jsalvata    2004/01/03 18:01:42

  Modified:    src/core/org/apache/jmeter/testbeans/gui Tag:
                        testbeans_experimental_branch WrapperEditor.java
  Log:
  Fix error in the handling of null vs. NullProperty introduced in
  the 61st second. :-(
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.3   +8 -13     
jakarta-jmeter/src/core/org/apache/jmeter/testbeans/gui/Attic/WrapperEditor.java
  
  Index: WrapperEditor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testbeans/gui/Attic/WrapperEditor.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- WrapperEditor.java        4 Jan 2004 01:42:52 -0000       1.1.2.2
  +++ WrapperEditor.java        4 Jan 2004 02:01:42 -0000       1.1.2.3
  @@ -94,8 +94,7 @@
    * For PropertyEditors without a custom editor, the provided GUI is a combo
    * box with:
    * <ul>
  - * <li>An option for "undefined" (corresponding to the null value, not the
  - *      NullProperty).
  + * <li>An option for "undefined" (corresponding to the null value or NullProperty).
    * <li>An option for each value returned by the getTags() method on the wrapped
    *   editor.
    * <li>The possibility to write your own value, which will be parsed by the
  @@ -289,12 +288,8 @@
                        }
           }
   
  -             if (value != null)
  -             {
  -                     result= TestBean.wrapInProperty(value);
  -                     result.setName(name);
  -             }
  -             else result= null;
  +             result= TestBean.wrapInProperty(value);
  +             result.setName(name);
           
           if (log.isDebugEnabled())
           {
  @@ -489,7 +484,7 @@
                                
                        testSetGet(e, new BooleanProperty("B", true));
                        testSetGet(e, new BooleanProperty("B", false));
  -                     testSetGet(e, null);
  +                     testSetGet(e, new NullProperty("B"));
                        testSetGet(e, new StringProperty("B", "${var}"));
                        
                        e.setValue(new StringProperty("B", "true"));
  @@ -516,7 +511,7 @@
                        assertEquals(new BooleanProperty("B", true), e.getValue());
                        
                        e.setAsText("invalid");
  -                     assertEquals(null, e.getValue());
  +                     assertEquals(new NullProperty("B"), e.getValue());
                }
                public void testSetGetAsTextOnString() throws Exception
                {
  @@ -528,10 +523,10 @@
                        testSetGetAsText(e, "");
                        testSetGetAsText(e, null);
                        testSetGetAsText(e, "${var}");
  -                     
  +
                        // Check "Undefined" does not become a "reserved word":
                        e.setAsText(UNDEFINED.toString());
  -                     assertNotNull(e.getValue());
  +                     assertNotNull(e.getAsText());
                }
        }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to