You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2006/04/10 16:45:04 UTC

Re: svn commit: r392952 - in /incubator/tuscany/java/samples/helloworld: helloworld/src/main/java/org/apache/tuscany/samples/helloworld/ helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/ helloworldjsonrpc/src/test/java/org/apac

Out of interested, are all these System.out.flush() statements really
needed? Isn't autoflush on by default?

   ...ant

On 4/10/06, rineholt@apache.org <ri...@apache.org> wrote:
>
> Author: rineholt
> Date: Mon Apr 10 07:05:50 2006
> New Revision: 392952
>
> URL: http://svn.apache.org/viewcvs?rev=392952&view=rev
> Log:
> Address http://issues.apache.org/jira/browse/TUSCANY-163
> Test cases in sample projects should not print to system.out
> Also got rid of the viasca ... we should always be able to run this
> samples.
>
> Modified:
>
>     incubator/tuscany/java/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java
>
>     incubator/tuscany/java/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java
>
>     incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
>
>     incubator/tuscany/java/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java
>
>     incubator/tuscany/java/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java
>
>     incubator/tuscany/java/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java
>
>     incubator/tuscany/java/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java
> Mon Apr 10 07:05:50 2006
> @@ -52,6 +52,7 @@
>          HelloWorldService helloworldService = (HelloWorldService)
> moduleContext.locateService("HelloWorldServiceComponent");
>          String value = helloworldService.getGreetings("World");
>          System.out.println(value);
> +        System.out.flush();
>
>          // Disassociate the application module component
>          tuscany.stop();
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java
> Mon Apr 10 07:05:50 2006
> @@ -46,6 +46,7 @@
>
>          System.out.println((new
> HelloWorldAxisClient()).getGreetings(urlstr,
>                  name));
> +        System.out.flush();
>
>      }
>
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworldjsonrpc/src/test/java/org/apache/tuscany/samples/helloworldjsonrpc/HelloWorldServiceTestCase.java
> Mon Apr 10 07:05:50 2006
> @@ -28,19 +28,13 @@
>   *
>   */
> public class HelloWorldServiceTestCase extends TestCase {
> -    public boolean verbose = false;
>
>      public void testGeetings() throws Exception {
>
> -        final boolean viaSCA = true;
>          TuscanyRuntime tuscany;
>          ModuleContext moduleContext = null;
> -        if (verbose)
> -            System.out.println("starting test..");
> -        System.out.flush();
>          HelloWorldService helloworldService = null;
>
> -        if (viaSCA) {
>              tuscany = new TuscanyRuntime("test", null);
>              tuscany.start();
>              moduleContext = CurrentModuleContext.getContext();
> @@ -51,33 +45,20 @@
>                      .locateService("HelloWorldServiceComponent");
>
>              assertNotNull(helloworldService);
> -        } else
> -            helloworldService = new HelloWorldServiceComponentImpl();
>
>          String value = helloworldService
>                  .getGreetings("World");
>
> -        if (verbose)
> -            System.out.println("Value = '" + value + "'");
>          assertEquals("jsonrpcHello World", value);
> -        if (viaSCA)
> -            tuscany.stop();
> +         tuscany.stop();
>
>      }
>
>      public final static void main(String[] args) throws Exception {
>          HelloWorldServiceTestCase hwc = new HelloWorldServiceTestCase();
> -        hwc.setVerbose(true);
>          hwc.testGeetings();
>
>      }
>
> -    public boolean isVerbose() {
> -        return verbose;
> -    }
> -
> -    public void setVerbose(boolean verbose) {
> -        this.verbose = verbose;
> -    }
>
> }
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java
> Mon Apr 10 07:05:50 2006
> @@ -44,6 +44,7 @@
>          String value = helloworldService.getGreetings();
>
>          System.out.println(value);
> +        System.out.flush();
>
>          // Stop the runtime
>          tuscany.stop();
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java
> Mon Apr 10 07:05:50 2006
> @@ -23,23 +23,15 @@
> import org.apache.tuscany.core.client.TuscanyRuntime;
>
> public class HelloWorldServiceComponentTestCase extends TestCase {
> -    public boolean verbose = true;
>
>      public void testGeetings() throws Exception {
>
> -        if (verbose)
> -            System.out.println("starting test..");
> -        System.out.flush();
>
>          TuscanyRuntime tuscany = new TuscanyRuntime("test", null);
>          tuscany.start();
>          ModuleContext moduleContext = CurrentModuleContext.getContext();
>
>          assertNotNull(moduleContext);
> -        System.out.println("module context name '"
> -                + moduleContext.getName() + "'");
> -        System.out.println("module context uri '" + moduleContext.getURI
> ()
> -                + "'");
>          HelloWorldService helloworldService =
>                  (HelloWorldService) moduleContext.locateService
>                          ("HelloWorldServiceComponent");
> @@ -48,8 +40,6 @@
>
>          String value = helloworldService.getGreetings();
>
> -        if (verbose)
> -            System.out.println("Value = '" + value + "'");
>
>          assertEquals("Hello SCA World", value);
>
> @@ -59,16 +49,8 @@
>      public final static void main(String[] args) throws Exception {
>          HelloWorldServiceComponentTestCase hwc =
>                  new HelloWorldServiceComponentTestCase();
> -        hwc.setVerbose(true);
>          hwc.testGeetings();
>      }
>
> -    public boolean isVerbose() {
> -        return verbose;
> -    }
> -
> -    public void setVerbose(boolean verbose) {
> -        this.verbose = verbose;
> -    }
>
> }
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java
> Mon Apr 10 07:05:50 2006
> @@ -26,40 +26,28 @@
>   *
>   */
> public class HelloWorldServiceComponentTestCase extends TestCase {
> -    public boolean verbose = false;
>
>      public void testGeetings() throws Exception {
>          // todo should use SCA ;-)
>          final boolean viaSCA = false;
>          TuscanyRuntime tuscany;
>          ModuleContext moduleContext = null;
> -        if (verbose)
> -            System.out.println("starting test..");
> -        System.out.flush();
> +
>          HelloWorldServiceComponent helloworldService = null;
>
> -        if (viaSCA) {
>              tuscany = new TuscanyRuntime("test", null);
>              tuscany.start();
>              moduleContext = CurrentModuleContext.getContext();
>
>              assertNotNull(moduleContext);
> -            System.out.println("module context name '"
> -                    + moduleContext.getName() + "'");
> -            System.out.println("module context uri '" +
> moduleContext.getURI()
> -                    + "'");
> +
>              helloworldService = (HelloWorldServiceComponent)
> moduleContext
>                      .locateService("HelloWorldServiceComponent");
>
>              assertNotNull(helloworldService);
> -        } else
> -            helloworldService = new HelloWorldServiceComponentImpl();
> -
>          String value = helloworldService
>                  .getGreetings("World");
>
> -        if (verbose)
> -            System.out.println("Value = '" + value + "'");
>          assertEquals("Hello World", value);
>          if (viaSCA)
>              tuscany.stop();
> @@ -68,17 +56,9 @@
>
>      public final static void main(String[] args) throws Exception {
>          HelloWorldServiceComponentTestCase hwc = new
> HelloWorldServiceComponentTestCase();
> -        hwc.setVerbose(true);
>          hwc.testGeetings();
>
>      }
>
> -    public boolean isVerbose() {
> -        return verbose;
> -    }
> -
> -    public void setVerbose(boolean verbose) {
> -        this.verbose = verbose;
> -    }
>
> }
>
> Modified:
> incubator/tuscany/java/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java
> URL:
> http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java?rev=392952&r1=392951&r2=392952&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java
> (original)
> +++
> incubator/tuscany/java/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java
> Mon Apr 10 07:05:50 2006
> @@ -44,6 +44,7 @@
>          String value = helloworldService.getGreetings("World");
>
>          System.out.println(value);
> +        System.out.flush();
>
>          // Stop the runtime
>          tuscany.stop();
>
>
>