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/01/19 20:42:33 UTC
[directory-studio] branch master updated: DIRSTUDIO-862: Add test
for prescriptiveACI and subtreeSpecification editor
This is an automated email from the ASF dual-hosted git repository.
seelmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-studio.git
The following commit(s) were added to refs/heads/master by this push:
new a5fee67 DIRSTUDIO-862: Add test for prescriptiveACI and subtreeSpecification editor
a5fee67 is described below
commit a5fee6734ef8e87611677b3b04cc28afcf24936c
Author: Stefan Seelmann <ma...@stefan-seelmann.de>
AuthorDate: Tue Jan 19 21:42:20 2021 +0100
DIRSTUDIO-862: Add test for prescriptiveACI and subtreeSpecification editor
---
.../test/integration/ui/EntryEditorTest.java | 47 +++++++++++++++++++++-
.../test/integration/ui/bots/EntryEditorBot.java | 6 +++
.../integration/ui/bots/EntryEditorWidgetBot.java | 7 ++++
.../test/integration/ui/EntryEditorTest.ldif | 9 +++++
4 files changed, 68 insertions(+), 1 deletion(-)
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 eac7f26..d37fbca 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
@@ -68,6 +68,7 @@ import org.apache.directory.studio.test.integration.ui.bots.NewAttributeWizardBo
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;
@@ -533,7 +534,7 @@ public class EntryEditorTest extends AbstractLdapTestUnit
@Test
- public void testAciItemEditor() throws Exception
+ public void testAciItemEditorEntryAci() throws Exception
{
browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
@@ -563,6 +564,50 @@ public class EntryEditorTest extends AbstractLdapTestUnit
}
+ @Test
+ public void testAciItemEditorPrescriptiveAci() throws Exception
+ {
+ browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ entryEditorBot.activate();
+ entryEditorBot.fetchOperationalAttributes();
+ SWTUtils.sleep( 1000 );
+
+ entryEditorBot.activate();
+ AciItemEditorDialogBot aciItemEditor = entryEditorBot.editValueExpectingAciItemEditor( "prescriptiveaci",
+ null );
+
+ aciItemEditor.activateSourceTab();
+ aciItemEditor.clickFormatButton();
+ aciItemEditor.activateVisualEditorTab();
+
+ aciItemEditor.clickOkButton();
+
+ SWTUtils.sleep( 1000 );
+ modificationLogsViewBot.waitForText( "replace: prescriptiveaci\n" );
+ }
+
+
+ @Test
+ public void testSubtreeSpecificationEditor() throws Exception
+ {
+ browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=hnelson" );
+
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot( "uid=hnelson,ou=users,ou=system" );
+ entryEditorBot.activate();
+ entryEditorBot.fetchOperationalAttributes();
+ SWTUtils.sleep( 1000 );
+
+ entryEditorBot.activate();
+ SubtreeSpecificationEditorDialogBot subtreeEditorBot = entryEditorBot
+ .editValueExpectingSubtreeSpecificationEditor( "subtreespecification",
+ null );
+
+ subtreeEditorBot.clickOkButton();
+ }
+
+
/**
* Test for DIRSTUDIO-1249: userSMIMECertificate is a binary attribute.
*/
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorBot.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorBot.java
index 64ca0d3..1542c6e 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorBot.java
@@ -119,6 +119,12 @@ public class EntryEditorBot
}
+ public SubtreeSpecificationEditorDialogBot editValueExpectingSubtreeSpecificationEditor( String attributeType, String value )
+ {
+ return editorBot.editValueExpectingSubtreeSpecificationEditor( attributeType, value );
+ }
+
+
public HexEditorDialogBot editValueExpectingHexEditor( String attributeType, String value )
{
return editorBot.editValueExpectingHexEditor( attributeType, value );
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
index 29c7da0..61e1bbf 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
@@ -164,6 +164,13 @@ class EntryEditorWidgetBot
}
+ SubtreeSpecificationEditorDialogBot editValueExpectingSubtreeSpecificationEditor( String attributeType, String value )
+ {
+ editValue( attributeType, value );
+ return new SubtreeSpecificationEditorDialogBot();
+ }
+
+
HexEditorDialogBot editValueExpectingHexEditor( String attributeType, String value )
{
editValue( attributeType, value );
diff --git a/tests/test.integration.ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif b/tests/test.integration.ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
index 8f9ef80..94a61d3 100644
--- a/tests/test.integration.ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
+++ b/tests/test.integration.ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
@@ -31,6 +31,7 @@ objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: extensibleObject
+objectclass: accessControlSubentry
cn: Horatio Nelson
sn: Nelson
uid: hnelson
@@ -72,6 +73,14 @@ userSMIMECertificate:: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJyg
Y2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbn
J2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1d
bX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+
+subtreeSpecification: {}
+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 } } } }
+ }
# cn=\#\\\+\, \"öé\",ou=users,ou=system
dn:: Y249XCNcXFwrXCwgXCLDtsOpXCIsb3U9dXNlcnMsb3U9c3lzdGVt