Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-12-09 15:46:25 +0000
committerjmisinco2013-12-12 20:38:09 +0000
commitb080a40051b990baea9340fbd326b1bd823cfb63 (patch)
treec8ea64b216854feaac7e39fbc154f05caef25789 /plugins/org.eclipse.osee.framework.skynet.core.test
parentfe5e2d94c5a592a23ddbd7b6ae5ff60f9a449d49 (diff)
downloadorg.eclipse.osee-b080a40051b990baea9340fbd326b1bd823cfb63.tar.gz
org.eclipse.osee-b080a40051b990baea9340fbd326b1bd823cfb63.tar.xz
org.eclipse.osee-b080a40051b990baea9340fbd326b1bd823cfb63.zip
feature[ats_EPQBU]: Add support for match locations to search REST API
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequestTest.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequestTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequestTest.java
new file mode 100644
index 00000000000..e34cfffddcc
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequestTest.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.skynet.core.artifact.search;
+
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test Case for {@link SearchRequest}
+ *
+ * @author Roberto E. Escobar
+ */
+public class SearchRequestTest {
+
+ @Test
+ public void testDataDefaultOptions() {
+ SearchRequest request = new SearchRequest(CoreBranches.COMMON, "Search", new SearchOptions());
+ Assert.assertEquals(CoreBranches.COMMON, request.getBranch());
+ Assert.assertEquals("Search", request.getRawSearch());
+ assertEquals(new SearchOptions(), request.getOptions());
+ }
+
+ @Test
+ public void testDataNullConstructedOptions() {
+ SearchRequest request = new SearchRequest(CoreBranches.COMMON, "Search", new SearchOptions());
+ Assert.assertEquals(CoreBranches.COMMON, request.getBranch());
+ Assert.assertEquals("Search", request.getRawSearch());
+ assertEquals(new SearchOptions(), request.getOptions());
+ }
+
+ private static void assertEquals(SearchOptions expected, SearchOptions actual) {
+ if (expected == null) {
+ Assert.assertNull(actual);
+ } else {
+ Assert.assertEquals(expected.isSearchAll(), actual.isSearchAll());
+ Assert.assertEquals(expected.isCaseSensitive(), actual.isCaseSensitive());
+ Assert.assertEquals(expected.isFindAllLocationsEnabled(), actual.isFindAllLocationsEnabled());
+ Assert.assertEquals(expected.getDeletionFlag(), actual.getDeletionFlag());
+ Assert.assertEquals(expected.isMatchWordOrder(), actual.isMatchWordOrder());
+
+ Assert.assertTrue(Collections.isEqual(expected.getAttributeTypeFilter(), actual.getAttributeTypeFilter()));
+ }
+ }
+}

Back to the top