camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r641919 - /activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component/uface/UFaceTest.java
Date Thu, 27 Mar 2008 17:34:20 GMT
Author: jstrachan
Date: Thu Mar 27 10:34:16 2008
New Revision: 641919

URL: http://svn.apache.org/viewvc?rev=641919&view=rev
Log:
avoid the use of Swing in the test case to avoid faiing on some CI machines

Modified:
    activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component/uface/UFaceTest.java

Modified: activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component/uface/UFaceTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component/uface/UFaceTest.java?rev=641919&r1=641918&r2=641919&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component/uface/UFaceTest.java
(original)
+++ activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component/uface/UFaceTest.java
Thu Mar 27 10:34:16 2008
@@ -20,12 +20,15 @@
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.ufacekit.ui.swing.databinding.swing.SwingRealm;
+import org.eclipse.core.databinding.observable.Realm;
 
 /**
  * @version $Revision$
  */
 public class UFaceTest extends ContextTestSupport {
+    // lets install a Realm to avoid null pointer exceptions
+    private Realm realm = new TestRealm();
+
     public void testUFaceEndpoints() throws Exception {
         MockEndpoint endpoint = getMockEndpoint("mock:results");
         endpoint.expectedMessageCount(1);
@@ -36,13 +39,20 @@
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
-        // Lets enable Swing as the Realm
-        SwingRealm.createDefault();
-
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("uface:a").to("uface:b").to("mock:results");
             }
         };
+    }
+
+    protected static class TestRealm extends Realm {
+        public TestRealm() {
+            Realm.setDefault(this);
+        }
+
+        public boolean isCurrent() {
+            return true;
+        }
     }
 }



Mime
View raw message