test: update view refresh test for unique indexes
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
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;
@@ -351,6 +352,8 @@ public class OViewRefreshIT {
try (OResultSet result = db.query("SELECT FROM " + viewName)) {
Assert.assertEquals(30, result.stream().count());
}
+ } finally {
+ orientDB.drop(this.getClass().getSimpleName());
}
}
}
@@ -393,22 +396,22 @@ public class OViewRefreshIT {
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();
}
