Skip to content

Commit

Permalink
#486 make MP Config Compilable with Java 11 - address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Emily Jiang <emijiang6@googlemail.com>
  • Loading branch information
Emily-Jiang committed Jan 20, 2020
1 parent b213968 commit 566b28f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Expand Up @@ -31,7 +31,7 @@

<links>https://osgi.org/javadoc/r6/annotation/</links>

<checkstyle.version>3.1.0</checkstyle.version>
<checkstyle.version>2.17</checkstyle.version>
<checkstyle.methodNameFormat>^_?[a-z][a-zA-Z0-9]*$</checkstyle.methodNameFormat>
</properties>

Expand Down Expand Up @@ -191,6 +191,7 @@
<plugin>
<groupId>org.eclipse.microprofile.maven</groupId>
<artifactId>microprofile-maven-build-extension</artifactId>
<version>1.0</version>
<extensions>true</extensions>
</plugin>

Expand Down
Expand Up @@ -155,15 +155,13 @@ public void testInjectedConfigSerializable() {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try (ObjectOutputStream out = new ObjectOutputStream(byteArrayOutputStream)) {
out.writeObject(config);
}
catch (IOException ex) {
} catch (IOException ex) {
Assert.fail("Injected config should be serializable, but could not serialize it", ex);
}
Object readObject = null;
try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()))) {
readObject = in.readObject();
}
catch (IOException | ClassNotFoundException ex) {
} catch (IOException | ClassNotFoundException ex) {
Assert.fail("Injected config should be serializable, but could not deserialize a previously serialized instance", ex);
}
MatcherAssert.assertThat("Deserialized object", readObject, CoreMatchers.instanceOf(Config.class));
Expand Down
Expand Up @@ -431,15 +431,13 @@ public void testConverterSerialization() {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try (ObjectOutputStream out = new ObjectOutputStream(byteArrayOutputStream)) {
out.writeObject(original);
}
catch (IOException ex) {
} catch (IOException ex) {
Assert.fail("Converter instance should be serializable, but could not serialize it", ex);
}
Object readObject = null;
try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()))) {
readObject = in.readObject();
}
catch (IOException | ClassNotFoundException ex) {
} catch (IOException | ClassNotFoundException ex) {
Assert.fail("Converter instance should be serializable, but could not deserialize a previously serialized instance", ex);
}
assertEquals("Converted values to be equal", original.convert("Donald").getName(),
Expand Down

0 comments on commit 566b28f

Please sign in to comment.