Skip to content

Commit

Permalink
Run TCK with server side selectors (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
eolivelli authored Apr 29, 2022
1 parent a39fe25 commit ed8b70c
Show file tree
Hide file tree
Showing 11 changed files with 409 additions and 8 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/tck-client-side-filters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run TCK with Client Side Filters

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'

- 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
run: mvn -B clean install -DskipTests -Dspotbugs.skip=true

- name: TCK tests - client side filters
run: mvn -B verify -DskipTests -Prun-tck
33 changes: 33 additions & 0 deletions .github/workflows/tck-server-side-filters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run TCK with Server Side Filters

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'

- 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
run: mvn -B clean install -DskipTests -Dspotbugs.skip=true

- name: TCK tests - server side filters
run: mvn -B verify -DskipTests -Prun-tck-server-side-filters
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ jobs:
- name: Build and test
run: mvn -B clean verify

- name: TCK tests
run: mvn -B verify -Prun-tck

Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class DockerTest {
private static final String TEST_PULSAR_DOCKER_IMAGE_NAME =
System.getProperty("testPulsarDockerImageName");

@TempDir
Path tempDir;
@TempDir Path tempDir;

@Test
public void testPulsar272() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.io.TempDir;
import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.GenericContainer;

Expand Down
36 changes: 36 additions & 0 deletions tck-executor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -102,6 +109,35 @@
</executions>
<configuration>
<executable>${basedir}/run_from_maven.sh</executable>
<arguments>
<argument>ts.jte</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>run-tck-server-side-filters</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${basedir}/run_from_maven.sh</executable>
<arguments>
<argument>ts.serverSideFilters.jte</argument>
</arguments>
</configuration>
</plugin>
</plugins>
Expand Down
6 changes: 6 additions & 0 deletions tck-executor/run_from_maven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ set -x
HERE=$(dirname $0)
HERE=$(realpath "$HERE")

CONFIGURATION_FILE=${1:-ts.jte}
echo "CONFIGURATION_FILE is $CONFIGURATION_FILE"

unzip -o $HERE/jakarta-messaging-tck-2.0.0.zip -d $HERE/target

TS_HOME=target/messaging-tck

VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)
cp ts.* $TS_HOME/bin
# overwrite ts.jte
cp $CONFIGURATION_FILE $TS_HOME/bin/ts.jte
echo "jms.home=$HERE" >> $TS_HOME/bin/ts.jte
echo "jms.classes=\${jms.home}/target/tck-executor-$VERSION.jar" >> $TS_HOME/bin/ts.jte

Expand All @@ -27,6 +32,7 @@ wget -O - http://localhost:8080/lookup/v2/topic/persistent/pulsar/system/transac
# move to the directory that contains the test you want to run
cd $TS_HOME/src/com/sun/ts/tests


ant runclient
ANTEXITCODE=$?
echo "Ant exit code $ANTEXITCODE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ private static PulsarConnectionFactory buildConnectionFactory(String name) throw
// com.sun.ts.tests.jms.core20.jmscontexttopictests.Client.verifyClientIDOnAdminConfiguredIDTest
configuration.put("jms.clientId", "cts");
}

System.getProperties()
.forEach(
(k, v) -> {
if (k.toString().startsWith("JMS_TCK_CLIENT_")) {
String key = k.toString().substring("JMS_TCK_CLIENT_".length()).replace("_", ".");
System.out.println("Found property " + k + ". Adding " + key + " = " + v);
configuration.put(key, v);
}
});
return new PulsarConnectionFactory(configuration);
}

Expand Down
2 changes: 1 addition & 1 deletion tck-executor/start_pulsar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HERE=$(dirname $0)
HERE=$(realpath "$HERE")
FILTERSDIRECTORY=$HERE/../pulsar-jms-filters/target
docker rm -f pulsar-jms-runner
docker run --name pulsar-jms-runner -v $FILTERSDIRECTORY:/pulsar/filters -v $HERE/conf:/pulsar/conf -d -p 8080:8080 -p 6650:6650 $IMAGENAME /pulsar/bin/pulsar standalone
docker run --name pulsar-jms-runner -v $FILTERSDIRECTORY:/pulsar/filters -v $HERE/conf:/pulsar/conf -d -p 8080:8080 -p 6650:6650 $IMAGENAME /pulsar/bin/pulsar standalone -nss -nfw
# Wait for pulsar to start
echo "Waiting 15 seconds"

Expand Down
2 changes: 1 addition & 1 deletion tck-executor/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ command.testExecute=com.sun.ts.lib.harness.ExecTSTestCmd \
-Djava.security.policy="${bin.dir}/harness.policy" \
-Djava.security.manager \
-Dlog4j2.debug=true \
-Dorg.slf4j.simpleLotgger.defaultLogLevel=warn \
-Dorg.slf4j.simpleLogger.defaultLogLevel=warn \
-Djava.naming.factory.initial=${java.naming.factory.initial} \
-Ddeliverable.class=${deliverable.class} \
-Djava.endorsed.dirs=${endorsed.dirs} \
Expand Down
Loading

0 comments on commit ed8b70c

Please sign in to comment.