[P-unit-devel] SF.net SVN: p-unit: [195] trunk/punit.test/src/tests/api/org/punit
Status: Beta
Brought to you by:
zhanghuangzhu
|
From: <zha...@us...> - 2007-06-04 06:57:11
|
Revision: 195
http://p-unit.svn.sourceforge.net/p-unit/?rev=195&view=rev
Author: zhanghuangzhu
Date: 2007-06-03 23:57:12 -0700 (Sun, 03 Jun 2007)
Log Message:
-----------
Andrew Zhang: refactored name.
Modified Paths:
--------------
trunk/punit.test/src/tests/api/org/punit/all/AllTests.java
Added Paths:
-----------
trunk/punit.test/src/tests/api/org/punit/builder/suite/
trunk/punit.test/src/tests/api/org/punit/builder/suite/TestSuiteBuilderTest.java
trunk/punit.test/src/tests/api/org/punit/runner/AnnotationFilterTest.java
trunk/punit.test/src/tests/api/org/punit/runner/NameConventionFilterTest.java
trunk/punit.test/src/tests/api/org/punit/suite/
Removed Paths:
-------------
trunk/punit.test/src/tests/api/org/punit/method/AnnotationFilterTest.java
trunk/punit.test/src/tests/api/org/punit/method/NameConventionFilterTest.java
trunk/punit.test/src/tests/api/org/punit/method/builder/MethodBuilderTest.java
trunk/punit.test/src/tests/api/org/punit/method/builder/TestSuiteBuilderTest.java
Modified: trunk/punit.test/src/tests/api/org/punit/all/AllTests.java
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/all/AllTests.java 2007-06-04 06:52:38 UTC (rev 194)
+++ trunk/punit.test/src/tests/api/org/punit/all/AllTests.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -2,6 +2,7 @@
import junit.framework.*;
import tests.api.org.punit.assertion.*;
+import tests.api.org.punit.builder.suite.*;
import tests.api.org.punit.exception.*;
import tests.api.org.punit.method.*;
import tests.api.org.punit.method.builder.*;
@@ -36,7 +37,6 @@
ConcurrentExceptionTest.class,
LoggerUtilTest.class,
MemoryWatcherTest.class,
- MethodBuilderTest.class,
ConcurrentRunnerTest.class,
StreamLoggerTest.class,
ExecutorPoolTest.class,
Copied: trunk/punit.test/src/tests/api/org/punit/builder/suite/TestSuiteBuilderTest.java (from rev 194, trunk/punit.test/src/tests/api/org/punit/method/builder/TestSuiteBuilderTest.java)
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/builder/suite/TestSuiteBuilderTest.java (rev 0)
+++ trunk/punit.test/src/tests/api/org/punit/builder/suite/TestSuiteBuilderTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -0,0 +1,102 @@
+package tests.api.org.punit.builder.suite;
+
+import junit.framework.*;
+
+import org.punit.runner.*;
+import org.punit.suite.builder.*;
+
+import tests.api.org.punit.testclasses.*;
+import tests.util.*;
+
+public class TestSuiteBuilderTest extends TestCase {
+ private TestSuiteBuilderImpl _testSuiteBuidler;
+
+ protected void setUp() throws Exception {
+ _testSuiteBuidler = new TestSuiteBuilderImpl();
+ _testSuiteBuidler.setFilter(new NameConventionFilter());
+ }
+
+ public void testBuildExcludedTestClasses1() {
+ _testSuiteBuidler.setFilter(new AnnotationFilter());
+ Object[] classes = _testSuiteBuidler.buildTestClasses(ExcludedTestClass1.class);
+ AssertUtil.assertArray(classes, new Class[] { });
+ }
+
+ public void testBuildTestClasses1() {
+ Object[] classes = _testSuiteBuidler.buildTestClasses(TestClass1.class);
+ AssertUtil.assertArray(classes, new Class[] { TestClass1.class });
+ }
+
+ public void testBuildTestSuite1() {
+ Object[] classes = _testSuiteBuidler.buildTestClasses(TestSuite1.class);
+ Class[] expectedClasses = new Class[] { TestClass1.class,
+ TestClass2.class, TestClass3.class };
+
+ assertEquals(expectedClasses.length + 2, classes.length); // suite labels
+
+ TestSuiteLabel label = (TestSuiteLabel) classes[0];
+ assertSame(TestSuite1.class, label.suite().getClass());
+ assertTrue(label.isStart());
+
+ label = (TestSuiteLabel) classes[classes.length - 1];
+ assertSame(TestSuite1.class, label.suite().getClass());
+ assertFalse(label.isStart());
+
+ AssertUtil.assertArrayContains(classes, expectedClasses);
+ }
+
+ public void testBuildTestSuite2() {
+ Object[] classes = _testSuiteBuidler.buildTestClasses(TestSuite2.class);
+ Class[] expectedClasses = new Class[] { ExcludedTestClass1.class, TestClass4.class,
+ TestClass1.class, TestClass2.class, TestClass3.class, TestClass5.class };
+
+ assertEquals(expectedClasses.length + 4, classes.length); // suite labels
+
+ TestSuiteLabel label = (TestSuiteLabel) classes[0];
+ assertSame(TestSuite2.class, label.suite().getClass());
+ assertTrue(label.isStart());
+
+ label = (TestSuiteLabel) classes[classes.length - 1];
+ assertSame(TestSuite2.class, label.suite().getClass());
+ assertFalse(label.isStart());
+
+ label = (TestSuiteLabel) classes[3];
+ assertSame(TestSuite1.class, label.suite().getClass());
+ assertTrue(label.isStart());
+
+ label = (TestSuiteLabel) classes[7];
+ assertSame(TestSuite1.class, label.suite().getClass());
+ assertFalse(label.isStart());
+
+ AssertUtil.assertArrayContains(classes, expectedClasses);
+ }
+
+ public void testBuildTestSuite2ByAnnotationFilter() {
+ _testSuiteBuidler.setFilter(new AnnotationFilter());
+ Object[] classes = _testSuiteBuidler.buildTestClasses(TestSuite2.class);
+ Class[] expectedClasses = new Class[] { TestClass4.class,
+ TestClass1.class, TestClass2.class, TestClass3.class, TestClass5.class };
+
+ assertEquals(expectedClasses.length + 4, classes.length); // suite labels
+
+ TestSuiteLabel label = (TestSuiteLabel) classes[0];
+ assertSame(TestSuite2.class, label.suite().getClass());
+ assertTrue(label.isStart());
+
+ label = (TestSuiteLabel) classes[classes.length - 1];
+ assertSame(TestSuite2.class, label.suite().getClass());
+ assertFalse(label.isStart());
+
+ label = (TestSuiteLabel) classes[2];
+ assertSame(TestSuite1.class, label.suite().getClass());
+ assertTrue(label.isStart());
+
+ label = (TestSuiteLabel) classes[6];
+ assertSame(TestSuite1.class, label.suite().getClass());
+ assertFalse(label.isStart());
+
+ AssertUtil.assertArrayContains(classes, expectedClasses);
+ }
+
+
+}
Deleted: trunk/punit.test/src/tests/api/org/punit/method/AnnotationFilterTest.java
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/method/AnnotationFilterTest.java 2007-06-04 06:52:38 UTC (rev 194)
+++ trunk/punit.test/src/tests/api/org/punit/method/AnnotationFilterTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -1,97 +0,0 @@
-/* (C) Copyright 2007, by Andrew Zhang */
-
-package tests.api.org.punit.method;
-
-import java.lang.reflect.*;
-
-import junit.framework.*;
-
-import org.punit.annotation.Test;
-import org.punit.runner.*;
-import org.punit.util.*;
-
-public class AnnotationFilterTest extends TestCase {
- AnnotationFilter _filter = new AnnotationFilter();
-
- public void testIsExcluded() {
- assertTrue(_filter.isExcluded(ExcludedClass.class));
- assertFalse(_filter.isExcluded(NonExcludedClass.class));
- assertFalse(_filter.isExcluded(getClass()));
- }
-
- public void testIsTestMethod() {
- Method method;
- method = ReflectionUtil.getMethod(getClass(), "_test1", new Class[] {}); //$NON-NLS-1$
- assertFalse(_filter.isTestMethod(method));
-
- method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
- assertTrue(_filter.isTestMethod(method));
- }
-
- public void testGetCheckMethod() {
- Method method, checkMethod;
- method = ReflectionUtil.getMethod(getClass(), "_test1", new Class[] {}); //$NON-NLS-1$
- assertFalse(_filter.isTestMethod(method));
- checkMethod = _filter.getCheckMethod(method);
- assertNull(checkMethod);
-
- method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
- assertTrue(_filter.isTestMethod(method));
- checkMethod = _filter.getCheckMethod(method);
- assertEquals("checkTest2", checkMethod.getName()); //$NON-NLS-1$
-
- method = ReflectionUtil.getMethod(getClass(), "_test3", new Class[] {}); //$NON-NLS-1$
- assertTrue(_filter.isTestMethod(method));
- checkMethod = _filter.getCheckMethod(method);
- assertEquals("check__test3", checkMethod.getName()); //$NON-NLS-1$
- }
-
- public void testGetExpectedException() {
- Method method;
- Class exception;
-
- method = ReflectionUtil.getMethod(getClass(), "_test1", new Class[] {}); //$NON-NLS-1$
- exception = _filter.getExpectedException(method);
- assertNull(exception);
-
- method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
- exception = _filter.getExpectedException(method);
- assertSame(NullPointerException.class, exception);
-
- method = ReflectionUtil.getMethod(getClass(), "_test3", new Class[] {}); //$NON-NLS-1$
- exception = _filter.getExpectedException(method);
- assertNull(exception);
- }
-
- public void _test1() {
-
- }
-
- @Test(checkMethod="checkTest2", expected=NullPointerException.class)
- public void _test2() {
-
- }
-
- public void checkTest2() {
-
- }
-
- @Test
- public void _test3() {
-
- }
-
- public void check__test3() {
-
- }
-
- @Test(excluded = true)
- static class ExcludedClass {
-
- }
-
- @Test(excluded = false)
- static class NonExcludedClass {
-
- }
-}
Deleted: trunk/punit.test/src/tests/api/org/punit/method/NameConventionFilterTest.java
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/method/NameConventionFilterTest.java 2007-06-04 06:52:38 UTC (rev 194)
+++ trunk/punit.test/src/tests/api/org/punit/method/NameConventionFilterTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -1,55 +0,0 @@
-/* (C) Copyright 2007, by Andrew Zhang */
-
-package tests.api.org.punit.method;
-
-import java.lang.reflect.*;
-
-import junit.framework.*;
-
-import org.punit.runner.*;
-import org.punit.util.*;
-
-public class NameConventionFilterTest extends TestCase {
- AnnotationFilter _filter = new AnnotationFilter();
-
- public void testIsTestMethod() {
- Method method;
- method = ReflectionUtil.getMethod(getClass(), "test1", new Class[] {}); //$NON-NLS-1$
- assertTrue(_filter.isTestMethod(method));
-
- method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
- assertFalse(_filter.isTestMethod(method));
- }
-
- public void testGetCheckMethod() {
- Method method, checkMethod;
- method = ReflectionUtil.getMethod(getClass(), "test1", new Class[] {}); //$NON-NLS-1$
- checkMethod = _filter.getCheckMethod(method);
- assertNull(checkMethod);
-
- method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
- checkMethod = _filter.getCheckMethod(method);
- assertEquals("check__test2", checkMethod.getName()); //$NON-NLS-1$
- }
-
-
- public void test1() {
-
- }
-
- public void _test2() {
-
- }
-
- public void check__test2() {
-
- }
-
- public void _test3() {
-
- }
-
- public void check__test3() {
-
- }
-}
Deleted: trunk/punit.test/src/tests/api/org/punit/method/builder/MethodBuilderTest.java
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/method/builder/MethodBuilderTest.java 2007-06-04 06:52:38 UTC (rev 194)
+++ trunk/punit.test/src/tests/api/org/punit/method/builder/MethodBuilderTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -1,60 +0,0 @@
-/* (C) Copyright 2007, by Andrew Zhang */
-
-package tests.api.org.punit.method.builder;
-
-import junit.framework.*;
-
-import org.punit.method.builder.*;
-import org.punit.runner.*;
-
-import tests.api.org.punit.testclasses.*;
-import tests.util.*;
-
-public class MethodBuilderTest extends TestCase {
-
- private MethodBuilderImpl _builder;
-
- public void setUp() {
- _builder = new MethodBuilderImpl();
- _builder.setMethodFilter(new NameConventionFilter());
- }
-
- public void testAnnotationFilter() {
- _builder.setMethodFilter(new AnnotationFilter());
- Object[] methods = _builder.buildTestMethods(TestInterfaceImpl1.class)
- .toArray();
- String[] names = TestUtil.toMethodNameArray(methods);
- AssertUtil.assertArrayContent(names, new String[] { "method1" }); //$NON-NLS-1$
- }
-
- public void testBuildTestMethods1() {
- Object[] methods = _builder.buildTestMethods(TestClass1.class)
- .toArray();
- String[] names = TestUtil.toMethodNameArray(methods);
- AssertUtil.assertArrayContains(names, new String[] { "test1", "test2", //$NON-NLS-1$ //$NON-NLS-2$
- "testa", "testb" }); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testBuildTestMethods_SubClass() {
- Object[] methods = _builder.buildTestMethods(SubTestClass.class).toArray();
- String[] names = TestUtil.toMethodNameArray(methods);
- AssertUtil.assertArrayContains(names, new String[] { "test1", "test2", //$NON-NLS-1$ //$NON-NLS-2$
- "testa", "testb" }); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testBuildTestMethods2() {
- Object[] methods = _builder.buildTestMethods(TestClass2.class).toArray();
- String[] names = TestUtil.toMethodNameArray(methods);
- AssertUtil.assertArrayContent(names, new String[] { "test1", "test2", //$NON-NLS-1$ //$NON-NLS-2$
- "testa", "testb" }); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testBuildTestMethods3() {
- Object[] methods = _builder.buildTestMethods(TestClass3.class).toArray();
- String[] names = TestUtil.toMethodNameArray(methods);
- AssertUtil.assertArrayContent(names, new String[] {
- "test1", "test2", "testa", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "testb" }); //$NON-NLS-1$
- }
-
-}
Deleted: trunk/punit.test/src/tests/api/org/punit/method/builder/TestSuiteBuilderTest.java
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/method/builder/TestSuiteBuilderTest.java 2007-06-04 06:52:38 UTC (rev 194)
+++ trunk/punit.test/src/tests/api/org/punit/method/builder/TestSuiteBuilderTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -1,102 +0,0 @@
-package tests.api.org.punit.method.builder;
-
-import junit.framework.*;
-
-import org.punit.runner.*;
-import org.punit.suite.builder.*;
-
-import tests.api.org.punit.testclasses.*;
-import tests.util.*;
-
-public class TestSuiteBuilderTest extends TestCase {
- private TestSuiteBuilderImpl _testSuiteBuidler;
-
- protected void setUp() throws Exception {
- _testSuiteBuidler = new TestSuiteBuilderImpl();
- _testSuiteBuidler.setFilter(new NameConventionFilter());
- }
-
- public void testBuildExcludedTestClasses1() {
- _testSuiteBuidler.setFilter(new AnnotationFilter());
- Object[] classes = _testSuiteBuidler.buildTestClasses(ExcludedTestClass1.class);
- AssertUtil.assertArray(classes, new Class[] { });
- }
-
- public void testBuildTestClasses1() {
- Object[] classes = _testSuiteBuidler.buildTestClasses(TestClass1.class);
- AssertUtil.assertArray(classes, new Class[] { TestClass1.class });
- }
-
- public void testBuildTestSuite1() {
- Object[] classes = _testSuiteBuidler.buildTestClasses(TestSuite1.class);
- Class[] expectedClasses = new Class[] { TestClass1.class,
- TestClass2.class, TestClass3.class };
-
- assertEquals(expectedClasses.length + 2, classes.length); // suite labels
-
- TestSuiteLabel label = (TestSuiteLabel) classes[0];
- assertSame(TestSuite1.class, label.suite().getClass());
- assertTrue(label.isStart());
-
- label = (TestSuiteLabel) classes[classes.length - 1];
- assertSame(TestSuite1.class, label.suite().getClass());
- assertFalse(label.isStart());
-
- AssertUtil.assertArrayContains(classes, expectedClasses);
- }
-
- public void testBuildTestSuite2() {
- Object[] classes = _testSuiteBuidler.buildTestClasses(TestSuite2.class);
- Class[] expectedClasses = new Class[] { ExcludedTestClass1.class, TestClass4.class,
- TestClass1.class, TestClass2.class, TestClass3.class, TestClass5.class };
-
- assertEquals(expectedClasses.length + 4, classes.length); // suite labels
-
- TestSuiteLabel label = (TestSuiteLabel) classes[0];
- assertSame(TestSuite2.class, label.suite().getClass());
- assertTrue(label.isStart());
-
- label = (TestSuiteLabel) classes[classes.length - 1];
- assertSame(TestSuite2.class, label.suite().getClass());
- assertFalse(label.isStart());
-
- label = (TestSuiteLabel) classes[3];
- assertSame(TestSuite1.class, label.suite().getClass());
- assertTrue(label.isStart());
-
- label = (TestSuiteLabel) classes[7];
- assertSame(TestSuite1.class, label.suite().getClass());
- assertFalse(label.isStart());
-
- AssertUtil.assertArrayContains(classes, expectedClasses);
- }
-
- public void testBuildTestSuite2ByAnnotationFilter() {
- _testSuiteBuidler.setFilter(new AnnotationFilter());
- Object[] classes = _testSuiteBuidler.buildTestClasses(TestSuite2.class);
- Class[] expectedClasses = new Class[] { TestClass4.class,
- TestClass1.class, TestClass2.class, TestClass3.class, TestClass5.class };
-
- assertEquals(expectedClasses.length + 4, classes.length); // suite labels
-
- TestSuiteLabel label = (TestSuiteLabel) classes[0];
- assertSame(TestSuite2.class, label.suite().getClass());
- assertTrue(label.isStart());
-
- label = (TestSuiteLabel) classes[classes.length - 1];
- assertSame(TestSuite2.class, label.suite().getClass());
- assertFalse(label.isStart());
-
- label = (TestSuiteLabel) classes[2];
- assertSame(TestSuite1.class, label.suite().getClass());
- assertTrue(label.isStart());
-
- label = (TestSuiteLabel) classes[6];
- assertSame(TestSuite1.class, label.suite().getClass());
- assertFalse(label.isStart());
-
- AssertUtil.assertArrayContains(classes, expectedClasses);
- }
-
-
-}
Copied: trunk/punit.test/src/tests/api/org/punit/runner/AnnotationFilterTest.java (from rev 194, trunk/punit.test/src/tests/api/org/punit/method/AnnotationFilterTest.java)
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/runner/AnnotationFilterTest.java (rev 0)
+++ trunk/punit.test/src/tests/api/org/punit/runner/AnnotationFilterTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -0,0 +1,97 @@
+/* (C) Copyright 2007, by Andrew Zhang */
+
+package tests.api.org.punit.runner;
+
+import java.lang.reflect.*;
+
+import junit.framework.*;
+
+import org.punit.annotation.Test;
+import org.punit.runner.*;
+import org.punit.util.*;
+
+public class AnnotationFilterTest extends TestCase {
+ AnnotationFilter _filter = new AnnotationFilter();
+
+ public void testIsExcluded() {
+ assertTrue(_filter.isExcluded(ExcludedClass.class));
+ assertFalse(_filter.isExcluded(NonExcludedClass.class));
+ assertFalse(_filter.isExcluded(getClass()));
+ }
+
+ public void testIsTestMethod() {
+ Method method;
+ method = ReflectionUtil.getMethod(getClass(), "_test1", new Class[] {}); //$NON-NLS-1$
+ assertFalse(_filter.isTestMethod(method));
+
+ method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
+ assertTrue(_filter.isTestMethod(method));
+ }
+
+ public void testGetCheckMethod() {
+ Method method, checkMethod;
+ method = ReflectionUtil.getMethod(getClass(), "_test1", new Class[] {}); //$NON-NLS-1$
+ assertFalse(_filter.isTestMethod(method));
+ checkMethod = _filter.getCheckMethod(method);
+ assertNull(checkMethod);
+
+ method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
+ assertTrue(_filter.isTestMethod(method));
+ checkMethod = _filter.getCheckMethod(method);
+ assertEquals("checkTest2", checkMethod.getName()); //$NON-NLS-1$
+
+ method = ReflectionUtil.getMethod(getClass(), "_test3", new Class[] {}); //$NON-NLS-1$
+ assertTrue(_filter.isTestMethod(method));
+ checkMethod = _filter.getCheckMethod(method);
+ assertEquals("check__test3", checkMethod.getName()); //$NON-NLS-1$
+ }
+
+ public void testGetExpectedException() {
+ Method method;
+ Class exception;
+
+ method = ReflectionUtil.getMethod(getClass(), "_test1", new Class[] {}); //$NON-NLS-1$
+ exception = _filter.getExpectedException(method);
+ assertNull(exception);
+
+ method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
+ exception = _filter.getExpectedException(method);
+ assertSame(NullPointerException.class, exception);
+
+ method = ReflectionUtil.getMethod(getClass(), "_test3", new Class[] {}); //$NON-NLS-1$
+ exception = _filter.getExpectedException(method);
+ assertNull(exception);
+ }
+
+ public void _test1() {
+
+ }
+
+ @Test(checkMethod="checkTest2", expected=NullPointerException.class)
+ public void _test2() {
+
+ }
+
+ public void checkTest2() {
+
+ }
+
+ @Test
+ public void _test3() {
+
+ }
+
+ public void check__test3() {
+
+ }
+
+ @Test(excluded = true)
+ static class ExcludedClass {
+
+ }
+
+ @Test(excluded = false)
+ static class NonExcludedClass {
+
+ }
+}
Copied: trunk/punit.test/src/tests/api/org/punit/runner/NameConventionFilterTest.java (from rev 194, trunk/punit.test/src/tests/api/org/punit/method/NameConventionFilterTest.java)
===================================================================
--- trunk/punit.test/src/tests/api/org/punit/runner/NameConventionFilterTest.java (rev 0)
+++ trunk/punit.test/src/tests/api/org/punit/runner/NameConventionFilterTest.java 2007-06-04 06:57:12 UTC (rev 195)
@@ -0,0 +1,55 @@
+/* (C) Copyright 2007, by Andrew Zhang */
+
+package tests.api.org.punit.runner;
+
+import java.lang.reflect.*;
+
+import junit.framework.*;
+
+import org.punit.runner.*;
+import org.punit.util.*;
+
+public class NameConventionFilterTest extends TestCase {
+ AnnotationFilter _filter = new AnnotationFilter();
+
+ public void testIsTestMethod() {
+ Method method;
+ method = ReflectionUtil.getMethod(getClass(), "test1", new Class[] {}); //$NON-NLS-1$
+ assertTrue(_filter.isTestMethod(method));
+
+ method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
+ assertFalse(_filter.isTestMethod(method));
+ }
+
+ public void testGetCheckMethod() {
+ Method method, checkMethod;
+ method = ReflectionUtil.getMethod(getClass(), "test1", new Class[] {}); //$NON-NLS-1$
+ checkMethod = _filter.getCheckMethod(method);
+ assertNull(checkMethod);
+
+ method = ReflectionUtil.getMethod(getClass(), "_test2", new Class[] {}); //$NON-NLS-1$
+ checkMethod = _filter.getCheckMethod(method);
+ assertEquals("check__test2", checkMethod.getName()); //$NON-NLS-1$
+ }
+
+
+ public void test1() {
+
+ }
+
+ public void _test2() {
+
+ }
+
+ public void check__test2() {
+
+ }
+
+ public void _test3() {
+
+ }
+
+ public void check__test3() {
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|