Skip to content

Commit

Permalink
#135: update to Java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Pfotenhauer committed Aug 25, 2020
1 parent 689636d commit a515a2f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source.version>1.8</maven.compiler.source.version>
<maven.compiler.target.version>1.8</maven.compiler.target.version>
<maven.compiler.source.version>11</maven.compiler.source.version>
<maven.compiler.target.version>11</maven.compiler.target.version>
<surefire.version>2.22.2</surefire.version>
<allure.version>2.13.3</allure.version>
<cucumber.version>5.7.0</cucumber.version>
Expand Down Expand Up @@ -135,6 +135,7 @@
</executions>
<configuration>
<source>8</source>
<detectJavaApiLink>false</detectJavaApiLink>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import java.lang.annotation.Repeatable;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -25,7 +26,7 @@ public static <T extends StatementBuilder> T instantiate(Class<T> clazz)
{
try
{
return clazz.newInstance();
return clazz.getDeclaredConstructor().newInstance();
}
catch (InstantiationException e)
{
Expand All @@ -35,6 +36,22 @@ public static <T extends StatementBuilder> T instantiate(Class<T> clazz)
{
throw new RuntimeException(e);
}
catch (IllegalArgumentException e)
{
throw new RuntimeException(e);
}
catch (InvocationTargetException e)
{
throw new RuntimeException(e);
}
catch (NoSuchMethodException e)
{
throw new RuntimeException(e);
}
catch (SecurityException e)
{
throw new RuntimeException(e);
}
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void testGetClass() throws Exception
Assert.assertEquals("1234567890", testCompound.getClubCardNumber());
Assert.assertEquals(null, testCompound.getNotSet());
Assert.assertEquals(null, testCompound.getNullValue());
Assert.assertEquals(new Double(12.34), testCompound.getNumberValue());
Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue());
Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription());
Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber());
Assert.assertEquals("123", testCompound.getCreditCard().getCcv());
Expand All @@ -235,7 +235,7 @@ public void testGetClass() throws Exception
public void testGetByPath() throws Exception
{
Double numberValue = DataUtils.get("$.numberValue", Double.class);
Assert.assertEquals(new Double(12.34), numberValue);
Assert.assertEquals(Double.valueOf(12.34), numberValue);

String description = DataUtils.get("$.description", String.class);
Assert.assertEquals("containing strange things like spaces and äüø", description);
Expand Down Expand Up @@ -276,7 +276,7 @@ public void testGetClassByPath() throws Exception
Assert.assertEquals("1234567890", testCompound.getClubCardNumber());
Assert.assertEquals(null, testCompound.getNotSet());
Assert.assertEquals(null, testCompound.getNullValue());
Assert.assertEquals(new Double(12.34), testCompound.getNumberValue());
Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue());
Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription());
Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber());
Assert.assertEquals("123", testCompound.getCreditCard().getCcv());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void testGetClass() throws Exception
Assert.assertEquals(null, testCompound.getNotSet());
// our XML parer does not support explicit null value
// Assert.assertEquals(null, testCompound.getNullValue());
Assert.assertEquals(new Double(12.34), testCompound.getNumberValue());
Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue());
Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription());
Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber());
Assert.assertEquals("123", testCompound.getCreditCard().getCcv());
Expand All @@ -235,7 +235,7 @@ public void testGetClass() throws Exception
public void testGetByPath() throws Exception
{
Double numberValue = DataUtils.get("$.numberValue", Double.class);
Assert.assertEquals(new Double(12.34), numberValue);
Assert.assertEquals(Double.valueOf(12.34), numberValue);

String description = DataUtils.get("$.description", String.class);
Assert.assertEquals("containing strange things like spaces and äüø", description);
Expand Down Expand Up @@ -277,7 +277,7 @@ public void testGetClassByPath() throws Exception
Assert.assertEquals(null, testCompound.getNotSet());
// our XML parer does not support explicit null value
// Assert.assertEquals(null, testCompound.getNullValue());
Assert.assertEquals(new Double(12.34), testCompound.getNumberValue());
Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue());
Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription());
Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber());
Assert.assertEquals("123", testCompound.getCreditCard().getCcv());
Expand Down

0 comments on commit a515a2f

Please sign in to comment.