directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1677038 - in /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui: ./ bots/ bots/utils/
Date Thu, 30 Apr 2015 18:05:15 GMT
Author: seelmann
Date: Thu Apr 30 18:05:14 2015
New Revision: 1677038

URL: http://svn.apache.org/r1677038
Log:
DIRSTUDIO-1041: Headless run of SWTBot tests
* Extend ApacheDS framework runner to capture screenshot of failing tests
* Replace some hand-written wait conditions by SWTBot provided
* Wait till wizards and dialogs are closed to avoid timeouts and race conditions
* Monitor and wait till background jobs are finished to avoid timeouts and race conditions

Added:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/utils/FrameworkRunnerWithScreenshotCaptureListener.java
Modified:
    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/ImportExportTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DeleteDialogBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ExportWizardBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ImportWizardBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewConnectionWizardBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewEntryWizardBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/RenameEntryDialogBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchResultEditorBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.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/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=1677038&r1=1677037&r2=1677038&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
Thu Apr 30 18:05:14 2015
@@ -32,7 +32,6 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifFiles;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.name.Dn;
@@ -51,6 +50,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.ReferralDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.SearchLogsViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.junit.After;
@@ -65,7 +65,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles( clazz = BrowserTest.class,

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=1677038&r1=1677037&r2=1677038&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
Thu Apr 30 18:05:14 2015
@@ -31,7 +31,6 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifFiles;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
@@ -43,6 +42,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.NewAttributeWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.SelectDnDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
 import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
 import org.junit.After;
@@ -57,7 +57,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles( clazz=EntryEditorTest.class,

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
Thu Apr 30 18:05:14 2015
@@ -36,7 +36,6 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifFiles;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
 import org.apache.directory.api.ldap.model.name.Dn;
@@ -47,6 +46,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.ExportWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.ImportWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.eclipse.core.runtime.Platform;
 import org.junit.After;
 import org.junit.Before;
@@ -60,7 +60,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles( clazz = ImportExportTest.class,
@@ -256,11 +256,11 @@ public class ImportExportTest extends Ab
         ImportWizardBot importWizardBot = browserViewBot.openImportLdifWizard();
         importWizardBot.typeFile( destFile );
         importWizardBot.clickFinishButton();
+        browserViewBot.waitForEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=User.1"
);
+        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=User.1"
);
 
         long fireCount1 = EventRegistry.getFireCount();
 
-        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=User.1"
);
-
         // verify that only three two events were fired between Import
         long fireCount = fireCount1 - fireCount0;
         assertEquals( "Only 2 event firings expected when importing LDIF.", 2, fireCount
);

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
Thu Apr 30 18:05:14 2015
@@ -49,7 +49,6 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.entry.Modification;
 import org.apache.directory.api.ldap.model.message.ModifyRequest;
@@ -64,6 +63,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.ErrorDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.NewConnectionWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.bouncycastle.x509.X509V1CertificateGenerator;
 import org.junit.After;
 import org.junit.Before;
@@ -80,7 +80,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 public class NewConnectionWizardTest extends AbstractLdapTestUnit

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
Thu Apr 30 18:05:14 2015
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTru
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.name.Dn;
@@ -40,6 +39,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.NewEntryWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.ReferralDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
 import org.junit.After;
@@ -54,7 +54,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 public class NewEntryWizardTest extends AbstractLdapTestUnit

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java
Thu Apr 30 18:05:14 2015
@@ -30,10 +30,10 @@ import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.studio.test.integration.ui.bots.CertificateValidationPreferencePageBot;
 import org.apache.directory.studio.test.integration.ui.bots.PreferencesBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.eclipse.core.runtime.Platform;
 import org.junit.After;
 import org.junit.Before;
