zeppelin git commit: ZEPPELIN-1368. interpreter-setting.json may be loaded mutliple times

2016-09-20 Thread jongyoul
Repository: zeppelin
Updated Branches:
  refs/heads/master ba12ea3ed -> 9b8421806


ZEPPELIN-1368. interpreter-setting.json may be loaded mutliple times

### What is this PR for?
here're several ways to load interpreter-setting.json, but for now we will load 
it multiple times. It is supposed to load only once. We should load it by the 
following orders
 * 1. Register it from path 
{ZEPPELIN_HOME}/interpreter/{interpreter_name}/ interpreter-setting.json
 * 2. Register it from interpreter-setting.json in classpath 
{ZEPPELIN_HOME}/interpreter/{interpreter_name}
 * 3. Register it by Interpreter.register

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

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

### How should this be tested?
Check the log that each interpreter is registered once. And also modify file 
interpreter/spark/interpreter-setting.json to make pyspark as the default 
interpreter and it works. Before this PR, it doesn't work, because it would be 
override by interpreter-setting.json in 
`interpreter/spark/zeppelin-spark_2.10-0.7.0-SNAPSHOT.jar`

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18621557/a4510966-7e57-11e6-8c9a-80697ebf2600.png)

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

Author: Jeff Zhang 

Closes #1435 from zjffdu/ZEPPELIN-1368 and squashes the following commits:

8266d12 [Jeff Zhang] ZEPPELIN-1368. interpreter-setting.json may be loaded 
mutliple times


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

Branch: refs/heads/master
Commit: 9b8421806038ff026ebab5d97f0b5d7d6b1b103c
Parents: ba12ea3
Author: Jeff Zhang 
Authored: Mon Sep 19 10:47:56 2016 +0800
Committer: Jongyoul Lee 
Committed: Tue Sep 20 16:18:11 2016 +0900

--
 .../zeppelin/interpreter/Interpreter.java   |  6 +-
 .../interpreter/InterpreterFactory.java | 64 
 2 files changed, 42 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/9b842180/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
--
diff --git 
a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
 
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
index 42caafd..6d7d660 100644
--- 
a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
+++ 
b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
@@ -338,9 +338,9 @@ public abstract class Interpreter {
   @Deprecated
   public static void register(String name, String group, String className,
   boolean defaultInterpreter, Map properties) 
{
-logger.error("Static initialization is deprecated. You should change it to 
use " +
- "interpreter-setting.json in your jar or " +
- "interpreter/{interpreter}/interpreter-setting.json");
+logger.warn("Static initialization is deprecated for interpreter {}, You 
should change it " +
+ "to use interpreter-setting.json in your jar or " +
+ "interpreter/{interpreter}/interpreter-setting.json", 
name);
 register(new RegisteredInterpreter(name, group, className, 
defaultInterpreter, properties));
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/9b842180/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
--
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
index 7732a45..5545e9b 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
@@ -171,32 +171,42 @@ public class InterpreterFactory implements 
InterpreterGroupFactory {
   })) {
 String interpreterDirString = interpreterDir.toString();
 
-registerInterpreterFromPath(interpreterDirString, interpreterJson);
-
-registerInterpreterFromResource(cl, interpreterDirString, 
interpreterJson);
-
-/*
- * TODO(jongyoul)
- * - Remove these codes below 

zeppelin git commit: ZEPPELIN-1456: Flaky Test: AuthenticationIT

2016-09-20 Thread corneadoug
Repository: zeppelin
Updated Branches:
  refs/heads/master 9b8421806 -> 1e8559e65


ZEPPELIN-1456: Flaky Test: AuthenticationIT

### What is this PR for?
This started happening after ZEPPELIN-1144, 
https://github.com/apache/zeppelin/pull/1330.
This test (testGroupPermission) is to validate the group related permission on 
a notebook.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Fix CI

### What is the Jira issue?
* [ZEPPELIN-1456](https://issues.apache.org/jira/browse/ZEPPELIN-1456)

### How should this be tested?
CI xxx.10 (selenium) should be green

### Screenshots (if appropriate)

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

Author: Prabhjyot Singh 

Closes #1444 from prabhjyotsingh/ZEPPELIN-1456 and squashes the following 
commits:

3c81587 [Prabhjyot Singh] ZEPPELIN-1456: fix


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

Branch: refs/heads/master
Commit: 1e8559e6518529a869b22422b8b6bc28aad1c3b9
Parents: 9b84218
Author: Prabhjyot Singh 
Authored: Tue Sep 20 14:53:08 2016 +0530
Committer: Damien CORNEAU 
Committed: Wed Sep 21 09:52:50 2016 +0900

--
 .../zeppelin/integration/AuthenticationIT.java  | 25 
 1 file changed, 21 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1e8559e6/zeppelin-server/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
--
diff --git 
a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
 
b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
index ea3f363..6001429 100644
--- 
a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
+++ 
b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URI;
 import java.util.List;
 
 
@@ -176,8 +177,16 @@ public class AuthenticationIT extends AbstractZeppelinIT {
   authenticationIT.logoutUser("finance1");
 
   authenticationIT.authenticationUser("hr1", "hr1");
-  pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + 
noteId + "')]"),
-  MAX_BROWSER_TIMEOUT_SEC).click();
+  try {
+WebElement element = 
pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + noteId 
+ "')]"),
+MAX_BROWSER_TIMEOUT_SEC);
+collector.checkThat("Check is user has permission to view this 
notebook link", false,
+CoreMatchers.equalTo(element.isDisplayed()));
+  } catch (Exception e) {
+//This should have failed, nothing to worry.
+  }
+
+  driver.get(new URI(driver.getCurrentUrl()).resolve("/#/notebook/" + 
noteId).toString());
 
   List privilegesModal = driver.findElements(
   
By.xpath("//div[@class='modal-content']//div[@class='bootstrap-dialog-header']" 
+
@@ -190,8 +199,16 @@ public class AuthenticationIT extends AbstractZeppelinIT {
   authenticationIT.logoutUser("hr1");
 
   authenticationIT.authenticationUser("finance2", "finance2");
-  pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + 
noteId + "')]"),
-  MAX_BROWSER_TIMEOUT_SEC).click();
+  try {
+WebElement element = 
pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + noteId 
+ "')]"),
+MAX_BROWSER_TIMEOUT_SEC);
+collector.checkThat("Check is user has permission to view this 
notebook link", false,
+CoreMatchers.equalTo(element.isDisplayed()));
+  } catch (Exception e) {
+//This should have failed, nothing to worry.
+  }
+
+  driver.get(new URI(driver.getCurrentUrl()).resolve("/#/notebook/" + 
noteId).toString());
 
   privilegesModal = driver.findElements(
   
By.xpath("//div[@class='modal-content']//div[@class='bootstrap-dialog-header']" 
+