[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] update to wizard page support
|
-
Added toolchain version support
-
Added new tests for version support
-
Added new tests for the Operation functionality of
pages
If these patches are applied then in theory this feature
should now be finished.
___________________________________________
Chris Recoskie
Texas Instruments, Toronto
|
cvs diff -u -wb (in directory C:\cdt_source_HEAD\org.eclipse.cdt-build\org.eclipse.cdt.managedbuilder.ui.tests\)
cvs diff: Empty password used - try 'cvs login' with a real password
? src/org/eclipse/cdt/managedbuilder/ui/tests/wizardPages/TestRunnable.java
? src/org/eclipse/cdt/managedbuilder/ui/tests/wizardPages/ToolchainCv20WizardPage.java
cvs diff: Diffing .
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui.tests/plugin.xml,v
retrieving revision 1.1
diff -u -w -b -r1.1 plugin.xml
--- plugin.xml 20 May 2005 03:22:26 -0000 1.1
+++ plugin.xml 1 Jun 2005 17:35:03 -0000
@@ -24,6 +24,7 @@
point="org.eclipse.cdt.managedbuilder.ui.newWizardPages">
<wizardPage
ID="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.AlwaysPresentWizardPage"
+ operationClass="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.TestRunnable"
pageClass="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.AlwaysPresentWizardPage"/>
<wizardPage
ID="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.NatureAWizardPage"
@@ -41,6 +42,13 @@
<toolchain toolchainID="C"/>
</wizardPage>
<wizardPage
+ ID="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ToolchainCv20WizardPage"
+ pageClass="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ToolchainCv20WizardPage">
+ <toolchain
+ toolchainID="C"
+ versionsSupported="2.0.0"/>
+ </wizardPage>
+ <wizardPage
ID="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ProjectTypeDWizardPage"
pageClass="org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ProjectTypeDWizardPage">
<projectType projectTypeID="D"/>
cvs diff: Diffing src
cvs diff: Diffing src/org
cvs diff: Diffing src/org/eclipse
cvs diff: Diffing src/org/eclipse/cdt
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/tests
Index: src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui.tests/src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java,v
retrieving revision 1.1
diff -u -w -b -r1.1 TestCustomPageManager.java
--- src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java 20 May 2005 03:22:26 -0000 1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/tests/TestCustomPageManager.java 1 Jun 2005 17:37:56 -0000
@@ -44,12 +44,17 @@
private static final String projectTypeDPageName = "org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ProjectTypeDWizardPage";
private static final String projectTypeEPageName = "org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ProjectTypeEWizardPage";
private static final String toolchainFPageName = "org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ToolchainFWizardPage";
+ private static final String toolchainCv20PageName = "org.eclipse.cdt.managedbuilder.ui.tests.wizardPages.ToolchainCv20WizardPage";
+
+ public static boolean testFlag = false;
public void setUp() throws Exception
{
MBSCustomPageManager.init();
MBSCustomPageManager.loadExtensions();
+
+ testFlag = false;
}
/**
@@ -103,6 +108,12 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(projectTypeDPageName))
{
fail("ProjectTypeDWizardPage should not be visible");
@@ -185,6 +196,12 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(projectTypeDPageName))
{
fail("ProjectTypeDWizardPage should not be visible");
@@ -266,6 +283,12 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(projectTypeDPageName))
{
fail("ProjectTypeDWizardPage should not be visible");
@@ -335,6 +358,112 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(natureAPageName))
+ {
+ fail("NatureAWizardPage should not be visible");
+ }
+
+ // the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(natureBPageName))
+ {
+ fail("NatureBWizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(projectTypeDPageName))
+ {
+ fail("ProjectTypeDWizardPage should not be visible");
+ }
+
+
+// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(projectTypeEPageName))
+ {
+ fail("ProjectTypeEWizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainFPageName))
+ {
+ fail("ToolchainFWizardPage should not be visible");
+ }
+ }
+
+ /**
+ * Set the toolchain to "C_2.0.0". Only pages with no contraints, or toolchains set to "C", or toolchains set to "C" version 2.0.0 should show up.
+ */
+ public void testToolchainCv20()
+ {
+// set the project type to be "X"
+ MBSCustomPageManager.addPageProperty(CProjectPlatformPage.PAGE_ID, CProjectPlatformPage.PROJECT_TYPE, "X");
+
+ // set the toolchain to "C"
+ Set toolchainSet = new LinkedHashSet();
+ TestToolchain toolchain = new TestToolchain();
+ toolchain.setID("C_2.0.0");
+ toolchainSet.add(toolchain);
+ MBSCustomPageManager.addPageProperty(CProjectPlatformPage.PAGE_ID, CProjectPlatformPage.TOOLCHAIN, toolchainSet);
+
+ // set the nature to "Z"
+ MBSCustomPageManager.addPageProperty(CProjectPlatformPage.PAGE_ID, CProjectPlatformPage.NATURE, "Z");
+
+ // check each of the pages
+
+ // this page should always be visible
+ if(!MBSCustomPageManager.isPageVisible(alwaysPresentPageName))
+ {
+ fail("AlwaysPresentWizardPage should be visible");
+ }
+
+ // next page for this page should be the page for toolchain C
+ if(MBSCustomPageManager.getNextPage(alwaysPresentPageName) != MBSCustomPageManager.getPageData(toolchainCPageName).getWizardPage())
+ {
+ fail("AlwaysPresentWizardPage's next page should be ToolchainCWizardPage");
+ }
+
+ // toolchain C page's previous page should be the always present page
+ if(MBSCustomPageManager.getPreviousPage(toolchainCPageName) != MBSCustomPageManager.getPageData(alwaysPresentPageName).getWizardPage())
+ {
+ fail("ToolchainCWizardPage's previous page should be AlwaysPresentWizardPage");
+ }
+
+ // Toolchain C page should be visible
+ if(!MBSCustomPageManager.isPageVisible(toolchainCPageName))
+ {
+ fail("ToolchainCWizardPage should be visible");
+ }
+
+ // Toolchain C page's next page should be the page for C 2.0
+ if(MBSCustomPageManager.getNextPage(toolchainCPageName) != MBSCustomPageManager.getPageData(toolchainCv20PageName).getWizardPage())
+ {
+ fail("ToolchainCWizardPage's next page should be ToolchainCv20WizardPage.");
+ }
+
+ // toolchain C v 2.0.0 page's previous page should be the toolchain C page
+ if(MBSCustomPageManager.getPreviousPage(toolchainCv20PageName) != MBSCustomPageManager.getPageData(toolchainCPageName).getWizardPage())
+ {
+ fail("ToolchainCv20WizardPage's previous page should be ToolchainCWizardPage");
+ }
+
+ // Toolchain C v 2.0.0 page should be visible
+ if(!MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolchainCWizardPage should be visible");
+ }
+
+ // Toolchain C v 2.0.0 page's next page should be null
+ if(MBSCustomPageManager.getNextPage(toolchainCv20PageName) != null)
+ {
+ fail("ToolchainCv20WizardPage should not have a next page.");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(natureAPageName))
{
fail("NatureAWizardPage should not be visible");
@@ -367,6 +496,7 @@
}
+
/**
* Set the project type to "D". Only pages with no contraints or project types set to "D" should show up.
*/
@@ -436,6 +566,12 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(projectTypeEPageName))
{
fail("ProjectTypeEWizardPage should not be visible");
@@ -520,6 +656,12 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(projectTypeDPageName))
{
fail("ProjectTypeDWizardPage should not be visible");
@@ -596,6 +738,12 @@
}
// the rest of the pages should be invisible
+ if(MBSCustomPageManager.isPageVisible(toolchainCv20PageName))
+ {
+ fail("ToolChainCv20WizardPage should not be visible");
+ }
+
+// the rest of the pages should be invisible
if(MBSCustomPageManager.isPageVisible(projectTypeDPageName))
{
fail("ProjectTypeDWizardPage should not be visible");
@@ -722,6 +870,16 @@
}
+ public void testOperation()
+ {
+ MBSCustomPageManager.getPageData(alwaysPresentPageName).getOperation().run();
+
+ if(testFlag != true)
+ {
+ fail("Running operation associated with AlwaysPresentWizardPage failed.");
+ }
+ }
+
public TestCustomPageManager(String name)
{
@@ -735,11 +893,12 @@
suite.addTest(new TestCustomPageManager("testNatureA"));
suite.addTest(new TestCustomPageManager("testNatureB"));
suite.addTest(new TestCustomPageManager("testToolchainC"));
+ suite.addTest(new TestCustomPageManager("testToolchainCv20"));
suite.addTest(new TestCustomPageManager("testProjectTypeD"));
suite.addTest(new TestCustomPageManager("testProjectTypeE"));
suite.addTest(new TestCustomPageManager("testToolchainF"));
suite.addTest(new TestCustomPageManager("testMultiplePages"));
-
+ suite.addTest(new TestCustomPageManager("testOperation"));
return suite;
}
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/tests/suite
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/tests/testplugin
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/tests/util
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/tests/wizardPages
***** CVS exited normally with code 1 *****
Attachment:
org.eclipse.cdt.managedbuilder.ui.tests.zip
Description: org.eclipse.cdt.managedbuilder.ui.tests.zip
cvs diff -u -wb (in directory C:\cdt_source_HEAD\org.eclipse.cdt-build\org.eclipse.cdt.managedbuilder.ui\)
cvs diff: Empty password used - try 'cvs login' with a real password
cvs diff: Diffing .
cvs diff: Diffing icons
cvs diff: Diffing icons/dlcl16
cvs diff: Diffing icons/elcl16
cvs diff: Diffing icons/full
cvs diff: Diffing icons/full/build16
cvs diff: Diffing icons/full/list
cvs diff: Diffing icons/full/wizban
cvs diff: Diffing schema
cvs diff: Diffing src
cvs diff: Diffing src/org
cvs diff: Diffing src/org/eclipse
cvs diff: Diffing src/org/eclipse/cdt
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/internal
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/internal/ui
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/toolchain
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/toolchain/gnu
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/toolchain/gnu/cygwin
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/actions
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/properties
cvs diff: Diffing src/org/eclipse/cdt/managedbuilder/ui/wizards
Index: src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java,v
retrieving revision 1.1
diff -u -w -b -r1.1 MBSCustomPageData.java
--- src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java 20 May 2005 03:16:13 -0000 1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageData.java 1 Jun 2005 15:09:17 -0000
@@ -191,16 +191,16 @@
if (tcd.getId().equals(id))
{
// if we don't check versions then we're done
- if (version == null)
+ if (tcd.getVersionsSupported() == null)
return true;
- // does the toolchain have a compatible version?
+
+
+ // is the toolchain of one of the specified versions?
for (int k = 0; k < tcd.getVersionsSupported().length; k++)
{
- // TODO: implement version support - should this check for an exact match?
- // An older version of a tool-chain could use a different custom page
- // than a newer version.
- if (tcd.getVersionsSupported()[k].compareTo(version) >= 0)
+ // check for an exact version match
+ if (tcd.getVersionsSupported()[k].equals(version))
{
return true;
}
Index: src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageManager.java,v
retrieving revision 1.1
diff -u -w -b -r1.1 MBSCustomPageManager.java
--- src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageManager.java 20 May 2005 03:16:13 -0000 1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSCustomPageManager.java 1 Jun 2005 18:06:51 -0000
@@ -12,6 +12,7 @@
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
@@ -363,11 +364,11 @@
while (toolchainIterator.hasNext())
{
IToolChain toolchain = (IToolChain) toolchainIterator.next();
+ String id = ManagedBuildManager.getIdFromIdAndVersion(toolchain.getId());
+ String version = ManagedBuildManager.getVersionFromIdAndVersion(toolchain.getId());
- // get the ID and version
- // version support in MBS is not complete yet so just check the id for now
- // TODO: implement version support
- if (toolchain.getId().equals(toolchainData[k].getId()))
+ // check the ID and version
+ if (page.shouldBeVisibleForToolchain(id, version))
{
return true;
}
***** CVS exited normally with code 1 *****