Skip to content

Commit

Permalink
Support for Java 8. issue #361
Browse files Browse the repository at this point in the history
  • Loading branch information
itaiag committed Feb 24, 2022
1 parent 98ef701 commit 25b0847
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<properties>
<jsystem.version>${jsystem.dependency.version}</jsystem.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<repositories>
<repository>
Expand All @@ -29,15 +31,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions jsystem-archetypes/jsystem-tests-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
<escapeString>\</escapeString>
</configuration>
</plugin>




<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<properties>
<jsystem.version>${jsystem.dependency.version}</jsystem.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<repositories>
<repository>
Expand Down Expand Up @@ -65,15 +67,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
16 changes: 0 additions & 16 deletions jsystem-miscellaneous/jsystem-services-so/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,5 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

</plugins>
</build>


</project>

6 changes: 6 additions & 0 deletions jsystem-miscellaneous/jsystem-services-tests/.run.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Thu Feb 24 11:45:42 IST 2022
summary.Date=Thu Feb 24 11\:45\:42 IST 2022
summary.Version=unknown
summary.Station=172.17.16.1
summary.Scenario=default
summary.User=itaiag
9 changes: 0 additions & 9 deletions jsystem-miscellaneous/jsystem-services-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.aqua.services.java8;

import jsystem.framework.TestProperties;
import junit.framework.SystemTestCase4;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.stream.Collectors;

import static org.junit.Assert.assertTrue;

public class TestJava8 extends SystemTestCase4 {

@Test
@TestProperties(name = "Test Java8 lambda expression support")
public void testLambda() {
List<String> names = new ArrayList<>();
names.add("foo");
names.add("bar");
names.add("zoo");
report.report("Before changes " + names);
List<String> changedNames = names.stream()
.filter(n -> !n.equals("bar"))
.map(n -> n.toUpperCase(Locale.ROOT))
.collect(Collectors.toList());

report.report("After changes " + changedNames);
assertTrue(changedNames.size() == 2);
assertTrue(changedNames.get(0).equals("FOO"));
}

@Test
@TestProperties(name = "Test Java8 optional feature support")
public void testOptional(){
String name = "JSystem";
Optional<String> opt = Optional.of(name);
assertTrue(opt.isPresent());
}

}
14 changes: 3 additions & 11 deletions jsystem-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<assembly.format>dir</assembly.format>
<topq.repository.rootUrl>http://maven.top-q.co.il</topq.repository.rootUrl>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand All @@ -53,7 +55,7 @@
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.9</version>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
Expand Down Expand Up @@ -214,16 +216,6 @@
<build>
<!--<finalName>${project.artifactId}</finalName> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<target>1.7</target>
<source>1.7</source>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down

0 comments on commit 25b0847

Please sign in to comment.