Split big test method into several discrete test methods

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@807972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
antelder 2009-08-26 11:58:30 +00:00
parent e785933e66
commit a98c6019b8

View file

@ -48,23 +48,42 @@ public class OneNodeTestCase{
}
@Test
public void testCalculator() throws Exception {
public void testService() throws Exception {
Helloworld service = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldService");
assertNotNull(service);
assertEquals("Hello Petra", service.sayHello("Petra"));
}
@Test
public void testClient() throws Exception {
Helloworld client = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldClient");
assertNotNull(client);
assertEquals("Hi Hello Petra", client.sayHello("Petra"));
}
@Test
public void testRemovingServiceContribution() throws Exception {
domain.removeContribution(serviceContributionUri);
try {
client = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldService");
SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldService");
// FIXME: should this be NoSuchServiceException or ServiceNotFoundException?
} catch (NoSuchServiceException e) {
// expected
}
Helloworld client = SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldClient");
assertNotNull(client);
try {
assertEquals("Hi Hello Petra", client.sayHello("Petra"));
fail();
} catch (Exception e) {
// FIXME: this gives an NPE, would be better to be something like ServiceNotFoundException
// expected
}
}
@Test
public void testStoppingDomainNode() throws Exception {
domain.stop();
try {
SCAClient.getService(Helloworld.class, "defaultDomain/HelloworldClient");
@ -73,7 +92,6 @@ public class OneNodeTestCase{
// expected
}
}
@AfterClass
public static void tearDownAfterClass() throws Exception {