aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-02-05 14:57:43 +0100
committerpwielebs <piotr.wielebski@nokia.com>2018-02-05 16:00:04 +0100
commit00c6ec7d386bd27c7752cf86e4692669e8b850ab (patch)
tree08d4fc8fcce9e5b08a6557723ae227e495d2fc94 /asdctool
parent0875ce0faad191c21b32cc9c95ffc20ebd57d586 (diff)
Correction of unit tests in test class
Change-Id: I4642fd858ea59024df61fe2f118852a8ccbce408 Issue-ID: SDC-1001 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'asdctool')
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java123
1 files changed, 35 insertions, 88 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java
index a84c74d2f5..307d7a0c16 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java
@@ -1,121 +1,68 @@
package org.openecomp.sdc.asdctool.enums;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
+import static org.junit.Assert.*;
-public class SchemaZipFileEnumTest {
- private SchemaZipFileEnum createTestSubject() {
- return SchemaZipFileEnum.DATA;
- }
+public class SchemaZipFileEnumTest {
-
- @Test
- public void testGetFileName() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
+ private SchemaZipFileEnum testSubject;
+ private String result;
- // default test
+ @Before
+ public void setUp() {
testSubject = createTestSubject();
- result = testSubject.getFileName();
}
-
- @Test
- public void testSetFileName() throws Exception {
- SchemaZipFileEnum testSubject;
- String fileName = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setFileName(fileName);
+ @After
+ public void tearDown() {
+ testSubject = null;
+ result = null;
}
-
@Test
- public void testGetSourceFolderName() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getSourceFolderName();
+ public void setGetFileName_shouldSetCustomFileName() {
+ String fileName = "customFileName";
+ testSubject.setFileName(fileName);
+ assertEquals(fileName, testSubject.getFileName());
}
-
@Test
- public void testSetSourceFolderName() throws Exception {
- SchemaZipFileEnum testSubject;
- String sourceFolderName = "";
-
- // default test
- testSubject = createTestSubject();
+ public void setGetSourceFolderName_shouldSetCustomSourceFolderName() {
+ String sourceFolderName = "customSourceFolderName";
testSubject.setSourceFolderName(sourceFolderName);
+ assertEquals(sourceFolderName, testSubject.getSourceFolderName());
}
-
- @Test
- public void testGetSourceFileName() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getSourceFileName();
- }
-
-
@Test
- public void testSetSourceFileName() throws Exception {
- SchemaZipFileEnum testSubject;
- String sourceFileName = "";
-
- // default test
- testSubject = createTestSubject();
+ public void setGetSourceFileName_shouldSetCustomSourceFileName() {
+ String sourceFileName = "customSourceFileName";
testSubject.setSourceFileName(sourceFileName);
+ assertEquals(sourceFileName, testSubject.getSourceFileName());
}
-
- @Test
- public void testGetCollectionTitle() throws Exception {
- SchemaZipFileEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getCollectionTitle();
- }
-
-
@Test
- public void testSetCollectionTitle() throws Exception {
- SchemaZipFileEnum testSubject;
- String collectionTitle = "";
-
- // default test
- testSubject = createTestSubject();
+ public void setGetCollectionTitle_shouldSetCustomCollectionTitle() {
+ String collectionTitle = "customCollectionTitle";
testSubject.setCollectionTitle(collectionTitle);
+ assertEquals(collectionTitle, testSubject.getCollectionTitle());
}
-
@Test
- public void testGetImportFileList() throws Exception {
- SchemaZipFileEnum testSubject;
- String[] result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getImportFileList();
+ public void setGetImportFileList_shouldSetGetFile1File2() {
+ String[] importFileList = new String[] { "File1", "File2" };
+ String[] receivedImportFileList;
+ testSubject.setImportFileList(importFileList);
+ receivedImportFileList = testSubject.getImportFileList();
+ assertNotNull(receivedImportFileList);
+ assertEquals("File1", receivedImportFileList[0]);
+ assertEquals("File2", receivedImportFileList[1]);
}
-
- @Test
- public void testSetImportFileList() throws Exception {
- SchemaZipFileEnum testSubject;
- String[] importFileList = new String[] { "" };
-
- // default test
- testSubject = createTestSubject();
- testSubject.setImportFileList(importFileList);
+ private SchemaZipFileEnum createTestSubject() {
+ return SchemaZipFileEnum.DATA;
}
} \ No newline at end of file