tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r810356 - in /tuscany/branches/sca-java-1.x/modules: binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/ binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/ binding-gdata/src/main/java/or...
Date Wed, 02 Sep 2009 04:29:05 GMT
Author: lresende
Date: Wed Sep  2 04:29:04 2009
New Revision: 810356

URL: http://svn.apache.org/viewvc?rev=810356&view=rev
Log:
Conversion to JUnit 4.5 + Cleaning up System.out

Modified:
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
    tuscany/branches/sca-java-1.x/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingInvoker.java Wed Sep  2 04:29:04 2009
@@ -140,7 +140,7 @@
         @Override
         public Message invoke(Message msg) {
 
-            System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- invoke method reached");
+            //System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- invoke method reached");
             // Post an entry
             Object[] args = (Object[])msg.getBody();
             com.google.gdata.data.Entry feedEntry = null;
@@ -149,10 +149,10 @@
 
                 // Expect an GData entry
 
-                System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- supportsFeedEntries: " + provider.supportsFeedEntries());
+                //System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- supportsFeedEntries: " + provider.supportsFeedEntries());
                 feedEntry = (com.google.gdata.data.Entry)args[0];
 
-                System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- feedEntry title: " + feedEntry.getTitle().getPlainText());
+                //System.out.println("[Debug Info]GdataBindingInvoker.PostInvoker --- feedEntry title: " + feedEntry.getTitle().getPlainText());
 
             } else {
                 // Expect a key and data item
@@ -222,7 +222,7 @@
                 
                 com.google.gdata.data.Entry toUpdateEntry = googleService.getEntry(entryURL, com.google.gdata.data.Entry.class);
                 
-                System.out.println("EditHtml:" + toUpdateEntry.getEditLink().getHref());
+                //System.out.println("EditHtml:" + toUpdateEntry.getEditLink().getHref());
                 
                 URL editURL = new URL(toUpdateEntry.getEditLink().getHref());
                 
@@ -269,7 +269,7 @@
                 
                com.google.gdata.data.Entry toUpdateEntry = googleService.getEntry(entryURL, com.google.gdata.data.Entry.class);
                 
-               System.out.println("EditHtml:" + toUpdateEntry.getEditLink().getHref());
+               //System.out.println("EditHtml:" + toUpdateEntry.getEditLink().getHref());
                 
                URL editURL = new URL(toUpdateEntry.getEditLink().getHref());
     
@@ -309,7 +309,7 @@
             GetMethod getMethod = new GetMethod(uri);
             getMethod.setRequestHeader("Authorization", authorizationHeader);
 
-            System.out.println("[Debug Info] GdataBindingInvoker.GetAllInvoker.invoke---feedURL: " + uri);
+            //System.out.println("[Debug Info] GdataBindingInvoker.GetAllInvoker.invoke---feedURL: " + uri);
 
             try {
 
@@ -354,7 +354,7 @@
             Object[] args = (Object[])msg.getBody();
             Query myQuery = (Query)args[0];
             
-            System.out.println("[Debug Info] GdataBindingInvoker.QueryInvoker.invoke---feedURL: " + uri);
+            //System.out.println("[Debug Info] GdataBindingInvoker.QueryInvoker.invoke---feedURL: " + uri);
 
             try {
 

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataBindingListenerServlet.java Wed Sep  2 04:29:04 2009
@@ -158,7 +158,7 @@
         qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
         itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
 
-        System.out.println("[Debug Info]GdataBindingListenerServlet --- initilized!");
+        //System.out.println("[Debug Info]GdataBindingListenerServlet --- initilized!");
     }
 
     
@@ -166,14 +166,13 @@
     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
 
         // No authentication required for a get request
-        System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- I am good here 00");
+        //System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- I am good here 00");
 
         // Get the request path
         String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
 
-        System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- request.getRequestURI():  " + request
-            .getRequestURI());
-        System.out.println("[Debug Info]GdataBindingListenerServlet doGet()--- path: " + path);
+        //System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- request.getRequestURI():  " + request.getRequestURI());
+        //System.out.println("[Debug Info]GdataBindingListenerServlet doGet()--- path: " + path);
 
         // FIXME: Log this get http request, commented out for testing
         logger.fine("get " + request.getRequestURI());
@@ -218,25 +217,25 @@
 
             // get HTTP request asking for a feed
 
-            System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- I am good here brach 02");
+            //System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- I am good here brach 02");
 
             // Return a feed containing the entries in the collection
             com.google.gdata.data.Feed feed = null;
 
             if (supportsFeedEntries) {
 
-                System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- supportsFeedEntries: " + supportsFeedEntries);
+                //System.out.println("[Debug Info]GdataBindingListenerServlet doGet() --- supportsFeedEntries: " + supportsFeedEntries);
 
                 // The service implementation supports feed entries, invoke its
                 // getFeed operation
                 Message requestMessage = messageFactory.createMessage();
                 Message responseMessage;
                 if (request.getQueryString() != null) {
-                    System.out.println("getQueryString != null");
+                    //System.out.println("getQueryString != null");
                     requestMessage.setBody(new Object[] {request.getQueryString()});
                     responseMessage = queryInvoker.invoke(requestMessage);
                 } else {
-                    System.out.println("getQueryString == null");
+                    //System.out.println("getQueryString == null");
                     responseMessage = getFeedInvoker.invoke(requestMessage);
                 }
                 if (responseMessage.isFault()) {
@@ -247,11 +246,11 @@
 
                 feed = (com.google.gdata.data.Feed)responseMessage.getBody();
 
-                System.out.println("feed title: " + feed.getTitle().getPlainText());
+                //System.out.println("feed title: " + feed.getTitle().getPlainText());
 
             } else {
 
-                System.out.println("GdataBindingListenerServlet doGet(): do not supportsFeedEntries");
+                //System.out.println("GdataBindingListenerServlet doGet(): do not supportsFeedEntries");
 
                 // The service implementation does not support feed entries,
                 // invoke its getAll operation to get the data item collection,
@@ -317,7 +316,7 @@
                 out.println(stringWriter.toString());
                 out.close();
 
-                System.out.println("Feed content in plain text:" + stringWriter.toString());
+                //System.out.println("Feed content in plain text:" + stringWriter.toString());
             } else {
                 response.sendError(HttpServletResponse.SC_NOT_FOUND);
             }
@@ -342,7 +341,7 @@
                 // The service implementation returns a feed entry
                 feedEntry = (com.google.gdata.data.Entry)responseMessage.getBody();
 
-                System.out.println("entry title: " + feedEntry.getTitle().getPlainText());
+                //System.out.println("entry title: " + feedEntry.getTitle().getPlainText());
 
             } else {
                 // The service implementation only returns a data item, create
@@ -387,7 +386,7 @@
     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
         IOException {
 
-        System.out.println("[Debug Info]GdataBindingListenerServlet doPost() --- reached");
+        //System.out.println("[Debug Info]GdataBindingListenerServlet doPost() --- reached");
 
         // Authenticate the user
         String user = processAuthorizationHeader(request);
@@ -399,7 +398,7 @@
         // Get the request path
         String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
 
-        System.out.println("[Debug Info]GdataBindingListenerServlet path --- " + path);
+        //System.out.println("[Debug Info]GdataBindingListenerServlet path --- " + path);
 
         if (path == null || path.length() == 0 || path.equals("/")) {
             // Create a new Gdata entry
@@ -534,7 +533,7 @@
         // Get the request path
         String path = request.getRequestURI().substring(request.getServletPath().length());
 
-        System.out.println("[Debug Info] localServlet doPut --- path: " + path);
+        //System.out.println("[Debug Info] localServlet doPut --- path: " + path);
         
         if (path != null && path.startsWith("/")) {
             String id = path.substring(1);
@@ -549,7 +548,7 @@
                     ParseSource source = new ParseSource(request.getReader());
                     feedEntry = com.google.gdata.data.Entry.readEntry(source, com.google.gdata.data.Entry.class, null);
                 
-                    System.out.println("[Debug Info] localServlet doPut --- feedEntry title: " + feedEntry.getTitle().getPlainText());
+                    //System.out.println("[Debug Info] localServlet doPut --- feedEntry title: " + feedEntry.getTitle().getPlainText());
                 } catch (ParseException pe) {
                     throw new ServletException(pe);
                 } catch (com.google.gdata.util.ParseException e) {
@@ -565,7 +564,7 @@
                 // Let the component implementation create it
                 if (supportsFeedEntries) {
 
-                    System.out.println("[Debug Info] localServlet doPut --- supportsFeedEntries: " + supportsFeedEntries);
+                    //System.out.println("[Debug Info] localServlet doPut --- supportsFeedEntries: " + supportsFeedEntries);
                     
                     // The service implementation supports feed entries, pass
                     // the entry to it

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/main/java/org/apache/tuscany/sca/binding/gdata/provider/GdataReferenceBindingProvider.java Wed Sep  2 04:29:04 2009
@@ -88,9 +88,9 @@
         String usernane = binding.getUsername();
         String password = binding.getPassword();
         
-        System.out.println("[Debug Info] binding.getServiceType()" + serviceType);
-        System.out.println("[Debug Info] binding.getName()" +usernane);
-        System.out.println("[Debug Info] binding.getPassword()" + password);    
+        //System.out.println("[Debug Info] binding.getServiceType()" + serviceType);
+        //System.out.println("[Debug Info] binding.getName()" +usernane);
+        //System.out.println("[Debug Info] binding.getPassword()" + password);    
         
         googleService = new GoogleService(serviceType, "");
         if(binding.getUsername().equals("admin") == false && binding.getPassword().equals("admin")==false){

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/Consumer.java Wed Sep  2 04:29:04 2009
@@ -36,7 +36,7 @@
         
         Feed feed = testService.clientGetFeed();
         
-        System.out.println("#Entries(Before post): "+ testService.clientGetFeed().getEntries().size());
+        //System.out.println("#Entries(Before post): "+ testService.clientGetFeed().getEntries().size());
         
         /*
         String entryID = "tag:blogger.com,1999:blog-4520949313432095990.post-973462497533349425";
@@ -49,11 +49,11 @@
         myEntry.setContent(new PlainTextConstruct("contentByConsmer2"));
         testService.clientPost(myEntry);
         
-        System.out.println("#Entries(After post): "+ testService.clientGetFeed().getEntries().size());
+        //System.out.println("#Entries(After post): "+ testService.clientGetFeed().getEntries().size());
         
         String entryID = "tag:blogger.com,1999:blog-4520949313432095990.post-973462497533349425";
         Entry entry = testService.clientGetEntry(entryID);
-        System.out.println("Entry id: " + entry.getId());
+        //System.out.println("Entry id: " + entry.getId());
 
        
     }

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/ConsumerProviderTestCase.java Wed Sep  2 04:29:04 2009
@@ -19,60 +19,57 @@
 
 package org.apache.tuscany.sca.binding.gdata;
 
-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.Test;
+
 import com.google.gdata.data.Entry;
 import com.google.gdata.data.Feed;
 import com.google.gdata.data.PlainTextConstruct;
 
-public class ConsumerProviderTestCase extends TestCase {
+public class ConsumerProviderTestCase {
 
-    private SCADomain scaDomainProvider = null;
-    private SCADomain scaDomainConsumer = null;
-    private CustomerClient testService = null;
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        System.out.println("Method Test Start-----------------------------------------------------------------------");
+    private static SCADomain scaDomainProvider = null;
+    private static SCADomain scaDomainConsumer = null;
+    private static CustomerClient testService = null;
 
+    @BeforeClass
+    public static void setUp() throws Exception {
         // Setup the local GData servlet (Service Binding test)
         scaDomainProvider = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Provider.composite");
-        System.out.println("[Debug Info] Provider.composite ready...");
+        //System.out.println("[Debug Info] Provider.composite ready...");
 
         // Initialize the GData client service (Reference Binding test)
         scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/Consumer.composite");
         testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");
     }
 
-    @After
-    @Override
-    public void tearDown() {
+    @AfterClass
+    public static void tearDown() {
+        scaDomainConsumer.close();
         scaDomainProvider.close();
-        System.out.println("Method Test End------------------------------------------------------------------------");
-        System.out.println("\n\n");
     }
     
         
     @Test
     public void testClientGetFeed() throws Exception {
         Feed feed = testService.clientGetFeed();
-        System.out.println(feed.getTitle().getPlainText());
-        assertNotNull(feed);
+        //System.out.println(feed.getTitle().getPlainText());
+        Assert.assertNotNull(feed);
         // Given we are testing on the localhost providing feed, we know the
         // feed title is "Feedtitle(LocalHostServlet)"
-        assertEquals("Feedtitle(LocalHostServlet)", feed.getTitle().getPlainText());
+        Assert.assertEquals("Feedtitle(LocalHostServlet)", feed.getTitle().getPlainText());
     }
 
     @Test
     public void testClientGetEntry() throws Exception {
         String entryID = "urn:uuid:customer-0";
         Entry entry = testService.clientGetEntry(entryID);
-        System.out.println("entryID in testcase: " + entry.getId());
-        assertEquals(entryID, entry.getId());
+        //System.out.println("entryID in testcase: " + entry.getId());
+        Assert.assertEquals(entryID, entry.getId());
     }
 
     @Test
@@ -81,7 +78,7 @@
         newEntry.setTitle(new PlainTextConstruct("NewEntry title by Post"));
         newEntry.setContent(new PlainTextConstruct("NewEntry Content by Post"));        
         Entry postedEntry = testService.clientPost(newEntry);        
-        assertEquals("NewEntry title by Post", postedEntry.getTitle().getPlainText());
+        Assert.assertEquals("NewEntry title by Post", postedEntry.getTitle().getPlainText());
     }
     
   
@@ -90,12 +87,12 @@
     public void testClientPut() throws Exception {
         String newTitleValue = "newTitleValueByPut";
         String entryID = "urn:uuid:customer-0";
-        System.out.println("Before clientPut");
+        //System.out.println("Before clientPut");
         testService.clientPut(entryID, newTitleValue);
-        System.out.println("After clientPut");
+        //System.out.println("After clientPut");
         Entry updatedEntry = testService.clientGetEntry(entryID);
-        System.out.println("title: "+ updatedEntry.getTitle().getPlainText());
-        assertEquals(newTitleValue, updatedEntry.getTitle().getPlainText());
+        //System.out.println("title: "+ updatedEntry.getTitle().getPlainText());
+        Assert.assertEquals(newTitleValue, updatedEntry.getTitle().getPlainText());
     }
     
 
@@ -116,22 +113,22 @@
         Feed feed00 = testService.clientGetFeed();
         int entryNum00 = feed00.getEntries().size(); // The number of entries
                                                         // before deleting
-        System.out.println("entryNum00:" + entryNum00);
+        //System.out.println("entryNum00:" + entryNum00);
                 
         // Delete this newly created entry
         String entryID = confirmedNewEntry.getId();
         Thread.sleep(300);
         
-        System.out.println("confirmed entry ID: " + confirmedNewEntry.getId());
-        System.out.println("confirmed entry title: " + confirmedNewEntry.getTitle().getPlainText());
+        //System.out.println("confirmed entry ID: " + confirmedNewEntry.getId());
+        //System.out.println("confirmed entry title: " + confirmedNewEntry.getTitle().getPlainText());
         
-        System.out.println("Before test clientDelete");
+        //System.out.println("Before test clientDelete");
         testService.clientDelete(entryID);
-        System.out.println("After test clientDelete");
+        //System.out.println("After test clientDelete");
         
         Feed feed01 = testService.clientGetFeed();
         int entryNum01 = feed01.getEntries().size();
-        System.out.println("entryNum01:" + entryNum01); // The number of entries after deleting
+        //System.out.println("entryNum01:" + entryNum01); // The number of entries after deleting
         
         //assertEquals(1, entryNum00 - entryNum01);
     }

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerClientImpl.java Wed Sep  2 04:29:04 2009
@@ -36,14 +36,14 @@
     // Call Collection.getFeed()
     public Feed clientGetFeed() throws Exception {
         // Get all the entries from the provider, return in a single feed
-        System.out.println(">>> get the feed from the provider service");
+        //System.out.println(">>> get the feed from the provider service");
         Feed feed = resourceCollection.getFeed();
-        System.out.println("\n\n!!! Fetched feed title:  " + feed.getTitle().getPlainText());
+        //System.out.println("\n\n!!! Fetched feed title:  " + feed.getTitle().getPlainText());
         int i = 0;
         for (Object o : feed.getEntries()) {
             com.google.gdata.data.Entry e = (com.google.gdata.data.Entry)o;
-            System.out.print("Entry" + i + "\t");
-            System.out.println(" id = " + e.getId() + "\t title = " + e.getTitle().getPlainText());
+            //System.out.print("Entry" + i + "\t");
+            //System.out.println(" id = " + e.getId() + "\t title = " + e.getTitle().getPlainText());
             i++;
         }
         return feed;
@@ -53,11 +53,11 @@
     // Call Collection.get(entryID)
     public Entry clientGetEntry(String entryID) throws Exception {
         // Get an existing entry based on its id
-        System.out.println(">>> get an existing entry from the provider service");
+        //System.out.println(">>> get an existing entry from the provider service");
         Entry entry = resourceCollection.get(entryID);
-        System.out.println("\n\n!!! Entry retrieved with id=" + entry.getId()
-            + " title="
-            + entry.getTitle().getPlainText());
+        //System.out.println("\n\n!!! Entry retrieved with id=" + entry.getId()
+        //    + " title="
+        //    + entry.getTitle().getPlainText());
         return entry;
     }
 
@@ -65,12 +65,11 @@
     // Call Collection.post(newEntry)
     public Entry clientPost(Entry newEntry) throws Exception {
         // Put a new entry to the provider
-        System.out.println(">>> post a new entry to the provider service");
+        //System.out.println(">>> post a new entry to the provider service");
         Entry confirmedNewEntry = resourceCollection.post(newEntry);
-        System.out.println("!!! New entry posted with id=" + confirmedNewEntry.getId()
-            + " title="
-            + confirmedNewEntry.getTitle().getPlainText());        
-        System.out.println("\n");
+        //System.out.println("!!! New entry posted with id=" + confirmedNewEntry.getId()
+        //    + " title="
+        //    + confirmedNewEntry.getTitle().getPlainText());        
         return confirmedNewEntry;
     }
 
@@ -78,11 +77,10 @@
     // Call Collection.delete(newEntry)
     public void clientDelete(String entryID) throws Exception {
         // Put a new entry to the provider
-        System.out.println(">>> delete an existing entry from the provider service");
-        System.out.println(">>> delete id=" + "urn:uuid:customer-1");
+        //System.out.println(">>> delete an existing entry from the provider service");
+        //System.out.println(">>> delete id=" + "urn:uuid:customer-1");
         resourceCollection.delete(entryID);
-        System.out.println("!!! entry with id" + entryID);
-        System.out.println("\n");
+        //System.out.println("!!! entry with id" + entryID);
     }
     
     
@@ -90,16 +88,16 @@
     // Call Collection.put(entry, updatedTitle)
     public void clientPut(String entryID, String newTitle) throws Exception {
 
-        System.out.println("clientPut");
+        //System.out.println("clientPut");
         // Put a new entry to the provider
-        System.out.println(">>> put id=" + entryID + " title=" + newTitle);
+        //System.out.println(">>> put id=" + entryID + " title=" + newTitle);
         Entry entry = resourceCollection.get(entryID);
         
         //change the title of this entry
         entry.setTitle(new PlainTextConstruct(newTitle));
         resourceCollection.put(entryID, entry);
-        System.out.println("!!! Updated entry with id=" + entry.getId() + " title=" + entry.getTitle());
-        System.out.println("\n");
+        //System.out.println("!!! Updated entry with id=" + entry.getId() + " title=" + entry.getTitle());
+        //System.out.println("\n");
     }
 
     
@@ -107,14 +105,14 @@
     // Call Collection.getFeed()
     public Feed clientQuery(Query query) throws Exception {
         // Get all the entries from the provider, return in a single feed
-        System.out.println(">>> query the service");
+        //System.out.println(">>> query the service");
         Feed feed = resourceCollection.query(query);
-        System.out.println("\n\n!!! Query result feed title:  " + feed.getTitle().getPlainText());
+        //System.out.println("\n\n!!! Query result feed title:  " + feed.getTitle().getPlainText());
         int i = 0;
         for (Object o : feed.getEntries()) {
             com.google.gdata.data.Entry e = (com.google.gdata.data.Entry)o;
-            System.out.print("Entry" + i + "\t");
-            System.out.println(" id = " + e.getId() + "\t title = " + e.getTitle().getPlainText());
+            //System.out.print("Entry" + i + "\t");
+            //System.out.println(" id = " + e.getId() + "\t title = " + e.getTitle().getPlainText());
             i++;
         }
         return feed;

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/CustomerCollectionImpl.java Wed Sep  2 04:29:04 2009
@@ -69,12 +69,12 @@
             // entry.addHtmlLink(""+id, "", "edit");
             // entry.addHtmlLink(""+id, "", "alternate");
             entries.put(id, entry);
-            System.out.println(">>> id=" + id);
+            //System.out.println(">>> id=" + id);
         }
     }
 
     public Entry post(Entry entry) {
-        System.out.println(">>> ResourceCollectionImpl.post entry=" + entry.getTitle());
+        //System.out.println(">>> ResourceCollectionImpl.post entry=" + entry.getTitle());
 
         String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
         entry.setId(id);
@@ -93,30 +93,30 @@
         // "alternate");
 
         entries.put(id, entry);
-        System.out.println(">>> ResourceCollectionImpl.post return id=" + id);
+        //System.out.println(">>> ResourceCollectionImpl.post return id=" + id);
         return entry;
     }
 
     public Entry get(String id) {
-        System.out.println(">>> ResourceCollectionImpl.get id= " + id);
+        //System.out.println(">>> ResourceCollectionImpl.get id= " + id);
         return entries.get(id);
     }
 
     public void put(String id, Entry entry) {
-        System.out.println(">>> ResourceCollectionImpl.put id=" + id + " entry=" + entry.getTitle().getPlainText());
+        //System.out.println(">>> ResourceCollectionImpl.put id=" + id + " entry=" + entry.getTitle().getPlainText());
         entry.setUpdated(DateTime.now());
         entries.put(id, entry);
     }
     
 
     public void delete(String id) {
-        System.out.println(">>> ResourceCollectionImpl.delete id=" + id);
+        //System.out.println(">>> ResourceCollectionImpl.delete id=" + id);
         entries.remove(id);
     }
 
     
     public Feed getFeed() {
-        System.out.println(">>> ResourceCollectionImpl.get collection");
+        //System.out.println(">>> ResourceCollectionImpl.get collection");
         
         Feed feed = new Feed();
         feed.setTitle(new PlainTextConstruct("Feedtitle(LocalHostServlet)"));
@@ -136,7 +136,7 @@
 
     //FIXME: need to be modified 
     public Feed query(Query query) {
-        System.out.println(">>> ResourceCollectionImpl.query collection ");
+        //System.out.println(">>> ResourceCollectionImpl.query collection ");
         return getFeed();
     }
 

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleBloggerServiceTestCase.java Wed Sep  2 04:29:04 2009
@@ -42,8 +42,6 @@
     
     @BeforeClass
     public static void setUp() throws Exception {
-        System.out.println("Method Test Start-----------------------------------------------------------------------");
-        
         //Initialize the GData client service (Reference Binding test)
         scaDomainConsumer = SCADomain.newInstance("org/apache/tuscany/sca/binding/gdata/ConsumerGoogleBlogger.composite");
         testService = scaDomainConsumer.getService(CustomerClient.class, "CustomerClient");  
@@ -51,14 +49,13 @@
 
     @AfterClass
     public static void tearDown(){
-        System.out.println("Method Test End------------------------------------------------------------------------");
-        System.out.println("\n\n");
+        scaDomainConsumer.close();
     }        
     
     @Test
     public void testClientGetFeed() throws Exception {
         Feed feed = testService.clientGetFeed();
-        System.out.println("feed title: " + feed.getTitle().getPlainText());        
+        //System.out.println("feed title: " + feed.getTitle().getPlainText());        
         Assert.assertEquals("gdata binding tuscany test", feed.getTitle().getPlainText());
      }
     
@@ -67,9 +64,9 @@
     public void testClientGetEntry() throws Exception {
         String entryID = "8308734583601887890";
         Entry blogEntry = testService.clientGetEntry(entryID);
-        System.out.println("Entry ID: " + blogEntry.getId());
+        //System.out.println("Entry ID: " + blogEntry.getId());
         Assert.assertTrue(blogEntry.getId().endsWith(entryID));
-        System.out.println("------------------------------------------------------------\n\n");
+        //System.out.println("------------------------------------------------------------\n\n");
     }
     
     
@@ -102,7 +99,7 @@
         //This test case might fail
         //because Google blogger service has limitation on new posts allowed everyday/every hour?
         
-        System.out.println("testClientDelete");
+        //System.out.println("testClientDelete");
         //We create a new post, and then delete it
         Entry newEntry = new Entry();
         newEntry.setTitle(new PlainTextConstruct("blogEntryShouldNotApear"));
@@ -111,11 +108,11 @@
         Thread.sleep(Constants.SLEEP_INTERVAL);        
         int idStartPosition = postedEntry.getId().lastIndexOf("-");
         String postedEntryID = postedEntry.getId().substring(idStartPosition+1);        
-        System.out.println("postedEntryID: " + postedEntryID );
+        //System.out.println("postedEntryID: " + postedEntryID );
         
         //Before deletion
         Entry entry00 = testService.clientGetEntry(postedEntryID);
-        System.out.println("Before Deleteion: " + entry00.getId());
+        //System.out.println("Before Deleteion: " + entry00.getId());
         
         //Delete this entry
         testService.clientDelete(postedEntryID);
@@ -135,8 +132,8 @@
         //myQuery.setUpdatedMin(startTime);
         myQuery.setUpdatedMax(DateTime.now());
         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());
      }
 

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleCalendarServiceTestCase.java Wed Sep  2 04:29:04 2009
@@ -21,11 +21,11 @@
 
 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.Test;
 
 import com.google.gdata.client.Query;
@@ -34,37 +34,32 @@
 import com.google.gdata.data.Feed;
 import com.google.gdata.data.PlainTextConstruct;
 
-public class GoogleCalendarServiceTestCase extends TestCase{
+public class GoogleCalendarServiceTestCase {
 
-    private SCADomain scaDomainConsumer = null;
-    private CustomerClient testService = null;    
+    private static SCADomain scaDomainConsumer = null;
+    private static CustomerClient testService = null;    
     
     public GoogleCalendarServiceTestCase(){
 
     }
     
-    @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/ConsumerGoogleCalendar.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("gsoc gosc", feed.getTitle().getPlainText());
+        //System.out.println("feed title: " + feed.getTitle().getPlainText());        
+        Assert.assertEquals("gsoc gosc", feed.getTitle().getPlainText());
      }
     
     
@@ -72,9 +67,9 @@
     public void testClientGetEntry() throws Exception {
         String entryID = "1c76lcl70jg9r0fm18rcbneea8";
         Entry blogEntry = testService.clientGetEntry(entryID);
-        System.out.println("Entry ID: " + blogEntry.getId());
-        assertTrue(blogEntry.getId().endsWith(entryID));
-        System.out.println("------------------------------------------------------------\n\n");
+        //System.out.println("Entry ID: " + blogEntry.getId());
+        Assert.assertTrue(blogEntry.getId().endsWith(entryID));
+        //System.out.println("------------------------------------------------------------\n\n");
     }
     
     
@@ -85,7 +80,7 @@
         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());
     }
     
     
@@ -97,7 +92,7 @@
         newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
         newEntry.setContent(new PlainTextConstruct("contentByGoogleCalendarTestCase"));
         Entry postedEntry = testService.clientPost(newEntry);        
-        assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
+        Assert.assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
     }
 
     
@@ -107,7 +102,7 @@
         //This test case might fail
         //because Google blogger service has limitation on new posts allowed everyday/every hour?
         
-        System.out.println("testClientDelete");
+        //System.out.println("testClientDelete");
         //We create a new post, and then delete it
         Entry newEntry = new Entry();
         newEntry.setTitle(new PlainTextConstruct("calendarEntryShouldNotApear"));
@@ -115,15 +110,15 @@
         Entry postedEntry = testService.clientPost(newEntry);
         Thread.sleep(Constants.SLEEP_INTERVAL); 
         
-        System.out.println("ID: " + postedEntry.getId());
+        //System.out.println("ID: " + postedEntry.getId());
         
         int idStartPosition = postedEntry.getId().lastIndexOf("/");
         String postedEntryID = postedEntry.getId().substring(idStartPosition+1);        
-        System.out.println("postedEntryID: " + postedEntryID );
+        //System.out.println("postedEntryID: " + postedEntryID );
         
         //Before deletion
         Entry entry00 = testService.clientGetEntry(postedEntryID);
-        System.out.println("Before Deleteion: " + entry00.getId());
+        //System.out.println("Before Deleteion: " + entry00.getId());
         
         //Delete this entry
         testService.clientDelete(postedEntryID);
@@ -148,8 +143,8 @@
         myQuery.setFullTextQuery(queryString);
         
         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());
      }
 

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java Wed Sep  2 04:29:04 2009
@@ -21,11 +21,11 @@
 
 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.Test;
 
 import com.google.gdata.client.Query;
@@ -34,37 +34,32 @@
 import com.google.gdata.data.Feed;
 import com.google.gdata.data.PlainTextConstruct;
 
-public class GoogleContactsServiceTestCase extends TestCase {
+public class GoogleContactsServiceTestCase {
 
-    private SCADomain scaDomainConsumer = null;
-    private CustomerClient testService = null;    
+    private static SCADomain scaDomainConsumer = null;
+    private static CustomerClient testService = null;    
     
     public GoogleContactsServiceTestCase(){
 
     }
     
-    @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/ConsumerGoogleContacts.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("Haibo Zhao's Contacts", feed.getTitle().getPlainText());
+        //System.out.println("feed title: " + feed.getTitle().getPlainText());        
+        Assert.assertEquals("Haibo Zhao's Contacts", feed.getTitle().getPlainText());
      }
     
     
@@ -72,9 +67,9 @@
     public void testClientGetEntry() throws Exception {
         String entryID = "12feeeb38ab87365";
         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");
     }
     
     
@@ -85,7 +80,7 @@
         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());
     }
     
     
@@ -97,7 +92,7 @@
         newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
         newEntry.setContent(new PlainTextConstruct("contentByGoogleContactsTestCase"));
         Entry postedEntry = testService.clientPost(newEntry);        
-        assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
+        Assert.assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
     }
 
     
@@ -107,7 +102,7 @@
         //This test case might fail
         //because Google blogger service has limitation on new posts allowed everyday/every hour?
         
-        System.out.println("testClientDelete");
+        //System.out.println("testClientDelete");
         //We create a new post, and then delete it
         Entry newEntry = new Entry();
         newEntry.setTitle(new PlainTextConstruct("contactEntryShouldNotApear"));
@@ -115,15 +110,15 @@
         Entry postedEntry = testService.clientPost(newEntry);
         Thread.sleep(Constants.SLEEP_INTERVAL); 
         
-        System.out.println("ID: " + postedEntry.getId());
+        //System.out.println("ID: " + postedEntry.getId());
         
         int idStartPosition = postedEntry.getId().lastIndexOf("/");
         String postedEntryID = postedEntry.getId().substring(idStartPosition+1);        
-        System.out.println("postedEntryID: " + postedEntryID );
+        //System.out.println("postedEntryID: " + postedEntryID );
         
         //Before deletion
         Entry entry00 = testService.clientGetEntry(postedEntryID);
-        System.out.println("Before Deleteion: " + entry00.getId());
+        //System.out.println("Before Deleteion: " + entry00.getId());
         
         //Delete this entry
         testService.clientDelete(postedEntryID);
@@ -143,8 +138,8 @@
         //myQuery.setUpdatedMin(startTime);
         myQuery.setUpdatedMax(DateTime.now());
         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());
      }
 

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleWebAlbumServiceTestCase.java Wed Sep  2 04:29:04 2009
@@ -21,50 +21,46 @@
 
 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.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 {
+        //System.out.println("Method Test Start-----------------------------------------------------------------------");
         
         //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(){
+        //System.out.println("Method Test End------------------------------------------------------------------------");
+        //System.out.println("\n\n");
     }        
     
     @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 +70,9 @@
     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 +84,8 @@
         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,7 +98,7 @@
         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());
     }
     
     

Modified: tuscany/branches/sca-java-1.x/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java?rev=810356&r1=810355&r2=810356&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java Wed Sep  2 04:29:04 2009
@@ -45,7 +45,7 @@
     
     public GdataBindingProcessor(ModelFactoryExtensionPoint modelFactories) {
         this.factory = modelFactories.getFactory(GdataBindingFactory.class);
-        System.out.println("[Debug Info]GdataBindingProcessor reached");
+        //System.out.println("[Debug Info]GdataBindingProcessor reached");
     }
 
     public QName getArtifactType() {



Mime
View raw message