Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2014-12-12 12:24:16 -0500
committerAngel Avila2014-12-12 12:24:16 -0500
commitfe063a6b01f790a5d1c81110ee89e3c4b7cbcbfe (patch)
treeaa834436dd1dcaf34c578c63f6a37373ffeae829 /plugins/org.eclipse.osee.orcs.db.test
parent087c777f6fb7efdd625d3838fbea1554aed614a7 (diff)
downloadorg.eclipse.osee-fe063a6b01f790a5d1c81110ee89e3c4b7cbcbfe.tar.gz
org.eclipse.osee-fe063a6b01f790a5d1c81110ee89e3c4b7cbcbfe.tar.xz
org.eclipse.osee-fe063a6b01f790a5d1c81110ee89e3c4b7cbcbfe.zip
feature[ats_ATS101638]: Add associated art id to BranchQuery
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.db.test')
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
index 6019aebcc9..9fa0a05968 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
@@ -36,6 +36,7 @@ import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.core.ds.OptionsUtil;
import org.eclipse.osee.orcs.core.ds.QueryData;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaAllBranches;
+import org.eclipse.osee.orcs.core.ds.criteria.CriteriaAssociatedArtId;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaBranchAncestorOf;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaBranchArchived;
import org.eclipse.osee.orcs.core.ds.criteria.CriteriaBranchChildOf;
@@ -458,6 +459,30 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(2L, iterator.next());
}
+ @Test
+ public void testAssociatedArtId() throws Exception {
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ " FROM \n" + //
+ "osee_branch br1\n" + //
+ " WHERE \n" + //
+ "br1.associated_art_id = ?\n" + //
+ " ORDER BY br1.branch_id";
+
+ queryData.addCriteria(new CriteriaAssociatedArtId(4));
+
+ QuerySqlContext context = queryEngine.createQueryContext(session, queryData);
+
+ assertEquals(expected, context.getSql());
+
+ List<Object> parameters = context.getParameters();
+ assertEquals(1, parameters.size());
+ List<AbstractJoinQuery> joins = context.getJoins();
+ assertEquals(0, joins.size());
+
+ Iterator<Object> iterator = parameters.iterator();
+ assertEquals(4, iterator.next());
+ }
+
private static Criteria ancestorOf(IOseeBranch child) {
return new CriteriaBranchAncestorOf(child);
}

Back to the top