blob: d77b4491a41d2e2694f5ddbaa7c61ef3fab463de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
package org.apache.tuscany.das.ldap.connect.test;
import javax.naming.ldap.LdapContext;
import org.apache.tuscany.das.ldap.connect.ADSEmbeddedConnection;
import org.apache.tuscany.model.Configuration;
import org.apache.tuscany.model.ConfigurationFactory;
import junit.framework.TestCase;
public class ADSEmbeddedConnectionTest extends TestCase {
public void testConnect() throws Exception
{
Configuration configuration =
ConfigurationFactory.
INSTANCE.
createConfiguration();
ADSEmbeddedConnection adsEmbeddedConnection =
new ADSEmbeddedConnection(configuration);
LdapContext dasContext =
adsEmbeddedConnection.
connect(
configuration.
getDasPartitionName());
assertEquals(
dasContext.getNameInNamespace(),
"ou=das");
LdapContext schemaContext =
adsEmbeddedConnection.
connect(
configuration.
getSchemaPartitionName());
assertEquals(
schemaContext.getNameInNamespace(),
"ou=schema");
configuration.setDasPartitionName("system");
LdapContext systemContext =
adsEmbeddedConnection.connect(configuration.getDasPartitionName());
assertEquals(
systemContext.getNameInNamespace(),
"ou=system");
adsEmbeddedConnection.shutdown();
}
}
|