hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r355542 - /jakarta/hivemind/branches/maven2-dec12-2005/framework/src/test/java/org/apache/hivemind/impl/TestMessageFormatter.java
Date Fri, 09 Dec 2005 17:10:29 GMT
Author: hlship
Date: Fri Dec  9 09:10:27 2005
New Revision: 355542

URL: http://svn.apache.org/viewcvs?rev=355542&view=rev
Log:
Use reflection inside TestMessageFormatter, to deal witha disconnect between Eclipse and Sun
JDK compilers

Modified:
    jakarta/hivemind/branches/maven2-dec12-2005/framework/src/test/java/org/apache/hivemind/impl/TestMessageFormatter.java

Modified: jakarta/hivemind/branches/maven2-dec12-2005/framework/src/test/java/org/apache/hivemind/impl/TestMessageFormatter.java
URL: http://svn.apache.org/viewcvs/jakarta/hivemind/branches/maven2-dec12-2005/framework/src/test/java/org/apache/hivemind/impl/TestMessageFormatter.java?rev=355542&r1=355541&r2=355542&view=diff
==============================================================================
--- jakarta/hivemind/branches/maven2-dec12-2005/framework/src/test/java/org/apache/hivemind/impl/TestMessageFormatter.java
(original)
+++ jakarta/hivemind/branches/maven2-dec12-2005/framework/src/test/java/org/apache/hivemind/impl/TestMessageFormatter.java
Fri Dec  9 09:10:27 2005
@@ -14,7 +14,7 @@
 
 package org.apache.hivemind.impl;
 
-import DefaultPackageMessages;
+import java.lang.reflect.Method;
 
 import org.apache.hivemind.test.HiveMindTestCase;
 
@@ -27,8 +27,15 @@
  */
 public class TestMessageFormatter extends HiveMindTestCase
 {
-    public void testMessagesInDefaultPackage()
+    public void testMessagesInDefaultPackage() throws Exception
     {
-        assertEquals("Success!", DefaultPackageMessages.success());
+        // Eclipse won't allow us to reference DefaultPackageMessages without importing it.
+        // Sun JDK won't allow "import DefaultPackageMessages;". Use a little reflection
to
+        // get around that.
+
+        Class clazz = Class.forName("DefaultPackageMessages");
+        Method m = clazz.getMethod("success", null);
+
+        assertEquals("Success!", m.invoke(null, null));
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message