diff options
Diffstat (limited to 'java/sca')
14 files changed, 127 insertions, 106 deletions
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java index 4fb0b5f0d8..510a6958db 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java @@ -71,12 +71,12 @@ public class AtomDeleteTestCase extends AbstractProviderConsumerTestCase { Assert.assertNotNull(resourceCollection); Entry postEntry = postEntry("Sponge Bob"); - System.out.println(">>> post entry= " + postEntry.getTitle()); + //System.out.println(">>> post entry= " + postEntry.getTitle()); Entry newEntry = resourceCollection.post(postEntry); - System.out.println("<<< Entry posted for " + newEntry.getTitle()); + //System.out.println("<<< Entry posted for " + newEntry.getTitle()); - System.out.println(">>> get id=" + newEntry.getId()); + //System.out.println(">>> get id=" + newEntry.getId()); resourceCollection.delete(newEntry.getId().toString()); diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java index 3605ff50b8..608ce4a697 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java @@ -29,6 +29,10 @@ import org.apache.abdera.model.Link; import org.apache.tuscany.sca.binding.atom.collection.Collection; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.Item; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -39,7 +43,7 @@ import org.junit.Test; * Test cases for using an Atom feed that does not implement * the Collections interface but does have a getAll() method. */ -public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase { +public class AtomFeedNonCollectionTest { /** * Used to generate unique IDs for the feed entries. */ @@ -64,6 +68,9 @@ public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase * The number of test feed entries. */ private static final int FEED_ENTRY_COUNT = FEED_ENTRY_TITLES.length; + + protected static Node scaProviderNode; + protected static Node scaConsumerNode; private static CustomerClient testService; @@ -72,7 +79,13 @@ public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase try { //System.out.println(">>>AtomFeedNonCollectionTest.init entry"); - initTestEnvironment(AtomFeedNonCollectionTest.class); + String contribution = ContributionLocationHelper.getContributionLocation(AtomFeedNonCollectionTest.class); + + scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite", new Contribution("provider", contribution)); + scaProviderNode.start(); + + scaConsumerNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Consumer.composite", new Contribution("consumer", contribution)); + scaConsumerNode.start(); testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient"); } catch (Exception e) { @@ -82,11 +95,18 @@ public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase @AfterClass public static void destroy() throws Exception { - destroyTestEnvironment(); + if (scaConsumerNode != null) { + scaConsumerNode.stop(); + scaConsumerNode.destroy(); + } + if (scaProviderNode != null) { + scaProviderNode.stop(); + scaProviderNode.destroy(); + } } /** - * Make sure everything has been initialised correctly. + * Make sure everything has been initialized correctly. */ @SuppressWarnings("unchecked") @Before @@ -141,29 +161,6 @@ public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase } /** - * Creates a feed entry. - * - * @param title Title for the feed entry - * @param content Contents of the feed entry - * @param link Link for the feed entry - * @return A new feed entry. - */ - private Entry<Object, Object> createFeedEntry(String title, String content, String link) { - final Item item = new Item(title, content, link, null, new Date()); - final Entry<Object, Object> entry = new Entry<Object, Object>(nextFeedID(), item); - return entry; - } - - /** - * Generates the feed entry ID. - * - * @return Next feed entry ID - */ - private String nextFeedID() { - return Integer.toString(ID_GEN.incrementAndGet()); - } - - /** * Tests that the title of the feed can be set by the title * attribute on the binding.atom */ @@ -196,4 +193,27 @@ public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase // Validate the description Assert.assertEquals(expectedFeedDescription, feedDescription); } + + /** + * Creates a feed entry. + * + * @param title Title for the feed entry + * @param content Contents of the feed entry + * @param link Link for the feed entry + * @return A new feed entry. + */ + private Entry<Object, Object> createFeedEntry(String title, String content, String link) { + final Item item = new Item(title, content, link, null, new Date()); + final Entry<Object, Object> entry = new Entry<Object, Object>(nextFeedID(), item); + return entry; + } + + /** + * Generates the feed entry ID. + * + * @return Next feed entry ID + */ + private String nextFeedID() { + return Integer.toString(ID_GEN.incrementAndGet()); + } } diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java index 8cb939e81b..0e86f0658e 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java @@ -67,17 +67,17 @@ public class AtomGetTestCase extends AbstractProviderConsumerTestCase { Assert.assertNotNull(resourceCollection); Entry postEntry = postEntry("Sponge Bob"); - System.out.println(">>> post entry= " + postEntry.getTitle()); + //System.out.println(">>> post entry= " + postEntry.getTitle()); Entry newEntry = resourceCollection.post(postEntry); - System.out.println("<<< Entry posted for " + newEntry.getTitle()); + //System.out.println("<<< Entry posted for " + newEntry.getTitle()); - System.out.println(">>> get id=" + newEntry.getId()); + //System.out.println(">>> get id=" + newEntry.getId()); Entry getEntry = resourceCollection.get(newEntry.getId().toString()); Assert.assertEquals(newEntry.getTitle(), getEntry.getTitle()); - System.out.println("<<< get id=" + getEntry.getId() + " entry=" + getEntry.getTitle()); + //System.out.println("<<< get id=" + getEntry.getId() + " entry=" + getEntry.getTitle()); } @Test @@ -86,11 +86,11 @@ public class AtomGetTestCase extends AbstractProviderConsumerTestCase { Assert.assertNotNull(resourceCollection); Entry postEntry = postEntry("Sponge Bob"); - System.out.println(">>> post entry= " + postEntry.getTitle()); + //System.out.println(">>> post entry= " + postEntry.getTitle()); Entry newEntry = resourceCollection.post(postEntry); - System.out.println("<<< Entry posted for " + newEntry.getTitle()); - System.out.println(newEntry.getId()); + //System.out.println("<<< Entry posted for " + newEntry.getTitle()); + //System.out.println(newEntry.getId()); // Delete the entry to force the Collection to throw NotFoundException resourceCollection.delete(newEntry.getId().toString()); diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java index ddc8802eb3..152f2433e2 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java @@ -67,13 +67,13 @@ public class AtomPostTestCase extends AbstractProviderConsumerTestCase { Assert.assertNotNull(resourceCollection); Entry postEntry = postEntry("Sponge Bob"); - System.out.println(">>> post entry= " + postEntry.getTitle()); + //System.out.println(">>> post entry= " + postEntry.getTitle()); Entry newEntry = resourceCollection.post(postEntry); Assert.assertEquals(postEntry.getTitle(), newEntry.getTitle()); - System.out.println("<<< new entry= " + newEntry.getTitle()); + //System.out.println("<<< new entry= " + newEntry.getTitle()); } diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java index ed9d8db110..24dae0c6ba 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java @@ -70,15 +70,15 @@ public class AtomPutTestCase extends AbstractProviderConsumerTestCase { Assert.assertNotNull(resourceCollection); Entry postEntry = postEntry("Sponge Bob"); - System.out.println(">>> post entry= " + postEntry.getTitle()); + //System.out.println(">>> post entry= " + postEntry.getTitle()); Entry newEntry = resourceCollection.post(postEntry); - System.out.println("<<< Entry posted for " + newEntry.getTitle()); - System.out.println(newEntry.getId()); + //System.out.println("<<< Entry posted for " + newEntry.getTitle()); + //System.out.println(newEntry.getId()); - System.out.println(">>> put id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); + //System.out.println(">>> put id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); resourceCollection.put(newEntry.getId().toString(), updateEntry(newEntry, "James Bond")); - System.out.println("<<< put id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); + //System.out.println("<<< put id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); } @Test @@ -87,7 +87,7 @@ public class AtomPutTestCase extends AbstractProviderConsumerTestCase { Assert.assertNotNull(resourceCollection); Entry postEntry = postEntry("Sponge Bob"); - System.out.println(">>> post entry= " + postEntry.getTitle()); + //System.out.println(">>> post entry= " + postEntry.getTitle()); // Generate random ID to pass as parameter in PUT() -- String id = "urn:uuid:customer-" + UUID.randomUUID().toString(); diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java index f28f0f0bed..0759555dc1 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java @@ -102,33 +102,33 @@ public class ConsumerProviderAtomTestCase extends AbstractProviderConsumerTestCa Assert.assertNotNull(resourceCollection); Entry newEntry = newEntry("Sponge Bob"); - System.out.println(">>> post entry=" + newEntry.getTitle()); + //System.out.println(">>> post entry=" + newEntry.getTitle()); newEntry = resourceCollection.post(newEntry); - System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); + //System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); newEntry = newEntry("Jane Bond"); - System.out.println(">>> post entry=" + newEntry.getTitle()); + //System.out.println(">>> post entry=" + newEntry.getTitle()); newEntry = resourceCollection.post(newEntry); - System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); + //System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); - System.out.println(">>> get id=" + newEntry.getId()); + //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("<<< get id=" + entry.getId() + " entry=" + entry.getTitle()); - System.out.println(">>> put id=" + newEntry.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("<<< put id=" + entry.getId() + " entry=" + entry.getTitle()); - System.out.println(">>> delete id=" + entry.getId()); + //System.out.println(">>> delete id=" + entry.getId()); resourceCollection.delete(entry.getId().toString()); - System.out.println("<<< delete id=" + entry.getId()); + //System.out.println("<<< delete id=" + entry.getId()); - System.out.println(">>> get collection"); + //System.out.println(">>> get collection"); Feed feed = resourceCollection.getFeed(); - System.out.println("<<< get collection"); + //System.out.println("<<< get collection"); for (Object o : feed.getEntries()) { Entry e = (Entry)o; - System.out.println("id = " + e.getId() + " entry = " + e.getTitle()); + //System.out.println("id = " + e.getId() + " entry = " + e.getTitle()); } } diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java index 0cc1b94825..d4d925ee01 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java @@ -95,7 +95,7 @@ public class ContentNegotiationTest { @Test
public void testPost() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testPost");
+ //System.out.println(">>>ContentNegotiationTest.testPost");
// Testing of entry creation
Factory factory = abdera.getFactory();
String customerName = "Fred Farkle";
@@ -134,7 +134,7 @@ public class ContentNegotiationTest { @Test
public void testXMLEntryGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testXMLEntryGet");
+ //System.out.println(">>>ContentNegotiationTest.testXMLEntryGet");
RequestOptions opts = new RequestOptions();
opts.setHeader( "Accept", "application/atom+xml" );
@@ -148,7 +148,7 @@ public class ContentNegotiationTest { @Test
public void testJSONEntryGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testJSONEntryGet");
+ //System.out.println(">>>ContentNegotiationTest.testJSONEntryGet");
RequestOptions opts = new RequestOptions();
opts.setHeader( "Accept", "application/json" );
@@ -178,7 +178,7 @@ public class ContentNegotiationTest { @Test
public void testXMLFeedGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testXMLFeedGet");
+ //System.out.println(">>>ContentNegotiationTest.testXMLFeedGet");
RequestOptions opts = new RequestOptions();
opts.setHeader( "Accept", "application/atom+xml" );
@@ -210,7 +210,7 @@ public class ContentNegotiationTest { @Test
public void testJSONFeedGet() throws Exception {
- System.out.println(">>>ContentNegotiationTest.testJSONFeedGet");
+ //System.out.println(">>>ContentNegotiationTest.testJSONFeedGet");
RequestOptions opts = new RequestOptions();
opts.setHeader( "Accept", "application/json" );
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java index 0aefce608b..c671954689 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java @@ -36,33 +36,33 @@ public class CustomerClientImpl implements CustomerClient { public void testCustomerCollection() throws Exception { Entry newEntry = newEntry("Sponge Bob"); - System.out.println(">>> post entry=" + newEntry.getTitle()); + //System.out.println(">>> post entry=" + newEntry.getTitle()); newEntry = customerCollection.post(newEntry); - System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); + //System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); newEntry = newEntry("Jane Bond"); - System.out.println(">>> post entry=" + newEntry.getTitle()); + //System.out.println(">>> post entry=" + newEntry.getTitle()); newEntry = customerCollection.post(newEntry); - System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); + //System.out.println("<<< post id=" + newEntry.getId() + " entry=" + newEntry.getTitle()); - System.out.println(">>> get id=" + newEntry.getId()); + //System.out.println(">>> get id=" + newEntry.getId()); Entry entry = customerCollection.get(newEntry.getId().toString()); - System.out.println("<<< get id=" + entry.getId() + " entry=" + entry.getTitle()); + //System.out.println("<<< get id=" + entry.getId() + " entry=" + entry.getTitle()); - System.out.println(">>> put id=" + newEntry.getId() + " entry=" + entry.getTitle()); + //System.out.println(">>> put id=" + newEntry.getId() + " entry=" + entry.getTitle()); customerCollection.put(entry.getId().toString(), updateEntry(entry, "James Bond")); - System.out.println("<<< put id=" + entry.getId() + " entry=" + entry.getTitle()); + //System.out.println("<<< put id=" + entry.getId() + " entry=" + entry.getTitle()); - System.out.println(">>> delete id=" + entry.getId()); + //System.out.println(">>> delete id=" + entry.getId()); customerCollection.delete(entry.getId().toString()); - System.out.println("<<< delete id=" + entry.getId()); + //System.out.println("<<< delete id=" + entry.getId()); - System.out.println(">>> get collection"); + //System.out.println(">>> get collection"); Feed feed = customerCollection.getFeed(); - System.out.println("<<< get collection"); + //System.out.println("<<< get collection"); for (Object o : feed.getEntries()) { Entry e = (Entry)o; - System.out.println("id = " + e.getId() + " entry = " + e.getTitle()); + //System.out.println("id = " + e.getId() + " entry = " + e.getTitle()); } } diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java index 222dc3e394..f62ad6110f 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java @@ -46,7 +46,7 @@ public class CustomerCollectionImpl implements Collection { } public Entry post(Entry entry) { - System.out.println(">>> CustomerCollectionImpl.post entry=" + entry.getTitle()); + //System.out.println(">>> CustomerCollectionImpl.post entry=" + entry.getTitle()); if(!("Exception_Test".equalsIgnoreCase(entry.getTitle()))) { @@ -60,7 +60,7 @@ public class CustomerCollectionImpl implements Collection { lastModified = now; entries.put(id, entry); - System.out.println(">>> CustomerCollectionImpl.post return id=" + id); + //System.out.println(">>> CustomerCollectionImpl.post return id=" + id); return entry; @@ -72,12 +72,12 @@ public class CustomerCollectionImpl implements Collection { } public Entry get(String id) { - System.out.println(">>> CustomerCollectionImpl.get id=" + id); + //System.out.println(">>> CustomerCollectionImpl.get id=" + id); return entries.get(id); } public void put(String id, Entry entry) throws NotFoundException { - System.out.println(">>> CustomerCollectionImpl.put id=" + id + " entry=" + entry.getTitle()); + //System.out.println(">>> CustomerCollectionImpl.put id=" + id + " entry=" + entry.getTitle()); if(entries.containsKey(id)){ Date now = new Date(); entry.setUpdated(now); @@ -90,7 +90,7 @@ public class CustomerCollectionImpl implements Collection { } public void delete(String id) throws NotFoundException { - System.out.println(">>> CustomerCollectionImpl.delete id=" + id); + //System.out.println(">>> CustomerCollectionImpl.delete id=" + id); if(entries.containsKey(id)){ entries.remove(id); lastModified = new Date(); @@ -101,7 +101,7 @@ public class CustomerCollectionImpl implements Collection { } public Feed getFeed() { - System.out.println(">>> CustomerCollectionImpl.getFeed"); + //System.out.println(">>> CustomerCollectionImpl.getFeed"); Feed feed = this.abdera.getFactory().newFeed(); feed.setId("customers" + this.hashCode() ); // provide unique id for feed instance. @@ -119,7 +119,7 @@ public class CustomerCollectionImpl implements Collection { } public Feed query(String queryString) { - System.out.println(">>> CustomerCollectionImpl.query collection " + queryString); + //System.out.println(">>> CustomerCollectionImpl.query collection " + queryString); return getFeed(); } diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java index d1d6135108..606d97fefe 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java @@ -44,7 +44,7 @@ public class MediaCollectionImpl implements MediaCollection { public Date lastModified = new Date(); public Entry post(Entry entry) { - System.out.println(">>> MediaCollectionImpl.post entry=" + entry.getTitle()); + //System.out.println(">>> MediaCollectionImpl.post entry=" + entry.getTitle()); if(!("Exception_Test".equalsIgnoreCase(entry.getTitle()))) { @@ -58,7 +58,7 @@ public class MediaCollectionImpl implements MediaCollection { lastModified = now; entries.put(id, entry); - System.out.println(">>> MediaCollectionImpl.post return id=" + id); + //System.out.println(">>> MediaCollectionImpl.post return id=" + id); return entry; @@ -70,12 +70,12 @@ public class MediaCollectionImpl implements MediaCollection { } public Entry get(String id) { - System.out.println(">>> MediaCollectionImpl.get id=" + id); + //System.out.println(">>> MediaCollectionImpl.get id=" + id); return entries.get(id); } public void put(String id, Entry entry) throws NotFoundException { - System.out.println(">>> MediaCollectionImpl.put id=" + id + " entry=" + entry.getTitle()); + //System.out.println(">>> MediaCollectionImpl.put id=" + id + " entry=" + entry.getTitle()); if(entries.containsKey(id)){ Date now = new Date(); entry.setUpdated(now); @@ -88,7 +88,7 @@ public class MediaCollectionImpl implements MediaCollection { } public void delete(String id) throws NotFoundException { - System.out.println(">>> MediaCollectionImpl.delete id=" + id); + //System.out.println(">>> MediaCollectionImpl.delete id=" + id); if(entries.containsKey(id)){ entries.remove(id); lastModified = new Date(); @@ -99,7 +99,7 @@ public class MediaCollectionImpl implements MediaCollection { } public Feed getFeed() { - System.out.println(">>> MediaCollectionImpl.getFeed"); + //System.out.println(">>> MediaCollectionImpl.getFeed"); Feed feed = this.abdera.getFactory().newFeed(); feed.setId("customers" + this.hashCode() ); // provide unique id for feed instance. @@ -117,7 +117,7 @@ public class MediaCollectionImpl implements MediaCollection { } public Feed query(String queryString) { - System.out.println(">>> MediaCollectionImpl.query collection " + queryString); + //System.out.println(">>> MediaCollectionImpl.query collection " + queryString); return getFeed(); } @@ -146,7 +146,7 @@ public class MediaCollectionImpl implements MediaCollection { // MediaCollection role public Entry postMedia(String title, String slug, String contentType, InputStream media) { - System.out.println(">>> MediaCollectionImpl.postMedia title=" + title + ", slug=" + slug + ", contentType=" + contentType ); + //System.out.println(">>> MediaCollectionImpl.postMedia title=" + title + ", slug=" + slug + ", contentType=" + contentType ); Factory factory = abdera.getFactory(); Entry entry = factory.newEntry(); @@ -196,7 +196,7 @@ public class MediaCollectionImpl implements MediaCollection { } public void putMedia(String id, String contentType, InputStream media) throws NotFoundException { - System.out.println(">>> MediaCollectionImpl.putMedia id=" + id + ", contentType=" + contentType ); + //System.out.println(">>> MediaCollectionImpl.putMedia id=" + id + ", contentType=" + contentType ); // Must responsd with success or not found as per Atom Pub spec (http://tools.ietf.org/html/rfc5023#section-9.6) // Body is null. diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java index 59fce99751..a5f6d3074e 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java @@ -82,7 +82,7 @@ public class ProviderFeedEntityTagsTestCase { @AfterClass public static void destroy() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.destroy"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.destroy"); if (scaProviderNode != null) { scaProviderNode.stop(); scaProviderNode.destroy(); @@ -97,7 +97,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testFeedBasics() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedBasics"); + // System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedBasics"); // Normal feed request ClientResponse res = client.get(providerURI); Assert.assertNotNull(res); @@ -129,7 +129,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testUnmodifiedGetIfMatch() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfMatch"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfMatch"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; @@ -157,7 +157,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testUnmodifiedGetIfNoneMatch() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfNoneMatch"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfNoneMatch"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; @@ -176,7 +176,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testUnmodifiedGetIfUnModified() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfUnModified"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfUnModified"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; @@ -195,7 +195,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testUnmodifiedGetIfModified() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfModified"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfModified"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; @@ -220,7 +220,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testModifiedGetIfNoneMatch() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedModifiedGetIfNoneMatch"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedModifiedGetIfNoneMatch"); // Post some new content to the feed. Factory factory = abdera.getFactory(); String customerName = "Fred Farkle"; @@ -260,7 +260,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testModifiedGetIfMatch() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedModifiedGetIfMatch"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedModifiedGetIfMatch"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; @@ -289,7 +289,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testModifiedGetIfUnModified() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfUnModified"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfUnModified"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; @@ -308,7 +308,7 @@ public class ProviderFeedEntityTagsTestCase { @Test public void testModifiedGetIfModified() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfModified"); + //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfModified"); // Feed request with predicates RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java index b2981d30de..b407d5aac5 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java +++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java @@ -49,7 +49,7 @@ public class AggregatorTestCase { node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite", new Contribution("test", contribution)); node.start(); - aggregatorService = node.getService(Aggregator.class, "AtomAggregator"); + aggregatorService = node.getService(Aggregator.class, "AtomAggregator/Aggregator"); Assert.assertNotNull(aggregatorService); } catch (Exception e) { e.printStackTrace(); diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite index 9b65cd9d5b..a50a876ac4 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite +++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite @@ -33,7 +33,6 @@ <tuscany:binding.atom uri = "http://localhost:8084/customer"
title="Atom binding Non Collection" description="Feed used for unit testing"/>
</service>
-
</component>
-
+
</composite>
diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite index d6722a80dd..35e25957fb 100644 --- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite +++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite @@ -38,7 +38,9 @@ <reference name="atomFeed2"> <tuscany:binding.atom uri="https://blogs.apache.org/foundation/feed/entries/atom"/> </reference> - <property name="feedTitle">Atom Aggregator Sample</property> + <property name="feedTitle">Atom Aggregator Sample</property> + <property name="feedDescription">Anonymous Aggregated Feed</property> + <property name="feedAuthor">anonymous</property> </component> <component name="Sort"> |