directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1679804 - in /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui: ./ bots/
Date Sat, 16 May 2015 21:20:31 GMT
Author: seelmann
Date: Sat May 16 21:20:30 2015
New Revision: 1679804

URL: http://svn.apache.org/r1679804
Log:
Improve some flaky tests

Added:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/AbstractLogsViewBot.java
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/LdifEditorTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ModificationLogsViewBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchLogsViewBot.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=1679804&r1=1679803&r2=1679804&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
Sat May 16 21:20:30 2015
@@ -37,10 +37,12 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.DeleteDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.NewApacheDSServerWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -49,6 +51,7 @@ import org.junit.Test;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 public class ApacheDSPluginTest
 {
     private StudioBot studioBot;

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/LdifEditorTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/LdifEditorTest.java?rev=1679804&r1=1679803&r2=1679804&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/LdifEditorTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/LdifEditorTest.java
Sat May 16 21:20:30 2015
@@ -50,6 +50,10 @@ public class LdifEditorTest extends Abst
     {
         studioBot = new StudioBot();
         studioBot.resetLdapPerspective();
+
+        // activate search and modifications logs, they also include an LDIF editor and increment
the counter
+        studioBot.getSearchLogsViewBot().getSearchLogsText();
+        studioBot.getModificationLogsViewBot().getModificationLogsText();
     }
 
 
@@ -70,7 +74,8 @@ public class LdifEditorTest extends Abst
         assertTrue( newWizard.isFinishButtonEnabled() );
         newWizard.clickFinishButton();
 
-        LdifEditorBot ldifEditorBot = new LdifEditorBot( "LDIF 2" );
+        // TODO: use matcher instead of hard code editor number
+        LdifEditorBot ldifEditorBot = new LdifEditorBot( "LDIF 3" );
         ldifEditorBot.activate();
         ldifEditorBot.typeText( "dn: dc=test\nobjectClass: domain\n\n" );
         assertTrue( ldifEditorBot.isDirty() );

Added: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/AbstractLogsViewBot.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/AbstractLogsViewBot.java?rev=1679804&view=auto
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/AbstractLogsViewBot.java
(added)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/AbstractLogsViewBot.java
Sat May 16 21:20:30 2015
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.test.integration.ui.bots;
+
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarPushButton;
+
+
+public class AbstractLogsViewBot
+{
+
+    private SWTBotView view;
+
+
+    public AbstractLogsViewBot( String title )
+    {
+        view = new SWTWorkbenchBot().viewByTitle( title );
+    }
+
+
+    public String getLogsText()
+    {
+        view.show();
+        SWTBotToolbarPushButton refreshButton = view.toolbarPushButton( "Refresh" );
+        if ( refreshButton.isEnabled() )
+        {
+            refreshButton.click();
+        }
+        return view.bot().styledText().getText();
+    }
+}

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ModificationLogsViewBot.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/ModificationLogsViewBot.java?rev=1679804&r1=1679803&r2=1679804&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ModificationLogsViewBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ModificationLogsViewBot.java
Sat May 16 21:20:30 2015
@@ -20,27 +20,16 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 
-import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-
-
-public class ModificationLogsViewBot
+public class ModificationLogsViewBot extends AbstractLogsViewBot
 {
-
-    private SWTBotView view;
-
-
     public ModificationLogsViewBot()
     {
-        view = new SWTWorkbenchBot().viewByTitle( "Modification Logs" );
+        super( "Modification Logs" );
     }
 
 
     public String getModificationLogsText()
     {
-        view.show();
-        view.toolbarPushButton( "Refresh" ).click();
-        return view.bot().styledText().getText();
+        return super.getLogsText();
     }
-
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchLogsViewBot.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/SearchLogsViewBot.java?rev=1679804&r1=1679803&r2=1679804&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchLogsViewBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchLogsViewBot.java
Sat May 16 21:20:30 2015
@@ -20,26 +20,16 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 
-import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-
-
-public class SearchLogsViewBot
+public class SearchLogsViewBot extends AbstractLogsViewBot
 {
-
-    private SWTBotView view;
-
-
     public SearchLogsViewBot()
     {
-        view = new SWTWorkbenchBot().viewByTitle( "Search Logs" );
+        super( "Search Logs" );
     }
 
 
     public String getSearchLogsText()
     {
-        view.show();
-        view.toolbarPushButton( "Refresh" ).click();
-        return view.bot().styledText().getText();
+        return super.getLogsText();
     }
 }



Mime
View raw message