-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update aesh dependency to 0.39 (second attempt)
- Loading branch information
Showing
12 changed files
with
146 additions
and
69 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
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
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
10 changes: 10 additions & 0 deletions
10
shell/spi/src/main/java/org/jboss/forge/addon/shell/spi/AeshSettingsProvider.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,10 @@ | ||
package org.jboss.forge.addon.shell.spi; | ||
|
||
import org.jboss.aesh.console.settings.Settings; | ||
|
||
public interface AeshSettingsProvider | ||
{ | ||
|
||
Settings buildSettings(); | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
shell/test-config/src/main/java/org/jboss/forge/addon/shell/test/TestSettingsProvider.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,62 @@ | ||
package org.jboss.forge.addon.shell.test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.io.PipedInputStream; | ||
import java.io.PipedOutputStream; | ||
|
||
import org.jboss.aesh.console.settings.Settings; | ||
import org.jboss.aesh.console.settings.SettingsBuilder; | ||
import org.jboss.aesh.edit.KeyOperation; | ||
import org.jboss.aesh.edit.actions.Operation; | ||
import org.jboss.aesh.terminal.Key; | ||
import org.jboss.aesh.terminal.TestTerminal; | ||
import org.jboss.forge.addon.shell.spi.AeshSettingsProvider; | ||
|
||
public class TestSettingsProvider implements AeshSettingsProvider | ||
{ | ||
|
||
private PipedOutputStream stdin = new PipedOutputStream(); | ||
private ByteArrayOutputStream stdout = new ByteArrayOutputStream(); | ||
private ByteArrayOutputStream stderr = new ByteArrayOutputStream(); | ||
private PipedInputStream inputStream; | ||
|
||
private Settings settings; | ||
|
||
@Override | ||
public Settings buildSettings() | ||
{ | ||
try { | ||
inputStream = new PipedInputStream(stdin); | ||
settings = new SettingsBuilder() | ||
.inputStream(inputStream) | ||
.outputStream(stdout) | ||
.outputStreamError(stderr) | ||
.name("test") | ||
.logging(true) | ||
.terminal(new TestTerminal()) | ||
.create(); | ||
settings.getOperationManager().addOperation(new KeyOperation(Key.ENTER, Operation.NEW_LINE)); | ||
} catch (IOException e) { | ||
throw new RuntimeException("Could not configure Shell.", e); | ||
} | ||
return settings; | ||
} | ||
|
||
public synchronized OutputStream getStdIn() | ||
{ | ||
return stdin; | ||
} | ||
|
||
public synchronized ByteArrayOutputStream getStdOut() | ||
{ | ||
return stdout; | ||
} | ||
|
||
public synchronized ByteArrayOutputStream getStdErr() | ||
{ | ||
return stderr; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.