Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support compiling the project with Java 11. #585

Merged
merged 5 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
dist: trusty
language: java
jdk:
- openjdk8
- openjdk11
script: mvn verify -Pquality,linux
cache:
directories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,67 +48,6 @@ public void registersJvmMetrics() {
Map<String, Gauge> gauges = metrics.getGauges();

assertThat(gauges.keySet(), hasItems(
"jvm.bufferpool.direct.capacity",
"jvm.bufferpool.direct.count",
"jvm.bufferpool.direct.used",
"jvm.bufferpool.mapped.capacity",
"jvm.bufferpool.mapped.count",
"jvm.bufferpool.mapped.used",
"jvm.gc.PS-MarkSweep.count",
"jvm.gc.PS-MarkSweep.time",
"jvm.gc.PS-Scavenge.count",
"jvm.gc.PS-Scavenge.time",
"jvm.memory.heap.committed",
"jvm.memory.heap.init",
"jvm.memory.heap.max",
"jvm.memory.heap.usage",
"jvm.memory.heap.used",
"jvm.memory.non-heap.committed",
"jvm.memory.non-heap.init",
"jvm.memory.non-heap.max",
"jvm.memory.non-heap.usage",
"jvm.memory.non-heap.used",
"jvm.memory.pools.Code-Cache.committed",
"jvm.memory.pools.Code-Cache.init",
"jvm.memory.pools.Code-Cache.max",
"jvm.memory.pools.Code-Cache.usage",
"jvm.memory.pools.Code-Cache.used",
"jvm.memory.pools.Compressed-Class-Space.committed",
"jvm.memory.pools.Compressed-Class-Space.init",
"jvm.memory.pools.Compressed-Class-Space.max",
"jvm.memory.pools.Compressed-Class-Space.usage",
"jvm.memory.pools.Compressed-Class-Space.used",
"jvm.memory.pools.Metaspace.committed",
"jvm.memory.pools.Metaspace.init",
"jvm.memory.pools.Metaspace.max",
"jvm.memory.pools.Metaspace.usage",
"jvm.memory.pools.Metaspace.used",
"jvm.memory.pools.PS-Eden-Space.committed",
"jvm.memory.pools.PS-Eden-Space.init",
"jvm.memory.pools.PS-Eden-Space.max",
"jvm.memory.pools.PS-Eden-Space.usage",
"jvm.memory.pools.PS-Eden-Space.used",
"jvm.memory.pools.PS-Eden-Space.used-after-gc",
"jvm.memory.pools.PS-Old-Gen.committed",
"jvm.memory.pools.PS-Old-Gen.init",
"jvm.memory.pools.PS-Old-Gen.max",
"jvm.memory.pools.PS-Old-Gen.usage",
"jvm.memory.pools.PS-Old-Gen.used",
"jvm.memory.pools.PS-Old-Gen.used-after-gc",
"jvm.memory.pools.PS-Survivor-Space.committed",
"jvm.memory.pools.PS-Survivor-Space.init",
"jvm.memory.pools.PS-Survivor-Space.max",
"jvm.memory.pools.PS-Survivor-Space.usage",
"jvm.memory.pools.PS-Survivor-Space.used",
"jvm.memory.pools.PS-Survivor-Space.used-after-gc",
"jvm.memory.total.committed",
"jvm.memory.total.init",
"jvm.memory.total.max",
"jvm.memory.total.used",
"jvm.netty.pooled-allocator.usedDirectMemory",
"jvm.netty.pooled-allocator.usedHeapMemory",
"jvm.netty.unpooled-allocator.usedDirectMemory",
"jvm.netty.unpooled-allocator.usedHeapMemory",
"jvm.thread.blocked.count",
"jvm.thread.count",
"jvm.thread.daemon.count",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@
*/
package com.hotels.styx.routing

import io.kotlintest.matchers.string.shouldContain
import io.kotlintest.shouldBe
import io.kotlintest.specs.StringSpec
import io.mockk.mockk
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter.ISO_DATE_TIME

private const val CREATED_STRING = "created:"
private const val TIMESTAMP_START_POSITION = CREATED_STRING.length

class RoutingObjectRecordTest : StringSpec({
"Creates with timestamp" {
val createdTag= RoutingObjectRecord.create("A", setOf("b"), mockk(), mockk())
.tags
.filter { it.startsWith("created") }
.filter { it.startsWith(CREATED_STRING) }
.map { it.substring(TIMESTAMP_START_POSITION) }
.first()

if (createdTag.contains(".")) { // just to keep the regexes clear
createdTag.shouldContain("created:20[0-9]{2}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,3}$".toRegex())
} else {
createdTag.shouldContain("created:20[0-9]{2}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$".toRegex())
LocalDateTime.parse(createdTag, ISO_DATE_TIME).format(ISO_DATE_TIME).shouldBe(createdTag);

}
}
})
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To build the docker image:
To run the image:

docker run -it -v /var/run/docker.sock:/var/run/docker.sock styxbuild
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /Users/$USER/.m2:/root/.m2 styxbuild:latest
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /Users/$USER/.m2:/root/.m2 -v `pwd`:/build styxbuild:latest

Note, mounting a `docker.sock` is only necessary for building a Styx Docker
image inside the build container.
Expand Down
4 changes: 2 additions & 2 deletions docker/styx-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM centos:7

ENV APP_HOME=/build

ARG MVN_VERSION=3.6.2
ARG MVN_VERSION=3.6.3
ARG MVN_URL=http://apache.mirrors.nublue.co.uk/maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz
ENV MVN_INSTALL_DIR=/opt/mvn

Expand All @@ -17,7 +17,7 @@ RUN yum install -y java-1.8.0-openjdk-devel \
&& tar -C /opt/ -zxvf apache-maven-${MVN_VERSION}-bin.tar.gz \
&& rm apache-maven-${MVN_VERSION}-bin.tar.gz

ENV PATH=/opt/apache-maven-3.6.2/bin:$PATH
ENV PATH=/opt/apache-maven-${MVN_VERSION}/bin:$PATH
ENV JAVA_HOME=/etc/alternatives/java_sdk


Expand Down
10 changes: 1 addition & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@

<!-- non apache plugin versions and configurations, please sort alphabetically -->
<build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
<jacoco-maven-plugin.version>0.7.5.201505241946</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>

<!-- code quality -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
Expand Down Expand Up @@ -677,14 +677,6 @@
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
Expand Down
18 changes: 0 additions & 18 deletions system-tests/e2e-suite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,6 @@
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.3</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ class TlsErrorSpec extends FunSpec
}

val message =
"""SSL handshake failure from incoming connection cause="Client requested protocol """ +
s"""TLSv1.1 not enabled or not supported", serverAddress=.*:$serverPort, clientAddress=.*"""
"""SSL handshake failure from incoming connection cause=".*TLSv1.1.*"""

eventually(timeout(3 seconds)) {
assertThat(log.log(), hasItem(loggingEvent(INFO, message)))
Expand Down