You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2008/07/19 07:57:52 UTC

svn commit: r678106 - in /tuscany/java/sca/modules: binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/ binding-atom/ binding-atom/src/test/java/org/ binding...

Author: lresende
Date: Fri Jul 18 22:57:51 2008
New Revision: 678106

URL: http://svn.apache.org/viewvc?rev=678106&view=rev
Log:
TUSCANY-2470 - Automating the consumer/provider test case and adding some atom binding model tests

Added:
    tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java   (with props)
    tuscany/java/sca/modules/binding-atom/src/test/java/org/
    tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/
    tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/
    tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/
    tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/
    tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/
    tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java   (with props)
Removed:
    tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java
    tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java
Modified:
    tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java
    tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
    tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
    tuscany/java/sca/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite
    tuscany/java/sca/modules/binding-atom/pom.xml

Added: tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java?rev=678106&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java (added)
+++ tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java Fri Jul 18 22:57:51 2008
@@ -0,0 +1,155 @@
+/*
+ * 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.tuscany.sca.binding.atom;
+
+import java.util.Date;
+
+import junit.framework.Assert;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.model.Content;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.tuscany.sca.binding.atom.collection.Collection;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test case for the given package.
+ */
+public class ConsumerProviderAtomTestCase {
+
+	protected static SCADomain scaConsumerDomain;
+	protected static SCADomain scaProviderDomain;
+	protected static CustomerClient testService;
+	protected static Abdera abdera;
+
+	@BeforeClass
+	public static void init() throws Exception {
+		System.out.println(">>>AtomBindingIntegratedTestCase.init entry");
+		scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
+		scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
+		testService = scaConsumerDomain.getService(CustomerClient.class,"CustomerClient");
+		abdera = new Abdera();
+	}
+
+	@AfterClass
+	public static void destroy() throws Exception {
+		System.out.println(">>>AtomBindingIntegratedTestCase.destroy entry");
+		scaConsumerDomain.close();
+		scaProviderDomain.close();
+	}
+
+	@Test
+	public void testPrelim() throws Exception {
+		Assert.assertNotNull(scaProviderDomain);
+		Assert.assertNotNull(scaConsumerDomain);
+		Assert.assertNotNull(testService);
+		Assert.assertNotNull(abdera);
+	}
+
+	@Test
+	public void testEntry() throws Exception {
+		// System.out.println( getClass().getName() + ".testEntry entry" );
+		Entry entry = abdera.newEntry();
+		Assert.assertNotNull(entry);
+
+		String testTitle = "Sponge Bob";
+		entry.setTitle(testTitle);
+		Assert.assertEquals(testTitle, entry.getTitle());
+
+		String testContent = "This is the content";
+		entry.setContent(testContent);
+		Assert.assertEquals(testContent, entry.getContent());
+
+		Date now = new Date();
+		entry.setEdited(now);
+		Assert.assertEquals(now, entry.getEdited());
+
+		Date later = new Date();
+		entry.setPublished(later);
+		Assert.assertEquals(later, entry.getPublished());
+
+		String testSummary = "This is the summary";
+		entry.setSummary(testSummary);
+		Assert.assertEquals(testSummary, entry.getSummary());
+	}
+
+	@Test
+	public void testCustomerCollection() throws Exception {
+		System.out.println(getClass().getName()	+ ".testCustomerCollection entry");
+		Collection resourceCollection = testService.getCustomerCollection();
+		Assert.assertNotNull(resourceCollection);
+		
+		Entry newEntry = newEntry("Sponge Bob");
+	        System.out.println(">>> post entry=" + newEntry.getTitle());
+	        newEntry = resourceCollection.post(newEntry);
+	        System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
+
+	        newEntry = newEntry("Jane Bond");
+	        System.out.println(">>> post entry=" + newEntry.getTitle());
+	        newEntry = resourceCollection.post(newEntry);
+	        System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
+
+	        System.out.println(">>> get id=" + newEntry.getId());
+	        Entry entry = resourceCollection.get(newEntry.getId().toString());
+	        System.out.println("<<< get id=" + entry.getId() + " entry=" + entry.getTitle());
+
+	        System.out.println(">>> put id=" + newEntry.getId() + " entry=" + entry.getTitle());
+	        resourceCollection.put(entry.getId().toString(), updateEntry(entry, "James Bond"));
+	        System.out.println("<<< put id=" + entry.getId() + " entry=" + entry.getTitle());
+
+	        System.out.println(">>> delete id=" + entry.getId());
+	        resourceCollection.delete(entry.getId().toString());
+	        System.out.println("<<< delete id=" + entry.getId());
+
+	        System.out.println(">>> get collection");
+	        Feed feed = resourceCollection.getFeed();
+	        System.out.println("<<< get collection");
+	        for (Object o : feed.getEntries()) {
+	            Entry e = (Entry)o;
+	            System.out.println("id = " + e.getId() + " entry = " + e.getTitle());
+	        }
+	}
+
+	private Entry newEntry(String value) {
+		Entry entry = abdera.newEntry();
+		entry.setTitle("customer " + value);
+
+		Content content = abdera.getFactory().newContent();
+		content.setContentType(Content.Type.TEXT);
+		content.setValue(value);
+		entry.setContentElement(content);
+
+		return entry;
+	}
+
+	private Entry updateEntry(Entry entry, String value) {
+		entry.setTitle("customer " + value);
+
+		Content content = abdera.getFactory().newContent();
+		content.setContentType(Content.Type.TEXT);
+		content.setValue(value);
+		entry.setContentElement(content);
+
+		return entry;
+	}
+}
\ No newline at end of file

