summaryrefslogtreecommitdiff
path: root/src/test/java/MainTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/MainTest.java')
-rw-r--r--src/test/java/MainTest.java25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/test/java/MainTest.java b/src/test/java/MainTest.java
index 26898ac..ccef17a 100644
--- a/src/test/java/MainTest.java
+++ b/src/test/java/MainTest.java
@@ -36,16 +36,8 @@ public class MainTest {
}
}
- /**
- * @throws Exception
- */
public void testMapFiles() throws Exception {
-
- Properties wAppProperties = new Properties();
- wAppProperties.put(CastorXMLUtility.CASTOR_XML_SERIALIZER_FACTORY,
- "org.exolab.castor.xml.XercesXMLSerializerFactory");
-
- new CastorXMLUtility(Gateway.getResource(), wAppProperties, "mapFiles/");
+ new CastorXMLUtility(Gateway.getResource(), Gateway.getProperties(), Gateway.getResource().getKernelResourceURL("mapFiles/"));
}
public void testBootItems() throws Exception {
@@ -58,7 +50,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 +70,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 +81,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 +98,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";