mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Updated a unit test for storing settings.
This commit is contained in:
@@ -514,21 +514,20 @@ public class H2DatabaseTest extends BriarTestCase {
|
|||||||
Database<Connection> db = open(false);
|
Database<Connection> db = open(false);
|
||||||
Connection txn = db.startTransaction();
|
Connection txn = db.startTransaction();
|
||||||
|
|
||||||
// Add a transport to the database
|
// Store some settings
|
||||||
db.addTransport(txn, transportId, 123);
|
|
||||||
|
|
||||||
// Set the transport config
|
|
||||||
Settings s = new Settings();
|
Settings s = new Settings();
|
||||||
s.put("foo", "foo");
|
s.put("foo", "foo");
|
||||||
s.put("bar", "bar");
|
s.put("bar", "bar");
|
||||||
db.mergeSettings(txn, s, "test");
|
db.mergeSettings(txn, s, "test");
|
||||||
assertEquals(s, db.getSettings(txn, "test"));
|
assertEquals(s, db.getSettings(txn, "test"));
|
||||||
|
|
||||||
// Update one of the properties and add another
|
// Update one of the settings and add another
|
||||||
Settings s1 = new Settings();
|
Settings s1 = new Settings();
|
||||||
s1.put("bar", "baz");
|
s1.put("bar", "baz");
|
||||||
s1.put("bam", "bam");
|
s1.put("bam", "bam");
|
||||||
db.mergeSettings(txn, s1, "test");
|
db.mergeSettings(txn, s1, "test");
|
||||||
|
|
||||||
|
// Check that the settings were merged
|
||||||
Settings merged = new Settings();
|
Settings merged = new Settings();
|
||||||
merged.put("foo", "foo");
|
merged.put("foo", "foo");
|
||||||
merged.put("bar", "baz");
|
merged.put("bar", "baz");
|
||||||
|
|||||||
Reference in New Issue
Block a user