Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-07-25 08:25:08 -0400
committerUwe Stieber2014-07-25 08:25:08 -0400
commit9533ff9f9017a106d4622c223ddfd30d91ebc025 (patch)
tree3f8c12227c202c8b81d480e757ff639e69753211
parent657ebd31430767eb9c4abf6df2ed37155b77ee77 (diff)
downloadorg.eclipse.tcf-9533ff9f9017a106d4622c223ddfd30d91ebc025.tar.gz
org.eclipse.tcf-9533ff9f9017a106d4622c223ddfd30d91ebc025.tar.xz
org.eclipse.tcf-9533ff9f9017a106d4622c223ddfd30d91ebc025.zip
Target Explorer: Remove channel manager test case as it cannot cover all desired cases as there is no value-add available
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java91
2 files changed, 0 insertions, 93 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java
index 33bd6a48d..054507b2b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java
@@ -21,7 +21,6 @@ import org.eclipse.tcf.te.tests.tcf.launch.TcfLaunchTests;
import org.eclipse.tcf.te.tests.tcf.locator.LocatorModelTestCase;
import org.eclipse.tcf.te.tests.tcf.processes.launcher.ProcessLauncherTestCase;
import org.eclipse.tcf.te.tests.tcf.processes.model.ProcessModelTestCase;
-import org.eclipse.tcf.te.tests.tcf.tests.TcfCoreTests;
import org.eclipse.tcf.te.tests.tcf.tests.TcfStepperTests;
import org.eclipse.tcf.te.tests.utils.UtilityTestCase;
@@ -72,7 +71,6 @@ public class AllTests {
suite.addTest(LocatorModelTestCase.getTestSuite());
suite.addTest(StepperTests.getTestSuite());
- suite.addTest(TcfCoreTests.getTestSuite());
suite.addTest(TcfStepperTests.getTestSuite());
suite.addTest(TcfLaunchTests.getTestSuite());
suite.addTest(ProcessModelTestCase.getTestSuite());
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java
deleted file mode 100644
index f2a5cd795..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Wind River Systems, Inc. and others. 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tests.tcf.tests;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
-import org.eclipse.tcf.te.tests.activator.UIPlugin;
-import org.eclipse.tcf.te.tests.tcf.TcfTestCase;
-
-/**
- * Core TCF tests.
- */
-public class TcfCoreTests extends TcfTestCase {
-
- /**
- * Provides a test suite to the caller which combines all single
- * test bundled within this category.
- *
- * @return Test suite containing all test for this test category.
- */
- public static Test getTestSuite() {
- TestSuite testSuite = new TestSuite("Core TCF tests"); //$NON-NLS-1$
-
- // add ourself to the test suite
- testSuite.addTestSuite(TcfCoreTests.class);
-
- return testSuite;
- }
-
- /**
- * Test the channel manager implementation.
- */
- public void testChannelManager() {
- assertNotNull("Precondition Failure: peer is not available.", peer); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", Tcf.getChannelManager()); //$NON-NLS-1$
-
- final AtomicReference<Callback> callback = new AtomicReference<Callback>();
- callback.set(new Callback());
-
- Map<String, Boolean> flags = new HashMap<String, Boolean>();
- flags.put(IChannelManager.FLAG_FORCE_NEW, Boolean.TRUE);
- Tcf.getChannelManager().openChannel(peer, flags, new IChannelManager.DoneOpenChannel() {
-
- @Override
- public void doneOpenChannel(Throwable error, IChannel channel) {
- callback.get().setResult(channel);
- IStatus status = new Status(error != null ? IStatus.ERROR : IStatus.OK,
- UIPlugin.getUniqueIdentifier(),
- error != null ? error.getLocalizedMessage() : null,
- error);
- callback.get().done(this, status);
- }
- });
-
- waitAndDispatch(0, callback.get().getDoneConditionTester(null));
-
- IStatus status = callback.get().getStatus();
- assertNotNull("Unexpected return value 'null'.", status); //$NON-NLS-1$
- assertTrue("Failed to open channel to test peer. Possible cause: " + status.getMessage(), status.isOK()); //$NON-NLS-1$
-
- IChannel channel = (IChannel)callback.get().getResult();
- assertNotNull("Unexpected return value 'null'.", channel); //$NON-NLS-1$
- assertTrue("Channel is not in expected open action.", channel.getState() == IChannel.STATE_OPEN); //$NON-NLS-1$
-
- Tcf.getChannelManager().closeChannel(channel);
- int counter = 10;
- while (counter > 0 && channel.getState() != IChannel.STATE_CLOSED) {
- waitAndDispatch(200);
- counter--;
- }
- assertTrue("Channel is not in expected closed action.", channel.getState() == IChannel.STATE_CLOSED); //$NON-NLS-1$
- }
-}

Back to the top