Re-factored Jupiter Junit5 dependency in ChronicleStampedLock (reference impl)'s DirtyReadOffenderTest.java ... moving to RFC repo

This commit is contained in:
cotton-ben
2020-07-19 10:07:44 -04:00
parent ba2d424ad3
commit 63bb24f8ea
3 changed files with 92 additions and 22 deletions
+18 -18
View File
@@ -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>
@@ -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() {
}
}
@@ -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()
);
}
}
/**