Commit 5714928
[testcontainers] Support both TQE 2.x and TQE 3.x versions (#86)
* feat(testcontainers): add TQE 3.x support and unify with 2.x via parameterized tests
Add TQE 3.x (message-queue-ee 3.x) integration on top of the existing
TQE 2.x support in testcontainers. Refactor the resulting duplication
into a single parameterized test suite driven by a per-version enum,
versioned cluster and gRPC strategy implementations, and shared
fixtures.
- New TQE 3.x wiring: image, configs, ProducerServiceGrpc client,
gRPC container, bidirectional subscription.
- Versioned cluster/container builders via FileTQEConfigurator.tqe3Builder
/tqe2Builder; single TQEClusterImpl (TQE 3.x startup order is safe
for both versions).
- GrpcRole.PRODUCER accepts "publisher" as alias (TQE 2.x naming) —
eliminates the version-specific role constant.
- Replace TQE2ClusterImplTest + TQE3ClusterImplTest with
TQEClusterIntegrationTest + TQEClusterTest parameterized over TQEVersion.
- Extract GrpcTestStrategy interface with TQE2/TQE3 implementations to
isolate version-specific gRPC API differences.
- TQEVersion encapsulates image, configs, role names, builder/cluster
factories, and gRPC strategy per version (OCP-friendly — adding a
future TQE 4.x is a single new enum constant).
- Migrate protobuf generation from xolstice to ascopes plugin; rename
proto/config resource directories to tqe2/tqe3.
- Fix GrpcContainerImpl.validateConfigPath: path.toString().endsWith()
instead of Path.endsWith (path-component comparison) so the .yml
extension check actually works as the error message claims.
Addresses PR #86 review comments.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor(testcontainers): address PR #86 review feedback
- FileTQEConfigurator: pass routerRole through private Builder constructor
instead of exposing withRouterRole() setter; remove dead null check in build()
- Rename GrpcTestStrategy -> TQEClient and implementations -> TQE2Client/TQE3Client
- Replace Set<User> with Consumer<User> in subscribe() for flexible result handling
- TQEVersion: drop unused displayName()/requiresConfigure() and trivial
createCluster() factory (TQEClusterImpl is created directly in tests)
- FileTQEConfiguratorTest: always call configure() (idempotent for both versions)
- TQEClusterIntegrationTest: simplify size check to users.size() == result.size()
* refactor(testcontainers): hide ManagedChannel from TQEClient API
Per PR #86 review (r3381299111): ManagedChannel is an internal transport
detail and should not be part of the TQEClient contract.
- TQEClient.publish/subscribe: drop ManagedChannel parameter
- TQE2Client/TQE3Client: take the channel in the constructor and store it
as a field; remove INSTANCE singletons
- TQEVersion: replace stored TQEClient field with an abstract
client(ManagedChannel) factory, overridden per version
- TQEClusterFixture: own the channels and the bound clients; expose
publisherClient()/consumerClient() and shut down channels in close()
- TQEClusterIntegrationTest: drop manual channel creation/shutdown
and the now-unused ManagedChannel import
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent f813243 commit 5714928
28 files changed
Lines changed: 1525 additions & 589 deletions
File tree
- testcontainers
- src
- main/java/org/testcontainers/containers/tqe
- configuration
- grpc
- test
- java/org/testcontainers/containers/integration/tqe
- proto
- tqe2
- messages
- services
- tqe3
- messages
- services
- resources
- tqe2/simple-config
- tqe3/simple-config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 107 | | |
115 | 108 | | |
116 | 109 | | |
| |||
146 | 139 | | |
147 | 140 | | |
148 | 141 | | |
149 | | - | |
| 142 | + | |
150 | 143 | | |
151 | 144 | | |
152 | 145 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
161 | 156 | | |
162 | 157 | | |
163 | 158 | | |
| 159 | + | |
164 | 160 | | |
165 | | - | |
166 | | - | |
| 161 | + | |
167 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | | - | |
66 | | - | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
Lines changed: 51 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
71 | | - | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | | - | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
| |||
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
159 | | - | |
| 164 | + | |
160 | 165 | | |
161 | | - | |
| 166 | + | |
162 | 167 | | |
163 | 168 | | |
164 | 169 | | |
| |||
436 | 441 | | |
437 | 442 | | |
438 | 443 | | |
439 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
440 | 453 | | |
441 | | - | |
| 454 | + | |
442 | 455 | | |
443 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
444 | 479 | | |
445 | 480 | | |
446 | 481 | | |
| |||
450 | 485 | | |
451 | 486 | | |
452 | 487 | | |
| 488 | + | |
453 | 489 | | |
454 | | - | |
| 490 | + | |
| 491 | + | |
455 | 492 | | |
456 | 493 | | |
457 | 494 | | |
| |||
469 | 506 | | |
470 | 507 | | |
471 | 508 | | |
| 509 | + | |
472 | 510 | | |
473 | 511 | | |
474 | 512 | | |
| 513 | + | |
475 | 514 | | |
476 | 515 | | |
477 | 516 | | |
| |||
514 | 553 | | |
515 | 554 | | |
516 | 555 | | |
517 | | - | |
| 556 | + | |
| 557 | + | |
518 | 558 | | |
519 | 559 | | |
520 | 560 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
Lines changed: 0 additions & 48 deletions
This file was deleted.
0 commit comments