-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: removed old API from core test cases
- Loading branch information
Showing
39 changed files
with
178 additions
and
898 deletions.
There are no files selected for viewing
43 changes: 14 additions & 29 deletions
43
core/src/test/java/com/orientechnologies/orient/core/db/ODatabaseCreateDropClusterTest.java
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,44 +1,29 @@ | ||
package com.orientechnologies.orient.core.db; | ||
|
||
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.metadata.schema.OClass; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class ODatabaseCreateDropClusterTest { | ||
public class ODatabaseCreateDropClusterTest extends BaseMemoryDatabase { | ||
|
||
@Test | ||
public void createDropCluster() { | ||
ODatabaseDocument db = | ||
new ODatabaseDocumentTx("memory:" + ODatabaseCreateDropClusterTest.class.getSimpleName()); | ||
db.create(); | ||
try { | ||
db.addCluster("test"); | ||
Assert.assertNotEquals(db.getClusterIdByName("test"), -1); | ||
db.dropCluster("test"); | ||
Assert.assertEquals(db.getClusterIdByName("test"), -1); | ||
} finally { | ||
db.drop(); | ||
} | ||
db.addCluster("test"); | ||
Assert.assertNotEquals(db.getClusterIdByName("test"), -1); | ||
db.dropCluster("test"); | ||
Assert.assertEquals(db.getClusterIdByName("test"), -1); | ||
} | ||
|
||
@Test | ||
public void createDropClusterOnClass() { | ||
ODatabaseDocument db = | ||
new ODatabaseDocumentTx("memory:" + ODatabaseCreateDropClusterTest.class.getSimpleName()); | ||
db.create(); | ||
try { | ||
OClass test = db.getMetadata().getSchema().createClass("test", 1, null); | ||
test.addCluster("aTest"); | ||
Assert.assertNotEquals(db.getClusterIdByName("aTest"), -1); | ||
Assert.assertEquals(test.getClusterIds().length, 2); | ||
db.dropCluster("aTest"); | ||
Assert.assertEquals(db.getClusterIdByName("aTest"), -1); | ||
test = db.getMetadata().getSchema().getClass("test"); | ||
Assert.assertEquals(test.getClusterIds().length, 1); | ||
} finally { | ||
db.drop(); | ||
} | ||
OClass test = db.getMetadata().getSchema().createClass("test", 1, null); | ||
test.addCluster("aTest"); | ||
Assert.assertNotEquals(db.getClusterIdByName("aTest"), -1); | ||
Assert.assertEquals(test.getClusterIds().length, 2); | ||
db.dropCluster("aTest"); | ||
Assert.assertEquals(db.getClusterIdByName("aTest"), -1); | ||
test = db.getMetadata().getSchema().getClass("test"); | ||
Assert.assertEquals(test.getClusterIds().length, 1); | ||
} | ||
} |
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
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.