aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/test
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2019-08-20 05:57:59 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-20 05:57:59 +0000
commit0621f75503f936d3283b7616a0b7686733cb7051 (patch)
tree8cd9557532f28bf1b3798caee8344d8e25685d94 /framework/src/test
parent1cbd3bfd4a7f676e69ee7b71c21da97c6e3a072b (diff)
parent803d801c8382ede9f3448637e87240822839b0bc (diff)
Merge "add Junit test cases wth cleanup code for OnapCommandExceutionShowCommandTest and OnapCommandExceutionShowDebugCommandTest"
Diffstat (limited to 'framework/src/test')
-rw-r--r--framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowCommandTest.java17
-rw-r--r--framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowDebugCommandTest.java17
2 files changed, 22 insertions, 12 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowCommandTest.java
index 172f7045..5d83374c 100644
--- a/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowCommandTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowCommandTest.java
@@ -14,6 +14,7 @@
* limitations under the License.
*/
package org.onap.cli.fw.cmd.execution;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.cli.fw.error.OnapCommandException;
@@ -21,6 +22,7 @@ import org.onap.cli.fw.error.OnapCommandExecutionFailed;
import org.onap.cli.fw.output.OnapCommandResultAttribute;
import org.onap.cli.fw.store.OnapCommandExecutionStoreTest;
+import java.io.File;
import java.util.List;
import static org.junit.Assert.*;
@@ -30,14 +32,9 @@ public class OnapCommandExceutionShowCommandTest {
public static void setUp() throws Exception {
OnapCommandExecutionStoreTest executionStoreTest= new OnapCommandExecutionStoreTest();
executionStoreTest.setUp();
- executionStoreTest.listExecutionsTest();
- executionStoreTest.storeExectutionDebugTest();
- executionStoreTest.storeExectutionEndTest();
- executionStoreTest.storeExectutionOutputTest();
- executionStoreTest.storeExectutionProgressTest();
executionStoreTest.storeExectutionStartTest();
}
- @Test
+ @Test
public void runTest() throws OnapCommandException {
OnapCommandExceutionShowCommand cmd=new OnapCommandExceutionShowCommand();
cmd.initializeSchema("execution-show.yaml");
@@ -48,4 +45,12 @@ public static void setUp() throws Exception {
.getRecords();
assertTrue(oclipCommandResultAttributes.size() > 1);
}
+
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ String dirPathForExecutions = System.getProperty("user.dir") + File.separator + "data/executions";
+ File executionsDir = new File(dirPathForExecutions);
+ assertTrue(OnapCommandExceutionListCommandTest.deleteDirectory(executionsDir));
+ }
} \ No newline at end of file
diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowDebugCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowDebugCommandTest.java
index e31e53d5..c7aafa1a 100644
--- a/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowDebugCommandTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/cmd/execution/OnapCommandExceutionShowDebugCommandTest.java
@@ -15,11 +15,14 @@
*/
package org.onap.cli.fw.cmd.execution;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.store.OnapCommandExecutionStoreTest;
+import java.io.File;
+
import static org.junit.Assert.*;
public class OnapCommandExceutionShowDebugCommandTest {
@@ -27,14 +30,9 @@ public class OnapCommandExceutionShowDebugCommandTest {
public static void setUp() throws Exception {
OnapCommandExecutionStoreTest executionStoreTest= new OnapCommandExecutionStoreTest();
executionStoreTest.setUp();
- executionStoreTest.listExecutionsTest();
- executionStoreTest.storeExectutionDebugTest();
- executionStoreTest.storeExectutionEndTest();
- executionStoreTest.storeExectutionOutputTest();
- executionStoreTest.storeExectutionProgressTest();
executionStoreTest.storeExectutionStartTest();
}
- @Test
+ @Test
public void runTest() throws OnapCommandException {
OnapCommandExceutionShowDebugCommand cmd=new OnapCommandExceutionShowDebugCommand();
cmd.initializeSchema("execution-show-debug.yaml");
@@ -44,4 +42,11 @@ public class OnapCommandExceutionShowDebugCommandTest {
}
+ @AfterClass
+ public static void tearDown() throws Exception {
+ String dirPathForExecutions = System.getProperty("user.dir") + File.separator + "data/executions";
+ File executionsDir = new File(dirPathForExecutions);
+ assertTrue(OnapCommandExceutionListCommandTest.deleteDirectory(executionsDir));
+ }
+
} \ No newline at end of file