Skip to content

Commit

Permalink
Merge pull request #567 from rhusar/MODCLUSTER-747-1.4
Browse files Browse the repository at this point in the history
[1.4] MODCLUSTER-747 CI: Test 1.4.x branch with JDK 11 & 17
  • Loading branch information
rhusar authored Feb 21, 2022
2 parents 94470d2 + 0dd09df commit 863821b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 31 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,30 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
java: [ 1.8 ]
java-compilation: [ 8 ]
java-runtime: [ 8, 11, 17 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
- name: Set up JDK ${{ matrix.java-compilation }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
java-version: ${{ matrix.java-compilation }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package
- name: Build with Maven (Tomcat 9)
run: mvn -B package -P TC9
- name: Build with Maven using JDK ${{ matrix.java-compilation }}
run: mvn -B verify -DskipTests
- name: Set up JDK ${{ matrix.java-runtime }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-runtime }}
- name: Run test with Maven using JDK ${{ matrix.java-runtime }}
# In order to support Windows Powershell, a space between -D property=true is required.
run: mvn -B verify -D enforcer.skip=true -D maven.main.skip=true
- name: Run test with Maven using JDK ${{ matrix.java-runtime }} (Tomcat 9)
run: mvn -B verify -D enforcer.skip=true -D maven.main.skip=true -P TC9
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import java.beans.PropertyChangeEvent;
Expand Down Expand Up @@ -283,7 +283,7 @@ public void initServer() throws Exception {

handler.lifecycleEvent(this.createAfterInitEvent(server));

verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);
}

protected void initServer(TomcatEventHandler handler, LifecycleServer server) {
Expand Down Expand Up @@ -329,7 +329,7 @@ public void startServer() throws Exception {

handler.lifecycleEvent(new LifecycleEvent(server, Lifecycle.AFTER_START_EVENT, null));

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);
}

protected void startServer(TomcatEventHandler handler, LifecycleServer server) {
Expand Down Expand Up @@ -386,13 +386,13 @@ public void stopServer() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);

this.initServer(handler, server);

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);

this.startServer(handler, server);

Expand All @@ -407,7 +407,7 @@ public void stopServer() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);
}

@Test
Expand All @@ -419,7 +419,7 @@ public void destroyServer() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);

this.initServer(handler, server);

Expand All @@ -444,7 +444,7 @@ public void destroyServer() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);
}

@Test
Expand All @@ -457,15 +457,15 @@ public void periodicEvent() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);

LifecycleServer server = mock(LifecycleServer.class);

this.initServer(handler, server);

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);

this.startServer(handler, server);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
*/
package org.jboss.modcluster.container.tomcat85;

import static org.mockito.ArgumentMatchers.same;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import org.apache.catalina.Container;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
Expand All @@ -31,18 +38,10 @@
import org.jboss.modcluster.container.tomcat.ServerProvider;
import org.jboss.modcluster.container.tomcat.TomcatEventHandler;
import org.jboss.modcluster.container.tomcat.TomcatFactory;
import org.mockito.Mockito;

import static org.mockito.ArgumentMatchers.same;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
* @author Paul Ferraro
* @author Radoslav Husar
* @version May 2016
*/
public class TomcatEventHandlerAdapterTestCase extends ContainerEventHandlerAdapterTestCase {

Expand Down Expand Up @@ -149,7 +148,7 @@ public void destroyServer() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);

this.initServer(handler, server);

Expand All @@ -174,6 +173,6 @@ public void destroyServer() throws Exception {

handler.lifecycleEvent(event);

Mockito.verifyZeroInteractions(this.eventHandler);
verifyNoInteractions(this.eventHandler);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void getResetRequestsNoServer() {

assertTrue(requests.isEmpty());

verifyZeroInteractions(server);
verifyNoInteractions(server);
}

@Test
Expand All @@ -70,7 +70,7 @@ public void getResetRequests() throws Exception {

this.source.init(server, contextFilter);

verifyZeroInteractions(server);
verifyNoInteractions(server);

Engine engine = mock(Engine.class);
Host host = mock(Host.class);
Expand Down Expand Up @@ -116,7 +116,7 @@ public void getResetRequestsDisableContexts() throws Exception {

this.source.init(server, contextFilter);

verifyZeroInteractions(server);
verifyNoInteractions(server);

Engine engine = mock(Engine.class);
Host host = mock(Host.class);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<version.jfreechart>1.0.13</version.jfreechart>
<version.jcip-annotations>1.0</version.jcip-annotations>
<version.junit>4.10</version.junit>
<version.mockito>2.5.2</version.mockito>
<version.mockito>4.3.1</version.mockito>
<version.javax.servlet-3.0>1.0.2.Final</version.javax.servlet-3.0>

<!-- Plugin versions -->
Expand Down

0 comments on commit 863821b

Please sign in to comment.