portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs TestPreferences.java
Date Mon, 08 Dec 2003 19:13:36 GMT
taylor      2003/12/08 11:13:36

  Modified:    portal/src/test/org/apache/jetspeed/spi/services/prefs
                        TestPreferences.java
  Log:
  Message to David Le Strat:
  
  recommended way of asserting in unit tests:
  
          assertTrue("expected prop1 == true, " + prop1, prop1.equals("true"));
  
  instead of:
  
          if (!prop1.equals("true"))
          {
              assertTrue(false);
          }
  
  btw, for some reason this is failing:
  
          Preferences prefs1 = Preferences.userRoot().node(fullPropertySetPath);
          prefs1.put("propertyName00", "true");
          String prop1 = prefs1.get("propertyName00", null);
          assertTrue("expected prop1 == true, " + prop1, prop1.equals("true"));
  
  and the build is broken because I forgot to run the unit tests for checking in.
  
  Revision  Changes    Path
  1.2       +1 -4      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs/TestPreferences.java
  
  Index: TestPreferences.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs/TestPreferences.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestPreferences.java	8 Dec 2003 18:28:07 -0000	1.1
  +++ TestPreferences.java	8 Dec 2003 19:13:36 -0000	1.2
  @@ -258,10 +258,7 @@
           Preferences prefs1 = Preferences.userRoot().node(fullPropertySetPath);
           prefs1.put("propertyName00", "true");
           String prop1 = prefs1.get("propertyName00", null);
  -        if (!prop1.equals("true"))
  -        {
  -            assertTrue(false);
  -        }
  +        assertTrue("expected prop1 == true, " + prop1, prop1.equals("true"));
           
           // Test remove property.
           prefs1.remove("propertyName00");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message