From 4131f09d174afbc00b4be76346a12b8e24b70e8b Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 28 Jun 2018 09:51:25 +0300 Subject: [PATCH] Enable tests for Java 10 (#4335) --- .../flow-code-generator-api/pom.xml | 8 ++++- flow-data/pom.xml | 29 +++++++++++++++++-- .../DefaultDeploymentConfiguration.java | 2 +- ...BootstrapHandlerPushConfigurationTest.java | 8 +++++ .../DefaultDeploymentConfigurationTest.java | 19 +++++++----- pom.xml | 8 ----- 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/flow-components-parent/flow-code-generator-api/pom.xml b/flow-components-parent/flow-code-generator-api/pom.xml index b49333fb0d0..1e80a5c3cd7 100644 --- a/flow-components-parent/flow-code-generator-api/pom.xml +++ b/flow-components-parent/flow-code-generator-api/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 @@ -53,6 +54,11 @@ commons-text 1.1 + + javax.annotation + javax.annotation-api + 1.3.2 + diff --git a/flow-data/pom.xml b/flow-data/pom.xml index 459b35ee5bf..d13e0e43fe4 100644 --- a/flow-data/pom.xml +++ b/flow-data/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 @@ -40,7 +41,7 @@ org.apache.commons commons-lang3 test - + org.hibernate.validator @@ -54,6 +55,30 @@ ${project.version} test + + javax.xml.bind + jaxb-api + 2.2.11 + test + + + com.sun.xml.bind + jaxb-core + 2.2.11 + test + + + com.sun.xml.bind + jaxb-impl + 2.2.11 + test + + + com.sun.activation + javax.activation + 1.2.0 + test + diff --git a/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java b/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java index 51a4fee0f73..7bb1ca37408 100755 --- a/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java @@ -153,7 +153,7 @@ protected String getSystemProperty(String parameterName) { } if (pkgName == null) { pkgName = ""; - } else { + } else if (!pkgName.isEmpty()) { pkgName += '.'; } String val = System.getProperty(pkgName + parameterName); diff --git a/flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerPushConfigurationTest.java b/flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerPushConfigurationTest.java index c52ca11b5f2..469946602fc 100644 --- a/flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerPushConfigurationTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerPushConfigurationTest.java @@ -14,8 +14,10 @@ import javax.servlet.http.HttpServletRequest; +import org.hamcrest.CoreMatchers; import org.junit.After; import org.junit.Assert; +import org.junit.Assume; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; @@ -111,6 +113,9 @@ public void uiInitialization_pushConfigurationIsApplied() @Test public void uiInitialization_customPushConnectionFactoryIsApplied() throws Exception { + String version = System.getProperty("java.version"); + Assume.assumeThat(version, CoreMatchers.startsWith("1.8")); + ClassLoader classLoader = service.getClassLoader(); ClassLoader mockClassLoader = mockClassloaderForServiceLoader( classLoader, "PushConnectionFactory_serviceLoader_single.txt"); @@ -126,6 +131,9 @@ public void uiInitialization_customPushConnectionFactoryIsApplied() @Test public void uiInitialization_shouldFailIfMultiplePushConnectionFactoryAreAvailable() throws Exception { + String version = System.getProperty("java.version"); + Assume.assumeThat(version, CoreMatchers.startsWith("1.8")); + ClassLoader classLoader = service.getClassLoader(); ClassLoader mockClassLoader = mockClassloaderForServiceLoader( classLoader, diff --git a/flow-server/src/test/java/com/vaadin/flow/server/DefaultDeploymentConfigurationTest.java b/flow-server/src/test/java/com/vaadin/flow/server/DefaultDeploymentConfigurationTest.java index ca2c07bea1d..253475ccadf 100644 --- a/flow-server/src/test/java/com/vaadin/flow/server/DefaultDeploymentConfigurationTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/server/DefaultDeploymentConfigurationTest.java @@ -54,12 +54,10 @@ public void testGetSystemProperty() throws ClassNotFoundException { + '.' + prop, value); DefaultDeploymentConfiguration config = new DefaultDeploymentConfiguration( - DefaultDeploymentConfigurationTest.class, new Properties() - ); + DefaultDeploymentConfigurationTest.class, new Properties()); assertEquals(value, config.getSystemProperty(prop)); } - @Test public void booleanValueReadIgnoreTheCase_true() { Properties initParameters = new Properties(); @@ -184,17 +182,22 @@ public void pushUrl() { @Test public void bundleIsEnabledInProduction() { Properties initParameters = new Properties(); - initParameters.setProperty(Constants.SERVLET_PARAMETER_PRODUCTION_MODE, "true"); - DefaultDeploymentConfiguration config = createDeploymentConfig(initParameters); + initParameters.setProperty(Constants.SERVLET_PARAMETER_PRODUCTION_MODE, + "true"); + DefaultDeploymentConfiguration config = createDeploymentConfig( + initParameters); Assert.assertTrue(config.useCompiledFrontendResources()); } @Test public void bundleCanBeDisabled() { Properties initParameters = new Properties(); - initParameters.setProperty(Constants.SERVLET_PARAMETER_PRODUCTION_MODE, "true"); - initParameters.setProperty(Constants.USE_ORIGINAL_FRONTEND_RESOURCES, "true"); - DefaultDeploymentConfiguration config = createDeploymentConfig(initParameters); + initParameters.setProperty(Constants.SERVLET_PARAMETER_PRODUCTION_MODE, + "true"); + initParameters.setProperty(Constants.USE_ORIGINAL_FRONTEND_RESOURCES, + "true"); + DefaultDeploymentConfiguration config = createDeploymentConfig( + initParameters); Assert.assertFalse(config.useCompiledFrontendResources()); } } diff --git a/pom.xml b/pom.xml index acc74d83545..e8b35c35794 100644 --- a/pom.xml +++ b/pom.xml @@ -502,17 +502,9 @@ maven-surefire-plugin - - - true - maven-failsafe-plugin - - - true - javax.xml.bind