use of com.intellij.cyclicDependencies.CyclicDependenciesBuilder in project intellij-community by JetBrains.
the class CyclicDependenciesTest method testPackageScope2.
public void testPackageScope2() {
//com.b<->com.a - find
//com.c<->com.d - not in scope
final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(myProject, new JavaAnalysisScope(JavaPsiFacade.getInstance(myPsiManager.getProject()).findPackage("com.subscope1"), null));
builder.analyze();
final HashMap<PsiPackage, Set<List<PsiPackage>>> cyclicDependencies = builder.getCyclicDependencies();
HashMap<String, String[][]> expected = new HashMap<>();
expected.put("com.subscope1.b", new String[][] { { "com.subscope1.a", "com.subscope1.b" } });
expected.put("com.subscope1.a", new String[][] { { "com.subscope1.b", "com.subscope1.a" } });
checkResult(expected, cyclicDependencies);
}
use of com.intellij.cyclicDependencies.CyclicDependenciesBuilder in project intellij-community by JetBrains.
the class CyclicDependenciesTest method testT3.
public void testT3() {
//com.b<->com.d
//com.b->com.a->com.c->com.b
final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(myProject, new AnalysisScope(myProject));
builder.analyze();
final HashMap<PsiPackage, Set<List<PsiPackage>>> cyclicDependencies = builder.getCyclicDependencies();
HashMap<String, String[][]> expected = new HashMap<>();
expected.put("com.b", new String[][] { { "com.c", "com.a", "com.b" }, { "com.d", "com.b" } });
expected.put("com.d", new String[][] { { "com.b", "com.d" } });
expected.put("com.c", new String[][] { { "com.a", "com.b", "com.c" } });
expected.put("com.a", new String[][] { { "com.b", "com.c", "com.a" } });
checkResult(expected, cyclicDependencies, true);
}
use of com.intellij.cyclicDependencies.CyclicDependenciesBuilder in project intellij-community by JetBrains.
the class CyclicDependenciesTest method testPackageScope1.
public void testPackageScope1() {
// com.a<->com.b
final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(myProject, new JavaAnalysisScope(JavaPsiFacade.getInstance(myPsiManager.getProject()).findPackage("com"), null));
builder.analyze();
final HashMap<PsiPackage, Set<List<PsiPackage>>> cyclicDependencies = builder.getCyclicDependencies();
HashMap<String, String[][]> expected = new HashMap<>();
expected.put("com.b", new String[][] { { "com.a", "com.b" } });
expected.put("com.a", new String[][] { { "com.b", "com.a" } });
checkResult(expected, cyclicDependencies);
}
use of com.intellij.cyclicDependencies.CyclicDependenciesBuilder in project intellij-community by JetBrains.
the class CyclicDependenciesTest method testT5.
public void testT5() {
//com.b<->com.d
//com.b->com.a->com.c->com.b
final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(myProject, new AnalysisScope(myProject));
builder.analyze();
final HashMap<PsiPackage, Set<List<PsiPackage>>> cyclicDependencies = builder.getCyclicDependencies();
HashMap<String, String[][]> expected = new HashMap<>();
expected.put("com.b", new String[][] { { "com.d", "com.b" }, { "com.c", "com.a", "com.b" } });
expected.put("com.d", new String[][] { { "com.b", "com.d" } });
expected.put("com.c", new String[][] { { "com.a", "com.b", "com.c" } });
expected.put("com.a", new String[][] { { "com.b", "com.c", "com.a" } });
checkResult(expected, cyclicDependencies, true);
}
use of com.intellij.cyclicDependencies.CyclicDependenciesBuilder in project intellij-community by JetBrains.
the class CyclicDependenciesHandler method analyze.
public void analyze() {
final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(myProject, myScope);
final Runnable process = () -> builder.analyze();
final Runnable successRunnable = () -> SwingUtilities.invokeLater(() -> {
CyclicDependenciesPanel panel = new CyclicDependenciesPanel(myProject, builder);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, AnalysisScopeBundle.message("action.analyzing.cyclic.dependencies.in.scope", builder.getScope().getDisplayName()), false);
content.setDisposer(panel);
panel.setContent(content);
DependenciesToolWindow.getInstance(myProject).addContent(content);
});
ProgressManager.getInstance().runProcessWithProgressAsynchronously(myProject, AnalysisScopeBundle.message("package.dependencies.progress.title"), process, successRunnable, null, new PerformAnalysisInBackgroundOption(myProject));
}
Aggregations