mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Re-factored Jupiter Junit5 dependency in ChronicleStampedLock (reference impl)'s DirtyReadOffenderTest.java ... moving to RFC repo
This commit is contained in:
@@ -227,24 +227,24 @@
|
||||
<version>1.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.junit.jupiter</groupId>-->
|
||||
<!-- <artifactId>junit-jupiter</artifactId>-->
|
||||
<!-- <version>RELEASE</version>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.junit.jupiter</groupId>-->
|
||||
<!-- <artifactId>junit-jupiter</artifactId>-->
|
||||
<!-- <version>RELEASE</version>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.junit.jupiter</groupId>-->
|
||||
<!-- <artifactId>junit-jupiter</artifactId>-->
|
||||
<!-- <version>RELEASE</version>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package net.openhft.chronicle.map.fromdocs.acid.revelations;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
//import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
public class ChronicleStampedLockTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void tryOptimisticRead() {
|
||||
Assert.assertEquals(Boolean.TRUE, Boolean.TRUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validate() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tryWriteLock() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tryReadLock() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void writeLock() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readLock() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unlock() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unlockRead() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unlockWrite() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getReadLockCount() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isReadLocked() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void offHeapLock() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void offHeapLockReaderCount() {
|
||||
}
|
||||
}
|
||||
+10
-4
@@ -61,9 +61,9 @@ public class DirtyReadVictimTest {
|
||||
);
|
||||
System.out.println(
|
||||
" ,,@t=" + System.currentTimeMillis() +
|
||||
" DirtyReadVictim sleeping 10 seconds"
|
||||
" DirtyReadVictim sleeping 2 seconds"
|
||||
);
|
||||
Thread.sleep(10_000);
|
||||
Thread.sleep(2_000);
|
||||
} finally {
|
||||
if (offHeapLock.validate(stamp)) {
|
||||
System.out.println(
|
||||
@@ -72,7 +72,10 @@ public class DirtyReadVictimTest {
|
||||
coupon + " "
|
||||
);
|
||||
// THIS Test will pass when ChronicleStampedLock is GA
|
||||
Assert.assertFalse(Boolean.TRUE);
|
||||
Assert.assertEquals(
|
||||
offHeapLock.chmW.get("WriterCount ").getVolatileValue(),
|
||||
0L
|
||||
);
|
||||
} else {
|
||||
System.out.println(
|
||||
" ,,@t=" + System.currentTimeMillis() +
|
||||
@@ -81,7 +84,10 @@ public class DirtyReadVictimTest {
|
||||
" coupon=[" + coupon + "] is *DIRTY*. "
|
||||
);
|
||||
// THIS Test will execute pass when ChronicleStampedLock is GA
|
||||
Assert.assertFalse(Boolean.FALSE);
|
||||
Assert.assertNotEquals(
|
||||
stamp,
|
||||
offHeapLock.lastWriterT.getEntryLockState()
|
||||
);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user