Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Merge ebec757 into 5526773
Browse files Browse the repository at this point in the history
  • Loading branch information
mapingo committed Nov 5, 2018
2 parents 5526773 + ebec757 commit 436e254
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 146 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to

## Unreleased

## Changed
- Update utilities to version 1.16.0

## Removed
- LoggerProducer and InitialContextProducer

## [2.1.0]

### Changed
Expand Down
8 changes: 1 addition & 7 deletions example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,8 @@
</dependency>
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-logging-simple</artifactId>
<type>pom</type>
<scope>test</scope>
<version>${test-utils.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>test-utils-core</artifactId>
<version>${test-utils.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

import static uk.gov.moj.cpp.jobmanager.it.util.OpenEjbConfigurationBuilder.createOpenEjbConfigurationBuilder;

import uk.gov.justice.services.cdi.InitialContextProducer;
import uk.gov.justice.services.cdi.LoggerProducer;
import uk.gov.justice.services.common.configuration.JndiBasedServiceContextNameProvider;
import uk.gov.justice.services.common.converter.JsonObjectToObjectConverter;
import uk.gov.justice.services.common.converter.ObjectToJsonObjectConverter;
import uk.gov.justice.services.common.converter.jackson.ObjectMapperProducer;
import uk.gov.justice.services.common.util.UtcClock;
import uk.gov.justice.services.core.cdi.LoggerProducer;
import uk.gov.justice.services.jdbc.persistence.JdbcRepositoryHelper;
import uk.gov.moj.cpp.jobmanager.example.task.BakeCakeTask;
import uk.gov.moj.cpp.jobmanager.example.task.FillCakeTinTask;
Expand All @@ -23,7 +24,6 @@
import uk.gov.moj.cpp.jobstore.api.ExecutionService;
import uk.gov.moj.cpp.jobstore.api.task.ExecutableTask;
import uk.gov.moj.cpp.jobstore.persistence.AnsiJobSqlProvider;
import uk.gov.moj.cpp.jobstore.persistence.InitialContextProducer;
import uk.gov.moj.cpp.jobstore.persistence.JdbcJobStoreDataSourceProvider;
import uk.gov.moj.cpp.jobstore.persistence.JobRepository;
import uk.gov.moj.cpp.jobstore.persistence.JobSqlProvider;
Expand Down
24 changes: 10 additions & 14 deletions job-executor/pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<parent>
<groupId>uk.gov.justice.services</groupId>
<groupId>uk.gov.justice.services</groupId>
<artifactId>job-manager</artifactId>
<version>2.1.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<modelVersion>4.0.0</modelVersion>

<artifactId>job-executor</artifactId>
<properties>
Expand All @@ -32,17 +34,9 @@
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>utilities-core</artifactId>
<version>${cpp.utilities.version}</version>
</dependency>

<!--Test-->
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-logging-simple</artifactId>
<type>pom</type>
<scope>test</scope>
<version>${test-utils.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -68,15 +62,17 @@
<artifactId>openejb-core</artifactId>
<scope>test</scope>
</dependency>

<!-- integration test -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-core</artifactId>
<version>${test-utils.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
34 changes: 15 additions & 19 deletions job-manager-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<groupId>uk.gov.justice.services</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>job-manager-it</artifactId>
<dependencies>
<dependency>
<groupId>uk.gov.justice.services</groupId>
Expand All @@ -22,6 +19,15 @@
<artifactId>jobstore-persistence</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>utilities-core</artifactId>
</dependency>
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-core</artifactId>
<version>${test-utils.version}</version>
</dependency>

<!-- TEST -->
<dependency>
Expand All @@ -39,43 +45,33 @@
<artifactId>openejb-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-logging-simple</artifactId>
<type>pom</type>
<scope>test</scope>
<version>${test-utils.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>jobstore-liquibase</artifactId>
<scope>test</scope>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>job-executor</artifactId>
<scope>test</scope>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-core</artifactId>
<version>${test-utils.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>test-utils-common</artifactId>
<version>${cpp.test-utils.version}</version>
<version>${framework-version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<modelVersion>4.0.0</modelVersion>
<artifactId>job-manager-it</artifactId>


</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import uk.gov.justice.services.cdi.InitialContextProducer;
import uk.gov.justice.services.cdi.LoggerProducer;
import uk.gov.justice.services.common.configuration.GlobalValueProducer;
import uk.gov.justice.services.common.configuration.JndiBasedServiceContextNameProvider;
import uk.gov.justice.services.common.configuration.ValueProducer;
Expand All @@ -18,12 +20,10 @@
import uk.gov.justice.services.messaging.logging.DefaultTraceLogger;
import uk.gov.justice.services.test.utils.common.envelope.EnvelopeRecordingInterceptor;
import uk.gov.justice.services.test.utils.common.reflection.ReflectionUtils;
import uk.gov.moj.cpp.jobmanager.it.util.LoggerProducer;
import uk.gov.moj.cpp.jobmanager.it.util.OpenEjbConfigurationBuilder;
import uk.gov.moj.cpp.jobmanager.it.util.OpenEjbJobJdbcRepository;
import uk.gov.moj.cpp.jobstore.api.ExecutionService;
import uk.gov.moj.cpp.jobstore.persistence.AnsiJobSqlProvider;
import uk.gov.moj.cpp.jobstore.persistence.InitialContextProducer;
import uk.gov.moj.cpp.jobstore.persistence.JdbcJobStoreDataSourceProvider;
import uk.gov.moj.cpp.jobstore.persistence.Job;
import uk.gov.moj.cpp.jobstore.persistence.JobRepository;
Expand Down Expand Up @@ -176,7 +176,7 @@ public void shouldNotPerformDuplicateJobUpdates() throws Exception {
final CyclicBarrier gate = new CyclicBarrier(4);
IntStream.range(0, 3)
.mapToObj(threadNo -> getThreadCurrentImpl(gate))
.forEach(t -> t.start());
.forEach(t -> t.start());
gate.await();
Thread.sleep(3000);
userTransaction.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import uk.gov.justice.services.cdi.InitialContextProducer;
import uk.gov.justice.services.cdi.LoggerProducer;
import uk.gov.justice.services.common.configuration.GlobalValueProducer;
import uk.gov.justice.services.common.configuration.JndiBasedServiceContextNameProvider;
import uk.gov.justice.services.common.configuration.ValueProducer;
import uk.gov.justice.services.jdbc.persistence.JdbcRepositoryHelper;
import uk.gov.justice.services.test.utils.common.reflection.ReflectionUtils;
import uk.gov.justice.services.test.utils.core.messaging.Poller;
import uk.gov.moj.cpp.jobmanager.it.util.LoggerProducer;
import uk.gov.moj.cpp.jobmanager.it.util.OpenEjbConfigurationBuilder;
import uk.gov.moj.cpp.jobmanager.it.util.OpenEjbJobJdbcRepository;
import uk.gov.moj.cpp.jobstore.persistence.AnsiJobSqlProvider;
import uk.gov.moj.cpp.jobstore.persistence.InitialContextProducer;
import uk.gov.moj.cpp.jobstore.persistence.JdbcJobStoreDataSourceProvider;
import uk.gov.moj.cpp.jobstore.persistence.Job;
import uk.gov.moj.cpp.jobstore.persistence.JobRepository;
Expand Down Expand Up @@ -103,7 +103,7 @@ public WebApp war() {

@Inject
JobService jobService;

@Before
public void setup() throws Exception {
InitialContext initialContext = new InitialContext();
Expand Down Expand Up @@ -160,8 +160,8 @@ public void shouldUpdateJobsThatHaveAWorkerIdAndBeenIdleForMoreThanOneHourAndRea
userTransaction.begin();
testJobJdbcRepository.cleanJobTables();
testJobJdbcRepository.createJobs(20);
testJobJdbcRepository.createIdleJobs(5, of(now().minus(65, MINUTES)), now().plus(30, MINUTES));
testJobJdbcRepository.createIdleJobs(5, of(now().minus(65, MINUTES)), now());
testJobJdbcRepository.createIdleJobs(5, of(now().minus(65, MINUTES)), now().plus(30, MINUTES));
testJobJdbcRepository.createIdleJobs(5, of(now().minus(65, MINUTES)), now());
testJobJdbcRepository.createIdleJobs(10, of(now().minus(30, MINUTES)), now());
userTransaction.commit();

Expand All @@ -187,7 +187,7 @@ public void shouldNotPerformDuplicateJobUpdates() throws Exception {
final CyclicBarrier gate = new CyclicBarrier(21);
IntStream.range(0, 20)
.mapToObj(threadNo -> getThreadCurrentImpl(gate))
.forEach(t -> t.start());
.forEach(t -> t.start());
gate.await();

detectDuplicates();
Expand Down
13 changes: 7 additions & 6 deletions jobstore-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<parent>
<groupId>uk.gov.justice.services</groupId>
<groupId>uk.gov.justice.services</groupId>
<artifactId>job-manager</artifactId>
<version>2.1.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -34,9 +36,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>test-utils-common</artifactId>
<version>${cpp.test-utils.version}</version>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>utilities-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static java.util.Optional.empty;
import static java.util.UUID.randomUUID;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import uk.gov.justice.services.common.util.UtcClock;
Expand Down
23 changes: 15 additions & 8 deletions jobstore-persistence/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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>
<groupId>uk.gov.justice.services</groupId>
<groupId>uk.gov.justice.services</groupId>
<artifactId>job-manager</artifactId>
<version>2.1.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>

<artifactId>jobstore-persistence</artifactId>
Expand All @@ -19,12 +21,11 @@
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>persistence-jdbc</artifactId>
<version>${cpp.persistance.version}</version>
<version>${framework-version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>utilities-core</artifactId>
<version>${cpp.utilities.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -41,15 +42,22 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-core</artifactId>
<version>${test-utils.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>test-utils-persistence</artifactId>
<version>${cpp.test-utils.version}</version>
<version>${framework-version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>uk.gov.justice.utils</groupId>
<artifactId>test-utils-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
Expand All @@ -70,7 +78,6 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.22</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit 436e254

Please sign in to comment.