mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
[232126] type attribute of SystemFilter is not restored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232126
This commit is contained in:
parent
57d093061e
commit
6a1daa7b93
5 changed files with 18 additions and 13 deletions
|
@ -18,6 +18,7 @@
|
|||
* Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save
|
||||
* David McKnight (IBM) - [217715] [api] RSE property sets should support nested property sets
|
||||
* David Dykstal (IBM) - [189274] provide import and export operations for profiles
|
||||
* David Dykstal (IBM) - [232126] persist filter type attribute
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.persistence.dom;
|
||||
|
@ -274,6 +275,10 @@ public class RSEDOMExporter implements IRSEDOMExporter {
|
|||
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_STRINGS_NON_CHANGABLE, getBooleanString(filter.isStringsNonChangable()));
|
||||
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE, Integer.toString(filter.getRelease()));
|
||||
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY, getBooleanString(filter.isSetSingleFilterStringOnly()));
|
||||
String filterType = filter.getType();
|
||||
if (filterType != null) {
|
||||
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_FILTER_TYPE, filter.getType());
|
||||
}
|
||||
}
|
||||
|
||||
// add nested filters
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* David Dykstal (IBM) - [197036] respond to removal of SystemProfile.createHost()
|
||||
* David Dykstal (IBM) - [217556] remove service subsystem types
|
||||
* David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
|
||||
* David Dykstal (IBM) - [232126] retrieve persisted filter type attribute
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.persistence.dom;
|
||||
|
@ -329,6 +330,7 @@ public class RSEDOMImporter {
|
|||
boolean isStringsNonChangable = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_STRINGS_NON_CHANGABLE);
|
||||
int release = getIntegerValue(node, IRSEDOMConstants.ATTRIBUTE_RELEASE);
|
||||
boolean isSetSingleFilterStringOnly = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY);
|
||||
String filterType = getAttributeValue(node, IRSEDOMConstants.ATTRIBUTE_FILTER_TYPE);
|
||||
|
||||
// create the filter strings
|
||||
RSEDOMNode[] filterStringNodes = node.getChildren(IRSEDOMConstants.TYPE_FILTER_STRING);
|
||||
|
@ -352,6 +354,7 @@ public class RSEDOMImporter {
|
|||
filter.setStringsNonChangable(isStringsNonChangable);
|
||||
filter.setRelease(release);
|
||||
filter.setSingleFilterStringOnly(isSetSingleFilterStringOnly);
|
||||
filter.setType(filterType);
|
||||
|
||||
// restore all property sets
|
||||
RSEDOMNode[] psChildren = node.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags
|
||||
* David Dykstal (IBM) - add attribute name for filter type
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.persistence.dom;
|
||||
|
@ -75,6 +76,7 @@ public interface IRSEDOMConstants {
|
|||
public static final String ATTRIBUTE_STRINGS_NON_CHANGABLE = "stringsNonChangable"; //$NON-NLS-1$
|
||||
public static final String ATTRIBUTE_RELEASE = "release"; //$NON-NLS-1$
|
||||
public static final String ATTRIBUTE_SINGLE_FILTER_STRING_ONLY = "singleFilterStringOnly"; //$NON-NLS-1$
|
||||
public static final String ATTRIBUTE_FILTER_TYPE = "filterType"; //$NON-NLS-1$
|
||||
|
||||
// server launcher attributes
|
||||
public static final String ATTRIBUTE_REXEC_PORT = "rexecPort"; //$NON-NLS-1$
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* Contributors:
|
||||
* David Dykstal (IBM) - initial contribution.
|
||||
* David Dykstal (IBM) - [189274] provide import and export operations for profiles
|
||||
* David Dykstal (IBM) - [232126] add test for filter type persistence
|
||||
*********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.tests.persistence;
|
||||
|
@ -67,7 +68,8 @@ public class ExportImportTest extends RSECoreTestCase {
|
|||
// create a connection-private filter (hostFilter1)
|
||||
String[] filterStrings = new String[] { "*.txt" };
|
||||
ISystemFilterPool host1FilterPool = host1FileSubsystem.getUniqueOwningSystemFilterPool(true);
|
||||
host1FilterPool.createSystemFilter("hostFilter1", filterStrings);
|
||||
ISystemFilter hostFilter1 = host1FilterPool.createSystemFilter("hostFilter1", filterStrings);
|
||||
hostFilter1.setType("hostFilter1Type");
|
||||
// create a connection-private filter (hostFilter2)
|
||||
filterStrings = new String[] { "*.c" };
|
||||
host1FilterPool.createSystemFilter("hostFilter2", filterStrings);
|
||||
|
@ -77,7 +79,8 @@ public class ExportImportTest extends RSECoreTestCase {
|
|||
ISystemFilterPool sharedFilterPool = filterPoolManager.createSystemFilterPool("sharedFilterPool", true);
|
||||
// create a shared filter (sharedFilter)
|
||||
filterStrings = new String[] { "*.java", "*.txt", "*.c" };
|
||||
sharedFilterPool.createSystemFilter("sharedFilter", filterStrings);
|
||||
ISystemFilter sharedFilter = sharedFilterPool.createSystemFilter("sharedFilter", filterStrings);
|
||||
sharedFilter.setType("sharedFilterType");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -124,6 +127,7 @@ public class ExportImportTest extends RSECoreTestCase {
|
|||
assertEquals(1, filters.length);
|
||||
ISystemFilter filter = filters[0];
|
||||
assertEquals("sharedFilter", filter.getName());
|
||||
assertEquals("sharedFilterType", filter.getType());
|
||||
String[] strings = filter.getFilterStrings();
|
||||
assertEquals(3, strings.length);
|
||||
assertEquals("*.java", strings[0]);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* David McKnight (IBM) - [217715] [api] RSE property sets should support nested property sets
|
||||
* Martin Oberhuber (Wind River) - organize, enable and tag test cases
|
||||
* David Dykstal (IBM) [219069] test is failing
|
||||
* David Dykstal (IBM) - [232126] test found to be failing when testing filter type persistence
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.tests.persistence;
|
||||
|
@ -81,7 +82,7 @@ public class PersistenceTest extends RSECoreTestCase {
|
|||
int n = registry.getSystemProfileManager().getSystemProfiles().length;
|
||||
|
||||
/*
|
||||
* Create a new profile in this profile manager. This will be the third
|
||||
* Create a new profile in this profile manager. This will be the second
|
||||
* profile created. Creating a profile causes a commit.
|
||||
*/
|
||||
try {
|
||||
|
@ -112,16 +113,6 @@ public class PersistenceTest extends RSECoreTestCase {
|
|||
}
|
||||
assertTrue("Default private profile not found", found);
|
||||
|
||||
/*
|
||||
* One should be the team profile
|
||||
*/
|
||||
found = false;
|
||||
for (int i = 0; i < profiles.length && !found; i++) {
|
||||
ISystemProfile p = profiles[i];
|
||||
found = p.getName().equals("Team");
|
||||
}
|
||||
assertTrue("Team profile not found", found);
|
||||
|
||||
/*
|
||||
* One should be the test profile
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue