summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrew <andrew@10.0.5.205>2013-07-15 16:42:49 +0200
committerandrew <andrew@10.0.5.205>2013-07-15 16:43:12 +0200
commiteb7e6084a0a21c48fea41312a21f979422924b23 (patch)
tree9391c40791ecea8c38fd94ff5a4dc74a39b6052a
parenta8b3981056e06bc4f74e4d35b3ad23beafba0145 (diff)
Report time spent marshalling and unmarshalling.
-rw-r--r--src/test/java/MainTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/java/MainTest.java b/src/test/java/MainTest.java
index ce15527..c292df9 100644
--- a/src/test/java/MainTest.java
+++ b/src/test/java/MainTest.java
@@ -36,6 +36,7 @@ public class MainTest {
String bootItems = FileStringUtility.url2String(Resource.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);
@@ -50,11 +51,15 @@ public class MainTest {
}
assert errors.length()==0;
- if (itemType.equals("CA") && !itemType.equals("EA")) {
+ if (itemType.equals("CA") || itemType.equals("EA")) {
Logger.msg(1, "Remarshalling "+thisItem);
+ long then = System.currentTimeMillis();
Object unmarshalled = Gateway.getMarshaller().unmarshall(data);
assert unmarshalled!=null;
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);
if (errors.length() > 0) {
Logger.error("Remarshalled resource "+thisItem+" has errors :"+errors);
@@ -70,6 +75,7 @@ public class MainTest {
// assert xmlDiff.identical();
}
}
+ Logger.msg("Total Castor marshall time: "+castorTime+"ms");
}
private static Schema getSchema(String name, int version, String resPath) throws ObjectNotFoundException {