mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 12:35:22 +02:00
[240729] More flexible disabling of testcases
This commit is contained in:
parent
464ddfc950
commit
c41e3fd332
7 changed files with 189 additions and 154 deletions
|
@ -245,6 +245,16 @@ public class RSECoreTestCase extends TestCase {
|
|||
System.out.println("--> disabled due to rule: " + checkString);
|
||||
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) {
|
||||
checkString = "*." + targetName;
|
||||
if (!RSETestsPlugin.isTestCaseEnabled(checkString)) {
|
||||
|
|
|
@ -77,6 +77,9 @@ public class RSEBaseConnectionTestCase extends RSECoreTestCase {
|
|||
* @return The local system type connection or <code>null</code> if the lookup fails.
|
||||
*/
|
||||
protected IHost getLocalSystemConnection() {
|
||||
setTargetName("local");
|
||||
if (isTestDisabled())
|
||||
return null;
|
||||
assertNotNull("Local system connection properties are not available!", localSystemConnectionProperties); //$NON-NLS-1$
|
||||
|
||||
Exception exception = null;
|
||||
|
@ -97,21 +100,33 @@ public class RSEBaseConnectionTestCase extends RSECoreTestCase {
|
|||
|
||||
protected IHost getSSHHost()
|
||||
{
|
||||
setTargetName("ssh");
|
||||
if (isTestDisabled())
|
||||
return null;
|
||||
return getHost("sshConnection.properties");
|
||||
}
|
||||
|
||||
protected IHost getFTPHost()
|
||||
{
|
||||
setTargetName("ftp");
|
||||
if (isTestDisabled())
|
||||
return null;
|
||||
return getHost("ftpConnection.properties");
|
||||
}
|
||||
|
||||
protected IHost getLinuxHost()
|
||||
{
|
||||
setTargetName("linux");
|
||||
if (isTestDisabled())
|
||||
return null;
|
||||
return getHost("linuxConnection.properties");
|
||||
}
|
||||
|
||||
protected IHost getWindowsHost()
|
||||
{
|
||||
setTargetName("windows");
|
||||
if (isTestDisabled())
|
||||
return null;
|
||||
return getHost("windowsConnection.properties");
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.eclipse.rse.core.model.IHost;
|
|||
import org.eclipse.rse.core.model.ISystemProfile;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.tests.RSETestsPlugin;
|
||||
import org.eclipse.rse.ui.ISystemPreferencesConstants;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
|
||||
|
@ -40,6 +39,8 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
|
|||
*/
|
||||
public void testConnectionCaseInSensitive() throws Exception {
|
||||
// -test-author-:MartinOberhuber
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
ISystemProfile prof = RSECorePlugin.getTheSystemProfileManager().getDefaultPrivateSystemProfile();
|
||||
ISystemProfile testprof = RSECorePlugin.getTheSystemProfileManager().cloneSystemProfile(prof, "testConnectionCaseInSensitive");
|
||||
|
@ -60,7 +61,8 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
|
|||
*/
|
||||
public void testConnectionCreation() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testConnectionCreation")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME, "TestProfile"); //$NON-NLS-1$
|
||||
|
@ -105,7 +107,8 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
|
|||
*/
|
||||
public void testConnectionRemoval() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testConnectionRemoval")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
|
||||
String profileName = "TestProfile"; //$NON-NLS-1$
|
||||
|
||||
|
@ -123,12 +126,13 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
|
|||
*/
|
||||
public void testConnect() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testConnect")) return; //$NON-NLS-1$
|
||||
IHost connection = getLocalSystemConnection();
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
|
||||
Exception exception = null;
|
||||
String cause = null;
|
||||
|
||||
IHost connection = getLocalSystemConnection();
|
||||
ISubSystem subsystem = null;
|
||||
try {
|
||||
subsystem = getConnectionManager().getFileSubSystem(connection, "local.files"); //$NON-NLS-1$
|
||||
|
@ -173,12 +177,13 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
|
|||
*/
|
||||
public void testResolveFilterString() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("RSEConnectionTestCase.testResolveFilterString")) return; //$NON-NLS-1$
|
||||
IHost connection = getLocalSystemConnection();
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
|
||||
Exception exception = null;
|
||||
String cause = null;
|
||||
|
||||
IHost connection = getLocalSystemConnection();
|
||||
ISubSystem subsystem = null;
|
||||
try {
|
||||
subsystem = getConnectionManager().getFileSubSystem(connection, "local.files"); //$NON-NLS-1$
|
||||
|
|
|
@ -39,6 +39,8 @@ public class PasswordsTest extends RSECoreTestCase {
|
|||
|
||||
public void testAddRemove() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
IRSESystemType systemType = RSECoreRegistry.getInstance().getSystemType(IRSESystemType.SYSTEMTYPE_UNIX_ID);
|
||||
IRSESystemType defaultSystemType = PasswordPersistenceManager.DEFAULT_SYSTEM_TYPE;
|
||||
String hostAddress = "somesystem.mycompany.com";
|
||||
|
@ -91,6 +93,8 @@ public class PasswordsTest extends RSECoreTestCase {
|
|||
|
||||
public void testSaveDenial() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
IRSESystemType systemType = RSECoreRegistry.getInstance().getSystemType(IRSESystemType.SYSTEMTYPE_UNIX_ID);
|
||||
String hostAddress = "somesystem.mycompany.com";
|
||||
boolean deny = RSEPreferencesManager.getDenyPasswordSave(systemType, hostAddress);
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
|
|||
import org.eclipse.rse.services.files.IFileService;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
|
||||
import org.eclipse.rse.tests.RSETestsPlugin;
|
||||
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
|
||||
|
||||
/**
|
||||
|
@ -38,7 +37,7 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
private List _connections;
|
||||
private List _samplePaths;
|
||||
|
||||
private String LOCALTEMPDIR = "C:\\temp";
|
||||
private String LOCALTEMPDIR = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.tests.core.RSECoreTestCase#tearDown()
|
||||
|
@ -80,15 +79,12 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
_connections = new ArrayList();
|
||||
_subSystems = new ArrayList();
|
||||
|
||||
// setup dstore connection
|
||||
addSystem(getLinuxHost());
|
||||
|
||||
// setup ssh connection
|
||||
addSystem(getSSHHost());
|
||||
|
||||
// setup ftp connection
|
||||
addSystem(getFTPHost());
|
||||
|
||||
//TODO Support Windows style connections
|
||||
//String[] connTypes = { "local", "ssh", "ftpWindows", "ftp", "linux", "windows" };
|
||||
String[] connTypes = { "ssh", "ftp", "linux" };
|
||||
for (int i = 0; i < connTypes.length; i++) {
|
||||
addSystem(getHost(connTypes[i] + "Connection.properties"));
|
||||
}
|
||||
|
||||
_samplePaths = new ArrayList();
|
||||
_samplePaths.add("/usr");
|
||||
|
@ -120,7 +116,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
*/
|
||||
public void testImplicitConnectViaFileSubSystem() {
|
||||
//-test-author-:DaveMcKnight
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testImplicitConnectViaFileSubSystem")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
setupConnections();
|
||||
|
||||
String testPath = "/usr/lib";
|
||||
|
@ -161,7 +158,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
}
|
||||
public void testSingleFileQuery() {
|
||||
//-test-author-:DaveMcKnight
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testSingleFileQuery")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
setupConnections();
|
||||
|
||||
|
||||
|
@ -251,7 +249,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
*/
|
||||
public void testMultiFileQuery() {
|
||||
//-test-author-:DaveMcKnight
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testMultiFileQuery")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
setupConnections();
|
||||
|
||||
|
||||
|
@ -321,7 +320,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
*/
|
||||
public void testSingleFileDownload() {
|
||||
//-test-author-:DaveMcKnight
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testSingleFileDownload")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
setupConnections();
|
||||
internalFileDownload(false);
|
||||
}
|
||||
|
@ -331,7 +331,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
*/
|
||||
public void testMultiFileDownload() {
|
||||
//-test-author-:DaveMcKnight
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("FileSubsystemConsistencyTestCase.testMultiFileDownload")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
setupConnections();
|
||||
internalFileDownload(true);
|
||||
}
|
||||
|
@ -466,7 +467,3 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.rse.core.model.IHost;
|
|||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.internal.ui.view.SystemView;
|
||||
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.RSEWaitAndDispatchUtil;
|
||||
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
|
||||
|
@ -70,7 +69,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
|||
|
||||
public void testAddAndDeleteDeepNodes() {
|
||||
//-test-author-:TobiasSchwarz
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("TestSubsystemTestCase.testAddAndDeleteDeepNodes")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
// these test _must_ run in UI thread
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -81,7 +81,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
|||
|
||||
public void testAddAndDeleteFlatNodes() {
|
||||
//-test-author-:TobiasSchwarz
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("TestSubsystemTestCase.testAddAndDeleteFlatNodes")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
// these test _must_ run in UI thread
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -142,7 +143,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
|||
|
||||
public void testBugzilla170728() {
|
||||
//-test-author-:TobiasSchwarz
|
||||
if (!RSETestsPlugin.isTestCaseEnabled("TestSubsystemTestCase.testBugzilla170728")) return; //$NON-NLS-1$
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
// these test _must_ run in UI thread
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
|
||||
public void run() {
|
||||
|
|
|
@ -39,6 +39,8 @@ public class PreferencesTest extends RSECoreTestCase {
|
|||
|
||||
public void testShowLists() {
|
||||
//-test-author-:DavidDykstal
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
Preferences store = RSEUIPlugin.getDefault().getPluginPreferences();
|
||||
boolean showLists = store.getBoolean(ISystemPreferencesConstants.SHOW_EMPTY_LISTS);
|
||||
assertTrue(showLists);
|
||||
|
|
Loading…
Add table
Reference in a new issue