use of com.intellij.execution.junit2.ui.properties.JUnitConsoleProperties in project intellij-community by JetBrains.
the class JUnitOpenSourceAtExceptionTest method testStackTraceParseerAcceptsJavaStacktrace.
public void testStackTraceParseerAcceptsJavaStacktrace() throws Exception {
myFixture.addClass("abstract class ATest extends junit.framework.TestCase {" + " public void testMe() {\n" + " int i = 0;\n" + " int j = 0;\n" + " int k = 0;\n" + " fail();\n" + " }\n" + "}");
myFixture.addClass("public class ChildTest extends ATest {}");
final SMTestProxy testProxy = new SMTestProxy("testMe", false, "java:test://ChildTest.testMe");
testProxy.setTestFailed("failure", "\tat junit.framework.Assert.fail(Assert.java:57)\n" + "\tat junit.framework.Assert.failNotEquals(Assert.java:329)\n" + "\tat junit.framework.Assert.assertEquals(Assert.java:78)\n" + "\tat junit.framework.Assert.assertEquals(Assert.java:234)\n" + "\tat junit.framework.Assert.assertEquals(Assert.java:241)\n" + "\tat junit.framework.TestCase.assertEquals(TestCase.java:409)\n" + "\tat ATest.testMe(Dummy.java:6)\n", true);
final Project project = getProject();
final GlobalSearchScope searchScope = GlobalSearchScope.projectScope(project);
testProxy.setLocator(JavaTestLocator.INSTANCE);
final Location location = testProxy.getLocation(project, searchScope);
assertNotNull(location);
assertInstanceOf(location, MethodLocation.class);
final JUnitConfiguration configuration = new JUnitConfiguration("p", getProject(), JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);
final Navigatable descriptor = testProxy.getDescriptor(location, new JUnitConsoleProperties(configuration, DefaultRunExecutor.getRunExecutorInstance()));
assertInstanceOf(descriptor, OpenFileDescriptor.class);
final OpenFileDescriptor fileDescriptor = (OpenFileDescriptor) descriptor;
final VirtualFile file = fileDescriptor.getFile();
assertNotNull(file);
assertEquals(5, fileDescriptor.getLine());
}
Aggregations