Skip to content

Commit

Permalink
test: update view refresh test for unique indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Feb 3, 2023
1 parent 2b9e783 commit 82b45e8
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.orientechnologies.orient.core.record.OElement;
import com.orientechnologies.orient.core.sql.executor.OResultSet;
import java.util.List;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -351,6 +352,8 @@ public void testOpenCloseRefresh() throws InterruptedException {
try (OResultSet result = db.query("SELECT FROM " + viewName)) {
Assert.assertEquals(30, result.stream().count());
}
} finally {
orientDB.drop(this.getClass().getSimpleName());
}
}
}
Expand Down Expand Up @@ -393,22 +396,22 @@ public void testRefreshFail() throws InterruptedException {
Object cl = result.next().getProperty("cl");
result.close();

for (int i = 0; i < 10; i++) {
for (int i = 10; i < 20; i++) {
OElement elem = db.newElement(className);
elem.setProperty("name", "name" + i);
elem.setProperty("surname", "surname" + i);
elem.save();
}

Thread.sleep(3000);
Thread.sleep(5000);
result =
db.query(
"select list(clusterIds) as cl from (SELECT expand(views) FROM metadata:schema)");
Object cl1 = result.next().getProperty("cl");
result.close();
assertEquals(cl, cl1);
assertEquals(((List<?>) cl1).size(), 1);
result = db.query("SELECT FROM " + viewName);
Assert.assertEquals(10, result.stream().count());
Assert.assertEquals(20, result.stream().count());

result.close();
}
Expand Down

0 comments on commit 82b45e8

Please sign in to comment.