Repository: sqoop Updated Branches: refs/heads/sqoop2 3613843a7 -> 63a83f5b0
SQOOP-2700: Sqoop2: Tests in shell module are in infinite loop (Dian Fu via Jarek Jarcec Cecho) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/63a83f5b Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/63a83f5b Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/63a83f5b Branch: refs/heads/sqoop2 Commit: 63a83f5b0a04e968f4ac85f1e2481934fac199be Parents: 3613843 Author: Jarek Jarcec Cecho <[email protected]> Authored: Thu Nov 19 07:07:07 2015 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Thu Nov 19 07:07:07 2015 -0800 ---------------------------------------------------------------------- .../src/test/java/org/apache/sqoop/shell/TestCloneCommand.java | 3 ++- .../test/java/org/apache/sqoop/shell/TestCreateCommand.java | 6 +++++- .../test/java/org/apache/sqoop/shell/TestUpdateCommand.java | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/63a83f5b/shell/src/test/java/org/apache/sqoop/shell/TestCloneCommand.java ---------------------------------------------------------------------- diff --git a/shell/src/test/java/org/apache/sqoop/shell/TestCloneCommand.java b/shell/src/test/java/org/apache/sqoop/shell/TestCloneCommand.java index 7a139ba..eed27d7 100644 --- a/shell/src/test/java/org/apache/sqoop/shell/TestCloneCommand.java +++ b/shell/src/test/java/org/apache/sqoop/shell/TestCloneCommand.java @@ -79,7 +79,6 @@ public class TestCloneCommand { public void setup() throws IOException { Groovysh shell = new Groovysh(); cloneCmd = new CloneCommand(shell); - ShellEnvironment.setInteractive(false); ShellEnvironment.setIo(shell.getIo()); client = mock(SqoopClient.class); ShellEnvironment.setClient(client); @@ -104,6 +103,7 @@ public class TestCloneCommand { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testCloneLink() { + ShellEnvironment.setInteractive(false); MLink link = new MLink(1L, new MLinkConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>())); when(client.getLink("link_test")).thenReturn(link); when(client.getConnectorConfigBundle(1L)).thenReturn(new MapResourceBundle(new HashMap())); @@ -170,6 +170,7 @@ public class TestCloneCommand { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testCloneJob() { + ShellEnvironment.setInteractive(false); MJob job = new MJob(1L, 2L, 1L, 2L, new MFromConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>()), new MToConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>()), http://git-wip-us.apache.org/repos/asf/sqoop/blob/63a83f5b/shell/src/test/java/org/apache/sqoop/shell/TestCreateCommand.java ---------------------------------------------------------------------- diff --git a/shell/src/test/java/org/apache/sqoop/shell/TestCreateCommand.java b/shell/src/test/java/org/apache/sqoop/shell/TestCreateCommand.java index 0316a60..48f646b 100644 --- a/shell/src/test/java/org/apache/sqoop/shell/TestCreateCommand.java +++ b/shell/src/test/java/org/apache/sqoop/shell/TestCreateCommand.java @@ -79,7 +79,6 @@ public class TestCreateCommand { public void setup() throws IOException { Groovysh shell = new Groovysh(); createCmd = new CreateCommand(shell); - ShellEnvironment.setInteractive(false); ShellEnvironment.setIo(shell.getIo()); client = mock(SqoopClient.class); ShellEnvironment.setClient(client); @@ -103,6 +102,7 @@ public class TestCreateCommand { @Test public void testCreateLink() { + ShellEnvironment.setInteractive(false); when(client.getConnector("connector_test")).thenReturn(new MConnector("", "", "", null, null, null)); when(client.createLink("connector_test")).thenReturn(new MLink(1, new MLinkConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>()))); when(client.saveLink(any(MLink.class))).thenReturn(Status.OK); @@ -127,6 +127,7 @@ public class TestCreateCommand { @Test public void testCreateLinkWithNonExistingConnector() { + ShellEnvironment.setInteractive(false); when(client.getConnector(any(String.class))).thenThrow(new SqoopException(TestShellError.TEST_SHELL_0000, "Connector doesn't exist")); when(client.getConnector(any(Integer.class))).thenThrow(new SqoopException(TestShellError.TEST_SHELL_0000, "Connector doesn't exist")); @@ -176,6 +177,7 @@ public class TestCreateCommand { @Test public void testCreateJob() { + ShellEnvironment.setInteractive(false); MConnector fromConnector = new MConnector("connector_from", "", "", null, new MFromConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>()), null); MConnector toConnector = new MConnector("connector_to", "", "", null, null, new MToConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>())); when(client.createJob("link_from", "link_to")).thenReturn( @@ -202,6 +204,7 @@ public class TestCreateCommand { @Test public void testCreateJobWithNonExistingLink() { + ShellEnvironment.setInteractive(false); when(client.createJob("link_from", "link_to")).thenThrow(new SqoopException(TestShellError.TEST_SHELL_0000, "From link doesn't exist")); try { @@ -303,6 +306,7 @@ public class TestCreateCommand { @Test public void testCreateRole() { + ShellEnvironment.setInteractive(false); // create role -r role_test Status status = (Status) createCmd.execute(Arrays.asList(Constants.FN_ROLE, "-r", "role_test")); assertTrue(status != null && status == Status.OK); http://git-wip-us.apache.org/repos/asf/sqoop/blob/63a83f5b/shell/src/test/java/org/apache/sqoop/shell/TestUpdateCommand.java ---------------------------------------------------------------------- diff --git a/shell/src/test/java/org/apache/sqoop/shell/TestUpdateCommand.java b/shell/src/test/java/org/apache/sqoop/shell/TestUpdateCommand.java index d8f061a..9b3e87a 100644 --- a/shell/src/test/java/org/apache/sqoop/shell/TestUpdateCommand.java +++ b/shell/src/test/java/org/apache/sqoop/shell/TestUpdateCommand.java @@ -80,7 +80,6 @@ public class TestUpdateCommand { public void setup() throws IOException { Groovysh shell = new Groovysh(); updateCmd = new UpdateCommand(shell); - ShellEnvironment.setInteractive(false); ShellEnvironment.setIo(shell.getIo()); client = mock(SqoopClient.class); ShellEnvironment.setClient(client); @@ -105,6 +104,7 @@ public class TestUpdateCommand { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testUpdateLink() throws InterruptedException { + ShellEnvironment.setInteractive(false); MLink link = new MLink(1L, new MLinkConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>())); when(client.getLink("link_test")).thenReturn(link); when(client.getConnectorConfigBundle(1L)).thenReturn(new MapResourceBundle(new HashMap())); @@ -172,6 +172,7 @@ public class TestUpdateCommand { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testUpdateJob() throws InterruptedException { + ShellEnvironment.setInteractive(false); MJob job = new MJob(1L, 2L, 1L, 2L, new MFromConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>()), new MToConfig(new ArrayList<MConfig>(), new ArrayList<MValidator>()),
