You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by rm...@apache.org on 2015/10/24 20:55:06 UTC
incubator-batchee git commit: BATCHEE-67 patch from Scott Kurz to
propagate job name + upgrading TCKs. Also fixing few tests not determistic
and upgrading openejb version for TCKs.
Repository: incubator-batchee
Updated Branches:
refs/heads/master 6d7a20dfc -> 31a4d1214
BATCHEE-67 patch from Scott Kurz to propagate job name + upgrading TCKs. Also fixing few tests not determistic and upgrading openejb version for TCKs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-batchee/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-batchee/commit/31a4d121
Tree: http://git-wip-us.apache.org/repos/asf/incubator-batchee/tree/31a4d121
Diff: http://git-wip-us.apache.org/repos/asf/incubator-batchee/diff/31a4d121
Branch: refs/heads/master
Commit: 31a4d1214753f509a3ef244b94f6bdf202cf8eca
Parents: 6d7a20d
Author: Romain Manni-Bucau <rm...@gmail.com>
Authored: Sat Oct 24 20:54:56 2015 +0200
Committer: Romain Manni-Bucau <rm...@gmail.com>
Committed: Sat Oct 24 20:54:56 2015 +0200
----------------------------------------------------------------------
jbatch/pom.xml | 802 +++++++++----------
.../batchee/container/impl/JobContextImpl.java | 12 +-
.../controller/PartitionedStepController.java | 2 +-
.../impl/controller/SplitController.java | 4 +-
.../impl/jobinstance/RuntimeJobExecution.java | 1 +
.../container/services/BatchKernelService.java | 6 +-
.../services/kernel/DefaultBatchKernel.java | 11 +-
.../MemoryPersistenceManagerService.java | 3 +
jbatch/src/test/resources/suites/tck.xml | 56 --
pom.xml | 21 +-
.../java/org/apache/batchee/cli/MainTest.java | 18 +-
11 files changed, 448 insertions(+), 488 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/pom.xml
----------------------------------------------------------------------
diff --git a/jbatch/pom.xml b/jbatch/pom.xml
index 9af8663..8b0eac2 100644
--- a/jbatch/pom.xml
+++ b/jbatch/pom.xml
@@ -15,425 +15,419 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>batchee</artifactId>
- <groupId>org.apache.batchee</groupId>
- <version>0.3-incubating-SNAPSHOT</version>
- </parent>
+ <parent>
+ <artifactId>batchee</artifactId>
+ <groupId>org.apache.batchee</groupId>
+ <version>0.3-incubating-SNAPSHOT</version>
+ </parent>
- <artifactId>batchee-jbatch</artifactId>
- <name>BatchEE :: JBatch</name>
+ <artifactId>batchee-jbatch</artifactId>
+ <name>BatchEE :: JBatch</name>
- <properties>
- <openjpa.version>2.3.0</openjpa.version>
+ <properties>
+ <openjpa.version>2.3.0</openjpa.version>
- <tck.suite>${project.basedir}/src/test/resources/suites/tck.xml</tck.suite>
- <tck.unpack.dir>${project.build.directory}/tck</tck.unpack.dir>
- <tck.dir>${tck.unpack.dir}/jsr352-tck-1.0/artifacts</tck.dir>
- </properties>
+ <tck.suite>${project.build.directory}/test-classes/testng/jsr352-tck-impl-EE-suite.xml</tck.suite>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jbatch_1.0_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-atinject_1.0_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jcdi_1.0_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ejb_3.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-interceptor_1.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.components</groupId>
- <artifactId>geronimo-transaction</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-servlet_3.0_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jbatch_1.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ejb_3.1_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.components</groupId>
+ <artifactId>geronimo-transaction</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.apache.xbean</groupId>
- <artifactId>xbean-reflect</artifactId>
- <version>3.16</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-reflect</artifactId>
+ <version>3.16</version>
+ </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-core</artifactId>
- <version>4.6.0</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-core</artifactId>
+ <version>4.7.2</version>
+ <scope>test</scope>
+ </dependency>
- </dependencies>
+ <dependency>
+ <groupId>com.ibm.jbatch.tck</groupId>
+ <artifactId>com.ibm.jbatch.tck</artifactId>
+ <version>1.1-b02</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.batch</groupId>
+ <artifactId>javax.batch-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </exclusion>
+ <!-- SNAPSHOTS -->
+ <exclusion>
+ <groupId>com.ibm.jbatch</groupId>
+ <artifactId>com.ibm.jbatch.spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.jbatch.tck</groupId>
+ <artifactId>com.ibm.jbatch.tck.spi</artifactId>
+ <version>1.1-b02</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.batch</groupId>
+ <artifactId>javax.batch-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>src/main/xsd</directory>
- <targetPath>xsd</targetPath>
- </resource>
- </resources>
- <plugins>
- <!-- download tcks since i didn't find the maven artifact with tests -->
- <plugin>
- <groupId>com.googlecode.maven-download-plugin</groupId>
- <artifactId>maven-download-plugin</artifactId>
- <version>1.1.0</version>
- <executions>
- <execution>
- <id>get-tck</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <url>https://java.net/projects/jbatch/downloads/download/jsr352-tck-1.0.zip</url>
- <unpack>true</unpack>
- <outputDirectory>${tck.unpack.dir}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/xsd</directory>
+ <targetPath>xsd</targetPath>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-tck</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>generate-test-sources</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.ibm.jbatch.tck</groupId>
+ <artifactId>com.ibm.jbatch.tck</artifactId>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ <includes>testng/*</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19</version>
+ <executions>
+ <execution>
+ <id>batchee-tests</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tck-in-memory</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <systemProperties>
+ <PersistenceManagerService>org.apache.batchee.container.services.persistence.MemoryPersistenceManagerService</PersistenceManagerService>
+ </systemProperties>
+ <suiteXmlFiles>
+ <suiteXmlFile>${tck.suite}</suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.batchee.test.tck.lifecycle.ContainerLifecycle</value>
+ </property>
+ </properties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tck-jdbc</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <systemProperties>
+ <PersistenceManagerService>org.apache.batchee.container.services.persistence.JDBCPersistenceManagerService</PersistenceManagerService>
+ </systemProperties>
+ <suiteXmlFiles>
+ <suiteXmlFile>${tck.suite}</suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.batchee.test.tck.lifecycle.ContainerLifecycle</value>
+ </property>
+ </properties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tck-jpa</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <systemProperties>
+ <PersistenceManagerService>org.apache.batchee.container.services.persistence.JPAPersistenceManagerService</PersistenceManagerService>
+ </systemProperties>
+ <suiteXmlFiles>
+ <suiteXmlFile>${tck.suite}</suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.batchee.test.tck.lifecycle.ContainerLifecycle</value>
+ </property>
+ </properties>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <skip>true</skip>
+ <forkCount>1</forkCount>
+ <reuseForks>false</reuseForks>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <executions>
- <execution>
- <id>batchee-tests</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- </configuration>
- </execution>
- <execution>
- <id>tck-in-memory</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <systemProperties>
- <PersistenceManagerService>org.apache.batchee.container.services.persistence.MemoryPersistenceManagerService</PersistenceManagerService>
- </systemProperties>
- <suiteXmlFiles>
- <suiteXmlFile>${tck.suite}</suiteXmlFile>
- </suiteXmlFiles>
- <additionalClasspathElements>
- <additionalClasspathElement>${tck.dir}/jsr352-tck-impl.jar</additionalClasspathElement>
- <additionalClasspathElement>${tck.dir}/jsr352-tck-SPI.jar</additionalClasspathElement>
- </additionalClasspathElements>
- </configuration>
- </execution>
- <execution>
- <id>tck-jdbc</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <systemProperties>
- <PersistenceManagerService>org.apache.batchee.container.services.persistence.JDBCPersistenceManagerService</PersistenceManagerService>
- </systemProperties>
- <suiteXmlFiles>
- <suiteXmlFile>${tck.suite}</suiteXmlFile>
- </suiteXmlFiles>
- <additionalClasspathElements>
- <additionalClasspathElement>${tck.dir}/jsr352-tck-impl.jar</additionalClasspathElement>
- <additionalClasspathElement>${tck.dir}/jsr352-tck-SPI.jar</additionalClasspathElement>
- </additionalClasspathElements>
- </configuration>
- </execution>
- <execution>
- <id>tck-jpa</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <systemProperties>
- <PersistenceManagerService>org.apache.batchee.container.services.persistence.JPAPersistenceManagerService</PersistenceManagerService>
- </systemProperties>
- <suiteXmlFiles>
- <suiteXmlFile>${tck.suite}</suiteXmlFile>
- </suiteXmlFiles>
- <additionalClasspathElements>
- <additionalClasspathElement>${tck.dir}/jsr352-tck-impl.jar</additionalClasspathElement>
- <additionalClasspathElement>${tck.dir}/jsr352-tck-SPI.jar</additionalClasspathElement>
- </additionalClasspathElements>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <skip>true</skip>
- <forkCount>1</forkCount>
- <reuseForks>false</reuseForks>
+ <!--
+ Global config for TCKs shared with batchee internal tests,
+ that's not a big deal since internal tests doesn't use it
+ and it avoids to spread it over all our executions
+ -->
+ <systemProperties>
+ <batchee.service-manager.log>true</batchee.service-manager.log>
- <!--
- Global config for TCKs shared with batchee internal tests,
- that's not a big deal since internal tests doesn't use it
- and it avoids to spread it over all our executions
- -->
- <systemProperties>
- <batchee.service-manager.log>true</batchee.service-manager.log>
+ <!-- replace properties file -->
+ <tck.execution.waiter.timeout>900000</tck.execution.waiter.timeout>
+ <ExecutionTests.testInvokeJobWithUserStop.sleep>1000</ExecutionTests.testInvokeJobWithUserStop.sleep>
+ <JobOperatorTests.testInvokeJobWithUserStop.sleep>1000</JobOperatorTests.testInvokeJobWithUserStop.sleep>
+ <JobOperatorTests.testJobOperatorGetRunningJobExecutions.sleep>1000</JobOperatorTests.testJobOperatorGetRunningJobExecutions.sleep>
+ <JobOperatorTests.testJobOperatorGetRunningJobExecutions.app.timeinterval>10000</JobOperatorTests.testJobOperatorGetRunningJobExecutions.app.timeinterval>
+ <JobOperatorTests.testJobOperatorGetRunningJobInstancesException.app.timeinterval>10000
+ </JobOperatorTests.testJobOperatorGetRunningJobInstancesException.app.timeinterval>
+ <ParallelExecutionTests.testStopRunningPartitionedStep.sleep>1900</ParallelExecutionTests.testStopRunningPartitionedStep.sleep>
+ <ParallelExecutionTests.testStopRestartRunningPartitionedStep.sleep>1900</ParallelExecutionTests.testStopRestartRunningPartitionedStep.sleep>
+ <ParallelExecutionTests.testInvokeJobWithOnePartitionedStepExitStatus.sleep>2000</ParallelExecutionTests.testInvokeJobWithOnePartitionedStepExitStatus.sleep>
+ <StopOrFailOnExitStatusWithRestartTests.testInvokeJobWithUserStop.sleep>500</StopOrFailOnExitStatusWithRestartTests.testInvokeJobWithUserStop.sleep>
+ <TransactionTests.testGlobalTranNoExceptions.sleep>0</TransactionTests.testGlobalTranNoExceptions.sleep>
+ <TransactionTests.testGlobalTranForcedExceptionWithRollback.sleep>0</TransactionTests.testGlobalTranForcedExceptionWithRollback.sleep>
+ <TransactionTests.testGlobalTranForcedExceptionCheckpointRestart.sleep>0</TransactionTests.testGlobalTranForcedExceptionCheckpointRestart.sleep>
+ <TransactionTests.testGlobalTranNoDelayLongTimeout.sleep>0</TransactionTests.testGlobalTranNoDelayLongTimeout.sleep>
+ <TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.1>10000
+ </TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.1>
+ <TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.2>0
+ </TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.2>
+ <TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutSteps.sleep>10000
+ </TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutSteps.sleep>
+ <TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutStepsCustomCheckpointAlgorithm.sleep>10000
+ </TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutStepsCustomCheckpointAlgorithm.sleep>
+ <TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.1>10000</TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.1>
+ <TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.2>0</TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.2>
+ <ChunkTests.testChunkTimeBased10Seconds.sleep>500</ChunkTests.testChunkTimeBased10Seconds.sleep>
+ <ChunkTests.testChunkRestartTimeBasedCheckpoint.sleep>500</ChunkTests.testChunkRestartTimeBasedCheckpoint.sleep>
+ <ChunkTests.testChunkTimeBasedTimeLimit0.sleep>500</ChunkTests.testChunkTimeBasedTimeLimit0.sleep>
+ <ChunkTests.testChunkRestartTimeBasedDefaultCheckpoint.sleep>500</ChunkTests.testChunkRestartTimeBasedDefaultCheckpoint.sleep>
+ </systemProperties>
+ </configuration>
+ </plugin>
- <!-- replace properties file -->
- <tck.execution.waiter.timeout>900000</tck.execution.waiter.timeout>
- <ExecutionTests.testInvokeJobWithUserStop.sleep>1000</ExecutionTests.testInvokeJobWithUserStop.sleep>
- <JobOperatorTests.testInvokeJobWithUserStop.sleep>1000</JobOperatorTests.testInvokeJobWithUserStop.sleep>
- <JobOperatorTests.testJobOperatorGetRunningJobExecutions.sleep>1000</JobOperatorTests.testJobOperatorGetRunningJobExecutions.sleep>
- <JobOperatorTests.testJobOperatorGetRunningJobExecutions.app.timeinterval>10000</JobOperatorTests.testJobOperatorGetRunningJobExecutions.app.timeinterval>
- <JobOperatorTests.testJobOperatorGetRunningJobInstancesException.app.timeinterval>10000</JobOperatorTests.testJobOperatorGetRunningJobInstancesException.app.timeinterval>
- <ParallelExecutionTests.testStopRunningPartitionedStep.sleep>1900</ParallelExecutionTests.testStopRunningPartitionedStep.sleep>
- <ParallelExecutionTests.testStopRestartRunningPartitionedStep.sleep>1900</ParallelExecutionTests.testStopRestartRunningPartitionedStep.sleep>
- <ParallelExecutionTests.testInvokeJobWithOnePartitionedStepExitStatus.sleep>2000</ParallelExecutionTests.testInvokeJobWithOnePartitionedStepExitStatus.sleep>
- <StopOrFailOnExitStatusWithRestartTests.testInvokeJobWithUserStop.sleep>500</StopOrFailOnExitStatusWithRestartTests.testInvokeJobWithUserStop.sleep>
- <TransactionTests.testGlobalTranNoExceptions.sleep>0</TransactionTests.testGlobalTranNoExceptions.sleep>
- <TransactionTests.testGlobalTranForcedExceptionWithRollback.sleep>0</TransactionTests.testGlobalTranForcedExceptionWithRollback.sleep>
- <TransactionTests.testGlobalTranForcedExceptionCheckpointRestart.sleep>0</TransactionTests.testGlobalTranForcedExceptionCheckpointRestart.sleep>
- <TransactionTests.testGlobalTranNoDelayLongTimeout.sleep>0</TransactionTests.testGlobalTranNoDelayLongTimeout.sleep>
- <TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.1>10000</TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.1>
- <TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.2>0</TransactionTests.testGlobalTranLongDelayShortTimeoutThenNoDelayShortTimeout.sleep.2>
- <TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutSteps.sleep>10000</TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutSteps.sleep>
- <TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutStepsCustomCheckpointAlgorithm.sleep>10000</TransactionTests.testGlobalTranLongDelayMixOfLongTimeoutStepsAndShortTimeoutStepsCustomCheckpointAlgorithm.sleep>
- <TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.1>10000</TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.1>
- <TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.2>0</TransactionTests.testGlobalTranForcedTimeoutCheckpointRestart.sleep.2>
- <ChunkTests.testChunkTimeBased10Seconds.sleep>500</ChunkTests.testChunkTimeBased10Seconds.sleep>
- <ChunkTests.testChunkRestartTimeBasedCheckpoint.sleep>500</ChunkTests.testChunkRestartTimeBasedCheckpoint.sleep>
- <ChunkTests.testChunkTimeBasedTimeLimit0.sleep>500</ChunkTests.testChunkTimeBasedTimeLimit0.sleep>
- <ChunkTests.testChunkRestartTimeBasedDefaultCheckpoint.sleep>500</ChunkTests.testChunkRestartTimeBasedDefaultCheckpoint.sleep>
- </systemProperties>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>templating-maven-plugin</artifactId>
+ <version>1.0-alpha-3</version>
+ <executions>
+ <execution>
+ <id>filter-src</id>
+ <goals>
+ <goal>filter-sources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>templating-maven-plugin</artifactId>
- <version>1.0-alpha-3</version>
- <executions>
- <execution>
- <id>filter-src</id>
- <goals>
- <goal>filter-sources</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <!--
+ * We use the openjpa-maven-plugin just for generating the
+ * CREATE TABLE statements for various databases.
+ * Those will later be zipped and added as attached artifact.
+ -->
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-maven-plugin</artifactId>
+ <version>${openjpa.version}</version>
- <plugin>
- <!--
- * We use the openjpa-maven-plugin just for generating the
- * CREATE TABLE statements for various databases.
- * Those will later be zipped and added as attached artifact.
- -->
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-maven-plugin</artifactId>
- <version>${openjpa.version}</version>
+ <configuration>
+ <includes>org/apache/batchee/container/services/persistence/jpa/domain/*.class</includes>
+ <addDefaultConstructor>true</addDefaultConstructor>
+ <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+ <persistenceXmlFile>${project.basedir}/src/test/resources/META-INF/persistence-createdb.xml</persistenceXmlFile>
+ <sqlAction>build</sqlAction>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ </toolProperties>
+ </configuration>
- <configuration>
- <includes>org/apache/batchee/container/services/persistence/jpa/domain/*.class</includes>
- <addDefaultConstructor>true</addDefaultConstructor>
- <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
- <persistenceXmlFile>${project.basedir}/src/test/resources/META-INF/persistence-createdb.xml</persistenceXmlFile>
- <sqlAction>build</sqlAction>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- </toolProperties>
- </configuration>
+ <executions>
+ <execution>
+ <id>oracle</id>
+ <goals>
+ <goal>sql</goal>
+ </goals>
+ <phase>process-classes</phase>
+ <configuration>
+ <sqlFile>${project.build.directory}/database-oracle.sql</sqlFile>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ <DBDictionary>org.apache.openjpa.jdbc.sql.OracleDictionary</DBDictionary>
+ </toolProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>mysql</id>
+ <goals>
+ <goal>sql</goal>
+ </goals>
+ <phase>process-classes</phase>
+ <configuration>
+ <sqlFile>${project.build.directory}/database-myslq.sql</sqlFile>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ <DBDictionary>org.apache.openjpa.jdbc.sql.MySQLDictionary</DBDictionary>
+ </toolProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>h2</id>
+ <goals>
+ <goal>sql</goal>
+ </goals>
+ <phase>process-classes</phase>
+ <configuration>
+ <sqlFile>${project.build.directory}/database-h2.sql</sqlFile>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ <DBDictionary>org.apache.openjpa.jdbc.sql.H2Dictionary</DBDictionary>
+ </toolProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>DB2</id>
+ <goals>
+ <goal>sql</goal>
+ </goals>
+ <phase>process-classes</phase>
+ <configuration>
+ <sqlFile>${project.build.directory}/database-db2.sql</sqlFile>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ <DBDictionary>org.apache.openjpa.jdbc.sql.DB2Dictionary</DBDictionary>
+ </toolProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>hsqldb</id>
+ <goals>
+ <goal>sql</goal>
+ </goals>
+ <phase>process-classes</phase>
+ <configuration>
+ <sqlFile>${project.build.directory}/database-hsqldb.sql</sqlFile>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ <DBDictionary>org.apache.openjpa.jdbc.sql.HSQLDictionary</DBDictionary>
+ </toolProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>derby</id>
+ <goals>
+ <goal>sql</goal>
+ </goals>
+ <phase>process-classes</phase>
+ <configuration>
+ <sqlFile>${project.build.directory}/database-derby.sql</sqlFile>
+ <toolProperties>
+ <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
+ <DBDictionary>org.apache.openjpa.jdbc.sql.DerbyDictionary</DBDictionary>
+ </toolProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <descriptors>
+ <descriptor>src/main/assembly/dbscripts-assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <executions>
- <execution>
- <id>oracle</id>
- <goals><goal>sql</goal></goals>
- <phase>process-classes</phase>
- <configuration>
- <sqlFile>${project.build.directory}/database-oracle.sql</sqlFile>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- <DBDictionary>org.apache.openjpa.jdbc.sql.OracleDictionary</DBDictionary>
- </toolProperties>
- </configuration>
- </execution>
- <execution>
- <id>mysql</id>
- <goals><goal>sql</goal></goals>
- <phase>process-classes</phase>
- <configuration>
- <sqlFile>${project.build.directory}/database-myslq.sql</sqlFile>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- <DBDictionary>org.apache.openjpa.jdbc.sql.MySQLDictionary</DBDictionary>
- </toolProperties>
- </configuration>
- </execution>
- <execution>
- <id>h2</id>
- <goals><goal>sql</goal></goals>
- <phase>process-classes</phase>
- <configuration>
- <sqlFile>${project.build.directory}/database-h2.sql</sqlFile>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- <DBDictionary>org.apache.openjpa.jdbc.sql.H2Dictionary</DBDictionary>
- </toolProperties>
- </configuration>
- </execution>
- <execution>
- <id>DB2</id>
- <goals><goal>sql</goal></goals>
- <phase>process-classes</phase>
- <configuration>
- <sqlFile>${project.build.directory}/database-db2.sql</sqlFile>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- <DBDictionary>org.apache.openjpa.jdbc.sql.DB2Dictionary</DBDictionary>
- </toolProperties>
- </configuration>
- </execution>
- <execution>
- <id>hsqldb</id>
- <goals><goal>sql</goal></goals>
- <phase>process-classes</phase>
- <configuration>
- <sqlFile>${project.build.directory}/database-hsqldb.sql</sqlFile>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- <DBDictionary>org.apache.openjpa.jdbc.sql.HSQLDictionary</DBDictionary>
- </toolProperties>
- </configuration>
- </execution>
- <execution>
- <id>derby</id>
- <goals><goal>sql</goal></goals>
- <phase>process-classes</phase>
- <configuration>
- <sqlFile>${project.build.directory}/database-derby.sql</sqlFile>
- <toolProperties>
- <MappingDefaults>ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict</MappingDefaults>
- <DBDictionary>org.apache.openjpa.jdbc.sql.DerbyDictionary</DBDictionary>
- </toolProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <tarLongFileMode>gnu</tarLongFileMode>
- <descriptors>
- <descriptor>src/main/assembly/dbscripts-assembly.xml</descriptor>
- </descriptors>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
-
- <profiles>
- <profile>
- <!--
- To debug having TCK at classpath (to be able to debug in TCK classes and/or to get completion in dev-suite.xml):
- 1) mvn process-test-classes
- 2) cp -r target/tck/jsr352-tck-1.0/artifacts/ /tmp
- 3) activate the following dependencies
- -->
- <id>tckdebug</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack_tck_tests</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <unzip src="${tck.dir}/jsr352-tck-impl-src.jar" dest="${project.build.directory}/tck-test-src" />
- <unzip src="${tck.dir}/jsr352-tck-SPI.jar" dest="${project.build.testOutputDirectory}" />
- <unzip src="${tck.dir}/jsr352-tck-impl.jar" dest="${project.build.testOutputDirectory}">
- <patternset>
- <include name="META-INF/**" />
- </patternset>
- </unzip>
- </tasks>
- <outputDirectory>${project.build.directory}/tck-test-src</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <id>add-tck-src</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${project.build.directory}/tck-test-src</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugins>
+ </build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/impl/JobContextImpl.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/impl/JobContextImpl.java b/jbatch/src/main/java/org/apache/batchee/container/impl/JobContextImpl.java
index e1cbcbe..fb81ff7 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/impl/JobContextImpl.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/impl/JobContextImpl.java
@@ -33,7 +33,7 @@ public class JobContextImpl implements JobContext {
private Object transientUserData = null;
private ModelNavigator<JSLJob> navigator = null;
- private String id; // Name
+ private String jobName; // 'id' attribute in JSL
private Properties properties = new Properties();
private long executionId;
@@ -42,7 +42,7 @@ public class JobContextImpl implements JobContext {
public JobContextImpl(final ModelNavigator<JSLJob> navigator, final JSLProperties jslProperties) {
this.navigator = navigator;
- this.id = navigator.getRootModelElement().getId();
+ this.jobName = navigator.getRootModelElement().getId();
this.batchStatus = BatchStatus.STARTING;
this.properties = convertJSProperties(jslProperties);
}
@@ -71,7 +71,11 @@ public class JobContextImpl implements JobContext {
}
public String getJobName() {
- return id;
+ return jobName;
+ }
+
+ public void setJobName(final String jobName) {
+ this.jobName = jobName;
}
public BatchStatus getBatchStatus() {
@@ -123,7 +127,7 @@ public class JobContextImpl implements JobContext {
@Override
public String toString() {
return ("batchStatus = " + batchStatus) + " , exitStatus = " + exitStatus + " , id = "
- + id + " , executionId = " + executionId + " , instanceId = " + instanceId + " , restartOn = " + restartOn;
+ + jobName + " , executionId = " + executionId + " , instanceId = " + instanceId + " , restartOn = " + restartOn;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/impl/controller/PartitionedStepController.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/impl/controller/PartitionedStepController.java b/jbatch/src/main/java/org/apache/batchee/container/impl/controller/PartitionedStepController.java
index 895ecd6..f98420e 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/impl/controller/PartitionedStepController.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/impl/controller/PartitionedStepController.java
@@ -298,7 +298,7 @@ public class PartitionedStepController extends BaseStepController {
new PartitionsBuilderConfig(subJobs, partitionProperties, analyzerStatusQueue, completedWorkQueue, jobExecutionImpl.getExecutionId());
// Then build all the subjobs but do not start them yet
if (stepStatus.getStartCount() > 1 && !plan.getPartitionsOverride()) {
- parallelBatchWorkUnits = kernelService.buildOnRestartParallelPartitions(config);
+ parallelBatchWorkUnits = kernelService.buildOnRestartParallelPartitions(config, jobExecutionImpl.getJobContext(), stepContext);
} else {
parallelBatchWorkUnits = kernelService.buildNewParallelPartitions(config, jobExecutionImpl.getJobContext(), stepContext);
}
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/impl/controller/SplitController.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/impl/controller/SplitController.java b/jbatch/src/main/java/org/apache/batchee/container/impl/controller/SplitController.java
index 2f0582d..f65e4d3 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/impl/controller/SplitController.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/impl/controller/SplitController.java
@@ -121,9 +121,9 @@ public class SplitController implements ExecutionElementController {
int count = batchKernel.getJobInstanceCount(job.getId());
FlowInSplitBuilderConfig config = new FlowInSplitBuilderConfig(job, completedWorkQueue, rootJobExecutionId);
if (count == 0) {
- parallelBatchWorkUnits.add(batchKernel.buildNewFlowInSplitWorkUnit(config));
+ parallelBatchWorkUnits.add(batchKernel.buildNewFlowInSplitWorkUnit(config, jobExecution.getJobContext()));
} else if (count == 1) {
- parallelBatchWorkUnits.add(batchKernel.buildOnRestartFlowInSplitWorkUnit(config));
+ parallelBatchWorkUnits.add(batchKernel.buildOnRestartFlowInSplitWorkUnit(config, jobExecution.getJobContext()));
} else {
throw new IllegalStateException("There is an inconsistency somewhere in the internal subjob creation");
}
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/impl/jobinstance/RuntimeJobExecution.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/impl/jobinstance/RuntimeJobExecution.java b/jbatch/src/main/java/org/apache/batchee/container/impl/jobinstance/RuntimeJobExecution.java
index 914b180..7c8b8d6 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/impl/jobinstance/RuntimeJobExecution.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/impl/jobinstance/RuntimeJobExecution.java
@@ -71,6 +71,7 @@ public class RuntimeJobExecution {
public void inheritJobContext(final JobContextImpl jc) {
jobContext.setExecutionId(jc.getExecutionId());
jobContext.setInstanceId(jc.getInstanceId());
+ jobContext.setJobName(jc.getJobName());
}
public void setRestartOn(final String restartOn) {
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/services/BatchKernelService.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/BatchKernelService.java b/jbatch/src/main/java/org/apache/batchee/container/services/BatchKernelService.java
index aa43be6..0c8f906 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/services/BatchKernelService.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/BatchKernelService.java
@@ -54,7 +54,7 @@ public interface BatchKernelService extends BatchService {
List<BatchPartitionWorkUnit> buildNewParallelPartitions(PartitionsBuilderConfig config, JobContextImpl jc, StepContextImpl sc) throws JobRestartException, JobStartException;
- List<BatchPartitionWorkUnit> buildOnRestartParallelPartitions(PartitionsBuilderConfig config) throws JobRestartException,
+ List<BatchPartitionWorkUnit> buildOnRestartParallelPartitions(PartitionsBuilderConfig config, JobContextImpl jc, StepContextImpl sc) throws JobRestartException,
JobExecutionAlreadyCompleteException, JobExecutionNotMostRecentException;
void startGeneratedJob(BatchWorkUnit batchWork);
@@ -64,10 +64,10 @@ public interface BatchKernelService extends BatchService {
boolean isExecutionRunning(long executionId);
BatchFlowInSplitWorkUnit buildNewFlowInSplitWorkUnit(
- FlowInSplitBuilderConfig config);
+ FlowInSplitBuilderConfig config, JobContextImpl jc);
BatchFlowInSplitWorkUnit buildOnRestartFlowInSplitWorkUnit(
- FlowInSplitBuilderConfig config);
+ FlowInSplitBuilderConfig config, JobContextImpl jc);
}
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/services/kernel/DefaultBatchKernel.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/kernel/DefaultBatchKernel.java b/jbatch/src/main/java/org/apache/batchee/container/services/kernel/DefaultBatchKernel.java
index dd7a381..deaa029 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/services/kernel/DefaultBatchKernel.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/kernel/DefaultBatchKernel.java
@@ -186,7 +186,7 @@ public class DefaultBatchKernel implements BatchKernelService {
}
@Override
- public List<BatchPartitionWorkUnit> buildOnRestartParallelPartitions(final PartitionsBuilderConfig config)
+ public List<BatchPartitionWorkUnit> buildOnRestartParallelPartitions(final PartitionsBuilderConfig config, final JobContextImpl jc, final StepContextImpl sc)
throws JobRestartException, JobExecutionAlreadyCompleteException, JobExecutionNotMostRecentException {
final List<JSLJob> jobModels = config.getJobModels();
@@ -205,6 +205,7 @@ public class DefaultBatchKernel implements BatchKernelService {
final RuntimeJobExecution jobExecution;
try {
jobExecution = JobExecutionHelper.restartPartition(servicesManager, execId, parallelJob, partitionProps);
+ jobExecution.inheritJobContext(jc);
jobExecution.setPartitionInstance(instance);
} catch (final NoSuchJobExecutionException e) {
throw new IllegalStateException("Caught NoSuchJobExecutionException but this is an internal JobExecution so this shouldn't have happened: execId ="
@@ -212,6 +213,7 @@ public class DefaultBatchKernel implements BatchKernelService {
}
final BatchPartitionWorkUnit batchWork = new BatchPartitionWorkUnit(jobExecution, config, servicesManager);
+ batchWork.inheritStepContext(sc);
registerCurrentInstanceAndExecution(jobExecution, batchWork.getController());
batchWorkUnits.add(batchWork);
@@ -231,11 +233,12 @@ public class DefaultBatchKernel implements BatchKernelService {
}
@Override
- public BatchFlowInSplitWorkUnit buildNewFlowInSplitWorkUnit(final FlowInSplitBuilderConfig config) {
+ public BatchFlowInSplitWorkUnit buildNewFlowInSplitWorkUnit(final FlowInSplitBuilderConfig config, final JobContextImpl jc) {
final JSLJob parallelJob = config.getJobModel();
final RuntimeFlowInSplitExecution execution = JobExecutionHelper.startFlowInSplit(servicesManager, parallelJob);
final BatchFlowInSplitWorkUnit batchWork = new BatchFlowInSplitWorkUnit(execution, config, servicesManager);
+ execution.inheritJobContext(jc);
registerCurrentInstanceAndExecution(execution, batchWork.getController());
return batchWork;
@@ -264,7 +267,7 @@ public class DefaultBatchKernel implements BatchKernelService {
}
@Override
- public BatchFlowInSplitWorkUnit buildOnRestartFlowInSplitWorkUnit(final FlowInSplitBuilderConfig config)
+ public BatchFlowInSplitWorkUnit buildOnRestartFlowInSplitWorkUnit(final FlowInSplitBuilderConfig config, final JobContextImpl jc)
throws JobRestartException, JobExecutionAlreadyCompleteException, JobExecutionNotMostRecentException {
final JSLJob jobModel = config.getJobModel();
@@ -277,7 +280,7 @@ public class DefaultBatchKernel implements BatchKernelService {
}
final BatchFlowInSplitWorkUnit batchWork = new BatchFlowInSplitWorkUnit(jobExecution, config, servicesManager);
-
+ jobExecution.inheritJobContext(jc);
registerCurrentInstanceAndExecution(jobExecution, batchWork.getController());
return batchWork;
}
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/main/java/org/apache/batchee/container/services/persistence/MemoryPersistenceManagerService.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/MemoryPersistenceManagerService.java b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/MemoryPersistenceManagerService.java
index de69724..d1f2274 100644
--- a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/MemoryPersistenceManagerService.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/MemoryPersistenceManagerService.java
@@ -243,6 +243,9 @@ public class MemoryPersistenceManagerService implements PersistenceManagerServic
public List<InternalJobExecution> jobOperatorGetJobExecutions(final long jobInstanceId) {
final List<InternalJobExecution> list = new LinkedList<InternalJobExecution>();
final Structures.JobInstanceData jobInstanceData = data.jobInstanceData.get(jobInstanceId);
+ if (jobInstanceData == null || jobInstanceData.executions == null) {
+ return list;
+ }
synchronized (jobInstanceData.executions) {
for (final Structures.ExecutionInstanceData executionInstanceData : jobInstanceData.executions) {
list.add(executionInstanceData.execution);
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/jbatch/src/test/resources/suites/tck.xml
----------------------------------------------------------------------
diff --git a/jbatch/src/test/resources/suites/tck.xml b/jbatch/src/test/resources/suites/tck.xml
deleted file mode 100644
index 9784fc2..0000000
--- a/jbatch/src/test/resources/suites/tck.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<suite name="JSR352 TCK" verbose="1">
- <listeners>
- <listener class-name="org.apache.batchee.test.tck.lifecycle.ContainerLifecycle"/>
- </listeners>
-
- <test name="JSR352 TCK">
- <classes> <!-- using <classes /> since <packages /> validation algorithm is broken in TestNG -->
- <class name="com.ibm.jbatch.tck.tests.ee.TransactionTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.ChunkTests">
- <methods> <!-- BATCHEE-4 -->
- <!--<exclude name="testChunkRetryMultipleExceptions"/>-->
- <exclude name="testChunkSkipMultipleExceptions"/>
- </methods>
- </class>
- <class name="com.ibm.jbatch.tck.tests.jslxml.BatchletRestartStateMachineTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.ContextAndListenerTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.ContextsGetIdTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.DeciderTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.ExecuteTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.ExecutionTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.FlowTransitioningTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.JobAttributeRestartTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.JobExecutableSequenceTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.JobLevelPropertiesTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.JobOperatorTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.MetricsTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.ParallelExecutionTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.PropertySubstitutionTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.RestartNotMostRecentTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.RetryListenerTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.SplitFlowTransitionLoopTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.SplitTransitioningTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.StartLimitTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.StepExecutionTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.StepLevelPropertiesTests"/>
- <class name="com.ibm.jbatch.tck.tests.jslxml.StopOrFailOnExitStatusWithRestartTests"/>
- </classes>
- </test>
-</suite>
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fdad006..be788b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -191,6 +191,18 @@
</resources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>1.5</version>
+ <dependencies>
+ <dependency> <!-- workaround for jdk 1.8 -->
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-filtering</artifactId>
+ <version>1.3</version>
+ </dependency>
+ </dependencies>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -471,15 +483,6 @@
</plugins>
</build>
- <pluginRepositories>
-
- <!-- WTF? surely not! -->
- <pluginRepository>
- <id>sonatype-public-repository</id>
- <url>https://oss.sonatype.org/content/groups/public</url>
- </pluginRepository>
- </pluginRepositories>
-
<reporting>
<plugins>
<plugin>
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/31a4d121/tools/cli/src/test/java/org/apache/batchee/cli/MainTest.java
----------------------------------------------------------------------
diff --git a/tools/cli/src/test/java/org/apache/batchee/cli/MainTest.java b/tools/cli/src/test/java/org/apache/batchee/cli/MainTest.java
index 2ebce01..b16f5ce 100644
--- a/tools/cli/src/test/java/org/apache/batchee/cli/MainTest.java
+++ b/tools/cli/src/test/java/org/apache/batchee/cli/MainTest.java
@@ -18,18 +18,22 @@ package org.apache.batchee.cli;
import org.apache.batchee.cli.lifecycle.Lifecycle;
import org.apache.batchee.util.Batches;
+import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.StandardOutputStreamLog;
+import org.junit.runners.MethodSorters;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
+import static java.lang.Thread.sleep;
import static org.apache.batchee.cli.BatchEECLI.main;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class MainTest {
@Rule
public final StandardOutputStreamLog stdout = new StandardOutputStreamLog();
@@ -74,6 +78,11 @@ public class MainTest {
final JobOperator jobOperator = BatchRuntime.getJobOperator();
final long id = jobOperator.start("long-sample", null);
+ try {
+ sleep(100); // ensure it is started
+ } catch (final InterruptedException e) {
+ Thread.interrupted();
+ }
main(new String[]{"running"});
assertThat(stdout.getLog(), containsString("long-sample -> ["));
@@ -154,18 +163,17 @@ public class MainTest {
final JobOperator jobOperator = BatchRuntime.getJobOperator();
final long id = jobOperator.start("sample", null);
- main(new String[]{"executions", "-id", Long.toString(id)});
-
// output looks like:
// Executions of sample for instance 5
// execution id | batch status | exit status | start time | end time
// 5 | COMPLETED | COMPLETED | sam. janv. 04 17:20:24 CET 2014 | sam. janv. 04 17:20:24 CET 2014
- assertThat(stdout.getLog(), containsString("Executions of sample for instance 5"));
- assertThat(stdout.getLog(), containsString("COMPLETED"));
-
Batches.waitForEnd(jobOperator, id);
+ main(new String[]{"executions", "-id", Long.toString(id)});
+
+ assertThat(stdout.getLog(), containsString("Executions of sample for instance " + id));
+ assertThat(stdout.getLog(), containsString("COMPLETED"));
}
@Test