/** * Tests that changing a directive to x-internal on an exported package causes the workspace api * baseline to be updated */ public void testWPUPdateExportPackageDirectiveChangedToInternal() throws Exception { IJavaProject project = getTestingProject(); assertNotNull("The testing project must exist", project); // add package assertTestPackage( project, new Path(project.getElementName()).append(ProjectUtils.SRC_FOLDER).makeAbsolute(), "export1"); // export the package ProjectUtils.addExportedPackage(project.getProject(), "export1", true, null); // check the description IApiAnnotations annot = getTestProjectApiDescription().resolveAnnotations(Factory.packageDescriptor("export1")); assertNotNull("there must be an annotation for the new exported package", annot); assertTrue( "the changed exported package must be PRIVATE visibility", annot.getVisibility() == VisibilityModifiers.PRIVATE); }
/** * sets the given package name to be an Exported-Package * * @param name */ private void setPackageToApi(IJavaProject project, String name) throws CoreException { ProjectUtils.addExportedPackage(project.getProject(), name, false, null); }