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
Date Sun, 30 Jun 2002 10:39:44 GMT
dion        2002/06/30 03:39:44

  Modified:    latka/src/test/org/apache/commons/latka/jelly
                        TestSuiteTag.java
  Log:
  More tests for Suite Tag
  
  Revision  Changes    Path
  1.2       +88 -5     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestSuiteTag.java	30 Jun 2002 10:01:46 -0000	1.1
  +++ TestSuiteTag.java	30 Jun 2002 10:39:43 -0000	1.2
  @@ -62,6 +62,7 @@
   package org.apache.commons.latka.jelly;
   
   import junit.framework.TestCase;
  +import org.apache.commons.latka.http.Proxy;
   
   /**
    * Unit tests for {@link SuiteTag}
  @@ -91,12 +92,94 @@
       }
   
       /**
  -     * test properties of the tag
  +     * test host property
        */
  -    public void testProperties() {
  +    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() {
  +        // id
  +        String id = "dummyId";
  +        instance.setId(id);
  +        assertEquals("id set or get failed", id, instance.getId());
  +    }
  +    
  +    /**
  +     * test label property
  +     */
  +    public void testLabel() {
  +        // label
  +        String label = "dummyLabel";
  +        instance.setLabel(label);
  +        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());
       }
   }
  
  
  

--
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