Skip to content

Commit

Permalink
Enable tests for Java 10 (#4335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis authored and SomeoneToIgnore committed Jun 28, 2018
1 parent c3386e3 commit 4131f09
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 20 deletions.
8 changes: 7 additions & 1 deletion flow-components-parent/flow-code-generator-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -53,6 +54,11 @@
<artifactId>commons-text</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>

<build>
Expand Down
29 changes: 27 additions & 2 deletions flow-data/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -40,7 +41,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>test</scope>
</dependency>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
Expand All @@ -54,6 +55,30 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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());
}
}
8 changes: 0 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -502,17 +502,9 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!--TODO tests require some fixing-->
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<!--TODO tests require some fixing-->
<configuration>
<skipTests>true</skipTests>
</configuration>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
Expand Down

0 comments on commit 4131f09

Please sign in to comment.