You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2016/06/21 04:27:39 UTC

zeppelin git commit: [ZEPPELIN-1039] updated CreateNewButton Testcase in ParagraphAction

Repository: zeppelin
Updated Branches:
  refs/heads/master 286a8886b -> 9b0fb6ec5


[ZEPPELIN-1039] updated CreateNewButton Testcase in ParagraphAction

### What is this PR for?
https://github.com/apache/zeppelin/commit/dec31d69efc3d167bb1f5ac91b26478f307414fb
After updating the code, and test cases fail.
The code was modified to add code to the test.

The interpreter automatically name is added, and therefore empty para graph is not generated.
```
testCreateNewButton(org.apache.zeppelin.integration.ParagraphActionsIT)  Time elapsed: 11.069 sec  <<< FAILURE!
java.lang.AssertionError: Paragraph is created above
Expected: ""
     but: was "%spark "
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:865)
	at org.junit.rules.ErrorCollector$1.call(ErrorCollector.java:65)
	at org.junit.rules.ErrorCollector.checkSucceeds(ErrorCollector.java:78)
	at org.junit.rules.ErrorCollector.checkThat(ErrorCollector.java:63)
	at org.apache.zeppelin.integration.ParagraphActionsIT.testCreateNewButton(ParagraphActionsIT.java:95)

testCreateNewButton(org.apache.zeppelin.integration.ParagraphActionsIT)  Time elapsed: 11.069 sec  <<< FAILURE!
java.lang.AssertionError: Paragraph is created below
Expected: ""
     but: was "%spark "
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:865)
	at org.junit.rules.ErrorCollector$1.call(ErrorCollector.java:65)
	at org.junit.rules.ErrorCollector.checkSucceeds(ErrorCollector.java:78)
	at org.junit.rules.ErrorCollector.checkThat(ErrorCollector.java:63)
	at org.apache.zeppelin.integration.ParagraphActionsIT.testCreateNewButton(ParagraphActionsIT.java:105)
```
### What type of PR is it?
Bug Fix

### Todos
* [x] - Updated Test case (createNewButton - ParagraphActionsIT.java)

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1039

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cl...@gmail.com>

Closes #1053 from cloverhearts/fixed/paragraphActionsIT-AutomaticallyintpTag and squashes the following commits:

bbff034 [CloverHearts] modifed paragraphActionIT Test case -  automatically interpreter tag.


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/9b0fb6ec
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/9b0fb6ec
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/9b0fb6ec

Branch: refs/heads/master
Commit: 9b0fb6ec5b58131c1481f149f1ac1beb45f4b74b
Parents: 286a888
Author: CloverHearts <cl...@gmail.com>
Authored: Tue Jun 21 03:49:43 2016 +0900
Committer: Mina Lee <mi...@apache.org>
Committed: Mon Jun 20 21:26:57 2016 -0700

----------------------------------------------------------------------
 .../apache/zeppelin/integration/ParagraphActionsIT.java  | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/9b0fb6ec/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
index a76706b..e07cdba 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
@@ -92,21 +92,28 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
       ZeppelinITUtils.sleep(1000, false);
       waitForParagraph(1, "READY");
 
+      String oldIntpTag = driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText();
+
       collector.checkThat("Paragraph is created above",
           driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
-          CoreMatchers.equalTo(StringUtils.EMPTY));
+          CoreMatchers.not(StringUtils.EMPTY));
       setTextOfParagraph(1, " this is above ");
 
+
       newPara = driver.findElement(By.xpath(getParagraphXPath(2) + "//div[contains(@class,'new-paragraph')][2]"));
       action.moveToElement(newPara).click().build().perform();
 
       waitForParagraph(3, "READY");
 
+      String lastIntpTag = driver.findElement(By.xpath(getParagraphXPath(3) + "//div[contains(@class, 'editor')]")).getText();
+
       collector.checkThat("Paragraph is created below",
           driver.findElement(By.xpath(getParagraphXPath(3) + "//div[contains(@class, 'editor')]")).getText(),
-          CoreMatchers.equalTo(StringUtils.EMPTY));
+          CoreMatchers.not(StringUtils.EMPTY));
       setTextOfParagraph(3, " this is below ");
 
+      collector.checkThat("Compare interpreter name tag", oldIntpTag, CoreMatchers.equalTo(lastIntpTag));
+
       collector.checkThat("The output field of paragraph1 contains",
           driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
           CoreMatchers.equalTo(" this is above "));