import java.util.Collections;
import java.util.List;
import java.util.Set;
+import org.springframework.test.annotation.DirtiesContext;
/**
* AbstractRbacManagerTestCase
*/
@RunWith( SpringJUnit4ClassRunner.class )
@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
+@DirtiesContext( classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD )
public abstract class AbstractRbacManagerTestCase
extends TestCase
{
private RBACDefaults rbacDefaults;
+ private static final int EVENTCOUNT = 2;
public void setRbacManager( RBACManager store )
{
this.rbacManager = store;
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- //assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
//assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 1, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 0, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 1, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 3, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 3, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 1, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 1, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 0, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 0, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 1, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );
// Assert some event tracker stuff
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );
/* Assert some event tracker stuff */
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );
// Assert some event tracker stuff
assertNotNull( eventTracker );
- assertEquals( 1, eventTracker.initCount );
+ assertEquals( EVENTCOUNT, eventTracker.initCount );
assertTrue( eventTracker.lastDbFreshness.booleanValue() );
assertEquals( 2, eventTracker.addedRoleNames.size() );