Author: mriou
Date: Wed Feb 4 17:15:00 2009
New Revision: 740798
URL: http://svn.apache.org/viewvc?rev=740798&view=rev
Log:
Test cases fixes.
Modified:
ode/sandbox/simpel/lang/src/main/java/org/apache/ode/embed/ServerLifecycle.java
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/rest/RestfulSimPELTest.java
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/simpel/SimPELRuntimeTest.java
ode/sandbox/simpel/server/src/test/java/org.apache.ode.lifecycle/TestLifecycle.java
Modified:
ode/sandbox/simpel/lang/src/main/java/org/apache/ode/embed/ServerLifecycle.java
URL:
http://svn.apache.org/viewvc/ode/sandbox/simpel/lang/src/main/java/org/apache/ode/embed/ServerLifecycle.java?rev=740798&r1=740797&r2=740798&view=diff
==============================================================================
---
ode/sandbox/simpel/lang/src/main/java/org/apache/ode/embed/ServerLifecycle.java
(original)
+++
ode/sandbox/simpel/lang/src/main/java/org/apache/ode/embed/ServerLifecycle.java
Wed Feb 4 17:15:00 2009
@@ -143,7 +143,7 @@
if (!result.next()) {
String dbProductName = metaData.getDatabaseProductName();
- if (dbProductName.indexOf("Derby") > 0) {
+ if (dbProductName.indexOf("Derby") >= 0) {
stmt = conn.createStatement();
stmt.execute(DERBY_SCHEDULER_DDL1);
stmt.close();
@@ -154,7 +154,7 @@
stmt.execute(DERBY_SCHEDULER_DDL3);
stmt.close();
}
- if (dbProductName.indexOf("hsql") > 0) {
+ if (dbProductName.indexOf("HSQL") >= 0) {
stmt = conn.createStatement();
stmt.execute(HSQL_SCHEDULER_DDL);
}
Modified:
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/rest/RestfulSimPELTest.java
URL:
http://svn.apache.org/viewvc/ode/sandbox/simpel/lang/src/test/java/org/apache/ode/rest/RestfulSimPELTest.java?rev=740798&r1=740797&r2=740798&view=diff
==============================================================================
---
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/rest/RestfulSimPELTest.java
(original)
+++
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/rest/RestfulSimPELTest.java
Wed Feb 4 17:15:00 2009
@@ -30,6 +30,9 @@
}
private static final String HELLO_WORLD =
+ "processConfig.inMem = true;\n" +
+ "processConfig.address = \"/hello\";\n" +
+
"process HelloWorld { \n" +
" receive(self) { |name| \n" +
" helloXml = <hello>{\"Hello \" + name}</hello>; \n" +
@@ -39,9 +42,7 @@
public void testRestfulHelloWorld() throws Exception {
server.start();
- Descriptor desc = new Descriptor();
- desc.setAddress("/hello");
- server.deploy(HELLO_WORLD, desc);
+ server.deploy(HELLO_WORLD);
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
@@ -57,6 +58,9 @@
}
private static final String COUNTER =
+ "processConfig.inMem = true;\n" +
+ "processConfig.address = \"/counter\";\n" +
+
"process Counter {\n" +
" counter = receive(self); \n" +
" reply(counter, self); \n" +
@@ -88,9 +92,7 @@
public void testCounter() throws Exception {
server.start();
- Descriptor desc = new Descriptor(); // TODO remove the descriptor to
use environment-based configuration
- desc.setAddress("/counter");
- server.deploy(COUNTER, desc);
+ server.deploy(COUNTER);
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
@@ -154,6 +156,9 @@
}
public static final String CALLING_GET =
+ "processConfig.inMem = true;\n" +
+ "processConfig.address = \"/feedget\";\n" +
+
"var feedBUrl = \"http://feeds.feedburner.com/\"; " +
"process CallingGet {\n" +
" receive(self) { |query|\n" +
@@ -165,9 +170,7 @@
public void testCallingGet() throws Exception {
server.start();
- Descriptor desc = new Descriptor();
- desc.setAddress("/feedget");
- server.deploy(CALLING_GET, desc);
+ server.deploy(CALLING_GET);
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
@@ -181,6 +184,9 @@
}
public static final String GET_PUT_POST_DELETE =
+ "processConfig.inMem = true;\n" +
+ "processConfig.address = \"/gppdproc\";\n" +
+
"var testRoot = \"http://localhost:3434/gppd\"; " +
"process AllMethods {\n" +
" receive(self) { |query|\n" +
@@ -202,9 +208,7 @@
public void testAllMethods() throws Exception {
server.start();
- Descriptor desc = new Descriptor();
- desc.setAddress("/gppdproc");
- server.deploy(GET_PUT_POST_DELETE, desc);
+ server.deploy(GET_PUT_POST_DELETE);
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
@@ -218,6 +222,9 @@
}
public static final String POST_WITH_201 =
+ "processConfig.inMem = true;\n" +
+ "processConfig.address = \"/post201proc\";\n" +
+
"var testRoot = \"http://localhost:3434/post201\"; " +
"process PostRedirect {\n" +
" receive(self) { |query|\n" +
@@ -235,9 +242,7 @@
public void testPostWith201() throws Exception {
server.start();
- Descriptor desc = new Descriptor();
- desc.setAddress("/post201proc");
- server.deploy(POST_WITH_201, desc);
+ server.deploy(POST_WITH_201);
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
@@ -251,6 +256,9 @@
}
private static final String HELLO_FORM_WORLD = // TODO reply with HTML
+ "processConfig.inMem = true;\n" +
+ "processConfig.address = \"/hello-form\";\n" +
+
"process HelloFormWorld { \n" +
" receive(self) { |form| \n" +
" helloXml = <hello>{\"Hello \" + form.firstname + \" \" +
form.lastname}</hello>; \n" +
@@ -260,9 +268,7 @@
public void testFormHelloWorld() throws Exception {
server.start();
- Descriptor desc = new Descriptor();
- desc.setAddress("/hello-form");
- server.deploy(HELLO_FORM_WORLD, desc);
+ server.deploy(HELLO_FORM_WORLD);
ClientConfig cc = new DefaultClientConfig();
Client c = Client.create(cc);
Modified:
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/simpel/SimPELRuntimeTest.java
URL:
http://svn.apache.org/viewvc/ode/sandbox/simpel/lang/src/test/java/org/apache/ode/simpel/SimPELRuntimeTest.java?rev=740798&r1=740797&r2=740798&view=diff
==============================================================================
---
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/simpel/SimPELRuntimeTest.java
(original)
+++
ode/sandbox/simpel/lang/src/test/java/org/apache/ode/simpel/SimPELRuntimeTest.java
Wed Feb 4 17:15:00 2009
@@ -31,6 +31,7 @@
}
private static final String HELLO_WORLD =
+ "processConfig.inMem = true;\n" +
"process HelloWorld {\n" +
" receive(myPl, helloOp) { |msgIn|\n" +
" msgOut = msgIn + \" World\";\n" +
@@ -51,6 +52,7 @@
}
private static final String XML_DATA_MANIPULATION =
+ "processConfig.inMem = true;\n" +
"process XmlData {\n" +
" receive(dataPl, dataOp) { |msgIn|\n" +
" friendInfo = <friend></friend>;\n" +
@@ -84,6 +86,7 @@
}
private static final String SIMPLE_IF =
+ "processConfig.inMem = true;\n" +
"process SimpleIf {\n" +
" receive(ifPl, ifOp) { |quantity|\n" +
" if (quantity > 20) {\n" +
@@ -113,6 +116,7 @@
}
public static final String INVOKE_ONE_WAY =
+ "processConfig.inMem = true;\n" +
"process InvokeOneWay {\n" +
" receive(iowPl, iowOp) { |status|\n" +
" invoke(partnerPl, partnerOp, status);\n" +
@@ -145,6 +149,7 @@
}
public static final String INVOKE_TWO_WAYS =
+ "processConfig.inMem = true;\n" +
"process InvokeTwoWays {\n" +
" receive(itwPl, itwOp) { |initial|\n" +
" operands = <operands></operands>; \n"+
@@ -183,6 +188,7 @@
}
private static final String JS_GLOBAL_STATE =
+ "processConfig.inMem = true;\n" +
"var append = \" Yeeha!\"; \n" +
"function helloPrepend(p) { return \"Hello \" + p; }; \n" +
"\n" +
@@ -207,6 +213,7 @@
}
private static final String SIMPLE_CORRELATION =
+ "processConfig.inMem = true;\n" +
"function getExchangeId(msg) { return msg.id; }; \n" +
"function getExchangeName(msg) { return msg.name; }; \n" +
"\n" +
@@ -247,6 +254,7 @@
}
private static final String WHILE_LOOP =
+ "processConfig.inMem = true;\n" +
"process WhileLoop { \n" +
" receive(myPl, firstOp) { |counter| \n" +
" i = 0; j = 1; cur = 1; \n" +
@@ -271,6 +279,7 @@
}
private static final String WAIT =
+ "processConfig.inMem = true;\n" +
"process WaitProcess {\n" +
" receive(myPl, helloOp) { |msgIn|\n" +
" wait(\"PT1S\");\n" +
@@ -291,6 +300,7 @@
}
private static final String RECEIVE_ASSIGN =
+ "processConfig.inMem = true;\n" +
"process ReceiveAssign {\n" +
" msgIn = receive(myPl, helloOp); \n" +
" msgOut = msgIn + \" World\";\n" +
Modified:
ode/sandbox/simpel/server/src/test/java/org.apache.ode.lifecycle/TestLifecycle.java
URL:
http://svn.apache.org/viewvc/ode/sandbox/simpel/server/src/test/java/org.apache.ode.lifecycle/TestLifecycle.java?rev=740798&r1=740797&r2=740798&view=diff
==============================================================================
---
ode/sandbox/simpel/server/src/test/java/org.apache.ode.lifecycle/TestLifecycle.java
(original)
+++
ode/sandbox/simpel/server/src/test/java/org.apache.ode.lifecycle/TestLifecycle.java
Wed Feb 4 17:15:00 2009
@@ -24,7 +24,7 @@
" }\n" +
"}";
- public void testFSDeploy() throws Exception {
+ public void testFSDeployUndeploy() throws Exception {
String rootDir = new
File(getClass().getClassLoader().getResource("marker").getFile()).getParent();
StandaloneServer.main(new String[] { rootDir });