You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2008/02/13 21:17:06 UTC

svn commit: r627580 - in /activemq/camel/trunk/components: camel-swing/ camel-swing/src/ camel-swing/src/main/ camel-swing/src/main/java/ camel-swing/src/main/java/org/ camel-swing/src/main/java/org/apache/ camel-swing/src/main/java/org/apache/camel/ c...

Author: jstrachan
Date: Wed Feb 13 12:16:58 2008
New Revision: 627580

URL: http://svn.apache.org/viewvc?rev=627580&view=rev
Log:
tidied up the code for visualising camel endpoints using uface

Added:
    activemq/camel/trunk/components/camel-swing/
    activemq/camel/trunk/components/camel-swing/pom.xml   (with props)
    activemq/camel/trunk/components/camel-swing/src/
    activemq/camel/trunk/components/camel-swing/src/main/
    activemq/camel/trunk/components/camel-swing/src/main/java/
    activemq/camel/trunk/components/camel-swing/src/main/java/org/
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/Main.java   (with props)
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java   (with props)
    activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingComponent.java   (with props)
    activemq/camel/trunk/components/camel-swing/src/main/resources/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/component/
    activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/component/swing
    activemq/camel/trunk/components/camel-swing/src/test/
    activemq/camel/trunk/components/camel-swing/src/test/java/
    activemq/camel/trunk/components/camel-swing/src/test/java/org/
    activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/
    activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/
    activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/
    activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/ExampleSender.java   (with props)
    activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/UFaceTest.java   (with props)
    activemq/camel/trunk/components/camel-swing/src/test/resources/
    activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/
    activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/
    activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/camel.xml   (with props)
    activemq/camel/trunk/components/camel-swing/src/test/resources/log4j.properties   (with props)
    activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/swing
    activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/uface
    activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/UFaceTest.java   (with props)
Removed:
    activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/
    activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/
Modified:
    activemq/camel/trunk/components/camel-uface/pom.xml
    activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java
    activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java
    activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java
    activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties

Added: activemq/camel/trunk/components/camel-swing/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/pom.xml?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/pom.xml (added)
+++ activemq/camel/trunk/components/camel-swing/pom.xml Wed Feb 13 12:16:58 2008
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-parent</artifactId>
+    <version>1.3-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-swing</artifactId>
+  <packaging>bundle</packaging>
+  <name>Camel :: Swing</name>
+  <description>Camel Swing support</description>
+
+  <properties>
+  	<camel.osgi.export.pkg>org.apache.camel.component.uface.swing*</camel.osgi.export.pkg>
+  </properties>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-uface</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.ufacekit</groupId>
+      <artifactId>org.ufacekit.ui.swing</artifactId>
+      <version>${uface-version}</version>
+    </dependency>
+
+    <!-- testing -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+
+  <build>
+    <plugins>
+                <!-- allows the example to be ran via 'mvn compile exec:java' -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <configuration>
+          <mainClass>org.apache.camel.component.uface.swing.Main</mainClass>
+          <includePluginDependencies>false</includePluginDependencies>
+        </configuration>
+      </plugin>
+
+    </plugins>
+  </build>
+</project>

Propchange: activemq/camel/trunk/components/camel-swing/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/Main.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/Main.java?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/Main.java (added)
+++ activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/Main.java Wed Feb 13 12:16:58 2008
@@ -0,0 +1,45 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.uface.swing;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class Main extends org.apache.camel.spring.Main {
+
+    public static void main(String... args) {
+        new Main().run(args);
+    }
+
+    protected void postProcesCamelContext(CamelContext camelContext) throws Exception {
+        super.postProcesCamelContext(camelContext);
+
+        try {
+            SwingBrowser browser = new SwingBrowser((DefaultCamelContext) camelContext);
+            browser.run();
+        }
+        catch (RuntimeException e) {
+            System.out.println("Caught: " + e);
+            e.printStackTrace();
+            throw e;
+        }
+    }
+}

Propchange: activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/Main.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java (added)
+++ activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java Wed Feb 13 12:16:58 2008
@@ -0,0 +1,57 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.uface.swing;
+
+import java.awt.*;
+
+import javax.swing.*;
+
+import org.apache.camel.component.uface.UFaceBrowser;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.spring.Main;
+import org.ufacekit.ui.UIComposite;
+import org.ufacekit.ui.swing.SwingComposite;
+import org.ufacekit.ui.swing.SwingFactory;
+import org.ufacekit.ui.swing.databinding.swing.SwingRealm;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class SwingBrowser extends UFaceBrowser {
+    static {
+        SwingRealm.createDefault();
+    }
+    
+    public SwingBrowser(DefaultCamelContext camelContext) {
+        super(camelContext);
+    }
+
+    public void run() {
+        JFrame frame = new JFrame();
+        frame.setTitle("Camel Browser");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        Container container = frame.getContentPane();
+        UIComposite composite = new SwingComposite(container, new SwingFactory().newFillLayout());
+
+        createBrowserUI(composite);
+
+        frame.pack();
+        frame.setSize(650, 500);
+        frame.setVisible(true);
+    }
+}

