adapted fun tests to new module layout
This commit is contained in:
parent
b865a84940
commit
46cff1a0a1
18 changed files with 84 additions and 58 deletions
|
|
@ -9,18 +9,19 @@ import com.google.inject.Scopes;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.reactor.EventBasedThreadPoolDispatcher;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.Config;
|
||||
import se.scalablesolutions.akka.reactor.EventBasedThreadPoolDispatcher;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
public class ActiveObjectGuiceConfiguratorTest extends TestCase {
|
||||
static String messageLog = "";
|
||||
|
||||
final private se.scalablesolutions.akka.kernel.config.ActiveObjectManager conf = new se.scalablesolutions.akka.kernel.config.ActiveObjectManager();
|
||||
final private se.scalablesolutions.akka.config.ActiveObjectManager conf = new se.scalablesolutions.akka.config.ActiveObjectManager();
|
||||
|
||||
protected void setUp() {
|
||||
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config();
|
||||
Config.config();
|
||||
EventBasedThreadPoolDispatcher dispatcher = new EventBasedThreadPoolDispatcher("name");
|
||||
dispatcher
|
||||
.withNewThreadPoolWithBoundedBlockingQueue(100)
|
||||
|
|
@ -103,7 +104,7 @@ public class ActiveObjectGuiceConfiguratorTest extends TestCase {
|
|||
try {
|
||||
foo.longRunning();
|
||||
fail("exception should have been thrown");
|
||||
} catch (se.scalablesolutions.akka.kernel.reactor.FutureTimeoutException e) {
|
||||
} catch (se.scalablesolutions.akka.reactor.FutureTimeoutException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.config.*;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.kernel.actor.*;
|
||||
import se.scalablesolutions.akka.kernel.Kernel;
|
||||
import se.scalablesolutions.akka.Config;
|
||||
import se.scalablesolutions.akka.config.*;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.actor.*;
|
||||
import se.scalablesolutions.akka.Kernel;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class InMemNestedStateTest extends TestCase {
|
||||
|
|
@ -26,7 +27,7 @@ public class InMemNestedStateTest extends TestCase {
|
|||
new Component(InMemFailer.class, new LifeCycle(new Permanent(), 1000), 1000)
|
||||
//new Component("inmem-clasher", InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent(), 1000), 100000)
|
||||
}).inject().supervise();
|
||||
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config();
|
||||
Config.config();
|
||||
}
|
||||
|
||||
protected void tearDown() {
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@ package se.scalablesolutions.akka.api;
|
|||
import se.scalablesolutions.akka.annotation.transactionrequired;
|
||||
import se.scalablesolutions.akka.annotation.prerestart;
|
||||
import se.scalablesolutions.akka.annotation.postrestart;
|
||||
import se.scalablesolutions.akka.kernel.state.*;
|
||||
import se.scalablesolutions.akka.state.*;
|
||||
|
||||
@transactionrequired
|
||||
public class InMemStateful {
|
||||
private TransactionalState factory = new TransactionalState();
|
||||
private TransactionalMap<String, String> mapState = factory.newInMemoryMap();
|
||||
private TransactionalVector<String> vectorState = factory.newInMemoryVector();
|
||||
private TransactionalRef<String> refState = factory.newInMemoryRef();
|
||||
private TransactionalMap<String, String> mapState = factory.newMap();
|
||||
private TransactionalVector<String> vectorState = factory.newVector();
|
||||
private TransactionalRef<String> refState = factory.newRef();
|
||||
|
||||
public String getMapState(String key) {
|
||||
return (String)mapState.get(key).get();
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.annotation.transactionrequired;
|
||||
import se.scalablesolutions.akka.kernel.state.*;
|
||||
import se.scalablesolutions.akka.state.*;
|
||||
|
||||
@transactionrequired
|
||||
public class InMemStatefulNested {
|
||||
private TransactionalState factory = new TransactionalState();
|
||||
private TransactionalMap<String, String> mapState = factory.newInMemoryMap();
|
||||
private TransactionalVector<String> vectorState = factory.newInMemoryVector();
|
||||
private TransactionalRef<String> refState = factory.newInMemoryRef();
|
||||
private TransactionalMap<String, String> mapState = factory.newMap();
|
||||
private TransactionalVector<String> vectorState = factory.newVector();
|
||||
private TransactionalRef<String> refState = factory.newRef();
|
||||
|
||||
|
||||
public String getMapState(String key) {
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@ package se.scalablesolutions.akka.api;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.config.*;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.kernel.actor.*;
|
||||
import se.scalablesolutions.akka.kernel.Kernel;
|
||||
import se.scalablesolutions.akka.Config;
|
||||
import se.scalablesolutions.akka.config.*;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.actor.*;
|
||||
import se.scalablesolutions.akka.Kernel;
|
||||
|
||||
public class InMemoryStateTest extends TestCase {
|
||||
static String messageLog = "";
|
||||
|
|
@ -18,7 +19,7 @@ public class InMemoryStateTest extends TestCase {
|
|||
|
||||
|
||||
protected void setUp() {
|
||||
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config();
|
||||
Config.config();
|
||||
conf.configure(
|
||||
new RestartStrategy(new AllForOne(), 3, 5000),
|
||||
new Component[]{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ public class PersistenceManager {
|
|||
private static volatile boolean isRunning = false;
|
||||
public static void init() {
|
||||
if (!isRunning) {
|
||||
se.scalablesolutions.akka.kernel.Kernel.startRemoteService();
|
||||
se.scalablesolutions.akka.Kernel.startRemoteService();
|
||||
isRunning = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.state.TransactionalMap;
|
||||
import se.scalablesolutions.akka.kernel.state.CassandraPersistentTransactionalMap;
|
||||
import se.scalablesolutions.akka.state.TransactionalMap;
|
||||
import se.scalablesolutions.akka.state.CassandraPersistentTransactionalMap;
|
||||
|
||||
public class PersistentClasher {
|
||||
private TransactionalMap state = new CassandraPersistentTransactionalMap();
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.config.*;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.kernel.actor.*;
|
||||
import se.scalablesolutions.akka.kernel.Kernel;
|
||||
import se.scalablesolutions.akka.config.*;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.actor.*;
|
||||
import se.scalablesolutions.akka.Kernel;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.config.*;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.kernel.actor.*;
|
||||
import se.scalablesolutions.akka.kernel.Kernel;
|
||||
import se.scalablesolutions.akka.config.*;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.actor.*;
|
||||
import se.scalablesolutions.akka.Kernel;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.annotation.transactionrequired;
|
||||
import se.scalablesolutions.akka.kernel.state.*;
|
||||
import se.scalablesolutions.akka.state.*;
|
||||
|
||||
@transactionrequired
|
||||
public class PersistentStateful {
|
||||
private TransactionalState factory = new TransactionalState();
|
||||
private TransactionalMap mapState = factory.newPersistentMap(new CassandraStorageConfig());
|
||||
private TransactionalVector vectorState = factory.newPersistentVector(new CassandraStorageConfig());;
|
||||
private TransactionalRef refState = factory.newPersistentRef(new CassandraStorageConfig());
|
||||
private PersistentState factory = new PersistentState();
|
||||
private TransactionalMap mapState = factory.newMap(new CassandraStorageConfig());
|
||||
private TransactionalVector vectorState = factory.newVector(new CassandraStorageConfig());;
|
||||
private TransactionalRef refState = factory.newRef(new CassandraStorageConfig());
|
||||
|
||||
|
||||
public String getMapState(String key) {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.annotation.transactionrequired;
|
||||
import se.scalablesolutions.akka.kernel.state.*;
|
||||
import se.scalablesolutions.akka.state.*;
|
||||
|
||||
@transactionrequired
|
||||
public class PersistentStatefulNested {
|
||||
private TransactionalState factory = new TransactionalState();
|
||||
private TransactionalMap mapState = factory.newPersistentMap(new CassandraStorageConfig());
|
||||
private TransactionalVector vectorState = factory.newPersistentVector(new CassandraStorageConfig());;
|
||||
private TransactionalRef refState = factory.newPersistentRef(new CassandraStorageConfig());
|
||||
private PersistentState factory = new PersistentState();
|
||||
private TransactionalMap mapState = factory.newMap(new CassandraStorageConfig());
|
||||
private TransactionalVector vectorState = factory.newVector(new CassandraStorageConfig());;
|
||||
private TransactionalRef refState = factory.newRef(new CassandraStorageConfig());
|
||||
|
||||
|
||||
public String getMapState(String key) {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@
|
|||
|
||||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.actor.ActiveObjectFactory;
|
||||
import se.scalablesolutions.akka.kernel.nio.RemoteServer;
|
||||
import se.scalablesolutions.akka.Config;
|
||||
import se.scalablesolutions.akka.actor.ActiveObjectFactory;
|
||||
import se.scalablesolutions.akka.config.ActiveObjectManager;
|
||||
import se.scalablesolutions.akka.nio.RemoteServer;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class RemoteInMemoryStateTest extends TestCase {
|
||||
|
|
@ -19,9 +21,9 @@ public class RemoteInMemoryStateTest extends TestCase {
|
|||
}
|
||||
}).start();
|
||||
try { Thread.currentThread().sleep(1000); } catch (Exception e) {}
|
||||
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config();
|
||||
Config.config();
|
||||
}
|
||||
final private se.scalablesolutions.akka.kernel.config.ActiveObjectManager conf = new se.scalablesolutions.akka.kernel.config.ActiveObjectManager();
|
||||
final ActiveObjectManager conf = new ActiveObjectManager();
|
||||
final private ActiveObjectFactory factory = new ActiveObjectFactory();
|
||||
|
||||
protected void tearDown() {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
package se.scalablesolutions.akka.api;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.config.*;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.kernel.actor.*;
|
||||
import se.scalablesolutions.akka.kernel.Kernel;
|
||||
import se.scalablesolutions.akka.config.*;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.actor.*;
|
||||
import se.scalablesolutions.akka.Kernel;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ import java.net.URI;
|
|||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import se.scalablesolutions.akka.kernel.config.*;
|
||||
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*;
|
||||
import se.scalablesolutions.akka.config.*;
|
||||
import static se.scalablesolutions.akka.config.JavaConfig.*;
|
||||
|
||||
|
||||
public class RestTest extends TestCase {
|
||||
|
|
@ -67,7 +67,7 @@ public class RestTest extends TestCase {
|
|||
*/
|
||||
private static SelectorThread startJersey() {
|
||||
try {
|
||||
Servlet servlet = new se.scalablesolutions.akka.kernel.rest.AkkaServlet();
|
||||
Servlet servlet = new se.scalablesolutions.akka.rest.AkkaServlet();
|
||||
ServletAdapter adapter = new ServletAdapter();
|
||||
adapter.setServletInstance(servlet);
|
||||
adapter.setContextPath(URI.getPath());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue