Skip to content

Commit 914f157

Browse files
committed
make test run in integration-test phase, enable integration-test phase to run in release ci, change name of the library to linux-x86-64 which is a hack to make it build to target/classes/linux-x86-64
1 parent 0c947dc commit 914f157

4 files changed

Lines changed: 39 additions & 17 deletions

File tree

.github/workflows/upload_release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
gpg-passphrase: MAVEN_GPG_PASSPHRASE
3333

3434
- name: Publish to Maven Central
35-
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
35+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean verify deploy -Ppublish-maven-central
3636
env:
3737
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3838
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
@@ -46,6 +46,6 @@ jobs:
4646
distribution: 'adopt'
4747

4848
- name: Publish to GitHub Packages
49-
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
49+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean verify deploy -Ppublish-github-packages
5050
env:
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pom.xml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<java.version>1.8</java.version>
1919
<maven.compiler.source>1.8</maven.compiler.source>
2020
<maven.compiler.target>1.8</maven.compiler.target>
21+
<junit.jupiter.version>5.7.1</junit.jupiter.version>
2122
</properties>
2223

2324
<licenses>
@@ -68,17 +69,18 @@
6869
<artifactId>maven-jar-plugin</artifactId>
6970
<version>3.3.0</version>
7071
</dependency>
71-
<dependency>
72-
<groupId>org.junit.jupiter</groupId>
73-
<artifactId>junit-jupiter</artifactId>
74-
<version>5.9.0</version>
75-
<scope>test</scope>
76-
</dependency>
7772
<dependency>
7873
<groupId>org.slf4j</groupId>
7974
<artifactId>slf4j-api</artifactId>
8075
<version>2.0.5</version>
8176
</dependency>
77+
<!-- testing -->
78+
<dependency>
79+
<groupId>org.junit.jupiter</groupId>
80+
<artifactId>junit-jupiter-engine</artifactId>
81+
<version>${junit.jupiter.version}</version>
82+
<scope>test</scope>
83+
</dependency>
8284
<dependency>
8385
<groupId>org.slf4j</groupId>
8486
<artifactId>slf4j-simple</artifactId>
@@ -88,6 +90,25 @@
8890
</dependencies>
8991
<build>
9092
<plugins>
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-failsafe-plugin</artifactId>
96+
<version>2.22.2</version>
97+
<executions>
98+
<execution>
99+
<id>integration-test</id>
100+
<goals>
101+
<goal>integration-test</goal>
102+
</goals>
103+
</execution>
104+
<execution>
105+
<id>verify</id>
106+
<goals>
107+
<goal>verify</goal>
108+
</goals>
109+
</execution>
110+
</executions>
111+
</plugin>
91112
<plugin>
92113
<groupId>org.codehaus.mojo</groupId>
93114
<artifactId>exec-maven-plugin</artifactId>
@@ -132,7 +153,8 @@
132153
<configuration>
133154
<executable>./configure</executable>
134155
<arguments>
135-
<argument>--prefix=/opt/Fail-Safe/${project.artifactId}</argument>
156+
<argument>--prefix=/</argument>
157+
<argument>--libdir=/</argument>
136158
</arguments>
137159
<workingDirectory>${project.build.directory}/${project.artifactId}/src/main/c</workingDirectory>
138160
</configuration>
@@ -162,7 +184,7 @@
162184
<arguments>
163185
<argument>-j1</argument>
164186
<argument>install</argument>
165-
<argument>DESTDIR=${project.build.directory}/classes/lib</argument>
187+
<argument>DESTDIR=${project.build.directory}/classes</argument>
166188
</arguments>
167189
<workingDirectory>${project.build.directory}/${project.artifactId}/src/main/c</workingDirectory>
168190
</configuration>
@@ -181,7 +203,7 @@
181203
<!-- <mainClass>test.org.Cliente</mainClass> -->
182204
</manifest>
183205
<manifestEntries>
184-
<Class-Path>lib/</Class-Path>
206+
<Class-Path>lib/javapcre/</Class-Path>
185207
</manifestEntries>
186208
</archive>
187209
</configuration>

src/main/c/configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([JavaPcre], 1.0)
1+
AC_INIT([linux-x86-64], 1.0)
22
#AC_CONFIG_MACRO_DIRS([m4])
33
AM_INIT_AUTOMAKE
44
LT_INIT
@@ -13,4 +13,4 @@ AC_TYPE_MODE_T
1313
AC_TYPE_OFF_T
1414
AC_TYPE_UINT8_T
1515
AC_CONFIG_FILES(Makefile)
16-
AC_OUTPUT
16+
AC_OUTPUT

src/test/java/com/teragrep/jpr_01/JavaPcreTest.java renamed to src/test/java/com/teragrep/jpr_01/JavaPcreIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212

1313
// import static org.junit.jupiter.api.Assertions.*;
1414

15-
class JavaPcreTest {
16-
15+
class JavaPcreIT {
16+
private static final Logger LOGGER = LoggerFactory.getLogger(JavaPcreIT.class);
17+
1718
@Test
1819
void pcre2_versioncheck_test() {
1920
JavaPcre s1 = new JavaPcre();
2021
s1.pcre2_versioncheck();
2122
}
2223

23-
private static final Logger LOGGER = LoggerFactory.getLogger(JavaPcre.class);
2424
@Test
2525
void pcre2_slf4j_test() {
2626
LOGGER.error("Testing error");
@@ -831,4 +831,4 @@ void jcompile_free_error(){
831831
}
832832
throw new IllegalStateException("Exception handling broke down");
833833
}
834-
}
834+
}

0 commit comments

Comments
 (0)