Propchange: activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingComponent.java?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingComponent.java (added)
+++ activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingComponent.java Wed Feb 13 12:16:58 2008
@@ -0,0 +1,37 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.uface.swing;
+
+import java.util.Map;
+
+import org.apache.camel.component.uface.UFaceComponent;
+import org.apache.camel.Endpoint;
+import org.ufacekit.ui.swing.databinding.swing.SwingRealm;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class SwingComponent extends UFaceComponent {
+    public SwingComponent() {
+        SwingRealm.createDefault();
+    }
+
+    protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+        return super.createEndpoint(uri, remaining, parameters);
+    }
+}

Propchange: activemq/camel/trunk/components/camel-swing/src/main/java/org/apache/camel/component.uface/swing/SwingComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/component/swing
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/component/swing?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/component/swing (added)
+++ activemq/camel/trunk/components/camel-swing/src/main/resources/META-INF/services/org/apache/camel/component/swing Wed Feb 13 12:16:58 2008
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class=org.apache.camel.component.uface.swing.SwingComponent

Added: activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/ExampleSender.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/ExampleSender.java?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/ExampleSender.java (added)
+++ activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/ExampleSender.java Wed Feb 13 12:16:58 2008
@@ -0,0 +1,54 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.uface;
+
+import java.util.Date;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.EndpointInject;
+import org.springframework.beans.factory.InitializingBean;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class ExampleSender implements InitializingBean {
+    private int counter;
+    private int messageCount = 10;
+
+    @EndpointInject(uri = "swing:a")
+    private ProducerTemplate template;
+
+    public String ping() {
+        return "Message " + (++counter) + " at: " + new Date();
+    }
+
+    public void afterPropertiesSet() throws Exception {
+        // lets send a bunch of messages...
+        for (int i = 0; i < messageCount; i++) {
+            template.sendBodyAndHeader(ping(), "messageCounter", i);
+        }
+    }
+
+    public int getMessageCount() {
+        return messageCount;
+    }
+
+    public void setMessageCount(int messageCount) {
+        this.messageCount = messageCount;
+    }
+}

Propchange: activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/ExampleSender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/UFaceTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/UFaceTest.java?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/UFaceTest.java (added)
+++ activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/UFaceTest.java Wed Feb 13 12:16:58 2008
@@ -0,0 +1,44 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.uface;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class UFaceTest extends ContextTestSupport {
+    public void testUFaceEndpoints() throws Exception {
+        MockEndpoint endpoint = getMockEndpoint("mock:results");
+        endpoint.expectedMessageCount(1);
+
+        template.sendBody("swing:a", "<hello>world!</hello>");
+
+        assertMockEndpointsSatisifed();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("swing:a").to("swing:b").to("mock:results");
+            }
+        };
+    }
+}

Propchange: activemq/camel/trunk/components/camel-swing/src/test/java/org/apache/camel/component.uface/UFaceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/camel.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/camel.xml?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/camel.xml (added)
+++ activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/camel.xml Wed Feb 13 12:16:58 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
+
+  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
+    <route>
+      <from uri="swing:a"/>
+      <to uri="swing:b"/>
+    </route>
+
+  </camelContext>
+
+  <bean id="sender" class="org.apache.camel.component.uface.ExampleSender"/>
+</beans>

Propchange: activemq/camel/trunk/components/camel-swing/src/test/resources/META-INF/spring/camel.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-swing/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-swing/src/test/resources/log4j.properties?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-swing/src/test/resources/log4j.properties (added)
+++ activemq/camel/trunk/components/camel-swing/src/test/resources/log4j.properties Wed Feb 13 12:16:58 2008
@@ -0,0 +1,53 @@
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
+
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+## 
+## http://www.apache.org/licenses/LICENSE-2.0
+## 
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=DEBUG, stdout
+
+log4j.logger.org.apache.activemq.spring=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/camel-test.log
+log4j.appender.out.append=true
+

Propchange: activemq/camel/trunk/components/camel-swing/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/components/camel-uface/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/pom.xml?rev=627580&r1=627579&r2=627580&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/pom.xml (original)
+++ activemq/camel/trunk/components/camel-uface/pom.xml Wed Feb 13 12:16:58 2008
@@ -35,7 +35,6 @@
 
   <properties>
 	<camel.osgi.export.pkg>org.apache.camel.component.uface*</camel.osgi.export.pkg>
