Fix the build
Build and Test j3270 / Build JAR & Run Tests (Java 17) (push) Successful in 25s
Build and Test j3270 / Build JAR & Run Tests (Java 11) (push) Successful in 59s
Build and Test j3270 / Build JAR & Run Tests (Java 21) (push) Successful in 23s

This commit is contained in:
2026-09-07 20:31:18 -04:00
parent dbcb0aa1b6
commit f8fc0e4b22
@@ -54,11 +54,12 @@ public class LiveHostHeadlessTest {
CountDownLatch connectedLatch = new CountDownLatch(1);
CountDownLatch screenLatch = new CountDownLatch(1);
java.util.concurrent.atomic.AtomicReference<String> screenContentRef = new java.util.concurrent.atomic.AtomicReference<>();
client.addConnectionListener(new ConnectionListener() {
@Override
public void onConnectionStateChanged(ConnectionState oldState, ConnectionState newState) {
if (newState == ConnectionState.CONNECTED_3270) {
if (newState.is3270()) {
connectedLatch.countDown();
}
}
@@ -72,29 +73,32 @@ public class LiveHostHeadlessTest {
public void onScreenUpdated() {
ScreenBuffer sb = client.getScreenBuffer();
if (sb != null && sb.isFormatted()) {
String text = sb.getText().trim();
if (!text.isEmpty()) {
screenContentRef.set(text);
screenLatch.countDown();
}
}
}
});
try {
client.connect();
boolean connected = connectedLatch.await(5, TimeUnit.SECONDS);
assertTrue(connected, "Client must establish CONNECTED_3270 state");
boolean connected = connectedLatch.await(8, TimeUnit.SECONDS);
assertTrue(connected, "Client must establish 3270 connected state");
boolean screenReceived = screenLatch.await(5, TimeUnit.SECONDS);
boolean screenReceived = screenLatch.await(8, TimeUnit.SECONDS);
assertTrue(screenReceived, "Client must receive formatted screen from live MVS host");
String screenContent = screenContentRef.get();
if (screenContent == null || screenContent.isEmpty()) {
ScreenBuffer sb = client.getScreenBuffer();
assertNotNull(sb);
StringBuilder fullText = new StringBuilder();
for (int i = 0; i < sb.getSize(); i++) {
char c = sb.getCell(i).ucs4;
fullText.append(c > ' ' ? c : ' ');
if (sb != null) {
screenContent = sb.getText().trim();
}
String screenContent = fullText.toString().trim();
}
assertNotNull(screenContent, "Screen content should not be null");
assertFalse(screenContent.isEmpty(), "Screen buffer text should not be empty");
// Verify headless graphics plane is initialized without AWT