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:53:41 +00:00
parent 464ddfc950
commit c41e3fd332
7 changed files with 189 additions and 154 deletions

View file

@ -245,6 +245,16 @@ public class RSECoreTestCase extends TestCase {
System.out.println("--> disabled due to rule: " + checkString); System.out.println("--> disabled due to rule: " + checkString);
return true; return true;
} }
checkString = testClassSimpleName + ".*";
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
checkString = "*." + testName;
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
System.out.println("--> disabled due to rule: " + checkString);
return true;
}
if (targetName != null) { if (targetName != null) {
checkString = "*." + targetName; checkString = "*." + targetName;
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) { if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {

View file

@ -77,6 +77,9 @@ public class RSEBaseConnectionTestCase extends RSECoreTestCase {
* @return The local system type connection or <code>null</code> if the lookup fails. * @return The local system type connection or <code>null</code> if the lookup fails.
*/ */
protected IHost getLocalSystemConnection() { protected IHost getLocalSystemConnection() {
setTargetName("local");
if (isTestDisabled())
return null;
assertNotNull("Local system connection properties are not available!", localSystemConnectionProperties); //$NON-NLS-1$ assertNotNull("Local system connection properties are not available!", localSystemConnectionProperties); //$NON-NLS-1$
Exception exception = null; Exception exception = null;
@ -97,21 +100,33 @@ public class RSEBaseConnectionTestCase extends RSECoreTestCase {
protected IHost getSSHHost() protected IHost getSSHHost()
{ {
setTargetName("ssh");
if (isTestDisabled())
return null;
return getHost("sshConnection.properties"); return getHost("sshConnection.properties");
} }
protected IHost getFTPHost() protected IHost getFTPHost()
{ {
setTargetName("ftp");
if (isTestDisabled())
return null;
return getHost("ftpConnection.properties"); return getHost("ftpConnection.properties");
} }
protected IHost getLinuxHost() protected IHost getLinuxHost()
{ {
setTargetName("linux");
if (isTestDisabled())
return null;
return getHost("linuxConnection.properties"); return getHost("linuxConnection.properties");
} }
protected IHost getWindowsHost() protected IHost getWindowsHost()
{ {
setTargetName("windows");
if (isTestDisabled())
return null;
return getHost("windowsConnection.properties"); return getHost("windowsConnection.properties");
} }

View file

@ -22,7 +22,6 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
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;
@ -40,6 +39,8 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testConnectionCaseInSensitive() throws Exception { public void testConnectionCaseInSensitive() throws Exception {
// -test-author-:MartinOberhuber // -test-author-:MartinOberhuber
if (isTestDisabled())
return;
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISystemProfile prof = RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile(); ISystemProfile prof = RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile();
ISystemProfile testprof = RSECorePlugin.getTheSystemProfileManager().cloneSystemProfile(prof, "testConnectionCaseInSensitive"); ISystemProfile testprof = RSECorePlugin.getTheSystemProfileManager().cloneSystemProfile(prof, "testConnectionCaseInSensitive");
@ -60,7 +61,8 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testConnectionCreation() { public void testConnectionCreation() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testConnectionCreation")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME, "TestProfile"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME, "TestProfile"); //$NON-NLS-1$
@ -105,7 +107,8 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testConnectionRemoval() { public void testConnectionRemoval() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testConnectionRemoval")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
String profileName = "TestProfile"; //$NON-NLS-1$ String profileName = "TestProfile"; //$NON-NLS-1$
@ -123,12 +126,13 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testConnect() { public void testConnect() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testConnect")) return; //$NON-NLS-1$ IHost connection = getLocalSystemConnection();
if (isTestDisabled())
return;
Exception exception = null; Exception exception = null;
String cause = null; String cause = null;
IHost connection = getLocalSystemConnection();
ISubSystem subsystem = null; ISubSystem subsystem = null;
try { try {
subsystem = getConnectionManager().getFileSubSystem(connection, "local.files"); //$NON-NLS-1$ subsystem = getConnectionManager().getFileSubSystem(connection, "local.files"); //$NON-NLS-1$
@ -173,12 +177,13 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
*/ */
public void testResolveFilterString() { public void testResolveFilterString() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testResolveFilterString")) return; //$NON-NLS-1$ IHost connection = getLocalSystemConnection();
if (isTestDisabled())
return;
Exception exception = null; Exception exception = null;
String cause = null; String cause = null;
IHost connection = getLocalSystemConnection();
ISubSystem subsystem = null; ISubSystem subsystem = null;
try { try {
subsystem = getConnectionManager().getFileSubSystem(connection, "local.files"); //$NON-NLS-1$ subsystem = getConnectionManager().getFileSubSystem(connection, "local.files"); //$NON-NLS-1$

View file

@ -39,6 +39,8 @@ public class PasswordsTest extends RSECoreTestCase {
public void testAddRemove() { public void testAddRemove() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
IRSESystemType systemType = RSECoreRegistry.getInstance().getSystemType(IRSESystemType.SYSTEMTYPE_UNIX_ID); IRSESystemType systemType = RSECoreRegistry.getInstance().getSystemType(IRSESystemType.SYSTEMTYPE_UNIX_ID);
IRSESystemType defaultSystemType = PasswordPersistenceManager.DEFAULT_SYSTEM_TYPE; IRSESystemType defaultSystemType = PasswordPersistenceManager.DEFAULT_SYSTEM_TYPE;
String hostAddress = "somesystem.mycompany.com"; String hostAddress = "somesystem.mycompany.com";
@ -91,6 +93,8 @@ public class PasswordsTest extends RSECoreTestCase {
public void testSaveDenial() { public void testSaveDenial() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
IRSESystemType systemType = RSECoreRegistry.getInstance().getSystemType(IRSESystemType.SYSTEMTYPE_UNIX_ID); IRSESystemType systemType = RSECoreRegistry.getInstance().getSystemType(IRSESystemType.SYSTEMTYPE_UNIX_ID);
String hostAddress = "somesystem.mycompany.com"; String hostAddress = "somesystem.mycompany.com";
boolean deny = RSEPreferencesManager.getDenyPasswordSave(systemType, hostAddress); boolean deny = RSEPreferencesManager.getDenyPasswordSave(systemType, hostAddress);

View file

@ -26,7 +26,6 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase; import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
/** /**
@ -38,7 +37,7 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
private List _connections; private List _connections;
private List _samplePaths; private List _samplePaths;
private String LOCALTEMPDIR = "C:\\temp"; private String LOCALTEMPDIR = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.tests.core.RSECoreTestCase#tearDown() * @see org.eclipse.rse.tests.core.RSECoreTestCase#tearDown()
@ -80,15 +79,12 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
_connections = new ArrayList(); _connections = new ArrayList();
_subSystems = new ArrayList(); _subSystems = new ArrayList();
// setup dstore connection //TODO Support Windows style connections
addSystem(getLinuxHost()); //String[] connTypes = { "local", "ssh", "ftpWindows", "ftp", "linux", "windows" };
String[] connTypes = { "ssh", "ftp", "linux" };
// setup ssh connection for (int i = 0; i < connTypes.length; i++) {
addSystem(getSSHHost()); addSystem(getHost(connTypes[i] + "Connection.properties"));
}
// setup ftp connection
addSystem(getFTPHost());
_samplePaths = new ArrayList(); _samplePaths = new ArrayList();
_samplePaths.add("/usr"); _samplePaths.add("/usr");
@ -120,7 +116,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
*/ */
public void testImplicitConnectViaFileSubSystem() { public void testImplicitConnectViaFileSubSystem() {
//-test-author-:DaveMcKnight //-test-author-:DaveMcKnight
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testImplicitConnectViaFileSubSystem")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
setupConnections(); setupConnections();
String testPath = "/usr/lib"; String testPath = "/usr/lib";
@ -161,7 +158,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
} }
public void testSingleFileQuery() { public void testSingleFileQuery() {
//-test-author-:DaveMcKnight //-test-author-:DaveMcKnight
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testSingleFileQuery")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
setupConnections(); setupConnections();
@ -251,7 +249,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
*/ */
public void testMultiFileQuery() { public void testMultiFileQuery() {
//-test-author-:DaveMcKnight //-test-author-:DaveMcKnight
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testMultiFileQuery")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
setupConnections(); setupConnections();
@ -321,7 +320,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
*/ */
public void testSingleFileDownload() { public void testSingleFileDownload() {
//-test-author-:DaveMcKnight //-test-author-:DaveMcKnight
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testSingleFileDownload")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
setupConnections(); setupConnections();
internalFileDownload(false); internalFileDownload(false);
} }
@ -331,7 +331,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
*/ */
public void testMultiFileDownload() { public void testMultiFileDownload() {
//-test-author-:DaveMcKnight //-test-author-:DaveMcKnight
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testMultiFileDownload")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
setupConnections(); setupConnections();
internalFileDownload(true); internalFileDownload(true);
} }
@ -466,7 +467,3 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
} }
} }

View file

@ -24,7 +24,6 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.internal.ui.view.SystemView; import org.eclipse.rse.internal.ui.view.SystemView;
import org.eclipse.rse.internal.ui.view.SystemViewPart; import org.eclipse.rse.internal.ui.view.SystemViewPart;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.IRSEViews; import org.eclipse.rse.tests.core.IRSEViews;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil; import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase; import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
@ -70,7 +69,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
public void testAddAndDeleteDeepNodes() { public void testAddAndDeleteDeepNodes() {
//-test-author-:TobiasSchwarz //-test-author-:TobiasSchwarz
if (!RSETestsPlugin.isTestCaseEnabled("TestSubsystemTestCase.testAddAndDeleteDeepNodes")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// these test _must_ run in UI thread // these test _must_ run in UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() { public void run() {
@ -81,7 +81,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
public void testAddAndDeleteFlatNodes() { public void testAddAndDeleteFlatNodes() {
//-test-author-:TobiasSchwarz //-test-author-:TobiasSchwarz
if (!RSETestsPlugin.isTestCaseEnabled("TestSubsystemTestCase.testAddAndDeleteFlatNodes")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// these test _must_ run in UI thread // these test _must_ run in UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() { public void run() {
@ -142,7 +143,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
public void testBugzilla170728() { public void testBugzilla170728() {
//-test-author-:TobiasSchwarz //-test-author-:TobiasSchwarz
if (!RSETestsPlugin.isTestCaseEnabled("TestSubsystemTestCase.testBugzilla170728")) return; //$NON-NLS-1$ if (isTestDisabled())
return;
// these test _must_ run in UI thread // these test _must_ run in UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() { public void run() {

View file

@ -39,6 +39,8 @@ public class PreferencesTest extends RSECoreTestCase {
public void testShowLists() { public void testShowLists() {
//-test-author-:DavidDykstal //-test-author-:DavidDykstal
if (isTestDisabled())
return;
Preferences store = RSEUIPlugin.getDefault().getPluginPreferences(); Preferences store = RSEUIPlugin.getDefault().getPluginPreferences();
boolean showLists = store.getBoolean(ISystemPreferencesConstants.SHOW_EMPTY_LISTS); boolean showLists = store.getBoolean(ISystemPreferencesConstants.SHOW_EMPTY_LISTS);
assertTrue(showLists); assertTrue(showLists);