@@ -22,16 +22,16 @@ public class WLSDeployArchiveTest {
22
22
private static final String APPS_ARCHIVE_FILE_NAME = "target/unit-tests/appsArchive.zip" ;
23
23
private static final String APP1_TO_ADD = "src/test/resources/my-app.war" ;
24
24
private static final String APP2_TO_ADD = "src/test/resources/my-other-app.war" ;
25
- private static final String APP_DIR_TO_ADD = "src/test/resources/my-app/" ;
26
25
private static final String APP1_ENTRY_NAME1 = "wlsdeploy/applications/my-app.war" ;
27
26
private static final String APP1_ENTRY_NAME2 = "wlsdeploy/applications/my-app(1).war" ;
28
27
private static final String APP1_ENTRY_NAME3 = "wlsdeploy/applications/my-app(2).war" ;
29
28
private static final String APP1_ENTRY_NAME4 = "wlsdeploy/applications/my-app(3).war" ;
30
29
private static final String APP2_ENTRY_NAME1 = "wlsdeploy/applications/my-other-app.war" ;
31
30
private static final String APP2_ENTRY_NAME2 = "wlsdeploy/applications/my-other-app(1).war" ;
32
31
private static final String APP2_ENTRY_NAME3 = "wlsdeploy/applications/my-other-app(2).war" ;
33
- private static final String INVALID_ENTRY_NAME = "wlsdeploy/applications/does-not-exist.war " ;
32
+ private static final String APP_DIR_TO_ADD = "src/test/resources/my-app/ " ;
34
33
private static final String APP_DIR_ENTRY_NAME = "wlsdeploy/applications/my-app/" ;
34
+ private static final String INVALID_APP_ENTRY_NAME = "wlsdeploy/applications/does-not-exist.war" ;
35
35
36
36
private static final String ZIP_FILE_EXISTING_EMPTY_FILE = "my-empty-zip.zip" ;
37
37
private static final String ZIP_FILE_EXISTING_BINARIES_FILE = "DiscoveredDemoDomain.zip" ;
@@ -103,17 +103,23 @@ public void testAddDirectory() throws Exception {
103
103
public void testIsAFile () throws Exception {
104
104
WLSDeployArchive archive = new WLSDeployArchive (APPS_ARCHIVE_FILE_NAME );
105
105
archive .addApplication (new File (APP1_TO_ADD ));
106
- archive .addApplication (new File (APP_DIR_TO_ADD ));
107
106
Assert .assertTrue ("File not found in archive: " + APP1_ENTRY_NAME1 , archive .containsFile (APP1_ENTRY_NAME1 ));
108
- //Assert.assertTrue("Path not found in archive: " + APP_DIR_ENTRY_NAME, archive.containsPath(APP_DIR_ENTRY_NAME));
109
107
Assert .assertTrue ("File not found in archive: " + APP1_ENTRY_NAME1 , archive .containsFileOrPath (APP1_ENTRY_NAME1 ));
110
- Assert .assertTrue ("Path not found in archive: " + APP_DIR_ENTRY_NAME , archive .containsFileOrPath (APP_DIR_ENTRY_NAME ));
111
108
Assert .assertFalse ("Is not a File" , archive .containsFile (APP_DIR_ENTRY_NAME ));
112
- Assert .assertFalse ("Is not a Path" , archive .containsPath (APP1_ENTRY_NAME1 ));
113
- Assert .assertFalse ("File should not exist" , archive .containsFileOrPath (INVALID_ENTRY_NAME ));
109
+ Assert .assertFalse ("File should not exist" , archive .containsFileOrPath (INVALID_APP_ENTRY_NAME ));
114
110
archive .close ();
115
111
}
116
112
113
+ @ Test
114
+ public void testIsAPath () throws Exception {
115
+ WLSDeployArchive archive = new WLSDeployArchive (APPS_ARCHIVE_FILE_NAME );
116
+ archive .addApplication (new File (APP_DIR_TO_ADD ));
117
+ Assert .assertTrue ("Path not found in archive: " + APP_DIR_ENTRY_NAME , archive .containsPath (APP_DIR_ENTRY_NAME ));
118
+ Assert .assertTrue ("Path not found in archive: " + APP_DIR_ENTRY_NAME ,
119
+ archive .containsFileOrPath (APP_DIR_ENTRY_NAME ));
120
+ Assert .assertFalse ("Is not a Path" , archive .containsPath (APP1_ENTRY_NAME1 ));
121
+ }
122
+
117
123
@ Test
118
124
public void testClearAllBinariesWithEmptyZip () throws Exception {
119
125
WLSDeployZipFileTest .copyFile (ZIP_FILE_EXISTING_BINARIES_FILE );
0 commit comments