Implementation of {@code ACLPersistenceStrategy} that uses the Java Persistence API (JPA) topersist the {@code ACL}s.
7071727374757677787980
{ //Get it as a system property to the test (eg. maven profiles) String resourcesCount = System.getProperty("acl.resources","100"); TOTAL_RESOURCES = Integer.parseInt(resourcesCount); this.strategy = new JPAPersistenceStrategy(); this.registration = new TestACLRegistration(strategy); this.provider = new ACLProviderImpl(); this.provider.setPersistenceStrategy(strategy); // create the resources used in the tests.
6768697071727374757677
* Default constructor. Initializes the state of this {@code TestCase}. * </p> */ public ACLProviderUnitTestCase() { ACLPersistenceStrategy strategy = new JPAPersistenceStrategy(); this.registration = new TestACLRegistration(strategy); this.provider = new ACLProviderImpl(); provider.setPersistenceStrategy(strategy); }
57585960616263
// create some test resources to be used by the tests. this.resources = new TestResource[10]; for (int index = 0; index < this.resources.length; index++) this.resources[index] = new TestResource(index + 1); this.createdACLs = new ArrayList<ACL>(); this.strategy = new JPAPersistenceStrategy(new TestResourceFactory()); }
3536373839404142434445
private static Logger log = Logger.getLogger( DroolsRepositoryAccessManager.class ); public DroolsRepositoryACLManager(final Identity identity) { this.strategy = new JPAPersistenceStrategy(); this.registration = new DroolsACLRegistration( strategy ); this.provider = new ACLProviderImpl(); this.provider.setPersistenceStrategy( strategy ); this.identity = identity;