Skip to content

Commit

Permalink
VS Code extension update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMartin committed Aug 12, 2024
1 parent 4a3f265 commit 9ea4e16
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 22 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

This **Black Box Testing** Tool is designed for automating the testing of **network application** or **console applications**. It tests how applications **interact with their environment** and does not test the internal behavior of the application. It offers several key features:

- **Universality**: The tool supports testing various types of software applications regardless of their implementation details.
- **Separation**: Emphasizes the separation of the evaluation application and its internal logic from the tested tasks.
- **Independence**: The tool operates independently of external network resources (servers, clients, ...), allowing it to create virtual servers and clients for testing purposes.
- **Flexibility**: Users can easily define new test sets using specific keywords in the configuration.
- **Deployment Versatility:** The tool can be run on localhost or integrated into CI/CD pipelines on platforms like GitLab and GitHub, ensuring seamless testing across different environments.
- **🌐 Universality**: The tool supports testing various types of software applications regardless of their implementation details.
- **🔍 Separation**: Emphasizes the separation of the evaluation application and its internal logic from the tested tasks.
- **🔌 Independence**: The tool operates independently of external network resources (servers, clients, ...), allowing it to create virtual servers and clients for testing purposes.
- **🛠️ Flexibility**: Users can easily define new test sets using specific keywords in the configuration.
- **📦 Deployment Versatility:** The tool can be run on localhost or integrated into CI/CD pipelines on platforms like GitLab and GitHub, ensuring seamless testing across different environments.
- **Plugin Support:** The tool supports the creation of custom plugins, allowing users to define their own keywords, communication modules or more for enhanced functionality. Tutorial is available [here](./examples/plugin-example).

<img src="./doc/diagram_simple_rest.png">
Expand Down
Binary file modified examples/project-example/NATT.jar
Binary file not shown.
Binary file modified natt-config-editor/NATT.jar
Binary file not shown.
1 change: 1 addition & 0 deletions natt-vscode-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NATT was created as part of a thesis at TBU FAI. It is a black box testing tool
- **🔍 Separation:** Emphasizes the separation of the evaluation application and its internal logic from the tested tasks.
- **🔌 Independence:** Operates independently of external network resources, allowing it to create virtual servers and clients for testing purposes.
- **🛠️ Flexibility:** Users can easily define new test sets using specific keywords in the configuration.
- **📦 Plugin Support:** The tool supports the creation of custom plugins, allowing users to define their own keywords, communication modules or more for enhanced functionality. Tutorial is available [here](https://github.com/0xMartin/NetworkAppTestingTool/tree/main/examples/plugin-example).

### 🔍 What Does the Tool Allow You to Test?

Expand Down
4 changes: 3 additions & 1 deletion natt-vscode-extension/out/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion natt-vscode-extension/out/extension.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions natt-vscode-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions natt-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"publisher": "0xM4R71N",
"repository": "https://github.com/0xMartin/NetworkAppTestingTool",
"description": "Test scenario configuration editor for black box network application testing tool.",
"version": "1.2.1",
"version": "1.2.3",
"engines": {
"vscode": "^1.91.1"
},
Expand Down Expand Up @@ -90,7 +90,7 @@
"properties": {
"yourExtension.nattJarUrl": {
"type": "string",
"default": "https://github.com/0xMartin/NetworkAppTestingTool/releases/download/1.6.1/NATT.jar",
"default": "https://github.com/0xMartin/NetworkAppTestingTool/releases/download/1.6.2/NATT.jar",
"description": "URL for the NATT JAR file"
}
}
Expand Down
5 changes: 4 additions & 1 deletion natt-vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function activate(context: vscode.ExtensionContext) {
}
// Define the URL and destination path for the JAR file
const config = vscode.workspace.getConfiguration('natt-configuration-editor');
const jarUrl = config.get<string>('nattJarUrl', 'https://github.com/0xMartin/NetworkAppTestingTool/releases/download/1.6.1/NATT.jar');
const jarUrl = config.get<string>('nattJarUrl', 'https://github.com/0xMartin/NetworkAppTestingTool/releases/download/1.6.2/NATT.jar');
const destJarPath = path.join(projectPath, 'NATT.jar');

// Function to download the file
Expand Down Expand Up @@ -209,6 +209,9 @@ export function activate(context: vscode.ExtensionContext) {
progress.report({ message: "Download complete!" });
});

// reload keywords
registerKeywordSnippets(context, homeWebviewProvider);

vscode.window.showInformationMessage('NATT.jar downloaded successfully. Setup complete!');
} catch (error) {
vscode.window.showErrorMessage(`Failed to download NATT.jar: ${error}`);
Expand Down
2 changes: 1 addition & 1 deletion natt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ task writeVersionProperties {

processResources.dependsOn writeVersionProperties

version = '1.6.1'
version = '1.6.2'
group = 'utb.fai.natt'
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
/**
* Umoznuje spustit externi testovanou aplikaci
*/
@NATTAnnotation.Keyword(
name = "run_app_later",
description = "Launches the application with a time delay. This operation is asynchronous. Again, only one external application can run at a time.",
parameters = {"command", "delay", "name"},
types = {ParamValType.STRING, ParamValType.LONG, ParamValType.STRING},
kwGroup = "NATT AppControll"
)
@NATTAnnotation.Keyword(name = "run_app_later", description = "Launches the application with a time delay. This operation is asynchronous. Again, only one external application can run at a time.", parameters = {
"command", "delay",
"name" }, types = { ParamValType.STRING, ParamValType.LONG, ParamValType.STRING }, kwGroup = "NATT AppControll")
public class RunAppLaterKw extends NATTKeyword {

private NATTLogger logger = new NATTLogger(RunAppLaterKw.class);
Expand All @@ -43,14 +39,15 @@ public boolean execute(INATTContext ctx)
throw new InternalErrorException("Delay must be higher than 0 ms!");
}

ExternalProgramRunner runner = new ExternalProgramRunner(
this.moduleName == null ? "default" : this.moduleName, this.command);

Thread thread = new Thread(() -> {
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
}
try {
ExternalProgramRunner runner = new ExternalProgramRunner(
this.moduleName == null ? "default" : this.moduleName, this.command);
runner.runModule();
} catch (Exception e) {
logger.warning("Failed to run application later: " + e.getMessage());
Expand Down

0 comments on commit 9ea4e16

Please sign in to comment.