summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-09-02 04:22:27 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-09-02 04:22:27 +0000
commit60b0359c6b93e39dbfcdab2e62b3b0fb602e02c6 (patch)
tree8d0afc819dfe5d641b862b67fcd1cbcd543f0c1d /branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
parent5e63e21cefacdeb0e5abfc71259733abe68804c8 (diff)
Conversion to JUnit 4.5 + Cleaning up System.out
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@810355 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java')
-rw-r--r--branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java47
1 files changed, 21 insertions, 26 deletions
diff --git a/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java b/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
index 474d669ff0..459c2f6933 100644
--- a/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
+++ b/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
@@ -21,50 +21,44 @@ package org.apache.tuscany.sca.binding.gdata;
import java.net.URL;
-import junit.framework.TestCase;
+import junit.framework.Assert;
import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import com.google.gdata.client.Query;
-import com.google.gdata.data.DateTime;
import com.google.gdata.data.Entry;
import com.google.gdata.data.Feed;
-import com.google.gdata.data.PlainTextConstruct;
-public class GoogleWebAlbumServiceTestCase extends TestCase{
+public class GoogleWebAlbumServiceTestCase {
- private SCADomain scaDomainConsumer = null;
- private CustomerClient testService = null;
+ private static SCADomain scaDomainConsumer = null;
+ private static CustomerClient testService = null;
public GoogleWebAlbumServiceTestCase(){
}
- @Before
- @Override
- public void setUp() throws Exception {
- System.out.println("Method Test Start-----------------------------------------------------------------------");
-
+ @BeforeClass
+ public static void setUp() throws Exception {
//Initialize the GData client service (Reference Binding test)
scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/ConsumerGoogleWebAlbum.composite");
testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");
}
- @After
- @Override
- public void tearDown(){
- System.out.println("Method Test End------------------------------------------------------------------------");
- System.out.println("\n\n");
+ @AfterClass
+ public static void tearDown(){
+ scaDomainConsumer.close();
}
@Test
public void testClientGetFeed() throws Exception {
Feed feed = testService.clientGetFeed();
- System.out.println("feed title: " + feed.getTitle().getPlainText());
- assertEquals("flowers", feed.getTitle().getPlainText());
+ //System.out.println("feed title: " + feed.getTitle().getPlainText());
+ Assert.assertEquals("flowers", feed.getTitle().getPlainText());
}
@@ -74,9 +68,9 @@ public class GoogleWebAlbumServiceTestCase extends TestCase{
public void testClientGetEntry() throws Exception {
String entryID = "photoid/5233468700029715874";
Entry contactEntry = testService.clientGetEntry(entryID);
- System.out.println("Entry ID: " + contactEntry.getId());
- assertTrue(contactEntry.getId().endsWith(entryID));
- System.out.println("------------------------------------------------------------\n\n");
+ //System.out.println("Entry ID: " + contactEntry.getId());
+ Assert.assertTrue(contactEntry.getId().endsWith(entryID));
+ //System.out.println("------------------------------------------------------------\n\n");
}
@@ -88,8 +82,8 @@ public class GoogleWebAlbumServiceTestCase extends TestCase{
myQuery.setMaxResults(100);
myQuery.setFullTextQuery("photo");
Feed resultFeed = testService.clientQuery(myQuery);
- System.out.println("Query result feed title: " + resultFeed.getTitle().getPlainText());
- System.out.println("Query result entry number: "+ resultFeed.getEntries().size());
+ //System.out.println("Query result feed title: " + resultFeed.getTitle().getPlainText());
+ //System.out.println("Query result entry number: "+ resultFeed.getEntries().size());
//assertEquals("gdata binding tuscany test", resultFeed.getTitle().getPlainText());
}
@@ -102,11 +96,12 @@ public class GoogleWebAlbumServiceTestCase extends TestCase{
testService.clientPut(entryID, newBlogEntryTitle); //update the title
Thread.sleep(Constants.SLEEP_INTERVAL);
Entry updatedEntry = testService.clientGetEntry(entryID);
- assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
+ Assert.assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
}
@Test
+ @Ignore("Not testing anything")
public void testClientDelete() throws Exception {
//Tested and it worked, but only once because we can not delete the same entry twice