Propchange: tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java?rev=678106&r1=678105&r2=678106&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java (original)
+++ tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClient.java Fri Jul 18 22:57:51 2008
@@ -19,7 +19,11 @@
 
 package org.apache.tuscany.sca.binding.atom;
 
+import org.apache.tuscany.sca.binding.atom.collection.Collection;
+
 public interface CustomerClient {
 
     void testCustomerCollection() throws Exception;
+ 
+    Collection getCustomerCollection();
 }

Modified: tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java?rev=678106&r1=678105&r2=678106&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java (original)
+++ tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java Fri Jul 18 22:57:51 2008
@@ -31,34 +31,34 @@
     protected final Abdera abdera = new Abdera();
     
     @Reference
-    public Collection resourceCollection;
+    public Collection customerCollection;
 
     public void testCustomerCollection() throws Exception {
 
         Entry newEntry = newEntry("Sponge Bob");
         System.out.println(">>> post entry=" + newEntry.getTitle());
-        newEntry = resourceCollection.post(newEntry);
+        newEntry = customerCollection.post(newEntry);
         System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
 
         newEntry = newEntry("Jane Bond");
         System.out.println(">>> post entry=" + newEntry.getTitle());
-        newEntry = resourceCollection.post(newEntry);
+        newEntry = customerCollection.post(newEntry);
         System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
 
         System.out.println(">>> get id=" + newEntry.getId());
-        Entry entry = resourceCollection.get(newEntry.getId().toString());
+        Entry entry = customerCollection.get(newEntry.getId().toString());
         System.out.println("<<< get id=" + entry.getId() + " entry=" + entry.getTitle());
 
         System.out.println(">>> put id=" + newEntry.getId() + " entry=" + entry.getTitle());
-        resourceCollection.put(entry.getId().toString(), updateEntry(entry, "James Bond"));
+        customerCollection.put(entry.getId().toString(), updateEntry(entry, "James Bond"));
         System.out.println("<<< put id=" + entry.getId() + " entry=" + entry.getTitle());
 
         System.out.println(">>> delete id=" + entry.getId());
-        resourceCollection.delete(entry.getId().toString());
+        customerCollection.delete(entry.getId().toString());
         System.out.println("<<< delete id=" + entry.getId());
 
         System.out.println(">>> get collection");
-        Feed feed = resourceCollection.getFeed();
+        Feed feed = customerCollection.getFeed();
         System.out.println("<<< get collection");
         for (Object o : feed.getEntries()) {
             Entry e = (Entry)o;
@@ -66,6 +66,10 @@
         }
     }
 
