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
|
|
@ -6,7 +6,7 @@ package se.scalablesolutions.akka.amqp
|
|||
|
||||
import akka.serialization.Serializer
|
||||
import com.rabbitmq.client.ConnectionParameters
|
||||
import kernel.actor.Actor
|
||||
import actor.Actor
|
||||
|
||||
object ExampleSession {
|
||||
import AMQP._
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
<groupId>se.scalablesolutions.akka</groupId>
|
||||
<version>0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
<!-- Core deps -->
|
||||
<dependency>
|
||||
|
|
|
|||
22
akka-samples-lift/src/main/webapp/WEB-INF/web.xml
Executable file
22
akka-samples-lift/src/main/webapp/WEB-INF/web.xml
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||
<web-app>
|
||||
<filter>
|
||||
<filter-name>LiftFilter</filter-name>
|
||||
<display-name>Lift Filter</display-name>
|
||||
<description>The Filter that intercepts lift calls</description>
|
||||
<filter-class>net.liftweb.http.LiftFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>LiftFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<servlet>
|
||||
<servlet-name>AkkaServlet</servlet-name>
|
||||
<servlet-class>se.scalablesolutions.akka.kernel.rest.AkkaServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>AkkaServlet</servlet-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
@ -25,7 +25,7 @@ see http://maven.apache.org/plugins/maven-changes-plugin/usage.html for full gui
|
|||
<action dev="Viktor Klang" type="add">Support for using Scala XML tags in RESTful Actors (scala-jersey)</action>
|
||||
<action dev="Viktor Klang" type="add">Support for Comet Actors using Atmosphere</action>
|
||||
<action dev="Jonas Bonér" type="add">AMQP module; abstracted as an Actor</action>
|
||||
<action dev="Jonas Bonér" type="add">Modularization of distribution into core and submodules</action>
|
||||
<action dev="Jonas Bonér" type="add">Modularization of distribution into a core and several submodules</action>
|
||||
<action dev="Jonas Bonér" type="add">JSON serialization for Java objects (using Jackson)</action>
|
||||
<action dev="Jonas Bonér" type="add">JSON serialization for Scala objects (using scala-json)</action>
|
||||
<action dev="Jonas Bonér" type="add">Protobuf serialization for Java and Scala objects</action>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue