List of usage examples for org.eclipse.jdt.core IJavaProject getPath
IPath getPath();
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
public void testBug374833() throws CoreException, IOException { IJavaProject pluginPrj = fileManager.setUpJavaProject("UnresolvedBasePlugin"); env.addProject(pluginPrj.getProject()); fullBuild();// www.j a va 2s . co m expectingOnlySpecificProblemsFor(pluginPrj.getPath(), new Problem[] { new Problem("", "Base plug-in Missing.Plugin cannot be resolved", pluginPrj.getPath().append("plugin.xml"), -1, -1, -1, IMarker.SEVERITY_ERROR) }); }
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
public void testAspectExport() throws CoreException, IOException { IJavaProject aeb = fileManager.setUpJavaProject("AspectExportBase"); env.addProject(aeb.getProject());/*from www . j ava2 s .c om*/ IJavaProject aea = fileManager.setUpJavaProject("AspectExportAspect"); aea.setOption("org.eclipse.objectteams.otdt.compiler.problem.binding_conventions", "error"); env.addProject(aea.getProject()); fullBuild(); expectingNoProblemsFor(aeb.getPath()); expectingOnlySpecificProblemsFor(aea.getPath(), new Problem[] { getMissingAspectExportProblem(aea, "aea") }); }
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
public void testBug419987() throws CoreException, IOException { IJavaProject aeb = fileManager.setUpJavaProject("Base419987"); env.addProject(aeb.getProject());//from w ww . j ava 2s . co m IJavaProject aea = fileManager.setUpJavaProject("Bug419987"); env.addProject(aea.getProject()); fullBuild(); expectingNoProblemsFor(aeb.getPath()); expectingNoProblemsFor(aea.getPath()); }
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
private Problem getDecapsulationProblem(IJavaProject project, String baseclassName, String teamPath, int start, int end) { return new Problem("", "Decapsulating base class " + baseclassName + " by means of a forced export. Note, that additionally a corresponing declaration is needed in config.ini (OTJLD 2.1.2(c) + OT/Equinox).", project.getPath().append(new Path("src/" + teamPath)), start, end, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_WARNING); }
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
private Problem getIllegalUseOfForcedExportProblem(IJavaProject project, String className, int start, int end) { return new Problem("", "The forced-exported type " + className + " cannot be accessed other than as a role's base class (OT/Equinox).", project.getPath().append(new Path("src/IllegalUseOfForcedExportTeam.java")), start, end, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR); }
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
private void expectAccessRestriction(IJavaProject project, String fileName, int start, int end) { expectingSpecificProblemFor(project.getPath(), new Problem("", "Access restriction: The type 'SampleAction' is not API (restriction on required project 'Trac18b')", project.getPath().append(new Path(fileName)), start, end, CategorizedProblem.CAT_RESTRICTION, IMarker.SEVERITY_ERROR));//from w w w . java2 s.c o m }
From source file:org.eclipse.objectteams.otdt.test.builder.OTEquinoxBuilderTests.java
License:Open Source License
private Problem getMissingAspectExportProblem(IJavaProject project, String packageName) { return new Problem("", "Package " + packageName + " containing one or more bound teams must be exported.", project.getPath().append(new Path("META-INF/MANIFEST.MF")), -1, -1, -1, IMarker.SEVERITY_ERROR); }
From source file:org.eclipse.pde.api.tools.util.tests.ProjectCreationTests.java
License:Open Source License
/** * Tests importing the java source for the Javadoc tag update tests */// w ww . jav a 2 s . c om public void testImportJavadocTestSource() { try { File dest = new File(JAVADOC_SRC_DIR); assertTrue("the source dir must exist", dest.exists()); //$NON-NLS-1$ assertTrue("the source dir must be a directory", dest.isDirectory()); //$NON-NLS-1$ IJavaProject project = getTestingJavaProject(TESTING_PROJECT_NAME); IPackageFragmentRoot srcroot = project.getPackageFragmentRoot(ProjectUtils.SRC_FOLDER); assertNotNull("the srcroot for the test java project must not be null", srcroot); //$NON-NLS-1$ FileUtils.importFilesFromDirectory(dest, project.getPath().append(srcroot.getPath()).append("javadoc"), //$NON-NLS-1$ new NullProgressMonitor()); // try to look up a file to test if it worked IType type = project.findType("javadoc.JavadocTestClass1", new NullProgressMonitor()); //$NON-NLS-1$ assertNotNull("the JavadocTestClass1 type should exist in the javadoc package", type); //$NON-NLS-1$ } catch (Exception e) { fail(e.getMessage()); } }
From source file:org.eclipse.pde.api.tools.util.tests.ProjectCreationTests.java
License:Open Source License
/** * Tests importing the java source for the javadoc tag reading tests *///from w w w. jav a 2s .c om public void testImportClassesTestSource() { try { File dest = new File(JAVADOC_READ_SRC_DIR); assertTrue("the source dir must exist", dest.exists()); //$NON-NLS-1$ assertTrue("the source dir must be a directory", dest.isDirectory()); //$NON-NLS-1$ IJavaProject project = getTestingJavaProject(TESTING_PROJECT_NAME); IPackageFragmentRoot srcroot = project.getPackageFragmentRoot(ProjectUtils.SRC_FOLDER); assertNotNull("the srcroot for the test java project must not be null", srcroot); //$NON-NLS-1$ FileUtils.importFilesFromDirectory(dest, project.getPath().append(srcroot.getPath()).append("a").append("b").append("c"), //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ new NullProgressMonitor()); } catch (Exception e) { fail(e.getMessage()); } }
From source file:org.eclipse.pde.internal.core.RequiredPluginsInitializer.java
License:Open Source License
@Override public Object getComparisonID(IPath containerPath, IJavaProject project) { if (containerPath == null || project == null) return null; return containerPath.segment(0) + "/" + project.getPath().segment(0); //$NON-NLS-1$ }