+    public Collection getCustomerCollection() {
+    	return customerCollection;
+    }
+    
     private Entry newEntry(String value) {
 
         Entry entry = this.abdera.newEntry();

Modified: tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java?rev=678106&r1=678105&r2=678106&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java (original)
+++ tuscany/java/sca/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java Fri Jul 18 22:57:51 2008
@@ -31,43 +31,24 @@
 import org.apache.tuscany.sca.binding.atom.collection.Collection;
 import org.osoa.sca.annotations.Scope;
 
-
-
 @Scope("COMPOSITE")
 public class CustomerCollectionImpl implements Collection {
-	private final Abdera abdera = new Abdera();
+    private final Abdera abdera = new Abdera();
     private Map<String, Entry> entries = new HashMap<String, Entry>();
 
     /**
-     * Default constructor that initializes collection with couple customer entries
+     * Default constructor that initializes collection with couple customer
+     * entries
      */
     public CustomerCollectionImpl() {
-
-        for (int i = 0; i < 4; i++) {
-            String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
-            
-            Entry entry = abdera.getFactory().newEntry();
-            entry.setId(id);
-            entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
-            
-            Content content = this.abdera.getFactory().newContent();
-            content.setContentType(Content.Type.TEXT);
-            content.setValue("Jane Doe_" + String.valueOf(i));
-            
-            entry.setContentElement(content);
-            
-            entry.addLink("" + id, "edit");
-            entry.addLink("" + id, "alternate");
-    
-            entry.setUpdated(new Date());
-
-            entries.put(id, entry);
-            System.out.println(">>> id=" + id);
-        }
+        // Used for testing.
+        // for (int i = 0; i < 4; i++) {
+        // testPut( "Jane Doe_" + String.valueOf( i ));
+        // }
     }
 
     public Entry post(Entry entry) {
-        System.out.println(">>> ResourceCollectionImpl.post entry=" + entry.getTitle());
+        System.out.println(">>> CustomerCollectionImpl.post entry=" + entry.getTitle());
 
         String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
         entry.setId(id);
@@ -79,49 +60,72 @@
 
         entries.put(id, entry);
 
-        System.out.println(">>> ResourceCollectionImpl.post return id=" + id);
+        System.out.println(">>> CustomerCollectionImpl.post return id=" + id);
 
         return entry;
     }
 
     public Entry get(String id) {
-        System.out.println(">>> ResourceCollectionImpl.get id=" + id);
+        System.out.println(">>> CustomerCollectionImpl.get id=" + id);
         return entries.get(id);
     }
 
     public void put(String id, Entry entry) {
-        System.out.println(">>> ResourceCollectionImpl.put id=" + id + " entry=" + entry.getTitle());
+        System.out.println(">>> CustomerCollectionImpl.put id=" + id + " entry=" + entry.getTitle());
 
         entry.setUpdated(new Date());
         entries.put(id, entry);
     }
 
     public void delete(String id) {
-        System.out.println(">>> ResourceCollectionImpl.delete id=" + id);
+        System.out.println(">>> CustomerCollectionImpl.delete id=" + id);
         entries.remove(id);
     }
 
     @SuppressWarnings("unchecked")
     public Feed getFeed() {
-        System.out.println(">>> ResourceCollectionImpl.get collection");
+        System.out.println(">>> CustomerCollectionImpl.getFeed");
 
         Feed feed = this.abdera.getFactory().newFeed();
         feed.setTitle("customers");
         feed.setSubtitle("This is a sample feed");
         feed.setUpdated(new Date());
         feed.addLink("");
-        feed.addLink("","self");
+        feed.addLink("", "self");
 
         for (Entry entry : entries.values()) {
-        	feed.addEntry(entry);
+            feed.addEntry(entry);
         }
 
         return feed;
     }
 
     public Feed query(String queryString) {
-        System.out.println(">>> ResourceCollectionImpl.query collection " + queryString);
+        System.out.println(">>> CustomerCollectionImpl.query collection " + queryString);
         return getFeed();
     }
 
+    // This method used for testing.
+    protected void testPut(String value) {
+        String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
+
+        Entry entry = abdera.getFactory().newEntry();
+        entry.setId(id);
+        entry.setTitle("customer " + value);
+
+        Content content = this.abdera.getFactory().newContent();
+        content.setContentType(Content.Type.TEXT);
+        content.setValue(value);
+
+        entry.setContentElement(content);
+
+        entry.addLink("" + id, "edit");
+        entry.addLink("" + id, "alternate");
+
+        entry.setUpdated(new Date());
+
+        entries.put(id, entry);
+        System.out.println(">>> id=" + id);
+    }
+
 }

Modified: tuscany/java/sca/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite?rev=678106&r1=678105&r2=678106&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite (original)
+++ tuscany/java/sca/modules/binding-atom-abdera/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite Fri Jul 18 22:57:51 2008
@@ -24,7 +24,7 @@
     
     <component name="CustomerClient">
         <implementation.java class="org.apache.tuscany.sca.binding.atom.CustomerClientImpl"/>
-        <reference name="resourceCollection">
+        <reference name="customerCollection">
         	<tuscany:binding.atom uri="http://localhost:8084/customer"/>
         </reference>
     </component>

Modified: tuscany/java/sca/modules/binding-atom/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom/pom.xml?rev=678106&r1=678105&r2=678106&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom/pom.xml (original)
+++ tuscany/java/sca/modules/binding-atom/pom.xml Fri Jul 18 22:57:51 2008
@@ -37,6 +37,20 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-assembly-xml</artifactId>
+            <version>1.4-SNAPSHOT</version>
+			<scope>test</scope>			
+        </dependency>
+		
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+			<scope>test</scope>
+        </dependency>
+		
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.2</version>

Added: tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java?rev=678106&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java (added)
+++ tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java Fri Jul 18 22:57:51 2008
@@ -0,0 +1,89 @@
+/*
+ * 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.tuscany.sca.binding.atom;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorFactoryImpl;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AtomBindingProcessorTestCase extends TestCase {
+    
+    private static final String COMPOSITE =
+        "<?xml version=\"1.0\" encoding=\"ASCII\"?>" 
+        + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://binding-atom\" name=\"binding-atom\">"
+            + " <component name=\"HelloWorldComponent\">"
+            + "   <implementation.java class=\"services.HelloWorld\"/>"
+            + "      <service name=\"HelloWorldService\">"
+            + "          <tuscany:binding.atom uri=\"http://localhost:8080/feed\" title=\"Feed Title\"/>"
+            + "      </service>"
+            + " </component>"
+            + "</composite>";
+
+    private XMLInputFactory inputFactory;
+    private StAXArtifactProcessor<Object> staxProcessor;
+    private Monitor monitor;
+
+    @Override
+    protected void setUp() throws Exception {
+        DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+        inputFactory = XMLInputFactory.newInstance();
+        // Create a monitor
+        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();  
+        if (monitorFactory != null) {
+        	monitor = monitorFactory.createMonitor();
+        	utilities.addUtility(monitorFactory);
+        }
+        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
+    }
+
+    /**
+     * Test parsing valid composite definition. Valid composite populated with correct values expected.
+     * @throws Exception
+     */
+    public void testLoadValidComposite() throws Exception {
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE));
+        
+        Composite composite = (Composite)staxProcessor.read(reader);
+        AtomBinding binding = (AtomBinding)   composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
+        
+        assertNotNull(binding);
+        assertEquals("Feed Title", binding.getTitle());
+        assertEquals("http://localhost:8080/feed", binding.getURI());
+    }
+}

Propchange: tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-atom/src/test/java/org/apache/tuscany/sca/binding/atom/AtomBindingProcessorTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date