zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongy...@apache.org
Subject [01/49] zeppelin git commit: [ZEPPELIN-3740] Adopt `google-java-format` and `fmt-maven-plugin`
Date Sun, 26 Aug 2018 04:43:44 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master f71aca480 -> 55f6c91ca


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java
index 8dd83dd..132ec33 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java
@@ -17,6 +17,14 @@
 
 package org.apache.zeppelin.scheduler;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
 import org.apache.zeppelin.interpreter.AbstractInterpreterTest;
 import org.apache.zeppelin.interpreter.InterpreterContext;
 import org.apache.zeppelin.interpreter.InterpreterException;
@@ -30,15 +38,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 public class RemoteSchedulerTest extends AbstractInterpreterTest
     implements RemoteInterpreterProcessListener {
 
@@ -61,50 +60,54 @@ public class RemoteSchedulerTest extends AbstractInterpreterTest
 
   @Test
   public void test() throws Exception {
-    final RemoteInterpreter intpA = (RemoteInterpreter) interpreterSetting.getInterpreter("user1",
"note1", "mock");
+    final RemoteInterpreter intpA =
+        (RemoteInterpreter) interpreterSetting.getInterpreter("user1", "note1", "mock");
 
     intpA.open();
 
     Scheduler scheduler = intpA.getScheduler();
 
-    Job job = new Job("jobId", "jobName", null) {
-      Object results;
-
-      @Override
-      public Object getReturn() {
-        return results;
-      }
-
-      @Override
-      public int progress() {
-        return 0;
-      }
-
-      @Override
-      public Map<String, Object> info() {
-        return null;
-      }
-
-      @Override
-      protected Object jobRun() throws Throwable {
-        intpA.interpret("1000", InterpreterContext.builder()
-                .setNoteId("noteId")
-                .setParagraphId("jobId")
-                .setResourcePool(new LocalResourcePool("pool1"))
-                .build());
-        return "1000";
-      }
-
-      @Override
-      protected boolean jobAbort() {
-        return false;
-      }
-
-      @Override
-      public void setResult(Object results) {
-        this.results = results;
-      }
-    };
+    Job job =
+        new Job("jobId", "jobName", null) {
+          Object results;
+
+          @Override
+          public Object getReturn() {
+            return results;
+          }
+
+          @Override
+          public int progress() {
+            return 0;
+          }
+
+          @Override
+          public Map<String, Object> info() {
+            return null;
+          }
+
+          @Override
+          protected Object jobRun() throws Throwable {
+            intpA.interpret(
+                "1000",
+                InterpreterContext.builder()
+                    .setNoteId("noteId")
+                    .setParagraphId("jobId")
+                    .setResourcePool(new LocalResourcePool("pool1"))
+                    .build());
+            return "1000";
+          }
+
+          @Override
+          protected boolean jobAbort() {
+            return false;
+          }
+
+          @Override
+          public void setResult(Object results) {
+            this.results = results;
+          }
+        };
     scheduler.submit(job);
 
     int cycles = 0;
@@ -135,111 +138,115 @@ public class RemoteSchedulerTest extends AbstractInterpreterTest
 
   @Test
   public void testAbortOnPending() throws Exception {
-    final RemoteInterpreter intpA = (RemoteInterpreter) interpreterSetting.getInterpreter("user1",
"note1", "mock");
+    final RemoteInterpreter intpA =
+        (RemoteInterpreter) interpreterSetting.getInterpreter("user1", "note1", "mock");
     intpA.open();
 
     Scheduler scheduler = intpA.getScheduler();
 
-    Job job1 = new Job("jobId1", "jobName1", null) {
-      Object results;
-      InterpreterContext context = InterpreterContext.builder()
-          .setNoteId("noteId")
-          .setParagraphId("jobId1")
-          .setResourcePool(new LocalResourcePool("pool1"))
-          .build();
-
-      @Override
-      public Object getReturn() {
-        return results;
-      }
-
-      @Override
-      public int progress() {
-        return 0;
-      }
-
-      @Override
-      public Map<String, Object> info() {
-        return null;
-      }
-
-      @Override
-      protected Object jobRun() throws Throwable {
-        intpA.interpret("1000", context);
-        return "1000";
-      }
-
-      @Override
-      protected boolean jobAbort() {
-        if (isRunning()) {
-          try {
-            intpA.cancel(context);
-          } catch (InterpreterException e) {
-            e.printStackTrace();
+    Job job1 =
+        new Job("jobId1", "jobName1", null) {
+          Object results;
+          InterpreterContext context =
+              InterpreterContext.builder()
+                  .setNoteId("noteId")
+                  .setParagraphId("jobId1")
+                  .setResourcePool(new LocalResourcePool("pool1"))
+                  .build();
+
+          @Override
+          public Object getReturn() {
+            return results;
           }
-        }
-        return true;
-      }
-
-      @Override
-      public void setResult(Object results) {
-        this.results = results;
-      }
-    };
-
-    Job job2 = new Job("jobId2", "jobName2", null) {
-      public Object results;
-      InterpreterContext context = InterpreterContext.builder()
-          .setNoteId("noteId")
-          .setParagraphId("jobId2")
-          .setResourcePool(new LocalResourcePool("pool1"))
-          .build();
-
-      @Override
-      public Object getReturn() {
-        return results;
-      }
-
-      @Override
-      public int progress() {
-        return 0;
-      }
-
-      @Override
-      public Map<String, Object> info() {
-        return null;
-      }
-
-      @Override
-      protected Object jobRun() throws Throwable {
-        intpA.interpret("1000", context);
-        return "1000";
-      }
-
-      @Override
-      protected boolean jobAbort() {
-        if (isRunning()) {
-          try {
-            intpA.cancel(context);
-          } catch (InterpreterException e) {
-            e.printStackTrace();
+
+          @Override
+          public int progress() {
+            return 0;
           }
-        }
-        return true;
-      }
 
-      @Override
-      public void setResult(Object results) {
-        this.results = results;
-      }
-    };
+          @Override
+          public Map<String, Object> info() {
+            return null;
+          }
+
+          @Override
+          protected Object jobRun() throws Throwable {
+            intpA.interpret("1000", context);
+            return "1000";
+          }
+
+          @Override
+          protected boolean jobAbort() {
+            if (isRunning()) {
+              try {
+                intpA.cancel(context);
+              } catch (InterpreterException e) {
+                e.printStackTrace();
+              }
+            }
+            return true;
+          }
+
+          @Override
+          public void setResult(Object results) {
+            this.results = results;
+          }
+        };
+
+    Job job2 =
+        new Job("jobId2", "jobName2", null) {
+          public Object results;
+          InterpreterContext context =
+              InterpreterContext.builder()
+                  .setNoteId("noteId")
+                  .setParagraphId("jobId2")
+                  .setResourcePool(new LocalResourcePool("pool1"))
+                  .build();
+
+          @Override
+          public Object getReturn() {
+            return results;
+          }
+
+          @Override
+          public int progress() {
+            return 0;
+          }
+
+          @Override
+          public Map<String, Object> info() {
+            return null;
+          }
+
+          @Override
+          protected Object jobRun() throws Throwable {
+            intpA.interpret("1000", context);
+            return "1000";
+          }
+
+          @Override
+          protected boolean jobAbort() {
+            if (isRunning()) {
+              try {
+                intpA.cancel(context);
+              } catch (InterpreterException e) {
+                e.printStackTrace();
+              }
+            }
+            return true;
+          }
+
+          @Override
+          public void setResult(Object results) {
+            this.results = results;
+          }
+        };
 
     job2.setResult("result2");
 
     scheduler.submit(job1);
     scheduler.submit(job2);
 
-
     int cycles = 0;
     while (!job1.isRunning() && cycles < MAX_WAIT_CYCLES) {
       Thread.sleep(TICK_WAIT);
@@ -267,28 +274,27 @@ public class RemoteSchedulerTest extends AbstractInterpreterTest
   }
 
   @Override
-  public void onOutputAppend(String noteId, String paragraphId, int index, String output)
{
-
-  }
+  public void onOutputAppend(String noteId, String paragraphId, int index, String output)
{}
 
   @Override
-  public void onOutputUpdated(String noteId, String paragraphId, int index, InterpreterResult.Type
type, String output) {
-
-  }
+  public void onOutputUpdated(
+      String noteId, String paragraphId, int index, InterpreterResult.Type type, String output)
{}
 
   @Override
-  public void onOutputClear(String noteId, String paragraphId) {
-
-  }
+  public void onOutputClear(String noteId, String paragraphId) {}
 
   @Override
-  public void runParagraphs(String noteId, List<Integer> paragraphIndices, List<String>
paragraphIds, String curParagraphId) throws IOException {
-
-  }
+  public void runParagraphs(
+      String noteId,
+      List<Integer> paragraphIndices,
+      List<String> paragraphIds,
+      String curParagraphId)
+      throws IOException {}
 
   @Override
-  public void onParaInfosReceived(String noteId, String paragraphId,
-                                  String interpreterSettingId, Map<String, String>
metaInfos) {
-  }
-
+  public void onParaInfosReceived(
+      String noteId,
+      String paragraphId,
+      String interpreterSettingId,
+      Map<String, String> metaInfos) {}
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/CredentialsTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/CredentialsTest.java
b/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/CredentialsTest.java
index 84a1244..233d446 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/CredentialsTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/CredentialsTest.java
@@ -17,11 +17,10 @@
 
 package org.apache.zeppelin.user;
 
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
-
-import static org.junit.Assert.assertEquals;
+import org.junit.Test;
 
 public class CredentialsTest {
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/EncryptorTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/EncryptorTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/EncryptorTest.java
index 9950be6..aebf45a 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/EncryptorTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/user/EncryptorTest.java
@@ -17,13 +17,12 @@
 
 package org.apache.zeppelin.user;
 
-import java.io.IOException;
-
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 
+import java.io.IOException;
+import org.junit.Test;
+
 public class EncryptorTest {
 
   @Test

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/55f6c91c/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilTest.java
index 3c3ea48..004a2e4 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilTest.java
@@ -17,19 +17,20 @@
 
 package org.apache.zeppelin.util;
 
-import org.junit.Test;
 import static org.junit.Assert.assertNotNull;
 
+import org.junit.Test;
+
 public class UtilTest {
 
-    @Test
-    public void getVersionTest() {
-        assertNotNull(Util.getVersion());
-    }
+  @Test
+  public void getVersionTest() {
+    assertNotNull(Util.getVersion());
+  }
 
-    @Test
-    public void getGitInfoTest() {
-        assertNotNull(Util.getGitCommitId());
-        assertNotNull(Util.getGitTimestamp());
-    }
+  @Test
+  public void getGitInfoTest() {
+    assertNotNull(Util.getGitCommitId());
+    assertNotNull(Util.getGitTimestamp());
+  }
 }


Mime
View raw message