1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 20:45:22 +02:00

[240729] More flexible disabling of testcases

This commit is contained in:
Martin Oberhuber 2008-07-14 21:48:51 +00:00
parent 13fce66f31
commit 464ddfc950
24 changed files with 1383 additions and 1085 deletions

View file

@ -1,5 +1,5 @@
############################################################################### ###############################################################################
# Copyright (c) 2001, 2007 IBM Corporation and others. # Copyright (c) 2001, 2008 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
# Contributors: # Contributors:
# IBM Corporation - initial API and implementation # IBM Corporation - initial API and implementation
# Uwe Stieber (Wind River) - Rework test data location & connection management # Uwe Stieber (Wind River) - Rework test data location & connection management
# Martin Oberhuber (Wind River) - [240729] More flexible disabling of testcases
############################################################################### ###############################################################################
# #
@ -36,6 +37,23 @@ TestSubsystemTestCase.testAddAndDeleteDeepNodes=true
TestSubsystemTestCase.testAddAndDeleteFlatNodes=true TestSubsystemTestCase.testAddAndDeleteFlatNodes=true
TestSubsystemTestCase.testBugzilla170728=true TestSubsystemTestCase.testBugzilla170728=true
#
# The following section controls enablement of test cases by target or client platform.
# Uncomment a line to disable running unit tests on the specified target connection.
# Target connections refer to connection properties files, e.g. ftp --> ftpConnection.properties
# For active target connections, the Properties file must contain valid connection properties.
#
*.ftp=true
*.ftpWindows=true
*.linux=true
*.local=true
*.ssh=true
*.windows=true
Windows_XP.x86.*=true
Linux.x86.*=true
Linux.ppc.*=true
# #
# The following section contains externalized string for the single classes # The following section contains externalized string for the single classes
# #

View file

