Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved existing PDS tool logic into systemtest #2092
- Added upload definitions - github workflow integration test gradle calls do now set SecHub build stage to "all" which will execute system integration test as well - Moved archive support into systemtest and used this one now in PDS tools - added internal test for illegal states - improved health check - system test document now inside techdoc
- Loading branch information
Showing
40 changed files
with
854 additions
and
201 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
20 changes: 20 additions & 0 deletions
20
...-commons-core/src/main/java/com/mercedesbenz/sechub/commons/core/IgnoreOutputHandler.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,20 @@ | ||
package com.mercedesbenz.sechub.commons.core; | ||
|
||
public class IgnoreOutputHandler implements OutputHandler { | ||
|
||
@Override | ||
public void info(String text) { | ||
|
||
} | ||
|
||
@Override | ||
public void warn(String message) { | ||
|
||
} | ||
|
||
@Override | ||
public void error(String message, Throwable t) { | ||
|
||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
sechub-commons-core/src/main/java/com/mercedesbenz/sechub/commons/core/OutputHandler.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,27 @@ | ||
package com.mercedesbenz.sechub.commons.core; | ||
|
||
/** | ||
* Sometimes it is necessary to switch between different output locations. <br> | ||
* <br> | ||
* An example:<br> | ||
* A library is used from a CLI tool and also from a server application. The CLI | ||
* wants to send the output directly to command line (without using a logging | ||
* framework) but the server application wants to use slf4j logger. The library | ||
* code does use the output handler to separate the logic to the caller side. | ||
* | ||
* @author Albert Tregnaghi | ||
* | ||
*/ | ||
public interface OutputHandler { | ||
|
||
public void info(String message); | ||
|
||
public void warn(String message); | ||
|
||
public default void error(String message) { | ||
error(message, null); | ||
} | ||
|
||
public void error(String message, Throwable t); | ||
|
||
} |
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
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
32 changes: 32 additions & 0 deletions
32
...s-tools/src/main/java/com/mercedesbenz/sechub/pds/tools/handler/ConsoleOutputHandler.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,32 @@ | ||
package com.mercedesbenz.sechub.pds.tools.handler; | ||
|
||
import com.mercedesbenz.sechub.commons.core.OutputHandler; | ||
|
||
public class ConsoleOutputHandler implements OutputHandler { | ||
|
||
private ConsoleHandler consoleHandler; | ||
|
||
public ConsoleOutputHandler(ConsoleHandler consoleHandler) { | ||
this.consoleHandler = consoleHandler; | ||
} | ||
|
||
@Override | ||
public void warn(String message) { | ||
getConsoleHandler().output("WARN:" + message); | ||
} | ||
|
||
@Override | ||
public void info(String message) { | ||
getConsoleHandler().output(message); | ||
|
||
} | ||
|
||
@Override | ||
public void error(String message, Throwable t) { | ||
getConsoleHandler().error(message, t); | ||
} | ||
|
||
private ConsoleHandler getConsoleHandler() { | ||
return consoleHandler; | ||
} | ||
} |
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.