From d5e7a0f66f639d42934074a751aa9af9f76a3ceb Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 17 Sep 2006 21:40:47 +0000 Subject: Finished replacing old query engine. --- .../carbonado/qe/TestIndexedQueryAnalyzer.java | 24 +++++++++------------- .../carbonado/qe/TestIndexedQueryExecutor.java | 18 ++++++++-------- .../carbonado/qe/TestJoinedQueryExecutor.java | 2 +- .../carbonado/qe/TestUnionQueryAnalyzer.java | 9 ++++++++ 4 files changed, 29 insertions(+), 24 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java index 29e094d..740f26c 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java +++ b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java @@ -309,26 +309,22 @@ public class TestIndexedQueryAnalyzer extends TestCase { throw new UnsupportedOperationException(); } - public Cursor fetch() { + public Cursor fetchAll() { throw new UnsupportedOperationException(); } - public Cursor fetch(StorableIndex index) { + public Cursor fetchOne(StorableIndex index, Object[] identityValues) { throw new UnsupportedOperationException(); } - public Cursor fetch(StorableIndex index, Object[] identityValues) { - throw new UnsupportedOperationException(); - } - - public Cursor fetch(StorableIndex index, - Object[] identityValues, - BoundaryType rangeStartBoundary, - Object rangeStartValue, - BoundaryType rangeEndBoundary, - Object rangeEndValue, - boolean reverseRange, - boolean reverseOrder) + public Cursor fetchSubset(StorableIndex index, + Object[] identityValues, + BoundaryType rangeStartBoundary, + Object rangeStartValue, + BoundaryType rangeEndBoundary, + Object rangeEndValue, + boolean reverseRange, + boolean reverseOrder) { throw new UnsupportedOperationException(); } diff --git a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java index 3226e13..4a4511e 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java +++ b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java @@ -680,7 +680,7 @@ public class TestIndexedQueryExecutor extends TestCase { assertEquals(values.getFilter(), executor.getFilter()); List> expectedOrdering = - makeOrdering(StorableTestBasic.class, "intProp", "-doubleProp", "stringProp"); + makeOrdering(StorableTestBasic.class, "stringProp"); assertEquals(expectedOrdering, executor.getOrdering()); } @@ -711,14 +711,14 @@ public class TestIndexedQueryExecutor extends TestCase { static class MockSupport implements IndexedQueryExecutor.Support { Mock mMock; - public Cursor fetch(StorableIndex index, - Object[] identityValues, - BoundaryType rangeStartBoundary, - Object rangeStartValue, - BoundaryType rangeEndBoundary, - Object rangeEndValue, - boolean reverseRange, - boolean reverseOrder) + public Cursor fetchSubset(StorableIndex index, + Object[] identityValues, + BoundaryType rangeStartBoundary, + Object rangeStartValue, + BoundaryType rangeEndBoundary, + Object rangeEndValue, + boolean reverseRange, + boolean reverseOrder) { mMock.mIdentityValues = identityValues; mMock.mRangeStartBoundary = rangeStartBoundary; diff --git a/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java index ac4ebea..423cd74 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java +++ b/src/test/java/com/amazon/carbonado/qe/TestJoinedQueryExecutor.java @@ -194,7 +194,7 @@ public class TestJoinedQueryExecutor extends TestQueryExecutor { return mQuery.getStorableType(); } - public Cursor fetch() throws FetchException { + public Cursor fetchAll() throws FetchException { return mQuery.fetch(); } } diff --git a/src/test/java/com/amazon/carbonado/qe/TestUnionQueryAnalyzer.java b/src/test/java/com/amazon/carbonado/qe/TestUnionQueryAnalyzer.java index 7488c5b..0278eab 100644 --- a/src/test/java/com/amazon/carbonado/qe/TestUnionQueryAnalyzer.java +++ b/src/test/java/com/amazon/carbonado/qe/TestUnionQueryAnalyzer.java @@ -68,6 +68,15 @@ public class TestUnionQueryAnalyzer extends TestCase { super(name); } + public void testNullFilter() throws Exception { + UnionQueryAnalyzer uqa = + new UnionQueryAnalyzer(Shipment.class, TestIndexedQueryAnalyzer.RepoAccess.INSTANCE); + UnionQueryAnalyzer.Result result = uqa.analyze(null, null); + List.Result> subResults = result.getSubResults(); + + assertEquals(1, subResults.size()); + } + public void testSingleSubResult() throws Exception { UnionQueryAnalyzer uqa = new UnionQueryAnalyzer(Shipment.class, TestIndexedQueryAnalyzer.RepoAccess.INSTANCE); -- cgit v1.2.3