diff options
author | jmisinco | 2014-08-29 16:22:59 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2014-10-01 21:03:23 +0000 |
commit | 6d9632667faafd9d14930175e45d67bbe1272ef8 (patch) | |
tree | 8929d30a4294594085a8123005233b8592703c4c /plugins/org.eclipse.osee.framework.core.message.test | |
parent | 1e8d8d173767d8eddbbfb7d7faf7953a43e47592 (diff) | |
download | org.eclipse.osee-6d9632667faafd9d14930175e45d67bbe1272ef8.tar.gz org.eclipse.osee-6d9632667faafd9d14930175e45d67bbe1272ef8.tar.xz org.eclipse.osee-6d9632667faafd9d14930175e45d67bbe1272ef8.zip |
refactor[ats_ATS46139]: Remove branch cache from servlets
Change-Id: I178632f81aad50f79766be84e69a0e91365b83fa
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message.test')
5 files changed, 2 insertions, 185 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/BranchCommitResponseTranslatorTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/BranchCommitResponseTranslatorTest.java index cfa49919836..02cee890d24 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/BranchCommitResponseTranslatorTest.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/BranchCommitResponseTranslatorTest.java @@ -13,16 +13,10 @@ package org.eclipse.osee.framework.core.message.test.translation; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.eclipse.osee.framework.core.enums.CoreTranslatorId; import org.eclipse.osee.framework.core.message.BranchCommitResponse; -import org.eclipse.osee.framework.core.message.internal.DataTranslationService; import org.eclipse.osee.framework.core.message.internal.translation.BranchCommitResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.TransactionRecordTranslator; import org.eclipse.osee.framework.core.message.test.mocks.DataAsserts; -import org.eclipse.osee.framework.core.message.test.mocks.MockDataFactory; -import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.core.model.cache.TransactionCache; -import org.eclipse.osee.framework.core.translation.IDataTranslationService; import org.eclipse.osee.framework.core.translation.ITranslator; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.junit.runner.RunWith; @@ -50,18 +44,13 @@ public class BranchCommitResponseTranslatorTest extends BaseTranslatorTest<Branc public static Collection<Object[]> data() throws OseeCoreException { List<Object[]> data = new ArrayList<Object[]>(); - IDataTranslationService service = new DataTranslationService(); - service.addTranslator(new TransactionRecordTranslator(), CoreTranslatorId.TRANSACTION_RECORD); - ITranslator<BranchCommitResponse> translator = new BranchCommitResponseTranslator(service); + ITranslator<BranchCommitResponse> translator = new BranchCommitResponseTranslator(); for (int index = 1; index <= 2; index++) { - TransactionRecord tx = MockDataFactory.createTransaction(index, index * 3); - BranchCommitResponse response = new BranchCommitResponse(); - response.setTransactionId(tx.getGuid()); + response.setTransactionId(index); data.add(new Object[] {response, translator}); } - data.add(new Object[] {new BranchCommitResponse(), translator}); return data; } } diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java index fe5e0293cda..614ecc32b37 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java @@ -10,15 +10,11 @@ *******************************************************************************/ package org.eclipse.osee.framework.core.message.test.translation; -import java.util.Collection; import org.eclipse.osee.framework.core.enums.CoreTranslatorId; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; import org.eclipse.osee.framework.core.message.internal.DataTranslationService; import org.eclipse.osee.framework.core.message.internal.DataTranslationServiceFactory; import org.eclipse.osee.framework.core.message.internal.translation.ArtifactTypeCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.AttributeTypeCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.BranchCacheStoreRequestTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.BranchCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.BranchCommitRequestTranslator; import org.eclipse.osee.framework.core.message.internal.translation.BranchCommitResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.BranchCreationRequestTranslator; @@ -32,19 +28,13 @@ import org.eclipse.osee.framework.core.message.internal.translation.OseeImportMo import org.eclipse.osee.framework.core.message.internal.translation.OseeImportModelResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.RelationTypeCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.TableDataTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.TransactionCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.TransactionRecordTranslator; import org.eclipse.osee.framework.core.model.BranchFactory; import org.eclipse.osee.framework.core.model.TransactionRecordFactory; -import org.eclipse.osee.framework.core.model.cache.BranchCache; -import org.eclipse.osee.framework.core.model.cache.IOseeCache; -import org.eclipse.osee.framework.core.model.cache.TransactionCache; import org.eclipse.osee.framework.core.model.type.ArtifactTypeFactory; import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory; import org.eclipse.osee.framework.core.model.type.OseeEnumTypeFactory; import org.eclipse.osee.framework.core.model.type.RelationTypeFactory; import org.eclipse.osee.framework.core.services.IOseeModelFactoryService; -import org.eclipse.osee.framework.core.services.TempCachingService; import org.eclipse.osee.framework.core.translation.IDataTranslationService; import org.eclipse.osee.framework.core.translation.ITranslator; import org.eclipse.osee.framework.core.translation.ITranslatorId; @@ -63,11 +53,8 @@ public class DataTranslationServiceFactoryTest { public void testServiceCreation() throws OseeCoreException { DataTranslationService srvc = new DataTranslationService(); srvc.setModelFactory(new MockModelFactoryService()); - srvc.setTempCachingService(new MockOseeCachingService()); srvc.start(); - checkExists(srvc, TransactionRecordTranslator.class, CoreTranslatorId.TRANSACTION_RECORD); - checkExists(srvc, BranchCreationRequestTranslator.class, CoreTranslatorId.BRANCH_CREATION_REQUEST); checkExists(srvc, BranchCreationResponseTranslator.class, CoreTranslatorId.BRANCH_CREATION_RESPONSE); @@ -86,9 +73,6 @@ public class DataTranslationServiceFactoryTest { CoreTranslatorId.RELATION_TYPE_CACHE_UPDATE_RESPONSE); checkExists(srvc, OseeEnumTypeCacheUpdateResponseTranslator.class, CoreTranslatorId.OSEE_ENUM_TYPE_CACHE_UPDATE_RESPONSE); - checkExists(srvc, BranchCacheUpdateResponseTranslator.class, CoreTranslatorId.BRANCH_CACHE_UPDATE_RESPONSE); - checkExists(srvc, BranchCacheStoreRequestTranslator.class, CoreTranslatorId.BRANCH_CACHE_STORE_REQUEST); - checkExists(srvc, TransactionCacheUpdateResponseTranslator.class, CoreTranslatorId.TX_CACHE_UPDATE_RESPONSE); checkExists(srvc, OseeImportModelRequestTranslator.class, CoreTranslatorId.OSEE_IMPORT_MODEL_REQUEST); checkExists(srvc, OseeImportModelResponseTranslator.class, CoreTranslatorId.OSEE_IMPORT_MODEL_RESPONSE); @@ -138,37 +122,4 @@ public class DataTranslationServiceFactoryTest { } } - private final class MockOseeCachingService implements TempCachingService { - - @Override - public BranchCache getBranchCache() { - return null; - } - - @Override - public TransactionCache getTransactionCache() { - return null; - } - - @Override - public Collection<?> getCaches() { - return null; - } - - @Override - public IOseeCache<?, ?> getCache(OseeCacheEnum cacheId) { - return null; - } - - @Override - public void reloadAll() { - // - } - - @Override - public void clearAll() { - // - } - - } } diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TransactionCacheUpdateResponseTranslatorTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TransactionCacheUpdateResponseTranslatorTest.java deleted file mode 100644 index a17e4159a40..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TransactionCacheUpdateResponseTranslatorTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.framework.core.message.test.translation; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.osee.framework.core.message.TransactionCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.internal.translation.TransactionCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.test.mocks.DataAsserts; -import org.eclipse.osee.framework.core.message.test.mocks.MockDataFactory; -import org.eclipse.osee.framework.core.message.test.mocks.MockOseeDataAccessor; -import org.eclipse.osee.framework.core.model.Branch; -import org.eclipse.osee.framework.core.model.TransactionRecord; -import org.eclipse.osee.framework.core.model.TransactionRecordFactory; -import org.eclipse.osee.framework.core.model.cache.BranchCache; -import org.eclipse.osee.framework.core.model.cache.TransactionCache; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.junit.Assert; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * Test Case for {@link TransactionCacheUpdateResponseTranslator} - * - * @author Roberto E. Escobar - */ -@RunWith(Parameterized.class) -public class TransactionCacheUpdateResponseTranslatorTest extends BaseTranslatorTest<TransactionCacheUpdateResponse> { - - public TransactionCacheUpdateResponseTranslatorTest(TransactionCacheUpdateResponse data, ITranslator<TransactionCacheUpdateResponse> translator) { - super(data, translator); - } - - @Override - protected void checkEquals(TransactionCacheUpdateResponse expected, TransactionCacheUpdateResponse actual) { - Assert.assertNotSame(expected, actual); - List<TransactionRecord> expectedRows = expected.getTxRows(); - List<TransactionRecord> actualRows = actual.getTxRows(); - Assert.assertEquals(expectedRows.size(), actualRows.size()); - for (int index = 0; index < expectedRows.size(); index++) { - DataAsserts.assertEquals(expectedRows.get(index), actualRows.get(index)); - } - } - - @Parameters - public static Collection<Object[]> data() { - BranchCache branchCache = new BranchCache(new MockOseeDataAccessor<Long, Branch>(), new TransactionCache()); - ITranslator<TransactionCacheUpdateResponse> translator = - new TransactionCacheUpdateResponseTranslator(new TransactionRecordFactory(), branchCache); - - List<Object[]> data = new ArrayList<Object[]>(); - for (int index = 1; index <= 2; index++) { - List<TransactionRecord> txRecords = new ArrayList<TransactionRecord>(); - for (int j = 1; j <= index; j++) { - txRecords.add(MockDataFactory.createTransaction(j, j * 3)); - } - data.add(new Object[] {new TransactionCacheUpdateResponse(txRecords), translator}); - } - return data; - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TransactionRecordTranslatorTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TransactionRecordTranslatorTest.java deleted file mode 100644 index 370e022ce3e..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TransactionRecordTranslatorTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.framework.core.message.test.translation; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.osee.framework.core.message.internal.translation.TransactionRecordTranslator; -import org.eclipse.osee.framework.core.model.cache.TransactionCache; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.junit.Assert; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * Test Case For {@link TransactionRecordTranslator} - * - * @author Roberto E. Escobar - */ -@RunWith(Parameterized.class) -public class TransactionRecordTranslatorTest extends BaseTranslatorTest<Integer> { - - public TransactionRecordTranslatorTest(Integer data, ITranslator<Integer> translator) { - super(data, translator); - } - - @Override - protected void checkEquals(Integer expected, Integer actual) { - Assert.assertEquals(expected, actual); - } - - @Parameters - public static Collection<Object[]> data() { - ITranslator<Integer> translator = new TransactionRecordTranslator(); - List<Object[]> data = new ArrayList<Object[]>(); - for (int index = 1; index <= 2; index++) { - data.add(new Object[] {index * 10, translator}); - } - return data; - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java index e3eca0bab21..4e327c7504d 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java @@ -27,8 +27,6 @@ import org.junit.runners.Suite; OseeImportModelRequestTranslatorTest.class, OseeImportModelResponseTranslatorTest.class, TableDataTranslatorTest.class, - TransactionCacheUpdateResponseTranslatorTest.class, - TransactionRecordTranslatorTest.class, PurgeBranchRequestTranslatorTest.class, BranchChangeTypeRequestTranslatorTest.class, BranchChangeStateRequestTranslatorTest.class, |