use of com.intellij.idea.Bombed in project intellij-community by JetBrains.
the class InvalidProjectImportingTest method testUnresolvedPlugins.
@Bombed(user = "Vladislav.Soroka", year = 2020, month = Calendar.APRIL, day = 1, description = "temporary disabled")
public void testUnresolvedPlugins() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<build>" + " <plugins>" + " <plugin>" + " <groupId>xxx</groupId>" + " <artifactId>yyy</artifactId>" + " <version>1</version>" + " </plugin>" + " </plugins>" + "</build>");
MavenProject root = getRootProjects().get(0);
assertProblems(root, "Unresolved plugin: 'xxx:yyy:1'");
}
use of com.intellij.idea.Bombed in project intellij-community by JetBrains.
the class InvalidProjectImportingTest method testUnresolvedExtensionsAfterResolve.
@Bombed(user = "Vladislav.Soroka", year = 2020, month = Calendar.APRIL, day = 1, description = "temporary disabled")
public void testUnresolvedExtensionsAfterResolve() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<build>" + " <extensions>" + " <extension>" + " <groupId>xxx</groupId>" + " <artifactId>yyy</artifactId>" + " <version>1</version>" + " </extension>" + " </extensions>" + "</build>");
resolveDependenciesAndImport();
MavenProject root = getRootProjects().get(0);
assertProblems(root, "Unresolved build extension: 'xxx:yyy:1'");
}
use of com.intellij.idea.Bombed in project intellij-community by JetBrains.
the class InvalidProjectImportingTest method testUnresolvedPomTypeDependency.
@Bombed(user = "Vladislav.Soroka", year = 2020, month = Calendar.APRIL, day = 1, description = "temporary disabled")
public void testUnresolvedPomTypeDependency() throws Exception {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<dependencies>" + " <dependency>" + " <groupId>xxx</groupId>" + " <artifactId>yyy</artifactId>" + " <version>4.0</version>" + " <type>pom</type>" + " </dependency>" + "</dependencies>");
importProject();
assertModuleLibDeps("project");
MavenProject root = getRootProjects().get(0);
assertProblems(root, "Unresolved dependency: 'xxx:yyy:pom:4.0'");
}
use of com.intellij.idea.Bombed in project intellij-community by JetBrains.
the class InvalidProjectImportingTest method testUnresolvedPluginsAsExtensions.
@Bombed(user = "Vladislav.Soroka", year = 2020, month = Calendar.APRIL, day = 1, description = "temporary disabled")
public void testUnresolvedPluginsAsExtensions() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<build>" + " <plugins>" + " <plugin>" + " <groupId>xxx</groupId>" + " <artifactId>yyy</artifactId>" + " <version>1</version>" + " <extensions>true</extensions>" + " </plugin>" + " </plugins>" + "</build>");
assertModules("project");
MavenProject root = getRootProjects().get(0);
assertProblems(root, "Unresolved plugin: 'xxx:yyy:1'");
}
use of com.intellij.idea.Bombed in project intellij-community by JetBrains.
the class TestAll method getTest.
@Nullable
private static Test getTest(@NotNull final Class<?> testCaseClass) {
try {
if ((testCaseClass.getModifiers() & Modifier.PUBLIC) == 0) {
return null;
}
Bombed classBomb = testCaseClass.getAnnotation(Bombed.class);
if (classBomb != null && PlatformTestUtil.bombExplodes(classBomb)) {
return new ExplodedBomb(testCaseClass.getName(), classBomb);
}
Method suiteMethod = safeFindMethod(testCaseClass, "suite");
if (suiteMethod != null && !isPerformanceTestsRun()) {
return (Test) suiteMethod.invoke(null, ArrayUtil.EMPTY_CLASS_ARRAY);
}
if (TestRunnerUtil.isJUnit4TestClass(testCaseClass)) {
JUnit4TestAdapter adapter = new JUnit4TestAdapter(testCaseClass);
boolean runEverything = isIncludingPerformanceTestsRun() || isPerformanceTest(null, testCaseClass) && isPerformanceTestsRun();
if (!runEverything) {
try {
adapter.filter(isPerformanceTestsRun() ? PERFORMANCE_ONLY : NO_PERFORMANCE);
} catch (NoTestsRemainException ignored) {
}
}
return adapter;
}
final int[] testsCount = { 0 };
TestSuite suite = new TestSuite(testCaseClass) {
@Override
public void addTest(Test test) {
if (!(test instanceof TestCase)) {
doAddTest(test);
} else {
String name = ((TestCase) test).getName();
// Mute TestSuite's "no tests found" warning
if ("warning".equals(name))
return;
if (!isIncludingPerformanceTestsRun() && (isPerformanceTestsRun() ^ isPerformanceTest(name, testCaseClass)))
return;
Method method = findTestMethod((TestCase) test);
if (method == null) {
doAddTest(test);
} else {
Bombed methodBomb = method.getAnnotation(Bombed.class);
if (methodBomb == null) {
doAddTest(test);
} else if (PlatformTestUtil.bombExplodes(methodBomb)) {
doAddTest(new ExplodedBomb(method.getDeclaringClass().getName() + "." + method.getName(), methodBomb));
}
}
}
}
private void doAddTest(Test test) {
testsCount[0]++;
super.addTest(test);
}
@Nullable
private Method findTestMethod(final TestCase testCase) {
return safeFindMethod(testCase.getClass(), testCase.getName());
}
};
return testsCount[0] > 0 ? suite : null;
} catch (Throwable t) {
System.err.println("Failed to load test: " + testCaseClass.getName());
t.printStackTrace(System.err);
return null;
}
}
Aggregations