From 3df50a102f5929e67f3723adc88c9dc752a8d6e8 Mon Sep 17 00:00:00 2001 From: Reinhard Budde Date: Tue, 27 Oct 2020 12:20:58 +0100 Subject: [PATCH] add travis;upgrade TransportGenerator:16.0.0;jacoco:0.8.6 --- Misc/transport.json | 3 ++- pom.xml | 19 +++++++++++++------ .../de/budde/provider/DbcExceptionMapper.java | 2 +- .../de/budde/provider/RandomDataProvider.java | 2 +- .../de/budde/resources/RandomGenerator.java | 2 +- .../MiniServerExceptionMapperTest.java | 4 ++-- .../budde/resources/RandomGeneratorTest.java | 6 +++--- travis.yml | 1 + 8 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 travis.yml diff --git a/Misc/transport.json b/Misc/transport.json index ded9d1d..4e3b0fe 100644 --- a/Misc/transport.json +++ b/Misc/transport.json @@ -1,7 +1,8 @@ { "from": "2017-12-08", "package": "de.budde.param", - "versionCheck": false, + "versionCheck": true, + "singleAssign": true, "version": "1", "declarations": [ { diff --git a/pom.xml b/pom.xml index c0bb9e1..ccbe025 100644 --- a/pom.xml +++ b/pom.xml @@ -225,7 +225,7 @@ org.jacoco jacoco-maven-plugin - 0.7.9 + 0.8.6 src/main/generated @@ -250,7 +250,7 @@ de.fhg.iais.tools TransportGenerator - 11.0.1 + 16.0.0 Misc/transport.json @@ -304,9 +304,16 @@ - - releasesP - http://maven.iais.fraunhofer.de/artifactory/iais-public-release - + + openroberta-release + repository for the OpenRoberta OSS + http://maven.iais.fraunhofer.de/artifactory/openroberta-release + + true + + + false + + \ No newline at end of file diff --git a/src/main/java/de/budde/provider/DbcExceptionMapper.java b/src/main/java/de/budde/provider/DbcExceptionMapper.java index 44e06cc..e298e0d 100644 --- a/src/main/java/de/budde/provider/DbcExceptionMapper.java +++ b/src/main/java/de/budde/provider/DbcExceptionMapper.java @@ -16,7 +16,7 @@ @Provider public class DbcExceptionMapper implements ExceptionMapper { private static final Logger LOG = LoggerFactory.getLogger(DbcExceptionMapper.class); - static final String ERROR_IN_ERROR = "{\"ok\":false,\"msg\":\"Error in error processor :-)\"}"; + static final String ERROR_IN_ERROR = "{\"ok\":false,\"_version\":\"1\",\"msg\":\"Error in error processor :-)\"}"; @Override public Response toResponse(DBCException e1) { diff --git a/src/main/java/de/budde/provider/RandomDataProvider.java b/src/main/java/de/budde/provider/RandomDataProvider.java index 768b803..36eefb3 100644 --- a/src/main/java/de/budde/provider/RandomDataProvider.java +++ b/src/main/java/de/budde/provider/RandomDataProvider.java @@ -36,7 +36,7 @@ public RandomRequest readFrom( WebApplicationException { String entity = convertStreamToString(entityStream); - return RandomRequest.make_1(entity); + return RandomRequest.makeFromString_1(entity); } static String convertStreamToString(InputStream is) { diff --git a/src/main/java/de/budde/resources/RandomGenerator.java b/src/main/java/de/budde/resources/RandomGenerator.java index b634ad4..df064b5 100644 --- a/src/main/java/de/budde/resources/RandomGenerator.java +++ b/src/main/java/de/budde/resources/RandomGenerator.java @@ -134,7 +134,7 @@ public Response postManyRandomsEncrypted(String requestEntity) { // TODO: this could be designed better. Write a specific provider? Same problem with #postDelegate String decrypted = this.security.toClearText(requestEntity); LOG.info("POST /rndsE request with entity {} decrypted from {}", decrypted, requestEntity); - RandomRequest request = RandomRequest.make_1(decrypted); + RandomRequest request = RandomRequest.makeFromString_1(decrypted); return createRandomResponse(request.getLimit(), request.getNumber()); } diff --git a/src/test/java/de/budde/provider/MiniServerExceptionMapperTest.java b/src/test/java/de/budde/provider/MiniServerExceptionMapperTest.java index 4a55141..aa85cbf 100644 --- a/src/test/java/de/budde/provider/MiniServerExceptionMapperTest.java +++ b/src/test/java/de/budde/provider/MiniServerExceptionMapperTest.java @@ -15,14 +15,14 @@ public void testToResponse() { String errorMsg = "Test message!"; Response resp = new DbcExceptionMapper().toResponse(new DBCException(errorMsg)); Assert.assertEquals(500, resp.getStatus()); - GenericResponse entity = GenericResponse.make_1((String) resp.getEntity()); + GenericResponse entity = GenericResponse.makeFromString_1((String) resp.getEntity()); Assert.assertEquals(false, entity.getOk()); Assert.assertEquals(errorMsg, entity.getMsg()); } @Test public void testErrorInError() { - GenericResponse entity = GenericResponse.make_1(DbcExceptionMapper.ERROR_IN_ERROR); + GenericResponse entity = GenericResponse.makeFromString_1(DbcExceptionMapper.ERROR_IN_ERROR); Assert.assertEquals(false, entity.getOk()); Assert.assertEquals("Error in error processor :-)", entity.getMsg()); } diff --git a/src/test/java/de/budde/resources/RandomGeneratorTest.java b/src/test/java/de/budde/resources/RandomGeneratorTest.java index 0acd0b6..ea5826d 100644 --- a/src/test/java/de/budde/resources/RandomGeneratorTest.java +++ b/src/test/java/de/budde/resources/RandomGeneratorTest.java @@ -22,7 +22,7 @@ public class RandomGeneratorTest { public void testGetRandom() { Response response = new RandomGenerator(this.worker, 50, 100, new NoSecurity(), null).getRandom(); Assert.assertEquals(200, response.getStatus()); - RandomResponse entity = RandomResponse.make_1((String) response.getEntity()); + RandomResponse entity = RandomResponse.makeFromString_1((String) response.getEntity()); Assert.assertTrue(entity.getOk()); Assert.assertEquals(1, entity.getRnd().size()); Integer rnd = entity.getRnd().get(0); @@ -67,7 +67,7 @@ public void testPostManyRandoms() { private void checkResponseWhenOk(int limit, int number, Response response) { Assert.assertEquals(200, response.getStatus()); - RandomResponse entity = RandomResponse.make_1((String) response.getEntity()); + RandomResponse entity = RandomResponse.makeFromString_1((String) response.getEntity()); Assert.assertTrue(entity.getOk()); Assert.assertEquals(number, entity.getRnd().size()); for ( Integer rnd : entity.getRnd() ) { @@ -77,7 +77,7 @@ private void checkResponseWhenOk(int limit, int number, Response response) { private void checkResponseWhenError(Response response) { Assert.assertEquals(400, response.getStatus()); - GenericResponse entity = GenericResponse.make_1((String) response.getEntity()); + GenericResponse entity = GenericResponse.makeFromString_1((String) response.getEntity()); Assert.assertFalse(entity.getOk()); } } diff --git a/travis.yml b/travis.yml new file mode 100644 index 0000000..f5c99a7 --- /dev/null +++ b/travis.yml @@ -0,0 +1 @@ +language: java \ No newline at end of file