directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r766865 - in /directory/studio/trunk: test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ test-integration-ui/src/main/resources/org/apache/directory/studio/test/integration/ui/ valueeditors/src/main/java/org/...
Date Mon, 20 Apr 2009 20:48:28 GMT
Author: seelmann
Date: Mon Apr 20 20:48:28 2009
New Revision: 766865

URL: http://svn.apache.org/viewvc?rev=766865&view=rev
Log:
Fix for DIRSTUDIO-483 (DN Editor escapes all non-ascii characters)

Modified:
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SWTBotUtils.java
    directory/studio/trunk/test-integration-ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
    directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/dn/DnValueEditor.java

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java?rev=766865&r1=766864&r2=766865&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
Mon Apr 20 20:48:28 2009
@@ -28,7 +28,7 @@
 
 
 /**
- * Tests the new entry wizard.
+ * Tests the entry editor.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -41,7 +41,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        super.loadTestLdif( true );
+        super.loadTestLdif( false );
         bot = new SWTEclipseBot();
         SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "EntryEditorTest", ldapService.getPort() );
@@ -57,7 +57,7 @@
 
 
     /**
-     * Test to create a single organization entry.
+     * Test adding, editing and deleting of attributes in the entry editor.
      * 
      * @throws Exception
      *             the exception
@@ -230,7 +230,52 @@
                 return "Attribute 'description' is still there.";
             }
         } );
+    }
+
 
+    /**
+     * DIRSTUDIO-483: DN Editor escapes all non-ascii characters 
+     * 
+     * @throws Exception
+     *             the exception
+     */
+    public void testDnValueEditor() throws Exception
+    {
+        SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );
+        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system",
"ou=users",
+            "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
+        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system",
"ou=groups", "cn=My Group" );
+
+        SWTBotTree entryEditorTree = SWTBotUtils.getEntryEditorTree( bot );
+        entryEditorTree.contextMenu( "New Attribute..." ).click();
+        bot.shell( "New Attribute" );
+        bot.comboBoxWithLabel( "Attribute type:" ).setText( "member" );
+        bot.button( "Finish" ).click();
+
+        // DN Editor automatically opened
+        bot.shell( "DN Editor" );
+        bot.button( "Browse..." ).click();
+
+        // select value from DN picker
+        bot.shell( "Select DN" );
+        SWTBotTree tree = bot.tree( 0 );
+        SWTBotUtils.selectEntry( bot, tree, false, "Root DSE", "ou=system", "ou=users",
+            "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
+        bot.button( "OK" ).click();
+
+        // assert value after selection
+        assertEquals( "Unexpected value", "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system",
bot.comboBox()
+            .getText() );
+
+        // save value
+        bot.button( "OK" ).click();
+        bot.sleep( 1000 );
+
+        // assert value after saved and reloaded from server
+        entryEditorTree.select( 3 );
+        assertEquals( "Unexpected value", "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system",
bot.comboBox()
+            .getText() );
+        bot.button( "Cancel" ).click();
     }
 
 }

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java?rev=766865&r1=766864&r2=766865&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
Mon Apr 20 20:48:28 2009
@@ -431,6 +431,8 @@
 
         SWTBotTree tree = bot.tree( 0 );
         SWTBotTreeItem krbNode = tree.getTreeItem( "krb5PrincipalName" );
+        // click to cancel editing attribute when pages becomes visible
+        krbNode.click();
 
         // enter cn value
         tree.select( "cn" );

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SWTBotUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SWTBotUtils.java?rev=766865&r1=766864&r2=766865&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SWTBotUtils.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SWTBotUtils.java
Mon Apr 20 20:48:28 2009
@@ -493,6 +493,7 @@
 
             if ( entry == null )
             {
+                currentPath = adjustNodeName( tree, currentPath );
                 entry = tree.getTreeItem( currentPath );
             }
             else
@@ -590,4 +591,19 @@
         return null;
     }
 
+
+    private static String adjustNodeName( SWTBotTree tree, String nodeName )
+    {
+        SWTBotTreeItem[] allItems = tree.getAllItems();
+        for ( SWTBotTreeItem item : allItems )
+        {
+            String node = item.getText();
+            if ( node.toUpperCase().startsWith( nodeName.toUpperCase() ) )
+            {
+                return node;
+            }
+        }
+        return null;
+    }
+
 }

Modified: directory/studio/trunk/test-integration-ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif?rev=766865&r1=766864&r2=766865&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/resources/org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif
Mon Apr 20 20:48:28 2009
@@ -8,3 +8,21 @@
 givenName: Barbara
 uid: bjensen
 
+# cn=\#\\\+\, \"öé\",ou=users,ou=system
+dn:: Y249XCNcXFwrXCwgXCLDtsOpXCIsb3U9dXNlcnMsb3U9c3lzdGVt
+objectClass: inetOrgPerson
+objectClass: organizationalPerson
+objectClass: person
+objectClass: top
+cn:: I1wrLCAiw7bDqSI=
+sn:: I1wrLCAiw7bDqSI=
+givenName:: I1wrLCAiw7bDqSI=
+uid:: I1wrLCAiw7bDqSI=
+
+dn: cn=My Group,ou=groups,ou=system
+objectClass: groupOfNames
+objectClass: top
+cn: My Group
+member: cn=Barbara Jensen,ou=users,ou=system
+
+

Modified: directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/dn/DnValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/dn/DnValueEditor.java?rev=766865&r1=766864&r2=766865&view=diff
==============================================================================
--- directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/dn/DnValueEditor.java
(original)
+++ directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/dn/DnValueEditor.java
Mon Apr 20 20:48:28 2009
@@ -66,7 +66,7 @@
             DnDialog dialog = new DnDialog( shell, Messages.getString("DnValueEditor.DNEditor"),
null, wrapper.connection, dn ); //$NON-NLS-1$
             if ( dialog.open() == TextDialog.OK && dialog.getDn() != null )
             {
-                setValue( dialog.getDn().toString() );
+                setValue( dialog.getDn().getUpName() );
                 return true;
             }
         }



Mime
View raw message