@@ -47,7 +47,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 public class PreferencesTest extends AbstractLdapTestUnit
 {
     private StudioBot studioBot;

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
Thu Apr 30 18:05:14 2015
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTru
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.name.Dn;
@@ -39,6 +38,7 @@ import org.apache.directory.studio.test.
 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.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -51,7 +51,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 public class ReferralDialogTest extends AbstractLdapTestUnit

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
Thu Apr 30 18:05:14 2015
@@ -27,11 +27,11 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifFiles;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 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.RenameEntryDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles( clazz = RenameEntryDialogTest.class,

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
Thu Apr 30 18:05:14 2015
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertTru
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.api.ldap.model.message.ModifyRequest;
 import org.apache.directory.api.ldap.model.message.ModifyRequestImpl;
 import org.apache.directory.api.ldap.model.name.Dn;
@@ -42,6 +41,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.SearchPropertiesDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.SearchResultEditorBot;
 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.swt.finder.utils.SWTUtils;
 import org.junit.After;
 import org.junit.Before;
@@ -55,7 +55,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 public class SearchTest extends AbstractLdapTestUnit

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
Thu Apr 30 18:05:14 2015
@@ -27,12 +27,12 @@ import static org.junit.Assert.assertTru
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
-import org.apache.directory.server.core.integ.FrameworkRunner;
 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.DeleteDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.NewEntryWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
+import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener;
 import org.eclipse.swt.graphics.DeviceData;
 import org.eclipse.swtbot.swt.finder.SWTBot;
 import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
@@ -49,7 +49,7 @@ import org.junit.runner.RunWith;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(FrameworkRunner.class)
+@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class)
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 public class SwtResourcesTest extends AbstractLdapTestUnit
@@ -163,6 +163,7 @@ public class SwtResourcesTest extends Ab
 
         wizardBot.clickFinishButton();
 
+        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "o=" + name
) );
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "o=" + name );
         DeleteDialogBot dialog = browserViewBot.openDeleteDialog();
         dialog.clickOkButton();

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.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/BrowserWidgetBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/BrowserWidgetBot.java
Thu Apr 30 18:05:14 2015
@@ -11,6 +11,7 @@ import org.eclipse.swtbot.swt.finder.SWT
 import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
 import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
 import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -170,20 +171,7 @@ class BrowserWidgetBot
     {
         if ( !bot.tree().isEnabled() )
         {
-            bot.waitUntil( new DefaultCondition()
-            {
-
-                public boolean test() throws Exception
-                {
-                    return bot.tree().isEnabled();
-                }
-
-
-                public String getFailureMessage()
-                {
-                    return "Entry " + entry + " is not enabled!";
-                }
-            } );
+            bot.waitUntil( Conditions.widgetIsEnabled( bot.tree() ) );
         }
         JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__init_entries_title_attonly
);
         entry.click();

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DeleteDialogBot.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/DeleteDialogBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DeleteDialogBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DeleteDialogBot.java
Thu Apr 30 18:05:14 2015
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.studio.test.integration.ui.bots;
 
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
+
 
 public class DeleteDialogBot extends DialogBot
 {
@@ -43,7 +46,22 @@ public class DeleteDialogBot extends Dia
 
     public void clickOkButton()
     {
+        JobWatcher watcher = null;
+        if ( DELETE_ENTRY_TITLE.equals( title ) )
+        {
+            watcher = new JobWatcher( BrowserCoreMessages.jobs__delete_entries_name_1 );
+        }
+        else if ( DELETE_ENTRIES_TITLE.equals( title ) )
+        {
+            watcher = new JobWatcher( BrowserCoreMessages.jobs__delete_entries_name_n );
+        }
+
         super.clickButton( "OK" );
+
+        if ( watcher != null )
+        {
+            watcher.waitUntilDone();
+        }
     }
 
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.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/DialogBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java
Thu Apr 30 18:05:14 2015
@@ -21,8 +21,6 @@ package org.apache.directory.studio.test
 
 
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
 
 
@@ -41,28 +39,6 @@ public abstract class DialogBot
     protected void clickButton( final String buttonTitle )
     {
         final SWTBotButton button = bot.button( buttonTitle );
-        if ( !button.isEnabled() )
-        {
-            bot.waitUntil( new ICondition()
-            {
-
-                public boolean test() throws Exception
-                {
-                    return button.isEnabled();
-                }
-
-
-                public void init( SWTBot bot )
-                {
-                }
-
-
-                public String getFailureMessage()
-                {
-                    return "Button " + buttonTitle + " is not enabled!";
-                }
-            } );
-        }
         button.click();
     }
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ExportWizardBot.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/ExportWizardBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ExportWizardBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ExportWizardBot.java
Thu Apr 30 18:05:14 2015
@@ -22,6 +22,8 @@ package org.apache.directory.studio.test
 
 import java.io.File;
 
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
 import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
 
 
@@ -34,6 +36,7 @@ public class ExportWizardBot extends Wiz
 
     public ExportWizardBot( String title )
     {
+        super(title);
         this.title = title;
     }
 
@@ -50,6 +53,28 @@ public class ExportWizardBot extends Wiz
     }
 
 
