From a8e021a5b4450e117b76d9f6cc69bd24cd1dd5d3 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 10:55:59 +0000 Subject: fixed updateRequired function git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@434 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/webstart/ConfiguratorTest.java | 175 +++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java (limited to 'BKUWebStart/src/test/java') diff --git a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java new file mode 100644 index 00000000..0c08a276 --- /dev/null +++ b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java @@ -0,0 +1,175 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.webstart; + +import java.io.File; +import java.net.URI; +import java.util.zip.ZipOutputStream; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author clemens + */ +public class ConfiguratorTest { + + + public ConfiguratorTest() { + } + + @BeforeClass + public static void setUpClass() throws Exception { + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of ensureConfiguration method, of class Configurator. + */ + @Ignore + @Test + public void testEnsureConfiguration() throws Exception { + System.out.println("ensureConfiguration"); + Configurator instance = new Configurator(); + instance.ensureConfiguration(); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of ensureCertificates method, of class Configurator. + */ + @Ignore + @Test + public void testEnsureCertificates() throws Exception { + System.out.println("ensureCertificates"); + Configurator instance = new Configurator(); + instance.ensureCertificates(); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of isCertRenewed method, of class Configurator. + */ + @Ignore + @Test + public void testIsCertRenewed() { + System.out.println("isCertRenewed"); + Configurator instance = new Configurator(); + boolean expResult = false; + boolean result = instance.isCertRenewed(); + assertEquals(expResult, result); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of readVersion method, of class Configurator. + */ + @Ignore + @Test + public void testReadVersion() { + System.out.println("readVersion"); + File versionFile = null; + String expResult = ""; + String result = Configurator.readVersion(versionFile); + assertEquals(expResult, result); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of updateRequired method, of class Configurator. + */ + @Test + public void testUpdateRequired() { + System.out.println("updateRequired"); + String oldVersion = "1.0.9-SNAPSHOT-r123"; + String minVersion = "1.0.9-SNAPSHOT"; + boolean expResult = false; + boolean result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-SNAPSHOT-r123"; + minVersion = "1.0.9"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-SNAPSHOT-r123"; + minVersion = "1.0.10-SNAPSHOT"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9"; + minVersion = "1.0.9.1-SNAPSHOT"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9"; + minVersion = "1.0.8.99-SNAPSHOT"; + expResult = false; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1"; + minVersion = "2"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + } + + /** + * Test of backupAndDelete method, of class Configurator. + */ + @Ignore + @Test + public void testBackupAndDelete() throws Exception { + System.out.println("backupAndDelete"); + File dir = null; + URI relativeTo = null; + ZipOutputStream zip = null; + Configurator.backupAndDelete(dir, relativeTo, zip); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of initConfig method, of class Configurator. + */ + @Ignore + @Test + public void testInitConfig() throws Exception { + System.out.println("initConfig"); + File configDir = null; + Configurator instance = new Configurator(); + instance.initConfig(configDir); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + +} \ No newline at end of file -- cgit v1.2.3 From e72c9994054446f38c5bc53d7da573e366f57963 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 19 Aug 2009 13:43:02 +0000 Subject: make "include-webstart" profile default (added "local-webstart" for development) updateRequired (versioning) bug fixed AboutDialog Branding (removed MOCCA/Bean) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@444 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/webstart/ConfiguratorTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'BKUWebStart/src/test/java') diff --git a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java index 0c08a276..0ea126cb 100644 --- a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java +++ b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java @@ -118,6 +118,30 @@ public class ConfiguratorTest { result = Configurator.updateRequired(oldVersion, minVersion); assertEquals(expResult, result); + oldVersion = "1.0.9-SNAPSHOT-r123"; + minVersion = "1.0.10-r432"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-r123"; + minVersion = "1.0.10-SNAPSHOT"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-r123"; + minVersion = "1.0.9-SNAPSHOT"; + expResult = false; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-SNAPSHOT"; + minVersion = "1.0.9-r349"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + oldVersion = "1.0.9-SNAPSHOT-r123"; minVersion = "1.0.10-SNAPSHOT"; expResult = true; -- cgit v1.2.3 From bd070e82c276afb8c1c3a9ddc3b5712783760881 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 29 Sep 2009 17:36:06 +0000 Subject: Logging issues fixed: - Added possibility to configure logging of BKUWebstart. Logging is now configured from log4j configuration deployed with BKUWebstart in a first step. In a second step the webstart launcher looks for a log4j configuration file in the user's mooca configuration directory and updates the log4j configuration. - Logging of IAIK PKI properly initialized. IAIK PKI does not mess with the log4j configuration any longer. - Changed log4j accordingly (an appender is now needed as IAIK PKI does not reconfigure log4j any longer). Added css-stylesheet to ErrorResponses issued by the BKU to improve the presentation to the user. Changed dependencies of BKUWebStart (see Issue#469 https://egovlabs.gv.at/tracker/index.php?func=detail&aid=469&group_id=13&atid=134). DataURLConnection now uses the request encoding of SL < 1.2. application/x-www-form-urlencoded is now used as default encoding method. multipart/form-data is used only if transfer parameters are present in the request that require a Content-Type parameter. This can only be set with multipart/form-data. This is not in conformance with SL 1.2, however it should improve compatibility with applications. Therefore, removed the ability to configure the DataURLConnection implementation class. DataURLConnection now uses a streaming implementation for encoding of application/x-www-form-urlencoded requests. XWWWFormUrlImputDecoder now uses a streaming implementation for decoding of application/x-www-form-urlencoded requests. Fixed Bug in SLResultPart that caused a binary response to be provided as parameter "XMLResponse" in a multipart/form-data encoded request to DataURL. SLCommandFactory now supports unmarshalling of SL < 1.2 requests in order issue meaningful error messages. Therefore, the marshaling context for response marshaling had to be separated from the marshaling context for requests in order to avoid the marshaling of SL < 1.2 namespace prefixes in SL 1.2 responses. Target attribute in QualifiedProperties is now marshaled. (see Issue#470 https://egovlabs.gv.at/tracker/index.php?func=detail&aid=470&group_id=13&atid=134) Reporting of XML validation errors improved. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@510 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'BKUWebStart/src/test/java') diff --git a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java index 0ea126cb..4f5798d5 100644 --- a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java +++ b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java @@ -8,8 +8,6 @@ package at.gv.egiz.bku.webstart; import java.io.File; import java.net.URI; import java.util.zip.ZipOutputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; -- cgit v1.2.3