Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 52341 invoked from network); 8 Jul 2002 01:45:02 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Jul 2002 01:45:02 -0000 Received: (qmail 27513 invoked by uid 97); 8 Jul 2002 01:45:18 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 27497 invoked by uid 97); 8 Jul 2002 01:45:18 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 27486 invoked by uid 97); 8 Jul 2002 01:45:17 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 8 Jul 2002 01:44:55 -0000 Message-ID: <20020708014455.2827.qmail@icarus.apache.org> From: dion@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/latka/src/test/org/apache/commons/latka/jelly TestSuiteTag.java TestSessionTag.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dion 2002/07/07 18:44:55 Modified: latka/src/test/org/apache/commons/latka/jelly TestSuiteTag.java TestSessionTag.java Log: Refactored host, proxy etc into Session Revision Changes Path 1.4 +4 -87 jakarta-commons/latka/src/test/org/apache/commons/latka/jelly/TestSuiteTag.java Index: TestSuiteTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/latka/src/test/org/apache/commons/latka/jelly/TestSuiteTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TestSuiteTag.java 6 Jul 2002 14:26:53 -0000 1.3 +++ TestSuiteTag.java 8 Jul 2002 01:44:54 -0000 1.4 @@ -62,7 +62,6 @@ package org.apache.commons.latka.jelly; import junit.framework.TestCase; -import org.apache.commons.latka.http.Proxy; /** * Unit tests for {@link SuiteTag} @@ -92,16 +91,6 @@ } /** - * test host property - */ - public void testHost() { - // host - String host = "dummyHost"; - instance.setHost(host); - assertEquals("host set or get failed", host, instance.getHost()); - } - - /** * test id property */ public void testId() { @@ -121,76 +110,4 @@ assertEquals("label set or get failed", label, instance.getLabel()); } - /** - * test port property - */ - public void testPort() { - // port - String port = "12"; - instance.setPort(port); - assertEquals("port set or get failed", port, instance.getPort()); - } - - /** - * test proxy property - */ - public void testProxy() { - Proxy p = new Proxy(); - instance.setProxy(p); - assertEquals("proxy set or get failed", p, instance.getProxy()); - } - - /** - * test proxyHost property - */ - public void testProxyHost() { - String proxyHost = "dummyHost"; - instance.setProxyHost(proxyHost); - assertEquals("proxyHost set or get failed", proxyHost, - instance.getProxyHost()); - } - - /** - * test proxyPort property - */ - public void testProxyPort() { - int port = 12; - instance.setProxyPort(port); - assertEquals("proxyPort set or get failed", port, - instance.getProxyPort()); - } - - /** - * test isProxyAvailable property - */ - public void testIsProxyAvailable() { - // null should fail - instance.setProxy(null); - assertEquals("proxy wrongly available", false, - instance.isProxyAvailable()); - testProxy(); - assertEquals("proxy with no host or port passed", false, - instance.isProxyAvailable()); - instance.getProxy().setHost("dummyHost"); - assertEquals("proxy with no port passed", false, - instance.isProxyAvailable()); - instance.getProxy().setHost(null); - instance.getProxy().setPort(12); - assertEquals("proxy with no host passed", false, - instance.isProxyAvailable()); - instance.getProxy().setHost("dummyHost"); - assertTrue("host and port on proxy failed", - instance.isProxyAvailable()); - } - - /** - * test secure property - */ - public void testSecure() { - // default is false - assertEquals("default of secure is not false", false, - instance.isSecure()); - instance.setSecure(true); - assertTrue("secure get or set failed", instance.isSecure()); - } } 1.3 +87 -3 jakarta-commons/latka/src/test/org/apache/commons/latka/jelly/TestSessionTag.java Index: TestSessionTag.java =================================================================== RCS file: /home/cvs/jakarta-commons/latka/src/test/org/apache/commons/latka/jelly/TestSessionTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestSessionTag.java 6 Jul 2002 13:08:59 -0000 1.2 +++ TestSessionTag.java 8 Jul 2002 01:44:54 -0000 1.3 @@ -62,6 +62,7 @@ package org.apache.commons.latka.jelly; import junit.framework.TestCase; +import org.apache.commons.latka.http.Proxy; /** * Unit tests for the {@link SessionTag} @@ -103,4 +104,87 @@ assertNull("http client is not null", instance.getHttpClient()); } + /** + * test host property + */ + public void testHost() { + // host + String host = "dummyHost"; + instance.setHost(host); + assertEquals("host set or get failed", host, instance.getHost()); + } + + /** + * test port property + */ + public void testPort() { + // port + String port = "12"; + instance.setPort(port); + assertEquals("port set or get failed", port, instance.getPort()); + } + + /** + * test proxy property + */ + public void testProxy() { + Proxy p = new Proxy(); + instance.setProxy(p); + assertEquals("proxy set or get failed", p, instance.getProxy()); + } + + /** + * test proxyHost property + */ + public void testProxyHost() { + String proxyHost = "dummyHost"; + instance.setProxyHost(proxyHost); + assertEquals("proxyHost set or get failed", proxyHost, + instance.getProxyHost()); + } + + /** + * test proxyPort property + */ + public void testProxyPort() { + int port = 12; + instance.setProxyPort(port); + assertEquals("proxyPort set or get failed", port, + instance.getProxyPort()); + } + + /** + * test isProxyAvailable property + */ + public void testIsProxyAvailable() { + // null should fail + instance.setProxy(null); + assertEquals("proxy wrongly available", false, + instance.isProxyAvailable()); + testProxy(); + assertEquals("proxy with no host or port passed", false, + instance.isProxyAvailable()); + instance.getProxy().setHost("dummyHost"); + assertEquals("proxy with no port passed", false, + instance.isProxyAvailable()); + instance.getProxy().setHost(null); + instance.getProxy().setPort(12); + assertEquals("proxy with no host passed", false, + instance.isProxyAvailable()); + instance.getProxy().setHost("dummyHost"); + assertTrue("host and port on proxy failed", + instance.isProxyAvailable()); + } + + /** + * test secure property + */ + public void testSecure() { + // default is false + assertEquals("default of secure is not false", false, + instance.isSecure()); + instance.setSecure(true); + assertTrue("secure get or set failed", instance.isSecure()); + } + } -- To unsubscribe, e-mail: For additional commands, e-mail: