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 2009/10/08 08:01:57 UTC
svn commit: r823047 - in
/tuscany/java/sca/modules/binding-atom-runtime/src/test:
java/org/apache/tuscany/sca/binding/atom/
java/org/apache/tuscany/sca/binding/atom/aggregator/
resources/org/apache/tuscany/sca/binding/atom/
resources/org/apache/tuscany...
Author: lresende
Date: Thu Oct 8 06:01:56 2009
New Revision: 823047
URL: http://svn.apache.org/viewvc?rev=823047&view=rev
Log:
Bringing up Atom Binding tests that were failing
Modified:
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java
tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite
tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java Thu Oct 8 06:01:56 2009
@@ -71,12 +71,12 @@
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());
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java Thu Oct 8 06:01:56 2009
@@ -29,6 +29,10 @@
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 @@
* 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 @@
* 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 @@
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 @@
@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 @@
}
/**
- * 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 @@
// 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());
+ }
}
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java Thu Oct 8 06:01:56 2009
@@ -67,17 +67,17 @@
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 @@
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());
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java Thu Oct 8 06:01:56 2009
@@ -67,13 +67,13 @@
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());
}
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java Thu Oct 8 06:01:56 2009
@@ -70,15 +70,15 @@
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 @@
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();
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java Thu Oct 8 06:01:56 2009
@@ -102,33 +102,33 @@
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());
}
}
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java Thu Oct 8 06:01:56 2009
@@ -95,7 +95,7 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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" );
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java Thu Oct 8 06:01:56 2009
@@ -36,33 +36,33 @@
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());
}
}
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java Thu Oct 8 06:01:56 2009
@@ -46,7 +46,7 @@
}
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 @@
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 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 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 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 Feed query(String queryString) {
- System.out.println(">>> CustomerCollectionImpl.query collection " + queryString);
+ //System.out.println(">>> CustomerCollectionImpl.query collection " + queryString);
return getFeed();
}
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java Thu Oct 8 06:01:56 2009
@@ -44,7 +44,7 @@
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 @@
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 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 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 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 Feed query(String queryString) {
- System.out.println(">>> MediaCollectionImpl.query collection " + queryString);
+ //System.out.println(">>> MediaCollectionImpl.query collection " + queryString);
return getFeed();
}
@@ -146,7 +146,7 @@
// 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 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.
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java Thu Oct 8 06:01:56 2009
@@ -82,7 +82,7 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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 @@
@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";
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java Thu Oct 8 06:01:56 2009
@@ -49,7 +49,7 @@
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();
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite Thu Oct 8 06:01:56 2009
@@ -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>
Modified: tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite?rev=823047&r1=823046&r2=823047&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite (original)
+++ tuscany/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite Thu Oct 8 06:01:56 2009
@@ -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">