Example usage for org.eclipse.jdt.internal.core JavaModelManager getClasspathContainer

List of usage examples for org.eclipse.jdt.internal.core JavaModelManager getClasspathContainer

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core JavaModelManager getClasspathContainer.

Prototype

public IClasspathContainer getClasspathContainer(final IPath containerPath, final IJavaProject project)
            throws JavaModelException 

Source Link

Usage

From source file:org.codehaus.groovy.eclipse.core.ClasspathContainerTest.java

License:Apache License

public void testClassPathContainerContents() throws JavaModelException {

    JavaModelManager javaModelManager = JavaModelManager.getJavaModelManager();
    IPath containerPath = new Path("GROOVY_SUPPORT");
    IClasspathContainer container = javaModelManager.getClasspathContainer(containerPath,
            testProject.getJavaProject());

    IClasspathEntry[] entries = container.getClasspathEntries();

    List<IClasspathEntry> groovyAllEntries = getGroovyAllEntries(entries);
    List<IClasspathEntry> nonPluginEntries = getNonPluginEntries(entries);

    assertEquals("classpath container class", GroovyClasspathContainer.class, container.getClass());
    assertEquals("Mutiple groovy-all found in the Groovy classpath container: " + groovyAllEntries, 1,
            groovyAllEntries.size());//from w  ww.j  av  a  2s  .co m
    assertEquals("Unexpected entries found in the Groovy classpath container: " + nonPluginEntries, 0,
            nonPluginEntries.size());
}