jruaux 2002/10/18 09:03:32
Modified: Eclipse-Plugin/src/java/org/apache/cactus/eclipse/launcher
CactusLaunchConfiguration.java
Log:
used code conventions
Revision Changes Path
1.5 +42 -33
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CactusLaunchConfiguration.java 18 Oct 2002 16:02:40 -0000 1.4
+++ CactusLaunchConfiguration.java 18 Oct 2002 16:03:32 -0000 1.5
@@ -86,29 +86,31 @@
import org.eclipse.jdt.launching.sourcelookup.JavaSourceLocator;
/**
- * This class contains the configuration for the VM that will actually launch
- * the cactus tests.
+ *
+ * This class contains the configuration for the VM that will actually launch the
cactus tests.
*
* @version $Id$
* @author <a href="mailto:jruaux@;octo.com">Julien Ruaux</a>
- * @author <a href="mailto:vmassol@;apache.org">Vincent Massol</a>
*/
public class CactusLaunchConfiguration extends JUnitLaunchConfiguration
{
- public static final String ID_CACTUS_APPLICATION =
+
+ public static final String ID_CACTUS_APPLICATION =
"org.apache.cactus.eclipse.launchconfig";
/**
* @see
org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(ILaunchConfiguration,
String, ILaunch, IProgressMonitor)
*/
- public void launch(ILaunchConfiguration Configuration, String Mode,
+ public void launch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor pm) throws CoreException
{
IJavaProject javaProject = getJavaProject(configuration);
if ((javaProject == null) || !javaProject.exists())
{
- abort(JUnitMessages.getString(
- "JUnitBaseLaunchConfiguration.error.invalidproject"), null,
+ abort(
+ JUnitMessages.getString(
+ "JUnitBaseLaunchConfiguration.error.invalidproject"),
+ null,
IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT);
}
@@ -116,12 +118,14 @@
IVMInstallType type = getVMInstallType(configuration);
IVMInstall install = getVMInstall(configuration);
IVMRunner runner = install.getVMRunner(mode);
-
if (runner == null)
{
- abort(MessageFormat.format(JUnitMessages.getString(
- "JUnitBaseLaunchConfiguration.error.novmrunner"),
- new String[] { install.getId()}), null,
+ abort(
+ MessageFormat.format(
+ JUnitMessages.getString(
+ "JUnitBaseLaunchConfiguration.error.novmrunner"),
+ new String[] { install.getId()}),
+ null,
IJavaLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST);
}
@@ -183,36 +187,40 @@
* @see
org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration#createVMRunner(ILaunchConfiguration,
IType[], int, String)
*/
protected VMRunnerConfiguration createVMRunner(
- ILaunchConfiguration configuration, IType[] testTypes, int port,
- String runMode) throws CoreException
+ ILaunchConfiguration configuration,
+ IType[] testTypes,
+ int port,
+ String runMode)
+ throws CoreException
{
String[] classPath = createClassPath(configuration, testTypes[0]);
- VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(
- "org.eclipse.jdt.internal.junit.runner.RemoteTestRunner",
- classPath);
+ VMRunnerConfiguration vmConfig =
+ new VMRunnerConfiguration(
+ "org.eclipse.jdt.internal.junit.runner.RemoteTestRunner",
+ classPath);
Vector argv = new Vector(10);
argv.add("-port");
argv.add(Integer.toString(port));
+ //argv("-debugging");
argv.add("-classNames");
- if (keepAlive(configuration)
+ if (keepAlive(configuration)
&& runMode.equals(ILaunchManager.DEBUG_MODE))
{
argv.add(0, "-keepalive");
}
-
+
for (int i = 0; i < testTypes.length; i++)
{
argv.add(testTypes[i].getFullyQualifiedName());
}
-
+
String[] args = new String[argv.size()];
argv.copyInto(args);
vmConfig.setProgramArguments(args);
- // We set a VM argument related to the Cactus framework (QQQ : get
- // this from the plugin preference page).
+ // We set a VM argument related to the Cactus framework (QQQ : get this
from the plugin preference page)
String[] vmArgs = { "-Dcactus.contextURL=http://localhost:8081/test" };
vmConfig.setVMArguments(vmArgs);
return vmConfig;
@@ -225,8 +233,10 @@
* @return String[]
* @throws CoreException
*/
- private String[] createClassPath(ILaunchConfiguration configuration,
- IType type) throws CoreException
+ private String[] createClassPath(
+ ILaunchConfiguration configuration,
+ IType type)
+ throws CoreException
{
URL url = JUnitPlugin.getDefault().getDescriptor().getInstallURL();
String[] cp = getClasspath(configuration);
@@ -239,20 +249,19 @@
if (inDevelopmentMode)
{
// assumption is that the output folder is called bin!
- classPath[0] = Platform.asLocalURL(
- new URL(url, "bin")).getFile();
- }
- else
+ classPath[0] =
+ Platform.asLocalURL(new URL(url, "bin")).getFile();
+ } else
{
- classPath[0] = Platform.asLocalURL(
- new URL(url, "junitsupport.jar")).getFile();
+ classPath[0] =
+ Platform
+ .asLocalURL(new URL(url, "junitsupport.jar"))
+ .getFile();
}
- }
- catch (MalformedURLException e)
+ } catch (MalformedURLException e)
{
JUnitPlugin.log(e); // TO DO abort run and inform user
- }
- catch (IOException e)
+ } catch (IOException e)
{
JUnitPlugin.log(e); // TO DO abort run and inform user
}
--
To unsubscribe, e-mail: <mailto:cactus-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-dev-help@;jakarta.apache.org>