falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rostafiyc...@apache.org
Subject falcon git commit: FALCON-1269 Update InstancePageTest and other after UI changes. Contributed by Ruslan Ostafiychuk
Date Fri, 12 Jun 2015 12:39:46 GMT
Repository: falcon
Updated Branches:
  refs/heads/master c75653072 -> 4df64f80b


FALCON-1269 Update InstancePageTest and other after UI changes. Contributed by Ruslan Ostafiychuk


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/4df64f80
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/4df64f80
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/4df64f80

Branch: refs/heads/master
Commit: 4df64f80b596997a6232fdeb44a4d80cbfe39597
Parents: c756530
Author: Ruslan Ostafiychuk <rostafiychuk@apache.org>
Authored: Fri Jun 12 15:20:59 2015 +0300
Committer: Ruslan Ostafiychuk <rostafiychuk@apache.org>
Committed: Fri Jun 12 15:38:29 2015 +0300

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  2 +
 .../regression/Entities/ClusterMerlin.java      | 39 +++++++++++-
 .../helpers/entity/AbstractEntityHelper.java    |  1 +
 .../falcon/regression/core/util/BundleUtil.java | 23 ++++---
 .../ui/search/AbstractSearchPage.java           | 66 +++++++++++++++++---
 .../regression/ui/search/ClusterWizardPage.java |  1 +
 .../regression/ui/search/FeedWizardPage.java    |  1 +
 .../regression/ui/search/InstancePage.java      |  1 +
 .../falcon/regression/ui/search/LoginPage.java  |  3 +-
 .../regression/ui/search/ProcessWizardPage.java |  2 +-
 .../falcon/regression/ui/search/SearchPage.java | 25 +++-----
 .../falcon/regression/ExternalFSTest.java       |  1 +
 .../falcon/regression/TestngListener.java       |  2 +-
 .../regression/searchUI/ClusterSetupTest.java   | 10 +--
 .../regression/searchUI/EntitiesTableTest.java  | 17 +++--
 .../regression/searchUI/InstancePageTest.java   | 27 ++++----
 16 files changed, 161 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index c54e142..c133e0d 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -351,6 +351,8 @@ Trunk (Unreleased)
    FALCON-681 delete duplicate feed retention test from falcon regression (SamarthG)
 
   BUG FIXES
+   FALCON-1269 Update InstancePageTest and other after UI changes (Ruslan Ostafiychuk)
+
    FALCON-1270 SearchUI. Login screen changed to not have password field (Namit Maheshwari
via Ruslan Ostafiychuk)
 
    FALCON-1266 LineageApiTest test fixes (Raghav Kumar Gautam via Ruslan Ostafiychuk)

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/Entities/ClusterMerlin.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/Entities/ClusterMerlin.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/Entities/ClusterMerlin.java
index 4912be9..0198e19 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/Entities/ClusterMerlin.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/Entities/ClusterMerlin.java
@@ -111,6 +111,40 @@ public class ClusterMerlin extends Cluster {
         }
     }
 
+    public String getInterfaceEndpoint(final Interfacetype interfaceType) {
+        String value = null;
+        for (Interface anInterface : getInterfaces().getInterfaces()) {
+            if (anInterface.getType() == interfaceType) {
+                value = anInterface.getEndpoint();
+            }
+        }
+        LOGGER.info("Cluster: " + getName() + " interfaceType: " + interfaceType
+            + " value:" + value);
+        return value;
+    }
+
+    public String getProperty(final String propName) {
+        String value = null;
+        for (Property property : getProperties().getProperties()) {
+            if (property.getName().trim().equals(propName.trim())) {
+                value = property.getValue();
+            }
+        }
+        LOGGER.info("Cluster: " + getName() + " property: " + propName + " value:" + value);
+        return value;
+    }
+
+    public String getLocation(final String locationType) {
+        String value = null;
+        for (Location location : getLocations().getLocations()) {
+            if (location.getName().name().trim().equalsIgnoreCase(locationType.trim().toLowerCase()))
{
+                value = location.getPath();
+            }
+        }
+        LOGGER.info("Cluster: " + getName() + " locationType: " + locationType + " value:"
+ value);
+        return value;
+    }
+
     /**
      * Cleans all properties and returns empty cluster as a draft (as we can't create cluster
e.g from empty string).
      */
@@ -251,14 +285,15 @@ public class ClusterMerlin extends Cluster {
         return true;
     }
 
