modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinMsiBundlerTest.java

Print this page
rev 6889 : RT-36724 - JavaFX Packager Renaming
Summary: Move java code around to new packages.

@@ -21,18 +21,17 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
-package com.oracle.bundlers.windows;

+package com.oracle.tools.packager.windows;

 
-import com.oracle.bundlers.Bundler;

-import com.sun.javafx.tools.packager.Log;

-import com.sun.javafx.tools.packager.bundlers.ConfigException;

-import com.sun.javafx.tools.packager.bundlers.RelativeFileSet;

-import com.sun.javafx.tools.packager.bundlers.UnsupportedPlatformException;

-import com.sun.javafx.tools.packager.bundlers.WinMsiBundler;

+import com.oracle.tools.packager.Bundler;

+import com.oracle.tools.packager.Log;

+import com.oracle.tools.packager.ConfigException;

+import com.oracle.tools.packager.RelativeFileSet;

+import com.oracle.tools.packager.UnsupportedPlatformException;

 import org.junit.After;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;

@@ -40,16 +39,14 @@
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.util.*;
 
-import static com.oracle.bundlers.StandardBundlerParam.*;

-import static org.junit.Assert.assertNotNull;

-import static org.junit.Assert.assertNull;

-import static org.junit.Assert.assertTrue;

+import static com.oracle.tools.packager.StandardBundlerParam.*;

+import static org.junit.Assert.*;

 
-public class WinMSIBundlerTest {

+public class WinMsiBundlerTest {

 
     static File tmpBase;
     static File workDir;
     static File appResourcesDir;
     static File fakeMainJar;

@@ -252,7 +249,22 @@
 
         File output = bundler.execute(bundleParams, new File(workDir, "NullCandle"));
         assertNull(output);
     }
 
+    @Test

+    public void testValidateVersion() {

+        String validVersions[] = {null, "1", "255", "1.0", "255.255.0", "255.255.6000"};

+        String invalidVersions[] = {"alpha", "1.0-alpha", "10.300", "300", "10.10.100000"};

+

+        for(String v: validVersions) {

+            assertTrue("Expect to be valid ["+v+"]",

+                    com.oracle.tools.packager.windows.WinMsiBundler.isVersionStringValid(v));

+        }

+

+        for(String v: invalidVersions) {

+            assertFalse("Expect to be invalid ["+v+"]",

+                    com.oracle.tools.packager.windows.WinMsiBundler.isVersionStringValid(v));

+        }

+    }

 
 }