Skip to content

Commit 4ddb06c

Browse files
committed
try to make it work v11e10
Signed-off-by: christian.lutnik <[email protected]>
1 parent 824cce5 commit 4ddb06c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/java/dev/openfeature/sdk/vmlens/VmLensTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@
2424
class VmLensTest {
2525
final OpenFeatureAPI api = OpenFeatureAPITestUtil.createAPI();
2626

27+
// todo add tests:
28+
// concurrent changing of context thorugh client.setctx... and flags with a targeting rule depending on that context
29+
// concurrent setting of context thorugh client.setctx... and flags with a targeting rule depending on that context
30+
// concurrent changing of context through a hook and flags with a targeting rule depending on that context
31+
// concurrent setting of context through a hook and flags with a targeting rule depending on that context
32+
33+
2734
@BeforeEach
2835
void setUp() {
36+
System.out.println("VmLensTest.setUp");
2937
var flags = new HashMap<String, Flag<?>>();
3038
flags.put("a", Flag.builder().variant("a", "def").defaultVariant("a").build());
3139
flags.put("b", Flag.builder().variant("a", "as").defaultVariant("a").build());
@@ -34,14 +42,17 @@ void setUp() {
3442

3543
@AfterEach
3644
void tearDown() {
45+
System.out.println("VmLensTest.tearDown");
3746
api.clearHooks();
3847
api.shutdown();
3948
}
4049

4150
@Test
4251
void concurrentClientCreations() {
52+
System.out.println("VmLensTest.concurrentClientCreations");
4353
try (AllInterleavings allInterleavings = new AllInterleavings("Concurrent creations of the Client")) {
4454
while (allInterleavings.hasNext()) {
55+
System.out.println("iteration");
4556
Runner.runParallel(api::getClient, api::getClient);
4657
}
4758
}
@@ -51,9 +62,11 @@ void concurrentClientCreations() {
5162

5263
@Test
5364
void concurrentFlagEvaluations() {
65+
System.out.println("VmLensTest.concurrentFlagEvaluations");
5466
var client = api.getClient();
5567
try (AllInterleavings allInterleavings = new AllInterleavings("Concurrent evaluations")) {
5668
while (allInterleavings.hasNext()) {
69+
System.out.println("iteration");
5770
Runner.runParallel(
5871
() -> assertEquals("def", client.getStringValue("a", "a")),
5972
() -> assertEquals("as", client.getStringValue("b", "b")));
@@ -63,9 +76,11 @@ void concurrentFlagEvaluations() {
6376

6477
@Test
6578
void concurrentFlagEvaluationsAndHookAdditions() {
79+
System.out.println("VmLensTest.concurrentFlagEvaluationsAndHookAdditions");
6680
var client = api.getClient();
6781
try (AllInterleavings allInterleavings = new AllInterleavings("Concurrent evaluations and hook additions")) {
6882
while (allInterleavings.hasNext()) {
83+
System.out.println("iteration");
6984
Runner.runParallel(
7085
() -> assertEquals("def", client.getStringValue("a", "a")),
7186
() -> client.addHooks(new StringHook() {}));
@@ -75,10 +90,12 @@ void concurrentFlagEvaluationsAndHookAdditions() {
7590

7691
@Test
7792
void concurrentContextSetting() {
93+
System.out.println("VmLensTest.concurrentContextSetting");
7894
var client = api.getClient();
7995
try (AllInterleavings allInterleavings =
8096
new AllInterleavings("Concurrently setting the context and evaluating a flag")) {
8197
while (allInterleavings.hasNext()) {
98+
System.out.println("iteration");
8299
Runner.runParallel(
83100
() -> assertEquals("def", client.getStringValue("a", "a")),
84101
() -> client.setEvaluationContext(new ImmutableContext(Map.of("a", new Value("b")))),

0 commit comments

Comments
 (0)