Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,6 @@
<module>testideas-websockets</module>
<module>testideas-sgbd</module>
<module>testideas-jersey</module>
<module>testideas-terminalEmulator</module>
</modules>
</project>
7 changes: 0 additions & 7 deletions testideas-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
<version>${org.glassfish.jersey.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.containers/jersey-container-grizzly2-http -->
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
<version>${org.glassfish.jersey.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public static void main(String[] args) {
rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName());

try {
HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, rc);
HttpServer server = GrizzlyHttpServerFactory.createHttpServer(HelloLauncher.BASE_URI, rc);
server.start();

System.out.println(String.format(
"Jersey app started with WADL available at " + "%sapplication.wadl\nHit enter to stop it...",
BASE_URI, BASE_URI));
HelloLauncher.BASE_URI, HelloLauncher.BASE_URI));

System.in.read();
server.shutdownNow();
Expand Down
41 changes: 41 additions & 0 deletions testideas-terminalEmulator/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions testideas-terminalEmulator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
23 changes: 23 additions & 0 deletions testideas-terminalEmulator/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>testideas-terminalEmulator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
118 changes: 118 additions & 0 deletions testideas-terminalEmulator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Test Ideas : Terminal Emulator

A complete Unix/Linux terminal emulator implemented in Java 8 with Swing GUI. (3 versions !)
- Graphical Implementation (Java Swing) ;
- Local implementation ;
- REST implementation (servers + clients) ;
- WebSocket implemntation (servers + clients) ;
- Java 8 ; Maven 3.6.3 ; Eclipse 2025-2026 ;
- Comprehensive unit and integration tests (JUnit 5) ;


## Main ideas and implementations

Features:
- Virtual file system with directories and text files
- 14+ Unix-like commands (ls, cd, pwd, cat, echo, touch, mkdir, rm, rmdir, cp, mv, clear, help, exit)
- Minimalist scripting language with variables, conditions, and loops
- Swing-based graphical user interface
- Command history with up/down arrow navigation
- Adding redirections, pipes, better scripting... !

Usage:
1. Compile It !
2. Run It ! (see optios)
3. Type 'help' for available commands
4. Enjoy !
5. Type 'exit' to quit


```
Commands Available:
ls [OPTIONS] [FILE...] - List directory contents
cd [DIR] - Change directory
pwd - Print working directory
cat [FILE...] - Concatenate and print files
echo [STRING...] - Display a line of text
touch [FILE...] - Create empty files
mkdir [DIRECTORY...] - Create directories
rm [FILE...] - Remove files
rmdir [DIRECTORY...] - Remove empty directories
cp SOURCE DEST - Copy files
mv SOURCE DEST - Move or rename files
clear - Clear the terminal screen
help [COMMAND] - Display help information
exit - Exit the terminal

Scripting Language:
# Variables
set var=value
echo $var

# Conditions
if [ "$var" = "value" ]
echo Equal
fi

# File tests
if [ -f "file.txt" ]
echo File exists
fi

# While loops
set count=0
while [ "$count" != "5" ]
echo $count
# Note: Manual incrementation needed in this version
set count=1
done

# For loops
for item in a b c
echo $item
done

Note: The scripting engine is minimal and does not support all Unix shell features.
```

...

## CLI launch options

```
Usage: testideas-terminalemulator [-hV] (-v1 | -v2 | -v3) [-c | -s | -b] [-r |
-w] [--warn | --trace | --none | --debug |
--info | --error]
Application CLI with picocli.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Version Options
-v1, --version1 First Version of Terminal Emulator.
-v2, --version2 Second Version of Terminal Emulator.
-v3, --version3 Third Version of Terminal Emulator.
(Apply on v3 only) Client/Server Options
-b, --both (Apply on v3 only) Server and Client Execution.
-c, --onlyclient (Apply on v3 only) Only Client Execution.
-s, --onlyserver (Apply on v3 only) Only Server Execution.
(Apply on v3 only) REST/WebSocket Options
-r, --rest (Apply on v3 only) Client / Server exchanges on REST
mode.
-w, --websocket (Apply on v3 only) Client / Server exchanges on Web
Socket mode.
Log Level Options
--debug Sets log level to DEBUG.
--error Sets log level to ERROR.
--info Sets log level to INFO.
--none Sets log level to NONE.
--trace Sets log level to NONE.
--warn Sets log level to WARN.

```

## Basic Launcher

```
java -jar testideas-terminalEmulator/target/testideas-terminalEmulator-0.0.1-SNAPSHOT-jar-with-dependencies.jar
```


Loading