mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java sm runner: normalize line breaks
This commit is contained in:
+5
-24
@@ -64,9 +64,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
|
||||
|
||||
"##teamcity[enteredTheMatrix]\n" +
|
||||
"\n" +
|
||||
"##teamcity[rootName name = 'root']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='root']\n" +
|
||||
"##teamcity[testSuiteStarted name ='TestA']\n" +
|
||||
"##teamcity[testSuiteStarted name ='|[0|]']\n" +
|
||||
@@ -91,9 +89,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='testName|[1|]']\n" +
|
||||
"##teamcity[testSuiteFinished name='|[1|]']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='TestB']\n" +
|
||||
"\n");
|
||||
"##teamcity[testSuiteFinished name='TestB']\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -112,9 +108,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
"##teamcity[suiteTreeEnded name='|[1|]']\n",
|
||||
//start
|
||||
"##teamcity[enteredTheMatrix]\n" +
|
||||
"\n" +
|
||||
"##teamcity[rootName name = 'TestA' comment = 'a']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteStarted name ='|[0|]']\n" +
|
||||
"##teamcity[testStarted name='testName|[0|]' locationHint='java:test://a.TestA.testName|[0|]']\n" +
|
||||
"\n" +
|
||||
@@ -125,9 +119,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='testName|[1|]']\n" +
|
||||
"##teamcity[testSuiteFinished name='|[1|]']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='TestA']\n" +
|
||||
"\n");
|
||||
"##teamcity[testSuiteFinished name='TestA']\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -161,9 +153,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
|
||||
//started
|
||||
"##teamcity[enteredTheMatrix]\n" +
|
||||
"\n" +
|
||||
"##teamcity[rootName name = 'root']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='root']\n" +
|
||||
"##teamcity[testSuiteStarted name ='ASuite1']\n" +
|
||||
"##teamcity[testSuiteStarted name ='ATest']\n" +
|
||||
@@ -178,9 +168,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='test1']\n" +
|
||||
"##teamcity[testSuiteFinished name='ATest']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='ASuite2']\n" +
|
||||
"\n");
|
||||
"##teamcity[testSuiteFinished name='ASuite2']\n");
|
||||
}
|
||||
|
||||
private static void doTest(Description root, List<Description> tests, String expectedTree, String expectedStart) throws Exception {
|
||||
@@ -244,9 +232,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
|
||||
//start
|
||||
"##teamcity[enteredTheMatrix]\n" +
|
||||
"\n" +
|
||||
"##teamcity[rootName name = 'root']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='root']\n" +
|
||||
"##teamcity[testSuiteStarted name ='ATest']\n" +
|
||||
"##teamcity[testSuiteStarted name ='|[0|]']\n" +
|
||||
@@ -266,9 +252,7 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='test']\n" +
|
||||
"##teamcity[testSuiteFinished name='ATest']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testSuiteFinished name='suite']\n" +
|
||||
"\n");
|
||||
"##teamcity[testSuiteFinished name='suite']\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -304,13 +288,10 @@ public class JUnitTreeByDescriptionHierarchyTest {
|
||||
|
||||
|
||||
"##teamcity[enteredTheMatrix]\n" +
|
||||
"\n" +
|
||||
"##teamcity[rootName name = 'TestA']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='warning' locationHint='java:test://junit.framework.TestSuite$1.warning']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='warning']\n" +
|
||||
"##teamcity[testSuiteFinished name='TestA']\n" +
|
||||
"\n");
|
||||
"##teamcity[testSuiteFinished name='TestA']\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SMTestSender extends RunListener {
|
||||
}
|
||||
|
||||
public void testRunStarted(Description description) throws Exception {
|
||||
myPrintStream.println("##teamcity[enteredTheMatrix]\n");
|
||||
myPrintStream.println("##teamcity[enteredTheMatrix]");
|
||||
if (myCurrentClassName != null && !myCurrentClassName.startsWith("[")) {
|
||||
int lastPointIdx = myCurrentClassName.lastIndexOf('.');
|
||||
String name = myCurrentClassName;
|
||||
@@ -73,20 +73,20 @@ public class SMTestSender extends RunListener {
|
||||
|
||||
myPrintStream.println("##teamcity[rootName name = \'" + escapeName(name) +
|
||||
(comment != null ? ("\' comment = \'" + escapeName(comment)) : "") +
|
||||
"\']\n");
|
||||
"\']");
|
||||
myCurrentClassName = getShortName(myCurrentClassName);
|
||||
}
|
||||
}
|
||||
|
||||
public void testRunFinished(Result result) throws Exception {
|
||||
if (myParamName != null) {
|
||||
myPrintStream.println("##teamcity[testSuiteFinished name=\'" + escapeName(myParamName) + "\']\n");
|
||||
myPrintStream.println("##teamcity[testSuiteFinished name=\'" + escapeName(myParamName) + "\']");
|
||||
}
|
||||
if (myCurrentClassName != null) {
|
||||
myPrintStream.println("##teamcity[testSuiteFinished name=\'" + escapeName(myCurrentClassName) + "\']\n");
|
||||
myPrintStream.println("##teamcity[testSuiteFinished name=\'" + escapeName(myCurrentClassName) + "\']");
|
||||
}
|
||||
if (myCurrentSuiteName != null) {
|
||||
myPrintStream.println("##teamcity[testSuiteFinished name=\'" + escapeName(getShortName(myCurrentSuiteName)) + "\']\n");
|
||||
myPrintStream.println("##teamcity[testSuiteFinished name=\'" + escapeName(getShortName(myCurrentSuiteName)) + "\']");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -40,7 +40,9 @@ public class TestNGTreeHierarchyTest {
|
||||
test.getClasses().add(xmlClass);
|
||||
suite.getTests().add(test);
|
||||
|
||||
doTest(suite, "##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://a.ATest']\n" +
|
||||
doTest(suite, "\n" +
|
||||
"##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://a.ATest']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='test1' locationHint='java:test://a.ATest.test1']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='test1']\n");
|
||||
@@ -60,22 +62,29 @@ public class TestNGTreeHierarchyTest {
|
||||
}
|
||||
listener.onSuiteFinish(className);
|
||||
|
||||
Assert.assertEquals("output: " + buf, "##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://a.ATest']\n" +
|
||||
Assert.assertEquals("output: " + buf, "\n" +
|
||||
"##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://a.ATest']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='setUp' locationHint='java:test://a.ATest.setUp']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='setUp']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='test1' locationHint='java:test://a.ATest.test1']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='test1']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='tearDown' locationHint='java:test://a.ATest.tearDown']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='tearDown']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='setUp' locationHint='java:test://a.ATest.setUp']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='setUp']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='test2' locationHint='java:test://a.ATest.test2']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='test2']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testStarted name='tearDown' locationHint='java:test://a.ATest.tearDown']\n" +
|
||||
"\n" +
|
||||
"##teamcity[testFinished name='tearDown']\n" +
|
||||
|
||||
@@ -106,7 +106,7 @@ public class IDEATestNGRemoteListener implements ISuiteListener, IResultListener
|
||||
if (myCurrentClassName != null) {
|
||||
onSuiteFinish(myCurrentClassName);
|
||||
}
|
||||
myPrintStream.print("##teamcity[testSuiteStarted name =\'" + escapeName(provideLocation ? getShortName(suiteName) : suiteName));
|
||||
myPrintStream.print("\n##teamcity[testSuiteStarted name =\'" + escapeName(provideLocation ? getShortName(suiteName) : suiteName));
|
||||
if (provideLocation) {
|
||||
myPrintStream.print("\' locationHint = \'java:suite://" + suiteName);
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public class IDEATestNGRemoteListener implements ISuiteListener, IResultListener
|
||||
}
|
||||
|
||||
private void fireTestStarted(String methodName, String className) {
|
||||
myPrintStream.println("##teamcity[testStarted name=\'" + escapeName(methodName) +
|
||||
myPrintStream.println("\n##teamcity[testStarted name=\'" + escapeName(methodName) +
|
||||
"\' locationHint=\'java:test://" + escapeName(className + "." + methodName) + "\']");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user