Skip to content

Commit fff3686

Browse files
committed
update to vmlens 1.2.12 or something like that
Signed-off-by: christian.lutnik <[email protected]>
1 parent 0fd8804 commit fff3686

File tree

5 files changed

+31
-12
lines changed

5 files changed

+31
-12
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
<dependency>
172172
<groupId>com.vmlens</groupId>
173173
<artifactId>api</artifactId>
174-
<version>1.2.11</version>
174+
<version>1.2.12</version>
175175
<scope>test</scope>
176176
</dependency>
177177

@@ -318,7 +318,7 @@
318318
<plugin>
319319
<groupId>com.vmlens</groupId>
320320
<artifactId>vmlens-maven-plugin</artifactId>
321-
<version>1.2.11</version>
321+
<version>1.2.12</version>
322322
<executions>
323323
<execution>
324324
<id>test</id>

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

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package dev.openfeature.sdk.vmlens;
22

3+
import static org.hamcrest.MatcherAssert.assertThat;
4+
import static org.hamcrest.Matchers.anyOf;
5+
import static org.hamcrest.Matchers.is;
36
import static org.junit.jupiter.api.Assertions.assertEquals;
47
import static org.junit.jupiter.api.Assertions.assertTrue;
58

@@ -31,7 +34,6 @@ class VmLensTest {
3134

3235
@BeforeEach
3336
void setUp() {
34-
System.out.println("VmLensTest.setUp");
3537
var flags = new HashMap<String, Flag<?>>();
3638
flags.put("a", Flag.builder().variant("a", "def").defaultVariant("a").build());
3739
flags.put("b", Flag.builder().variant("a", "as").defaultVariant("a").build());
@@ -40,17 +42,14 @@ void setUp() {
4042

4143
@AfterEach
4244
void tearDown() {
43-
System.out.println("VmLensTest.tearDown");
4445
api.clearHooks();
4546
api.shutdown();
4647
}
4748

4849
@Test
4950
void concurrentClientCreations() {
50-
System.out.println("VmLensTest.concurrentClientCreations");
5151
try (AllInterleavings allInterleavings = new AllInterleavings("Concurrent creations of the Client")) {
5252
while (allInterleavings.hasNext()) {
53-
System.out.println("iteration");
5453
Runner.runParallel(api::getClient, api::getClient);
5554
}
5655
}
@@ -60,11 +59,9 @@ void concurrentClientCreations() {
6059

6160
@Test
6261
void concurrentFlagEvaluations() {
63-
System.out.println("VmLensTest.concurrentFlagEvaluations");
6462
var client = api.getClient();
6563
try (AllInterleavings allInterleavings = new AllInterleavings("Concurrent evaluations")) {
6664
while (allInterleavings.hasNext()) {
67-
System.out.println("iteration");
6865
Runner.runParallel(
6966
() -> assertEquals("def", client.getStringValue("a", "a")),
7067
() -> assertEquals("as", client.getStringValue("b", "b")));
@@ -74,16 +71,38 @@ void concurrentFlagEvaluations() {
7471

7572
@Test
7673
void concurrentContextSetting() {
77-
System.out.println("VmLensTest.concurrentContextSetting");
7874
var client = api.getClient();
75+
var contextA = new ImmutableContext(Map.of("a", new Value("b")));
76+
var contextB = new ImmutableContext(Map.of("c", new Value("d")));
7977
try (AllInterleavings allInterleavings =
8078
new AllInterleavings("Concurrently setting the context and evaluating a flag")) {
8179
while (allInterleavings.hasNext()) {
82-
System.out.println("iteration");
8380
Runner.runParallel(
8481
() -> assertEquals("def", client.getStringValue("a", "a")),
85-
() -> client.setEvaluationContext(new ImmutableContext(Map.of("a", new Value("b")))),
86-
() -> client.setEvaluationContext(new ImmutableContext(Map.of("c", new Value("d")))));
82+
() -> client.setEvaluationContext(contextA),
83+
() -> client.setEvaluationContext(contextB)
84+
);
85+
assertThat(
86+
client.getEvaluationContext(),
87+
anyOf(
88+
is(contextA),
89+
is(contextB)
90+
)
91+
);
92+
}
93+
}
94+
}
95+
96+
@Test
97+
void fails() {
98+
int[] i = new int[] {0};
99+
try (AllInterleavings allInterleavings = new AllInterleavings("pls fail!")) {
100+
while (allInterleavings.hasNext()) {
101+
Runner.runParallel(
102+
() -> i[0]++,
103+
() -> i[0]++
104+
);
105+
assertEquals(2, i[0]);
87106
}
88107
}
89108
}

vmlens-agent/agent.jar

-1 Bytes
Binary file not shown.

vmlens-agent/agent_bootstrap.jar

96 Bytes
Binary file not shown.

vmlens-agent/agent_runtime.jar

4.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)