Jayaram Subramanian <[email protected]> writes:

> Hi All,
> I was analyzing the impact of removing the JDBCClient.isDB2Client()
> and BaseJDBCTestCase.usingDB2Client() from JUnit test cases. Following
> are some of the samples of usingDB2Client() references in the
> souce.... Could you please guide me on how to approach these scenarios

Hi Jayaram,

Here are my suggestions for how to handle these cases:

> functionTests/tests/derbyNet/NSSecurityMechanismTest.java
> ==========================================================
> private HashMap addRequiredAttributes(HashMap attrs)
>     {
>         String hostName = TestConfiguration.getCurrent().getHostName();
>         int port = TestConfiguration.getCurrent().getPort();
>         if (usingDB2Client())
>         {
>             //attrs.put("retrieveMessagesFromServerOnGetMessage","true");
>             attrs.put("driverType","4");
>             /**
>              * As per the fix of derby-410 servername should
>              * default to localhost, but for jcc it's still needed
>              */
>             attrs.put("serverName",hostName);
>         }

Remove the entire if statement. This test doesn't run against the DB2
client anymore, so it should be safe to remove that code.

> functionTEsts/tests/jdbcapi/BlobClob4BlobTest.java
> ============================================================
> private void checkException(String SQLState, SQLException se)
>             throws Exception
>     {
>         if (!usingDB2Client()) {
>             assertSQLState(SQLState, se);
>         }
>     }

Here I think we should remove the checkException() method altogether and
change the callers to use assertSQLState() directly.

> jdbcapi/ConcurrencyTests.java
> ===============================================================
> if (!usingDB2Client()) { // DB2 client does not support UR with Derby
>                 suite.addTest(new ConcurrencyTest ("testUpdatePurgedTuple2"));
>                 suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple3"));
>                 suite.addTest(new ConcurrencyTest("testUpdatePurgedTuple4"));

Always add these test cases without checking usingDB2Client() now that
we don't run this test against the DB2 client anymore.

> jdbcapi/DriverTest.java
> ============================================================
> if (usingDerbyNetClient())
>             protocol = protocol + TestConfiguration.getCurrent().getHostName()
>             + ":" + TestConfiguration.getCurrent().getPort() + "/";
>         else if (usingDB2Client())
>             protocol = protocol + "net:" +
>             TestConfiguration.getCurrent().getHostName() + ":" +

Remove the entire else if branch.

> tests/lang/TableFunctionTest.java
> ==============================================================
> if (usingDerbyNetClient())
>             protocol = protocol + TestConfiguration.getCurrent().getHostName()
>             + ":" + TestConfiguration.getCurrent().getPort() + "/";
>         else if (usingDB2Client())
>             protocol = protocol + "net:" +
>             TestConfiguration.getCurrent().getHostName() + ":" +

Same here. Remove the entire else if branch.

Hope this helps,

-- 
Knut Anders

Reply via email to