Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2011-01-19 23:02:41 +0000
committerRyan D. Brooks2011-01-19 23:02:41 +0000
commit2e8baee6dbfaf7b5065cd5f4e6f3bcdcd00e5ffa (patch)
tree153cab028139e7566c3bc81b966704db75ce2b46 /plugins/org.eclipse.osee.framework.skynet.core.test
parentd1bfbe55c7af2302ea5eba86c46d9356849d7fa8 (diff)
downloadorg.eclipse.osee-2e8baee6dbfaf7b5065cd5f4e6f3bcdcd00e5ffa.tar.gz
org.eclipse.osee-2e8baee6dbfaf7b5065cd5f4e6f3bcdcd00e5ffa.tar.xz
org.eclipse.osee-2e8baee6dbfaf7b5065cd5f4e6f3bcdcd00e5ffa.zip
refactor: Remove obsolete rendering utility code
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchTestSuite.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchUtilityTest.java153
3 files changed, 1 insertions, 156 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java
index 69494f31936..8bf5db21f03 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.framework.skynet.core.test;
import static org.junit.Assert.assertTrue;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.skynet.core.test.branch.BranchManagerTest;
import org.eclipse.osee.framework.skynet.core.test.branch.BranchTestSuite;
import org.eclipse.osee.framework.skynet.core.test.cases.ArtifactLoaderTest;
import org.eclipse.osee.framework.skynet.core.test.cases.ArtifactPurgeTest;
@@ -72,7 +71,6 @@ import org.junit.runners.Suite;
ArtifactQueryTestDemo.class,
TransactionManagerTest.class,
BranchTestSuite.class,
- BranchManagerTest.class,
RelationTestSuite.class,
ArtifactTypeInheritanceTest.class,
ArtifactPurgeTest.class,
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchTestSuite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchTestSuite.java
index 6a74d60696c..b1248ff689b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchTestSuite.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchTestSuite.java
@@ -15,7 +15,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
-@Suite.SuiteClasses({BranchUtilityTest.class})
+@Suite.SuiteClasses({BranchManagerTest.class})
/**
* @author Roberto E. Escobar
*
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchUtilityTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchUtilityTest.java
deleted file mode 100644
index 074e437326c..00000000000
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/branch/BranchUtilityTest.java
+++ /dev/null
@@ -1,153 +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.skynet.core.test.branch;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import junit.framework.Assert;
-import org.eclipse.osee.framework.core.enums.BranchState;
-import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.BranchFactory;
-import org.eclipse.osee.framework.core.model.cache.AbstractOseeCache;
-import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.core.model.test.mocks.MockOseeDataAccessor;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchUtility;
-import org.junit.Test;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BranchUtilityTest {
-
- @Test
- public void testBranchToFileName() throws Exception {
- AbstractOseeCache<Branch> cache = new TestCache();
- for (int index = 0; index < 100; index++) {
- String guid = GUID.create();
- Branch branch = createBranch(cache, guid, String.format("Test %s", index + 1), index);
-
- String actual = BranchUtility.toFileName(branch);
- Assert.assertEquals(encode(guid), actual);
- }
- }
-
- @Test
- public void testBranchToFileNameInvalidGuid() throws OseeCoreException {
- AbstractOseeCache<Branch> cache = new TestCache();
- Branch branch = createBranch(cache, "!#A", "Invalid Guid", 2);
- try {
- BranchUtility.toFileName(branch);
- Assert.assertFalse("This line should not be executed", true);
- } catch (Exception ex) {
- Assert.assertTrue(ex instanceof OseeStateException);
- }
- }
-
- @Test
- public void testBranchToFileNameNullBranch() {
- try {
- BranchUtility.toFileName(null);
- Assert.assertFalse("This line should not be executed", true);
- } catch (Exception ex) {
- Assert.assertTrue(ex instanceof OseeArgumentException);
- }
- }
-
- @Test
- public void testfromFileNameGuidNotFound() throws OseeCoreException {
- AbstractOseeCache<Branch> cache = new TestCache();
- cache.ensurePopulated();
- Assert.assertEquals(0, cache.size());
- try {
- String guid = GUID.create();
- BranchUtility.fromFileName(cache, encode(guid));
- } catch (Exception ex) {
- Assert.assertTrue(ex.getClass().getSimpleName(), ex instanceof OseeArgumentException);
- }
- }
-
- @Test
- public void testfromFileNameIdNotFound() throws OseeCoreException {
- AbstractOseeCache<Branch> cache = new TestCache();
- cache.ensurePopulated();
- Assert.assertEquals(0, cache.size());
- try {
- BranchUtility.fromFileName(cache, "hello.-2");
- } catch (Exception ex) {
- Assert.assertTrue(ex instanceof OseeArgumentException);
- }
- }
-
- @Test
- public void testfromFileNameNullArgs() {
- try {
- BranchUtility.fromFileName(null, "hello.-2");
- } catch (Exception ex) {
- Assert.assertTrue(ex instanceof OseeArgumentException);
- }
- AbstractOseeCache<Branch> cache = new TestCache();
- try {
- BranchUtility.fromFileName(cache, null);
- } catch (Exception ex) {
- Assert.assertTrue(ex instanceof OseeArgumentException);
- }
- }
-
- @Test
- public void testfromFileName() throws OseeCoreException, UnsupportedEncodingException {
- AbstractOseeCache<Branch> cache = new TestCache();
- cache.ensurePopulated();
- Assert.assertEquals(0, cache.size());
-
- Branch expectedBranch1 = createBranch(cache, "AyH_e52bdW+WUbdQUoQA", "Test 1", 1);
- Branch expectedBranch2 = createBranch(cache, "AyH_e52bdW+WUbdQUoQB", "Test 2", 2);
-
- cache.cache(expectedBranch1);
- cache.cache(expectedBranch2);
-
- Assert.assertEquals(2, cache.size());
-
- checkBranchFromFile(cache, expectedBranch1, encode("AyH_e52bdW+WUbdQUoQA"));
- checkBranchFromFile(cache, expectedBranch2, encode("AyH_e52bdW+WUbdQUoQB"));
-
- checkBranchFromFile(cache, expectedBranch1, encode("X.1"));
- checkBranchFromFile(cache, expectedBranch2, encode("X.2"));
- }
-
- private void checkBranchFromFile(AbstractOseeCache<Branch> cache, Branch expected, String fileName) throws OseeCoreException {
- Branch actual = BranchUtility.fromFileName(cache, fileName);
- Assert.assertNotNull(actual);
- Assert.assertEquals(expected, actual);
- }
-
- private String encode(String guid) throws UnsupportedEncodingException {
- return URLEncoder.encode(guid, "UTF-8");
- }
-
- private Branch createBranch(AbstractOseeCache<Branch> cache, String guid, String name, int id) throws OseeCoreException {
- Branch branch = new BranchFactory().create(guid, name, BranchType.WORKING, BranchState.MODIFIED, false);
- Assert.assertNotNull(branch);
- branch.setId(id);
- return branch;
- }
-
- private final class TestCache extends BranchCache {
- public TestCache() {
- super(new MockOseeDataAccessor<Branch>());
- }
- }
-}

Back to the top