diff --git a/akka-fun-test-java/pom.xml b/akka-active-object-test/pom.xml similarity index 55% rename from akka-fun-test-java/pom.xml rename to akka-active-object-test/pom.xml index c7ce656cf3..62935a30b4 100644 --- a/akka-fun-test-java/pom.xml +++ b/akka-active-object-test/pom.xml @@ -3,24 +3,28 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - Akka Functional Tests in Java - akka-fun-test-java + Akka Active Object Tests in Java + akka-active-object-test se.scalablesolutions.akka 0.9 jar 2.8.0.RC3 - 0.5.2 - 1.1.5 - 1.9.18-i embedded-repo Embedded Repository - file://Users/jboner/src/scala/akka/embedded-repo + file:///Users/jboner/src/scala/akka/embedded-repo + + + + jboss + JBoss Repository + https://repository.jboss.org/nexus/content/groups/public + @@ -35,59 +39,9 @@ se.scalablesolutions.akka - akka-kernel_2.8.0.RC3 + akka-core_2.8.0.RC3 0.9 - - se.scalablesolutions.akka - akka-persistence-cassandra_2.8.0.RC3 - 0.9 - - - com.google.protobuf - protobuf-java - 2.3.0 - - - org.codehaus.jackson - jackson-core-asl - 1.2.1 - - - org.codehaus.jackson - jackson-mapper-asl - 1.2.1 - - - com.sun.grizzly - grizzly-servlet-webserver - ${grizzly.version} - test - - - com.sun.jersey - jersey-server - ${jersey.version} - test - - - com.sun.jersey - jersey-json - ${jersey.version} - test - - - com.sun.jersey - jersey-client - ${jersey.version} - test - - - com.sun.jersey - jersey-atom - ${jersey.version} - test - junit junit diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfiguratorTest.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/AllTest.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/AllTest.java similarity index 67% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/AllTest.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/AllTest.java index 2e724f0324..465c9da182 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/AllTest.java +++ b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/AllTest.java @@ -8,13 +8,9 @@ public class AllTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite("All Java tests"); suite.addTestSuite(InMemoryStateTest.class); - //suite.addTestSuite(InMemNestedStateTest.class); + suite.addTestSuite(InMemNestedStateTest.class); suite.addTestSuite(RemoteInMemoryStateTest.class); suite.addTestSuite(ActiveObjectGuiceConfiguratorTest.class); - //suite.addTestSuite(PersistentStateTest.class); - //suite.addTestSuite(PersistentNestedStateTest.class); - //suite.addTestSuite(RemotePersistentStateTest.class); - //suite.addTestSuite(RestTest.class); return suite; } diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/Bar.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/Bar.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/Bar.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/Bar.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/BarImpl.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/BarImpl.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/BarImpl.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/BarImpl.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/Ext.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/Ext.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/Ext.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/Ext.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ExtImpl.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/ExtImpl.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ExtImpl.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/ExtImpl.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/Foo.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/Foo.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/Foo.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/Foo.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemFailer.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemFailer.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemFailer.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemFailer.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java similarity index 99% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java index 992c188fa1..746df950bf 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java +++ b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java @@ -9,7 +9,6 @@ import se.scalablesolutions.akka.config.Config; import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import static se.scalablesolutions.akka.config.JavaConfig.*; import se.scalablesolutions.akka.actor.*; -import se.scalablesolutions.akka.kernel.Kernel; import junit.framework.TestCase; public class InMemNestedStateTest extends TestCase { diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemStateful.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemStatefulNested.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java similarity index 99% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java index 740bfd892c..3708d58acc 100644 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java +++ b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java @@ -13,7 +13,6 @@ import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import static se.scalablesolutions.akka.config.JavaConfig.*; import se.scalablesolutions.akka.actor.*; -import se.scalablesolutions.akka.kernel.Kernel; public class InMemoryStateTest extends TestCase { static String messageLog = ""; diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java b/akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java similarity index 100% rename from akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java rename to akka-active-object-test/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/JerseyFoo.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/JerseyFoo.java deleted file mode 100644 index 6828ba421f..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/JerseyFoo.java +++ /dev/null @@ -1,14 +0,0 @@ -package se.scalablesolutions.akka.api; - -import javax.ws.rs.Path; -import javax.ws.rs.GET; -import javax.ws.rs.Produces; - -@Path("/foo") -public class JerseyFoo { - @GET - @Produces({"application/json"}) - public String foo() { - return "hello foo"; - } -} \ No newline at end of file diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java deleted file mode 100644 index 080c1cbd0b..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistenceManager.java +++ /dev/null @@ -1,11 +0,0 @@ -package se.scalablesolutions.akka.api; - -public class PersistenceManager { - private static volatile boolean isRunning = false; - public static void init() { - if (!isRunning) { - se.scalablesolutions.akka.kernel.Kernel$.MODULE$.startRemoteService(); - isRunning = true; - } - } -} diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java deleted file mode 100644 index d5c1bdf00c..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentClasher.java +++ /dev/null @@ -1,26 +0,0 @@ -package se.scalablesolutions.akka.api; - -import se.scalablesolutions.akka.persistence.common.*; -import se.scalablesolutions.akka.persistence.cassandra.*; -import se.scalablesolutions.akka.actor.annotation.inittransactionalstate; - -public class PersistentClasher { - private PersistentMap state; - - @inittransactionalstate - public void init() { - state = CassandraStorage.newMap(); - } - - public String getState(String key) { - return (String)state.get(key).get(); - } - - public void setState(String key, String msg) { - state.put(key, msg); - } - - public void clash() { - state.put("clasher", "was here"); - } -} \ No newline at end of file diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentFailer.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentFailer.java deleted file mode 100644 index 44cab7d6c3..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentFailer.java +++ /dev/null @@ -1,7 +0,0 @@ -package se.scalablesolutions.akka.api; - -public class PersistentFailer implements java.io.Serializable { - public int fail() { - throw new RuntimeException("expected"); - } -} diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java deleted file mode 100644 index 796d3d913a..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentNestedStateTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.api; - -import se.scalablesolutions.akka.config.*; -import se.scalablesolutions.akka.config.ActiveObjectConfigurator; -import static se.scalablesolutions.akka.config.JavaConfig.*; -import se.scalablesolutions.akka.actor.*; -import se.scalablesolutions.akka.kernel.Kernel; - -import junit.framework.TestCase; - -public class PersistentNestedStateTest extends TestCase { - static String messageLog = ""; - - final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator(); - - protected void setUp() { - PersistenceManager.init(); - conf.configure( - new RestartStrategy(new AllForOne(), 3, 5000, new Class[] {Exception.class}), - new Component[]{ - new Component(PersistentStateful.class, new LifeCycle(new Permanent()), 10000000), - new Component(PersistentStatefulNested.class, new LifeCycle(new Permanent()), 10000000), - new Component(PersistentFailer.class, new LifeCycle(new Permanent()), 1000) - //new Component("inmem-clasher", InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent()), 100000) - }).inject().supervise(); - } - - protected void tearDown() { - conf.stop(); - } - - public void testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess() throws Exception { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - PersistentStatefulNested nested = conf.getInstance(PersistentStatefulNested.class); - stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state - nested.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state", nested); // transactional - assertEquals("new state", nested.getMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")); - assertEquals("new state", stateful.getMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")); - } - - public void testMapShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure", "init"); // set init state - PersistentStatefulNested nested = conf.getInstance(PersistentStatefulNested.class); - nested.setMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure", "init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", nested, failer); // call failing transactional method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")); // check that state is == init state - assertEquals("init", nested.getMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")); // check that state is == init state - } - - public void testVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setVectorState("init"); // set init state - PersistentStatefulNested nested = conf.getInstance(PersistentStatefulNested.class); - nested.setVectorState("init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state", nested); // transactional - assertEquals(2, stateful.getVectorLength()); // BAD: keeps one element since last test - assertEquals(2, nested.getVectorLength()); - } - - public void testVectorShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setVectorState("init"); // set init state - PersistentStatefulNested nested = conf.getInstance(PersistentStatefulNested.class); - nested.setVectorState("init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", nested, failer); // call failing transactional method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals(1, stateful.getVectorLength()); - assertEquals(1, nested.getVectorLength()); - } - - public void testRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - PersistentStatefulNested nested = conf.getInstance(PersistentStatefulNested.class); - stateful.setRefState("init"); // set init state - nested.setRefState("init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state", nested); // transactional - assertEquals("new state", stateful.getRefState()); - assertEquals("new state", nested.getRefState()); - } - - public void testRefShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - PersistentStatefulNested nested = conf.getInstance(PersistentStatefulNested.class); - stateful.setRefState("init"); // set init state - nested.setRefState("init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", nested, failer); // call failing transactional method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getRefState()); // check that state is == init state - assertEquals("init", nested.getRefState()); // check that state is == init state - } -} diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateTest.java deleted file mode 100644 index 74f0afcf53..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.api; - -import se.scalablesolutions.akka.config.*; -import static se.scalablesolutions.akka.config.JavaConfig.*; - -import junit.framework.TestCase; - -public class PersistentStateTest extends TestCase { - static String messageLog = ""; - - final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator(); - - protected void setUp() { - PersistenceManager.init(); - conf.configure( - new RestartStrategy(new AllForOne(), 3, 5000, new Class[] {Exception.class}), - new Component[] { - new Component(PersistentStateful.class, new LifeCycle(new Permanent()), 10000000), - new Component(PersistentFailer.class, new LifeCycle(new Permanent()), 1000) - //new Component(PersistentClasher.class, new LifeCycle(new Permanent()), 100000) - }).supervise(); - } - - protected void tearDown() { - conf.stop(); - } - - public void testShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state"); // transactionrequired - assertEquals("new state", stateful.getMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")); - } - - public void testMapShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure", "init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer); // call failing transactionrequired method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")); // check that state is == init state - } - - public void testVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setVectorState("init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state"); // transactionrequired - assertEquals("init", stateful.getVectorState(0)); - assertEquals("new state", stateful.getVectorState(1)); - } - - public void testVectorShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setVectorState("init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer); // call failing transactionrequired method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getVectorState(0)); // check that state is == init state - } - - public void testRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setRefState("init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state"); // transactionrequired - assertEquals("new state", stateful.getRefState()); - } - - public void testRefShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setRefState("init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer); // call failing transactionrequired method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getRefState()); // check that state is == init state - } -} diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java deleted file mode 100644 index 6a8d3353b7..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateful.java +++ /dev/null @@ -1,84 +0,0 @@ -package se.scalablesolutions.akka.api; - -import se.scalablesolutions.akka.actor.annotation.inittransactionalstate; -import se.scalablesolutions.akka.actor.annotation.transactionrequired; -import se.scalablesolutions.akka.persistence.common.*; -import se.scalablesolutions.akka.persistence.cassandra.*; - -@transactionrequired -public class PersistentStateful { - private PersistentMap mapState; - private PersistentVector vectorState; - private PersistentRef refState; - - @inittransactionalstate - public void init() { - mapState = CassandraStorage.newMap(); - vectorState = CassandraStorage.newVector(); - refState = CassandraStorage.newRef(); - } - - public String getMapState(String key) { - byte[] bytes = (byte[]) mapState.get(key.getBytes()).get(); - return new String(bytes, 0, bytes.length); - } - - public String getVectorState(int index) { - byte[] bytes = (byte[]) vectorState.get(index); - return new String(bytes, 0, bytes.length); - } - - public int getVectorLength() { - return vectorState.length(); - } - - public String getRefState() { - if (refState.isDefined()) { - byte[] bytes = (byte[]) refState.get().get(); - return new String(bytes, 0, bytes.length); - } else throw new IllegalStateException("No such element"); - } - - public void setMapState(String key, String msg) { - mapState.put(key.getBytes(), msg.getBytes()); - } - - public void setVectorState(String msg) { - vectorState.add(msg.getBytes()); - } - - public void setRefState(String msg) { - refState.swap(msg.getBytes()); - } - - public void success(String key, String msg) { - mapState.put(key.getBytes(), msg.getBytes()); - vectorState.add(msg.getBytes()); - refState.swap(msg.getBytes()); - } - - public String failure(String key, String msg, PersistentFailer failer) { - mapState.put(key.getBytes(), msg.getBytes()); - vectorState.add(msg.getBytes()); - refState.swap(msg.getBytes()); - failer.fail(); - return msg; - } - - public String success(String key, String msg, PersistentStatefulNested nested) { - mapState.put(key.getBytes(), msg.getBytes()); - vectorState.add(msg.getBytes()); - refState.swap(msg.getBytes()); - nested.success(key, msg); - return msg; - } - - public String failure(String key, String msg, PersistentStatefulNested nested, PersistentFailer failer) { - mapState.put(key.getBytes(), msg.getBytes()); - vectorState.add(msg.getBytes()); - refState.swap(msg.getBytes()); - nested.failure(key, msg, failer); - return msg; - } -} - diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java deleted file mode 100644 index bd931ef108..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStatefulNested.java +++ /dev/null @@ -1,70 +0,0 @@ -package se.scalablesolutions.akka.api; - -import se.scalablesolutions.akka.actor.annotation.inittransactionalstate; -import se.scalablesolutions.akka.actor.annotation.transactionrequired; -import se.scalablesolutions.akka.persistence.common.*; -import se.scalablesolutions.akka.persistence.cassandra.*; - -@transactionrequired -public class PersistentStatefulNested { - private PersistentMap mapState; - private PersistentVector vectorState; - private PersistentRef refState; - - @inittransactionalstate - public void init() { - mapState = CassandraStorage.newMap(); - vectorState = CassandraStorage.newVector(); - refState = CassandraStorage.newRef(); - } - - public String getMapState(String key) { - byte[] bytes = (byte[]) mapState.get(key.getBytes()).get(); - return new String(bytes, 0, bytes.length); - } - - - public String getVectorState(int index) { - byte[] bytes = (byte[]) vectorState.get(index); - return new String(bytes, 0, bytes.length); - } - - public int getVectorLength() { - return vectorState.length(); - } - - public String getRefState() { - if (refState.isDefined()) { - byte[] bytes = (byte[]) refState.get().get(); - return new String(bytes, 0, bytes.length); - } else throw new IllegalStateException("No such element"); - } - - public void setMapState(String key, String msg) { - mapState.put(key.getBytes(), msg.getBytes()); - } - - public void setVectorState(String msg) { - vectorState.add(msg.getBytes()); - } - - public void setRefState(String msg) { - refState.swap(msg.getBytes()); - } - - public String success(String key, String msg) { - mapState.put(key.getBytes(), msg.getBytes()); - vectorState.add(msg.getBytes()); - refState.swap(msg.getBytes()); - return msg; - } - - public String failure(String key, String msg, PersistentFailer failer) { - mapState.put(key.getBytes(), msg.getBytes()); - vectorState.add(msg.getBytes()); - refState.swap(msg.getBytes()); - failer.fail(); - return msg; - } -} - diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.java deleted file mode 100644 index e7b15ca1ef..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.java +++ /dev/null @@ -1,403 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -package se.scalablesolutions.akka.api; - -public final class ProtobufProtocol { - private ProtobufProtocol() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - public static final class ProtobufPOJO extends - com.google.protobuf.GeneratedMessage { - // Use ProtobufPOJO.newBuilder() to construct. - private ProtobufPOJO() {} - - private static final ProtobufPOJO defaultInstance = new ProtobufPOJO(); - public static ProtobufPOJO getDefaultInstance() { - return defaultInstance; - } - - public ProtobufPOJO getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return se.scalablesolutions.akka.api.ProtobufProtocol.internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return se.scalablesolutions.akka.api.ProtobufProtocol.internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_fieldAccessorTable; - } - - // required uint64 id = 1; - public static final int ID_FIELD_NUMBER = 1; - private boolean hasId; - private long id_ = 0L; - public boolean hasId() { return hasId; } - public long getId() { return id_; } - - // required string name = 2; - public static final int NAME_FIELD_NUMBER = 2; - private boolean hasName; - private java.lang.String name_ = ""; - public boolean hasName() { return hasName; } - public java.lang.String getName() { return name_; } - - // required bool status = 3; - public static final int STATUS_FIELD_NUMBER = 3; - private boolean hasStatus; - private boolean status_ = false; - public boolean hasStatus() { return hasStatus; } - public boolean getStatus() { return status_; } - - public final boolean isInitialized() { - if (!hasId) return false; - if (!hasName) return false; - if (!hasStatus) return false; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (hasId()) { - output.writeUInt64(1, getId()); - } - if (hasName()) { - output.writeString(2, getName()); - } - if (hasStatus()) { - output.writeBool(3, getStatus()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasId()) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, getId()); - } - if (hasName()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(2, getName()); - } - if (hasStatus()) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, getStatus()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeDelimitedFrom(input).buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeDelimitedFrom(input, extensionRegistry) - .buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder { - private se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO result; - - // Construct using se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO(); - return builder; - } - - protected se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO internalGetResult() { - return result; - } - - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO(); - return this; - } - - public Builder clone() { - return create().mergeFrom(result); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO.getDescriptor(); - } - - public se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO getDefaultInstanceForType() { - return se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO.getDefaultInstance(); - } - - public boolean isInitialized() { - return result.isInitialized(); - } - public se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO build() { - if (result != null && !isInitialized()) { - throw newUninitializedMessageException(result); - } - return buildPartial(); - } - - private se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - - public se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); - } - se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO returnMe = result; - result = null; - return returnMe; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO) { - return mergeFrom((se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO other) { - if (other == se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO.getDefaultInstance()) return this; - if (other.hasId()) { - setId(other.getId()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasStatus()) { - setStatus(other.getStatus()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - return this; - } - break; - } - case 8: { - setId(input.readUInt64()); - break; - } - case 18: { - setName(input.readString()); - break; - } - case 24: { - setStatus(input.readBool()); - break; - } - } - } - } - - - // required uint64 id = 1; - public boolean hasId() { - return result.hasId(); - } - public long getId() { - return result.getId(); - } - public Builder setId(long value) { - result.hasId = true; - result.id_ = value; - return this; - } - public Builder clearId() { - result.hasId = false; - result.id_ = 0L; - return this; - } - - // required string name = 2; - public boolean hasName() { - return result.hasName(); - } - public java.lang.String getName() { - return result.getName(); - } - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasName = true; - result.name_ = value; - return this; - } - public Builder clearName() { - result.hasName = false; - result.name_ = getDefaultInstance().getName(); - return this; - } - - // required bool status = 3; - public boolean hasStatus() { - return result.hasStatus(); - } - public boolean getStatus() { - return result.getStatus(); - } - public Builder setStatus(boolean value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder clearStatus() { - result.hasStatus = false; - result.status_ = false; - return this; - } - } - - static { - se.scalablesolutions.akka.api.ProtobufProtocol.getDescriptor(); - } - - static { - se.scalablesolutions.akka.api.ProtobufProtocol.internalForceInit(); - } - } - - private static com.google.protobuf.Descriptors.Descriptor - internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n4se/scalablesolutions/akka/api/Protobuf" + - "Protocol.proto\022\035se.scalablesolutions.akk" + - "a.api\"8\n\014ProtobufPOJO\022\n\n\002id\030\001 \002(\004\022\014\n\004nam" + - "e\030\002 \002(\t\022\016\n\006status\030\003 \002(\010" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_se_scalablesolutions_akka_api_ProtobufPOJO_descriptor, - new java.lang.String[] { "Id", "Name", "Status", }, - se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO.class, - se.scalablesolutions.akka.api.ProtobufProtocol.ProtobufPOJO.Builder.class); - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - } - - public static void internalForceInit() {} -} diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto deleted file mode 100644 index 8140ad313a..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.api; - -/* - Compile with: - cd ./akka-fun-test-java/src/test/java - protoc se/scalablesolutions/akka/api/ProtobufProtocol.proto --java_out . -*/ - -message ProtobufPOJO { - required uint64 id = 1; - required string name = 2; - required bool status = 3; -} diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufSerializationTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufSerializationTest.java deleted file mode 100644 index a67560146d..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufSerializationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.api; - -import junit.framework.TestCase; -import se.scalablesolutions.akka.serialization.SerializerFactory; - -public class ProtobufSerializationTest extends TestCase { - public void testOutIn() throws Exception { - SerializerFactory factory = new SerializerFactory(); - ProtobufProtocol.ProtobufPOJO pojo1 = ProtobufProtocol.ProtobufPOJO.getDefaultInstance().toBuilder().setId(1).setName("protobuf").setStatus(true).build(); - - byte[] bytes = factory.getProtobuf().out(pojo1); - Object obj = factory.getProtobuf().in(bytes, pojo1.getClass()); - - assertTrue(obj instanceof ProtobufProtocol.ProtobufPOJO); - ProtobufProtocol.ProtobufPOJO pojo2 = (ProtobufProtocol.ProtobufPOJO)obj; - assertEquals(pojo1.getId(), pojo2.getId()); - assertEquals(pojo1.getName(), pojo2.getName()); - assertEquals(pojo1.getStatus(), pojo2.getStatus()); - } - - public void testDeepClone() throws Exception { - SerializerFactory factory = new SerializerFactory(); - ProtobufProtocol.ProtobufPOJO pojo1 = ProtobufProtocol.ProtobufPOJO.getDefaultInstance().toBuilder().setId(1).setName("protobuf").setStatus(true).build(); - - Object obj = factory.getProtobuf().deepClone(pojo1); - - assertTrue(obj instanceof ProtobufProtocol.ProtobufPOJO); - ProtobufProtocol.ProtobufPOJO pojo2 = (ProtobufProtocol.ProtobufPOJO)obj; - assertEquals(pojo1.getId(), pojo2.getId()); - assertEquals(pojo1.getName(), pojo2.getName()); - assertEquals(pojo1.getStatus(), pojo2.getStatus()); - } -} - diff --git a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemotePersistentStateTest.java b/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemotePersistentStateTest.java deleted file mode 100644 index 18c3b1ed62..0000000000 --- a/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemotePersistentStateTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (C) 2009-2010 Scalable Solutions AB - */ - -package se.scalablesolutions.akka.api; - -import se.scalablesolutions.akka.config.*; -import static se.scalablesolutions.akka.config.JavaConfig.*; - -import junit.framework.TestCase; - -public class RemotePersistentStateTest extends TestCase { - static String messageLog = ""; - - final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator(); - - protected void setUp() { - PersistenceManager.init(); - conf.configure( - new RestartStrategy(new AllForOne(), 3, 5000, new Class[]{Exception.class}), - new Component[] { - new Component(PersistentStateful.class, new LifeCycle(new Permanent()), 1000000, new RemoteAddress("localhost", 9999)), - new Component(PersistentFailer.class, new LifeCycle(new Permanent()), 1000000, new RemoteAddress("localhost", 9999)) - }).supervise(); - } - - protected void tearDown() { - conf.stop(); - } - - public void testShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state"); // transactionrequired - assertEquals("new state", stateful.getMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")); - } - - public void testMapShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure", "init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "MapShouldRollBack", failer); // call failing transactionrequired method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")); // check that state is == init state - } - - public void testVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - int init = stateful.getVectorLength(); - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "VectorShouldNotRollback"); // transactionrequired - assertEquals(init + 1, stateful.getVectorLength()); - } - - public void testVectorShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - int init = stateful.getVectorLength(); - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer); // call failing transactionrequired method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals(init, stateful.getVectorLength()); - } - - public void testRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setRefState("init"); // set init state - stateful.success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state"); // transactionrequired - assertEquals("new state", stateful.getRefState()); - } - - public void testRefShouldRollbackStateForStatefulServerInCaseOfFailure() { - PersistentStateful stateful = conf.getInstance(PersistentStateful.class); - stateful.setRefState("init"); // set init state - PersistentFailer failer = conf.getInstance(PersistentFailer.class); - try { - stateful.failure("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer); // call failing transactionrequired method - fail("should have thrown an exception"); - } catch (RuntimeException e) { - } // expected - assertEquals("init", stateful.getRefState()); // check that state is == init state - } - -} \ No newline at end of file diff --git a/akka-fun-test-java/testng.xml b/akka-fun-test-java/testng.xml deleted file mode 100644 index b894d3880b..0000000000 --- a/akka-fun-test-java/testng.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index f243a8a3f3..ca42082067 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -78,8 +78,8 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_http, akka_spring, akka_camel, akka_persistence, akka_amqp) - // functional tests in java - lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) + // active object tests in java + lazy val akka_active_object_test = project("akka-active-object-test", "akka-active-object-test", new AkkaActiveObjectTestProject(_), akka_kernel) // examples lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) @@ -290,14 +290,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } // ================= TEST ================== - class AkkaFunTestProject(info: ProjectInfo) extends DefaultProject(info) { - val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" - val stax_api = "javax.xml.stream" % "stax-api" % "1.0-2" % "compile" - val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" - val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" - val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" - val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" - val jersey_atom = "com.sun.jersey" % "jersey-atom" % JERSEY_VERSION % "compile" + class AkkaActiveObjectTestProject(info: ProjectInfo) extends DefaultProject(info) { // testing val junit = "junit" % "junit" % "4.5" % "test" val jmock = "org.jmock" % "jmock" % "2.4.0" % "test"