directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r810474 - /directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
Date Wed, 02 Sep 2009 12:14:34 GMT
Author: akarasulu
Date: Wed Sep  2 12:14:34 2009
New Revision: 810474

URL: http://svn.apache.org/viewvc?rev=810474&view=rev
Log:
fixing issues with static and non-static test and class setup teardown methods

Modified:
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?rev=810474&r1=810473&r2=810474&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
Wed Sep  2 12:14:34 2009
@@ -32,13 +32,14 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import static org.junit.Assert.assertTrue;
@@ -54,13 +55,13 @@
  */
 public class SubtreeEvaluatorTest
 {
-    private Registries registries;
+    private static Registries registries;
     private SubtreeEvaluator evaluator;
     FilterNormalizingVisitor visitor;
-    AttributeTypeRegistry attributeRegistry;
+    static AttributeTypeRegistry attributeRegistry;
+    static ConcreteNameComponentNormalizer ncn;
 
-
-    private void init() throws Exception
+    private static void init() throws Exception
     {
     	String workingDirectory = System.getProperty( "workingDirectory" );
 
@@ -80,22 +81,36 @@
     	
         attributeRegistry = registries.getAttributeTypeRegistry();
         
-        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry
);
+        ncn = new ConcreteNameComponentNormalizer( attributeRegistry );
+    }
+
+    
+    @Before
+    public void initTest()
+    {
         visitor = new FilterNormalizingVisitor( ncn, registries );
+        evaluator = new SubtreeEvaluator( registries.getOidRegistry(), registries.getAttributeTypeRegistry()
);
+    }
+
+
+    @After
+    public void destroyTest()
+    {
+        visitor = null;
+        evaluator = null;
     }
 
+    
     @BeforeClass
-    protected void setUp() throws Exception
+    public static void setUp() throws Exception
     {
         init();
-        evaluator = new SubtreeEvaluator( registries.getOidRegistry(), registries.getAttributeTypeRegistry()
);
     }
 
 
     @AfterClass
-    protected void tearDown() throws Exception
+    public static void tearDown() throws Exception
     {
-        evaluator = null;
         registries = null;
     }
 



Mime
View raw message