Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-10-30 01:24:23 +0000
committerRoberto E. Escobar2012-10-30 01:24:23 +0000
commitc3673da8ce6273eb23f933f7f41da609e626d4fa (patch)
tree54fa86e1a1c725eefed42b03a0cf5b867c5b52ab /plugins/org.eclipse.osee.orcs.rest.test
parentfb6b30b35a249ad0444bda9626402fa8571a0ae8 (diff)
downloadorg.eclipse.osee-c3673da8ce6273eb23f933f7f41da609e626d4fa.tar.gz
org.eclipse.osee-c3673da8ce6273eb23f933f7f41da609e626d4fa.tar.xz
org.eclipse.osee-c3673da8ce6273eb23f933f7f41da609e626d4fa.zip
refactor: Update ORCS Rest Tests to use mock framework
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.rest.test')
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/AttributeTypePredicateHandlerTest.java37
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/ExistsTypePredicateHandlerTest.java29
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IdsPredicateHandlerTest.java27
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IsOfTypePredicateHandlerTest.java21
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/mocks/MockQueryBuilder.java228
6 files changed, 83 insertions, 264 deletions
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.rest.test/META-INF/MANIFEST.MF
index 69a0e15767e..f04e89f2e86 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.rest.test/META-INF/MANIFEST.MF
@@ -6,5 +6,8 @@ Bundle-Version: 0.11.0.qualifier
Fragment-Host: org.eclipse.osee.orcs.rest
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Eclipse Open System Engineering Environment
-Require-Bundle: org.junit
+Require-Bundle: org.junit,
+ org.mockito;bundle-version="1.9.0",
+ org.hamcrest.core,
+ org.objenesis
Import-Package: org.eclipse.osee.executor.admin
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/AttributeTypePredicateHandlerTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/AttributeTypePredicateHandlerTest.java
index e3794e88614..93e1cde28ca 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/AttributeTypePredicateHandlerTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/AttributeTypePredicateHandlerTest.java
@@ -21,12 +21,14 @@ import org.eclipse.osee.orcs.rest.internal.search.Predicate;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchFlag;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchMethod;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchOp;
-import org.eclipse.osee.orcs.rest.mocks.MockQueryBuilder;
import org.eclipse.osee.orcs.search.CaseType;
import org.eclipse.osee.orcs.search.Operator;
import org.eclipse.osee.orcs.search.QueryBuilder;
import org.eclipse.osee.orcs.search.StringOperator;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
/**
* @author John R. Misinco
@@ -54,6 +56,15 @@ public class AttributeTypePredicateHandlerTest {
}
+ // @formatter:off
+ @Mock private QueryBuilder builder;
+ // @formatter:on
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
@Test
public void testStringOperatorSelection() throws OseeCoreException {
TestAttributeTypePredicateHandler handler = new TestAttributeTypePredicateHandler();
@@ -62,25 +73,25 @@ public class AttributeTypePredicateHandlerTest {
List<String> values = Collections.singletonList("value");
Predicate testPredicate =
new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(StringOperator.TOKENIZED_ANY_ORDER, handler.stringOperator);
flags = Arrays.asList(SearchFlag.TOKENIZED_ORDERED);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(StringOperator.TOKENIZED_MATCH_ORDER, handler.stringOperator);
flags = Arrays.asList(SearchFlag.IGNORE_CASE);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(StringOperator.EQUALS, handler.stringOperator);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.NOT_EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(StringOperator.NOT_EQUALS, handler.stringOperator);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.IN, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(StringOperator.CONTAINS, handler.stringOperator);
}
@@ -92,17 +103,17 @@ public class AttributeTypePredicateHandlerTest {
List<String> values = Collections.singletonList("value");
Predicate testPredicate =
new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(CaseType.IGNORE_CASE, handler.ct);
flags = Arrays.asList(SearchFlag.TOKENIZED, SearchFlag.IGNORE_CASE);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(CaseType.IGNORE_CASE, handler.ct);
flags = Arrays.asList(SearchFlag.TOKENIZED, SearchFlag.MATCH_CASE);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(CaseType.MATCH_CASE, handler.ct);
}
@@ -114,19 +125,19 @@ public class AttributeTypePredicateHandlerTest {
List<String> values = Collections.singletonList("value");
Predicate testPredicate =
new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(Operator.EQUAL, handler.operator);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.GREATER_THAN, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(Operator.GREATER_THAN, handler.operator);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.LESS_THAN, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(Operator.LESS_THAN, handler.operator);
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.NOT_EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(Operator.NOT_EQUAL, handler.operator);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/ExistsTypePredicateHandlerTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/ExistsTypePredicateHandlerTest.java
index 22cca5ecc6c..0190a25b443 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/ExistsTypePredicateHandlerTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/ExistsTypePredicateHandlerTest.java
@@ -24,9 +24,11 @@ import org.eclipse.osee.orcs.rest.internal.search.Predicate;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchFlag;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchMethod;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchOp;
-import org.eclipse.osee.orcs.rest.mocks.MockQueryBuilder;
import org.eclipse.osee.orcs.search.QueryBuilder;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
/**
* @author John R. Misinco
@@ -52,6 +54,15 @@ public class ExistsTypePredicateHandlerTest {
}
+ // @formatter:off
+ @Mock private QueryBuilder builder;
+ // @formatter:on
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
@Test
public void testHandleRelationTypeSides() throws OseeCoreException {
TestExistsTypePredicateHandler handler = new TestExistsTypePredicateHandler();
@@ -62,7 +73,7 @@ public class ExistsTypePredicateHandlerTest {
String relationValue = "A12345";
List<String> values = Collections.singletonList(relationValue);
Predicate testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(1, handler.relations.size());
IRelationTypeSide side = handler.relations.iterator().next();
@@ -73,7 +84,7 @@ public class ExistsTypePredicateHandlerTest {
relationValue = "B12345";
values = Collections.singletonList(relationValue);
testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(1, handler.relations.size());
side = handler.relations.iterator().next();
@@ -85,7 +96,7 @@ public class ExistsTypePredicateHandlerTest {
String relationValue2 = "B34567";
values = Arrays.asList(relationValue1, relationValue2);
testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(2, handler.relations.size());
boolean sideAMatched = false, sideBMatched = false;
@@ -113,7 +124,7 @@ public class ExistsTypePredicateHandlerTest {
String attrUuid = "12345";
List<String> values = Collections.singletonList(attrUuid);
Predicate testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(1, handler.attributeTypes.size());
IAttributeType type = handler.attributeTypes.iterator().next();
@@ -124,7 +135,7 @@ public class ExistsTypePredicateHandlerTest {
String attrType2 = "34567";
values = Arrays.asList(attrType1, attrType2);
testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(2, handler.attributeTypes.size());
boolean attr1Matched = false, attr2Matched = false;
@@ -150,17 +161,17 @@ public class ExistsTypePredicateHandlerTest {
String value = "12A4G";
List<String> values = Collections.singletonList(value);
Predicate testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(0, handler.attributeTypes.size());
value = "A12A4G";
typeParameters = Collections.singletonList("relType");
values = Collections.singletonList(value);
testPredicate = new Predicate(SearchMethod.EXISTS_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(0, handler.relations.size());
testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, typeParameters, SearchOp.EQUALS, flags, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IdsPredicateHandlerTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IdsPredicateHandlerTest.java
index 5abc1845af6..703e2e9e412 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IdsPredicateHandlerTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IdsPredicateHandlerTest.java
@@ -19,9 +19,11 @@ import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.orcs.rest.internal.search.Predicate;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchMethod;
-import org.eclipse.osee.orcs.rest.mocks.MockQueryBuilder;
import org.eclipse.osee.orcs.search.QueryBuilder;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
/**
* @author John R. Misinco
@@ -34,19 +36,28 @@ public class IdsPredicateHandlerTest {
Collection<Integer> rawIds;
@Override
- protected QueryBuilder addGuids(QueryBuilder builder, Collection<String> guids) throws OseeCoreException {
+ protected QueryBuilder addGuids(QueryBuilder builder, Collection<String> guids) {
this.guids = guids;
return builder;
}
@Override
- protected QueryBuilder addIds(QueryBuilder builder, Collection<Integer> rawIds) throws OseeCoreException {
+ protected QueryBuilder addIds(QueryBuilder builder, Collection<Integer> rawIds) {
this.rawIds = rawIds;
return builder;
}
}
+ // @formatter:off
+ @Mock private QueryBuilder builder;
+ // @formatter:on
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
@Test
public void testHandle() throws OseeCoreException {
TestIdsPredicateHandler handler = new TestIdsPredicateHandler();
@@ -56,7 +67,7 @@ public class IdsPredicateHandlerTest {
String id1 = "12345";
List<String> values = Collections.singletonList(id1);
Predicate testPredicate = new Predicate(SearchMethod.IDS, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(1, handler.rawIds.size());
Assert.assertNull(handler.guids);
@@ -67,7 +78,7 @@ public class IdsPredicateHandlerTest {
String id2 = "AGUID234";
values = Collections.singletonList(id2);
testPredicate = new Predicate(SearchMethod.IDS, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertNull(handler.rawIds);
Assert.assertEquals(1, handler.guids.size());
@@ -77,7 +88,7 @@ public class IdsPredicateHandlerTest {
handler = new TestIdsPredicateHandler();
values = Arrays.asList(id1, id2);
testPredicate = new Predicate(SearchMethod.IDS, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(1, handler.rawIds.size());
Assert.assertEquals(1, handler.guids.size());
@@ -90,7 +101,7 @@ public class IdsPredicateHandlerTest {
public void testHandleBadValues() throws OseeCoreException {
TestIdsPredicateHandler handler = new TestIdsPredicateHandler();
Predicate testPredicate = new Predicate(SearchMethod.IDS, null, null, null, null);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
}
@Test(expected = OseeArgumentException.class)
@@ -99,6 +110,6 @@ public class IdsPredicateHandlerTest {
String id1 = "12345";
List<String> values = Collections.singletonList(id1);
Predicate testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IsOfTypePredicateHandlerTest.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IsOfTypePredicateHandlerTest.java
index 31dd51e01bf..f9d06d3130c 100644
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IsOfTypePredicateHandlerTest.java
+++ b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/internal/search/predicate/IsOfTypePredicateHandlerTest.java
@@ -20,9 +20,11 @@ import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.orcs.rest.internal.search.Predicate;
import org.eclipse.osee.orcs.rest.internal.search.dsl.SearchMethod;
-import org.eclipse.osee.orcs.rest.mocks.MockQueryBuilder;
import org.eclipse.osee.orcs.search.QueryBuilder;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
/**
* @author John R. Misinco
@@ -41,6 +43,15 @@ public class IsOfTypePredicateHandlerTest {
}
+ // @formatter:off
+ @Mock private QueryBuilder builder;
+ // @formatter:on
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
@Test
public void testHandle() throws OseeCoreException {
TestIsOfTypePredicateHandler handler = new TestIsOfTypePredicateHandler();
@@ -49,7 +60,7 @@ public class IsOfTypePredicateHandlerTest {
String id1 = "12345";
List<String> values = Collections.singletonList(id1);
Predicate testPredicate = new Predicate(SearchMethod.IS_OF_TYPE, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(1, handler.artTypes.size());
Assert.assertEquals(id1, handler.artTypes.iterator().next().getGuid().toString());
@@ -58,7 +69,7 @@ public class IsOfTypePredicateHandlerTest {
values = Arrays.asList(id1, id2);
testPredicate = new Predicate(SearchMethod.IS_OF_TYPE, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
Assert.assertEquals(2, handler.artTypes.size());
}
@@ -67,7 +78,7 @@ public class IsOfTypePredicateHandlerTest {
public void testHandleBadValues() throws OseeCoreException {
TestIsOfTypePredicateHandler handler = new TestIsOfTypePredicateHandler();
Predicate testPredicate = new Predicate(SearchMethod.IS_OF_TYPE, null, null, null, null);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
}
@Test(expected = OseeArgumentException.class)
@@ -76,6 +87,6 @@ public class IsOfTypePredicateHandlerTest {
String id1 = "12345";
List<String> values = Collections.singletonList(id1);
Predicate testPredicate = new Predicate(SearchMethod.ATTRIBUTE_TYPE, null, null, null, values);
- handler.handle(new MockQueryBuilder(), testPredicate);
+ handler.handle(builder, testPredicate);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/mocks/MockQueryBuilder.java b/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/mocks/MockQueryBuilder.java
deleted file mode 100644
index b2c91eb55c0..00000000000
--- a/plugins/org.eclipse.osee.orcs.rest.test/src/org/eclipse/osee/orcs/rest/mocks/MockQueryBuilder.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.rest.mocks;
-
-import java.util.Collection;
-import org.eclipse.osee.executor.admin.CancellableCallable;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
-import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.data.IRelationTypeSide;
-import org.eclipse.osee.framework.core.data.ResultSet;
-import org.eclipse.osee.orcs.data.ArtifactReadable;
-import org.eclipse.osee.orcs.data.AttributeReadable;
-import org.eclipse.osee.orcs.search.CaseType;
-import org.eclipse.osee.orcs.search.Match;
-import org.eclipse.osee.orcs.search.Operator;
-import org.eclipse.osee.orcs.search.QueryBuilder;
-import org.eclipse.osee.orcs.search.StringOperator;
-
-/**
- * @author John R. Misinco
- */
-public class MockQueryBuilder implements QueryBuilder {
-
- @Override
- public QueryBuilder includeCache() {
- return this;
- }
-
- @Override
- public QueryBuilder includeCache(boolean enabled) {
- return this;
- }
-
- @Override
- public boolean isCacheIncluded() {
- return false;
- }
-
- @Override
- public QueryBuilder includeDeleted() {
- return this;
- }
-
- @Override
- public QueryBuilder includeDeleted(boolean enabled) {
- return this;
- }
-
- @Override
- public boolean areDeletedIncluded() {
- return false;
- }
-
- @Override
- public QueryBuilder includeTypeInheritance() {
- return this;
- }
-
- @Override
- public QueryBuilder includeTypeInheritance(boolean enabled) {
- return this;
- }
-
- @Override
- public boolean isTypeInheritanceIncluded() {
- return false;
- }
-
- @Override
- public QueryBuilder fromTransaction(int transactionId) {
- return this;
- }
-
- @Override
- public int getFromTransaction() {
- return 0;
- }
-
- @Override
- public QueryBuilder headTransaction() {
- return this;
- }
-
- @Override
- public boolean isHeadTransaction() {
- return false;
- }
-
- @Override
- public QueryBuilder excludeCache() {
- return this;
- }
-
- @Override
- public QueryBuilder excludeDeleted() {
- return this;
- }
-
- @Override
- public QueryBuilder excludeTypeInheritance() {
- return this;
- }
-
- @Override
- public QueryBuilder resetToDefaults() {
- return this;
- }
-
- @Override
- public QueryBuilder andLocalId(int... artifactId) {
- return this;
- }
-
- @Override
- public QueryBuilder andLocalIds(Collection<Integer> artifactIds) {
- return this;
- }
-
- @Override
- public QueryBuilder andGuidsOrHrids(String... ids) {
- return this;
- }
-
- @Override
- public QueryBuilder andGuidsOrHrids(Collection<String> ids) {
- return this;
- }
-
- @Override
- public QueryBuilder andIds(IArtifactToken... artifactToken) {
- return this;
- }
-
- @Override
- public QueryBuilder andIds(Collection<? extends IArtifactToken> artifactTokens) {
- return this;
- }
-
- @Override
- public QueryBuilder andIsOfType(IArtifactType... artifactType) {
- return this;
- }
-
- @Override
- public QueryBuilder andIsOfType(Collection<? extends IArtifactType> artifactType) {
- return this;
- }
-
- @Override
- public QueryBuilder andExists(IAttributeType... attributeType) {
- return this;
- }
-
- @Override
- public QueryBuilder andExists(Collection<? extends IAttributeType> attributeTypes) {
- return this;
- }
-
- @Override
- public QueryBuilder andExists(IRelationTypeSide relationType) {
- return this;
- }
-
- @Override
- public QueryBuilder andNameEquals(String artifactName) {
- return this;
- }
-
- @Override
- public QueryBuilder and(IAttributeType attributeType, Operator operator, String value) {
- return this;
- }
-
- @Override
- public QueryBuilder and(IAttributeType attributeType, Operator operator, Collection<String> values) {
- return this;
- }
-
- @Override
- public QueryBuilder and(IAttributeType attributeType, StringOperator operator, CaseType match, String value) {
- return this;
- }
-
- @Override
- public QueryBuilder and(Collection<? extends IAttributeType> attributeTypes, StringOperator operator, CaseType match, String value) {
- return this;
- }
-
- @Override
- public ResultSet<ArtifactReadable> getResults() {
- return null;
- }
-
- @Override
- public ResultSet<Match<ArtifactReadable, AttributeReadable<?>>> getMatches() {
- return null;
- }
-
- @Override
- public int getCount() {
- return 0;
- }
-
- @Override
- public CancellableCallable<Integer> createCount() {
- return null;
- }
-
- @Override
- public CancellableCallable<ResultSet<ArtifactReadable>> createSearch() {
- return null;
- }
-
- @Override
- public CancellableCallable<ResultSet<Match<ArtifactReadable, AttributeReadable<?>>>> createSearchWithMatches() {
- return null;
- }
-
-} \ No newline at end of file

Back to the top