Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-08-19 02:17:40 -0400
committerRyan D. Brooks2018-08-29 14:55:34 -0400
commitd8d548bb26dd21e997f3925974d6bde6598fca1c (patch)
treecba070e4c01167ccb17f91ae7eccd0ea924091c7
parent856b4bdd0cd121f2d190b955c05ee872e0b77a76 (diff)
downloadorg.eclipse.osee-d8d548bb26dd21e997f3925974d6bde6598fca1c.tar.gz
org.eclipse.osee-d8d548bb26dd21e997f3925974d6bde6598fca1c.tar.xz
org.eclipse.osee-d8d548bb26dd21e997f3925974d6bde6598fca1c.zip
refactor: Remove unused OrcsLazyObject and IntegrationUtil
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsLazyObject.java55
-rw-r--r--plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java93
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java2
8 files changed, 10 insertions, 154 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsLazyObject.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsLazyObject.java
deleted file mode 100644
index 111520473bd..00000000000
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsLazyObject.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.core.internal.util;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.FutureTask;
-import org.eclipse.osee.framework.jdk.core.type.LazyObject;
-import org.eclipse.osee.orcs.core.ds.HasOrcsData;
-import org.eclipse.osee.orcs.core.ds.OrcsData;
-
-/**
- * @author Roberto E. Escobar
- */
-public abstract class OrcsLazyObject<T, D extends OrcsData> extends LazyObject<T> implements HasOrcsData<D> {
-
- private D data;
-
- public OrcsLazyObject(D data) {
- super();
- this.data = data;
- }
-
- @Override
- public D getOrcsData() {
- return data;
- }
-
- @Override
- public void setOrcsData(D data) {
- invalidate();
- this.data = data;
- }
-
- @Override
- protected final FutureTask<T> createLoaderTask() {
- Callable<T> callable = new Callable<T>() {
- @Override
- public T call() throws Exception {
- return instance();
- }
- };
- return new FutureTask<T>(callable);
- }
-
- protected abstract T instance();
-
-}
diff --git a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java
index 0624334f1bb..74c8327581d 100644
--- a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java
+++ b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.mock;
import org.junit.Assert;
+import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
@@ -19,13 +20,16 @@ import org.junit.runners.model.Statement;
* @author Roberto E. Escobar
*/
public class OseeDatabase implements TestRule {
-
private final String[] osgiBindings;
public OseeDatabase(String... osgiBindings) {
this.osgiBindings = osgiBindings;
}
+ public static TestRule integrationRule(Object testObject) {
+ return RuleChain.outerRule(new OseeDatabase("orcs.jdbc.service")).around(new OsgiRule(testObject));
+ }
+
@Override
public Statement apply(final Statement base, final Description description) {
return new Statement() {
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
deleted file mode 100644
index ab63bac2218..00000000000
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.db.intergration;
-
-import static org.junit.Assert.assertEquals;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TransactionId;
-import org.eclipse.osee.orcs.core.ds.ArtifactData;
-import org.eclipse.osee.orcs.core.ds.AttributeData;
-import org.eclipse.osee.orcs.core.ds.OrcsData;
-import org.eclipse.osee.orcs.core.ds.RelationData;
-import org.eclipse.osee.orcs.core.ds.VersionData;
-import org.eclipse.osee.orcs.db.mock.OseeDatabase;
-import org.eclipse.osee.orcs.db.mock.OsgiRule;
-import org.junit.rules.RuleChain;
-import org.junit.rules.TestRule;
-
-/**
- * @author Roberto E. Escobar
- */
-public class IntegrationUtil {
-
- private static final Comparator<OrcsData> SORT_BY_LOCAL_ID = new IdComparator();
-
- public static TestRule integrationRule(Object testObject) {
- return RuleChain.outerRule(new OseeDatabase("orcs.jdbc.service")).around(new OsgiRule(testObject));
- }
-
- public static void sort(List<? extends OrcsData> data) {
- Collections.sort(data, SORT_BY_LOCAL_ID);
- }
-
- public static void verifyData(ArtifactData data, Object... values) {
- int index = 0;
- assertEquals(values[index++], data);
- assertEquals(values[index++], data.getGuid());
-
- verifyData(data, index, values);
- }
-
- public static void verifyData(AttributeData data, Object... values) {
- int index = 0;
- assertEquals(values[index++], data);
- assertEquals(values[index++], ArtifactId.valueOf(data.getArtifactId()));
-
- index = verifyData(data, index, values);
-
- assertEquals(values[index++], data.getDataProxy().getRawValue());
- assertEquals(values[index++], data.getDataProxy().getUri());
- }
-
- public static void verifyData(RelationData data, Object... values) {
- int index = 0;
- assertEquals(values[index++], data.getLocalId());
-
- assertEquals(values[index++], data.getArtifactIdA());
- assertEquals(values[index++], data.getArtifactIdB());
- assertEquals(values[index++], data.getRationale());
-
- verifyData(data, index, values);
- }
-
- private static int verifyData(OrcsData orcsData, int index, Object... values) {
- assertEquals(values[index++], orcsData.getModType());
- assertEquals(values[index++], orcsData.getTypeUuid());
-
- VersionData version = orcsData.getVersion();
- assertEquals(values[index++], version.getBranch());
- assertEquals(values[index++], version.getTransactionId());
- assertEquals(TransactionId.SENTINEL, version.getStripeId());
- assertEquals(values[index++], version.getGammaId());
- return index;
- }
-
- private static final class IdComparator implements Comparator<OrcsData> {
-
- @Override
- public int compare(OrcsData arg0, OrcsData arg1) {
- return arg0.getLocalId() - arg1.getLocalId();
- }
- };
-}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
index bf08d03b6e0..6b6acee225c 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.orcs.db.intergration;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DemoUsers.Joe_Smith;
-import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
+import static org.eclipse.osee.orcs.db.mock.OseeDatabase.integrationRule;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.data.AttributeId;
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 dd0d0e7780f..abdd2efc20f 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
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.db.internal.loader;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
-import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
+import static org.eclipse.osee.orcs.db.mock.OseeDatabase.integrationRule;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
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 103f50f9597..ac4587e984b 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
@@ -18,7 +18,7 @@ import static org.eclipse.osee.framework.core.enums.BranchType.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.BranchType.WORKING;
import static org.eclipse.osee.framework.core.enums.CoreArtifactTokens.DefaultHierarchyRoot;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
+import static org.eclipse.osee.orcs.db.mock.OseeDatabase.integrationRule;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
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 ffc7862b530..12c31eecfd0 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
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.search.engines;
-import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
+import static org.eclipse.osee.orcs.db.mock.OseeDatabase.integrationRule;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import com.google.common.collect.Lists;
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 8ecd81fc26a..117c52a2921 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
@@ -19,7 +19,7 @@ import static org.eclipse.osee.framework.core.enums.ModificationType.MODIFIED;
import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
import static org.eclipse.osee.framework.core.enums.ModificationType.REPLACED_WITH_VERSION;
import static org.eclipse.osee.framework.core.enums.ModificationType.UNDELETED;
-import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
+import static org.eclipse.osee.orcs.db.mock.OseeDatabase.integrationRule;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

Back to the top