Skip to content

Commit

Permalink
packageInfo reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGroscheTT committed Aug 20, 2020
1 parent e233d7c commit 221c514
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 63 deletions.
Expand Up @@ -237,9 +237,9 @@ private Map<String, String> getGlobalConstantMap() {
}

/**
* Helper class storing project information about the test result and the test report directory.
* Helper class storing information about the test result and the test report directory.
*/
protected static final class TestProjectInfoHolder implements Serializable {
protected static class TestInfoHolder implements Serializable {

private static final long serialVersionUID = 1L;

Expand All @@ -248,13 +248,13 @@ protected static final class TestProjectInfoHolder implements Serializable {
private final boolean isAborted;

/**
* Instantiates a new {@link TestProjectInfoHolder}.
* Instantiates a new {@link TestInfoHolder}.
*
* @param testResult the test result
* @param testReportDir the test report directory
* @param isAborted specifies whether test execution is aborted
*/
public TestProjectInfoHolder(final String testResult, final String testReportDir, final boolean isAborted) {
public TestInfoHolder(final String testResult, final String testReportDir, final boolean isAborted) {
this.testResult = testResult;
this.testReportDir = testReportDir;
this.isAborted = isAborted;
Expand All @@ -273,51 +273,6 @@ public boolean isAborted() {
}
}

/**
* Helper class storing package information about the test result and the test report directory.
*/
protected static final class TestPackageInfoHolder implements Serializable {

private static final long serialVersionUID = 1L;

private final String testResult;
private final String testReportDir;
private final boolean isAborted;
private final Map<String, String> outputParameters;

/**
* Instantiates a new {@link TestPackageInfoHolder}.
*
* @param testResult the test result
* @param testReportDir the test report directory
* @param isAborted specifies whether test execution is aborted
* @param outputParameters the output parameter map
*/
public TestPackageInfoHolder(final String testResult, final String testReportDir, final boolean isAborted,
final Map<String, String> outputParameters) {
this.testResult = testResult;
this.testReportDir = testReportDir;
this.isAborted = isAborted;
this.outputParameters = outputParameters;
}

public String getTestResult() {
return testResult;
}

public String getTestReportDir() {
return testReportDir;
}

public boolean isAborted() {
return isAborted;
}

public Map<String, String> getOutputParameters() {
return outputParameters;
}
}

/**
* Helper class storing information about the errors returned by checking packages and projects.
*/
Expand Down
Expand Up @@ -448,4 +448,32 @@ public String getTestDescription() {
return testDescription;
}
}

/**
* Helper class storing package information about the test result and the test report directory.
*/
protected static final class TestPackageInfoHolder extends TestInfoHolder implements Serializable {

private static final long serialVersionUID = 1L;

private final Map<String, String> outputParameters;

/**
* Instantiates a new {@link TestPackageInfoHolder}.
*
* @param testResult the test result
* @param testReportDir the test report directory
* @param isAborted specifies whether test execution is aborted
* @param outputParameters the output parameter map
*/
public TestPackageInfoHolder(final String testResult, final String testReportDir, final boolean isAborted,
final Map<String, String> outputParameters) {
super(testResult, testReportDir, isAborted);
this.outputParameters = outputParameters;
}

public Map<String, String> getOutputParameters() {
return outputParameters;
}
}
}
Expand Up @@ -83,7 +83,7 @@ public boolean runTestCase(final FilePath workspace, final Launcher launcher, fi

try {
// Run project
final TestProjectInfoHolder testInfo = launcher.getChannel().call(
final TestInfoHolder testInfo = launcher.getChannel().call(
new RunProjectCallable(getTestFile(), getProjectConfig(), getExecutionConfig(), listener));

// Set project information
Expand Down Expand Up @@ -180,7 +180,7 @@ public Boolean call() throws IOException {
/**
* {@link Callable} providing remote access to run a project via COM.
*/
private static final class RunProjectCallable extends MasterToSlaveCallable<TestProjectInfoHolder, IOException> {
private static final class RunProjectCallable extends MasterToSlaveCallable<TestInfoHolder, IOException> {

private static final long serialVersionUID = 1L;

Expand All @@ -206,10 +206,10 @@ private static final class RunProjectCallable extends MasterToSlaveCallable<Test
}

@Override
public TestProjectInfoHolder call() throws IOException {
public TestInfoHolder call() throws IOException {
final int jobExecutionMode = projectConfig.getJobExecMode().getValue();
final int timeout = executionConfig.getParsedTimeout();
TestProjectInfoHolder testInfo = null;
TestInfoHolder testInfo = null;
final TTConsoleLogger logger = new TTConsoleLogger(listener);
logger.logInfo("- Running project...");
final String progId = ETComProperty.getInstance().getProgId();
Expand Down Expand Up @@ -252,9 +252,9 @@ public TestProjectInfoHolder call() throws IOException {
* @param logger the logger
* @return the test information
*/
private TestProjectInfoHolder abortTestExecution(final int timeout, final String progId,
final TTConsoleLogger logger) {
TestProjectInfoHolder testInfo = null;
private TestInfoHolder abortTestExecution(final int timeout, final String progId,
final TTConsoleLogger logger) {
TestInfoHolder testInfo = null;
try (ETComClient comClient = new ETComClient(progId);
TestEnvironment testEnv = (TestEnvironment) comClient.getTestEnvironment();
TestExecutionInfo execInfo = (TestExecutionInfo) testEnv.getTestExecutionInfo()) {
Expand All @@ -277,14 +277,14 @@ private TestProjectInfoHolder abortTestExecution(final int timeout, final String
* @return the test information
* @throws ETComException in case of a COM exception
*/
private TestProjectInfoHolder getTestInfo(final TestExecutionInfo execInfo, final boolean isAborted,
final TTConsoleLogger logger) throws ETComException {
private TestInfoHolder getTestInfo(final TestExecutionInfo execInfo, final boolean isAborted,
final TTConsoleLogger logger) throws ETComException {
final String testResult = execInfo.getResult();
logger.logInfo(String.format("-> Project execution %s with result: %s",
isAborted ? "aborted" : "completed", testResult));
final String testReportDir = new File(execInfo.getReportDb()).getParentFile().getAbsolutePath();
logger.logInfo(String.format("-> Test report directory: %s", testReportDir));
return new TestProjectInfoHolder(testResult, testReportDir, isAborted);
return new TestInfoHolder(testResult, testReportDir, isAborted);
}

/**
Expand Down
Expand Up @@ -5,8 +5,8 @@
#
outputParameters.add=Add Output Parameter
outputParameters.advanced=Package Output Parameter
outputParameters.description=The configured package output parameter are available after the test execution has \
finished successfully.
outputParameters.description=The configured output parameters refer to package return values of the same name and\
are available after the test execution has finished successfully.
outputParameters.title=Package Output Parameter
packageSection.title=Package Settings
parameters.add=Add Parameter
Expand Down
Expand Up @@ -5,8 +5,8 @@
#
outputParameters.add=Output Parameter hinzuf\u00FCgen
outputParameters.advanced=Package Output Parameter
outputParameters.description=Die konfigurierten Package-R\u00FCckgabe-Parameter stehen nach erfolgreicher \
Testausf\u00FChrung als Variablen zur Verf\u00FCgung.
outputParameters.description=Die konfigurierten R\u00FCckgabe-Parameter beziehen sich auf gleichnamige\
Package-Ausgabe-Parameter und stehen nach erfolgreicher Testausf\u00FChrung als Variablen zur Verf\u00FCgung.
outputParameters.title=Package Output Parameter
packageSection.title=Package-Einstellungen
parameters.add=Parameter hinzuf\u00FCgen
Expand Down

0 comments on commit 221c514

Please sign in to comment.