Skip to content

Commit

Permalink
add travis;upgrade TransportGenerator:16.0.0;jacoco:0.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rbudde committed Oct 27, 2020
1 parent 48eb653 commit 3df50a1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Misc/transport.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"from": "2017-12-08",
"package": "de.budde.param",
"versionCheck": false,
"versionCheck": true,
"singleAssign": true,
"version": "1",
"declarations": [
{
Expand Down
19 changes: 13 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<version>0.8.6</version>
<configuration>
<excludes>
<exclude>src/main/generated</exclude>
Expand All @@ -250,7 +250,7 @@
<plugin>
<groupId>de.fhg.iais.tools</groupId>
<artifactId>TransportGenerator</artifactId>
<version>11.0.1</version>
<version>16.0.0</version>
<configuration>
<transportConfigFiles>
<file>Misc/transport.json</file>
Expand Down Expand Up @@ -304,9 +304,16 @@
</repositories>

<pluginRepositories>
<pluginRepository>
<id>releasesP</id>
<url>http://maven.iais.fraunhofer.de/artifactory/iais-public-release</url>
</pluginRepository>
<pluginRepository>
<id>openroberta-release</id>
<name>repository for the OpenRoberta OSS</name>
<url>http://maven.iais.fraunhofer.de/artifactory/openroberta-release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
2 changes: 1 addition & 1 deletion src/main/java/de/budde/provider/DbcExceptionMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Provider
public class DbcExceptionMapper implements ExceptionMapper<DBCException> {
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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/budde/provider/RandomDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/budde/resources/RandomGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/de/budde/resources/RandomGeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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() ) {
Expand All @@ -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());
}
}
1 change: 1 addition & 0 deletions travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: java

0 comments on commit 3df50a1

Please sign in to comment.