Ejemplo n.º 1
0
  public void testSourceOnSourcepath_ignored() throws Exception {
    NBSource source = createSampleSource();
    assertTrue(
        PathUtil.getInstance()
            .sourceOnSourcepath(
                IDEController.getInstance().getActiveProjectFromIDE(), source.getFileObject()));

    setIgnoredOnSourcepath((NBSource) source.getParent());
    assertFalse(
        PathUtil.getInstance()
            .sourceOnSourcepath(
                IDEController.getInstance().getActiveProjectFromIDE(), source.getFileObject()));
  }
Ejemplo n.º 2
0
 public Project getProject(Object ideProject) {
   Object key = getIdeProjects().getKeyByValue(ideProject);
   Project project = (Project) getProjects().getValueByKey(key);
   if (project == null) {
     project = IDEController.getInstance().createNewProject(ideProject);
     getProjects().put(key, project);
   }
   return project;
 }
Ejemplo n.º 3
0
  public void testSourceOnSourcepath_notOnPath_localSource() throws Exception {
    NBSource source = createSampleSource();
    setSourcepathRoot(getRoot().mkdir("some_other_sourcepath_root").getFileOrNull());

    assertFalse(
        PathUtil.getInstance()
            .sourceOnSourcepath(
                IDEController.getInstance().getActiveProjectFromIDE(), source.getFileObject()));
  }
Ejemplo n.º 4
0
  public static Test suite() throws Exception {
    final TestSuite suite = new TestSuite("Refactorings");

    suite.addTest(WhereUsedTest.suite());
    suite.addTest(SearchFilter.Tests.suite());
    if (!IDEController.runningNetBeans()) {
      suite.addTest(NotUsedTest.suite());
    }
    if (!IDEController.runningNetBeans()) {
      suite.addTest(FixmeScannerTest.suite());
    }
    if (!IDEController.runningNetBeans()) {
      suite.addTest(FixmeScannerMultiplePackagesTest.suite());
    }
    if (!IDEController.runningNetBeans()) {
      suite.addTest(FixmeTimestampTest.suite());
    }
    if (!IDEController.runningNetBeans()) {
      suite.addTest(net.sf.refactorit.test.metrics.AllTests.suite());
    }
    suite.addTest(DependenciesIndexer.TestDriver.suite());
    suite.addTest(MoveTypeTest.suite());
    suite.addTest(ExtractMethodTest.suite());
    suite.addTest(SnapshotDiff.SelfTest.suite());
    if (!IDEController.runningNetBeans()) {
      suite.addTest(ExtractSuperTest.suite());
    }
    suite.addTest(net.sf.refactorit.test.refactorings.rename.AllTests.suite());
    suite.addTest(net.sf.refactorit.test.refactorings.javadoc.AllTests.suite());
    suite.addTest(EncapsulateFieldTest.suite());
    if (!IDEController.runningNetBeans()) {
      suite.addTest(net.sf.refactorit.test.refactorings.structure.AllTests.suite());
    }
    suite.addTest(MinimizeAccessRightsTest.suite());
    suite.addTest(MoveMemberTest.suite());
    suite.addTest(UndoManagerTest.suite());
    suite.addTest(AddDelegatesTest.suite());
    suite.addTest(OverrideMethodsTest.suite());
    suite.addTest(ChangeMethodSignatureTest.suite());
    suite.addTestSuite(DigraphTopologicalSorterTest.class);
    suite.addTest(net.sf.refactorit.test.refactorings.usesupertype.AllTests.suite());
    suite.addTest(SnapshotBuilderTest.suite());
    suite.addTest(EjbUtilTest.suite());
    suite.addTest(FactoryMethodTest.suite());
    suite.addTest(CleanImportsTest.suite());
    suite.addTest(CreateMissingMethodTest.suite());
    suite.addTest(CallTreeTest.suite());
    suite.addTest(net.sf.refactorit.test.refactorings.inlinevariable.AllTests.suite());
    suite.addTest(net.sf.refactorit.test.refactorings.promotetemptofield.AllTests.suite());
    suite.addTest(net.sf.refactorit.test.refactorings.introducetemp.AllTests.suite());
    suite.addTest(net.sf.refactorit.test.refactorings.nonjava.AllTests.suite());
    suite.addTest(InlineMethodTest.suite());
    suite.addTest(WhereCaughtTest.suite());
    suite.addTest(CleanRebuildDialogTest.suite());
    suite.addTest(ImportUtilsTest.suite());
    return suite;
  }
Ejemplo n.º 5
0
 public BidirectionalMap getIdeProjects() {
   Object[] ideProjects = JBController.getProjectsFromIDE();
   BidirectionalMap projects = new BidirectionalMap(ideProjects.length, 1f);
   for (int i = 0; i < ideProjects.length; i++) {
     Object project = ideProjects[i];
     projects.put(
         IDEController.getInstance().getWorkspaceManager().getIdeProjectIdentifier(project),
         project);
   }
   return projects;
 }