directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1690295 - in /directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers: SizeLimitWrapperTest.java TimeLimitWrapperTest.java
Date Fri, 10 Jul 2015 17:34:22 GMT
Author: elecharny
Date: Fri Jul 10 17:34:22 2015
New Revision: 1690295

URL: http://svn.apache.org/r1690295
Log:
Fixed the failing tests due to some modifications in the TimeLimitWrapper and SizeLimitWrapper
classes

Modified:
    directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/SizeLimitWrapperTest.java
    directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/TimeLimitWrapperTest.java

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/SizeLimitWrapperTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/SizeLimitWrapperTest.java?rev=1690295&r1=1690294&r2=1690295&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/SizeLimitWrapperTest.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/SizeLimitWrapperTest.java
Fri Jul 10 17:34:22 2015
@@ -93,29 +93,46 @@ public class SizeLimitWrapperTest
     @Test
     public void testIsValid()
     {
-        assertTrue( SizeLimitWrapper.isValid( null ) );
-        assertTrue( SizeLimitWrapper.isValid( "" ) );
-        assertTrue( SizeLimitWrapper.isValid( "  " ) );
+        SizeLimitWrapper sizeLimitWrapper = new SizeLimitWrapper( null );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "  " );
+        assertTrue( sizeLimitWrapper.isValid() );
         
-        assertTrue( SizeLimitWrapper.isValid( "size=100" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size=none" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size=unlimited" ) );
+        sizeLimitWrapper = new SizeLimitWrapper( "size=100" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size=none" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size=unlimited" );
+        assertTrue( sizeLimitWrapper.isValid() );
         
-        assertTrue( SizeLimitWrapper.isValid( "size.hard=100" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size.hard=none" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size.hard=unlimited" ) );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.hard=100" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.hard=none" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.hard=unlimited" );
+        assertTrue( sizeLimitWrapper.isValid() );
         
-        assertTrue( SizeLimitWrapper.isValid( "size.soft=100" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size.soft=none" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size.soft=unlimited" ) );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.soft=100" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.soft=none" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.soft=unlimited" );
+        assertTrue( sizeLimitWrapper.isValid() );
 
-        assertTrue( SizeLimitWrapper.isValid( "size.soft=100 size.hard=200" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size.hard=100 size.soft=200" ) );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.soft=100 size.hard=200" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.hard=100 size.soft=200" );
+        assertTrue( sizeLimitWrapper.isValid() );
 
-        assertTrue( SizeLimitWrapper.isValid( "size.soft=none size.hard=200" ) );
-        assertTrue( SizeLimitWrapper.isValid( "size.hard=100 size.soft=unlimited" ) );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.soft=none size.hard=200" );
+        assertTrue( sizeLimitWrapper.isValid() );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.hard=100 size.soft=unlimited" );
+        assertTrue( sizeLimitWrapper.isValid() );
 
-        assertTrue( SizeLimitWrapper.isValid( "size.hard=soft size.soft=unlimited size=100"
) );
+        sizeLimitWrapper = new SizeLimitWrapper( "size.hard=soft size.soft=unlimited size=100"
);
+        assertTrue( sizeLimitWrapper.isValid() );
     }
     
     

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/TimeLimitWrapperTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/TimeLimitWrapperTest.java?rev=1690295&r1=1690294&r2=1690295&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/TimeLimitWrapperTest.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/test/java/org/apache/directory/studio/openldap/config/wrappers/TimeLimitWrapperTest.java
Fri Jul 10 17:34:22 2015
@@ -92,29 +92,46 @@ public class TimeLimitWrapperTest
     @Test
     public void testIsValid()
     {
-        assertTrue( TimeLimitWrapper.isValid( null ) );
-        assertTrue( TimeLimitWrapper.isValid( "" ) );
-        assertTrue( TimeLimitWrapper.isValid( "  " ) );
+        TimeLimitWrapper timeLimitWrapper = new TimeLimitWrapper( null );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "  " );
+        assertTrue( timeLimitWrapper.isValid() );
         
-        assertTrue( TimeLimitWrapper.isValid( "time=100" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time=none" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time=unlimited" ) );
+        timeLimitWrapper = new TimeLimitWrapper( "time=100" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time=none" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time=unlimited" );
+        assertTrue( timeLimitWrapper.isValid() );
         
-        assertTrue( TimeLimitWrapper.isValid( "time.hard=100" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time.hard=none" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time.hard=unlimited" ) );
+        timeLimitWrapper = new TimeLimitWrapper( "time.hard=100" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time.hard=none" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time.hard=unlimited" );
+        assertTrue( timeLimitWrapper.isValid() );
         
-        assertTrue( TimeLimitWrapper.isValid( "time.soft=100" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time.soft=none" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time.soft=unlimited" ) );
+        timeLimitWrapper = new TimeLimitWrapper( "time.soft=100" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time.soft=none" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time.soft=unlimited" );
+        assertTrue( timeLimitWrapper.isValid() );
 
-        assertTrue( TimeLimitWrapper.isValid( "time.soft=100 time.hard=200" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time.hard=100 time.soft=200" ) );
+        timeLimitWrapper = new TimeLimitWrapper( "time.soft=100 time.hard=200" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time.hard=100 time.soft=200" );
+        assertTrue( timeLimitWrapper.isValid() );
 
-        assertTrue( TimeLimitWrapper.isValid( "time.soft=none time.hard=200" ) );
-        assertTrue( TimeLimitWrapper.isValid( "time.hard=100 time.soft=unlimited" ) );
+        timeLimitWrapper = new TimeLimitWrapper( "time.soft=none time.hard=200" );
+        assertTrue( timeLimitWrapper.isValid() );
+        timeLimitWrapper = new TimeLimitWrapper( "time.hard=100 time.soft=unlimited" );
+        assertTrue( timeLimitWrapper.isValid() );
 
-        assertTrue( TimeLimitWrapper.isValid( "time.hard=soft time.soft=unlimited time=100"
) );
+        timeLimitWrapper = new TimeLimitWrapper( "time.hard=soft time.soft=unlimited time=100"
);
+        assertTrue( timeLimitWrapper.isValid() );
     }
     
     
@@ -123,7 +140,7 @@ public class TimeLimitWrapperTest
     {
         TimeLimitWrapper tlw = new TimeLimitWrapper( null );
         assertEquals( null, tlw.getGlobalLimit() );
-        assertEquals( null, tlw.getSoftLimit() );
+        assertEquals( null,tlw.getSoftLimit() );
         assertEquals( null, tlw.getHardLimit() );
 
         tlw = new TimeLimitWrapper( "" );



Mime
View raw message