From dd0163d2dc5b383ce192fa1589d728879d5c5ac3 Mon Sep 17 00:00:00 2001 From: offa Date: Sat, 8 Oct 2016 16:14:55 +0200 Subject: [PATCH] Deprecated APIs and Tests removed (fixes #16). --- .../cnd/unittest/api/CndTestCase.java | 16 ------ .../unittest/ui/GoToCallstackNodeAction.java | 9 +--- .../cpputest/CppUTestErrorHandlerTest.java | 8 --- .../cpputest/CppUTestTestHandlerTest.java | 29 ---------- .../cpputest/CppUTestTimeHandlerTest.java | 8 --- .../GoogleTestSessionFinishedHandlerTest.java | 14 ----- .../GoogleTestSuiteFinishedHandlerTest.java | 14 ----- .../GoogleTestSuiteStartedHandlerTest.java | 14 ----- .../GoogleTestTestFinishedHandlerTest.java | 54 ------------------- .../GoogleTestTestStartedHandlerTest.java | 7 --- ...LibunittestCppTestFinishedHandlerTest.java | 7 --- 11 files changed, 1 insertion(+), 179 deletions(-) diff --git a/src/main/java/bv/offa/netbeans/cnd/unittest/api/CndTestCase.java b/src/main/java/bv/offa/netbeans/cnd/unittest/api/CndTestCase.java index db5a05d..69396c0 100644 --- a/src/main/java/bv/offa/netbeans/cnd/unittest/api/CndTestCase.java +++ b/src/main/java/bv/offa/netbeans/cnd/unittest/api/CndTestCase.java @@ -70,22 +70,6 @@ public void setError() trouble.setError(true); setTrouble(trouble); } - - - /** - * Sets the Test as failed. - * - * @param stackTrace Stacktrace of the failure - * @deprecated Replaced by {@link #setError(String, int)} - */ - @Deprecated - public void setError(String stackTrace[]) - { - Trouble trouble = new Trouble(true); - trouble.setStackTrace(stackTrace); - setTrouble(trouble); - } - /** diff --git a/src/main/java/bv/offa/netbeans/cnd/unittest/ui/GoToCallstackNodeAction.java b/src/main/java/bv/offa/netbeans/cnd/unittest/ui/GoToCallstackNodeAction.java index 1232ed0..b5470e8 100644 --- a/src/main/java/bv/offa/netbeans/cnd/unittest/ui/GoToCallstackNodeAction.java +++ b/src/main/java/bv/offa/netbeans/cnd/unittest/ui/GoToCallstackNodeAction.java @@ -36,14 +36,7 @@ public class GoToCallstackNodeAction extends AbstractTestNodeAction private static final long serialVersionUID = 1L; private final CndTestCase testCase; - /** @deprecated Obsolete - will be removed */ - @Deprecated - public GoToCallstackNodeAction(String actionName, String frameInfo) - { - super(actionName, null); - this.testCase = null; - } - + public GoToCallstackNodeAction(String actionName, CndTestCase testCase, Project project) { super(actionName, project); diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestErrorHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestErrorHandlerTest.java index e905c7e..09d7aa3 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestErrorHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestErrorHandlerTest.java @@ -54,14 +54,6 @@ public void setUp() } - @Deprecated - @Test - public void matchesErrorLocationLine() - { - assertTrue(handler.matches("test/TestSuite.cpp:37: error: Failure " - + "in TEST(TestSuite, testCase)")); - } - @Test public void parsesDataErrorLocationLine() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTestHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTestHandlerTest.java index 5c87465..cfa4eb9 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTestHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTestHandlerTest.java @@ -83,28 +83,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesTestCaseStr() - { - assertTrue(handler.matches("TEST(TestSuite, testCase) - 8 ms")); - } - - @Deprecated - @Test - public void matchesTestCaseIgnored() - { - assertTrue(handler.matches("IGNORE_TEST(TestSuite, testCase) - 7 ms")); - } - - @Deprecated - @Test - public void matchesTestCaseAndDetectsNotIgnored() - { - Matcher m = checkedMatch(handler, "TEST(TestSuite, testCase) - 8 ms"); - assertNull(m.group(1)); - } - @Test public void matchesTestCaseAndDetectsIgnored() { @@ -122,13 +100,6 @@ public void parsesDataTestCase() assertEquals("84", m.group(5)); } - @Deprecated - @Test - public void matchesDataTestCaseWhichFailed() - { - assertTrue(handler.matches("TEST(TestSuite, testThatFailed)")); - } - @Test public void parsesDataTestCaseWhichFailed() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTimeHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTimeHandlerTest.java index 43b2ee2..f7edaed 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTimeHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/cpputest/CppUTestTimeHandlerTest.java @@ -50,14 +50,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesTime() - { - assertTrue(handler.matches(" - 0 ms")); - assertTrue(handler.matches(" - 123 ms")); - } - @Test public void parsesDataTime() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSessionFinishedHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSessionFinishedHandlerTest.java index 2fdfafd..0602aab 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSessionFinishedHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSessionFinishedHandlerTest.java @@ -61,13 +61,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesTestSessionResult() - { - assertTrue(handler.matches("[==========] 1200 tests from 307 test cases ran. (1234 ms total)")); - } - @Test public void parseDataTestSession() { @@ -75,13 +68,6 @@ public void parseDataTestSession() assertEquals("1234", m.group(1)); } - @Deprecated - @Test - public void matchesSingleTests() - { - assertTrue(handler.matches("[==========] 1 test from 1 test case ran. (3 ms total)")); - } - @Test public void parseDataSingleTests() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteFinishedHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteFinishedHandlerTest.java index db8cafa..e67e989 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteFinishedHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteFinishedHandlerTest.java @@ -44,13 +44,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesSuccessfulTestSuite() - { - assertTrue(handler.matches("[----------] 3 tests from TestSuite (259 ms total)")); - } - @Test public void parseDataSuccessfulTestSuite() { @@ -59,13 +52,6 @@ public void parseDataSuccessfulTestSuite() assertEquals("259", m.group(2)); } - @Deprecated - @Test - public void matchesSingleTestSuite() - { - assertTrue(handler.matches("[----------] 1 test from TestSuite (123 ms total)")); - } - @Test public void parseDataSingleTestSuite() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteStartedHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteStartedHandlerTest.java index dc78668..5aa6bea 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteStartedHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteStartedHandlerTest.java @@ -74,13 +74,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesTestSuiteStr() - { - assertTrue(handler.matches("[----------] 5 tests from TestSuite")); - } - @Test public void parseDataTestSuite() { @@ -95,13 +88,6 @@ public void parseDataTestSuiteParameterized() assertEquals("withParameterImpl/TestSuite", m.group(1)); } - @Deprecated - @Test - public void matchesSingleTestSuiteParameterized() - { - assertTrue(handler.matches("[----------] 1 test from TestSuite")); - } - @Test public void parseDataSingleTestSuite() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestFinishedHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestFinishedHandlerTest.java index d9723e0..96d2e69 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestFinishedHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestFinishedHandlerTest.java @@ -61,20 +61,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesSuccessfulTestCase() - { - assertTrue(handler.matches("[ OK ] TestSuite.testCase (0 ms)")); - } - - @Deprecated - @Test - public void matchesFailedTestCase() - { - assertTrue(handler.matches("[ FAILED ] TestSuite.testCase (45 ms)")); - } - @Test public void rejectsUnknownTestCaseResult() { @@ -123,46 +109,6 @@ public void parseDataFailedTestCase() assertEquals("45", m.group(4)); } - @Deprecated - @Test - public void updateUIThrowsIfNoTest() - { - checkedMatch(handler, "[ OK ] TestSuite.testCase (0 ms)"); - exception.expect(IllegalStateException.class); - handler.updateUI((Manager) null, session); - } - - @Deprecated - @Test - public void updateUIThrownsIfNotMatchingTestCase() - { - checkedMatch(handler, "[ OK ] withParameterImpl/" - + "TestSuite.withParameter/0 (0 ms)"); - createCurrentTestCase("TestSuite", "testCase", FRAMEWORK, session); - exception.expect(IllegalStateException.class); - handler.updateUI((Manager) null, session); - } - - @Deprecated - @Test - public void updateUIIgnoresNotMatchingTestSuite() - { - checkedMatch(handler, "[ OK ] TestSuite.testCase (0 ms)"); - createCurrentTestCase("WrongTestSuite", "testCase", FRAMEWORK, session); - exception.expect(IllegalStateException.class); - handler.updateUI((Manager) null, session); - } - - @Deprecated - @Test - public void updateUIDoesNothingIfSuccessful() - { - checkedMatch(handler, "[ OK ] TestSuite.testCase (0 ms)"); - CndTestCase testCase = createCurrentTestCase("TestSuite", "testCase", FRAMEWORK, session); - handler.updateUI((Manager) null, session); - assertNull(testCase.getTrouble()); - } - @Test public void updateUISetsTroubleIfFailed() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestStartedHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestStartedHandlerTest.java index 273d201..114f803 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestStartedHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestTestStartedHandlerTest.java @@ -49,13 +49,6 @@ public void setUp() manager = mock(ManagerAdapter.class); } - @Deprecated - @Test - public void matchesTestCaseStr() - { - assertTrue(handler.matches("[ RUN ] TestSuite.testCase")); - } - @Test public void parseDataTestCase() { diff --git a/src/test/java/bv/offa/netbeans/cnd/unittest/libunittestcpp/LibunittestCppTestFinishedHandlerTest.java b/src/test/java/bv/offa/netbeans/cnd/unittest/libunittestcpp/LibunittestCppTestFinishedHandlerTest.java index ff146c0..5a97f6b 100644 --- a/src/test/java/bv/offa/netbeans/cnd/unittest/libunittestcpp/LibunittestCppTestFinishedHandlerTest.java +++ b/src/test/java/bv/offa/netbeans/cnd/unittest/libunittestcpp/LibunittestCppTestFinishedHandlerTest.java @@ -113,13 +113,6 @@ public void parseDataFailedTest() assertEquals("FAIL", m.group(4)); } - @Deprecated - @Test - public void matchesIgnoredTestCase() - { - assertTrue(handler.matches("TestSuite::testExample::test ... [0s] SKIP A message")); - } - @Test public void parseDataIgnoredTestCase() {