You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2021/04/18 21:44:34 UTC
[directory-studio] branch DIRSTUDIO-1274-rework-integration-tests
updated: Migrate entry editor tests
This is an automated email from the ASF dual-hosted git repository.
seelmann pushed a commit to branch DIRSTUDIO-1274-rework-integration-tests
in repository https://gitbox.apache.org/repos/asf/directory-studio.git
The following commit(s) were added to refs/heads/DIRSTUDIO-1274-rework-integration-tests by this push:
new 9bd6bab Migrate entry editor tests
9bd6bab is described below
commit 9bd6bab739bb58f29ae6fc0a00de8c1fec315c7a
Author: Stefan Seelmann <ma...@stefan-seelmann.de>
AuthorDate: Sun Apr 18 23:44:03 2021 +0200
Migrate entry editor tests
---
.../test/integration/junit5/TestFixture.java | 8 +
.../test/integration/junit5/TestLdapServer.java | 28 ++
.../studio/test/integration/junit5/ApacheDS.ldif | 55 +++
.../test/integration/junit5/TestFixture.ldif | 75 ++++
.../test/integration/ui/AbstractTestBase.java | 22 +-
.../studio/test/integration/ui/BrowserTest.java | 17 -
.../test/integration/ui/EntryEditorTest.java | 401 ++++++++++++---------
.../test/integration/ui/Fedora389dsTest.java | 71 ----
.../studio/test/integration/ui/OpenLdapTest.java | 70 ----
.../integration/ui/bots/ConnectionsViewBot.java | 5 +-
10 files changed, 407 insertions(+), 345 deletions(-)
diff --git a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestFixture.java b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestFixture.java
index da801f1..7c29967 100644
--- a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestFixture.java
+++ b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestFixture.java
@@ -103,6 +103,8 @@ public class TestFixture
public static final Dn MISC1_DN = dn( "ou=misc.1", MISC_DN );
public static final Dn MISC11_DN = dn( "ou=misc.1.1", MISC1_DN );
public static final Dn MISC111_DN = dn( "ou=misc.1.1.1", MISC11_DN );
+ public static final Dn BJENSEN_DN = dn( "cn=Barbara Jensen", MISC_DN );
+ public static final Dn HNELSON_DN = dn( "uid=hnelson", MISC_DN );
public static final Dn MULTI_VALUED_RDN_DN = dn( "cn=Barbara Jensen+uid=bjensen", MISC_DN );
public static final Dn DN_WITH_LEADING_SHARP_BACKSLASH_PREFIXED = dn( "cn=\\#123456", MISC_DN );
public static final Dn DN_WITH_LEADING_SHARP_HEX_PAIR_ESCAPED = dn( "cn=\\23123456", MISC_DN );
@@ -120,6 +122,9 @@ public class TestFixture
public static final Dn USER3_DN = dn( "uid=user.3", USERS_DN );
public static final Dn USER8_DN = dn( "uid=user.8", USERS_DN );
+ public static final Dn GROUPS_DN = dn( "ou=groups", CONTEXT_DN );
+ public static final Dn GROUP1_DN = dn( "cn=group.1", GROUPS_DN );
+
public static final Dn REFERRALS_DN = dn( "ou=referrals", CONTEXT_DN );
public static final Dn REFERRAL_TO_USERS_DN = dn( "cn=referral-to-users", REFERRALS_DN );
public static final Dn REFERRAL_TO_USER1_DN = dn( "cn=referral-to-user.1", REFERRALS_DN );
@@ -149,6 +154,7 @@ public class TestFixture
ldapServer.withAdminConnection( connection -> {
try ( LdifReader ldifReader = new LdifReader( TestFixture.class.getResourceAsStream( TEST_FIXTURE_LDIF ) ) )
{
+ ldifReader.setSchemaManager( connection.getSchemaManager() );
for ( LdifEntry entry : ldifReader )
{
replaceRefLdapUrl( ldapServer, entry );
@@ -188,6 +194,8 @@ public class TestFixture
// delete ou=referrals
deleteTree( connection, REFERRALS_DN, Optional.of( Controls.MANAGEDSAIT_CONTROL ) );
+ // delete ou=groups
+ deleteTree( connection, GROUPS_DN, Optional.empty() );
// delete ou=users
deleteTree( connection, USERS_DN, Optional.empty() );
// delete ou=misc
diff --git a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestLdapServer.java b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestLdapServer.java
index 6b36cc4..50bc9f6 100644
--- a/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestLdapServer.java
+++ b/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/junit5/TestLdapServer.java
@@ -23,6 +23,8 @@ package org.apache.directory.studio.test.integration.junit5;
import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.ldif.LdifEntry;
+import org.apache.directory.api.ldap.model.ldif.LdifReader;
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.ldap.client.api.LdapNetworkConnection;
import org.apache.directory.ldap.client.api.exception.InvalidConnectionException;
@@ -124,6 +126,32 @@ public abstract class TestLdapServer
TestFixture.createContextEntry( this );
TestFixture.cleanup( this );
TestFixture.importData( this );
+
+ String serverSpecificLdif = getType().name() + ".ldif";
+ if ( TestFixture.class.getResource( serverSpecificLdif ) != null )
+ {
+ withAdminConnection( connection -> {
+ try ( LdifReader ldifReader = new LdifReader(
+ TestFixture.class.getResourceAsStream( serverSpecificLdif ) ) )
+ {
+ for ( LdifEntry entry : ldifReader )
+ {
+ if ( entry.isChangeModify() )
+ {
+ connection.modify( entry.getDn(), entry.getModificationArray() );
+ }
+ if ( entry.isChangeAdd() )
+ {
+ connection.add( entry.getEntry() );
+ }
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Unexpected exception: " + e, e );
+ }
+ } );
+ }
}
diff --git a/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/ApacheDS.ldif b/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/ApacheDS.ldif
new file mode 100644
index 0000000..2eceeea
--- /dev/null
+++ b/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/ApacheDS.ldif
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+dn: ou=misc,dc=example,dc=org
+changetype: modify
+add: administrativeRole
+administrativeRole: accessControlSpecificArea
+-
+
+dn: cn=subentry,ou=misc,dc=example,dc=org
+changetype: add
+objectClass: top
+objectClass: subentry
+cn: subentry
+subtreeSpecification: {}
+
+dn: uid=hnelson,ou=misc,dc=example,dc=org
+changetype: modify
+add: subtreeSpecification
+subtreeSpecification: {}
+-
+add: entryACI
+entryACI: { identificationTag "test", precedence 1, authenticationLevel none,
+ itemOrUserFirst userFirst: { userClasses { subtree { { base "dc=example,dc=co
+ m", minimum 1, maximum 2, specificExclusions { chopBefore: "dc=example,dc=com
+ " } } }, allUsers, userGroup { "dc=example,dc=com" } }, userPermissions { { p
+ recedence 2, protectedItems { allUserAttributeTypes, attributeValue {userpass
+ word=* }, maxImmSub 2, entry, maxValueCount {{ type userPassword, maxCount 2
+ }} }, grantsAndDenials { denyRemove, grantReturnDN, denyModify, denyAdd, deny
+ Rename, grantFilterMatch, grantBrowse, grantRead, grantCompare } } } } }
+-
+add: prescriptiveACI
+prescriptiveACI: { identificationTag "allUsersACI", precedence 10, authenticat
+ ionLevel simple, itemOrUserFirst userFirst: { userClasses { allUsers }, userP
+ ermissions { { protectedItems { allUserAttributeTypesAndValues, entry }, gran
+ tsAndDenials { grantReturnDN, grantCompare, grantRead, grantDiscloseOnError,
+ grantFilterMatch, grantBrowse } }, { protectedItems { attributeType { userPas
+ sword } }, grantsAndDenials { denyCompare, denyRead, denyFilterMatch } } } }
+ }
+-
diff --git a/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/TestFixture.ldif b/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/TestFixture.ldif
index 79d3847..522497a 100644
--- a/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/TestFixture.ldif
+++ b/tests/test.integration.core/src/main/resources/org/apache/directory/studio/test/integration/junit5/TestFixture.ldif
@@ -27,6 +27,56 @@ objectClass: top
objectClass: organizationalUnit
ou: misc
+dn: cn=Barbara Jensen,ou=misc,dc=example,dc=org
+objectClass: inetOrgPerson
+objectClass: organizationalPerson
+objectClass: person
+objectClass: top
+cn: Barbara Jensen
+sn: Jensen
+givenName: Barbara
+uid: bjensen
+
+dn: uid=hnelson,ou=misc,dc=example,dc=org
+objectClass: inetOrgPerson
+objectClass: organizationalPerson
+objectClass: person
+objectClass: top
+objectClass: extensibleObject
+cn: Horatio Nelson
+sn: Nelson
+uid: hnelson
+description:: QSDDqSDigqwg0K8gzrsg16kg2Lkg4ruhIA==
+userPassword:: e1NTSEE1MTJ9aUlyTG1uR0MxdTNaTGFPWmRvSjZUMjBKdG9XQ05wWjArWGFLRnN
+ 5bEVEdFpYK3I3bUZrcjRwYTNKMXE3VWpSZ3ZFV2lCd1FNUjZadjBoYnRsYnRqSTQ2TmR6WVRDdG9G
+jpegPhoto:: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw
+ 8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRw
+ hMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAB
+ AAEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEA
+ wUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKS
+ o0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqK
+ jpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QA
+ HwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEB
+ SExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSE
+ lKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba
+ 3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iii
+ gD//2Q==
+userSMIMECertificate:: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJyg
+ pKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFi
+ Y2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbn
+ J2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1d
+ bX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==
+userSMIMECertificate:: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJyg
+ pKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFi
+ Y2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbn
+ J2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1d
+ bX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/wA=
+userSMIMECertificate:: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJyg
+ pKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFi
+ Y2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbn
+ J2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1d
+ bX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+
+
# Multi-valued RDN
dn: cn=Barbara Jensen+uid=bjensen,ou=misc,dc=example,dc=org
objectClass: inetOrgPerson
@@ -95,6 +145,7 @@ objectClass: top
objectClass: organizationalUnit
ou: misc.1.1.1
+
#
# ou=users
# Fixed number of users used by severals search tests that expect a fixed entry set.
@@ -307,6 +358,30 @@ description: This is the description for Abahri Abazari.
roomNumber: 1963
#
+# ou=groups
+# Group entries
+#
+
+dn: ou=groups,dc=example,dc=org
+objectClass: organizationalUnit
+objectClass: top
+ou: groups
+
+dn: cn=group.1,ou=groups,dc=example,dc=org
+objectClass: groupOfNames
+objectClass: top
+cn: group.1
+member: uid=user.1,ou=users,dc=example,dc=org
+member: uid=user.2,ou=users,dc=example,dc=org
+member: uid=user.3,ou=users,dc=example,dc=org
+member: uid=user.4,ou=users,dc=example,dc=org
+member: uid=user.5,ou=users,dc=example,dc=org
+member: uid=user.6,ou=users,dc=example,dc=org
+member: uid=user.7,ou=users,dc=example,dc=org
+member: uid=user.8,ou=users,dc=example,dc=org
+
+
+#
# ou=referrals
# Entries for referral specific test scenarios.
#
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java
index 5efdf1f..828f52f 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java
@@ -72,12 +72,6 @@ public class AbstractTestBase
}
- public static String[] path( Dn dn, String leaf )
- {
- return ArrayUtils.addAll( path( dn ), leaf );
- }
-
-
/**
* Gets the path to the DN in the LDAP browser tree.
* The path starts with "DIT", "Root DSE", and the context entry.
@@ -104,14 +98,24 @@ public class AbstractTestBase
*/
public static String[] path( Dn dn, Rdn rdn )
{
- return ArrayUtils.add( path( dn ), rdn.getName() );
+ return path( dn, rdn.getName() );
+ }
+
+
+ /**
+ * Gets the path to the leaf below the DN in the LDAP browser tree.
+ * The path starts with "DIT", "Root DSE", and the context entry.
+ */
+ public static String[] path( Dn dn, String leaf )
+ {
+ return ArrayUtils.addAll( path( dn ), leaf );
}
public static String[] pathWithRefLdapUrl( TestLdapServer ldapServer, Dn dn )
{
- String s = ldapServer.getLdapUrl() + "/" + dn.getName();
- return path( path( REFERRALS_DN ), s );
+ String leaf = ldapServer.getLdapUrl() + "/" + dn.getName();
+ return path( REFERRALS_DN, leaf );
}
}
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
index 0543649..5d7d84a 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
@@ -47,10 +47,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.lang3.StringUtils;
import org.apache.directory.api.ldap.model.entry.DefaultEntry;
-import org.apache.directory.api.ldap.model.entry.DefaultModification;
import org.apache.directory.api.ldap.model.entry.Entry;
-import org.apache.directory.api.ldap.model.entry.Modification;
-import org.apache.directory.api.ldap.model.entry.ModificationOperation;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.studio.connection.core.Connection;
import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
@@ -800,20 +797,6 @@ public class BrowserTest extends AbstractTestBase
{
Dn subentryDn = dn( "cn=subentry", MISC_DN );
- server.withAdminConnection( connection -> {
-
- Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
- "administrativeRole", "accessControlSpecificArea" );
- connection.modify( subentryDn.getParent(), mod );
-
- Entry subentry = new DefaultEntry( connection.getSchemaManager() );
- subentry.setDn( subentryDn );
- subentry.add( "objectClass", "top", "subentry" );
- subentry.add( "cn", "subentry" );
- subentry.add( "subtreeSpecification", "{}" );
- connection.add( subentry );
- } );
-
// enable Subentries control
Connection connection = connectionsViewBot.createTestConnection( server );
connection.getConnectionParameter().setExtendedBoolProperty(
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
index 7565099..226889b 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
@@ -21,6 +21,11 @@
package org.apache.directory.studio.test.integration.ui;
+import static org.apache.directory.studio.test.integration.junit5.TestFixture.BJENSEN_DN;
+import static org.apache.directory.studio.test.integration.junit5.TestFixture.HNELSON_DN;
+import static org.apache.directory.studio.test.integration.junit5.TestFixture.GROUP1_DN;
+import static org.apache.directory.studio.test.integration.junit5.TestFixture.MULTI_VALUED_RDN_DN;
+import static org.apache.directory.studio.test.integration.junit5.TestFixture.USER1_DN;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
@@ -28,46 +33,40 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
import org.apache.directory.api.ldap.model.constants.LdapSecurityConstants;
import org.apache.directory.api.ldap.model.entry.Entry;
-import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.password.PasswordUtil;
import org.apache.directory.api.util.Strings;
-import org.apache.directory.server.annotations.CreateLdapServer;
-import org.apache.directory.server.annotations.CreateTransport;
-import org.apache.directory.server.core.annotations.ApplyLdifFiles;
-import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.studio.connection.core.Connection;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyMode;
import org.apache.directory.studio.ldifparser.LdifFormatParameters;
import org.apache.directory.studio.ldifparser.LdifParserConstants;
import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.test.integration.junit5.LdapServerType;
+import org.apache.directory.studio.test.integration.junit5.LdapServersSource;
+import org.apache.directory.studio.test.integration.junit5.TestLdapServer;
import org.apache.directory.studio.test.integration.ui.bots.AciItemEditorDialogBot;
-import org.apache.directory.studio.test.integration.ui.bots.BrowserViewBot;
import org.apache.directory.studio.test.integration.ui.bots.CertificateEditorDialogBot;
-import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot;
import org.apache.directory.studio.test.integration.ui.bots.DnEditorDialogBot;
import org.apache.directory.studio.test.integration.ui.bots.EntryEditorBot;
import org.apache.directory.studio.test.integration.ui.bots.HexEditorDialogBot;
import org.apache.directory.studio.test.integration.ui.bots.ImageEditorDialogBot;
-import org.apache.directory.studio.test.integration.ui.bots.ModificationLogsViewBot;
import org.apache.directory.studio.test.integration.ui.bots.NewAttributeWizardBot;
import org.apache.directory.studio.test.integration.ui.bots.PasswordEditorDialogBot;
import org.apache.directory.studio.test.integration.ui.bots.SelectDnDialogBot;
-import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
import org.apache.directory.studio.test.integration.ui.bots.SubtreeSpecificationEditorDialogBot;
import org.apache.directory.studio.test.integration.ui.bots.TextEditorDialogBot;
-import org.apache.directory.studio.test.integration.ui.bots.utils.Assertions;
import org.apache.directory.studio.test.integration.ui.bots.utils.Characters;
-import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.params.ParameterizedTest;
/**
@@ -76,50 +75,23 @@ import org.junit.runner.RunWith;
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
-@CreateLdapServer(transports =
- { @CreateTransport(protocol = "LDAP") })
-@ApplyLdifFiles(clazz = EntryEditorTest.class, value =
- { "org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif" })
-public class EntryEditorTest extends AbstractLdapTestUnit
+public class EntryEditorTest extends AbstractTestBase
{
- private StudioBot studioBot;
- private ConnectionsViewBot connectionsViewBot;
- private BrowserViewBot browserViewBot;
- private ModificationLogsViewBot modificationLogsViewBot;
-
- @Before
- public void setUp() throws Exception
- {
- studioBot = new StudioBot();
- studioBot.resetLdapPerspective();
- connectionsViewBot = studioBot.getConnectionView();
- connectionsViewBot.createTestConnection( "EntryEditorTest", ldapServer.getPort() );
- browserViewBot = studioBot.getBrowserView();
- modificationLogsViewBot = studioBot.getModificationLogsViewBot();
- }
-
-
- @After
- public void tearDown() throws Exception
- {
- connectionsViewBot.deleteTestConnections();
- Assertions.genericTearDownAssertions();
- }
-
/**
* Test adding, editing and deleting of attributes in the entry editor.
*/
- @Test
- public void testAddEditDeleteAttribute() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testAddEditDeleteAttribute( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
String dn = entryEditorBot.getDnText();
- assertEquals( "DN: cn=Barbara Jensen,ou=users,ou=system", dn );
+ assertEquals( "DN: " + BJENSEN_DN.getName(), dn );
assertEquals( 8, entryEditorBot.getAttributeValues().size() );
assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
@@ -183,15 +155,25 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* Test adding, editing and deleting of attributes without equality matching rule in the entry editor.
*/
- @Test
- public void testAddEditDeleteAttributeWithoutEqualityMatchingRule() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testAddEditDeleteAttributeWithoutEqualityMatchingRule( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ Connection connection = connectionsViewBot.createTestConnection( server );
+
+ if ( server.getType() == LdapServerType.OpenLdap )
+ {
+ IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
+ .getBrowserConnection( connection );
+ browserConnection.setModifyModeNoEMR( ModifyMode.REPLACE );
+ }
+
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
String dn = entryEditorBot.getDnText();
- assertEquals( "DN: cn=Barbara Jensen,ou=users,ou=system", dn );
+ assertEquals( "DN: " + BJENSEN_DN.getName(), dn );
assertEquals( 8, entryEditorBot.getAttributeValues().size() );
assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
@@ -204,8 +186,18 @@ public class EntryEditorTest extends AbstractLdapTestUnit
entryEditorBot.typeValueAndFinish( "+1 234 567 890" );
assertEquals( 9, entryEditorBot.getAttributeValues().size() );
assertTrue( entryEditorBot.getAttributeValues().contains( "facsimileTelephoneNumber: +1 234 567 890" ) );
- modificationLogsViewBot
- .waitForText( "add: facsimileTelephoneNumber\nfacsimileTelephoneNumber: +1 234 567 890" );
+ if ( server.getType() == LdapServerType.OpenLdap )
+ {
+ modificationLogsViewBot
+ .waitForText( "replace: facsimileTelephoneNumber\nfacsimileTelephoneNumber: +1 234 567 890" );
+
+ }
+ else
+ {
+ modificationLogsViewBot
+ .waitForText( "add: facsimileTelephoneNumber\nfacsimileTelephoneNumber: +1 234 567 890" );
+
+ }
// edit value
entryEditorBot.editValue( "facsimileTelephoneNumber", "+1 234 567 890" );
@@ -213,16 +205,34 @@ public class EntryEditorTest extends AbstractLdapTestUnit
assertEquals( 9, entryEditorBot.getAttributeValues().size() );
assertFalse( entryEditorBot.getAttributeValues().contains( "facsimileTelephoneNumber: +1 234 567 890" ) );
assertTrue( entryEditorBot.getAttributeValues().contains( "facsimileTelephoneNumber: 000000000000" ) );
- modificationLogsViewBot
- .waitForText( "delete: facsimileTelephoneNumber\nfacsimileTelephoneNumber: +1 234 567 890" );
- modificationLogsViewBot.waitForText( "add: facsimileTelephoneNumber\nfacsimileTelephoneNumber: 000000000000" );
+ if ( server.getType() == LdapServerType.OpenLdap )
+ {
+ modificationLogsViewBot
+ .waitForText( "replace: facsimileTelephoneNumber\nfacsimileTelephoneNumber: 000000000000" );
+
+ }
+ else
+ {
+ modificationLogsViewBot
+ .waitForText( "delete: facsimileTelephoneNumber\nfacsimileTelephoneNumber: +1 234 567 890" );
+ modificationLogsViewBot
+ .waitForText( "add: facsimileTelephoneNumber\nfacsimileTelephoneNumber: 000000000000" );
+ }
// delete 1st value/attribute
entryEditorBot.deleteValue( "facsimileTelephoneNumber", "000000000000" );
assertEquals( 8, entryEditorBot.getAttributeValues().size() );
assertFalse( entryEditorBot.getAttributeValues().contains( "facsimileTelephoneNumber: 000000000000" ) );
- modificationLogsViewBot
- .waitForText( "delete: facsimileTelephoneNumber\nfacsimileTelephoneNumber: 000000000000\n-" );
+ if ( server.getType() == LdapServerType.OpenLdap )
+ {
+ modificationLogsViewBot.waitForText( "replace: facsimileTelephoneNumber\n-" );
+
+ }
+ else
+ {
+ modificationLogsViewBot
+ .waitForText( "delete: facsimileTelephoneNumber\nfacsimileTelephoneNumber: 000000000000\n-" );
+ }
assertEquals( "Expected 3 modifications.", 3,
StringUtils.countMatches( modificationLogsViewBot.getModificationLogsText(), "#!RESULT OK" ) );
@@ -231,20 +241,19 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* DIRSTUDIO-483: DN Editor escapes all non-ascii characters
- *
- * @throws Exception
- * the exception
*/
- @Test
- public void testDnValueEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testDnValueEditor( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=groups", "cn=My Group" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( GROUP1_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=My Group,ou=groups,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( GROUP1_DN.getName() );
entryEditorBot.activate();
String dn = entryEditorBot.getDnText();
- assertEquals( "DN: cn=My Group,ou=groups,ou=system", dn );
- assertEquals( 4, entryEditorBot.getAttributeValues().size() );
+ assertEquals( "DN: " + GROUP1_DN.getName(), dn );
+ assertEquals( 11, entryEditorBot.getAttributeValues().size() );
// add member attribute
NewAttributeWizardBot wizardBot = entryEditorBot.openNewAttributeWizard();
@@ -254,19 +263,17 @@ public class EntryEditorTest extends AbstractLdapTestUnit
assertTrue( dnEditorBot.isVisible() );
SelectDnDialogBot selectDnBot = dnEditorBot.clickBrowseButtonExpectingSelectDnDialog();
assertTrue( selectDnBot.isVisible() );
- selectDnBot.selectEntry( "Root DSE", "ou=system", "ou=users", "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
+ selectDnBot.selectEntry( ArrayUtils.remove( path( MULTI_VALUED_RDN_DN ), 0 ) );
selectDnBot.clickOkButton();
- assertEquals( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system", dnEditorBot.getDnText() );
+ assertEquals( MULTI_VALUED_RDN_DN.getName(), dnEditorBot.getDnText() );
dnEditorBot.clickOkButton();
// assert value after saved and reloaded from server
SWTUtils.sleep( 1000 );
- assertEquals( 5, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains(
- "member: cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" ) );
- dnEditorBot = entryEditorBot.editValueExpectingDnEditor( "member",
- "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" );
- assertEquals( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system", dnEditorBot.getDnText() );
+ assertEquals( 12, entryEditorBot.getAttributeValues().size() );
+ assertTrue( entryEditorBot.getAttributeValues().contains( "member: " + MULTI_VALUED_RDN_DN.getName() ) );
+ dnEditorBot = entryEditorBot.editValueExpectingDnEditor( "member", MULTI_VALUED_RDN_DN.getName() );
+ assertEquals( MULTI_VALUED_RDN_DN.getName(), dnEditorBot.getDnText() );
dnEditorBot.clickCancelButton();
modificationLogsViewBot.waitForText( "#!RESULT OK" );
@@ -278,26 +285,24 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* DIRSTUDIO-637: copy/paste of attributes no longer works.
* Test copy/paste within entry editor.
- *
- * @throws Exception
- * the exception
*/
- @Test
- public void testCopyPasteStringValue() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testCopyPasteStringValue( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
// copy a value
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
entryEditorBot.copyValue( "uid", "bjensen" );
// go to another entry
- browserViewBot
- .selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
- entryEditorBot = studioBot.getEntryEditorBot( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" );
+ browserViewBot.selectEntry( path( USER1_DN ) );
+ entryEditorBot = studioBot.getEntryEditorBot( USER1_DN.getName() );
entryEditorBot.activate();
- assertEquals( 8, entryEditorBot.getAttributeValues().size() );
+ assertEquals( 23, entryEditorBot.getAttributeValues().size() );
// paste value, wait till job is done
JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__execute_ldif_name );
@@ -305,33 +310,36 @@ public class EntryEditorTest extends AbstractLdapTestUnit
watcher.waitUntilDone();
// assert pasted value visible in editor
- assertEquals( 9, entryEditorBot.getAttributeValues().size() );
+ assertEquals( 24, entryEditorBot.getAttributeValues().size() );
assertTrue( "Should contain uid=bjensen: " + entryEditorBot.getAttributeValues(),
entryEditorBot.getAttributeValues().contains( "uid: bjensen" ) );
// assert pasted value was written to directory
- Entry entry = service.getAdminSession()
- .lookup( new Dn( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" ) );
- assertTrue( "Should contain uid=bjensen: " + entry, entry.contains( "uid", "bjensen" ) );
+ server.withAdminConnection( conn -> {
+ Entry entry = conn.lookup( USER1_DN );
+ assertTrue( "Should contain uid=bjensen: " + entry, entry.contains( "uid", "bjensen" ) );
+
+ } );
}
- @Test
- public void testCopyPasteMultipleStringAndBinaryValues() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testCopyPasteMultipleStringAndBinaryValues( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
// copy the values
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
- entryEditorBot.copyValues( "userpassword", "uid", "description", "jpegphoto" );
+ entryEditorBot.copyValues( "userPassword", "uid", "description", "jpegPhoto" );
// go to another entry
- browserViewBot
- .selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
- entryEditorBot = studioBot.getEntryEditorBot( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" );
+ browserViewBot.selectEntry( path( USER1_DN ) );
+ entryEditorBot = studioBot.getEntryEditorBot( USER1_DN.getName() );
entryEditorBot.activate();
- assertEquals( 8, entryEditorBot.getAttributeValues().size() );
+ assertEquals( 23, entryEditorBot.getAttributeValues().size() );
// paste values, wait till job is done
JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__execute_ldif_name );
@@ -340,34 +348,37 @@ public class EntryEditorTest extends AbstractLdapTestUnit
// assert pasted values are visible in editor
SWTUtils.sleep( 1000 );
- assertEquals( 12, entryEditorBot.getAttributeValues().size() );
+ assertEquals( 27, entryEditorBot.getAttributeValues().size() );
assertTrue( entryEditorBot.getAttributeValues().contains( "uid: hnelson" ) );
assertTrue( entryEditorBot.getAttributeValues().contains( "description: " + Characters.ALL ) );
assertTrue( entryEditorBot.getAttributeValues().contains( "jpegPhoto: JPEG-Image (1x1 Pixel, 631 Bytes)" ) );
assertTrue( entryEditorBot.getAttributeValues().contains( "userPassword: SSHA-512 hashed password" ) );
// assert pasted values were written to directory
- Entry entry = service.getAdminSession()
- .lookup( new Dn( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" ) );
- assertTrue( "Should contain uid=hnelson: " + entry, entry.contains( "uid", "hnelson" ) );
- assertTrue( "Should contain description: " + entry, entry.contains( "description", Characters.ALL ) );
- assertTrue( "Should contain userPassword: " + entry, entry.containsAttribute( "userPassword" ) );
- assertTrue( "Should contain jpegPhoto: " + entry, entry.containsAttribute( "jpegPhoto" ) );
+ server.withAdminConnection( conn -> {
+ Entry entry = conn.lookup( USER1_DN );
+ assertTrue( "Should contain uid=hnelson: " + entry, entry.contains( "uid", "hnelson" ) );
+ assertTrue( "Should contain description: " + entry, entry.contains( "description", Characters.ALL ) );
+ assertTrue( "Should contain userPassword: " + entry, entry.containsAttribute( "userPassword" ) );
+ assertTrue( "Should contain jpegPhoto: " + entry, entry.containsAttribute( "jpegPhoto" ) );
+ } );
}
/**
* DIRSTUDIO-738: Add support for modular crypt format password
*/
- @Test
- public void testPasswordValueEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testPasswordValueEditor( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
String dn = entryEditorBot.getDnText();
- assertEquals( "DN: cn=Barbara Jensen,ou=users,ou=system", dn );
+ assertEquals( "DN: " + BJENSEN_DN.getName(), dn );
assertEquals( 8, entryEditorBot.getAttributeValues().size() );
assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
@@ -467,15 +478,17 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* DIRSTUDIO-1157: Values cannot be modified by text editor
*/
- @Test
- public void testTextValueEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testTextValueEditor( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
String dn = entryEditorBot.getDnText();
- assertEquals( "DN: cn=Barbara Jensen,ou=users,ou=system", dn );
+ assertEquals( "DN: " + BJENSEN_DN.getName(), dn );
assertEquals( 8, entryEditorBot.getAttributeValues().size() );
assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
@@ -510,14 +523,16 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* DIRSTUDIO-1199, DIRSTUDIO-1204, DIRSTUDIO-1267: Binary attributes
*/
- @Test
- public void testCertificateValueEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testCertificateValueEditor( TestLdapServer server ) throws Exception
{
+ connectionsViewBot.createTestConnection( server );
String certFile = ResourceUtils.prepareInputFile( "rfc5280_cert2.cer" );
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
NewAttributeWizardBot wizardBot = entryEditorBot.openNewAttributeWizard();
@@ -533,22 +548,32 @@ public class EntryEditorTest extends AbstractLdapTestUnit
certEditorBot.clickOkButton();
modificationLogsViewBot.waitForText( "add: userCertificate;binary\nuserCertificate;binary:: " );
- assertTrue( entryEditorBot.getAttributeValues()
- .contains( "userCertificate: X.509v3: CN=End Entity,DC=example,DC=com" ) );
+ if ( server.getType() == LdapServerType.OpenLdap || server.getType() == LdapServerType.Fedora389ds )
+ {
+ assertTrue( entryEditorBot.getAttributeValues()
+ .contains( "userCertificate;binary: X.509v3: CN=End Entity,DC=example,DC=com" ) );
+ }
+ else
+ {
+ assertTrue( entryEditorBot.getAttributeValues()
+ .contains( "userCertificate: X.509v3: CN=End Entity,DC=example,DC=com" ) );
+ }
}
/**
* DIRSTUDIO-1199, DIRSTUDIO-1204: Binary attributes
*/
- @Test
- public void testImageValueEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testImageValueEditor( TestLdapServer server ) throws Exception
{
+ connectionsViewBot.createTestConnection( server );
String imgFile = ResourceUtils.prepareInputFile( "studio_64x64.jpg" );
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=Barbara Jensen" );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "cn=Barbara Jensen,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( BJENSEN_DN.getName() );
entryEditorBot.activate();
// add image
@@ -566,18 +591,20 @@ public class EntryEditorTest extends AbstractLdapTestUnit
}
- @Test
- public void testAciItemEditorAllOptions() throws Exception
+ @ParameterizedTest
+ @LdapServersSource(types = LdapServerType.ApacheDS)
+ public void testAciItemEditorAllOptions( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
entryEditorBot.fetchOperationalAttributes();
SWTUtils.sleep( 1000 );
entryEditorBot.activate();
- AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "entryaci", null );
+ AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "entryACI", null );
aciItemEditor.activateSourceTab();
aciItemEditor.activateVisualEditorTab();
@@ -641,18 +668,20 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* Test for DIRSTUDIO-1135
*/
- @Test
- public void testAllAttributesValuesParser() throws Exception
+ @ParameterizedTest
+ @LdapServersSource(types = LdapServerType.ApacheDS)
+ public void testAciItemEditorAllAttributesValuesParser( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
entryEditorBot.fetchOperationalAttributes();
SWTUtils.sleep( 1000 );
entryEditorBot.activate();
- AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "entryaci", null );
+ AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "entryACI", null );
aciItemEditor.activateSourceTab();
aciItemEditor.setSource(
@@ -671,23 +700,25 @@ public class EntryEditorTest extends AbstractLdapTestUnit
aciItemEditor.clickOkButton();
SWTUtils.sleep( 1000 );
- modificationLogsViewBot.waitForText( "delete: entryaci\n" );
- modificationLogsViewBot.waitForText( "add: entryaci\n" );
+ modificationLogsViewBot.waitForText( "delete: entryACI\n" );
+ modificationLogsViewBot.waitForText( "add: entryACI\n" );
}
- @Test
- public void testAciItemEditorEntryAci() throws Exception
+ @ParameterizedTest
+ @LdapServersSource(types = LdapServerType.ApacheDS)
+ public void testAciItemEditorEntryAci( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
entryEditorBot.fetchOperationalAttributes();
SWTUtils.sleep( 1000 );
entryEditorBot.activate();
- AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "entryaci", null );
+ AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "entryACI", null );
aciItemEditor.activateSourceTab();
aciItemEditor.clickCheckSyntaxButtonOk();
@@ -711,23 +742,25 @@ public class EntryEditorTest extends AbstractLdapTestUnit
aciItemEditor.clickOkButton();
SWTUtils.sleep( 1000 );
- modificationLogsViewBot.waitForText( "delete: entryaci\n" );
- modificationLogsViewBot.waitForText( "add: entryaci\n" );
+ modificationLogsViewBot.waitForText( "delete: entryACI\n" );
+ modificationLogsViewBot.waitForText( "add: entryACI\n" );
}
- @Test
- public void testAciItemEditorPrescriptiveAci() throws Exception
+ @ParameterizedTest
+ @LdapServersSource(types = LdapServerType.ApacheDS)
+ public void testAciItemEditorPrescriptiveAci( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
entryEditorBot.fetchOperationalAttributes();
SWTUtils.sleep( 1000 );
entryEditorBot.activate();
- AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "prescriptiveaci",
+ AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "prescriptiveACI",
null );
aciItemEditor.activateSourceTab();
@@ -740,24 +773,26 @@ public class EntryEditorTest extends AbstractLdapTestUnit
aciItemEditor.clickOkButton();
SWTUtils.sleep( 1000 );
- modificationLogsViewBot.waitForText( "delete: prescriptiveaci\n" );
- modificationLogsViewBot.waitForText( "add: prescriptiveaci\n" );
+ modificationLogsViewBot.waitForText( "delete: prescriptiveACI\n" );
+ modificationLogsViewBot.waitForText( "add: prescriptiveACI\n" );
}
- @Test
- public void testSubtreeSpecificationEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource(types = LdapServerType.ApacheDS)
+ public void testSubtreeSpecificationEditor( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
entryEditorBot.fetchOperationalAttributes();
SWTUtils.sleep( 1000 );
entryEditorBot.activate();
SubtreeSpecificationEditorDialogBot subtreeEditorBot = entryEditorBot
- .editValueExpectingSubtreeSpecificationEditor( "subtreespecification",
+ .editValueExpectingSubtreeSpecificationEditor( "subtreeSpecification",
null );
subtreeEditorBot.clickOkButton();
@@ -767,18 +802,26 @@ public class EntryEditorTest extends AbstractLdapTestUnit
/**
* Test for DIRSTUDIO-1249, DIRSTUDIO-1267: userSMIMECertificate is a binary attribute.
*/
- @Test
- public void testHexEditor() throws Exception
+ @ParameterizedTest
+ @LdapServersSource
+ public void testHexEditor( TestLdapServer server ) throws Exception
{
- browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+ Connection connection = connectionsViewBot.createTestConnection( server );
+ if ( server.getType() == LdapServerType.OpenLdap )
+ {
+ IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
+ .getBrowserConnection( connection );
+ browserConnection.setModifyModeNoEMR( ModifyMode.REPLACE );
+ }
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ browserViewBot.selectEntry( path( HNELSON_DN ) );
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( HNELSON_DN.getName() );
entryEditorBot.activate();
- assertTrue( entryEditorBot.getAttributeValues().contains( "usersmimecertificate: Binary Data (255 Bytes)" ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "usersmimecertificate: Binary Data (256 Bytes)" ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "usersmimecertificate: Binary Data (257 Bytes)" ) );
+ assertTrue( entryEditorBot.getAttributeValues().contains( "userSMIMECertificate: Binary Data (255 Bytes)" ) );
+ assertTrue( entryEditorBot.getAttributeValues().contains( "userSMIMECertificate: Binary Data (256 Bytes)" ) );
+ assertTrue( entryEditorBot.getAttributeValues().contains( "userSMIMECertificate: Binary Data (257 Bytes)" ) );
- HexEditorDialogBot hexEditorDialogBot = entryEditorBot.editValueExpectingHexEditor( "usersmimecertificate",
+ HexEditorDialogBot hexEditorDialogBot = entryEditorBot.editValueExpectingHexEditor( "userSMIMECertificate",
"Binary Data (256 Bytes)" );
String hexText = hexEditorDialogBot.getHexText();
assertTrue( hexText.contains( "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ........ ........" ) );
@@ -787,13 +830,13 @@ public class EntryEditorTest extends AbstractLdapTestUnit
assertTrue( hexText.contains( "f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff ........ ........" ) );
hexEditorDialogBot.clickCancelButton();
- hexEditorDialogBot = entryEditorBot.editValueExpectingHexEditor( "usersmimecertificate",
+ hexEditorDialogBot = entryEditorBot.editValueExpectingHexEditor( "userSMIMECertificate",
"Binary Data (255 Bytes)" );
hexText = hexEditorDialogBot.getHexText();
assertTrue( hexText.contains( "f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ........ ......." ) );
hexEditorDialogBot.clickCancelButton();
- hexEditorDialogBot = entryEditorBot.editValueExpectingHexEditor( "usersmimecertificate",
+ hexEditorDialogBot = entryEditorBot.editValueExpectingHexEditor( "userSMIMECertificate",
"Binary Data (257 Bytes)" );
hexText = hexEditorDialogBot.getHexText();
assertTrue( hexText.contains( "f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff ........ ........" ) );
@@ -807,7 +850,6 @@ public class EntryEditorTest extends AbstractLdapTestUnit
assertTrue( wizardBot.isVisible() );
wizardBot.typeAttributeType( "userSMIMECertificate" );
wizardBot.clickNextButton();
- wizardBot.selectBinaryOption();
HexEditorDialogBot hexEditorBot = wizardBot.clickFinishButtonExpectingHexEditor();
assertTrue( hexEditorBot.isVisible() );
@@ -815,9 +857,18 @@ public class EntryEditorTest extends AbstractLdapTestUnit
hexEditorBot.clickOkButton();
- modificationLogsViewBot.waitForText( "add: userSMIMECertificate;binary\nuserSMIMECertificate;binary:: " );
- assertTrue( entryEditorBot.getAttributeValues()
- .contains( "usersmimecertificate: Binary Data (629 Bytes)" ) );
+ if ( server.getType() == LdapServerType.OpenLdap )
+ {
+ modificationLogsViewBot.waitForText( "replace: userSMIMECertificate\nuserSMIMECertificate:: " );
+ assertTrue( entryEditorBot.getAttributeValues()
+ .contains( "userSMIMECertificate: Binary Data (629 Bytes)" ) );
+ }
+ else
+ {
+ modificationLogsViewBot.waitForText( "add: userSMIMECertificate\nuserSMIMECertificate:: " );
+ assertTrue( entryEditorBot.getAttributeValues()
+ .contains( "userSMIMECertificate: Binary Data (629 Bytes)" ) );
+ }
}
}
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Fedora389dsTest.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Fedora389dsTest.java
index 7324714..2350276 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Fedora389dsTest.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Fedora389dsTest.java
@@ -303,77 +303,6 @@ public class Fedora389dsTest
}
- /**
- * Test adding, editing and deleting of attributes in the entry editor.
- */
- @Test
- public void testAddEditDeleteAttribute() throws Exception
- {
- browserViewBot.selectEntry( "DIT", "Root DSE", "dc=example,dc=org", "ou=users", "uid=user.1" );
-
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=user.1,ou=users,dc=example,dc=org" );
- entryEditorBot.activate();
- String dn = entryEditorBot.getDnText();
- assertEquals( "DN: uid=user.1,ou=users,dc=example,dc=org", dn );
- assertEquals( 22, entryEditorBot.getAttributeValues().size() );
- assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
-
- // add description attribute
- entryEditorBot.activate();
- NewAttributeWizardBot wizardBot = entryEditorBot.openNewAttributeWizard();
- assertTrue( wizardBot.isVisible() );
- wizardBot.typeAttributeType( "description" );
- wizardBot.clickFinishButton();
- entryEditorBot.typeValueAndFinish( "This is the 1st description." );
- assertEquals( 23, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the 1st description." );
-
- // add second value
- entryEditorBot.activate();
- entryEditorBot.addValue( "description" );
- entryEditorBot.typeValueAndFinish( "This is the 2nd description." );
- assertEquals( 24, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 2nd description." ) );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the 2nd description." );
-
- // edit second value
- entryEditorBot.editValue( "description", "This is the 2nd description." );
- entryEditorBot.typeValueAndFinish( "This is the 3rd description." );
- assertEquals( 24, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 2nd description." ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 3rd description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the 2nd description." );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the 3rd description." );
-
- // delete second value
- entryEditorBot.deleteValue( "description", "This is the 3rd description." );
- assertEquals( 23, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 3rd description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the 3rd description." );
-
- // edit 1st value
- entryEditorBot.editValue( "description", "This is the 1st description." );
- entryEditorBot.typeValueAndFinish( "This is the final description." );
- assertEquals( 23, entryEditorBot.getAttributeValues().size() );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the final description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the 1st description." );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the final description." );
-
- // delete 1st value/attribute
- entryEditorBot.deleteValue( "description", "This is the final description." );
- assertEquals( 22, entryEditorBot.getAttributeValues().size() );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the final description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the final description.\n-" );
-
- assertEquals( "Expected 6 modifications.", 6,
- StringUtils.countMatches( modificationLogsViewBot.getModificationLogsText(), "#!RESULT OK" ) );
- }
-
/**
* Test adding, editing and deleting of attributes without equality matching rule in the entry editor.
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/OpenLdapTest.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/OpenLdapTest.java
index f33bf92..d31ccec 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/OpenLdapTest.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/OpenLdapTest.java
@@ -331,76 +331,6 @@ public class OpenLdapTest
}
- /**
- * Test adding, editing and deleting of attributes in the entry editor.
- */
- @Test
- public void testAddEditDeleteAttribute() throws Exception
- {
- browserViewBot.selectEntry( "DIT", "Root DSE", "dc=example,dc=org", "ou=users", "uid=user.1" );
-
- EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=user.1,ou=users,dc=example,dc=org" );
- entryEditorBot.activate();
- String dn = entryEditorBot.getDnText();
- assertEquals( "DN: uid=user.1,ou=users,dc=example,dc=org", dn );
- assertEquals( 22, entryEditorBot.getAttributeValues().size() );
- assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
-
- // add description attribute
- entryEditorBot.activate();
- NewAttributeWizardBot wizardBot = entryEditorBot.openNewAttributeWizard();
- assertTrue( wizardBot.isVisible() );
- wizardBot.typeAttributeType( "description" );
- wizardBot.clickFinishButton();
- entryEditorBot.typeValueAndFinish( "This is the 1st description." );
- assertEquals( 23, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the 1st description." );
-
- // add second value
- entryEditorBot.activate();
- entryEditorBot.addValue( "description" );
- entryEditorBot.typeValueAndFinish( "This is the 2nd description." );
- assertEquals( 24, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 2nd description." ) );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the 2nd description." );
-
- // edit second value
- entryEditorBot.editValue( "description", "This is the 2nd description." );
- entryEditorBot.typeValueAndFinish( "This is the 3rd description." );
- assertEquals( 24, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 2nd description." ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 3rd description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the 2nd description." );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the 3rd description." );
-
- // delete second value
- entryEditorBot.deleteValue( "description", "This is the 3rd description." );
- assertEquals( 23, entryEditorBot.getAttributeValues().size() );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 3rd description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the 3rd description." );
-
- // edit 1st value
- entryEditorBot.editValue( "description", "This is the 1st description." );
- entryEditorBot.typeValueAndFinish( "This is the final description." );
- assertEquals( 23, entryEditorBot.getAttributeValues().size() );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
- assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the final description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the 1st description." );
- modificationLogsViewBot.waitForText( "add: description\ndescription: This is the final description." );
-
- // delete 1st value/attribute
- entryEditorBot.deleteValue( "description", "This is the final description." );
- assertEquals( 22, entryEditorBot.getAttributeValues().size() );
- assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the final description." ) );
- modificationLogsViewBot.waitForText( "delete: description\ndescription: This is the final description.\n-" );
-
- assertEquals( "Expected 6 modifications.", 6,
- StringUtils.countMatches( modificationLogsViewBot.getModificationLogsText(), "#!RESULT OK" ) );
- }
/**
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionsViewBot.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionsViewBot.java
index ac5d679..4775860 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionsViewBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionsViewBot.java
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.commons.lang3.RandomStringUtils;
import org.apache.directory.studio.connection.core.Connection;
import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
import org.apache.directory.studio.connection.core.ConnectionFolder;
@@ -38,9 +37,9 @@ import org.apache.directory.studio.connection.core.ConnectionParameter.Encryptio
import org.apache.directory.studio.connection.core.Messages;
import org.apache.directory.studio.connection.core.jobs.OpenConnectionsRunnable;
import org.apache.directory.studio.connection.core.jobs.StudioConnectionJob;
+import org.apache.directory.studio.test.integration.junit5.TestLdapServer;
import org.apache.directory.studio.test.integration.ui.ContextMenuHelper;
import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
-import org.apache.directory.studio.test.integration.junit5.TestLdapServer;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.utils.TableCollection;
@@ -217,7 +216,7 @@ public class ConnectionsViewBot
public Connection createTestConnection( TestLdapServer server ) throws Exception
{
- return createTestConnection( server.getType() + "_" + RandomStringUtils.randomAscii( 10 ), server.getHost(),
+ return createTestConnection( server.getType().name(), server.getHost(),
server.getPort(), server.getAdminDn(),
server.getAdminPassword() );
}