zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongy...@apache.org
Subject [02/50] [abbrv] zeppelin git commit: Revert "[ZEPPELIN-3740] Adopt `google-java-format` and `fmt-maven-plugin`"
Date Wed, 29 Aug 2018 10:06:58 GMT
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0d746fa2/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 132ec33..8dd83dd 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,14 +17,6 @@
 
 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;
@@ -38,6 +30,15 @@ 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 {
 
@@ -60,54 +61,50 @@ 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;
@@ -138,115 +135,111 @@ 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;
+    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();
           }
-
-          @Override
-          public int progress() {
-            return 0;
+        }
+        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 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;
-          }
-        };
+      @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);
@@ -274,27 +267,28 @@ 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/0d746fa2/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 233d446..84a1244 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,10 +17,11 @@
 
 package org.apache.zeppelin.user;
 
-import static org.junit.Assert.assertEquals;
+import org.junit.Test;
 
 import java.io.IOException;
-import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 public class CredentialsTest {
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0d746fa2/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 aebf45a..9950be6 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,12 +17,13 @@
 
 package org.apache.zeppelin.user;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-
 import java.io.IOException;
+
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
 public class EncryptorTest {
 
   @Test

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0d746fa2/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 004a2e4..3c3ea48 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,20 +17,19 @@
 
 package org.apache.zeppelin.util;
 
-import static org.junit.Assert.assertNotNull;
-
 import org.junit.Test;
+import static org.junit.Assert.assertNotNull;
 
 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