-    public List<Location> getLocation(ClusterLocationType type) {
+    public Location getLocation(ClusterLocationType type) {
         List<Location> locationsOfType = new ArrayList<>();
         for(Location location : locations.getLocations()) {
             if (location.getName() == type) {
                 locationsOfType.add(location);
             }
         }
-        return locationsOfType;
+        Assert.assertEquals(locationsOfType.size(), 1, "Unexpected number of " + type + "
locations in: " + this);
+        return locationsOfType.get(0);
     }
     @Override
     public EntityType getEntityType() {

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
index f242286..98ac2f8 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
@@ -164,6 +164,7 @@ public abstract class AbstractEntityHelper {
     public FileSystem getHadoopFS() throws IOException {
         if (null == this.hadoopFS) {
             Configuration conf = new Configuration();
+            conf.setBoolean("fs.hdfs.impl.disable.cache", true);
             conf.set("fs.default.name", "hdfs://" + this.hadoopURL);
             this.hadoopFS = FileSystem.get(conf);
         }

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/BundleUtil.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/BundleUtil.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/BundleUtil.java
index 761ebe7..bda5c23 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/BundleUtil.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/BundleUtil.java
@@ -198,11 +198,11 @@ public final class BundleUtil {
         }
         //set colo name:
         clusterObject.setColo(Config.getProperty(prefix + "colo"));
+        // get the properties object for the cluster
+        org.apache.falcon.entity.v0.cluster.Properties clusterProperties =
+            clusterObject.getProperties();
         // properties in the cluster needed when secure mode is on
         if (MerlinConstants.IS_SECURE) {
-            // get the properties object for the cluster
-            org.apache.falcon.entity.v0.cluster.Properties clusterProperties =
-                clusterObject.getProperties();
             // add the namenode principal to the properties object
             clusterProperties.getProperties().add(getFalconClusterPropertyObject(
                     "dfs.namenode.kerberos.principal",
@@ -219,11 +219,18 @@ public final class BundleUtil {
             clusterProperties.getProperties()
                 .add(getFalconClusterPropertyObject("hive.metastore.sasl.enabled", "true"));
             // Only set the metastore uri if its not empty or null.
-            if (null != hcatEndpoint && !hcatEndpoint.isEmpty()) {
-                //hive.metastore.uris
-                clusterProperties.getProperties()
-                    .add(getFalconClusterPropertyObject("hive.metastore.uris", hcatEndpoint));
-            }
+        }
+        String hiveMetastoreUris = Config.getProperty(prefix + "hive.metastore.uris");
+        if (StringUtils.isNotBlank(hiveMetastoreUris)) {
+            //hive.metastore.uris
+            clusterProperties.getProperties()
+                .add(getFalconClusterPropertyObject("hive.metastore.uris", hiveMetastoreUris));
+        }
+        String hiveServer2Uri = Config.getProperty(prefix + "hive.server2.uri");
+        if (StringUtils.isNotBlank(hiveServer2Uri)) {
+            //hive.metastore.uris
+            clusterProperties.getProperties()
+                .add(getFalconClusterPropertyObject("hive.server2.uri", hiveServer2Uri));
         }
         return clusterObject;
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
index a1e3e2e..b22fa1c 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
@@ -29,11 +29,14 @@ import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.FindBy;
 import org.openqa.selenium.support.PageFactory;
 import org.openqa.selenium.support.ui.Select;
+import org.testng.Assert;
 
 import java.util.ArrayList;
 import java.util.List;
 
 
+
+
 /** Parent page object for all the search ui pages. */
 public abstract class AbstractSearchPage extends Page {
 
@@ -73,6 +76,51 @@ public abstract class AbstractSearchPage extends Page {
 
     }
 
+    public static void clearAndSet(WebElement webElement, String val) {
+        webElement.clear();
+        webElement.sendKeys(val);
+    }
+
+    public static void clearAndSetSlowly(WebElement webElement, String val) {
+        webElement.clear();
+        sendKeysSlowly(webElement, val);
+    }
+
+    protected WebElement findElementByNgModel(String ngModelName) {
+        // trying to get an xpath that looks like: "//*[@ng-model='UIModel.retry.policy']"
+        final String xpathExpression = "//*[@ng-model='" + ngModelName + "']";
+        final List<WebElement> webElements = driver.findElements(By.xpath(xpathExpression));
+        Assert.assertEquals(webElements.size(), 1, "Element is not unique for ng-model: "
+ ngModelName);
+        return webElements.get(0);
+    }
+
+    protected void selectNgModelByVisibleText(String ngModelName, String visibleText) {
+        final WebElement webElement = findElementByNgModel(ngModelName);
+        final Select select = new Select(webElement);
+        select.selectByVisibleText(visibleText);
+    }
+
+    protected void clearAndSetByNgModel(String ngModelName, String value) {
+        final WebElement webElement = findElementByNgModel(ngModelName);
+        clearAndSet(webElement, value);
+    }
+
+    protected void clearAndSetSlowlyByNgModel(String ngModelName, String value) {
+        final WebElement webElement = findElementByNgModel(ngModelName);
+        clearAndSetSlowly(webElement, value);
+    }
+
+    protected void clickById(String id) {
+        final List<WebElement> webElements = driver.findElements(By.id(id));
+        Assert.assertEquals(webElements.size(), 1, "Element is not unique.");
+        webElements.get(0).click();
+    }
+
+    protected void clickByNgModel(String ngModelName) {
+        final WebElement webElement = findElementByNgModel(ngModelName);
+        webElement.click();
+    }
+
     // Utility method to get Dropdown Values
     public List<String> getDropdownValues(Select element){
         List<WebElement> allOptions = element.getOptions();
@@ -99,14 +147,16 @@ public abstract class AbstractSearchPage extends Page {
     }
 
     public String getActiveAlertText() {
-        WebElement alertsBlock = driver.findElement(By.className("messages"));
-        List<WebElement> alerts = alertsBlock.findElements(By.className("message"));
-        if (!alerts.isEmpty()) {
-            WebElement last = alerts.get(alerts.size() - 1);
-            if (last.isDisplayed()) {
-                return last.getText();
-            }
+        WebElement alertsBlock = driver.findElement(By.xpath("//div[@class='messages notifs']"));
+        if (alertsBlock.getAttribute("style").contains("opacity")) {
+            return alertsBlock.findElement(By.xpath("./div[last()]")).getText();
+        } else {
+            return null;
         }
-        return null;
+    }
+
+    protected void waitForAlert() {
+        driver.findElements(
+            By.xpath("//div[@class='messages notifs' and contains(@style,'opacity')]"));
     }
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
index c2493e8..cb6315b 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
@@ -423,6 +423,7 @@ public class ClusterWizardPage extends AbstractSearchPage {
      */
     public void clickSave() {
         save.click();
+        waitForAlert();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/FeedWizardPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/FeedWizardPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/FeedWizardPage.java
index 9b68c95..eb5ff87 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/FeedWizardPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/FeedWizardPage.java
@@ -641,6 +641,7 @@ public class FeedWizardPage extends AbstractSearchPage {
         setFeedClustersInfo(feed);
         nextButton.click();
         saveFeedButton.click();
+        waitForAlert();
     }
 
     public FeedMerlin getFeedMerlinFromFeedXml() throws Exception{

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/InstancePage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/InstancePage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/InstancePage.java
index 1fce0a2..d056539 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/InstancePage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/InstancePage.java
@@ -42,6 +42,7 @@ public class InstancePage extends AbstractSearchPage {
      */
     public enum Button {
         Resume,
+        Rerun,
         Suspend,
         Stop
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/LoginPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/LoginPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/LoginPage.java
index e292e44..eb41e23 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/LoginPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/LoginPage.java
@@ -18,6 +18,7 @@
 
 package org.apache.falcon.regression.ui.search;
 
+import org.apache.falcon.regression.core.enumsAndConstants.MerlinConstants;
 import org.apache.falcon.regression.core.util.UIAssert;
 import org.apache.log4j.Logger;
 import org.openqa.selenium.By;
@@ -31,7 +32,7 @@ import org.testng.Assert;
 /** Page object for the Login Page. */
 public class LoginPage extends AbstractSearchPage {
     private static final Logger LOGGER = Logger.getLogger(LoginPage.class);
-    public static final String UI_DEFAULT_USER = "hrt_qa";
+    public static final String UI_DEFAULT_USER = MerlinConstants.CURRENT_USER_NAME;
 
     public LoginPage(WebDriver driver) {
         super(driver);

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ProcessWizardPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ProcessWizardPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ProcessWizardPage.java
index 42e2f12..5413cb6 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ProcessWizardPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ProcessWizardPage.java
@@ -822,7 +822,7 @@ public class ProcessWizardPage extends AbstractSearchPage {
 
     public void clickSave(){
         getSaveProcessButton().click();
-        waitForAngularToFinish();
+        waitForAlert();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/SearchPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/SearchPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/SearchPage.java
index b3bbeab..c3767eb 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/SearchPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/SearchPage.java
@@ -145,8 +145,9 @@ public class SearchPage extends AbstractSearchPage {
 
     public List<SearchResult> appendAndSearch(String appendedPart) {
         for(String queryParam : appendedPart.split("\\s+")) {
+            focusOnSearchBox();
             getSearchBox().sendKeys(queryParam);
-            getSearchBox().sendKeys(Keys.SPACE);
+            getSearchBox().sendKeys(Keys.ENTER);
         }
         String activeAlert = getActiveAlertText();
         if (activeAlert != null) {
@@ -163,6 +164,7 @@ public class SearchPage extends AbstractSearchPage {
     }
 
     public void clearSearch() {
+        focusOnSearchBox();
         getSearchBox().clear();
         SearchQuery query = getSearchQuery();
         for (int i = 0; i < query.getElementsNumber(); i++) {
@@ -171,10 +173,14 @@ public class SearchPage extends AbstractSearchPage {
     }
 
     public void removeLastParam() {
+        focusOnSearchBox();
         getSearchBox().sendKeys(Keys.BACK_SPACE);
         getSearchBox().sendKeys(Keys.BACK_SPACE);
     }
 
+    private void focusOnSearchBox() {
+        searchBlock.findElement(By.className("tags")).click();
+    }
 
     public void checkNoResult() {
         UIAssert.assertNotDisplayed(resultBlock, "Search result block");
@@ -216,7 +222,6 @@ public class SearchPage extends AbstractSearchPage {
 
         private SearchQuery updateElements() {
             name = null;
-            type = null;
             tags.clear();
             final WebElement queryGroup = searchBlock.findElement(By.className("tag-list"));
             final List<WebElement> queryParts = queryGroup.findElements(By.tagName("li"));
@@ -225,35 +230,23 @@ public class SearchPage extends AbstractSearchPage {
                 final WebElement queryLabel = queryPart.findElement(By.tagName("strong"));
                 final String queryText = queryPart.findElement(By.tagName("span")).getText();
                 switch (queryLabel.getText().trim()) {
-                case "NAME:":
+                case "Name:":
                     if (name != null) {
                         LOGGER.warn(String.format("NAME block is already added: '%s' =>
'%s'",
                             name, queryText));
                     }
                     name = queryText;
                     break;
-                case "TAG:":
+                case "Tag:":
                     tags.add(queryText);
                     break;
-                case "TYPE:":
-                    if (type != null) {
-                        LOGGER.warn(String.format("TYPE block is already added: '%s' =>
'%s'",
-                            type, queryText));
-                    }
-                    type = queryText;
-                    break;
                 default:
-                    Assert.fail("There should be only TAGs or TYPE");
                 }
             }
             return this;
         }
 
 
-        public String getType() {
-            return type;
-        }
-
         public String getName() {
             return name;
         }

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ExternalFSTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ExternalFSTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ExternalFSTest.java
index 05a2b0b..0662562 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ExternalFSTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ExternalFSTest.java
@@ -90,6 +90,7 @@ public class ExternalFSTest extends BaseTestClass{
         conf.set("fs.defaultFS", WASB_END_POINT);
         conf.set("fs.azure.account.key." + MerlinConstants.WASB_ACCOUNT,
                 MerlinConstants.WASB_SECRET);
+        conf.setBoolean("fs.hdfs.impl.disable.cache", false);
         wasbFS = FileSystem.get(conf);
         LOGGER.info("creating base wasb dir" + baseWasbDir);
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/TestngListener.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/TestngListener.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/TestngListener.java
index 8d8677c..ea472e6 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/TestngListener.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/TestngListener.java
@@ -119,7 +119,7 @@ public class TestngListener implements ITestListener, IExecutionListener
{
                 String params = Arrays.toString(result.getParameters());
                 params = params.replaceAll("[<>\":\\\\/\\|\\?\\*]", ""); //remove <>:"/\|?*
                 String filename = OSUtil.getPath("target", "surefire-reports", "screenshots",
-                    String.format("%s.%s.(%s).png", result.getTestClass().getRealClass()
+                    String.format("%s.%s(%s).png", result.getTestClass().getRealClass()
                         .getSimpleName(), result.getName(), params));
                 FileUtils.writeByteArrayToFile(new File(filename), scrFile);
             } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
index 12b3fe5..960bb5c 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
@@ -228,12 +228,12 @@ public class ClusterSetupTest extends BaseUITestClass{
     @Test
     public void testLocationsBadPermissions() throws IOException {
         //reverse staging and working location dirs
-        String staging = sourceCluster.getLocation(ClusterLocationType.STAGING).get(0).getPath();
-        String working = sourceCluster.getLocation(ClusterLocationType.WORKING).get(0).getPath();
+        String staging = sourceCluster.getLocation(ClusterLocationType.STAGING).getPath();
+        String working = sourceCluster.getLocation(ClusterLocationType.WORKING).getPath();
         //set working to dir which has 777 permissions
-        sourceCluster.getLocation(ClusterLocationType.WORKING).get(0).setPath(staging);
+        sourceCluster.getLocation(ClusterLocationType.WORKING).setPath(staging);
         //set staging to dir which has 755 permissions
-        sourceCluster.getLocation(ClusterLocationType.STAGING).get(0).setPath(working);
+        sourceCluster.getLocation(ClusterLocationType.STAGING).setPath(working);
         clusterSetup.fillForm(sourceCluster);
         clusterSetup.clickNext();
         clusterSetup.clickSave();
@@ -249,7 +249,7 @@ public class ClusterSetupTest extends BaseUITestClass{
     @Test
     public void testLocationsNonExistent() throws IOException {
         String nonExistent = "/non-existent-directory";
-        sourceCluster.getLocation(ClusterLocationType.STAGING).get(0).setPath(nonExistent);
+        sourceCluster.getLocation(ClusterLocationType.STAGING).setPath(nonExistent);
         clusterSetup.fillForm(sourceCluster);
         clusterSetup.clickNext();
         clusterSetup.clickSave();

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntitiesTableTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntitiesTableTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntitiesTableTest.java
index 88db7fe..c875659 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntitiesTableTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntitiesTableTest.java
@@ -32,6 +32,7 @@ import org.apache.log4j.Logger;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
@@ -76,7 +77,7 @@ public class EntitiesTableTest extends BaseUITestClass {
         bundles[0].setProcessWorkflow(aggregateWorkflowDir);
         ProcessMerlin process = bundles[0].getProcessObject();
         baseProcessName = process.getName();
-        for (int i = 1; i <= 10; i++) {
+        for (int i = 1; i <= tags.length; i++) {
             process.setName(baseProcessName + '-' + i);
             process.setTags(StringUtils.join(Arrays.copyOfRange(tags, 0, i), ','));
             AssertUtil.assertSucceeded(prism.getProcessHelper().submitEntity(process.toString()));
@@ -84,6 +85,12 @@ public class EntitiesTableTest extends BaseUITestClass {
 
     }
 
+    @BeforeMethod(alwaysRun = true)
+    public void refresh() {
+        searchPage.refresh();
+    }
+
+
     @AfterClass(alwaysRun = true)
     public void tearDown() throws IOException {
         removeTestClassEntities();
@@ -117,9 +124,9 @@ public class EntitiesTableTest extends BaseUITestClass {
     @Test
     public void testSearchBoxManyParams() {
         searchPage.doSearch(baseProcessName);
-        for (int i = 0; i < 10; i++) {
-            Assert.assertEquals(searchPage.appendAndSearch(tags[i]).size(), 10 - i,
-                "There should be " + (10 - i) + " results");
+        for (int i = 0; i < tags.length; i++) {
+            Assert.assertEquals(searchPage.appendAndSearch(tags[i]).size(), tags.length -
i,
+                "There should be " + (tags.length - i) + " results");
         }
     }
 
@@ -130,7 +137,7 @@ public class EntitiesTableTest extends BaseUITestClass {
     @Test(dataProvider = "getBoolean")
     public void testSearchBoxCleanSingleParam(boolean deleteByClick) {
         searchPage.doSearch(this.getClass().getSimpleName() + ' ' + StringUtils.join(tags,
' '));
-        for (int i = 1; i <= 10; i++) {
+        for (int i = 1; i <= tags.length; i++) {
             Assert.assertEquals(searchPage.getSearchResults().size(), i,
                 "There should be " + i + " results");
             if (deleteByClick) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/4df64f80/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/InstancePageTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/InstancePageTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/InstancePageTest.java
index 0152b42..dc21a27 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/InstancePageTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/InstancePageTest.java
@@ -26,6 +26,7 @@ import org.apache.falcon.regression.core.util.*;
 import org.apache.falcon.regression.testHelper.BaseUITestClass;
 import org.apache.falcon.regression.ui.search.EntityPage;
 import org.apache.falcon.regression.ui.search.InstancePage;
+import org.apache.falcon.regression.ui.search.InstancePage.Button;
 import org.apache.falcon.regression.ui.search.LoginPage;
 import org.apache.falcon.regression.ui.search.SearchPage;
 import org.apache.falcon.resource.InstancesResult;
@@ -90,7 +91,7 @@ public class InstancePageTest extends BaseUITestClass {
         instancePage = searchPage.openEntityPage(processName).openInstance(instance);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.WAITING);
 
-        Assert.assertEquals(instancePage.getButtons(false), EnumSet.allOf(InstancePage.Button.class),
+        Assert.assertEquals(instancePage.getButtons(false), EnumSet.allOf(Button.class),
             "All buttons should be disabled for WAITING instance");
 
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
@@ -100,8 +101,8 @@ public class InstancePageTest extends BaseUITestClass {
 
         instancePage = instancePage.refreshPage();
         checkInstanceStatuses(InstancesResult.WorkflowStatus.RUNNING);
-        Assert.assertEquals(instancePage.getButtons(false), EnumSet.of(InstancePage.Button.Resume),
-                "Only 'Resume' button should be disabled for RUNNING instance");
+        Assert.assertEquals(instancePage.getButtons(false), EnumSet.of(Button.Resume, Button.Rerun),
+                "'Rerun' and 'Resume' buttons should be disabled for RUNNING instance");
     }
 
     @Test
@@ -113,13 +114,13 @@ public class InstancePageTest extends BaseUITestClass {
         instancePage = searchPage.openEntityPage(processName).openInstance(instance);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.RUNNING);
 
-        instancePage.clickButton(InstancePage.Button.Suspend);
+        instancePage.clickButton(Button.Suspend);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.SUSPENDED);
 
-        Assert.assertEquals(instancePage.getButtons(false), EnumSet.of(InstancePage.Button.Suspend),
-                "Only 'Suspend' button should be disabled for SUSPENDED instance");
+        Assert.assertEquals(instancePage.getButtons(false), EnumSet.of(Button.Rerun, Button.Suspend),
+                "'Rerun' and 'Suspend' buttons should be disabled for SUSPENDED instance");
 
-        instancePage.clickButton(InstancePage.Button.Resume);
+        instancePage.clickButton(Button.Resume);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.RUNNING);
     }
 
@@ -132,13 +133,13 @@ public class InstancePageTest extends BaseUITestClass {
         instancePage = searchPage.openEntityPage(processName).openInstance(instance);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.RUNNING);
 
-        instancePage.clickButton(InstancePage.Button.Stop);
+        instancePage.clickButton(Button.Stop);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.KILLED);
 
-        Assert.assertEquals(instancePage.getButtons(true), EnumSet.of(InstancePage.Button.Resume),
-                "Only 'Resume' button should be active for KILLED instance");
+        Assert.assertEquals(instancePage.getButtons(true), EnumSet.of(Button.Rerun),
+                "Only 'Rerun' button should be active for KILLED instance");
 
-        instancePage.clickButton(InstancePage.Button.Resume);
+        instancePage.clickButton(Button.Rerun);
         checkInstanceStatuses(InstancesResult.WorkflowStatus.RUNNING);
     }
 
@@ -171,13 +172,13 @@ public class InstancePageTest extends BaseUITestClass {
 
 
     private void checkInstanceStatuses(InstancesResult.WorkflowStatus status) throws Exception
{
+        Assert.assertEquals(instancePage.getStatus(), status.toString(), "Unexpected status
on UI");
+
         InstancesResult.Instance[] instances = prism.getProcessHelper()
                 .listInstances(processName, "start=" + instance, null).getInstances();
         Assert.assertNotNull(instance, "Instances not found via API");
         Assert.assertEquals(instances.length, 1, "Only one instance expected via API");
         Assert.assertEquals(instances[0].getStatus(), status, "Unexpected status via API");
-
-        Assert.assertEquals(instancePage.getStatus(), status.toString(), "Unexpected status
on UI");
     }
 
 


Mime
View raw message