Skip to content

Commit

Permalink
DATALDAP-1 - Polishing.
Browse files Browse the repository at this point in the history
Split XML configuration into infrastructure and test-specific parts. Add test logging configuration. Rename test classes to end with Tests suffix.
  • Loading branch information
mp911de committed Dec 6, 2016
1 parent 39b6b4d commit ba9f653
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 31 deletions.
Expand Up @@ -42,7 +42,7 @@
/**
* @author Mattias Hellborg Arthursson
*/
public class SimpleLdapRepositoryTest {
public class SimpleLdapRepositoryTests {

private LdapOperations ldapOperationsMock;
private ObjectDirectoryMapper odmMock;
Expand Down
Expand Up @@ -46,7 +46,7 @@ public void testAnnotationConfig() {
}

@Configuration
@ImportResource("classpath:/ldap-annotation-config.xml")
@ImportResource("classpath:/infrastructure.xml")
@EnableLdapRepositories(basePackageClasses = DummyLdapRepository.class)
static class Config {}
}
Expand Up @@ -36,8 +36,8 @@
* @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;
Expand Down
Expand Up @@ -29,7 +29,7 @@
* @author Mattias Hellborg Arthursson
* @author Eddu Melendez
*/
public class QueryDslFilterGeneratorTest {
public class QueryDslFilterGeneratorTests {

private LdapSerializer tested;
private QPerson person;
Expand Down
13 changes: 0 additions & 13 deletions src/test/resources/ldap-annotation-config.xml

This file was deleted.

18 changes: 18 additions & 0 deletions src/test/resources/logback.xml
@@ -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>
1 change: 1 addition & 0 deletions src/test/resources/logging.properties
@@ -0,0 +1 @@
handlers = org.slf4j.bridge.SLF4JBridgeHandler
@@ -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>
13 changes: 0 additions & 13 deletions src/test/resources/query-test.xml

This file was deleted.

0 comments on commit ba9f653

Please sign in to comment.