directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r488373 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/
Date Mon, 18 Dec 2006 17:58:20 GMT
Author: elecharny
Date: Mon Dec 18 09:58:19 2006
New Revision: 488373

URL: http://svn.apache.org/viewvc?view=rev&rev=488373
Log:
Changed the tests to reflect the modification done in SC classes
Removed some warnings

Modified:
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/NameOrNumericIdSyntaxCheckerTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxCheckerTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITStructureRuleDescriptionTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxCheckerTest.java

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/NameOrNumericIdSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/NameOrNumericIdSyntaxCheckerTest.java?view=diff&rev=488373&r1=488372&r2=488373
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/NameOrNumericIdSyntaxCheckerTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/NameOrNumericIdSyntaxCheckerTest.java
Mon Dec 18 09:58:19 2006
@@ -33,7 +33,7 @@
  */
 public class NameOrNumericIdSyntaxCheckerTest extends TestCase
 {
-    NumericOidSyntaxChecker checker = new NumericOidSyntaxChecker( "1.1" );
+    NumericOidSyntaxChecker checker = new NumericOidSyntaxChecker();
 
 
     public void testNullString()

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxCheckerTest.java?view=diff&rev=488373&r1=488372&r2=488373
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxCheckerTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassTypeSyntaxCheckerTest.java
Mon Dec 18 09:58:19 2006
@@ -31,7 +31,7 @@
  */
 public class ObjectClassTypeSyntaxCheckerTest extends TestCase
 {
-    ObjectClassTypeSyntaxChecker checker = new ObjectClassTypeSyntaxChecker( "1.1" );
+    ObjectClassTypeSyntaxChecker checker = new ObjectClassTypeSyntaxChecker();
 
 
     public void testNullString()

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITStructureRuleDescriptionTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITStructureRuleDescriptionTest.java?view=diff&rev=488373&r1=488372&r2=488373
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITStructureRuleDescriptionTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITStructureRuleDescriptionTest.java
Mon Dec 18 09:58:19 2006
@@ -128,7 +128,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid ruleid '1234567890' (quoted)" );
+            fail( "Exception expected, invalid ruleid '1234567890' (quoted)" );
         }
         catch ( ParseException pe )
         {
@@ -373,7 +373,7 @@
      * 
      * @throws ParseException
      */
-    public void testUniqueElements() throws ParseException
+    public void testUniqueElements()
     {
         String[] testValues = new String[]
             { 

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java?view=diff&rev=488373&r1=488372&r2=488373
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java
Mon Dec 18 09:58:19 2006
@@ -99,7 +99,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid SYNTAX test" );
+            fail( "Exception expected, invalid SYNTAX test" );
         }
         catch ( ParseException pe )
         {
@@ -127,7 +127,7 @@
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
         
     }
@@ -171,7 +171,7 @@
      * 
      * @throws ParseException
      */
-    public void testUniqueElements() throws ParseException
+    public void testUniqueElements()
     {
         String[] testValues = new String[]
             { 
@@ -207,7 +207,7 @@
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
 
     }
@@ -251,18 +251,17 @@
      * This is a real matching rule from Sun Directory 5.2. It has an invalid 
      * syntax, no DOTs allowed in NAME value. 
      */
-    public void testSun2() throws ParseException
+    public void testSun2()
     {
         String value = "( 1.3.6.1.4.1.42.2.27.9.4.34.3.6 NAME 'caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3'
DESC 'en' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )";
         try
         {
             parser.parseMatchingRuleDescription( value );
-            TestCase
-                .fail( "Exception expected, invalid NAME value 'caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3'
(contains DOTs)" );
+            fail( "Exception expected, invalid NAME value 'caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3'
(contains DOTs)" );
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
     }
 

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java?view=diff&rev=488373&r1=488372&r2=488373
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java
Mon Dec 18 09:58:19 2006
@@ -10,7 +10,7 @@
 import org.apache.directory.shared.ldap.schema.syntax.parser.AbstractSchemaParser;
 
 
-public abstract class SchemaParserTestUtils 
+public class SchemaParserTestUtils extends TestCase
 {
 
     /**
@@ -28,7 +28,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, null" );
+            fail( "Exception expected, null" );
         }
         catch ( ParseException pe )
         {
@@ -40,7 +40,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, no NUMERICOID" );
+            fail( "Exception expected, no NUMERICOID" );
         }
         catch ( ParseException pe )
         {
@@ -50,24 +50,24 @@
         // simple
         value = "( 0.1.2.3.4.5.6.7.8.9 "+required+" )";
         asd = parser.parse( value );
-        TestCase.assertEquals( "0.1.2.3.4.5.6.7.8.9", asd.getNumericOid() );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", asd.getNumericOid() );
 
         // simple
         value = "( 123.4567.890 "+required+")";
         asd = parser.parse( value );
-        TestCase.assertEquals( "123.4567.890", asd.getNumericOid() );
+        assertEquals( "123.4567.890", asd.getNumericOid() );
         
         // simple with spaces
         value = "(          0.1.2.3.4.5.6.7.8.9         "+required+" )";
         asd = parser.parse( value );
-        TestCase.assertEquals( "0.1.2.3.4.5.6.7.8.9", asd.getNumericOid() );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", asd.getNumericOid() );
 
         // non-numeric not allowed
         value = "( test "+required+" )";
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID test" );
+            fail( "Exception expected, invalid NUMERICOID test" );
         }
         catch ( ParseException pe )
         {
@@ -79,7 +79,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID 1" );
+            fail( "Exception expected, invalid NUMERICOID 1" );
         }
         catch ( ParseException pe )
         {
@@ -91,7 +91,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID ." );
+            fail( "Exception expected, invalid NUMERICOID ." );
         }
         catch ( ParseException pe )
         {
@@ -103,7 +103,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID 1.1." );
+            fail( "Exception expected, invalid NUMERICOID 1.1." );
         }
         catch ( ParseException pe )
         {
@@ -115,7 +115,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID '1.1' (quoted)" );
+            fail( "Exception expected, invalid NUMERICOID '1.1' (quoted)" );
         }
         catch ( ParseException pe )
         {
@@ -127,7 +127,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID 01.1 (leading zero)" );
+            fail( "Exception expected, invalid NUMERICOID 01.1 (leading zero)" );
         }
         catch ( ParseException pe )
         {
@@ -139,11 +139,11 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NUMERICOID 1.2.a.4 (alpha not allowed)"
);
+            fail( "Exception expected, invalid NUMERICOID 1.2.a.4 (alpha not allowed)" );
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
         
     }
@@ -161,56 +161,56 @@
         // alpha
         value = "( "+oid+" "+required+" NAME 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
)";
         asd = parser.parse( value );
-        TestCase.assertEquals( 1, asd.getNames().size() );
-        TestCase.assertEquals( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", asd.getNames().get(
0 ) );
+        assertEquals( 1, asd.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", asd.getNames().get(
0 ) );
 
         // alpha-num-hypen
         value = "( "+oid+" "+required+" NAME 'abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789'
)";
         asd = parser.parse( value );
-        TestCase.assertEquals( 1, asd.getNames().size() );
-        TestCase.assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789",
asd.getNames().get( 0 ) );
+        assertEquals( 1, asd.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789",
asd.getNames().get( 0 ) );
 
         // with parentheses
         value = "( "+oid+" "+required+" NAME ( 'a-z-0-9' ) )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 1, asd.getNames().size() );
-        TestCase.assertEquals( "a-z-0-9", asd.getNames().get( 0 ) );
+        assertEquals( 1, asd.getNames().size() );
+        assertEquals( "a-z-0-9", asd.getNames().get( 0 ) );
 
         // with parentheses, without space
         value = "( "+oid+" "+required+" NAME ('a-z-0-9') )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 1, asd.getNames().size() );
-        TestCase.assertEquals( "a-z-0-9", asd.getNames().get( 0 ) );
+        assertEquals( 1, asd.getNames().size() );
+        assertEquals( "a-z-0-9", asd.getNames().get( 0 ) );
 
         // multi with space
         value = "( "+oid+" "+required+" NAME ( 'test1' 'test2' ) )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 2, asd.getNames().size() );
-        TestCase.assertEquals( "test1", asd.getNames().get( 0 ) );
-        TestCase.assertEquals( "test2", asd.getNames().get( 1 ) );
+        assertEquals( 2, asd.getNames().size() );
+        assertEquals( "test1", asd.getNames().get( 0 ) );
+        assertEquals( "test2", asd.getNames().get( 1 ) );
 
         // multi without space
         value = "( "+oid+" "+required+" NAME ('test1' 'test2' 'test3') )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 3, asd.getNames().size() );
-        TestCase.assertEquals( "test1", asd.getNames().get( 0 ) );
-        TestCase.assertEquals( "test2", asd.getNames().get( 1 ) );
-        TestCase.assertEquals( "test3", asd.getNames().get( 2 ) );
+        assertEquals( 3, asd.getNames().size() );
+        assertEquals( "test1", asd.getNames().get( 0 ) );
+        assertEquals( "test2", asd.getNames().get( 1 ) );
+        assertEquals( "test3", asd.getNames().get( 2 ) );
 
         // multi with many spaces
         value = "(          "+oid+" "+required+"          NAME          (          'test1'
         'test2'          'test3'          )          )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 3, asd.getNames().size() );
-        TestCase.assertEquals( "test1", asd.getNames().get( 0 ) );
-        TestCase.assertEquals( "test2", asd.getNames().get( 1 ) );
-        TestCase.assertEquals( "test3", asd.getNames().get( 2 ) );
+        assertEquals( 3, asd.getNames().size() );
+        assertEquals( "test1", asd.getNames().get( 0 ) );
+        assertEquals( "test2", asd.getNames().get( 1 ) );
+        assertEquals( "test3", asd.getNames().get( 2 ) );
 
         // lowercase
         value = "( "+oid+" "+required+" name 'test' )";
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, NAME is lowercase" );
+            fail( "Exception expected, NAME is lowercase" );
         }
         catch ( ParseException pe )
         {
@@ -222,7 +222,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NAME test (unquoted)" );
+            fail( "Exception expected, invalid NAME test (unquoted)" );
         }
         catch ( ParseException pe )
         {
@@ -234,7 +234,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NAME 1test (starts with number)"
);
+            fail( "Exception expected, invalid NAME 1test (starts with number)" );
         }
         catch ( ParseException pe )
         {
@@ -246,7 +246,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NAME -test (starts with hypen)" );
+            fail( "Exception expected, invalid NAME -test (starts with hypen)" );
         }
         catch ( ParseException pe )
         {
@@ -258,7 +258,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NAME te_st (contains invalid character)"
);
+            fail( "Exception expected, invalid NAME te_st (contains invalid character)" );
         }
         catch ( ParseException pe )
         {
@@ -270,7 +270,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid token NAM" );
+            fail( "Exception expected, invalid token NAM" );
         }
         catch ( ParseException pe )
         {
@@ -282,7 +282,7 @@
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NAME te_st (contains invalid character)"
);
+            fail( "Exception expected, invalid NAME te_st (contains invalid character)" );
         }
         catch ( ParseException pe )
         {
@@ -294,11 +294,11 @@
         try
         {
             asd = parser.parse( value );
-            TestCase.fail( "Exception expected, invalid NAME values (no space between values)"
);
+            fail( "Exception expected, invalid NAME values (no space between values)" );
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
     }
     
@@ -316,23 +316,23 @@
         // simple
         value = "("+oid+" "+required+" DESC 'Descripton')";
         asd = parser.parse( value );
-        TestCase.assertEquals( "Descripton", asd.getDescription() );
+        assertEquals( "Descripton", asd.getDescription() );
 
         // unicode
         value = "( "+oid+" "+required+" DESC 'Descripton äöüß 部長' )";
         asd = parser.parse( value );
-        TestCase.assertEquals( "Descripton äöüß 部長", asd.getDescription()
);
+        assertEquals( "Descripton äöüß 部長", asd.getDescription() );
 
         // lowercase
         value = "( "+oid+" "+required+" desc 'Descripton' )";
         try
         {
             parser.parse( value );
-            TestCase.fail( "Exception expected, DESC is lowercase" );
+            fail( "Exception expected, DESC is lowercase" );
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
         
     }
@@ -351,49 +351,49 @@
         // no extension
         value = "( "+oid+" "+required+" )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 0, asd.getExtensions().size() );
+        assertEquals( 0, asd.getExtensions().size() );
 
         // single extension with one value
         value = "( "+oid+" "+required+" X-TEST 'test' )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 1, asd.getExtensions().size() );
-        TestCase.assertNotNull( asd.getExtensions().get( "X-TEST" ) );
-        TestCase.assertEquals( 1, asd.getExtensions().get( "X-TEST" ).size() );
-        TestCase.assertEquals( "test", asd.getExtensions().get( "X-TEST" ).get( 0 ) );
+        assertEquals( 1, asd.getExtensions().size() );
+        assertNotNull( asd.getExtensions().get( "X-TEST" ) );
+        assertEquals( 1, asd.getExtensions().get( "X-TEST" ).size() );
+        assertEquals( "test", asd.getExtensions().get( "X-TEST" ).get( 0 ) );
 
         // single extension with multiple values
         value = "( "+oid+" "+required+" X-TEST-ABC ('test1' 'test äöüß'     
 'test 部長' ) )";
         asd = parser.parse( value );
-        TestCase.assertEquals( 1, asd.getExtensions().size() );
-        TestCase.assertNotNull( asd.getExtensions().get( "X-TEST-ABC" ) );
-        TestCase.assertEquals( 3, asd.getExtensions().get( "X-TEST-ABC" ).size() );
-        TestCase.assertEquals( "test1", asd.getExtensions().get( "X-TEST-ABC" ).get( 0 )
);
-        TestCase.assertEquals( "test äöüß", asd.getExtensions().get( "X-TEST-ABC"
).get( 1 ) );
-        TestCase.assertEquals( "test 部長", asd.getExtensions().get( "X-TEST-ABC"
).get( 2 ) );
+        assertEquals( 1, asd.getExtensions().size() );
+        assertNotNull( asd.getExtensions().get( "X-TEST-ABC" ) );
+        assertEquals( 3, asd.getExtensions().get( "X-TEST-ABC" ).size() );
+        assertEquals( "test1", asd.getExtensions().get( "X-TEST-ABC" ).get( 0 ) );
+        assertEquals( "test äöüß", asd.getExtensions().get( "X-TEST-ABC" ).get(
1 ) );
+        assertEquals( "test 部長", asd.getExtensions().get( "X-TEST-ABC" ).get( 2
) );
 
         // multiple extensions
         value = "("+oid+" "+required+" X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1'
'test2-2'))";
         asd = parser.parse( value );
-        TestCase.assertEquals( 2, asd.getExtensions().size() );
-        TestCase.assertNotNull( asd.getExtensions().get( "X-TEST-a" ) );
-        TestCase.assertEquals( 2, asd.getExtensions().get( "X-TEST-a" ).size() );
-        TestCase.assertEquals( "test1-1", asd.getExtensions().get( "X-TEST-a" ).get( 0 )
);
-        TestCase.assertEquals( "test1-2", asd.getExtensions().get( "X-TEST-a" ).get( 1 )
);
-        TestCase.assertNotNull( asd.getExtensions().get( "X-TEST-b" ) );
-        TestCase.assertEquals( 2, asd.getExtensions().get( "X-TEST-b" ).size() );
-        TestCase.assertEquals( "test2-1", asd.getExtensions().get( "X-TEST-b" ).get( 0 )
);
-        TestCase.assertEquals( "test2-2", asd.getExtensions().get( "X-TEST-b" ).get( 1 )
);
+        assertEquals( 2, asd.getExtensions().size() );
+        assertNotNull( asd.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, asd.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", asd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", asd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( asd.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, asd.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", asd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", asd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
 
         // invalid extension, no number allowed
         value = "( "+oid+" "+required+" X-TEST1 'test' )";
         try
         {
             asd = parser.parse( value );
-            TestCase.fail( "Exception expected, invalid extension X-TEST1 (no number allowed)"
);
+            fail( "Exception expected, invalid extension X-TEST1 (no number allowed)" );
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
 
     }
@@ -412,29 +412,29 @@
         // not obsolete
         value = "( "+oid+" "+required+" )";
         asd = parser.parse( value );
-        TestCase.assertFalse( asd.isObsolete() );
+        assertFalse( asd.isObsolete() );
 
         // not obsolete
         value = "( "+oid+" "+required+" NAME 'test' DESC 'Descripton' )";
         asd = parser.parse( value );
-        TestCase.assertFalse( asd.isObsolete() );
+        assertFalse( asd.isObsolete() );
         
         // obsolete
         value = "("+oid+" "+required+" NAME 'test' DESC 'Descripton' OBSOLETE)";
         asd = parser.parse( value );
-        TestCase.assertTrue( asd.isObsolete() );
+        assertTrue( asd.isObsolete() );
 
         // obsolete 
         value = "("+oid+" "+required+" OBSOLETE)";
         asd = parser.parse( value );
-        TestCase.assertTrue( asd.isObsolete() );
+        assertTrue( asd.isObsolete() );
 
         // ivalid
         value = "("+oid+" "+required+" NAME 'test' DESC 'Descripton' OBSOLET )";
         try
         {
             asd = parser.parse( value );
-            TestCase.fail( "Exception expected, invalid OBSOLETE value" );
+            fail( "Exception expected, invalid OBSOLETE value" );
         }
         catch ( ParseException pe )
         {
@@ -446,11 +446,11 @@
         try
         {
             asd = parser.parse( value );
-            TestCase.fail( "Exception expected, trailing value ('true') now allowed" );
+            fail( "Exception expected, trailing value ('true') now allowed" );
         }
         catch ( ParseException pe )
         {
-            // expected
+            assertTrue( true );
         }
         
     }
@@ -462,7 +462,7 @@
      * 
      * @throws ParseException
      */
-    public static void testUnique( AbstractSchemaParser parser, String[] testValues ) throws
ParseException
+    public static void testUnique( AbstractSchemaParser parser, String[] testValues )
     {
         for ( int i = 0; i < testValues.length; i++ )
         {
@@ -470,11 +470,11 @@
             try
             {
                 parser.parse( testValue );
-                TestCase.fail( "Exception expected, element appears twice in "+testValue
);
+                fail( "Exception expected, element appears twice in "+testValue );
             }
             catch ( ParseException pe )
             {
-                // expected
+                assertTrue( true );
             }
         }
         
@@ -484,7 +484,7 @@
     /**
      * Tests the multithreaded use of a single parser.
      */
-    public static void testMultiThreaded( AbstractSchemaParser parser, String[] testValues
) throws ParseException
+    public static void testMultiThreaded( AbstractSchemaParser parser, String[] testValues
)
     {
         final boolean[] isSuccessMultithreaded = new boolean[1];
         isSuccessMultithreaded[0] = true;
@@ -509,14 +509,14 @@
 
             for ( int ii = 0; ii < threads.size(); ii++ )
             {
-                Thread t = ( Thread ) threads.get( ii );
+                Thread t = threads.get( ii );
                 hasLiveThreads = hasLiveThreads || t.isAlive();
             }
         }
         while ( hasLiveThreads );
 
         // check that no one thread failed to parse and generate a SS object
-        TestCase.assertTrue( isSuccessMultithreaded[0] );
+        assertTrue( isSuccessMultithreaded[0] );
         
     }
 

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxCheckerTest.java?view=diff&rev=488373&r1=488372&r2=488373
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxCheckerTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/TelephoneNumberSyntaxCheckerTest.java
Mon Dec 18 09:58:19 2006
@@ -36,6 +36,11 @@
     {
         assertFalse( checker.isValidSyntax( null ) );
     }
+    
+    public void testOID()
+    {
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.50", checker.getSyntaxOid() );
+    }
 
 
     public void testEmptyString()



Mime
View raw message