summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-08-19 07:17:48 +0200
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-08-19 07:34:44 +0200
commite937fd80bf7b33e1dc900dd0ecce6dfcddaacf7d (patch)
treefef8cd7e20ba65729bdd889022055d6edcf36d7f
parent6750f9e73f44e7fc6854d570142e6d30f5d3cd24 (diff)
Removing jmockit dependencies.
Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> Change-Id: Idbd406f3cbfb943452870a394e2a8b7bcdc7509b Issue-ID: VNFSDK-631
-rw-r--r--csarvalidation/pom.xml8
-rw-r--r--csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java85
2 files changed, 2 insertions, 91 deletions
diff --git a/csarvalidation/pom.xml b/csarvalidation/pom.xml
index 3dbbf9e..410d92b 100644
--- a/csarvalidation/pom.xml
+++ b/csarvalidation/pom.xml
@@ -67,12 +67,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jmockit</groupId>
- <artifactId>jmockit</artifactId>
- <version>1.19</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.2.1</version>
@@ -192,7 +186,7 @@
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
- <excludeArtifactIds>junit,jmockit</excludeArtifactIds>
+ <excludeArtifactIds>junit</excludeArtifactIds>
</configuration>
</execution>
</executions>
diff --git a/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java b/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
index 395b866..2fe3640 100644
--- a/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
+++ b/csarvalidation/src/test/java/org/onap/validation/csarvalidationtest/CsarValidatorTest.java
@@ -34,15 +34,7 @@ import org.junit.Test;
import org.onap.validation.csar.CommonConstants;
import org.onap.validation.csar.CsarValidator;
import org.onap.validation.csar.FileUtil;
-import org.onap.validation.csar.ValidationException;
-import org.junit.runner.RunWith;
-import mockit.integration.junit4.JMockit;
-import mockit.Expectations;
-import mockit.Mocked;
-import mockit.Mock;
-import mockit.MockUp;
-
-@RunWith(JMockit.class)
+
public class CsarValidatorTest {
String regex = "^\\/[a-zA-Z]\\:\\/";
@@ -169,18 +161,6 @@ public class CsarValidatorTest {
assertTrue(true);
}
- @Test(expected = ValidationException.class)
- public void testCloseInputStream2( @Mocked InputStream inputStream) throws IOException {
- new Expectations(){
- {
- inputStream.close();
- result = new IOException();
- }
- };
- FileUtil.closeInputStream(inputStream);
- assertTrue(true);
- }
-
@Test
public void testCloseZipFile() throws ZipException, IOException {
File file = new File(sample1);
@@ -197,17 +177,6 @@ public class CsarValidatorTest {
}
- @Test(expected = ValidationException.class)
- public void testCloseFileStream2(@Mocked FileInputStream fileInputStream) throws IOException {
- new Expectations(){
- {
- fileInputStream.close();
- result = new IOException();
- }
- };
- FileUtil.closeFileStream(fileInputStream);
- }
-
@Test
public void testCloseOutptutStream() {
OutputStream dir4 = new OutputStream() {
@@ -221,17 +190,6 @@ public class CsarValidatorTest {
assertTrue(true);
}
- @Test(expected = ValidationException.class)
- public void testCloseOutptutStream2(@Mocked OutputStream outputStream) throws IOException {
- new Expectations(){
- {
- outputStream.close();
- result = new IOException();
- }
- };
- FileUtil.closeOutputStream(outputStream);
- }
-
private void testValidateCsarMeta(CsarValidator cv) {
String result = CsarValidator.validateCsarMeta();
assertEquals(true, result == CommonConstants.SUCCESS_STR);
@@ -265,47 +223,6 @@ public class CsarValidatorTest {
}
@Test
- public void testValidateCsar() throws IOException {
- new MockUp<CsarValidator>(){
- @Mock
- public String validateCsarMeta(){
- return "FAIL";
- }
- @Mock
- public String validateAndScanToscaMeta(){
- return "SUCCESS";
- }
- @Mock
- public String validateMainService(){
- return "FAIL";
- }
- };
- String res=CsarValidator.validateCsar();
- assertEquals("FAIL OR FAIL",res);
-
- }
-
- @Test
- public void testValidateCsar2() throws IOException {
- new MockUp<CsarValidator>(){
- @Mock
- public String validateCsarMeta(){
- return "SUCCESS";
- }
- @Mock
- public String validateAndScanToscaMeta(){
- return "FAIL";
- }
- @Mock
- public String validateMainService(){
- return "SUCCESS";
- }
- };
- String res=CsarValidator.validateCsar();
- assertEquals("FAIL",res);
- }
-
- @Test
public void testDeleteDir(){
String dstPath = "./dstPathForTest1";
File dst = new File(dstPath);