-
Notifications
You must be signed in to change notification settings - Fork 872
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move tests to new base database API
- Loading branch information
Showing
14 changed files
with
360 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.orientechnologies.orient.core.index; | ||
|
||
import com.orientechnologies.orient.core.db.document.ODatabaseDocument; | ||
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; | ||
import com.orientechnologies.BaseMemoryDatabase; | ||
import com.orientechnologies.orient.core.id.ORID; | ||
import com.orientechnologies.orient.core.metadata.schema.OClass; | ||
import com.orientechnologies.orient.core.metadata.schema.OSchema; | ||
|
@@ -10,21 +9,11 @@ | |
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; | ||
import com.orientechnologies.orient.core.storage.ORecordDuplicatedException; | ||
import java.util.List; | ||
import org.junit.After; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** Created by tglman on 01/02/16. */ | ||
public class UniqueIndexTest { | ||
|
||
private ODatabaseDocument db; | ||
|
||
@Before | ||
public void before() { | ||
db = new ODatabaseDocumentTx("memory:" + UniqueIndexTest.class.getSimpleName()); | ||
db.create(); | ||
} | ||
public class UniqueIndexTest extends BaseMemoryDatabase { | ||
|
||
@Test() | ||
public void testUniqueOnUpdate() { | ||
|
@@ -63,19 +52,17 @@ public void testUniqueOnUpdateNegativeVersion() { | |
jane.save(); | ||
|
||
final ORID rid = jane.getIdentity(); | ||
db.close(); | ||
|
||
db.open("admin", "admin"); | ||
reOpen("admin", "adminpwd"); | ||
|
||
ODocument joneJane = db.load(rid); | ||
|
||
joneJane.field("MailAddress", "[email protected]"); | ||
joneJane.field("@version", -1); | ||
|
||
joneJane.save(); | ||
db.close(); | ||
|
||
db.open("admin", "admin"); | ||
reOpen("admin", "adminpwd"); | ||
|
||
try { | ||
ODocument toUp = new ODocument("User"); | ||
|
@@ -91,9 +78,4 @@ public void testUniqueOnUpdateNegativeVersion() { | |
new OSQLSynchQuery<ODocument>("select from User where MailAddress = '[email protected]'")); | ||
Assert.assertEquals(result.size(), 1); | ||
} | ||
|
||
@After | ||
public void after() { | ||
db.drop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.