SchemaParserTestUtils.testQuirksMode( parser, "" );
try
{
String value = null;
ObjectClass objectClass = null;
parser.setQuirksMode( true );
// ensure all other test pass in quirks mode
testNumericOid();
testNames();
testDescription();
testObsolete();
testSuperior();
testKind();
testMust();
testMay();
testExtensions();
testFull();
testUniqueElements();
testIgnoreElementOrder();
testRfcTop();
testRfcSimpleSecurityObject();
testSunAlias();
testNovellDcObject();
testNovellList();
testMicrosoftAds2000Locality();
testMicrosoftAds2003Msieee();
testSiemensDirxX500Subschema();
testMultiThreaded();
// NAME with special chars
value = "( 1.2.3 NAME 't-e_s.t;' )";
objectClass = parser.parseObjectClassDescription( value );
assertEquals( 1, objectClass.getNames().size() );
assertEquals( "t-e_s.t;", objectClass.getNames().get( 0 ) );
// SUP with underscore
value = "( 1.1 SUP te_st )";
objectClass = parser.parseObjectClassDescription( value );
assertEquals( 1, objectClass.getSuperiorOids().size() );
assertEquals( "te_st", objectClass.getSuperiorOids().get( 0 ) );
// MAY with underscore
value = "( 1.1 MAY te_st )";
objectClass = parser.parseObjectClassDescription( value );
assertEquals( 1, objectClass.getMayAttributeTypeOids().size() );
assertEquals( "te_st", objectClass.getMayAttributeTypeOids().get( 0 ) );
// MUST with underscore
value = "( 1.1 MUST te_st )";
objectClass = parser.parseObjectClassDescription( value );
assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
assertEquals( "te_st", objectClass.getMustAttributeTypeOids().get( 0 ) );
// Netscape object class
value = "( nsAdminGroup-oid NAME 'nsAdminGroup' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsAdminGroupName $ description $ nsConfigRoot $ nsAdminSIEDN ) X-ORIGIN 'Netscape' )";
objectClass = parser.parseObjectClassDescription( value );
assertEquals( "nsAdminGroup-oid", objectClass.getOid() );
assertEquals( 1, objectClass.getNames().size() );
assertEquals( "nsAdminGroup", objectClass.getNames().get( 0 ) );
}
finally
{
parser.setQuirksMode( false );
}