ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional EchoPropertiesTest.java
Date Tue, 07 May 2002 13:20:10 GMT
bodewig     02/05/07 06:20:10

  Modified:    src/testcases/org/apache/tools/ant/taskdefs/optional Tag:
                        ANT_15_BRANCH EchoPropertiesTest.java
  Log:
  Make test for <echoproperties> work on JDK 1.1 through 1.4.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +5 -8      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
  
  Index: EchoPropertiesTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- EchoPropertiesTest.java	22 Feb 2002 08:29:37 -0000	1.1
  +++ EchoPropertiesTest.java	7 May 2002 13:20:10 -0000	1.1.2.1
  @@ -71,6 +71,7 @@
       private final static String TASKDEFS_DIR = "src/etc/testcases/taskdefs/optional/";
       private static final String GOOD_OUTFILE = "test.properties";
       private static final String PREFIX_OUTFILE = "test-prefix.properties";
  +    private static final String TEST_VALUE = "isSet";
       private static final String BAD_OUTFILE = ".";
   
       public EchoPropertiesTest(String name) {
  @@ -79,7 +80,7 @@
   
       public void setUp() {
           configureProject(TASKDEFS_DIR + "echoproperties.xml");
  -        project.setProperty( "test.property", "is set" );
  +        project.setProperty( "test.property", TEST_VALUE );
       }
   
       public void tearDown() {
  @@ -88,11 +89,7 @@
       
       
       public void testEchoToLog() {
  -        executeTarget( "testEchoToLog" );
  -        String out = getLog();
  -        assertTrue(
  -            "Did not output testEchoToLog.",
  -            out.indexOf( "test.property=is set" ) >= 0 );
  +        expectLogContaining("testEchoToLog", "test.property="+TEST_VALUE);
       }
       
       
  @@ -167,7 +164,7 @@
           Properties props=loadPropFile(GOOD_OUTFILE);
           props.list(System.out);
           assertEquals("test property not found ",
  -                     "is set",props.getProperty("test.property"));
  +                     TEST_VALUE, props.getProperty("test.property"));
   /*
           // read in the file
           FileReader fr = new FileReader( f );
  @@ -176,7 +173,7 @@
               String read = null;
               while ( (read = br.readLine()) != null)
               {
  -                if (read.indexOf("test.property=is set") >= 0)
  +                if (read.indexOf("test.property" + TEST_VALUE) >= 0)
                   {
                       // found the property we set - it's good.
                       return;
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message