Skip to content

Commit

Permalink
A test forgot to unregister a handler in the end
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Oct 30, 2012
1 parent 3050f96 commit a84b79c
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -601,7 +601,7 @@ public void modifiedPropertyCanByFurtherModifiedInBeforeCommit() throws Exceptio
node.setProperty( key, "initial value" );
commit();
// -- register a tx handler which will override a property
getGraphDb().registerTransactionEventHandler( new TransactionEventHandler.Adapter<Void>()
TransactionEventHandler<Void> handler = new TransactionEventHandler.Adapter<Void>()
{
@Override
public Void beforeCommit( TransactionData data ) throws Exception
Expand All @@ -611,7 +611,8 @@ public Void beforeCommit( TransactionData data ) throws Exception
modifiedNode.setProperty( key, value2 );
return null;
}
} );
};
getGraphDb().registerTransactionEventHandler( handler );

// When
newTransaction();
Expand All @@ -620,5 +621,6 @@ public Void beforeCommit( TransactionData data ) throws Exception

// Then
assertEquals( value2, node.getProperty( key ) );
getGraphDb().unregisterTransactionEventHandler( handler );
}
}

0 comments on commit a84b79c

Please sign in to comment.