diff options
author | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-24 13:08:55 +0000 |
---|---|---|
committer | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-24 13:08:55 +0000 |
commit | 61ed6b103cdea7af530950851857643a0b3efd45 (patch) | |
tree | e712ad12fd50e5194fada5be200b6c7345dfff92 /sca-java-2.x/contrib/modules/binding-comet-runtime/src/test | |
parent | d1f056a0126252f101d108ad2952ac0eebb78cb0 (diff) |
Enforced coding standards and formatting.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@988521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib/modules/binding-comet-runtime/src/test')
3 files changed, 22 insertions, 23 deletions
diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java index 9729d8ef27..e485fd2ca6 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.test; +import junit.framework.Assert; import junit.framework.TestCase; import org.apache.tuscany.sca.node.Contribution; @@ -31,24 +32,22 @@ import org.apache.tuscany.sca.node.NodeFactory; */ public class CometTestCase extends TestCase { - /** - * Test consisting in starting up a node containing services exposed via the - * comet binding. - */ - public void testComet() { - try { - String location = ContributionLocationHelper - .getContributionLocation("test.composite"); - Node node = NodeFactory.newInstance().createNode("test.composite", - new Contribution("c1", location)); - node.start(); - // System.out.println("Press any key to stop the node."); - // System.in.read(); - node.stop(); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } + /** + * Test consisting in starting up a node containing services exposed via the + * comet binding. + */ + public void testComet() { + try { + final String location = ContributionLocationHelper.getContributionLocation("test.composite"); + final Node node = NodeFactory.newInstance().createNode("test.composite", new Contribution("c1", location)); + node.start(); + // System.out.println("Press any key to stop the node."); + // System.in.read(); + node.stop(); + } catch (final Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } } diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java index 7dbfb07b74..6d23479f30 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java @@ -22,7 +22,7 @@ import org.oasisopen.sca.annotation.Remotable; @Remotable public interface StockService { - + String getQuotes(); } diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java index 80e7a7e94b..359d7dec0b 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java @@ -28,12 +28,12 @@ import org.oasisopen.sca.annotation.Service; public class StockServiceImpl implements StockService { public static final int MAX_VALUE = 1000; - private Random random = new Random(new Date().getTime()); + private final Random random = new Random(new Date().getTime()); @Override public String getQuotes() { - Double value = Math.abs(random.nextDouble() * random.nextInt(MAX_VALUE)); + final Double value = Math.abs(this.random.nextDouble() * this.random.nextInt(StockServiceImpl.MAX_VALUE)); return "ASF" + "#" + Double.valueOf(new DecimalFormat("#.##").format(value)); } - + } |