-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
159 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+20 Bytes
(100%)
native/src/main/resources/org/jline/nativ/Linux/arm/libjlinenative.so
Binary file not shown.
Binary file modified
BIN
+16 Bytes
(100%)
native/src/main/resources/org/jline/nativ/Linux/arm64/libjlinenative.so
Binary file not shown.
Binary file modified
BIN
+20 Bytes
(100%)
native/src/main/resources/org/jline/nativ/Linux/armv7/libjlinenative.so
Binary file not shown.
Binary file modified
BIN
+8 Bytes
(100%)
native/src/main/resources/org/jline/nativ/Linux/ppc64/libjlinenative.so
Binary file not shown.
Binary file modified
BIN
+20 Bytes
(100%)
native/src/main/resources/org/jline/nativ/Linux/x86/libjlinenative.so
Binary file not shown.
Binary file modified
BIN
+16 Bytes
(100%)
native/src/main/resources/org/jline/nativ/Linux/x86_64/libjlinenative.so
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
terminal-jna/src/test/java/org/jline/terminal/impl/jna/JnaTerminalProviderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2002-2021, the original author(s). | ||
* | ||
* This software is distributable under the BSD license. See the terms of the | ||
* BSD license in the documentation provided with this software. | ||
* | ||
* https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
package org.jline.terminal.impl.jna; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.PipedInputStream; | ||
import java.io.PipedOutputStream; | ||
import java.nio.charset.Charset; | ||
|
||
import org.jline.terminal.Terminal; | ||
import org.jline.terminal.spi.SystemStream; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.condition.DisabledOnOs; | ||
import org.junit.jupiter.api.condition.OS; | ||
|
||
import com.sun.jna.Platform; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assumptions.assumeFalse; | ||
|
||
public class JnaTerminalProviderTest { | ||
|
||
@Test | ||
void testIsSystemStream() { | ||
assumeFalse(Platform.isMac() && Platform.is64Bit() && Platform.isARM()); | ||
|
||
assertDoesNotThrow(() -> new JnaTerminalProvider().isSystemStream(SystemStream.Output)); | ||
} | ||
|
||
@Test | ||
@DisabledOnOs(OS.WINDOWS) | ||
void testNewTerminal() throws IOException { | ||
assumeFalse(Platform.isMac() && Platform.is64Bit() && Platform.isARM()); | ||
|
||
PipedOutputStream pos = new PipedOutputStream(); | ||
PipedInputStream pis = new PipedInputStream(pos); | ||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
|
||
Terminal terminal = new JnaTerminalProvider() | ||
.newTerminal( | ||
"name", | ||
"xterm", | ||
pis, | ||
baos, | ||
Charset.defaultCharset(), | ||
Terminal.SignalHandler.SIG_DFL, | ||
true, | ||
null, | ||
null); | ||
assertNotNull(terminal); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
terminal-jni/src/test/java/org/jline/terminal/impl/jni/JniTerminalProviderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2002-2021, the original author(s). | ||
* | ||
* This software is distributable under the BSD license. See the terms of the | ||
* BSD license in the documentation provided with this software. | ||
* | ||
* https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
package org.jline.terminal.impl.jni; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.PipedInputStream; | ||
import java.io.PipedOutputStream; | ||
import java.nio.charset.Charset; | ||
|
||
import org.jline.terminal.Terminal; | ||
import org.jline.terminal.spi.SystemStream; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.condition.DisabledOnOs; | ||
import org.junit.jupiter.api.condition.OS; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class JniTerminalProviderTest { | ||
|
||
@Test | ||
void testIsSystemStream() { | ||
assertDoesNotThrow(() -> new JniTerminalProvider().isSystemStream(SystemStream.Output)); | ||
} | ||
|
||
@Test | ||
@DisabledOnOs(OS.WINDOWS) | ||
void testNewTerminal() throws IOException { | ||
PipedOutputStream pos = new PipedOutputStream(); | ||
PipedInputStream pis = new PipedInputStream(pos); | ||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
|
||
Terminal terminal = new JniTerminalProvider() | ||
.newTerminal( | ||
"name", | ||
"xterm", | ||
pis, | ||
baos, | ||
Charset.defaultCharset(), | ||
Terminal.SignalHandler.SIG_DFL, | ||
true, | ||
null, | ||
null); | ||
assertNotNull(terminal); | ||
} | ||
} |