directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r828665 - in /directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui: ./ bots/
Date Thu, 22 Oct 2009 11:51:40 GMT
Author: seelmann
Date: Thu Oct 22 11:51:39 2009
New Revision: 828665

URL: http://svn.apache.org/viewvc?rev=828665&view=rev
Log:
Use better method to open and reset LDAP perspective

Modified:
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
    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/ImportExportTest.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/ReferralDialogTest.java
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.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/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/SwtResourcesTest.java
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserViewBot.java
    directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java?rev=828665&r1=828664&r2=828665&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
Thu Oct 22 11:51:39 2009
@@ -30,6 +30,7 @@
 import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText;
@@ -55,14 +56,18 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot eBot;
 
 
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         eBot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( eBot );
         SWTBotUtils.createTestConnection( eBot, "BrowserTest", ldapServer.getPort() );
     }
 

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=828665&r1=828664&r2=828665&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
Thu Oct 22 11:51:39 2009
@@ -28,6 +28,7 @@
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.junit.After;
@@ -50,14 +51,18 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot bot;
 
 
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         bot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "EntryEditorTest", ldapServer.getPort() );
     }
 

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java?rev=828665&r1=828664&r2=828665&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
Thu Oct 22 11:51:39 2009
@@ -40,6 +40,7 @@
 import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
@@ -65,14 +66,18 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot eBot;
 
 
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         eBot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( eBot );
         SWTBotUtils.createTestConnection( eBot, "ImportExportTest", ldapServer.getPort()
);
     }
 

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=828665&r1=828664&r2=828665&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
Thu Oct 22 11:51:39 2009
@@ -34,6 +34,7 @@
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
@@ -58,6 +59,8 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot bot;
 
 
@@ -81,8 +84,10 @@
             schemaRoot.modifyAttributes( "cn=Krb5kdc", mods );
         }
 
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         bot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "NewEntryWizardTest", ldapServer.getPort()
);
     }
 

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java?rev=828665&r1=828664&r2=828665&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
Thu Oct 22 11:51:39 2009
@@ -38,6 +38,7 @@
 import org.apache.directory.studio.test.integration.ui.bots.BrowserViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.ReferralDialogBot;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.junit.After;
 import org.junit.Before;
@@ -57,6 +58,7 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
     private ConnectionsViewBot connectionsViewBot;
     private BrowserViewBot browserViewBot;
 
@@ -71,13 +73,14 @@
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+        connectionsViewBot = studioBot.getConnectionView();
+        browserViewBot = studioBot.getBrowserView();
+        
         bot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( bot );
         connection = SWTBotUtils.createTestConnection( bot, "ReferralDialogTest", ldapServer.getPort()
);
 
-        connectionsViewBot = new ConnectionsViewBot();
-        browserViewBot = new BrowserViewBot();
-
         // create referral entry
         ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries()
);
         entry.setDn( new LdapDN( "cn=referralDialogTest,ou=system" ) );

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java?rev=828665&r1=828664&r2=828665&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
Thu Oct 22 11:51:39 2009
@@ -26,6 +26,7 @@
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -48,14 +49,18 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot bot;
 
 
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         bot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "RenameEntryDialogTest", ldapServer.getPort()
);
     }
 

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=828665&r1=828664&r2=828665&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
Thu Oct 22 11:51:39 2009
@@ -46,7 +46,6 @@
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
@@ -62,73 +61,6 @@
 {
 
     /**
-     * Opens the LDAP perspective.
-     * 
-     * @param bot
-     *            the bot
-     * 
-     * @throws Exception
-     *             the exception
-     */
-    public static void openLdapPerspective( final SWTWorkbenchBot eBot ) throws Exception
-    {
-        // optimization: only open LDAP perspective if not yet opened
-        try
-        {
-            if ( eBot.viewByTitle( "Connections" ) != null )
-            {
-                // LDAP perspective already opened
-                return;
-            }
-        }
-        catch ( Exception e )
-        {
-            // no 'Connections' view, continue to open the LDAP perspective
-        }
-
-        // open "Open Perspective" dialog
-        SWTBotMenu windowMenu = eBot.menu( "&Window" );
-        windowMenu.click();
-        SWTBotMenu perspectiveMenu = windowMenu.menu( "Open Perspective" );
-        perspectiveMenu.click();
-        SWTBotMenu otherMenu = windowMenu.menu( "Other..." );
-        otherMenu.click();
-
-        // select "LDAP" perspective
-        SWTBotTable table = eBot.table();
-        table.select( "LDAP" );
-
-        // press "OK"
-        SWTBotButton okButton = eBot.button( "OK" );
-        okButton.click();
-
-        // wait till Connections view become visible
-        eBot.waitUntil( new DefaultCondition()
-        {
-            public boolean test() throws Exception
-            {
-                return eBot.viewByTitle( "Connections" ) != null;
-            }
-
-
-            public String getFailureMessage()
-            {
-                return "Could not find widget";
-            }
-        } );
-
-        // close welcome view, if it is there
-        try
-        {
-            eBot.viewByTitle( "Welcome" ).close();
-        }
-        catch ( Exception e )
-        {
-        }
-    }
-
-
-    /**
      * Creates the test connection.
      * 
      * @param bot

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=828665&r1=828664&r2=828665&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
Thu Oct 22 11:51:39 2009
@@ -30,6 +30,7 @@
 import org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.junit.After;
@@ -51,14 +52,18 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot bot;
 
 
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         bot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "SearchTest1", ldapServer.getPort() );
         SWTBotUtils.createTestConnection( bot, "SearchTest2", ldapServer.getPort() );
     }

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java?rev=828665&r1=828664&r2=828665&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
Thu Oct 22 11:51:39 2009
@@ -28,6 +28,7 @@
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
 import org.eclipse.swt.graphics.DeviceData;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
@@ -54,14 +55,18 @@
 {
     public static LdapServer ldapServer;
 
+    private StudioBot studioBot;
+
     private SWTWorkbenchBot bot;
 
 
     @Before
     public void setUp() throws Exception
     {
+        studioBot = new StudioBot();
+        studioBot.resetLdapPerspective();
+
         bot = new SWTWorkbenchBot();
-        SWTBotUtils.openLdapPerspective( bot );
         SWTBotUtils.createTestConnection( bot, "SwtResourcesTest", ldapServer.getPort() );
     }
 

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=828665&r1=828664&r2=828665&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
Thu Oct 22 11:51:39 2009
@@ -109,7 +109,6 @@
                 // adjust current path, because the label is decorated with the
                 // number of children
                 node = adjustNodeName( entry, node );
-                System.out.println( node );
                 entry = entry.getNode( node );
             }
 

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java?rev=828665&r1=828664&r2=828665&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
(original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
Thu Oct 22 11:51:39 2009
@@ -40,6 +40,12 @@
     }
 
 
+    public BrowserViewBot getBrowserView()
+    {
+        return new BrowserViewBot();
+    }
+
+
     public void resetLdapPerspective()
     {
         UIThreadRunnable.syncExec( new VoidResult()



Mime
View raw message