You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2016/12/21 15:42:47 UTC
svn commit: r1775474 - in /jackrabbit/oak/trunk/oak-auth-ldap: pom.xml
src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
Author: reschke
Date: Wed Dec 21 15:42:47 2016
New Revision: 1775474
URL: http://svn.apache.org/viewvc?rev=1775474&view=rev
Log:
OAK-5358: test failures for oak-auth-ldap on Windows
let cache service shut down properly, re-enable tests on Windows
Modified:
jackrabbit/oak/trunk/oak-auth-ldap/pom.xml
jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
Modified: jackrabbit/oak/trunk/oak-auth-ldap/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/pom.xml?rev=1775474&r1=1775473&r2=1775474&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-auth-ldap/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-auth-ldap/pom.xml Wed Dec 21 15:42:47 2016
@@ -99,36 +99,6 @@
</plugins>
</build>
</profile>
-
- <profile>
- <!-- Disable LDAP Server Integrations Tests on windows -->
- <id>disable-ldap-integration-windows</id>
- <activation>
- <!-- temporarily disable on windows: OAK-2904 -->
- <os>
- <family>Windows</family>
- </os>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/LdapProviderTest.class</exclude>
- <exclude>**/DefaultLdapLoginModuleTest.class</exclude>
- <exclude>**/GuestTokenDefaultLdapLoginModuleTest.class</exclude>
- <exclude>**/LdapDefaultLoginModuleTest.class</exclude>
- <exclude>**/LdapLoginStandaloneTest.class</exclude>
- <exclude>**/TokenDefaultLdapLoginModuleTest.class</exclude>
- <exclude>**/LargeLdapProviderTest.class</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
Modified: jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java?rev=1775474&r1=1775473&r2=1775474&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java (original)
+++ jackrabbit/oak/trunk/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java Wed Dec 21 15:42:47 2016
@@ -94,6 +94,8 @@ public abstract class AbstractServer {
protected int port = -1;
+ protected CacheService cacheService;
+
protected DirectoryService directoryService;
protected LdapServer ldapServer;
@@ -192,12 +194,12 @@ public abstract class AbstractServer {
directoryService.setShutdownHookEnabled(false);
directoryService.setInstanceLayout(new InstanceLayout(cwd));
- CacheService cache = new CacheService();
- cache.initialize(directoryService.getInstanceLayout());
+ cacheService = new CacheService();
+ cacheService.initialize(directoryService.getInstanceLayout());
SchemaManager schemaManager = new DefaultSchemaManager();
directoryService.setSchemaManager(schemaManager);
- directoryService.setDnFactory(new DefaultDnFactory(directoryService.getSchemaManager(), cache.getCache("dnCache")));
+ directoryService.setDnFactory(new DefaultDnFactory(directoryService.getSchemaManager(), cacheService.getCache("dnCache")));
AvlPartition schLdifPart = new AvlPartition(directoryService.getSchemaManager(), directoryService.getDnFactory());
schLdifPart.setId("schema");
@@ -215,7 +217,7 @@ public abstract class AbstractServer {
AvlPartition examplePart = new AvlPartition(directoryService.getSchemaManager(), directoryService.getDnFactory());
examplePart.setId("example");
examplePart.setSuffixDn(directoryService.getDnFactory().create(EXAMPLE_DN));
- examplePart.setCacheService(cache);
+ examplePart.setCacheService(cacheService);
directoryService.addPartition(examplePart);
// setup ldap server
@@ -360,11 +362,16 @@ public abstract class AbstractServer {
* Sets the system context root to null.
*/
protected void tearDown() throws Exception {
- ldapServer.stop();
+ if (ldapServer != null) {
+ ldapServer.stop();
+ }
try {
directoryService.shutdown();
} catch (Exception e) {
// ignore
}
+ if (cacheService != null) {
+ cacheService.destroy();
+ }
}
}