vmassol 2002/10/19 16:37:57
Modified: Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui
CactusMessages.properties
Eclipse-Plugin/src/java/org/apache/cactus/eclipse/launcher
CactusLaunchConfiguration.java
Log:
First start at creating cactus classpath. Not tested yet (still trying to figure out
how to automate testing for an eclipse plugin and how to make a build process ....)
Revision Changes Path
1.2 +2 -0
jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusMessages.properties
Index: CactusMessages.properties
===================================================================
RCS file:
/home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusMessages.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CactusMessages.properties 19 Oct 2002 09:57:03 -0000 1.1
+++ CactusMessages.properties 19 Oct 2002 23:37:57 -0000 1.2
@@ -3,3 +3,5 @@
#
# Version $Id$
# ---------------------------------------------------------------------------
+
+cactus.error.cannotfindjar = Cannot find required jar
\ No newline at end of file
1.16 +40 -2
jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/launcher/CactusLaunchConfiguration.java
Index: CactusLaunchConfiguration.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/launcher/CactusLaunchConfiguration.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- CactusLaunchConfiguration.java 19 Oct 2002 15:32:00 -0000 1.15
+++ CactusLaunchConfiguration.java 19 Oct 2002 23:37:57 -0000 1.16
@@ -56,10 +56,17 @@
*/
package org.apache.cactus.eclipse.launcher;
+import java.net.URL;
+import java.util.Vector;
+
+import org.apache.cactus.eclipse.ui.CactusMessages;
+import org.apache.cactus.eclipse.ui.CactusPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.internal.junit.launcher.JUnitLaunchConfiguration;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
/**
@@ -110,8 +117,7 @@
theConfiguration, theTestTypes, thePort, theRunMode);
// Compute new classpath : JUnit CP + Cactus CP
- // TODO: Add Cactus specific jars to the classpath here
- String[] cactusClasspath = {};
+ String[] cactusClasspath = getCactusClientJars();
String[] classpath = concatenateStringArrays(
junitVmConfig.getClassPath(), cactusClasspath);
@@ -139,6 +145,38 @@
return cactusVmConfig;
}
+ /**
+ * @return the cactus related jars that must be in the Cactus client side
+ * classpath
* @exception CoreException on critical failures
+ */
+ private String[] getCactusClientJars() throws CoreException
+ {
+ Vector cactusJars = new Vector();
+
+ // Base URL pointing to our plugin directory
+ URL baseUrl =
+ CactusPlugin.getDefault().getDescriptor().getInstallURL();
+
+ try
+ {
+ cactusJars.add(Platform.asLocalURL(new URL(baseUrl,
+ "cactus.jar")).getFile());
+ cactusJars.add(Platform.asLocalURL(new URL(baseUrl,
+ "aspectjrt.jar")).getFile());
+ cactusJars.add(Platform.asLocalURL(new URL(baseUrl,
+ "junit.jar")).getFile());
+ cactusJars.add(Platform.asLocalURL(new URL(baseUrl,
+ "commons-httpclient.jar")).getFile());
+ }
+ catch (Exception e)
+ {
+ abort(CactusMessages.getString("cactus.error.cannotfindjar"), e,
+ IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ }
+
+ return (String[]) cactusJars.toArray();
+ }
+
/**
* Concatenate two string arrays.
*
* @param theArray1 the first array
* @param theArray2 the second
array
* @return a string array containing the first array followed by the second
--
To unsubscribe, e-mail: <mailto:cactus-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-dev-help@;jakarta.apache.org>