directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r881497 - in /directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui: SearchTest.java bots/BrowserViewBot.java
Date Tue, 17 Nov 2009 20:36:33 GMT
Author: seelmann
Date: Tue Nov 17 20:36:33 2009
New Revision: 881497

URL: http://svn.apache.org/viewvc?rev=881497&view=rev
Log:
Test for DIRSTUDIO-587 (UI flickers on quick search)

Modified:
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java?rev=881497&r1=881496&r2=881497&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
Tue Nov 17 20:36:33 2009
@@ -30,6 +30,7 @@
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.test.integration.ui.bots.BrowserViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot;
@@ -128,4 +129,32 @@
             .getBrowserConnection() );
     }
 
+
+    /**
+     * Test for DIRSTUDIO-587 (UI flickers on quick search).
+     * 
+     * When performing a quick search only one UI update should be fired.
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testOnlyOneUiUpdateOnQuickSearch() throws Exception
+    {
+        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system" );
+
+        browserViewBot.typeQuickSearchAttributeType( "ou" );
+        browserViewBot.typeQuickSearchValue( "*" );
+
+        long fireCount0 = EventRegistry.getFireCount();
+        browserViewBot.clickRunQuickSearchButton();
+        browserViewBot.waitForEntry( "DIT", "Root DSE", "ou=system", "Quick Search" );
+        long fireCount1 = EventRegistry.getFireCount();
+
+        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "Quick Search" );
+
+        // verify that only one events was fired 
+        long fireCount = fireCount1 - fireCount0;
+        assertEquals( "Only 1 event firings expected when running quick search.", 1, fireCount
);
+    }
+
 }

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java?rev=881497&r1=881496&r2=881497&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
Tue Nov 17 20:36:33 2009
@@ -157,16 +157,42 @@
     {
         ContextMenuHelper.clickContextMenu( browserBot.getTree(), "Copy" );
     }
-    
+
+
     public void paste()
     {
         ContextMenuHelper.clickContextMenu( browserBot.getTree(), "Paste" );
     }
-    
+
+
     public SearchPropertiesDialogBot pasteSearch()
     {
         ContextMenuHelper.clickContextMenu( browserBot.getTree(), "Paste" );
         return new SearchPropertiesDialogBot();
     }
 
+
+    public void typeQuickSearchAttributeType( String attributeType )
+    {
+        bot.comboBox( 0 ).setText( attributeType );
+    }
+
+
+    public void typeQuickSearchValue( String value )
+    {
+        bot.comboBox( 2 ).setText( value );
+    }
+
+
+    public void clickRunQuickSearchButton()
+    {
+        bot.buttonWithTooltip( "Run Quick Search" ).click();
+    }
+
+
+    public boolean isQuickSearchEnabled()
+    {
+        return bot.comboBox( 0 ).isEnabled();
+    }
+
 }



Mime
View raw message