[jira] [Commented] (DERBY-6945) Re-package Derby as a collection of jigsaw modules

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DERBY-6945) Re-package Derby as a collection of jigsaw modules

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/DERBY-6945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16612594#comment-16612594 ]

Rick Hillegas commented on DERBY-6945:
--------------------------------------

Attaching derby-6945-54-aa-driverAutoloading.diff. This patch makes the JUnit jdbcapi suite run (almost) cleanly with a module path.

AutoloadTest was failing at first. That was because JDBC driver autoloading didn't work with the module path. The fix was to make the engine and client module descriptors declare their autoloaded drivers as providers of the java.sql.Driver service.

One test still fails with the module path, but that test also fails identically with the classpath. I attribute the failure to an undiagnosed environmental problem:

{noformat}
There was 1 failure:
1) testInvalidLDAPServerConnectionError(org.apache.derbyTesting.functionTests.tests.jdbcapi.InvalidLDAPServerAuthenticationTest)junit.framework.AssertionFailedError
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.InvalidLDAPServerAuthenticationTest.testInvalidLDAPServerConnectionError(InvalidLDAPServerAuthenticationTest.java:126)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:122)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:443)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:460)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:58)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)

FAILURES!!!
Tests run: 2,  Failures: 1,  Errors: 0
{noformat}

With this patch and on the classpath, the regression tests passed cleanly modulo the error above and the other error which occurs when tests run at my current location:

{noformat}
There were 2 failures:
1) testPingWithWrongHost(org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest)junit.framework.AssertionFailedError: Could not find expectedString:Unable to find host in output:<STDOUT>Wed Sep 12 08:59:51 PDT 2018 : Could not connect to Derby Network Server on host nothere.invalid, port 1527: Operation timed out (Connection timed out)
<END STDOUT>
<STDERR><END STDERR>

        at org.apache.derbyTesting.junit.BaseTestCase.assertExecJavaCmdAsExpected(BaseTestCase.java:611)
        at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest.assertFailedPing(NetworkServerControlClientCommandTest.java:147)
        at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest.testPingWithWrongHost(NetworkServerControlClientCommandTest.java:112)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:122)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:443)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:460)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:58)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
2) testInvalidLDAPServerConnectionError(org.apache.derbyTesting.functionTests.tests.jdbcapi.InvalidLDAPServerAuthenticationTest)junit.framework.AssertionFailedError
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.InvalidLDAPServerAuthenticationTest.testInvalidLDAPServerConnectionError(InvalidLDAPServerAuthenticationTest.java:126)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:122)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:443)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:460)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:58)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)

FAILURES!!!
Tests run: 14030,  Failures: 2,  Errors: 0
{noformat}


Touches the following files:

{noformat}
---------------------------

M       java/org.apache.derby.client/module-info.java
M       java/org.apache.derby.engine/module-info.java

Declare the autoloaded drivers as providers of the java.sql.Driver service.

---------------------------

M       java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java

Add some debug information to this test.
{noformat}


> Re-package Derby as a collection of jigsaw modules
> --------------------------------------------------
>
>                 Key: DERBY-6945
>                 URL: https://issues.apache.org/jira/browse/DERBY-6945
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.13.1.2
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>            Priority: Major
>         Attachments: derby-6945-01-aa-remove_derbyPreBuild_dep.diff, derby-6945-02-ab-newDerbySharedJar.diff, derby-6945-02-ac-newDerbySharedJar.diff, derby-6945-03-aa-partitionTest.diff, derby-6945-04-aa-moveRunClass.diff, derby-6945-05-aa-removeRedundant_Attribute_SQLState.diff, derby-6945-06-aa-removeOtherSharedDuplicates.diff, derby-6945-07-aa-net_client_overlap.diff, derby-6945-08-aa-move_shared_iapi_under_shared.diff, derby-6945-08-ab-move_shared_iapi_under_shared.diff, derby-6945-08-ad-move_shared_iapi_under_shared.diff, derby-6945-09-ab-moveInternalDriver.diff, derby-6945-10-aa-moveDriver42.diff, derby-6945-11-ab-moveAutoloadedDriver.diff, derby-6945-12-ab-moveClientDataSourceInterface.diff, derby-6945-13-aa-create-ClientAutoloadedDriver.diff, derby-6945-14-aa-moveMoreEmbeddedClassesOutOfPublicAPI.diff, derby-6945-15-aa-moveMoreClientClassesOutOfPublicAPI.diff, derby-6945-16-aa-consolidatePublicAPI.diff, derby-6945-17-aa-resealPackagesIn-derbyshared.diff, derby-6945-18-aa-resealLocalizationPackage.diff, derby-6945-19-ad-movePublicAPIintoToolsJar.diff, derby-6945-20-aa-removeClasslister.diff, derby-6945-21-aa-simplifyBuildScripts.diff, derby-6945-21-ab-simplifyBuildScripts.diff, derby-6945-22-ad-isolateClassesByArtifact.diff, derby-6945-22-ae-isolateClassesByArtifact.diff, derby-6945-22-af-isolateClassesByArtifact.diff, derby-6945-23-aa-upgradeToAnt_1.10.2.diff, derby-6945-24-aa-fixNativeAuthenticationServiceTest.diff, derby-6945-25-ab-moduleDescriptors.diff, derby-6945-26-aa-packagePrivateTests.diff, derby-6945-27-aa-adjustModulesForTests.diff, derby-6945-28-aa-testingModuleDescriptor.diff, derby-6945-29-aa-disable-SimpleApp-test.diff, derby-6945-30-ab-move-clientmessages-toolsmessages.diff, derby-6945-31-aa-clientmessages-ResourceBundleProvider.diff, derby-6945-32-aa-messageLookupCleanup.diff, derby-6945-33-ab-moveLocalizations.diff, derby-6945-34-aa-licenseHeaders.diff, derby-6945-35-aa-removeSpuriousCharacter.diff, derby-6945-36-aa-moduleDescriptorsForLocaleJars.diff, derby-6945-38-aa-javadocCleanup.diff, derby-6945-39-aa-javadocCleanup.diff, derby-6945-40-aa-generatedSource-dirNames.diff, derby-6945-41-ac-cleanupProductJavadoc.diff, derby-6945-42-aa-cleanupTestJavadoc.diff, derby-6945-43-aa-cleanupPublicAPIforJavadoc.diff, derby-6945-44-aa-moduleAwareJavadoc.diff, derby-6945-45-aa-fixWarnings.diff, derby-6945-46-aa-jacocoSourceRoots.diff, derby-6945-47-aa-runModulesWithLocalizations.diff, derby-6945-48-ac-serverWithSecurityPolicy.diff, derby-6945-49-aa-runSomeTestsWithModulePath.diff, derby-6945-50-aa-runOldTestHarnessWithModulePath.diff, derby-6945-51-ab-runUpgradeTestsWithModulePath.diff, derby-6945-52-aa-runLangSuiteWithModulePath.diff, derby-6945-53-aa-fixJavadocWarning.diff, derby-6945-54-aa-driverAutoloading.diff, derby-6945-XX-moveDataSourceFactories, jdeps.out.tar, weirdAnt.out
>
>
> Once we commit to building with Java 9 (see DERBY-6856), we should consider re-packaging Derby as a set of jigsaw modules. This would result in a different set of release artifacts. This might be a good opportunity to address the Tomcat artifactory issues raised by issue DERBY-6944.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)