[java-opensaml COMMIT] in /trunk: opensaml-storage-api/src/main/java/org/opensaml/storage/StorageService.java opensam...

noreply at shibboleth.net noreply at shibboleth.net
Fri Dec 5 16:14:08 EST 2014


Author: scantor
Date: Fri Dec  5 16:14:08 2014
New Revision: 4177

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4177&view=rev
Log:
Stop exposing component interfaces as a core part of service API

Modified:
    trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageService.java
    trunk/opensaml-storage-api/src/test/java/org/opensaml/storage/StorageServiceTest.java
    trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/LDAPStorageServiceTest.java

Modified: trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageService.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageService.java?rev=4177&r1=4176&r2=4177&view=diff
==============================================================================
--- trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageService.java (original)
+++ trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageService.java Fri Dec  5 16:14:08 2014
@@ -26,9 +26,7 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.Positive;
 import net.shibboleth.utilities.java.support.annotation.constraint.ThreadSafeAfterInit;
 import net.shibboleth.utilities.java.support.collection.Pair;
-import net.shibboleth.utilities.java.support.component.DestructableComponent;
 import net.shibboleth.utilities.java.support.component.IdentifiedComponent;
-import net.shibboleth.utilities.java.support.component.InitializableComponent;
 
 /**
  * Generic data storage facility. Implementations will vary in how much
@@ -47,7 +45,7 @@
  * or a null can be used to signify no expiration.</p>
  */
 @ThreadSafeAfterInit
-public interface StorageService extends InitializableComponent, DestructableComponent, IdentifiedComponent {
+public interface StorageService extends IdentifiedComponent {
 
     /**
      * Returns the capabilities of the underlying store.

Modified: trunk/opensaml-storage-api/src/test/java/org/opensaml/storage/StorageServiceTest.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-api/src/test/java/org/opensaml/storage/StorageServiceTest.java?rev=4177&r1=4176&r2=4177&view=diff
==============================================================================
--- trunk/opensaml-storage-api/src/test/java/org/opensaml/storage/StorageServiceTest.java (original)
+++ trunk/opensaml-storage-api/src/test/java/org/opensaml/storage/StorageServiceTest.java Fri Dec  5 16:14:08 2014
@@ -23,6 +23,8 @@
 import javax.annotation.Nonnull;
 
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
+import net.shibboleth.utilities.java.support.component.DestructableComponent;
+import net.shibboleth.utilities.java.support.component.InitializableComponent;
 
 import org.opensaml.storage.StorageRecord;
 import org.opensaml.storage.StorageService;
@@ -61,12 +63,16 @@
     protected void setUp() throws ComponentInitializationException {
         random = new SecureRandom();
         shared = getStorageService();
-        shared.initialize();
+        if (shared instanceof InitializableComponent) {
+            ((InitializableComponent) shared).initialize();
+        }
     }
     
     @AfterClass
     protected void tearDown() {
-        shared.destroy();
+        if (shared instanceof DestructableComponent) {
+            ((DestructableComponent) shared).destroy();
+        }
     }
     
     @Test(threadPoolSize = 10, invocationCount = 10,  timeOut = 10000)

Modified: trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/LDAPStorageServiceTest.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/LDAPStorageServiceTest.java?rev=4177&r1=4176&r2=4177&view=diff
==============================================================================
--- trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/LDAPStorageServiceTest.java (original)
+++ trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/LDAPStorageServiceTest.java Fri Dec  5 16:14:08 2014
@@ -28,7 +28,6 @@
 import org.ldaptive.pool.BlockingConnectionPool;
 import org.ldaptive.pool.PooledConnectionFactory;
 import org.opensaml.storage.StorageRecord;
-import org.opensaml.storage.StorageService;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterTest;
@@ -47,7 +46,7 @@
 public class LDAPStorageServiceTest {
 
     /** Storage service to test. */
-    protected StorageService storageService;
+    protected LDAPStorageService storageService;
 
     /** In-memory directory server. */
     private InMemoryDirectoryServer directoryServer;
@@ -94,7 +93,7 @@
                 "ldap://localhost:10389")));
     }
 
-    @Nonnull protected StorageService getStorageService() {
+    @Nonnull protected LDAPStorageService getStorageService() {
         LDAPStorageService ss = new LDAPStorageService(
                 getPooledConnectionFactory(),

[... 2 lines stripped ...]


More information about the commits mailing list