mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SMTestSender -> JUnit4TestListener
This commit is contained in:
+4
-4
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.execution.junit;
|
||||
|
||||
import com.intellij.junit4.SMTestSender;
|
||||
import com.intellij.junit4.JUnit4TestListener;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -170,7 +170,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
|
||||
private static void doTest(Description root, List<Description> tests, String expectedTree, String expectedStart) throws Exception {
|
||||
final StringBuffer buf = new StringBuffer();
|
||||
final SMTestSender sender = new SMTestSender(new PrintStream(new OutputStream() {
|
||||
final JUnit4TestListener sender = new JUnit4TestListener(new PrintStream(new OutputStream() {
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
buf.append(new String(new byte[]{(byte)b}));
|
||||
@@ -300,7 +300,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
|
||||
private static void doTest(Description description, String expected) {
|
||||
final StringBuffer buf = new StringBuffer();
|
||||
new SMTestSender(new PrintStream(new OutputStream() {
|
||||
new JUnit4TestListener(new PrintStream(new OutputStream() {
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
buf.append(new String(new byte[]{(byte)b}));
|
||||
@@ -313,7 +313,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
@Test
|
||||
public void testProcessEmptyTestCase() throws Exception {
|
||||
final Description description = Description.createSuiteDescription("TestA");
|
||||
final Description emptyDescription = Description.createTestDescription(SMTestSender.EMPTY_SUITE_NAME, SMTestSender.EMPTY_SUITE_WARNING);
|
||||
final Description emptyDescription = Description.createTestDescription(JUnit4TestListener.EMPTY_SUITE_NAME, JUnit4TestListener.EMPTY_SUITE_WARNING);
|
||||
description.addChild(emptyDescription);
|
||||
doTest(description, Collections.singletonList(emptyDescription),
|
||||
"##teamcity[suiteTreeNode name='warning' locationHint='java:test://TestA.warning']\n",
|
||||
|
||||
@@ -52,9 +52,9 @@ public class JUnit4IdeaTestRunner implements IdeaTestRunner {
|
||||
description = getFilteredDescription(request, description);
|
||||
}
|
||||
|
||||
if (myTestsListener instanceof SMTestSender) {
|
||||
if (myTestsListener instanceof JUnit4TestListener) {
|
||||
if (sendTree) {
|
||||
((SMTestSender)myTestsListener).sendTree(description);
|
||||
((JUnit4TestListener)myTestsListener).sendTree(description);
|
||||
}
|
||||
sendTree = false;
|
||||
} else {
|
||||
@@ -189,7 +189,7 @@ public class JUnit4IdeaTestRunner implements IdeaTestRunner {
|
||||
|
||||
public void setStreams(Object segmentedOut, Object segmentedErr, int lastIdx) {
|
||||
if (JUnitStarter.SM_RUNNER) {
|
||||
myTestsListener = new SMTestSender();
|
||||
myTestsListener = new JUnit4TestListener();
|
||||
} else {
|
||||
myRegistry = new JUnit4OutputObjectRegistry((PacketProcessor)segmentedOut, lastIdx);
|
||||
myTestsListener = new JUnit4TestResultsSender(myRegistry);
|
||||
|
||||
+3
-3
@@ -36,7 +36,7 @@ import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.*;
|
||||
|
||||
public class SMTestSender extends RunListener {
|
||||
public class JUnit4TestListener extends RunListener {
|
||||
private static final String MESSAGE_LENGTH_FOR_PATTERN_MATCHING = "idea.junit.message.length.threshold";
|
||||
private static final String JUNIT_FRAMEWORK_COMPARISON_NAME = ComparisonFailure.class.getName();
|
||||
private static final String ORG_JUNIT_COMPARISON_NAME = "org.junit.ComparisonFailure";
|
||||
@@ -48,11 +48,11 @@ public class SMTestSender extends RunListener {
|
||||
private final PrintStream myPrintStream;
|
||||
private String myRootName;
|
||||
|
||||
public SMTestSender() {
|
||||
public JUnit4TestListener() {
|
||||
myPrintStream = System.out;
|
||||
}
|
||||
|
||||
public SMTestSender(PrintStream printStream) {
|
||||
public JUnit4TestListener(PrintStream printStream) {
|
||||
myPrintStream = printStream;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class JUnit4TestResultsSender extends RunListener {
|
||||
private static final String JUNIT_FRAMEWORK_COMPARISON_NAME = ComparisonFailure.class.getName();
|
||||
@@ -108,7 +106,7 @@ public class JUnit4TestResultsSender extends RunListener {
|
||||
|
||||
private static PacketFactory createExceptionNotification(Throwable assertion) {
|
||||
if (assertion instanceof KnownException) return ((KnownException)assertion).getPacketFactory();
|
||||
final ComparisonFailureData notification = SMTestSender.createExceptionNotification(assertion);
|
||||
final ComparisonFailureData notification = JUnit4TestListener.createExceptionNotification(assertion);
|
||||
if (notification != null) {
|
||||
return ComparisonDetailsExtractor.create(assertion, notification.getExpected(), notification.getActual());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user