Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for %TYPE operator parsing error #1565

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

lananda
Copy link
Contributor

@lananda lananda commented Jun 29, 2022

No description provided.

Copy link
Contributor

@rfelcman rfelcman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I'm missing some additional description there why this PR was created.
For functional fixes like this we want some unit test.
For this fix I'd like recommend utils/eclipselink.dbws.builder.test.oracle module as a target for unit test.
Test execution command for the mentioned module is mvn verify -pl :org.eclipse.persistence.dbws.builder.oracle.test -P oracle (after EclipseLink build).

Copy link
Contributor

@rfelcman rfelcman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During my local execution I'm getting following error for renamed test class.

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.949 s <<< FAILURE! - in dbws.testing.plsqlrecord.PLSQLTypeReturnTestSuite
[ERROR] dbws.testing.plsqlrecord.PLSQLTypeReturnTestSuite  Time elapsed: 0.948 s  <<< ERROR!
java.lang.NullPointerException
	at org.eclipse.persistence.tools.dbws.oracle.OracleHelper.translateToOracleType(OracleHelper.java:1930)
	at org.eclipse.persistence.tools.dbws.oracle.OracleHelper.buildDatabaseTypeFromMetadataType(OracleHelper.java:1920)
	at org.eclipse.persistence.tools.dbws.oracle.OracleHelper.buildQueryForProcedureType(OracleHelper.java:1278)
	at org.eclipse.persistence.tools.dbws.BaseDBWSBuilderHelper.finishUpProjects(BaseDBWSBuilderHelper.java:426)
	at org.eclipse.persistence.tools.dbws.BaseDBWSBuilderHelper.buildOROXProjects(BaseDBWSBuilderHelper.java:404)
	at org.eclipse.persistence.tools.dbws.DBWSBuilder.build(DBWSBuilder.java:427)
	at org.eclipse.persistence.tools.dbws.DBWSBuilder.build(DBWSBuilder.java:366)
	at dbws.testing.DBWSTestSuite.setUp(DBWSTestSuite.java:233)
	at dbws.testing.DBWSTestSuite.setUp(DBWSTestSuite.java:151)
	at dbws.testing.plsqlrecord.PLSQLTypeReturnTestSuite.setUp(PLSQLTypeReturnTestSuite.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 java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:377)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:284)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:248)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:167)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)

Hint how to build DBWS builder module:
mvn clean install -pl :org.eclipse.persistence.dbws.builder -P oracle
Hint how to build and execute DBWS builder Oracle tests:
mvn clean verify -pl :org.eclipse.persistence.dbws.builder.oracle.test -P oracle

//test imports
import dbws.testing.DBWSTestSuite;

public class PLSQLTypeReturnTest extends DBWSTestSuite {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this class dbws.testing.plsqlrecord.PLSQLTypeReturnTest should be dbws.testing.plsqlrecord.PLSQLTypeReturnTestSuite to match pattern <include>**.*TestSuite*</include> L159 in module pom.xml .
Without this, test class is not executed as a part of tests by command:
mvn clean verify -pl :org.eclipse.persistence.dbws.builder.oracle.test -P oracle

@lananda lananda force-pushed the Bug1562_%Type_operator_parsingerror branch from 7b3cdd8 to 0a98a7d Compare August 9, 2022 09:09
@lananda lananda force-pushed the Bug1562_%Type_operator_parsingerror branch from 7aa6376 to a074410 Compare August 20, 2022 09:01
@rfelcman
Copy link
Contributor

Attached test still doesn't work.
To test it directly from IDE you can pass to java properties like this
-Ddb.user=scott -Ddb.pwd=tiger -Ddb.url=jdbc:oracle:thin:@localhost:1521:ORCL
another hint is temporary add to org.eclipse.persistence.dbws.builder.oracle.test POM dependency

        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc11</artifactId>
            <scope>test</scope>
        </dependency>

instead of

        <dependency>
            <groupId>${db.driver.groupId}</groupId>
            <artifactId>${db.driver.artifactId}</artifactId>
            <version>${db.driver.version}</version>
            <scope>test</scope>
        </dependency>

It seems, that there are some naming collisions like EMP_RECORD_PACKAGE with dbws.testing.plsqlrecord.PLSQLRecordTestSuite. Please ensure, that DB object names used in the test are unique for this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants