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/09/02 14:15:02 UTC
svn commit: r810475 - in
/directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm:
JdbmIndexTest.java JdbmStoreTest.java
Author: elecharny
Date: Wed Sep 2 12:15:02 2009
New Revision: 810475
URL: http://svn.apache.org/viewvc?rev=810475&view=rev
Log:
Speedup tests
Modified:
directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
Modified: directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java?rev=810475&r1=810474&r2=810475&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java Wed Sep 2 12:15:02 2009
@@ -21,6 +21,7 @@
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.After;
import static org.junit.Assert.assertEquals;
@@ -54,13 +55,13 @@
*/
public class JdbmIndexTest
{
- AttributeTypeRegistry registry;
- File dbFileDir;
+ private static AttributeTypeRegistry registry;
+ private static File dbFileDir;
Index<String,ServerEntry> idx;
- @Before
- public void setup() throws Exception
+ @BeforeClass
+ public static void init() throws Exception
{
String workingDirectory = System.getProperty( "workingDirectory" );
@@ -80,7 +81,13 @@
SerializableComparator.setRegistry( registries.getComparatorRegistry() );
- this.registry = registries.getAttributeTypeRegistry();
+ registry = registries.getAttributeTypeRegistry();
+ }
+
+
+ @Before
+ public void setup() throws IOException
+ {
File tmpIndexFile = File.createTempFile( JdbmIndexTest.class.getSimpleName(), "db" );
tmpIndexFile.deleteOnExit();
@@ -94,7 +101,6 @@
@After
public void teardown() throws Exception
{
- registry = null;
destroyIndex();
if ( ( dbFileDir != null ) && dbFileDir.exists() )
@@ -160,6 +166,7 @@
// initialized index
initIndex();
+
try
{
idx.setAttributeId( "foo" );
Modified: directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=810475&r1=810474&r2=810475&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Wed Sep 2 12:15:02 2009
@@ -24,6 +24,7 @@
import org.slf4j.LoggerFactory;
import org.junit.Before;
import org.junit.After;
+import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -84,12 +85,13 @@
File wkdir;
JdbmStore<ServerEntry> store;
- Registries registries = null;
- AttributeTypeRegistry attributeRegistry;
+ private static Registries registries = null;
+ private static AttributeTypeRegistry attributeRegistry;
private static LdifSchemaLoader loader;
- public JdbmStoreTest() throws Exception
+ @BeforeClass
+ public static void setup() throws Exception
{
String workingDirectory = System.getProperty( "workingDirectory" );