asakusafw/asakusafw — Issue #100: Test driver fails with IllegalArgumentException if batch argument value for Context API includes space character
Author: aoetk
Created: 2011-10-31 10:11:28+00:00
State: open

See following example.

// Operator
@Update
public void update(Ex1 model, int value) {
Report.info(BatchContext.get("datum"));
...
}

// Test code
@Test
public void testExample() throws Throwable {
BatchTester batchDriver = new BatchTester(this.getClass());
batchDriver.setBatchArg("datum", "2011-10-3110:00:00");
...
}

// Exception
19:49:36 [main] INFO c.a.testdriver.JobflowExecutor - 【COMMAND】 /home/asakusa/asakusa/experimental/bin/hadoop_job_run.sh test.flowpart.testing.flowpart.stage0001.StageClient /home/asakusa/workspace_windgate1/portal-asakusa/target/testdriver/batchcwork/jobflow-flowpart.jar -D com.asakusafw.executionId=TestFpBranchFilter.testing.flowpart -D com.asakusafw.batchArgs=datum=1999-10-27 14:00:00 -D com.asakusafw.user=asakusa
【COMMAND】/usr/lib/hadoop/bin/hadoop jar /home/asakusa/asakusa/core/lib/asakusa-runtime.jar com.asakusafw.runtime.stage.ToolLauncher test.flowpart.testing.flowpart.stage0001.StageClient -conf /home/asakusa/asakusa/core/conf/asakusa-resources.xml -libjars /home/asakusa/workspace_windgate1/portal-asakusa/target/testdriver/batchcwork/jobflow-flowpart.jar,/home/asakusa/asakusa/core/lib/asakusa-runtime.jar -D com.asakusafw.executionId=TestFpBranchFilter.testing.flowpart -D com.asakusafw.batchArgs=datum=1999-10-27 14:00:00 -D com.asakusafw.user=asakusa
java.lang.IllegalStateException: プロパティ"com.asakusafw.user"が設定されていません
at com.asakusafw.runtime.stage.AbstractStageClient.getMandatoryProperty(AbstractStageClient.java:232)
at com.asakusafw.runtime.stage.AbstractStageClient.getUser(AbstractStageClient.java:217)
at com.asakusafw.runtime.stage.AbstractStageClient.getPathParser(AbstractStageClient.java:601)
at com.asakusafw.runtime.stage.AbstractStageClient.createJob(AbstractStageClient.java:422)
at com.asakusafw.runtime.stage.AbstractStageClient.run(AbstractStageClient.java:406)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at com.asakusafw.runtime.stage.ToolLauncher.main(ToolLauncher.java:87)
at com.asakusafw.runtime.stage.ToolLauncher.main(ToolLauncher.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:186)