[BAEL-2959] A Guide to MapDB code (#7042)
* [BAEL-2959] A Guide to MapDB code * [BAEL-2959] fixes * [BAEL-2959] made VOLUME_LOCATION static in SortedTableMapUnitTest * moved mapdb files from libraries to libraries-2 * [BAEL-2959] formatting fixes * updated pom.xml
This commit is contained in:
parent
e82221416d
commit
7c4019e384
@ -1,70 +1,71 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<artifactId>libraries2</artifactId>
|
||||||
<artifactId>libraries2</artifactId>
|
<name>libraries2</name>
|
||||||
<name>libraries2</name>
|
<parent>
|
||||||
|
<groupId>com.baeldung</groupId>
|
||||||
<parent>
|
<artifactId>parent-modules</artifactId>
|
||||||
<groupId>com.baeldung</groupId>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<artifactId>parent-modules</artifactId>
|
</parent>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<repositories>
|
||||||
</parent>
|
<repository>
|
||||||
|
<id>jboss-public-repository-group</id>
|
||||||
<repositories>
|
<name>JBoss Public Repository Group</name>
|
||||||
<repository>
|
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
|
||||||
<id>jboss-public-repository-group</id>
|
<releases>
|
||||||
<name>JBoss Public Repository Group</name>
|
<enabled>true</enabled>
|
||||||
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
|
<updatePolicy>never</updatePolicy>
|
||||||
<releases>
|
</releases>
|
||||||
<enabled>true</enabled>
|
<snapshots>
|
||||||
<updatePolicy>never</updatePolicy>
|
<enabled>true</enabled>
|
||||||
</releases>
|
<updatePolicy>daily</updatePolicy>
|
||||||
<snapshots>
|
</snapshots>
|
||||||
<enabled>true</enabled>
|
</repository>
|
||||||
<updatePolicy>daily</updatePolicy>
|
</repositories>
|
||||||
</snapshots>
|
<dependencies>
|
||||||
</repository>
|
<dependency>
|
||||||
</repositories>
|
<groupId>org.mapdb</groupId>
|
||||||
|
<artifactId>mapdb</artifactId>
|
||||||
<dependencies>
|
<version>${mapdb.version}</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>com.pivovarit</groupId>
|
<dependency>
|
||||||
<artifactId>parallel-collectors</artifactId>
|
<groupId>com.pivovarit</groupId>
|
||||||
<version>1.1.0</version>
|
<artifactId>parallel-collectors</artifactId>
|
||||||
</dependency>
|
<version>1.1.0</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.assertj</groupId>
|
<dependency>
|
||||||
<artifactId>assertj-core</artifactId>
|
<groupId>org.assertj</groupId>
|
||||||
<version>${assertj.version}</version>
|
<artifactId>assertj-core</artifactId>
|
||||||
</dependency>
|
<version>${assertj.version}</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>io.github.classgraph</groupId>
|
<dependency>
|
||||||
<artifactId>classgraph</artifactId>
|
<groupId>io.github.classgraph</groupId>
|
||||||
<version>${classgraph.version}</version>
|
<artifactId>classgraph</artifactId>
|
||||||
</dependency>
|
<version>${classgraph.version}</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.jbpm</groupId>
|
<dependency>
|
||||||
<artifactId>jbpm-test</artifactId>
|
<groupId>org.jbpm</groupId>
|
||||||
<version>${jbpm.version}</version>
|
<artifactId>jbpm-test</artifactId>
|
||||||
</dependency>
|
<version>${jbpm.version}</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>info.picocli</groupId>
|
<dependency>
|
||||||
<artifactId>picocli</artifactId>
|
<groupId>info.picocli</groupId>
|
||||||
<version>${picocli.version}</version>
|
<artifactId>picocli</artifactId>
|
||||||
</dependency>
|
<version>${picocli.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ejml</groupId>
|
<groupId>org.ejml</groupId>
|
||||||
<artifactId>ejml-all</artifactId>
|
<artifactId>ejml-all</artifactId>
|
||||||
<version>${ejml.version}</version>
|
<version>${ejml.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.nd4j</groupId>
|
<groupId>org.nd4j</groupId>
|
||||||
<artifactId>nd4j-native</artifactId>
|
<artifactId>nd4j-native</artifactId>
|
||||||
<version>${nd4j.version}</version>
|
<version>${nd4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.la4j</groupId>
|
<groupId>org.la4j</groupId>
|
||||||
<artifactId>la4j</artifactId>
|
<artifactId>la4j</artifactId>
|
||||||
@ -75,87 +76,79 @@
|
|||||||
<artifactId>colt</artifactId>
|
<artifactId>colt</artifactId>
|
||||||
<version>${colt.version}</version>
|
<version>${colt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
<version>${spring-boot-starter.version}</version>
|
<version>${spring-boot-starter.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.openhft</groupId>
|
<groupId>net.openhft</groupId>
|
||||||
<artifactId>chronicle-map</artifactId>
|
<artifactId>chronicle-map</artifactId>
|
||||||
<version>${chronicle.map.version}</version>
|
<version>${chronicle.map.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.sun.java</groupId>
|
<groupId>com.sun.java</groupId>
|
||||||
<artifactId>tools</artifactId>
|
<artifactId>tools</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Dependencies for response decoder with okhttp -->
|
||||||
<!-- Dependencies for response decoder with okhttp -->
|
<dependency>
|
||||||
<dependency>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
<artifactId>okhttp</artifactId>
|
||||||
<artifactId>okhttp</artifactId>
|
<version>3.14.2</version>
|
||||||
<version>3.14.2</version>
|
</dependency>
|
||||||
</dependency>
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<dependency>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<version>2.9.9</version>
|
||||||
<artifactId>jackson-databind</artifactId>
|
</dependency>
|
||||||
<version>2.9.9</version>
|
<dependency>
|
||||||
</dependency>
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
<dependency>
|
<version>2.8.5</version>
|
||||||
<groupId>com.google.code.gson</groupId>
|
</dependency>
|
||||||
<artifactId>gson</artifactId>
|
<dependency>
|
||||||
<version>2.8.5</version>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
</dependency>
|
<artifactId>mockwebserver</artifactId>
|
||||||
|
<version>3.14.2</version>
|
||||||
<dependency>
|
<scope>test</scope>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
</dependency>
|
||||||
<artifactId>mockwebserver</artifactId>
|
|
||||||
<version>3.14.2</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>edu.uci.ics</groupId>
|
<groupId>edu.uci.ics</groupId>
|
||||||
<artifactId>crawler4j</artifactId>
|
<artifactId>crawler4j</artifactId>
|
||||||
<version>${crawler4j.version}</version>
|
<version>${crawler4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
<dependency>
|
<groupId>com.github.jknack</groupId>
|
||||||
<groupId>com.github.jknack</groupId>
|
<artifactId>handlebars</artifactId>
|
||||||
<artifactId>handlebars</artifactId>
|
<version>4.1.2</version>
|
||||||
<version>4.1.2</version>
|
</dependency>
|
||||||
</dependency>
|
<!-- Benchmarking -->
|
||||||
|
<dependency>
|
||||||
<!-- Benchmarking -->
|
<groupId>org.openjdk.jmh</groupId>
|
||||||
<dependency>
|
<artifactId>jmh-core</artifactId>
|
||||||
<groupId>org.openjdk.jmh</groupId>
|
<version>${jmh.version}</version>
|
||||||
<artifactId>jmh-core</artifactId>
|
</dependency>
|
||||||
<version>${jmh.version}</version>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.openjdk.jmh</groupId>
|
||||||
<dependency>
|
<artifactId>jmh-generator-annprocess</artifactId>
|
||||||
<groupId>org.openjdk.jmh</groupId>
|
<version>${jmh.version}</version>
|
||||||
<artifactId>jmh-generator-annprocess</artifactId>
|
</dependency>
|
||||||
<version>${jmh.version}</version>
|
</dependencies>
|
||||||
</dependency>
|
<properties>
|
||||||
|
<mapdb.version>3.0.7</mapdb.version>
|
||||||
</dependencies>
|
<assertj.version>3.6.2</assertj.version>
|
||||||
|
<classgraph.version>4.8.28</classgraph.version>
|
||||||
<properties>
|
<jbpm.version>6.0.0.Final</jbpm.version>
|
||||||
<assertj.version>3.6.2</assertj.version>
|
<picocli.version>3.9.6</picocli.version>
|
||||||
<classgraph.version>4.8.28</classgraph.version>
|
<chronicle.map.version>3.17.2</chronicle.map.version>
|
||||||
<jbpm.version>6.0.0.Final</jbpm.version>
|
|
||||||
<picocli.version>3.9.6</picocli.version>
|
|
||||||
<chronicle.map.version>3.17.2</chronicle.map.version>
|
|
||||||
<crawler4j.version>4.4.0</crawler4j.version>
|
<crawler4j.version>4.4.0</crawler4j.version>
|
||||||
<spring-boot-starter.version>2.1.4.RELEASE</spring-boot-starter.version>
|
<spring-boot-starter.version>2.1.4.RELEASE</spring-boot-starter.version>
|
||||||
<ejml.version>0.38</ejml.version>
|
<ejml.version>0.38</ejml.version>
|
||||||
<nd4j.version>1.0.0-beta4</nd4j.version>
|
<nd4j.version>1.0.0-beta4</nd4j.version>
|
||||||
<colt.version>1.2.0</colt.version>
|
<colt.version>1.2.0</colt.version>
|
||||||
<la4j.version>0.6.0</la4j.version>
|
<la4j.version>0.6.0</la4j.version>
|
||||||
<jmh.version>1.19</jmh.version>
|
<jmh.version>1.19</jmh.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.baeldung.mapdb;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mapdb.DB;
|
||||||
|
import org.mapdb.DBMaker;
|
||||||
|
import org.mapdb.Serializer;
|
||||||
|
|
||||||
|
import java.util.NavigableSet;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class CollectionsUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenSetCreatedInDB_whenMultipleElementsAdded_checkOnlyOneExists() {
|
||||||
|
|
||||||
|
DB db = DBMaker.memoryDB().make();
|
||||||
|
|
||||||
|
NavigableSet<String> set = db.
|
||||||
|
treeSet("mySet")
|
||||||
|
.serializer(Serializer.STRING)
|
||||||
|
.createOrOpen();
|
||||||
|
|
||||||
|
String myString = "Baeldung!";
|
||||||
|
|
||||||
|
set.add(myString);
|
||||||
|
set.add(myString);
|
||||||
|
|
||||||
|
assertEquals(1, set.size());
|
||||||
|
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.baeldung.mapdb;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mapdb.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class HTreeMapUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenValidDB_whenHTreeMapAddedToAndRetrieved_CheckedRetrievalCorrect() {
|
||||||
|
|
||||||
|
DB db = DBMaker.memoryDB().make();
|
||||||
|
|
||||||
|
HTreeMap<String, String> hTreeMap = db
|
||||||
|
.hashMap("myTreMap")
|
||||||
|
.keySerializer(Serializer.STRING)
|
||||||
|
.valueSerializer(Serializer.STRING)
|
||||||
|
.create();
|
||||||
|
|
||||||
|
hTreeMap.put("key1", "value1");
|
||||||
|
hTreeMap.put("key2", "value2");
|
||||||
|
|
||||||
|
assertEquals(2, hTreeMap.size());
|
||||||
|
|
||||||
|
//add another value with the same key
|
||||||
|
|
||||||
|
hTreeMap.put("key1", "value3");
|
||||||
|
|
||||||
|
assertEquals(2, hTreeMap.size());
|
||||||
|
assertEquals("value3", hTreeMap.get("key1"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.baeldung.mapdb;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mapdb.DB;
|
||||||
|
import org.mapdb.DBMaker;
|
||||||
|
import org.mapdb.HTreeMap;
|
||||||
|
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class HelloBaeldungUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenInMemoryDBInstantiateCorrectly_whenDataSavedAndRetrieved_checkRetrievalCorrect() {
|
||||||
|
|
||||||
|
DB db = DBMaker.memoryDB().make();
|
||||||
|
|
||||||
|
String welcomeMessageKey = "Welcome Message";
|
||||||
|
String welcomeMessageString = "Hello Baeldung!";
|
||||||
|
|
||||||
|
HTreeMap myMap = db.hashMap("myMap").createOrOpen();
|
||||||
|
myMap.put(welcomeMessageKey, welcomeMessageString);
|
||||||
|
|
||||||
|
String welcomeMessageFromDB = (String) myMap.get(welcomeMessageKey);
|
||||||
|
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
assertEquals(welcomeMessageString, welcomeMessageFromDB);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenInFileDBInstantiateCorrectly_whenDataSavedAndRetrieved_checkRetrievalCorrect() {
|
||||||
|
|
||||||
|
DB db = DBMaker.fileDB("file.db").make();
|
||||||
|
|
||||||
|
String welcomeMessageKey = "Welcome Message";
|
||||||
|
String welcomeMessageString = "Hello Baeldung!";
|
||||||
|
|
||||||
|
HTreeMap myMap = db.hashMap("myMap").createOrOpen();
|
||||||
|
myMap.put(welcomeMessageKey, welcomeMessageString);
|
||||||
|
|
||||||
|
String welcomeMessageFromDB = (String) myMap.get(welcomeMessageKey);
|
||||||
|
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
assertEquals(welcomeMessageString, welcomeMessageFromDB);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.baeldung.mapdb;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mapdb.DB;
|
||||||
|
import org.mapdb.DBMaker;
|
||||||
|
import org.mapdb.HTreeMap;
|
||||||
|
import org.mapdb.Serializer;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class InMemoryModesUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenDBCreatedOnHeap_whenUsed_checkUsageCorrect() {
|
||||||
|
|
||||||
|
DB heapDB = DBMaker.heapDB().make();
|
||||||
|
|
||||||
|
HTreeMap<Integer, String> map = heapDB
|
||||||
|
.hashMap("myMap")
|
||||||
|
.keySerializer(Serializer.INTEGER)
|
||||||
|
.valueSerializer(Serializer.STRING)
|
||||||
|
.createOrOpen();
|
||||||
|
|
||||||
|
map.put(1, "ONE");
|
||||||
|
|
||||||
|
assertEquals("ONE", map.get(1));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenDBCreatedBaseOnByteArray_whenUsed_checkUsageCorrect() {
|
||||||
|
|
||||||
|
DB heapDB = DBMaker.memoryDB().make();
|
||||||
|
|
||||||
|
HTreeMap<Integer, String> map = heapDB
|
||||||
|
.hashMap("myMap")
|
||||||
|
.keySerializer(Serializer.INTEGER)
|
||||||
|
.valueSerializer(Serializer.STRING)
|
||||||
|
.createOrOpen();
|
||||||
|
|
||||||
|
map.put(1, "ONE");
|
||||||
|
|
||||||
|
assertEquals("ONE", map.get(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenDBCreatedBaseOnDirectByteBuffer_whenUsed_checkUsageCorrect() {
|
||||||
|
|
||||||
|
DB heapDB = DBMaker.memoryDirectDB().make();
|
||||||
|
|
||||||
|
HTreeMap<Integer, String> map = heapDB
|
||||||
|
.hashMap("myMap")
|
||||||
|
.keySerializer(Serializer.INTEGER)
|
||||||
|
.valueSerializer(Serializer.STRING)
|
||||||
|
.createOrOpen();
|
||||||
|
|
||||||
|
map.put(1, "ONE");
|
||||||
|
|
||||||
|
assertEquals("ONE", map.get(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.baeldung.mapdb;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mapdb.Serializer;
|
||||||
|
import org.mapdb.SortedTableMap;
|
||||||
|
import org.mapdb.volume.MappedFileVol;
|
||||||
|
import org.mapdb.volume.Volume;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class SortedTableMapUnitTest {
|
||||||
|
|
||||||
|
private static final String VOLUME_LOCATION = "sortedTableMapVol.db";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenValidSortedTableMapSetup_whenQueried_checkValuesCorrect() {
|
||||||
|
|
||||||
|
//create memory mapped volume, readonly false
|
||||||
|
Volume vol = MappedFileVol.FACTORY.makeVolume(VOLUME_LOCATION, false);
|
||||||
|
|
||||||
|
//create sink to feed the map with data
|
||||||
|
SortedTableMap.Sink<Integer, String> sink =
|
||||||
|
SortedTableMap.create(
|
||||||
|
vol,
|
||||||
|
Serializer.INTEGER,
|
||||||
|
Serializer.STRING
|
||||||
|
).createFromSink();
|
||||||
|
|
||||||
|
//add content
|
||||||
|
for(int i = 0; i < 100; i++){
|
||||||
|
sink.put(i, "Value " + Integer.toString(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
sink.create();
|
||||||
|
|
||||||
|
//now open in read-only mode
|
||||||
|
Volume openVol = MappedFileVol.FACTORY.makeVolume(VOLUME_LOCATION, true);
|
||||||
|
|
||||||
|
SortedTableMap<Integer, String> sortedTableMap = SortedTableMap.open(
|
||||||
|
openVol,
|
||||||
|
Serializer.INTEGER,
|
||||||
|
Serializer.STRING
|
||||||
|
);
|
||||||
|
|
||||||
|
assertEquals(100, sortedTableMap.size());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.baeldung.mapdb;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mapdb.DB;
|
||||||
|
import org.mapdb.DBMaker;
|
||||||
|
import org.mapdb.Serializer;
|
||||||
|
|
||||||
|
import java.util.NavigableSet;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class TransactionsUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenValidDBSetup_whenTransactionCommittedAndRolledBack_checkPreviousStateAchieved() {
|
||||||
|
|
||||||
|
DB db = DBMaker.memoryDB().transactionEnable().make();
|
||||||
|
|
||||||
|
NavigableSet<String> set = db
|
||||||
|
.treeSet("mySet")
|
||||||
|
.serializer(Serializer.STRING)
|
||||||
|
.createOrOpen();
|
||||||
|
|
||||||
|
set.add("One");
|
||||||
|
set.add("Two");
|
||||||
|
|
||||||
|
db.commit();
|
||||||
|
|
||||||
|
assertEquals(2, set.size());
|
||||||
|
|
||||||
|
set.add("Three");
|
||||||
|
|
||||||
|
assertEquals(3, set.size());
|
||||||
|
|
||||||
|
db.rollback();
|
||||||
|
|
||||||
|
assertEquals(2, set.size());
|
||||||
|
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,9 @@
|
|||||||
<version>${typesafe-akka.version}</version>
|
<version>${typesafe-akka.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.typesafe.akka</groupId>
|
<groupId>com.typesafe.akka</groupId>
|
||||||
<artifactId>akka-testkit_2.12</artifactId>
|
<artifactId>akka-testkit_2.12</artifactId>
|
||||||
@ -837,6 +840,7 @@
|
|||||||
<h2.version>1.4.196</h2.version>
|
<h2.version>1.4.196</h2.version>
|
||||||
<jnats.version>1.0</jnats.version>
|
<jnats.version>1.0</jnats.version>
|
||||||
|
|
||||||
|
|
||||||
<httpclient.version>4.5.3</httpclient.version>
|
<httpclient.version>4.5.3</httpclient.version>
|
||||||
<jackson.version>2.9.7</jackson.version>
|
<jackson.version>2.9.7</jackson.version>
|
||||||
<neuroph.version>2.92</neuroph.version>
|
<neuroph.version>2.92</neuroph.version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user