summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java12
-rw-r--r--src/test/java/com/amazon/carbonado/qe/TestQueryExecutor.java13
-rw-r--r--src/test/java/com/amazon/carbonado/qe/TestSortedQueryExecutor.java6
3 files changed, 8 insertions, 23 deletions
diff --git a/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java
index e2c9f5e..7d352ed 100644
--- a/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java
+++ b/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java
@@ -175,16 +175,10 @@ public class TestJoinedQueryExecutor extends TestQueryExecutor {
addressExecutor = new FilteredQueryExecutor<UserAddress>
(addressExecutor, Filter.filterFor(UserAddress.class, "state = ?"));
- StorableProperty<UserAddress> prop = StorableIntrospector
- .examine(UserAddress.class).getAllProperties().get("country");
+ OrderingList<UserAddress> ordering = OrderingList.get(UserAddress.class, "+country");
- List<OrderedProperty<UserAddress>> orderings =
- new ArrayList<OrderedProperty<UserAddress>>();
-
- orderings.add(OrderedProperty.get(prop, Direction.ASCENDING));
-
- addressExecutor = new ArraySortedQueryExecutor<UserAddress>
- (addressExecutor, null, orderings);
+ addressExecutor =
+ new ArraySortedQueryExecutor<UserAddress>(addressExecutor, null, ordering);
return addressExecutor;
}
diff --git a/src/test/java/com/amazon/carbonado/qe/TestQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestQueryExecutor.java
index 4727a56..07558f1 100644
--- a/src/test/java/com/amazon/carbonado/qe/TestQueryExecutor.java
+++ b/src/test/java/com/amazon/carbonado/qe/TestQueryExecutor.java
@@ -83,17 +83,8 @@ public abstract class TestQueryExecutor extends TestCase {
}
}
- protected List<OrderedProperty<Address>> createOrdering(String... properties) {
- StorableInfo<Address> info = StorableIntrospector.examine(Address.class);
- Map<String, ? extends StorableProperty<Address>> props = info.getAllProperties();
-
- List<OrderedProperty<Address>> ordered = new ArrayList<OrderedProperty<Address>>();
-
- for (String prop : properties) {
- ordered.add(OrderedProperty.get(props.get(prop), Direction.ASCENDING));
- }
-
- return ordered;
+ protected OrderingList<Address> createOrdering(String... properties) {
+ return OrderingList.get(Address.class, properties);
}
static void printPlan(QueryExecutor executor) {
diff --git a/src/test/java/com/amazon/carbonado/qe/TestSortedQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestSortedQueryExecutor.java
index 9e9906f..8e1eda2 100644
--- a/src/test/java/com/amazon/carbonado/qe/TestSortedQueryExecutor.java
+++ b/src/test/java/com/amazon/carbonado/qe/TestSortedQueryExecutor.java
@@ -47,7 +47,7 @@ public class TestSortedQueryExecutor extends TestQueryExecutor {
QueryExecutor<Address> unsorted = createExecutor(4, 2, 3, 1);
Filter<Address> filter = Filter.getOpenFilter(Address.class);
FilterValues<Address> values = filter.initialFilterValues();
- List<OrderedProperty<Address>> ordered = createOrdering("addressCountry");
+ OrderingList<Address> ordered = createOrdering("addressCountry");
QueryExecutor<Address> executor =
new ArraySortedQueryExecutor<Address>(unsorted, null, ordered);
@@ -65,8 +65,8 @@ public class TestSortedQueryExecutor extends TestQueryExecutor {
QueryExecutor<Address> unsorted = createExecutor(1, 2, 3, 4);
Filter<Address> filter = Filter.getOpenFilter(Address.class);
FilterValues<Address> values = filter.initialFilterValues();
- List<OrderedProperty<Address>> handled = createOrdering("addressCountry");
- List<OrderedProperty<Address>> finisher = createOrdering("addressState");
+ OrderingList<Address> handled = createOrdering("addressCountry");
+ OrderingList<Address> finisher = createOrdering("addressState");
QueryExecutor<Address> executor =
new ArraySortedQueryExecutor<Address>(unsorted, handled, finisher);