From 7b297ff1e458bb77df8c339d8aad75904cf9824e Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Fri, 25 Jul 2008 13:21:58 +0000 Subject: [PATCH] [242074][tests][regression] testSubSystemConfigurationProxy fails --- .../SubSystemConfigurationProxyTestCase.java | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/core/registries/SubSystemConfigurationProxyTestCase.java b/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/core/registries/SubSystemConfigurationProxyTestCase.java index ff8bdc81850..63a246326a5 100644 --- a/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/core/registries/SubSystemConfigurationProxyTestCase.java +++ b/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/core/registries/SubSystemConfigurationProxyTestCase.java @@ -23,11 +23,27 @@ import org.eclipse.rse.tests.core.RSECoreTestCase; /** * Tests the subsystem configuration proxy functionality. - * - * @author uwe.stieber@windriver.com */ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase { + private void assertProxyApplicable(ISubSystemConfigurationProxy proxy, IRSESystemType systemType, boolean isApplicable) { + if (proxy.appliesToSystemType(systemType) != isApplicable) { + StringBuffer buf = new StringBuffer(120); + buf.append("Proxy \""); //$NON-NLS-1$ + buf.append(proxy.getId()); + buf.append("\" is expected "); //$NON-NLS-1$ + if (!isApplicable) + buf.append("not "); //$NON-NLS-1$ + buf.append("to be applicable to systemType \""); //$NON-NLS-1$ + buf.append(systemType.getId()); + buf.append("\", but returned "); //$NON-NLS-1$ + if (isApplicable) + buf.append("not "); //$NON-NLS-1$ + buf.append("to be!"); //$NON-NLS-1$ + assertTrue(buf.toString(), false); + } + } + public void testSubSystemConfigurationProxy() { //-test-author-:UweStieber if (isTestDisabled()) @@ -64,10 +80,10 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase { for (int j = 0; j < systemTypes.length; j++) { IRSESystemType systemType = systemTypes[j]; assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$ - if (systemType.isLocal() || systemType.isWindows()) { - assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$ + if (systemType.getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID) || systemType.getId().equals(IRSESystemType.SYSTEMTYPE_WINDOWS_ID)) { + assertProxyApplicable(proxy, systemType, true); } else { - assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$ + assertProxyApplicable(proxy, systemType, false); } } } @@ -89,9 +105,9 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase { IRSESystemType systemType = systemTypes[j]; assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$ if (systemType.getId().startsWith("org.eclipse.rse.tests.")) { //$NON-NLS-1$ - assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$ + assertProxyApplicable(proxy, systemType, true); } else { - assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$ + assertProxyApplicable(proxy, systemType, false); } } } @@ -113,9 +129,9 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase { IRSESystemType systemType = systemTypes[j]; assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$ if ("Unix".equalsIgnoreCase(systemType.getName()) || "Linux".equalsIgnoreCase(systemType.getName())) { //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$ + assertProxyApplicable(proxy, systemType, true); } else { - assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$ + assertProxyApplicable(proxy, systemType, false); } } }