You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`ObjectSelect`** — Modern fluent API for fetching persistent objects (preferred)
20
+
-**`SQLSelect`** / **`SQLExec`** — Raw SQL with Cayenne parameter binding
21
+
-**`EJBQLQuery`** — Legacy EJBQL support
22
+
-**`Expression`** / **`ExpressionFactory`** — In-memory and SQL predicate building
23
+
24
+
### ORM Mapping
25
+
26
+
- Mapping metadata lives in `cayenne-project.xml` (project descriptor) and `*.map.xml` files (per-DataMap); loaded at startup into `DataMap` / `EntityResolver`
- All source files must have the Apache License 2.0 header (enforced by Apache RAT plugin)
47
+
- Encoding: UTF-8 everywhere
48
+
49
+
## Test Infrastructure
50
+
51
+
Tests use a shared set of test mapping files and database scripts in `cayenne/src/test/resources/`. The `DBHelper` and `UnitDbAdapter` utilities handle database-specific test setup.
-**`ObjectSelect`** — Modern fluent API for fetching persistent objects (preferred)
71
-
-**`SQLSelect`** / **`SQLExec`** — Raw SQL with Cayenne parameter binding
72
-
-**`EJBQLQuery`** — Legacy EJBQL support
73
-
-**`Expression`** / **`ExpressionFactory`** — In-memory and SQL predicate building
74
-
75
-
### ORM Mapping
76
-
77
-
- Mapping metadata lives in `cayenne-project.xml` (project descriptor) and `*.map.xml` files (per-DataMap); loaded at startup into `DataMap` / `EntityResolver`
- All source files must have the Apache License 2.0 header (enforced by Apache RAT plugin)
98
-
- Encoding: UTF-8 everywhere
61
+
Test naming: `*Test.java` = unit tests (Surefire), `*IT.java` = integration tests (Failsafe).
62
+
All new tests must use JUnit 5. Test classes and methods must be `public`. Method names must not use the `test` prefix (e.g. `someFeature()` not `testSomeFeature()`).
99
63
100
-
### Test Infrastructure
64
+
### Legacy Tests
101
65
102
-
Tests in `cayenne/src/test/` use a shared set of test mapping files and database scripts in `src/test/resources/`. The `DBHelper` and `UnitDbAdapter` utilities handle database-specific test setup. TestContainers is used for non-embedded databases.
103
-
Test naming: `*Test.java` = unit tests (Surefire), `*IT.java` = integration tests (Failsafe).
66
+
JUnit 4 tests are still present but are considered legacy (run via `junit-vintage-engine`). They are being migrated to JUnit 5. Mockito is used for mocking and is also considered legacy and should be avoided in the new tests.
104
67
105
-
**Test style:** JUnit 5 is the standard for all new tests. JUnit 4-style tests are legacy. New test classes and methods must be `public`; method names must not use the `test` prefix (e.g., use `someFeature()` not `testSomeFeature()`). Mockito is used for mocking for legacy reasons. Should avoid it in newer tests
0 commit comments