MunitEclipseUpdater.launch();
String mainTypeName = verifyMainTypeName(configuration);
IVMRunner runner = getVMRunner(configuration, mode);
File workingDir = verifyWorkingDirectory(configuration);
String workingDirName = null;
if (workingDir != null)
{
workingDirName = workingDir.getAbsolutePath();
}
String[] envp = getEnvironment(configuration);
ArrayList vmArguments = new ArrayList();
ArrayList programArguments = new ArrayList();
programArguments.add("-resource");
programArguments.add(configuration.getAttribute("resource", ""));
programArguments.add("-path");
programArguments.add(configuration.getAttribute("Mpath", ""));
programArguments.add("-port");
programArguments.add(String.valueOf(MunitEclipseUpdater.getInstance().getPort()));
// VM-specific attributes
Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
for (int i = 0; i < entries.length; i++)
{
IClasspathEntry entry = entries[i];
if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE)
{
IPath path = entry.getPath();
IFolder sourceFolder = root.getFolder(path);
if (!sourceFolder.getLocation().toString().contains("test/munit"))
{
try
{
IFolder folder = root.getFolder(entry.getOutputLocation());
for (IResource resource : folder.members())
{
try
{
resource.copy(munitOutputFolder, IFolder.SHALLOW, monitor);
}
catch (Throwable e)
{
}
}
}
catch (Throwable y)
{
}
}
}
}
String[] classpath = getClasspath(configuration);
// ClasspathgetC
List<String> classPathAsList = new ArrayList<String>(Arrays.asList(classpath));
try
{
URL[] urlClasspath = new ClasspathProvider().getClassPath(getJavaProject(configuration));
for (URL url : urlClasspath)
{
classPathAsList.add(url.getFile());
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
// Create VM config
VMRunnerConfiguration runConfig = new VMRunnerConfiguration("org.mule.munit.runner.remote.MunitRemoteRunner", classPathAsList.toArray(new String[] {}));
runConfig.setVMArguments((String[]) vmArguments.toArray(new String[vmArguments.size()]));
runConfig.setProgramArguments((String[]) programArguments.toArray(new String[programArguments.size()]));
runConfig.setEnvironment(envp);
runConfig.setWorkingDirectory(workingDirName);
runConfig.setVMSpecificAttributesMap(vmAttributesMap);
// Bootpath
runConfig.setBootClassPath(getBootpath(configuration));
// check for cancellation
if (monitor.isCanceled())
{
return;
}
// done the verification phase
monitor.worked(1);
setDefaultSourceLocator(launch, configuration);
monitor.worked(1);
runner.run(runConfig, launch, monitor);
if (monitor.isCanceled())
{
return;