commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/test/org/apache/commons/latka/jelly TestSuiteTag.java TestSessionTag.java
Date Mon, 08 Jul 2002 01:44:55 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message