Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2015-12-23 14:54:49 -0500
committerRyan D. Brooks2015-12-23 14:54:49 -0500
commit82b1c027fa407dcdeaae4676c91681e3cdd9fa6c (patch)
tree2c235ec876df29269b683ed69ecf2ef432375ec9 /plugins/org.eclipse.osee.orcs.db.test
parentad0d071519a7e37e8d6f81906c4c9690a3de3a31 (diff)
downloadorg.eclipse.osee-82b1c027fa407dcdeaae4676c91681e3cdd9fa6c.tar.gz
org.eclipse.osee-82b1c027fa407dcdeaae4676c91681e3cdd9fa6c.tar.xz
org.eclipse.osee-82b1c027fa407dcdeaae4676c91681e3cdd9fa6c.zip
refinement: Re-Organize, Format and Cleanup source
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/exchange/transformer/TransformerTestSuite.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java271
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/StorageTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java535
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java111
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassMatcherTest.java44
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/mocks/Utility.java2
12 files changed, 481 insertions, 524 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/exchange/transformer/TransformerTestSuite.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/exchange/transformer/TransformerTestSuite.java
index 2737728968..f4ba72dcf7 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/exchange/transformer/TransformerTestSuite.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/exchange/transformer/TransformerTestSuite.java
@@ -18,7 +18,7 @@ import org.junit.runners.Suite;
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({ //
-ExchangeTransformProviderTest.class, //
+ ExchangeTransformProviderTest.class, //
})
public class TransformerTestSuite {
//
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
index 558ae06c81..c2f98e01b2 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
@@ -42,6 +42,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+
/**
* Test Case for {@link DataFactoryImplTest} and {@link OrcsObjectFactoryImpl}
*
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
index 3db8f228c6..71f4887c11 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
@@ -26,9 +26,7 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.eclipse.osee.executor.admin.HasCancellation;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.LoadLevel;
@@ -281,15 +279,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -307,15 +304,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -357,15 +353,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithIds() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -382,15 +377,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithIdsAndTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.attr_type_id = jid2.id AND jid2.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.attr_type_id = jid2.id AND jid2.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -409,15 +403,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithIdAndType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -513,15 +506,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelations() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -537,15 +529,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsIncludeDeleted() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -562,15 +553,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -588,15 +578,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -607,12 +596,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(
- EXPECTED_HEAD_TX_ID,
- expectedLoadLevel,
- EXCLUDE_DELETED,
- expected,
- data(JQID),
+ verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID),
list(data(CoreRelationTypes.Default_Hierarchical__Child.getGuid(),
CoreRelationTypes.Dependency__Artifact.getGuid())));
}
@@ -621,15 +605,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithId() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -646,15 +629,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithIds() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -671,15 +653,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithIdsAndTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.rel_link_type_id = jid2.id AND jid2.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.rel_link_type_id = jid2.id AND jid2.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -691,12 +672,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(
- EXPECTED_HEAD_TX_ID,
- expectedLoadLevel,
- EXCLUDE_DELETED,
- expected,
- data(JQID, JQID),
+ verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID, JQID),
list(data(45, 55),
data(CoreRelationTypes.Default_Hierarchical__Child.getGuid(), CoreRelationTypes.Dependency__Artifact)));
}
@@ -705,15 +681,14 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithIdAndType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -756,15 +731,14 @@ public class DataLoaderFactoryImplTest {
@Test
public void testLoadArtifactIncludeDeletedAttributes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -782,15 +756,14 @@ public class DataLoaderFactoryImplTest {
@Test
public void testLoadArtifactIncludeDeletedRelations() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
- String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/StorageTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/StorageTest.java
index 6247db60a3..d2bd7a368f 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/StorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/StorageTest.java
@@ -112,7 +112,7 @@ public class StorageTest extends DataResourceTest {
Assert.assertEquals(store, loader.getResource());
Assert.assertTrue(store.isInitialized());
- // Second Acquire not allowed
+ // Second Acquire not allowed
loader.setContent(DATA_SET_2);
Assert.assertEquals(DATA_SET_1, store.getContent());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
index 02848e78ec..7fcd137830 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
@@ -24,7 +24,6 @@ import java.util.List;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.sql.OseeSql;
@@ -90,24 +89,24 @@ public class ArtifactQuerySqlContextFactoryImplTest {
private static final Criteria GUIDS = new CriteriaArtifactGuids(asList(GUID.create(), GUID.create()));
private static final Criteria IDS = new CriteriaArtifactIds(asList(1L, 2L, 3L, 4L, 5L));
private static final Criteria TYPES = new CriteriaArtifactType(null, asList(CoreArtifactTypes.CodeUnit), false);
- private static final Criteria ATTRIBUTE = new CriteriaAttributeOther(Collections.singleton(CoreAttributeTypes.Name),
- asList("Hello"));
+ private static final Criteria ATTRIBUTE =
+ new CriteriaAttributeOther(Collections.singleton(CoreAttributeTypes.Name), asList("Hello"));
private static final Criteria ATTR_TYPE_EXITS = new CriteriaAttributeTypeExists(asList(CoreAttributeTypes.Name));
- private static final Criteria REL_TYPE_EXISTS = new CriteriaRelationTypeExists(
- CoreRelationTypes.Default_Hierarchical__Child);
+ private static final Criteria REL_TYPE_EXISTS =
+ new CriteriaRelationTypeExists(CoreRelationTypes.Default_Hierarchical__Child);
- private static final Criteria ATTRIBUTE_KEYWORD = new CriteriaAttributeKeywords(false, asList(
- CoreAttributeTypes.Name, CoreAttributeTypes.WordTemplateContent), null, QUICK_SEARCH_VALUE,
- QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
- QueryOption.CASE__MATCH);
+ private static final Criteria ATTRIBUTE_KEYWORD =
+ new CriteriaAttributeKeywords(false, asList(CoreAttributeTypes.Name, CoreAttributeTypes.WordTemplateContent),
+ null, QUICK_SEARCH_VALUE, QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__MATCH,
+ QueryOption.TOKEN_COUNT__IGNORE, QueryOption.CASE__MATCH);
- private static final Criteria RELATED_TO = new CriteriaRelatedTo(CoreRelationTypes.Default_Hierarchical__Child,
- asList(45, 61));
+ private static final Criteria RELATED_TO =
+ new CriteriaRelatedTo(CoreRelationTypes.Default_Hierarchical__Child, asList(45, 61));
private static final Criteria ALL_ARTIFACTS = new CriteriaAllArtifacts();
- private static final Criteria FOLLOW_RELATION_TYPE = new CriteriaRelationTypeFollow(
- CoreRelationTypes.Default_Hierarchical__Child);
+ private static final Criteria FOLLOW_RELATION_TYPE =
+ new CriteriaRelationTypeFollow(CoreRelationTypes.Default_Hierarchical__Child);
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -182,16 +181,15 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testCount() throws Exception {
- String expected =
- "SELECT/*+ ordered */ count(art2.art_id)\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?";
+ String expected = "SELECT/*+ ordered */ count(art2.art_id)\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?";
queryData.addCriteria(GUIDS, IDS, TYPES);
@@ -221,7 +219,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
"art1.art_type_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
- " AND \n" + //
+ " AND \n" + //
"txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
" GROUP BY art1.art_id, txs1.branch_id\n" + //
") xTable";
@@ -247,17 +245,16 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQuery() throws Exception {
- String expected =
- "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, IDS, TYPES);
@@ -281,17 +278,16 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQuerySqlIncludeDeleted() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current IN (1, 2, 3) AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current IN (1, 2, 3) AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, IDS, TYPES);
OptionsUtil.setIncludeDeletedArtifacts(queryData.getOptions(), true);
@@ -315,31 +311,30 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryHistorical() throws OseeCoreException {
- String expected =
- "WITH artUuid1 AS ( \n" + //
- "SELECT max(txs.transaction_id) as transaction_id, art.art_id as art_id\n" + //
- " FROM osee_txs txs, osee_artifact art, osee_join_char_id id\n" + //
- " WHERE txs.gamma_id = art.gamma_id\n" + //
- " AND art.guid = id.id AND id.query_id = ? AND txs.transaction_id <= ? AND txs.branch_id = ?\n" + //
- " GROUP BY art.art_id\n" + //
- " )\n" + //
- "SELECT max(txs2.transaction_id) as transaction_id, art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, artUuid1\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
- " AND \n" + //
- "txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ?\n" + //
- " AND \n" + //
- "artUuid1.transaction_id = txs2.transaction_id AND artUuid1.art_id = art2.art_id AND art2.gamma_id = txs2.gamma_id AND txs2.transaction_id <= ?\n" + //
- " AND \n" + //"
- "txs2.mod_type <> 3 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " GROUP BY art2.art_id, txs2.branch_id\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "WITH artUuid1 AS ( \n" + //
+ "SELECT max(txs.transaction_id) as transaction_id, art.art_id as art_id\n" + //
+ " FROM osee_txs txs, osee_artifact art, osee_join_char_id id\n" + //
+ " WHERE txs.gamma_id = art.gamma_id\n" + //
+ " AND art.guid = id.id AND id.query_id = ? AND txs.transaction_id <= ? AND txs.branch_id = ?\n" + //
+ " GROUP BY art.art_id\n" + //
+ " )\n" + //
+ "SELECT max(txs2.transaction_id) as transaction_id, art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, artUuid1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
+ " AND \n" + //
+ "txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ?\n" + //
+ " AND \n" + //
+ "artUuid1.transaction_id = txs2.transaction_id AND artUuid1.art_id = art2.art_id AND art2.gamma_id = txs2.gamma_id AND txs2.transaction_id <= ?\n" + //
+ " AND \n" + //"
+ "txs2.mod_type <> 3 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " GROUP BY art2.art_id, txs2.branch_id\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, IDS, TYPES);
OptionsUtil.setFromTransaction(queryData.getOptions(), EXPECTED_TX_ID);
@@ -374,60 +369,59 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryHistoricalMultipleItems() throws OseeCoreException {
- String expected =
- "WITH artUuid1 AS ( \n" + //
- "SELECT max(txs.transaction_id) as transaction_id, art.art_id as art_id\n" + //
- " FROM osee_txs txs, osee_artifact art, osee_join_char_id id\n" + //
- " WHERE txs.gamma_id = art.gamma_id\n" + //
- " AND art.guid = id.id AND id.query_id = ? AND txs.transaction_id <= ? AND txs.branch_id = ?\n" + //
- " GROUP BY art.art_id\n" + //
- " ), \n" + //
- " attrExt1 AS ( \n" + //
- "SELECT max(txs.transaction_id) as transaction_id, attr.art_id as art_id\n" + //
- " FROM osee_txs txs, osee_attribute attr\n" + //
- " WHERE txs.gamma_id = attr.gamma_id\n" + //
- " AND att.attr_type_id = ? AND txs.transaction_id <= ? AND txs.branch_id = ?\n" + //
- " GROUP BY attr.art_id\n" + //
- " )\n" + //
- "SELECT max(txs2.transaction_id) as transaction_id, art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, osee_attribute att1, osee_txs txs3, osee_relation_link rel1, osee_txs txs4, artUuid1, attrExt1\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
- " AND \n" + //
- "txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ?\n" + //
- " AND \n" + //
- "artUuid1.transaction_id = txs2.transaction_id AND artUuid1.art_id = art2.art_id AND art2.gamma_id = txs2.gamma_id AND txs2.transaction_id <= ?\n" + //
- " AND \n" + //
- "txs2.mod_type <> 3 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " AND \n" + //
- "att1.attr_type_id = ?\n" + //
- " AND \n" + //
- "att1.art_id = art1.art_id AND att1.art_id = art2.art_id\n" + //
- " AND \n" + //
- "attrExt1.transaction_id = txs3.transaction_id AND attrExt1.art_id = att1.art_id\n" + //
- " AND \n" + //
- "att1.gamma_id = txs3.gamma_id AND txs3.transaction_id <= ?\n" + //
- " AND \n" + //
- "txs3.mod_type <> 3 AND txs3.branch_id = ?\n" + //
- " AND \n" + //
- "rel1.rel_link_type_id = ?\n" + //
- " AND \n" + //
- "(rel1.a_art_id = art1.art_id OR rel1.b_art_id = art1.art_id)\n" + //
- " AND \n" + //
- "(rel1.a_art_id = art2.art_id OR rel1.b_art_id = art2.art_id)\n" + //
- " AND \n" + //
- "rel1.gamma_id = txs4.gamma_id\n" + //
- " AND \n" + //
- "txs4.transaction_id <= ?\n" + //
- " AND \n" + //
- "txs4.mod_type <> 3 AND txs4.branch_id = ?\n" + //
- " GROUP BY art2.art_id, txs2.branch_id\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "WITH artUuid1 AS ( \n" + //
+ "SELECT max(txs.transaction_id) as transaction_id, art.art_id as art_id\n" + //
+ " FROM osee_txs txs, osee_artifact art, osee_join_char_id id\n" + //
+ " WHERE txs.gamma_id = art.gamma_id\n" + //
+ " AND art.guid = id.id AND id.query_id = ? AND txs.transaction_id <= ? AND txs.branch_id = ?\n" + //
+ " GROUP BY art.art_id\n" + //
+ " ), \n" + //
+ " attrExt1 AS ( \n" + //
+ "SELECT max(txs.transaction_id) as transaction_id, attr.art_id as art_id\n" + //
+ " FROM osee_txs txs, osee_attribute attr\n" + //
+ " WHERE txs.gamma_id = attr.gamma_id\n" + //
+ " AND att.attr_type_id = ? AND txs.transaction_id <= ? AND txs.branch_id = ?\n" + //
+ " GROUP BY attr.art_id\n" + //
+ " )\n" + //
+ "SELECT max(txs2.transaction_id) as transaction_id, art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, osee_attribute att1, osee_txs txs3, osee_relation_link rel1, osee_txs txs4, artUuid1, attrExt1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
+ " AND \n" + //
+ "txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ?\n" + //
+ " AND \n" + //
+ "artUuid1.transaction_id = txs2.transaction_id AND artUuid1.art_id = art2.art_id AND art2.gamma_id = txs2.gamma_id AND txs2.transaction_id <= ?\n" + //
+ " AND \n" + //
+ "txs2.mod_type <> 3 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " AND \n" + //
+ "att1.attr_type_id = ?\n" + //
+ " AND \n" + //
+ "att1.art_id = art1.art_id AND att1.art_id = art2.art_id\n" + //
+ " AND \n" + //
+ "attrExt1.transaction_id = txs3.transaction_id AND attrExt1.art_id = att1.art_id\n" + //
+ " AND \n" + //
+ "att1.gamma_id = txs3.gamma_id AND txs3.transaction_id <= ?\n" + //
+ " AND \n" + //
+ "txs3.mod_type <> 3 AND txs3.branch_id = ?\n" + //
+ " AND \n" + //
+ "rel1.rel_link_type_id = ?\n" + //
+ " AND \n" + //
+ "(rel1.a_art_id = art1.art_id OR rel1.b_art_id = art1.art_id)\n" + //
+ " AND \n" + //
+ "(rel1.a_art_id = art2.art_id OR rel1.b_art_id = art2.art_id)\n" + //
+ " AND \n" + //
+ "rel1.gamma_id = txs4.gamma_id\n" + //
+ " AND \n" + //
+ "txs4.transaction_id <= ?\n" + //
+ " AND \n" + //
+ "txs4.mod_type <> 3 AND txs4.branch_id = ?\n" + //
+ " GROUP BY art2.art_id, txs2.branch_id\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, IDS, TYPES, ATTR_TYPE_EXITS, REL_TYPE_EXISTS);
OptionsUtil.setFromTransaction(queryData.getOptions(), EXPECTED_TX_ID);
@@ -471,13 +465,12 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryGuids() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " ORDER BY art1.art_id, txs1.branch_id";
+ String expected = "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " ORDER BY art1.art_id, txs1.branch_id";
queryData.addCriteria(IDS);
@@ -497,7 +490,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryArtifactTypes() throws OseeCoreException {
- String expected = "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
+ String expected = "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
" FROM \n" + //
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
@@ -522,12 +515,12 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryAttribute() throws OseeCoreException {
- String expected = "SELECT/*+ ordered */ art1.art_id, txs2.branch_id\n" + //
+ String expected = "SELECT/*+ ordered */ art1.art_id, txs2.branch_id\n" + //
" FROM \n" + //
"osee_attribute att1, osee_txs txs1, osee_artifact art1, osee_txs txs2\n" + //
" WHERE \n" + //
"att1.attr_type_id = ? AND att1.value = ?\n" + //
- " AND \n" + //
+ " AND \n" + //
"art1.art_id = att1.art_id AND att1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
" AND \n" + //
"art1.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
@@ -553,7 +546,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryAtttributeKeyword() throws OseeCoreException {
- String expected = "WITH gamma1 AS ( \n" + //
+ String expected = "WITH gamma1 AS ( \n" + //
" ( \n" + //
" SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
" INTERSECT \n" + //
@@ -561,7 +554,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
" INTERSECT \n" + //
" SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
" ) \n" + //
- " ), \n" + //
+ " ), \n" + //
" att1 AS ( \n" + //
" SELECT art_id FROM osee_attribute att, osee_txs txs, osee_join_id jid1, gamma1\n" + //
" WHERE \n" + //
@@ -575,7 +568,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
" WHERE \n" + //
"art1.art_id = att1.art_id\n" + //
" AND \n" + //
- "txs1.gamma_id = art1.gamma_id\n" + //
+ "txs1.gamma_id = art1.gamma_id\n" + //
" AND \n" + //
"txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
" ORDER BY art1.art_id, txs1.branch_id";
@@ -661,36 +654,35 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryExistsNoBranch() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, " + //
- "osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, " + //
- "osee_attribute att1, osee_txs txs3, " + //
- "osee_relation_link rel1, osee_txs txs4\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " AND \n" + //
- "att1.attr_type_id = ?\n" + //
- " AND \n" + //
- "att1.art_id = art1.art_id AND att1.art_id = art2.art_id\n" + //
- " AND \n" + //
- "att1.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
- " AND \n" + //
- "rel1.rel_link_type_id = ?\n" + //
- " AND \n" + //
- "(rel1.a_art_id = art1.art_id OR rel1.b_art_id = art1.art_id)\n" + //
- " AND \n" + //
- "(rel1.a_art_id = art2.art_id OR rel1.b_art_id = art2.art_id)\n" + //
- " AND \n" + //
- "rel1.gamma_id = txs4.gamma_id\n" + //
- " AND \n" + //
- "txs4.tx_current = 1 AND txs4.branch_id = ?\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, " + //
+ "osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, " + //
+ "osee_attribute att1, osee_txs txs3, " + //
+ "osee_relation_link rel1, osee_txs txs4\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " AND \n" + //
+ "att1.attr_type_id = ?\n" + //
+ " AND \n" + //
+ "att1.art_id = art1.art_id AND att1.art_id = art2.art_id\n" + //
+ " AND \n" + //
+ "att1.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
+ " AND \n" + //
+ "rel1.rel_link_type_id = ?\n" + //
+ " AND \n" + //
+ "(rel1.a_art_id = art1.art_id OR rel1.b_art_id = art1.art_id)\n" + //
+ " AND \n" + //
+ "(rel1.a_art_id = art2.art_id OR rel1.b_art_id = art2.art_id)\n" + //
+ " AND \n" + //
+ "rel1.gamma_id = txs4.gamma_id\n" + //
+ " AND \n" + //
+ "txs4.tx_current = 1 AND txs4.branch_id = ?\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, TYPES, REL_TYPE_EXISTS, IDS, ATTR_TYPE_EXITS);
@@ -716,36 +708,35 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryExistsWithBranch() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, " + //
- "osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, " + //
- "osee_attribute att1, osee_txs txs3, " + //
- "osee_relation_link rel1, osee_txs txs4\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " AND \n" + //
- "att1.attr_type_id = ?\n" + //
- " AND \n" + //
- "att1.art_id = art1.art_id AND att1.art_id = art2.art_id\n" + //
- " AND \n" + //
- "att1.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
- " AND \n" + //
- "rel1.rel_link_type_id = ?\n" + //
- " AND \n" + //
- "(rel1.a_art_id = art1.art_id OR rel1.b_art_id = art1.art_id)\n" + //
- " AND \n" + //
- "(rel1.a_art_id = art2.art_id OR rel1.b_art_id = art2.art_id)\n" + //
- " AND \n" + //
- "rel1.gamma_id = txs4.gamma_id\n" + //
- " AND \n" + //
- "txs4.tx_current = 1 AND txs4.branch_id = ?\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, " + //
+ "osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, " + //
+ "osee_attribute att1, osee_txs txs3, " + //
+ "osee_relation_link rel1, osee_txs txs4\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " AND \n" + //
+ "att1.attr_type_id = ?\n" + //
+ " AND \n" + //
+ "att1.art_id = art1.art_id AND att1.art_id = art2.art_id\n" + //
+ " AND \n" + //
+ "att1.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
+ " AND \n" + //
+ "rel1.rel_link_type_id = ?\n" + //
+ " AND \n" + //
+ "(rel1.a_art_id = art1.art_id OR rel1.b_art_id = art1.art_id)\n" + //
+ " AND \n" + //
+ "(rel1.a_art_id = art2.art_id OR rel1.b_art_id = art2.art_id)\n" + //
+ " AND \n" + //
+ "rel1.gamma_id = txs4.gamma_id\n" + //
+ " AND \n" + //
+ "txs4.tx_current = 1 AND txs4.branch_id = ?\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, TYPES, REL_TYPE_EXISTS, IDS, ATTR_TYPE_EXITS);
@@ -775,27 +766,26 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testRelatedTo() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, osee_join_id jid2, osee_relation_link rel1, osee_txs txs3\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
- " AND \n" + //
- "rel1.rel_link_type_id = ? AND rel1.b_art_id = jid2.id AND jid2.query_id = ?\n" + //
- " AND \n" + //
- "rel1.a_art_id = art1.art_id\n" + //
- " AND \n" + //
- "rel1.a_art_id = art2.art_id\n" + //
- " AND \n" + //
- "rel1.gamma_id = txs3.gamma_id\n" + //
- " AND \n" + //
- "txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
- " ORDER BY art2.art_id, txs2.branch_id";
+ String expected = "SELECT/*+ ordered */ art2.art_id, txs2.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1, osee_join_char_id jch1, osee_artifact art2, osee_txs txs2, osee_join_id jid2, osee_relation_link rel1, osee_txs txs3\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art2.guid = jch1.id AND jch1.query_id = ? AND art2.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_type_id = ? AND art2.art_type_id = ?\n" + //
+ " AND \n" + //
+ "rel1.rel_link_type_id = ? AND rel1.b_art_id = jid2.id AND jid2.query_id = ?\n" + //
+ " AND \n" + //
+ "rel1.a_art_id = art1.art_id\n" + //
+ " AND \n" + //
+ "rel1.a_art_id = art2.art_id\n" + //
+ " AND \n" + //
+ "rel1.gamma_id = txs3.gamma_id\n" + //
+ " AND \n" + //
+ "txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
+ " ORDER BY art2.art_id, txs2.branch_id";
queryData.addCriteria(GUIDS, TYPES, IDS, RELATED_TO);
@@ -823,7 +813,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testCountAllArtifactsFromBranch() throws OseeCoreException {
- String expected = "SELECT/*+ ordered */ count(art1.art_id)\n" + //
+ String expected = "SELECT/*+ ordered */ count(art1.art_id)\n" + //
" FROM \n" + //
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
@@ -852,7 +842,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
"art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
- " AND \n" + //
+ " AND \n" + //
"txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
" GROUP BY art1.art_id, txs1.branch_id\n" + //
") xTable";
@@ -876,7 +866,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryAllArtifactsFromBranch() throws OseeCoreException {
- String expected = "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
+ String expected = "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
" FROM \n" + //
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
@@ -901,12 +891,12 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testQueryAllArtifactsFromBranchHistorical() throws OseeCoreException {
String expected =
- "SELECT/*+ ordered */ max(txs1.transaction_id) as transaction_id, art1.art_id, txs1.branch_id\n" + //
+ "SELECT/*+ ordered */ max(txs1.transaction_id) as transaction_id, art1.art_id, txs1.branch_id\n" + //
" FROM \n" + //
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
"art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + //
- " AND \n" + //
+ " AND \n" + //
"txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + //
" GROUP BY art1.art_id, txs1.branch_id\n" + //
" ORDER BY art1.art_id, txs1.branch_id";
@@ -930,13 +920,12 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testAllArtifactWithOtherCriteria() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
- " FROM \n" + //
- "osee_join_id jid1, osee_artifact art1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " ORDER BY art1.art_id, txs1.branch_id";
+ String expected = "SELECT/*+ ordered */ art1.art_id, txs1.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_id jid1, osee_artifact art1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jid1.id AND jid1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " ORDER BY art1.art_id, txs1.branch_id";
queryData.addCriteria(ALL_ARTIFACTS, IDS);
@@ -961,14 +950,14 @@ public class ArtifactQuerySqlContextFactoryImplTest {
"osee_artifact art1, osee_txs txs1\n" + //
" WHERE \n" + //
"art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
+ " AND \n" + //
"NOT EXISTS (SELECT 1 FROM osee_relation_link rel, osee_txs txs WHERE rel.rel_link_type_id = ?\n" + //
" AND \n" + //
"(rel.a_art_id = art1.art_id OR rel.b_art_id = art1.art_id)\n" + //
" AND \n" + //
"rel.gamma_id = txs.gamma_id\n" + //
" AND \n" + //
- "txs.tx_current = 1 AND txs.branch_id = ?)\n" + //
+ "txs.tx_current = 1 AND txs.branch_id = ?)\n" + //
" ORDER BY art1.art_id, txs1.branch_id";
Criteria relTypeNotExists = new CriteriaRelationTypeNotExists(CoreRelationTypes.Default_Hierarchical__Child);
@@ -1027,7 +1016,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
" AND \n" + //
"rel1.b_art_id = art1.art_id\n" + //
" AND \n" + //
- "rel1.gamma_id = txs2.gamma_id\n" + //
+ "rel1.gamma_id = txs2.gamma_id\n" + //
" AND \n" + //
"txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
" ORDER BY art1.art_id, txs1.branch_id";
@@ -1047,17 +1036,16 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testRelationTypeFollow() throws OseeCoreException {
- String expected =
- "SELECT/*+ ordered */ art2.art_id, txs3.branch_id\n" + //
- " FROM \n" + //
- "osee_artifact art1, osee_txs txs1, osee_relation_link rel1, osee_txs txs2, osee_artifact art2, osee_txs txs3\n" + //
- " WHERE \n" + //
- "art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "rel1.rel_link_type_id = ? AND rel1.a_art_id = art1.art_id AND rel1.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "rel1.b_art_id = art2.art_id AND art2.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
- " ORDER BY art2.art_id, txs3.branch_id";
+ String expected = "SELECT/*+ ordered */ art2.art_id, txs3.branch_id\n" + //
+ " FROM \n" + //
+ "osee_artifact art1, osee_txs txs1, osee_relation_link rel1, osee_txs txs2, osee_artifact art2, osee_txs txs3\n" + //
+ " WHERE \n" + //
+ "art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "rel1.rel_link_type_id = ? AND rel1.a_art_id = art1.art_id AND rel1.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "rel1.b_art_id = art2.art_id AND art2.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
+ " ORDER BY art2.art_id, txs3.branch_id";
queryData.addCriteria(FOLLOW_RELATION_TYPE);
@@ -1079,35 +1067,34 @@ public class ArtifactQuerySqlContextFactoryImplTest {
@Test
public void testRelationTypeFollowCombined() throws OseeCoreException {
- String expected =
- "WITH gamma1 AS ( \n" + //
- " ( \n" + //
- " SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
- " INTERSECT \n" + //
- " SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
- " INTERSECT \n" + //
- " SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
- " ) \n" + //
- " ), \n" + //
- " att1 AS ( \n" + //
- " SELECT art_id FROM osee_attribute att, osee_txs txs, osee_join_id jid1, gamma1\n" + //
- " WHERE \n" + //
- " att.gamma_id = gamma1.gamma_id AND att.attr_type_id = jid1.id AND jid1.query_id = ?\n" + //
- " AND \n" + //
- " att.gamma_id = txs.gamma_id AND txs.tx_current = 1 AND txs.branch_id = ?\n" + //
- " )\n" + //
- "SELECT art2.art_id, txs3.branch_id\n" + //
- " FROM \n" + //
- "osee_join_char_id jch1, osee_artifact art1, osee_txs txs1, osee_relation_link rel1, osee_txs txs2, osee_artifact art2, osee_txs txs3, att1\n" + //
- " WHERE \n" + //
- "art1.guid = jch1.id AND jch1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
- " AND \n" + //
- "art1.art_id = att1.art_id\n" + //
- " AND \n" + //
- "rel1.rel_link_type_id = ? AND rel1.a_art_id = art1.art_id AND rel1.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
- " AND \n" + //
- "rel1.b_art_id = art2.art_id AND art2.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
- " ORDER BY art2.art_id, txs3.branch_id";
+ String expected = "WITH gamma1 AS ( \n" + //
+ " ( \n" + //
+ " SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
+ " INTERSECT \n" + //
+ " SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
+ " INTERSECT \n" + //
+ " SELECT gamma_id FROM osee_search_tags WHERE coded_tag_id = ?\n" + //
+ " ) \n" + //
+ " ), \n" + //
+ " att1 AS ( \n" + //
+ " SELECT art_id FROM osee_attribute att, osee_txs txs, osee_join_id jid1, gamma1\n" + //
+ " WHERE \n" + //
+ " att.gamma_id = gamma1.gamma_id AND att.attr_type_id = jid1.id AND jid1.query_id = ?\n" + //
+ " AND \n" + //
+ " att.gamma_id = txs.gamma_id AND txs.tx_current = 1 AND txs.branch_id = ?\n" + //
+ " )\n" + //
+ "SELECT art2.art_id, txs3.branch_id\n" + //
+ " FROM \n" + //
+ "osee_join_char_id jch1, osee_artifact art1, osee_txs txs1, osee_relation_link rel1, osee_txs txs2, osee_artifact art2, osee_txs txs3, att1\n" + //
+ " WHERE \n" + //
+ "art1.guid = jch1.id AND jch1.query_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 AND txs1.branch_id = ?\n" + //
+ " AND \n" + //
+ "art1.art_id = att1.art_id\n" + //
+ " AND \n" + //
+ "rel1.rel_link_type_id = ? AND rel1.a_art_id = art1.art_id AND rel1.gamma_id = txs2.gamma_id AND txs2.tx_current = 1 AND txs2.branch_id = ?\n" + //
+ " AND \n" + //
+ "rel1.b_art_id = art2.art_id AND art2.gamma_id = txs3.gamma_id AND txs3.tx_current = 1 AND txs3.branch_id = ?\n" + //
+ " ORDER BY art2.art_id, txs3.branch_id";
queryData.addCriteria(ATTRIBUTE_KEYWORD, FOLLOW_RELATION_TYPE, GUIDS);
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 6c849fd255..ab081bb00b 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
@@ -116,7 +116,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testCount() throws Exception {
- String expected = "SELECT/*+ ordered */ count(br1.branch_id)\n" + //
+ String expected = "SELECT/*+ ordered */ count(br1.branch_id)\n" + //
" FROM \n" + //
"osee_join_id jid1, osee_branch br1, osee_join_id jid2\n" + //
" WHERE \n" + //
@@ -144,7 +144,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryUuidIdsTypes() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_join_id jid1, osee_branch br1, osee_join_id jid2\n" + //
" WHERE \n" + //
@@ -173,7 +173,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryAllBranches() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_branch br1\n" + //
" ORDER BY br1.branch_id";
@@ -192,7 +192,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryUuidIdsTypesSingles() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_branch br1\n" + //
" WHERE \n" + //
@@ -219,7 +219,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryName() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_branch br1\n" + //
" WHERE \n" + //
@@ -243,7 +243,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryNamePattern() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_branch br1\n" + //
" WHERE \n" + //
@@ -269,7 +269,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryStateArchive() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_join_id jid1, osee_branch br1\n" + //
" WHERE \n" + //
@@ -297,7 +297,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQuerySingleStateArchive() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_branch br1\n" + //
" WHERE \n" + //
@@ -324,19 +324,18 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryChildOf() throws OseeCoreException {
- String expected =
- "WITH chof1 (child_id, branch_level) AS ( \n" + //
- " SELECT anch_br1.branch_id, 0 as branch_level FROM osee_branch anch_br1, osee_branch anch_br2\n" + //
- " WHERE anch_br1.parent_branch_id = anch_br2.branch_id AND anch_br2.branch_id = ?\n" + //
- " UNION ALL \n" + //
- " SELECT branch_id, branch_level + 1 FROM chof1 recurse, osee_branch br WHERE recurse.child_id = br.parent_branch_id\n" + //
- " )\n" + //
- "SELECT br1.*\n" + //
- " FROM \n" + //
- "osee_branch br1, chof1\n" + //
- " WHERE \n" + //
- "br1.branch_id = chof1.child_id\n" + //
- " ORDER BY br1.branch_id";
+ String expected = "WITH chof1 (child_id, branch_level) AS ( \n" + //
+ " SELECT anch_br1.branch_id, 0 as branch_level FROM osee_branch anch_br1, osee_branch anch_br2\n" + //
+ " WHERE anch_br1.parent_branch_id = anch_br2.branch_id AND anch_br2.branch_id = ?\n" + //
+ " UNION ALL \n" + //
+ " SELECT branch_id, branch_level + 1 FROM chof1 recurse, osee_branch br WHERE recurse.child_id = br.parent_branch_id\n" + //
+ " )\n" + //
+ "SELECT br1.*\n" + //
+ " FROM \n" + //
+ "osee_branch br1, chof1\n" + //
+ " WHERE \n" + //
+ "br1.branch_id = chof1.child_id\n" + //
+ " ORDER BY br1.branch_id";
queryData.addCriteria(childOf(COMMON));
@@ -355,19 +354,18 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testQueryAncestorOf() throws OseeCoreException {
- String expected =
- "WITH anstrof1 (parent_id, branch_level) AS ( \n" + //
- " SELECT anch_br1.parent_branch_id, 0 as branch_level FROM osee_branch anch_br1\n" + //
- " WHERE anch_br1.branch_id = ?\n" + //
- " UNION ALL \n" + //
- " SELECT parent_branch_id, branch_level - 1 FROM anstrof1 recurse, osee_branch br WHERE br.branch_id = recurse.parent_id\n" + //
- " )\n" + //
- "SELECT br1.*\n" + //
- " FROM \n" + //
- "osee_branch br1, anstrof1\n" + //
- " WHERE \n" + //
- "br1.branch_id = anstrof1.parent_id\n" + //
- " ORDER BY br1.branch_id";
+ String expected = "WITH anstrof1 (parent_id, branch_level) AS ( \n" + //
+ " SELECT anch_br1.parent_branch_id, 0 as branch_level FROM osee_branch anch_br1\n" + //
+ " WHERE anch_br1.branch_id = ?\n" + //
+ " UNION ALL \n" + //
+ " SELECT parent_branch_id, branch_level - 1 FROM anstrof1 recurse, osee_branch br WHERE br.branch_id = recurse.parent_id\n" + //
+ " )\n" + //
+ "SELECT br1.*\n" + //
+ " FROM \n" + //
+ "osee_branch br1, anstrof1\n" + //
+ " WHERE \n" + //
+ "br1.branch_id = anstrof1.parent_id\n" + //
+ " ORDER BY br1.branch_id";
queryData.addCriteria(ancestorOf(COMMON));
@@ -386,27 +384,26 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testMultiples() throws OseeCoreException {
- String expected =
- "WITH chof1 (child_id, branch_level) AS ( \n" + //
- " SELECT anch_br1.branch_id, 0 as branch_level FROM osee_branch anch_br1, osee_branch anch_br2\n" + //
- " WHERE anch_br1.parent_branch_id = anch_br2.branch_id AND anch_br2.branch_id = ?\n" + //
- " UNION ALL \n" + //
- " SELECT branch_id, branch_level + 1 FROM chof1 recurse, osee_branch br WHERE recurse.child_id = br.parent_branch_id\n" + //
- " )\n" + //
- "SELECT br1.*\n" + //
- " FROM \n" + //
- "osee_branch br1, osee_join_id jid1, chof1\n" + //
- " WHERE \n" + //
- "br1.branch_id = chof1.child_id\n" + //
- " AND \n" + //
- "br1.branch_type = ?\n" + //
- " AND \n" + //
- "br1.branch_state = jid1.id AND jid1.query_id = ?\n" + //
- " AND \n" + //
- "br1.archived = ?\n" + //
- " AND \n" + //
- "REGEXP_MATCHES (br1.branch_name, ?)\n" + //
- " ORDER BY br1.branch_id";
+ String expected = "WITH chof1 (child_id, branch_level) AS ( \n" + //
+ " SELECT anch_br1.branch_id, 0 as branch_level FROM osee_branch anch_br1, osee_branch anch_br2\n" + //
+ " WHERE anch_br1.parent_branch_id = anch_br2.branch_id AND anch_br2.branch_id = ?\n" + //
+ " UNION ALL \n" + //
+ " SELECT branch_id, branch_level + 1 FROM chof1 recurse, osee_branch br WHERE recurse.child_id = br.parent_branch_id\n" + //
+ " )\n" + //
+ "SELECT br1.*\n" + //
+ " FROM \n" + //
+ "osee_branch br1, osee_join_id jid1, chof1\n" + //
+ " WHERE \n" + //
+ "br1.branch_id = chof1.child_id\n" + //
+ " AND \n" + //
+ "br1.branch_type = ?\n" + //
+ " AND \n" + //
+ "br1.branch_state = jid1.id AND jid1.query_id = ?\n" + //
+ " AND \n" + //
+ "br1.archived = ?\n" + //
+ " AND \n" + //
+ "REGEXP_MATCHES (br1.branch_name, ?)\n" + //
+ " ORDER BY br1.branch_id";
queryData.addCriteria(STATE, IS_ARCHIVED, type(WORKING), childOf(COMMON), NAME_PATTERN);
@@ -433,7 +430,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testMergeBranchFor() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_merge mbr1, osee_branch br1\n" + //
" WHERE \n" + //
@@ -462,7 +459,7 @@ public class BranchQuerySqlContextFactoryImplTest {
@Test
public void testAssociatedArtId() throws Exception {
- String expected = "SELECT/*+ ordered */ br1.*\n" + //
+ String expected = "SELECT/*+ ordered */ br1.*\n" + //
" FROM \n" + //
"osee_branch br1\n" + //
" WHERE \n" + //
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
index 31fff01d5b..b0f9489793 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
@@ -62,12 +62,12 @@ public class TxQuerySqlContextFactoryImplTest {
private static final Criteria IDS = id(1, 2, 3, 4, 5);
private static final Criteria COMMENT = comment("SimpleTemplateProviderTask", false);
- private static final Criteria TYPES = type(Arrays.asList(TransactionDetailsType.Baselined,
- TransactionDetailsType.NonBaselined));
+ private static final Criteria TYPES =
+ type(Arrays.asList(TransactionDetailsType.Baselined, TransactionDetailsType.NonBaselined));
private static final Criteria BRANCHIDS = branchUuids(1L, 2L, 3L, 4L, 5L);
private static final Criteria IDS_WITH_OPERATOR = idWithOperator(Operator.LESS_THAN, 1);
- private static final Criteria DATE_WITH_OPERATOR = dateWithOperator(Operator.LESS_THAN,
- Timestamp.valueOf("2013-05-06 12:34:56"));
+ private static final Criteria DATE_WITH_OPERATOR =
+ dateWithOperator(Operator.LESS_THAN, Timestamp.valueOf("2013-05-06 12:34:56"));
private static final Criteria AUTHORS = byAuthorId(Arrays.asList(new Integer(1), new Integer(2)));
private static final Criteria COMMITS = byCommitId(Arrays.asList(new Integer(1), new Integer(2)));
@@ -110,7 +110,7 @@ public class TxQuerySqlContextFactoryImplTest {
@Test
public void testCount() throws Exception {
- String expected = "SELECT/*+ ordered */ count(txd1.transaction_id)\n" + //
+ String expected = "SELECT/*+ ordered */ count(txd1.transaction_id)\n" + //
" FROM \n" + //
"osee_join_id jid1, osee_tx_details txd1\n" + //
" WHERE \n" + //
@@ -278,13 +278,12 @@ public class TxQuerySqlContextFactoryImplTest {
@Test
public void testQueryTxPrior() throws Exception {
- String expected =
- "SELECT/*+ ordered */ txd1.*\n" + //
- " FROM \n" + //
- "osee_tx_details txd1\n" + //
- " WHERE \n" + //
- "txd1.transaction_id = (SELECT max(td2.transaction_id) FROM osee_tx_details td1,osee_tx_details td2 WHERE td1.transaction_id = ? AND td1.branch_id = td2.branch_id AND td1.transaction_id > td2.transaction_id)\n" + //
- " ORDER BY txd1.transaction_id";
+ String expected = "SELECT/*+ ordered */ txd1.*\n" + //
+ " FROM \n" + //
+ "osee_tx_details txd1\n" + //
+ " WHERE \n" + //
+ "txd1.transaction_id = (SELECT max(td2.transaction_id) FROM osee_tx_details td1,osee_tx_details td2 WHERE td1.transaction_id = ? AND td1.branch_id = td2.branch_id AND td1.transaction_id > td2.transaction_id)\n" + //
+ " ORDER BY txd1.transaction_id";
queryData.addCriteria(prior(3));
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java
index 482e4ed751..e2412681a6 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java
@@ -74,7 +74,8 @@ public class SqlHandlerFactoryUtilTest {
criteria.add(new CriteriaAttributeTypeExists(null));
criteria.add(new CriteriaAttributeTypeNotExists(null));
criteria.add(new CriteriaAttributeOther(null, null));
- criteria.add(new CriteriaAttributeKeywords(false, null, null, Collections.<String> emptyList(), null, null, null));
+ criteria.add(
+ new CriteriaAttributeKeywords(false, null, null, Collections.<String> emptyList(), null, null, null));
criteria.add(new CriteriaRelatedTo(null, null));
criteria.add(new CriteriaAllArtifacts());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java
index 6de289dc3d..bdf7453a37 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java
@@ -46,7 +46,7 @@ public class IndexingTaskDatabaseTxCallableTest {
@Mock private OrcsSession session;
@Mock private JdbcClient jdbcClient;
@Mock private IndexerCollectorAdapter collector;
- @Mock private AttributeTypes types;
+ @Mock private AttributeTypes types;
@Mock private IndexedResource resource1;
@Mock private IndexedResource resource2;
@Mock private TaggingEngine engine;
@@ -67,9 +67,8 @@ public class IndexingTaskDatabaseTxCallableTest {
handler.onData(resource2);
}
};
- txCallable =
- new IndexingTaskDatabaseTxCallable(logger, session, jdbcClient, loader, engine, collector, -1, false, 10000,
- types);
+ txCallable = new IndexingTaskDatabaseTxCallable(logger, session, jdbcClient, loader, engine, collector, -1, false,
+ 10000, types);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassMatcherTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassMatcherTest.java
index 41cce4ccb9..34a0fe53e3 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassMatcherTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassMatcherTest.java
@@ -80,8 +80,8 @@ public class SecondPassMatcherTest {
QueryOption.TOKEN_DELIMITER__EXACT, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
false, getLocs(12, 15));
addTest(data, matcher, "What does this mean", "what does", QueryOption.CASE__IGNORE,
- QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH,
- QueryOption.TOKEN_COUNT__IGNORE, false, getLocs(1, 11));
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
+ false, getLocs(1, 11));
addTest(data, matcher, "What does this mean", "what does", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__MATCH,
false, getLocs());
@@ -89,14 +89,14 @@ public class SecondPassMatcherTest {
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__MATCH,
false, getLocs(1, 13));
addTest(data, matcher, "What->does] .this. mean", "What does tHis", QueryOption.CASE__IGNORE,
- QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
- false, getLocs(1, 17));
+ QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE, false,
+ getLocs(1, 17));
addTest(data, matcher, "does does does", "does does", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__MATCH,
false, getLocs());
addTest(data, matcher, " does does does", "does does", QueryOption.CASE__IGNORE,
- QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH,
- QueryOption.TOKEN_COUNT__IGNORE, false, getLocs(4, 12));
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
+ false, getLocs(4, 12));
addTest(data, matcher, " (Selected) -> [.SELECTED_STRING_ID] Selected -> ", "SELECTED_STRING_ID",
QueryOption.CASE__IGNORE, QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__MATCH,
QueryOption.TOKEN_COUNT__IGNORE, false, getLocs(18, 35));
@@ -125,8 +125,8 @@ public class SecondPassMatcherTest {
QueryOption.TOKEN_DELIMITER__EXACT, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
true, getLocs(12, 15));
addTest(data, matcher, "What does this mean", "what does", QueryOption.CASE__IGNORE,
- QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH,
- QueryOption.TOKEN_COUNT__IGNORE, true, getLocs(1, 11));
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
+ true, getLocs(1, 11));
addTest(data, matcher, "What does this mean", "what does", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__MATCH,
true, getLocs());
@@ -140,8 +140,8 @@ public class SecondPassMatcherTest {
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__MATCH,
true, getLocs());
addTest(data, matcher, " does does does", "does does", QueryOption.CASE__IGNORE,
- QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH,
- QueryOption.TOKEN_COUNT__IGNORE, true, getLocs(4, 12));
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_COUNT__IGNORE,
+ true, getLocs(4, 12));
addTest(data, matcher, " (Selected) -> [.SELECTED_STRING_ID] Selected -> ", "SELECTED_STRING_ID",
QueryOption.CASE__IGNORE, QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__MATCH,
QueryOption.TOKEN_COUNT__IGNORE, true, getLocs(18, 35));
@@ -162,12 +162,12 @@ public class SecondPassMatcherTest {
addTest(data, matcher, "each token should match", "should token match each", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__IGNORE,
false, getLocs(1, 4, 6, 10, 12, 17, 19, 23));
- addTest(data, matcher, "each token should match extra token", "should token match each",
- QueryOption.CASE__IGNORE, QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY,
- QueryOption.TOKEN_COUNT__IGNORE, false, getLocs(1, 4, 6, 10, 12, 17, 19, 23));
- addTest(data, matcher, "each token should match extra token", "should token match each",
- QueryOption.CASE__IGNORE, QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY,
- QueryOption.TOKEN_COUNT__MATCH, false, getLocs());
+ addTest(data, matcher, "each token should match extra token", "should token match each", QueryOption.CASE__IGNORE,
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__IGNORE,
+ false, getLocs(1, 4, 6, 10, 12, 17, 19, 23));
+ addTest(data, matcher, "each token should match extra token", "should token match each", QueryOption.CASE__IGNORE,
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__MATCH,
+ false, getLocs());
addTest(data, matcher, "each token should match ToKen", "should token match each", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__IGNORE,
true, getLocs(1, 4, 6, 10, 12, 17, 19, 23, 27, 31));
@@ -178,12 +178,12 @@ public class SecondPassMatcherTest {
addTest(data, matcher, "each token should match", "should token match each", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__IGNORE,
true, getLocs(1, 4, 6, 10, 12, 17, 19, 23));
- addTest(data, matcher, "each token should match extra token", "should token match each",
- QueryOption.CASE__IGNORE, QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY,
- QueryOption.TOKEN_COUNT__IGNORE, true, getLocs(1, 4, 6, 10, 12, 17, 19, 23, 31, 35));
- addTest(data, matcher, "each token should match extra token", "should token match each",
- QueryOption.CASE__IGNORE, QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY,
- QueryOption.TOKEN_COUNT__MATCH, true, getLocs());
+ addTest(data, matcher, "each token should match extra token", "should token match each", QueryOption.CASE__IGNORE,
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__IGNORE,
+ true, getLocs(1, 4, 6, 10, 12, 17, 19, 23, 31, 35));
+ addTest(data, matcher, "each token should match extra token", "should token match each", QueryOption.CASE__IGNORE,
+ QueryOption.TOKEN_DELIMITER__WHITESPACE, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__MATCH,
+ true, getLocs());
addTest(data, matcher, "each each should extra token", "should token match each", QueryOption.CASE__IGNORE,
QueryOption.TOKEN_DELIMITER__ANY, QueryOption.TOKEN_MATCH_ORDER__ANY, QueryOption.TOKEN_COUNT__IGNORE, true,
getLocs());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
index 778c2e1447..cb9e9ec48b 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
@@ -65,8 +65,8 @@ import org.mockito.stubbing.Answer;
public class TxSqlBuilderTest {
private static final List<ModificationType> MODS_ITEMS_ROW = Arrays.asList(NEW, MODIFIED, MERGED, UNDELETED);
- private static final List<ModificationType> MODS_REUSE_ROW = Arrays.asList(ARTIFACT_DELETED, DELETED, INTRODUCED,
- REPLACED_WITH_VERSION);
+ private static final List<ModificationType> MODS_REUSE_ROW =
+ Arrays.asList(ARTIFACT_DELETED, DELETED, INTRODUCED, REPLACED_WITH_VERSION);
private static final int EXPECTED_TX_ID = 10000;
private static final int LOADED_TX_ID = 567;
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/mocks/Utility.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/mocks/Utility.java
index c2eb8895ca..bd90dca45a 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/mocks/Utility.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/mocks/Utility.java
@@ -38,7 +38,7 @@ public final class Utility {
char[] data = new char[size];
for (int index = 0; index < size; index++) {
int rnd = (int) (Math.random() * 52);
- char base = (rnd < 26) ? 'A' : 'a';
+ char base = rnd < 26 ? 'A' : 'a';
data[index] = (char) (base + rnd % 26);
}
return new String(data);

Back to the top