falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rag...@apache.org
Subject [4/5] falcon git commit: FALCON-1319: Contribute HiveDr, Mirror tests and some test fixes contributed by Namit Maheshwari, Paul Isaychuk, Raghav Kumar Gautam & Ruslan Ostafiychuk
Date Wed, 29 Jul 2015 17:09:43 GMT
http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/MirrorWizardPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/MirrorWizardPage.java b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/MirrorWizardPage.java
new file mode 100644
index 0000000..6dfa1ca
--- /dev/null
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/MirrorWizardPage.java
@@ -0,0 +1,510 @@
+/**
+ * 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.falcon.regression.ui.search;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.falcon.cli.FalconCLI;
+import org.apache.falcon.entity.v0.Frequency;
+import org.apache.falcon.entity.v0.cluster.Interfacetype;
+import org.apache.falcon.entity.v0.process.ACL;
+import org.apache.falcon.entity.v0.process.Retry;
+import org.apache.falcon.regression.Entities.ClusterMerlin;
+import org.apache.falcon.regression.Entities.RecipeMerlin;
+import org.apache.falcon.regression.core.util.TimeUtil;
+import org.apache.falcon.regression.core.util.UIAssert;
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+import org.openqa.selenium.support.FindBys;
+
+import java.util.EnumMap;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/** Page object of the Mirror creation page. */
+public class MirrorWizardPage extends AbstractSearchPage {
+    private static final Logger LOGGER = Logger.getLogger(MirrorWizardPage.class);
+    @FindBys({
+        @FindBy(className = "mainUIView"),
+        @FindBy(className = "formPage")
+    })
+    private WebElement mirrorBox;
+
+    public MirrorWizardPage(WebDriver driver) {
+        super(driver);
+    }
+
+    @Override
+    public void checkPage() {
+        UIAssert.assertDisplayed(mirrorBox, "Mirror box");
+    }
+
+
+    public void setName(String name) {
+        clearAndSetByNgModel("UIModel.name", name);
+    }
+
+    public void setTags(List<String> tags) {
+        //TODO add code here
+    }
+
+    public void setMirrorType(FalconCLI.RecipeOperation recipeOperation) {
+        switch (recipeOperation) {
+        case HDFS_REPLICATION:
+            driver.findElement(By.xpath("//button[contains(.,'File System')]")).click();
+            break;
+        case HIVE_DISASTER_RECOVERY:
+            driver.findElement(By.xpath("//button[contains(.,'HIVE')]")).click();
+            break;
+        default:
+            break;
+        }
+    }
+
+
+    public void setHiveReplication(RecipeMerlin recipeMerlin) {
+        if (StringUtils.isNotEmpty(recipeMerlin.getSourceTable())) {
+            clickById("targetHIVETablesRadio");
+            clearAndSetByNgModel("UIModel.source.hiveDatabase", recipeMerlin.getSourceDb());
+            clearAndSetByNgModel("UIModel.source.hiveTables", recipeMerlin.getSourceTable());
+        } else {
+            clickById("targetHIVEDatabaseRadio");
+            clearAndSetByNgModel("UIModel.source.hiveDatabases", recipeMerlin.getSourceDb());
+        }
+    }
+
+
+    public void setStartTime(String validityStartStr) {
+        final DateTime startDate = TimeUtil.oozieDateToDate(validityStartStr);
+
+        clearAndSetByNgModel("UIModel.validity.start", DateTimeFormat.forPattern("MM/dd/yyyy").print(startDate));
+        final WebElement startTimeBox = driver.findElement(By.className("startTimeBox"));
+        final List<WebElement> startHourAndMinute = startTimeBox.findElements(By.tagName("input"));
+        final WebElement hourText = startHourAndMinute.get(0);
+        final WebElement minuteText = startHourAndMinute.get(1);
+        clearAndSet(hourText, DateTimeFormat.forPattern("hh").print(startDate));
+        clearAndSet(minuteText, DateTimeFormat.forPattern("mm").print(startDate));
+        final WebElement amPmButton = startTimeBox.findElement(By.tagName("button"));
+        if (!amPmButton.getText().equals(DateTimeFormat.forPattern("a").print(startDate))) {
+            amPmButton.click();
+        }
+    }
+
+    public void setEndTime(String validityEndStr) {
+        final DateTime validityEnd = TimeUtil.oozieDateToDate(validityEndStr);
+
+        clearAndSetByNgModel("UIModel.validity.end", DateTimeFormat.forPattern("MM/dd/yyyy").print(validityEnd));
+        final WebElement startTimeBox = driver.findElement(By.className("endTimeBox"));
+        final List<WebElement> startHourAndMinute = startTimeBox.findElements(By.tagName("input"));
+        final WebElement hourText = startHourAndMinute.get(0);
+        final WebElement minuteText = startHourAndMinute.get(1);
+        clearAndSet(hourText, DateTimeFormat.forPattern("hh").print(validityEnd));
+        clearAndSet(minuteText, DateTimeFormat.forPattern("mm").print(validityEnd));
+        final WebElement amPmButton = startTimeBox.findElement(By.tagName("button"));
+        if (!amPmButton.getText().equals(DateTimeFormat.forPattern("a").print(validityEnd))) {
+            amPmButton.click();
+        }
+    }
+
+    public void toggleAdvancedOptions() {
+        final WebElement advanceOption = driver.findElement(By.xpath("//h4[contains(.,'Advanced options')]"));
+        advanceOption.click();
+    }
+
+    public void setFrequency(Frequency frequency) {
+        clearAndSetByNgModel("UIModel.frequency.number", frequency.getFrequency());
+        selectNgModelByVisibleText("UIModel.frequency.unit", frequency.getTimeUnit().name().toLowerCase());
+    }
+
+    public void setHdfsDistCpMaxMaps(String distCpMaxMaps) {
+        clearAndSetByNgModel("UIModel.allocation.hdfs.maxMaps", distCpMaxMaps);
+    }
+
+
+    public void setHdfsMaxBandwidth(String replicationMaxMaps) {
+        clearAndSetByNgModel("UIModel.allocation.hdfs.maxBandwidth", replicationMaxMaps);
+    }
+
+    public void setHiveDistCpMaxMaps(String distCpMaxMaps) {
+        clearAndSetByNgModel("UIModel.allocation.hive.maxMapsDistcp", distCpMaxMaps);
+    }
+
+
+    public void setHiveReplicationMaxMaps(String replicationMaxMaps) {
+        clearAndSetByNgModel("UIModel.allocation.hive.maxMapsMirror", replicationMaxMaps);
+    }
+
+    public void setMaxEvents(String maxEvents) {
+        clearAndSetByNgModel("UIModel.allocation.hive.maxMapsEvents", maxEvents);
+    }
+
+    public void setHiveMaxBandwidth(String maxBandWidth) {
+        clearAndSetByNgModel("UIModel.allocation.hive.maxBandwidth", maxBandWidth);
+    }
+
+
+    public void setSourceInfo(ClusterMerlin srcCluster) {
+        setSourceStaging(srcCluster.getLocation("staging"));
+        setSourceHiveEndpoint(srcCluster.getInterfaceEndpoint(Interfacetype.REGISTRY));
+    }
+
+    public void setSourceHiveEndpoint(String hiveEndpoint) {
+        clearAndSetByNgModel("UIModel.hiveOptions.source.hiveServerToEndpoint", hiveEndpoint);
+    }
+
+    public void setSourceStaging(String stagingLocation) {
+        clearAndSetByNgModel("UIModel.hiveOptions.source.stagingPath", stagingLocation);
+    }
+
+    public void setTargetInfo(ClusterMerlin tgtCluster) {
+        setTargetStaging(tgtCluster.getLocation("staging"));
+        setTargetHiveEndpoint(tgtCluster.getInterfaceEndpoint(Interfacetype.REGISTRY));
+    }
+
+    public void setTargetHiveEndpoint(String hiveEndPoint) {
+        clearAndSetByNgModel("UIModel.hiveOptions.target.hiveServerToEndpoint", hiveEndPoint);
+    }
+
+    public void setTargetStaging(String hiveEndpoint) {
+        clearAndSetByNgModel("UIModel.hiveOptions.target.stagingPath", hiveEndpoint);
+    }
+
+    public void setRetry(Retry retry) {
+        selectNgModelByVisibleText("UIModel.retry.policy", retry.getPolicy().toString().toUpperCase());
+        clearAndSetByNgModel("UIModel.retry.delay.number", retry.getDelay().getFrequency());
+        selectNgModelByVisibleText("UIModel.retry.delay.unit", retry.getDelay().getTimeUnit().name().toLowerCase());
+        clearAndSetByNgModel("UIModel.retry.attempts", String.valueOf(retry.getAttempts()));
+    }
+
+
+    public void setAcl(ACL acl) {
+        setAclOwner(acl.getOwner());
+        setAclGroup(acl.getGroup());
+        setAclPermission(acl.getPermission());
+    }
+
+    public void setAclOwner(String aclOwner) {
+        clearAndSetSlowlyByNgModel("UIModel.acl.owner", aclOwner);
+    }
+
+    public boolean isAclOwnerWarningDisplayed() {
+        final WebElement warning =
+            findElementByNgModel("UIModel.acl.owner").findElement(By.xpath("./following-sibling::*"));
+        waitForAngularToFinish();
+        return warning.isDisplayed();
+    }
+
+    public void setAclGroup(String aclGroup) {
+        clearAndSetSlowlyByNgModel("UIModel.acl.group", aclGroup);
+    }
+
+    public boolean isAclGroupWarningDisplayed() {
+        final WebElement warning =
+            findElementByNgModel("UIModel.acl.group").findElement(By.xpath("./following-sibling::*"));
+        waitForAngularToFinish();
+        return warning.isDisplayed();
+    }
+
+    public void setAclPermission(String aclPermission) {
+        clearAndSetSlowlyByNgModel("UIModel.acl.permissions", aclPermission);
+    }
+
+    public boolean isAclPermissionWarningDisplayed() {
+        final WebElement warning =
+            findElementByNgModel("UIModel.acl.permissions").findElement(By.xpath("./following-sibling::*"));
+        waitForAngularToFinish();
+        return warning.isDisplayed();
+    }
+
+    public void next() {
+        final WebElement nextButton = driver.findElement(By.xpath("//button[contains(.,'Next')]"));
+        nextButton.click();
+    }
+
+    public void previous() {
+        final WebElement prevButton = driver.findElement(By.xpath("//button[contains(.,'Previous')]"));
+        prevButton.click();
+    }
+
+    public void silentPrevious() {
+        try {
+            previous();
+        } catch (Exception ignore) {
+            //ignore
+        }
+    }
+
+    public void cancel() {
+        driver.findElement(By.xpath("//a[contains(.,'Cancel')]"));
+    }
+
+    public void save() {
+        final WebElement saveButton = driver.findElement(By.xpath("//button[contains(.,'Save')]"));
+        UIAssert.assertDisplayed(saveButton, "Save button in not displayed.");
+        saveButton.click();
+        waitForAlert();
+    }
+
+    public ClusterBlock getSourceBlock() {
+        return new ClusterBlock("Source");
+    }
+
+    public ClusterBlock getTargetBlock() {
+        return new ClusterBlock("Target");
+    }
+
+    public void applyRecipe(RecipeMerlin recipe) {
+        final ClusterMerlin srcCluster = recipe.getSrcCluster();
+        final ClusterMerlin tgtCluster = recipe.getTgtCluster();
+        setName(recipe.getName());
+        setTags(recipe.getTags());
+        setMirrorType(recipe.getRecipeOperation());
+        getSourceBlock().selectCluster(srcCluster.getName());
+        getTargetBlock().selectCluster(tgtCluster.getName());
+        getSourceBlock().selectRunHere();
+        setStartTime(recipe.getValidityStart());
+        setEndTime(recipe.getValidityEnd());
+        toggleAdvancedOptions();
+        switch (recipe.getRecipeOperation()) {
+        case HDFS_REPLICATION:
+            getSourceBlock().setPath(recipe.getSourceDir());
+            getTargetBlock().setPath(recipe.getTargetDir());
+            setHdfsDistCpMaxMaps(recipe.getDistCpMaxMaps());
+            setHdfsMaxBandwidth(recipe.getDistCpMaxMaps());
+            break;
+        case HIVE_DISASTER_RECOVERY:
+            setHiveReplication(recipe);
+            setHiveDistCpMaxMaps(recipe.getDistCpMaxMaps());
+            setHiveReplicationMaxMaps(recipe.getReplicationMaxMaps());
+            setMaxEvents(recipe.getMaxEvents());
+            setHiveMaxBandwidth(recipe.getMapBandwidth());
+            setSourceInfo(recipe.getSrcCluster());
+            setTargetInfo(recipe.getTgtCluster());
+            break;
+        default:
+            break;
+        }
+        setFrequency(recipe.getFrequency());
+        setRetry(recipe.getRetry());
+        setAcl(recipe.getAcl());
+    }
+
+    public int getStepNumber() {
+        try {
+            driver.findElement(By.xpath("//button[contains(.,'Previous')]"));
+            return 2;
+        } catch (Exception ignore) {
+            //ignore
+        }
+        return 1;
+    }
+
+    public Map<Summary, String> getSummaryProperties() {
+        String formText = driver.findElement(By.id("formSummaryBox")).getText();
+        Map<Summary, String> props = new EnumMap<>(Summary.class);
+        props.put(Summary.NAME, getBetween(formText, "Name", "Type"));
+        props.put(Summary.TYPE, getBetween(formText, "Type", "Tags"));
+        props.put(Summary.TAGS, getBetween(formText, "Tags", "Source"));
+        props.put(Summary.RUN_ON, getBetween(formText, "Run On", "Schedule"));
+        props.put(Summary.START, getBetween(formText, "Start on:", "End on:"));
+        props.put(Summary.END, getBetween(formText, "End on:", "Max Maps"));
+        props.put(Summary.MAX_MAPS, getBetween(formText, "Max Maps", "Max Bandwidth"));
+        props.put(Summary.MAX_BANDWIDTH, getBetween(formText, "Max Bandwidth", "ACL"));
+
+        props.put(Summary.ACL_OWNER, getBetween(formText, "Owner:", "Group:"));
+        props.put(Summary.ACL_GROUP, getBetween(formText, "Group:", "Permissions:"));
+        props.put(Summary.ACL_PERMISSIONS, getBetween(formText, "Permissions:", "Retry"));
+
+        props.put(Summary.RETRY_POLICY, getBetween(formText, "Policy:", "delay:"));
+        props.put(Summary.RETRY_DELAY, getBetween(formText, "delay:", "Attempts:"));
+        props.put(Summary.RETRY_ATTEMPTS, getBetween(formText, "Attempts:", "Frequency"));
+
+        props.put(Summary.FREQUENCY, getBetween(formText, "Frequency", "Previous"));
+
+        String source = getBetween(formText, "Source", "Target");
+        String target = getBetween(formText, "Target", "Run On");
+        if ("HDFS".equals(props.get(Summary.TYPE))) {
+            props.put(Summary.SOURCE_LOCATION, getBetween(source, "Location", "Path"));
+            props.put(Summary.TARGET_LOCATION, getBetween(target, "Location", "Path"));
+            if ("HDFS".equals(props.get(Summary.SOURCE_LOCATION))) {
+                props.put(Summary.SOURCE_CLUSTER, getBetween(source, "^", "Location"));
+                props.put(Summary.SOURCE_PATH, getBetween(source, "Path:", "$"));
+
+            } else {
+                props.put(Summary.SOURCE_PATH, getBetween(source, "Path:", "URL"));
+                props.put(Summary.SOURCE_URL, getBetween(source, "URL:", "$"));
+
+            }
+            if ("HDFS".equals(props.get(Summary.TARGET_LOCATION))) {
+                props.put(Summary.TARGET_CLUSTER, getBetween(target, "^", "Location"));
+                props.put(Summary.TARGET_PATH, getBetween(target, "Path:", "$"));
+
+            } else {
+                props.put(Summary.TARGET_PATH, getBetween(target, "Path:", "URL"));
+                props.put(Summary.TARGET_URL, getBetween(target, "URL:", "$"));
+
+            }
+
+        } else {
+            LOGGER.error("TODO Read info for HIVE replication.");
+        }
+
+
+        return props;
+    }
+
+    /** Parts of the mirror summary. */
+    public enum Summary {
+        NAME,
+        TYPE,
+        TAGS,
+        RUN_ON,
+        START,
+        END,
+        MAX_MAPS,
+        MAX_BANDWIDTH,
+        ACL_OWNER,
+        ACL_GROUP,
+        ACL_PERMISSIONS,
+        RETRY_POLICY,
+        RETRY_DELAY,
+        RETRY_ATTEMPTS,
+        FREQUENCY,
+        SOURCE_LOCATION,
+        SOURCE_PATH,
+        SOURCE_CLUSTER,
+        SOURCE_URL,
+        TARGET_LOCATION,
+        TARGET_PATH,
+        TARGET_CLUSTER,
+        TARGET_URL,
+
+    }
+
+    private static String getBetween(String text, String first, String second) {
+        Pattern pattern = Pattern.compile(".*" + first + "(.+)" + second + ".*", Pattern.DOTALL);
+        Matcher matcher = pattern.matcher(text);
+        if (matcher.find()) {
+            return matcher.group(1).trim();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Block of source or target cluster with parameters.
+     */
+    public final class ClusterBlock {
+        private final WebElement mainBlock;
+        private final WebElement runHereButton;
+        private final String blockType;
+
+        private ClusterBlock(String type) {
+            this.blockType = type;
+            mainBlock = driver.findElement(By.xpath("//h3[contains(.,'" + type + "')]/.."));
+            runHereButton = mainBlock.findElement(By.id("runJobOn" + type + "Radio"));
+        }
+
+        public Set<Location> getAvailableLocationTypes() {
+            List<WebElement> inputs = getLocationBox().findElements(By.xpath(".//input"));
+            Set<Location> result = EnumSet.noneOf(Location.class);
+            for (WebElement input : inputs) {
+                result.add(Location.getByInput(input));
+            }
+            return result;
+        }
+
+        public Location getSelectedLocationType() {
+            WebElement selected = getLocationBox()
+                .findElement(By.xpath("//input[contains(@class,'ng-valid-parse')]"));
+            return Location.getByInput(selected);
+        }
+
+        public void setLocationType(Location type) {
+            getLocationBox().findElement(By.xpath(
+                String.format(".//input[translate(@value,'azures','AZURES')='%s']", type.toString()))).click();
+        }
+
+        public void selectRunHere() {
+            runHereButton.click();
+        }
+
+        public Set<String> getAvailableClusters() {
+            List<WebElement> options = mainBlock.findElements(By.xpath(".//option[not(@disabled)]"));
+            Set<String> clusters = new TreeSet<>();
+            for (WebElement option : options) {
+                clusters.add(option.getText());
+            }
+            return clusters;
+        }
+
+        public void selectCluster(String clusterName) {
+            selectNgModelByVisibleText("UIModel." + blockType.toLowerCase() + ".cluster", clusterName);
+        }
+
+        public void setPath(String path) {
+            final WebElement srcPathElement = getPath();
+            clearAndSet(srcPathElement, path);
+        }
+
+        public boolean isRunHereSelected() {
+            return runHereButton.getAttribute("class").contains("ng-valid-parse");
+        }
+
+        public boolean isRunHereAvailable() {
+            return runHereButton.getAttribute("disabled") == null;
+        }
+
+
+        private WebElement getLocationBox() {
+            return mainBlock.findElement(By.className("locationBox"));
+        }
+
+        private WebElement getPath() {
+            return mainBlock.findElement(By.name(blockType.toLowerCase() + "ClusterPathInput"));
+        }
+
+
+
+    }
+
+    /**
+     * Types of source/target location.
+     */
+    public enum Location {
+        HDFS,
+        AZURE,
+        S3;
+
+        private static Location getByInput(WebElement input) {
+            return Location.valueOf(input.getAttribute("value").trim().toUpperCase());
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/NewMirrorPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/NewMirrorPage.java b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/NewMirrorPage.java
deleted file mode 100644
index 2772f54..0000000
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/NewMirrorPage.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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.falcon.regression.ui.search;
-
-import org.apache.falcon.regression.core.util.UIAssert;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.FindBy;
-import org.openqa.selenium.support.FindBys;
-
-/** Page object of the Mirror creation page. */
-public class NewMirrorPage extends AbstractSearchPage {
-
-    @FindBys({
-        @FindBy(className = "mainUIView"),
-        @FindBy(className = "formPage")
-    })
-    private WebElement mirrorBox;
-
-    public NewMirrorPage(WebDriver driver) {
-        super(driver);
-    }
-
-    @Override
-    public void checkPage() {
-        UIAssert.assertDisplayed(mirrorBox, "Mirror box");
-    }
-}

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/PageHeader.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/PageHeader.java b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/PageHeader.java
index cb5bccf..2a75b20 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/PageHeader.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/PageHeader.java
@@ -20,9 +20,11 @@ package org.apache.falcon.regression.ui.search;
 
 import org.apache.falcon.regression.core.enumsAndConstants.MerlinConstants;
 import org.apache.falcon.regression.core.util.AssertUtil;
+import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.core.util.UIAssert;
 import org.apache.log4j.Logger;
 import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.FindBy;
@@ -114,9 +116,11 @@ public class PageHeader {
         final SearchPage searchPage = PageFactory.initElements(driver, SearchPage.class);
         searchPage.checkPage();
         final PageHeader searchHeader = searchPage.getPageHeader();
-        searchHeader.checkLoggedIn();
-        Assert.assertEquals(searchHeader.getLoggedInUser(), LoginPage.UI_DEFAULT_USER,
-            "Unexpected user is displayed");
+        if (!MerlinConstants.IS_SECURE) {
+            searchHeader.checkLoggedIn();
+            Assert.assertEquals(searchHeader.getLoggedInUser(), LoginPage.UI_DEFAULT_USER,
+                "Unexpected user is displayed");
+        }
         return searchPage;
     }
 
@@ -138,7 +142,7 @@ public class PageHeader {
 
         final String oldUrl = driver.getCurrentUrl();
         //displayed if user is logged in: create entity buttons, upload entity button, username
-        if (getLogoutButton().isDisplayed()) {
+        if (MerlinConstants.IS_SECURE || getLogoutButton().isDisplayed()) {
             //checking create entity box
             UIAssert.assertDisplayed(createEntityBox, "Create entity box");
             final WebElement createEntityLabel = createEntityBox.findElement(By.tagName("h4"));
@@ -153,6 +157,9 @@ public class PageHeader {
             Assert.assertEquals(uploadEntityButton.getText(), "Browse for the XML file",
                 "Unexpected text on upload entity button");
             //checking if logged-in username is displayed
+            if (!MerlinConstants.IS_SECURE) {
+                UIAssert.assertDisplayed(getLogoutButton(), "Logout button");
+            }
             AssertUtil.assertNotEmpty(getLoggedInUser(), "Expecting logged-in username.");
 
             //create button navigation
@@ -219,12 +226,12 @@ public class PageHeader {
         return processPage;
     }
 
-    public NewMirrorPage doCreateMirror() {
+    public MirrorWizardPage doCreateMirror() {
         UIAssert.assertDisplayed(mirrorCreateButton, "Mirror create button");
         Assert.assertEquals(mirrorCreateButton.getText(), "Mirror",
             "Unexpected text on create mirror button");
         mirrorCreateButton.click();
-        final NewMirrorPage mirrorPage = PageFactory.initElements(driver, NewMirrorPage.class);
+        final MirrorWizardPage mirrorPage = PageFactory.initElements(driver, MirrorWizardPage.class);
         mirrorPage.checkPage();
         return mirrorPage;
     }
@@ -242,7 +249,7 @@ public class PageHeader {
     }
 
     private WebElement getLogoutButton() {
-        return loginHeaderBox.findElement(By.xpath("//button[contains(.,'Logout')]"));
+        return loginHeaderBox.findElements(By.tagName("button")).get(1);
     }
 
     public LoginPage doLogout() {
@@ -253,4 +260,19 @@ public class PageHeader {
         return loginPage;
     }
 
+    protected void waitForAngularToFinish() {
+        final String javaScript = "return (window.angular != null) && "
+            + "(angular.element(document).injector() != null) && "
+            + "(angular.element(document).injector().get('$http').pendingRequests.length === 0)";
+        boolean isLoaded = false;
+        for (int i = 0; i < AbstractSearchPage.PAGELOAD_TIMEOUT_THRESHOLD && !isLoaded; i++) {
+            final Object output = ((JavascriptExecutor) driver).executeScript(javaScript);
+            isLoaded = Boolean.valueOf(output.toString());
+            LOGGER.info(i+1 + ". waiting on angular to finish.");
+            TimeUtil.sleepSeconds(1);
+        }
+        LOGGER.info("angular is done continuing...");
+    }
+
+
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/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 5413cb6..706328f 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
@@ -131,6 +131,7 @@ public class ProcessWizardPage extends AbstractSearchPage {
     }
 
     public void clickEditXml(){
+        waitForAngularToFinish();
         editXmlButton.click();
     }
 
@@ -710,10 +711,12 @@ public class ProcessWizardPage extends AbstractSearchPage {
     }
 
     public void clickAddInput(){
+        waitForAngularToFinish();
         getAddInputButton().click();
     }
 
     public void clickAddOutput(){
+        waitForAngularToFinish();
         getAddOutputButton().click();
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/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 c3767eb..15d50b0 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
@@ -149,13 +149,12 @@ public class SearchPage extends AbstractSearchPage {
             getSearchBox().sendKeys(queryParam);
             getSearchBox().sendKeys(Keys.ENTER);
         }
-        String activeAlert = getActiveAlertText();
-        if (activeAlert != null) {
-            Assert.assertEquals(activeAlert.trim(), "No results matched the search criteria.");
+        waitForAngularToFinish();
+        if (resultBlock.isDisplayed()) {
+            return getSearchResults();
+        } else {
             return Collections.emptyList();
         }
-        UIAssert.assertDisplayed(resultBlock, "Search result block");
-        return getSearchResults();
 
     }
 
@@ -179,7 +178,7 @@ public class SearchPage extends AbstractSearchPage {
     }
 
     private void focusOnSearchBox() {
-        searchBlock.findElement(By.className("tags")).click();
+        driver.findElement(By.className("tags")).click();
     }
 
     public void checkNoResult() {

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceParamTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceParamTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceParamTest.java
index 8a36c98..33808bf 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceParamTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceParamTest.java
@@ -77,15 +77,16 @@ public class InstanceParamTest extends BaseTestClass {
 
     @BeforeMethod(alwaysRun = true)
     public void setup() throws Exception {
-        processBundle = BundleUtil.readELBundle();
-        processBundle = new Bundle(processBundle, cluster1);
+        processBundle = new Bundle(BundleUtil.readELBundle(), cluster1);
         processBundle.generateUniqueBundle(this);
         processBundle.setInputFeedDataPath(feedInputPath);
         processBundle.setOutputFeedLocationData(feedOutputPath);
         processBundle.setProcessWorkflow(aggregateWorkflowDir);
         for (int i = 0; i < 3; i++) {
-            bundles[i] = new Bundle(processBundle, servers.get(i));
+            bundles[i] = new Bundle(BundleUtil.readELBundle(), servers.get(i));
             bundles[i].generateUniqueBundle(this);
+            bundles[i].setInputFeedDataPath(feedInputPath);
+            bundles[i].setOutputFeedLocationData(feedOutputPath);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }
         processName = processBundle.getProcessName();

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceSummaryTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceSummaryTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceSummaryTest.java
index a3fca09..137491d 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceSummaryTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/InstanceSummaryTest.java
@@ -82,15 +82,14 @@ public class InstanceSummaryTest extends BaseTestClass {
 
     @BeforeMethod(alwaysRun = true)
     public void setup() throws Exception {
-        processBundle = BundleUtil.readELBundle();
-        processBundle = new Bundle(processBundle, cluster3);
+        processBundle = new Bundle(BundleUtil.readELBundle(), cluster3);
         processBundle.generateUniqueBundle(this);
         processBundle.setInputFeedDataPath(feedInputPath);
         processBundle.setOutputFeedLocationData(baseTestHDFSDir + "/output" + MINUTE_DATE_PATTERN);
         processBundle.setProcessWorkflow(aggregateWorkflowDir);
 
         for (int i = 0; i < 3; i++) {
-            bundles[i] = new Bundle(processBundle, servers.get(i));
+            bundles[i] = new Bundle(BundleUtil.readELBundle(), servers.get(i));
             bundles[i].generateUniqueBundle(this);
             bundles[i].setProcessWorkflow(aggregateWorkflowDir);
         }

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessFrequencyTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessFrequencyTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessFrequencyTest.java
index d7331cf..b0480e9 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessFrequencyTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessFrequencyTest.java
@@ -59,9 +59,6 @@ public class ProcessFrequencyTest extends BaseTestClass {
     public void createTestData() throws Exception {
         LOGGER.info("in @BeforeClass");
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        Bundle bundle = BundleUtil.readELBundle();
-        bundle.generateUniqueBundle(this);
-        bundles[0] = new Bundle(bundle, cluster);
     }
 
     @BeforeMethod(alwaysRun = true)

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceColoMixedTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceColoMixedTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceColoMixedTest.java
index 56e1474..91d39a7 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceColoMixedTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceColoMixedTest.java
@@ -69,17 +69,12 @@ public class ProcessInstanceColoMixedTest extends BaseTestClass {
 
     @BeforeMethod(alwaysRun = true)
     public void setup() throws Exception {
-
-        //get 3 unique bundles
-        bundles[0] = BundleUtil.readELBundle();
+        //generate bundles according to config files
+        bundles[0] = new Bundle(BundleUtil.readELBundle(), cluster1);
+        bundles[1] = new Bundle(BundleUtil.readELBundle(), cluster2);
         bundles[0].generateUniqueBundle(this);
-        bundles[1] = BundleUtil.readELBundle();
         bundles[1].generateUniqueBundle(this);
 
-        //generate bundles according to config files
-        bundles[0] = new Bundle(bundles[0], cluster1);
-        bundles[1] = new Bundle(bundles[1], cluster2);
-
         //set cluster colos
         bundles[0].setCLusterColo(cluster1.getClusterHelper().getColoName());
         LOGGER.info("cluster b1: " + Util.prettyPrintXml(bundles[0].getClusters().get(0)));

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
index 2f5dbd9..48c8021 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceKillsTest.java
@@ -66,10 +66,6 @@ public class ProcessInstanceKillsTest extends BaseTestClass {
     public void createTestData() throws Exception {
         LOGGER.info("in @BeforeClass");
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        Bundle b = BundleUtil.readELBundle();
-        b.generateUniqueBundle(this);
-        b = new Bundle(b, cluster);
-        b.setInputFeedDataPath(feedInputPath);
     }
 
     @BeforeMethod(alwaysRun = true)

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
index a8cc2e0..57443a8 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRerunTest.java
@@ -18,19 +18,20 @@
 
 package org.apache.falcon.regression;
 
-import org.apache.falcon.entity.v0.process.*;
-import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.entity.v0.Frequency.TimeUnit;
+import org.apache.falcon.entity.v0.process.Properties;
+import org.apache.falcon.entity.v0.process.Property;
+import org.apache.falcon.regression.core.bundle.Bundle;
 import org.apache.falcon.regression.core.enumsAndConstants.ResponseErrors;
 import org.apache.falcon.regression.core.helpers.ColoHelper;
-import org.apache.falcon.regression.core.util.InstanceUtil;
-import org.apache.falcon.regression.core.util.OozieUtil;
-import org.apache.falcon.regression.core.util.HadoopUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
+import org.apache.falcon.regression.core.util.HadoopUtil;
+import org.apache.falcon.regression.core.util.InstanceUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
-import org.apache.falcon.regression.core.util.Util;
+import org.apache.falcon.regression.core.util.OozieUtil;
 import org.apache.falcon.regression.core.util.TimeUtil;
+import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
 import org.apache.falcon.resource.InstancesResult;
 import org.apache.hadoop.fs.FileSystem;
@@ -70,9 +71,6 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
     public void createTestData() throws Exception {
         LOGGER.info("in @BeforeClass");
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        Bundle b = BundleUtil.readELBundle();
-        b = new Bundle(b, cluster);
-        b.setInputFeedDataPath(feedInputPath);
     }
 
     @BeforeMethod(alwaysRun = true)
@@ -113,7 +111,7 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.validateResponse(r, 4, 0, 0, 0, 4);
         List<String> wfIDs = InstanceUtil.getWorkflows(clusterOC, processName);
         prism.getProcessHelper().getProcessInstanceRerun(processName,
-                start + "&end=2010-01-02T01:11Z");
+            start + "&end=2010-01-02T01:11Z");
         InstanceUtil.areWorkflowsRunning(clusterOC, wfIDs, 6, 5, 1, 0);
     }
 
@@ -156,9 +154,9 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstancesAreCreated(clusterOC, bundles[0].getProcessData(), 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 5,
-                CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
+            CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
         InstancesResult r = prism.getProcessHelper().getProcessInstanceKill(processName,
-                start + "&end=2010-01-02T01:16Z");
+            start + "&end=2010-01-02T01:16Z");
         InstanceUtil.validateResponse(r, 4, 0, 0, 0, 4);
         r = prism.getProcessHelper().getProcessInstanceRerun(processName,
                 "?end=2010-01-02T01:11Z");
@@ -205,7 +203,7 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstancesAreCreated(clusterOC, bundles[0].getProcessData(), 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 3,
-                CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
+            CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
         InstancesResult r = prism.getProcessHelper()
             .getProcessInstanceKill(processName, start + "&end=2010-01-02T01:11Z");
         InstanceUtil.validateResponse(r, 3, 0, 0, 0, 3);
@@ -236,7 +234,7 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.validateResponse(r, 3, 0, 0, 0, 3);
         List<String> wfIDs = InstanceUtil.getWorkflows(clusterOC, processName);
         prism.getProcessHelper().getProcessInstanceRerun(processName,
-                start + "&end=2010-01-02T01:11Z");
+            start + "&end=2010-01-02T01:11Z");
         TimeUtil.sleepSeconds(TIMEOUT);
         InstanceUtil.areWorkflowsRunning(clusterOC, wfIDs, 6, 6, 0, 0);
     }
@@ -255,12 +253,12 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstancesAreCreated(clusterOC, bundles[0].getProcessData(), 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1,
-                CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
+            CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
         prism.getProcessHelper().getProcessInstanceKill(processName,
-                start + "&end=2010-01-02T01:01Z");
+            start + "&end=2010-01-02T01:01Z");
         String wfID = InstanceUtil.getWorkflows(clusterOC, processName, Status.KILLED).get(0);
         prism.getProcessHelper().getProcessInstanceRerun(processName,
-                start + "&end=2010-01-02T01:01Z");
+            start + "&end=2010-01-02T01:01Z");
         Assert.assertTrue(InstanceUtil.isWorkflowRunning(clusterOC, wfID));
     }
 
@@ -280,13 +278,13 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstancesAreCreated(clusterOC, process, 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1,
-                CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
+            CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
         String wfID = InstanceUtil.getWorkflows(clusterOC, processName, Status.RUNNING,
             Status.SUCCEEDED).get(0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 0, CoordinatorAction
-                .Status.SUCCEEDED, EntityType.PROCESS);
+            .Status.SUCCEEDED, EntityType.PROCESS);
         prism.getProcessHelper().getProcessInstanceRerun(processName,
-                start + "&end=2010-01-02T01:01Z&force=true");
+            start + "&end=2010-01-02T01:01Z&force=true");
         Assert.assertTrue(InstanceUtil.isWorkflowRunning(clusterOC, wfID));
     }
 
@@ -307,11 +305,11 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 2,
             CoordinatorAction.Status.RUNNING, EntityType.PROCESS, 5);
         prism.getProcessHelper().getProcessInstanceSuspend(processName,
-                start + "&end=2010-01-02T01:06Z");
+            start + "&end=2010-01-02T01:06Z");
         prism.getProcessHelper().getProcessInstanceRerun(processName,
-                start + "&end=2010-01-02T01:06Z");
+            start + "&end=2010-01-02T01:06Z");
         Assert.assertEquals(InstanceUtil.getInstanceStatus(clusterOC, processName, 0, 1),
-                CoordinatorAction.Status.SUSPENDED);
+            CoordinatorAction.Status.SUSPENDED);
     }
 
     /**
@@ -328,7 +326,7 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstancesAreCreated(clusterOC, bundles[0].getProcessData(), 0);
         OozieUtil.createMissingDependencies(cluster, EntityType.PROCESS, processName, 0);
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 2,
-                CoordinatorAction.Status.SUCCEEDED, EntityType.PROCESS);
+            CoordinatorAction.Status.SUCCEEDED, EntityType.PROCESS);
         List<String> wfIDs = InstanceUtil.getWorkflows(clusterOC, processName);
         prism.getProcessHelper().getProcessInstanceRerun(processName,
                 start + "&end=2010-01-02T01:11Z&force=true");
@@ -353,7 +351,7 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1,
                 CoordinatorAction.Status.TIMEDOUT, EntityType.PROCESS);
         prism.getProcessHelper().getProcessInstanceRerun(processName,
-                start + "&end=2010-01-02T01:11Z");
+            start + "&end=2010-01-02T01:11Z");
         s = InstanceUtil.getInstanceStatus(clusterOC, processName, 0, 0);
         Assert.assertEquals(s, CoordinatorAction.Status.WAITING,
                 "instance should have been in WAITING state");
@@ -378,12 +376,12 @@ public class ProcessInstanceRerunTest extends BaseTestClass {
 
         //wait for instance to go in killing state
         InstanceUtil.waitTillInstanceReachState(clusterOC, processName, 1,
-                CoordinatorAction.Status.KILLED, EntityType.PROCESS, 5);
+            CoordinatorAction.Status.KILLED, EntityType.PROCESS, 5);
 
         Assert.assertEquals(OozieUtil.getWorkflowActionStatus(clusterOC, bundleId, "post-processing")
-                .contains("KILLED"), true);
+            .contains("KILLED"), true);
         Assert.assertEquals(OozieUtil.getWorkflowActionStatus(clusterOC, bundleId, "user-action")
-                .contains("SUCCEEDED"), true);
+            .contains("SUCCEEDED"), true);
 
         //start Server1 colo
         Util.startService(cluster.getClusterHelper());

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
index a2ff993..b7f4428 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceResumeTest.java
@@ -61,9 +61,6 @@ public class ProcessInstanceResumeTest extends BaseTestClass {
     public void createTestData() throws Exception {
         LOGGER.info("in @BeforeClass");
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        Bundle b = BundleUtil.readELBundle();
-        b = new Bundle(b, cluster);
-        b.setInputFeedDataPath(feedInputPath);
     }
 
     @BeforeMethod(alwaysRun = true)

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRunningTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRunningTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRunningTest.java
index ee1c5e4..98fdcca 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRunningTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceRunningTest.java
@@ -65,10 +65,6 @@ public class ProcessInstanceRunningTest extends BaseTestClass {
     public void createTestData() throws Exception {
         LOGGER.info("in @BeforeClass");
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        Bundle bundle = BundleUtil.readELBundle();
-        bundle.generateUniqueBundle(this);
-        bundle = new Bundle(bundle, cluster);
-        bundle.setInputFeedDataPath(feedInputPath);
     }
 
     @BeforeMethod(alwaysRun = true)

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
index 8f177ec..7f1e445 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ProcessInstanceStatusTest.java
@@ -78,10 +78,6 @@ public class ProcessInstanceStatusTest extends BaseTestClass {
     public void createTestData() throws Exception {
         LOGGER.info("in @BeforeClass");
         HadoopUtil.uploadDir(clusterFS, aggregateWorkflowDir, OSUtil.RESOURCES_OOZIE);
-        Bundle bundle = BundleUtil.readELBundle();
-        bundle.generateUniqueBundle(this);
-        bundle = new Bundle(bundle, cluster);
-        bundle.setInputFeedDataPath(feedInputPath);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/EntitiesPatternSearchTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/EntitiesPatternSearchTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/EntitiesPatternSearchTest.java
index c9ed3a6..461b733 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/EntitiesPatternSearchTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/entity/EntitiesPatternSearchTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.falcon.regression.entity;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.falcon.regression.Entities.ClusterMerlin;
 import org.apache.falcon.regression.Entities.FeedMerlin;
 import org.apache.falcon.regression.Entities.ProcessMerlin;
@@ -43,6 +44,7 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.regex.Pattern;
 
 /**
  * Testing the pattern search of entities. Falcon-914
@@ -173,17 +175,13 @@ public class EntitiesPatternSearchTest extends BaseTestClass {
         }
     }
 
-    private Boolean getOutputEntity(String entityName, String pattern) {
-        String patternCheck="";
-        String regexString=".*";
-        StringBuffer newString = new StringBuffer();
-        char[] searchPatterns = pattern.toLowerCase().toCharArray();
-        for (char searchPattern : searchPatterns) {
-            newString = newString.append(regexString).append(searchPattern);
-        }
-        patternCheck = newString.append(regexString).toString();
-        LOGGER.info("patternCheck : " + patternCheck);
-        return entityName.toLowerCase().matches(patternCheck);
+    private Boolean getOutputEntity(final String entityName, final String userInput) {
+        final String wildCard = ".*";
+        final String patternStr = StringUtils.join(userInput.split(""), wildCard) + wildCard;
+        final Pattern pattern = Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);
+        final boolean isMatch = pattern.matcher(entityName).find();
+        LOGGER.info("patternStr : " + patternStr + " entityName: " + entityName + " isMatch: " + isMatch);
+        return isMatch;
     }
 
     private List<String> getPatternName() {

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
index 89a6714..27417bd 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatFeedOperationsTest.java
@@ -31,6 +31,7 @@ import org.apache.falcon.regression.core.response.ServiceResponse;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.core.util.BundleUtil;
 import org.apache.falcon.regression.core.util.HCatUtil;
+import org.apache.falcon.regression.core.util.InstanceUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
 import org.apache.falcon.regression.core.util.OozieUtil;
 import org.apache.falcon.regression.core.util.Util;
@@ -208,6 +209,7 @@ public class HCatFeedOperationsTest extends BaseTestClass {
                 .build()).toString();
 
         AssertUtil.assertSucceeded(prism.getFeedHelper().submitAndSchedule(feed));
+        InstanceUtil.waitTillInstancesAreCreated(cluster2OC, feed, 0);
         Assert.assertEquals(OozieUtil.checkIfFeedCoordExist(cluster2OC, Util.readEntityName(feed), "REPLICATION"), 1);
         //This test doesn't wait for replication to succeed.
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/f9669000/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
index 237b3b2..a96b17e 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/hcat/HCatReplicationTest.java
@@ -194,7 +194,7 @@ public class HCatReplicationTest extends BaseTestClass {
         //replication should start, wait while it ends
         // we will check for 2 instances so that both partitions are copied over.
         InstanceUtil.waitTillInstanceReachState(cluster2OC, Util.readEntityName(feed), 2,
-            CoordinatorAction.Status.SUCCEEDED, EntityType.FEED);
+            CoordinatorAction.Status.SUCCEEDED, EntityType.FEED, 30);
 
         //check if data was replicated correctly
         List<Path> cluster1ReplicatedData = HadoopUtil
@@ -290,7 +290,7 @@ public class HCatReplicationTest extends BaseTestClass {
         //replication should start, wait while it ends
         // we will check for 2 instances so that both partitions are copied over.
         InstanceUtil.waitTillInstanceReachState(cluster2OC, Util.readEntityName(feed), 2,
-            CoordinatorAction.Status.SUCCEEDED, EntityType.FEED);
+            CoordinatorAction.Status.SUCCEEDED, EntityType.FEED, 30);
 
         //replication should start, wait while it ends
         // we will check for 2 instances so that both partitions are copied over.


Mime
View raw message