You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/08/18 10:29:45 UTC
[09/50] [abbrv] ambari git commit: AMBARI-18144. Fix Hive Jdbc Test
cases related to actor system. (Ashwin Rajeev via dipayanb)
AMBARI-18144. Fix Hive Jdbc Test cases related to actor system. (Ashwin Rajeev via dipayanb)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2f3da5f0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2f3da5f0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2f3da5f0
Branch: refs/heads/branch-dev-logsearch
Commit: 2f3da5f0227f49dd52d33709ff69a6189989b4a2
Parents: 3e3641d
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Tue Aug 16 10:45:56 2016 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
Committed: Tue Aug 16 10:46:33 2016 +0530
----------------------------------------------------------------------
.../apache/ambari/view/hive2/ConnectionFailuresTest.java | 9 +++------
.../java/org/apache/ambari/view/hive2/JobExecutionTest.java | 5 +----
2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2f3da5f0/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/ConnectionFailuresTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/ConnectionFailuresTest.java b/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/ConnectionFailuresTest.java
index 005eb76..e36c1d4 100644
--- a/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/ConnectionFailuresTest.java
+++ b/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/ConnectionFailuresTest.java
@@ -22,7 +22,6 @@ import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.testkit.JavaTestKit;
-import com.beust.jcommander.internal.Lists;
import com.google.common.base.Optional;
import org.apache.ambari.view.ViewContext;
import org.apache.ambari.view.hive2.actor.DeathWatch;
@@ -44,7 +43,6 @@ import org.apache.hive.jdbc.HiveQueryResultSet;
import org.apache.hive.jdbc.HiveStatement;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import java.sql.ResultSet;
@@ -58,7 +56,7 @@ public class ConnectionFailuresTest {
@Before
public void setUp() throws Exception {
- actorSystem = ActorSystem.create("TestingActorSystem");
+ actorSystem = ActorSystem.create("TestingActorSystem");
}
@After
@@ -67,7 +65,6 @@ public class ConnectionFailuresTest {
}
@Test
- @Ignore
public void testConnectionFailure() throws Exception {
ViewContext viewContext = createNiceMock(ViewContext.class);
ConnectionSupplier connectionSupplier = createNiceMock(ConnectionSupplier.class);
@@ -95,6 +92,7 @@ public class ConnectionFailuresTest {
expect(dataStorageSupplier.get(viewContext)).andReturn(storage);
expect(connectionSupplier.get(viewContext)).andReturn(delegate);
expect(storage.load(JobImpl.class, "1")).andReturn(jobImpl).anyTimes();
+ expect(jobImpl.getDateSubmitted()).andReturn(0L).times(1);
connectionWrapper.connect();
jobImpl.setStatus(Job.JOB_STATE_ERROR);
storage.store(JobImpl.class, jobImpl);
@@ -109,7 +107,6 @@ public class ConnectionFailuresTest {
}
@Test
- @Ignore
public void testExecutionFailure() throws Exception {
ViewContext viewContext = createNiceMock(ViewContext.class);
ConnectionSupplier connectionSupplier = createNiceMock(ConnectionSupplier.class);
@@ -138,7 +135,7 @@ public class ConnectionFailuresTest {
expect(storage.load(JobImpl.class, "1")).andReturn(jobImpl).anyTimes();
expect(delegate.createStatement(hiveConnection)).andReturn(statement);
expect(delegate.execute("select * from test")).andThrow(new SQLException("Syntax error"));
- expect(statement.getQueryLog()).andReturn(Lists.<String>newArrayList());
+ expect(jobImpl.getDateSubmitted()).andReturn(0L).times(2);
jobImpl.setStatus(Job.JOB_STATE_RUNNING);
storage.store(JobImpl.class, jobImpl);
connectionWrapper.connect();
http://git-wip-us.apache.org/repos/asf/ambari/blob/2f3da5f0/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/JobExecutionTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/JobExecutionTest.java b/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/JobExecutionTest.java
index c86bf41..fc042ce 100644
--- a/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/JobExecutionTest.java
+++ b/contrib/views/hive-next/src/test/java/org/apache/ambari/view/hive2/JobExecutionTest.java
@@ -25,7 +25,6 @@ import akka.testkit.JavaTestKit;
import com.beust.jcommander.internal.Lists;
import com.google.common.base.Optional;
import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.ConnectionDelegate;
import org.apache.ambari.view.hive2.actor.DeathWatch;
import org.apache.ambari.view.hive2.actor.OperationController;
import org.apache.ambari.view.hive2.actor.message.Connect;
@@ -45,13 +44,11 @@ import org.apache.hive.jdbc.HiveQueryResultSet;
import org.apache.hive.jdbc.HiveStatement;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import java.sql.ResultSet;
import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
public class JobExecutionTest {
@@ -68,7 +65,6 @@ public class JobExecutionTest {
}
@Test
- @Ignore
public void testExecuteJob() throws Exception {
ViewContext viewContext = createNiceMock(ViewContext.class);
ConnectionSupplier connectionSupplier = createNiceMock(ConnectionSupplier.class);
@@ -98,6 +94,7 @@ public class JobExecutionTest {
expect(delegate.createStatement(hiveConnection)).andReturn(statement);
expect(delegate.execute("select * from test")).andReturn(Optional.of(resultSet));
expect(statement.getQueryLog()).andReturn(Lists.<String>newArrayList());
+ expect(jobImpl.getDateSubmitted()).andReturn(0L).times(2);
jobImpl.setStatus(Job.JOB_STATE_RUNNING);
storage.store(JobImpl.class, jobImpl);
connectionWrapper.connect();