summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/MainTest.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/test/java/MainTest.java b/src/test/java/MainTest.java
index 26898ac..431c4c0 100644
--- a/src/test/java/MainTest.java
+++ b/src/test/java/MainTest.java
@@ -12,6 +12,7 @@ import com.c2kernel.persistency.outcome.SchemaValidator;
import com.c2kernel.process.Gateway;
import com.c2kernel.scripting.Script;
import com.c2kernel.utils.CastorXMLUtility;
+import com.c2kernel.scripting.ScriptParsingException;
import com.c2kernel.utils.FileStringUtility;
import com.c2kernel.utils.Logger;
@@ -58,7 +59,6 @@ public class MainTest {
String bootItems = FileStringUtility.url2String(Gateway.getResource().getKernelResourceURL("boot/allbootitems.txt"));
StringTokenizer str = new StringTokenizer(bootItems, "\n\r");
- long castorTime=0;
while (str.hasMoreTokens()) {
String thisItem = str.nextToken();
Logger.msg(1, "Validating "+thisItem);
@@ -79,7 +79,6 @@ public class MainTest {
String remarshalled = Gateway.getMarshaller().marshall(unmarshalled);
long now = System.currentTimeMillis();
Logger.msg("Marshall/remarshall of "+thisItem+" took "+(now-then)+"ms");
- castorTime+=(now-then);
errors = validator.validate(remarshalled);
assert errors.length()==0 : "Remarshalled resource "+thisItem+" has errors :"+errors+"\nRemarshalled form:\n"+remarshalled;
@@ -91,8 +90,12 @@ public class MainTest {
// }
// assert xmlDiff.identical();
}
- }
- Logger.msg("Total Castor marshall time: "+castorTime+"ms");
+
+ if (itemType.equals("SC")) {
+ Logger.msg(1, "Parsing script "+thisItem);
+ new Script(thisItem, 0, data);
+ }
+ }
}
private static Schema getSchema(String name, int version, String resPath) throws ObjectNotFoundException {
@@ -104,11 +107,10 @@ public class MainTest {
String testScriptString = FileStringUtility.url2String(MainTest.class.getResource("TestScript.xml"));
String errors = valid.validate(testScriptString);
assert errors.length()==0 : "Test script not valid to schema: "+errors;
-
- Script testScript = new Script(testScriptString);
+
+ Script testScript = new Script("TestScript", 0, testScriptString);
assert testScript.getInputParams().size()==1 : "Script input param count wrong";
assert testScript.getInputParams().get("test")!=null : "Could not retrieve script input param value";
-
testScript.setInputParamValue("test", "Test");
assert testScript.getInputParams().get("test").getInitialised() : "Script is not initialized when it should be";