// Path: java/collabode/testing/TestSupportInitializer.java
// public class TestSupportInitializer extends ClasspathContainerInitializer {
//     
//     public static final String PACKAGE = "collabode";
//     
//     public static final List<String> STATUSES = Arrays.asList(new String[] { "New", "NeedsImpl", "NeedsReview", "Accepted" });
//     
//     public static final IPath PATH = new Path("collabode.TEST_SUPPORT_CONTAINER");
//     
//     public static String weaverPath() throws IOException {
//         return Application.bundleResourcePath("lib/aspectjweaver.jar");
//     }
//     
//     private final String annotationsPath;
//     private final String coveragePath;
//     
//     public TestSupportInitializer() throws IOException {
//         annotationsPath = Application.bundleResourcePath("inject-bin");
//         coveragePath = Application.bundleResourcePath("lib/jacto.jar");
//     }
// 
//     public void initialize(final IPath containerPath, IJavaProject project) throws CoreException {
//         final IClasspathEntry[] entries = {
//                 JavaCore.newLibraryEntry(new Path(annotationsPath), null, null),
//                 JavaCore.newLibraryEntry(new Path(coveragePath), null, null)
//         };
//         IClasspathContainer[] container = {
//                 new IClasspathContainer() {
//                     public IClasspathEntry[] getClasspathEntries() {
//                         return entries;
//                     }
//                     public String getDescription() {
//                         return "Collabode Test Support";
//                     }
//                     public int getKind() {
//                         return IClasspathContainer.K_APPLICATION;
//                     }
//                     public IPath getPath() {
//                         return containerPath;
//                     }
//                 }
//         };
//         JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, container, null);
//     }
// }


import java.io.ByteArrayInputStream;
import java.util.*;
import net.appjet.ajstdlib.execution;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.junit.JUnitCore;
import org.eclipse.jdt.launching.JavaRuntime;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import collabode.testing.TestSupportInitializer;
        return dest;
    }
    
    public static ILaunchConfiguration accessLaunchConfig(IFile file) {
        return DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(file);
    }
    
    private static void addJavaNature(IProject project) throws CoreException {
        IProjectDescription description = project.getDescription();
        String[] prevNatures = description.getNatureIds();
        String[] newNatures = new String[prevNatures.length + 1];
        System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
        newNatures[prevNatures.length] = JavaCore.NATURE_ID;
        description.setNatureIds(newNatures);
        project.setDescription(description, null);
    }

    private static void setupJavaClasspath(IProject project, boolean testDriven) throws CoreException {
        IFolder srcFolder = project.getFolder("src");
        srcFolder.create(true, true, null);
        IFolder binFolder = project.getFolder("bin");
        if ( ! binFolder.exists()) {
            binFolder.create(true, true, null);
        }
        IJavaProject javaProject = JavaCore.create(project);
        javaProject.setOutputLocation(binFolder.getFullPath(), null);
        
        List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
        entries.add(JavaRuntime.getDefaultJREContainerEntry());
        entries.add(JavaCore.newContainerEntry(JUnitCore.JUNIT4_CONTAINER_PATH));
// Path: java/collabode/testing/TestSupportInitializer.java
// public class TestSupportInitializer extends ClasspathContainerInitializer {
//     
//     public static final String PACKAGE = "collabode";
//     
//     public static final List<String> STATUSES = Arrays.asList(new String[] { "New", "NeedsImpl", "NeedsReview", "Accepted" });
//     
//     public static final IPath PATH = new Path("collabode.TEST_SUPPORT_CONTAINER");
//     
//     public static String weaverPath() throws IOException {
//         return Application.bundleResourcePath("lib/aspectjweaver.jar");
//     }
//     
//     private final String annotationsPath;
//     private final String coveragePath;
//     
//     public TestSupportInitializer() throws IOException {
//         annotationsPath = Application.bundleResourcePath("inject-bin");
//         coveragePath = Application.bundleResourcePath("lib/jacto.jar");
//     }
// 
//     public void initialize(final IPath containerPath, IJavaProject project) throws CoreException {
//         final IClasspathEntry[] entries = {
//                 JavaCore.newLibraryEntry(new Path(annotationsPath), null, null),
//                 JavaCore.newLibraryEntry(new Path(coveragePath), null, null)
//         };
//         IClasspathContainer[] container = {
//                 new IClasspathContainer() {
//                     public IClasspathEntry[] getClasspathEntries() {
//                         return entries;
//                     }
//                     public String getDescription() {
//                         return "Collabode Test Support";
//                     }
//                     public int getKind() {
//                         return IClasspathContainer.K_APPLICATION;
//                     }
//                     public IPath getPath() {
//                         return containerPath;
//                     }
//                 }
//         };
//         JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, container, null);
//     }
// }


// Path: java/collabode/Workspace.java
import java.io.ByteArrayInputStream;
import java.util.*;
import net.appjet.ajstdlib.execution;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.junit.JUnitCore;
import org.eclipse.jdt.launching.JavaRuntime;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import collabode.testing.TestSupportInitializer;

        return dest;
    }
    
    public static ILaunchConfiguration accessLaunchConfig(IFile file) {
        return DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(file);
    }
    
    private static void addJavaNature(IProject project) throws CoreException {
        IProjectDescription description = project.getDescription();
        String[] prevNatures = description.getNatureIds();
        String[] newNatures = new String[prevNatures.length + 1];
        System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
        newNatures[prevNatures.length] = JavaCore.NATURE_ID;
        description.setNatureIds(newNatures);
        project.setDescription(description, null);
    }

    private static void setupJavaClasspath(IProject project, boolean testDriven) throws CoreException {
        IFolder srcFolder = project.getFolder("src");
        srcFolder.create(true, true, null);
        IFolder binFolder = project.getFolder("bin");
        if ( ! binFolder.exists()) {
            binFolder.create(true, true, null);
        }
        IJavaProject javaProject = JavaCore.create(project);
        javaProject.setOutputLocation(binFolder.getFullPath(), null);
        
        List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
        entries.add(JavaRuntime.getDefaultJREContainerEntry());
        entries.add(JavaCore.newContainerEntry(JUnitCore.JUNIT4_CONTAINER_PATH));
        if (testDriven) { entries.add(JavaCore.newContainerEntry(TestSupportInitializer.PATH)); }