[hornetq-commits] JBoss hornetq SVN: r11571 - trunk/tests/joram-tests/src/test/java/org/hornetq/jms.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 21 10:13:48 EDT 2011


Author: borges
Date: 2011-10-21 10:13:48 -0400 (Fri, 21 Oct 2011)
New Revision: 11571

Modified:
   trunk/tests/joram-tests/src/test/java/org/hornetq/jms/JoramAggregationTest.java
Log:
Remove non-abstract TestCase extension class causing warning failures in Maven's Surefire

Modified: trunk/tests/joram-tests/src/test/java/org/hornetq/jms/JoramAggregationTest.java
===================================================================
--- trunk/tests/joram-tests/src/test/java/org/hornetq/jms/JoramAggregationTest.java	2011-10-21 07:48:48 UTC (rev 11570)
+++ trunk/tests/joram-tests/src/test/java/org/hornetq/jms/JoramAggregationTest.java	2011-10-21 14:13:48 UTC (rev 11571)
@@ -49,7 +49,7 @@
 
 /**
  * JoramAggregationTest.
- * 
+ *
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.2 $
  */
@@ -60,33 +60,25 @@
       super(name);
    }
 
-   
-   
-   /** Used to similuate tests while renaming its names. */
-   private static class DummyTestCase extends TestCase
-   {
-       DummyTestCase(String name)
-       {
-           super (name);
-       }
-   }
- 
    /**
-    * One of the goals of this class also is to keep original classNames into testNames. So, you will realize several proxies existent here to
-    * keep these class names while executing method names.
+    * One of the goals of this class also is to keep original classNames into testNames.
+    * <p>
+    * So, you will realize several proxies existent here to keep these class names while executing
+    * method names.
     */
    static class TestProxy extends TestCase
    {
-       Hashtable hashTests = new Hashtable();
+      Hashtable<Test, Test> hashTests = new Hashtable<Test, Test>();
+      Test testcase;
 
-
        public TestProxy(Test testcase, String name)
        {
            super(name);
            this.testcase = testcase;
        }
 
-       public int countTestCases()
+       @Override
+      public int countTestCases()
        {
            return testcase.countTestCases();
        }
@@ -98,20 +90,20 @@
         */
        private Test createDummyTest(Test test)
        {
-           Test dummyTest = (Test)hashTests.get(test);
+           Test dummyTest = hashTests.get(test);
            if (dummyTest==null)
            {
-               if (test instanceof TestCase)
+            if (test instanceof TestCase || test instanceof TestSuite)
                {
-                   dummyTest = new DummyTestCase(this.getName() + ":"+ ((TestCase)test).getName());
-               } else
-               if (test instanceof TestSuite)
+               dummyTest = new TestCase(this.getName() + ":" + ((TestCase)test).getName())
                {
-                   dummyTest = new DummyTestCase(this.getName() + ":"+ ((TestCase)test).getName());
+               };
                }
                else
                {
-                   dummyTest = new DummyTestCase(test.getClass().getName());
+               dummyTest = new TestCase(test.getClass().getName())
+               {
+               };
                }
 
                hashTests.put(test,dummyTest);
@@ -120,7 +112,8 @@
            return dummyTest;
        }
 
-       public void run(final TestResult result)
+       @Override
+      public void run(final TestResult result)
        {
            TestResult subResult = new TestResult();
            subResult.addListener(new TestListener()
@@ -151,14 +144,12 @@
            });
            testcase.run(subResult);
        }
-
-       Test testcase;
    }
 
-   
 
-   
 
+
+
    public static junit.framework.Test suite() throws Exception
    {
       TestSuite suite = new TestSuite();
@@ -181,11 +172,12 @@
       suite.addTest(new TestProxy(TopicSessionTest.suite(), TopicSessionTest.class.getName()));
       suite.addTest(new TestProxy(UnifiedSessionTest.suite(), UnifiedSessionTest.class.getName()));
       suite.addTest(new TestProxy(TemporaryTopicTest.suite(), TemporaryTopicTest.class.getName()));
-      
+
       return new TestAggregation(suite);
    }
+
    /**
-    * Should be overriden 
+    * Should be overridden
     * @return
     */
    protected static Properties getProviderProperties() throws IOException
@@ -195,10 +187,10 @@
       return props;
    }
 
-   
+
    static class TestAggregation extends TestSetup
    {
-      
+
       Admin admin;
 
       /**
@@ -208,7 +200,8 @@
       {
          super(test);
       }
-      
+
+      @Override
       public void setUp() throws Exception
       {
          JMSTestCase.startServer = false;
@@ -219,13 +212,13 @@
          admin.startServer();
 
       }
-      
+
+      @Override
       public void tearDown() throws Exception
       {
-         System.out.println("TearDown");
          admin.stopServer();
          JMSTestCase.startServer = true;
       }
-      
+
    }
 }



More information about the hornetq-commits mailing list