LDAP-262: Moved the stuff from the samples-utils project to plain-sample.

This commit is contained in:
Mattias Hellborg Arthursson
2013-09-12 08:07:15 +02:00
parent 9458b80fa1
commit 96429d00c6
17 changed files with 97 additions and 133 deletions

View File

@@ -4,7 +4,6 @@ apply plugin: 'jetty'
dependencies {
compile project(':spring-ldap-test'),
project(':spring-ldap-samples-utils'),
'log4j:log4j:1.2.9',
'javax.servlet:jstl:1.2',
"org.springframework:spring-context:$springVersion",

View File

@@ -1,10 +1,26 @@
/*
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.samples.utils;
import org.springframework.ldap.core.DirContextOperations;
import java.util.LinkedList;
import java.util.List;
import org.springframework.ldap.core.DirContextOperations;
public class HtmlRowLdapTreeVisitor implements LdapTreeVisitor {
private List<String> rows = new LinkedList<String>();

View File

@@ -1,10 +1,26 @@
/*
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.samples.utils;
import org.springframework.ldap.core.DirContextOperations;
import java.util.LinkedList;
import java.util.List;
import org.springframework.ldap.core.DirContextOperations;
public class LdapTree {
private final DirContextOperations node;

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.samples.utils;
import org.springframework.ldap.core.DirContextOperations;

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.samples.utils;
import org.springframework.ldap.core.DirContextOperations;
public interface LdapTreeVisitor {
public void visit(DirContextOperations node, int currentDepth);
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ldap.samples.utils;
import org.junit.Test;
@@ -14,7 +30,7 @@ import java.util.Map;
import static junit.framework.Assert.assertEquals;
@ContextConfiguration(locations = { "/conf/testContext.xml" })
@ContextConfiguration(locations = { "/config/testContext.xml" })
public class LdapTreeBuilderIntegrationTest extends AbstractJUnit4SpringContextTests {
@Autowired

View File

@@ -26,4 +26,8 @@
class="org.springframework.ldap.samples.plain.dao.PersonDaoImpl">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
<bean class="org.springframework.ldap.samples.utils.LdapTreeBuilder">
<constructor-arg ref="ldapTemplate" />
</bean>
</beans>

View File

@@ -1,4 +0,0 @@
target
.classpath
.project
.settings

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beansProjectDescription>
<version>1</version>
<pluginVersion><![CDATA[2.3.0.200912170948-RELEASE]]></pluginVersion>
<configSuffixes>
<configSuffix><![CDATA[xml]]></configSuffix>
</configSuffixes>
<enableImports><![CDATA[false]]></enableImports>
<configs>
</configs>
<configSets>
</configSets>
</beansProjectDescription>

View File

@@ -1,11 +0,0 @@
apply from: JAVA_SCRIPT
dependencies {
compile project(':spring-ldap-core-tiger'),
project(':spring-ldap-test')
testCompile "org.springframework:spring-test:$springVersion",
"junit:junit:$junitVersion"
}
test.enabled = false // FIXME this needs to be enabled, but fails since no LDAP server is started

View File

@@ -1,8 +0,0 @@
package org.springframework.ldap.samples.utils;
import org.springframework.ldap.core.DirContextOperations;
public interface LdapTreeVisitor {
public void visit(DirContextOperations node, int currentDepth);
}

View File

@@ -1,16 +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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!--
This context configuration file defines common beans,
minimizing duplication in the various test context files.
-->
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:/conf/ldap.properties" />
</bean>
</beans>

View File

@@ -1,4 +0,0 @@
urls=ldap://127.0.0.1:18885
userDn=uid=admin,ou=system
password=secret
base=dc=jayway,dc=se

View File

@@ -1,27 +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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<import resource="classpath:/conf/commonTestContext.xml" />
<bean id="contextSource"
class="org.springframework.ldap.test.TestContextSourceFactoryBean">
<property name="defaultPartitionSuffix" value="dc=jayway,dc=se" />
<property name="defaultPartitionName" value="jayway" />
<property name="principal" value="${userDn}" />
<property name="password" value="${password}" />
<property name="ldifFile" value="classpath:/setup_data.ldif" />
<property name="port" value="18885" />
</bean>
<bean id="ldapTemplate"
class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>
<bean
class="org.springframework.ldap.samples.utils.LdapTreeBuilder">
<constructor-arg ref="ldapTemplate" />
</bean>
</beans>

View File

@@ -1,7 +0,0 @@
log4j.rootCategory=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
log4j.logger.org.apache.directory=ERROR

View File

@@ -1,36 +0,0 @@
dn: c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: country
c: Sweden
description: The country of Sweden
dn: ou=company1,c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: organizationalUnit
ou: company1
description: First company in Sweden
dn: cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: some.person
userPassword: password
cn: Some Person
sn: Person
description: Sweden, Company1, Some Person
telephoneNumber: +46 555-123456
dn: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: some.person2
userPassword: password
cn: Some Person2
sn: Person2
description: Sweden, Company1, Some Person2
telephoneNumber: +46 555-654321

View File

@@ -15,7 +15,6 @@ include 'test/integration-tests-openldap'
include 'test/integration-tests-sunone'
include 'test/integration-tests-ad'
include 'samples/plain'
include 'samples/samples-utils'
include 'samples/simple-odm'
rootProject.children.each { p->