You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/03/15 01:19:05 UTC
svn commit: r754566 -
/directory/shared/branches/shared-replication/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
Author: elecharny
Date: Sun Mar 15 00:19:05 2009
New Revision: 754566
URL: http://svn.apache.org/viewvc?rev=754566&view=rev
Log:
Switched to JUNIT 4.4
Modified:
directory/shared/branches/shared-replication/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
Modified: directory/shared/branches/shared-replication/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java?rev=754566&r1=754565&r2=754566&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java (original)
+++ directory/shared/branches/shared-replication/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java Sun Mar 15 00:19:05 2009
@@ -26,13 +26,19 @@
import java.util.List;
import java.util.Map;
-import junit.framework.TestCase;
-
import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeLiteral;
import org.apache.directory.shared.ldap.schema.parsers.ObjectClassLiteral;
import org.apache.directory.shared.ldap.schema.parsers.OpenLdapSchemaParser;
import org.apache.directory.shared.ldap.schema.syntaxes.OpenLdapObjectIdentifierMacro;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
@@ -41,27 +47,26 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev: 437016 $
*/
-public class OpenLdapSchemaParserTest extends TestCase
+public class OpenLdapSchemaParserTest
{
private OpenLdapSchemaParser parser;
-
- protected void setUp() throws Exception
+ @Before
+ public void setUp() throws Exception
{
- super.setUp();
-
parser = new OpenLdapSchemaParser();
parser.setParserMonitor( new ConsoleParserMonitor() );
}
- protected void tearDown() throws Exception
+ @After
+ public void tearDown() throws Exception
{
- super.tearDown();
parser = null;
}
+ @Test
public void testSimpleAttributeTypeNoLength() throws Exception
{
String attributeTypeData = "attributetype ( 2.5.4.14 NAME 'searchGuide'\n"
@@ -94,6 +99,7 @@
}
+ @Test
public void testSimpleAttributeTypeParse() throws Exception
{
String attributeTypeData = "# adding a comment \n" + "attributetype ( 2.5.4.2 NAME 'knowledgeInformation'\n"
@@ -113,6 +119,7 @@
}
+ @Test
public void testAttributeTypeParseWithDescQuotes() throws Exception
{
String attributeTypeData = "# adding a comment \n" + "attributetype ( 2.5.4.2 NAME 'knowledgeInformation'\n"
@@ -132,6 +139,7 @@
}
+ @Test
public void testComplexAttributeTypeParse() throws Exception
{
String attributeTypeData = "# adding a comment \n"
@@ -165,6 +173,7 @@
}
+ @Test
public void testObjectClassParse() throws Exception
{
String objectClassData = "objectclass ( 2.5.6.6 NAME 'person'\n" + " DESC 'RFC2256: a person'\n"
@@ -189,6 +198,7 @@
}
+ @Test
public void testObjectClassMultipleNames() throws Exception
{
String objectClassData = "objectclass ( 0.9.2342.19200300.100.4.4\n"
@@ -234,6 +244,7 @@
}
+ @Test
public void testParseOpenLdapCoreSchema() throws Exception
{
InputStream input = getClass().getResourceAsStream( "core.schema" );
@@ -249,6 +260,7 @@
}
+ @Test
public void testParseOpenLdapInetOrgPersonSchema() throws Exception
{
InputStream input = getClass().getResourceAsStream( "inetorgperson.schema" );
@@ -264,6 +276,7 @@
}
+ @Test
public void testParseOpenLdapCollectiveSchema() throws Exception
{
InputStream input = getClass().getResourceAsStream( "collective.schema" );
@@ -283,6 +296,7 @@
}
+ @Test
public void testOpenLdapObjectIdentifiereMacros() throws Exception
{
InputStream input = getClass().getResourceAsStream( "dyngroup.schema" );