@ -52,6 +52,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testMoveOneUp() throws Exception { public void testMoveOneUp() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost host = hostArray[NUMBER_OF_HOSTS - 1]; IHost host = hostArray[NUMBER_OF_HOSTS - 1];
IHost[] hosts = new IHost[] {host}; IHost[] hosts = new IHost[] {host};
@ -65,6 +67,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testMoveManyUp() throws Exception { public void testMoveManyUp() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost[] hosts = new IHost[] {hostArray[NUMBER_OF_HOSTS - 1], hostArray[NUMBER_OF_HOSTS - 2]}; IHost[] hosts = new IHost[] {hostArray[NUMBER_OF_HOSTS - 1], hostArray[NUMBER_OF_HOSTS - 2]};
registry.moveHosts("TestProfile", hosts, -2); registry.moveHosts("TestProfile", hosts, -2);
@ -80,6 +84,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testMoveFirstUp() throws Exception { public void testMoveFirstUp() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost host = hostArray[0]; IHost host = hostArray[0];
assertEquals(0, registry.getHostPosition(host)); assertEquals(0, registry.getHostPosition(host));
@ -90,6 +96,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testMoveOneDown() throws Exception { public void testMoveOneDown() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost host = hostArray[1]; // second in the list IHost host = hostArray[1]; // second in the list
assertEquals(1, registry.getHostPosition(host)); assertEquals(1, registry.getHostPosition(host));
@ -102,6 +110,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testMoveManyDown() throws Exception { public void testMoveManyDown() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost[] hosts = new IHost[] {hostArray[0], hostArray[2], hostArray[4]}; IHost[] hosts = new IHost[] {hostArray[0], hostArray[2], hostArray[4]};
assertEquals(0, registry.getHostPosition(hostArray[0])); assertEquals(0, registry.getHostPosition(hostArray[0]));
@ -119,6 +129,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testMoveLastDown() throws Exception { public void testMoveLastDown() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost host = hostArray[NUMBER_OF_HOSTS - 1]; IHost host = hostArray[NUMBER_OF_HOSTS - 1];
assertEquals(NUMBER_OF_HOSTS - 1, registry.getHostPosition(host)); assertEquals(NUMBER_OF_HOSTS - 1, registry.getHostPosition(host));
@ -129,6 +141,8 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
public void testNoHost() throws Exception { public void testNoHost() throws Exception {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
checkPrecondition(); checkPrecondition();
IHost[] hosts = new IHost[] {}; IHost[] hosts = new IHost[] {};
registry.moveHosts("TestProfile", hosts, -1); // should not fail registry.moveHosts("TestProfile", hosts, -1); // should not fail
@ -152,7 +166,7 @@ public class HostMoveTest extends RSEBaseConnectionTestCase {
for (int i = 0; i < hostArray.length; i++) { for (int i = 0; i < hostArray.length; i++) {
String hostName = getHostName(i); String hostName = getHostName(i);
properties.setProperty(IRSEConnectionProperties.ATTR_NAME, hostName); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_NAME, hostName);
hostArray[i] = getConnectionManager().findOrCreateConnection(props); hostArray[i] = getConnectionManager().findOrCreateConnection(props);
assertNotNull("Failed to create connection " + props.getProperty(IRSEConnectionProperties.ATTR_NAME), hostArray[i]); //$NON-NLS-1$ assertNotNull("Failed to create connection " + props.getProperty(IRSEConnectionProperties.ATTR_NAME), hostArray[i]); //$NON-NLS-1$
} }

View file

@ -10,6 +10,7 @@
* Martin Oberhuber (Wind River) - fix build against 3.2.1, fix javadoc errors * Martin Oberhuber (Wind River) - fix build against 3.2.1, fix javadoc errors
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* Martin Oberhuber (Wind River) - [219086] flush event queue to shield tests from each other * Martin Oberhuber (Wind River) - [219086] flush event queue to shield tests from each other
* Martin Oberhuber (Wind River) - [240729] More flexible disabling of testcases
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.tests.core; package org.eclipse.rse.tests.core;
@ -70,6 +71,13 @@ public class RSECoreTestCase extends TestCase {
// Internal. Used to remember view zoom state changes. // Internal. Used to remember view zoom state changes.
private final String PROP_RSE_SYSTEMS_VIEW_ZOOM_STATE_CHANGED = "rseSystemsViewZoomStateChanged"; //$NON-NLS-1$ private final String PROP_RSE_SYSTEMS_VIEW_ZOOM_STATE_CHANGED = "rseSystemsViewZoomStateChanged"; //$NON-NLS-1$
// Target name, if set.
private String targetName = null;
// Client name, if set.
private static final String defaultClientName = (System.getProperty("os.name") + '.' + System.getProperty("os.arch")).replace(' ', '_');
private String clientName = defaultClientName;
/** /**
* Constructor. * Constructor.
*/ */
@ -90,6 +98,28 @@ public class RSECoreTestCase extends TestCase {
initializeProperties(); initializeProperties();
} }
/**
* Set the name of the target platform against which this test runs. Must be
* done from Constructor. Used to filter tests in {@link #isTestDisabled()}.
*
* @param targetName target platform name.
*/
public void setTargetName(String targetName) {
this.targetName = targetName;
}
/**
* Set the name of the client platform on which this test runs. Usually not
* necessary, since the default is computed automatically. If set, this must
* be done from the Constructor. Used to filter tests in
* {@link #isTestDisabled()}.
*
* @param clientName client platform name.
*/
public void setClientName(String clientName) {
this.clientName = clientName;
}
// ***** Test properties management and support methods ***** // ***** Test properties management and support methods *****
/** /**
@ -174,6 +204,81 @@ public class RSECoreTestCase extends TestCase {
return properties.getProperty(key, null); return properties.getProperty(key, null);
} }
/**
* Return the fully qualified name of the unit test currently running. Used
* for pattern matching against enablement rules. Qualification is
* "OS_Name"."OS_Arch"."Testclass"."methodname"."connectiontype" where the
* connectiontype may be empty if not specified.
*
* @return the fully qualified name of the unit test currently running.
*/
protected String getTestNameForCheck() {
String testName = getName();
String testClass = getClass().getName();
String testPackage = getClass().getPackage().getName();
String testClassSimpleName = testClass.substring(testPackage.length() + 1);
String checkName = testClassSimpleName + '.' + testName;
if (targetName != null) {
checkName = checkName + '.' + targetName;
}
if (clientName != null) {
checkName = clientName + '.' + checkName;
}
return checkName;
}
/**
* Check whether this test is currently disabled. Uses Introspection and
* JUnit Test Name to check against user-specified Properties file. Note
* that by default, all tests are enabled.
*
* @return true if this test should run, false otherwise.
*/
protected boolean isTestDisabled() {
String testName = getName();
String testClass = getClass().getName();
String testPackage = getClass().getPackage().getName();
String testClassSimpleName = testClass.substring(testPackage.length() + 1);
String checkName = testClassSimpleName + '.' + testName;
String checkString = checkName;
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
if (targetName != null) {
checkString = "*." + targetName;
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
checkString = checkName + '.' + targetName;
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
if (clientName != null) {
checkString = getTestNameForCheck();
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
}
}
if (clientName != null) {
checkString = clientName + ".*";
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
checkString = clientName + '.' + checkName;
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
}
return false;
}
// ***** Test case life cycle management and support methods ***** // ***** Test case life cycle management and support methods *****
final static QualifiedName BACKGROUND_TEST_EXECUTION_FINISHED = new QualifiedName(RSETestsPlugin.getDefault().getBundle().getSymbolicName(), "background_test_execution_finished"); //$NON-NLS-1$ final static QualifiedName BACKGROUND_TEST_EXECUTION_FINISHED = new QualifiedName(RSETestsPlugin.getDefault().getBundle().getSymbolicName(), "background_test_execution_finished"); //$NON-NLS-1$

View file

@ -30,6 +30,8 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase {
public void testSubSystemConfigurationProxy() { public void testSubSystemConfigurationProxy() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (isTestDisabled())
return;
ISystemRegistry systemRegistry = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry systemRegistry = RSECorePlugin.getTheSystemRegistry();
assertNotNull("Failed to fetch RSE system registry instance!", systemRegistry); //$NON-NLS-1$ assertNotNull("Failed to fetch RSE system registry instance!", systemRegistry); //$NON-NLS-1$

View file

@ -23,14 +23,14 @@ import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
import org.eclipse.rse.tests.core.RSECoreTestCase; import org.eclipse.rse.tests.core.RSECoreTestCase;
/** /**
* Tests the subsystem configuration proxy functionality. * Tests the subsystem interfaces.
*
* @author uwe.stieber@windriver.com
*/ */
public class SubSystemInterfacesTest extends RSECoreTestCase { public class SubSystemInterfacesTest extends RSECoreTestCase {
public void testSubSystemFinding() { public void testSubSystemFinding() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
assertNotNull("system registry not found", registry); //$NON-NLS-1$ assertNotNull("system registry not found", registry); //$NON-NLS-1$

View file

@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.rse.core.IRSEInitListener; import org.eclipse.rse.core.IRSEInitListener;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.tests.RSETestsPlugin;
/** /**
* Should be run on a clean workspace. * Should be run on a clean workspace.
@ -49,6 +50,7 @@ public class InitializationTest extends TestCase {
public void testInitialization() { public void testInitialization() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (!RSETestsPlugin.isTestCaseEnabled("InitializationTest.testInitialization"))return; //$NON-NLS-1$
try { try {
IStatus status = null; IStatus status = null;
status = RSECorePlugin.waitForInitCompletion(RSECorePlugin.INIT_MODEL); status = RSECorePlugin.waitForInitCompletion(RSECorePlugin.INIT_MODEL);

View file

@ -24,7 +24,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.IRSECoreTestCaseProperties; import org.eclipse.rse.tests.core.IRSECoreTestCaseProperties;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil; import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil.IInterruptCondition; import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil.IInterruptCondition;
@ -43,7 +42,8 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testCoreTestPropertiesHandling() { public void testCoreTestPropertiesHandling() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (!RSETestsPlugin.isTestCaseEnabled("RSEInternalFrameworkTestCase.testCoreTestPropertiesHandling")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// test for our defaults // test for our defaults
assertTrue("Unexpected default for property PROP_MAXIMIZE_REMOTE_SYSTEMS_VIEW!", isProperty(IRSECoreTestCaseProperties.PROP_MAXIMIZE_REMOTE_SYSTEMS_VIEW, false)); //$NON-NLS-1$ assertTrue("Unexpected default for property PROP_MAXIMIZE_REMOTE_SYSTEMS_VIEW!", isProperty(IRSECoreTestCaseProperties.PROP_MAXIMIZE_REMOTE_SYSTEMS_VIEW, false)); //$NON-NLS-1$
@ -103,7 +103,8 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testWaitAndDispatch() { public void testWaitAndDispatch() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (!RSETestsPlugin.isTestCaseEnabled("RSEInternalFrameworkTestCase.testWaitAndDispatch")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// the simple wait and dispatch is time out based // the simple wait and dispatch is time out based
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
@ -136,7 +137,8 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testTestDataLocationManagement() { public void testTestDataLocationManagement() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (!RSETestsPlugin.isTestCaseEnabled("RSEInternalFrameworkTestCase.testTestDataLocationManagement")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// get the pure test data location root path. // get the pure test data location root path.
IPath root = getTestDataLocation("", false); //$NON-NLS-1$ IPath root = getTestDataLocation("", false); //$NON-NLS-1$
@ -172,7 +174,8 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testConnectionManager() { public void testConnectionManager() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (!RSETestsPlugin.isTestCaseEnabled("RSEInternalFrameworkTestCase.testConnectionManager")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// get the pure test data location root path. // get the pure test data location root path.
IPath location = getTestDataLocation("testConnectionManager", false); //$NON-NLS-1$ IPath location = getTestDataLocation("testConnectionManager", false); //$NON-NLS-1$
@ -187,7 +190,7 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
assertEquals("Property name does not match!", "test_windows", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property name does not match!", "test_windows", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property profile name does not match!", "junit_test_profile", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property profile name does not match!", "junit_test_profile", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_WINDOWS_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_WINDOWS_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$
assertEquals("Property remote system address does not match!", "128.0.0.1", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property remote system address does not match!", "128.0.0.1", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property user id does not match!", "test_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "test_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property password does not match!", "test_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "test_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$
@ -201,7 +204,7 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
assertEquals("Property name does not match!", "Local", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property name does not match!", "Local", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$
assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$
assertEquals("Property remote system address does not match!", "localhost", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property remote system address does not match!", "localhost", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$
@ -211,7 +214,7 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
assertNull("Property name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ assertNull("Property name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$
assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$
assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$
assertNull("Property remote system address does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ assertNull("Property remote system address does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$
assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -28,7 +28,8 @@ public class RSETestsPluginTestCase extends RSECoreTestCase {
*/ */
public void testPluginResourceBundle() { public void testPluginResourceBundle() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (!RSETestsPlugin.isTestCaseEnabled("RSETestsPluginTestCase.testPluginResourceBundle")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
ResourceBundle bundle = RSETestsPlugin.getDefault().getResourceBundle(); ResourceBundle bundle = RSETestsPlugin.getDefault().getResourceBundle();
assertNotNull("No resource bundle associated with RSETestsPlugin!", bundle); //$NON-NLS-1$ assertNotNull("No resource bundle associated with RSETestsPlugin!", bundle); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/********************************************************************************* /*********************************************************************************
* Copyright (c) 2008 IBM Corporation. All rights reserved. * Copyright (c) 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -8,6 +8,7 @@
* David Dykstal (IBM) - initial contribution. * David Dykstal (IBM) - initial contribution.
* David Dykstal (IBM) - [189274] provide import and export operations for profiles * David Dykstal (IBM) - [189274] provide import and export operations for profiles
* David Dykstal (IBM) - [232126] add test for filter type persistence * David Dykstal (IBM) - [232126] add test for filter type persistence
* Martin Oberhuber (Wind River) - [240729] More flexible disabling of testcases
*********************************************************************************/ *********************************************************************************/
package org.eclipse.rse.tests.persistence; package org.eclipse.rse.tests.persistence;
@ -95,6 +96,8 @@ public class ExportImportTest extends RSECoreTestCase {
*/ */
public void testFilterPool1() { public void testFilterPool1() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
// find the provider // find the provider
IRSEPersistenceProvider persistenceProvider = manager.getPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider"); IRSEPersistenceProvider persistenceProvider = manager.getPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider");
@ -143,6 +146,8 @@ public class ExportImportTest extends RSECoreTestCase {
*/ */
public void testHost1() { public void testHost1() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
// find the provider // find the provider
IRSEPersistenceProvider persistenceProvider = manager.getPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider"); IRSEPersistenceProvider persistenceProvider = manager.getPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider");
@ -189,6 +194,8 @@ public class ExportImportTest extends RSECoreTestCase {
public void testPropertySet() { public void testPropertySet() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
} }
} }

View file

@ -1,11 +1,12 @@
/********************************************************************************* /*********************************************************************************
* Copyright (c) 2008 IBM Corporation. All rights reserved. * Copyright (c) 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - initial contribution. * David Dykstal (IBM) - initial contribution.
* Martin Oberhuber (Wind River) - [240729] More flexible disabling of testcases
*********************************************************************************/ *********************************************************************************/
package org.eclipse.rse.tests.persistence; package org.eclipse.rse.tests.persistence;
@ -23,6 +24,8 @@ public class MigrationTest extends RSECoreTestCase {
public void testProfileMigration() { public void testProfileMigration() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
// create a new profile // create a new profile
// set its persistence manager to PM1 // set its persistence manager to PM1
// populate the profile // populate the profile

View file

@ -61,6 +61,8 @@ public class PersistenceTest extends RSECoreTestCase {
public void testPersistenceManagerStartup() { public void testPersistenceManagerStartup() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
IRSEPersistenceManager m = RSECorePlugin.getThePersistenceManager(); IRSEPersistenceManager m = RSECorePlugin.getThePersistenceManager();
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
if (m.isRestoreComplete()) break; if (m.isRestoreComplete()) break;
@ -75,6 +77,8 @@ public class PersistenceTest extends RSECoreTestCase {
public void testProfilePersistence() { public void testProfilePersistence() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
/* /*
* Set up this particular test. * Set up this particular test.
*/ */
@ -187,6 +191,8 @@ public class PersistenceTest extends RSECoreTestCase {
public void testHostPersistence() { public void testHostPersistence() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
/* /*
* Set up this particular test. * Set up this particular test.
*/ */

View file

@ -45,6 +45,8 @@ public class PreferencesTest extends RSECoreTestCase {
public void testActiveProfiles() { public void testActiveProfiles() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
RSEPreferencesManager.addActiveProfile("bogus01"); //$NON-NLS-1$ RSEPreferencesManager.addActiveProfile("bogus01"); //$NON-NLS-1$
RSEPreferencesManager.addActiveProfile("bogus02"); //$NON-NLS-1$ RSEPreferencesManager.addActiveProfile("bogus02"); //$NON-NLS-1$
String[] profiles = RSEPreferencesManager.getActiveProfiles(); String[] profiles = RSEPreferencesManager.getActiveProfiles();
@ -63,6 +65,8 @@ public class PreferencesTest extends RSECoreTestCase {
public void testUserIds() { public void testUserIds() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
RSEPreferencesManager.setUserId("a.b.c", "bogusUser"); //$NON-NLS-1$ //$NON-NLS-2$ RSEPreferencesManager.setUserId("a.b.c", "bogusUser"); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("bogusUser", RSEPreferencesManager.getUserId("a.b.c")); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("bogusUser", RSEPreferencesManager.getUserId("a.b.c")); //$NON-NLS-1$ //$NON-NLS-2$
RSEPreferencesManager.clearUserId("a.b.c"); //$NON-NLS-1$ RSEPreferencesManager.clearUserId("a.b.c"); //$NON-NLS-1$
@ -71,6 +75,8 @@ public class PreferencesTest extends RSECoreTestCase {
public void testDefaultUserIds() { public void testDefaultUserIds() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
IRSECoreRegistry registry = RSECorePlugin.getTheCoreRegistry(); IRSECoreRegistry registry = RSECorePlugin.getTheCoreRegistry();
//TODO should we test deprecated methods as well? Probably yes... //TODO should we test deprecated methods as well? Probably yes...
IRSESystemType systemTypeDeprecated = registry.getSystemType("Local"); //$NON-NLS-1$ IRSESystemType systemTypeDeprecated = registry.getSystemType("Local"); //$NON-NLS-1$
@ -80,7 +86,7 @@ public class PreferencesTest extends RSECoreTestCase {
RSEPreferencesManager.setDefaultUserId(systemType, "bogus1"); //$NON-NLS-1$ RSEPreferencesManager.setDefaultUserId(systemType, "bogus1"); //$NON-NLS-1$
assertEquals("bogus1", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$ assertEquals("bogus1", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$
IRSESystemType localType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID); IRSESystemType localType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
RSEPreferencesManager.setDefaultUserId(localType, "bogus2"); //$NON-NLS-1$ //$NON-NLS-2$ RSEPreferencesManager.setDefaultUserId(localType, "bogus2"); //$NON-NLS-1$
assertEquals("bogus2", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$ assertEquals("bogus2", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$
RSEPreferencesManager.setDefaultUserId(systemType, oldValue); RSEPreferencesManager.setDefaultUserId(systemType, oldValue);
assertEquals(oldValue, RSEPreferencesManager.getDefaultUserId(systemType)); assertEquals(oldValue, RSEPreferencesManager.getDefaultUserId(systemType));
@ -88,6 +94,8 @@ public class PreferencesTest extends RSECoreTestCase {
public void testShowLocalConnection() { public void testShowLocalConnection() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
assertTrue(SystemPreferencesManager.getShowLocalConnection()); assertTrue(SystemPreferencesManager.getShowLocalConnection());
} }

View file

@ -53,6 +53,8 @@ public class ProfileTest extends RSECoreTestCase {
public void testDefaultProfileMarking() { public void testDefaultProfileMarking() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
assertNotNull("default profile is null", defaultProfile); assertNotNull("default profile is null", defaultProfile);
assertTrue("default profile is not active - 1", defaultProfile.isActive()); assertTrue("default profile is not active - 1", defaultProfile.isActive());
assertTrue("default profile is not marked as default", defaultProfile.isDefaultPrivate()); assertTrue("default profile is not marked as default", defaultProfile.isDefaultPrivate());
@ -60,6 +62,8 @@ public class ProfileTest extends RSECoreTestCase {
public void testDefaultProfileActivation() { public void testDefaultProfileActivation() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
registry.setSystemProfileActive(defaultProfile, true); registry.setSystemProfileActive(defaultProfile, true);
assertTrue("default profile is not active - 2", defaultProfile.isActive()); assertTrue("default profile is not active - 2", defaultProfile.isActive());
registry.setSystemProfileActive(defaultProfile, false); // this should be ignored registry.setSystemProfileActive(defaultProfile, false); // this should be ignored
@ -68,6 +72,8 @@ public class ProfileTest extends RSECoreTestCase {
public void testDefaultProfileRename() { public void testDefaultProfileRename() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
ISystemProfile profile = registry.getSystemProfile("bogus"); ISystemProfile profile = registry.getSystemProfile("bogus");
assertNull(profile); assertNull(profile);
@ -89,6 +95,8 @@ public class ProfileTest extends RSECoreTestCase {
public void testProfileActivation() { public void testProfileActivation() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
ISystemProfile profile = registry.getSystemProfile("bogus"); ISystemProfile profile = registry.getSystemProfile("bogus");
assertNull(profile); assertNull(profile);
@ -107,6 +115,8 @@ public class ProfileTest extends RSECoreTestCase {
public void testDefaultProfileDeletion() { public void testDefaultProfileDeletion() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
registry.deleteSystemProfile(defaultProfile); // this should be ignored registry.deleteSystemProfile(defaultProfile); // this should be ignored
List profiles = Arrays.asList(manager.getSystemProfiles()); List profiles = Arrays.asList(manager.getSystemProfiles());
@ -119,6 +129,8 @@ public class ProfileTest extends RSECoreTestCase {
public void testProfileDeletion() { public void testProfileDeletion() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
try { try {
ISystemProfile profile = registry.getSystemProfile("bogus"); ISystemProfile profile = registry.getSystemProfile("bogus");
assertNull(profile); assertNull(profile);

View file

@ -59,30 +59,33 @@ public class CreateFileTestCase extends FileServiceBaseTest {
public void testCreateFileFTP() throws Exception { public void testCreateFileFTP() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getFTPHost(); host = getFTPHost();
if (isTestDisabled())
return;
createFileAndAssertProperties(); createFileAndAssertProperties();
} }
public void testCreateFileLinux() throws Exception { public void testCreateFileLinux() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
// Lookup and create the connection now if necessary
host = getLinuxHost(); host = getLinuxHost();
if (isTestDisabled())
return;
createFileAndAssertProperties(); createFileAndAssertProperties();
} }
public void testCreateFileSSH() throws Exception { public void testCreateFileSSH() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getSSHHost(); host = getSSHHost();
if (isTestDisabled())
return;
createFileAndAssertProperties(); createFileAndAssertProperties();
} }
public void testCreateFileWindows() throws Exception { public void testCreateFileWindows() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getWindowsHost(); host = getWindowsHost();
if (isTestDisabled())
return;
createFileAndAssertProperties(); createFileAndAssertProperties();
} }

View file

@ -30,7 +30,6 @@ import org.eclipse.rse.internal.services.files.ftp.FTPService;
import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.files.IHostFile; import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.subsystems.files.ftp.FTPFileSubSystemConfiguration; import org.eclipse.rse.subsystems.files.ftp.FTPFileSubSystemConfiguration;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil; import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties; import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase; import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
@ -65,7 +64,8 @@ public class FTPFileSubsystemTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testFTPReadAccessToRemoteHost() { public void testFTPReadAccessToRemoteHost() {
//-test-author-:UweStieber //-test-author-:UweStieber
if (!RSETestsPlugin.isTestCaseEnabled("FTPFileSubsystemTestCase.testFTPReadAccessToRemoteHost")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
ISystemRegistry systemRegistry = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry systemRegistry = RSECorePlugin.getTheSystemRegistry();
assertNotNull("Failed to get RSE system registry instance!", systemRegistry); //$NON-NLS-1$ assertNotNull("Failed to get RSE system registry instance!", systemRegistry); //$NON-NLS-1$

View file

@ -63,60 +63,80 @@ public class FileOutputStreamTestCase extends FileServiceBaseTest {
public void testRSEFileStoreAppendOutputStreamLocal() throws Exception { public void testRSEFileStoreAppendOutputStreamLocal() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getLocalSystemConnection(); host = getLocalSystemConnection();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.APPEND); outputStreamFileWriting(EFS.APPEND);
} }
public void testRSEFileStoreAppendOutputStreamFTP() throws Exception { public void testRSEFileStoreAppendOutputStreamFTP() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getFTPHost(); host = getFTPHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.APPEND); outputStreamFileWriting(EFS.APPEND);
} }
public void testRSEFileStoreAppendOutputStreamLinux() throws Exception { public void testRSEFileStoreAppendOutputStreamLinux() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getLinuxHost(); host = getLinuxHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.APPEND); outputStreamFileWriting(EFS.APPEND);
} }
public void testRSEFileStoreAppendOutputStreamWindows() throws Exception { public void testRSEFileStoreAppendOutputStreamWindows() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getWindowsHost(); host = getWindowsHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.APPEND); outputStreamFileWriting(EFS.APPEND);
} }
public void testRSEFileStoreAppendOutputStreamSSH() throws Exception { public void testRSEFileStoreAppendOutputStreamSSH() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getSSHHost(); host = getSSHHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.APPEND); outputStreamFileWriting(EFS.APPEND);
} }
public void testRSEFileStoreOverwriteOutputStreamLocal() throws Exception { public void testRSEFileStoreOverwriteOutputStreamLocal() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getLocalSystemConnection(); host = getLocalSystemConnection();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.NONE); outputStreamFileWriting(EFS.NONE);
} }
public void testRSEFileStoreOverwriteOutputStreamFTP() throws Exception { public void testRSEFileStoreOverwriteOutputStreamFTP() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getFTPHost(); host = getFTPHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.NONE); outputStreamFileWriting(EFS.NONE);
} }
public void testRSEFileStoreOverwriteOutputStreamLinux() throws Exception { public void testRSEFileStoreOverwriteOutputStreamLinux() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getLinuxHost(); host = getLinuxHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.NONE); outputStreamFileWriting(EFS.NONE);
} }
public void testRSEFileStoreOverwriteOutputStreamWindows() throws Exception { public void testRSEFileStoreOverwriteOutputStreamWindows() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getWindowsHost(); host = getWindowsHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.NONE); outputStreamFileWriting(EFS.NONE);
} }
public void testRSEFileStoreOverwriteOutputStreamSSH() throws Exception { public void testRSEFileStoreOverwriteOutputStreamSSH() throws Exception {
//-test-author-:KevinDoyle //-test-author-:KevinDoyle
host = getSSHHost(); host = getSSHHost();
if (isTestDisabled())
return;
outputStreamFileWriting(EFS.NONE); outputStreamFileWriting(EFS.NONE);
} }

View file

@ -23,7 +23,6 @@ import org.eclipse.rse.core.model.SystemWorkspaceResourceSet;
import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter; import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter;
import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility; import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.tests.RSETestsPlugin;
public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest { public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
@ -499,7 +498,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testCreateTarFile() throws Exception { public void testCreateTarFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip file first. //Create the zip file first.
IRemoteFile newArchiveFile = createFileOrFolder(tempDirPath, testName, false); IRemoteFile newArchiveFile = createFileOrFolder(tempDirPath, testName, false);
@ -552,7 +552,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testCopyToTarArchiveFile() throws Exception { public void testCopyToTarArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -584,7 +585,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testCopyTarVirtualFile() throws Exception { public void testCopyTarVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -615,7 +617,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testMoveToTarArchiveFile() throws Exception { public void testMoveToTarArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -650,7 +653,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testMoveTarVirtualFile() throws Exception { public void testMoveTarVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -687,7 +691,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testRenameTarVirtualFile() throws Exception { public void testRenameTarVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip file first. //Create the zip file first.
IRemoteFile newArchiveFile = createFileOrFolder(tempDirPath, testName, false); IRemoteFile newArchiveFile = createFileOrFolder(tempDirPath, testName, false);
@ -755,7 +760,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testDeleteTarVirtualFile() throws Exception { public void testDeleteTarVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -826,7 +832,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testCopyBatchToTarArchiveFile() throws Exception { public void testCopyBatchToTarArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceTarFiles(); createSourceTarFiles();
createSourceFolders(); createSourceFolders();
@ -883,7 +890,8 @@ public abstract class FileServiceArchiveBaseTest extends FileServiceBaseTest {
public void testOpenFileFromTarArchive() throws Exception { public void testOpenFileFromTarArchive() throws Exception {
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createTarSourceForOpen(); createTarSourceForOpen();

View file

@ -24,7 +24,6 @@ import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter;
import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility; import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.tests.RSETestsPlugin;
public class FileServiceArchiveTest extends FileServiceArchiveBaseTest { public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
@ -306,7 +305,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCreateZipFile() throws Exception { public void testCreateZipFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip file first. //Create the zip file first.
String testName = "dummy.zip"; String testName = "dummy.zip";
@ -362,7 +362,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testRenameVirtualFile() throws Exception { public void testRenameVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip file first. //Create the zip file first.
String testName = "dummy.zip"; String testName = "dummy.zip";
@ -434,7 +435,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveVirtualFile() throws Exception { public void testMoveVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the source data needed for testing //Create the source data needed for testing
createSourceZipFiles(); createSourceZipFiles();
@ -469,7 +471,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveVirtualFileLevelTwo() throws Exception { public void testMoveVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -506,7 +509,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveToArchiveFile() throws Exception { public void testMoveToArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -540,7 +544,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveToVirtualFileLevelOne() throws Exception { public void testMoveToVirtualFileLevelOne() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -576,7 +581,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveToVirtualFileLevelTwo() throws Exception { public void testMoveToVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -613,7 +619,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyVirtualFile() throws Exception { public void testCopyVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -641,7 +648,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyVirtualFileLevelTwo() throws Exception { public void testCopyVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -673,7 +681,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyToArchiveFile() throws Exception { public void testCopyToArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -704,7 +713,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyToVirtualFileLevelOne() throws Exception { public void testCopyToVirtualFileLevelOne() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -737,7 +747,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyToVirtualFileLevelTwo() throws Exception { public void testCopyToVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -769,7 +780,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchToArchiveFile() throws Exception { public void testCopyBatchToArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -824,7 +836,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchToVirtualFileLevelOne() throws Exception { public void testCopyBatchToVirtualFileLevelOne() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -857,7 +870,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchToVirtualFileLevelTwo() throws Exception { public void testCopyBatchToVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
createSourceFolders(); createSourceFolders();
@ -917,7 +931,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchVirtualFile() throws Exception { public void testCopyBatchVirtualFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -963,7 +978,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchVirtualFileLevelTwo() throws Exception { public void testCopyBatchVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -996,7 +1012,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyVirtualBatchToArchiveFile() throws Exception { public void testCopyVirtualBatchToArchiveFile() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -1028,7 +1045,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyVirtualBatchToVirtualFileLevelOne() throws Exception { public void testCopyVirtualBatchToVirtualFileLevelOne() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -1085,7 +1103,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyVirtualBatchToVirtualFileLevelTwo() throws Exception { public void testCopyVirtualBatchToVirtualFileLevelTwo() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -1128,7 +1147,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyToTarVirtualFileLevelOne() throws Exception { public void testCopyToTarVirtualFileLevelOne() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -1161,7 +1181,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyToTarVirtualFileLevelFour() throws Exception { public void testCopyToTarVirtualFileLevelFour() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -1200,7 +1221,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyTarVirtualFileLevelFour() throws Exception { public void testCopyTarVirtualFileLevelFour() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -1249,7 +1271,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveToTarVirtualFileLevelOne() throws Exception { public void testMoveToTarVirtualFileLevelOne() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -1286,7 +1309,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveToVirtualFileLevelFour() throws Exception { public void testMoveToVirtualFileLevelFour() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -1330,7 +1354,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testMoveTarVirtualFileLevelFour() throws Exception { public void testMoveTarVirtualFileLevelFour() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//create the source for testing first //create the source for testing first
createSourceTarFiles(); createSourceTarFiles();
@ -1376,7 +1401,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchToTarVirtualFileLevelFour() throws Exception { public void testCopyBatchToTarVirtualFileLevelFour() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceTarFiles(); createSourceTarFiles();
createSourceFolders(); createSourceFolders();
@ -1443,7 +1469,8 @@ public class FileServiceArchiveTest extends FileServiceArchiveBaseTest {
public void testCopyBatchTarVirtualFileLevelFive() throws Exception { public void testCopyBatchTarVirtualFileLevelFive() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceTarFiles(); createSourceTarFiles();

View file

@ -34,7 +34,6 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.ui.ISystemPreferencesConstants; import org.eclipse.rse.ui.ISystemPreferencesConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
@ -49,6 +48,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
*/ */
public FileServiceArchiveTestDStore(String name) { public FileServiceArchiveTestDStore(String name) {
super(name); super(name);
setTargetName("linux");
} }
public static junit.framework.Test suite() { public static junit.framework.Test suite() {
@ -178,6 +178,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testSuperTransferLocalToRemote() throws Exception { public void testSuperTransferLocalToRemote() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (isTestDisabled())
return;
String tempPath = getWorkspace().getRoot().getLocation().append("temp").toString(); String tempPath = getWorkspace().getRoot().getLocation().append("temp").toString();
IFileStore temp = createDir(tempPath, true); IFileStore temp = createDir(tempPath, true);
@ -220,6 +222,9 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testSuperTransferDStoreWindowsAndDStore() throws Exception { public void testSuperTransferDStoreWindowsAndDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
getWindowsHost();
if (isTestDisabled())
return;
String tempPath = getWorkspace().getRoot().getLocation().append("temp").toString(); String tempPath = getWorkspace().getRoot().getLocation().append("temp").toString();
IFileStore temp = createDir(tempPath, true); IFileStore temp = createDir(tempPath, true);
@ -310,6 +315,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testSuperTransferDStoreToLocal() throws Exception { public void testSuperTransferDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (isTestDisabled())
return;
String tempPath = getWorkspace().getRoot().getLocation().append("temp").toString(); String tempPath = getWorkspace().getRoot().getLocation().append("temp").toString();
IFileStore temp = createDir(tempPath, true); IFileStore temp = createDir(tempPath, true);
@ -385,7 +392,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVirtualFileFromDStoreToLocal() throws Exception { public void testCopyVirtualFileFromDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -444,7 +452,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVirtualFileLevelTwoFromDStoreToLocal() throws Exception { public void testCopyVirtualFileLevelTwoFromDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
createSourceZipFiles(); createSourceZipFiles();
@ -504,7 +513,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVirtualFileFromLocalToDStore() throws Exception { public void testCopyVirtualFileFromLocalToDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
IRemoteFile sourceZipLocation = createSourceZipFiles(localFss); IRemoteFile sourceZipLocation = createSourceZipFiles(localFss);
@ -545,7 +555,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVirtualFileLevelTwoFromLocalToDStore() throws Exception { public void testCopyVirtualFileLevelTwoFromLocalToDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
IRemoteFile sourceZipLocation = createSourceZipFiles(localFss); IRemoteFile sourceZipLocation = createSourceZipFiles(localFss);
@ -591,7 +602,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFToArchiveFromDStoreToLocal() throws Exception { public void testCopyVFToArchiveFromDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -636,7 +648,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFLevelTwoToArchiveFromDStoreToLocal() throws Exception { public void testCopyVFLevelTwoToArchiveFromDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -687,7 +700,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFToArchiveFromLocalToDStore() throws Exception { public void testCopyVFToArchiveFromLocalToDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -736,7 +750,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFLevelTwoToArchiveFromLocalToDStore() throws Exception { public void testCopyVFLevelTwoToArchiveFromLocalToDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -789,7 +804,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFToVFFromDStoreToLocal() throws Exception { public void testCopyVFToVFFromDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -834,7 +850,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFToVFLevelTwoFromDStoreToLocal() throws Exception { public void testCopyVFToVFLevelTwoFromDStoreToLocal() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -884,7 +901,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFToVFFromLocalToDStore() throws Exception { public void testCopyVFToVFFromLocalToDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();
@ -933,7 +951,8 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
public void testCopyVFToVFLevelTwoFromLocalToDStore() throws Exception { public void testCopyVFToVFLevelTwoFromLocalToDStore() throws Exception {
//-test-author-:XuanChen //-test-author-:XuanChen
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
//Create the zip files in dstore connection. //Create the zip files in dstore connection.
createSourceZipFiles(); createSourceZipFiles();

View file

@ -36,6 +36,7 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
*/ */
public FileServiceArchiveTestDStoreWindows(String name) { public FileServiceArchiveTestDStoreWindows(String name) {
super(name); super(name);
setTargetName("windows");
} }
public static junit.framework.Test suite() { public static junit.framework.Test suite() {

View file

@ -63,11 +63,14 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
*/ */
public FileServiceBaseTest(String name) { public FileServiceBaseTest(String name) {
super(name); super(name);
setTargetName("local");
} }
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
setupFileSubSystem(); setupFileSubSystem();
if (isTestDisabled())
return;
//Create a temparory directory in My Home //Create a temparory directory in My Home
try try
{ {
@ -85,11 +88,13 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
} }
public void tearDown() throws Exception { public void tearDown() throws Exception {
if (fss != null) {
try { try {
fss.delete(tempDir, mon); fss.delete(tempDir, mon);
} catch(SystemMessageException msg) { } catch (SystemMessageException msg) {
//ensure that super.tearDown() can run // ensure that super.tearDown() can run
System.err.println("Exception on tearDown: "+msg.getLocalizedMessage()); //$NON-NLS-1$ System.err.println("Exception on tearDown: " + msg.getLocalizedMessage()); //$NON-NLS-1$
}
} }
super.tearDown(); super.tearDown();
} }
@ -397,6 +402,8 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
protected void setupFileSubSystem() protected void setupFileSubSystem()
{ {
IHost localHost = getLocalSystemConnection(); IHost localHost = getLocalSystemConnection();
if (isTestDisabled())
return;
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystem[] ss = sr.getServiceSubSystems(localHost, IFileService.class); ISubSystem[] ss = sr.getServiceSubSystems(localHost, IFileService.class);
for (int i=0; i<ss.length; i++) { for (int i=0; i<ss.length; i++) {

View file

@ -30,7 +30,6 @@ import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase; import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
public class FileServiceTest extends RSEBaseConnectionTestCase { public class FileServiceTest extends RSEBaseConnectionTestCase {
@ -64,6 +63,11 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
public FileServiceTest(String name, String propertiesFileName) { public FileServiceTest(String name, String propertiesFileName) {
super(name); super(name);
fPropertiesFileName = propertiesFileName; fPropertiesFileName = propertiesFileName;
if (propertiesFileName != null) {
int idx = propertiesFileName.indexOf("Connection.properties");
String targetName = propertiesFileName.substring(0, idx);
setTargetName(targetName);
}
} }
public static Test suite() { public static Test suite() {
@ -128,6 +132,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
public void testGetRootProperties() throws Exception { public void testGetRootProperties() throws Exception {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (isTestDisabled()) return;
IHostFile[] roots = fs.getRoots(new NullProgressMonitor()); IHostFile[] roots = fs.getRoots(new NullProgressMonitor());
assertNotNull(roots); assertNotNull(roots);
assertTrue(roots.length > 0); assertTrue(roots.length > 0);
@ -138,6 +143,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
String rootName = roots[i].getName(); String rootName = roots[i].getName();
assertNotNull(rootName); assertNotNull(rootName);
System.out.println(rootName); System.out.println(rootName);
// DStore: NPE, bug 240710
IHostFile newHf = fs.getFile(null, rootName, new NullProgressMonitor()); IHostFile newHf = fs.getFile(null, rootName, new NullProgressMonitor());
assertTrue(newHf.isRoot()); assertTrue(newHf.isRoot());
assertTrue(newHf.exists()); assertTrue(newHf.exists());
@ -151,7 +157,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
public void testCaseSensitive() { public void testCaseSensitive() {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCaseSensitive")) return; //$NON-NLS-1$ if (isTestDisabled()) return;
if (isWindows()) { if (isWindows()) {
assertFalse(fs.isCaseSensitive()); assertFalse(fs.isCaseSensitive());
@ -166,7 +172,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
public void testCreateFile() throws SystemMessageException { public void testCreateFile() throws SystemMessageException {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateFile")) return; //$NON-NLS-1$ if (isTestDisabled()) return;
String testName = getTestFileName(); String testName = getTestFileName();
IHostFile hf = fs.createFile(tempDirPath, testName, mon); //dstore-linux: bug 235492 IHostFile hf = fs.createFile(tempDirPath, testName, mon); //dstore-linux: bug 235492
@ -187,7 +193,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
public void testCreateCaseSensitive() throws SystemMessageException { public void testCreateCaseSensitive() throws SystemMessageException {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (!RSETestsPlugin.isTestCaseEnabled("FileServiceTest.testCreateCaseSensitive")) return; //$NON-NLS-1$ if (isTestDisabled()) return;
String testName = getTestFileName(); String testName = getTestFileName();
String testName2 = testName.toUpperCase(); String testName2 = testName.toUpperCase();

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [240729] More flexible disabling of testcases
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.subsystems.files; package org.eclipse.rse.tests.subsystems.files;
@ -74,6 +75,11 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public RSEFileStoreTest(String name, String propertiesFileName) { public RSEFileStoreTest(String name, String propertiesFileName) {
super(name); super(name);
fPropertiesFileName = propertiesFileName; fPropertiesFileName = propertiesFileName;
if (propertiesFileName != null) {
int idx = propertiesFileName.indexOf("Connection.properties");
String targetName = propertiesFileName.substring(0, idx);
setTargetName(targetName);
}
} }
public static Test suite() { public static Test suite() {
@ -178,6 +184,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testRecursiveGetParent() { public void testRecursiveGetParent() {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (isTestDisabled())
return;
IFileStore store = fTestStore; IFileStore store = fTestStore;
String homePath = store.toURI().getPath(); String homePath = store.toURI().getPath();
assertTrue("exists: " + store, store.fetchInfo().exists()); assertTrue("exists: " + store, store.fetchInfo().exists());
@ -193,6 +201,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testAppendOutputStream() throws Exception { public void testAppendOutputStream() throws Exception {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (isTestDisabled())
return;
IFileStore f = createFile("foo"); IFileStore f = createFile("foo");
fOS = f.openOutputStream(EFS.APPEND, getDefaultProgressMonitor()); fOS = f.openOutputStream(EFS.APPEND, getDefaultProgressMonitor());
fOS.write("bar".getBytes()); fOS.write("bar".getBytes());
@ -211,6 +221,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testPutInfo() throws Exception { public void testPutInfo() throws Exception {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (isTestDisabled())
return;
IFileInfo testInfo = fTestStore.fetchInfo(); IFileInfo testInfo = fTestStore.fetchInfo();
assertTrue("1.1", testInfo.exists()); assertTrue("1.1", testInfo.exists());
assertTrue("1.2", testInfo.isDirectory()); assertTrue("1.2", testInfo.isDirectory());
@ -250,6 +262,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testDeleteSpecialCases() throws Exception { public void testDeleteSpecialCases() throws Exception {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (isTestDisabled())
return;
String testFileName = "noPerm.txt"; //$NON-NLS-1$ String testFileName = "noPerm.txt"; //$NON-NLS-1$
boolean exceptionThrown = false; boolean exceptionThrown = false;
@ -350,6 +364,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testModifyNonExisting() throws Exception { public void testModifyNonExisting() throws Exception {
// -test-author-:MartinOberhuber // -test-author-:MartinOberhuber
if (isTestDisabled())
return;
IFileStore store = fTestStore.getChild("nonExisting.txt"); IFileStore store = fTestStore.getChild("nonExisting.txt");
IFileInfo info; IFileInfo info;
boolean exceptionThrown = false; boolean exceptionThrown = false;
@ -435,6 +451,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testModifyReadOnly() throws Exception { public void testModifyReadOnly() throws Exception {
//-test-author-:MartinOberhuber //-test-author-:MartinOberhuber
if (isTestDisabled())
return;
IFileStore store = createFile("readOnly.txt"); IFileStore store = createFile("readOnly.txt");
IFileInfo info = store.fetchInfo(); IFileInfo info = store.fetchInfo();
info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, true); info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, true);
@ -494,6 +512,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
public void testMakeDeleteTree() throws Exception { public void testMakeDeleteTree() throws Exception {
// -test-author-:MartinOberhuber // -test-author-:MartinOberhuber
// Create folder // Create folder
if (isTestDisabled())
return;
IFileStore treeStore = fTestStore.getChild("treeTest"); IFileStore treeStore = fTestStore.getChild("treeTest");
treeStore.mkdir(EFS.SHALLOW, getDefaultProgressMonitor()); treeStore.mkdir(EFS.SHALLOW, getDefaultProgressMonitor());
@ -597,6 +617,8 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
} }
public void test255files() throws Exception { public void test255files() throws Exception {
if (isTestDisabled())
return;
IFileStore f = fTestStore.getChild("f"); IFileStore f = fTestStore.getChild("f");
f.mkdir(EFS.SHALLOW, getDefaultProgressMonitor()); f.mkdir(EFS.SHALLOW, getDefaultProgressMonitor());
for (int i = 0; i < 255; i++) { for (int i = 0; i < 255; i++) {

View file

@ -41,6 +41,8 @@ public class MnemonicsTest extends RSECoreTestCase {
public void testDefaultGeneration() { public void testDefaultGeneration() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
Mnemonics mn = new Mnemonics(); Mnemonics mn = new Mnemonics();
mn.clear("abcde"); mn.clear("abcde");
String result = mn.setUniqueMnemonic("A..."); String result = mn.setUniqueMnemonic("A...");
@ -51,6 +53,8 @@ public class MnemonicsTest extends RSECoreTestCase {
public void testAppendPolicies() { public void testAppendPolicies() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
setLocalePattern(".*"); // match all locales setLocalePattern(".*"); // match all locales
Mnemonics mn = new Mnemonics(); Mnemonics mn = new Mnemonics();
mn.clear("abcde"); mn.clear("abcde");