directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1669963 - in /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui: ./ bots/
Date Sun, 29 Mar 2015 21:40:03 GMT
Author: seelmann
Date: Sun Mar 29 21:40:02 2015
New Revision: 1669963

URL: http://svn.apache.org/r1669963
Log:
Fix some tests (DIRSTUDIO-1021)

Modified:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSServersViewBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionFromServerDialogBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewApacheDSServerWizardBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/WizardBot.java

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
Sun Mar 29 21:40:02 2015
@@ -92,6 +92,7 @@ public class ApacheDSPluginTest
         assertFalse( wizardBot.isFinishButtonEnabled() );
 
         // Filling fields of the wizard
+        wizardBot.selectApacheDS200();
         String serverName = "NewServerWizardTest";
         wizardBot.typeServerName( serverName );
 
@@ -146,6 +147,7 @@ public class ApacheDSPluginTest
 
         // Filling fields of the wizard
         String serverName = "NewServerWizardTest";
+        wizardBot.selectApacheDS200();
         wizardBot.typeServerName( serverName );
 
         // Verifying the wizard can now be finished
@@ -166,6 +168,7 @@ public class ApacheDSPluginTest
         assertFalse( wizardBot.isFinishButtonEnabled() );
 
         // Filling fields of the wizard
+        wizardBot.selectApacheDS200();
         wizardBot.typeServerName( serverName );
 
         // Verifying the wizard can't be finished (because a server with
@@ -209,6 +212,7 @@ public class ApacheDSPluginTest
 
         // Filling fields of the wizard
         String serverName = "NewServerWizardTest";
+        wizardBot.selectApacheDS200();
         wizardBot.typeServerName( serverName );
 
         // Verifying the wizard can now be finished
@@ -231,6 +235,7 @@ public class ApacheDSPluginTest
 
         // Creating a connection associated with the server
         ConnectionFromServerDialogBot connectionFromServerDialogBot = serversViewBot.createConnectionFromServer();
+        assertTrue( connectionFromServerDialogBot.isVisible() );
         connectionFromServerDialogBot.clickOkButton();
 
         // Verifying the connections count is now 1

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
Sun Mar 29 21:40:02 2015
@@ -21,9 +21,9 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.List;
 
@@ -68,8 +68,8 @@ import org.junit.runner.RunWith;
 @RunWith(FrameworkRunner.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
-@ApplyLdifFiles(
-    { "org/apache/directory/studio/test/integration/ui/BrowserTest.ldif" })
+@ApplyLdifFiles( clazz = BrowserTest.class,
+    value = "org/apache/directory/studio/test/integration/ui/BrowserTest.ldif" )
 public class BrowserTest extends AbstractLdapTestUnit
 {
     private StudioBot studioBot;
@@ -87,8 +87,6 @@ public class BrowserTest extends Abstrac
         studioBot = new StudioBot();
         studioBot.resetLdapPerspective();
         connectionsViewBot = studioBot.getConnectionView();
-        System.out.println( connectionsViewBot );
-        System.out.println( ldapServer );
         connection = connectionsViewBot.createTestConnection( "BrowserTest", ldapServer.getPort()
);
         browserViewBot = studioBot.getBrowserView();
         searchLogsViewBot = studioBot.getSearchLogsViewBot();

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
Sun Mar 29 21:40:02 2015
@@ -21,9 +21,9 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.eclipse.swtbot.swt.finder.SWTBotTestCase.assertContains;
 
 import org.apache.commons.lang.StringUtils;

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSServersViewBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSServersViewBot.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSServersViewBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSServersViewBot.java
Sun Mar 29 21:40:02 2015
@@ -40,7 +40,7 @@ public class ApacheDSServersViewBot
 
     public ApacheDSServersViewBot()
     {
-        view = new SWTWorkbenchBot().viewByTitle( "Servers" );
+        view = new SWTWorkbenchBot().viewByTitle( "LDAP Servers" );
     }
 
 
@@ -74,7 +74,7 @@ public class ApacheDSServersViewBot
      */
     public ConnectionFromServerDialogBot createConnectionFromServer()
     {
-        ContextMenuHelper.clickContextMenu( getServersTree(), "LDAP Browser", "Create a Connection"
);
+        ContextMenuHelper.clickContextMenu( getServersTree(), "Create a Connection" );
         return new ConnectionFromServerDialogBot();
     }
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionFromServerDialogBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionFromServerDialogBot.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionFromServerDialogBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionFromServerDialogBot.java
Sun Mar 29 21:40:02 2015
@@ -19,11 +19,21 @@
  */
 package org.apache.directory.studio.test.integration.ui.bots;
 
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
+
 
 public class ConnectionFromServerDialogBot extends DialogBot
 {
     public void clickOkButton()
     {
-        super.clickButton( "OK" );
+        // TODO: handle native dialogs
+        //super.clickButton( "OK" );
+        super.bot.activeShell().pressShortcut( Keystrokes.SPACE );
+    }
+
+
+    public boolean isVisible()
+    {
+        return isVisible( "Connection created" );
     }
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/EntryEditorWidgetBot.java
Sun Mar 29 21:40:02 2015
@@ -65,7 +65,8 @@ class EntryEditorWidgetBot
     void cancelEditValue()
     {
         SWTBotTree tree = bot.tree( 0 );
-        tree.getTreeItem( "objectClass" ).click();
+        // TODO: DIRAPI-228
+        tree.getTreeItem( "objectclass" ).click();
     }
 
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewApacheDSServerWizardBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewApacheDSServerWizardBot.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewApacheDSServerWizardBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewApacheDSServerWizardBot.java
Sun Mar 29 21:40:02 2015
@@ -21,17 +21,32 @@ package org.apache.directory.studio.test
 
 
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 
 
 public class NewApacheDSServerWizardBot extends WizardBot
 {
 
-    private static final String NAME = "Name:";
+    private static final String TITLE = "New LDAP Server";
+    private static final String TYPE = "Select the server type:";
+    private static final String NAME = "Server Name:";
 
+    public NewApacheDSServerWizardBot()
+    {
+        super(TITLE);
+    }
 
     public void typeServerName( String serverName )
     {
         SWTBotText connText = bot.textWithLabel( NAME );
         connText.setText( serverName );
     }
+
+
+    public void selectApacheDS200()
+    {
+        SWTBotTree tree = bot.treeWithLabel( TYPE );
+        tree.expandNode( "Apache Software Foundation" ).select( "ApacheDS 2.0.0" );
+    }
+
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/WizardBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/WizardBot.java?rev=1669963&r1=1669962&r2=1669963&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/WizardBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/WizardBot.java
Sun Mar 29 21:40:02 2015
@@ -20,9 +20,26 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 
+import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+
+
 public abstract class WizardBot extends DialogBot
 {
 
+    private String title;
+
+
+    public WizardBot()
+    {
+    }
+
+
+    public WizardBot( String title )
+    {
+        this.title = title;
+    }
+
+
     public boolean isBackButtonEnabled()
     {
         return isButtonEnabled( "< Back" );
@@ -68,6 +85,23 @@ public abstract class WizardBot extends
     public void clickFinishButton()
     {
         clickButton( "Finish" );
+
+        if ( title != null )
+        {
+            bot.waitUntil( new DefaultCondition()
+            {
+                public boolean test() throws Exception
+                {
+                    return isVisible( title );
+                }
+
+
+                public String getFailureMessage()
+                {
+                    return "Wizard " + title + " not closed.";
+                }
+            } );
+        }
     }
 
 



Mime
View raw message