LDAP-258: Some minor restructuring to avoid (irrelevant, but ugly and build failing) package tangles in test cases.

This commit is contained in:
Mattias Hellborg Arthursson
2013-09-09 10:08:10 +02:00
parent e93ee9cf6a
commit d6f8f6e488
37 changed files with 144 additions and 127 deletions

View File

@@ -212,7 +212,7 @@ public abstract class AbstractContextSource implements BaseLdapPathContextSource
* @param ldapUrls all individual url Strings.
* @return the full url String
*/
protected String assembleProviderUrlString(String[] ldapUrls) {
public String assembleProviderUrlString(String[] ldapUrls) {
StringBuilder providerUrlBuffer = new StringBuilder(1024);
for (String ldapUrl : ldapUrls) {
providerUrlBuffer.append(ldapUrl);

View File

@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.transaction.compensating.support;
package org.springframework.ldap.transaction.compensating.manager;
import org.junit.Before;
import org.junit.Test;
import org.springframework.ldap.core.ContextSource;
import org.springframework.ldap.transaction.compensating.manager.DirContextHolder;
import org.springframework.transaction.compensating.CompensatingTransactionOperationManager;
import org.springframework.transaction.compensating.support.CompensatingTransactionHolderSupport;
import org.springframework.transaction.compensating.support.CompensatingTransactionUtils;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.naming.directory.DirContext;

View File

@@ -13,24 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.control;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import java.util.List;
import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
package org.springframework.ldap.itest.control;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.control.PagedResultsCookie;
import org.springframework.ldap.control.PagedResultsRequestControl;
import org.springframework.ldap.control.Person;
import org.springframework.ldap.core.CollectingNameClassPairCallbackHandler;
import org.springframework.ldap.core.ContextMapper;
import org.springframework.ldap.core.ContextMapperCallbackHandler;
@@ -41,6 +32,17 @@ import org.springframework.ldap.core.SearchExecutor;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
/**
* Tests the paged search result capability of LdapTemplate.
* <p>

View File

@@ -13,14 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.core;
import static junit.framework.Assert.assertEquals;
import java.util.List;
import javax.naming.Name;
import javax.naming.directory.SearchControls;
package org.springframework.ldap.itest.core;
import org.junit.After;
import org.junit.Before;
@@ -33,6 +26,12 @@ import org.springframework.ldap.test.AttributeCheckContextMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import javax.naming.Name;
import javax.naming.directory.SearchControls;
import java.util.List;
import static junit.framework.Assert.assertEquals;
/**
* Verifies that LdapTemplate search methods work against OpenLDAP with TLS.
*

View File

@@ -3,7 +3,7 @@
* distributed with this file and available online at
* http://www.ja-sig.org/products/cas/overview/license/index.html
*/
package org.springframework.ldap.core.support;
package org.springframework.ldap.itest.core.support;
import javax.naming.directory.DirContext;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.core;
package org.springframework.ldap.itest.core;
import static junit.framework.Assert.assertEquals;
@@ -25,6 +25,9 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.core.CollectingNameClassPairCallbackHandler;
import org.springframework.ldap.core.ContextMapperCallbackHandler;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.itest.Person;
import org.springframework.ldap.itest.PersonContextMapper;
import org.springframework.ldap.control.VirtualListViewControlDirContextProcessor;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.Before;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
@@ -39,7 +39,7 @@ import static junit.framework.Assert.assertEquals;
*
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class InvalidBackslashITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,13 +37,13 @@ import static junit.framework.Assert.assertEquals;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateAttributesMapperITest extends AbstractLdapTemplateIntegrationTest {
@Autowired
private LdapTemplate tested;
protected String[] getConfigLocations() {
return new String[] { "/conf/ldapTemplateTestContext.xml" };
return new String[] {"/conf/ldapTemplateTestContext.xml"};
}
@Test

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
@@ -27,6 +27,7 @@ import javax.naming.directory.DirContext;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.ldap.AuthenticationException;
import org.springframework.ldap.core.AuthenticatedLdapEntryContextCallback;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapEntryIdentification;
@@ -44,7 +45,7 @@ import org.springframework.test.context.ContextConfiguration;
* @author Mattias Hellborg Arthursson
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateAuthenticationITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.support.LdapUtils;
@@ -40,7 +41,7 @@ import static junit.framework.Assert.fail;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateBindUnbindITest extends
AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import static junit.framework.Assert.assertTrue;
@@ -32,7 +32,7 @@ import org.springframework.test.context.ContextConfiguration;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateContextExecutorTest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,7 +35,7 @@ import static junit.framework.Assert.assertEquals;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateContextMapperITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
@@ -37,7 +37,7 @@ import static junit.framework.Assert.assertTrue;
*
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateListITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,7 +42,7 @@ import static junit.framework.Assert.assertNull;
* @author Mattias Hellborg Arthursson
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateLookupITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,12 +14,13 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.AttributeInUseException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations;
import org.springframework.ldap.core.DistinguishedName;
@@ -50,7 +51,7 @@ import static junit.framework.Assert.fail;
* @author Mattias Hellborg Arthursson
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateModifyITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.core.support.CountNameClassPairCallbackHandler;
@@ -39,7 +40,7 @@ import static junit.framework.Assert.fail;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateNoBaseSuffixTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateNoBaseSuffixTestContext.xml"})
public class LdapTemplateNoBaseSuffixITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
@@ -37,7 +37,7 @@ import org.springframework.test.context.ContextConfiguration;
*
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateObjectBindTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateObjectBindTestContext.xml"})
public class LdapTemplateObjectBindIntegrationTest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,12 +14,13 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.support.LdapUtils;
@@ -37,7 +38,7 @@ import static junit.framework.Assert.fail;
* @author Mattias Hellborg Arthursson
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateRecursiveDeleteITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,12 +14,13 @@
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.support.LdapUtils;
@@ -38,7 +39,7 @@ import static junit.framework.Assert.fail;
*
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateRenameITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap;
package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
@@ -21,6 +21,7 @@ import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations;
import org.springframework.ldap.core.LdapTemplate;
@@ -46,7 +47,7 @@ import static junit.framework.Assert.fail;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapTemplateSearchResultITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.ldap.control;
package org.springframework.ldap.itest.control;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.core.ContextMapper;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.support.LdapUtils;
import org.springframework.test.context.ContextConfiguration;
@@ -35,7 +35,7 @@ import static junit.framework.Assert.assertEquals;
*
* @author Ulrik Sandberg
*/
@ContextConfiguration(locations = { "/conf/rootContextSourceTestContext.xml" })
@ContextConfiguration(locations = {"/conf/rootContextSourceTestContext.xml"})
public class SupportedControlsITest extends AbstractLdapTemplateIntegrationTest {
/** must use a context source that has no base set */
@Autowired

View File

@@ -13,23 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.core;
package org.springframework.ldap.itest.core;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.itest.core.DummyDistinguishedNameConsumer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
/**
* Integration tests for {@link DistinguishedNameEditor}.
* Integration tests for {@link org.springframework.ldap.core.DistinguishedNameEditor}.
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/distinguishedNameEditorTestContext.xml" })
@ContextConfiguration(locations = {"/conf/distinguishedNameEditorTestContext.xml"})
public class DistinguishedNameEditorITest extends AbstractJUnit4SpringContextTests {
@Autowired

View File

@@ -14,9 +14,10 @@
* limitations under the License.
*/
package org.springframework.ldap.core;
package org.springframework.ldap.itest.core;
import org.junit.Test;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.util.StopWatch;
/**

View File

@@ -13,17 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.core.simple;
package org.springframework.ldap.itest.core.simple;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations;
import org.springframework.ldap.core.DirContextProcessor;
import org.springframework.ldap.core.simple.ParameterizedContextMapper;
import org.springframework.ldap.core.simple.SimpleLdapTemplate;
import org.springframework.ldap.filter.AndFilter;
import org.springframework.ldap.filter.EqualsFilter;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.support.LdapUtils;
import org.springframework.test.context.ContextConfiguration;
@@ -37,7 +39,7 @@ import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
@ContextConfiguration(locations = { "/conf/simpleLdapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/simpleLdapTemplateTestContext.xml"})
public class SimpleLdapTemplateITest extends AbstractLdapTemplateIntegrationTest {
private static String DN_STRING = "cn=Some Person4,ou=company1,c=Sweden";

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.core.support;
package org.springframework.ldap.itest.core.support;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
@@ -39,7 +39,7 @@ public class BaseLdapPathBeanPostprocessorITest {
@Test
public void testPostProcessBeforeInitialization() throws Exception {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"/conf/baseLdapPathPostProcessorTestContext.xml");
"/conf/baseLdapPathPostProcessorTestContext.xml");
DummyBaseLdapPathAware tested = ctx.getBean(DummyBaseLdapPathAware.class);
DistinguishedName base = tested.getBase();
@@ -65,7 +65,7 @@ public class BaseLdapPathBeanPostprocessorITest {
@Test
public void testPostProcessBeforeInitializationMultipleContextSourcesOneSpecified() throws Exception {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"/conf/baseLdapPathPostProcessorMultiContextSourceOneSpecTestContext.xml");
"/conf/baseLdapPathPostProcessorMultiContextSourceOneSpecTestContext.xml");
DummyBaseLdapPathAware tested = (DummyBaseLdapPathAware) ctx.getBean("dummyBaseContextAware");
DistinguishedName base = tested.getBase();
@@ -88,7 +88,7 @@ public class BaseLdapPathBeanPostprocessorITest {
@Test
public void testPostProcessBeforeInitializationBaseSetInProperty() throws Exception {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"/conf/baseLdapPathPostProcessorPropertyOverrideTestContext.xml");
"/conf/baseLdapPathPostProcessorPropertyOverrideTestContext.xml");
DummyBaseLdapPathAware tested = (DummyBaseLdapPathAware) ctx.getBean("dummyBaseContextAware");
DistinguishedName base = tested.getBase();
@@ -99,7 +99,7 @@ public class BaseLdapPathBeanPostprocessorITest {
@Test
public void testPostProcessBeforeInitializationTransactionProxy() throws Exception {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"/conf/baseLdapPathPostProcessorTransactionTestContext.xml");
"/conf/baseLdapPathPostProcessorTransactionTestContext.xml");
DummyBaseLdapPathAware tested = (DummyBaseLdapPathAware) ctx.getBean("dummyBaseContextAware");
DistinguishedName base = tested.getBase();

View File

@@ -14,17 +14,18 @@
* limitations under the License.
*/
package org.springframework.ldap.core.support;
package org.springframework.ldap.itest.core.support;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.core.ContextSource;
import org.springframework.ldap.core.DirContextOperations;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.core.simple.AbstractParameterizedContextMapper;
import org.springframework.ldap.core.support.LdapContextSource;
import org.springframework.ldap.filter.EqualsFilter;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.support.LdapUtils;
import org.springframework.test.context.ContextConfiguration;
@@ -45,7 +46,7 @@ import static junit.framework.Assert.fail;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class LdapContextSourceIntegrationTest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -13,23 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.core.support;
import static junit.framework.Assert.assertEquals;
import javax.naming.NamingException;
package org.springframework.ldap.itest.core.support;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.core.support.LdapContextSource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import javax.naming.NamingException;
import static junit.framework.Assert.assertEquals;
/**
* Advanced integration tests for LdapContextSource.
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapContextSourceTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapContextSourceTestContext.xml"})
public class LdapContextSourceMultiServerIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired

View File

@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.filter;
package org.springframework.ldap.itest.filter;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.core.support.CountNameClassPairCallbackHandler;
import org.springframework.ldap.itest.filter.DummyFilterConsumer;
import org.springframework.ldap.filter.Filter;
import org.springframework.ldap.filter.HardcodedFilter;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.support.LdapUtils;
import org.springframework.test.context.ContextConfiguration;
@@ -30,7 +31,7 @@ import static junit.framework.Assert.assertTrue;
/**
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/hardcodedFilterTestContext.xml", "/conf/ldapTemplateTestContext.xml" })
@ContextConfiguration(locations = {"/conf/hardcodedFilterTestContext.xml", "/conf/ldapTemplateTestContext.xml" })
public class HardcodedFilterIntegrationTest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.ldap.integration;
package org.springframework.ldap.itest.integration;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.itest.LdapGroupDao;
import org.springframework.test.context.ContextConfiguration;
@@ -30,7 +30,7 @@ import static org.junit.Assert.assertNotNull;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldap-247-testContext.xml" })
@ContextConfiguration(locations = {"/conf/ldap-247-testContext.xml"})
public class JiraLdap247ITest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.transaction.compensating.manager;
package org.springframework.ldap.itest.manager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -25,10 +25,10 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.AttributesMapper;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyDao;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyException;
import org.springframework.test.context.ContextConfiguration;
@@ -49,7 +49,7 @@ import static junit.framework.Assert.fail;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapAndJdbcTransactionTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapAndJdbcTransactionTestContext.xml"})
public class ContextSourceAndDataSourceTransactionManagerIntegrationTest extends AbstractLdapTemplateIntegrationTest {
private static Log log = LogFactory.getLog(ContextSourceAndDataSourceTransactionManagerIntegrationTest.class);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap.transaction.compensating.manager;
package org.springframework.ldap.itest.manager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -13,15 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.transaction.compensating.manager;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
package org.springframework.ldap.itest.manager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -29,21 +21,29 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.AttributesMapper;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyDao;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyException;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
/**
* Integration tests for {@link ContextSourceAndDataSourceTransactionManager}.
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTransactionTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTransactionTestContext.xml"})
public class ContextSourceTransactionManagerIntegrationTest extends AbstractLdapTemplateIntegrationTest {
private static Log log = LogFactory.getLog(ContextSourceTransactionManagerIntegrationTest.class);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap.transaction.compensating.manager;
package org.springframework.ldap.itest.manager;
import org.junit.Before;
import org.junit.Test;
@@ -22,9 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyDao;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyException;
import org.springframework.test.context.ContextConfiguration;
@@ -39,7 +39,7 @@ import static junit.framework.Assert.fail;
*
* @author Mattias Hellborg Arthursson
*/
@ContextConfiguration(locations = { "/conf/ldapTemplateTransactionSubtreeTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapTemplateTransactionSubtreeTestContext.xml"})
public class ContextSourceTransactionManagerSubtreeIntegrationTest extends AbstractLdapTemplateIntegrationTest {
@Autowired

View File

@@ -13,18 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.transaction.compensating.manager.hibernate;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
import java.util.List;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
package org.springframework.ldap.itest.manager.hibernate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -37,10 +26,10 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.AttributesMapper;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.itest.transaction.compensating.manager.DummyException;
import org.springframework.ldap.itest.transaction.compensating.manager.hibernate.OrgPerson;
import org.springframework.ldap.itest.transaction.compensating.manager.hibernate.OrgPersonDao;
@@ -49,12 +38,22 @@ import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
/**
* Integration tests for {@link ContextSourceAndHibernateTransactionManager}.
*
* @author Hans Westerbeek
*/
@ContextConfiguration(locations = { "/conf/ldapAndHibernateTransactionTestContext.xml" })
@ContextConfiguration(locations = {"/conf/ldapAndHibernateTransactionTestContext.xml"})
public class ContextSourceAndHibernateTransactionManagerIntegrationTest extends AbstractLdapTemplateIntegrationTest {
private static Log log = LogFactory.getLog(ContextSourceAndHibernateTransactionManagerIntegrationTest.class);

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ldap.transaction.compensating.manager.hibernate;
package org.springframework.ldap.itest.manager.hibernate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Hans Westerbeek
*/
@ContextConfiguration(locations = { "/conf/missingLdapAndHibernateTransactionTestContext.xml" })
@ContextConfiguration(locations = {"/conf/missingLdapAndHibernateTransactionTestContext.xml"})
public class ContextSourceAndHibernateTransactionManagerLdap179IntegrationTest extends AbstractJUnit4SpringContextTests {
private static Log log = LogFactory.getLog(ContextSourceAndHibernateTransactionManagerLdap179IntegrationTest.class);