This is an automated email from the ASF dual-hosted git repository. hulee pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/helix.git
commit ca36fbfa3c59f6dc0eec31f312f103749874f7c0 Author: Hunter Lee <[email protected]> AuthorDate: Fri Mar 29 11:56:13 2019 -0700 Migrate Helix to Java 8 This diff migrates the project to JDK1.8. This diff does not change any functionalities/core logic. It contains a few style changes and redundant code changes. Changelist: 1. Change to Java 8 2. Upgrade dependencies in pom.xml RB=1613418 BUG=HELIX-1742 G=helix-reviewers A=jxue Signed-off-by: Hunter Lee <[email protected]> --- .../stages/TestClusterEventBlockingQueue.java | 4 +- .../helix/integration/task/TestTaskRebalancer.java | 2 +- pom.xml | 161 +++++++++++---------- 3 files changed, 88 insertions(+), 79 deletions(-) diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEventBlockingQueue.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEventBlockingQueue.java index fc7177a..b38572d 100644 --- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEventBlockingQueue.java +++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEventBlockingQueue.java @@ -60,7 +60,7 @@ public class TestClusterEventBlockingQueue { // test peek ClusterEvent peeked = queue.peek(); Assert.assertEquals(peeked.getEventType(), ClusterEventType.IdealStateChange); - Assert.assertEquals(peeked.getAttribute("attr"), 1); + Assert.assertEquals((int) peeked.getAttribute("attr"), 1); Assert.assertEquals(queue.size(), 2); // test take the head @@ -68,7 +68,7 @@ public class TestClusterEventBlockingQueue { MoreExecutors.listeningDecorator(Executors.newCachedThreadPool()); ClusterEvent takenEvent1 = safeTake(queue, service); Assert.assertEquals(takenEvent1.getEventType(), ClusterEventType.IdealStateChange); - Assert.assertEquals(takenEvent1.getAttribute("attr"), 1); + Assert.assertEquals((int) takenEvent1.getAttribute("attr"), 1); Assert.assertEquals(queue.size(), 1); // test take the tail diff --git a/helix-core/src/test/java/org/apache/helix/integration/task/TestTaskRebalancer.java b/helix-core/src/test/java/org/apache/helix/integration/task/TestTaskRebalancer.java index 6d4f03b..e12b4a9 100644 --- a/helix-core/src/test/java/org/apache/helix/integration/task/TestTaskRebalancer.java +++ b/helix-core/src/test/java/org/apache/helix/integration/task/TestTaskRebalancer.java @@ -88,7 +88,7 @@ public class TestTaskRebalancer extends TaskTestBase { // Ensure workflow config and context were cleaned up by now Assert.assertFalse(_manager.getHelixPropertyStore().exists(workflowPropStoreKey, AccessOption.PERSISTENT)); - Assert.assertEquals(accessor.getProperty(workflowCfgKey), null); + Assert.assertNull(accessor.getProperty(workflowCfgKey)); } private void basic(long jobCompletionTime) throws Exception { diff --git a/pom.xml b/pom.xml index 20fc309..8481470 100644 --- a/pom.xml +++ b/pom.xml @@ -237,6 +237,15 @@ under the License. </roles> <timezone>-8</timezone> </developer> + <developer> + <id>hulee</id> + <name>Hunter Lee</name> + <email>[email protected]</email> + <roles> + <role>Committer</role> + </roles> + <timezone>-8</timezone> + </developer> </developers> <modules> <module>helix-core</module> @@ -338,8 +347,8 @@ under the License. <sonar.host.url>https://analysis.apache.org/</sonar.host.url> - <maven-scm-provider-svnjava.version>2.0.5</maven-scm-provider-svnjava.version> - <svnkit.version>1.7.5-v1</svnkit.version> + <maven-scm-provider-svnjava.version>3.0.0</maven-scm-provider-svnjava.version> + <svnkit.version>1.10.0</svnkit.version> <helix.siteFilePath>${user.home}/helix-site/helix-site-deploy</helix.siteFilePath> <!-- you can use javasvn too --> @@ -421,10 +430,10 @@ under the License. <version>${project.version}</version> </dependency> <dependency> - <groupId>org.apache.helix</groupId> - <artifactId>helix-core</artifactId> - <type>test-jar</type> - <version>${project.version}</version> + <groupId>org.apache.helix</groupId> + <artifactId>helix-core</artifactId> + <type>test-jar</type> + <version>${project.version}</version> </dependency> <dependency> <groupId>junit</groupId> @@ -454,8 +463,8 @@ under the License. <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> - <source>1.7</source> - <target>1.7</target> + <source>1.8</source> + <target>1.8</target> </configuration> </plugin> <plugin> @@ -582,14 +591,14 @@ under the License. </dependencies> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.14</version> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.14</version> </plugin> <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <version>0.8</version> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <version>0.8</version> </plugin> </plugins> </pluginManagement> @@ -614,7 +623,7 @@ under the License. <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> - <version>2.3.7</version> + <version>3.5.0</version> <inherited>true</inherited> <extensions>true</extensions> <configuration> @@ -653,42 +662,42 @@ under the License. <artifactId>maven-source-plugin</artifactId> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <!-- - Configuration for unit/integration tests section 2 of 3 (plugins) STARTS HERE. - This is the core piece for being able to manage unit tests and - integration (='system') tests within Maven by using surefire. - See also: properties section and profiles section. - --> - <configuration> - <argLine>-Xms1024m -Xmx1024m</argLine> - <suiteXmlFiles> - <suiteXmlFile>src/test/conf/testng.xml</suiteXmlFile> - </suiteXmlFiles> - <excludes> - <exclude>**/integration/**</exclude> - </excludes> - </configuration> - <executions> - <execution> - <id>integration-tests</id> - <phase>integration-test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration> - <skip>${SKIP_INTEGRATION_TESTS}</skip> - <excludes> - <exclude>none</exclude> - </excludes> - <includes> - <include>**/integration/**</include> - </includes> - </configuration> - </execution> - </executions> - <!-- Configuration for unit/integration tests section 2 of 3 (plugins) ENDS HERE. --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <!-- + Configuration for unit/integration tests section 2 of 3 (plugins) STARTS HERE. + This is the core piece for being able to manage unit tests and + integration (='system') tests within Maven by using surefire. + See also: properties section and profiles section. + --> + <configuration> + <argLine>-Xms1024m -Xmx1024m</argLine> + <suiteXmlFiles> + <suiteXmlFile>src/test/conf/testng.xml</suiteXmlFile> + </suiteXmlFiles> + <excludes> + <exclude>**/integration/**</exclude> + </excludes> + </configuration> + <executions> + <execution> + <id>integration-tests</id> + <phase>integration-test</phase> + <goals> + <goal>test</goal> + </goals> + <configuration> + <skip>${SKIP_INTEGRATION_TESTS}</skip> + <excludes> + <exclude>none</exclude> + </excludes> + <includes> + <include>**/integration/**</include> + </includes> + </configuration> + </execution> + </executions> + <!-- Configuration for unit/integration tests section 2 of 3 (plugins) ENDS HERE. --> </plugin> </plugins> </build> @@ -697,7 +706,7 @@ under the License. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-changes-plugin</artifactId> - <version>2.8</version> + <version>2.12.1</version> <inherited>false</inherited> <configuration> <columnNames>Type,Fix Version,Key,Summary,Assignee,Status,Created</columnNames> @@ -719,7 +728,7 @@ under the License. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> - <version>2.3</version> + <version>3.0.0</version> <configuration> <aggregate>true</aggregate> </configuration> @@ -727,7 +736,7 @@ under the License. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> - <version>2.7</version> + <version>3.0.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -771,7 +780,7 @@ under the License. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.9.1</version> + <version>3.0.0</version> <inherited>false</inherited> <reportSets> <reportSet> @@ -836,26 +845,26 @@ under the License. </plugins> </build> </profile> - <!-- - Configuration for unit/integration tests section 3 of 3 (profiles) STARTS HERE. - Use the following profile to run Integration tests. From the command line: - mvn clean install -P integration-test - or: - mvn integration-test -P integration-test - * Note that if you do: 'mvn test -P integration-test' - integration tests will not run, because the test phase is before the - integration phase in the default maven lifecycle. - * Also note that unit tests will also be run when integration tests are - run, because the integration-test phase is always after the test phase - in the default Maven lifecycle. - See also: surefire plugin section and properties section. - --> - <profile> - <id>integration-test</id> - <properties> - <SKIP_INTEGRATION_TESTS>false</SKIP_INTEGRATION_TESTS> - </properties> - </profile> - <!-- Configuration for unit/integration tests section 3 of 3 (profiles) ENDS HERE.--> + <!-- + Configuration for unit/integration tests section 3 of 3 (profiles) STARTS HERE. + Use the following profile to run Integration tests. From the command line: + mvn clean install -P integration-test + or: + mvn integration-test -P integration-test + * Note that if you do: 'mvn test -P integration-test' + integration tests will not run, because the test phase is before the + integration phase in the default maven lifecycle. + * Also note that unit tests will also be run when integration tests are + run, because the integration-test phase is always after the test phase + in the default Maven lifecycle. + See also: surefire plugin section and properties section. + --> + <profile> + <id>integration-test</id> + <properties> + <SKIP_INTEGRATION_TESTS>false</SKIP_INTEGRATION_TESTS> + </properties> + </profile> + <!-- Configuration for unit/integration tests section 3 of 3 (profiles) ENDS HERE.--> </profiles> </project>
