Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Tests fail on Apple Mac when building the project from command line #405

Open
lionel-nj opened this issue Jan 19, 2022 · 1 comment
Open
Labels

Comments

@lionel-nj
Copy link

lionel-nj commented Jan 19, 2022

Summary:

Test sets fail when building the project from command line - which prevents the project from building.

Steps to reproduce:

After applying the fix suggested in #404, run mvn package at the root of the project.

Expected behavior:

Tests pass and project builds. An executable jar should be generated in target.

Observed behavior:
Failure in tests that prevent the project from building (see test reports.zip)

  • edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest
  • edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest

Capture d’écran, le 2022-01-19 à 13 59 03

Interestingly, those test sets are successfully executed in IntelliJ.

"This might have something to do with the HSQLDB drivers on Mac, because those tests test queries against a HSQLDB instance using the JDBC drivers."

"I guess maybe IntelliJ is including something on the classpath that you're missing on command-line? Maybe the JDBC drivers?"

(from @barbeau).

Platform:

Mac M1
MacOS Big Sur 11.6 version
Java 11.0.11

@barbeau
Copy link
Member

barbeau commented Jan 19, 2022

Looks like these are related to Hibernate and database access for the web app during the test:

-------------------------------------------------------------------------------
Test set: edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.011 s <<< FAILURE! - in edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest
testGtfsFeed(edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest)  Time elapsed: 0.01 s  <<< ERROR!
org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
	at edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest.setUp(GtfsFeedTest.java:44)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
	at edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest.setUp(GtfsFeedTest.java:44)
Caused by: java.lang.reflect.InvocationTargetException
	at edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest.setUp(GtfsFeedTest.java:44)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @7d934771
	at edu.usf.cutr.gtfsrtvalidator.api.resource.GtfsFeedTest.setUp(GtfsFeedTest.java:44)
-------------------------------------------------------------------------------
Test set: edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.568 s <<< FAILURE! - in edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest
testViewErrorLogModel(edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest)  Time elapsed: 0.529 s  <<< ERROR!
org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)
Caused by: java.lang.reflect.InvocationTargetException
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @7d934771
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)

testViewErrorSummaryModel(edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest)  Time elapsed: 0.027 s  <<< ERROR!
org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)
Caused by: java.lang.reflect.InvocationTargetException
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @7d934771
	at edu.usf.cutr.gtfsrtvalidator.test.queries.QueryTest.setUp(QueryTest.java:65)

@barbeau barbeau added the bug label Jan 19, 2022
@barbeau barbeau changed the title Failure in test sets when building the project from command line Tests fail on Apple Mac when building the project from command line Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants