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 2012/02/27 14:46:12 UTC
svn commit: r1294153 [2/2] - in /directory/apacheds/branches/apacheds-txns:
core-api/src/main/java/org/apache/directory/server/core/api/txn/
core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/
core-shared/src/main/java/org/apache/d...
Modified: directory/apacheds/branches/apacheds-txns/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=1294153&r1=1294152&r2=1294153&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java (original)
+++ directory/apacheds/branches/apacheds-txns/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java Mon Feb 27 13:46:11 2012
@@ -87,31 +87,31 @@ public class FrameworkRunner extends Blo
/**
* Initialize the codec service
*/
- static
+ static
{
// Load the extension points
- System.setProperty( StandaloneLdapApiService.DEFAULT_CONTROLS_LIST,
+ System.setProperty( StandaloneLdapApiService.DEFAULT_CONTROLS_LIST,
"org.apache.directory.shared.ldap.codec.controls.cascade.CascadeFactory," +
- "org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory," +
- "org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory," +
- "org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory," +
- "org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory," +
- "org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesFactory" );
+ "org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory," +
+ "org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesFactory" );
- System.setProperty( StandaloneLdapApiService.EXTRA_CONTROLS_LIST,
+ System.setProperty( StandaloneLdapApiService.EXTRA_CONTROLS_LIST,
"org.apache.directory.shared.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory," +
- "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory," +
- "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory," +
- "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory," +
- "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory" );
-
- System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_REQUESTS_LIST,
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory," +
+ "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory" );
+
+ System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_REQUESTS_LIST,
"org.apache.directory.shared.ldap.extras.extended.ads_impl.cancel.CancelFactory," +
- "org.apache.directory.shared.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory," +
- "org.apache.directory.shared.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory," +
- "org.apache.directory.shared.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory" );
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory," +
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory," +
+ "org.apache.directory.shared.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory" );
- System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST,
+ System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST,
"org.apache.directory.shared.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory" );
}
@@ -221,13 +221,13 @@ public class FrameworkRunner extends Blo
else if ( ( suite != null ) && ( suite.getLdapServer() != null ) )
{
classLdapServer = suite.getLdapServer();
-
+
// set directoryService only if there is no class level DS
if ( directoryService == null )
{
directoryService = classLdapServer.getDirectoryService();
}
-
+
// no need to inject the LDIF data that would have been done above
// if ApplyLdifs is present
}
@@ -275,6 +275,8 @@ public class FrameworkRunner extends Blo
}
else
{
+ Description description = getDescription();
+ System.out.println( "reverting for " + description );
// Revert the ldifs
// We use a class or suite DS, just revert the current test's modifications
revert( directoryService, revision );
@@ -288,6 +290,8 @@ public class FrameworkRunner extends Blo
}
finally
{
+ Description description = getDescription();
+ System.out.println( "reverting for " + description );
// help GC to get rid of the directory service with all its references
suite = null;
classDS = null;
@@ -319,7 +323,7 @@ public class FrameworkRunner extends Blo
}
}
}
-
+
return minPort;
}
@@ -435,14 +439,16 @@ public class FrameworkRunner extends Blo
// At this point, we know which service to use.
// Inject it into the class
- Method setService = getTestClass().getJavaClass().getMethod( SET_SERVICE_METHOD_NAME, DirectoryService.class );
+ Method setService = getTestClass().getJavaClass().getMethod( SET_SERVICE_METHOD_NAME,
+ DirectoryService.class );
setService.invoke( getTestClass().getJavaClass(), directoryService );
// if we run this class in a suite, tell it to the test
Field runInSuiteField = getTestClass().getJavaClass().getField( IS_RUN_IN_SUITE_FIELD_NAME );
runInSuiteField.set( getTestClass().getJavaClass(), suite != null );
- Method setLdapServer = getTestClass().getJavaClass().getMethod( SET_LDAP_SERVER_METHOD_NAME, LdapServer.class );
+ Method setLdapServer = getTestClass().getJavaClass().getMethod( SET_LDAP_SERVER_METHOD_NAME,
+ LdapServer.class );
Method setKdcServer = getTestClass().getJavaClass().getMethod( SET_KDC_SERVER_METHOD_NAME, KdcServer.class );
DirectoryService oldLdapServerDirService = null;
@@ -454,7 +460,7 @@ public class FrameworkRunner extends Blo
methodLdapServer.setDirectoryService( directoryService );
setLdapServer.invoke( getTestClass().getJavaClass(), methodLdapServer );
- }
+ }
else if ( classLdapServer != null )
{
oldLdapServerDirService = classLdapServer.getDirectoryService();
@@ -494,12 +500,12 @@ public class FrameworkRunner extends Blo
{
classLdapServer.setDirectoryService( oldLdapServerDirService );
}
-
+
if ( oldKdcServerDirService != null )
{
classKdcServer.setDirectoryService( oldKdcServerDirService );
}
-
+
// Cleanup the methodDS if it has been created
if ( methodDS != null )
{
@@ -564,6 +570,7 @@ public class FrameworkRunner extends Blo
}
ChangeLog cl = dirService.getChangeLog();
+
if ( cl.isEnabled() && ( revision < cl.getCurrentRevision() ) )
{
LOG.debug( "Revert revision {}", revision );
Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java?rev=1294153&r1=1294152&r2=1294153&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java Mon Feb 27 13:46:11 2012
@@ -24,12 +24,10 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
import org.apache.directory.server.core.api.partition.index.IndexCursor;
import org.apache.directory.server.core.api.partition.index.IndexEntry;
-import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
-import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -44,16 +42,12 @@ public class AndCursor<V> extends Abstra
{
/** The message for unsupported operations */
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
-
+
/** */
private final IndexCursor<V> wrapped;
-
+
/** The evaluators used for the members of the And filter */
private final List<Evaluator<? extends ExprNode>> evaluators;
-
- /** Txn and Operation Execution Factories */
- private TxnManagerFactory txnManagerFactory;
- private OperationExecutionManagerFactory executionManagerFactory;
/**
@@ -66,9 +60,6 @@ public class AndCursor<V> extends Abstra
public AndCursor( IndexCursor<V> wrapped,
List<Evaluator<? extends ExprNode>> evaluators )
{
- this.txnManagerFactory = txnManagerFactory;
- this.executionManagerFactory = executionManagerFactory;
-
this.wrapped = wrapped;
this.evaluators = optimize( evaluators );
}
@@ -82,7 +73,7 @@ public class AndCursor<V> extends Abstra
return UNSUPPORTED_MSG;
}
-
+
/**
* {@inheritDoc}
*/
@@ -111,7 +102,7 @@ public class AndCursor<V> extends Abstra
public boolean first() throws Exception
{
beforeFirst();
-
+
return next();
}
@@ -122,7 +113,7 @@ public class AndCursor<V> extends Abstra
public boolean last() throws Exception
{
afterLast();
-
+
return previous();
}
@@ -137,7 +128,7 @@ public class AndCursor<V> extends Abstra
checkNotClosed( "previous()" );
IndexEntry<V> candidate = wrapped.get();
-
+
if ( matches( candidate ) )
{
return setAvailable( true );
@@ -157,14 +148,14 @@ public class AndCursor<V> extends Abstra
{
checkNotClosed( "next()" );
IndexEntry<V> candidate = wrapped.get();
-
+
if ( matches( candidate ) )
{
return setAvailable( true );
}
}
- return setAvailable( false);
+ return setAvailable( false );
}
@@ -174,7 +165,7 @@ public class AndCursor<V> extends Abstra
public IndexEntry<V> get() throws Exception
{
checkNotClosed( "get()" );
-
+
if ( available() )
{
return wrapped.get();
@@ -225,7 +216,9 @@ public class AndCursor<V> extends Abstra
{
for ( Evaluator<?> evaluator : evaluators )
{
- if ( !evaluator.evaluate( indexEntry ) )
+ boolean eval = evaluator.evaluate( indexEntry );
+
+ if ( !eval )
{
return false;
}