Skip to content

Commit 1abcfbd

Browse files
committed
Add samples to build
Issue gh-610
1 parent de0f7ae commit 1abcfbd

File tree

8 files changed

+30
-17
lines changed

8 files changed

+30
-17
lines changed

samples/odm/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
plugins {
2+
id 'io.spring.convention.spring-module'
23
id "org.gretty"
34
id 'war'
45
}
56

67
dependencies {
8+
management platform(project(":spring-ldap-dependencies"))
9+
710
implementation project(':spring-ldap-test'),
811
'javax.servlet:jstl:1.2',
912
"org.springframework:spring-context",
1013
"org.springframework:spring-webmvc",
11-
"org.springframework.data:spring-data-commons",
1214
"commons-lang:commons-lang"
1315

1416
compileOnly "javax.servlet:servlet-api:2.5"
1517

1618
runtimeOnly 'ch.qos.logback:logback-classic:1.0.13'
1719

20+
testImplementation "com.unboundid:unboundid-ldapsdk"
21+
testImplementation platform('org.junit:junit-bom')
22+
testImplementation "org.junit.vintage:junit-vintage-engine"
1823
testImplementation "org.springframework:spring-test",
1924
"junit:junit",
2025
"org.assertj:assertj-core"

samples/odm/src/main/resources/applicationContext.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<beans profile="default">
2929
<!-- Populates the LDAP server with initial data -->
30-
<bean class="org.springframework.ldap.test.LdifPopulator" depends-on="embeddedLdapServer">
30+
<bean class="org.springframework.ldap.test.unboundid.LdifPopulator" depends-on="embeddedLdapServer">
3131
<property name="contextSource" ref="contextSource" />
3232
<property name="resource" value="classpath:/setup_data.ldif" />
3333
<property name="base" value="${sample.ldap.base}" />

samples/odm/src/test/resources/config/testContext.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
<!-- Populates the LDAP server with initial data -->
19-
<bean class="org.springframework.ldap.test.LdifPopulator" depends-on="embeddedLdapServer">
19+
<bean class="org.springframework.ldap.test.unboundid.LdifPopulator" depends-on="embeddedLdapServer">
2020
<property name="contextSource" ref="contextSource" />
2121
<property name="resource" value="classpath:/setup_data.ldif" />
2222
<property name="base" value="${sample.ldap.base}" />
@@ -28,8 +28,8 @@
2828
This is for test and demo purposes only - EmbeddedLdapServerFactoryBean launches an in-process
2929
LDAP server.
3030
-->
31-
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.EmbeddedLdapServerFactoryBean">
32-
<property name="partitionName" value="example"/>
31+
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.unboundid.EmbeddedLdapServerFactoryBean">
32+
<property name="partitionName" value="jayway"/>
3333
<property name="partitionSuffix" value="${sample.ldap.base}" />
3434
<property name="port" value="18880" />
3535
</bean>

samples/plain/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
plugins {
2+
id 'io.spring.convention.spring-module'
23
id "org.gretty"
34
id 'war'
45
}
56

67
dependencies {
8+
management platform(project(":spring-ldap-dependencies"))
9+
710
implementation project(':spring-ldap-test'),
811
'javax.servlet:jstl:1.2',
912
"org.springframework:spring-context",
1013
"org.springframework:spring-webmvc",
11-
"org.springframework.data:spring-data-commons"
14+
"commons-lang:commons-lang"
1215

1316
compileOnly "javax.servlet:servlet-api:2.5"
1417

1518
runtimeOnly 'ch.qos.logback:logback-classic:1.0.13'
1619

20+
testImplementation "com.unboundid:unboundid-ldapsdk"
21+
testImplementation platform('org.junit:junit-bom')
22+
testImplementation "org.junit.vintage:junit-vintage-engine"
1723
testImplementation "org.springframework:spring-test",
1824
"junit:junit",
1925
"org.assertj:assertj-core"

samples/plain/src/main/java/org/springframework/ldap/samples/plain/web/DefaultController.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
package org.springframework.ldap.samples.plain.web;
22

3+
import java.io.UnsupportedEncodingException;
4+
import java.net.URLEncoder;
5+
6+
import javax.naming.Name;
7+
38
import org.apache.commons.lang.StringUtils;
9+
410
import org.springframework.beans.factory.annotation.Autowired;
511
import org.springframework.ldap.core.DirContextOperations;
612
import org.springframework.ldap.samples.plain.dao.PersonDao;
@@ -14,10 +20,6 @@
1420
import org.springframework.web.bind.annotation.RequestMapping;
1521
import org.springframework.web.servlet.ModelAndView;
1622

17-
import javax.naming.Name;
18-
import java.io.UnsupportedEncodingException;
19-
import java.net.URLEncoder;
20-
2123
/**
2224
* Default controller.
2325
*

samples/plain/src/main/resources/applicationContext.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<beans profile="default">
2929
<!-- Populates the LDAP server with initial data -->
30-
<bean class="org.springframework.ldap.test.LdifPopulator" depends-on="embeddedLdapServer">
30+
<bean id="ldifPopulator" class="org.springframework.ldap.test.LdifPopulator" depends-on="embeddedLdapServer">
3131
<property name="contextSource" ref="contextSource" />
3232
<property name="resource" value="classpath:/setup_data.ldif" />
3333
<property name="base" value="${sample.ldap.base}" />
@@ -39,8 +39,8 @@
3939
This is for test and demo purposes only - EmbeddedLdapServerFactoryBean launches an in-process
4040
LDAP server.
4141
-->
42-
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.EmbeddedLdapServerFactoryBean">
43-
<property name="partitionName" value="example"/>
42+
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.unboundid.EmbeddedLdapServerFactoryBean">
43+
<property name="partitionName" value="jayway"/>
4444
<property name="partitionSuffix" value="${sample.ldap.base}" />
4545
<property name="port" value="18880" />
4646
</bean>

samples/plain/src/test/resources/config/testContext.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
This is for test and demo purposes only - EmbeddedLdapServerFactoryBean launches an in-process
2828
LDAP server.
2929
-->
30-
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.EmbeddedLdapServerFactoryBean">
31-
<property name="partitionName" value="example"/>
30+
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.unboundid.EmbeddedLdapServerFactoryBean">
31+
<property name="partitionName" value="jayway"/>
3232
<property name="partitionSuffix" value="${sample.ldap.base}" />
3333
<property name="port" value="18880" />
3434
</bean>

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ include 'test/integration-tests'
3636
include 'test/integration-tests-openldap'
3737
include 'test/integration-tests-sunone'
3838
include 'test/integration-tests-ad'
39-
//include 'samples/plain'
40-
//include 'samples/odm'
39+
include 'samples/plain'
40+
include 'samples/odm'
4141

4242

4343
rootProject.children.each { p->

0 commit comments

Comments
 (0)