-    <uface-version>1.0-SNAPSHOT</uface-version>
   </properties>
 
   <dependencies>
@@ -62,11 +61,6 @@
       <artifactId>org.ufacekit.ui.beanform</artifactId>
       <version>${uface-version}</version>
     </dependency>
-    <dependency>
-      <groupId>org.ufacekit</groupId>
-      <artifactId>org.ufacekit.ui.swing</artifactId>
-      <version>${uface-version}</version>
-    </dependency>
 
     <!-- testing -->
     <dependency>
@@ -75,6 +69,12 @@
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.ufacekit</groupId>
+      <artifactId>org.ufacekit.ui.swing</artifactId>
+      <version>${uface-version}</version>
+      <scope>test</scope>
+    </dependency>
 
     <dependency>
       <groupId>commons-logging</groupId>
@@ -93,19 +93,4 @@
     </dependency>
   </dependencies>
 
-
-  <build>
-    <plugins>
-                <!-- allows the example to be ran via 'mvn compile exec:java' -->
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>exec-maven-plugin</artifactId>
-        <configuration>
-          <mainClass>org.apache.camel.component.uface.swing.Main</mainClass>
-          <includePluginDependencies>false</includePluginDependencies>
-        </configuration>
-      </plugin>
-
-    </plugins>
-  </build>
 </project>

Modified: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java?rev=627580&r1=627579&r2=627580&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java (original)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java Wed Feb 13 12:16:58 2008
@@ -101,12 +101,6 @@
 
         BeanForm selectionForm = new BeanForm();
 
-/*
-        UIComposite detailComposite = ui.newComposite(splitter, null, ui.newGridLayout(1));
-
-        ui.newLabel(detailComposite, new UILabel.LabelUIInfo(new GridLayoutData(GridLayoutData.ALIGN_END, GridLayoutData.ALIGN_CENTER))).setText("Exchanges");
-*/
-
         UITable table = ui.newTable(splitter, new UITable.TableUIInfo(new GridLayoutData(GridLayoutData.ALIGN_FILL, GridLayoutData.ALIGN_FILL, true, true)),
                 new UITable.TableBindingInfo(selectionForm,
                         selectionForm.detailList("exchanges", Collection.class)));

Modified: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java?rev=627580&r1=627579&r2=627580&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java Wed Feb 13 12:16:58 2008
@@ -23,6 +23,9 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Exchange;
+import org.apache.camel.util.ObjectHelper;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.Realm;
 
 /**
  * @version $Revision: 1.1 $
@@ -34,7 +37,8 @@
 
     @Override
     protected List<Exchange> createExchangeList() {
-        // TODO
-        return super.createExchangeList();
+        Realm realm = Realm.getDefault();
+        ObjectHelper.notNull(realm, "DataBinding Realm");
+        return new WritableList(realm);
     }
 }

Added: activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/swing
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/swing?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/swing (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/swing Wed Feb 13 12:16:58 2008
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class=org.apache.camel.component.uface.swing.SwingComponent

Added: activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/uface
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/uface?rev=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/uface (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/uface Wed Feb 13 12:16:58 2008
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class=org.apache.camel.component.uface.UFaceComponent

Modified: activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java?rev=627580&r1=627579&r2=627580&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java (original)
+++ activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java Wed Feb 13 12:16:58 2008
@@ -30,7 +30,7 @@
     private int counter;
     private int messageCount = 10;
 
-    @EndpointInject(uri = "mock:a")
+    @EndpointInject(uri = "uface:a")
     private ProducerTemplate template;
 
     public String ping() {

Added: 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=627580&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/UFaceTest.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/UFaceTest.java Wed Feb 13 12:16:58 2008
@@ -0,0 +1,48 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.uface;
+
+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;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class UFaceTest extends ContextTestSupport {
+    public void testUFaceEndpoints() throws Exception {
+        MockEndpoint endpoint = getMockEndpoint("mock:results");
+        endpoint.expectedMessageCount(1);
+
+        template.sendBody("uface:a", "<hello>world!</hello>");
+
+        assertMockEndpointsSatisifed();
+    }
+
+    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");
+            }
+        };
+    }
+}

Propchange: activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/UFaceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties?rev=627580&r1=627579&r2=627580&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties (original)
+++ activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties Wed Feb 13 12:16:58 2008
@@ -35,7 +35,7 @@
 #
 # The logging properties used during tests..
 #
-log4j.rootLogger=INFO, stdout
+log4j.rootLogger=DEBUG, stdout
 
 log4j.logger.org.apache.activemq.spring=WARN