1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +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:
David Dykstal 2008-05-14 18:15:21 +00:00
parent 57d093061e
commit 6a1daa7b93
5 changed files with 18 additions and 13 deletions

View file

@ -18,6 +18,7 @@
* Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save * 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 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) - [189274] provide import and export operations for profiles
* David Dykstal (IBM) - [232126] persist filter type attribute
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.persistence.dom; 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_STRINGS_NON_CHANGABLE, getBooleanString(filter.isStringsNonChangable()));
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE, Integer.toString(filter.getRelease())); node.addAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE, Integer.toString(filter.getRelease()));
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY, getBooleanString(filter.isSetSingleFilterStringOnly())); 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 // add nested filters

View file

@ -20,6 +20,7 @@
* David Dykstal (IBM) - [197036] respond to removal of SystemProfile.createHost() * David Dykstal (IBM) - [197036] respond to removal of SystemProfile.createHost()
* David Dykstal (IBM) - [217556] remove service subsystem types * David Dykstal (IBM) - [217556] remove service subsystem types
* David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated * 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; package org.eclipse.rse.internal.persistence.dom;
@ -329,6 +330,7 @@ public class RSEDOMImporter {
boolean isStringsNonChangable = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_STRINGS_NON_CHANGABLE); boolean isStringsNonChangable = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_STRINGS_NON_CHANGABLE);
int release = getIntegerValue(node, IRSEDOMConstants.ATTRIBUTE_RELEASE); int release = getIntegerValue(node, IRSEDOMConstants.ATTRIBUTE_RELEASE);
boolean isSetSingleFilterStringOnly = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY); boolean isSetSingleFilterStringOnly = getBooleanValue(node, IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY);
String filterType = getAttributeValue(node, IRSEDOMConstants.ATTRIBUTE_FILTER_TYPE);
// create the filter strings // create the filter strings
RSEDOMNode[] filterStringNodes = node.getChildren(IRSEDOMConstants.TYPE_FILTER_STRING); RSEDOMNode[] filterStringNodes = node.getChildren(IRSEDOMConstants.TYPE_FILTER_STRING);
@ -352,6 +354,7 @@ public class RSEDOMImporter {
filter.setStringsNonChangable(isStringsNonChangable); filter.setStringsNonChangable(isStringsNonChangable);
filter.setRelease(release); filter.setRelease(release);
filter.setSingleFilterStringOnly(isSetSingleFilterStringOnly); filter.setSingleFilterStringOnly(isSetSingleFilterStringOnly);
filter.setType(filterType);
// restore all property sets // restore all property sets
RSEDOMNode[] psChildren = node.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); RSEDOMNode[] psChildren = node.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET);

View file

@ -13,6 +13,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags * 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; 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_STRINGS_NON_CHANGABLE = "stringsNonChangable"; //$NON-NLS-1$
public static final String ATTRIBUTE_RELEASE = "release"; //$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_SINGLE_FILTER_STRING_ONLY = "singleFilterStringOnly"; //$NON-NLS-1$
public static final String ATTRIBUTE_FILTER_TYPE = "filterType"; //$NON-NLS-1$
// server launcher attributes // server launcher attributes
public static final String ATTRIBUTE_REXEC_PORT = "rexecPort"; //$NON-NLS-1$ public static final String ATTRIBUTE_REXEC_PORT = "rexecPort"; //$NON-NLS-1$

View file

@ -7,6 +7,7 @@
* Contributors: * Contributors:
* 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
*********************************************************************************/ *********************************************************************************/
package org.eclipse.rse.tests.persistence; package org.eclipse.rse.tests.persistence;
@ -67,7 +68,8 @@ public class ExportImportTest extends RSECoreTestCase {
// create a connection-private filter (hostFilter1) // create a connection-private filter (hostFilter1)
String[] filterStrings = new String[] { "*.txt" }; String[] filterStrings = new String[] { "*.txt" };
ISystemFilterPool host1FilterPool = host1FileSubsystem.getUniqueOwningSystemFilterPool(true); ISystemFilterPool host1FilterPool = host1FileSubsystem.getUniqueOwningSystemFilterPool(true);
host1FilterPool.createSystemFilter("hostFilter1", filterStrings); ISystemFilter hostFilter1 = host1FilterPool.createSystemFilter("hostFilter1", filterStrings);
hostFilter1.setType("hostFilter1Type");
// create a connection-private filter (hostFilter2) // create a connection-private filter (hostFilter2)
filterStrings = new String[] { "*.c" }; filterStrings = new String[] { "*.c" };
host1FilterPool.createSystemFilter("hostFilter2", filterStrings); host1FilterPool.createSystemFilter("hostFilter2", filterStrings);
@ -77,7 +79,8 @@ public class ExportImportTest extends RSECoreTestCase {
ISystemFilterPool sharedFilterPool = filterPoolManager.createSystemFilterPool("sharedFilterPool", true); ISystemFilterPool sharedFilterPool = filterPoolManager.createSystemFilterPool("sharedFilterPool", true);
// create a shared filter (sharedFilter) // create a shared filter (sharedFilter)
filterStrings = new String[] { "*.java", "*.txt", "*.c" }; filterStrings = new String[] { "*.java", "*.txt", "*.c" };
sharedFilterPool.createSystemFilter("sharedFilter", filterStrings); ISystemFilter sharedFilter = sharedFilterPool.createSystemFilter("sharedFilter", filterStrings);
sharedFilter.setType("sharedFilterType");
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -124,6 +127,7 @@ public class ExportImportTest extends RSECoreTestCase {
assertEquals(1, filters.length); assertEquals(1, filters.length);
ISystemFilter filter = filters[0]; ISystemFilter filter = filters[0];
assertEquals("sharedFilter", filter.getName()); assertEquals("sharedFilter", filter.getName());
assertEquals("sharedFilterType", filter.getType());
String[] strings = filter.getFilterStrings(); String[] strings = filter.getFilterStrings();
assertEquals(3, strings.length); assertEquals(3, strings.length);
assertEquals("*.java", strings[0]); assertEquals("*.java", strings[0]);

View file

@ -13,6 +13,7 @@
* David McKnight (IBM) - [217715] [api] RSE property sets should support nested property sets * David McKnight (IBM) - [217715] [api] RSE property sets should support nested property sets
* Martin Oberhuber (Wind River) - organize, enable and tag test cases * Martin Oberhuber (Wind River) - organize, enable and tag test cases
* David Dykstal (IBM) [219069] test is failing * 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; package org.eclipse.rse.tests.persistence;
@ -81,7 +82,7 @@ public class PersistenceTest extends RSECoreTestCase {
int n = registry.getSystemProfileManager().getSystemProfiles().length; 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. * profile created. Creating a profile causes a commit.
*/ */
try { try {
@ -112,16 +113,6 @@ public class PersistenceTest extends RSECoreTestCase {
} }
assertTrue("Default private profile not found", found); 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 * One should be the test profile
*/ */