[
https://issues.apache.org/jira/browse/OPENJPA-3075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144660#comment-18144660
]
ASF subversion and git services commented on OPENJPA-3075:
----------------------------------------------------------
Commit e5b11995904a7d2d9ed222041b7a296cdef42cd5 in openjpa's branch
refs/heads/master from Maxim Solodovnik
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=e5b119959 ]
[OPENJPA-3007] tests are converted to use JUnit 6 (#305)
* [OPENJPA-3007] tests are converted to use JUnit 6
* [OPENJPA-3007] best practices
* [OPENJPA-3007] Call the setUp and tearDown of AbstractMojoTestCase from
Jupiter and leave out the vintage engine in the maven plugin
* [OPENJPA-3007] Rewrite the enhancer mojo test with the JUnit 5 support of
maven-plugin-testing-harness 3.5.1
* [OPENJPA-3007] Port the sqlActionRefresh and nonRecursiveRelations plugin ITs
to JUnit 6 and take the JUnit version of the ITs from the build
* Code clean-up
* Code clean-up after refactoring
* More errors are fixed
* Fix for TestEnhancedInstanceBrokerSerialization tests
* DynamicEnhancementSuite is improved
* Code simplified
* Best practices after rebase
* More methods are made package private
* Build should be fixed
* [OPENJPA-3007] Compare the SQL in every embeddable and join criteria test
EmbeddableDomainTestCase and JoinDomainTestCase set the dictionary only
in the test instance that created the shared EntityManagerFactory. Every
later instance had no dictionary, so executeAndCompareSQL skipped the
SQL comparison. Set it in every setUp(), as CriteriaTest does.
This exposes a wrong expectation in embeddableQuery76 to 83: the default
collection table of EntityA_Coll_Embed_Embed.embeds is named after the
entity (EntityA_Coll_Embed_Embed_embeds), not after its table TBL1A.
* [OPENJPA-3007] Close the EntityManagerFactory of TestEmbeddableCriteria in
@AfterAll
The class counted public test* methods to decide when to close the
shared factory. After the conversion no method matches, so the factory
was rebuilt for every method. Close the EntityManager after each method
and the factory in @AfterAll, which also runs when methods are skipped.
* Best practices after rebase
* Some tests are converted to parametrized
* Best practices after rebase
* Unaligned parameters are fixed
* [OPENJPA-3007] Convert the tests added by OPENJPA-3075 to JUnit 6
* [OPENJPA-3007] Make the JUnit dependencies of openjpa-junit5 provided and use
the public AnnotationSupport API
* Best practices after rebase
* Missing check for the suite
* [OPENJPA-3007] Make TestDataCacheBehavesIdentical independent of the test
order: clear the tables of both factories before any test persists, and reset
RefreshFromDataCache for every test
* Best practices after rebase + RELEASE_NOTES
* [OPENJPA-3007] Put the assertion messages of TestNamesPerDictionary last and
drop the reset of the shared identifier rule, which OPENJPA-3076 made
unnecessary
* Best practices after rebase
* Code clean-up
* Postgres failure should be fixed
* [OPENJPA-3007] Rename openjpa-junit5 to openjpa-junit-jupiter and its package
to org.apache.openjpa.junit.jupiter
The extension works with JUnit 5 and 6, which share the Jupiter API. The rename
is described in the migration
considerations and in the upgrade notes.
* [OPENJPA-3007] Make the autoapply tests and TestRangeQuery independent of the
test order
The autoapply tests use unenhanced entities, which a factory subclasses only
when it creates its first entity
manager, so the metamodel tests failed when they ran first: open an entity
manager in the shared set-up.
TestSchemaGenerationProperties leaves the tables of its drop scripts in the
JVM-wide SchemaTool tracking for the
TestConv unit, so a later buildSchema factory of that unit, such as the one of
TestRangeQuery, did not create
them: clear the tracking after each test.
Found with random method and class order (seeds 11 and 2).
* [OPENJPA-3007] Do not let tests depend on rows left by earlier tests or builds
TestInheritedPropertyAccessPersist and TestFieldAccessWithNonStandardAccessors
insert fixed ids into tables that
nothing clears, and the Derby database outlives the build, so every second run
in the same target directory
failed: clear their tables when the factory starts.
TestEntityManagerFactory.emfCreation left an AllFieldTypes
row whose id came from the shared sequence table, which other tests reset, so
TestInMemoryQueryMatchEscapes could
hit a duplicate key: remove the row, and clear the table in
TestInMemoryQueryMatchEscapes.
Found with random method and class order (seeds 202, 505, 606, 707).
* [OPENJPA-3007] Give the String ids of the
TestRelationFieldAsPrimaryKeyAndForeignKey entities a length, so that the
composite primary keys fit the 3072 byte index limit of MySQL and MariaDB
The test used to disable itself on that error; the JUnit 6 migration removed
the catch, so the tests failed on
MySQL and MariaDB. With @Column(length = 64) they now run there.
* [OPENJPA-3007] Let TestMappingToolRefresh create EntityBoolChar itself rather
than reuse the table another test left
TestJDBCSchemaManager leaves EntityBoolChar with the native boolean column
(BIT(1), BOOLEAN), and the 'add'
schema action never changes an existing column, so inserting '1' as STRING_10
failed on MySQL, MariaDB and
PostgreSQL depending on the test order. The first stage now uses
SchemaAction='drop,add'.
* [OPENJPA-3007] Keep the types-changed listeners of the remote commit tests
strongly reachable
The query cache holds its listeners weakly, so a garbage collection between
registering the lambda and the
event dropped it, and queryCacheIgnoresUnknownTypeNames saw no event. Hold the
listener in a local variable and
remove it in finally.
* [OPENJPA-3007] Run the tests in a fixed order by default and in random order
on master
PR and local builds use alphabetical class order and method-name order, so a
failure can be reproduced. The
master build (ci.yml) runs classes and methods in random order with the run id
as seed to find tests that depend
on each other; the root pom describes how to replay such a run.
---------
Co-authored-by: Richard Zowalla <[email protected]>
> DerbyDictionary does not know WINDOW and other words Derby reserves
> --------------------------------------------------------------------
>
> Key: OPENJPA-3075
> URL: https://issues.apache.org/jira/browse/OPENJPA-3075
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Richard Zowalla
> Assignee: Richard Zowalla
> Priority: Major
> Fix For: 4.2.0
>
>
> DerbyDictionary's reserved words are missing words that Derby rejects as
> unquoted identifiers, such as WINDOW. An entity named Window therefore
> produces CREATE TABLE Window, which fails on Derby. Add the missing words,
> taken from Derby itself.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)