protected void addClasspath(Collection<Container> path) throws Exception { for (Container c : Container.flatten(path)) { addClasspath(c); } }
public int start(ClassLoader parent) throws Exception { prepare(); for (String path : getClasspath()) { cp.add(new File(path).toURI() .toURL()); URLClassLoader cl = new URLClassLoader(cp.toArray(new URL[0]), fcl); String[] args = getRunProgramArgs().toArray(new String[0]); Class<?> main = cl.loadClass(getMainTypeName()); return invoke(main, args);
public String getVMArguments(ILaunchConfiguration c) { return Processor.join(launcher.getRunVM(), " "); }
public int launch() throws Exception { prepare(); java = new Command(); Map<String, String> env = getRunEnv(); for (Map.Entry<String, String> e : env.entrySet()) { java.var(e.getKey(), e.getValue()); java.add(project.getProperty("java", getJavaExecutable())); String javaagent = project.getProperty(Constants.JAVAAGENT); if (Processor.isTrue(javaagent)) { String jdb = getRunJdb(); if (jdb != null) { int port = 1044; java.addAll(split(System.getenv("JAVA_OPTS"), "\\s+")); java.add(Processor.join(getClasspath(), File.pathSeparator)); java.addAll(getRunVM()); java.add(getMainTypeName()); java.addAll(getRunProgramArgs()); if (timeout != 0) java.setTimeout(timeout + 1000, TimeUnit.MILLISECONDS); File cwd = getCwd(); if (cwd != null) java.setCwd(cwd); if (result == Integer.MIN_VALUE)
public int launch() throws Exception { prepare(); java = new Command(); java.add(project.getProperty("java", "java")); java.add("-cp"); java.add(Processor.join(getClasspath(), File.pathSeparator)); java.addAll(getRunVM()); java.add(getMainTypeName()); java.addAll(getArguments()); if (timeout != 0) java.setTimeout(timeout + 1000, TimeUnit.MILLISECONDS); File cwd = getCwd(); if (cwd != null) java.setCwd(cwd); try { int result = java.execute(System.in, System.err, System.err); if (result == Integer.MIN_VALUE) return TIMEDOUT; reportResult(result); return result; } finally { cleanup(); } }
public int launch() throws Exception { prepare(); java = new Command(); java.add(project.getProperty("java", "java")); java.add("-cp"); java.add(Processor.join(getClasspath(), File.pathSeparator)); java.addAll(getRunVM()); java.add(getMainTypeName()); java.addAll(getArguments()); if (timeout != 0) java.setTimeout(timeout + 1000, TimeUnit.MILLISECONDS); int result = java.execute(System.in, System.out, System.err); if (result == Integer.MIN_VALUE) return TIMEDOUT; reportResult(result); return result; }
setCwd(project.getBase()); runsystempackages = new Parameters(project.mergeProperties(Constants.RUNSYSTEMPACKAGES), project); runsystemcapabilities = new Parameters(project.mergeProperties(Constants.RUNSYSTEMCAPABILITIES), project); framework = getRunframework(project.getProperty(Constants.RUNFRAMEWORK)); addClasspath(c); setKeep(project.getRunKeep());
public ProjectTester(Project project) throws Exception { this.project = project; launcher = project.getProjectLauncher(); launcher.setCwd(project.getBase()); launcher.addRunVM("-ea"); testbundles = project.getTestpath(); continuous = project.is(Constants.TESTCONTINUOUS); for (Container c : testbundles) { launcher.addClasspath(c); } reportDir = new File(project.getTarget(), project.getProperty("test-reports", "test-reports")); }
runbundles.add(file.getAbsolutePath()); } else { error("Bundle file \"%s\" does not exist, given error is %s", file, container.getError()); runsystempackages = new Parameters( project.mergeProperties(Constants.RUNSYSTEMPACKAGES)); runsystemcapabilities = project.mergeProperties(Constants.RUNSYSTEMCAPABILITIES); framework = getRunframework(project.getProperty(Constants.RUNFRAMEWORK)); addClasspath(c);
runbundles.add(file.getAbsolutePath()); } else { warning("Bundle file \"%s\" does not exist", file.getAbsolutePath()); framework = getRunframework(project.getProperty(Constants.RUNFRAMEWORK)); trace = Processor.isTrue(project.getProperty(Constants.RUNTRACE)); addClasspath(c);
public ProjectLauncher(Project project) throws Exception { this.project = project; updateFromProject(); }
programArguments.addAll(launcher.getArguments()); vmArguments.addAll(launcher.getRunVM());
public String[] getClasspath(ILaunchConfiguration configuration) { return launcher.getClasspath().toArray(new String[0]); } }
public String verifyMainTypeName(ILaunchConfiguration configuration) throws CoreException { return launcher.getMainTypeName(); }
public int launch() throws Exception { prepare(); java = new Command(); Map<String, String> env = getRunEnv(); for (Map.Entry<String, String> e : env.entrySet()) { java.var(e.getKey(), e.getValue()); java.add(project.getProperty("java", getJavaExecutable())); String javaagent = project.getProperty(Constants.JAVAAGENT); if (Processor.isTrue(javaagent)) { String jdb = getRunJdb(); if (jdb != null) { int port = 1044; java.addAll(split(System.getenv("JAVA_OPTS"), "\\s+")); java.add(Processor.join(getClasspath(), File.pathSeparator)); java.addAll(getRunVM()); java.add(getMainTypeName()); java.addAll(getRunProgramArgs()); if (timeout != 0) java.setTimeout(timeout + 1000, TimeUnit.MILLISECONDS); File cwd = getCwd(); if (cwd != null) java.setCwd(cwd); if (result == Integer.MIN_VALUE)
setCwd(project.getBase()); runsystempackages = new Parameters(project.mergeProperties(Constants.RUNSYSTEMPACKAGES), project); runsystemcapabilities = new Parameters(project.mergeProperties(Constants.RUNSYSTEMCAPABILITIES), project); framework = getRunframework(project.getProperty(Constants.RUNFRAMEWORK)); addClasspath(c); setKeep(project.getRunKeep());