adapted fun tests to new module layout

This commit is contained in:
jboner 2009-09-04 09:47:32 +02:00
parent b865a84940
commit 46cff1a0a1
18 changed files with 84 additions and 58 deletions

View file

@ -6,7 +6,7 @@ package se.scalablesolutions.akka.amqp
import akka.serialization.Serializer import akka.serialization.Serializer
import com.rabbitmq.client.ConnectionParameters import com.rabbitmq.client.ConnectionParameters
import kernel.actor.Actor import actor.Actor
object ExampleSession { object ExampleSession {
import AMQP._ import AMQP._

View file

@ -9,18 +9,19 @@ import com.google.inject.Scopes;
import junit.framework.TestCase; import junit.framework.TestCase;
import se.scalablesolutions.akka.kernel.reactor.EventBasedThreadPoolDispatcher; import se.scalablesolutions.akka.Config;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import se.scalablesolutions.akka.reactor.EventBasedThreadPoolDispatcher;
import static se.scalablesolutions.akka.config.JavaConfig.*;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
public class ActiveObjectGuiceConfiguratorTest extends TestCase { public class ActiveObjectGuiceConfiguratorTest extends TestCase {
static String messageLog = ""; 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() { protected void setUp() {
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config(); Config.config();
EventBasedThreadPoolDispatcher dispatcher = new EventBasedThreadPoolDispatcher("name"); EventBasedThreadPoolDispatcher dispatcher = new EventBasedThreadPoolDispatcher("name");
dispatcher dispatcher
.withNewThreadPoolWithBoundedBlockingQueue(100) .withNewThreadPoolWithBoundedBlockingQueue(100)
@ -103,7 +104,7 @@ public class ActiveObjectGuiceConfiguratorTest extends TestCase {
try { try {
foo.longRunning(); foo.longRunning();
fail("exception should have been thrown"); fail("exception should have been thrown");
} catch (se.scalablesolutions.akka.kernel.reactor.FutureTimeoutException e) { } catch (se.scalablesolutions.akka.reactor.FutureTimeoutException e) {
} }
} }

View file

@ -4,10 +4,11 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.kernel.config.*; import se.scalablesolutions.akka.Config;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import se.scalablesolutions.akka.config.*;
import se.scalablesolutions.akka.kernel.actor.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
import se.scalablesolutions.akka.kernel.Kernel; import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.Kernel;
import junit.framework.TestCase; import junit.framework.TestCase;
public class InMemNestedStateTest extends 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(InMemFailer.class, new LifeCycle(new Permanent(), 1000), 1000)
//new Component("inmem-clasher", InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent(), 1000), 100000) //new Component("inmem-clasher", InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent(), 1000), 100000)
}).inject().supervise(); }).inject().supervise();
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config(); Config.config();
} }
protected void tearDown() { protected void tearDown() {

View file

@ -3,14 +3,14 @@ package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.transactionrequired;
import se.scalablesolutions.akka.annotation.prerestart; import se.scalablesolutions.akka.annotation.prerestart;
import se.scalablesolutions.akka.annotation.postrestart; import se.scalablesolutions.akka.annotation.postrestart;
import se.scalablesolutions.akka.kernel.state.*; import se.scalablesolutions.akka.state.*;
@transactionrequired @transactionrequired
public class InMemStateful { public class InMemStateful {
private TransactionalState factory = new TransactionalState(); private TransactionalState factory = new TransactionalState();
private TransactionalMap<String, String> mapState = factory.newInMemoryMap(); private TransactionalMap<String, String> mapState = factory.newMap();
private TransactionalVector<String> vectorState = factory.newInMemoryVector(); private TransactionalVector<String> vectorState = factory.newVector();
private TransactionalRef<String> refState = factory.newInMemoryRef(); private TransactionalRef<String> refState = factory.newRef();
public String getMapState(String key) { public String getMapState(String key) {
return (String)mapState.get(key).get(); return (String)mapState.get(key).get();

View file

@ -1,14 +1,14 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.transactionrequired;
import se.scalablesolutions.akka.kernel.state.*; import se.scalablesolutions.akka.state.*;
@transactionrequired @transactionrequired
public class InMemStatefulNested { public class InMemStatefulNested {
private TransactionalState factory = new TransactionalState(); private TransactionalState factory = new TransactionalState();
private TransactionalMap<String, String> mapState = factory.newInMemoryMap(); private TransactionalMap<String, String> mapState = factory.newMap();
private TransactionalVector<String> vectorState = factory.newInMemoryVector(); private TransactionalVector<String> vectorState = factory.newVector();
private TransactionalRef<String> refState = factory.newInMemoryRef(); private TransactionalRef<String> refState = factory.newRef();
public String getMapState(String key) { public String getMapState(String key) {

View file

@ -6,10 +6,11 @@ package se.scalablesolutions.akka.api;
import junit.framework.TestCase; import junit.framework.TestCase;
import se.scalablesolutions.akka.kernel.config.*; import se.scalablesolutions.akka.Config;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import se.scalablesolutions.akka.config.*;
import se.scalablesolutions.akka.kernel.actor.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
import se.scalablesolutions.akka.kernel.Kernel; import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.Kernel;
public class InMemoryStateTest extends TestCase { public class InMemoryStateTest extends TestCase {
static String messageLog = ""; static String messageLog = "";
@ -18,7 +19,7 @@ public class InMemoryStateTest extends TestCase {
protected void setUp() { protected void setUp() {
se.scalablesolutions.akka.kernel.Kernel$.MODULE$.config(); Config.config();
conf.configure( conf.configure(
new RestartStrategy(new AllForOne(), 3, 5000), new RestartStrategy(new AllForOne(), 3, 5000),
new Component[]{ new Component[]{

View file

@ -4,7 +4,7 @@ public class PersistenceManager {
private static volatile boolean isRunning = false; private static volatile boolean isRunning = false;
public static void init() { public static void init() {
if (!isRunning) { if (!isRunning) {
se.scalablesolutions.akka.kernel.Kernel.startRemoteService(); se.scalablesolutions.akka.Kernel.startRemoteService();
isRunning = true; isRunning = true;
} }
} }

View file

@ -1,7 +1,7 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.kernel.state.TransactionalMap; import se.scalablesolutions.akka.state.TransactionalMap;
import se.scalablesolutions.akka.kernel.state.CassandraPersistentTransactionalMap; import se.scalablesolutions.akka.state.CassandraPersistentTransactionalMap;
public class PersistentClasher { public class PersistentClasher {
private TransactionalMap state = new CassandraPersistentTransactionalMap(); private TransactionalMap state = new CassandraPersistentTransactionalMap();

View file

@ -4,10 +4,10 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.kernel.config.*; import se.scalablesolutions.akka.config.*;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
import se.scalablesolutions.akka.kernel.actor.*; import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.kernel.Kernel; import se.scalablesolutions.akka.Kernel;
import junit.framework.TestCase; import junit.framework.TestCase;

View file

@ -4,10 +4,10 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.kernel.config.*; import se.scalablesolutions.akka.config.*;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
import se.scalablesolutions.akka.kernel.actor.*; import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.kernel.Kernel; import se.scalablesolutions.akka.Kernel;
import junit.framework.TestCase; import junit.framework.TestCase;

View file

@ -1,14 +1,14 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.transactionrequired;
import se.scalablesolutions.akka.kernel.state.*; import se.scalablesolutions.akka.state.*;
@transactionrequired @transactionrequired
public class PersistentStateful { public class PersistentStateful {
private TransactionalState factory = new TransactionalState(); private PersistentState factory = new PersistentState();
private TransactionalMap mapState = factory.newPersistentMap(new CassandraStorageConfig()); private TransactionalMap mapState = factory.newMap(new CassandraStorageConfig());
private TransactionalVector vectorState = factory.newPersistentVector(new CassandraStorageConfig());; private TransactionalVector vectorState = factory.newVector(new CassandraStorageConfig());;
private TransactionalRef refState = factory.newPersistentRef(new CassandraStorageConfig()); private TransactionalRef refState = factory.newRef(new CassandraStorageConfig());
public String getMapState(String key) { public String getMapState(String key) {

View file

@ -1,14 +1,14 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.annotation.transactionrequired; import se.scalablesolutions.akka.annotation.transactionrequired;
import se.scalablesolutions.akka.kernel.state.*; import se.scalablesolutions.akka.state.*;
@transactionrequired @transactionrequired
public class PersistentStatefulNested { public class PersistentStatefulNested {
private TransactionalState factory = new TransactionalState(); private PersistentState factory = new PersistentState();
private TransactionalMap mapState = factory.newPersistentMap(new CassandraStorageConfig()); private TransactionalMap mapState = factory.newMap(new CassandraStorageConfig());
private TransactionalVector vectorState = factory.newPersistentVector(new CassandraStorageConfig());; private TransactionalVector vectorState = factory.newVector(new CassandraStorageConfig());;
private TransactionalRef refState = factory.newPersistentRef(new CassandraStorageConfig()); private TransactionalRef refState = factory.newRef(new CassandraStorageConfig());
public String getMapState(String key) { public String getMapState(String key) {

View file

@ -4,8 +4,10 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.kernel.actor.ActiveObjectFactory; import se.scalablesolutions.akka.Config;
import se.scalablesolutions.akka.kernel.nio.RemoteServer; import se.scalablesolutions.akka.actor.ActiveObjectFactory;
import se.scalablesolutions.akka.config.ActiveObjectManager;
import se.scalablesolutions.akka.nio.RemoteServer;
import junit.framework.TestCase; import junit.framework.TestCase;
public class RemoteInMemoryStateTest extends TestCase { public class RemoteInMemoryStateTest extends TestCase {
@ -19,9 +21,9 @@ public class RemoteInMemoryStateTest extends TestCase {
} }
}).start(); }).start();
try { Thread.currentThread().sleep(1000); } catch (Exception e) {} 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(); final private ActiveObjectFactory factory = new ActiveObjectFactory();
protected void tearDown() { protected void tearDown() {

View file

@ -4,10 +4,10 @@
package se.scalablesolutions.akka.api; package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.kernel.config.*; import se.scalablesolutions.akka.config.*;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
import se.scalablesolutions.akka.kernel.actor.*; import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.kernel.Kernel; import se.scalablesolutions.akka.Kernel;
import junit.framework.TestCase; import junit.framework.TestCase;

View file

@ -25,8 +25,8 @@ import java.net.URI;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import se.scalablesolutions.akka.kernel.config.*; import se.scalablesolutions.akka.config.*;
import static se.scalablesolutions.akka.kernel.config.JavaConfig.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
public class RestTest extends TestCase { public class RestTest extends TestCase {
@ -67,7 +67,7 @@ public class RestTest extends TestCase {
*/ */
private static SelectorThread startJersey() { private static SelectorThread startJersey() {
try { try {
Servlet servlet = new se.scalablesolutions.akka.kernel.rest.AkkaServlet(); Servlet servlet = new se.scalablesolutions.akka.rest.AkkaServlet();
ServletAdapter adapter = new ServletAdapter(); ServletAdapter adapter = new ServletAdapter();
adapter.setServletInstance(servlet); adapter.setServletInstance(servlet);
adapter.setContextPath(URI.getPath()); adapter.setContextPath(URI.getPath());

View file

@ -42,7 +42,6 @@
<groupId>se.scalablesolutions.akka</groupId> <groupId>se.scalablesolutions.akka</groupId>
<version>0.6</version> <version>0.6</version>
</dependency> </dependency>
<dependency>
<!-- Core deps --> <!-- Core deps -->
<dependency> <dependency>

View 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>

View file

@ -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 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="Viktor Klang" type="add">Support for Comet Actors using Atmosphere</action>
<action dev="Jonas Bon&#233;r" type="add">AMQP module; abstracted as an Actor</action> <action dev="Jonas Bon&#233;r" type="add">AMQP module; abstracted as an Actor</action>
<action dev="Jonas Bon&#233;r" type="add">Modularization of distribution into core and submodules</action> <action dev="Jonas Bon&#233;r" type="add">Modularization of distribution into a core and several submodules</action>
<action dev="Jonas Bon&#233;r" type="add">JSON serialization for Java objects (using Jackson)</action> <action dev="Jonas Bon&#233;r" type="add">JSON serialization for Java objects (using Jackson)</action>
<action dev="Jonas Bon&#233;r" type="add">JSON serialization for Scala objects (using scala-json)</action> <action dev="Jonas Bon&#233;r" type="add">JSON serialization for Scala objects (using scala-json)</action>
<action dev="Jonas Bon&#233;r" type="add">Protobuf serialization for Java and Scala objects</action> <action dev="Jonas Bon&#233;r" type="add">Protobuf serialization for Java and Scala objects</action>