File tree Expand file tree Collapse file tree
src/test/java/org/codejive/miniterm
src/test/java/org/codejive/miniterm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 cache : maven
2626
2727 - name : Build and verify
28- run : ./mvnw --no-transfer-progress --batch-mode verify
28+ run : ./mvnw --no-transfer-progress --batch-mode verify -DskipITs
Original file line number Diff line number Diff line change 1+ name : Test CI
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ build :
8+ runs-on : ${{ matrix.os }}
9+ strategy :
10+ matrix :
11+ os : [ubuntu-latest, windows-latest, macos-latest]
12+
13+ steps :
14+ - uses : actions/checkout@v6
15+
16+ - name : Set up JDK 22
17+ uses : actions/setup-java@v5
18+ with :
19+ java-version : ' 22'
20+ distribution : ' temurin'
21+ cache : maven
22+
23+ - name : Build and verify
24+ run : ./mvnw --no-transfer-progress --batch-mode verify
25+
26+ - name : Run IT tests
27+ shell : bash
28+ run : |
29+ MVN="./mvnw --no-transfer-progress --batch-mode verify -DskipITs=false -Dsurefire.skip=true"
30+ if [[ "$RUNNER_OS" == "Linux" ]]; then
31+ # Allocate a PTY so /dev/tty is available for the Terminal IT tests
32+ script -q -e -c "$MVN" /dev/null
33+ elif [[ "$RUNNER_OS" == "macOS" ]]; then
34+ # BSD script: command args follow the output file
35+ script -q /dev/null $MVN
36+ else
37+ $MVN
38+ fi
Original file line number Diff line number Diff line change 107107 <argLine >--enable-native-access=ALL-UNNAMED</argLine >
108108 </configuration >
109109 </plugin >
110+ <plugin >
111+ <groupId >org.apache.maven.plugins</groupId >
112+ <artifactId >maven-failsafe-plugin</artifactId >
113+ <configuration >
114+ <argLine >--enable-native-access=ALL-UNNAMED</argLine >
115+ </configuration >
116+ <executions >
117+ <execution >
118+ <goals >
119+ <goal >integration-test</goal >
120+ <goal >verify</goal >
121+ </goals >
122+ </execution >
123+ </executions >
124+ </plugin >
110125 <plugin >
111126 <groupId >com.diffplug.spotless</groupId >
112127 <artifactId >spotless-maven-plugin</artifactId >
155170 </plugins >
156171 </build >
157172
173+ <profiles >
174+ <profile >
175+ <id >macos-it</id >
176+ <activation >
177+ <os ><family >mac</family ></os >
178+ </activation >
179+ <build >
180+ <plugins >
181+ <plugin >
182+ <groupId >org.apache.maven.plugins</groupId >
183+ <artifactId >maven-failsafe-plugin</artifactId >
184+ <configuration >
185+ <!-- On macOS the forked JVM's stdin is a pipe, not a TTY.
186+ Running in-process avoids the fork so /dev/stdin remains a PTY. -->
187+ <forkCount >0</forkCount >
188+ </configuration >
189+ </plugin >
190+ </plugins >
191+ </build >
192+ </profile >
193+ </profiles >
194+
158195</project >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright TamboUI and miniterm Contributors
3+ * SPDX-License-Identifier: MIT
4+ */
5+ package org .codejive .miniterm ;
6+
7+ import static org .assertj .core .api .Assertions .assertThat ;
8+
9+ import java .io .IOException ;
10+ import org .junit .jupiter .api .Test ;
11+
12+ class TerminalIT {
13+
14+ @ Test
15+ void terminalCanBeCreatedAndClosed () throws IOException {
16+ Terminal terminal = Terminal .create ();
17+ try {
18+ assertThat (terminal ).isNotNull ();
19+ assertThat (terminal .charset ()).isNotNull ();
20+ assertThat (terminal .rawModeEnabled ()).isFalse ();
21+ } finally {
22+ terminal .close ();
23+ }
24+ }
25+ }
Original file line number Diff line number Diff line change 8080 </archive >
8181 </configuration >
8282 </plugin >
83+ <plugin >
84+ <groupId >org.apache.maven.plugins</groupId >
85+ <artifactId >maven-failsafe-plugin</artifactId >
86+ <executions >
87+ <execution >
88+ <goals >
89+ <goal >integration-test</goal >
90+ <goal >verify</goal >
91+ </goals >
92+ </execution >
93+ </executions >
94+ </plugin >
8395 <plugin >
8496 <groupId >com.diffplug.spotless</groupId >
8597 <artifactId >spotless-maven-plugin</artifactId >
244256 </plugins >
245257 </build >
246258 </profile >
259+ <profile >
260+ <id >macos-it</id >
261+ <activation >
262+ <os ><family >mac</family ></os >
263+ </activation >
264+ <build >
265+ <plugins >
266+ <plugin >
267+ <groupId >org.apache.maven.plugins</groupId >
268+ <artifactId >maven-failsafe-plugin</artifactId >
269+ <configuration >
270+ <!-- On macOS the forked JVM's stdin is a pipe, not a TTY.
271+ Running in-process avoids the fork so /dev/stdin remains a PTY. -->
272+ <forkCount >0</forkCount >
273+ </configuration >
274+ </plugin >
275+ </plugins >
276+ </build >
277+ </profile >
247278 </profiles >
248279
249280</project >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright TamboUI and miniterm Contributors
3+ * SPDX-License-Identifier: MIT
4+ */
5+ package org .codejive .miniterm ;
6+
7+ import static org .assertj .core .api .Assertions .assertThat ;
8+
9+ import java .io .IOException ;
10+ import org .junit .jupiter .api .Test ;
11+
12+ class TerminalIT {
13+
14+ @ Test
15+ void terminalCanBeCreatedAndClosed () throws IOException {
16+ Terminal terminal = Terminal .create ();
17+ try {
18+ assertThat (terminal ).isNotNull ();
19+ assertThat (terminal .charset ()).isNotNull ();
20+ assertThat (terminal .rawModeEnabled ()).isFalse ();
21+ } finally {
22+ terminal .close ();
23+ }
24+ }
25+ }
Original file line number Diff line number Diff line change 4646
4747 <properties >
4848 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
49+ <skipITs >true</skipITs >
4950
5051 <!-- Dependency versions -->
5152 <version .jspecify>1.0.0</version .jspecify>
99100 <artifactId >maven-surefire-plugin</artifactId >
100101 <version >3.5.5</version >
101102 </plugin >
103+ <plugin >
104+ <groupId >org.apache.maven.plugins</groupId >
105+ <artifactId >maven-failsafe-plugin</artifactId >
106+ <version >3.5.5</version >
107+ </plugin >
102108 <plugin >
103109 <groupId >org.apache.maven.plugins</groupId >
104110 <artifactId >maven-jar-plugin</artifactId >
You can’t perform that action at this time.
0 commit comments