commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab GlobalAttribute.java GlobalAttributeOption.java TestScarabSettings.java scarab-settings.xml
Date Sat, 01 Jun 2002 18:47:00 GMT
jon         2002/06/01 11:47:00

  Modified:    betwixt/src/test/org/apache/commons/betwixt/scarab
                        GlobalAttribute.java GlobalAttributeOption.java
                        TestScarabSettings.java scarab-settings.xml
  Log:
  attempting to define more than one globalAttributeOption...this code is NOT
  working. i'm hoping jason can help me figure out the problem.
  
  -jon
  
  Revision  Changes    Path
  1.3       +8 -7      jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/GlobalAttribute.java
  
  Index: GlobalAttribute.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/GlobalAttribute.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GlobalAttribute.java	1 Jun 2002 18:28:06 -0000	1.2
  +++ GlobalAttribute.java	1 Jun 2002 18:46:59 -0000	1.3
  @@ -72,7 +72,7 @@
    * <p><code>GlobalAttribute</code> is a sample bean for use by the test
cases.</p>
    *
    * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
  - * @version $Id: GlobalAttribute.java,v 1.2 2002/06/01 18:28:06 jon Exp $
  + * @version $Id: GlobalAttribute.java,v 1.3 2002/06/01 18:46:59 jon Exp $
    */
   public class GlobalAttribute implements Serializable
   {
  @@ -82,7 +82,7 @@
        */
       private final static Log log = LogFactory.getLog(GlobalAttribute.class);
   
  -    private GlobalAttributeOption globalAttributeOption;
  +    private List globalAttributeOptions;
       
       private String name;
       
  @@ -90,17 +90,18 @@
        * Constructor for the ScarabSettings object
        */
       public GlobalAttribute() 
  -    { 
  +    {
  +        globalAttributeOptions = new ArrayList();
       }
   
  -    public void setGlobalAttributeOption(GlobalAttributeOption globalAttributeOption)
  +    public void addGlobalAttributeOption(GlobalAttributeOption globalAttributeOption)
       {
  -        this.globalAttributeOption = globalAttributeOption;
  +        globalAttributeOptions.add(globalAttributeOption);
       }        
   
  -    public GlobalAttributeOption getGlobalAttributeOption()
  +    public List getGlobalAttributeOptions()
       {
  -        return globalAttributeOption;
  +        return globalAttributeOptions;
       }        
   
       public void setName(String name)
  
  
  
  1.3       +23 -1     jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/GlobalAttributeOption.java
  
  Index: GlobalAttributeOption.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/GlobalAttributeOption.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GlobalAttributeOption.java	1 Jun 2002 18:28:06 -0000	1.2
  +++ GlobalAttributeOption.java	1 Jun 2002 18:46:59 -0000	1.3
  @@ -73,11 +73,13 @@
    * <p><code>GlobalAttributeOption</code> is a sample bean for use by
the test cases.</p>
    *
    * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
  - * @version $Id: GlobalAttributeOption.java,v 1.2 2002/06/01 18:28:06 jon Exp $
  + * @version $Id: GlobalAttributeOption.java,v 1.3 2002/06/01 18:46:59 jon Exp $
    */
   public class GlobalAttributeOption implements Serializable
   {
       private String name;
  +    private String preferredOrder;
  +    private String childOption;
   
       /**
        * Constructor for the ScarabSettings object
  @@ -95,4 +97,24 @@
       {
           return name;
       }        
  +
  +    public void setChildOption(String name)
  +    {
  +        this.childOption = name;
  +    }
  +    
  +    public String getChildOption()
  +    {
  +        return childOption;
  +    }        
  +
  +    public String getPreferredOrder()
  +    {
  +        return preferredOrder;
  +    }
  +
  +    public void setPreferredOrder(String value)
  +    {
  +        this.preferredOrder = value;
  +    }
   }
  
  
  
  1.5       +8 -1      jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/TestScarabSettings.java
  
  Index: TestScarabSettings.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/TestScarabSettings.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestScarabSettings.java	1 Jun 2002 18:28:06 -0000	1.4
  +++ TestScarabSettings.java	1 Jun 2002 18:46:59 -0000	1.5
  @@ -81,7 +81,7 @@
    * Test harness which round trips a Scarab's settings xml file
    *
    * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
  - * @version $Id: TestScarabSettings.java,v 1.4 2002/06/01 18:28:06 jon Exp $
  + * @version $Id: TestScarabSettings.java,v 1.5 2002/06/01 18:46:59 jon Exp $
    */
   public class TestScarabSettings extends AbstractTestCase
   {
  @@ -189,6 +189,13 @@
           List globalAttributes = ss.getGlobalAttributes();
           GlobalAttribute ga = (GlobalAttribute) globalAttributes.get(0);
           assertEquals("Description", ga.getName());
  +
  +        List globalAttributeOptions = ga.getGlobalAttributeOptions();
  +        assertEquals(globalAttributeOptions.size(), 2);
  +        GlobalAttributeOption gao = (GlobalAttributeOption) globalAttributeOptions.get(0);
  +        assertEquals("UI", gao.getChildOption());        
  +        gao = (GlobalAttributeOption) globalAttributeOptions.get(1);
  +        assertEquals("Code", gao.getChildOption());        
   
           List globalIssueTypes = ss.getGlobalIssueTypes();
           GlobalIssueType git = (GlobalIssueType) globalIssueTypes.get(0);
  
  
  
  1.6       +7 -0      jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/scarab-settings.xml
  
  Index: scarab-settings.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/test/org/apache/commons/betwixt/scarab/scarab-settings.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- scarab-settings.xml	1 Jun 2002 02:26:48 -0000	1.5
  +++ scarab-settings.xml	1 Jun 2002 18:46:59 -0000	1.6
  @@ -32,6 +32,13 @@
           <weight>1</weight>
           <preferred-order>1</preferred-order>
         </global-attribute-option>
  +      <global-attribute-option>
  +        <name>Root</name>
  +        <deleted>false</deleted>
  +        <child-option>Code</child-option>
  +        <weight>1</weight>
  +        <preferred-order>1</preferred-order>
  +      </global-attribute-option>
       </global-attribute>
     </global-attributes>
     
  
  
  

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