DATALDAP-1 - Polishing.

Split XML configuration into infrastructure and test-specific parts. Add test logging configuration. Rename test classes to end with Tests suffix.
This commit is contained in:
Mark Paluch
2016-12-06 10:15:26 +01:00
parent 39b6b4d6af
commit ba9f653c95
9 changed files with 37 additions and 31 deletions

View File

@@ -42,7 +42,7 @@ import org.springframework.ldap.support.LdapUtils;
/**
* @author Mattias Hellborg Arthursson
*/
public class SimpleLdapRepositoryTest {
public class SimpleLdapRepositoryTests {
private LdapOperations ldapOperationsMock;
private ObjectDirectoryMapper odmMock;

View File

@@ -46,7 +46,7 @@ public class AnnotationConfigTests {
}
@Configuration
@ImportResource("classpath:/ldap-annotation-config.xml")
@ImportResource("classpath:/infrastructure.xml")
@EnableLdapRepositories(basePackageClasses = DummyLdapRepository.class)
static class Config {}
}

View File

@@ -36,8 +36,8 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
* @author Mattias Hellborg Arthursson
* @author Eddu Melendez
*/
@ContextConfiguration("classpath:/query-test.xml")
public class PartTreeLdapRepositoryQueryTest extends AbstractJUnit4SpringContextTests {
@ContextConfiguration
public class PartTreeLdapRepositoryQueryTests extends AbstractJUnit4SpringContextTests {
@Autowired private LdapTemplate ldapTemplate;
private Class<?> targetClass;

View File

@@ -29,7 +29,7 @@ import com.querydsl.core.types.Expression;
* @author Mattias Hellborg Arthursson
* @author Eddu Melendez
*/
public class QueryDslFilterGeneratorTest {
public class QueryDslFilterGeneratorTests {
private LdapSerializer tested;
private QPerson person;

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<ldap:context-source password="apassword" url="ldap://localhost:389" username="uid=admin"/>
<ldap:ldap-template/>
<context:component-scan base-package="org.springframework.data.ldap.repository.config"/>
</beans>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<!--
<logger name="org.springframework" level="debug" />
-->
<root level="error">
<appender-ref ref="console" />
</root>
</configuration>

View File

@@ -0,0 +1 @@
handlers = org.slf4j.bridge.SLF4JBridgeHandler

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:data-ldap="http://www.springframework.org/schema/data/ldap"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/ldap http://www.springframework.org/schema/data/ldap/spring-ldap.xsd
">
<import resource="classpath:infrastructure.xml"/>
<data-ldap:repositories base-package="org.springframework.ldap.repository.query"/>
</beans>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd">
<ldap:context-source url="ldap://localhost:389"
username="cn=Admin"
password="secret" />
<ldap:ldap-template />
<ldap:repositories base-package="org.springframework.ldap.repository.query" />
</beans>