http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/com/nflabs/zeppelin/ZeppelinIT.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/com/nflabs/zeppelin/ZeppelinIT.java b/zeppelin-server/src/test/java/com/nflabs/zeppelin/ZeppelinIT.java deleted file mode 100644 index c2208ac..0000000 --- a/zeppelin-server/src/test/java/com/nflabs/zeppelin/ZeppelinIT.java +++ /dev/null @@ -1,327 +0,0 @@ -package com.nflabs.zeppelin; - -import static org.junit.Assert.fail; - -import java.io.File; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.OutputType; -import org.openqa.selenium.TakesScreenshot; -import org.openqa.selenium.TimeoutException; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebDriverException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.firefox.FirefoxBinary; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.firefox.FirefoxProfile; -import org.openqa.selenium.safari.SafariDriver; -import org.openqa.selenium.support.ui.ExpectedCondition; -import org.openqa.selenium.support.ui.WebDriverWait; - -public class ZeppelinIT { - private WebDriver getWebDriver(){ - WebDriver driver = null; - - if (driver==null){ - try { - FirefoxBinary ffox = new FirefoxBinary(); - if ("true".equals(System.getenv("TRAVIS"))) { - ffox.setEnvironmentProperty("DISPLAY", ":99"); // xvfb is supposed to run with DISPLAY 99 - } - FirefoxProfile profile = new FirefoxProfile(); - driver = new FirefoxDriver(ffox, profile); - } catch (Exception e){ - } - } - - if (driver==null){ - try { - driver = new ChromeDriver(); - } catch (Exception e){ - } - } - - if (driver==null){ - try { - driver = new SafariDriver(); - } catch (Exception e){ - } - } - - String url; - if (System.getProperty("url")!=null) { - url = System.getProperty("url"); - } else { - url = "http://localhost:8080"; - } - - long start = System.currentTimeMillis(); - boolean loaded = false; - driver.get(url); - - while (System.currentTimeMillis() - start < 60*1000) { - // wait for page load - try { - (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.partialLinkText("Start")).isDisplayed(); - } - }); - loaded = true; - break; - } catch (TimeoutException e){ - driver.navigate().to(url); - } - } - - if (loaded==false) { - fail(); - } - - return driver; - } - - @Test - public void testDisableIT(){ - // - } - - /* - @Test - public void testRunSimpleQueryInNewSession() { - // Notice that the remainder of the code relies on the interface, - // not the implementation. - WebDriver driver = getWebDriver(); - - try { - // click start - WebElement start = driver.findElement(By.partialLinkText("Start")); - start.click(); - - // Wait for the page to load, timeout after 10 seconds - (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.linkText("Create new Job")).isDisplayed(); - } - }); - - // click new - driver.findElement(By.linkText("Create new Job")).click(); - - // wait for run button appears - (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.linkText("Run")).isDisplayed(); - } - }); - - // type some query - driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("create table if not exists test "+Keys.chord(Keys.SHIFT, "9")+"id STRING);\n"); - driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("\nshow tables;"); - - // press run button - driver.findElement(By.linkText("Run")).click(); - - // wait for button becomes Running ... - (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div//a[text()='Running ...']")).isDisplayed(); - } - }); - - // wait for button becomes Run - (new WebDriverWait(driver, 60)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div//a[text()='Run']")).isDisplayed(); - } - }); - - WebElement msg = driver.findElement(By.id("msgBox")); - if (msg!=null) { - System.out.println("msgBox="+msg.getText()); - } - - // wait for visualization - (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div[@id='visualizationContainer']//iframe")).isDisplayed(); - } - }); - - WebDriver iframe = driver.switchTo().frame(driver.findElement(By.xpath("//div[@id='visualizationContainer']//iframe"))); - - // wait for result displayed - (new WebDriverWait(iframe, 20)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//table//td[text()='test']")).isDisplayed(); - } - }); - } catch (WebDriverException e){ - File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); - System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); - throw e; - } finally { - // Close the browser - driver.quit(); - } - } - -*/ - - /** - * Get the url of Zeppelin - * - * @param path to add to the url ex: HOST/myPath - * @return Zeppelin url HOST:PORT{/PATH} - */ - private String getUrl(String path) { - String url; - if (System.getProperty("url") != null) { - url = System.getProperty("url"); - } else { - url = "http://localhost:8080"; - } - if (path != null) - url += path; - return url; - } - -/* - @Test - public void testZAN() { - WebDriver driver = getWebDriver(); - - try { - // goto ZAN menu - driver.findElement(By.xpath("//ul//a[text()='ZAN']")).click(); - - // wait for ZAN page loaded - (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div//a[text()='Update Catalog']")).isDisplayed(); - } - }); - } catch (WebDriverException e) { - File scrFile = ((TakesScreenshot) driver) - .getScreenshotAs(OutputType.FILE); - System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); - throw e; - } finally { - // Close the browser - driver.quit(); - } - } -*/ - - - /** - * Test is swagger-ui is started - */ - /* - @Test - public void testSwaggerDocumentation() { - WebDriver driver = getWebDriver(); - try { - - driver.get(getUrl("/docs")); - // wait for Swagger page loaded - (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div//input[@id='input_apiKey']")).isDisplayed(); - } - }); - - } catch (WebDriverException ex) { - File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); - System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); - throw ex; - } finally { - driver.close(); - } - } - - @Test - public void testAnnotationStmt() { - // Notice that the remainder of the code relies on the interface, - // not the implementation. - WebDriver driver = getWebDriver(); - - try { - // click start - WebElement start = driver.findElement(By.partialLinkText("Start")); - start.click(); - - // Wait for the page to load, timeout after 10 seconds - (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.linkText("Create new Job")).isDisplayed(); - } - }); - - // click new - driver.findElement(By.linkText("Create new Job")).click(); - - // wait for run button appears - (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.linkText("Run")).isDisplayed(); - } - }); - - // type some query with default driver - driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("@driver set exec;"); - driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("\necho 'hello world';"); - - // press run button - driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys(Keys.chord(Keys.COMMAND, Keys.ENTER)); - driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys(Keys.chord(Keys.CONTROL, Keys.ENTER)); - driver.findElement(By.linkText("Run")).click(); - - // wait for button becomes Running ... - (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div//a[text()='Running ...']")).isDisplayed(); - } - }); - - // wait for button becomes Run - (new WebDriverWait(driver, 60)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div//a[text()='Run']")).isDisplayed(); - } - }); - - WebElement msg = driver.findElement(By.id("msgBox")); - if (msg!=null) { - System.out.println("msgBox="+msg.getText()); - } - - // wait for visualization - (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//div[@id='visualizationContainer']//iframe")).isDisplayed(); - } - }); - - WebDriver iframe = driver.switchTo().frame(driver.findElement(By.xpath("//div[@id='visualizationContainer']//iframe"))); - - // wait for result displayed - (new WebDriverWait(iframe, 20)).until(new ExpectedCondition<Boolean>() { - public Boolean apply(WebDriver d) { - return d.findElement(By.xpath("//table//td[text()='hello world']")).isDisplayed(); - } - }); - } catch (WebDriverException e){ - File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); - System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); - throw e; - } finally { - // Close the browser - driver.quit(); - } - } -*/ -}
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/AbstractTestRestApi.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/AbstractTestRestApi.java b/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/AbstractTestRestApi.java deleted file mode 100644 index f7a038c..0000000 --- a/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/AbstractTestRestApi.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.nflabs.zeppelin.rest; - -import java.io.IOException; -import java.lang.ref.WeakReference; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.RequestEntity; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.JsonElement; -import com.google.gson.JsonParseException; -import com.google.gson.JsonParser; -import com.nflabs.zeppelin.server.ZeppelinServer; - -public abstract class AbstractTestRestApi { - - protected static final Logger LOG = LoggerFactory.getLogger(AbstractTestRestApi.class); - - static final String restApiUrl = "/api"; - static final String url = getUrlToTest(); - protected static final boolean wasRunning = checkIfServerIsRuning(); - - private String getUrl(String path) { - String url; - if (System.getProperty("url") != null) { - url = System.getProperty("url"); - } else { - url = "http://localhost:8080"; - } - url += restApiUrl; - if (path != null) - url += path; - return url; - } - - protected static String getUrlToTest() { - String url = "http://localhost:8080" + restApiUrl; - if (System.getProperty("url") != null) { - url = System.getProperty("url"); - } - return url; - } - - static ExecutorService executor = Executors.newSingleThreadExecutor(); - protected static final Runnable server = new Runnable() { - @Override - public void run() { - try { - ZeppelinServer.main(new String[] {""}); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - } - }; - - protected static void startUp() throws Exception { - if (!wasRunning) { - LOG.info("Staring test Zeppelin up..."); - executor.submit(server); - long s = System.currentTimeMillis(); - boolean started = false; - while (System.currentTimeMillis() - s < 1000 * 60 * 3) { // 3 minutes - Thread.sleep(2000); - started = checkIfServerIsRuning(); - if (started == true) { - break; - } - } - if (started == false) { - throw new RuntimeException("Can not start Zeppelin server"); - } - LOG.info("Test Zeppelin stared."); - } - } - - protected static void shutDown() { - if (!wasRunning) { - LOG.info("Terminating test Zeppelin..."); - executor.shutdown(); - try { - executor.awaitTermination(10, TimeUnit.SECONDS); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - LOG.info("Test Zeppelin terminated."); - } - } - - protected static boolean checkIfServerIsRuning() { - GetMethod request = null; - boolean isRunning = true; - try { - request = httpGet("/"); - isRunning = request.getStatusCode() == 200; - } catch (IOException e) { - isRunning = false; - } finally { - if (request != null) { - request.releaseConnection(); - } - } - return isRunning; - } - - protected static GetMethod httpGet(String path) throws IOException { - LOG.info("Connecting to {}", url + path); - HttpClient httpClient = new HttpClient(); - GetMethod getMethod = new GetMethod(url + path); - httpClient.executeMethod(getMethod); - LOG.info("{} - {}", getMethod.getStatusCode(), getMethod.getStatusText()); - return getMethod; - } - - protected static PostMethod httpPost(String path, String body) throws IOException { - LOG.info("Connecting to {}", url + path); - HttpClient httpClient = new HttpClient(); - PostMethod postMethod = new PostMethod(url + path); - RequestEntity entity = new ByteArrayRequestEntity(body.getBytes("UTF-8")); - postMethod.setRequestEntity(entity); - httpClient.executeMethod(postMethod); - LOG.info("{} - {}", postMethod.getStatusCode(), postMethod.getStatusText()); - return postMethod; - } - - protected Matcher<GetMethod> responsesWith(final int expectedStatusCode) { - return new TypeSafeMatcher<GetMethod>() { - WeakReference<GetMethod> method; - - @Override - public boolean matchesSafely(GetMethod getMethod) { - method = (method == null) ? new WeakReference<GetMethod>(getMethod) : method; - return getMethod.getStatusCode() == expectedStatusCode; - } - - @Override - public void describeTo(Description description) { - description.appendText("HTTP response ").appendValue(expectedStatusCode) - .appendText(" from ").appendText(method.get().getPath()); - } - - @Override - protected void describeMismatchSafely(GetMethod item, Description description) { - description.appendText("got ").appendValue(item.getStatusCode()).appendText(" ") - .appendText(item.getStatusText()); - } - }; - } - - protected TypeSafeMatcher<String> isJSON() { - return new TypeSafeMatcher<String>() { - @Override - public boolean matchesSafely(String body) { - String b = body.trim(); - return (b.startsWith("{") && b.endsWith("}")) || (b.startsWith("[") && b.endsWith("]")); - } - - @Override - public void describeTo(Description description) { - description.appendText("response in JSON format "); - } - - @Override - protected void describeMismatchSafely(String item, Description description) { - description.appendText("got ").appendText(item); - } - }; - } - - protected TypeSafeMatcher<String> isValidJSON() { - return new TypeSafeMatcher<String>() { - @Override - public boolean matchesSafely(String body) { - boolean isValid = true; - try { - new JsonParser().parse(body); - } catch (JsonParseException e) { - isValid = false; - } - return isValid; - } - - @Override - public void describeTo(Description description) { - description.appendText("response in JSON format "); - } - - @Override - protected void describeMismatchSafely(String item, Description description) { - description.appendText("got ").appendText(item); - } - }; - } - - protected TypeSafeMatcher<? super JsonElement> hasRootElementNamed(final String memberName) { - return new TypeSafeMatcher<JsonElement>() { - @Override - protected boolean matchesSafely(JsonElement item) { - return item.isJsonObject() && item.getAsJsonObject().has(memberName); - } - - @Override - public void describeTo(Description description) { - description.appendText("response in JSON format with \"").appendText(memberName) - .appendText("\" beeing a root element "); - } - - @Override - protected void describeMismatchSafely(JsonElement root, Description description) { - description.appendText("got ").appendText(root.toString()); - } - }; - } - - /** Status code matcher */ - protected Matcher<? super GetMethod> isForbiden() { - return responsesWith(403); - } - - protected Matcher<? super GetMethod> isAllowed() { - return responsesWith(200); - } - - protected Matcher<? super GetMethod> isNotAllowed() { - return responsesWith(405); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/ZeppelinRestApiTest.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/ZeppelinRestApiTest.java b/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/ZeppelinRestApiTest.java deleted file mode 100644 index 9ccabcd..0000000 --- a/zeppelin-server/src/test/java/com/nflabs/zeppelin/rest/ZeppelinRestApiTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.nflabs.zeppelin.rest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.commons.httpclient.methods.GetMethod; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.nflabs.zeppelin.notebook.Note; -import com.nflabs.zeppelin.server.ZeppelinServer; -/** - * BASIC Zeppelin rest api tests - * TODO: Add Post,Put,Delete test and method - * - * @author anthonycorbacho - * - */ -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class ZeppelinRestApiTest extends AbstractTestRestApi { - Gson gson = new Gson(); - - @BeforeClass - public static void init() throws Exception { - AbstractTestRestApi.startUp(); - } - - @AfterClass - public static void destroy() { - AbstractTestRestApi.shutDown(); - } - - /*** - * ROOT API TEST - ***/ - @Test - public void getApiRoot() throws IOException { - // when - GetMethod httpGetRoot = httpGet("/"); - // then - assertThat(httpGetRoot, isAllowed()); - httpGetRoot.releaseConnection(); - } - - - @Test - public void getAvailableInterpreters() throws IOException { - // when - GetMethod get = httpGet("/interpreter"); - - // then - assertThat(get, isAllowed()); - Map<String, Object> resp = gson.fromJson(get.getResponseBodyAsString(), new TypeToken<Map<String, Object>>(){}.getType()); - Map<String, Object> body = (Map<String, Object>) resp.get("body"); - assertEquals(6, body.size()); - get.releaseConnection(); - } - - @Test - public void getSettings() throws IOException { - // when - GetMethod get = httpGet("/interpreter/setting"); - - // then - Map<String, Object> resp = gson.fromJson(get.getResponseBodyAsString(), new TypeToken<Map<String, Object>>(){}.getType()); - assertThat(get, isAllowed()); - get.releaseConnection(); - } - - - @Test - public void testInterpreterAutoBinding() throws IOException { - // create note - Note note = ZeppelinServer.notebook.createNote(); - - // check interpreter is bindded - GetMethod get = httpGet("/notebook/interpreter/bind/"+note.id()); - assertThat(get, isAllowed()); - Map<String, Object> resp = gson.fromJson(get.getResponseBodyAsString(), new TypeToken<Map<String, Object>>(){}.getType()); - List<Map<String, String>> body = (List<Map<String, String>>) resp.get("body"); - assertTrue(0 < body.size()); - - get.releaseConnection(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java b/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java index 473cfeb..ae83bee 100644 --- a/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java +++ b/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java @@ -42,7 +42,7 @@ public class ScreenCaptureHtmlUnitDriver extends HtmlUnitDriver implements Takes private static Map<String, byte[]> imagesCache = Collections.synchronizedMap(new HashMap<String, byte[]>()); private static Map<String, String> cssjsCache = Collections.synchronizedMap(new HashMap<String, String>()); - + // http://stackoverflow.com/questions/4652777/java-regex-to-get-the-urls-from-css private final static Pattern cssUrlPattern = Pattern.compile("background(-image)?[\\s]*:[^url]*url[\\s]*\\([\\s]*([^\\)]*)[\\s]*\\)[\\s]*");// ?<url> @@ -65,6 +65,7 @@ public class ScreenCaptureHtmlUnitDriver extends HtmlUnitDriver implements Takes } //@Override + @Override @SuppressWarnings("unchecked") public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException { byte[] archive = new byte[0]; http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java new file mode 100644 index 0000000..08d3238 --- /dev/null +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java @@ -0,0 +1,338 @@ +/* + * 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.zeppelin; + +import static org.junit.Assert.fail; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.TimeoutException; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.firefox.FirefoxBinary; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.firefox.FirefoxProfile; +import org.openqa.selenium.safari.SafariDriver; +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.WebDriverWait; + +public class ZeppelinIT { + private WebDriver getWebDriver(){ + WebDriver driver = null; + + if (driver==null){ + try { + FirefoxBinary ffox = new FirefoxBinary(); + if ("true".equals(System.getenv("TRAVIS"))) { + ffox.setEnvironmentProperty("DISPLAY", ":99"); // xvfb is supposed to run with DISPLAY 99 + } + FirefoxProfile profile = new FirefoxProfile(); + driver = new FirefoxDriver(ffox, profile); + } catch (Exception e){ + } + } + + if (driver==null){ + try { + driver = new ChromeDriver(); + } catch (Exception e){ + } + } + + if (driver==null){ + try { + driver = new SafariDriver(); + } catch (Exception e){ + } + } + + String url; + if (System.getProperty("url")!=null) { + url = System.getProperty("url"); + } else { + url = "http://localhost:8080"; + } + + long start = System.currentTimeMillis(); + boolean loaded = false; + driver.get(url); + + while (System.currentTimeMillis() - start < 60*1000) { + // wait for page load + try { + (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() { + @Override + public Boolean apply(WebDriver d) { + return d.findElement(By.partialLinkText("Start")).isDisplayed(); + } + }); + loaded = true; + break; + } catch (TimeoutException e){ + driver.navigate().to(url); + } + } + + if (loaded==false) { + fail(); + } + + return driver; + } + + @Test + public void testDisableIT(){ + // + } + + /* + @Test + public void testRunSimpleQueryInNewSession() { + // Notice that the remainder of the code relies on the interface, + // not the implementation. + WebDriver driver = getWebDriver(); + + try { + // click start + WebElement start = driver.findElement(By.partialLinkText("Start")); + start.click(); + + // Wait for the page to load, timeout after 10 seconds + (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.linkText("Create new Job")).isDisplayed(); + } + }); + + // click new + driver.findElement(By.linkText("Create new Job")).click(); + + // wait for run button appears + (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.linkText("Run")).isDisplayed(); + } + }); + + // type some query + driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("create table if not exists test "+Keys.chord(Keys.SHIFT, "9")+"id STRING);\n"); + driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("\nshow tables;"); + + // press run button + driver.findElement(By.linkText("Run")).click(); + + // wait for button becomes Running ... + (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div//a[text()='Running ...']")).isDisplayed(); + } + }); + + // wait for button becomes Run + (new WebDriverWait(driver, 60)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div//a[text()='Run']")).isDisplayed(); + } + }); + + WebElement msg = driver.findElement(By.id("msgBox")); + if (msg!=null) { + System.out.println("msgBox="+msg.getText()); + } + + // wait for visualization + (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div[@id='visualizationContainer']//iframe")).isDisplayed(); + } + }); + + WebDriver iframe = driver.switchTo().frame(driver.findElement(By.xpath("//div[@id='visualizationContainer']//iframe"))); + + // wait for result displayed + (new WebDriverWait(iframe, 20)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//table//td[text()='test']")).isDisplayed(); + } + }); + } catch (WebDriverException e){ + File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); + throw e; + } finally { + // Close the browser + driver.quit(); + } + } + +*/ + + /** + * Get the url of Zeppelin + * + * @param path to add to the url ex: HOST/myPath + * @return Zeppelin url HOST:PORT{/PATH} + */ + private String getUrl(String path) { + String url; + if (System.getProperty("url") != null) { + url = System.getProperty("url"); + } else { + url = "http://localhost:8080"; + } + if (path != null) + url += path; + return url; + } + +/* + @Test + public void testZAN() { + WebDriver driver = getWebDriver(); + + try { + // goto ZAN menu + driver.findElement(By.xpath("//ul//a[text()='ZAN']")).click(); + + // wait for ZAN page loaded + (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div//a[text()='Update Catalog']")).isDisplayed(); + } + }); + } catch (WebDriverException e) { + File scrFile = ((TakesScreenshot) driver) + .getScreenshotAs(OutputType.FILE); + System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); + throw e; + } finally { + // Close the browser + driver.quit(); + } + } +*/ + + + /** + * Test is swagger-ui is started + */ + /* + @Test + public void testSwaggerDocumentation() { + WebDriver driver = getWebDriver(); + try { + + driver.get(getUrl("/docs")); + // wait for Swagger page loaded + (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div//input[@id='input_apiKey']")).isDisplayed(); + } + }); + + } catch (WebDriverException ex) { + File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); + System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); + throw ex; + } finally { + driver.close(); + } + } + + @Test + public void testAnnotationStmt() { + // Notice that the remainder of the code relies on the interface, + // not the implementation. + WebDriver driver = getWebDriver(); + + try { + // click start + WebElement start = driver.findElement(By.partialLinkText("Start")); + start.click(); + + // Wait for the page to load, timeout after 10 seconds + (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.linkText("Create new Job")).isDisplayed(); + } + }); + + // click new + driver.findElement(By.linkText("Create new Job")).click(); + + // wait for run button appears + (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.linkText("Run")).isDisplayed(); + } + }); + + // type some query with default driver + driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("@driver set exec;"); + driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys("\necho 'hello world';"); + + // press run button + driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys(Keys.chord(Keys.COMMAND, Keys.ENTER)); + driver.findElement(By.xpath("//div[@id='zqlEditor']//textarea")).sendKeys(Keys.chord(Keys.CONTROL, Keys.ENTER)); + driver.findElement(By.linkText("Run")).click(); + + // wait for button becomes Running ... + (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div//a[text()='Running ...']")).isDisplayed(); + } + }); + + // wait for button becomes Run + (new WebDriverWait(driver, 60)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div//a[text()='Run']")).isDisplayed(); + } + }); + + WebElement msg = driver.findElement(By.id("msgBox")); + if (msg!=null) { + System.out.println("msgBox="+msg.getText()); + } + + // wait for visualization + (new WebDriverWait(driver, 20)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//div[@id='visualizationContainer']//iframe")).isDisplayed(); + } + }); + + WebDriver iframe = driver.switchTo().frame(driver.findElement(By.xpath("//div[@id='visualizationContainer']//iframe"))); + + // wait for result displayed + (new WebDriverWait(iframe, 20)).until(new ExpectedCondition<Boolean>() { + public Boolean apply(WebDriver d) { + return d.findElement(By.xpath("//table//td[text()='hello world']")).isDisplayed(); + } + }); + } catch (WebDriverException e){ + File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + System.out.println("Screenshot in: " + scrFile.getAbsolutePath()); + throw e; + } finally { + // Close the browser + driver.quit(); + } + } +*/ +} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java new file mode 100644 index 0000000..ac40dda --- /dev/null +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java @@ -0,0 +1,256 @@ +/* + * 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.zeppelin.rest; + +import java.io.IOException; +import java.lang.ref.WeakReference; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.RequestEntity; +import org.apache.zeppelin.server.ZeppelinServer; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; + +public abstract class AbstractTestRestApi { + + protected static final Logger LOG = LoggerFactory.getLogger(AbstractTestRestApi.class); + + static final String restApiUrl = "/api"; + static final String url = getUrlToTest(); + protected static final boolean wasRunning = checkIfServerIsRuning(); + + private String getUrl(String path) { + String url; + if (System.getProperty("url") != null) { + url = System.getProperty("url"); + } else { + url = "http://localhost:8080"; + } + url += restApiUrl; + if (path != null) + url += path; + return url; + } + + protected static String getUrlToTest() { + String url = "http://localhost:8080" + restApiUrl; + if (System.getProperty("url") != null) { + url = System.getProperty("url"); + } + return url; + } + + static ExecutorService executor = Executors.newSingleThreadExecutor(); + protected static final Runnable server = new Runnable() { + @Override + public void run() { + try { + ZeppelinServer.main(new String[] {""}); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + }; + + protected static void startUp() throws Exception { + if (!wasRunning) { + LOG.info("Staring test Zeppelin up..."); + executor.submit(server); + long s = System.currentTimeMillis(); + boolean started = false; + while (System.currentTimeMillis() - s < 1000 * 60 * 3) { // 3 minutes + Thread.sleep(2000); + started = checkIfServerIsRuning(); + if (started == true) { + break; + } + } + if (started == false) { + throw new RuntimeException("Can not start Zeppelin server"); + } + LOG.info("Test Zeppelin stared."); + } + } + + protected static void shutDown() { + if (!wasRunning) { + LOG.info("Terminating test Zeppelin..."); + executor.shutdown(); + try { + executor.awaitTermination(10, TimeUnit.SECONDS); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + LOG.info("Test Zeppelin terminated."); + } + } + + protected static boolean checkIfServerIsRuning() { + GetMethod request = null; + boolean isRunning = true; + try { + request = httpGet("/"); + isRunning = request.getStatusCode() == 200; + } catch (IOException e) { + isRunning = false; + } finally { + if (request != null) { + request.releaseConnection(); + } + } + return isRunning; + } + + protected static GetMethod httpGet(String path) throws IOException { + LOG.info("Connecting to {}", url + path); + HttpClient httpClient = new HttpClient(); + GetMethod getMethod = new GetMethod(url + path); + httpClient.executeMethod(getMethod); + LOG.info("{} - {}", getMethod.getStatusCode(), getMethod.getStatusText()); + return getMethod; + } + + protected static PostMethod httpPost(String path, String body) throws IOException { + LOG.info("Connecting to {}", url + path); + HttpClient httpClient = new HttpClient(); + PostMethod postMethod = new PostMethod(url + path); + RequestEntity entity = new ByteArrayRequestEntity(body.getBytes("UTF-8")); + postMethod.setRequestEntity(entity); + httpClient.executeMethod(postMethod); + LOG.info("{} - {}", postMethod.getStatusCode(), postMethod.getStatusText()); + return postMethod; + } + + protected Matcher<GetMethod> responsesWith(final int expectedStatusCode) { + return new TypeSafeMatcher<GetMethod>() { + WeakReference<GetMethod> method; + + @Override + public boolean matchesSafely(GetMethod getMethod) { + method = (method == null) ? new WeakReference<GetMethod>(getMethod) : method; + return getMethod.getStatusCode() == expectedStatusCode; + } + + @Override + public void describeTo(Description description) { + description.appendText("HTTP response ").appendValue(expectedStatusCode) + .appendText(" from ").appendText(method.get().getPath()); + } + + @Override + protected void describeMismatchSafely(GetMethod item, Description description) { + description.appendText("got ").appendValue(item.getStatusCode()).appendText(" ") + .appendText(item.getStatusText()); + } + }; + } + + protected TypeSafeMatcher<String> isJSON() { + return new TypeSafeMatcher<String>() { + @Override + public boolean matchesSafely(String body) { + String b = body.trim(); + return (b.startsWith("{") && b.endsWith("}")) || (b.startsWith("[") && b.endsWith("]")); + } + + @Override + public void describeTo(Description description) { + description.appendText("response in JSON format "); + } + + @Override + protected void describeMismatchSafely(String item, Description description) { + description.appendText("got ").appendText(item); + } + }; + } + + protected TypeSafeMatcher<String> isValidJSON() { + return new TypeSafeMatcher<String>() { + @Override + public boolean matchesSafely(String body) { + boolean isValid = true; + try { + new JsonParser().parse(body); + } catch (JsonParseException e) { + isValid = false; + } + return isValid; + } + + @Override + public void describeTo(Description description) { + description.appendText("response in JSON format "); + } + + @Override + protected void describeMismatchSafely(String item, Description description) { + description.appendText("got ").appendText(item); + } + }; + } + + protected TypeSafeMatcher<? super JsonElement> hasRootElementNamed(final String memberName) { + return new TypeSafeMatcher<JsonElement>() { + @Override + protected boolean matchesSafely(JsonElement item) { + return item.isJsonObject() && item.getAsJsonObject().has(memberName); + } + + @Override + public void describeTo(Description description) { + description.appendText("response in JSON format with \"").appendText(memberName) + .appendText("\" beeing a root element "); + } + + @Override + protected void describeMismatchSafely(JsonElement root, Description description) { + description.appendText("got ").appendText(root.toString()); + } + }; + } + + /** Status code matcher */ + protected Matcher<? super GetMethod> isForbiden() { + return responsesWith(403); + } + + protected Matcher<? super GetMethod> isAllowed() { + return responsesWith(200); + } + + protected Matcher<? super GetMethod> isNotAllowed() { + return responsesWith(405); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java new file mode 100644 index 0000000..3e63503 --- /dev/null +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java @@ -0,0 +1,112 @@ +/* + * 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.zeppelin.rest; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.zeppelin.notebook.Note; +import org.apache.zeppelin.server.ZeppelinServer; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +/** + * BASIC Zeppelin rest api tests + * TODO: Add Post,Put,Delete test and method + * + * @author anthonycorbacho + * + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class ZeppelinRestApiTest extends AbstractTestRestApi { + Gson gson = new Gson(); + + @BeforeClass + public static void init() throws Exception { + AbstractTestRestApi.startUp(); + } + + @AfterClass + public static void destroy() { + AbstractTestRestApi.shutDown(); + } + + /*** + * ROOT API TEST + ***/ + @Test + public void getApiRoot() throws IOException { + // when + GetMethod httpGetRoot = httpGet("/"); + // then + assertThat(httpGetRoot, isAllowed()); + httpGetRoot.releaseConnection(); + } + + + @Test + public void getAvailableInterpreters() throws IOException { + // when + GetMethod get = httpGet("/interpreter"); + + // then + assertThat(get, isAllowed()); + Map<String, Object> resp = gson.fromJson(get.getResponseBodyAsString(), new TypeToken<Map<String, Object>>(){}.getType()); + Map<String, Object> body = (Map<String, Object>) resp.get("body"); + assertEquals(6, body.size()); + get.releaseConnection(); + } + + @Test + public void getSettings() throws IOException { + // when + GetMethod get = httpGet("/interpreter/setting"); + + // then + Map<String, Object> resp = gson.fromJson(get.getResponseBodyAsString(), new TypeToken<Map<String, Object>>(){}.getType()); + assertThat(get, isAllowed()); + get.releaseConnection(); + } + + + @Test + public void testInterpreterAutoBinding() throws IOException { + // create note + Note note = ZeppelinServer.notebook.createNote(); + + // check interpreter is bindded + GetMethod get = httpGet("/notebook/interpreter/bind/"+note.id()); + assertThat(get, isAllowed()); + Map<String, Object> resp = gson.fromJson(get.getResponseBodyAsString(), new TypeToken<Map<String, Object>>(){}.getType()); + List<Map<String, String>> body = (List<Map<String, String>>) resp.get("body"); + assertTrue(0 < body.size()); + + get.releaseConnection(); + } +} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/resources/log4j.properties b/zeppelin-server/src/test/resources/log4j.properties index 14cea37..376ce00 100644 --- a/zeppelin-server/src/test/resources/log4j.properties +++ b/zeppelin-server/src/test/resources/log4j.properties @@ -1,3 +1,20 @@ +# +# 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. +# + # Direct log messages to stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out @@ -16,7 +33,7 @@ log4j.logger.org.apache.hadoop.mapred=WARN log4j.logger.org.apache.hadoop.hive.ql=WARN log4j.logger.org.apache.hadoop.hive.metastore=WARN log4j.logger.org.apache.haadoop.hive.service.HiveServer=WARN -log4j.logger.com.nflabs.zeppelin.scheduler=WARN +log4j.logger.org.apache.zeppelin.scheduler=WARN log4j.logger.org.quartz=WARN log4j.logger.DataNucleus=WARN http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/scala/com/nflabs/zeppelin/AbstractFunctionalSuite.scala ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/scala/com/nflabs/zeppelin/AbstractFunctionalSuite.scala b/zeppelin-server/src/test/scala/com/nflabs/zeppelin/AbstractFunctionalSuite.scala deleted file mode 100644 index ff0f1cf..0000000 --- a/zeppelin-server/src/test/scala/com/nflabs/zeppelin/AbstractFunctionalSuite.scala +++ /dev/null @@ -1,65 +0,0 @@ -package com.nflabs.zeppelin - -import com.nflabs.zeppelin.AbstractFunctionalSuite.SERVER_ADDRESS -import org.openqa.selenium.WebDriver -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.firefox.{FirefoxBinary, FirefoxDriver, FirefoxProfile} -import org.openqa.selenium.safari.SafariDriver -import org.scalatest.concurrent.Eventually._ -import org.scalatest.time._ -import org.scalatest.selenium.WebBrowser -import org.scalatest.{BeforeAndAfterAll, FunSuite, Suite} - -import scala.sys.process._ -import scala.util.Try - -object AbstractFunctionalSuite { - val SERVER_ADDRESS = "http://localhost:8080" -} - -class AbstractFunctionalSuite extends FunSuite with WebBrowser with BeforeAndAfterAll { - - implicit val webDriver = getDriver() - - override def beforeAll() = { - "../bin/zeppelin-daemon.sh start" ! - - eventually (timeout(Span(20, Seconds))) { - go to SERVER_ADDRESS - assert(find("welcome").isDefined) - } - } - - override def nestedSuites = - List[Suite](new WelcomePageSuite).toIndexedSeq - - override def afterAll() = { - "../bin/zeppelin-daemon.sh stop" ! - } - - def getDriver(): WebDriver = { - val possibleDrivers = List[() => WebDriver](safary, chrome, firefox) - val createdDriver = possibleDrivers.map(driverFactory => Try(driverFactory.apply())).find(_.isSuccess) - createdDriver match { - case Some(driver) => driver.get - case None => throw new RuntimeException("Could not initialize any driver") - } - } - - def safary(): WebDriver = { - new SafariDriver() - } - - def chrome(): WebDriver = { - new ChromeDriver() - } - - def firefox(): WebDriver = { - val ffox: FirefoxBinary = new FirefoxBinary - if ("true" == System.getenv("TRAVIS")) { - ffox.setEnvironmentProperty("DISPLAY", ":99") - } - val profile: FirefoxProfile = new FirefoxProfile - new FirefoxDriver(ffox, profile) - } -} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/scala/com/nflabs/zeppelin/WelcomePageSuite.scala ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/scala/com/nflabs/zeppelin/WelcomePageSuite.scala b/zeppelin-server/src/test/scala/com/nflabs/zeppelin/WelcomePageSuite.scala deleted file mode 100644 index c02df2b..0000000 --- a/zeppelin-server/src/test/scala/com/nflabs/zeppelin/WelcomePageSuite.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.nflabs.zeppelin - -import org.openqa.selenium.WebDriver -import org.scalatest.concurrent.Eventually._ -import org.scalatest.time._ -import org.scalatest.selenium.WebBrowser -import org.scalatest.{DoNotDiscover, FunSuite} -import AbstractFunctionalSuite.SERVER_ADDRESS - -@DoNotDiscover -class WelcomePageSuite(implicit driver: WebDriver) extends FunSuite with WebBrowser { - - test("Welcome sign is correct") { - eventually (timeout(Span(20, Seconds))) { - go to SERVER_ADDRESS - assert(find("welcome").isDefined) - } - } - -} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala b/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala new file mode 100644 index 0000000..a83ab5b --- /dev/null +++ b/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala @@ -0,0 +1,82 @@ +/* + * 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.zeppelin + +import org.apache.zeppelin.AbstractFunctionalSuite.SERVER_ADDRESS +import org.openqa.selenium.WebDriver +import org.openqa.selenium.chrome.ChromeDriver +import org.openqa.selenium.firefox.{FirefoxBinary, FirefoxDriver, FirefoxProfile} +import org.openqa.selenium.safari.SafariDriver +import org.scalatest.concurrent.Eventually._ +import org.scalatest.time._ +import org.scalatest.selenium.WebBrowser +import org.scalatest.{BeforeAndAfterAll, FunSuite, Suite} + +import scala.sys.process._ +import scala.util.Try + +object AbstractFunctionalSuite { + val SERVER_ADDRESS = "http://localhost:8080" +} + +class AbstractFunctionalSuite extends FunSuite with WebBrowser with BeforeAndAfterAll { + + implicit val webDriver = getDriver() + + override def beforeAll() = { + "../bin/zeppelin-daemon.sh start" ! + + eventually (timeout(Span(20, Seconds))) { + go to SERVER_ADDRESS + assert(find("welcome").isDefined) + } + } + + override def nestedSuites = + List[Suite](new WelcomePageSuite).toIndexedSeq + + override def afterAll() = { + "../bin/zeppelin-daemon.sh stop" ! + } + + def getDriver(): WebDriver = { + val possibleDrivers = List[() => WebDriver](safary, chrome, firefox) + val createdDriver = possibleDrivers.map(driverFactory => Try(driverFactory.apply())).find(_.isSuccess) + createdDriver match { + case Some(driver) => driver.get + case None => throw new RuntimeException("Could not initialize any driver") + } + } + + def safary(): WebDriver = { + new SafariDriver() + } + + def chrome(): WebDriver = { + new ChromeDriver() + } + + def firefox(): WebDriver = { + val ffox: FirefoxBinary = new FirefoxBinary + if ("true" == System.getenv("TRAVIS")) { + ffox.setEnvironmentProperty("DISPLAY", ":99") + } + val profile: FirefoxProfile = new FirefoxProfile + new FirefoxDriver(ffox, profile) + } +} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-server/src/test/scala/org/apache/zeppelin/WelcomePageSuite.scala ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/scala/org/apache/zeppelin/WelcomePageSuite.scala b/zeppelin-server/src/test/scala/org/apache/zeppelin/WelcomePageSuite.scala new file mode 100644 index 0000000..3ce534a --- /dev/null +++ b/zeppelin-server/src/test/scala/org/apache/zeppelin/WelcomePageSuite.scala @@ -0,0 +1,37 @@ +/* + * 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.zeppelin + +import org.openqa.selenium.WebDriver +import org.scalatest.concurrent.Eventually._ +import org.scalatest.time._ +import org.scalatest.selenium.WebBrowser +import org.scalatest.{DoNotDiscover, FunSuite} +import AbstractFunctionalSuite.SERVER_ADDRESS + +@DoNotDiscover +class WelcomePageSuite(implicit driver: WebDriver) extends FunSuite with WebBrowser { + + test("Welcome sign is correct") { + eventually (timeout(Span(20, Seconds))) { + go to SERVER_ADDRESS + assert(find("welcome").isDefined) + } + } + +} http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/Gruntfile.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/Gruntfile.js b/zeppelin-web/Gruntfile.js index 77900b1..d544ba4 100644 --- a/zeppelin-web/Gruntfile.js +++ b/zeppelin-web/Gruntfile.js @@ -1,3 +1,20 @@ +/* + * 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. + */ + // Generated on 2014-08-29 using generator-angular 0.9.5 'use strict'; http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/404.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/404.html b/zeppelin-web/app/404.html index ec98e3c..45cc829 100644 --- a/zeppelin-web/app/404.html +++ b/zeppelin-web/app/404.html @@ -1,3 +1,17 @@ +<!-- +Licensed 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. +--> + <!DOCTYPE html> <html lang="en"> <head> http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/WEB-INF/web.xml b/zeppelin-web/app/WEB-INF/web.xml index 9a04fab..f34da18 100644 --- a/zeppelin-web/app/WEB-INF/web.xml +++ b/zeppelin-web/app/WEB-INF/web.xml @@ -1,4 +1,21 @@ <?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + ~ 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. + --> + <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> @@ -9,7 +26,7 @@ <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> - <param-value>com.nflabs.zeppelin.rest;com.wordnik.swagger.jersey.listing</param-value> + <param-value>org.apache.zeppelin.rest;com.wordnik.swagger.jersey.listing</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/fonts/custom-font.svg ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/fonts/custom-font.svg b/zeppelin-web/app/fonts/custom-font.svg index fb2769a..55756b1 100644 --- a/zeppelin-web/app/fonts/custom-font.svg +++ b/zeppelin-web/app/fonts/custom-font.svg @@ -1,4 +1,20 @@ <?xml version="1.0" standalone="no"?> +<!-- + ~ 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. + --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > <svg xmlns="http://www.w3.org/2000/svg"> <metadata> @@ -22,4 +38,4 @@ <missing-glyph horiz-adv-x="2048" /> <glyph unicode=" " d="" horiz-adv-x="1024" /> <glyph unicode="" d="M2340.572 36.572v-146.286h-2340.572v1755.428h146.286v-1609.142h2194.286zM681.142 443.428q0-60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428zM921.142 889.142q0-60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428zM1298.286 601.142q0-60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428zM1488 1061.714q0-60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428zM1157.714 1307.428q0-60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428zM1755.428 768q0-60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428zM1926.858 1392q0 -60.572-42.858-103.428t-103.428-42.858-103.428 42.858-42.858 103.428 42.858 103.428 103.428 42.858 103.428-42.858 42.858-103.428z" horiz-adv-x="2340" /> -</font></defs></svg> \ No newline at end of file +</font></defs></svg> http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/index.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/index.html b/zeppelin-web/app/index.html index dd6e801..2ad0e97 100644 --- a/zeppelin-web/app/index.html +++ b/zeppelin-web/app/index.html @@ -1,6 +1,4 @@ <!-- -Copyright 2014 NFLabs - Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/ace/textarea/src/ace-bookmarklet.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/ace/textarea/src/ace-bookmarklet.js b/zeppelin-web/app/scripts/ace/textarea/src/ace-bookmarklet.js index 9770344..f723f43 100644 --- a/zeppelin-web/app/scripts/ace/textarea/src/ace-bookmarklet.js +++ b/zeppelin-web/app/scripts/ace/textarea/src/ace-bookmarklet.js @@ -1 +1,14 @@ -alert("moved to https://ajaxorg.github.io/ace-builds/demo/bookmarklet/index.html. Please update your bookmark") \ No newline at end of file +/* + * Licensed 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. + */ +alert("moved to https://ajaxorg.github.io/ace-builds/demo/bookmarklet/index.html. Please update your bookmark") http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/app.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/app.js b/zeppelin-web/app/scripts/app.js index 55dc9b4..ff55647 100644 --- a/zeppelin-web/app/scripts/app.js +++ b/zeppelin-web/app/scripts/app.js @@ -1,10 +1,12 @@ -/* Copyright 2014 NFlabs +/* + * 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 * - * Licensed 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 + * 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, @@ -12,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - 'use strict'; /** get the current port of the websocket http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/controllers/interpreter.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/controllers/interpreter.js b/zeppelin-web/app/scripts/controllers/interpreter.js index 083f3e9..0da1baa 100644 --- a/zeppelin-web/app/scripts/controllers/interpreter.js +++ b/zeppelin-web/app/scripts/controllers/interpreter.js @@ -1,7 +1,6 @@ /* global confirm:false, alert:false */ /* jshint loopfunc: true */ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/controllers/main.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/controllers/main.js b/zeppelin-web/app/scripts/controllers/main.js index 477f544..535cf78 100644 --- a/zeppelin-web/app/scripts/controllers/main.js +++ b/zeppelin-web/app/scripts/controllers/main.js @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/controllers/nav.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/controllers/nav.js b/zeppelin-web/app/scripts/controllers/nav.js index 5daf2e8..3925845 100644 --- a/zeppelin-web/app/scripts/controllers/nav.js +++ b/zeppelin-web/app/scripts/controllers/nav.js @@ -1,6 +1,5 @@ /* global $:false */ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/controllers/notebook.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/controllers/notebook.js b/zeppelin-web/app/scripts/controllers/notebook.js index 3d3fead..cc295dc 100644 --- a/zeppelin-web/app/scripts/controllers/notebook.js +++ b/zeppelin-web/app/scripts/controllers/notebook.js @@ -1,7 +1,6 @@ /* global confirm:false, alert:false */ /* jshint loopfunc: true */ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/controllers/paragraph.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/controllers/paragraph.js b/zeppelin-web/app/scripts/controllers/paragraph.js index a1cab47..aac8a78 100644 --- a/zeppelin-web/app/scripts/controllers/paragraph.js +++ b/zeppelin-web/app/scripts/controllers/paragraph.js @@ -1,7 +1,6 @@ /* global $:false, jQuery:false, ace:false, confirm:false, d3:false, nv:false*/ /*jshint loopfunc: true, unused:false */ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/directives/dropdowninput.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/directives/dropdowninput.js b/zeppelin-web/app/scripts/directives/dropdowninput.js index 005e4b6..65dd5d3 100644 --- a/zeppelin-web/app/scripts/directives/dropdowninput.js +++ b/zeppelin-web/app/scripts/directives/dropdowninput.js @@ -1,3 +1,16 @@ +/* + * Licensed 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. + */ 'use strict'; angular.module('zeppelinWebApp').directive('dropdownInput', function () { http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/directives/ngdelete.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/directives/ngdelete.js b/zeppelin-web/app/scripts/directives/ngdelete.js index c6967b8..9338952 100644 --- a/zeppelin-web/app/scripts/directives/ngdelete.js +++ b/zeppelin-web/app/scripts/directives/ngdelete.js @@ -1,3 +1,17 @@ +/* + * Licensed 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. + */ + 'use strict'; /** http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/directives/ngenter.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/directives/ngenter.js b/zeppelin-web/app/scripts/directives/ngenter.js index ed97b24..6fc4b73 100644 --- a/zeppelin-web/app/scripts/directives/ngenter.js +++ b/zeppelin-web/app/scripts/directives/ngenter.js @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/directives/popover-html-unsafe.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/directives/popover-html-unsafe.js b/zeppelin-web/app/scripts/directives/popover-html-unsafe.js index 95eeb20..8a84daa 100644 --- a/zeppelin-web/app/scripts/directives/popover-html-unsafe.js +++ b/zeppelin-web/app/scripts/directives/popover-html-unsafe.js @@ -1,3 +1,16 @@ +/* + * Licensed 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. + */ 'use strict'; angular.module('zeppelinWebApp') http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/scripts/directives/resizable.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/directives/resizable.js b/zeppelin-web/app/scripts/directives/resizable.js index dc92308..fe46a24 100644 --- a/zeppelin-web/app/scripts/directives/resizable.js +++ b/zeppelin-web/app/scripts/directives/resizable.js @@ -1,3 +1,16 @@ +/* + * Licensed 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. + */ 'use strict'; angular.module('zeppelinWebApp').directive('resizable', function () { http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/custom-font.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/custom-font.css b/zeppelin-web/app/styles/custom-font.css index 040ba23..91d3f01 100644 --- a/zeppelin-web/app/styles/custom-font.css +++ b/zeppelin-web/app/styles/custom-font.css @@ -1,3 +1,17 @@ +/* + * Licensed 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. + */ + @font-face { font-family: 'CustomFont'; src: url('../fonts/custom-font.eot') format('embedded-opentype'), url('../fonts/custom-font.woff') format('woff'), url('../fonts/custom-font.ttf') format('truetype'), url('../fonts/custom-font.svg') format('svg'); http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/interpreter.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/interpreter.css b/zeppelin-web/app/styles/interpreter.css index 41704c7..1dcc52b 100644 --- a/zeppelin-web/app/styles/interpreter.css +++ b/zeppelin-web/app/styles/interpreter.css @@ -1,3 +1,17 @@ +/* + * Licensed 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. + */ + .interpreterHead { margin-left: -10px; margin-right: -10px; http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/looknfeel/default.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/looknfeel/default.css b/zeppelin-web/app/styles/looknfeel/default.css index 5a36f9d..8aeee95 100644 --- a/zeppelin-web/app/styles/looknfeel/default.css +++ b/zeppelin-web/app/styles/looknfeel/default.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/looknfeel/report.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/looknfeel/report.css b/zeppelin-web/app/styles/looknfeel/report.css index 6a1d8d5..84f86d0 100644 --- a/zeppelin-web/app/styles/looknfeel/report.css +++ b/zeppelin-web/app/styles/looknfeel/report.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/looknfeel/simple.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/looknfeel/simple.css b/zeppelin-web/app/styles/looknfeel/simple.css index 678e0cf..9edb95e 100644 --- a/zeppelin-web/app/styles/looknfeel/simple.css +++ b/zeppelin-web/app/styles/looknfeel/simple.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/main.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/main.css b/zeppelin-web/app/styles/main.css index b060188..f9cbed8 100644 --- a/zeppelin-web/app/styles/main.css +++ b/zeppelin-web/app/styles/main.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/notebook.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/notebook.css b/zeppelin-web/app/styles/notebook.css index 344197a..e605534 100644 --- a/zeppelin-web/app/styles/notebook.css +++ b/zeppelin-web/app/styles/notebook.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/printMode.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/printMode.css b/zeppelin-web/app/styles/printMode.css index 92b906b..953b3a6 100644 --- a/zeppelin-web/app/styles/printMode.css +++ b/zeppelin-web/app/styles/printMode.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/styles/typography.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/styles/typography.css b/zeppelin-web/app/styles/typography.css index 2ac77dd..5050f19 100644 --- a/zeppelin-web/app/styles/typography.css +++ b/zeppelin-web/app/styles/typography.css @@ -1,5 +1,4 @@ -/* Copyright 2014 NFLabs - * +/* * Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/views/interpreter.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/views/interpreter.html b/zeppelin-web/app/views/interpreter.html index dbc3a82..2bd3fb3 100644 --- a/zeppelin-web/app/views/interpreter.html +++ b/zeppelin-web/app/views/interpreter.html @@ -1,6 +1,4 @@ <!-- -Copyright 2014 NFLabs - Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/views/main.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/views/main.html b/zeppelin-web/app/views/main.html index 4981a01..c6e8755 100644 --- a/zeppelin-web/app/views/main.html +++ b/zeppelin-web/app/views/main.html @@ -1,6 +1,4 @@ <!-- -Copyright 2014 NFLabs - Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/views/modal-shortcut.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/views/modal-shortcut.html b/zeppelin-web/app/views/modal-shortcut.html index 5d2da83..1fdf9ea 100644 --- a/zeppelin-web/app/views/modal-shortcut.html +++ b/zeppelin-web/app/views/modal-shortcut.html @@ -1,6 +1,4 @@ <!-- -Copyright 2014 NFLabs - Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/views/notebooks.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/views/notebooks.html b/zeppelin-web/app/views/notebooks.html index 49cecdd..f3294a1 100644 --- a/zeppelin-web/app/views/notebooks.html +++ b/zeppelin-web/app/views/notebooks.html @@ -1,6 +1,4 @@ <!-- -Copyright 2014 NFLabs - Licensed 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://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/669d408d/zeppelin-web/app/views/paragraph.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/views/paragraph.html b/zeppelin-web/app/views/paragraph.html index 96bf759..c77c85a 100644 --- a/zeppelin-web/app/views/paragraph.html +++ b/zeppelin-web/app/views/paragraph.html @@ -1,6 +1,4 @@ <!-- -Copyright 2014 NFLabs - Licensed 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