http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/com/cloudera/sqoop/testutil/LobAvroImportTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/com/cloudera/sqoop/testutil/LobAvroImportTestCase.java b/src/test/com/cloudera/sqoop/testutil/LobAvroImportTestCase.java index 468673f..7469799 100644 --- a/src/test/com/cloudera/sqoop/testutil/LobAvroImportTestCase.java +++ b/src/test/com/cloudera/sqoop/testutil/LobAvroImportTestCase.java @@ -18,7 +18,9 @@ package com.cloudera.sqoop.testutil; +import org.junit.After; import org.junit.FixMethodOrder; +import org.junit.Test; import org.junit.runners.MethodSorters; import java.io.IOException; import java.io.InputStream; @@ -39,6 +41,10 @@ import org.apache.hadoop.fs.Path; import org.apache.sqoop.io.CodecMap; import org.apache.sqoop.lib.BlobRef; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Tests BLOB/CLOB import for Avro. */ @@ -72,7 +78,7 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { return false; } - @Override + @After public void tearDown() { try { // Clean up the database on our way out. @@ -158,6 +164,7 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { * @throws IOException * @throws SQLException */ + @Test public void testBlobAvroImportInline() throws IOException, SQLException { String [] types = { getBlobType() }; String expectedVal = "This is short BLOB data"; @@ -185,6 +192,7 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { * @throws IOException * @throws SQLException */ + @Test public void testBlobAvroImportExternal() throws IOException, SQLException { String [] types = { getBlobType() }; String data = "This is short BLOB data"; @@ -234,6 +242,7 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { * @throws IOException * @throws SQLException */ + @Test public void testBlobCompressedAvroImportInline() throws IOException, SQLException { String [] types = { getBlobType() }; @@ -267,6 +276,7 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { * @throws IOException * @throws SQLException */ + @Test public void testBlobCompressedAvroImportExternal() throws IOException, SQLException { String [] types = { getBlobType() }; @@ -323,6 +333,7 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { * @throws IOException * @throws SQLException */ + @Test public void testBlobAvroImportMultiCols() throws IOException, SQLException { String [] types = { getBlobType(), getBlobType(), getBlobType(), }; String expectedVal1 = "This is short BLOB data1"; @@ -357,24 +368,29 @@ public abstract class LobAvroImportTestCase extends ImportJobTestCase { assertEquals(getColName(2), expectedVal3, returnVal); } + @Test public void testClobAvroImportInline() throws IOException, SQLException { // TODO: add tests for CLOB support for Avro import } + @Test public void testClobAvroImportExternal() throws IOException, SQLException { // TODO: add tests for CLOB support for Avro import } + @Test public void testClobCompressedAvroImportInline() throws IOException, SQLException { // TODO: add tests for CLOB support for Avro import } + @Test public void testClobCompressedAvroImportExternal() throws IOException, SQLException { // TODO: add tests for CLOB support for Avro import } + @Test public void testClobAvroImportMultiCols() throws IOException, SQLException { // TODO: add tests for CLOB support for Avro import }
http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java b/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java index ecbaa83..7db044c 100644 --- a/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java +++ b/src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java @@ -29,6 +29,12 @@ import org.apache.hadoop.io.BytesWritable; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Class that implements common tests that should be applied to all jdbc * drivers that we want to interop with. http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/com/cloudera/sqoop/tool/TestToolPlugin.java ---------------------------------------------------------------------- diff --git a/src/test/com/cloudera/sqoop/tool/TestToolPlugin.java b/src/test/com/cloudera/sqoop/tool/TestToolPlugin.java index 1793626..da1ef65 100644 --- a/src/test/com/cloudera/sqoop/tool/TestToolPlugin.java +++ b/src/test/com/cloudera/sqoop/tool/TestToolPlugin.java @@ -38,12 +38,15 @@ import com.cloudera.sqoop.cli.ToolOptions; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import junit.framework.TestCase; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Test that tool plugins work. */ -public class TestToolPlugin extends TestCase { +public class TestToolPlugin { public static final Log LOG = LogFactory .getLog(TestToolPlugin.class.getName()); @@ -102,6 +105,7 @@ public class TestToolPlugin extends TestCase { } } + @Test public void testPlugin() { // Register the plugin with SqoopTool. Configuration pluginConf = new Configuration(); @@ -132,6 +136,7 @@ public class TestToolPlugin extends TestCase { } } + @Test public void testNoOverrideTools() { // Test that you can't override an existing tool definition. First // registration of a tool name wins. http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/com/cloudera/sqoop/util/TestOptionsFileExpansion.java ---------------------------------------------------------------------- diff --git a/src/test/com/cloudera/sqoop/util/TestOptionsFileExpansion.java b/src/test/com/cloudera/sqoop/util/TestOptionsFileExpansion.java index 3f0bfb9..6d3f0f3 100644 --- a/src/test/com/cloudera/sqoop/util/TestOptionsFileExpansion.java +++ b/src/test/com/cloudera/sqoop/util/TestOptionsFileExpansion.java @@ -22,15 +22,15 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; -import junit.framework.TestCase; - import org.junit.Assert; import com.cloudera.sqoop.Sqoop; +import org.junit.Test; + /** * Tests various options file loading scenarios. */ -public class TestOptionsFileExpansion extends TestCase { +public class TestOptionsFileExpansion { /** * Text from options file 1. Each string represents a new line. @@ -141,17 +141,20 @@ public class TestOptionsFileExpansion extends TestCase { "--efgh", }; + @Test public void testOptionsFiles() throws Exception { checkOptionsFile(OPTIONS_FILE_TEXT1, OPTIONS_FILE_TEXT1_OUTPUT); checkOptionsFile(OPTIONS_FILE_TEXT2, OPTIONS_FILE_TEXT2_OUTPUT); checkOptionsFile(OPTIONS_FILE_TEXT3, OPTIONS_FILE_TEXT3_OUTPUT); } + @Test public void testInvalidOptionsFile() { checkInvalidOptionsFile(OPTIONS_FILE_TEXT4); checkInvalidOptionsFile(OPTIONS_FILE_TEXT5); } + @Test public void testMultilineQuotedText() { try { checkOptionsFile(OPTIONS_FILE_TEXT6, new String[] {}); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/com/cloudera/sqoop/util/TestSubstitutionUtils.java ---------------------------------------------------------------------- diff --git a/src/test/com/cloudera/sqoop/util/TestSubstitutionUtils.java b/src/test/com/cloudera/sqoop/util/TestSubstitutionUtils.java index cd13adc..b6b072f 100644 --- a/src/test/com/cloudera/sqoop/util/TestSubstitutionUtils.java +++ b/src/test/com/cloudera/sqoop/util/TestSubstitutionUtils.java @@ -17,14 +17,17 @@ */ package com.cloudera.sqoop.util; -import junit.framework.TestCase; import org.apache.sqoop.util.SubstitutionUtils; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; /** * */ -public class TestSubstitutionUtils extends TestCase { +public class TestSubstitutionUtils { + @Test public void testRemoveEscapeCharacters() { assertEquals("\\N", SubstitutionUtils.removeEscapeCharacters("\\\\N")); assertEquals("\n", SubstitutionUtils.removeEscapeCharacters("\\n")); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/TestAutoResetMapper.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/TestAutoResetMapper.java b/src/test/org/apache/sqoop/TestAutoResetMapper.java index 4c8282c..fd29c2d 100644 --- a/src/test/org/apache/sqoop/TestAutoResetMapper.java +++ b/src/test/org/apache/sqoop/TestAutoResetMapper.java @@ -37,6 +37,10 @@ import org.junit.After; import org.junit.Before; import com.cloudera.sqoop.testutil.ImportJobTestCase; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; public class TestAutoResetMapper extends ImportJobTestCase { @@ -140,6 +144,7 @@ public class TestAutoResetMapper extends ImportJobTestCase { super.tearDown(); } + @Test public void testMultiTableImportWithAutoMapperReset() throws IOException { String[] argv = getArgv(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/TestBigDecimalExport.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/TestBigDecimalExport.java b/src/test/org/apache/sqoop/TestBigDecimalExport.java index 80cdad5..414e3d9 100644 --- a/src/test/org/apache/sqoop/TestBigDecimalExport.java +++ b/src/test/org/apache/sqoop/TestBigDecimalExport.java @@ -35,6 +35,9 @@ import org.apache.hadoop.fs.Path; import com.cloudera.sqoop.testutil.CommonArgs; import com.cloudera.sqoop.testutil.ExportJobTestCase; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; /** * Test exporting lines that are created via both options of @@ -101,10 +104,12 @@ public class TestBigDecimalExport extends ExportJobTestCase { assertEquals(expected2, actual2); } + @Test public void testBigDecimalDefault() throws IOException, SQLException { runBigDecimalExport("0.000001,0.0000001"); } + @Test public void testBigDecimalNoFormat() throws IOException, SQLException { runBigDecimalExport("0.000001,1E-7"); } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/TestBigDecimalImport.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/TestBigDecimalImport.java b/src/test/org/apache/sqoop/TestBigDecimalImport.java index 76e4704..d265d17 100644 --- a/src/test/org/apache/sqoop/TestBigDecimalImport.java +++ b/src/test/org/apache/sqoop/TestBigDecimalImport.java @@ -30,6 +30,9 @@ import org.apache.hadoop.fs.Path; import com.cloudera.sqoop.testutil.CommonArgs; import com.cloudera.sqoop.testutil.ImportJobTestCase; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; /** * Test the sqoop.bigdecimal.format.string parameter default behavior and when @@ -70,11 +73,13 @@ public class TestBigDecimalImport extends ImportJobTestCase { return line; } + @Test public void testBigDecimalDefault() throws IOException { String line = runBigDecimalImport(null); assertEquals("0.000001,0.0000001", line); } + @Test public void testBigDecimalNoFormat() throws IOException { List<String> args = new ArrayList<String>(); args.add("-Dsqoop.bigdecimal.format.string=false"); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/TestExportUsingProcedure.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/TestExportUsingProcedure.java b/src/test/org/apache/sqoop/TestExportUsingProcedure.java index 8182c8d..b4b46f2 100644 --- a/src/test/org/apache/sqoop/TestExportUsingProcedure.java +++ b/src/test/org/apache/sqoop/TestExportUsingProcedure.java @@ -29,8 +29,6 @@ import java.sql.Statement; import java.sql.Time; import java.sql.Types; -import junit.framework.JUnit4TestAdapter; -import org.apache.commons.lang.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.sqoop.manager.GenericJdbcManager; import org.apache.sqoop.tool.ExportTool; @@ -41,17 +39,18 @@ import org.junit.Before; import com.cloudera.sqoop.SqoopOptions; import com.cloudera.sqoop.TestExport; import org.junit.Rule; +import org.junit.rules.TestName; + +import static org.junit.Assert.assertEquals; + import org.junit.Test; import org.junit.rules.ExpectedException; -import org.junit.rules.TestName; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; + /** * We'll use H2 as a database as the version of HSQLDB we currently depend on * (1.8) doesn't include support for stored procedures. */ -@RunWith(JUnit4.class) public class TestExportUsingProcedure extends TestExport { private static final String PROCEDURE_NAME = "INSERT_PROCEDURE"; /** @@ -62,6 +61,8 @@ public class TestExportUsingProcedure extends TestExport { private String[] names; private String[] types; private Connection connection; + @Rule + public TestName name = new TestName(); @Rule public ExpectedException thrown = ExpectedException.none(); @@ -70,11 +71,6 @@ public class TestExportUsingProcedure extends TestExport { public TestName testName = new TestName(); @Override - public String getName() { - return testName.getMethodName(); - } - - @Override @Before public void setUp() { super.setUp(); @@ -104,7 +100,7 @@ public class TestExportUsingProcedure extends TestExport { create.append(getClass().getName()); create.append(".insertFunction"); if (extraNames.length > 0) { - create.append(getName()); + create.append(name.getMethodName()); } create.append('"'); @@ -121,7 +117,7 @@ public class TestExportUsingProcedure extends TestExport { @Override protected String getConnectString() { - return "jdbc:h2:mem:" + getName(); + return "jdbc:h2:mem:" + name.getMethodName(); } @Override @@ -139,7 +135,7 @@ public class TestExportUsingProcedure extends TestExport { // just use the old class definition even though we've compiled a // new one! String[] args = newStrArray(additionalArgv, "--" + ExportTool.CALL_ARG, - PROCEDURE_NAME, "--" + ExportTool.CLASS_NAME_ARG, getName(), "--" + PROCEDURE_NAME, "--" + ExportTool.CLASS_NAME_ARG, name.getMethodName(), "--" + ExportTool.CONN_MANAGER_CLASS_NAME, GenericJdbcManager.class.getName(), "--" + ExportTool.DRIVER_ARG, Driver.class.getName()); @@ -272,6 +268,7 @@ public class TestExportUsingProcedure extends TestExport { } } + public static void insertFunction(int id, String msg) throws SQLException { insertFunction(id, msg, new SetExtraArgs() { @Override @@ -338,9 +335,4 @@ public class TestExportUsingProcedure extends TestExport { }); } - //workaround: ant kept falling back to JUnit3 - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(TestExportUsingProcedure.class); - } - } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/TestSqoopJobDataPublisher.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/TestSqoopJobDataPublisher.java b/src/test/org/apache/sqoop/TestSqoopJobDataPublisher.java index e9698be..fb89a0b 100644 --- a/src/test/org/apache/sqoop/TestSqoopJobDataPublisher.java +++ b/src/test/org/apache/sqoop/TestSqoopJobDataPublisher.java @@ -27,21 +27,28 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.Path; import org.apache.sqoop.config.ConfigurationConstants; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + public class TestSqoopJobDataPublisher extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog(TestSqoopJobDataPublisher.class.getName()); + @Before public void setUp() { super.setUp(); HiveImport.setTestMode(true); } + @After public void tearDown() { super.tearDown(); HiveImport.setTestMode(false); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/TestSqoopOptions.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/TestSqoopOptions.java b/src/test/org/apache/sqoop/TestSqoopOptions.java index fdb8c8d..6d55c33 100644 --- a/src/test/org/apache/sqoop/TestSqoopOptions.java +++ b/src/test/org/apache/sqoop/TestSqoopOptions.java @@ -20,11 +20,16 @@ package org.apache.sqoop; import java.util.Properties; -import junit.framework.TestCase; +import org.junit.Test; -public class TestSqoopOptions extends TestCase { +import static org.junit.Assert.assertEquals; + +public class TestSqoopOptions { + + @Test public void testParseColumnParsing() { new SqoopOptions() { + @Test public void testParseColumnMapping() { Properties result = new Properties(); parseColumnMapping("test=INTEGER,test1=DECIMAL(1%2C1),test2=NUMERIC(1%2C%202)", result); @@ -35,6 +40,7 @@ public class TestSqoopOptions extends TestCase { }.testParseColumnMapping(); } + @Test public void testColumnNameCaseInsensitive() { SqoopOptions opts = new SqoopOptions(); opts.setColumns(new String[]{ "AAA", "bbb" }); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java b/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java index 9000f5d..95c9b56 100644 --- a/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java +++ b/src/test/org/apache/sqoop/accumulo/AccumuloTestCase.java @@ -52,6 +52,10 @@ import org.junit.Before; import com.cloudera.sqoop.testutil.HsqldbTestServer; import com.cloudera.sqoop.testutil.ImportJobTestCase; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + /** * Utility methods that facilitate Accumulo import tests. * These test use the MiniAccumuloCluster. They are http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/accumulo/TestAccumuloImport.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/accumulo/TestAccumuloImport.java b/src/test/org/apache/sqoop/accumulo/TestAccumuloImport.java index d52f0f0..db78a19 100644 --- a/src/test/org/apache/sqoop/accumulo/TestAccumuloImport.java +++ b/src/test/org/apache/sqoop/accumulo/TestAccumuloImport.java @@ -22,6 +22,8 @@ import java.io.IOException; import org.junit.Test; +import static org.junit.Assert.fail; + /** * Test imports of tables into Accumulo. */ http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/accumulo/TestAccumuloQueryImport.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/accumulo/TestAccumuloQueryImport.java b/src/test/org/apache/sqoop/accumulo/TestAccumuloQueryImport.java index be73594..633ce06 100644 --- a/src/test/org/apache/sqoop/accumulo/TestAccumuloQueryImport.java +++ b/src/test/org/apache/sqoop/accumulo/TestAccumuloQueryImport.java @@ -22,6 +22,8 @@ import java.io.IOException; import org.junit.Test; +import static org.junit.Assert.fail; + /** * Test import of free-form query into Accumulo. */ http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/accumulo/TestAccumuloUtil.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/accumulo/TestAccumuloUtil.java b/src/test/org/apache/sqoop/accumulo/TestAccumuloUtil.java index c236b8a..631eeff 100644 --- a/src/test/org/apache/sqoop/accumulo/TestAccumuloUtil.java +++ b/src/test/org/apache/sqoop/accumulo/TestAccumuloUtil.java @@ -20,14 +20,15 @@ package org.apache.sqoop.accumulo; import org.junit.Test; -import junit.framework.TestCase; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * This tests to verify that Accumulo is present (default when running * test cases) and that when in fake not present mode, the method returns * false. */ -public class TestAccumuloUtil extends TestCase { +public class TestAccumuloUtil { @Test public void testAccumuloPresent() { http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/credentials/TestPassingSecurePassword.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/credentials/TestPassingSecurePassword.java b/src/test/org/apache/sqoop/credentials/TestPassingSecurePassword.java index 5b170b6..bd911f2 100644 --- a/src/test/org/apache/sqoop/credentials/TestPassingSecurePassword.java +++ b/src/test/org/apache/sqoop/credentials/TestPassingSecurePassword.java @@ -34,6 +34,7 @@ import org.apache.sqoop.util.password.CredentialProviderHelper; import org.apache.sqoop.util.password.CredentialProviderPasswordLoader; import org.apache.sqoop.util.password.CryptoFileLoader; import org.apache.sqoop.util.password.PasswordLoader; +import org.junit.Test; import javax.crypto.Cipher; import javax.crypto.SecretKey; @@ -50,6 +51,12 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Properties; +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 static org.junit.Assert.fail; + /** * Set of tests for securing passwords. */ @@ -67,6 +74,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testPasswordFilePathInOptionIsEnabled() throws Exception { String passwordFilePath = TEMP_BASE_DIR + ".pwd"; createTempFile(passwordFilePath); @@ -87,6 +95,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testPasswordFileDoesNotExist() throws Exception { try { ArrayList<String> extraArgs = new ArrayList<String>(); @@ -105,6 +114,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testPasswordFileIsADirectory() throws Exception { try { ArrayList<String> extraArgs = new ArrayList<String>(); @@ -123,6 +133,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testBothPasswordOptions() throws Exception { String passwordFilePath = TEMP_BASE_DIR + ".pwd"; createTempFile(passwordFilePath); @@ -151,6 +162,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testPasswordFilePath() throws Exception { String passwordFilePath = TEMP_BASE_DIR + ".pwd"; createTempFile(passwordFilePath); @@ -176,6 +188,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testPasswordInDBConfiguration() throws Exception { JobConf jobConf = new JobConf(getConf()); DBConfiguration.configureDB(jobConf, "org.hsqldb.jdbcDriver", @@ -195,6 +208,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { assertNotNull(connection); } + @Test public void testPasswordNotInJobConf() throws Exception { JobConf jobConf = new JobConf(getConf()); DBConfiguration.configureDB(jobConf, "org.hsqldb.jdbcDriver", @@ -203,6 +217,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { assertNull(jobConf.get(DBConfiguration.PASSWORD_PROPERTY, null)); } + @Test public void testPasswordInMetastoreWithRecordEnabledAndSecureOption() throws Exception { String passwordFilePath = TEMP_BASE_DIR + ".pwd"; @@ -239,6 +254,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { assertEquals(passwordFilePath, optionsFromMetastore.getPasswordFilePath()); } + @Test public void testPasswordInMetastoreWithRecordDisabledAndSecureOption() throws Exception { String passwordFilePath = TEMP_BASE_DIR + ".pwd"; @@ -274,6 +290,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { assertEquals(passwordFilePath, optionsFromMetastore.getPasswordFilePath()); } + @Test public void testPasswordInMetastoreWithRecordEnabledAndNonSecureOption() throws Exception { ArrayList<String> extraArgs = new ArrayList<String>(); @@ -328,6 +345,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { return args.toArray(new String[0]); } + @Test public void testCryptoFileLoader() throws Exception { // Current implementation is limited to ECB mode Object[][] ciphers = { @@ -358,6 +376,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testCredentialProviderLoader() throws Exception { CredentialProviderPasswordLoader pl = new CredentialProviderPasswordLoader(); @@ -403,6 +422,7 @@ public class TestPassingSecurePassword extends BaseSqoopTestCase { } } + @Test public void testPasswordAliasOption() throws Exception { CredentialProviderPasswordLoader pl = new CredentialProviderPasswordLoader(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java b/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java index 5ef9b2b..32add56 100644 --- a/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java +++ b/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java @@ -33,7 +33,6 @@ import java.util.Map; import java.util.TimeZone; import com.cloudera.sqoop.SqoopOptions; -import junit.framework.JUnit4TestAdapter; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -52,13 +51,13 @@ import com.cloudera.sqoop.testutil.ExportJobTestCase; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Test that we can export HCatalog tables into databases. */ -@RunWith(JUnit4.class) public class HCatalogExportTest extends ExportJobTestCase { private static final Log LOG = LogFactory.getLog(HCatalogExportTest.class); @@ -68,7 +67,6 @@ public class HCatalogExportTest extends ExportJobTestCase { public ExpectedException exception = ExpectedException.none(); @Before - @Override public void setUp() { super.setUp(); try { @@ -563,8 +561,4 @@ public class HCatalogExportTest extends ExportJobTestCase { utils.launchHCatCli(createViewCmd); } - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(HCatalogImportTest.class); - } - } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/hcat/HCatalogImportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/hcat/HCatalogImportTest.java b/src/test/org/apache/sqoop/hcat/HCatalogImportTest.java index 28f83f2..d784a20 100644 --- a/src/test/org/apache/sqoop/hcat/HCatalogImportTest.java +++ b/src/test/org/apache/sqoop/hcat/HCatalogImportTest.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Map; import java.util.TimeZone; -import junit.framework.JUnit4TestAdapter; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -61,13 +61,14 @@ import com.cloudera.sqoop.tool.SqoopTool; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Test that we can export HCatalog tables into databases. */ -@RunWith(JUnit4.class) public class HCatalogImportTest extends ImportJobTestCase { private static final Log LOG = LogFactory.getLog(HCatalogImportTest.class); @@ -1070,7 +1071,4 @@ public class HCatalogImportTest extends ImportJobTestCase { utils.launchHCatCli(createViewCmd); } - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(HCatalogImportTest.class); - } } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/hcat/TestHCatalogBasic.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/hcat/TestHCatalogBasic.java b/src/test/org/apache/sqoop/hcat/TestHCatalogBasic.java index d3337c7..71a371d 100644 --- a/src/test/org/apache/sqoop/hcat/TestHCatalogBasic.java +++ b/src/test/org/apache/sqoop/hcat/TestHCatalogBasic.java @@ -18,25 +18,22 @@ package org.apache.sqoop.hcat; -import junit.framework.JUnit4TestAdapter; -import junit.framework.TestCase; - import org.junit.Before; import com.cloudera.sqoop.SqoopOptions; import com.cloudera.sqoop.tool.ExportTool; import com.cloudera.sqoop.tool.ImportTool; -import org.junit.Rule; + import org.junit.Test; + +import org.junit.Rule; import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; /** * Test basic HCatalog related features. */ -@RunWith(JUnit4.class) -public class TestHCatalogBasic extends TestCase { +public class TestHCatalogBasic { + private static ImportTool importTool; private static ExportTool exportTool; @@ -44,7 +41,6 @@ public class TestHCatalogBasic extends TestCase { public ExpectedException thrown = ExpectedException.none(); @Before - @Override public void setUp() { importTool = new ImportTool(); exportTool = new ExportTool(); @@ -400,8 +396,4 @@ public class TestHCatalogBasic extends TestCase { importTool.validateOptions(opts); } - //workaround: ant kept falling back to JUnit3 - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(TestHCatalogBasic.class); - } } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/TestMainframeManager.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/TestMainframeManager.java b/src/test/org/apache/sqoop/manager/TestMainframeManager.java index 79cbcb1..9359ac4 100644 --- a/src/test/org/apache/sqoop/manager/TestMainframeManager.java +++ b/src/test/org/apache/sqoop/manager/TestMainframeManager.java @@ -44,6 +44,11 @@ import com.cloudera.sqoop.metastore.JobData; import com.cloudera.sqoop.testutil.BaseSqoopTestCase; import com.cloudera.sqoop.util.ImportException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + /** * Test methods of the generic SqlManager implementation. */ http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/TestSqlManager.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/TestSqlManager.java b/src/test/org/apache/sqoop/manager/TestSqlManager.java index 08413b0..571ed50 100644 --- a/src/test/org/apache/sqoop/manager/TestSqlManager.java +++ b/src/test/org/apache/sqoop/manager/TestSqlManager.java @@ -26,13 +26,10 @@ import java.sql.SQLException; import org.junit.Test; import com.cloudera.sqoop.SqoopOptions; - -import junit.framework.TestCase; - /** * Test methods of the generic SqlManager implementation. */ -public class TestSqlManager extends TestCase { +public class TestSqlManager { @Test public void testFilteringSpecifiedColumnNamesWhenNoneSpecified() { http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/cubrid/CubridAuthTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/cubrid/CubridAuthTest.java b/src/test/org/apache/sqoop/manager/cubrid/CubridAuthTest.java index ed6ba3b..78103ec 100644 --- a/src/test/org/apache/sqoop/manager/cubrid/CubridAuthTest.java +++ b/src/test/org/apache/sqoop/manager/cubrid/CubridAuthTest.java @@ -36,6 +36,9 @@ import com.cloudera.sqoop.SqoopOptions; import com.cloudera.sqoop.manager.ConnManager; import com.cloudera.sqoop.testutil.ImportJobTestCase; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Test authentication. * http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/mysql/MySqlCallExportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/mysql/MySqlCallExportTest.java b/src/test/org/apache/sqoop/manager/mysql/MySqlCallExportTest.java index 420ab19..90dff97 100644 --- a/src/test/org/apache/sqoop/manager/mysql/MySqlCallExportTest.java +++ b/src/test/org/apache/sqoop/manager/mysql/MySqlCallExportTest.java @@ -38,6 +38,9 @@ import com.cloudera.sqoop.SqoopOptions; import com.cloudera.sqoop.manager.MySQLTestUtils; import com.cloudera.sqoop.testutil.CommonArgs; import com.cloudera.sqoop.testutil.ExportJobTestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; /** * Test free form query import with the MySQL db. @@ -51,13 +54,13 @@ public class MySqlCallExportTest extends ExportJobTestCase { private final String procName = "MYSQL_CALL_EXPORT_PROC"; private MySQLTestUtils mySQLTestUtils = new MySQLTestUtils(); - @Override + @Before public void setUp() { super.setUp(); createObjects(); } - @Override + @After public void tearDown() { try { Statement stmt = getManager().getConnection().createStatement(); @@ -194,6 +197,7 @@ public class MySqlCallExportTest extends ExportJobTestCase { } } + @Test public void testExportUsingProcedure() throws IOException, SQLException { String[] lines = { "0,textfield0,2002-12-29,3300", http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java b/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java index 8a6b6fe..7ecc929 100644 --- a/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java +++ b/src/test/org/apache/sqoop/manager/mysql/MySqlColumnEscapeImportTest.java @@ -28,12 +28,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; +import org.junit.After; +import org.junit.Test; import java.io.File; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; +import static org.junit.Assert.assertEquals; + public class MySqlColumnEscapeImportTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( @@ -63,7 +67,7 @@ public class MySqlColumnEscapeImportTest extends ImportJobTestCase { return "DROP TABLE IF EXISTS " + getManager().escapeTableName(table); } - @Override + @After public void tearDown() { try { dropTableIfExists(getTableName()); @@ -93,6 +97,7 @@ public class MySqlColumnEscapeImportTest extends ImportJobTestCase { return args.toArray(new String[0]); } + @Test public void testEscapeColumnWithDoubleQuote() throws IOException { String[] colNames = { "column\"withdoublequote" }; String[] types = { "VARCHAR(50)"}; http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaExportManualTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaExportManualTest.java b/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaExportManualTest.java index 92012c4..b48b379 100644 --- a/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaExportManualTest.java +++ b/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaExportManualTest.java @@ -29,6 +29,8 @@ import org.junit.Test; import com.cloudera.sqoop.SqoopOptions; +import static org.junit.Assert.fail; + /** * Test the DirectNetezzaManager implementation's exportJob() functionality. */ @@ -179,6 +181,7 @@ public class DirectNetezzaExportManualTest extends NetezzaExportManualTest { } + @Test public void testDifferentNullStrings() throws IOException, SQLException { ColumnGenerator[] extraCols = new ColumnGenerator[] { new NullColumnGenerator(), @@ -218,23 +221,27 @@ public class DirectNetezzaExportManualTest extends NetezzaExportManualTest { @Override + @Test public void testMultiMapTextExportWithStaging() throws IOException, SQLException { // disable this test as staging is not supported in direct mode } @Override + @Test public void testMultiTransactionWithStaging() throws IOException, SQLException { // disable this test as staging is not supported in direct mode } @Override + @Test public void testColumnsExport() throws IOException, SQLException { // disable this test as it is not supported in direct mode } @Override + @Test public void testSequenceFileExport() throws IOException, SQLException { // disable this test as it is not supported in direct mode } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatExportManualTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatExportManualTest.java b/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatExportManualTest.java index dbf9988..03cef89 100644 --- a/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatExportManualTest.java +++ b/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatExportManualTest.java @@ -34,6 +34,7 @@ import org.apache.sqoop.manager.NetezzaManager; import org.junit.Before; import com.cloudera.sqoop.SqoopOptions; +import org.junit.Test; /** * Test the DirectNetezzaManager implementation's hcatalog export functionality. @@ -88,6 +89,7 @@ public class DirectNetezzaHCatExportManualTest extends HCatalogExportTest { setUpNZ(); } + @Test public void testIntTypes() throws Exception { final int TOTAL_RECORDS = 1 * 10; String table = getTableName().toUpperCase(); @@ -110,6 +112,7 @@ public class DirectNetezzaHCatExportManualTest extends HCatalogExportTest { runHCatExport(addlArgsArray, TOTAL_RECORDS, table, cols); } + @Test public void testStringTypes() throws Exception { final int TOTAL_RECORDS = 1 * 10; String table = getTableName().toUpperCase(); @@ -125,6 +128,7 @@ public class DirectNetezzaHCatExportManualTest extends HCatalogExportTest { runHCatExport(addlArgsArray, TOTAL_RECORDS, table, cols); } + @Test public void testNumberTypes() throws Exception { final int TOTAL_RECORDS = 1 * 10; String table = getTableName().toUpperCase(); @@ -142,24 +146,31 @@ public class DirectNetezzaHCatExportManualTest extends HCatalogExportTest { // Disable the following tests for direct mode netezza connector + @Test public void testBinaryTypes() throws Exception { } + @Test public void testColumnProjection() throws Exception { } + @Test public void testStaticPartitioning() throws Exception { } + @Test public void testDynamicPartitioning() throws Exception { } + @Test public void testStaticAndDynamicPartitioning() throws Exception { } + @Test public void testSequenceFile() throws Exception { } + @Test public void testTextFile() throws Exception { } } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatImportManualTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatImportManualTest.java b/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatImportManualTest.java index cf56714..ed4ae19 100644 --- a/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatImportManualTest.java +++ b/src/test/org/apache/sqoop/manager/netezza/DirectNetezzaHCatImportManualTest.java @@ -34,6 +34,7 @@ import org.apache.sqoop.manager.NetezzaManager; import org.junit.Before; import com.cloudera.sqoop.SqoopOptions; +import org.junit.Test; /** * Test the DirectNetezzaManager implementation's hcatalog import functionality. @@ -88,6 +89,7 @@ public class DirectNetezzaHCatImportManualTest extends HCatalogImportTest { setUpNZ(); } + @Test public void testIntTypes() throws Exception { final int TOTAL_RECORDS = 1 * 10; String table = getTableName().toUpperCase(); @@ -111,6 +113,7 @@ public class DirectNetezzaHCatImportManualTest extends HCatalogImportTest { super.runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null); } + @Test public void testStringTypes() throws Exception { final int TOTAL_RECORDS = 1 * 10; String table = getTableName().toUpperCase(); @@ -127,6 +130,7 @@ public class DirectNetezzaHCatImportManualTest extends HCatalogImportTest { runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null); } + @Test public void testNumberTypes() throws Exception { final int TOTAL_RECORDS = 1 * 10; String table = getTableName().toUpperCase(); @@ -144,48 +148,63 @@ public class DirectNetezzaHCatImportManualTest extends HCatalogImportTest { } // Disable the following for direct mode tests + @Test public void testBinaryTypes() throws Exception { } + @Test public void testColumnProjection() throws Exception { } + @Test public void testColumnProjectionMissingPartKeys() throws Exception { } + @Test public void testStaticPartitioning() throws Exception { } + @Test public void testDynamicPartitioning() throws Exception { } + @Test public void testStaticAndDynamicPartitioning() throws Exception { } + @Test public void testSequenceFile() throws Exception { } + @Test public void testTextFile() throws Exception { } + @Test public void testTableCreation() throws Exception { } + @Test public void testTableCreationWithPartition() throws Exception { } + @Test public void testTableCreationWithStorageStanza() throws Exception { } + @Test public void testHiveDropDelims() throws Exception { } + @Test public void testHiveDelimsReplacement() throws Exception { } + @Test public void testDynamicKeyInMiddle() throws Exception { } + @Test public void testCreateTableWithPreExistingTable() throws Exception { } } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/netezza/NetezzaExportManualTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/netezza/NetezzaExportManualTest.java b/src/test/org/apache/sqoop/manager/netezza/NetezzaExportManualTest.java index 9ba65a8..79946c5 100644 --- a/src/test/org/apache/sqoop/manager/netezza/NetezzaExportManualTest.java +++ b/src/test/org/apache/sqoop/manager/netezza/NetezzaExportManualTest.java @@ -38,6 +38,8 @@ import com.cloudera.sqoop.TestExport; import com.cloudera.sqoop.testutil.BaseSqoopTestCase; import com.cloudera.sqoop.testutil.CommonArgs; +import static org.junit.Assert.fail; + /** * Test the Netezza implementation. * http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/netezza/NetezzaImportManualTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/netezza/NetezzaImportManualTest.java b/src/test/org/apache/sqoop/manager/netezza/NetezzaImportManualTest.java index 6a6ed0c..1adbbdb 100644 --- a/src/test/org/apache/sqoop/manager/netezza/NetezzaImportManualTest.java +++ b/src/test/org/apache/sqoop/manager/netezza/NetezzaImportManualTest.java @@ -45,6 +45,10 @@ import com.cloudera.sqoop.testutil.CommonArgs; import com.cloudera.sqoop.testutil.ImportJobTestCase; import com.cloudera.sqoop.util.FileListing; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Test the Netezza implementation. * http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/ExportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/ExportTest.java b/src/test/org/apache/sqoop/manager/oracle/ExportTest.java index 3752886..23b4c73 100644 --- a/src/test/org/apache/sqoop/manager/oracle/ExportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/ExportTest.java @@ -18,12 +18,12 @@ package org.apache.sqoop.manager.oracle; -import junit.framework.Assert; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import static org.junit.Assert.assertEquals; + /** * Test exporting data into Oracle. */ @@ -41,14 +41,14 @@ public class ExportTest extends OraOopTestCase { int retCode = TEST_CASE.runImport("TST_PRODUCT", TEST_CASE.getSqoopConf(), false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } @Test public void testProductExport() throws Exception { int retCode = TEST_CASE.runExportFromTemplateTable("TST_PRODUCT", "TST_PRODUCT_EXP", false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } @Test @@ -56,7 +56,7 @@ public class ExportTest extends OraOopTestCase { int retCode = TEST_CASE.runExportFromTemplateTable("TST_PRODUCT", "\"\"T5+_Pr#duct_Exp\"\"", false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } @AfterClass http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/ImportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/ImportTest.java b/src/test/org/apache/sqoop/manager/oracle/ImportTest.java index 5db9bc2..0002128 100644 --- a/src/test/org/apache/sqoop/manager/oracle/ImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/ImportTest.java @@ -18,14 +18,14 @@ package org.apache.sqoop.manager.oracle; -import junit.framework.Assert; - import org.apache.hadoop.conf.Configuration; import org.apache.sqoop.SqoopOptions; import org.apache.sqoop.manager.oracle.OraOopConstants. OraOopOracleDataChunkMethod; import org.junit.Test; +import static org.junit.Assert.assertEquals; + /** * Test import data from Oracle. */ @@ -38,7 +38,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT", getSqoopConf(), false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -55,7 +55,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_Pr OdUCT", getSqoopConf(), false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { System.clearProperty(SqoopOptions.ORACLE_ESCAPING_DISABLED); @@ -71,7 +71,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_PART", getSqoopConf(), false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -90,7 +90,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_PART", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -111,7 +111,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_PART", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -135,7 +135,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_PART", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -150,7 +150,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_SUBPART", getSqoopConf(), false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -169,7 +169,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_SUBPART", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -192,7 +192,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_SUBPART", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -213,7 +213,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_SUBPART", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -234,7 +234,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -249,7 +249,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("\"\"T5+_Pr#duct\"\"", getSqoopConf(), false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); @@ -268,7 +268,7 @@ public class ImportTest extends OraOopTestCase { try { int retCode = runImport("TST_PRODUCT_PART_IOT", sqoopConf, false); - Assert.assertEquals("Return code should be 0", 0, retCode); + assertEquals("Return code should be 0", 0, retCode); } finally { cleanupFolders(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/OraOopDataDrivenDBInputFormatConnectionCloseTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/OraOopDataDrivenDBInputFormatConnectionCloseTest.java b/src/test/org/apache/sqoop/manager/oracle/OraOopDataDrivenDBInputFormatConnectionCloseTest.java index 59b6e3a..8e31c3f 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OraOopDataDrivenDBInputFormatConnectionCloseTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OraOopDataDrivenDBInputFormatConnectionCloseTest.java @@ -19,7 +19,6 @@ package org.apache.sqoop.manager.oracle; import com.cloudera.sqoop.mapreduce.db.DBConfiguration; -import junit.framework.TestCase; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.JobContext; import org.junit.Before; @@ -38,7 +37,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class OraOopDataDrivenDBInputFormatConnectionCloseTest extends TestCase { +public class OraOopDataDrivenDBInputFormatConnectionCloseTest { private static final OraOopLog LOG = OraOopLogFactory.getLog( TestOraOopDataDrivenDBInputFormat.class.getName()); http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java b/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java index 3811e38..631e4f9 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java +++ b/src/test/org/apache/sqoop/manager/oracle/OraOopTestCase.java @@ -46,7 +46,7 @@ import org.apache.sqoop.manager.oracle.util.OracleData; import com.cloudera.sqoop.Sqoop; import com.cloudera.sqoop.manager.OracleUtils; -import junit.framework.Assert; +import static org.junit.Assert.assertEquals; /** * Base test case for OraOop to handle common functions. @@ -269,7 +269,7 @@ public abstract class OraOopTestCase { rowsImported = Integer.parseInt(matcher.group(2)); } } - Assert.assertEquals("Incorrect number of rows imported", rowsInTable, + assertEquals("Incorrect number of rows imported", rowsInTable, rowsImported); return retCode; } http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/OracleCallExportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleCallExportTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleCallExportTest.java index 1d3417a..a473f67 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleCallExportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleCallExportTest.java @@ -38,6 +38,7 @@ import com.cloudera.sqoop.SqoopOptions; import com.cloudera.sqoop.manager.OracleUtils; import com.cloudera.sqoop.testutil.CommonArgs; import com.cloudera.sqoop.testutil.ExportJobTestCase; +import org.junit.Test; /** * Test free form query import with the MySQL db. @@ -194,6 +195,7 @@ public class OracleCallExportTest extends ExportJobTestCase { statement.close(); } } + @Test public void testExportUsingProcedure() throws IOException, SQLException { String[] lines = { "0,textfield0,2002-12-29 08:40:00,3300", http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java index d428040..1e3b799 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleColumnEscapeImportTest.java @@ -28,12 +28,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; +import org.junit.After; +import org.junit.Test; import java.io.File; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; +import static org.junit.Assert.assertEquals; + public class OracleColumnEscapeImportTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( @@ -61,7 +65,7 @@ public class OracleColumnEscapeImportTest extends ImportJobTestCase { OracleUtils.dropTable(table, getManager()); } - @Override + @After public void tearDown() { try { OracleUtils.dropTable(getTableName(), getManager()); @@ -92,6 +96,7 @@ public class OracleColumnEscapeImportTest extends ImportJobTestCase { return args.toArray(new String[0]); } + @Test public void testRegexpReplaceEscapeWithSpecialCharacters() throws IOException { String [] types = { "VARCHAR(50)"}; String [] vals = { "'hello, world:'"}; http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java index e596646..2a908b3 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java @@ -29,6 +29,8 @@ import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IOUtils; +import org.junit.After; +import org.junit.Test; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -42,6 +44,8 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import static org.junit.Assert.assertEquals; + /** * Test free form query import with the Oracle db. */ @@ -75,7 +79,7 @@ public class OracleIncrementalImportTest extends ImportJobTestCase { /** the names of the tables we're creating. */ private List<String> tableNames; - @Override + @After public void tearDown() { // Clean up the database on our way out. for (String tableName : tableNames) { @@ -128,6 +132,7 @@ public class OracleIncrementalImportTest extends ImportJobTestCase { * Create a tables with a date column. Run incremental import on the table * with date column as check-column. */ + @Test public void testIncrementalImportWithLastModified() throws IOException { tableNames = new ArrayList<String>(); String [] types = { "INT", "VARCHAR(10)", "DATE", }; @@ -156,6 +161,7 @@ public class OracleIncrementalImportTest extends ImportJobTestCase { expectedVal, output); } + @Test public void testIncrementalImportWithLastModifiedTimestamp() throws IOException { tableNames = new ArrayList<String>(); String [] types = { "INT", "VARCHAR(10)", "TIMESTAMP", }; http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java b/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java index fc5f56b..6878608 100644 --- a/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java +++ b/src/test/org/apache/sqoop/manager/oracle/OracleSplitterTest.java @@ -30,6 +30,7 @@ import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IOUtils; +import org.junit.Test; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -43,6 +44,8 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import static org.junit.Assert.assertEquals; + /** * Test various custom splitters for Oracle. */ @@ -111,6 +114,7 @@ public class OracleSplitterTest extends ImportJobTestCase { return args.toArray(new String[0]); } + @Test public void testTimestampSplitter() throws IOException { tableNames = new ArrayList<String>(); String [] types = { "INT", "VARCHAR(10)", "TIMESTAMP", }; http://git-wip-us.apache.org/repos/asf/sqoop/blob/4a74b8bc/src/test/org/apache/sqoop/manager/oracle/TestOraOopJdbcUrl.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/manager/oracle/TestOraOopJdbcUrl.java b/src/test/org/apache/sqoop/manager/oracle/TestOraOopJdbcUrl.java index e842849..33f51af 100644 --- a/src/test/org/apache/sqoop/manager/oracle/TestOraOopJdbcUrl.java +++ b/src/test/org/apache/sqoop/manager/oracle/TestOraOopJdbcUrl.java @@ -17,9 +17,6 @@ */ package org.apache.sqoop.manager.oracle; - -import static org.junit.Assert.*; -import junit.framework.Assert; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -29,6 +26,10 @@ import org.junit.Test; import org.apache.sqoop.manager.oracle.OraOopUtilities. JdbcOracleThinConnectionParsingError; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * Unit tests for OraOopJdbcUrl. */ @@ -62,21 +63,21 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { // Null JDBC URL... try { actual = new OraOopJdbcUrl(null).parseJdbcOracleThinConnectionString(); - Assert.fail("An IllegalArgumentException should be been thrown."); + fail("An IllegalArgumentException should be been thrown."); } catch (IllegalArgumentException ex) { /* This is what we want to happen. */ } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail("An IllegalArgumentException should be been thrown."); + fail("An IllegalArgumentException should be been thrown."); } // Empty JDBC URL... try { actual = new OraOopJdbcUrl("").parseJdbcOracleThinConnectionString(); - Assert.fail("An IllegalArgumentException should be been thrown."); + fail("An IllegalArgumentException should be been thrown."); } catch (IllegalArgumentException ex) { /* This is what we want to happen. */ } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail("An IllegalArgumentException should be been thrown."); + fail("An IllegalArgumentException should be been thrown."); } // Incorrect number of fragments in the URL... @@ -84,7 +85,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { actual = new OraOopJdbcUrl("jdbc:oracle:oci8:@dbname.domain") .parseJdbcOracleThinConnectionString(); - Assert.fail( + fail( "A JdbcOracleThinConnectionParsingError should be been thrown."); } catch (JdbcOracleThinConnectionParsingError ex) { // This is what we want to happen. @@ -102,7 +103,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "jdbc:oracle:loremipsum:@hostname.domain.com.au:port1521:dbsid") .parseJdbcOracleThinConnectionString(); - Assert.fail( + fail( "A JdbcOracleThinConnectionParsingError should be been thrown."); } catch (JdbcOracleThinConnectionParsingError ex) { // This is what we want to happen. @@ -125,7 +126,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "jdbc:oracle:thin:@hostname.domain.com.au:port1521:dbsid") .parseJdbcOracleThinConnectionString(); - Assert.fail( + fail( "An JdbcOracleThinConnectionParsingError should be been thrown."); } catch (JdbcOracleThinConnectionParsingError ex) { assertTrue( @@ -139,7 +140,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "jdbc:oracle:thin:@hostname.domain.com.au:-1521:dbsid") .parseJdbcOracleThinConnectionString(); - Assert.fail( + fail( "An JdbcOracleThinConnectionParsingError should be been thrown."); } catch (JdbcOracleThinConnectionParsingError ex) { assertTrue( @@ -153,11 +154,11 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "JDBC:Oracle:tHiN:@hostname.domain.com.au:1521:dbsid") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname.domain.com.au", actual.getHost()); - Assert.assertEquals(1521, actual.getPort()); - Assert.assertEquals("dbsid", actual.getSid()); + assertEquals("hostname.domain.com.au", actual.getHost()); + assertEquals(1521, actual.getPort()); + assertEquals("dbsid", actual.getSid()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } // Valid JDBC URL... @@ -166,11 +167,11 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( " JDBC : Oracle : tHiN : @hostname.domain.com.au : 1529 : dbsid") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname.domain.com.au", actual.getHost()); - Assert.assertEquals(1529, actual.getPort()); - Assert.assertEquals("dbsid", actual.getSid()); + assertEquals("hostname.domain.com.au", actual.getHost()); + assertEquals(1529, actual.getPort()); + assertEquals("dbsid", actual.getSid()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } // Valid (sid-based) JDBC URL with parameters... @@ -179,12 +180,12 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "jdbc:oracle:thin:@hostname:1521:dbsid?param1=loremipsum") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname", actual.getHost()); - Assert.assertEquals(1521, actual.getPort()); - Assert.assertEquals("dbsid", actual.getSid()); - Assert.assertEquals(null, actual.getService()); + assertEquals("hostname", actual.getHost()); + assertEquals(1521, actual.getPort()); + assertEquals("dbsid", actual.getSid()); + assertEquals(null, actual.getService()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } // Valid (service-based) JDBC URL... @@ -193,12 +194,12 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "jdbc:oracle:thin:@hostname:1521/dbservice.dbdomain") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname", actual.getHost()); - Assert.assertEquals(1521, actual.getPort()); - Assert.assertEquals(null, actual.getSid()); - Assert.assertEquals("dbservice.dbdomain", actual.getService()); + assertEquals("hostname", actual.getHost()); + assertEquals(1521, actual.getPort()); + assertEquals(null, actual.getSid()); + assertEquals("dbservice.dbdomain", actual.getService()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } // Valid (service-based) JDBC URL with slashes... @@ -207,12 +208,12 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { new OraOopJdbcUrl( "jdbc:oracle:thin:@//hostname:1521/dbservice.dbdomain") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname", actual.getHost()); - Assert.assertEquals(1521, actual.getPort()); - Assert.assertEquals(null, actual.getSid()); - Assert.assertEquals("dbservice.dbdomain", actual.getService()); + assertEquals("hostname", actual.getHost()); + assertEquals(1521, actual.getPort()); + assertEquals(null, actual.getSid()); + assertEquals("dbservice.dbdomain", actual.getService()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } // Valid (service-based) JDBC URL with parameters... @@ -220,12 +221,12 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { actual = new OraOopJdbcUrl( "jdbc:oracle:thin:@hostname:1521/dbservice.dbdomain?param1=loremipsum") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname", actual.getHost()); - Assert.assertEquals(1521, actual.getPort()); - Assert.assertEquals(null, actual.getSid()); - Assert.assertEquals("dbservice.dbdomain", actual.getService()); + assertEquals("hostname", actual.getHost()); + assertEquals(1521, actual.getPort()); + assertEquals(null, actual.getSid()); + assertEquals("dbservice.dbdomain", actual.getService()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } // Valid (service-based) JDBC URL with slashes and parameters... @@ -233,12 +234,12 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { actual = new OraOopJdbcUrl( "jdbc:oracle:thin:@//hostname:1521/dbservice.dbdomain?param1=loremipsum") .parseJdbcOracleThinConnectionString(); - Assert.assertEquals("hostname", actual.getHost()); - Assert.assertEquals(1521, actual.getPort()); - Assert.assertEquals(null, actual.getSid()); - Assert.assertEquals("dbservice.dbdomain", actual.getService()); + assertEquals("hostname", actual.getHost()); + assertEquals(1521, actual.getPort()); + assertEquals(null, actual.getSid()); + assertEquals("dbservice.dbdomain", actual.getService()); } catch (JdbcOracleThinConnectionParsingError ex) { - Assert.fail(ex.getMessage()); + fail(ex.getMessage()); } } @@ -250,7 +251,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { // Null JDBC URL... try { actual = new OraOopJdbcUrl(null).getConnectionUrl(); - Assert.fail("An IllegalArgumentException should be been thrown."); + fail("An IllegalArgumentException should be been thrown."); } catch (IllegalArgumentException ex) { /* This is what we want to happen. */ } @@ -258,7 +259,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { // Empty JDBC URL... try { actual = new OraOopJdbcUrl("").getConnectionUrl(); - Assert.fail("An IllegalArgumentException should be been thrown."); + fail("An IllegalArgumentException should be been thrown."); } catch (IllegalArgumentException ex) { /* This is what we want to happen. */ } @@ -267,7 +268,7 @@ public class TestOraOopJdbcUrl extends OraOopTestCase { actual = new OraOopJdbcUrl("jdbc:oracle:thin:@hostname.domain:1521:dbsid") .getConnectionUrl(); - Assert.assertEquals("jdbc:oracle:thin:@hostname.domain:1521:dbsid", actual); + assertEquals("jdbc:oracle:thin:@hostname.domain:1521:dbsid", actual); }
