Skip to content

Commit

Permalink
test: optimized execution of some specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Oct 31, 2023
1 parent 3fc744d commit 0f410f1
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.orientechnologies.orient.core.index;

import org.junit.Test;

import com.orientechnologies.BaseMemoryDatabase;
import com.orientechnologies.orient.core.exception.OTooBigIndexKeyException;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OClass.INDEX_TYPE;
import com.orientechnologies.orient.core.metadata.schema.OProperty;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.impl.ODocument;
import org.junit.Test;

public class BigKeyIndexTest extends BaseMemoryDatabase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,6 @@ public void beforeTest() {
new OCommandSQL(
"insert into OCommandExecutorSQLSelectTest_aggregations set data = [{\"size\": 0}, {\"size\": 0}, {\"size\": 30}, {\"size\": 50}, {\"size\": 50}]"))
.execute();

initExpandSkipLimit(db);
initMassiveOrderSkipLimit(db);
initDatesSet(db);

initMatchesWithRegex(db);
initDistinctLimit(db);
initLinkListSequence(db);
initMaxLongNumber(db);
initFilterAndOrderByTest(db);
initComplexFilterInSquareBrackets(db);
initCollateOnLinked(db);
}

private static void initCollateOnLinked(ODatabaseDocument db) {
Expand Down Expand Up @@ -1090,6 +1078,7 @@ public void testNullProjection() {

@Test
public void testExpandSkipLimit() {
initExpandSkipLimit(db);
// issue #4985
OSQLSynchQuery sql =
new OSQLSynchQuery(
Expand Down Expand Up @@ -1139,6 +1128,7 @@ public void testOrderByEmbeddedParams2() {

@Test
public void testMassiveOrderAscSkipLimit() {
initMassiveOrderSkipLimit(db);
int skip = 1000;
OSQLSynchQuery sql =
new OSQLSynchQuery(
Expand All @@ -1154,6 +1144,7 @@ public void testMassiveOrderAscSkipLimit() {

@Test
public void testMassiveOrderDescSkipLimit() {
initMassiveOrderSkipLimit(db);
int skip = 1000;
OSQLSynchQuery sql =
new OSQLSynchQuery(
Expand Down Expand Up @@ -1187,6 +1178,7 @@ public void testIntersectExpandLet() {

@Test
public void testDatesListContainsString() {
initDatesSet(db);
// issue #3526
OSQLSynchQuery sql =
new OSQLSynchQuery(
Expand All @@ -1208,6 +1200,7 @@ public void testParamWithMatches() {

@Test
public void testParamWithMatchesQuoteRegex() {
initMatchesWithRegex(db);
// issue #5229
Map<String, Object> params = new HashMap<String, Object>();
params.put("param1", ".*admin[name].*"); // will not work
Expand All @@ -1221,6 +1214,7 @@ public void testParamWithMatchesQuoteRegex() {

@Test
public void testMatchesWithQuotes() {
initMatchesWithRegex(db);
// issue #5229
String pattern = Pattern.quote("adm") + ".*";
OSQLSynchQuery sql = new OSQLSynchQuery("SELECT FROM matchesstuff WHERE (name matches ?)");
Expand All @@ -1230,6 +1224,7 @@ public void testMatchesWithQuotes() {

@Test
public void testMatchesWithQuotes2() {
initMatchesWithRegex(db);
// issue #5229
OSQLSynchQuery sql =
new OSQLSynchQuery(
Expand All @@ -1240,6 +1235,7 @@ public void testMatchesWithQuotes2() {

@Test
public void testMatchesWithQuotes3() {
initMatchesWithRegex(db);
// issue #5229
OSQLSynchQuery sql =
new OSQLSynchQuery(
Expand Down Expand Up @@ -1267,6 +1263,7 @@ public void testParamWithMatchesAndNot() {

@Test
public void testDistinctLimit() {
initDistinctLimit(db);
OSQLSynchQuery sql = new OSQLSynchQuery("select distinct(name) from DistinctLimit limit 1");
List<ODocument> results = db.query(sql);
assertEquals(results.size(), 1);
Expand All @@ -1286,6 +1283,7 @@ public void testDistinctLimit() {

@Test
public void testSelectFromClusterNumber() {
initDistinctLimit(db);
OClass clazz = db.getMetadata().getSchema().getClass("DistinctLimit");
int clusterId = clazz.getClusterIds()[0];
OSQLSynchQuery sql = new OSQLSynchQuery("select from cluster:" + clusterId + " limit 1");
Expand All @@ -1295,6 +1293,7 @@ public void testSelectFromClusterNumber() {

@Test
public void testLinkListSequence1() {
initLinkListSequence(db);
OSQLSynchQuery sql =
new OSQLSynchQuery(
"select expand(children.children.children) from LinkListSequence where name = 'root'");
Expand All @@ -1308,6 +1307,7 @@ public void testLinkListSequence1() {

@Test
public void testLinkListSequence2() {
initLinkListSequence(db);
OSQLSynchQuery sql =
new OSQLSynchQuery(
"select expand(children[0].children.children) from LinkListSequence where name = 'root'");
Expand All @@ -1321,6 +1321,7 @@ public void testLinkListSequence2() {

@Test
public void testLinkListSequence3() {
initLinkListSequence(db);
OSQLSynchQuery sql =
new OSQLSynchQuery(
"select expand(children[0].children[0].children) from LinkListSequence where name = 'root'");
Expand All @@ -1334,6 +1335,7 @@ public void testLinkListSequence3() {

@Test
public void testMaxLongNumber() {
initMaxLongNumber(db);
// issue #5664
OSQLSynchQuery sql =
new OSQLSynchQuery("select from MaxLongNumberTest WHERE last < 10 OR last is null");
Expand All @@ -1348,6 +1350,7 @@ public void testMaxLongNumber() {

@Test
public void testFilterAndOrderBy() {
initFilterAndOrderByTest(db);
// issue http://www.prjhub.com/#/issues/6199

OSQLSynchQuery sql =
Expand All @@ -1372,6 +1375,7 @@ public void testFilterAndOrderBy() {

@Test
public void testComplexFilterInSquareBrackets() {
initComplexFilterInSquareBrackets(db);
// issues #513 #5451

OSQLSynchQuery sql =
Expand Down Expand Up @@ -1496,6 +1500,8 @@ public void testEvalLong() {

@Test
public void testCollateOnLinked() {
initCollateOnLinked(db);

List<ODocument> results =
db.query(
new OSQLSynchQuery<ODocument>(
Expand Down
Loading

0 comments on commit 0f410f1

Please sign in to comment.