+    @Override
+    public void clickFinishButton()
+    {
+        JobWatcher watcher = null;
+        if ( EXPORT_LDIF_TITLE.equals( title ) )
+        {
+            watcher = new JobWatcher( BrowserCoreMessages.jobs__export_ldif_name );
+        }
+        else if ( EXPORT_DSML_TITLE.equals( title ) )
+        {
+            watcher = new JobWatcher( BrowserCoreMessages.jobs__export_dsml_name );
+        }
+
+        super.clickFinishButton();
+
+        if ( watcher != null )
+        {
+            watcher.waitUntilDone();
+        }
+    }
+
+
     public void waitTillExportFinished( final String file, final int expectedFileSize )
     {
         bot.waitUntil( new DefaultCondition()

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ImportWizardBot.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/ImportWizardBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ImportWizardBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ImportWizardBot.java
Thu Apr 30 18:05:14 2015
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.studio.test.integration.ui.bots;
 
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
+
 
 public class ImportWizardBot extends WizardBot
 {
@@ -29,6 +32,7 @@ public class ImportWizardBot extends Wiz
 
     public ImportWizardBot( String title )
     {
+        super(title);
         this.title = title;
     }
 
@@ -44,4 +48,26 @@ public class ImportWizardBot extends Wiz
         bot.comboBox().setText( file );
     }
 
+
+    @Override
+    public void clickFinishButton()
+    {
+        JobWatcher watcher = null;
+        if ( IMPORT_LDIF_TITLE.equals( title ) )
+        {
+            watcher = new JobWatcher( BrowserCoreMessages.jobs__import_ldif_name );
+        }
+        else if ( IMPORT_DSML_TITLE.equals( title ) )
+        {
+            watcher = new JobWatcher( BrowserCoreMessages.jobs__import_dsml_name );
+        }
+
+        super.clickFinishButton();
+
+        if ( watcher != null )
+        {
+            watcher.waitUntilDone();
+        }
+    }
+
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewConnectionWizardBot.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/NewConnectionWizardBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewConnectionWizardBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewConnectionWizardBot.java
Thu Apr 30 18:05:14 2015
@@ -20,6 +20,8 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
@@ -28,6 +30,7 @@ import org.eclipse.swtbot.swt.finder.wid
 public class NewConnectionWizardBot extends WizardBot
 {
 
+    private static final String TITLE = "New LDAP Connection";
     private static final String CERTIFICATE_TRUST = "Certificate Trust";
     private static final String CONNECTION_NAME = "Connection name:";
     private static final String HOSTNAME = "Hostname:";
@@ -50,10 +53,23 @@ public class NewConnectionWizardBot exte
     private static final String START_TLS_ENCRYPTION = "Use StartTLS extension";
     private static final String LDAPS_ENCRYPTION = "Use SSL encryption (ldaps://)";
 
+    
+    public NewConnectionWizardBot()
+    {
+        super( TITLE );
+    }
 
+    @Override
+    public void clickFinishButton()
+    {
+        JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__open_connections_name_1
);
+        super.clickFinishButton();
+        watcher.waitUntilDone();
+    }
+    
     public boolean isVisible()
     {
-        return isVisible( "New LDAP Connection" );
+        return isVisible( TITLE );
     }
 
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewEntryWizardBot.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/NewEntryWizardBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewEntryWizardBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewEntryWizardBot.java
Thu Apr 30 18:05:14 2015
@@ -20,24 +20,35 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 import org.apache.directory.api.ldap.model.name.Dn;
-
-
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
 
 
 public class NewEntryWizardBot extends WizardBot
 {
+    private static final String TITLE = "New Entry";
+
     private EntryEditorWidgetBot widgetBot;
 
 
     public NewEntryWizardBot()
     {
+        super( TITLE );
         this.widgetBot = new EntryEditorWidgetBot( bot );
     }
 
 
+    @Override
+    public void clickFinishButton()
+    {
+        JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__create_entry_name_1
);
+        super.clickFinishButton();
+        watcher.waitUntilDone();
+    }
+
     public boolean isVisible()
     {
-        return isVisible( "New Entry" );
+        return isVisible( TITLE );
     }
 
 
@@ -117,7 +128,7 @@ public class NewEntryWizardBot extends W
 
     public ReferralDialogBot clickFinishButtonExpectingReferralDialog()
     {
-        clickFinishButton();
+        clickButton( "Finish" );
         return new ReferralDialogBot();
     }
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/RenameEntryDialogBot.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/RenameEntryDialogBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/RenameEntryDialogBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/RenameEntryDialogBot.java
Thu Apr 30 18:05:14 2015
@@ -19,6 +19,9 @@
  */
 package org.apache.directory.studio.test.integration.ui.bots;
 
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
+
 
 public class RenameEntryDialogBot extends DialogBot
 {
@@ -31,7 +34,9 @@ public class RenameEntryDialogBot extend
 
     public void clickOkButton()
     {
+        JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__rename_entry_name
);
         super.clickButton( "OK" );
+        watcher.waitUntilDone();
     }
 
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchResultEditorBot.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/SearchResultEditorBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchResultEditorBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/SearchResultEditorBot.java
Thu Apr 30 18:05:14 2015
@@ -30,6 +30,7 @@ import org.apache.directory.studio.ldapb
 import org.apache.directory.studio.test.integration.ui.bots.utils.JobWatcher;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Widget;
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
 import org.eclipse.swtbot.swt.finder.SWTBot;
@@ -75,7 +76,7 @@ public class SearchResultEditorBot
     {
         JobWatcher watcher = new JobWatcher( BrowserCoreMessages.jobs__search_name );
         //bot.toolbarButton( "Search Again (F5)" ).click();
-        Matcher matcher = allOf( widgetOfType( ToolItem.class ), withTooltip( "Search Again
(F5)" ), withStyle(
+        Matcher<Widget> matcher = allOf( widgetOfType( ToolItem.class ), withTooltip(
"Search Again (F5)" ), withStyle(
             SWT.PUSH, "SWT.PUSH" ) );
         SWTBotToolbarPushButton button = new SWTBotToolbarPushButton( ( ToolItem ) bot.widget(
matcher, 0 ), matcher );
         button.click();

Modified: directory/studio/trunk/tests/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/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java?rev=1677038&r1=1677037&r2=1677038&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
Thu Apr 30 18:05:14 2015
@@ -79,6 +79,9 @@ public class StudioBot
             {
                 try
                 {
+                    // https://wiki.eclipse.org/SWTBot/Troubleshooting#No_active_Shell_when_running_SWTBot_tests_in_Xvfb
+                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().forceActive();
+
                     IWorkbench workbench = PlatformUI.getWorkbench();
                     IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
 

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=1677038&r1=1677037&r2=1677038&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
Thu Apr 30 18:05:14 2015
@@ -20,7 +20,8 @@
 package org.apache.directory.studio.test.integration.ui.bots;
 
 
-import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
 
 
 public abstract class WizardBot extends DialogBot
@@ -84,23 +85,17 @@ public abstract class WizardBot extends
 
     public void clickFinishButton()
     {
-        clickButton( "Finish" );
-
+        SWTBotShell shell = null;
         if ( title != null )
         {
-            bot.waitUntil( new DefaultCondition()
-            {
-                public boolean test() throws Exception
-                {
-                    return isVisible( title );
-                }
+            shell = bot.shell( title );
+        }
 
+        clickButton( "Finish" );
 
-                public String getFailureMessage()
-                {
-                    return "Wizard " + title + " not closed.";
-                }
-            } );
+        if ( shell != null )
+        {
+            bot.waitUntil( Conditions.shellCloses( shell ) );
         }
     }
 

Added: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/utils/FrameworkRunnerWithScreenshotCaptureListener.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/utils/FrameworkRunnerWithScreenshotCaptureListener.java?rev=1677038&view=auto
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/utils/FrameworkRunnerWithScreenshotCaptureListener.java
(added)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/utils/FrameworkRunnerWithScreenshotCaptureListener.java
Thu Apr 30 18:05:14 2015
@@ -0,0 +1,54 @@
+/*
+ *  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.utils;
+
+
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.eclipse.swtbot.swt.finder.junit.ScreenshotCaptureListener;
+import org.junit.runner.notification.RunListener;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.model.InitializationError;
+
+
+public class FrameworkRunnerWithScreenshotCaptureListener extends FrameworkRunner
+{
+
+    public FrameworkRunnerWithScreenshotCaptureListener( Class<?> clazz ) throws InitializationError
+    {
+        super( clazz );
+    }
+
+
+    public void run( RunNotifier notifier )
+    {
+        RunListener failureSpy = new ScreenshotCaptureListener();
+        notifier.removeListener( failureSpy );
+        notifier.addListener( failureSpy );
+        try
+        {
+            super.run( notifier );
+        }
+        finally
+        {
+            notifier.removeListener( failureSpy );
+        }
+    }
+
+}



Mime
View raw message