Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java')
-rw-r--r--bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java114
1 files changed, 0 insertions, 114 deletions
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java
deleted file mode 100644
index f5e2931f3..000000000
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/JavaMofReflectionCommand.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.consumption.command.common;
-
-
-//core stuff
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.java.JavaHelpers;
-import org.eclipse.jem.java.JavaRefFactory;
-import org.eclipse.jem.util.emf.workbench.nature.EMFNature;
-import org.eclipse.jem.workbench.utility.JemProjectUtilities;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.consumption.ConsumptionMessages;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-
-
-/**
-* This class is to be used to Build the data model
-* first we get the java class and then build the model
-*/
-public class JavaMofReflectionCommand extends AbstractDataModelOperation
-{
-
- public static String LABEL = "JavaMofReflectionCommand";
- public static String DESCRIPTION = "reflection for a given class";
- public static String OK_MESSAGE = "The model has been built ";
- private static String JAVA_EXTENSION = ".java";
- private static String CLASS_EXTENSION = ".class";
-
- private String clientProject;
- private JavaHelpers javaClass;
- private String qname;
- private String proxyBean;
-
- /**
- * Constructs a new JavaMofReflectionCommand with the given label and description
- *
- */
- public JavaMofReflectionCommand()
- {
- }
-
- // setters for this command
-
-
- /**
- * The end result of this whole process is to get the Java Class
- */
- public JavaHelpers getJavaClass()
- {
- return javaClass;
- }
-
-
- private void processQName()
- {
- qname = proxyBean;
- if (qname.toLowerCase().endsWith(JAVA_EXTENSION)) {
- qname = qname.substring(0,(qname.length() -5));
- }
- if (qname.toLowerCase().endsWith(CLASS_EXTENSION)) {
- qname = qname.substring(0,(qname.length() -6));
- }
- }
-
- /**
- * Get the java model from the resource then
- * build the model from the mof
- */
- public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable )
- {
- //just make sure the project and qname are there
- //they are essential for this operation
- IStatus status = Status.OK_STATUS;
- IProject clientIProject = (IProject)ResourceUtils.findResource(clientProject);
- processQName();
- if(clientProject == null || qname == null)
- return StatusUtils.warningStatus( ConsumptionMessages.MSG_WARN_UNABLE_TO_FIND_PROXY );
-
- try {
- EMFNature nature = JemProjectUtilities.getJEM_EMF_Nature(clientIProject, true);
- javaClass = JavaRefFactory.eINSTANCE.reflectType(qname, nature.getResourceSet());
- } catch (CoreException e) {
- }
-
- return status;
- }
-
- public void setProxyBean(String proxyBean)
- {
- this.proxyBean = proxyBean;
- }
-
- public void setClientProject(String clientProject)
- {
- this.clientProject = clientProject;
- }
-
- }

Back to the top

f.contentassist.tests/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/META-INF/MANIFEST.MF27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/build.properties21
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/AllTests.java40
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/BaseTestClass.java130
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/CompletionPrefixTest.java671
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/ContentAssistTestsPlugin.java66
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestContentAssistParser.java119
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestFunctionCompletionStrategy.java128
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestIdCompletionStrategy.java130
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149224.java175
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149743.java100
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBean.java.data13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBeanSettable.java.data171
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/basicELExpressions.jsp.data28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224.properties.data4
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224_1.jsp.data25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149743.jsp.data23
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_basic.xml.data17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_bug149743.xml.data17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore5
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.jdt.core.prefs62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF24
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/AllTests.java38
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java64
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ModelBaseTestCase.java115
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java1099
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2_ChangeStability.java519
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIMapTypeDescriptor.java141
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIPropertySymbolItemProvider.java136
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestTypeCoercion.java193
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data5
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/MyListBean.java.data29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data37
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data8
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanMap.java.data19
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanWithGenericProperties.java.data34
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle.properties.data3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle2.properties.data4
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/.cvsignore5
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF58
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/build.properties22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.xml39
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java120
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/JSFCoreFastTests.java23
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/TestsPlugin.java102
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/CompositeJSFAppConfigLocatorProviderStrategyTests.java78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/JSFAppConfigManagerFactoryTests.java86
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManager.java186
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactory.java38
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactoryFromExtension.java29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFromExtension.java14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestLocatorProvider.java117
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/provider/TestJARFileJSFAppConfigProvider.java302
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/validation/AppConfigValidationUtilTestCase.java152
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/contenttype/TestContentTypes.java148
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryProviderTests.java49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java41
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java166
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java185
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java183
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigDialogSettingDataTestCases.java62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigModelTestCases.java179
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryRegistryUtilTestCases.java75
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFProjectLibraryReferenceTestCases.java119
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryReferenceTestCases.java199
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryServerSuppliedReferenceTestCases.java133
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/ArchiveFileTestCases.java227
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryPackageTestCases.java50
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryTestCases.java244
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryTestCases.java121
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/MaintainDefaultImplementationAdapterTestCases.java123
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIBArchiveFilesDelegate.java29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIB_EMPTYArchiveFilesDelegate.java27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/migration/MigrationV1toV2Test.java327
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMAttributeDeclaration.java46
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMNode.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockJSPTagRegistry.java204
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockTLDAttributeDeclaration.java63
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/JSFFacetInstallDataModelProviderTestCases.java151
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils.java876
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils11.java315
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils12.java435
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils20.java51
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestUtilSuite.java17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestableJSFUtils.java82
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/region/TestRegion2ElementAdapter.java526
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AbstractTestListener.java12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AllLifecycleListenerTests.java16
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/ClasspathTestListener.java121
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastClasspathEntryLifecycleTests.java72
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests.java261
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests_Scenario.java340
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/LifecycleStressTest.java222
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MockListener.java86
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MyTestListener.java136
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestDefaultJarLocator.java141
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestLifecycleListener.java372
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestResourceTracker.java193
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/sanity/TestJSFFacetedTestEnvironment.java53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/serialization/TLDAttributeSerializationTests.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/ConcreteAxiomaticSetTest.java164
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/NodeSetTest.java141
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestElementToTagIdentifierMapping.java28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestMemberConstraint.java136
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestXPathValidation.java71
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/ConcatStrategy.java44
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/StrategyCompositeTests.java56
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/BaseTagMatcherTestCase.java134
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/TestXPathTagMatcher.java80
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeComparatorTests.java533
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeTransformerTests.java110
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFCoreUtilHelper.java623
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFFacetedTestEnvironment.java157
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestCMUtil.java97
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanIntrospector.java671
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanPropertyWorkingCopy.java519
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJSFAppConfigUtils.java94
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestTypeUtil.java444
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/UtilSuite.java39
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIReporter.java81
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIValidationContext.java49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockValidationReporter.java201
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticValidation_AttrValueConverter.java171
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_AttributeValues.java158
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_Containment.java219
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/XMLViewDefnValidatorTests.java62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/AnotherBean.java.data13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/IBeanInterface.java.data7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-beanutils-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-collections-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-digester-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-logging-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-api-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-impl-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jstl-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/EmptyJSFLibraryRegistryV1.xml.data2
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1.xml.data27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1_expectedMigrationResult.xml.data27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV2.xml.data27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/standard-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1.java.data141
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1Subclass.java.data10
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBeanGeneric.java.data34
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestEnum1.java.data6
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2.jarbin1152 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2_nofacesconfig.jarbin781 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/noextdata.jarbin672 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/withextdata.jarbin687 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-all-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-api-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-impl-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_1.xml9
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_2.xml9
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-2_0.xml9
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/jsflibrary-api-1.1.3.jarbin1153 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/no-version-entry/jsflibrary-api-1.1.3.jarbin1117 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/nonstandard_implementation_version/jsflibrary-api-1.1.3.jarbin1144 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsf-core.tld.data30
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/NonELAttributeValues.jsp.data0
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testContainment.jsp.data19
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testdata1.jsp.data40
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/CaseInsensitive.xml17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileA.xml13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileB.xml13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.xml101
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test_en_US.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_core.tld.data781
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_html.tld.data6200
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/sandbox-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/signatures.jarbin2493 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests.zipbin30377 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests2.zipbin21571 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/Test2Project.zipbin7883 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject.zipbin7991 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject1.zipbin7330 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject1.zipbin9289 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject2.zipbin10421 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/valueHolderTest11.zipbin12713 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/tomahawk-bogus.jarbin3966 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/.cvsignore5
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/META-INF/MANIFEST.MF38
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/build.properties20
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/AllTests.java95
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeFastTests.java17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeTestsPlugin.java64
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestAbstractDataModelVariableFactory.java246
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTFacesContext.java119
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTJSPExternalContext.java245
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultBeanSymbolSourceProvider.java200
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTMethodResolver.java159
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTVariableResolver.java250
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultPropertyResolver.java842
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDesignTimeApplicationManager.java394
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20DefaultBeanSymbolSourceProvider.java212
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20ImplicitVariables.java259
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPDefaultSymbolFactory.java132
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPModelProcessor.java392
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleMapSource.java257
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleSymbolSourceProvider.java172
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestStartupHandler.java178
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/ChangeTester.java179
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/FastResourceLocatorSuite.java18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJSFResource.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResource.java115
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResourceLocator.java77
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestResourceIdentifierFactory.java85
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedJSFResource.java49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedResourceLocator.java426
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestDTUIViewRoot.java61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestJSPViewDefnAdapter.java231
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseStrategyTestClass.java131
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseTestClass.java101
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/JSPViewSuite.java36
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestDefaultJSPTagResolver.java53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDNamespace.java93
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDTagRegistry.java120
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagAnalyzer.java251
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagIntrospectingStrategy.java205
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestUtil.java102
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/VerifyRegistryUtil.java464
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/persistence/TestSerializableTLDTagElement.java117
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/test.xml50
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithListProp.java.data12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithMapProp.java.data12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/ListBean.java.data29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MapBean.java.data13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MethodBean.java.data14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean1.java.data41
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean2.java.data12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean3.java.data10
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBeanWithGenericProperties.java.data19
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestProject.zipbin11943 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle1.resources.data3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle2.resources.data3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config.xml.data32
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_1_2.xml.data23
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_2_0.xml.data39
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/jsfResources.jarbin575 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/tag1.xhtml0
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata1.jsp.data54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata2.jsp.data29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.cvsignore5
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.jdt.core.prefs62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/META-INF/MANIFEST.MF25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/_readme.txt1
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/build.properties20
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/plugin.properties11
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/AllFacesConfigTests.java41
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/TestsPlugin.java65
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/AllReadTests.java177
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/BaseReadTestCase.java78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase.java303
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_1_2.java144
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_2_0.java155
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeComponentTestCase.java257
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeConverterTestCase.java255
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeRendererTestCase.java258
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeValidatorTestCase.java255
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadComponentTestCase.java251
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase.java177
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase_1_2.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadExtensionDataTestCase.java88
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase.java201
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_1_2.java57
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_2_0.java255
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetComponentTestCase.java179
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetRendererTestCase.java177
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase.java157
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_1_2.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_2_0.java168
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase.java78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase_1_2.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanManagedPropertyTestCase.java273
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase.java228
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_1_2.java62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_2_0.java54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase.java303
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_1_2.java63
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_2_0.java100
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyComponentTestCase.java259
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyConverterTestCase.java258
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyValidatorTestCase.java253
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadReferencedBeanTestCase.java126
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase.java144
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_1_2.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_2_0.java69
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRendererTestCase.java211
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase.java160
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase_1_2.java62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/CommonStructuresUtil.java664
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/FacesConfigModelUtil.java274
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/WizardUtil.java218
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/AllWriteTests.java154
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/BaseWriteTestCase.java81
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/FacesConfigExtensionTestCase.java94
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase.java200
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_1_2.java191
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_2_0.java154
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentExtensionDataTestCase.java101
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentTestCase.java169
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase.java146
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase_1_2.java94
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFacesConfigTestCase_2_0.java239
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase.java158
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_1_2.java93
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_2_0.java193
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase.java91
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase_1_2.java91
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase.java396
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_1_2.java92
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_2_0.java65
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase.java201
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_1_2.java97
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_2_0.java117
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteReferencedBeanTestCase.java131
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase.java231
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_1_2.java93
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_2_0.java119
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase.java158
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase_1_2.java91
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config-ext-data1.xml21
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config.xml411
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config1.xml12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config2.xml14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config3.xml14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_1_2.xml433
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_2_0.xml521
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.cvsignore2
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.jdt.core.prefs62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/META-INF/MANIFEST.MF12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/build.properties20
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/section/ComponentsPageTest.java168
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/AllTestCases.java53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/FacesConfigEditorTest.java107
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/GEMPreferencesTest.java77
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/JSPUtilTest.java37
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/ManagedBeanUtilTest.java73
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/OpenADFDemoFacesConfigTest.java88
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/PageflowEditorTest.java235
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/TestNotificationsOnNonUIThread.java537
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/WebrootUtilTest.java132
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/TestUtil.java306
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/ZipStreamWrapper.java59
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/wizard/NewManagedBeanWizardTest.java67
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/adfDemoProject.zipbin6407583 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/emptyjsfproject.zipbin4226 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/page1.jsp34
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/.cvsignore4
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/META-INF/MANIFEST.MF42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.properties11
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.xml10
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/build.properties22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.xml91
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractBaseMetaDataTestCase.java160
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractEntityQueryVisitorTest.java42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractMetaDataVisitorTest.java35
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractTraitQueryVisitorTest.java43
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AllDeprecatedMetadataTests.java42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EmptyResultSetTest.java54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EntityImplTests.java87
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/IncludeEntityGroupImplTests.java53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MergeTests.java202
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataExceptionTest.java42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataQueryHelperTests.java286
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MissingMDExtensionModelTests.java122
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelImplTests.java115
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelProviderAdapterTests.java97
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MyMDLocator.java33
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TinyTestTests.java54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitImplTests.java72
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitValueHelperTests.java265
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractBaseMetaDataTestCase.java170
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractEntityQueryVisitorTests.java42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractMetaDataVisitorTests.java35
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractTraitQueryVisitorTests.java43
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AllUpdatedMetadataTests.java54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EmptyResultSetTests.java54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EntityImplTests.java90
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/FakeDomainQueryFactory.java40
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/IncludeEntityGroupImplTests.java57
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MergeTests.java207
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataExceptionTests.java42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataModelManagerFactoryTests.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryContextFactoryTests.java55
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryFactoryTests.java95
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryHelperTests.java315
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MissingMDExtensionModelTests.java125
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelImplTests.java110
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelProviderAdapterTests.java104
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TaglibMetaDataQueryTests.java279
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TestMDModelManagerFactory.java41
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TinyTestTests.java57
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitImplTests.java73
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitValueHelperTests.java270
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/AllTests.java208
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/MetadataTestsPlugin.java58
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AllMetaDataProcessingTests.java31
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeExtensionsTests.java69
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeFactoryTests.java64
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypesRegistryTests.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataEnabledBarkAdapter.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataProcessorsFactoryTests.java136
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/features/IBarker.java22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyBooleanType.java29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyLongType.java27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PaletteTests.java266
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PropertyDescriptorTests.java116
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/QuickEditSectionsTests.java68
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ActionTypeTests.java76
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/AllTests.java97
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/BooleanTypeTest.java69
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSClassTypeTests.java56
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSStyleTypeTests.java45
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CharacterTypeTest.java43
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ColorTypeTest.java100
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentBindingTypeTests.java66
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentIDTypeTests.java103
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ContentTypeTest.java44
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CurrencyCodeTypeTest.java51
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/DoubleTypeTest.java82
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedDoubleTypeTest.java43
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedIntegerTypeTest.java46
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedLongTypeTest.java49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigConverterIDTypeTests.java96
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigValidatorIDTypeTests.java81
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/IntegerTypeTest.java74
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFCoreTestCase.java18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFHTMLTestCase.java181
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JavaClassTypeTest.java138
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LanguageCodeTypeTest.java48
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LengthTypeTest.java95
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LinkTypeTest.java44
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LocaleTypeTest.java72
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LongTypeTest.java82
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/MethodBindingTypeTests.java74
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/NumberPatternTypeTest.java31
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/StringTypeTest.java69
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TaglibProcessingTestCase.java68
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TimeZoneTypeTest.java40
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueBindingTypeTests.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueTypeTests.java61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/BaseTestCase.java194
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequired.java18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV11.java18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV12.java18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/JSPTestCase.java172
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/NoJSFRuntimeFoundException.java17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/SingleJSPTestCase.java113
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/icons/attr_val.gifbin124 -> 0 bytes-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyBean.java.data16
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverter.java.data17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass1.java.data12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass2.java.data16
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass3.java.data12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MySubclassOfMyConverterSubclass1.java.data11
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyValidator.java.data14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/JSFPage.jsp16
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/actionTypeTest.jsp.data17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.html18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.jsp.data15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigConverterIDType.jsp.data18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigValidatorIDType.jsp.data18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/foo.css.data157
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/javaClassType.jsp.data17
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/mystyle.css.data31
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/propertyDescTests.jsp13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileA.xml66
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileB.xml96
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileIncludeExternalModel.xml9
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TestJSP.jsp16
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TinyIncludeTest.xml82
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_metadataprocessing.xml107
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tagprocessing.xml251
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.xml141
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test_en_US.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tinytest.xml22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/missingMDModelTest.xml88
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/propertyDescriptorTest.xml64
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/quickEditSectionTest.xml21
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.xml77
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest_en_US.properties15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/web/faces-config_1_1.xml.data50
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.cvsignore5
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/META-INF/MANIFEST.MF14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/build.properties20
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/metadata/jsf_metadataprocessing2.xml25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.xml21
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/Activator.java57
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/NoImplPossibleVals.java42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/.cvsignore4
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/META-INF/MANIFEST.MF40
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/build.properties18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/Activator.java77
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestCase.java102
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestSuite.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JDTTestEnvironment.java229
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JSFTestUtil.java416
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/LoadableResource.java76
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/PerfTracker.java83
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ProjectTestEnvironment.java272
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestFileResource.java54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestUtil.java471
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/WebProjectTestEnvironment.java284
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ZipStreamWrapper.java59
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/junit4/BugRegressionTest.java14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/junit4/FastTest.java15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/junit4/NoPluginEnvironment.java13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/junit4/RequiresPluginEnvironment.java14
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/junit4/SlowTest.java12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/IMockResourceFactory.java41
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockBundle.java172
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockContainer.java167
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockContentType.java128
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockContentTypeManager.java113
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockDataModel.java274
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockExtensionRegistryProvider.java18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockFile.java224
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockFolder.java67
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockJarProvider.java69
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockModelProvider.java46
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockProject.java178
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockResource.java579
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockResourceChangeEvent.java60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockResourceChangeEventFactory.java104
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockResourceDelta.java372
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockResourceDeltaFactory.java333
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockVirtualComponentQuery.java27
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockVirtualFile.java162
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockVirtualFolder.java253
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockWorkspace.java374
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockWorkspaceContext.java329
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockWorkspaceMediator.java22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/MockWorkspaceRoot.java128
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockClasspathEntry.java328
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockJDTWorkspaceContext.java135
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockJavaChangeEventFactory.java47
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockJavaCoreMediator.java37
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockJavaElement.java161
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockJavaElementDelta.java12
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockJavaProject.java462
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/mock/java/MockPackageFragmentRoot.java207
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/sanity/TestJDTTestEnvironment.java78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/sanity/TestJSFTestUtil.java79
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/sanity/TestProjectTestEnvironment.java41
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/sanity/TestWebProjectTestEnvironment.java67
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/testdata/TestClass1.java.data9
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/testdata/dummyFile1
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.test.util/testdata/faces-config.xml.data1
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/.cvsignore4
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/META-INF/MANIFEST.MF29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/build.properties20
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/src/org/eclipse/jst/jsf/ui/tests/JSFUIAllTests.java33
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/src/org/eclipse/jst/jsf/ui/tests/JSFUITestsPlugin.java65
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/src/org/eclipse/jst/jsf/ui/tests/jspeditor/TestELHyperlinkDetector.java160
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/src/org/eclipse/jst/jsf/ui/tests/jspeditor/TestJSFELHover.java125
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/src/org/eclipse/jst/jsf/ui/tests/util/JSFUITestHelper.java114
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.ui.tests/test.xml49
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/.settings/org.eclipse.jdt.core.prefs61
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/META-INF/MANIFEST.MF36
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/build.properties20
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/plugin.properties11
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/AllTests.java40
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/AllTests_1_1.java53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/AllTests_1_2.java52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/CommonTests.java100
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/ELValidationTestPlugin.java62
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/PerfSuite.java15
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/base/BaseTestCase.java347
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/base/ELAssert.java396
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/base/JSPTestCase.java98
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/base/MockELValidationReporter.java67
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/base/SingleJSPTestCase.java183
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ArithmeticAddTestCase.java125
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ArithmeticDivideTestCase.java186
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ArithmeticMinusTestCase.java125
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ArithmeticModuloTestCase.java181
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ArithmeticMultiplyTestCase.java124
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/AssignabilityTestCase.java82
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/BadSyntaxTestCase.java81
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/BeanPropertyResolutionTestCase.java180
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/BeanVariableResolutionTestCase.java82
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/BracketOperatorTestCase.java239
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/BuiltInSymbolsTestCase.java201
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/DataTableResolutionTestCase.java79
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/GenericsTestCase.java64
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/GreaterThanEqTestCase.java210
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/GreaterThanTestCase.java213
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/JSPFunctionsTestCase.java79
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LessThanEqTestCase.java209
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LessThanTestCase.java214
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LoadBundleResolutionTestCase.java178
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LogicalAndTestCase.java133
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LogicalEqualsTestCase.java219
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LogicalNotEqualsTestCase.java206
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LogicalNotTestCase.java140
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/LogicalOrTestCase.java125
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/MarkerOffsetsTestCase.java178
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/MethodBindingTestCase.java145
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/PropertiesOfListTestCase.java47
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/PropertiesOfMapsTestCase.java94
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ResourceBundleTestCase.java140
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/UnaryEmptyTestCase.java109
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/UnaryMinusTestCase.java114
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ext/BeanPropertyResolutionTestCase_JSFExt.java25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ext/BeanPropertyResolutionTestCase_JSPFExt.java25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/jsp/ext/BeanPropertyResolutionTestCase_JSPXExt.java25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/perf/PropertyFileStressTest.java134
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/perf/StressTest.java153
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/preferences/EndToEndTestCase.java196
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/preferences/PrefTestUtil.java130
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/preferences/TestELValidationPreferences.java86
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/preferences/ValidationMessageFactory.java178
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/util/CreateTestCaseForJSP.java165
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/src/org/eclipse/jst/jsf/validation/el/tests/util/FindELRegions.java139
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/test.xml60
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/BeanWithListProperties.java.data25
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/BeanWithMapProperties.java.data26
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/Bundle.properties.data3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/Bundle2.properties.data2
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/ListBean.java.data29
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/MapBean.java.data18
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/MyBean.java.data154
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/MyBeanSettable.java.data188
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/MyBeanSubClass.java.data10
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/MyEnum1.java.data7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/MyEnum2.java.data7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/classes/stress1.properties.data8689
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/arithmeticAdd.jsp.data52
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/arithmeticDivide.jsp.data68
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/arithmeticMinus.jsp.data51
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/arithmeticModulo.jsp.data65
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/arithmeticMultiply.jsp.data51
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/assignability.jsp.data35
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/badSyntax.jsp.data36
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/beanPropertyResolution.jsp.data78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/beanVariableResolution.jsp.data35
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/bracketOperator.jsp.data96
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/builtinSymbols.jsp.data112
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/complexArithmetic1.jsp.data46
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/complexComparison.jsp.data36
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/dataTableResolution.jsp.data67
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/emptyOperator.jsp.data44
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/generics.jsp.data33
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/greaterThan.jsp.data78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/greaterThanEq.jsp.data77
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/jspFunctions.jsp.data42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/lessThan.jsp.data78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/lessThanEq.jsp.data77
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/listBeans.jsp.data34
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/loadBundleResolution.jsp.data50
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/logicalAND.jsp.data53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/logicalEquals.jsp.data81
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/logicalNOT.jsp.data53
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/logicalNotEquals.jsp.data78
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/logicalOR.jsp.data54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/markerOffsets.jsp.data63
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/methodBinding.jsp.data71
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/perfTest1.jsp.data30
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/preferenceTest1.jsp.data44
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/propertiesOfMaps.jsp.data42
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/resourceBundleResolution.jsp.data54
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/syntaxCheck.jsp.data35
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/test.jsp.data35
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/unaryMinus.jsp.data48
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/jsps/variableNaming.jsp.data30
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/web/faces-config_1_1.xml.data104
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.validation.el.tests/testdata/web/faces-config_1_2.xml.data118
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/.project33
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/.settings/org.eclipse.jdt.core.prefs66
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/META-INF/MANIFEST.MF33
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/about.html22
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/build.properties23
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/metadata/checkmodeop_dti.xml60
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/metadata/test-metadata.xml34
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/plugin.properties13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/plugin.xml44
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/AllTests_Part1.java82
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/AllTests_Part2.java82
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/PageDesignerTestsPlugin.java64
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/Test_DTManager.java248
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/Test_TransformOperations.java703
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/Utils.java22
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tabbed/properties/sections/BaseTestCase.java248
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tabbed/properties/sections/BasicTabbedPropertyPageTests.java317
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tabbed/properties/sections/FakePropertySection.java94
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tabbed/properties/sections/FakePropertySectionUsingDialogField.java110
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/BaseDefaultTagCreatorTestCase.java26
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/BaseUserCustomizedTagCreatorTestCase.java102
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestDefaultTagCreatorForJSFCore.java165
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestDefaultTagCreatorForJSFHTML.java159
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestDefaultTagCreatorHTML.java49
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestDefaultTagCreatorJSP.java39
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestItemCreationToolForJSFCore.java166
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestItemCreationToolForJSFHTML.java156
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestItemCreationToolHTML.java49
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestItemCreationToolJSP.java40
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestOverrideableCreationData.java217
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestTagCreationFactory.java256
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestUserCustomizedTagCreatorForJSFHTML_AttributeCustomization.java57
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestUserCustomizedTagCreatorForJSFHTML_ChildCustomization.java111
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestUserCustomizedTagCreatorForJSFHTML_GeneralCustomization.java165
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/TestUserCustomizedTagCreatorForJSFHTML_ParentCustomization.java82
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/base/BaseItemCreationToolTestCase.java76
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/base/BaseTagCreatorTestCase.java103
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/base/BaseTestClass.java384
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/base/MockCreateItemCommand.java47
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreator/base/MockItemCreationTool.java58
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreatorPlugin/TestCreationFactory.java186
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/src/org/eclipse/jst/pagedesigner/tests/tagcreatorPlugin/UserCustomizedElementEditFactory.java72
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/test.xml62
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/Test_DTManager.jsp.data17
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/Test_TransformOperations.jsp.data23
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/AttributeCustomization/jsf/expectedResult_commandButton.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/AttributeCustomization/jsf/expectedResult_commandButton.jspx.data14
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/AttributeCustomization/jsf/expectedResult_commandButton.xhtml.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/ChildCustomization/jsf/expectedResult_commandButton.jsp.data30
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/ChildCustomization/jsf/expectedResult_commandButton.jspx.data29
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/ChildCustomization/jsf/expectedResult_commandButton.xhtml.data30
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/GeneralCustomization/jsf/expectedResult_commandButton.jsp.data53
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/GeneralCustomization/jsf/expectedResult_commandButton.jspx.data55
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/GeneralCustomization/jsf/expectedResult_commandButton.xhtml.data52
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/ParentCustomization/jsf/expectedResult_commandButton.jsp.data23
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/ParentCustomization/jsf/expectedResult_commandButton.jspx.data22
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/UserCustomizedTagCreator/ParentCustomization/jsf/expectedResult_commandButton.xhtml.data23
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/checkmodeop/checkModeOp.tld.data72
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/checkmodeop/testCheckModeOperation.jsp.data27
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/propertypages/tagProperty.xsd.data154
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/propertypages/test-metadata.xml64
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/propertypages/testPropPages.tld.data161
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/propertypages/testPropertyPage.jsp.data15
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/expectedResult_directive.include.jspx.data11
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/html/expectedResult_INPUT.BUTTON.html.data10
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/html/expectedResult_INPUT.BUTTON.xhtml.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_actionListener.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_attribute.jsp.data15
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_commandButton.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_commandButton.jspx.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_commandButton.xhtml.data15
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_commandLink.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_convertDateTime.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_convertNumber.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_converter.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_dataTable.jsp.data21
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_facet.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_form.jsp.data14
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_graphicImage.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_inputHidden.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_inputSecret.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_inputText.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_inputTextarea.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_loadBundle.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_message.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_messages.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_outputFormat.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_outputLabel.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_outputLink.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_outputText.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_panelGrid.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_panelGroup.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_param.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectBooleanCheckbox.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectItem.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectItems.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectManyCheckbox.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectManyListbox.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectManyMenu.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectOneListbox.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectOneMenu.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_selectOneRadio.jsp.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_subview.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_validateDoubleRange.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_validateLength.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_validateLongRange.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_validator.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_valueChangeListener.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_verbatim.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsf/expectedResult_view.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsp/expectedResult_jsp_directive.include.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/jsp/expectedResult_jsp_directive.include.jspx.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/tagCreator.html.data10
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/tagCreator.jsp.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/tagCreator.jspx.data13
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/tagCreator.xhtml.data12
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/testCreator.tld.data142
-rw-r--r--jsf/tests/org.eclipse.jst.pagedesigner.tests/testdata/tagcreator/testTagCreation.jsp.data16
881 files changed, 0 insertions, 98211 deletions
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.project b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.project
deleted file mode 100644
index 970c00a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.common.runtime.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 335f5ca..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Mon Nov 19 16:52:39 PST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index f4a31c4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Runtime Test Plugin
-Bundle-SymbolicName: org.eclipse.jst.jsf.common.runtime.tests
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.common.runtime.tests.RuntimeTestPlugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.jst.jsf.common.runtime;bundle-version="[1.0.0,2.0.0)",
- org.junit;bundle-version="3.8.1"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jst.jsf.common.runtime.tests.model
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/about.html
deleted file mode 100644
index 90bd74d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/build.properties
deleted file mode 100644
index bfaab6e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/AllRuntimeTests.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/AllRuntimeTests.java
deleted file mode 100644
index 5892995..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/AllRuntimeTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.common.runtime.tests.model.TestViewObject;
-import org.eclipse.jst.jsf.common.runtime.tests.model.bean.TestDataModelInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.behavioural.TestActionSource2Info;
-import org.eclipse.jst.jsf.common.runtime.tests.model.behavioural.TestValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestUICommandInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestUIDataInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestUIFormInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestUIInputInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.component.TestUIOutputInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.decorator.TestComponentDecorator;
-
-public class AllRuntimeTests {
- /**
- * @return the test suite
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Test for org.eclipse.jst.jsf.common.runtime");
- //$JUnit-BEGIN$
-
- suite.addTestSuite(TestValueHolderInfo.class);
- suite.addTestSuite(TestComponentDecorator.class);
- suite.addTestSuite(TestDataModelInfo.class);
- suite.addTestSuite(TestComponentTypeInfo.class);
- suite.addTestSuite(TestActionSource2Info.class);
-
- // test the main objects
- suite.addTestSuite(TestViewObject.class);
- suite.addTestSuite(TestComponentInfo.class);
- suite.addTestSuite(TestUIOutputInfo.class);
- suite.addTestSuite(TestUIInputInfo.class);
- suite.addTestSuite(TestUICommandInfo.class);
- suite.addTestSuite(TestUIFormInfo.class);
- suite.addTestSuite(TestUIDataInfo.class);
-
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/RuntimeTestPlugin.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/RuntimeTestPlugin.java
deleted file mode 100644
index 6172549..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/RuntimeTestPlugin.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class RuntimeTestPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.common.runtime.tests";
-
- // The shared instance
- private static RuntimeTestPlugin plugin;
-
- /**
- * The constructor
- */
- public RuntimeTestPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static RuntimeTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/debug/TestRenderNode.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/debug/TestRenderNode.java
deleted file mode 100644
index 5f5b2e5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/debug/TestRenderNode.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.debug;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.runtime.internal.debug.RenderAttribute;
-import org.eclipse.jst.jsf.common.runtime.internal.debug.RenderNode;
-
-public class TestRenderNode extends TestCase {
-
- private RenderNode _renderNode;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- _renderNode = new RenderNode("org.eclipse.jsf.jst.CompType", "th");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetComponentId()
- {
- assertEquals("org.eclipse.jsf.jst.CompType", _renderNode.getComponentId());
- }
-
- @SuppressWarnings("unchecked")
- public void testGetChildren() {
- RenderNode child1 = new RenderNode("org.eclipse.jsf.jst.CompType2", "a");
- RenderNode child2 = new RenderNode("org.eclipse.jst.jst.CompType3", "br");
-
- _renderNode.getChildren().add(child1);
- _renderNode.getChildren().add(child2);
-
- assertEquals(2, _renderNode.getChildren().size());
- verifySame(child1, (RenderNode) _renderNode.getChildren().get(0));
- verifySame(child2, (RenderNode) _renderNode.getChildren().get(1));
- }
-
- public void testGetRenderedNodeName() {
- assertEquals("th", _renderNode.getRenderedNodeName());
- }
-
- @SuppressWarnings("unchecked")
- public void testGetRenderedAttributes() {
- RenderAttribute attribute1 = new RenderAttribute("id", "blah", null);
-
- _renderNode.getRenderedAttributes().add(attribute1);
-
- RenderAttribute attribute2 = new RenderAttribute("value", "5", "Value");
- _renderNode.getRenderedAttributes().add(attribute2);
-
- verifySame(attribute1, (RenderAttribute)_renderNode.getRenderedAttributes().get(0));
- verifySame(attribute2, (RenderAttribute)_renderNode.getRenderedAttributes().get(1));
- }
-
- public static void verifySame(RenderNode truth, RenderNode check)
- {
- if (truth == check) return;
-
- assertEquals(truth.getComponentId(), check.getComponentId());
- assertEquals(truth.getRenderedNodeName(), check.getRenderedNodeName());
-
- assertEquals(truth.getChildren().size(), check.getChildren().size());
-
- for (int i = 0; i < check.getChildren().size(); i++)
- {
- verifySame((RenderNode)truth.getChildren().get(i), (RenderNode)check.getChildren().get(i));
- }
-
- assertEquals(truth.getRenderedAttributes().size(), check.getChildren().size());
-
- for (int i = 0; i < check.getRenderedAttributes().size(); i++)
- {
- verifySame((RenderAttribute)truth.getRenderedAttributes().get(i),
- (RenderAttribute)check.getRenderedAttributes().get(i));
- }
- }
-
- public static void verifySame(RenderAttribute truth, RenderAttribute check)
- {
- assertEquals(truth.getName(), check.getName());
- assertEquals(truth.getPropertyName(), check.getPropertyName());
- assertEquals(truth.getValue(), check.getValue());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/RuntimeTestUtil.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/RuntimeTestUtil.java
deleted file mode 100644
index ddfb348..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/RuntimeTestUtil.java
+++ /dev/null
@@ -1,890 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.bean.DataModelInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.IActionSource2Info;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.IActionSourceInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.IEditableValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.IValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UICommandInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIDataInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIFormInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIInputInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIOutputInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ActionListenerDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ComponentDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.Decorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.FacetDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-
-public final class RuntimeTestUtil extends Assert
-{
- // expected type info for jsf/core components
- public static final ComponentTypeInfo COMPINFO_PARAM = new ComponentTypeInfo(
- "javax.faces.Parameter", "javax.faces.component.UIParameter",
- new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.Parameter",
- null);
-
- public static final ComponentTypeInfo COMPINFO_SELECTITEM = new ComponentTypeInfo(
- "javax.faces.SelectItem", "javax.faces.component.UISelectItem",
- new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.SelectItem",
- null);
-
- public static final ComponentTypeInfo COMPINFO_SELECTITEMS = new ComponentTypeInfo(
- "javax.faces.SelectItems", "javax.faces.component.UISelectItems",
- new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", },
- "javax.faces.SelectItems", null);
-
- public static final ComponentTypeInfo COMPINFO_SUBVIEW = new ComponentTypeInfo(
- "javax.faces.NamingContainer",
- "javax.faces.component.UINamingContainer", new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.NamingContainer",
- "javax.faces.component.StateHolder", },
- "javax.faces.NamingContainer", null);
-
- public static final ComponentTypeInfo COMPINFO_VERBATIM = new ComponentTypeInfo(
- "javax.faces.Output", "javax.faces.component.UIOutput",
- new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output", "javax.faces.Text");
-
- public static final ComponentTypeInfo COMPINFO_VIEW = new ComponentTypeInfo(
- "javax.faces.ViewRoot", "javax.faces.component.UIViewRoot",
- new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.ViewRoot",
- null);
-
- // expected type info for jsf/html components
- public static final ComponentTypeInfo COMPINFO_COLUMN = new ComponentTypeInfo(
- "javax.faces.Column", "javax.faces.component.UIColumn",
- new String[]
- { "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.StateHolder" }, "javax.faces.Column", null);
- public static final ComponentTypeInfo COMPINFO_COMMAND = new ComponentTypeInfo(
- "javax.faces.HtmlCommandButton",
- "javax.faces.component.html.HtmlCommandButton", new String[]
- { "javax.faces.component.UICommand",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.ActionSource",
- "javax.faces.component.StateHolder" },
- "javax.faces.Command", "javax.faces.Button");
- public static final ComponentTypeInfo COMPINFO_COMMANDLINK = new ComponentTypeInfo(
- "javax.faces.HtmlCommandLink",
- "javax.faces.component.html.HtmlCommandLink",
- new String[]
- { "javax.faces.component.UICommand",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.ActionSource",
- "javax.faces.component.StateHolder" },
- "javax.faces.Command", "javax.faces.Link");
- public static final ComponentTypeInfo COMPINFO_DATATABLE = new ComponentTypeInfo(
- "javax.faces.HtmlDataTable",
- "javax.faces.component.html.HtmlDataTable", new String[]
- { "javax.faces.component.UIData",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.NamingContainer",
- "javax.faces.component.StateHolder", }, "javax.faces.Data",
- "javax.faces.Table");
- public static final ComponentTypeInfo COMPINFO_FORM = new ComponentTypeInfo(
- "javax.faces.HtmlForm", "javax.faces.component.html.HtmlForm",
- new String[]
- { "javax.faces.component.UIForm",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.NamingContainer",
- "javax.faces.component.StateHolder" }, "javax.faces.Form",
- "javax.faces.Form");
- public static final ComponentTypeInfo COMPINFO_GRAPHIC = new ComponentTypeInfo(
- "javax.faces.HtmlGraphicImage",
- "javax.faces.component.html.HtmlGraphicImage", new String[]
- { "javax.faces.component.UIGraphic",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.Graphic",
- "javax.faces.Image");
- public static final ComponentTypeInfo COMPINFO_HIDDEN = new ComponentTypeInfo(
- "javax.faces.HtmlInputHidden",
- "javax.faces.component.html.HtmlInputHidden", new String[]
- { "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Input", "javax.faces.Hidden");
- public static final ComponentTypeInfo COMPINFO_SECRET = new ComponentTypeInfo(
- "javax.faces.HtmlInputSecret",
- "javax.faces.component.html.HtmlInputSecret", new String[]
- { "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder" }, "javax.faces.Input",
- "javax.faces.Secret");
- public static final ComponentTypeInfo COMPINFO_INPUTTEXT = new ComponentTypeInfo(
- "javax.faces.HtmlInputText",
- "javax.faces.component.html.HtmlInputText", new String[]
- { "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object" },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder" }, "javax.faces.Input",
- "javax.faces.Text");
- public static final ComponentTypeInfo COMPINFO_INPUTTEXTAREA = new ComponentTypeInfo(
- "javax.faces.HtmlInputTextarea",
- "javax.faces.component.html.HtmlInputTextarea", new String[]
- { "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Input", "javax.faces.Textarea");
- public static final ComponentTypeInfo COMPINFO_MESSAGE = new ComponentTypeInfo(
- "javax.faces.HtmlMessage",
- "javax.faces.component.html.HtmlMessage", new String[]
- { "javax.faces.component.UIMessage",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.Message",
- "javax.faces.Message");
- public static final ComponentTypeInfo COMPINFO_MESSAGES = new ComponentTypeInfo(
- "javax.faces.HtmlMessages",
- "javax.faces.component.html.HtmlMessages", new String[]
- { "javax.faces.component.UIMessages",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.Messages",
- "javax.faces.Messages");
- public static final ComponentTypeInfo COMPINFO_OUTPUTFORMAT = new ComponentTypeInfo(
- "javax.faces.HtmlOutputFormat",
- "javax.faces.component.html.HtmlOutputFormat", new String[]
- { "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output", "javax.faces.Format");
- public static final ComponentTypeInfo COMPINFO_OUTPUTLABEL = new ComponentTypeInfo(
- "javax.faces.HtmlOutputLabel",
- "javax.faces.component.html.HtmlOutputLabel", new String[]
- { "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output", "javax.faces.Label");
- public static final ComponentTypeInfo COMPINFO_OUTPUTLINK = new ComponentTypeInfo(
- "javax.faces.HtmlOutputLink",
- "javax.faces.component.html.HtmlOutputLink", new String[]
- { "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output", "javax.faces.Link");
- public static final ComponentTypeInfo COMPINFO_OUTPUTTEXT = new ComponentTypeInfo(
- "javax.faces.HtmlOutputText",
- "javax.faces.component.html.HtmlOutputText", new String[]
- { "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.Output", "javax.faces.Text");
- public static final ComponentTypeInfo COMPINFO_PANELGRID = new ComponentTypeInfo(
- "javax.faces.HtmlPanelGrid",
- "javax.faces.component.html.HtmlPanelGrid", new String[]
- { "javax.faces.component.UIPanel",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.Panel",
- "javax.faces.Grid");
- public static final ComponentTypeInfo COMPINFO_PANELGROUP = new ComponentTypeInfo(
- "javax.faces.HtmlPanelGroup",
- "javax.faces.component.html.HtmlPanelGroup", new String[]
- { "javax.faces.component.UIPanel",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.StateHolder", }, "javax.faces.Panel",
- "javax.faces.Group");
- public static final ComponentTypeInfo COMPINFO_SELECTBOOLEANCHECKBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectBooleanCheckbox",
- "javax.faces.component.html.HtmlSelectBooleanCheckbox",
- new String[]
- { "javax.faces.component.UISelectBoolean",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectBoolean", "javax.faces.Checkbox");
- public static final ComponentTypeInfo COMPINFO_SELECTMANYCHECKBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectManyCheckbox",
- "javax.faces.component.html.HtmlSelectManyCheckbox", new String[]
- { "javax.faces.component.UISelectMany",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectMany", "javax.faces.Checkbox");
- public static final ComponentTypeInfo COMPINFO_SELECTMANYLISTBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectManyListbox",
- "javax.faces.component.html.HtmlSelectManyListbox", new String[]
- { "javax.faces.component.UISelectMany",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectMany", "javax.faces.Listbox");
- public static final ComponentTypeInfo COMPINFO_SELECTMANYMENU = new ComponentTypeInfo(
- "javax.faces.HtmlSelectManyMenu",
- "javax.faces.component.html.HtmlSelectManyMenu", new String[]
- { "javax.faces.component.UISelectMany",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectMany", "javax.faces.Menu");
- public static final ComponentTypeInfo COMPINFO_SELECTONELISTBOX = new ComponentTypeInfo(
- "javax.faces.HtmlSelectOneListbox",
- "javax.faces.component.html.HtmlSelectOneListbox", new String[]
- { "javax.faces.component.UISelectOne",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectOne", "javax.faces.Listbox");
- public static final ComponentTypeInfo COMPINFO_SELECTONEMENU = new ComponentTypeInfo(
- "javax.faces.HtmlSelectOneMenu",
- "javax.faces.component.html.HtmlSelectOneMenu", new String[]
- { "javax.faces.component.UISelectOne",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectOne", "javax.faces.Menu");
- public static final ComponentTypeInfo COMPINFO_SELECTONERADIO = new ComponentTypeInfo(
- "javax.faces.HtmlSelectOneRadio",
- "javax.faces.component.html.HtmlSelectOneRadio", new String[]
- { "javax.faces.component.UISelectOne",
- "javax.faces.component.UIInput",
- "javax.faces.component.UIOutput",
- "javax.faces.component.UIComponentBase",
- "javax.faces.component.UIComponent", "java.lang.Object", },
- new String[]
- { "javax.faces.component.EditableValueHolder",
- "javax.faces.component.ValueHolder",
- "javax.faces.component.StateHolder", },
- "javax.faces.SelectOne", "javax.faces.Radio");
-
- // default converters
- public static final ConverterTypeInfo CONVERTERINFO_DATETIME = new ConverterTypeInfo(
- "javax.faces.convert.DateTimeConverter", "javax.faces.DateTime");
-
- public static final ConverterTypeInfo CONVERTERINFO_NUMBER = new ConverterTypeInfo(
- "javax.faces.convert.NumberConverter", "javax.faces.Number");
-
- // default validators
- public static final ValidatorTypeInfo VALIDATORINFO_DOUBLERANGE = new ValidatorTypeInfo(
- "javax.faces.validator.DoubleRangeValidator",
- "javax.faces.DoubleRange");
-
- public static final ValidatorTypeInfo VALIDATORINFO_LENGTH = new ValidatorTypeInfo(
- "javax.faces.validator.LengthValidator", "javax.faces.Length");
-
- public static final ValidatorTypeInfo VALIDATORINFO_LONGRANGE = new ValidatorTypeInfo(
- "javax.faces.validator.LongRangeValidator", "javax.faces.LongRange");
-
- // public static final ValidatorTypeInfo VALIDATORINFO_METHODEXPRESSION =
- // new ValidatorTypeInfo(
- // "javax.faces.validator.MethodExpressionValidator ",
- // "javax.faces.LongRange");
-
- @SuppressWarnings("unchecked")
- public static <COMPONENT_T> COMPONENT_T serializeDeserialize(
- final COMPONENT_T object) throws IOException,
- ClassNotFoundException
- {
- final ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
- final ObjectOutputStream outStream = new ObjectOutputStream(byteStream);
-
- outStream.writeObject(object);
-
- final ByteArrayInputStream byteArray = new ByteArrayInputStream(
- byteStream.toByteArray());
- final ObjectInputStream inStream = new ObjectInputStream(byteArray);
-
- return (COMPONENT_T) inStream.readObject();
- }
-
- public static void verifyImplicitAdapter(final ViewObject check,
- final Class<?> adapterType, final Object explicitAdapter)
- {
- assertEquals(check, check.getAdapter(adapterType));
- // cannot add explicit adapter if check is already that type
- boolean caughtException = false;
-
- try
- {
- check.addAdapter(adapterType, explicitAdapter);
- }
- catch (IllegalArgumentException iae)
- {
- caughtException = true;
- }
-
- assertTrue(caughtException);
-
- // should be unaffected by the attempt
- assertEquals(check, check.getAdapter(adapterType));
- }
-
- public static void verifySame(final ComponentTypeInfo truth,
- final ComponentTypeInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getClassName(), check.getClassName());
- assertEquals(truth.getComponentFamily(), check.getComponentFamily());
- assertEquals(truth.getComponentType(), check.getComponentType());
- assertEquals(truth.getRenderFamily(), check.getRenderFamily());
-
- verifyArraysSame(truth.getInterfaces(), check.getInterfaces());
- verifyArraysSame(truth.getSuperClasses(), check.getSuperClasses());
- }
-
- public static <T> void verifyArraysSame(T[] expected, T[] check)
- {
- assertEquals("Arrays must be same size", expected.length, check.length);
-
- Set<T> expectedValues = new HashSet<T>();
-
- for (final T e : expected)
- {
- expectedValues.add(e);
- }
-
- for (final T e : check)
- {
- assertTrue("Must contain "+e,expectedValues.contains(e));
- }
- }
-
- public static void verifySame(final DataModelInfo truth,
- final DataModelInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getRowCount(), check.getRowCount());
- assertEquals(truth.getRowIndex(), check.getRowIndex());
-
- // assertEquals(truth.getRowData(), check.getRowData());
- // assertEquals(truth.getWrappedData(), check.getWrappedData());
- }
-
- public static void verifySame(final ViewObject truth, final ViewObject check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getAllDecorators().size(), check.getAllDecorators()
- .size());
-
- for (int i = 0; i < check.getAllDecorators().size(); i++)
- {
- verifySame((Decorator) truth.getAllDecorators().get(i),
- (Decorator) check.getAllDecorators().get(i));
- }
-
- // TODO: hard to check adapters since they are arbitrary
- assertEquals(truth.getAllAdapters().size(), truth.getAllAdapters()
- .size());
- // can at least check that the keys match
- assertEquals(truth.getAllAdapters().keySet(), check.getAllAdapters()
- .keySet());
- }
-
- public static void verifySame(final ComponentInfo truth,
- final ComponentInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ViewObject) truth, (ViewObject) check);
- verifySame(truth.getComponentTypeInfo(), check.getComponentTypeInfo());
-
- assertEquals(truth.getId(), check.getId());
- assertEquals(truth.isRendered(), check.isRendered());
-// assertEquals(truth.getMostSpecificComponentName(), check
-// .getMostSpecificComponentName());
- // assertEquals(truth.getParent(), t);
- // TestRenderNode.verifySame(truth.getRenderNode(),
- // check.getRenderNode());
-
- assertEquals(truth.getChildren().size(), check.getChildren().size());
-
- for (int i = 0; i < check.getChildren().size(); i++)
- {
- final ComponentInfo checkChild = (ComponentInfo) check
- .getChildren().get(i);
- verifySame((ComponentInfo) truth.getChildren().get(i), checkChild);
- }
-
- final List<?> truthGetAllDecorators = truth.getAllDecorators();
- final List<?> checkGetAllDecorators = check.getAllDecorators();
-
- for (int i = 0; i < checkGetAllDecorators.size(); i++)
- {
- final Decorator checkDecorator = (Decorator) checkGetAllDecorators
- .get(i);
-
- verifySame((Decorator) truthGetAllDecorators.get(i), checkDecorator);
- }
- }
-
- public static void verifySame(final UIOutputInfo truth,
- final UIOutputInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ComponentInfo) truth, (ComponentInfo) check);
- verifySame((IValueHolderInfo) truth, (IValueHolderInfo) check);
- }
-
- public static void verifySame(final UIInputInfo truth,
- final UIInputInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((UIOutputInfo) truth, (UIOutputInfo) check);
- verifySame((IEditableValueHolderInfo) truth,
- (IEditableValueHolderInfo) check);
- }
-
- public static void verifySame(final UICommandInfo truth,
- final UICommandInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ComponentInfo) truth, (ComponentInfo) check);
- verifySame((IActionSourceInfo) truth, (IActionSourceInfo) check);
- }
-
- public static void verifySame(final UIFormInfo truth, final UIFormInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ComponentInfo) truth, (ComponentInfo) check);
- assertEquals(truth.isPrependId(), check.isPrependId());
- assertEquals(truth.isSubmitted(), check.isSubmitted());
- }
-
- public static void verifySame(final UIDataInfo truth, final UIDataInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ComponentInfo) truth, (ComponentInfo) check);
-
- assertEquals(truth.getFirst(), check.getFirst());
- assertEquals(truth.getRowCount(), check.getRowCount());
- assertEquals(truth.isRowAvailable(), check.isRowAvailable());
- assertEquals(truth.getRowIndex(), check.getRowIndex());
- assertEquals(truth.getRows(), check.getRows());
- assertEquals(truth.getVar(), check.getVar());
- }
-
- public static void verifySame(final Decorator truth, final Decorator check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getClass(), check.getClass());
-
- verifySame((ViewObject) truth, (ViewObject) check);
-
- if (truth instanceof FacetDecorator)
- {
- verifySame((FacetDecorator) truth, (FacetDecorator) check);
- }
- else if (truth instanceof ActionListenerDecorator)
- {
- verifySame((ActionListenerDecorator) truth,
- (ActionListenerDecorator) check);
- }
- else if (truth instanceof ValidatorDecorator)
- {
- verifySame((ValidatorDecorator) truth, (ValidatorDecorator) check);
- }
- else if (truth instanceof ConverterDecorator)
- {
- verifySame((ConverterDecorator) truth, (ConverterDecorator) check);
- }
- else if (truth instanceof ComponentDecorator)
- {
- verifySame((ComponentDecorator) truth, (ComponentDecorator) check);
- }
- }
-
- private static void verifySame(final ComponentDecorator truth,
- final ComponentDecorator check)
- {
- verifySame(truth.getDecorates(), check.getDecorates());
- }
-
- private static void verifySame(final ActionListenerDecorator truth,
- final ActionListenerDecorator check)
- {
- verifySame((ComponentDecorator) truth, (ComponentDecorator) check);
- }
-
- private static void verifySame(final FacetDecorator truth,
- final FacetDecorator check)
- {
- verifySame((ComponentDecorator) truth, (ComponentDecorator) check);
- assertEquals(truth.getName(), check.getName());
- }
-
- private static void verifySame(final ConverterDecorator truth,
- final ConverterDecorator check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ComponentDecorator) truth, (ComponentDecorator) check);
- }
-
- public static void verifySame(final ConverterTypeInfo truth,
- final ConverterTypeInfo check)
- {
- if (truth == check)
- {
- return;
- }
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getClassName(), check.getClassName());
- assertEquals(truth.getConverterId(), check.getConverterId());
- }
-
- private static void verifySame(final ValidatorDecorator truth,
- final ValidatorDecorator check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((ComponentDecorator) truth, (ComponentDecorator) check);
- }
-
- public static void verifySame(final ValidatorTypeInfo truth,
- final ValidatorTypeInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getClassName(), check.getClassName());
- assertEquals(truth.getValidatorId(), check.getValidatorId());
- }
-
- public static ComponentTypeInfo createComponentTypeInfo()
- {
- return new ComponentTypeInfo("org.eclipse.jst.jsf.test",
- "org.eclipse.jst.jsf.test.ComponentClass",
- "org.eclipse.jst.jsf.test.ComponentFamily",
- "org.eclipse.jst.jsf.test.RenderFamily");
- }
-
- public static void verifySame(final IValueHolderInfo truth,
- final IValueHolderInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getLocalValue(), check.getLocalValue());
- assertEquals(truth.getValue(), check.getValue());
- verifySame(truth.getConverter(), check.getConverter());
- }
-
- public static void verifySame(final IEditableValueHolderInfo truth,
- final IEditableValueHolderInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- verifySame((IValueHolderInfo) truth, (IValueHolderInfo) check);
-
- assertEquals(truth.isImmediate(), truth.isImmediate());
- assertEquals(truth.isLocalSetValue(), truth.isLocalSetValue());
- assertEquals(truth.isRequired(), truth.isRequired());
- assertEquals(truth.isValid(), truth.isValid());
-
- assertEquals(truth.getSubmittedValue(), check.getSubmittedValue());
- assertEquals(truth.getValidator(), check.getValidator());
- assertEquals(truth.getValueChangeListener(), truth
- .getValueChangeListener());
-
- // check validators
- assertEquals(truth.getValidators().size(), check.getValidators().size());
-
- for (int i = 0; i < check.getValidators().size(); i++)
- {
- verifySame((Decorator) truth.getValidators().get(i),
- (Decorator) check.getValidators().get(i));
- }
-
- for (int i = 0; i < check.getValueChangeListeners().size(); i++)
- {
- verifySame((Decorator) truth.getValidators().get(i),
- (Decorator) check.getValidators().get(i));
- }
- }
-
- public static void verifySame(final IActionSourceInfo truth,
- final IActionSourceInfo check)
- {
- if (truth == check)
- {
- return;
- }
-
- // the only way having truth or check null is valid is if
- // the are both null, which we check above
- assertNotNull(truth);
- assertNotNull(check);
-
- assertEquals(truth.getAction(), check.getAction());
- assertEquals(truth.getActionListener(), check.getActionListener());
- assertEquals(truth.isImmediate(), check.isImmediate());
-
- if (truth instanceof IActionSource2Info)
- {
- assertTrue(check instanceof IActionSource2Info);
- assertEquals(((IActionSource2Info) truth).getActionExpression(),
- ((IActionSource2Info) check).getActionExpression());
- }
-
- // check action listener
- assertEquals(truth.getActionListeners().size(), check
- .getActionListeners().size());
-
- for (int i = 0; i < check.getActionListeners().size(); i++)
- {
- verifySame((Decorator) truth.getActionListeners().get(i),
- (Decorator) check.getActionListeners().get(i));
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/TestViewObject.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/TestViewObject.java
deleted file mode 100644
index 74a8197..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/TestViewObject.java
+++ /dev/null
@@ -1,572 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model;
-
-import java.io.Serializable;
-import java.util.AbstractList;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.ViewObject;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.Decorator;
-
-public class TestViewObject extends TestCase
-{
-
- private MockAdapter _adapter1;
- private MockAdapter _adapter2;
- private MockDecorator _decorator1;
- private MockDecorator _decorator2;
- private ViewObject _viewObject1;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _decorator1 = new MockDecorator();
- _decorator2 = new MockDecorator();
- _adapter1 = new MockAdapter();
- _adapter2 = new MockAdapter();
- _viewObject1 = new MockViewObject();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testGetAllDecorators()
- {
- // we have not added anything so we should get an empty
- // immutable list
- List<?> allDecorators = _viewObject1.getAllDecorators();
- assertSizeAndImmutable(allDecorators, 0);
-
- // add the decorators; use different keys
- _viewObject1.addDecorator(_decorator1, Decorator.class);
- _viewObject1.addDecorator(_decorator2, String.class);
-
- allDecorators = _viewObject1.getAllDecorators();
-
- assertSizeAndImmutable(allDecorators, 2);
-
- assertTrue(allDecorators.contains(_decorator1));
- assertTrue(allDecorators.contains(_decorator2));
- }
-
- public void testGetAllAdapters()
- {
- // we have not added anything so we should get an empty
- // immutable list
- Map<?, ?> allAdapters = _viewObject1.getAllAdapters();
- assertSizeAndImmutable(allAdapters, 0);
-
- // add the decorators; use different keys
- // _viewObject1.addAdapter(Object.class, _adapter1);
- _viewObject1.addAdapter(MockAdapter.class, _adapter2);
-
- allAdapters = _viewObject1.getAllAdapters();
-
- assertSizeAndImmutable(allAdapters, 1);
-
- //assertEquals(_adapter1, allAdapters.get(Object.class));
- assertEquals(_adapter2, allAdapters.get(MockAdapter.class));
- }
-
- @SuppressWarnings("unchecked")
- public void testGetDecorators()
- {
- // haven't added anything yet, so all should be empty immutable
- assertSizeAndImmutable(_viewObject1.getDecorators(Decorator.class), 0);
- assertSizeAndImmutable(_viewObject1.getDecorators(MockDecorator.class),
- 0);
- assertSizeAndImmutable(_viewObject1.getDecorators(String.class), 0);
-
- // just add using self class key
- _viewObject1.addDecorator(_decorator1);
- _viewObject1.addDecorator(_decorator2);
-
- List<Decorator> decorators = _viewObject1.getDecorators(_decorator1.getClass());
- assertSizeAndImmutable(decorators, 2);
- assertTrue(decorators.contains(_decorator1));
- assertTrue(decorators.contains(_decorator2));
-
- // wrong key
- assertFalse(_viewObject1.removeDecorator(_decorator1, Decorator.class));
- assertSizeAndImmutable(decorators, 2);
-
- // right keys
- assertTrue(_viewObject1.removeDecorator(_decorator1, _decorator1
- .getClass()));
- assertTrue(_viewObject1.removeDecorator(_decorator2, _decorator1
- .getClass()));
- assertSizeAndImmutable(decorators, 0);
-
- // reset view Object and do the same with direct class keys
- _viewObject1 = new MockViewObject();
-
- _viewObject1.addDecorator(_decorator1, MockDecorator.class);
- _viewObject1.addDecorator(_decorator2, MockDecorator.class);
-
- decorators = _viewObject1.getDecorators(_decorator1.getClass());
- assertSizeAndImmutable(decorators, 2);
- assertTrue(decorators.contains(_decorator1));
- assertTrue(decorators.contains(_decorator2));
-
- assertTrue(_viewObject1.removeDecorator(_decorator1, _decorator1
- .getClass()));
- assertTrue(_viewObject1.removeDecorator(_decorator2, _decorator1
- .getClass()));
- assertSizeAndImmutable(decorators, 0);
-
- // store under different keys
- _viewObject1 = new MockViewObject();
-
- _viewObject1.addDecorator(_decorator1, Decorator.class);
- _viewObject1.addDecorator(_decorator2);
-
- // should only be on since _decorator2 was added under its own class
- decorators = _viewObject1.getDecorators(Decorator.class);
- assertSizeAndImmutable(decorators, 1);
- assertTrue(decorators.contains(_decorator1));
-
- decorators = _viewObject1.getDecorators(MockDecorator.class);
- assertSizeAndImmutable(decorators, 1);
- assertTrue(decorators.contains(_decorator2));
- }
-
- public void testNullDecoratorArgs()
- {
- boolean isOk = false;
- // try to add a null decorator
- try
- {
- _viewObject1.addDecorator(null);
- }
- catch (final IllegalArgumentException iae)
- {
- isOk = true;
- }
- assertTrue(isOk);
- assertTrue(_viewObject1.getDecorators(null).isEmpty());
-
- // try to add a decorator with a null class
- isOk = false;
- try
- {
- _viewObject1.addDecorator(_decorator1, null);
- }
- catch (final IllegalArgumentException iae)
- {
- isOk = true;
- }
- assertTrue(isOk);
- assertTrue(_viewObject1.getDecorators(null).isEmpty());
-
- // try to remove null decorator
- isOk = false;
- try
- {
- _viewObject1.removeDecorator(null, Decorator.class);
- }
- catch (final IllegalArgumentException iae)
- {
- isOk = true;
- }
- assertTrue(isOk);
- // try to remove decorator with null key
- isOk = false;
- try
- {
- _viewObject1.removeDecorator(_decorator1, null);
- }
- catch (final IllegalArgumentException iae)
- {
- isOk = true;
- }
- assertTrue(isOk);
- }
-
- public void testGetAdapter()
- {
- // should have no adapters
- assertNull(_viewObject1.getAdapter(MockAdapter.class));
- assertNull(_viewObject1.getAdapter(String.class));
- assertNull(_viewObject1.getAdapter(MockDecorator.class));
-
- // now add the adapters under the same keys
- _viewObject1.addAdapter(MockAdapter.class, _adapter1);
- assertEquals(_adapter1, _viewObject1.getAdapter(MockAdapter.class));
- _viewObject1.addAdapter(MockAdapter.class, _adapter2);
- assertEquals(_adapter2, _viewObject1.getAdapter(MockAdapter.class));
-
- // now try class and sub-class
- _viewObject1.addAdapter(MockDecorator.class, _decorator1);
- assertEquals(_decorator1, _viewObject1.getAdapter(MockDecorator.class));
- assertNull(_viewObject1.getAdapter(Decorator.class));
- assertEquals(_decorator1, _viewObject1
- .removeAdapter(MockDecorator.class));
- // ok to add as a decorator because MockDecorator -> Decorator
- _viewObject1.addAdapter(Decorator.class, _decorator1);
- assertEquals(_decorator1, _viewObject1.getAdapter(Decorator.class));
- // this was removed above and should have been readded
- assertNull(_viewObject1.getAdapter(MockDecorator.class));
- assertEquals(_decorator1, _viewObject1.removeAdapter(Decorator.class));
-
- // test assertion conditions
- boolean assertionOk = false;
- try
- {
- // try to use a null class
- _viewObject1.addAdapter(null, _decorator1);
- }
- catch (final IllegalArgumentException iae)
- {
- assertionOk = true;
- }
-
- assertTrue(assertionOk);
- assertNull(_viewObject1.getAdapter(null));
-
- assertionOk = false;
- // try to use null object
- try
- {
- _viewObject1.addAdapter(Decorator.class, null);
- }
- catch (final IllegalArgumentException iae)
- {
- assertionOk = true;
- }
- assertTrue(assertionOk);
-
- assertionOk = false;
- // try adding a class that is not an instance of the interface key
- try
- {
- _viewObject1.addAdapter(Decorator.class, _adapter1);
- }
- catch (final IllegalArgumentException iae)
- {
- assertionOk = true;
- }
-
- assertTrue(assertionOk);
- }
-
- public void testDefaultAdapterBehaviour()
- {
- // by default, the view object will return its "this" object
- // if it is an instance of a requested class, even if it has
- // this in its adapter list.
- final ViewObject viewObject1 = new MockViewObject();
- final ViewObject listViewObject1 = new MockViewObjectImplementsList();
-
- final List<?> listAdapter = new ArrayList<Object>();
-
- // with the non-list, get adapter will return something only if it is
- // added
- assertNull(viewObject1.getAdapter(List.class));
- viewObject1.addAdapter(List.class, listAdapter);
- assertEquals(listAdapter, viewObject1.getAdapter(List.class));
- assertEquals(listAdapter, viewObject1.removeAdapter(List.class));
- assertNull(viewObject1.getAdapter(List.class));
-
- // however, with the viewObject that is a list...
- assertEquals(listViewObject1, listViewObject1.getAdapter(List.class));
-
- boolean caughtException = false;
- // can't add an interface to an object already of that type
- try
- {
- listViewObject1.addAdapter(List.class, listAdapter);
- }
- catch (final IllegalArgumentException iae)
- {
- caughtException = true;
- }
-
- assertTrue(caughtException);
- // should be unaffected
- assertEquals(listViewObject1, listViewObject1.getAdapter(List.class));
- }
-
- public void testGetDecoratorMap()
- {
- // check contract: getDecoratorMap should never return null
- // and should always return the same map
- final Map<?, ?> map = ((MockViewObject) _viewObject1).getDecoratorMap();
- assertNotNull(map);
- assertEquals(map, ((MockViewObject) _viewObject1).getDecoratorMap());
- assertEquals(map, ((MockViewObject) _viewObject1).getDecoratorMap());
- assertEquals(map, ((MockViewObject) _viewObject1).getDecoratorMap());
- }
-
- public void testGetAdapterMap()
- {
- // check contract: getAdapterMap should never return null
- // and should always return the same map
- final Map<?, ?> map = ((MockViewObject) _viewObject1).getAdapterMap();
- assertNotNull(map);
- assertEquals(map, ((MockViewObject) _viewObject1).getAdapterMap());
- assertEquals(map, ((MockViewObject) _viewObject1).getAdapterMap());
- assertEquals(map, ((MockViewObject) _viewObject1).getAdapterMap());
-
- }
-
- public void testSerializable() throws Exception
- {
- _viewObject1.addDecorator(_decorator1);
- _viewObject1.addDecorator(_decorator2, Decorator.class);
- _viewObject1.addAdapter(MockAdapter.class, _adapter1);
-
- final ViewObject deserialized = RuntimeTestUtil
- .serializeDeserialize(_viewObject1);
-
- RuntimeTestUtil.verifySame(_viewObject1, deserialized);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- private void assertSizeAndImmutable(final List list, final int size)
- {
- assertEquals(size, list.size());
- // in the default case, the list should throw an exception
- // on modification
- boolean isListImmutable = false;
- try
- {
- list.add(new MockDecorator());
- }
- catch (final Exception e)
- {
- // success
- isListImmutable = true;
- }
- assertTrue(isListImmutable);
- // since immutable, should not have changed
- assertEquals(size, list.size());
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- private void assertSizeAndImmutable(final Map map, final int size)
- {
- assertEquals(size, map.size());
- // in the default case, the list should throw an exception
- // on modification
- boolean isMapImmutable = false;
- try
- {
- map.put(new Object(), new MockDecorator());
- }
- catch (final Exception e)
- {
- // success
- isMapImmutable = true;
- }
- assertTrue(isMapImmutable);
- // since immutable, should not have changed
- assertEquals(size, map.size());
- }
-
- public static class MockViewObject extends ViewObject
- {
- /**
- *
- */
- private static final long serialVersionUID = 5839704536769825171L;
-
- @Override
- public Map<?,?> getAdapterMap()
- {
- return super.getAdapterMap();
- }
-
- @Override
- public Map<?, ?> getDecoratorMap()
- {
- return super.getDecoratorMap();
- }
- }
-
- public static class MockViewObjectImplementsList extends ViewObject
- implements List<Object>
- {
- /**
- *
- */
- private static final long serialVersionUID = -6379202834709723049L;
-
- public boolean add(final Object o)
- {
- return false;
- }
-
- public void add(final int index, final Object element)
- {
-
- }
-
- public boolean addAll(final Collection<?> c)
- {
- return false;
- }
-
- public boolean addAll(final int index, final Collection<?> c)
- {
- return false;
- }
-
- public void clear()
- {
-
- }
-
- public boolean contains(final Object o)
- {
- return false;
- }
-
- public boolean containsAll(final Collection<?> c)
- {
- return false;
- }
-
- public Object get(final int index)
- {
- return null;
- }
-
- public int indexOf(final Object o)
- {
- return 0;
- }
-
- public boolean isEmpty()
- {
- return false;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public Iterator iterator()
- {
- return null;
- }
-
- public int lastIndexOf(final Object o)
- {
- return 0;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public ListIterator listIterator()
- {
- return null;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public ListIterator listIterator(final int index)
- {
- return null;
- }
-
- public boolean remove(final Object o)
- {
- return false;
- }
-
- public Object remove(final int index)
- {
- return null;
- }
-
- public boolean removeAll(final Collection<?> c)
- {
- return false;
- }
-
- public boolean retainAll(final Collection<?> c)
- {
- return false;
- }
-
- public Object set(final int index, final Object element)
- {
- return null;
- }
-
- public int size()
- {
- return 0;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public List subList(final int fromIndex, final int toIndex)
- {
- return null;
- }
-
- public Object[] toArray()
- {
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Object[] toArray(final Object[] a)
- {
- return null;
- }
-
- }
-
- public static class MockDecorator extends Decorator
- {
-
- /**
- *
- */
- private static final long serialVersionUID = 456684865942628607L;
-
- }
-
- public static class MockAdapter implements Serializable
- {
-
- /**
- *
- */
- private static final long serialVersionUID = 424297135847238931L;
- }
-
- public static class MockAdapterImplementsList extends AbstractList<Object>
- {
-
- @Override
- public Object get(final int index)
- {
- return null;
- }
-
- @Override
- public int size()
- {
- return 0;
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/bean/TestDataModelInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/bean/TestDataModelInfo.java
deleted file mode 100644
index 6ceaf0b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/bean/TestDataModelInfo.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.bean;
-
-import java.io.Serializable;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.bean.DataModelInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestDataModelInfo extends TestCase {
-
- private DataModelInfo _dataModelInfo;
- private Object _rowDataObject;
- private Object _wrappedDataObject;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- _rowDataObject = new Object();
- _wrappedDataObject = new Object();
- _dataModelInfo = new DataModelInfo(true, -1, _rowDataObject, -1,
- _wrappedDataObject);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testIsRowAvailable() {
- assertEquals(true, _dataModelInfo.isRowAvailable());
- }
-
- public void testGetRowCount() {
- assertEquals(-1, _dataModelInfo.getRowCount());
- }
-
- public void testGetRowData() {
- assertEquals(_rowDataObject, _dataModelInfo.getRowData());
- }
-
- public void testGetRowIndex() {
- assertEquals(-1, _dataModelInfo.getRowIndex());
- }
-
- public void testGetWrappedData() {
- assertEquals(_wrappedDataObject, _dataModelInfo.getWrappedData());
- }
-
- public void testSerializable() throws Exception {
- DataModelInfo deserialized = RuntimeTestUtil
- .serializeDeserialize(_dataModelInfo);
- RuntimeTestUtil.verifySame(_dataModelInfo, deserialized);
-
- // if the object is not serializable, then the deserialize will be null
- if (_dataModelInfo.getRowData() instanceof Serializable)
- {
- assertEquals(_dataModelInfo.getRowData(), deserialized.getRowData());
- }
- else
- {
- assertNull(deserialized.getRowData());
- }
-
- // if the object is not serializable, then the deserialize will be null
- if (_dataModelInfo.getWrappedData() instanceof Serializable)
- {
- assertEquals(_dataModelInfo.getWrappedData()
- , deserialized.getWrappedData());
- }
- else
- {
- assertNull(deserialized.getWrappedData());
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/behavioural/TestActionSource2Info.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/behavioural/TestActionSource2Info.java
deleted file mode 100644
index 530e240..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/behavioural/TestActionSource2Info.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.behavioural;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ActionSourceInfo2;
-
-import junit.framework.TestCase;
-
-public class TestActionSource2Info extends TestCase {
-
- private ActionSourceInfo2 _actionSource2;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- _actionSource2 = new ActionSourceInfo2("com.Action",
- "com.ActionListener", true, "com.ActionExpression");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetActionExpression() {
- assertEquals("com.ActionExpression", _actionSource2.getActionExpression());
- }
-
- public void testAddActionListener() {
-
- }
-
- public void testGetAction() {
- assertEquals("com.Action", _actionSource2.getAction());
- }
-
- public void testGetActionListener() {
- assertEquals("com.ActionListener", _actionSource2.getActionListener());
- }
-
- public void testGetActionListeners() {
- //fail("Not yet implemented");
- }
-
- public void testIsImmediate() {
- assertTrue(_actionSource2.isImmediate());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/behavioural/TestValueHolderInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/behavioural/TestValueHolderInfo.java
deleted file mode 100644
index 2d265d8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/behavioural/TestValueHolderInfo.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.behavioural;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestValueHolderInfo extends TestCase {
-
- private ComponentInfo _componentInfo;
- private ValueHolderInfo _valueHolder;
- private ConverterTypeInfo _converterTypeInfo;
- private ConverterDecorator _converterDecorator;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _converterTypeInfo = ConverterTypeInfo.UNKNOWN;
- _converterDecorator = new ConverterDecorator(_componentInfo, _converterTypeInfo);
- _componentInfo = ComponentFactory.createComponentInfo("id", null, RuntimeTestUtil
- .createComponentTypeInfo(), true);
- _valueHolder = new ValueHolderInfo(_converterDecorator, "value", "value");
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetValue() {
- assertEquals("value", _valueHolder.getValue());
- }
-
- public void testGetLocalValue() {
- assertEquals("value", _valueHolder.getLocalValue());
- }
-
- public void testGetConverter() {
- RuntimeTestUtil.verifySame(_converterDecorator, _valueHolder.getConverter());
- RuntimeTestUtil.verifySame(_converterTypeInfo, _valueHolder.getConverter().getTypeInfo());
- }
-
- public void testSerializable() throws Exception
- {
- final ValueHolderInfo deserialized =
- RuntimeTestUtil.serializeDeserialize(_valueHolder);
-
- RuntimeTestUtil.verifySame(_valueHolder, deserialized);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/ComponentTestCase.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/ComponentTestCase.java
deleted file mode 100644
index ce8c87d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/ComponentTestCase.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import junit.framework.TestCase;
-
-abstract class ComponentTestCase extends TestCase
-{
- public abstract void testSerializable() throws Exception;
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestComponentInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestComponentInfo.java
deleted file mode 100644
index cf01e70..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestComponentInfo.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.FacetDecorator;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestComponentInfo extends ComponentTestCase {
-
- protected ComponentTypeInfo _componentTypeInfo;
- private ComponentInfo _componentInfo;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _componentTypeInfo = RuntimeTestUtil.createComponentTypeInfo();
-
- _componentInfo = ComponentFactory.createComponentInfo("id", null,
- _componentTypeInfo, true);
- }
-
- public void testToString()
- {
- // just call it for now to get coverage. toString should only
- // be used for diagnostics and dumps on these objects anyway...
- System.out.println(getComponentInfo().toString());
- }
-
- /**
- * @return the main test component info. Override in child tests.
- */
- protected ComponentInfo getComponentInfo() {
- return _componentInfo;
- }
-
- public void testGetId() {
- assertEquals("id", getComponentInfo().getId());
- }
-
- public void testGetComponentTypeInfo() {
- assertEquals(_componentTypeInfo, getComponentInfo()
- .getComponentTypeInfo());
- }
-
- public void testIsRendered() {
- assertTrue(getComponentInfo().isRendered());
- }
-
- public void testChildren() {
- assertTrue(getComponentInfo().getChildren().isEmpty());
- final ComponentInfo componentInfo = ComponentFactory
- .createComponentInfo("id2", getComponentInfo(),
- _componentTypeInfo, true);
- getComponentInfo().addChild(componentInfo);
- assertEquals(1, getComponentInfo().getChildren().size());
- RuntimeTestUtil.verifySame(componentInfo,
- (ComponentInfo) getComponentInfo().getChildren().get(0));
- }
-
- public void testFacet() {
- assertTrue(getComponentInfo().getChildren().isEmpty());
- final ComponentInfo componentInfo = ComponentFactory
- .createComponentInfo("id2", getComponentInfo(),
- _componentTypeInfo, true);
- getComponentInfo().addFacet("header", componentInfo);
- assertEquals(1, getComponentInfo().getChildren().size());
- RuntimeTestUtil.verifySame(componentInfo,
- (ComponentInfo) getComponentInfo().getChildren().get(0));
- assertEquals("header", getComponentInfo().getFacetName(componentInfo));
- assertEquals(componentInfo, getComponentInfo().getFacet("header"));
-
- final List<?> facetDecorators = getComponentInfo().getDecorators(
- ComponentFactory.FACET);
- boolean hasFacet = false;
- for (final Iterator<?> it = facetDecorators.iterator(); it.hasNext();) {
- final FacetDecorator decorator = (FacetDecorator) it.next();
-
- if ("header".equals(decorator.getName())) {
- RuntimeTestUtil.verifySame(componentInfo, decorator
- .getDecorates());
- hasFacet = true;
- break;
- }
- }
- assertTrue(hasFacet);
-
- final List<?> useGetFacets = getComponentInfo().getFacets();
- assertEquals(facetDecorators, useGetFacets);
- }
-
- public void testGetParent() {
- final ComponentInfo componentInfo = ComponentFactory
- .createComponentInfo("id2", getComponentInfo(),
- _componentTypeInfo, true);
- assertEquals(getComponentInfo(), componentInfo.getParent());
- }
-
- @Override
- public void testSerializable() throws Exception {
- final ComponentInfo child = ComponentFactory.createComponentInfo("id2",
- getComponentInfo(), _componentTypeInfo, true);
- getComponentInfo().addChild(child);
-
- final ComponentInfo facet = ComponentFactory.createComponentInfo("id3",
- getComponentInfo(), _componentTypeInfo, true);
- getComponentInfo().addFacet("header", facet);
-
- final ComponentInfo deserialized = RuntimeTestUtil
- .serializeDeserialize(getComponentInfo());
-
- RuntimeTestUtil.verifySame(getComponentInfo(), deserialized);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestComponentTypeInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestComponentTypeInfo.java
deleted file mode 100644
index 9495e04..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestComponentTypeInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-
-import junit.framework.TestCase;
-
-public class TestComponentTypeInfo extends TestCase {
-
- private ComponentTypeInfo _componentTypeInfo;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- _componentTypeInfo = new ComponentTypeInfo("blah", "Blah", "Blah", "renderBlah");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testToString()
- {
- // for now, just test toString to get coverage. We get enough
- // coverage from the component test classes currently.
- // later we will need to look for more coverage in this classe
- System.out.println(_componentTypeInfo.toString());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUICommandInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUICommandInfo.java
deleted file mode 100644
index b801cee..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUICommandInfo.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ActionSourceInfo2;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UICommandInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ActionListenerDecorator;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestUICommandInfo extends TestComponentInfo {
- private ActionListenerDecorator _actionListener;
- private ActionSourceInfo2 _actionSourceInfo;
- private ActionSourceInfo2 _actionSourceInfo2;
- private UICommandInfo _uiCommand1;
- private UICommandInfo _uiCommand_NoActionSourceAtConstruction;
- private UICommandInfo _uiCommandActionListenerAtConstruction;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- _actionSourceInfo = new ActionSourceInfo2("bean.Action",
- "com.ActionListener", true, "bean.Action");
- _uiCommand1 = ComponentFactory.createUICommandInfo("id", null,
- _componentTypeInfo, _actionSourceInfo, true);
-
- _uiCommand_NoActionSourceAtConstruction = ComponentFactory
- .createUICommandInfo("id2", null, _componentTypeInfo, null,
- false);
-
- _actionSourceInfo2 = new ActionSourceInfo2("bean.Action",
- "com.ActionListener", false, "bean.Action");
- _actionListener = new ActionListenerDecorator(null);
- _actionSourceInfo2.addActionListener(_actionListener);
- _uiCommandActionListenerAtConstruction = ComponentFactory
- .createUICommandInfo("id3", null, _componentTypeInfo,
- _actionSourceInfo2, true);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetActionExpression() {
- assertEquals("bean.Action", _uiCommand1.getActionExpression());
- assertNull(_uiCommand_NoActionSourceAtConstruction
- .getActionExpression());
- }
-
- public void testGetAction() {
- assertEquals("bean.Action", _uiCommand1.getAction());
- assertNull(_uiCommand_NoActionSourceAtConstruction.getAction());
- }
-
- public void testGetActionListener() {
- assertEquals("com.ActionListener", _uiCommand1.getActionListener());
- assertNull(_uiCommand_NoActionSourceAtConstruction.getActionListener());
- }
-
- public void testImplicitAdapter() {
- RuntimeTestUtil.verifyImplicitAdapter(getComponentInfo(),
- ComponentFactory.ACTION_SOURCE, _actionSourceInfo);
- RuntimeTestUtil.verifyImplicitAdapter(getComponentInfo(),
- ComponentFactory.ACTION_SOURCE2, _actionSourceInfo);
- }
-
- public void testGetActionListeners() {
- assertTrue(_uiCommandActionListenerAtConstruction.getActionListeners()
- .contains(_actionListener));
- assertTrue(_uiCommandActionListenerAtConstruction.getDecorators(
- ComponentFactory.ACTION_LISTENER).contains(
- _actionListener));
-
- final ActionListenerDecorator actionListener =
- new ActionListenerDecorator(_uiCommand1);
- _uiCommand1.addActionListener(actionListener);
-
- assertEquals(1, _uiCommand1.getActionListeners().size());
- assertTrue(_uiCommand1.getActionListeners().contains(
- actionListener));
- assertTrue(_uiCommand1.getDecorators(
- ComponentFactory.ACTION_LISTENER).contains(
- actionListener));
- }
-
- public void testIsImmediate() {
- assertTrue(_uiCommand1.isImmediate());
- }
-
- @Override
- public void testSerializable() throws Exception {
- UICommandInfo commandInfo = RuntimeTestUtil
- .serializeDeserialize(_uiCommand1);
- RuntimeTestUtil.verifySame(_uiCommand1, commandInfo);
- }
-
- @Override
- protected ComponentInfo getComponentInfo() {
- return _uiCommand1;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIDataInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIDataInfo.java
deleted file mode 100644
index e6ffc88..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIDataInfo.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import java.io.Serializable;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.bean.DataModelInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.INamingContainerInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIDataInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestUIDataInfo extends TestComponentInfo {
-
- private UIDataInfo _uiData;
- private UIDataInfo _uiDataWithFacetsAtConstruction;
- private DataModelInfo _dataModel;
- private Object _rowData;
- private Object _value;
- private ComponentInfo _header;
- private ComponentInfo _footer;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _dataModel = new DataModelInfo(true, -1, null, 1, null);
- _rowData = new Object();
- _value = new Object();
-
- _uiData = ComponentFactory.createUIDataInfo("id", null,
- _componentTypeInfo, true, _dataModel, 0, null, null, 1, true,
- _rowData, 2, 3, _value, "row");
-
- _header = ComponentFactory.createComponentInfo("header", null,
- _componentTypeInfo, true);
- _footer = ComponentFactory.createComponentInfo("footer", null,
- _componentTypeInfo, true);
- _uiDataWithFacetsAtConstruction = ComponentFactory.createUIDataInfo(
- "id3", null, _componentTypeInfo, true, _dataModel, 3, _footer,
- _header, 2, true, _rowData, 1, 0, _value, "row");
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testFacets()
- {
- // nothing set on construction
- assertNull(_uiData.getFooter());
- assertNull(_uiData.getFacet(UIDataInfo.FACET_NAME_FOOTER));
- assertNull(_uiData.getHeader());
- assertNull(_uiData.getFacet(UIDataInfo.FACET_NAME_HEADER));
- _uiData.addFacet(UIDataInfo.FACET_NAME_FOOTER, _footer);
- _uiData.addFacet(UIDataInfo.FACET_NAME_HEADER, _header);
-
- assertEquals(_footer, _uiData.getFooter());
- assertEquals(_header, _uiData.getHeader());
-
- // set on construction
- assertEquals(_footer, _uiDataWithFacetsAtConstruction.getFooter());
- assertEquals(_header, _uiDataWithFacetsAtConstruction.getHeader());
- }
-
- public void testGetDataModel() {
- RuntimeTestUtil.verifySame(_dataModel, _uiData.getDataModel());
- }
-
- public void testGetFirst() {
- assertEquals(0, _uiData.getFirst());
- }
-
- public void testGetRowCount() {
- assertEquals(1, _uiData.getRowCount());
- }
-
- public void testIsRowAvailable() {
- assertTrue(_uiData.isRowAvailable());
- }
-
- public void testGetRowData() {
- assertEquals(_rowData, _uiData.getRowData());
- }
-
- public void testGetRowIndex() {
- assertEquals(2, _uiData.getRowIndex());
- }
-
- public void testGetRows() {
- assertEquals(3, _uiData.getRows());
- }
-
- public void testGetValue() {
- assertEquals(_value, _uiData.getValue());
- }
-
- public void testGetVar() {
- assertEquals("row", _uiData.getVar());
- }
-
- public void testImplicitAdapter() {
- RuntimeTestUtil.verifyImplicitAdapter(getComponentInfo(),
- ComponentFactory.NAMING_CONTAINER, new INamingContainerInfo() {
-
- /**
- *
- */
- private static final long serialVersionUID = -4727106447103788829L;
- });
- }
-
- @Override
- public ComponentInfo getComponentInfo() {
- return _uiData;
- }
-
- @Override
- public void testSerializable() throws Exception {
- final UIDataInfo deserialized = RuntimeTestUtil
- .serializeDeserialize(_uiData);
-
- RuntimeTestUtil.verifySame(_uiData, deserialized);
-
- // the Objects may not be serializable
-
- // if the object is not serializable, then the deserialize will be null
- if (_uiData.getRowData() instanceof Serializable) {
- assertEquals(_uiData.getRowData(), deserialized.getRowData());
- } else {
- assertNull(deserialized.getRowData());
- }
-
- // if the object is not serializable, then the deserialize will be null
- if (_uiData.getValue() instanceof Serializable) {
- assertEquals(_uiData.getValue(), deserialized.getValue());
- } else {
- assertNull(deserialized.getValue());
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIFormInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIFormInfo.java
deleted file mode 100644
index 6315267..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIFormInfo.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.INamingContainerInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIFormInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestUIFormInfo extends TestComponentInfo {
-
- private UIFormInfo _uiForm1;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _uiForm1 = ComponentFactory.createUIFormInfo
- ("id", null, _componentTypeInfo, true, true, true);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testIsPrependId() {
- assertTrue(_uiForm1.isPrependId());
- }
-
- public void testIsSubmitted() {
- assertTrue(_uiForm1.isSubmitted());
- }
-
- @Override
- protected ComponentInfo getComponentInfo() {
- return _uiForm1;
- }
-
- public void testImplicitAdapter() {
- RuntimeTestUtil.verifyImplicitAdapter(getComponentInfo(),
- ComponentFactory.NAMING_CONTAINER, new INamingContainerInfo() {
-
- /**
- *
- */
- private static final long serialVersionUID = -3927882952151032590L;});
- }
-
- @Override
- public void testSerializable() throws Exception {
- final UIFormInfo uiForm = RuntimeTestUtil.serializeDeserialize(_uiForm1);
- RuntimeTestUtil.verifySame(_uiForm1, uiForm);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIInputInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIInputInfo.java
deleted file mode 100644
index fda91ff..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIInputInfo.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.EditableValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIInputInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValueChangeListenerDecorator;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestUIInputInfo extends TestUIOutputInfo {
-
- private UIInputInfo _uiComponentInfo1;
- private UIInputInfo _uiComponentInfo_NoValueHolderAtConstruction;
- private UIInputInfo _uiInput_ValidatorAndListenerAtConstruction;
- private EditableValueHolderInfo _editableValueHolder;
- private EditableValueHolderInfo _editableValueHolder2;
- private ValidatorDecorator _validator;
- private ValueChangeListenerDecorator _valueChangeListener;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _uiComponentInfo_NoValueHolderAtConstruction = ComponentFactory
- .createUIInputInfo("idNoConstruction", null,
- _componentTypeInfo, null, true);
-
- _editableValueHolder = new EditableValueHolderInfo(null, "value",
- "value", true, true, false, true, null, null, null);
-
- _uiComponentInfo1 = ComponentFactory.createUIInputInfo("id", null,
- _componentTypeInfo, _editableValueHolder, true);
-
- _editableValueHolder2 = new EditableValueHolderInfo(null, "value2",
- "value2", true, true, false, true, null, null, null);
- _validator = new ValidatorDecorator(null, ValidatorTypeInfo.UNKNOWN);
- _editableValueHolder2.addValidator(_validator);
- _valueChangeListener = new ValueChangeListenerDecorator(null);
- _editableValueHolder2.addValueChangeListener(_valueChangeListener);
- _uiInput_ValidatorAndListenerAtConstruction = ComponentFactory
- .createUIInputInfo("id", null, _componentTypeInfo,
- _editableValueHolder2, true);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testIsValid() {
- assertFalse(_uiComponentInfo1.isValid());
- assertTrue(_uiComponentInfo_NoValueHolderAtConstruction.isValid());
- }
-
- public void testIsImmediate() {
- assertTrue(_uiComponentInfo1.isImmediate());
- assertFalse(_uiComponentInfo_NoValueHolderAtConstruction.isImmediate());
- }
-
- public void testIsRequired() {
- assertTrue(_uiComponentInfo1.isRequired());
- assertFalse(_uiComponentInfo_NoValueHolderAtConstruction.isRequired());
- }
-
- public void testIsLocalValueSet() {
- assertTrue(_uiComponentInfo1.isLocalSetValue());
- assertFalse(_uiComponentInfo_NoValueHolderAtConstruction
- .isLocalSetValue());
- }
-
- public void testValidators() {
- assertTrue(_uiInput_ValidatorAndListenerAtConstruction.getValidators()
- .contains(_validator));
- assertTrue(_uiInput_ValidatorAndListenerAtConstruction.getDecorators(
- ComponentFactory.VALIDATOR).contains(_validator));
-
- final ValidatorDecorator validator = new ValidatorDecorator(
- _uiComponentInfo1,ValidatorTypeInfo.UNKNOWN);
- _uiComponentInfo1.addValidator(validator);
-
- assertEquals(1, _uiComponentInfo1.getValidators().size());
- assertTrue(_uiComponentInfo1.getValidators().contains(validator));
- assertTrue(_uiComponentInfo1.getDecorators(ComponentFactory.VALIDATOR)
- .contains(validator));
- }
-
- public void testValueChangeListener() {
- assertTrue(_uiInput_ValidatorAndListenerAtConstruction
- .getValueChangeListeners().contains(_valueChangeListener));
- assertTrue(_uiInput_ValidatorAndListenerAtConstruction.getDecorators(
- ComponentFactory.VALUE_CHANGE_LISTENER).contains(
- _valueChangeListener));
-
- final ValueChangeListenerDecorator valueChangeListener = new ValueChangeListenerDecorator(
- _uiComponentInfo1);
- _uiComponentInfo1.addValueChangeListener(valueChangeListener);
-
- assertEquals(1, _uiComponentInfo1.getValueChangeListeners().size());
- assertTrue(_uiComponentInfo1.getValueChangeListeners().contains(
- valueChangeListener));
- assertTrue(_uiComponentInfo1.getDecorators(
- ComponentFactory.VALUE_CHANGE_LISTENER).contains(
- valueChangeListener));
-
- }
-
- @Override
- protected ComponentInfo getComponentInfo() {
- return _uiComponentInfo1;
- }
-
- @Override
- public void testImplicitAdapter() {
- super.testImplicitAdapter();
- RuntimeTestUtil.verifyImplicitAdapter(_uiComponentInfo1,
- ComponentFactory.EDITABLE_VALUE_HOLDER, _editableValueHolder);
- }
-
- @Override
- public void testSerializable() throws Exception {
- final UIInputInfo deserialized = RuntimeTestUtil
- .serializeDeserialize(_uiComponentInfo1);
-
- RuntimeTestUtil.verifySame(_uiComponentInfo1, deserialized);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIOutputInfo.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIOutputInfo.java
deleted file mode 100644
index 21feb08..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/component/TestUIOutputInfo.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.component;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.behavioural.ValueHolderInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.UIOutputInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterDecorator;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestUIOutputInfo extends TestComponentInfo {
- private UIOutputInfo _uiOutputInfo;
- private UIOutputInfo _uiOutputInfo2;
- private ValueHolderInfo _valueHolder;
- private ValueHolderInfo _valueHolder2;
- private ConverterDecorator _converter;
- private ConverterTypeInfo _converterTypeInfo;
- private UIOutputInfo _uiOutputInfo_NoValueHolderAtConstruction;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _valueHolder = new ValueHolderInfo(null, "value", "value");
- _uiOutputInfo = ComponentFactory.createUIOutputInfo("id", null,
- _componentTypeInfo, _valueHolder, true);
-
- _converterTypeInfo = ConverterTypeInfo.UNKNOWN;
- _converter = new ConverterDecorator(null, _converterTypeInfo);
- _valueHolder2 = new ValueHolderInfo(_converter, "value2", "value2");
- _uiOutputInfo2 = ComponentFactory.createUIOutputInfo("id2", null,
- _componentTypeInfo, _valueHolder2, true);
-
- _uiOutputInfo_NoValueHolderAtConstruction = ComponentFactory
- .createUIOutputInfo("id", null, _componentTypeInfo, null, true);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetConverter() {
- // not converter by setup
- assertNull(_uiOutputInfo.getConverter());
- assertTrue(_uiOutputInfo.getDecorators(ComponentFactory.CONVERTER)
- .isEmpty());
-
- // this one has a converter by construction
- assertEquals(_converter, _uiOutputInfo2.getConverter());
- assertEquals(_converter, _uiOutputInfo2.getDecorators(
- ComponentFactory.CONVERTER).get(0));
- assertEquals(_converterTypeInfo, ((ConverterDecorator)_uiOutputInfo2.getDecorators(
- ComponentFactory.CONVERTER).get(0)).getTypeInfo());
- }
-
- public void testGetLocalValue() {
- assertEquals("value", _uiOutputInfo.getLocalValue());
- assertEquals("value2", _uiOutputInfo2.getLocalValue());
- assertNull(_uiOutputInfo_NoValueHolderAtConstruction.getLocalValue());
- }
-
- public void testGetValue() {
- assertEquals("value", _uiOutputInfo.getValue());
- assertEquals("value2", _uiOutputInfo2.getValue());
- assertNull(_uiOutputInfo_NoValueHolderAtConstruction.getValue());
- }
-
- public void testImplicitAdapter() {
- RuntimeTestUtil.verifyImplicitAdapter(getComponentInfo(),
- ComponentFactory.VALUE_HOLDER, _valueHolder);
- }
-
- @Override
- public void testSerializable() throws Exception {
- final UIOutputInfo deserialized = RuntimeTestUtil
- .serializeDeserialize(_uiOutputInfo);
-
- RuntimeTestUtil.verifySame(_uiOutputInfo, deserialized);
-
- final UIOutputInfo deserialized2 = RuntimeTestUtil
- .serializeDeserialize(_uiOutputInfo2);
- RuntimeTestUtil.verifySame(_uiOutputInfo2, deserialized2);
- }
-
- @Override
- protected ComponentInfo getComponentInfo() {
- return _uiOutputInfo;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/decorator/TestComponentDecorator.java b/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/decorator/TestComponentDecorator.java
deleted file mode 100644
index 0687525..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/src/org/eclipse/jst/jsf/common/runtime/tests/model/decorator/TestComponentDecorator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.runtime.tests.model.decorator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentFactory;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ComponentDecorator;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-
-public class TestComponentDecorator extends TestCase {
-
- private ComponentTypeInfo _componentTypeInfo;
- private ComponentInfo _decorates;
- private ComponentDecorator _componentDecorator;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- _componentTypeInfo = new ComponentTypeInfo("org.eclipse.jst.jsf.test",
- "org.eclipse.jst.jsf.test.ComponentClass",
- "org.eclipse.jst.jsf.test.ComponentFamily",
- "org.eclipse.jst.jsf.test.RenderFamily");
-
- _decorates = ComponentFactory.createComponentInfo("id", null,
- _componentTypeInfo, true);
-
- _componentDecorator = new MockComponentDecorator(_decorates);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetDecorates() {
- assertEquals(_decorates, _componentDecorator.getDecorates());
- }
-
- public void testSerializable() throws Exception {
- final ComponentDecorator deserialized = RuntimeTestUtil
- .serializeDeserialize(_componentDecorator);
-
- RuntimeTestUtil.verifySame(_componentDecorator, deserialized);
- }
-
- public static class MockComponentDecorator extends ComponentDecorator {
- /**
- * serialization id
- */
- private static final long serialVersionUID = 7317971755600134713L;
-
- public MockComponentDecorator(final ComponentInfo decorates) {
- super(decorates);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.cvsignore
deleted file mode 100644
index 5e903f8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-temp.folder
-build.xml
-javaCompiler.jsfcontentassisttests.jar.args
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.project b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.project
deleted file mode 100644
index 2e0c667..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.contentassist.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 0a53ff7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:01:19 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 467e199..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-#Wed Sep 19 11:05:10 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 91707d6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.contentassist.tests
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.contentassist.tests.ContentAssistTestsPlugin
-Bundle-Localization: plugin
-Bundle-ClassPath: jsfcontentassisttests.jar
-Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.junit;bundle-version="3.8.1",
- org.eclipse.jst.jsf.test.util;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.core.tests;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jst.jsf.contentassist.tests;x-internal:=true
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/about.html
deleted file mode 100644
index 04d4782..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/build.properties
deleted file mode 100644
index 6afa53a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- jsfcontentassisttests.jar,\
- test.xml,\
- about.html,\
- testdata/,\
- plugin.properties
-source.jsfcontentassisttests.jar = src/
-output.jsfcontentassisttests.jar = bin/
-jars.compile.order = jsfcontentassisttests.jar
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/plugin.properties
deleted file mode 100644
index ceb11e8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-Bundle-Name.0=JavaServer Faces Tools - Contentassist Tests Plug-in
-Bundle-Vendor.0=Eclipse.org
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/AllTests.java
deleted file mode 100644
index 6bd7405..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/AllTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * All tests suite for content assist
- *
- * @author cbateman
- *
- */
-public class AllTests {
- /**
- * @return the test suite
- */
- public static Test suite()
- {
- final TestSuite suite = new TestSuite("Test for org.eclipse.jst.jsf.contentassist");
- //$JUnit-BEGIN$
- suite.addTestSuite(CompletionPrefixTest.class);
- suite.addTestSuite(Test_bug_149224.class);
- suite.addTestSuite(Test_bug_149743.class);
- suite.addTestSuite(TestIdCompletionStrategy.class);
- suite.addTestSuite(TestFunctionCompletionStrategy.class);
- suite.addTestSuite(TestContentAssistParser.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/BaseTestClass.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/BaseTestClass.java
deleted file mode 100644
index a9b1814..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/BaseTestClass.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistParser;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistStrategy;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper.ContextWrapper;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-
-public class BaseTestClass extends TestCase {
-
-
-
-
- /**
- * Uses the docOffset to find the EL text used to generate the proposals on.
- * @param jspFile
- * @param docOffset
- * @param exprOffset
- * @return the proposals
- * @throws Exception
- */
- protected final List<ICompletionProposal> getProposals(final IFile jspFile,
- final int docOffset, final int exprOffset) throws Exception {
- ContextWrapper wrapper = null;
-
- try {
- wrapper = JSFCoreUtilHelper.getDocumentContext(jspFile, docOffset);
-
- final ITextRegionContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(wrapper.getContext());
-
- assertEquals(DOMJSPRegionContexts.JSP_VBL_CONTENT, resolver.getRegionType());
- final String elText = resolver.getRegionText().trim();
- assertNotNull(elText);
-
- final ContentAssistStrategy strategy = ContentAssistParser
- .getPrefix(exprOffset, elText);
- assertNotNull(strategy);
- return strategy.getProposals(wrapper.getContext());
- } finally {
- if (wrapper != null) {
- wrapper.dispose();
- }
- }
- }
-
- /**
- * This method doesn't use the docOffset to find the EL text.
- *
- * @param jspFile
- * @param exprOffset
- * @param elText
- * @return the proposals at 1-based exprOffset into elText
- * @throws Exception
- */
- protected final List<ICompletionProposal> getProposals(final IFile jspFile,
- final int docOffset, final String elText, final int exprOffset) throws Exception
- {
- ContextWrapper wrapper = null;
-
- try {
- wrapper = JSFCoreUtilHelper.getDocumentContext(jspFile, docOffset);
-
-
- final ContentAssistStrategy strategy = ContentAssistParser
- .getPrefix(exprOffset, elText);
- assertNotNull(strategy);
- return strategy.getProposals(wrapper.getContext());
- } finally {
- if (wrapper != null) {
- wrapper.dispose();
- }
- }
-
- }
-
- protected final void applyAndCheck(final IFile jspFile, final int offset, final ICompletionProposal applyMe, final String expectedResult)
- throws Exception {
- ContextWrapper wrapper = null;
-
- try {
- wrapper = JSFCoreUtilHelper.getDocumentContext(jspFile, offset);
-
- applyMe.apply(JSFCoreUtilHelper.getDocumentContext(jspFile, offset).getContext()
- .getStructuredDocument());
-
- final ITextRegionContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(wrapper.getContext());
-
- final String newELText = resolver.getRegionText();
- assertEquals(expectedResult, newELText);
- } finally {
- if (wrapper != null) {
- wrapper.dispose();
- }
- }
- }
-
- /**
- * @param expected
- * @param proposals
- */
- protected void assertDisplayNamesMatch(final Set<String> expected, final List<ICompletionProposal> proposals) {
- assertEquals(expected.size(), proposals.size());
-
- for (final ICompletionProposal proposal : proposals)
- {
- expected.contains(proposal.getDisplayString());
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/CompletionPrefixTest.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/CompletionPrefixTest.java
deleted file mode 100644
index f596e82..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/CompletionPrefixTest.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistParser;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistStrategy;
-
-/**
- * @author cbateman
- *
- */
-public class CompletionPrefixTest extends TestCase
-{
- /* empty expresion */
- private final static String empty_ = " ";
-
- /* simple value expressions */
- private final static String xxx = "xxx";
- private final static String xxxDot = "xxx.";
- private final static String xxxYYY = "xxx.yyy";
- private final static String xxxYYYZZZ = "xxx.yyy.zzz";
-
- /* value expressions with comparisons */
- private final static String xxxLtYYY = "xxx < yyy";
- private final static String xxxDotYYYLtZZZ = "xxx.yyy < zzz";
-
- /* expressions using the ['yyy'] map syntax */
- private final static String xxxMapYYY = "xxx['yyy']";
- private final static String xxxMapXXXExpr = "xxx[XXX]";
- private final static String xxxMapXXXDotExpr = "xxx[XXX.]";
- private final static String xxxMapXXXDotYYYExpr = "xxx[XXX.YYY]";
- private final static String xxxMapXXXDotYYYDotExpr = "xxx[XXX.YYY.]";
- private final static String xxxMapXXXDotYYYDotZZZExpr = "xxx[XXX.YYY.ZZZ]";
-
-
-
- /**
- * Test passing null to the parser
- */
- public void testPrefix_null()
- {
- /* Test passing a null expression */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, null);
- assertNull(prefix);
- }
- }
-
- /**
- *
- */
- public void testPrefix_empty_()
- {
- /* Test */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, empty_);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testPrefix_xxx()
- {
- /* Test x x x */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxx);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxx);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxx);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testPrefix_xxxDot()
- {
- /* Test x x x . */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxxDot);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxxDot);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxxDot);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testSuffix_xxxDot()
- {
- /* Test x x x . */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(5, xxxDot);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testPrefix_xxxYYY()
- {
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxxYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxxYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxxYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testFirstSuffix_xxxYYY()
- {
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(5, xxxYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(6, xxxYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(8, xxxYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
- /**
- * Test code completion on an EL prefix expression such as prefix.suffix
- */
- public void testPrefix_xxxYYYZZZ()
- {
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
-
- /**
- *
- */
- public void testFirstSuffix_xxxYYYZZZ()
- {
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(5, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(6, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(8, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
- }
-
-
- /**
- *
- */
- public void testSecondSuffix_xxxYYYZZZ()
- {
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(9, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx.yyy".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(10, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx.yyy".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y . z z z */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(12, xxxYYYZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx.yyy".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testPrefix_xxxLtYYY()
- {
- /* Test x x x < y y y */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxxLtYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x < y y y */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxxLtYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x < y y y */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxxLtYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x < y y y */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(7, xxxLtYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "yyy".equals(prefix.getValue()));
- }
-
- /* Test x x x < y y y */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(8, xxxLtYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "yyy".equals(prefix.getValue()));
- }
-
- /* Test x x x < y y y */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(10, xxxLtYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "yyy".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testPrefix_xxxDotYYYLtZZZ()
- {
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(5, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(6, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(8, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(11, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "zzz".equals(prefix.getValue()));
- }
-
- /* Test x x x . y y y < z z z */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(14, xxxDotYYYLtZZZ);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "zzz".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testSuffix_xxxDotYYYLtZZZ()
- {
- /* Test x x x . y y y < z z z . */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(15, xxxDotYYYLtZZZ+".");
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "zzz".equals(prefix.getValue()));
- }
- }
-
- /**
- *
- */
- public void testPrefix_xxxMapYYY()
- {
- /* Test x x x [ ' y y y ' ] */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(1, xxxMapYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x [ ' y y y ' ] */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(2, xxxMapYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x [ ' y y y ' ] */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(4, xxxMapYYY);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "xxx".equals(prefix.getValue()));
- }
-
- /* Test x x x [ ' y y y ' ] */
- /* ^ */
-// {
-// ContentAssistStrategy prefix = ContentAssistParser.getPrefix(11, xxxMapYYY);
-//
-// System.out.println(prefix.getValue());
-// assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
-// && "xxx['yyy']".equals(prefix.getValue()));
-// }
-
- /* Test x x x [ ' y y y ' ] . */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(12, xxxMapYYY+".");
-
- System.out.println(prefix.getValue());
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION
- && "xxx['yyy']".equals(prefix.getValue()));
- }
- }
-
- /**
- * Test completion inside an array
- */
- public void testPrefix_xxxMapXXXDotExpr()
- {
- /* Test x x x [ X X X ] */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(5, xxxMapXXXExpr);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "XXX".equals(prefix.getValue()));
- }
-
- /* Test x x x [ X X X ] */
- /* ^ */
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(6, xxxMapXXXExpr);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "XXX".equals(prefix.getValue()));
- }
-
- /* Test x x x [ X X X ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(8, xxxMapXXXExpr);
-
- assertTrue(prefix.getType() == ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION
- && "XXX".equals(prefix.getValue()));
- }
- }
-
- /**
- * Tests suffix completions on dots inside brackets
- */
- public void testSuffix_xxxMapXXXDotExpr()
- {
- /* Test x x x [ X X X . ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(8, xxxMapXXXDotExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_ID_COMPLETION, prefix.getType());
- assertEquals("XXX", prefix.getValue());
- }
-
- /* Test x x x [ X X X . ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(9, xxxMapXXXDotExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX", prefix.getValue());
- }
- }
-
- /**
- * Test dot completion inside an array expression
- */
- public void testSuffix_xxxMapXXXDotYYYExpr()
- {
- /* Test x x x [ X X X . Y Y Y ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(9, xxxMapXXXDotYYYExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX", prefix.getValue());
- }
-
- /* Test x x x [ X X X . Y Y Y ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(10, xxxMapXXXDotYYYExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX", prefix.getValue());
- }
-
- /* Test x x x [ X X X . Y Y Y ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(12, xxxMapXXXDotYYYExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX", prefix.getValue());
- }
-
- /* Test x x x [ X X X . Y Y Y . ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(12, xxxMapXXXDotYYYDotExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX", prefix.getValue());
- }
-
- /* Test x x x [ X X X . Y Y Y . ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(13, xxxMapXXXDotYYYDotExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX.YYY", prefix.getValue());
- }
- }
-
- /**
- * Test dot completion on XXX.YYY.ZZZ type expressions
- */
- public void testSuffix_xxxMapXXXDotYYYDotZZZExpr()
- {
- /* Test x x x [ X X X . Y Y Y . Z Z Z] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(13, xxxMapXXXDotYYYDotZZZExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX.YYY", prefix.getValue());
- }
-
- /* Test x x x [ X X X . Y Y Y . Z Z Z] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(14, xxxMapXXXDotYYYDotZZZExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX.YYY", prefix.getValue());
- }
-
- /* Test x x x [ X X X . Y Y Y . Z Z Z ] */
- /* ^*/
- {
- final ContentAssistStrategy prefix = ContentAssistParser.getPrefix(16, xxxMapXXXDotYYYDotZZZExpr);
-
- assertEquals(ContentAssistStrategy.PREFIX_TYPE_DOT_COMPLETION, prefix.getType());
- assertEquals("XXX.YYY", prefix.getValue());
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/ContentAssistTestsPlugin.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/ContentAssistTestsPlugin.java
deleted file mode 100644
index 4bda030..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/ContentAssistTestsPlugin.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ContentAssistTestsPlugin extends AbstractUIPlugin {
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.contentassist.tests";
-
- // The shared instance
- private static ContentAssistTestsPlugin plugin;
-
- /**
- * The constructor
- */
- public ContentAssistTestsPlugin() {
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(final BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ContentAssistTestsPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestContentAssistParser.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestContentAssistParser.java
deleted file mode 100644
index a7d941c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestContentAssistParser.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistParser;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.SymbolInfo;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestContentAssistParser extends BaseTestClass
-{
- private WebProjectTestEnvironment _testEnv;
- private IFile _jspFile;
- private IType _myBeanType;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _testEnv = new WebProjectTestEnvironment(getClass().getName()+"_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_basic.xml.data",
- "/WEB-INF/faces-config.xml");
- _jspFile = (IFile) _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/basicELExpressions.jsp.data",
- "/basicELExpressions.jsp");
- assertNotNull(_jspFile);
- assertTrue(_jspFile.isAccessible());
-
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(_testEnv);
- final TestFileResource resource = new TestFileResource();
- resource.load(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/MyBean.java.data");
- jdtTestEnv.addSourceFile("src", "beans", "MyBean", resource.toString());
- _myBeanType = JavaCore.create(_testEnv.getTestProject()).findType("beans.MyBean");
- assertNotNull(_myBeanType);
- assertTrue(_myBeanType.exists());
- }
-
- public void testSanity() throws Exception
- {
- JSFCoreUtilHelper.assertELSanity(_jspFile, 518, "value", "#{}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 547, "value", "#{ }");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 579, "value", "#{myBean}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 614, "value", "#{myBean.property}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 658, "value", "#{paramValues.foo}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 706, "action", "#{myBean.actionMethod}");
-
- JSFCoreUtilHelper.assertELVariableSanity(_jspFile, "myBean");
- }
-
-
- public void testGetPrefix() {
- // for now there's a enough coverage through TestIdCompletionStrategy
- }
-
- public void testGetSymbolInfo() throws Exception
- {
- assertNull(ContentAssistParser.getSymbolInfo(JSFCoreUtilHelper.getDocumentContext(_jspFile, 518).getContext(), 1, null));
- assertNull(ContentAssistParser.getSymbolInfo(JSFCoreUtilHelper.getDocumentContext(_jspFile, 518).getContext(), 1, ""));
- assertNull(ContentAssistParser.getSymbolInfo(JSFCoreUtilHelper.getDocumentContext(_jspFile, 547).getContext(), 1, " "));
-
- // variable test
- SymbolInfo symbolInfo =
- ContentAssistParser.getSymbolInfo(JSFCoreUtilHelper.getDocumentContext(_jspFile, 579).getContext(), 1, "myBean");
- assertNotNull(symbolInfo);
- assertEquals("myBean", symbolInfo.getSymbol().getName());
- assertTrue(symbolInfo.getSymbol() instanceof IBeanInstanceSymbol);
- assertNotNull(symbolInfo.getRelativeRegion());
- assertEquals(6, symbolInfo.getRelativeRegion().getLength());
-
- // property test
- symbolInfo =
- ContentAssistParser.getSymbolInfo(JSFCoreUtilHelper.getDocumentContext(_jspFile, 614).getContext(), 8, "myBean.property");
- assertNotNull(symbolInfo);
- assertEquals("property", symbolInfo.getSymbol().getName());
- assertTrue(symbolInfo.getSymbol() instanceof IBeanPropertySymbol);
- assertNotNull(symbolInfo.getRelativeRegion());
-
- // method test
- symbolInfo =
- ContentAssistParser.getSymbolInfo(JSFCoreUtilHelper.getDocumentContext(_jspFile, 706).getContext(), 8, "myBean.actionMethod");
- assertNotNull(symbolInfo);
- assertEquals("actionMethod", symbolInfo.getSymbol().getName());
- assertTrue(symbolInfo.getSymbol() instanceof IBeanMethodSymbol);
- assertNotNull(symbolInfo.getRelativeRegion());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestFunctionCompletionStrategy.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestFunctionCompletionStrategy.java
deleted file mode 100644
index fc9677a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestFunctionCompletionStrategy.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Basic unit test for class FunctionCompletionStrategy
- * @author cbateman
- *
- */
-public class TestFunctionCompletionStrategy extends BaseTestClass
-{
- private WebProjectTestEnvironment _testEnv;
- private IFile _jspFile;
- private IType _myBeanType;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _testEnv = new WebProjectTestEnvironment(getClass().getName()+"_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_basic.xml.data",
- "/WEB-INF/faces-config.xml");
- _jspFile = (IFile) _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/basicELExpressions.jsp.data",
- "/basicELExpressions.jsp");
- assertNotNull(_jspFile);
- assertTrue(_jspFile.isAccessible());
-
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(_testEnv);
- final TestFileResource resource = new TestFileResource();
- resource.load(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/MyBean.java.data");
- jdtTestEnv.addSourceFile("src", "beans", "MyBean", resource.toString());
- _myBeanType = JavaCore.create(_testEnv.getTestProject()).findType("beans.MyBean");
- assertNotNull(_myBeanType);
- assertTrue(_myBeanType.exists());
- }
-
- /**
- * Sanity check
- */
- public void testSanity() throws Exception
- {
- JSFCoreUtilHelper.assertELSanity(_jspFile, 614, "value", "#{myBean.property}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 658, "value", "#{paramValues.foo}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 706, "action", "#{myBean.actionMethod}");
-
- JSFCoreUtilHelper.assertELVariableSanity(_jspFile, "myBean");
- }
-
- public void testFunctionCompletionStrategy() throws Exception
- {
- // normal value binding only has properties
- List<ICompletionProposal> proposals = getProposals(_jspFile, 614, 8);
-
- {
- final Set<String> propNames = new HashSet<String>();
- propNames.add("property");
- propNames.add("class");
- assertDisplayNamesMatch(propNames, proposals);
- }
-
- // method binding includes methods and also properties
- proposals = getProposals(_jspFile, 706, 8);
-
- {
- final Set<String> propNames = new HashSet<String>();
- propNames.add("property");
- propNames.add("class");
- propNames.add("getProperty");
- propNames.add("actionMethod");
- propNames.add("equals");
- propNames.add("getClass");
- propNames.add("hashCode");
- propNames.add("notify");
- propNames.add("notifyAll");
- propNames.add("toString");
- propNames.add("wait");
- propNames.add("wait");
- propNames.add("wait");
-
- assertEquals(13, proposals.size());
- // have to loop through explicitly here because wait appears
- // in the list thrice, but can only be in the set once
- for (final ICompletionProposal prop : proposals)
- {
- assertTrue(propNames.contains(prop.getDisplayString()));
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestIdCompletionStrategy.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestIdCompletionStrategy.java
deleted file mode 100644
index 3ca76ee..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/TestIdCompletionStrategy.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestIdCompletionStrategy extends BaseTestClass
-{
- private final static Set<String> DISPLAY_NAMES;
-
- static
- {
- final Set<String> displayNames = new HashSet<String>();
- displayNames.add("requestScope");
- displayNames.add("cookie");
- displayNames.add("header");
- displayNames.add("headerValues");
- displayNames.add("param");
- displayNames.add("paramValues");
- displayNames.add("facesContext");
- displayNames.add("view");
- displayNames.add("initParam");
- displayNames.add("sessionScope");
- displayNames.add("applicationScope");
- displayNames.add("myBean");
- DISPLAY_NAMES = Collections.unmodifiableSet(displayNames);
- }
- private WebProjectTestEnvironment _testEnv;
- private IFile _jspFile;
- private IType _myBeanType;
-
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _testEnv = new WebProjectTestEnvironment(getClass().getName()+"_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_basic.xml.data",
- "/WEB-INF/faces-config.xml");
- _jspFile = (IFile) _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/basicELExpressions.jsp.data",
- "/basicELExpressions.jsp");
- assertNotNull(_jspFile);
- assertTrue(_jspFile.isAccessible());
-
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(_testEnv);
- final TestFileResource resource = new TestFileResource();
- resource.load(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/MyBean.java.data");
- jdtTestEnv.addSourceFile("src", "beans", "MyBean", resource.toString());
- _myBeanType = JavaCore.create(_testEnv.getTestProject()).findType("beans.MyBean");
- assertNotNull(_myBeanType);
- assertTrue(_myBeanType.exists());
- }
-
- public void testSanity() throws Exception
- {
- JSFCoreUtilHelper.assertELSanity(_jspFile, 518, "value", "#{}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 547, "value", "#{ }");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 579, "value", "#{myBean}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 614, "value", "#{myBean.property}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 658, "value", "#{paramValues.foo}");
-
- assertEquals(12, DISPLAY_NAMES.size());
- }
-
- public void testGetProposals() {
-
- }
-
- public void testIdCompletionStrategy() throws Exception
- {
- // empty string has all
- assertDisplayNamesMatch(DISPLAY_NAMES, getProposals(_jspFile, 518, "", 1));
-
- // empty whitespace has all
- assertDisplayNamesMatch(DISPLAY_NAMES, getProposals(_jspFile, 547, 1));
-
- // at the very start of a variable, have all
- assertDisplayNamesMatch(DISPLAY_NAMES, getProposals(_jspFile, 579, 1));
- // one character in, only ones matching prefix
- assertDisplayNamesMatch(Collections.singleton("myBean"), getProposals(_jspFile, 579, 2));
-
- // having properties should not change the variable resolved
- assertDisplayNamesMatch(DISPLAY_NAMES, getProposals(_jspFile, 614, 1));
- // one character in, only ones matching prefix
- assertDisplayNamesMatch(Collections.singleton("myBean"), getProposals(_jspFile, 614, 2));
-
- // having properties should not change the variable resolved
- assertDisplayNamesMatch(DISPLAY_NAMES, getProposals(_jspFile, 658, 1));
- // one character in, only ones matching prefix
- final Set<String> paramNames = new HashSet<String>();
- paramNames.add("param");
- paramNames.add("paramValues");
- assertDisplayNamesMatch(Collections.unmodifiableSet(paramNames), getProposals(_jspFile, 658, 2));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149224.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149224.java
deleted file mode 100644
index 0d98cd5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149224.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper.ContextWrapper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Regression test for 149224 -- replace '.' on completion with [] style of
- * map
- *
- * @author cbateman
- *
- */
-public class Test_bug_149224 extends BaseTestClass
-{
- private WebProjectTestEnvironment _testEnv;
- private IFile _jspFile;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _testEnv = new WebProjectTestEnvironment("Test_bug_149224_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _jspFile = (IFile) _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/bug_149224_1.jsp.data",
- "/bug_149224.jsp");
-
- assertNotNull(_jspFile);
- assertTrue(_jspFile.isAccessible());
-
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(_testEnv);
- TestFileResource resource = new TestFileResource();
- resource.load(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/MyBean.java.data");
- jdtTestEnv.addSourceFile("src", "beans", "MyBean", resource.toString());
-
- resource = new TestFileResource();
- resource.load(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/bug_149224.properties.data");
- jdtTestEnv.addResourceFile("src", new ByteArrayInputStream(resource.toBytes()),
- "bundles", "bundle1.properties");
-
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(JSFCoreUtilHelper.createSimpleRegistryFactory());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(null);
- }
-
- /**
- * Sanity check
- */
- public void testSanity() throws Exception
- {
- final ContextWrapper wrapper = null;
-
- try
- {
- JSFCoreUtilHelper.assertELSanity(_jspFile, 589, "value", "#{bundle1.}");
- JSFCoreUtilHelper.assertELSanity(_jspFile, 630, "value", "#{bundle1.x}");
- JSFCoreUtilHelper.assertELVariableSanity(_jspFile, "bundle1");
- }
- finally
- {
- if (wrapper != null)
- {
- wrapper.dispose();
- }
- }
- }
-
- /**
- * Test the completion:
- *
- * # { b u n d l e 1 . }
- * ^
- */
- public void testCompletionAtCloseBrace() throws Exception
- {
- final List<ICompletionProposal> proposals =
- getProposals(_jspFile, 589, "bundle1.",9);
- assertNotNull(proposals);
- ICompletionProposal proposal = null;
-
- FIND_ARRAY_PROPOSAL:
- for (final ICompletionProposal findProp : proposals)
- {
- // TODO: this is a bit of a hack. Would rather be able
- // to query for the actual replacement text
- if (findProp.getDisplayString().startsWith("['"))
- {
- proposal = findProp;
- break FIND_ARRAY_PROPOSAL;
- }
- }
-
- assertNotNull(proposal);
-
- applyAndCheck(_jspFile, 589, proposal, "bundle1['prop.with.dots_x']");
- }
-
- /**
- * Test the completion:
- *
- * # { b u n d l e 1 . x }
- * ^
- */
- public void testCompletionAtProperty() throws Exception
- {
- final ContextWrapper wrapper = null;
-
- try
- {
- final List<ICompletionProposal> proposals =
- getProposals(_jspFile, 630, 9);
-
- ICompletionProposal proposal = null;
-
- FIND_ARRAY_PROPOSAL:
- for (final ICompletionProposal completionProposal : proposals) {
- proposal = completionProposal;
- // TODO: this is a bit of a hack. Would rather be able
- // to query for the actual replacement text
- if (proposal.getDisplayString().startsWith("['"))
- {
- break FIND_ARRAY_PROPOSAL;
- }
- }
-
- assertNotNull(proposal);
- applyAndCheck(_jspFile, 630, proposal, "bundle1['prop.with.dots_x']x");
- }
- finally
- {
- if (wrapper != null)
- {
- wrapper.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149743.java b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149743.java
deleted file mode 100644
index 3d5c5d8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/src/org/eclipse/jst/jsf/contentassist/tests/Test_bug_149743.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.contentassist.tests;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Test a situation where no expected return type information is
- * available for a tag.
- *
- * @author cbateman
- *
- */
-public class Test_bug_149743 extends BaseTestClass
-{
- private WebProjectTestEnvironment _testEnv;
- private IFile _jspFile;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _testEnv = new WebProjectTestEnvironment("Test_bug_149743_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_bug149743.xml.data",
- "/WEB-INF/faces-config.xml");
- _jspFile = (IFile) _testEnv.loadResourceInWebRoot(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/bug_149743.jsp.data",
- "/bug_149743.jsp");
-
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(_testEnv);
- final TestFileResource resource = new TestFileResource();
- resource.load(ContentAssistTestsPlugin.getDefault().getBundle(),
- "/testdata/MyBean.java.data");
- jdtTestEnv.addSourceFile("src", "beans", "MyBean", resource.toString());
- }
-
- /**
- * Sanity check
- */
- public void testSanity() throws Exception
- {
- JSFCoreUtilHelper.assertELSanity(_jspFile, 529, "value" ,"#{myBean.property}");
- JSFCoreUtilHelper.assertELVariableSanity(_jspFile, "myBean");
- }
-
- /**
- * Checks the scenario for Test_bug_149743
- */
- public void testCompletionProposalsForId() throws Exception
- {
- final List<ICompletionProposal> proposals =
- getProposals(_jspFile, 529, 8);
- assertEquals(2, proposals.size());
- final Set<String> names = new HashSet<String>();
-
- for (final ICompletionProposal proposal : proposals)
- {
- names.add(proposal.getDisplayString());
- }
- assertTrue(names.contains("class"));
- assertTrue(names.contains("property"));
- }
-
-
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/test.xml b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/test.xml
deleted file mode 100644
index e59e084..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.."/> -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jst.jsf.contentassist.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.jst.jsf.contentassist.tests.*xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jsf-folder" value="${eclipse-home}/jsf_folder"/>
- <delete dir="${jsf-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jsf-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jst.jsf.contentassist.tests.AllTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.jst.jsf.contentassist.tests.*xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBean.java.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBean.java.data
deleted file mode 100644
index 7de1772..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBean.java.data
+++ /dev/null
@@ -1,13 +0,0 @@
-package beans;
-
-public class MyBean {
- public String[] getProperty()
- {
- return new String[]{"blah"};
- }
-
- public String actionMethod()
- {
- return "foo";
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBeanSettable.java.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBeanSettable.java.data
deleted file mode 100644
index 7edb245..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/MyBeanSettable.java.data
+++ /dev/null
@@ -1,171 +0,0 @@
-package beans;
-
-import java.math.BigInteger;
-import java.math.BigDecimal;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-public class MyBeanSettable
-{
- public String getStringProperty()
- {
- return "";
- }
-
- public void setStringProperty(String stringProp)
- {
-
- }
-
- public double getDoubleProperty()
- {
- return 1.04;
- }
-
- public void setDoubleProperty(double newValue)
- {
- // doesn't matter what happens here
- }
-
- public void setIntegerProperty(int integerProp)
- {
-
- }
-
- public int getIntegerProperty()
- {
- return 0;
- }
-
- public boolean getBooleanProperty()
- {
- return false;
- }
-
- public void setBooleanProperty(boolean booleanProp)
- {
-
- }
-
- public Map getMapProperty()
- {
- return Collections.EMPTY_MAP;
- }
-
- public void setMapProperty(Map mapProperty)
- {
-
- }
-
- public void setStringArrayProperty(String[] stringArrayProperty)
- {
-
- }
-
- public String[] getStringArrayProperty()
- {
- return new String[0];
- }
-
- public Collection getCollectionProperty()
- {
- return Collections.EMPTY_LIST;
- }
-
- public void setCollectionProperty(Collection collectionProp)
- {
-
- }
-
- public void setListProperty(List listProp)
- {
-
- }
-
- public List getListProperty()
- {
- return Collections.EMPTY_LIST;
- }
-
- public void setComparablePropety(Comparable comp)
- {
-
- }
-
- public Comparable getComparableProperty()
- {
- return null;
- }
-
- public MyBeanSettable recursiveCall()
- {
- return this;
- }
-
- public String getWritableStringProperty()
- {
- return "";
- }
-
- public void setWritableStringProperty(String newValue)
- {
- ;
- }
-
- public BigInteger getBigIntegerProperty()
- {
- return BigInteger.ONE;
- }
-
- public void setBigIntegerProperty(BigInteger newValue)
- {
- // doesn't matter what happens here
- }
-
- public BigDecimal getBigDoubleProperty()
- {
- return new BigDecimal(0.5);
- }
-
- public void setBigDoubleProperty(BigDecimal newValue)
- {
- // doesn't matter what happens here
- }
-
- public void validate(FacesContext facesContext,
- UIComponent component,
- Object object
- )
- {
-
- }
-
- public void validate2(FacesContext facesContext,
- UIComponent component,
- Object[] object
- )
- {
-
- }
-
- public MyBeanSettable getSelf()
- {
- return this;
- }
-
- public boolean isIsStyleBooleanProperty()
- {
- return false;
- }
-
- public void setIsStyleBooleanProperty(boolean styleProp)
- {
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/basicELExpressions.jsp.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/basicELExpressions.jsp.data
deleted file mode 100644
index aba8370..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/basicELExpressions.jsp.data
+++ /dev/null
@@ -1,28 +0,0 @@
-<%@page contentType="text/html"%>
-<%@page pageEncoding="UTF-8"%>
-
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <f:view>
- <h1>JSP Page</h1>
- <!-- no errors -->
- <h:outputText value="#{}"/>
- <h:outputText value="#{ }"/>
- <h:outputText value="#{myBean}"/>
- <h:outputText value="#{myBean.property}"/>
- <h:outputText value="#{paramValues.foo}"/>
- <h:commandButton action="#{myBean.actionMethod}"/>
- </f:view>
- </body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224.properties.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224.properties.data
deleted file mode 100644
index d29c89a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224.properties.data
+++ /dev/null
@@ -1,4 +0,0 @@
-prop1_x=foo
-prop2_x=bar
-prop.with.dots_x=foo.bar
-anotherprop=blah \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224_1.jsp.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224_1.jsp.data
deleted file mode 100644
index aba64ef..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149224_1.jsp.data
+++ /dev/null
@@ -1,25 +0,0 @@
-<%@page contentType="text/html"%>
-<%@page pageEncoding="UTF-8"%>
-
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <f:view>
- <f:loadBundle basename="bundles.bundle1" var="bundle1"/>
- <h1>JSP Page</h1>
- <!-- no errors -->
- <h:outputText value="#{bundle1.}"/>
- <h:outputText value="#{bundle1.x}"/>
- </f:view>
- </body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149743.jsp.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149743.jsp.data
deleted file mode 100644
index 5a68a6c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/bug_149743.jsp.data
+++ /dev/null
@@ -1,23 +0,0 @@
-<%@page contentType="text/html"%>
-<%@page pageEncoding="UTF-8"%>
-
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <f:view>
- <h1>JSP Page</h1>
- <!-- no errors -->
- <f:selectItems value="#{myBean.property}"/>
- </f:view>
- </body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_basic.xml.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_basic.xml.data
deleted file mode 100644
index e4a475b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_basic.xml.data
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config>
- <managed-bean>
- <managed-bean-name>
- myBean</managed-bean-name>
- <managed-bean-class>
- beans.MyBean</managed-bean-class>
- <managed-bean-scope>
- none</managed-bean-scope>
- </managed-bean>
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_bug149743.xml.data b/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_bug149743.xml.data
deleted file mode 100644
index 5db9cf5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.contentassist.tests/testdata/faces-config_bug149743.xml.data
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config>
- <managed-bean>
- <managed-bean-name>
- myBean</managed-bean-name>
- <managed-bean-class>
- beans.MyBean</managed-bean-class>
- <managed-bean-scope>
- none</managed-bean-scope>
- </managed-bean>
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore
deleted file mode 100644
index 3927467..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project
deleted file mode 100644
index 28a1842..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.context.symbol.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 9c7d20e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:01:57 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 444ca5c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,62 +0,0 @@
-#Tue May 15 17:20:53 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 2be44a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jst.jsf.context.symbol.tests; singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-ClassPath: .
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.jsf.context.symbol.tests;x-internal:=true
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)",
- org.junit;bundle-version="3.8.1",
- org.eclipse.jst.jsf.test.util;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.edit;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="1.1.103"
-Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.jst.jsf.context.symbol.tests.ContextSymbolTestPlugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/about.html
deleted file mode 100644
index 04d4782..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties
deleted file mode 100644
index e5db9e1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-jars.compile.order = .
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- test.xml,\
- testdata/,\
- plugin.properties,\
- about.html
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties
deleted file mode 100644
index a584e7e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/plugin.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=JavaServer Faces Tools - Context Symbol Tests
-providerName=Eclipse.org
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/AllTests.java
deleted file mode 100644
index 4246a4b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/AllTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for all context.symbol tests
- *
- * @author cbateman
- *
- */
-public class AllTests {
- /**
- * @return the all tests suite
- */
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Test for base symbols framework");
- //$JUnit-BEGIN$
- suite.addTestSuite(TestIJavaTypeDescriptor2.class);
- suite.addTestSuite(TestIPropertySymbolItemProvider.class);
- suite.addTestSuite(TestTypeCoercion.class);
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=217135
- // suite.addTestSuite(TestIJavaTypeDescriptor2_ChangeStability.class);
- //$JUnit-END$
- return suite;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java
deleted file mode 100644
index 51f59d2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ContextSymbolTestPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ContextSymbolTestPlugin extends AbstractUIPlugin
-{
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.context.symbol.tests";
-
- // The shared instance
- private static ContextSymbolTestPlugin plugin;
-
- /**
- * The constructor
- */
- public ContextSymbolTestPlugin() {
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ContextSymbolTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ModelBaseTestCase.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ModelBaseTestCase.java
deleted file mode 100644
index f91472f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/ModelBaseTestCase.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.osgi.framework.Bundle;
-
-/**
- * @author cbateman
- *
- */
-public class ModelBaseTestCase extends TestCase
-{
- /**
- * The test environment for a JavaProject
- */
- protected JDTTestEnvironment _jdtTestEnvironment;
-
- /**
- * The base source folder name for Java classes
- */
- protected final static String srcFolderName = "src";
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJDTBeanIntrospectorProject_"+getName());
- projectTestEnvironment.createProject(true);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
- }
-
- /**
- * @param bundle
- * @param fileName
- * @param packageName
- * @param beanClassName
- * @throws Exception
- */
- protected void loadSourceClass(final Bundle bundle, final String fileName, final String packageName, final String beanClassName) throws Exception
- {
- TestFileResource codeRes = new TestFileResource();
- codeRes.load(bundle, fileName);
- String code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName, beanClassName, code);
- assertNotNull(_jdtTestEnvironment.getJavaProject().findType(packageName+"."+beanClassName));
- }
-
- /**
- * @param bundle
- * @param fileName
- * @param packageName
- * @param beanClassName
- * @param properties
- * @return a bean instance set up for the indicated test class
- * @throws Exception
- */
- protected IBeanInstanceSymbol setupBeanProperty(Bundle bundle, String fileName, String packageName, String beanClassName, Map<String, IPropertySymbol> properties) throws Exception
- {
- loadSourceClass(bundle, fileName, packageName, beanClassName);
-
- final IType testBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(packageName+"."+beanClassName);
- assertNotNull(testBean1Type);
-
- final IJavaTypeDescriptor2 testBeanDescriptor =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- testBeanDescriptor.setType(testBean1Type);
-
- IBeanInstanceSymbol bean =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- bean.setTypeDescriptor(testBeanDescriptor);
- bean.setName(beanClassName);
- populatePropertyMap(bean, properties);
- return bean;
- }
-
- protected void populatePropertyMap(IBeanInstanceSymbol bean, Map<String, IPropertySymbol> properties)
- {
- List<?> propertyList = bean.getProperties();
- for(final Iterator<?> it = propertyList.iterator(); it.hasNext();)
- {
- final IPropertySymbol property = (IPropertySymbol) it.next();
- properties.put(property.getName(), property);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java
deleted file mode 100644
index 20707a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2.java
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ITypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.SymbolPackage;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-
-/**
- * Test the IJavaTypeDescriptor
- *
- * @author cbateman
- *
- */
-public class TestIJavaTypeDescriptor2 extends ModelBaseTestCase
-{
- private Map _beanProperties;
- private Map _beanSubclassProperties;
- private Map<String, IBeanMethodSymbol> _beanMethods;
- private Map _beanMethodsSubclass;
- private Map<String, IPropertySymbol> _genericProperties;
-
- private IBeanInstanceSymbol _testBean1Symbol;
- private IBeanInstanceSymbol _testBean1SubclassSymbol;
- private IBeanInstanceSymbol _testBean2Symbol;
- private IBeanInstanceSymbol _testBean2SubclassSymbol;
-
- private final static String packageName1 = "com.test";
- private final static String testBeanName1 = "TestBean1";
- private final static String testBean1Sig = "L"+packageName1+"."+testBeanName1+";";
- private final static String testBeanSubclass1 = "TestBean1Subclass";
- private final static String testBeanName2 = "TestBean2";
- private final static String testBean2Subclass = "TestBean2Subclass";
-
- private final static String overloadedMethodName = "overloadedMethod";
-
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // load ITestBean2 first due to later dependencies
- loadSourceClass(ContextSymbolTestPlugin.getDefault().getBundle(), "/testdata/ITestBean2.java.data", packageName1, "ITestBean2");
-
- // load another bean first since others have a dependency on on it
- loadSourceClass(TestsPlugin.getDefault().getBundle(), "/testfiles/AnotherBean.java.data", packageName1, "AnotherBean");
- assertNotNull(_jdtTestEnvironment.getJavaProject().findType(packageName1+"."+"AnotherBean"));
-
- _beanProperties = new HashMap();
- _testBean1Symbol =
- setupBeanProperty(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data", packageName1,
- testBeanName1, _beanProperties);
-
- _beanSubclassProperties = new HashMap();
- _testBean1SubclassSymbol =
- setupBeanProperty(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1Subclass.java.data", packageName1,
- testBeanSubclass1, _beanSubclassProperties);
-
- _genericProperties = new HashMap<String, IPropertySymbol>();
-
- setupBeanProperty(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/TestBeanWithGenericProperties.java.data", packageName1,
- "TestBeanWithGenericProperties",_genericProperties);
-
- _beanMethods = new HashMap();
- _testBean2Symbol =
- setupBeanMethods("/testdata/TestBean2.java.data", testBeanName2, _beanMethods);
-
- _beanMethodsSubclass = new HashMap();
- _testBean2SubclassSymbol =
- setupBeanMethods("/testdata/TestBean2Subclass.java.data", testBean2Subclass, _beanMethodsSubclass);
- }
-
- private IBeanInstanceSymbol setupBeanMethods(String fileName, String beanClassName, Map<String, IBeanMethodSymbol> methods) throws Exception
- {
- loadSourceClass(ContextSymbolTestPlugin.getDefault().getBundle(), fileName, packageName1, beanClassName);
-
- final IType testBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(packageName1+"."+beanClassName);
- assertNotNull(testBean1Type);
-
- final IJavaTypeDescriptor2 testBeanDescriptor =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- testBeanDescriptor.setType(testBean1Type);
-
- IBeanInstanceSymbol bean =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- bean.setTypeDescriptor(testBeanDescriptor);
- bean.setName(beanClassName);
- List methodList = bean.getMethods();
- for(final Iterator it = methodList.iterator(); it.hasNext();)
- {
- final IBeanMethodSymbol method = (IBeanMethodSymbol) it.next();
-
- // exclude the overloaded methods as these are handled separately
- if (!overloadedMethodName.equals(method.getName()))
- {
- methods.put(method.getName(), method);
- }
- }
-
- return bean;
- }
-
- /**
- * Basic high-level sanity check on the generate properties map
- */
- public void testMapSanity()
- {
- final int NUM_PROPS_IN_BEAN = 15; // includes getClass on parent java.lang.Object
- assertEquals("Check extra or missing properties",NUM_PROPS_IN_BEAN, _beanProperties.size());
- assertEquals("Check extra or missing properties",NUM_PROPS_IN_BEAN+1, _beanSubclassProperties.size());
- assertEquals("Check extra or missing methods",12,_beanMethods.size()); // includes java.lang.Object methods
- assertEquals("Check extra or missing methods",13,_beanMethodsSubclass.size());
- assertEquals("Check extra or missing methods", 5, _genericProperties.size());
- }
-
- /**
- *
- */
- public void testStringProp1()
- {
- testStringProp1(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testStringProp1SubClass()
- {
- testStringProp1(_beanSubclassProperties);
- }
-
- /**
- * @param properties
- */
- private void testStringProp1(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("stringProp1");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a String",
- "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * test property
- */
- public void testBooleanIsProp1()
- {
- testBooleanIsProp1(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testBooleanIsProp1SubClass()
- {
- testBooleanIsProp1(_beanSubclassProperties);
- }
-
-
- /**
- * @param properties
- */
- private void testBooleanIsProp1(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("booleanIsProp1");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a boolean",
- Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testBooleanIsProp2()
- {
- testBooleanIsProp2(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testBooleanIsProp2SubClass()
- {
- testBooleanIsProp2(_beanSubclassProperties);
- }
-
- /**
- * @param properties
- */
- private void testBooleanIsProp2(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("booleanIsProp2");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a boolean",
- Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testNotBooleanIsProp1()
- {
- testNotBooleanIsProp1(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testNotBooleanIsProp1SubClass()
- {
- testNotBooleanIsProp1(_beanSubclassProperties);
- }
-
- /**
- *
- */
- private void testNotBooleanIsProp1(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("notBooleanIsProp1");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a boolean",
- Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testStringProperty2()
- {
- testStringProperty2(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testStringProperty2SubClass()
- {
- testStringProperty2(_beanSubclassProperties);
- }
-
- /**
- *
- */
- private void testStringProperty2(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("stringProperty2");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertFalse("No setter for this property", property.isWritable());
- assertEquals("Signature must be for a String",
- "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testReadonlyStringProperty()
- {
- testReadonlyStringProperty(_beanProperties);
- }
-
- /**
- *
- */
- private void testReadonlyStringProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("readonlyStringProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertFalse("No setter for this property", property.isWritable());
- assertEquals("Signature must be for a String",
- "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testReadonlyBooleanProperty()
- {
- testReadonlyBooleanProperty(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testReadonlyBooleanPropertySubClass()
- {
- testReadonlyBooleanProperty(_beanSubclassProperties);
- }
-
- /**
- * test inhertied
- */
- public void testReadonlyStringPropertySubClass()
- {
- testReadonlyStringProperty(_beanSubclassProperties);
- }
-
- /**
- *
- */
- private void testReadonlyBooleanProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("readonlyBooleanProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertFalse("No setter for this property", property.isWritable());
- assertEquals("Signature must be for a boolean",
- Signature.SIG_BOOLEAN, property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testStringArrayProperty()
- {
- testStringArrayProperty(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testStringArrayPropertySubClass()
- {
- testStringArrayProperty(_beanSubclassProperties);
- }
-
- /**
- *
- */
- private void testStringArrayProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("stringArrayProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
-
- ITypeDescriptor typeDesc = property.getTypeDescriptor();
- assertEquals("Signature must be for a String[]",
- Signature.createArraySignature(TypeConstants.TYPE_STRING, 1), typeDesc.getTypeSignature());
- assertEquals(true, typeDesc.isArray());
- assertEquals(1, ((IJavaTypeDescriptor2)typeDesc).getArrayCount());
- }
-
- /**
- *
- */
- public void testIntArrayProperty()
- {
- testIntArrayProperty(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testIntArrayPropertySubClass()
- {
- testIntArrayProperty(_beanSubclassProperties);
- }
-
- private void testIntArrayProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("intArrayProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
-
- ITypeDescriptor typeDesc = property.getTypeDescriptor();
- assertEquals("Signature must be for a int[]",
- Signature.createArraySignature(Signature.SIG_INT, 1), typeDesc.getTypeSignature());
- assertEquals(true, typeDesc.isArray());
- assertEquals(1, ((IJavaTypeDescriptor2)typeDesc).getArrayCount());
- }
-
- /**
- *
- */
- public void testArrayOfArrayOfStringProperty()
- {
- testArrayOfArrayOfStringProperty(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testArrayOfArrayOfStringPropertySubClass()
- {
- testArrayOfArrayOfStringProperty(_beanSubclassProperties);
- }
-
- private void testArrayOfArrayOfStringProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("arrayOfArrayOfStringProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
-
- ITypeDescriptor typeDesc = property.getTypeDescriptor();
- assertEquals("Signature must be for a String[][]",
- Signature.createArraySignature(TypeConstants.TYPE_STRING, 2), typeDesc.getTypeSignature());
- assertEquals(true, typeDesc.isArray());
- assertEquals(2, ((IJavaTypeDescriptor2)typeDesc).getArrayCount());
- }
-
- /**
- *
- */
- public void testCollectionProperty()
- {
- testCollectionProperty(_beanProperties);
- }
-
- /**
- * test inhertited
- */
- public void testCollectionPropertySubClass()
- {
- testCollectionProperty(_beanSubclassProperties);
- }
-
- /**
- *
- */
- private void testCollectionProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("collectionProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a Collection",
- "Ljava.util.Collection;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testMapProperty()
- {
- testMapProperty(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testMapPropertySubClass()
- {
- testMapProperty(_beanProperties);
- }
-
- /**
- *
- */
- private void testMapProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("mapProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a Map",
- "Ljava.util.Map;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- *
- */
- public void testWriteonlyStringProperty()
- {
- testWriteonlyStringProperty(_beanProperties);
- }
-
- /**
- * inherited
- */
- public void testWriteonlyStringPropertySubClass()
- {
- testWriteonlyStringProperty(_beanSubclassProperties);
- }
-
- /**
- *
- */
- private void testWriteonlyStringProperty(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("writeonlyStringProperty");
- assertNotNull(property);
-
- assertFalse("No getter for this property", property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a String",
- "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * test a locally defined bean type
- */
- public void testAnotherBean()
- {
- testAnotherBean(_beanProperties);
- }
-
- /**
- * test inherited
- */
- public void testAnotherBeanSubClass()
- {
- testAnotherBean(_beanSubclassProperties);
- }
-
- private void testAnotherBean(Map properties)
- {
- IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("anotherBean");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue("No setter for this property",property.isWritable());
- assertEquals("Signature must be for a com.test.AnotherBean",
- "Lcom.test.AnotherBean;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * Test bean.anotherBean.property for TestBean1
- */
- public void testPropertyOfProperty()
- {
- testPropertyOfProperty(_beanProperties);
- }
-
- /**
- * Test in inherited anotherBean property
- */
- public void testPropertyOfPropertyInSubclass()
- {
- testPropertyOfProperty(_beanSubclassProperties);
- }
-
- private void testPropertyOfProperty(Map properties)
- {
- final IBeanPropertySymbol property =
- (IBeanPropertySymbol) properties.get("anotherBean");
- assertNotNull(property);
-
- boolean foundNestedProperty = false;
-
- final List anotherBeanProps =
- property.getTypeDescriptor().getProperties();
- assertTrue("The nested properties has properties", anotherBeanProps.size()>0);
-
- SEARCH_FOR_NESTED_PROPERTY:for
- (final Iterator it = anotherBeanProps.iterator(); it.hasNext();)
- {
- final IBeanPropertySymbol nestedProp = (IBeanPropertySymbol) it.next();
-
- // looking for a property of AnotherBean called property
- if ("property".equals(nestedProp.getName()))
- {
- foundNestedProperty = true;
- break SEARCH_FOR_NESTED_PROPERTY;
- }
- }
-
- assertTrue(foundNestedProperty);
- }
-
- /**
- * Test a property that's in the sub-class but not the parent
- */
- public void testSubclassOnly()
- {
- final String inheritedPropertyName = "locallyDefinedProperty";
-
- // ensure we didn't some how put an inherited property into the
- // parent
- assertNull(_beanProperties.get(inheritedPropertyName));
- IBeanPropertySymbol property = (IBeanPropertySymbol) _beanSubclassProperties.get(inheritedPropertyName);
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- // no setter
- assertFalse(property.isWritable());
- assertEquals("Signature must be for a String",
- "Ljava.lang.String;", property.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * Acquire an element of an array
- */
- public void testArrayPropertyElement()
- {
- final IPropertySymbol propSymbol =
- (IPropertySymbol) _beanProperties.get("stringArrayProperty");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getArrayElement().getTypeDescriptor().getTypeSignature());
-
- final IObjectSymbol symbol = typeDesc.getArrayElement();
- assertNotNull(symbol);
- assertEquals(TypeConstants.TYPE_STRING, symbol.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * Acquire an element of an int array
- */
- public void testIntArrayPropertyElement()
- {
- final IPropertySymbol propSymbol =
- (IPropertySymbol) _beanProperties.get("intArrayProperty");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(Signature.SIG_INT, typeDesc.getArrayElement().getTypeDescriptor().getTypeSignature());
-
- final IObjectSymbol symbol = typeDesc.getArrayElement();
- assertNotNull(symbol);
- assertEquals(Signature.SIG_INT, symbol.getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * Acquire an element of an array of array of string and
- * get the element of that element
- */
- public void testArrayOfArrayOfStringPropertyElement()
- {
- final IPropertySymbol propSymbol =
- (IPropertySymbol) _beanProperties.get("arrayOfArrayOfStringProperty");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(Signature.createArraySignature(TypeConstants.TYPE_STRING, 1),
- typeDesc.getArrayElement().getTypeDescriptor().getTypeSignature()
- );
-
- final IObjectSymbol symbol = typeDesc.getArrayElement();
- assertNotNull(symbol);
- assertEquals(Signature.createArraySignature(TypeConstants.TYPE_STRING, 1),
- typeDesc.getArrayElement().getTypeDescriptor().getTypeSignature());
-
- assertTrue(symbol.getTypeDescriptor().isArray());
- final IObjectSymbol nestedSymbol = symbol.getTypeDescriptor().getArrayElement();
- assertNotNull(nestedSymbol);
- assertEquals(TypeConstants.TYPE_STRING,
- nestedSymbol.getTypeDescriptor().getTypeSignature());
- }
-
-/* ------ Properties with generics ------- */
-
- public void testGenericGetterBeans()
- {
- // list of strings
- {
- final IPropertySymbol propSymbol = _genericProperties.get("listOfStrings");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(TypeConstants.TYPE_LIST, typeDesc.getTypeSignature());
- assertEquals(1, typeDesc.getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getTypeParameterSignatures().get(0));
- }
-
- // map of strings keyed on strings
- {
- final IPropertySymbol propSymbol = _genericProperties.get("mapOfStringsKeyedByString");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(TypeConstants.TYPE_MAP, typeDesc.getTypeSignature());
- assertEquals(2, typeDesc.getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getTypeParameterSignatures().get(0));
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getTypeParameterSignatures().get(1));
- }
-
- // map of user (source) defined type keyed on strings
- {
- final IPropertySymbol propSymbol = _genericProperties.get("mapOfTestBeansByString");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(TypeConstants.TYPE_MAP, typeDesc.getTypeSignature());
- assertEquals(2, typeDesc.getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getTypeParameterSignatures().get(0));
- assertEquals(testBean1Sig, typeDesc.getTypeParameterSignatures().get(1));
- }
-
- // mutable map
- {
- final IPropertySymbol propSymbol = _genericProperties.get("mutableMapOfStringByString");
- assertNotNull(propSymbol);
-
- ITypeDescriptor typeDesc = propSymbol.getTypeDescriptor();
- assertNotNull(typeDesc);
- assertEquals(TypeConstants.TYPE_MAP, typeDesc.getTypeSignature());
- assertEquals(2, typeDesc.getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getTypeParameterSignatures().get(0));
- assertEquals(TypeConstants.TYPE_STRING, typeDesc.getTypeParameterSignatures().get(1));
- }
- }
-
-/* ------ Method signature testing -----------------------*/
-
- /**
- * test no arg boolean method
- */
- public void testABooleanMethodWithNoArgs()
- {
- testABooleanMethodWithNoArgs(_beanMethods);
- }
-
- /**
- * test inherited no arg boolean method
- */
- public void testABooleanMethodWithNoArgsSubclass()
- {
- testABooleanMethodWithNoArgs(_beanMethodsSubclass);
- }
-
-
- /**
- *
- */
- private void testABooleanMethodWithNoArgs(Map properties)
- {
- IBeanMethodSymbol method =
- (IBeanMethodSymbol) properties.get("aBooleanMethodWithNoArgs");
-
- assertEquals("()"+Signature.SIG_BOOLEAN,
- method.getSignature());
- }
-
- /**
- * test no args string method
- */
- public void testAStringMethodWithNoArgs()
- {
- testAStringMethodWithNoArgs(_beanMethods);
- }
-
- /**
- * test inherited no args string method
- */
- public void testAStringMethodWithNoArgsSubclass()
- {
- testAStringMethodWithNoArgs(_beanMethodsSubclass);
- }
-
- /**
- *
- */
- private void testAStringMethodWithNoArgs(Map properties)
- {
- IBeanMethodSymbol method =
- (IBeanMethodSymbol) properties.get("aStringMethodWithNoArgs");
-
- assertEquals("()Ljava.lang.String;",
- method.getSignature());
- }
-
- /**
- * test is accessor method
- */
- public void testIsAnIsAccessor()
- {
- testIsAnIsAccessor(_beanMethods);
- }
-
- /**
- * test inherited
- */
- public void testIsAnIsAccessorSubclass()
- {
- testIsAnIsAccessor(_beanMethodsSubclass);
- }
-
- /**
- *
- */
- private void testIsAnIsAccessor(Map properties)
- {
- IBeanMethodSymbol method =
- (IBeanMethodSymbol) properties.get("isAnIsAccessor");
-
- assertEquals("()Z",
- method.getSignature());
- }
-
- /**
- *
- */
- public void testAIntegerMethodThatTakesAString()
- {
- testAIntegerMethodThatTakesAString(_beanMethods);
- }
-
- /**
- * inherited
- */
- public void testAIntegerMethodThatTakesAStringSubclass()
- {
- testAIntegerMethodThatTakesAString(_beanMethodsSubclass);
- }
-
- /**
- *
- */
- private void testAIntegerMethodThatTakesAString(Map properties)
- {
- IBeanMethodSymbol method =
- (IBeanMethodSymbol) properties.get("aIntegerMethodThatTakesAString");
-
- assertEquals("(Ljava.lang.String;)"+Signature.SIG_INT,
- method.getSignature());
- }
-
- /**
- *
- */
- public void testAIntegerMethodThatTakesAStringAndLong()
- {
- testAIntegerMethodThatTakesAStringAndLong(_beanMethods);
- }
-
- /**
- * inherited
- */
- public void testAIntegerMethodThatTakesAStringAndLongSubclass()
- {
- testAIntegerMethodThatTakesAStringAndLong(_beanMethodsSubclass);
- }
-
- /**
- * @param arg1
- * @param arg2
- */
- private void testAIntegerMethodThatTakesAStringAndLong(Map properties)
- {
- IBeanMethodSymbol method =
- (IBeanMethodSymbol) properties.get("aIntegerMethodThatTakesAStringAndLong");
-
- assertEquals("(Ljava.lang.String;Ljava.lang.Long;)"+Signature.SIG_INT,
- method.getSignature());
- }
-
- /**
- * test that the overloaded methods are both there
- */
- public void testOverloadedMethod()
- {
- testOverloadedMethod(_testBean2Symbol);
- }
-
- /**
- * test the inherited
- */
- public void testOverloadedMethodSubclass()
- {
- testOverloadedMethod(_testBean2SubclassSymbol);
- }
-
- private void testOverloadedMethod(IBeanInstanceSymbol bean)
- {
- final String intMethodSignature =
- "("+Signature.SIG_INT+")"+Signature.SIG_VOID;
- final String stringMethodSignature =
- "(Ljava.lang.String;)V";
-
- boolean foundIntOverload = false;
- boolean foundStringOverload = false;
-
- for (final Iterator it = bean.getTypeDescriptor().getMethods().iterator();
- it.hasNext();)
- {
- final IBeanMethodSymbol method = (IBeanMethodSymbol) it.next();
- if (overloadedMethodName.equals(method.getName()))
- {
- final String typeSignature = method.getSignature();
-
- if (intMethodSignature.equals(typeSignature))
- {
- foundIntOverload = true;
- }
- else if (stringMethodSignature.equals(typeSignature))
- {
- foundStringOverload = true;
- }
- }
- }
-
- assertTrue(foundIntOverload && foundStringOverload);
- }
-
- /**
- * Test method signature that is only in the sub-class, not in the parent
- */
- public void testMethodSubclassOnly()
- {
- assertNull(_beanMethods.get("validate"));
-
- IBeanMethodSymbol method =
- (IBeanMethodSymbol) _beanMethodsSubclass.get("validate");
- assertNotNull(method);
- assertEquals("(Lcom.test.TestBean2;)"+Signature.SIG_VOID,
- method.getSignature());
- }
-
-/* ------ test acquisition of super-classes and interfaces -----------------------*/
- /**
- * Test correct super class acquistion
- */
- public void testSuperClassAcquisition()
- {
- // TestBean1
- List superSigs =
- _testBean1Symbol.getTypeDescriptor().getSuperTypeSignatures();
-
- // should only have java.lang.Object as a super
- assertEquals(superSigs.size(), 1);
- assertEquals("Ljava.lang.Object;", (String)superSigs.get(0));
-
- // TestBean1Subclass
- superSigs =
- _testBean1SubclassSymbol.getTypeDescriptor().getSuperTypeSignatures();
-
- // should have Object and TestBean1 as parents
- assertEquals(superSigs.size(), 2);
- assertTrue(superSigs.contains("Ljava.lang.Object;"));
- assertTrue(superSigs.contains("Lcom.test.TestBean1;"));
-
- // TestBean2
- superSigs =
- _testBean2Symbol.getTypeDescriptor().getSuperTypeSignatures();
-
- // should only have java.lang.Object as a super
- assertEquals(superSigs.size(), 1);
- assertEquals("Ljava.lang.Object;", (String)superSigs.get(0));
-
- // TestBean2Subclass
- superSigs =
- _testBean2SubclassSymbol.getTypeDescriptor().getSuperTypeSignatures();
- // should have Object and TestBean2 as parents
- assertEquals(superSigs.size(), 2);
- assertTrue(superSigs.contains("Ljava.lang.Object;"));
- assertTrue(superSigs.contains("Lcom.test.TestBean2;"));
-
- }
-
- /**
- * Test the acquisition of the interface implemented on TestBean2 and its subclass
- */
- public void testInterfaceAcquisition()
- {
- // TestBean2
- List superSigs =
- _testBean2Symbol.getTypeDescriptor().getInterfaceTypeSignatures();
-
- // should only have ITestBean2
- assertEquals(superSigs.size(), 1);
- assertEquals("Lcom.test.ITestBean2;", (String)superSigs.get(0));
-
- // TestBean2Subclass
- superSigs =
- _testBean2SubclassSymbol.getTypeDescriptor().getInterfaceTypeSignatures();
- // should only have ITestBean2
- assertEquals(superSigs.size(), 1);
- assertEquals("Lcom.test.ITestBean2;", (String)superSigs.get(0));
- }
-
-// coverage of EObject generated methods
-
- /**
- * Cover isSet
- */
- public void testIsESet()
- {
- IType testBean1Type = null;
-
- try
- {
- testBean1Type =
- _jdtTestEnvironment.getJavaProject().
- findType(packageName1+"."+testBeanName1);
- }
- catch (JavaModelException jme)
- {
- fail(jme.getLocalizedMessage());
- }
-
- assertNotNull(testBean1Type);
-
- IJavaTypeDescriptor2 desc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
-
- // there are methods and one property on TestBean2
- assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties()));
- assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods()));
- //assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIBeanInstanceSymbol_escriptor()));
-
- desc.eSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties(),
- _testBean2Symbol.getJavaTypeDescriptor().getBeanProperties());
- desc.eSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods(),
- _testBean2Symbol.getJavaTypeDescriptor().getBeanMethods());
- desc.eSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type(),
- testBean1Type);
-
- assertFalse(((List)desc.eGet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties())).size()
- == 0);
- assertFalse(((List)desc.eGet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods())).size()
- == 0);
- assertEquals(desc.eGet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type()),
- testBean1Type);
-
- assertTrue(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties()));
- assertTrue(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods()));
- assertTrue(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type()));
-
- desc.eUnset(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties());
- desc.eUnset(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods());
- desc.eUnset(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type());
-
- // there are methods and one property on TestBean2
- assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanProperties()));
- assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_BeanMethods()));
- assertFalse(desc.eIsSet(SymbolPackage.eINSTANCE.getIJavaTypeDescriptor2_Type()));
- }
-
- /**
- * Cover the toString
- */
- public void testToString()
- {
- _testBean2Symbol.getTypeDescriptor().toString();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2_ChangeStability.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2_ChangeStability.java
deleted file mode 100644
index d268c51..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIJavaTypeDescriptor2_ChangeStability.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.Type;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.util.TypeUtil;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ITypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.text.edits.TextEdit;
-
-
-/**
- * Tests the java type descriptor's ability to react correctly to changes
- * in its underlying type. This is very important when type and symbol caching
- * are enabled.
- *
- * @author cbateman
- *
- */
-public class TestIJavaTypeDescriptor2_ChangeStability extends ModelBaseTestCase
-{
- private IBeanInstanceSymbol _testBean1Symbol;
- private IBeanInstanceSymbol _testBean2Symbol;
-
- private Map<String, IPropertySymbol> _beanProperties;
- private Map<String, IBeanMethodSymbol> _bean1Methods;
- private Map<String, IBeanMethodSymbol> _bean2Methods;
- private Map<String, IPropertySymbol> _bean2Properties;
-
- private final static String packageName1 = "com.test";
- private final static String testBeanName1 = "TestBean1";
- private final static String testBeanName2 = "TestBean2";
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // load ITestBean2 first due to later dependencies
- loadSourceClass(ContextSymbolTestPlugin.getDefault().getBundle(), "/testdata/ITestBean2.java.data", packageName1, "ITestBean2");
-
- // load another bean first since others have a dependency on on it
- loadSourceClass(TestsPlugin.getDefault().getBundle(), "/testfiles/AnotherBean.java.data", packageName1, "AnotherBean");
- assertNotNull(_jdtTestEnvironment.getJavaProject().findType(packageName1+"."+"AnotherBean"));
-
- _beanProperties = new HashMap<String, IPropertySymbol>();
- _testBean1Symbol =
- setupBeanProperty(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data", packageName1,
- testBeanName1, _beanProperties);
- _bean1Methods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(_bean1Methods, _testBean1Symbol);
-
- _bean2Methods = new HashMap<String, IBeanMethodSymbol>();
- _testBean2Symbol =
- setupBeanMethods("/testdata/TestBean2.java.data", testBeanName2, _bean2Methods);
- _bean2Properties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean2Symbol, _bean2Properties);
- }
-
-
- private IBeanInstanceSymbol setupBeanMethods(String fileName, String beanClassName, Map<String, IBeanMethodSymbol> methods) throws Exception
- {
- loadSourceClass(ContextSymbolTestPlugin.getDefault().getBundle(), fileName, packageName1, beanClassName);
-
- final IType testBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(packageName1+"."+beanClassName);
- assertNotNull(testBean1Type);
-
- final IJavaTypeDescriptor2 testBeanDescriptor =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- testBeanDescriptor.setType(testBean1Type);
-
- IBeanInstanceSymbol bean =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- bean.setTypeDescriptor(testBeanDescriptor);
- bean.setName(beanClassName);
- populateMethodMap(methods, bean);
- return bean;
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- _jdtTestEnvironment.getProjectEnvironment().getTestProject().delete(true, null);
- }
-
- private final static String NON_BEAN_METHOD_CONTENTS = "public String myActionSource(){return \"foo\";}";
- private final static String NON_BEAN_METHOD_SIG = Signature.createMethodSignature(new String[0], TypeConstants.TYPE_STRING);
- /**
- * Check the affect of adding a non-bean (not a getter/setter match) on
- * the IJavaTypeDescriptor2
- */
- public void testAddNonBeanMethod() throws Exception
- {
- // pre-cond => basic setup
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod newMethod = type.createMethod(NON_BEAN_METHOD_CONTENTS, null, true, null);
- assertNotNull(newMethod);
- assertEquals(NON_BEAN_METHOD_SIG, TypeUtil.resolveMethodSignature(type, newMethod.getSignature()));
- assertTrue(newMethod.exists());
-
- // post-cond: bean has new method
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size()+1, newMethods.size());
- // should be the same if we remove the new method
- assertNotNull(newMethods.remove("myActionSource"));
- compareMethodMaps(_bean1Methods, newMethods);
-
- // post-cond: properties are unchanged
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- compareSymbolMaps(_beanProperties, newProperties);
- }
-
- public void testRemoveNonBeanMethod() throws Exception
- {
- // pre-cond => basic setup, delete a non-bean method
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod method = type.getMethod("get", new String[0]);
- assertNotNull(method);
- method.delete(true, null);
- assertFalse(method.exists());
-
- // post-cond: bean has one less method
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size()-1, newMethods.size());
- assertTrue(newMethods.get("get") == null);
- // should be the same if we remove the method from expected
- assertNotNull(_bean1Methods.remove("get"));
- compareMethodMaps(_bean1Methods, newMethods);
-
- // post-cond: properties are unchanged
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- compareSymbolMaps(_beanProperties, newProperties);
- }
-
- private final static String BEAN_PROPERTY_NAME = "anAddedStringProperty";
- private final static String BEAN_METHOD_NAME = "getAnAddedStringProperty";
- private final static String BEAN_METHOD_CONTENTS =
- "public String "+BEAN_METHOD_NAME+"() {return \"foo\";}";
- private final static String BEAN_METHOD_SIG =
- Signature.createMethodSignature(new String[0], TypeConstants.TYPE_STRING);
-
- public void testAddBeanMethod() throws Exception
- {
- // pre-cond => basic setup
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod newMethod = type.createMethod(BEAN_METHOD_CONTENTS, null, true, null);
- assertNotNull(newMethod);
- assertTrue(newMethod.exists());
- assertEquals(BEAN_METHOD_SIG, TypeUtil.resolveMethodSignature(type, newMethod.getSignature()));
-
- {
- // post-cond: bean has new method
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size()+1, newMethods.size());
- // should be the same if we remove the new method
- assertNotNull(newMethods.remove(BEAN_METHOD_NAME));
- compareMethodMaps(_bean1Methods, newMethods);
- }
-
- {
- // post-cond: bean has a new property
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- assertEquals(_beanProperties.size()+1, newProperties.size());
- // should be the same if we remove the new property
- IPropertySymbol prop = newProperties.remove(BEAN_PROPERTY_NAME);
- assertEquals(TypeConstants.TYPE_STRING, prop.getTypeDescriptor().getTypeSignature());
- compareSymbolMaps(_beanProperties, newProperties);
- }
- }
-
- private final static String EXISTING_BEAN_PROPERTY_TO_REMOVE = "readonlyStringProperty";
- private final static String EXISTING_BEAN_METHOD = "getReadonlyStringProperty";
- private final static String EXISTING_BEAN_METHOD_SIG = BEAN_METHOD_SIG;
-
- public void testRemoveBeanMethod() throws Exception
- {
- // pre-cond => basic setup, delete a non-bean method
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod method = type.getMethod(EXISTING_BEAN_METHOD, new String[0]);
- assertNotNull(method);
- assertEquals(EXISTING_BEAN_METHOD_SIG, TypeUtil.resolveMethodSignature(type, method.getSignature()));
- assertTrue(method.exists());
- method.delete(true, null);
- assertFalse(method.exists());
-
- // post-cond: bean has one less method
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size()-1, newMethods.size());
- assertTrue(newMethods.get(EXISTING_BEAN_METHOD) == null);
- // should be the same if we remove the method from expected
- assertNotNull(_bean1Methods.remove(EXISTING_BEAN_METHOD));
- compareMethodMaps(_bean1Methods, newMethods);
-
- // post-cond: bean has one less property
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- assertEquals(_beanProperties.size()-1, newProperties.size());
- // should be the same if we remove the same property from the expected
- IPropertySymbol prop = _beanProperties.remove(EXISTING_BEAN_PROPERTY_TO_REMOVE);
- assertEquals(TypeConstants.TYPE_STRING, prop.getTypeDescriptor().getTypeSignature());
- compareSymbolMaps(_beanProperties, newProperties);
- }
-
- // NOTE: it is ADifferentReadonlyPropertyName with a capital "A" because it is followed
- // by a capital letter (D), which by bean rules means don't lower-cap the property name
- private final static String NEW_READONLY_BEAN_PROP_NAME = "ADifferentReadonlyPropertyName";
- private final static String NEW_READONLY_BEAN_METHOD_NAME = "getADifferentReadonlyPropertyName";
-
- public void testRenameBeanProperty() throws Exception
- {
- // pre-cond => basic setup, delete a non-bean method
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod method = type.getMethod(EXISTING_BEAN_METHOD, new String[0]);
- assertNotNull(method);
- assertEquals(EXISTING_BEAN_METHOD_SIG, TypeUtil.resolveMethodSignature(type, method.getSignature()));
- assertTrue(method.exists());
- method.rename(NEW_READONLY_BEAN_METHOD_NAME, false, null);
- method = type.getMethod(NEW_READONLY_BEAN_METHOD_NAME, new String[0]);
- assertTrue(method.exists());
-
- // post-cond: bean has same number of methods
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size(), newMethods.size());
- assertTrue(newMethods.get(EXISTING_BEAN_METHOD) == null);
- // should be the same if we remove existing and add new one from newMethods
- assertNotNull(_bean1Methods.remove(EXISTING_BEAN_METHOD));
- IBeanMethodSymbol changedMethod = newMethods.get(NEW_READONLY_BEAN_METHOD_NAME);
- assertEquals(BEAN_METHOD_SIG, changedMethod.getSignature());
- _bean1Methods.put(NEW_READONLY_BEAN_METHOD_NAME, changedMethod);
- compareMethodMaps(_bean1Methods, newMethods);
-
- // post-cond: bean has same number of properties
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- assertEquals(_beanProperties.size(), newProperties.size());
- // should be the same if we replace with the new property
- IPropertySymbol prop = newProperties.get(NEW_READONLY_BEAN_PROP_NAME);
- assertNotNull(prop);
- assertEquals(TypeConstants.TYPE_STRING, prop.getTypeDescriptor().getTypeSignature());
- assertNotNull(_beanProperties.remove(EXISTING_BEAN_PROPERTY_TO_REMOVE));
- _beanProperties.put(prop.getName(), prop);
- compareSymbolMaps(_beanProperties, newProperties);
- }
-
- private static final String READONLY_BEAN_REPLACEMENT_METHOD =
- "public Integer "+EXISTING_BEAN_METHOD+"(){return new Integer(4);}";
- private static final String READONLY_BEAN_REPLACEMENT_SIG =
- Signature.createMethodSignature(new String[0], TypeConstants.TYPE_BOXED_INTEGER);
-
- public void testChangeTypeOfGetter() throws Exception
- {
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod method = type.getMethod(EXISTING_BEAN_METHOD, new String[0]);
- assertNotNull(method);
- assertTrue(method.exists());
-
- // remove old, add new
- method.delete(true, null);
- assertFalse(method.exists());
- type.createMethod(READONLY_BEAN_REPLACEMENT_METHOD, null, true, null);
- assertTrue(method.exists());
-
- // post-cond: bean has the same number of methods
- // but, we need to replace the changed one in _bean1Methods
- // for the maps to equal
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size(), newMethods.size());
- assertNotNull(newMethods.get(EXISTING_BEAN_METHOD));
- IBeanMethodSymbol methodSymbol = _bean1Methods.remove(EXISTING_BEAN_METHOD);
- assertNotNull(methodSymbol);
- assertEquals(EXISTING_BEAN_METHOD_SIG, methodSymbol.getSignature());
- // should be the same if we swap the new method into the old map
- methodSymbol = newMethods.get(EXISTING_BEAN_METHOD);
- assertNotNull(methodSymbol);
- assertEquals(READONLY_BEAN_REPLACEMENT_SIG, methodSymbol.getSignature());
- _bean1Methods.put(EXISTING_BEAN_METHOD, methodSymbol);
- compareMethodMaps(_bean1Methods, newMethods);
-
- // post-cond: bean's type signature has changed
- // post-cond: same number of props
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- assertEquals(_beanProperties.size(), newProperties.size());
- // should be the same if we replace the same property from the expected
- IPropertySymbol prop = _beanProperties.remove(EXISTING_BEAN_PROPERTY_TO_REMOVE);
- assertEquals(TypeConstants.TYPE_STRING, prop.getTypeDescriptor().getTypeSignature());
- prop = newProperties.get(EXISTING_BEAN_PROPERTY_TO_REMOVE);
- assertEquals(TypeConstants.TYPE_BOXED_INTEGER, prop.getTypeDescriptor().getTypeSignature());
- _beanProperties.put(EXISTING_BEAN_PROPERTY_TO_REMOVE, prop);
- compareSymbolMaps(_beanProperties, newProperties);
- }
-
- private final static String WRITEONLY_BEAN_PROPERTY_NAME =
- "writeonlyStringProperty";
- private final static String WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME =
- "setWriteonlyStringProperty";
- private final static String WRITEONLY_BEAN_REPLACMENT_CONTENTS =
- "public void "+WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME
- +"(Integer newValue){}";
- private final static String EXISTING_BEAN_SETTER_METHOD_SIG =
- Signature.createMethodSignature(new String[] {TypeConstants.TYPE_STRING}, Signature.SIG_VOID);
- private final static String REPLACEMENT_BEAN_SETTER_METHOD_SIG =
- Signature.createMethodSignature(new String[] {TypeConstants.TYPE_BOXED_INTEGER}, Signature.SIG_VOID);
-
- public void testChangeTypeOfSetter() throws Exception
- {
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- IMethod method = type.getMethod(WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME, new String[]{"QString;"});
- assertNotNull(method);
- assertTrue(method.exists());
-
- // remove old, add new
- method.delete(true, null);
- assertFalse(method.exists());
- method = type.createMethod(WRITEONLY_BEAN_REPLACMENT_CONTENTS, null, true, null);
- assertTrue(method.exists());
-
- // post-cond: bean has the same number of methods
- // but, we need to replace the changed one in _bean1Methods
- // for the maps to equal
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- assertEquals(_bean1Methods.size(), newMethods.size());
- assertNotNull(newMethods.get(WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME));
- IBeanMethodSymbol methodSymbol =
- _bean1Methods.remove(WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME);
- assertNotNull(methodSymbol);
- assertEquals(EXISTING_BEAN_SETTER_METHOD_SIG, methodSymbol.getSignature());
- // should be the same if we swap the new method into the old map
- methodSymbol = newMethods.get(WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME);
- assertNotNull(methodSymbol);
- assertEquals(REPLACEMENT_BEAN_SETTER_METHOD_SIG, methodSymbol.getSignature());
- _bean1Methods.put(WRITEONLY_BEAN_REPLACEMENT_METHOD_NAME, methodSymbol);
- compareMethodMaps(_bean1Methods, newMethods);
-
- // post-cond: bean's type signature has changed
- // post-cond: same number of props
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- assertEquals(_beanProperties.size(), newProperties.size());
- // should be the same if we replace the same property from the expected
- IPropertySymbol prop = _beanProperties.remove(WRITEONLY_BEAN_PROPERTY_NAME);
- assertEquals(TypeConstants.TYPE_STRING, prop.getTypeDescriptor().getTypeSignature());
- prop = newProperties.get(WRITEONLY_BEAN_PROPERTY_NAME);
- assertEquals(TypeConstants.TYPE_BOXED_INTEGER, prop.getTypeDescriptor().getTypeSignature());
- _beanProperties.put(WRITEONLY_BEAN_PROPERTY_NAME, prop);
- compareSymbolMaps(_beanProperties, newProperties);
- }
-
- public void testAddSuperType() throws Exception
- {
- IType type = _testBean1Symbol.getJavaTypeDescriptor().getType();
- changeSuperType(type, _testBean2Symbol.getJavaTypeDescriptor().getType());
-
- // post-cond: bean has the same number of methods
- // but, we need to replace the changed one in _bean1Methods
- // for the maps to equal
- Map<String, IBeanMethodSymbol> newMethods = new HashMap<String, IBeanMethodSymbol>();
- populateMethodMap(newMethods,_testBean1Symbol);
- Map<String, IBeanMethodSymbol> mergedMethodMap = new HashMap<String, IBeanMethodSymbol>();
- mergedMethodMap.putAll(_bean1Methods);
- mergedMethodMap.putAll(_bean2Methods);
-
- assertEquals(mergedMethodMap.size(), newMethods.size());
- compareMethodMaps(mergedMethodMap, newMethods);
-
- // post-cond: bean's type signature has changed
- // post-cond: same number of props
- Map<String, IPropertySymbol> newProperties = new HashMap<String, IPropertySymbol>();
- populatePropertyMap(_testBean1Symbol, newProperties);
- // should be the same if we merge the two expected maps
- Map<String, IPropertySymbol> mergedSymbolMap = new HashMap<String, IPropertySymbol>();
- mergedSymbolMap.putAll(_beanProperties);
- mergedSymbolMap.putAll(_bean2Properties);
- // bean 2 has a single bean property
- assertEquals(mergedSymbolMap.size(), newProperties.size());
- compareSymbolMaps(mergedSymbolMap, newProperties);
- }
-
- private void populateMethodMap(Map<String, IBeanMethodSymbol> methods, IBeanInstanceSymbol bean)
- {
- List methodList = bean.getMethods();
- for(final Iterator it = methodList.iterator(); it.hasNext();)
- {
- final IBeanMethodSymbol method = (IBeanMethodSymbol) it.next();
- methods.put(method.getName(), method);
- }
- }
-
- private void compareSymbolMaps(Map<String, ? extends IObjectSymbol> expected, Map<String, ? extends IObjectSymbol> actual)
- {
- assertEquals(expected.size(), actual.size());
-
- for (String name : actual.keySet())
- {
- ITypeDescriptor expectedTypeDesc = expected.get(name).getTypeDescriptor();
- ITypeDescriptor actualTypeDesc = actual.get(name).getTypeDescriptor();
-
- assertTypeDescriptorsSame(expectedTypeDesc, actualTypeDesc);
- }
- }
-
- private void compareMethodMaps(Map<String, ? extends IMethodSymbol> expected, Map<String, ? extends IMethodSymbol> actual)
- {
- assertEquals(expected.size(), actual.size());
-
- for (String name : actual.keySet())
- {
- assertEquals(expected.get(name).getSignature(), actual.get(name).getSignature());
- }
- }
-
- private void assertTypeDescriptorsSame(ITypeDescriptor expectedTypeDesc, ITypeDescriptor actualTypeDesc)
- {
- assertEquals(expectedTypeDesc.getTypeSignature()
- , actualTypeDesc.getTypeSignature());
- if (expectedTypeDesc.getArrayElement() != null)
- {
- assertNotNull(actualTypeDesc.getArrayElement());
- assertTypeDescriptorsSame(expectedTypeDesc.getArrayElement().getTypeDescriptor()
- , actualTypeDesc.getArrayElement().getTypeDescriptor());
- }
- else
- {
- assertNull(actualTypeDesc.getArrayElement());
- }
-
- assertEquals(expectedTypeDesc.getInterfaceTypeSignatures()
- , actualTypeDesc.getInterfaceTypeSignatures());
- assertEquals(expectedTypeDesc.getSuperTypeSignatures()
- , actualTypeDesc.getSuperTypeSignatures());
- assertEquals(expectedTypeDesc.getTypeParameterSignatures()
- , actualTypeDesc.getTypeParameterSignatures());
- }
-
- private void changeSuperType(IType type, IType newSuperType) throws Exception
- {
- ICompilationUnit cu = type.getCompilationUnit().getWorkingCopy(null);
- CompilationUnit astRoot = createASTAndStartRecording(cu);
-
- // modify the AST
- TypeDeclaration typeDeclaration = (TypeDeclaration)astRoot.types().get(0);
- AST ast = typeDeclaration.getAST();
- Name superName = ast.newName(newSuperType.getFullyQualifiedName());
- Type superType = ast.newSimpleType(superName);
- typeDeclaration.setSuperclassType(superType);
-
- commitAST(cu, astRoot);
- }
-
- private CompilationUnit createASTAndStartRecording(ICompilationUnit cu) throws Exception
- {
- // creation of DOM/AST from a ICompilationUnit
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(cu);
- // start record of the modifications
- CompilationUnit astRoot = (CompilationUnit) parser.createAST(null);
- astRoot.recordModifications();
- return astRoot;
- }
-
- private void commitAST(ICompilationUnit cu, CompilationUnit astRoot) throws Exception
- {
- String source = cu.getBuffer().getContents();
- Document document= new Document(source);
-
- // computation of the text edits
- TextEdit edits = astRoot.rewrite(document, cu.getJavaProject().getOptions(true));
-
- // computation of the new source code
- edits.apply(document);
- String newSource = document.get();
-
- // update of the compilation unit
- cu.getBuffer().setContents(newSource);
- cu.commitWorkingCopy(true, null);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIMapTypeDescriptor.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIMapTypeDescriptor.java
deleted file mode 100644
index c59b321..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIMapTypeDescriptor.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.designtime.internal.symbols.ResourceBundleMapSourceFactory;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-
-public class TestIMapTypeDescriptor extends ModelBaseTestCase
-{
- private IFile _propertyFile;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- // add a resource bundle to the default package to test regression on
- // bug 144525
- final TestFileResource resource = new TestFileResource();
- resource.load(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/bundle.properties.data");
- _propertyFile = _jdtTestEnvironment.addResourceFile("src",
- new ByteArrayInputStream(resource.toBytes()), "res",
- "Bundle.properties");
- assertTrue(_propertyFile.isAccessible());
- }
-
- public void testResBoundDescriptor() throws JavaModelException,
- IOException, CoreException
- {
- final Map mapSource = ResourceBundleMapSourceFactory
- .getResourceBundleMapSource(_jdtTestEnvironment
- .getProjectEnvironment().getTestProject(), "res.Bundle");
- final IMapTypeDescriptor typeDesc = SymbolFactory.eINSTANCE
- .createIMapTypeDescriptor();
- typeDesc.setMapSource(mapSource);
- Map<String, IPropertySymbol> map = createMap(typeDesc);
- assertEquals(3, map.size());
-
- assertTrue(map.containsKey("simpleprop"));
- assertFalse(map.get("simpleprop").isIntermediate());
- assertTrue(map.containsKey("two"));
- assertTrue(map.get("two").isIntermediate());
- assertTrue(map.containsKey("three"));
- assertTrue(map.get("three").isIntermediate());
- }
-
- public void testDeleteBundle() throws Exception
- {
- final Map mapSource = ResourceBundleMapSourceFactory
- .getResourceBundleMapSource(_jdtTestEnvironment
- .getProjectEnvironment().getTestProject(), "res.Bundle");
- final IMapTypeDescriptor typeDesc = SymbolFactory.eINSTANCE
- .createIMapTypeDescriptor();
- typeDesc.setMapSource(mapSource);
- Map<String, IPropertySymbol> map = createMap(typeDesc);
- assertEquals(3, map.size());
- deleteAndWaitFor(_propertyFile);
- EList properties = typeDesc.getProperties();
- assertEquals(0, properties.size());
- }
-
- public void testDeleteAndRecreate() throws Exception
- {
- {
- final Map mapSource = ResourceBundleMapSourceFactory
- .getResourceBundleMapSource(_jdtTestEnvironment
- .getProjectEnvironment().getTestProject(),
- "res.Bundle");
- final IMapTypeDescriptor typeDesc = SymbolFactory.eINSTANCE
- .createIMapTypeDescriptor();
- typeDesc.setMapSource(mapSource);
- Map<String, IPropertySymbol> map = createMap(typeDesc);
- assertEquals(3, map.size());
- }
-
- deleteAndWaitFor(_propertyFile);
-
- {
- final TestFileResource resource = new TestFileResource();
- resource.load(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/bundle2.properties.data");
- _propertyFile = _jdtTestEnvironment.addResourceFile("src",
- new ByteArrayInputStream(resource.toBytes()), "res",
- "Bundle.properties");
-
- final Map mapSource = ResourceBundleMapSourceFactory
- .getResourceBundleMapSource(_jdtTestEnvironment
- .getProjectEnvironment().getTestProject(),
- "res.Bundle");
- final IMapTypeDescriptor typeDesc = SymbolFactory.eINSTANCE
- .createIMapTypeDescriptor();
- typeDesc.setMapSource(mapSource);
- Map<String, IPropertySymbol> map = createMap(typeDesc);
- // it's different bundle but with the same name
- assertEquals(4, map.size());
- }
- }
-
- private void deleteAndWaitFor(final IResource res)
- {
- JSFTestUtil.safeDelete(res, 10, 500);
- for (int i = 0; i < 10; i++)
- {
- if (res.isAccessible())
- {
- try
- {
- Thread.sleep(500);
- } catch (InterruptedException e)
- {
- // do nothing
- }
- }
- }
- assertFalse(res.isAccessible());
- }
-
- private Map<String, IPropertySymbol> createMap(final IMapTypeDescriptor desc)
- {
- final Map<String, IPropertySymbol> map = new HashMap<String, IPropertySymbol>();
- EList properties = desc.getProperties();
- for (final Iterator it = properties.iterator(); it.hasNext();)
- {
- IPropertySymbol prop = (IPropertySymbol) it.next();
- map.put(prop.getName(), prop);
- }
- return map;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIPropertySymbolItemProvider.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIPropertySymbolItemProvider.java
deleted file mode 100644
index 4873854..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestIPropertySymbolItemProvider.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.provider.IContentProposalProvider;
-import org.eclipse.jst.jsf.context.symbol.provider.ProposalCreationFactoryAdapter;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Tests for TestIPropertySymbolItemProvider
- *
- * @author cbateman
- *
- */
-public class TestIPropertySymbolItemProvider extends TestCase
-{
- private Properties props;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TestFileResource propertiesFile = new TestFileResource();
- propertiesFile.load(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/bundle.properties.data");
- props = new Properties();
- props.load(new ByteArrayInputStream(propertiesFile.toBytes()));
- }
-
- /**
- * Ensure test is in sync with test data and other sanity checks
- */
- public void testSanity()
- {
- assertEquals(props.size(), 3);
- }
-
- /**
- * Test completion proposal construction for a properties map
- */
- public void testProposalConstructionForMap()
- {
- IMapTypeDescriptor mapDesc =
- SymbolFactory.eINSTANCE.createIMapTypeDescriptor();
- mapDesc.setImmutable(true);
- mapDesc.setMapSource(props);
-
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("myTestSymbol");
- symbol.setTypeDescriptor(mapDesc);
-
- final ComposedAdapterFactory factory =
- new ComposedAdapterFactory(
- ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- final MyCompletionFactory creationInfo = new MyCompletionFactory();
-
- for (final Iterator it = symbol.getTypeDescriptor().getProperties().iterator(); it.hasNext();)
- {
- final ISymbol propSymbol = (ISymbol) it.next();
- final Object provider =
- factory.adapt(propSymbol, IContentProposalProvider.class);
-
- assertTrue(provider instanceof IContentProposalProvider);
-
- final ICompletionProposal[] proposal =
- ((IContentProposalProvider) provider).
- getProposals(propSymbol, creationInfo);
-
- assertNotNull(proposal);
- }
-
- List list = creationInfo._replacementText;
-
- assertEquals(list.size(), 3);
-
- for (final Iterator it = list.iterator();it.hasNext();)
- {
- String replacementText = (String) it.next();
-
- if (replacementText.startsWith("['"))
- {
- replacementText = replacementText.substring(2);
- replacementText = replacementText.substring(0, replacementText.length()-2);
- }
- assertTrue(props.containsKey(replacementText));
- }
- }
-
- private class MyCompletionFactory extends ProposalCreationFactoryAdapter
- {
- final List<String> _replacementText;
-
- /**
- *
- */
- public MyCompletionFactory()
- {
- super(0, 0);
- _replacementText = new ArrayList<String>();
- }
-
- public ICompletionProposal createProposal(String replacementText, String displayText, String additionalText, Image displayImage, Object targetObject)
- {
- _replacementText.add(replacementText);
-
- return super.createProposal(replacementText, displayText, additionalText,
- displayImage, targetObject);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestTypeCoercion.java b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestTypeCoercion.java
deleted file mode 100644
index cea4f35..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/src/org/eclipse/jst/jsf/context/symbol/tests/TestTypeCoercion.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBoundedListTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IBoundedMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.ITypeDescriptor;
-
-/**
- *
- * @author cbateman
- *
- */
-public class TestTypeCoercion extends ModelBaseTestCase
-{
- private final static String packageName = "com.test";
- private IBeanInstanceSymbol _testMapBeanSymbol;
- private IBeanInstanceSymbol _testListBeanSymbol;
- private IBeanInstanceSymbol _testBeanWithGenericProperties;
- private Map<String, IPropertySymbol> _genericProperties;
-
- // used as the int argument to List.get(int)
- private final static ValueType LIST_GETTER_ARG = new ValueType(Signature.SIG_INT, ValueType.ASSIGNMENT_TYPE_RHS);
-
- // used as a String argument to List.get(String)
- private final static ValueType MAP_GETTER_ARG_STRING = new ValueType(TypeConstants.TYPE_STRING, ValueType.ASSIGNMENT_TYPE_RHS);
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _testMapBeanSymbol =
- setupBeanProperty(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/TestBeanMap.java.data", packageName,
- "TestBeanMap", new HashMap<String, IPropertySymbol>());
-
- _testListBeanSymbol =
- setupBeanProperty(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/MyListBean.java.data", packageName,
- "MyListBean", new HashMap<String, IPropertySymbol>());
-
- _genericProperties = new HashMap<String, IPropertySymbol>();
-
- _testBeanWithGenericProperties =
- setupBeanProperty(ContextSymbolTestPlugin.getDefault().getBundle(),
- "/testdata/TestBeanWithGenericProperties.java.data", packageName,
- "TestBeanWithGenericProperties",_genericProperties);
- }
-
- /**
- * Test Sanity of setup
- */
- public void testSanity()
- {
- assertNotNull(_testMapBeanSymbol);
- assertNotNull(_testListBeanSymbol);
- assertNotNull(_testBeanWithGenericProperties);
- }
-
- /**
- * Test the basic semantics of a bean that implements Map
- */
- public void testBasicMapBean()
- {
- assertTrue(_testMapBeanSymbol.getTypeDescriptor().instanceOf(TypeConstants.TYPE_MAP));
- assertTrue(_testMapBeanSymbol.supportsCoercion(TypeConstants.TYPE_MAP));
- final ITypeDescriptor typeDesc =
- _testMapBeanSymbol.coerce(TypeConstants.TYPE_MAP);
- assertNotNull(typeDesc);
- assertTrue(typeDesc.instanceOf(TypeConstants.TYPE_MAP));
- assertTrue(typeDesc instanceof IBoundedMapTypeDescriptor);
- assertTrue(((IBoundedMapTypeDescriptor)typeDesc).isUnboundedForType(TypeConstants.TYPE_MAP));
- final String testSymbolName = "chelsea";
- ISymbol symbol =
- ((IBoundedMapTypeDescriptor)typeDesc).
- getUnboundedProperty(testSymbolName, TypeConstants.TYPE_MAP);
-
- assertEquals(testSymbolName, symbol.getName());
- }
-
- /**
- * Test basic bean coercion to a list
- */
- public void testBasicListBean()
- {
- assertTrue(_testListBeanSymbol.getTypeDescriptor().instanceOf(TypeConstants.TYPE_LIST));
- assertTrue(_testListBeanSymbol.supportsCoercion(TypeConstants.TYPE_LIST));
- final ITypeDescriptor typeDesc =
- _testListBeanSymbol.coerce(TypeConstants.TYPE_LIST);
- assertNotNull(typeDesc);
- assertTrue(typeDesc.instanceOf(TypeConstants.TYPE_LIST));
- assertTrue(typeDesc instanceof IBoundedListTypeDescriptor);
-
- // a list can only be indexed numerically (i.e. get(int))
- assertTrue(((IBoundedListTypeDescriptor)typeDesc).isUnboundedForType(TypeConstants.TYPE_BOXED_INTEGER));
- final Integer symbolKey = Integer.valueOf(0);
- ISymbol symbol =
- ((IBoundedListTypeDescriptor)typeDesc).
- getUnboundedProperty(symbolKey, TypeConstants.TYPE_BOXED_INTEGER);
-
- assertEquals(symbolKey.toString(), symbol.getName());
-
- }
-
- public void testListGetCall()
- {
- assertTrue(_testListBeanSymbol.getTypeDescriptor().instanceOf(TypeConstants.TYPE_LIST));
- assertTrue(_testListBeanSymbol.supportsCoercion(TypeConstants.TYPE_LIST));
-
- EList<ValueType> valueTypes = new BasicEList<ValueType>();
- valueTypes.add(LIST_GETTER_ARG);
- ISymbol symbol = _testListBeanSymbol.call("get", valueTypes, "listBean[0]");
- assertNotNull(symbol);
- assertTrue(symbol instanceof IPropertySymbol);
- assertEquals(TypeConstants.TYPE_JAVAOBJECT, ((IPropertySymbol)symbol).getTypeDescriptor().getTypeSignature());
- }
-
- public void testMapGetCall()
- {
- assertTrue(_testMapBeanSymbol.getTypeDescriptor().instanceOf(TypeConstants.TYPE_MAP));
- assertTrue(_testMapBeanSymbol.supportsCoercion(TypeConstants.TYPE_MAP));
-
- EList<ValueType> valueTypes = new BasicEList<ValueType>();
- valueTypes.add(MAP_GETTER_ARG_STRING);
- ISymbol symbol = _testMapBeanSymbol.call("get", valueTypes, "foo");
- assertNotNull(symbol);
- assertTrue(symbol instanceof IPropertySymbol);
- assertEquals(TypeConstants.TYPE_JAVAOBJECT, ((IPropertySymbol)symbol).getTypeDescriptor().getTypeSignature());
-
- }
-
- public void testListGetCallWithSimpleTypeArguments()
- {
- final EList<ValueType> valueTypes = new BasicEList<ValueType>();
- valueTypes.add(LIST_GETTER_ARG);
-
- final IPropertySymbol propSymbol =
- _genericProperties.get("listOfStrings");
- assertNotNull(propSymbol);
- assertTrue(propSymbol.supportsCoercion(TypeConstants.TYPE_LIST));
- assertFalse(propSymbol.supportsCoercion(TypeConstants.TYPE_MAP));
- assertEquals(TypeConstants.TYPE_LIST, propSymbol.getTypeDescriptor().getTypeSignature());
- assertEquals(1, propSymbol.getTypeDescriptor().getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, propSymbol.getTypeDescriptor().getTypeParameterSignatures().get(0));
-
- ISymbol symbol = propSymbol.call("get", valueTypes, "listBean[0]");
- assertNotNull(symbol);
- assertTrue(symbol instanceof IPropertySymbol);
- assertEquals(TypeConstants.TYPE_STRING, ((IPropertySymbol)symbol).getTypeDescriptor().getTypeSignature());
- }
-
- public void testMapGetCallWithSimpleTypeArguments()
- {
- final EList<ValueType> valueTypes = new BasicEList<ValueType>();
- valueTypes.add(MAP_GETTER_ARG_STRING);
-
- final IPropertySymbol propSymbol =
- _genericProperties.get("mapOfStringsKeyedByString");
- assertNotNull(propSymbol);
- assertTrue(propSymbol.supportsCoercion(TypeConstants.TYPE_MAP));
- assertFalse(propSymbol.supportsCoercion(TypeConstants.TYPE_LIST));
- assertEquals(TypeConstants.TYPE_MAP, propSymbol.getTypeDescriptor().getTypeSignature());
- assertEquals(2, propSymbol.getTypeDescriptor().getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, propSymbol.getTypeDescriptor().getTypeParameterSignatures().get(0));
- assertEquals(TypeConstants.TYPE_STRING, propSymbol.getTypeDescriptor().getTypeParameterSignatures().get(1));
-
- ISymbol symbol = propSymbol.call("get", valueTypes, "mapBean['someKey']");
- assertNotNull(symbol);
- assertTrue(symbol instanceof IPropertySymbol);
- assertEquals(TypeConstants.TYPE_STRING, ((IPropertySymbol)symbol).getTypeDescriptor().getTypeSignature());
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/test.xml b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/test.xml
deleted file mode 100644
index 67d6320..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.."/> -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jst.jsf.context.symbol.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.jst.jsf.context.symbol.tests.*xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jsf-folder" value="${eclipse-home}/jsf_folder"/>
- <delete dir="${jsf-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jsf-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jst.jsf.context.symbol.tests.AllTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.jst.jsf.context.symbol.tests.*xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data
deleted file mode 100644
index e837d65..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/ITestBean2.java.data
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.test;
-
-public interface ITestBean2
-{
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/MyListBean.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/MyListBean.java.data
deleted file mode 100644
index 95da5d5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/MyListBean.java.data
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.test;
-
-import java.util.AbstractList;
-
-/**
- * A bean class that implements java.util.List
- *
- * @author cbateman
- *
- */
-public class MyListBean extends AbstractList
-{
- public Object get(int index) {
- return null;
- }
-
- public int size() {
- return 0;
- }
-
- /**
- * Simulate a
- * @return
- */
- public String getStringProperty()
- {
- return "";
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data
deleted file mode 100644
index 34d25e9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2.java.data
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.test
-
-public class TestBean2 implements ITestBean2
-{
- public boolean aBooleanMethodWithNoArgs()
- {
- return false;
- }
-
- public String aStringMethodWithNoArgs()
- {
- return true;
- }
-
- public boolean isAnIsAccessor()
- {
- return false;
- }
-
- public int aIntegerMethodThatTakesAString(String arg)
- {
- return -1;
- }
-
- public int aIntegerMethodThatTakesAStringAndLong(String arg1, Long arg2)
- {
- return -1;
- }
-
- public void overloadedMethod(int a)
- {
- }
-
- public void overloadedMethod(String a)
- {
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data
deleted file mode 100644
index cbe2224..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBean2Subclass.java.data
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.test
-
-public class TestBean2Subclass extends TestBean2
-{
- public void validate(TestBean2 parentBean)
- {
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanMap.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanMap.java.data
deleted file mode 100644
index 1dcf356..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanMap.java.data
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.jst.jsf.context.symbol.tests;
-
-import java.util.AbstractMap;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Test bean class that implements java.util.Map via AbstractMap
- * @author cbateman
- *
- */
-public class TestBeanMap extends AbstractMap {
-
- public Set entrySet()
- {
- return new HashSet();
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanWithGenericProperties.java.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanWithGenericProperties.java.data
deleted file mode 100644
index 733c557..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/TestBeanWithGenericProperties.java.data
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.test;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-
-public class TestBeanWithGenericProperties
-{
- public List<String> getListOfStrings()
- {
- return new ArrayList<String>();
- }
-
- public Map<String, String> getMapOfStringsKeyedByString()
- {
- return new HashMap<String, String>();
- }
-
- public Map<String, TestBean1> getMapOfTestBeansByString()
- {
- return new HashMap<String, TestBean2>();
- }
-
- public Map<String, String> getMutableMapOfStringByString()
- {
- return new HashMap<String, String>();
- }
-
- public void setMutableMapOfStringByString(Map<String,String> map)
- {
- // do nothing, method sig is all that's required
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle.properties.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle.properties.data
deleted file mode 100644
index 02979fd..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle.properties.data
+++ /dev/null
@@ -1,3 +0,0 @@
-simpleprop=blah
-two.dot=value
-three.dot.property=chicken \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle2.properties.data b/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle2.properties.data
deleted file mode 100644
index 38989d9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.context.symbol.tests/testdata/bundle2.properties.data
+++ /dev/null
@@ -1,4 +0,0 @@
-simpleprop=blah
-two.dot=value
-three.dot.property=chicken
-anotherProperty=foobar
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.core.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.core.tests/.cvsignore
deleted file mode 100644
index 3bb4cae..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-build.xml
-javaCompiler.jsfcoretests.jar.args
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/.project b/jsf/tests/org.eclipse.jst.jsf.core.tests/.project
deleted file mode 100644
index bcb3609..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index efa5488..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:02:25 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index fe5af64..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-#Fri Aug 24 19:12:00 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index f866a0b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,58 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.core.tests;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.core.tests.TestsPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Bundle-ClassPath: jsfcoretests.jar
-Require-Bundle: org.eclipse.jst.jsf.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jst.j2ee.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.core.runtime.compatibility;bundle-version="[3.1.100,4.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsf.test.util;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsf.facesconfig;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jface.text,
- org.eclipse.core.net,
- org.eclipse.jst.jsp.core,
- org.eclipse.wst.html.core,
- org.eclipse.ui.ide;bundle-version="3.4.0",
- org.eclipse.jst.common.frameworks,
- org.eclipse.jst.common.project.facet.core,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jem;bundle-version="2.0.400",
- org.junit;bundle-version="3.8.1",
- org.eclipse.jst.jsf.common.runtime;bundle-version="1.1.0"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jst.jsf.core.tests;x-friends:="org.eclipse.jst.jsf.ui.tests,org.eclipse.jst.jsf.context.symbol.tests,org.eclipse.jst.jsf.designtime.tests",
- org.eclipse.jst.jsf.core.tests.appconfig.provider;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.appconfig.validation;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.jsflibraryconfig;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.jsflibraryconfiguration;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.jsflibraryregistry;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.jsflibraryregistry.migration;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.project.facet;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.sanity;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.set;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.tagmatcher;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.types;x-internal:=true,
- org.eclipse.jst.jsf.core.tests.util;
- x-friends:="org.eclipse.jst.jsf.contentassist.tests,
- org.eclipse.jst.jsf.designtime.tests,
- org.eclipse.jst.jsf.validation.el.tests,
- org.eclipse.jst.jsf.ui.tests,
- org.eclipse.jst.pagedesigner.tests",
- org.eclipse.jst.jsf.core.tests.validation
-Plugin-Class: org.eclipse.jst.jsf.core.tests.TestsPlugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.core.tests/about.html
deleted file mode 100644
index 7c80c6c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.core.tests/build.properties
deleted file mode 100644
index e9e65fe..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.html,\
- test.xml,\
- jsfcoretests.jar,\
- testfiles/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = jsfcoretests.jar
-source.jsfcoretests.jar = src/
-output.jsfcoretests.jar = bin/
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.properties
deleted file mode 100644
index 0691ded..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-jsfLibrary.label.0 = FAKE LIB FROM jsf.core.tests (1)
-jsfLibrary.label.1 = FAKE LIB FROM jsf.core.tests (2)
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = JavaServer Faces Tools - Core Tests Plug-in \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.xml
deleted file mode 100644
index 315af5a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/plugin.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- id="id1"
- point="org.eclipse.jst.jsf.core.pluginProvidedJsfLibraries">
- <jsfLibrary
- archiveFilesDelegate="org.eclipse.jst.jsf.core.tests.jsflibraryregistry.TEST_PP_LIBArchiveFilesDelegate"
- isImplementation="true"
- label="%jsfLibrary.label.0"
- maxVersionSupported="v1_1"
- name="TEST_PP_LIB_2">
- </jsfLibrary>
- <jsfLibrary
- archiveFilesDelegate="org.eclipse.jst.jsf.core.tests.jsflibraryregistry.TEST_PP_LIB_EMPTYArchiveFilesDelegate"
- isImplementation="false"
- label="%jsfLibrary.label.1"
- maxVersionSupported="v1_2"
- name="TEST_PP_LIB_EMPTY">
- </jsfLibrary>
- </extension>
-
-<!--
- <extension
- point="org.eclipse.jst.jsf.core.jsfAppConfigManagerFactory">
- <factory
- class="org.eclipse.jst.jsf.core.tests.appconfig.TestJSFAppConfigManagerFactoryFromExtension">
- </factory>
- </extension>
--->
-<!--
- <extension
- point="org.eclipse.jst.jsf.core.jsfAppConfigLocatorProviderFactory">
- <locatorProvider
- class="org.eclipse.jst.jsf.core.tests.appconfig.TestLocatorProvider">
- </locatorProvider>
- </extension>
--->
-</plugin>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java
deleted file mode 100644
index 5393dbe..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.core.tests.appconfig.CompositeJSFAppConfigLocatorProviderStrategyTests;
-import org.eclipse.jst.jsf.core.tests.appconfig.JSFAppConfigManagerFactoryTests;
-import org.eclipse.jst.jsf.core.tests.appconfig.validation.AppConfigValidationUtilTestCase;
-import org.eclipse.jst.jsf.core.tests.contenttype.TestContentTypes;
-import org.eclipse.jst.jsf.core.tests.facet.JsfLibraryProviderTests;
-import org.eclipse.jst.jsf.core.tests.facet.JsfLibraryValidatorTest;
-import org.eclipse.jst.jsf.core.tests.facet.VendorSpecificWebXmlConfigurationForJ2EETest;
-import org.eclipse.jst.jsf.core.tests.facet.VendorSpecificWebXmlConfigurationForJavaEETest;
-import org.eclipse.jst.jsf.core.tests.jsflibraryconfig.JSFLibraryRegistryUtilTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryconfig.JSFProjectLibraryReferenceTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryconfiguration.JSFLibraryReferenceTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryconfiguration.JSFLibraryServerSuppliedReferenceTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryregistry.ArchiveFileTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryregistry.JSFLibraryRegistryPackageTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryregistry.JSFLibraryRegistryTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryregistry.JSFLibraryTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryregistry.MaintainDefaultImplementationAdapterTestCases;
-import org.eclipse.jst.jsf.core.tests.jsflibraryregistry.migration.MigrationV1toV2Test;
-import org.eclipse.jst.jsf.core.tests.project.facet.JSFFacetInstallDataModelProviderTestCases;
-import org.eclipse.jst.jsf.core.tests.set.ConcreteAxiomaticSetTest;
-import org.eclipse.jst.jsf.core.tests.set.NodeSetTest;
-import org.eclipse.jst.jsf.core.tests.set.TestMemberConstraint;
-import org.eclipse.jst.jsf.core.tests.set.TestXPathValidation;
-import org.eclipse.jst.jsf.core.tests.tagmatcher.TestXPathTagMatcher;
-import org.eclipse.jst.jsf.core.tests.types.TypeComparatorTests;
-import org.eclipse.jst.jsf.core.tests.types.TypeTransformerTests;
-import org.eclipse.jst.jsf.core.tests.util.TestJDTBeanIntrospector;
-import org.eclipse.jst.jsf.core.tests.util.TestJDTBeanPropertyWorkingCopy;
-import org.eclipse.jst.jsf.core.tests.util.TestTypeUtil;
-import org.eclipse.jst.jsf.core.tests.validation.TestJSPSemanticsValidator_AttributeValues;
-import org.eclipse.jst.jsf.core.tests.validation.TestJSPSemanticsValidator_Containment;
-
-/**
- * The full test suite for core.tests
- * @author cbateman
- *
- */
-public class AllTests
-{
- /**
- * @return the test suite
- */
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.jst.jsf.core.tests");
- //$JUnit-BEGIN$
- suite.addTestSuite(TestContentTypes.class);
-
- suite.addTestSuite(TestJDTBeanPropertyWorkingCopy.class);
- suite.addTestSuite(TestJDTBeanIntrospector.class);
- suite.addTestSuite(TestTypeUtil.class);
-
- suite.addTestSuite(TypeComparatorTests.class);
- suite.addTestSuite(TypeTransformerTests.class);
-
- suite.addTestSuite(JSFLibraryRegistryTestCases.class);
- suite.addTestSuite(JSFLibraryTestCases.class);
- suite.addTestSuite(ArchiveFileTestCases.class);
- suite.addTestSuite(MaintainDefaultImplementationAdapterTestCases.class);
- suite.addTestSuite(JSFLibraryRegistryPackageTestCases.class);
-
- // comment out temporarily. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=214417
- //suite.addTestSuite(TestLifecycleListener.class);
-
- suite.addTestSuite(JSFFacetInstallDataModelProviderTestCases.class);
-
- // test the jar file appconfig provider
- // TODO C.B: add this back suite.addTestSuite(TestJARFileJSFAppConfigProvider.class);
-
-// suite.addTestSuite(JSFLibraryConfigDialogSettingDataTestCases.class);
- suite.addTestSuite(JSFProjectLibraryReferenceTestCases.class);
-// suite.addTestSuite(JSFLibraryConfigModelTestCases.class);
- suite.addTestSuite(JSFLibraryRegistryUtilTestCases.class);
- suite.addTestSuite(JsfLibraryValidatorTest.class);
-
- suite.addTestSuite(TestJSPSemanticsValidator_Containment.class);
- suite.addTestSuite(TestJSPSemanticsValidator_AttributeValues.class);
- suite.addTestSuite(AppConfigValidationUtilTestCase.class);
- suite.addTestSuite(TestMemberConstraint.class);
- suite.addTestSuite(TestXPathValidation.class);
- suite.addTestSuite(TestXPathTagMatcher.class);
- suite.addTestSuite(ConcreteAxiomaticSetTest.class);
- suite.addTestSuite(NodeSetTest.class);
-
- // NOTE: migration tests affect workspace meta-data files, but they
- // should play nice with others
- // BUT, to be on the safe side, always run them LAST.
- suite.addTestSuite(MigrationV1toV2Test.class);
-
- suite.addTestSuite(JSFLibraryReferenceTestCases.class);
- suite.addTestSuite(JSFLibraryServerSuppliedReferenceTestCases.class);
-
- // Vendor-specific web.xml configuration tests
- suite.addTestSuite(VendorSpecificWebXmlConfigurationForJavaEETest.class);
- suite.addTestSuite(VendorSpecificWebXmlConfigurationForJ2EETest.class);
-
- // Jsf library provider tests
- suite.addTestSuite(JsfLibraryProviderTests.class);
-
- //JSFAppConfig Tests
- suite.addTestSuite(CompositeJSFAppConfigLocatorProviderStrategyTests.class);
- suite.addTestSuite(JSFAppConfigManagerFactoryTests.class);
- //$JUnit-END$
- return suite;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/JSFCoreFastTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/JSFCoreFastTests.java
deleted file mode 100644
index 479cd21..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/JSFCoreFastTests.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.eclipse.jst.jsf.core.tests;
-
-import org.eclipse.jst.jsf.core.tests.resource.AllLifecycleListenerTests;
-import org.eclipse.jst.jsf.core.tests.resource.FastClasspathEntryLifecycleTests;
-import org.eclipse.jst.jsf.core.tests.resource.TestDefaultJarLocator;
-import org.eclipse.jst.jsf.core.tests.resource.TestResourceTracker;
-import org.eclipse.jst.jsf.core.tests.serialization.TLDAttributeSerializationTests;
-import org.eclipse.jst.jsf.test.util.junit4.FastTest;
-import org.junit.experimental.categories.Categories;
-import org.junit.experimental.categories.Categories.IncludeCategory;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Categories.class)
-@IncludeCategory(FastTest.class)
-@SuiteClasses(
-{ AllLifecycleListenerTests.class,
- TestResourceTracker.class, TLDAttributeSerializationTests.class ,
- FastClasspathEntryLifecycleTests.class, TestDefaultJarLocator.class})
-public class JSFCoreFastTests
-{
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/TestsPlugin.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/TestsPlugin.java
deleted file mode 100644
index bbddf88..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/TestsPlugin.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class TestsPlugin extends AbstractUIPlugin {
- private static String ID_BUNDLE = "org.eclipse.jst.jsf.core.tests";
-
- //The shared instance.
- private static TestsPlugin plugin;
-
- /**
- * The constructor.
- */
- public TestsPlugin() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- * @return the plugin
- */
- public static TestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.jst.jsf.core.tests", path);
- }
-
- /**
- * @return the url corresponding to the bundle's install location
- */
- public static URL getInstallLocation() {
- URL installLocation = Platform.getBundle(TestsPlugin.ID_BUNDLE).getEntry("/");
- URL resolvedLocation = null;
- try {
- resolvedLocation = FileLocator.resolve(installLocation);
- }
- catch (IOException e) {
- // impossible
- throw new Error(e);
- }
- return resolvedLocation;
- }
-
- /**
- * @param filepath
- * @return the File for the given path relative to the bundle install location
- */
- public static File getTestFile(String filepath) {
- URL installURL = getInstallLocation();
- //String scheme = installURL.getProtocol();
- String path = installURL.getPath();
- String location = path + filepath;
- File result = new File(location);
- return result;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/CompositeJSFAppConfigLocatorProviderStrategyTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/CompositeJSFAppConfigLocatorProviderStrategyTests.java
deleted file mode 100644
index 5b0cc23..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/CompositeJSFAppConfigLocatorProviderStrategyTests.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.CompositeJSFAppConfigLocatorProviderStrategy;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigLocatorProvider;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.junit.Test;
-
-public class CompositeJSFAppConfigLocatorProviderStrategyTests extends TestCase {
- WebProjectTestEnvironment projectTestEnvironment;
- JDTTestEnvironment jdtTestEnv;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- projectTestEnvironment =
- new WebProjectTestEnvironment("CompositeJSFAppConfigLocatorProviderStrategyTests"+"_"+getName());
- boolean created = projectTestEnvironment.createProject(true);
-
- assertNotNull(projectTestEnvironment);
- assertNotNull(projectTestEnvironment.getTestProject());
- assertTrue(projectTestEnvironment.getTestProject().isAccessible());
-
- if (created) {
- // initialize test case for faces 1.1
- JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(projectTestEnvironment);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- }
- }
-
-//test ext-pt removed as it causes other tests to fail
-// @Test
-// public void testExtPtLocatorProvider() {
-// //uses the TestLocatorProvider that was loaded using ext-pt (currently)
-// CompositeLocatorProviderStrategy strategy = new CompositeLocatorProviderStrategy(projectTestEnvironment.getTestProject(), null);
-// assertNotNull(strategy.getLocators());
-// assertEquals(5, strategy.getLocators().size());//expecting FakeProvider + default set
-// assertTrue(strategy.getLocators().get(0).getClass().getSimpleName().equals("FakeLocator"));
-//
-// IJSFAppConfigManager mgr = JSFAppConfigManagerFactory.getInstance(projectTestEnvironment.getTestProject());
-// assertNotNull(mgr.getManagedBeans());
-// assertEquals(TestLocatorProvider.MANAGED_BEAN_COUNT, mgr.getManagedBeans().size());
-// ManagedBeanType bean = (ManagedBeanType)mgr.getManagedBeans().get(0);
-// assertTrue( bean.getManagedBeanName().getTextContent().contains(TestLocatorProvider.MANAGED_BEAN_NAME_PREFIX));
-// assertTrue( bean.getManagedBeanClass().getTextContent().contains(TestLocatorProvider.MANAGED_BEAN_CLASS_PREFIX));
-// }
-
- @Test
- public void testTestableLocatorProvider() throws Exception {
- //uses the TestLocatorProvider
- int EXPECTED_BEAN_COUNT = 3;
- IJSFAppConfigLocatorProvider testLocatorProvider = new TestLocatorProvider(EXPECTED_BEAN_COUNT);
- projectTestEnvironment.getTestProject().setSessionProperty(CompositeJSFAppConfigLocatorProviderStrategy.TESTABLE_FACTORY_SESSION_KEY, testLocatorProvider);
- CompositeJSFAppConfigLocatorProviderStrategy strategy = new CompositeJSFAppConfigLocatorProviderStrategy(projectTestEnvironment.getTestProject());
- assertNotNull(strategy.getLocators());
- assertEquals(5, strategy.getLocators().size());//expecting FakeProvider + default set
- assertTrue(strategy.getLocators().get(0).getClass().getSimpleName().equals("FakeLocator"));
- }
-
- public void testDefaultLocatorProvider() {
- //since we are not using an extension, if no testable is provided, must be using default
- CompositeJSFAppConfigLocatorProviderStrategy strategy = new CompositeJSFAppConfigLocatorProviderStrategy(projectTestEnvironment.getTestProject());
- assertNotNull(strategy.getLocators());
- assertEquals(4, strategy.getLocators().size());//expecting default set only
- assertTrue(strategy.getLocators().get(0).getClass().getSimpleName().equals("ImplicitRuntimeJSFAppConfigLocater"));
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/JSFAppConfigManagerFactoryTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/JSFAppConfigManagerFactoryTests.java
deleted file mode 100644
index 90ba9b2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/JSFAppConfigManagerFactoryTests.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.JSFAppConfigManagerFactory;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class JSFAppConfigManagerFactoryTests extends TestCase {
- WebProjectTestEnvironment projectTestEnvironment;
- JDTTestEnvironment jdtTestEnv;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- projectTestEnvironment =
- new WebProjectTestEnvironment("JSFAppConfigManagerFactoryTests"+"_"+getName());
- boolean created = projectTestEnvironment.createProject(true);
-
- assertNotNull(projectTestEnvironment);
- assertNotNull(projectTestEnvironment.getTestProject());
- assertTrue(projectTestEnvironment.getTestProject().isAccessible());
-
- if (created) {
- // initialize test case for faces 1.1
- JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(projectTestEnvironment);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- }
- }
-
- public void testDefaultJSFAppConfigManagerSetup() {
- //test extension must be removed for this to work
- IJSFAppConfigManager mgr = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(projectTestEnvironment.getTestProject());
- assertNotNull(mgr);
- assertEquals("org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager", mgr.getClass().getName());
-
- //verify getting same instance when called the second time
- IJSFAppConfigManager mgr2 = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(projectTestEnvironment.getTestProject());
- assertNotNull(mgr2);
- assertEquals(mgr, mgr2);
-
- //verify that the deprecated call results in same instance
- JSFAppConfigManager mgr3 = JSFAppConfigManager.getInstance(projectTestEnvironment.getTestProject());
- assertNotNull(mgr3);
- assertEquals(mgr, mgr3);
- assertNotNull(mgr3.getManagedBeans());
- }
-
-// test extension disabled becuz it screws up tests
-// public void testExtPtJSFAppConfigManagerSetup() {
-// IJSFAppConfigManager mgr = JSFAppConfigManagerFactory.getInstance(projectTestEnvironment.getTestProject());
-// assertNotNull(mgr);
-// assertEquals("TestJSFAppConfigManager", mgr.getClass().getSimpleName());
-// assertNotNull(mgr.getManagedBeans());
-// assertEquals(TestLocatorProvider.MANAGED_BEAN_COUNT, mgr.getManagedBeans().size());
-// ManagedBeanType bean = (ManagedBeanType)mgr.getManagedBeans().get(0);
-// assertTrue( bean.getManagedBeanName().getTextContent().contains(TestLocatorProvider.MANAGED_BEAN_NAME_PREFIX));
-// assertTrue( bean.getManagedBeanClass().getTextContent().contains(TestLocatorProvider.MANAGED_BEAN_CLASS_PREFIX));
-// }
-
- public void testTestableJSFAppConfigManagerSetup() throws Exception {
- projectTestEnvironment.getTestProject().setSessionProperty(JSFAppConfigManagerFactory.TESTABLE_FACTORY_SESSION_KEY, new TestJSFAppConfigManagerFactory());
- IJSFAppConfigManager mgr = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(projectTestEnvironment.getTestProject());
- assertNotNull(mgr);
- assertEquals("TestJSFAppConfigManager", mgr.getClass().getSimpleName());
- assertNotNull(mgr.getManagedBeans());
- assertEquals(TestLocatorProvider.MANAGED_BEAN_COUNT, mgr.getManagedBeans().size());
- ManagedBeanType bean = (ManagedBeanType)mgr.getManagedBeans().get(0);
- assertTrue( bean.getManagedBeanName().getTextContent().contains(TestLocatorProvider.MANAGED_BEAN_NAME_PREFIX));
- assertTrue( bean.getManagedBeanClass().getTextContent().contains(TestLocatorProvider.MANAGED_BEAN_CLASS_PREFIX));
-
- IJSFAppConfigManager mgr2 = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(projectTestEnvironment.getTestProject());
- assertNotNull(mgr2);
- assertEquals(mgr, mgr2);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManager.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManager.java
deleted file mode 100644
index 3744a71..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManager.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.jst.jsf.core.jsfappconfig.IFacesConfigChangeListener;
-import org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider;
-import org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvidersChangeListener;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.CompositeJSFAppConfigLocatorProviderStrategy;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.emf.ReferencedBeanType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-
-public class TestJSFAppConfigManager implements IJSFAppConfigManager {
-
- private IProject _project;
- private IJSFAppConfigManager _manager;
- private final AtomicBoolean _isDisposed = new AtomicBoolean(false);
-
- public TestJSFAppConfigManager(final IProject project,
- final TestLocatorProvider testLocatorProvider) throws Exception{
-
- _project = project;
- _project.setSessionProperty(CompositeJSFAppConfigLocatorProviderStrategy.TESTABLE_FACTORY_SESSION_KEY, testLocatorProvider);
-
- }
-
- public IProject getProject() {
- return _project;
- }
-
- private IJSFAppConfigManager getManager() {
- if (_manager == null) {
- //deprecated is to be expected
- _manager = JSFAppConfigManager.getInstance(_project);
- }
- return _manager;
- }
- public boolean addJSFAppConfigProvidersChangeListener(
- IJSFAppConfigProvidersChangeListener listener) {
- return getManager().addJSFAppConfigProvidersChangeListener(listener);
- }
-
- public boolean removeJSFAppConfigProvidersChangeListener(
- IJSFAppConfigProvidersChangeListener listener) {
- return getManager().removeJSFAppConfigProvidersChangeListener(listener);
- }
-
- public void notifyJSFAppConfigProvidersChangeListeners(
- IJSFAppConfigProvider configProvider, int eventType) {
-
- getManager().notifyJSFAppConfigProvidersChangeListeners(configProvider, eventType);
- }
-
- @SuppressWarnings("rawtypes")
- public Object addFacesConfigChangeListener(Class emfClass,
- IFacesConfigChangeListener listener) {
-
- return getManager().addFacesConfigChangeListener(emfClass, listener);
- }
-
- @SuppressWarnings("rawtypes")
- public Object removeFacesConfigChangeListener(Class emfClass) {
- return getManager().removeFacesConfigChangeListener(emfClass);
- }
-
- public void notifyFacesConfigChangeListeners(Notification notification) {
- getManager().notifyFacesConfigChangeListeners(notification);
- }
-
-// public Set<IJSFAppConfigProvider> getJSFAppConfigProviders() {
-// return getManager().getJSFAppConfigProviders();
-// }
-
-// public List<FacesConfigType> getFacesConfigModels() {
-// return getManager().getFacesConfigModels();
-// }
-
- public List<ManagedBeanType> getManagedBeans() {
- return getManager().getManagedBeans();
- }
-
- public List<String> getPropertyResolvers() {
- return getManager().getPropertyResolvers();
- }
-
- public List<ValidatorType> getValidators() {
- return getManager().getValidators();
- }
-
- public List<String> getVariableResolvers() {
- return getManager().getVariableResolvers();
- }
-
- public List<ConverterType> getConverters() {
- return getManager().getConverters();
- }
-
- public List<NavigationRuleType> getNavigationRules() {
- return getManager().getNavigationRules();
- }
-
- public List<NavigationRuleType> getNavigationRulesForPage(IFile pageFile) {
- return getManager().getNavigationRulesForPage(pageFile);
- }
-
- public List<ApplicationType> getApplications() {
- return getManager().getApplications();
- }
-
- public List<FactoryType> getFactories() {
- return getManager().getFactories();
- }
-
- public List<ComponentType> getComponents() {
- return getManager().getComponents();
- }
-
- public List<ReferencedBeanType> getReferencedBeans() {
- return getManager().getReferencedBeans();
- }
-
- public List<RenderKitType> getRenderKits() {
- return getManager().getRenderKits();
- }
-
- public List<LifecycleType> getLifecycles() {
- return getManager().getLifecycles();
- }
-
- public List<ResourceBundleType> getResourceBundles() {
- return getManager().getResourceBundles();
- }
-
- public List<FacesConfigExtensionType> getFacesConfigExtensions() {
- return getManager().getFacesConfigExtensions();
- }
-
- public List<BehaviorType> getBehaviors() {
- return getManager().getBehaviors();
- }
-
- public void addFacesConfigChangeAdapter(FacesConfigType facesConfig) {
- getManager().addFacesConfigChangeAdapter(facesConfig);
-
- }
-
- public void removeFacesConfigChangeAdapter(FacesConfigType facesConfig) {
- getManager().removeFacesConfigChangeAdapter(facesConfig);
- }
-
- public void dispose() {
- _isDisposed.compareAndSet(false, true);
- }
-
- public void destroy() {
- // TODO Auto-generated method stub
-
- }
-
- public void checkpoint() {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isDisposed() {
- return _isDisposed.get();
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactory.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactory.java
deleted file mode 100644
index c14fcdb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManagerFactory;
-
-public class TestJSFAppConfigManagerFactory implements IJSFAppConfigManagerFactory {
-
- public IJSFAppConfigManager getInstance(IProject project) {
- try {
- return new TestJSFAppConfigManager(project, new TestLocatorProvider());
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public void destroy() {
- // TODO Auto-generated method stub
-
- }
-
- public void checkpoint() {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isDisposed() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactoryFromExtension.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactoryFromExtension.java
deleted file mode 100644
index eb3206e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFactoryFromExtension.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.internal.managedobject.AbstractManagedObject;
-import org.eclipse.jst.jsf.common.internal.managedobject.ObjectManager.ManagedObjectException;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManagerFactory;
-
-public class TestJSFAppConfigManagerFactoryFromExtension
- extends AbstractManagedObject
- implements IJSFAppConfigManagerFactory {
-
- public IJSFAppConfigManager getInstance(final IProject project) throws ManagedObjectException {
- return new TestJSFAppConfigManagerFromExtension(project);
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
- }
-
- public void destroy() {
- // TODO Auto-generated method stub
- }
-
- public void checkpoint() {
- // TODO Auto-generated method stub
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFromExtension.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFromExtension.java
deleted file mode 100644
index 288e909..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestJSFAppConfigManagerFromExtension.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.AbstractJSFAppConfigManager;
-
-public class TestJSFAppConfigManagerFromExtension extends
- AbstractJSFAppConfigManager {
-
- public TestJSFAppConfigManagerFromExtension(IProject project) {
- super(project);
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestLocatorProvider.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestLocatorProvider.java
deleted file mode 100644
index 50d5c9d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/TestLocatorProvider.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.appconfig;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater;
-import org.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigProvider;
-import org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater;
-import org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigProvider;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.DefaultJSFAppConfigLocatorProviderStrategy;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigLocatorProvider;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-
-/**
- * An {@link IJSFAppConfigLocatorProvider} that adds a faked {@link IJSFAppConfigLocater} and all of the default platform locators
- *
- */
-public class TestLocatorProvider implements IJSFAppConfigLocatorProvider {
-
- public static final String MANAGED_BEAN_NAME_PREFIX = "MyManagedBean";
- public static final String MANAGED_BEAN_CLASS_PREFIX = "com.foo.MyManagedBeanClass";
- public static final int MANAGED_BEAN_COUNT = 10;
- public int managed_bean_count = 0;
-
- public TestLocatorProvider(int count) {
- managed_bean_count = count;
- }
-
- public TestLocatorProvider() {
- managed_bean_count = MANAGED_BEAN_COUNT;
- }
-
- public List<IJSFAppConfigLocater> getLocators() {
- List<IJSFAppConfigLocater> ret = new ArrayList<IJSFAppConfigLocater>();
- ret.add(new FakeLocator());
- ret.addAll(new DefaultJSFAppConfigLocatorProviderStrategy().getLocators());
- return Collections.unmodifiableList(ret);
- }
-
- /**
- * Set how many beans should be created by the Provider
- * @param count
- */
- public void setBeanCreationCount(int count) {
- managed_bean_count = count;
- }
-
- private class FakeLocator extends AbstractJSFAppConfigLocater {
-
- private Set<IJSFAppConfigProvider> _providers;
-
- @Override
- public Set<IJSFAppConfigProvider> getJSFAppConfigProviders() {
- if (_providers == null) {
- _providers = new HashSet<IJSFAppConfigProvider>();
- _providers.add(new FakeProvider());
- }
- return Collections.unmodifiableSet(_providers);
- }
-
- @Override
- public void startLocating() {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stopLocating() {
- // TODO Auto-generated method stub
- }
- }
-
- private class FakeProvider extends AbstractJSFAppConfigProvider {
-
- private FacesConfigType _model;
-
- @Override
- public FacesConfigType getFacesConfigModel() {
- if (_model == null) {
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- _model = fac.createFacesConfigType();
- addFakeBeans(fac, _model);
- }
- return _model;
- }
-
- @SuppressWarnings("unchecked")
- private void addFakeBeans(FacesConfigFactory fac, FacesConfigType model) {
- for (int i=0; i<TestLocatorProvider.this.managed_bean_count; i++) {
- ManagedBeanType bean = fac.createManagedBeanType();
-
- ManagedBeanNameType name = fac.createManagedBeanNameType();
- name.setTextContent(MANAGED_BEAN_NAME_PREFIX+i);
- bean.setManagedBeanName(name);
-
- ManagedBeanClassType klass = fac.createManagedBeanClassType();
- klass.setTextContent(MANAGED_BEAN_CLASS_PREFIX+i);
- bean.setManagedBeanClass(klass);
-
- model.getManagedBean().add(bean);
- }
- }
-
- @Override
- public void releaseFacesConfigModel() {
- _model = null;
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/provider/TestJARFileJSFAppConfigProvider.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/provider/TestJARFileJSFAppConfigProvider.java
deleted file mode 100644
index 554de1d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/provider/TestJARFileJSFAppConfigProvider.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.appconfig.provider;
-
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.internal.net.ProxyData;
-import org.eclipse.core.internal.net.ProxyManager;
-import org.eclipse.core.net.proxy.IProxyData;
-import org.eclipse.core.net.proxy.IProxyService;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.jsfappconfig.IJSFAppConfigLocater;
-import org.eclipse.jst.jsf.core.jsfappconfig.JARFileJSFAppConfigProvider;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.core.jsfappconfig.RuntimeClasspathJSFAppConfigLocater;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-
-/**
- * Unit test for JARFileJSFAppConfigProvider, the app config provider used to
- * load faces-config models from jars (i.e. classpath libraries).
- *
- * @author cbateman
- *
- */
-public class TestJARFileJSFAppConfigProvider extends TestCase
-{
- private final static String NO_EXT_DATA_JAR_PATH =
- "/testfiles/appconfig/noextdata.jar";
- private final static String WITH_EXT_DATA_JAR_PATH =
- "/testfiles/appconfig/withextdata.jar";
- private final static String NO_FACES_CONFIG_FILE =
- "/testfiles/appconfig/fail2_nofacesconfig.jar";
-
- private final static String FAIL_JAR_PATH =
- "/testfiles/appconfig/fail2.jar";
-
- private WebProjectTestEnvironment _testEnv;
- private JDTTestEnvironment _jdtTestEnv;
-
- private IClasspathEntry _noExtData;
- private IClasspathEntry _withExtData;
- private IClasspathEntry _noFacesConfigFile;
- private IResource _copiedIntoProject;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- setInternetPrefs();
- // JSFTestUtil.setInternetProxyPreferences
- // (true, "www-proxy.us.oracle.com", "80");
-
- _testEnv =
- new WebProjectTestEnvironment("ELValidationTest_"
- + this.getClass().getName() + "_" + getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- _copiedIntoProject =
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault()
- .getBundle(), FAIL_JAR_PATH, "WEB-INF/lib/fail2.jar");
- assertNotNull(_copiedIntoProject);
- assertTrue(_copiedIntoProject.exists());
-
- _jdtTestEnv = new JDTTestEnvironment(_testEnv);
- _noExtData =
- _jdtTestEnv.addJarClasspathEntry(TestsPlugin.getDefault()
- .getBundle(), NO_EXT_DATA_JAR_PATH);
- assertNotNull(_noExtData);
-
- _withExtData =
- _jdtTestEnv.addJarClasspathEntry(TestsPlugin.getDefault()
- .getBundle(), WITH_EXT_DATA_JAR_PATH);
- assertNotNull(_withExtData);
-
- _noFacesConfigFile =
- _jdtTestEnv.addJarClasspathEntry(TestsPlugin.getDefault()
- .getBundle(), NO_FACES_CONFIG_FILE);
- assertNotNull(_noFacesConfigFile);
-
- // initialize test case for faces 1.1
- final JSFFacetedTestEnvironment jsfFacedEnv =
- new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- // ensure the project can be deleted (no jar lock:
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=195867)
- final IVirtualContainer container = _testEnv.getWebRoot(false, false);
- assertNotNull(container);
- final IFile file =
- container.getFile("WEB-INF/lib/fail2.jar").getUnderlyingFile();
- assertNotNull(file);
- assertTrue(file.exists());
- _testEnv.getTestProject().delete(true, null);
- assertFalse(_testEnv.getTestProject().exists());
- assertFalse(file.exists());
- }
-
- /**
- * Tests model load of a simple jar-based faces config file that has no
- * extension data in it.
- */
- public void testNoExtensionData() throws Exception
- {
- final JARFileJSFAppConfigProvider provider = createProvider(_noExtData, true);
- final FacesConfigType facesConfig = provider.getFacesConfigModel();
- assertNotNull(facesConfig);
-
- verifyCommonElements(facesConfig);
- }
-
- /**
- * This is a regression for
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=181643
- *
- * At the present time we are not able to support extension data inside of
- * jar file-based facesConfig files because the EMF2DOMSEE adapter doesn't
- * support jar-loading and we rely on this class for our renderer
- * workarounds.
- *
- * @throws Exception
- */
- public void testWithExtensionData() throws Exception
- {
- final JARFileJSFAppConfigProvider provider =
- createProvider(_withExtData, true);
- final FacesConfigType facesConfig = provider.getFacesConfigModel();
- assertNotNull(facesConfig);
-
- verifyCommonElements(facesConfig);
-
- final ComponentType componentType =
- (ComponentType) facesConfig.getComponent().get(0);
- assertEquals(1, componentType.getComponentExtension().size());
-
- final ComponentExtensionType extType =
- (ComponentExtensionType) componentType.getComponentExtension()
- .get(0);
- // this value should actually be 1, but we are not able to use our
- // worked-around
- // translation renderer for jar files. This assertion is intended to
- // break
- // once translation of ANY content is fixed for JAR-contained
- // faces-config models
- assertEquals(0, extType.getChildNodes().size());
- }
-
- public void testJarCopiedInProject() throws Exception
- {
- final JARFileJSFAppConfigProvider provider =
- createProvider((IFile) _copiedIntoProject);
- final FacesConfigType facesConfig = provider.getFacesConfigModel();
- assertNotNull(facesConfig);
- }
-
- public void testNoFacesConfigJar() throws Exception
- {
- final JARFileJSFAppConfigProvider provider =
- createProvider(_noFacesConfigFile, false);
- final FacesConfigType facesConfig = provider.getFacesConfigModel();
- assertNull(facesConfig);
- }
-
- private void verifyCommonElements(final FacesConfigType facesConfig)
- {
- assertEquals(1, facesConfig.getComponent().size());
- final ComponentType component =
- (ComponentType) facesConfig.getComponent().get(0);
- assertEquals("com.ibm.odc.jsf.RichTextEditor", component
- .getComponentType().getTextContent());
- assertEquals(
- "com.ibm.odc.jsf.components.components.rte.UIRichTextEditor",
- component.getComponentClass().getTextContent());
-
- assertEquals(1, facesConfig.getManagedBean().size());
- final ManagedBeanType managedBean =
- (ManagedBeanType) facesConfig.getManagedBean().get(0);
- assertEquals("jarBean", managedBean.getManagedBeanName()
- .getTextContent());
- assertEquals("java.util.List", managedBean.getManagedBeanClass()
- .getTextContent());
- assertEquals("request", managedBean.getManagedBeanScope()
- .getTextContent());
- }
-
- private JARFileJSFAppConfigProvider createProvider(final IFile file)
- throws Exception
- {
- final String libName = file.getLocation().toOSString();
-
- final IJSFAppConfigLocater locator =
- new RuntimeClasspathJSFAppConfigLocater();
-
- //until setJSFAppConfigManager accepts IJSFAppConfigManagers, leave deprecated method call
- locator.setJSFAppConfigManager((IJSFAppConfigManager)JSFAppConfigManager.getInstance(_testEnv
- .getTestProject()));
- final JARFileJSFAppConfigProvider provider =
- new JARFileJSFAppConfigProvider(libName);
- provider.setJSFAppConfigLocater(locator);
- return provider;
- }
-
- private JARFileJSFAppConfigProvider createProvider(final IClasspathEntry forJar,
- final boolean assertFacesConfig) throws Exception
- {
- final String libName = getLibraryName(forJar, assertFacesConfig);
-
- final IJSFAppConfigLocater locator =
- new RuntimeClasspathJSFAppConfigLocater();
-
- //until setJSFAppConfigManager accepts IJSFAppConfigManagers, leave deprecated method call
- locator.setJSFAppConfigManager((IJSFAppConfigManager)JSFAppConfigManager.getInstance(_testEnv
- .getTestProject()));
- final JARFileJSFAppConfigProvider provider =
- new JARFileJSFAppConfigProvider(libName);
- provider.setJSFAppConfigLocater(locator);
- return provider;
- }
-
- private static String getLibraryName(final IClasspathEntry classPathEntry,
- final boolean assertFacesConfig) throws Exception
- {
- final IPath libraryPath = classPathEntry.getPath();
-
- final String libraryPathString = libraryPath.toOSString();
-
- if (assertFacesConfig)
- {
- JarFile jarFile = null;
-
- try
- {
- jarFile = new JarFile(libraryPathString, false);
- if (jarFile != null)
- {
- final JarEntry jarEntry =
- jarFile
- .getJarEntry(JSFAppConfigUtils.FACES_CONFIG_IN_JAR_PATH);
- assertNotNull(jarEntry);
- }
- }
- finally
- {
- if (jarFile != null)
- {
- jarFile.close();
- }
- }
- }
-
- return libraryPathString;
- }
-
- private static void setInternetPrefs() throws Exception
- {
- final IProxyService proxy = ProxyManager.getProxyManager();
-
- final ProxyData proxyData = new ProxyData(IProxyData.HTTP_PROXY_TYPE);
- proxyData.setHost("www-proxy.us.oracle.com");
- proxyData.setPassword("80");
- proxy.setProxyData(new ProxyData[]
- { proxyData });
- proxy.setProxiesEnabled(true);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/validation/AppConfigValidationUtilTestCase.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/validation/AppConfigValidationUtilTestCase.java
deleted file mode 100644
index b119d37..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/appconfig/validation/AppConfigValidationUtilTestCase.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.appconfig.validation;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.ProjectTestEnvironment;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidationUtil;
-import org.eclipse.jst.jsf.validation.internal.appconfig.DiagnosticFactory;
-import org.eclipse.jst.jsf.validation.internal.appconfig.ILocalizedMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Unit tests for AppConfigValidationUtil
- *
- * @author cbateman
- *
- */
-public class AppConfigValidationUtilTestCase extends TestCase
-{
- private ProjectTestEnvironment _testEnvironment;
- private JDTTestEnvironment _jdtTestEnvironment;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80");
-
- _testEnvironment =
- new WebProjectTestEnvironment("AppConfigValidationUtilTestCase_"+getName());
- _testEnvironment.createProject(true);
-
- _jdtTestEnvironment = new JDTTestEnvironment(_testEnvironment);
-
- TestFileResource resource = new TestFileResource();
- resource.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestEnum1.java.data");
-
- _jdtTestEnvironment.addSourceFile("src", "org.eclipse.jst.jsf.core.tests.util", "TestEnum1", resource.toString());
-
- resource = new TestFileResource();
- resource.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data");
- _jdtTestEnvironment.addSourceFile("src", "com.test", "TestBean1", resource.toString());
-
- resource = new TestFileResource();
- resource.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1Subclass.java.data");
- _jdtTestEnvironment.addSourceFile("src", "com.test", "TestBean1Subclass", resource.toString());
- }
-
- /**
- * test validateELExpression method
- */
- public void testValidateELExpression()
- {
- final String validELString1 = "#{x.y}";
- final String validELString2 = "#{a.b.c}";
- final String inValidEmptyExpr = "#{}";
- final String inValidNoBraces = "x.y";
- final String inValidSyntaxInEL = "#{x.[}";
-
- assertNull(AppConfigValidationUtil.validateELExpression(validELString1));
- assertNull(AppConfigValidationUtil.validateELExpression(validELString2));
-
- IMessage message = AppConfigValidationUtil.validateELExpression(inValidEmptyExpr);
- assertNotNull(message);
- assertEquals(DiagnosticFactory.SYNTAX_ERROR_IN_EL_ID,
- ((ILocalizedMessage)message).getErrorCode());
-
- message = AppConfigValidationUtil.validateELExpression(inValidNoBraces);
- assertNotNull(message);
- assertEquals(DiagnosticFactory.EL_EXPR_MUST_BE_IN_HASH_BRACES_ID,
- ((ILocalizedMessage)message).getErrorCode());
-
- message = AppConfigValidationUtil.validateELExpression(inValidSyntaxInEL);
- assertNotNull(message);
- assertEquals(DiagnosticFactory.SYNTAX_ERROR_IN_EL_ID,
- ((ILocalizedMessage)message).getErrorCode());
- }
-
- public void testValidateClassName_NoError() throws Exception
- {
- final IProject project = _testEnvironment.getTestProject();
-
-
- // null indicates no problem
- assertNull(AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1", null, true, project));
- // TestBean1 is a class, so mustBeClass should have no effect on outcome
- assertNull(AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1", null, false, project));
-
- // should react the same as TestBean1 since is a class
- assertNull(AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1Subclass", null, true, project));
- assertNull(AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1Subclass", null, false, project));
- // TestBean1Subclass is-a TestBean1
- assertNull(AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1Subclass", "com.test.TestBean1", true, project));
- assertNull(AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1Subclass", "com.test.TestBean1", false, project));
-
- // will succeed for enums if mustBeClass == false
- assertNull(AppConfigValidationUtil.validateClassName
- ("org.eclipse.jst.jsf.core.tests.util.TestEnum1", null, false, project));
- // the enum is-a Enum
- assertNull(AppConfigValidationUtil.validateClassName
- ("org.eclipse.jst.jsf.core.tests.util.TestEnum1", "java.lang.Enum", false, project));
- }
-
- public void testValidateClassName_Errors() throws Exception
- {
- final IProject project = _testEnvironment.getTestProject();
-
- // invalid name
- IMessage error = AppConfigValidationUtil.validateClassName
- ("com.test.NoTaVAliDClAss", null, false, project);
- assertNotNull(error);
- assertEquals(DiagnosticFactory.CANNOT_FIND_CLASS_NAME_ID, ((ILocalizedMessage)error).getErrorCode());
-
- // must be a class but is an enum
- error = AppConfigValidationUtil.validateClassName
- ("org.eclipse.jst.jsf.core.tests.util.TestEnum1", null, true, project);
- assertNotNull(error);
- assertEquals(DiagnosticFactory.FULLY_QUALIFIED_NAME_MUST_BE_A_CLASS_ID, ((ILocalizedMessage)error).getErrorCode());
-
- // must be an instanceof javax.faces.Converter but is not
- error = AppConfigValidationUtil.validateClassName
- ("com.test.TestBean1", "javax.faces.Converter", true, project);
- assertNotNull(error);
- assertEquals(DiagnosticFactory.CLASS_MUST_BE_INSTANCE_OF_ID, ((ILocalizedMessage)error).getErrorCode());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/contenttype/TestContentTypes.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/contenttype/TestContentTypes.java
deleted file mode 100644
index 5ac1f55..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/contenttype/TestContentTypes.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.contenttype;
-
-import java.util.zip.ZipFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.osgi.framework.Bundle;
-
-/**
- * Test that content types are being calculated correctly.
- *
- * @author Ian Trimble - Oracle
- */
-public class TestContentTypes extends TestCase {
-
- private static final String FACELET_FILENAME =
- "WebContent/contentType_jsf_facelet.xhtml"; //$NON-NLS-1$
- private static final String FACELET_COMPOSITE_FILENAME =
- "WebContent/resources/ezcomp/contentType_jsf_facelet_composite.xhtml"; //$NON-NLS-1$
-
- private WebProjectTestEnvironment _webProject;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80"); //$NON-NLS-1$ //$NON-NLS-2$
-
- final ZipFile zipFile = JSFTestUtil.createZipFile(
- TestsPlugin.getDefault().getBundle(),
- "/testfiles/testzips/TestProject1.zip"); //$NON-NLS-1$
- _webProject = new WebProjectTestEnvironment(
- this,
- JavaFacet.VERSION_1_5,
- ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.5")); //$NON-NLS-1$ //$NON-NLS-2$
- _webProject.createFromZip2(zipFile, true);
- Job.getJobManager().beginRule(_webProject.getTestProject(), null);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- @Override
- protected void tearDown() throws Exception {
- Job.getJobManager().endRule(_webProject.getTestProject());
- super.tearDown();
- }
-
- /**
- * Sanity check.
- * @throws Exception when one or more errors occur during test.
- */
- public void testSanity() throws Exception {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile faceletFile = project.getFile(new Path(FACELET_FILENAME));
- assertTrue(faceletFile.isAccessible());
-
- final IFile faceletCompositeFile = project.getFile(new Path(FACELET_COMPOSITE_FILENAME));
- assertTrue(faceletCompositeFile.isAccessible());
- }
-
- /**
- * Test that accessing describer class does not change the bundle state.
- * @throws Exception when one or more errors occur during test.
- */
- public void testNoBundleStateChange() throws Exception {
- //assert bundle is available
- final Bundle bundle = Platform.getBundle("org.eclipse.jst.jsf.core"); //$NON-NLS-1$
- assertNotNull(bundle);
-
- //get initial bundle state
- final int initialBundleState = bundle.getState();
-
- //assert test file has expected content type (and, therefore, describer class was loaded)
- final IFile faceletFile = _webProject.getTestProject().getFile(new Path(FACELET_FILENAME));
- assertTrue(hasContentType(
- faceletFile.getFullPath().toString(), "jsf.facelet")); //$NON-NLS-1$
-
- //assert bundle state has not been changed
- assertEquals(
- "Bundle state changed while querying content type", //$NON-NLS-1$
- initialBundleState, bundle.getState());
- }
-
- /**
- * Test that the "jsf.facelet" content type is being calculated correctly.
- * @throws Exception when one or more errors occur during test.
- */
- public void testJSFFaceletContentType() throws Exception {
- final IFile faceletFile = _webProject.getTestProject().getFile(
- new Path(FACELET_FILENAME));
- assertTrue(hasContentType(
- faceletFile.getFullPath().toString(), "jsf.facelet")); //$NON-NLS-1$
- }
-
- /**
- * Test that the "jsf.facelet.composite" content type is being calculated correctly.
- * @throws Exception when one or more errors occur during test.
- */
- public void testJSFFaceletCompositeContentType() throws Exception {
- final IFile faceletFile = _webProject.getTestProject().getFile(
- new Path(FACELET_COMPOSITE_FILENAME));
- assertTrue(hasContentType(
- faceletFile.getFullPath().toString(), "jsf.facelet.composite")); //$NON-NLS-1$
- }
-
- private boolean hasContentType(String filename, String contentTypeId) {
- boolean hasContentType = false;
- final IContentType[] contentTypes =
- Platform.getContentTypeManager().findContentTypesFor(filename);
- for (final IContentType contentType: contentTypes) {
- if (contentTypeId.equals(contentType.getId())) {
- hasContentType = true;
- break;
- }
- }
- return hasContentType;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryProviderTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryProviderTests.java
deleted file mode 100644
index c497a6a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryProviderTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2009 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Debajit Adhikary - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.core.tests.facet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.libprov.osgi.OsgiBundlesLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate;
-
-
-/**
- * @author Debajit Adhikary
- *
- */
-public class JsfLibraryProviderTests extends TestCase
-{
- /**
- * @param name
- */
- public JsfLibraryProviderTests (final String name)
- {
- super(name);
- }
-
-
- public void testGetUserLibProviderFromLibConfig ()
- {
- assertNull(JSFFacetInstallDelegate.getUserLibConfig(new LibraryProviderOperationConfig()));
- assertNull(JSFFacetInstallDelegate.getUserLibConfig(new NoOpLibraryProviderInstallOperationConfig()));
- assertNull(JSFFacetInstallDelegate.getUserLibConfig(new OsgiBundlesLibraryProviderInstallOperationConfig()));
-
- assertNotNull(JSFFacetInstallDelegate.getUserLibConfig(new UserLibraryProviderInstallOperationConfig()));
- assertNotNull(JSFFacetInstallDelegate.getUserLibConfig(new WtpUserLibraryProviderInstallOperationConfig()));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java
deleted file mode 100644
index 1b58f51..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.core.tests.facet;
-
-
-/**
- * @author Debajit Adhikary
- *
- */
-public class JsfLibraryValidatorTest extends LibraryValidatorTest
-{
- private static final String CLASS_NAME_IDENTIFYING_IMPLEMENTATION_JAR = "javax/faces/render/RenderKit.class"; //$NON-NLS-1$
- private static final String JARFILE = "testfiles/facet/jsflibrary-api-1.1.3.jar"; //$NON-NLS-1$
- private static final String JARFILE_WITHOUT_IMPLEMENTATION_VERSION_ENTRY = "testfiles/facet/no-version-entry/jsflibrary-api-1.1.3.jar"; //$NON-NLS-1$
- private static final String JARFILE_WITH_NONSTANDARD_IMPLEMENTATION_VERSION_ENTRY = "testfiles/facet/nonstandard_implementation_version/jsflibrary-api-1.1.3.jar"; //$NON-NLS-1$
- private static final String EXPECTED_LIBRARY_VERSION = "1.1.3"; //$NON-NLS-1$
-
-
- /**
- * @param name
- */
- public JsfLibraryValidatorTest (final String name)
- {
- super(name,
- CLASS_NAME_IDENTIFYING_IMPLEMENTATION_JAR,
- JARFILE,
- JARFILE_WITHOUT_IMPLEMENTATION_VERSION_ENTRY,
- JARFILE_WITH_NONSTANDARD_IMPLEMENTATION_VERSION_ENTRY,
- EXPECTED_LIBRARY_VERSION);
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java
deleted file mode 100644
index ccd3c29..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.core.tests.facet;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.jar.JarFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.osgi.framework.Bundle;
-
-
-/**
- * @author Debajit Adhikary
- *
- */
-public abstract class LibraryValidatorTest extends TestCase
-{
- private String classNameIdentifyingJarToUse;
- private String jarPath;
- private String jarPathWithoutImplementationVersionEntry;
- private String jarPathWithNonstandardImplementationVersionEntry;
- private String expectedLibraryVersion;
- private UserLibraryVersionValidatorProxy validator;
-
-
- /**
- * @param name
- */
- public LibraryValidatorTest (final String name)
- {
- super(name);
- }
-
-
- public LibraryValidatorTest (final String name,
- final String classNameIdentifyingJarToUse,
- final String jarPath,
- final String jarPathWithoutImplementationVersionEntry,
- final String jarPathWithNonstandardImplementationVersionEntry,
- final String expectedLibraryVersion)
- {
- super(name);
-
- this.classNameIdentifyingJarToUse = classNameIdentifyingJarToUse;
- this.jarPath = jarPath;
- this.jarPathWithoutImplementationVersionEntry = jarPathWithoutImplementationVersionEntry;
- this.jarPathWithNonstandardImplementationVersionEntry = jarPathWithNonstandardImplementationVersionEntry;
- this.expectedLibraryVersion = expectedLibraryVersion;
-
- this.validator = new UserLibraryVersionValidatorProxy(this.classNameIdentifyingJarToUse);
- }
-
-
- public void testVersionStringSuffixMatch ()
- {
- assertNotNull(validator);
-
- final IStatus status = validator.validateVersionStrings("1.2", "1.1.2");
- assertEquals(IStatus.WARNING, status.getSeverity());
- }
-
-
- public void testVersionStringPrefixMatch ()
- {
- assertNotNull(validator);
-
- final IStatus status = validator.validateVersionStrings("1.2", "1.2.11");
- assertEquals(IStatus.OK, status.getSeverity());
- }
-
-
- public void testNullLibraryVersionString ()
- {
- assertNotNull(validator);
-
- final IStatus status = validator.validateVersionStrings("1.2", null);
- assertEquals(IStatus.WARNING, status.getSeverity());
- }
-
-
- public void testNullFacetVersionString ()
- {
- assertNotNull(validator);
-
- try
- {
- validator.validateVersionStrings(null, "1.0.1.2.11"); // Fails
- }
- catch (final IllegalArgumentException e)
- {
- assertEquals("Cannot read facet version", e.getLocalizedMessage());
- return;
- }
-
- fail();
- }
-
-
- protected File getFileFromPlugin (final String relativePathToFile,
- final Plugin plugin)
- throws IOException, URISyntaxException
- {
- final Bundle bundle = TestsPlugin.getDefault().getBundle();
-
- final URL bundleUrl = bundle.getEntry(relativePathToFile);
- assertNotNull(bundleUrl);
-
- final URL fileUrl = FileLocator.toFileURL(bundleUrl);
- final File file = new File(fileUrl.getPath());
- assertTrue(file.exists());
- return file;
- }
-
-
- public void testReadLibraryVersionFromJarWithManifestEntry ()
- throws IOException, URISyntaxException
- {
- final JarFile jarFile = new JarFile(getFileFromPlugin(jarPath, TestsPlugin.getDefault()));
- assertEquals(expectedLibraryVersion, validator.getLibraryVersion(jarFile));
- }
-
-
- public void testReadLibraryVersionFromJarWithoutManifestEntry ()
- throws IOException, URISyntaxException
- {
- final JarFile jarFile = new JarFile(getFileFromPlugin(jarPathWithoutImplementationVersionEntry, TestsPlugin.getDefault()));
- assertNull("Was expecting library-version string to be null", validator.getLibraryVersion(jarFile)); //$NON-NLS-1$
- }
-
-
- /**
- * Regression test-case. This would fail earlier without the patch in
- *
- * "JSF Facet version validator fails to validate some non-standard jars"
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=286351
- *
- * @throws IOException
- * @throws URISyntaxException
- *
- */
- public void testReadLibraryVersionFromJarWithNonstandardImplementationVersion()
- throws IOException, URISyntaxException
- {
- final JarFile jarFile = new JarFile(getFileFromPlugin(jarPathWithNonstandardImplementationVersionEntry, TestsPlugin.getDefault()));
- assertNotNull("Was expecting library-version string to be non-null", validator.getLibraryVersion(jarFile)); //$NON-NLS-1$
- assertEquals(expectedLibraryVersion, validator.getLibraryVersion(jarFile));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java
deleted file mode 100644
index 0db8552..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.core.tests.facet;
-
-import java.io.IOException;
-import java.util.jar.JarFile;
-
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.facet.libraryprovider.UserLibraryVersionValidator;
-
-
-/**
- * "Proxy" class for the actual UserLibraryVersionValidator. This is only used so
- * that the protected methods in UserLibraryVersionValidator can be tested.
- *
- * The test-cases have package-level access to these protected methods.
- *
- * @author Debajit Adhikary
- *
- */
-public class UserLibraryVersionValidatorProxy extends UserLibraryVersionValidator
-{
- public UserLibraryVersionValidatorProxy (final String classNameIdentifyingJar)
- {
- super(classNameIdentifyingJar);
- }
-
-
- @Override
- protected IStatus validateVersionStrings (final String facetVersion, final String libraryVersion)
- {
- return super.validateVersionStrings(facetVersion, libraryVersion);
- }
-
-
- @Override
- protected String getLibraryVersion (final JarFile jarFile) throws IOException
- {
- return super.getLibraryVersion(jarFile);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java
deleted file mode 100644
index 218e203..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2009 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.core.tests.facet;
-
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.j2ee.common.Description;
-import org.eclipse.jst.j2ee.common.Listener;
-import org.eclipse.jst.j2ee.common.ParamValue;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletMapping;
-import org.eclipse.jst.j2ee.webapplication.internal.impl.ServletTypeImpl;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUpdater;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-
-/**
- * Tests the web.xml updating functionality used for vendor-specific web.xml
- * configuration
- *
- * @author Debajit Adhikary
- *
- * @see VendorSpecificWebXmlConfigurationForJavaEETest
- *
- */
-public class VendorSpecificWebXmlConfigurationForJ2EETest extends TestCase
-{
- private static final IProjectFacetVersion WEB_MODULE_VERSION = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.4");
-
- private static final IProjectFacetVersion JAVA_VERSION = JavaFacet.VERSION_1_5;
-
- private static final String SERVLET_NAME = "_TEST_SERVLET_NAME";
- private static final String SERVLET_CLASS_NAME = "_TEST_SERVLET_CLASS_NAME";
- private static final String SERVLET_LOAD_ON_STARTUP = "1";
- private static final String SERVLET_URL_PATTERN = "*._TEST_SERVLET_URL_PATTERN";
- private static final String CONTEXT_PARAM_NAME = "_TEST_CONTEXT_PARAM_NAME";
- private static final String CONTEXT_PARAM_VALUE = "_TEST_CONTEXT_PARAM_VALUE";
- private static final String CONTEXT_PARAM_DESCRIPTION = "_TEST_CONTEXT_PARAM_DESCRIPTION";
- private static final String LISTENER_CLASS = "_TEST_LISTENER_CLASS";
-
- private IProject project;
- private WebXmlUpdater updater;
-
- private IProject createProject (final String projectName)
- throws Exception
- {
- final WebProjectTestEnvironment testEnv = new WebProjectTestEnvironment(projectName, JAVA_VERSION, WEB_MODULE_VERSION);
- assertTrue(testEnv.createProject(true));
- return testEnv.getTestProject();
- }
-
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- this.project = createProject(this.getClass().getName() + "_" + getName());
- this.updater = new WebXmlUpdater(project, null);
- }
-
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- System.out.println(JSFTestUtil.safeDelete(project, 3, 500));
- }
-
-
- public void testAddServlet () throws Exception
- {
- setupServlet();
- }
-
-
- private void setupServlet()
- {
- // Write servlet to web.xml
- assertFalse(WebXmlUtilsForJ2EE.existsServlet(updater.getWebAppForJ2EE(), SERVLET_NAME, SERVLET_CLASS_NAME));
- updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
-
- // Read servlet from web.xml
- final Servlet servlet = WebXmlUtilsForJ2EE.findServlet(updater.getWebAppForJ2EE(), SERVLET_CLASS_NAME);
- assertEquals(SERVLET_NAME, servlet.getServletName());
- assertEquals(SERVLET_CLASS_NAME, ((ServletTypeImpl) servlet.getWebType()).getClassName());
- assertEquals(Integer.parseInt(SERVLET_LOAD_ON_STARTUP), servlet.getLoadOnStartup().intValue());
- }
-
-
- public void testAddContextParam () throws Exception
- {
- // Write param to web.xml
- assertFalse(WebXmlUtilsForJ2EE.existsContextParam(updater.getWebAppForJ2EE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- updater.addContextParam(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE, CONTEXT_PARAM_DESCRIPTION);
-
- // Read param from web.xml
- final ParamValue param = WebXmlUtilsForJ2EE.findContextParam(updater.getWebAppForJ2EE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE);
- assertEquals(CONTEXT_PARAM_NAME, param.getName());
- assertEquals(CONTEXT_PARAM_VALUE, param.getValue());
- assertEquals(CONTEXT_PARAM_DESCRIPTION, ((Description) param.getDescriptions().get(0)).getValue());
- }
-
-
- public void testGetContextParamValue ()
- {
- assertFalse(WebXmlUtilsForJ2EE.existsContextParam(updater.getWebAppForJ2EE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- updater.addContextParam(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE, CONTEXT_PARAM_DESCRIPTION);
-
- final String contextParamValue = updater.getContextParamValue(CONTEXT_PARAM_NAME);
- assertNotNull(contextParamValue);
- assertEquals(CONTEXT_PARAM_VALUE, contextParamValue);
- }
-
-
- public void testGetContextParamValuesAsList ()
- {
- assertFalse(WebXmlUtilsForJ2EE.existsContextParam(updater.getWebAppForJ2EE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- final String delimiter = ";";
- final String paramValue = CONTEXT_PARAM_VALUE + "1" + delimiter + CONTEXT_PARAM_VALUE + "2" + delimiter + CONTEXT_PARAM_VALUE + "3";
- updater.addContextParam(CONTEXT_PARAM_NAME, paramValue, CONTEXT_PARAM_DESCRIPTION);
-
- final List<String> expectedList = Arrays.asList(CONTEXT_PARAM_VALUE + "1", CONTEXT_PARAM_VALUE + "2", CONTEXT_PARAM_VALUE + "3");
- final List<String> actualList = updater.getContextParamValuesAsList(CONTEXT_PARAM_NAME, delimiter);
- assertEquals(expectedList, actualList);
- }
-
-
- public void testSetContextParamValue ()
- {
- assertFalse(WebXmlUtilsForJ2EE.existsContextParam(updater.getWebAppForJ2EE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- updater.setContextParamValue(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE); // Adds new context param
- assertEquals(CONTEXT_PARAM_VALUE, updater.getContextParamValue(CONTEXT_PARAM_NAME));
-
- final String updatedValue = CONTEXT_PARAM_VALUE + "updated";
- assertFalse(updater.getContextParamValue(CONTEXT_PARAM_NAME).equals(updatedValue));
-
- updater.setContextParamValue(CONTEXT_PARAM_NAME, updatedValue);
- assertEquals(updatedValue, updater.getContextParamValue(CONTEXT_PARAM_NAME));
- }
-
-
- public void testAddServletMapping () throws Exception
- {
- setupServlet();
- // Write servlet-mapping to web.xml
- assertFalse(WebXmlUtilsForJ2EE.existsServletMapping(updater.getWebAppForJ2EE(), SERVLET_NAME, SERVLET_URL_PATTERN));
- updater.addServletMapping(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_URL_PATTERN);
-
- // Read from web.xml
- final ServletMapping mapping = WebXmlUtilsForJ2EE.findServletMapping(updater.getWebAppForJ2EE(), SERVLET_NAME, SERVLET_URL_PATTERN);
- assertEquals(SERVLET_NAME, mapping.getName());
- assertEquals(SERVLET_URL_PATTERN, mapping.getUrlPattern());
- }
-
-
- public void testAddListener () throws Exception
- {
- // Write to web.xml
- assertFalse(WebXmlUtilsForJ2EE.existsListener(updater.getWebAppForJ2EE(), LISTENER_CLASS));
- updater.addListener(LISTENER_CLASS);
-
- // Read from web.xml
- final Listener listener = WebXmlUtilsForJ2EE.findListener(updater.getWebAppForJ2EE(), LISTENER_CLASS);
- assertEquals(LISTENER_CLASS, listener.getListenerClassName());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java
deleted file mode 100644
index 05b2f80..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2009 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.core.tests.facet;
-
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.javaee.core.Description;
-import org.eclipse.jst.javaee.core.Listener;
-import org.eclipse.jst.javaee.core.ParamValue;
-import org.eclipse.jst.javaee.core.UrlPatternType;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.ServletMapping;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUpdater;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-
-/**
- * Tests the web.xml updating functionality used for vendor-specific web.xml
- * configuration (for Java EE)
- *
- * @author Debajit Adhikary
- *
- * @see VendorSpecificWebXmlConfigurationForJ2EETest
- *
- */
-public class VendorSpecificWebXmlConfigurationForJavaEETest extends TestCase
-{
- private static final IProjectFacetVersion WEB_MODULE_VERSION = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.5");
-
- private static final IProjectFacetVersion JAVA_VERSION = JavaFacet.VERSION_1_5;
-
- private static final String PROJECT_NAME_PREFIX = "_TEST_PROJECT_NAME_FOR_JAVA_EE";
- private static final String SERVLET_NAME = "_TEST_SERVLET_NAME";
- private static final String SERVLET_CLASS_NAME = "_TEST_SERVLET_CLASS_NAME";
- private static final String SERVLET_LOAD_ON_STARTUP = "1";
- private static final String SERVLET_URL_PATTERN = "*._TEST_SERVLET_URL_PATTERN";
- private static final String CONTEXT_PARAM_NAME = "_TEST_CONTEXT_PARAM_NAME";
- private static final String CONTEXT_PARAM_VALUE = "_TEST_CONTEXT_PARAM_VALUE";
- private static final String CONTEXT_PARAM_DESCRIPTION = "_TEST_CONTEXT_PARAM_DESCRIPTION";
- private static final String LISTENER_CLASS = "_TEST_LISTENER_CLASS";
-
- private IProject project;
- private WebXmlUpdater updater;
-
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
- updater = new WebXmlUpdater(project, new NullProgressMonitor());
- }
-
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- JSFTestUtil.safeDelete(project, 3, 500);
- }
-
-
- private IProject createProject (final String projectName)
- throws Exception
- {
- final WebProjectTestEnvironment testEnv = new WebProjectTestEnvironment(projectName, JAVA_VERSION, WEB_MODULE_VERSION);
- testEnv.createProject(true);
- return testEnv.getTestProject();
- }
-
-
- public void testAddServlet () throws Exception
- {
- // Write servlet to web.xml
- updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
-
- // Read servlet from web.xml
- final Servlet servlet = WebXmlUtilsForJavaEE.findServlet(SERVLET_CLASS_NAME, updater.getWebAppForJavaEE());
- assertNotNull(servlet);
- assertEquals(SERVLET_NAME, servlet.getServletName());
- assertEquals(SERVLET_CLASS_NAME, servlet.getServletClass());
- assertEquals(SERVLET_LOAD_ON_STARTUP, servlet.getLoadOnStartup().toString());
- }
-
-
- public void testAddContextParam () throws Exception
- {
- // Write param to web.xml
- updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
- updater.addContextParam(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE, CONTEXT_PARAM_DESCRIPTION);
-
- // Read param from web.xml
- final ParamValue param = WebXmlUtilsForJavaEE.findContextParam(updater.getWebAppForJavaEE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE);
- assertNotNull(param);
- assertEquals(CONTEXT_PARAM_NAME, param.getParamName());
- assertEquals(CONTEXT_PARAM_VALUE, param.getParamValue());
- assertEquals(CONTEXT_PARAM_DESCRIPTION, ((Description) param.getDescriptions().get(0)).getValue());
- }
-
-
- public void testGetContextParamValue ()
- {
- assertFalse(WebXmlUtilsForJavaEE.existsContextParam(updater.getWebAppForJavaEE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- updater.addContextParam(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE, CONTEXT_PARAM_DESCRIPTION);
-
- final String contextParamValue = updater.getContextParamValue(CONTEXT_PARAM_NAME);
- assertNotNull(contextParamValue);
- assertEquals(CONTEXT_PARAM_VALUE, contextParamValue);
- }
-
-
- public void testGetContextParamValuesAsList ()
- {
- assertFalse(WebXmlUtilsForJavaEE.existsContextParam(updater.getWebAppForJavaEE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- final String delimiter = ";";
- final String paramValue = CONTEXT_PARAM_VALUE + "1" + delimiter + CONTEXT_PARAM_VALUE + "2" + delimiter + CONTEXT_PARAM_VALUE + "3";
- updater.addContextParam(CONTEXT_PARAM_NAME, paramValue, CONTEXT_PARAM_DESCRIPTION);
-
- final List<String> expectedList = Arrays.asList(CONTEXT_PARAM_VALUE + "1", CONTEXT_PARAM_VALUE + "2", CONTEXT_PARAM_VALUE + "3");
- final List<String> actualList = updater.getContextParamValuesAsList(CONTEXT_PARAM_NAME, delimiter);
- assertEquals(expectedList, actualList);
- }
-
-
- public void testSetContextParamValue ()
- {
- assertFalse(WebXmlUtilsForJavaEE.existsContextParam(updater.getWebAppForJavaEE(), CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
- updater.setContextParamValue(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE); // Adds new context param
- assertEquals(CONTEXT_PARAM_VALUE, updater.getContextParamValue(CONTEXT_PARAM_NAME));
-
- final String updatedValue = CONTEXT_PARAM_VALUE + "updated";
- assertFalse(updater.getContextParamValue(CONTEXT_PARAM_NAME).equals(updatedValue));
-
- updater.setContextParamValue(CONTEXT_PARAM_NAME, updatedValue);
- assertEquals(updatedValue, updater.getContextParamValue(CONTEXT_PARAM_NAME));
- }
-
-
- public void testAddServletMapping () throws Exception
- {
- // Write servlet-mapping to web.xml
- updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
- updater.addServletMapping(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_URL_PATTERN);
-
- // Read from web.xml
- final ServletMapping mapping = WebXmlUtilsForJavaEE.findServletMapping(updater.getWebAppForJavaEE(), SERVLET_NAME, SERVLET_URL_PATTERN);
- assertNotNull(mapping);
- assertEquals(SERVLET_NAME, mapping.getServletName());
- assertEquals(SERVLET_URL_PATTERN, ((UrlPatternType) mapping.getUrlPatterns().get(0)).getValue());
- }
-
-
- public void testAddListener () throws Exception
- {
- // Write to web.xml
- updater.addListener(LISTENER_CLASS);
-
- // Read from web.xml
- final Listener listener = WebXmlUtilsForJavaEE.findListener(updater.getWebAppForJavaEE(), LISTENER_CLASS);
- assertNotNull(listener);
- assertEquals(LISTENER_CLASS, listener.getListenerClass());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigDialogSettingDataTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigDialogSettingDataTestCases.java
deleted file mode 100644
index ce3a6a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigDialogSettingDataTestCases.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryconfig;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryConfigDialogSettingDataTestCases extends TestCase {
- private JSFLibraryRegistry libReg = null;
-// private boolean bDeployImplLib = false;
- private String[] compLibs = null;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFCoreUtilHelper.createJSFLibraryRegistry();
- libReg = JSFCoreUtilHelper.getJSFLibraryRegistryFromJSFLibraryHelper();
-
- compLibs = new String[1]; // test data has one component library
- JSFLibrary lib = (JSFLibrary)libReg.getNonImplJSFLibraries().get(0);
- compLibs[0] = lib.getID() + ":" + "true"; // deployed
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-
- //FIX ME - Kill Me
-// public void testJSFLibraryConfigDialogSettingData() {
-// JSFLibraryConfigDialogSettingData data = new JSFLibraryConfigDialogSettingData(bDeployImplLib, null);
-// Assert.assertNotNull(data);
-// Assert.assertNotNull(data.getJSFImplementationLibrary());
-// Assert.assertTrue(data.getJSFComponentLibraries().size() == 0);
-// }
-//
-// public void testGetJSFImplementationLibrary() {
-// JSFLibraryConfigDialogSettingData data = new JSFLibraryConfigDialogSettingData(bDeployImplLib, compLibs);
-// Assert.assertNotNull(data);
-//
-// JSFLibrary dftImplLib = libReg.getDefaultImplementation();
-// Assert.assertTrue( data.getJSFImplementationLibrary().getID().equals(dftImplLib.getID()));
-// }
-//
-// public void testGetJSFComponentLibraries() {
-// JSFLibraryConfigDialogSettingData data = new JSFLibraryConfigDialogSettingData(bDeployImplLib, compLibs);
-// Assert.assertNotNull(data);
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigModelTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigModelTestCases.java
deleted file mode 100644
index 3a7dca0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryConfigModelTestCases.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryconfig;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryConfigModelTestCases extends TestCase {
-// final static private String QUALIFIEDNAME = "org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryConfigProjectData";
-// private static final String PROJ_NAME = "_TEST_CFGLIBRARYMODEL_PROJECT";
-// private static final String PROJ_NAME2 = "_TEST_CFGLIBRARYMODEL_PROJECT2";
-// private JSFLibraryConfiglModelSource modelSrc = null;
-// private JSFLibraryConfiglModelSource modelSrcWithServerSupplied = null;
-// private IProject project;
-// private int numCompLibs;
-
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFCoreUtilHelper.createJSFLibraryRegistry();
- JSFLibraryRegistry libReg = JSFCoreUtilHelper.getJSFLibraryRegistryFromJSFLibraryHelper();
-
- /* number of components is changed in workspace when running the whole test suite.
- * Recording the number from registry for testing.
- */
- /*numCompLibs = */libReg.getNonImplJSFLibraries().size();
-
- String[] compLibs = new String[1];
- JSFLibrary lib = (JSFLibrary)libReg.getNonImplJSFLibraries().get(0);
- compLibs[0] = lib.getID() + ":" + "true";
-
-// modelSrc = new JSFLibraryConfigDialogSettingData(true, compLibs);
-// modelSrcWithServerSupplied = new JSFLibraryConfigDialogSettingData(IMPLEMENTATION_TYPE.SERVER_SUPPLIED, true, compLibs);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- //FIX ME!
-// public void testGetJSFImplementationLibraries() {
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrc);
-//
-// Assert.assertNotNull(model);
-// // we should have at least as many impl libraries as we have added
-// // NOTE: this test case has interactions with test cases in the same suite
-// // since JSF libs exist on a workspace basis which is normally not cleared
-// // between each TestCase being run
-// Assert.assertTrue(model.getJSFImplementationLibraries().size() >= numCompLibs);
-// }
-//
-// public void testGetJSFComponentLibraries() {
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrc);
-//
-// Assert.assertNotNull(model);
-// Assert.assertTrue(model.getJSFComponentLibraries().size() == numCompLibs);
-// }
-//
-// public void testGetCurrentJSFImplementationLibrarySelection() {
-// testGetSavedJSFImplementationLibrary();
-// }
-//
-// public void testGetCurrentJSFComponentLibrarySelection() {
-// testGetSavedJSFComponentLibraries();
-// }
-//
-// public void testGetSavedJSFImplementationLibrary() {
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrc);
-//
-// JSFLibraryRegistry libReg = JSFCoreUtilHelper.getJSFLibraryRegistryFromJSFLibraryHelper();
-// JSFLibraryInternalReference libImplRef = model.getCurrentJSFImplementationLibrarySelection();
-// Assert.assertNotNull(libImplRef);
-// Assert.assertTrue(libReg.getDefaultImplementation().getID().equals(libImplRef.getID()));
-// }
-//
-// @SuppressWarnings("unchecked")
-// public void testGetSavedJSFComponentLibraries() {
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrc);
-//
-// /*JSFLibraryRegistry libReg = */JSFCoreUtilHelper.getJSFLibraryRegistryFromJSFLibraryHelper();
-// List lstCompRef = model.getCurrentJSFComponentLibrarySelection();
-//
-// Assert.assertTrue(lstCompRef.size() == 1);
-//
-// JSFLibraryInternalReference libCompRef = (JSFLibraryInternalReference) lstCompRef.get(0);
-// Assert.assertNotNull(libCompRef);
-// Assert.assertTrue(libCompRef.isSelected());
-// Assert.assertTrue(libCompRef.isCheckedToBeDeployed());
-// }
-//
-///*
-// public void testSetCurrentJSFImplementationLibrarySelection() {
-// fail("Not yet implemented");
-// }
-//
-// public void testSetCurrentJSFComponentLibrarySelection() {
-// fail("Not yet implemented");
-// }
-//*/
-// public void testSaveData() {
-// try {
-// project = JSFCoreUtilHelper.createWebProject(PROJ_NAME);
-// } catch (Exception e1) {
-// fail("Unable to create project for testing.");
-// }
-//
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrc);
-// model.saveData(project);
-//
-// try {
-// String content = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
-// JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES));
-// Assert.assertNotNull(content);
-// Assert.assertTrue(content.length() > 1);
-//
-//
-// String type = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
-// JSFUtils.PP_JSF_IMPLEMENTATION_TYPE));
-//
-// Assert.assertNotNull(type);
-// Assert.assertEquals(IMPLEMENTATION_TYPE.getStringValue(IMPLEMENTATION_TYPE.USER_SPECIFIED), type);
-// } catch (CoreException e) {
-// fail("Not expecting an exception.");
-// }
-// }
-//
-// public void testSaveDataWithServerSuppliedImplSelection() {
-// try {
-// project = JSFCoreUtilHelper.createWebProject(PROJ_NAME2);
-// } catch (Exception e1) {
-// fail("Unable to create project for testing.");
-// }
-//
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrcWithServerSupplied);
-// model.saveData(project);
-//
-// try {
-// String content = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
-// JSFUtils.PP_JSF_IMPLEMENTATION_LIBRARIES));
-// Assert.assertNotNull(content);
-// Assert.assertTrue(content.length() > 1);
-//
-// String type = ((IResource)project).getPersistentProperty(new QualifiedName(QUALIFIEDNAME,
-// JSFUtils.PP_JSF_IMPLEMENTATION_TYPE));
-//
-// Assert.assertNotNull(type);
-// Assert.assertEquals(IMPLEMENTATION_TYPE.getStringValue(IMPLEMENTATION_TYPE.SERVER_SUPPLIED), type);
-// } catch (CoreException e) {
-// fail("Not expecting an exception.");
-// }
-// }
-//
-// public void testGetSavedImplementationType() {
-// JSFLibraryConfigModel model = JSFLibraryConfigModelFactory.createInstance(modelSrc);
-// Assert.assertNotNull(model.getImplementationType());
-// Assert.assertTrue(model.getImplementationType() == IMPLEMENTATION_TYPE.USER_SPECIFIED);
-//
-// model = JSFLibraryConfigModelFactory.createInstance(modelSrcWithServerSupplied);
-// Assert.assertNotNull(model.getImplementationType());
-// Assert.assertTrue(model.getImplementationType() == IMPLEMENTATION_TYPE.SERVER_SUPPLIED);
-//
-// model = JSFLibraryConfigModelFactory.createInstance(new JSFLibraryConfigDialogSettingData(IMPLEMENTATION_TYPE.UNKNOWN, true, null));
-// Assert.assertNotNull(model.getImplementationType());
-// Assert.assertTrue(model.getImplementationType() == IMPLEMENTATION_TYPE.UNKNOWN);
-// }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryRegistryUtilTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryRegistryUtilTestCases.java
deleted file mode 100644
index c0e8508..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFLibraryRegistryUtilTestCases.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryconfig;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryRegistryUtilTestCases extends TestCase {
- private JSFLibraryRegistry libReg = null;
- private JSFLibraryRegistryUtil libUtilInstance = null;
- private int numCompLibs;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFCoreUtilHelper.createJSFLibraryRegistry();
- libReg = JSFCoreUtilHelper.getJSFLibraryRegistryFromJSFLibraryHelper();
- numCompLibs = libReg.getNonImplJSFLibraries().size();
- libUtilInstance = JSFLibraryRegistryUtil.getInstance();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- libReg = null;
- }
-
- public void testGetJSFLibraryRegistry() {
- Assert.assertNotNull(libUtilInstance.getJSFLibraryRegistry());
- Assert.assertEquals(libReg, libUtilInstance.getJSFLibraryRegistry());
- }
-
- public void testGetDefaultJSFImplementationLibrary() {
- JSFLibraryInternalReference dftImplLib = libUtilInstance.getDefaultJSFImplementationLibrary();
- Assert.assertNotNull(dftImplLib);
- Assert.assertEquals(libReg.getDefaultImplementation().getID(), dftImplLib.getID());
- }
-
- public void testGetJSFLibryReferencebyID() {
- JSFLibraryInternalReference lib = libUtilInstance.getJSFLibraryReferencebyID(libReg.getDefaultImplementationID());
- Assert.assertNotNull(lib);
- Assert.assertEquals(libReg.getDefaultImplementation().getID(), lib.getID());
- }
-
- public void testAddJSFLibrary() {
- JSFLibrary jsfLib = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
-// jsfLib.setID("124365879");
- jsfLib.setName("A_COMP_LIB");
- jsfLib.setImplementation(false);
-
- JSFLibraryInternalReference jsfLibRef = new JSFLibraryInternalReference(jsfLib,
- false, // selected
- false); // to be deployed
- Assert.assertTrue(libReg.getNonImplJSFLibraries().size() == numCompLibs);
- libUtilInstance.addJSFLibrary(jsfLibRef);
- Assert.assertTrue(libReg.getNonImplJSFLibraries().size() == (numCompLibs + 1));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFProjectLibraryReferenceTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFProjectLibraryReferenceTestCases.java
deleted file mode 100644
index d4caaff..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfig/JSFProjectLibraryReferenceTestCases.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryconfig;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-
-@SuppressWarnings("deprecation")
-public class JSFProjectLibraryReferenceTestCases extends TestCase {
- private String JSF_NAME = "MockJSFLib";
-// private String JSF_ID = "123456789";
- private boolean isImpl = false;
- private JSFLibrary jsfLib = null;
- private JSFLibraryInternalReference jsfLibRef = null;
-
- public JSFProjectLibraryReferenceTestCases(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- jsfLib = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
- jsfLib.setName(JSF_NAME);
- jsfLib.setImplementation(false);
-
- jsfLibRef = new JSFLibraryInternalReference(jsfLib,
- true, // selected
- true); // to be deployed
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- jsfLib = null;
- jsfLibRef = null;
- }
-
- /*
- * General test class for JSFLibraryInternalReference class
- */
- public void testJSFProjectLibraryReference() {
- JSFLibraryInternalReference jsfLibRef_ = new JSFLibraryInternalReference(jsfLib, true, true);
-
- Assert.assertNotNull(jsfLibRef_);
- Assert.assertTrue(jsfLibRef_.isSelected());
- Assert.assertTrue(jsfLibRef_.isCheckedToBeDeployed());
- Assert.assertTrue(JSF_NAME.equals(jsfLibRef_.getName()));
- Assert.assertTrue(JSF_NAME.equals(jsfLibRef_.getID()));
- Assert.assertTrue(JSF_NAME.equals(jsfLibRef_.getLabel()));
- Assert.assertTrue(isImpl == jsfLibRef_.isImplementation());
- }
-
- /*
- * test method for JSFLibraryInternalReference.getLibrary()
- */
- public void testGetLibrary() {
- Assert.assertNotNull(jsfLibRef);
- Assert.assertEquals(jsfLibRef.getLibrary(), jsfLib);
- }
-
- /*
- * test method for JSFLibraryInternalReference.isCheckedToBeDeployed()
- */
- public void testIsCheckedToBeDeployed() {
- JSFLibraryInternalReference jsfLibRef_ = new JSFLibraryInternalReference(jsfLib, true, true);
- Assert.assertNotNull(jsfLibRef_);
- Assert.assertTrue(jsfLibRef_.isCheckedToBeDeployed());
- }
-
- /*
- * test method for JSFLibraryInternalReference.setSelected()
- */
- public void testSetSelected() {
- JSFLibraryInternalReference jsfLibRef_ = new JSFLibraryInternalReference(jsfLib, true, true);
- Assert.assertNotNull(jsfLibRef_);
-
- Assert.assertTrue(jsfLibRef_.isSelected());
-
- jsfLibRef_.setSelected(false);
- Assert.assertFalse(jsfLibRef_.isSelected());
- }
-
- /*
- * test method for JSFLibraryInternalReference.isImplementation()
- */
- public void testIsImplementation() {
- Assert.assertFalse(jsfLibRef.isImplementation());
- }
-
- /*
- * test method for JSFLibraryInternalReferenceJSFLibraryInternalReference.getArchiveFiles()
- */
- public void testGetArchiveFiles() {
- String path2TestJAR = TestsPlugin.getInstallLocation().getPath() + "testfiles/faces-all-bogus.jar";
-
- ArchiveFile af = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- af.setRelativeToWorkspace(false);
- af.setSourceLocation(path2TestJAR);
- af.setJSFLibrary(jsfLib);
-
- Assert.assertNotNull(jsfLib.getArchiveFiles());
- Assert.assertTrue(jsfLib.getArchiveFiles().size() == 1);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryReferenceTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryReferenceTestCases.java
deleted file mode 100644
index 3281543..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryReferenceTestCases.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryconfiguration;
-
-import java.util.Collection;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReference;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceUserDefined;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceUserSpecified;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFVersion;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.internal.JSFLibraryReferenceFacadeFactory;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryReferenceTestCases extends TestCase {
- WebProjectTestEnvironment projectTestEnvironment;
- JDTTestEnvironment jdtTestEnv;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- projectTestEnvironment =
- new WebProjectTestEnvironment("JSFLibraryReferenceTestCases");
- boolean created = projectTestEnvironment.createProject(true);
-
- assertNotNull(projectTestEnvironment);
- assertNotNull(projectTestEnvironment.getTestProject());
- assertTrue(projectTestEnvironment.getTestProject().isAccessible());
-
- if (created) {
- // initialize test case for faces 1.1
- JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(projectTestEnvironment);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- createRegistryAndAddReferences(projectTestEnvironment, jsfFacedEnv);
- }
- }
-
- private void createRegistryAndAddReferences(WebProjectTestEnvironment projectTestEnvironment, JSFFacetedTestEnvironment jsfFacedEnv) throws CoreException {
- JSFLibraryRegistry jsfLibRegistry = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
-
- String[] archivefiles1 = {
- "faces-all-bogu.jar",
- "faces-api-bogus.jar",
- "faces-impl-bogus.jar",
- "tomahawk-bogus.jar"};
-
- String[] archivefiles2 = {
- "faces-all-bogu2.jar",
- "faces-api-bogus2.jar",
- "faces-impl-bogus2.jar"};
-
- JSFLibrary implJSFLib = JSFCoreUtilHelper.constructJSFLib("JSFLIBIMPL_NAME",
- "JSFLIBIMPL_NAME",
- archivefiles1,
- true);
- implJSFLib.setJSFVersion(org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_1_LITERAL);
-
- JSFLibrary nonimplJSFLib = JSFCoreUtilHelper.constructJSFLib("JSFLIBNONIMPL_NAME",
- "JSFLIBNONIMPL_NAME",
- archivefiles2,
- false);
- nonimplJSFLib.setJSFVersion(org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_2_LITERAL);
-
- PluginProvidedJSFLibrary ppJSFLib = (PluginProvidedJSFLibrary)JSFCoreUtilHelper.constructJSFLib("PP-JSFLIBNONIMPL_NAME",
- "testfiles/JSFLib",
- false,
- true);
- ppJSFLib.setPluginID("PluginProvidedLib");
- ppJSFLib.setLabel("PluginProvidedLib");
- ppJSFLib.setJSFVersion(org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_1_LITERAL);
-
- jsfLibRegistry.addJSFLibrary(implJSFLib);
- jsfFacedEnv.addJSFLibraryReference(implJSFLib, false);
-
- jsfLibRegistry.addJSFLibrary(nonimplJSFLib);
- jsfFacedEnv.addJSFLibraryReference(nonimplJSFLib, false);
-
- jsfLibRegistry.addJSFLibrary(ppJSFLib);
- jsfFacedEnv.addJSFLibraryReference(ppJSFLib, true);
- }
-
- public void testGetJSFLibraryReferences() {
- Collection<JSFLibraryReference> results = JSFLibraryConfigurationHelper.getJSFLibraryReferences(projectTestEnvironment.getTestProject());
- Assert.assertNotNull(results);
- Assert.assertTrue(results.size() >= 3); //expect 3 libs from project... JSFLIBIMPL_NAME, JSFLIBNOIMPL_NAME, PP-JSFLIBNOIMPL_NAME
- }
-
- public void testIsJSFLibraryContainer() throws JavaModelException, CoreException {
- IClasspathEntry[] entries = null;
- entries = getJDTTestEnv().getJavaProject().getRawClasspath();
- for (int i=0;i<entries.length;i++) {
- IClasspathEntry cpEntry = entries[i];
- boolean isJsfLib = JSFLibraryConfigurationHelper.isJSFLibraryContainer(cpEntry);
- if (cpEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER &&
- cpEntry.getPath().segment(0).equals(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID)) {
- Assert.assertTrue("Is a JSF LIB: "+cpEntry.toString(), isJsfLib);
- }
- else
- Assert.assertFalse("Is NOT a JSF LIB: "+cpEntry.toString(), isJsfLib);
- }
- }
-
- public void testJSFLibraryReferenceFacadeFactoryCreate() throws CoreException{
- IClasspathEntry[] entries = null;
- try {
- entries = getJDTTestEnv().getJavaProject().getRawClasspath();
- for (int i=0;i<entries.length;i++){
- IClasspathEntry cpEntry = entries[i];
- boolean isJsfLib = JSFLibraryConfigurationHelper.isJSFLibraryContainer(cpEntry);
- JSFLibraryReference ref = JSFLibraryReferenceFacadeFactory.create(cpEntry);
- if (isJsfLib) {
- String libID = getLibId(cpEntry);
- Assert.assertNotNull(libID+": ref", ref);
- if (libID.equals("JSFLIBIMPL_NAME")){
- doAsserts(ref, "JSFLibraryReferenceUserSpecifiedImpl", "JSFLIBIMPL_NAME", "JSFLIBIMPL_NAME", "JSFLIBIMPL_NAME", false, true, JSFVersion.V1_1, 4 );
- assertTrue(ref instanceof JSFLibraryReferenceUserDefined);
- assertTrue(ref instanceof JSFLibraryReferenceUserSpecified);
- }
- else if (libID.equals("JSFLIBNONIMPL_NAME")){
- doAsserts(ref, "JSFLibraryReferenceUserSpecifiedImpl", "JSFLIBNONIMPL_NAME", "JSFLIBNONIMPL_NAME", "JSFLIBNONIMPL_NAME", false,false, JSFVersion.V1_2, 3);
- assertTrue(ref instanceof JSFLibraryReferenceUserDefined);
- assertTrue(ref instanceof JSFLibraryReferenceUserSpecified);
- }
- else if (libID.equals("PluginProvidedLib$$PP-JSFLIBNONIMPL_NAME")){
- doAsserts(ref, "JSFLibraryReferencePluginProvidedImpl", "PluginProvidedLib$$PP-JSFLIBNONIMPL_NAME", "PP-JSFLIBNONIMPL_NAME", "PluginProvidedLib", true, false, JSFVersion.V1_1, 8 );
- }
- ref.toString();//just for coverage
- }
- else {
- Assert.assertNull(ref);
- }
- }
-
-// JSFLibraryReferenceFacadeFactory.create(cpEntry)
- } catch (JavaModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- private JDTTestEnvironment getJDTTestEnv() throws CoreException {
- if (jdtTestEnv == null){
- jdtTestEnv = new JDTTestEnvironment(projectTestEnvironment);
- }
- return jdtTestEnv;
- }
-
- private void doAsserts(JSFLibraryReference ref, String instanceName, String id, String name, String label, boolean isDeployed, boolean isImpl, JSFVersion version, int jarCount ) {
- Assert.assertTrue(id+":instanceName", ref.getClass().getSimpleName().equals(instanceName));
- Assert.assertEquals(id+": id",id, ref.getId());
- Assert.assertEquals(id+": name", name, ref.getName());
- Assert.assertEquals(id+": label",label, ref.getLabel());
- Assert.assertEquals(id+": isDeployed",isDeployed, ref.isDeployed());
- Assert.assertEquals(id+": isImpl", isImpl, ref.isJSFImplementation());
- Assert.assertEquals(id+": version", version, ref.getMaxSupportedVersion());
- Assert.assertEquals(id+": jarCount", jarCount, ref.getJars().size());
-
- }
-
-
-
- private String getLibId(IClasspathEntry cpEntry){
- return cpEntry.getPath().segment(1);
- }
-
-// public void testCreateServerSuppliedJSFLibRef() {
-// fail("Not yet implemented");
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryServerSuppliedReferenceTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryServerSuppliedReferenceTestCases.java
deleted file mode 100644
index 601b839..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryconfiguration/JSFLibraryServerSuppliedReferenceTestCases.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryconfiguration;
-
-import java.util.Collection;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReference;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryReferenceServerSupplied;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFVersion;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryServerSuppliedReferenceTestCases extends TestCase {
- WebProjectTestEnvironment projectTestEnvironment;
- JDTTestEnvironment jdtTestEnv;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- projectTestEnvironment =
- new WebProjectTestEnvironment("JSFLibraryServerSuppliedReferenceTestCases", ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_JAVA ).getVersion( "5.0" )
- , ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.5"));
- boolean created = projectTestEnvironment.createProject(true);
-
- assertNotNull(projectTestEnvironment);
- assertNotNull(projectTestEnvironment.getTestProject());
- assertTrue(projectTestEnvironment.getTestProject().isAccessible());
-
- if (created) {
- // initialize test case for faces 1.2
- JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(projectTestEnvironment);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_2);
-
- createRegistryAndAddreferences(projectTestEnvironment, jsfFacedEnv);
- }
- }
-
- private void createRegistryAndAddreferences(WebProjectTestEnvironment projectTestEnvironment, JSFFacetedTestEnvironment jsfFacedEnv) throws CoreException {
- JSFLibraryRegistry jsfLibRegistry = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
-
- String[] archivefiles1 = {
- "faces-all-bogu.jar",
- "faces-api-bogus.jar",
- "faces-impl-bogus.jar",
- "tomahawk-bogus.jar"};
-
- String[] archivefiles2 = {
- "faces-all-bogu2.jar",
- "faces-api-bogus2.jar",
- "faces-impl-bogus2.jar",
- "tomahawk-bogus2.jar"};
-
- JSFLibrary implJSFLib = JSFCoreUtilHelper.constructJSFLib("JSFLIBIMPL_NAME",
- "JSFLIBIMPL_NAME",
- archivefiles1,
- true);
- implJSFLib.setJSFVersion(org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_1_LITERAL);
-
- JSFLibrary nonimplJSFLib = JSFCoreUtilHelper.constructJSFLib("JSFLIBNONIMPL_NAME",
- "JSFLIBNONIMPL_NAME",
- archivefiles2,
- false);
- nonimplJSFLib.setJSFVersion(org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_2_LITERAL);
-
- PluginProvidedJSFLibrary ppJSFLib = (PluginProvidedJSFLibrary)JSFCoreUtilHelper.constructJSFLib("PP-JSFLIBNONIMPL_NAME",
- "testfiles/JSFLib",
- false,
- true);
- ppJSFLib.setPluginID("PluginProvidedLib");
- ppJSFLib.setLabel("PluginProvidedLib");
- ppJSFLib.setJSFVersion(org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion.V1_1_LITERAL);
-
- jsfLibRegistry.addJSFLibrary(implJSFLib);
-// jsfFacedEnv.addJSFLibraryReference(implJSFLib, false);
-
- jsfLibRegistry.addJSFLibrary(nonimplJSFLib);
-// jsfFacedEnv.addJSFLibraryReference(nonimplJSFLib, false);
-
- jsfLibRegistry.addJSFLibrary(ppJSFLib);
-// jsfFacedEnv.addJSFLibraryReference(ppJSFLib, true);
- }
-
- public void testGetJSFLibraryReferencesAndServerSuppliedRef() throws CoreException{
- Collection<JSFLibraryReference> libs = JSFLibraryConfigurationHelper.getJSFLibraryReferences(projectTestEnvironment.getTestProject());
- Assert.assertNotNull(libs);
- Assert.assertEquals(1, libs.size());
- JSFLibraryReference ref = (JSFLibraryReference)libs.iterator().next();
- Assert.assertTrue(ref instanceof JSFLibraryReferenceServerSupplied);
- doAsserts(ref, "JSFLibraryReferenceServerSuppliedImpl", "_ServerSupplied_", "_ServerSupplied_", "Server Supplied", false, true, JSFVersion.UNKNOWN, 0 );
-
- }
-
- private void doAsserts(JSFLibraryReference ref, String instanceName, String id, String name, String label, boolean isDeployed, boolean isImpl, JSFVersion version, int jarCount ) {
- Assert.assertTrue(id+":instanceName", ref.getClass().getSimpleName().equals(instanceName));
- Assert.assertEquals(id+": id",id, ref.getId());
- Assert.assertEquals(id+": name", name, ref.getName());
- Assert.assertEquals(id+": label",label, ref.getLabel());
- Assert.assertEquals(id+": isDeployed",isDeployed, ref.isDeployed());
- Assert.assertEquals(id+": isImpl", isImpl, ref.isJSFImplementation());
- Assert.assertEquals(id+": version", version, ref.getMaxSupportedVersion());
- Assert.assertEquals(id+": jarCount", jarCount, ref.getJars().size());
- Assert.assertNotNull(ref.toString());
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/ArchiveFileTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/ArchiveFileTestCases.java
deleted file mode 100644
index 4361c79..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/ArchiveFileTestCases.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import java.io.File;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-
-@SuppressWarnings("deprecation")
-public class ArchiveFileTestCases extends TestCase {
- private String path4TestFiles;
-
- // Test Data
- private String[] archivefiles = {
- "faces-all-bogus.jar",
- "faces-api-bogus.jar",
- "faces-impl-bogus.jar",
- "tomahawk-bogus.jar"};
-
- public ArchiveFileTestCases(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- path4TestFiles = TestsPlugin.getInstallLocation().getPath() + "testfiles/";
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testArchiveFile() {
- JSFLibrary jsfLib = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
-// jsfLib.setID("Myfaces");
- jsfLib.setName("Myfaces");
-
- ArchiveFile archiveFile = null;
- String testData;
- int subStrEnd = path4TestFiles.length() - 1;
-
- for (int i = 0; i < archivefiles.length; i++) {
- testData = path4TestFiles + archivefiles[i];
- archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(testData);
-
- Assert.assertEquals(testData, archiveFile.getSourceLocation());
-
- Assert.assertEquals(path4TestFiles.substring(0, subStrEnd), archiveFile.getPath());
-
- Assert.assertEquals(archivefiles[i], archiveFile.getName());
-
- Assert.assertTrue(archiveFile.exists());
-
- archiveFile.setJSFLibrary(jsfLib);
-
- Assert.assertEquals(jsfLib, archiveFile.getJSFLibrary());
- }
-
- // test number of jar files in the library.
- Assert.assertEquals(archivefiles.length, jsfLib.getArchiveFiles().size());
- }
-
- public void testsetSourceLocation() {
- ArchiveFile archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
-
- Assert.assertNotNull(archiveFile);
-
- // Not relative To workspace
- archiveFile.setRelativeToWorkspace(false);
- String testData = "c:\\test\\archivefiles";
- archiveFile.setSourceLocation(testData);
- Assert.assertEquals(testData, archiveFile.getSourceLocation());
-
- // Relative to workspace
- archiveFile.setRelativeToWorkspace(true);
- IWorkspaceRoot wsRoot = getWorkspaceRoot();
- IPath wsRootPath = wsRoot.getLocation();
- testData = "archivefiles";
- archiveFile.setSourceLocation(wsRootPath.toOSString() + File.separator + testData);
- Assert.assertEquals(testData, archiveFile.getSourceLocation());
-
- }
-
- public void testgetPath() {
- ArchiveFile archiveFile = null;
- String testData;
- //int subStrEnd = path4TestFiles.length() - 1;
-
- // Branch test - not-relative to workspace
- testData = path4TestFiles + archivefiles[archivefiles.length-1];
- archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(testData);
-// Assert.assertTrue(path4TestFiles.contains(archiveFile.getPath()));
-
- // Branch test - relative to workspace
- archiveFile.setRelativeToWorkspace(true);
- IWorkspaceRoot wsRoot = getWorkspaceRoot();
- IPath wsRootPath = wsRoot.getLocation();
- testData = "test.jar";
- archiveFile.setSourceLocation(wsRootPath.toOSString() + File.separator + testData);
- IPath arPath = new Path(archiveFile.getPath());
- Assert.assertEquals(wsRootPath, arPath);
-
- }
-
- public void testgetName() {
- ArchiveFile archiveFile = null;
- String testData;
- //int subStrEnd = path4TestFiles.length() - 1;
-
- // Branch test - not-relative to workspace
- testData = path4TestFiles + archivefiles[archivefiles.length-1];
- archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(testData);
- Assert.assertEquals(archivefiles[archivefiles.length-1], archiveFile.getName());
-
- // Branch test - relative to workspace
- archiveFile.setRelativeToWorkspace(true);
- IWorkspaceRoot wsRoot = getWorkspaceRoot();
- IPath wsRootPath = wsRoot.getLocation();
- testData = "test.jar";
- archiveFile.setSourceLocation(wsRootPath.toOSString() + File.separator + testData);
- Assert.assertEquals(testData, archiveFile.getName());
-
- }
-
- public void testexists() {
- ArchiveFile archiveFile = null;
- String testData;
- //int subStrEnd = path4TestFiles.length() - 1;
-
- testData = path4TestFiles + archivefiles[archivefiles.length-1];
- archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(testData);
-
- Assert.assertTrue(archiveFile.exists());
-
- archiveFile.setRelativeToWorkspace(true);
- IWorkspaceRoot wsRoot = getWorkspaceRoot();
- IPath wsRootPath = wsRoot.getLocation();
- testData = "test.jar";
- archiveFile.setSourceLocation(wsRootPath.toOSString() + File.separator + testData);
- Assert.assertFalse(archiveFile.exists());
-
- }
-
- public void testequals() {
- ArchiveFile archiveFile_01 = null;
- ArchiveFile archiveFile_02 = null;
- String testData;
- //int subStrEnd = path4TestFiles.length() - 1;
-
- testData = path4TestFiles + archivefiles[archivefiles.length-1];
- archiveFile_01 = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile_01.setRelativeToWorkspace(false);
- archiveFile_01.setSourceLocation(testData);
-
- archiveFile_02 = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile_02.setRelativeToWorkspace(false);
- archiveFile_02.setSourceLocation(testData);
-
- Assert.assertEquals(archiveFile_01, archiveFile_02);
-
- archiveFile_01.setRelativeToWorkspace(true);
- IWorkspaceRoot wsRoot = getWorkspaceRoot();
- IPath wsRootPath = wsRoot.getLocation();
- testData = "test.jar";
- archiveFile_01.setSourceLocation(wsRootPath.toOSString() + File.separator + testData);
- Assert.assertFalse(archiveFile_01.equals(archiveFile_02));
- }
-
- public void testcopyTo() {
- ArchiveFile archiveFile = null;
- String testData;
- //int subStrEnd = path4TestFiles.length() - 1;
-
- testData = path4TestFiles + archivefiles[0];
-
- archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(testData);
-
- IWorkspaceRoot wsRoot = getWorkspaceRoot();
- IPath wsRootPath = wsRoot.getLocation();
-
- boolean copied = archiveFile.copyTo(wsRootPath.toOSString());
-
- Assert.assertTrue(copied);
- File fileCopied = new File(wsRootPath.toOSString() + File.separator + archivefiles[0]);
- Assert.assertTrue(fileCopied.exists());
-
- Assert.assertFalse(archiveFile.copyTo(wsRootPath.toOSString()));
-
- // cleanup test data
- fileCopied.deleteOnExit();
- }
-
- private IWorkspaceRoot getWorkspaceRoot() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- return (workspace != null) ? workspace.getRoot() : null;
- }
-
-} // end of ArchiveFileTestCases
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryPackageTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryPackageTestCases.java
deleted file mode 100644
index 2943345..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryPackageTestCases.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryPackage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryPackageImpl;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryRegistryPackageTestCases extends TestCase {
-
- public JSFLibraryRegistryPackageTestCases(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testObjectCreation() {
- JSFLibraryRegistryPackage jlrp = JSFLibraryRegistryPackageImpl.init();
-
- Assert.assertNotNull(jlrp);
-
- // test some getters that initialized in the Class satic init methods
- Assert.assertNotNull(jlrp.getJSFLibrary_ID());
- Assert.assertNotNull(jlrp.getName());
- Assert.assertNotNull(jlrp.getJSFLibraryRegistry());
- Assert.assertNotNull(jlrp.getArchiveFile());
- Assert.assertNotNull(jlrp.getJSFLibrary());
- Assert.assertNotNull(jlrp.getPluginProvidedJSFLibrary());
- Assert.assertNotNull(jlrp.getJSFVersion());
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryTestCases.java
deleted file mode 100644
index 5f13b27..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryRegistryTestCases.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryRegistryTestCases extends TestCase {
-
- public JSFLibraryRegistryTestCases(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getDefaultImplementationID()'
- */
- public void testGetDefaultImplementationID() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- Assert.assertEquals("", jsfLibRegistry.getDefaultImplementationID());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.setDefaultImplementationID(String)'
- */
- public void testSetDefaultImplementationID() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- String updatedImplID = "myfaces_reg";
- jsfLibRegistry.setDefaultImplementationID(updatedImplID);
- Assert.assertEquals(updatedImplID, jsfLibRegistry.getDefaultImplementationID());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getJSFLibraries()'
- */
- public void testGetJSFLibraries() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
-
- String[] archivefiles = {
- "faces-all-bogu.jar",
- "faces-api-bogus.jar",
- "faces-impl-bogus.jar",
- "tomahawk-bogus.jar"};
-
- JSFLibrary implJSFLib = JSFCoreUtilHelper.constructJSFLib("impljsflib_id",
- "impljsflib_name",
- archivefiles,
- true);
- JSFLibrary nonimplJSFLib = JSFCoreUtilHelper.constructJSFLib("nonimpljsflib_id",
- "nonimpljsflib_name",
- archivefiles,
- false);
-
- jsfLibRegistry.addJSFLibrary(implJSFLib);
- jsfLibRegistry.addJSFLibrary(nonimplJSFLib);
-
- Assert.assertEquals(2, jsfLibRegistry.getJSFLibraries().size());
- Assert.assertEquals(1, jsfLibRegistry.getImplJSFLibraries().size());
- Assert.assertEquals(1, jsfLibRegistry.getNonImplJSFLibraries().size());
- Assert.assertEquals(1, jsfLibRegistry.getJSFLibrariesByName("impljsflib_name").size());
- Assert.assertEquals(1, jsfLibRegistry.getJSFLibrariesByName("nonimpljsflib_name").size());
- Assert.assertNull(jsfLibRegistry.getJSFLibraryByID("nosuchlib_id"));
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getPluginProvidedJSFLibraries()'
- */
- public void testGetPluginProvidedJSFLibraries() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- PluginProvidedJSFLibrary pluginLib = (PluginProvidedJSFLibrary)JSFCoreUtilHelper.constructJSFLib("plugin_provided", "testfiles/JSFLib", true, true);
- jsfLibRegistry.addJSFLibrary(pluginLib);
- JSFLibrary nonPluginLib = JSFCoreUtilHelper.constructJSFLib("non_plugin_provided", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(nonPluginLib);
- Assert.assertEquals(1, jsfLibRegistry.getPluginProvidedJSFLibraries().size());
-
- Assert.assertEquals(pluginLib.getName(), pluginLib.getLabel());
- pluginLib.setLabel("plugin_providedLABEL");
- Assert.assertEquals("plugin_providedLABEL", pluginLib.getLabel());
-
- Assert.assertEquals(nonPluginLib.getName(), nonPluginLib.getLabel());
- Assert.assertEquals(nonPluginLib.getName(), nonPluginLib.getID());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.jsflibraryregistry.internal.internal.impl.JSFLibraryRegistryImpl.getDefaultImplementation()'
- */
- public void testGetDefaultImplementation() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary lib = JSFCoreUtilHelper.constructJSFLib("lib", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib);
- jsfLibRegistry.setDefaultImplementation(lib);
- Assert.assertEquals(lib, jsfLibRegistry.getDefaultImplementation());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.setDefaultImplementation(JSFLibrary)'
- */
- public void testSetDefaultImplementation() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary lib = JSFCoreUtilHelper.constructJSFLib("lib", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib);
- jsfLibRegistry.setDefaultImplementation(lib);
- Assert.assertEquals(lib, jsfLibRegistry.getDefaultImplementation());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getJSFLibraryByID(String)'
- */
- public void testGetJSFLibraryByID() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary lib = JSFCoreUtilHelper.constructJSFLib("lib", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib);
- String libID = "lib";
-// lib.setID(libID);
- Assert.assertEquals(lib, jsfLibRegistry.getJSFLibraryByID(libID));
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getJSFLibrariesByName(String)'
- */
- public void testGetJSFLibrariesByName() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- String lib1Name = "Sun RI v1.1";
- JSFLibrary lib1 = JSFCoreUtilHelper.constructJSFLib(lib1Name, "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib1);
- String lib2Name = "Another Sun RI v1.1";
- JSFLibrary lib2 = JSFCoreUtilHelper.constructJSFLib(lib2Name, "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib2);
- Assert.assertEquals(1, jsfLibRegistry.getJSFLibrariesByName(lib1Name).size());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getImplJSFLibraries()'
- */
- public void testGetImplJSFLibraries() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary implLib = JSFCoreUtilHelper.constructJSFLib("impl_lib", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(implLib);
- JSFLibrary nonImplLib = JSFCoreUtilHelper.constructJSFLib("non_impl_lib", "testfiles/JSFLib", false, false);
- jsfLibRegistry.addJSFLibrary(nonImplLib);
- Assert.assertEquals(1, jsfLibRegistry.getImplJSFLibraries().size());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getNonImplJSFLibraries()'
- */
- public void testGetNonImplJSFLibraries() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary implLib = JSFCoreUtilHelper.constructJSFLib("impl_lib", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(implLib);
- JSFLibrary nonImplLib = JSFCoreUtilHelper.constructJSFLib("non_impl_lib", "testfiles/JSFLib", false, false);
- jsfLibRegistry.addJSFLibrary(nonImplLib);
- Assert.assertEquals(1, jsfLibRegistry.getNonImplJSFLibraries().size());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.getAllJSFLibraries()'
- */
- public void testGetAllJSFLibraries() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary lib1 = JSFCoreUtilHelper.constructJSFLib("plugin_provided", "testfiles/JSFLib", true, true);
- jsfLibRegistry.addJSFLibrary(lib1);
- JSFLibrary lib2 = JSFCoreUtilHelper.constructJSFLib("non_plugin_provided", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib2);
- Assert.assertEquals(2, jsfLibRegistry.getAllJSFLibraries().size());
- }
-
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.addJSFLibrary(JSFLibrary)'
- */
- public void testAddJSFLibrary() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary pluginLib = JSFCoreUtilHelper.constructJSFLib("plugin_provided", "testfiles/JSFLib", true, true);
- jsfLibRegistry.addJSFLibrary(pluginLib);
- Assert.assertEquals(1, jsfLibRegistry.getPluginProvidedJSFLibraries().size());
- Assert.assertEquals(0, jsfLibRegistry.getJSFLibraries().size());
- JSFLibrary nonPluginLib = JSFCoreUtilHelper.constructJSFLib("non_plugin_provided", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(nonPluginLib);
- Assert.assertEquals(1, jsfLibRegistry.getPluginProvidedJSFLibraries().size());
- Assert.assertEquals(1, jsfLibRegistry.getJSFLibraries().size());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryRegistryImpl.removeJSFLibrary(JSFLibrary)'
- */
- public void testRemoveJSFLibrary() {
- JSFLibraryRegistry jsfLibRegistry = JSFCoreUtilHelper.getNewJSFLibraryRegistry();
- JSFLibrary lib = JSFCoreUtilHelper.constructJSFLib("lib", "testfiles/JSFLib", true, false);
- jsfLibRegistry.addJSFLibrary(lib);
- Assert.assertEquals(1, jsfLibRegistry.getJSFLibraries().size());
- jsfLibRegistry.removeJSFLibrary(lib);
- Assert.assertEquals(0, jsfLibRegistry.getJSFLibraries().size());
- }
-
- public void testPluginProvidedJSFLibCreationFromExtPt() {
- //2 jar lib
- JSFLibraryRegistry jsfLibRegistry = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- List<?> libs = jsfLibRegistry.getJSFLibrariesByName("TEST_PP_LIB_2");
- Assert.assertNotNull(libs);
- Assert.assertEquals(1, libs.size());
- JSFLibrary lib = (JSFLibrary)libs.get(0);
- Assert.assertTrue(lib instanceof PluginProvidedJSFLibrary);
- Assert.assertEquals(2, lib.getArchiveFiles().size());
- Assert.assertEquals("FAKE LIB FROM jsf.core.tests (1)", lib.getLabel());
- Assert.assertTrue(lib.isImplementation());
-
- //empty jar lib
- libs = jsfLibRegistry.getJSFLibrariesByName("TEST_PP_LIB_EMPTY");
- Assert.assertNotNull(libs);
- Assert.assertEquals(1, libs.size());
- lib = (JSFLibrary)libs.get(0);
- Assert.assertTrue(lib instanceof PluginProvidedJSFLibrary);
- Assert.assertEquals(0, lib.getArchiveFiles().size());
- Assert.assertEquals("FAKE LIB FROM jsf.core.tests (2)", lib.getLabel());
- Assert.assertFalse(lib.isImplementation());
-
- }
-
-} // end of JSFLibraryRegistryTestCases
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryTestCases.java
deleted file mode 100644
index 6e3e19c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/JSFLibraryTestCases.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import java.util.Iterator;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-
-@SuppressWarnings("deprecation")
-public class JSFLibraryTestCases extends TestCase {
- private JSFLibrary jsfLib = null;
-
- // test data
- private String jsfLibID = "MyfacesID";
- private String jsfLibName = "MyfacesName";
- //private boolean jsfDeployDefault = true;
- private String[] archivefiles = {
- "faces-all-bogus.jar",
- "faces-api-bogus.jar",
- "faces-impl-bogus.jar",
- "tomahawk-bogus.jar"};
-
- public JSFLibraryTestCases(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- jsfLib = JSFCoreUtilHelper.constructJSFLib(
- jsfLibID,
- jsfLibName,
- archivefiles,
- true);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- jsfLib = null;
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl.getArchiveFiles()'
- * Probably not needed...
- */
- public void testgetArchiveFiles() {
- EList<?> el = jsfLib.getArchiveFiles();
- Assert.assertNotNull(el);
- Assert.assertEquals(archivefiles.length, el.size());
- Iterator<?> it = el.iterator();
- int i = 0;
- while(it.hasNext()) {
- Assert.assertEquals(archivefiles[i], ((ArchiveFile)it.next()).getName());
- i++;
- }
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.jsflibraryregistry.impl.JSFLibraryImpl.containsArchiveFile(String)'
- */
- public void testcontainsArchiveFile() {
- String pathTestFiles = TestsPlugin.getInstallLocation().getPath() + "testfiles/";
-
- Assert.assertTrue( jsfLib.containsArchiveFile(pathTestFiles + archivefiles[2]) );
- Assert.assertFalse( jsfLib.containsArchiveFile(pathTestFiles + "bogus.jar") );
- Assert.assertFalse( jsfLib.containsArchiveFile(pathTestFiles + "sandbox.jar") );
-
- }
-
- public void testgetWorkingCopy() {
- JSFLibrary jsfLibWorkingCopy = jsfLib.getWorkingCopy();
-
- Assert.assertNotNull(jsfLibWorkingCopy);
- Assert.assertEquals(jsfLibWorkingCopy.getArchiveFiles().size(),
- jsfLib.getArchiveFiles().size());
-
- }
-
- public void testupdateValue() {
- String[] archives = {
- "faces-all-bogus.jar",
- "faces-api-bogus.jar" };
-
- JSFLibrary jsfLibtmp = JSFCoreUtilHelper.constructJSFLib(
- "jsfLibTmp",
- "jsfLibTmpName",
- archives,
- true);
-
- jsfLibtmp.updateValues(jsfLib);
-
- Assert.assertEquals(jsfLibtmp.getID(), jsfLib.getID());
- Assert.assertEquals(jsfLibtmp.getName(), jsfLib.getName());
- Assert.assertEquals(jsfLibtmp.getArchiveFiles().size(),
- jsfLib.getArchiveFiles().size());
-
- }
-
- /**
- * ArchiveFile.copyTo should be sufficient to cover this case.
- *
- public void testcopyTo() {
- }
- */
-
-} // end of JSFLibraryTestCases
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/MaintainDefaultImplementationAdapterTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/MaintainDefaultImplementationAdapterTestCases.java
deleted file mode 100644
index e1d2693..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/MaintainDefaultImplementationAdapterTestCases.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-
-@SuppressWarnings("deprecation")
-public class MaintainDefaultImplementationAdapterTestCases extends TestCase {
-
- public MaintainDefaultImplementationAdapterTestCases(String name) {
- super(name);
- }
-
- protected JSFLibraryRegistry getPreparedJSFLibraryRegistry() {
- //get registry from JSFCorePlugin
- JSFLibraryRegistry registry = JSFCoreUtilHelper.getJSFLibraryRegistryFromJSFLibraryHelper();
- //clear registry (loaded and plugin-provided libs may have crept in)
- registry.getJSFLibraries().clear();
- registry.getPluginProvidedJSFLibraries().clear();
- //ensure default implementation is null
- registry.setDefaultImplementation(null);
- return registry;
- }
-
- public void testAddingFirstImplSetsNewDefaultImpl() {
- //get prepared registry
- JSFLibraryRegistry registry = getPreparedJSFLibraryRegistry();
- //create and add impl
- JSFLibrary impl1 = JSFCoreUtilHelper.constructJSFLib("impl1", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl1);
- //test
- Assert.assertEquals(impl1, registry.getDefaultImplementation());
- }
-
- public void testRemovingDefaultImplSetsNewDefaultImpl() {
- //get prepared registry
- JSFLibraryRegistry registry = getPreparedJSFLibraryRegistry();
- //create and add impl
- JSFLibrary impl1 = JSFCoreUtilHelper.constructJSFLib("impl1", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl1);
- //create and add impl
- JSFLibrary impl2 = JSFCoreUtilHelper.constructJSFLib("impl2", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl2);
- //test
- Assert.assertEquals(impl1, registry.getDefaultImplementation());
- //remove default impl
- registry.removeJSFLibrary(impl1);
- //test
- Assert.assertEquals(impl2, registry.getDefaultImplementation());
- }
-
- public void testRemovingLastImplNullsDefaultImpl() {
- //get prepared registry
- JSFLibraryRegistry registry = getPreparedJSFLibraryRegistry();
- //create and add impl
- JSFLibrary impl1 = JSFCoreUtilHelper.constructJSFLib("impl1", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl1);
- //test
- Assert.assertEquals(impl1, registry.getDefaultImplementation());
- //remove default impl
- registry.removeJSFLibrary(impl1);
- //test
- Assert.assertNull(registry.getDefaultImplementation());
- }
-
- public void testChangingLibToImplSetsNewDefaultImpl() {
- //get prepared registry
- JSFLibraryRegistry registry = getPreparedJSFLibraryRegistry();
- //create and add lib
- JSFLibrary lib1 = JSFCoreUtilHelper.constructJSFLib("lib1", "testfiles/JSFLib", false, false);
- registry.addJSFLibrary(lib1);
- //test
- Assert.assertNull(registry.getDefaultImplementation());
- //make lib an impl
- lib1.setImplementation(true);
- //test
- Assert.assertEquals(lib1, registry.getDefaultImplementation());
- }
-
- public void testChangingImplToLibSetsNewDefaultImpl() {
- //get prepared registry
- JSFLibraryRegistry registry = getPreparedJSFLibraryRegistry();
- //create and add impl
- JSFLibrary impl1 = JSFCoreUtilHelper.constructJSFLib("impl1", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl1);
- //create and add impl
- JSFLibrary impl2 = JSFCoreUtilHelper.constructJSFLib("impl2", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl2);
- //test
- Assert.assertEquals(impl1, registry.getDefaultImplementation());
- //make default impl a lib
- impl1.setImplementation(false);
- //test
- Assert.assertEquals(impl2, registry.getDefaultImplementation());
- }
-
- public void testChangingLastImplToLibNullsDefaultImpl() {
- //get prepared registry
- JSFLibraryRegistry registry = getPreparedJSFLibraryRegistry();
- //create and add impl
- JSFLibrary impl1 = JSFCoreUtilHelper.constructJSFLib("impl1", "testfiles/JSFLib", true, false);
- registry.addJSFLibrary(impl1);
- //test
- Assert.assertEquals(impl1, registry.getDefaultImplementation());
- //make default impl a lib
- impl1.setImplementation(false);
- //test
- Assert.assertNull(registry.getDefaultImplementation());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIBArchiveFilesDelegate.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIBArchiveFilesDelegate.java
deleted file mode 100644
index c71a7a2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIBArchiveFilesDelegate.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import org.eclipse.jst.jsf.core.jsflibraryregistry.PluginProvidedJSFLibraryArchiveFilesDelegate;
-
-@SuppressWarnings("deprecation")
-public class TEST_PP_LIBArchiveFilesDelegate extends
- PluginProvidedJSFLibraryArchiveFilesDelegate {
-
- public TEST_PP_LIBArchiveFilesDelegate() {
- super();
- }
-
- @Override
- public void getArchiveFiles() {
- addArchiveFile("/lib/foo.jar");
- addArchiveFile("/boo.jar");
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIB_EMPTYArchiveFilesDelegate.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIB_EMPTYArchiveFilesDelegate.java
deleted file mode 100644
index 3b7ce71..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/TEST_PP_LIB_EMPTYArchiveFilesDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry;
-
-import org.eclipse.jst.jsf.core.jsflibraryregistry.PluginProvidedJSFLibraryArchiveFilesDelegate;
-
-@SuppressWarnings("deprecation")
-public class TEST_PP_LIB_EMPTYArchiveFilesDelegate extends
- PluginProvidedJSFLibraryArchiveFilesDelegate {
-
- public TEST_PP_LIB_EMPTYArchiveFilesDelegate() {
- super();
- }
-
- @Override
- public void getArchiveFiles() {
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/migration/MigrationV1toV2Test.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/migration/MigrationV1toV2Test.java
deleted file mode 100644
index 1b06db6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/jsflibraryregistry/migration/MigrationV1toV2Test.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.jsflibraryregistry.migration;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.util.JSFLibraryRegistryUpgradeUtil;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.osgi.framework.Bundle;
-
-/**
- * Tests a migration from a version 1 registry file to a version 2 file
- *
- * @author cbateman
- *
- */
-@SuppressWarnings("deprecation")
-public class MigrationV1toV2Test extends TestCase
-{
- private ByteArrayOutputStream _v1RegistryFile;
- private ByteArrayOutputStream _v2RegistryFile;
- private ByteArrayOutputStream _v1RegistryBackup;
-
- protected void setUp() throws Exception
- {
- // JSFCorePlugin must already be active to ensure that it doesn't stop on
- // the test data when start is called
- assertEquals(Bundle.ACTIVE, JSFCorePlugin.getDefault().getBundle().getState());
-
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- // clear plugin meta-data on every call
- _v1RegistryFile = clearRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- _v2RegistryFile = clearRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- _v1RegistryBackup = clearRegistryFile(JSFLibraryRegistryUpgradeUtil.getBackupFileName(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL));
- }
-
- private ByteArrayOutputStream clearRegistryFile(String fileName) throws Exception
- {
- final File file = getRegistryFile(fileName);
-
- ByteArrayOutputStream backup = null;
-
- if (file.exists())
- {
- // backup the file so that we can restore it on tear down.
- backup = JSFTestUtil.loadFromFile(file);
-
- assertTrue("Must be able to delete file: ".concat(fileName), file.delete());
- }
- return backup;
- }
-
- protected void tearDown() throws Exception {
-
- tearDownRegistryFile(_v1RegistryFile, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- tearDownRegistryFile(_v2RegistryFile, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- tearDownRegistryFile(_v1RegistryBackup, JSFLibraryRegistryUpgradeUtil.getBackupFileName(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL));
- }
-
- private void tearDownRegistryFile(final ByteArrayOutputStream backup, final String name) throws Exception
- {
- // restore the registries as they were before setup
- if (backup != null)
- {
- JSFTestUtil.saveToFileSystem(backup.toByteArray(), JSFTestUtil.getPlatformAbsPath(name));
- }
- // if wasn't there, make sure to delete it
- else
- {
- clearRegistryFile(name);
- }
-
- }
- private File getRegistryFile(String fileName) throws Exception
- {
- URI uri = JSFTestUtil.getPlatformAbsPath(fileName);
- return new File(uri);
- }
-
- /**
- * Pre-condition: Empty Version 1 registry file
- *
- * Expected post-conditions:
- *
- * 1) a successful upgrade should occur, but the upgraded flag should be false
- * 2) the backup file is successfully created
- */
- public void testEmptyFileMigration()
- {
- TestFileResource emptyReg = new TestFileResource();
-
- try
- {
- emptyReg.load(TestsPlugin.getDefault().getBundle(), "/testfiles/JSFLib/registryFiles/EmptyJSFLibraryRegistryV1.xml.data");
- JSFTestUtil.savePlatformRelative(emptyReg, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- assertTrue(JSFTestUtil.areEqual(emptyReg, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL)));
-
- JSFLibraryRegistryUpgradeUtil upgradeUtil =
- JSFLibraryRegistryUpgradeUtil.getInstance();
-
- upgradeUtil.upgradeRegistryIfNecessary(2);
- assertEquals(IStatus.OK, upgradeUtil.getUpgradeStatus().getSeverity());
- assertEquals(false, upgradeUtil.getUpgradeStatus().isUpgradeOccurred());
-
- // ensure backup is successful
- assertTrue(JSFTestUtil.areEqual(emptyReg, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL.concat(".bkp"))));
-
- // in the case of empty file, the new v2 file must exist and match the v1 file after upgrade
- assertTrue(JSFTestUtil.areEqual(emptyReg, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL)));
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (URISyntaxException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Pre-condition: Version 1 is present and valid with entries
- *
- * Expected post-conditions:
- *
- * 1) The V2 file will be created and populated with the old entries.
- * 2) Upgrade flag set.
- * 3) The ws will still need manual upgrade (not tested for)
- * 4) The v1 backup file will be created.
- *
- */
- public void testValidNonEmptyMigration()
- {
- TestFileResource validNonEmptyReg = new TestFileResource();
-
- try
- {
- validNonEmptyReg.load(TestsPlugin.getDefault().getBundle(), "/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1.xml.data");
- JSFTestUtil.savePlatformRelative(validNonEmptyReg, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- assertTrue(JSFTestUtil.areEqual(validNonEmptyReg, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL)));
-
- JSFLibraryRegistryUpgradeUtil upgradeUtil =
- JSFLibraryRegistryUpgradeUtil.getInstance();
-
- upgradeUtil.upgradeRegistryIfNecessary(2);
- assertEquals(IStatus.OK, upgradeUtil.getUpgradeStatus().getSeverity());
- assertEquals(true, upgradeUtil.getUpgradeStatus().isUpgradeOccurred());
-
- // ensure backup is successful
- assertTrue(JSFTestUtil.areEqual(validNonEmptyReg
- , JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.getBackupFileName(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL))));
-
- TestFileResource expectedV2File = new TestFileResource();
- expectedV2File.load(TestsPlugin.getDefault().getBundle(), "/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1_expectedMigrationResult.xml.data");
-
- // in the case of empty file, the new v2 file must exist and match the v1 file after upgrade
- assertTrue(JSFTestUtil.areEqual(expectedV2File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL)));
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (URISyntaxException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Pre-condition: No JSF Library Registry exists whatsoever
- *
- * Expected post-conditions:
- *
- * 1) No upgrade should occur
- * 2) No upgrade flag set
- * 3) Do nothing
- */
- public void testNoRegistryFileMigration()
- {
-
- JSFLibraryRegistryUpgradeUtil upgradeUtil =
- JSFLibraryRegistryUpgradeUtil.getInstance();
-
- upgradeUtil.upgradeRegistryIfNecessary(2);
-
- // status should ok with no upgrade
- assertEquals(IStatus.OK, upgradeUtil.getUpgradeStatus().getSeverity());
- assertEquals(false, upgradeUtil.getUpgradeStatus().isUpgradeOccurred());
-
- // no file should be created
- try
- {
- File file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- assertFalse(file.exists());
- file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- assertFalse(file.exists());
- file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.getBackupFileName(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL));
- assertFalse(file.exists());
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Pre-condition: V2 library already exists as expected. The V1 file is not present
- *
- * Expected post-conditions:
- *
- * 1) No upgrade should occur
- * 2) No upgrade flag set
- * 3) Do nothing
- */
- public void testV2AlreadyPresent_NoV1()
- {
- TestFileResource validV2File = new TestFileResource();
-
-
- // no file should be created
- try
- {
- // load V2
- validV2File.load(TestsPlugin.getDefault().getBundle(), "/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV2.xml.data");
- JSFTestUtil.savePlatformRelative(validV2File, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- assertTrue(JSFTestUtil.areEqual(validV2File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL)));
-
- JSFLibraryRegistryUpgradeUtil upgradeUtil =
- JSFLibraryRegistryUpgradeUtil.getInstance();
-
- upgradeUtil.upgradeRegistryIfNecessary(2);
-
- // status should ok with no upgrade
- assertEquals(IStatus.OK, upgradeUtil.getUpgradeStatus().getSeverity());
- assertEquals(false, upgradeUtil.getUpgradeStatus().isUpgradeOccurred());
-
- // No backup or v1.
- File file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- assertFalse(file.exists());
- file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.getBackupFileName(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL));
- assertFalse(file.exists());
-
- // v2 file should be present and unchanged.
- file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- assertTrue(file.exists());
- assertTrue(JSFTestUtil.areEqual(validV2File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL)));
-
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
- /**
- * Pre-condition: V2 library already exists as expected. The V1 file is present
- *
- * Expected post-conditions:
- *
- * 1) No upgrade should occur
- * 2) No upgrade flag set
- * 3) Do nothing
- */
- public void testV2AlreadyPresent_WithV1()
- {
- TestFileResource validV2File = new TestFileResource();
- TestFileResource validV1File = new TestFileResource();
-
- // no file should be created
- try
- {
- // load V1
- validV1File.load(TestsPlugin.getDefault().getBundle(), "/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1.xml.data");
- JSFTestUtil.savePlatformRelative(validV1File, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- assertTrue(JSFTestUtil.areEqual(validV1File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL)));
-
- // load V2
- validV2File.load(TestsPlugin.getDefault().getBundle(), "/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV2.xml.data");
- JSFTestUtil.savePlatformRelative(validV2File, JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- assertTrue(JSFTestUtil.areEqual(validV1File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL)));
-
- JSFLibraryRegistryUpgradeUtil upgradeUtil =
- JSFLibraryRegistryUpgradeUtil.getInstance();
-
- upgradeUtil.upgradeRegistryIfNecessary(2);
-
- // status should ok with no upgrade
- assertEquals(IStatus.OK, upgradeUtil.getUpgradeStatus().getSeverity());
- assertEquals(false, upgradeUtil.getUpgradeStatus().isUpgradeOccurred());
-
- // v1 and v2 files should be present. And should be unchanged
- File file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL);
- assertTrue(file.exists());
- assertTrue(JSFTestUtil.areEqual(validV1File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL)));
-
- file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
- assertTrue(file.exists());
- assertTrue(JSFTestUtil.areEqual(validV1File, JSFTestUtil.getPlatformAbsPath(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL)));
-
- // No backup or v1.
- file = getRegistryFile(JSFLibraryRegistryUpgradeUtil.getBackupFileName(JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V1_URL));
- assertFalse(file.exists());
-
-
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMAttributeDeclaration.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMAttributeDeclaration.java
deleted file mode 100644
index 35e50ff..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMAttributeDeclaration.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.mock;
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class MockCMAttributeDeclaration extends MockCMNode implements
- CMAttributeDeclaration
-{
-
- private CMDataType _cmType;
-
- public MockCMAttributeDeclaration(String nodeName, CMDataType cmType)
- {
- super(nodeName, CMNode.ATTRIBUTE_DECLARATION);
- _cmType = cmType;
- }
-
- public String getAttrName()
- {
- return super.getNodeName();
- }
-
- public CMDataType getAttrType()
- {
- return _cmType;
- }
-
- public String getDefaultValue()
- {
- throw new UnsupportedOperationException();
- }
-
- @SuppressWarnings("rawtypes")
- public Enumeration getEnumAttr()
- {
- throw new UnsupportedOperationException();
- }
-
- public int getUsage()
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMNode.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMNode.java
deleted file mode 100644
index f8b38a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockCMNode.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.mock;
-
-import junit.framework.Assert;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class MockCMNode implements CMNode
-{
- private final String _nodeName;
- private final int _nodeType;
-
- public MockCMNode(final String nodeName, final int nodeType)
- {
- _nodeName = nodeName;
- switch(nodeType)
- {
- case CMNode.ANY_ELEMENT:
- case CMNode.ATTRIBUTE_DECLARATION:
- case CMNode.DATA_TYPE:
- case CMNode.DOCUMENT:
- case CMNode.DOCUMENTATION:
- case CMNode.ELEMENT_DECLARATION:
- case CMNode.ENTITY_DECLARATION:
- case CMNode.GROUP:
- case CMNode.NAME_SPACE:
- _nodeType = nodeType;
- break;
- default:
- _nodeType = -1;
- Assert.fail("Invalid type: "+nodeType);
- }
- }
- public String getNodeName()
- {
- return _nodeName;
- }
-
- public int getNodeType()
- {
- return _nodeType;
- }
-
- public boolean supports(String propertyName)
- {
- throw new UnsupportedOperationException();
- }
-
- public Object getProperty(String propertyName)
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockJSPTagRegistry.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockJSPTagRegistry.java
deleted file mode 100644
index 5e2509e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockJSPTagRegistry.java
+++ /dev/null
@@ -1,204 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.mock;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttribute;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.TagElement;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-
-public class MockJSPTagRegistry implements ITagRegistry
-{
-
- public boolean isDisposed()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void refresh(Runnable runAfter, boolean flushCaches)
- {
- throw new UnsupportedOperationException();
- }
-
- public void addListener(ITagRegistryListener listener)
- {
- //no-op
- }
-
- public void removeListener(ITagRegistryListener listener)
- {
- //no-op
- }
-
- public Collection<? extends Namespace> getAllTagLibraries()
- {
- List<Namespace> all = new ArrayList<Namespace>();
- MyNamespace ns_core = new MyNamespace(ITLDConstants.URI_JSF_CORE);
- ns_core.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_CORE, "view"));
- ns_core.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_CORE, "loadBundle"));
- all.add(ns_core);
-
- //jsf html
- MyNamespace ns = new MyNamespace(ITLDConstants.URI_JSF_HTML);
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "form"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "commandButton"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "commandLink"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "panelGrid"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "dataTable"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "graphicImage"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "inputHidden"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "message"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "messages"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "outputFormat"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "outputLabel"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "outputText"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "panelGroup"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "inputText"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "inputSecret"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectBooleanCheckbox"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectManyCheckbox"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectManyListbox"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectManyMenu"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectOneListbox"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectOneMenu"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectOneRadio"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "inputTextarea"));
- ns.addViewElement(new MyTagElement(ITLDConstants.URI_JSF_HTML, "selectBooleanCheckbox"));
- all.add(ns);
- return all;
- }
-
- public Namespace getTagLibrary(String uri)
- {
- for (final Namespace ns : getAllTagLibraries())
- {
- if (ns.getNSUri().equals(uri))
- {
- return ns;
- }
- }
- return null;
- }
-
- private static class MyNamespace extends Namespace
- {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private final String _uri;
- private final List<ITagElement> _viewElements = new ArrayList<ITagElement>();
-
- /**
- * @param uri
- */
- public MyNamespace(final String uri)
- {
- _uri = uri;
- }
-
- @Override
- public String getNSUri()
- {
- return _uri;
- }
-
- void addViewElement(final ITagElement tagElement)
- {
- _viewElements.add(tagElement);
- }
-
- @Override
- public Collection<ITagElement> getViewElements()
- {
- return _viewElements;
- }
-
- @Override
- public boolean hasViewElements()
- {
- return getViewElements().size() > 0;
- }
-
- @Override
- public boolean isInitialized()
- {
- return true;
- }
-
- @Override
- public ITagElement getViewElement(String name)
- {
- for (final ITagElement element : getViewElements()){
- if (element.getName().equals(name))
- {
- return element;
- }
- }
- return null;
- }
-
- @Override
- public String getDisplayName()
- {
- throw new UnsupportedOperationException();
- }
-
- }
-
- private static class MyTagElement extends TagElement
- {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private final String _name;
- private final String _uri;
-
- public MyTagElement(String uri, String name)
- {
- super();
- _name = name;
- _uri = uri;
- }
-
- public Map<String, ? extends ITagAttribute> getAttributes()
- {
- return Collections.emptyMap();
- }
-
- @Override
- public String getName()
- {
- return _name;
- }
-
- @Override
- public String getUri()
- {
- return _uri;
- }
-
- @Override
- public String getTagHandlerClassName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Map getAttributeHandlers()
- {
- return Collections.emptyMap();
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockTLDAttributeDeclaration.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockTLDAttributeDeclaration.java
deleted file mode 100644
index 502f881..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/mock/MockTLDAttributeDeclaration.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.mock;
-
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDataTypeImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-public class MockTLDAttributeDeclaration extends MockCMAttributeDeclaration
- implements TLDAttributeDeclaration
-{
-
- private final String _description;
- private final String _id;
- private final boolean _required;
-
- public MockTLDAttributeDeclaration(String nodeName, CMDataType cmType, String description, String id, boolean required)
- {
- super(nodeName, cmType);
- _description = description;
- _id = id;
- _required = required;
- }
-
- public MockTLDAttributeDeclaration(final String nodeName, String description, String id, boolean required)
- {
- this(nodeName, new CMDataTypeImpl("foo data type name"), description, id, required);
- }
- public String getDescription()
- {
- return _description;
- }
-
- public String getId()
- {
- return _id;
- }
-
- public CMDocument getOwnerDocument()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getRtexprvalue()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getType()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isFragment()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isRequired()
- {
- return _required;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/JSFFacetInstallDataModelProviderTestCases.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/JSFFacetInstallDataModelProviderTestCases.java
deleted file mode 100644
index eba1bbf..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/JSFFacetInstallDataModelProviderTestCases.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-import java.util.Set;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("deprecation")
-public class JSFFacetInstallDataModelProviderTestCases extends TestCase {
- private static final String PROJ_2_3_NAME = "_TEST_2_3_PROJECT";
- //private static final String PROJ_2_4_NAME = "_TEST_2_4_PROJECT";
-
- private JSFFacetInstallDataModelProvider dm;
-
- protected void setUp() throws Exception {
- //seed JSFLib registry if not present
- JSFCoreUtilHelper.createJSFLibraryRegistry();
- //create a project, if one doesn't exist in the current workspace
- IProject project = JSFCoreUtilHelper.createWebProject(PROJ_2_3_NAME);
- //create lib
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getDefaultImplementation();
-
- dm = new JSFFacetInstallDataModelProvider();
- IDataModel model = DataModelFactory.createDataModel(dm);
- model.setStringProperty(IJSFFacetInstallDataModelProperties.FACET_PROJECT_NAME, project.getName());
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.getPropertyNames()'
- */
- public void testGetPropertyNames() {
- Set<?> names = dm.getPropertyNames();
- Assert.assertNotNull(names);
-// Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.IMPLEMENTATION));
-// Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION));
- Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
- Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.SERVLET_NAME));
- Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS));
- Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.WEBCONTENT_DIR));
-
- Assert.assertTrue(names.contains(IJSFFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE));
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.getDefaultProperty(String)'
- */
- public void testGetDefaultPropertyString() {
-// Assert.assertNotNull(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION));
-// Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION) instanceof JSFLibraryInternalReference);
-// JSFLibraryInternalReference ref = (JSFLibraryInternalReference)dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION) ;
-// Assert.assertTrue(ref.getLibrary() == jsfLib);
-// Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION) == Boolean.TRUE);
- Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH) != null);
- Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME) != null);
- Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS) != null);
- Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.WEBCONTENT_DIR) != null);
-
-// Assert.assertTrue(dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE) != null);
- }
-
- /*
- * Test method for 'org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.validate(String)'
-
- public void testValidateString() {
- //positive tests
- IDataModel model = dm.getDataModel();
-
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, (String)dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
- model.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION, jsfLib);
- model.setStringProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME, (String)dm.getDefaultProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME));
-
- Assert.assertTrue(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
- Assert.assertTrue(dm.validate(IJSFFacetInstallDataModelProperties.IMPLEMENTATION).isOK());
- Assert.assertTrue(dm.validate(IJSFFacetInstallDataModelProperties.SERVLET_NAME).isOK());
-
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, "foo.xml");
- Assert.assertTrue(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
- //negative tests
- //config path
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, "");
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
-
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, "../../../foo.xml");
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
-
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, "WEB-INF/xxx.txt");
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
-
- String pathWithDevice = new Path(Platform.getLocation().getDevice(), "/temp/faces-config.xml").toOSString();
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, pathWithDevice );
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
-
- model.setStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH, "\\WEB-INF\\xxx.txt");
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
-
- //impl
- model.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION, null);
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.CONFIG_PATH).isOK());
-
- //servlet name
- //can't check null name because null set returns default value
- model.setStringProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME, " ");
- Assert.assertFalse(dm.validate(IJSFFacetInstallDataModelProperties.SERVLET_NAME).isOK());
-
- }
- */
-
-
- /*
- * Test method for:
- * org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.isValidConfigFileName()
- * org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.validateConfigLocation()
- */
- public void testConfigFileNameValidation ()
- {
- assertTrue(JSFFacetInstallDataModelProvider.isValidConfigFileName("faces-config.xml"));
- assertTrue(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml"));
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces config.xml")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config//faces-config.xml")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config///faces-config.xml")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml,/WEB-INF/config/faces-config2.xml")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml, /WEB-INF/config/faces-config2.xml")); // Invalid
-
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml, ")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml. ")); // Invalid
-
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml%")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml.&65")); // Invalid
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/faces-config.xml*")); // Invalid
-
- assertFalse(JSFFacetInstallDataModelProvider.isValidConfigFileName("/WEB-INF/config/face*s-config.xml*")); // Invalid
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils.java
deleted file mode 100644
index 5fb9c86..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils.java
+++ /dev/null
@@ -1,876 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.javaee.web.WebAppVersionType;
-import org.eclipse.jst.javaee.web.WebFactory;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtilFactory;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.mock.MockBundle;
-import org.eclipse.jst.jsf.test.util.mock.MockDataModel;
-import org.eclipse.jst.jsf.test.util.mock.MockDataModel.MockPropertyHolder;
-import org.eclipse.jst.jsf.test.util.mock.MockModelProvider;
-import org.eclipse.jst.jsf.test.util.mock.MockResource;
-
-//@Category(NoPluginEnvironment.class)
-public abstract class TestJSFUtils extends TestCase
-{
- private static final String PATTERN_SLASH_FACES_SLASH_ALL = "/faces/*";
- // private WebProjectTestEnvironment _webProjectTestEnv;
- protected TestableJSFUtils _jsfUtils;
- protected Object _modelObject;
- private WebAppAccessor _webAppAccessor;
-
-// @Before
- protected void setUp() throws Exception
- {
- // for these tests, it doesn't matter which version is created.
- _modelObject = new Object();
- _jsfUtils = new TestableJSFUtils(new JSFUtilFactory().create(
- getVersionToTestIn(), null),
- new MockModelProvider(_modelObject));
- assertEquals(getVersionToTestIn(), _jsfUtils.getVersion());
- _webAppAccessor = createWebAccessor();
- }
-
- protected void testRollbackWebApp(final String version)
- {
- // safe on an empty web app
- final Object webApp = _webAppAccessor.createWebApp(version);
- _jsfUtils.rollbackWebApp(webApp);
-
- // Add servlet
- final Object servlet = _webAppAccessor.createServlet("Foobar",
- JSFUtils.JSF_SERVLET_CLASS);
- _webAppAccessor.addServletToWebApp(webApp, servlet);
- _jsfUtils.rollbackWebApp(webApp);
- // servlet should be gone
- assertEquals(0, _webAppAccessor.getServlets(webApp).size());
- assertTrue(_webAppAccessor.getServlet(webApp, "Foobar") == null);
-
- // Add servlet and servlet mapping and context param
- _webAppAccessor.addServletToWebApp(webApp, servlet);
- Object mapping = _webAppAccessor.createServletMapping();
- _webAppAccessor.setMappingData(webApp, Collections
- .singletonList(".xhtml"), servlet, mapping);
- _webAppAccessor.addMappingToWebApp(webApp, mapping);
- Object contextParam = _webAppAccessor.createContextParam(JSFUtils.JSF_CONFIG_CONTEXT_PARAM, "/WEB-INF/faces-config.xml", version);
- _webAppAccessor.setContextParam(webApp, contextParam, version);
- assertEquals(1, _webAppAccessor.getServlets(webApp).size());
- assertTrue(_webAppAccessor.getServlet(webApp, "Foobar") == servlet);
- assertEquals(1, _webAppAccessor.getServletMappings_WebApp(webApp)
- .size());
- assertEquals(1, _webAppAccessor.getContextParams(webApp, version).size());
- _jsfUtils.rollbackWebApp(webApp);
- // servlet should be gone
- assertEquals(0, _webAppAccessor.getServlets(webApp).size());
- assertTrue(_webAppAccessor.getServlet(webApp, "Foobar") == null);
- // servlet mapping should be gone.
- assertEquals(0, _webAppAccessor.getServletMappings_WebApp(webApp)
- .size());
- // context param should be gone
- assertEquals(0, _webAppAccessor.getContextParams(webApp, version).size());
-
- // add two servlet and servlet mappings and verify it only removes
- // the JSF one
- // Add servlet and servlet mapping
- _webAppAccessor.addServletToWebApp(webApp, servlet);
- Object servlet2 = _webAppAccessor.createServlet("DonotRemove",
- "com.foo.SomeClass");
- _webAppAccessor.addServletToWebApp(webApp, servlet2);
- _webAppAccessor.addMappingToWebApp(webApp, mapping);
- Object mapping2 = _webAppAccessor.createServletMapping();
- _webAppAccessor.setMappingData(webApp, Collections
- .singletonList("blah"), servlet2, mapping2);
- _webAppAccessor.addMappingToWebApp(webApp, mapping2);
- assertEquals(2, _webAppAccessor.getServlets(webApp).size());
- assertTrue(_webAppAccessor.getServlet(webApp, "Foobar") == servlet);
- assertTrue(_webAppAccessor.getServlet(webApp, "DonotRemove") == servlet2);
- // servlet mapping should be gone.
- assertEquals(2, _webAppAccessor.getServletMappings_WebApp(webApp)
- .size());
- _jsfUtils.rollbackWebApp(webApp);
- // servlet should be gone, but servlet2 is still here
- assertEquals(1, _webAppAccessor.getServlets(webApp).size());
- assertSame(servlet2, _webAppAccessor.getServlet(webApp, "DonotRemove"));
- // servlet mapping1 should be gone, but mapping 2 still there.
- assertEquals(1, _webAppAccessor.getServletMappings_WebApp(webApp)
- .size());
- }
-
- protected void testUpdateWebApp_NewServlet(final String version)
- {
- Object webApp = _webAppAccessor.createWebApp(version);
-
- final Map<String, MockPropertyHolder> configProps = new HashMap<String, MockPropertyHolder>();
- configProps.put(
- IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- new MockPropertyHolder(new String[]
- { PATTERN_SLASH_FACES_SLASH_ALL }, null));
- configProps.put(IJSFFacetInstallDataModelProperties.CONFIG_PATH,
- new MockPropertyHolder("/WEB-INF/faces-config.xml", null));
- final MockDataModel config = new MockDataModel("testModel", configProps);
- _jsfUtils.updateWebApp(webApp, config);
- verifyServlet(webApp);
-
- // cover the cases where the CONFIG_PATH is not the default
- // case one: the config param is not already present
- webApp = _webAppAccessor.createWebApp(version);
- configProps.put(IJSFFacetInstallDataModelProperties.CONFIG_PATH,
- new MockPropertyHolder("/WEB-INF/app-config.xml", null));
- _jsfUtils.updateWebApp(webApp, config);
- verifyServlet(webApp);
- assertEquals(1, _webAppAccessor.getContextParams(webApp, version).size());
- assertEquals("/WEB-INF/app-config.xml", _webAppAccessor.getContextParamValue(_webAppAccessor.getContextParams(webApp, version).get(0),version));
-
- // case two: the config param is already present
- webApp = _webAppAccessor.createWebApp(version);
- configProps.put(IJSFFacetInstallDataModelProperties.CONFIG_PATH,
- new MockPropertyHolder("/WEB-INF/app-config.xml", null));
- Object param = _webAppAccessor.createContextParam(JSFUtils.JSF_CONFIG_CONTEXT_PARAM, "SomeOtherValue", version);
- _webAppAccessor.setContextParam(webApp, param, version);
- _jsfUtils.updateWebApp(webApp, config);
- verifyServlet(webApp);
- assertEquals(1, _webAppAccessor.getContextParams(webApp, version).size());
-
- }
-
- @SuppressWarnings("rawtypes")
- protected void verifyServlet(final Object webApp)
- {
- final Object defaultServlet = _webAppAccessor.getServlet(webApp,
- JSFUtils.JSF_DEFAULT_SERVLET_NAME);
- assertNotNull(defaultServlet);
- _webAppAccessor.verifyServlet(defaultServlet,
- JSFUtils.JSF_SERVLET_CLASS);
- _webAppAccessor.verifyLoadOnStartup(defaultServlet, Integer.valueOf(1));
- List mappings = _webAppAccessor.getServletMappings_Servlet(webApp,
- defaultServlet);
- assertEquals(1, mappings.size());
- Object mapping = mappings.get(0);
- assertNotNull(mapping);
- _webAppAccessor.verifyMapping(mapping,
- JSFUtils.JSF_DEFAULT_SERVLET_NAME,
- PATTERN_SLASH_FACES_SLASH_ALL);
- }
-
- protected void testUpdateWebApp_ExistingServlet(final String version)
- {
- final Object webApp = _webAppAccessor.createWebApp(version);
- final Object servlet = _webAppAccessor.createServlet("Foobar",
- JSFUtils.JSF_SERVLET_CLASS);
- _webAppAccessor.addServletToWebApp(webApp, servlet);
- final Map<String, MockPropertyHolder> configProps = new HashMap<String, MockPropertyHolder>();
- final MockDataModel config = new MockDataModel("testModel", configProps);
-
- _jsfUtils.updateWebApp(webApp, config);
- Object defaultServlet = _webAppAccessor.getServlet(webApp,
- JSFUtils.JSF_DEFAULT_SERVLET_NAME);
- assertNotNull(defaultServlet);
- _webAppAccessor.verifyServlet(defaultServlet,
- JSFUtils.JSF_SERVLET_CLASS);
- _webAppAccessor.verifyLoadOnStartup(defaultServlet, Integer.valueOf(1));
-
- // do again, but this time have an existing servlet mapping that matches
- // Foobar
- final Object mapping = _webAppAccessor.createServletMapping();
- _webAppAccessor.setMappingData(webApp, Collections
- .singletonList("/faces"), servlet, mapping);
- _webAppAccessor.addMappingToWebApp(webApp, mapping);
- configProps.put(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- new MockPropertyHolder(new String[]{"/faces"}, null));
- _jsfUtils.updateWebApp(webApp, config);
- defaultServlet = _webAppAccessor.getServlet(webApp,
- JSFUtils.JSF_DEFAULT_SERVLET_NAME);
- _webAppAccessor.verifyServlet(defaultServlet,
- JSFUtils.JSF_SERVLET_CLASS);
- _webAppAccessor.verifyMapping(mapping,
- JSFUtils.JSF_DEFAULT_SERVLET_NAME, "/faces");
- _webAppAccessor.verifyLoadOnStartup(defaultServlet, Integer.valueOf(1));
-
- }
-
- protected void testGetFileUrlPath_NonNullCases(final String version)
- {
- // a web app with valid servlet and extension mapping
- final Object webApp = _webAppAccessor.createWebApp(version);
- final Object servlet = _webAppAccessor.createServlet("JSF Servlet",
- JSFUtils.JSF_SERVLET_CLASS);
- _webAppAccessor.addServletToWebApp(webApp, servlet);
- final Object mapping = _webAppAccessor.createServletMapping();
- _webAppAccessor.setMappingData(webApp, Collections
- .singletonList(".faces"), servlet, mapping);
- _webAppAccessor.addMappingToWebApp(webApp, mapping);
-
- IPath fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- IResource.FILE, new Path("/WebContent/test.jsp")), new Path(
- "/test.jsp"));
- assertEquals("/test.faces", fileUrlPath.toString());
-
- // web app with valid servlet and non-default extension mapping
- fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- IResource.FILE, new Path("/WebContent/test.xhtml")), new Path(
- "/test.xhtml"));
- assertEquals("/test.faces", fileUrlPath.toString());
-
- // web app with valid servlet and path-based mapping
- _webAppAccessor.setUrlPattern(mapping, Collections
- .singletonList("/faces"));
- fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- IResource.FILE, new Path("/WebContent/test.jsp")), new Path(
- "/test.jsp"));
- assertEquals("/faces/test.jsp", fileUrlPath.toString());
-
- // web app with valid servlet and path-based mapping match *
- _webAppAccessor.setUrlPattern(mapping, Collections
- .singletonList(PATTERN_SLASH_FACES_SLASH_ALL));
- fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- IResource.FILE, new Path("/WebContent/test.jsp")), new Path(
- "/test.jsp"));
- assertEquals("/faces/test.jsp", fileUrlPath.toString());
-
- // web app with valid servlet and extension mapping based on a
- // non-default, default extension
- _webAppAccessor.setUrlPattern(mapping, Collections
- .singletonList(".jspx"));
- final Object param = _webAppAccessor.createContextParam(
- JSFUtils.JSF_DEFAULT_SUFFIX_CONTEXT_PARAM, ".xhtml", version);
- _webAppAccessor.setContextParam(webApp, param,version);
- fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- IResource.FILE, new Path("/WebContent/test.xhtml")), new Path(
- "/test.xhtml"));
- assertEquals("/test.jspx", fileUrlPath.toString());
- }
-
- protected void testGetFileUrlPath_NullCases(final String version)
- {
- // a null webApp object produces a null path
- final Path existingURL = new Path("foobar");
- verifyNull(existingURL, null);
-
- // a non-null value that is not instanceof WebApp returns a null path
- verifyNull(existingURL, new Object());
- // a web app with no servlet produces a null path
-
- final Object webApp = _webAppAccessor.createWebApp("2.4");
- verifyNull(existingURL, webApp);
-
- // a web app with no meaningful servlet returns null
- Object servlet = _webAppAccessor.createServlet(null, null);
- _webAppAccessor.addServletToWebApp(webApp, servlet);
- verifyNull(existingURL, webApp);
-
- doPre25SpecificOrNoop(existingURL, webApp, servlet);
-
- // wrong servlet class name
- _webAppAccessor.setServletClass(servlet, "com.wrong.Servlet");
- verifyNull(existingURL, webApp);
-
- // multiple wrong class names
- servlet = _webAppAccessor.createServlet("JSF Servlet",
- "com.AnotherWrong.Servlet");
- _webAppAccessor.addServletToWebApp(webApp, servlet);
-
- assertEquals(2, _webAppAccessor.getServlets(webApp).size());
- verifyNull(existingURL, webApp);
-
- // valid servlet class, but no mappings
- _webAppAccessor.setServletClass(servlet, JSFUtils.JSF_SERVLET_CLASS);
- verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- new Path("/somepath")));
- verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- new Path("/somepath.xhtml")));
-
- final Object mapping = _webAppAccessor.createServletMapping();
- _webAppAccessor.addMappingToWebApp(webApp, mapping);
- assertEquals(1, _webAppAccessor.getServletMappings_WebApp(webApp)
- .size());
- assertEquals(0, _webAppAccessor.getServletMappings_Servlet(webApp,
- servlet).size());
- verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- new Path("/somepath.xhtml")));
-
- // empty mapping that matches to servlet
- _webAppAccessor.setServletOnMapping(mapping, servlet);
- assertEquals(1, _webAppAccessor.getServletMappings_WebApp(webApp)
- .size());
- // mapping should be matched
- assertEquals(1, _webAppAccessor.getServletMappings_Servlet(webApp,
- servlet).size());
- assertTrue(_webAppAccessor.getServletMappings_Servlet(webApp, servlet)
- .contains(mapping));
- verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- new Path("/somepath.xhtml")));
- }
-
- protected void doPre25SpecificOrNoop(final Path existingURL,
- final Object webApp, final Object servlet)
- {
- // this is a noop unless explicitly overridden
- }
-
-// @Test
- public void testFacesConfigCreation() throws IOException
- {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- _jsfUtils.printConfigFile_testable(os);
- assertEquals(getExpectedDefaultConfigFile().toString("ISO-8859-1")
- .replaceAll("\\r", ""), os.toString("ISO-8859-1"));
- }
-
- protected TestFileResource getExpectedDefaultConfigFile()
- throws IOException
- {
- String replaceAll = getVersionToTestIn().toString().replaceAll("\\.",
- "_");
- final String defaultFileName = String.format(
- "/testfiles/facet/expected-faces-config-%s.xml", replaceAll);
- TestFileResource testFileResource = new TestFileResource();
- testFileResource.load(new MockBundle(new File(".").getCanonicalPath()),
- defaultFileName);
- return testFileResource;
- }
-
-// @Test
- public void testIsJavaEE()
- {
- final org.eclipse.jst.javaee.web.WebApp javaEEWebApp = WebFactory.eINSTANCE
- .createWebApp();
- assertEquals(WebAppVersionType._25_LITERAL, javaEEWebApp.getVersion());
- assertTrue(_jsfUtils.isJavaEE(javaEEWebApp));
- javaEEWebApp.setVersion(WebAppVersionType._30_LITERAL);
- assertTrue(_jsfUtils.isJavaEE(javaEEWebApp));
-
- final org.eclipse.jst.j2ee.webapplication.WebApp J2EEWebApp = org.eclipse.jst.j2ee.webapplication.WebapplicationFactory.eINSTANCE
- .createWebApp();
- assertFalse(_jsfUtils.isJavaEE(J2EEWebApp));
- }
-
-// @Test
- public void testGetModelProvider()
- {
- final IModelProvider modelProvider = _jsfUtils.getModelProvider();
- assertNotNull(modelProvider);
- assertEquals(_modelObject, modelProvider.getModelObject());
-
- _jsfUtils = new TestableJSFUtils(new JSFUtilFactory().create(
- JSFVersion.V2_0, null), new MockModelProvider(null));
- // returns null when the model provider has a null model object.
- assertNull(_jsfUtils.getModelProvider());
- }
-
-// @Test
- public void testGetDisplayName()
- {
- final Map<String, MockPropertyHolder> propsMap = new HashMap<String, MockPropertyHolder>();
- final MockDataModel model = new MockDataModel("TestID", propsMap);
- // when the property is not present, use the default.
- assertEquals(JSFUtils.JSF_DEFAULT_SERVLET_NAME, _jsfUtils
- .getDisplayName_testable(model));
-
- // if property is present but empty or only whitespace, we also use
- // the default.
- model.setProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME, "");
- assertEquals(JSFUtils.JSF_DEFAULT_SERVLET_NAME, _jsfUtils
- .getDisplayName_testable(model));
- model.setProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME, "");
- assertEquals(JSFUtils.JSF_DEFAULT_SERVLET_NAME, _jsfUtils
- .getDisplayName_testable(model));
-
- // otherwise, we should get back the value
- model.setProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME,
- "foobar");
- assertEquals("foobar", _jsfUtils.getDisplayName_testable(model));
- }
-
-// @Test
- public void testGetServletClassName()
- {
- final Map<String, MockPropertyHolder> propsMap = new HashMap<String, MockPropertyHolder>();
- final MockDataModel model = new MockDataModel("TestID", propsMap);
- // when the property is not present, use the default.
- assertEquals(JSFUtils.JSF_SERVLET_CLASS, _jsfUtils
- .getServletClassname_testable(model));
-
- // if property is present but empty or only whitespace, we also use
- // the default.
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_CLASSNAME, "");
- assertEquals(JSFUtils.JSF_SERVLET_CLASS, _jsfUtils
- .getServletClassname_testable(model));
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_CLASSNAME, "");
- assertEquals(JSFUtils.JSF_SERVLET_CLASS, _jsfUtils
- .getServletClassname_testable(model));
-
- // otherwise, we should get back the value
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_CLASSNAME, "foobar");
- assertEquals("foobar", _jsfUtils.getServletClassname_testable(model));
- }
-
-// @Test
- public void testGetServletMappings()
- {
- final Map<String, MockPropertyHolder> propsMap = new HashMap<String, MockPropertyHolder>();
- final MockDataModel model = new MockDataModel("TestID", propsMap);
-
- // empty array should beget empty list
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- new String[]
- {});
- assertTrue(_jsfUtils.getServletMappings_testable(model).isEmpty());
-
- // non-empty list should beget the same list back
- final String[] values1 = new String[]
- { "foo" };
- final String[] valuesMany = new String[]
- { "foo", "bar", "foobar" };
-
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- values1);
- assertEquals(Arrays.asList(values1), _jsfUtils
- .getServletMappings_testable(model));
-
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- valuesMany);
- assertEquals(Arrays.asList(valuesMany), _jsfUtils
- .getServletMappings_testable(model));
- }
-
-// @Test
- public void testIsJSFPage()
- {
- assertTrue(_jsfUtils.isJSFPage_testable(null));
- }
-
-// @Test
- public void testIsValidKnownExtension()
- {
- assertTrue(_jsfUtils.isValidKnownExtension_testable("jsp"));
- assertTrue(_jsfUtils.isValidKnownExtension_testable("jspx")); //$NON-NLS-1$
- assertTrue(_jsfUtils.isValidKnownExtension_testable("jsf")); //$NON-NLS-1$
- assertTrue(_jsfUtils.isValidKnownExtension_testable("xhtml")); //$NON-NLS-1$
-
- assertFalse(_jsfUtils.isValidKnownExtension_testable("html")); //$NON-NLS-1$)
- assertFalse(_jsfUtils.isValidKnownExtension_testable("dtd")); //$NON-NLS-1$)
- assertFalse(_jsfUtils.isValidKnownExtension_testable("jspf")); //$NON-NLS-1$)
- assertFalse(_jsfUtils.isValidKnownExtension_testable("php")); //$NON-NLS-1$)
-
- assertFalse(_jsfUtils.isValidKnownExtension_testable("")); //$NON-NLS-1$)
- assertFalse(_jsfUtils.isValidKnownExtension_testable(null)); // )
- }
-
- protected final void verifyNull(final Path existingURL,
- final Object webApp, final IResource res)
- {
- assertNull(_jsfUtils.getFileUrlPath(webApp, res, null));
- assertNull(_jsfUtils.getFileUrlPath(webApp, res, existingURL));
- }
-
- protected final void verifyNull(final Path existingURL, final Object webApp)
- {
- verifyNull(existingURL, webApp, null);
- }
-
- protected abstract JSFVersion getVersionToTestIn();
-
- protected abstract WebAppAccessor createWebAccessor();
-
- /**
- * Concrete implementations are used to abstract test cases away from
- * whether they are using the J2EE or JavaEE version of the WebApp objects.
- *
- * @author cbateman
- *
- */
- @SuppressWarnings("rawtypes")
- public static abstract class WebAppAccessor
- {
- protected abstract Object createWebApp(final String version);
-
- protected abstract String getContextParamValue(Object param, String version);
-
- protected abstract List getContextParams(Object webApp, String version);
-
- protected abstract void verifyMapping(Object mapping,
- String servletName, String servletClass);
-
- protected abstract Object createServlet(final String servletName,
- final String servletClass);
-
- protected abstract Object createServletMapping();
-
- protected abstract void setServletClass(Object servlet, String name);
-
- protected abstract List getServlets(final Object webApp);
-
- protected abstract void addMappingToWebApp(final Object webApp,
- final Object mapping);
-
- protected abstract void addServletToWebApp(final Object webApp,
- final Object servlet);
-
- protected abstract List getServletMappings_WebApp(final Object webApp);
-
- protected abstract List getServletMappings_Servlet(final Object webApp,
- final Object servlet);
-
- protected abstract void setMappingData(final Object webApp,
- final List<String> urlPatterns, final Object servlet,
- final Object mapping);
-
- /**
- * Clears any existing patterns and replaces them with patterns
- *
- * @param mapping
- * @param patterns
- */
- protected abstract void setUrlPattern(final Object mapping,
- final List<String> patterns);
-
- protected abstract Object createContextParam(final String name,
- final String value, final String version);
-
- protected abstract void setContextParam(final Object webApp,
- final Object param, final String version);
-
- protected abstract Object getServlet(final Object webApp,
- final String servletName);
-
- protected abstract void verifyServlet(final Object defaultServlet,
- final String className);
-
- protected abstract void verifyLoadOnStartup(
- final Object defaultServlet, final Integer expectedValue);
-
- protected abstract void setServletOnMapping(Object mapping,
- Object servlet);
- }
-
- // @Override
- // protected void tearDown() throws Exception {
- // super.tearDown();
- // _webProjectTestEnv.getTestProject().close(null);
- // }
-
- // public void testSearchServletMappings_NoPrefixMappings() {
- // final List<String> mappings = new ArrayList<String>();
- // // prefix mappings must end in "*"
- // mappings.add("/notaprefixmapping/");
- // mappings.add("*.faces");
- // mappings.add("*.html");
- // mappings.add("*.jsp");
- //
- // // if no preference, then the first one should be found
- // MappingSearchResult result = searchServletMappings(mappings,
- // null, null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertTrue(result.getExtensionMapping().equals("*.faces"));
- // assertNull(result.getPrefixMapping());
- //
- // // selecting the first one as the preferred should yield the same result
- // result = searchServletMappings(mappings, "*.faces", null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getExtensionMapping(), "*.faces");
- // assertNull(result.getPrefixMapping());
- //
- // result = searchServletMappings(mappings, "*.html", null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getExtensionMapping(), "*.html");
- // assertNull(result.getPrefixMapping());
- //
- // result = searchServletMappings(mappings, "*.jsp", null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getExtensionMapping(), "*.jsp");
- // assertNull(result.getPrefixMapping());
- //
- // // an extension that doesn't exist
- // result = searchServletMappings(mappings, "*.xhtml", null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // // if preferred not present, then should be the first one
- // assertEquals(result.getExtensionMapping(), "*.faces");
- // assertNull(result.getPrefixMapping());
- // }
- //
- // public void testSearchServletMappings_NoExtensionMappings() {
- // final List<String> mappings = new ArrayList<String>();
- // // prefix mappings must end in "*"
- // mappings.add("/notaprefixMapping/");
- // mappings.add("/faces/*");
- // mappings.add("/foo/*");
- // mappings.add("/bar/*");
- //
- // // if no preference, then the first one should be found
- // MappingSearchResult result = searchServletMappings(mappings,
- // null, null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertNull(result.getExtensionMapping());
- //
- // result = searchServletMappings(mappings, null, "/faces/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertNull(result.getExtensionMapping());
- //
- // result = searchServletMappings(mappings, null, "/foo/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/foo/*");
- // assertNull(result.getExtensionMapping());
- //
- // result = searchServletMappings(mappings, null, "/bar/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/bar/*");
- // assertNull(result.getExtensionMapping());
- //
- // // if a preference is given that is not present, then first one
- // // one should be picked
- // result = searchServletMappings(mappings, null, "/notfound/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertNull(result.getExtensionMapping());
- // }
- //
- // public void testSearchServletMappings_BothKindsOfMappings() {
- // final List<String> mappings = new ArrayList<String>();
- // // prefix mappings must end in "*"
- // mappings.add("/notaprefixmapping/");
- // mappings.add("*.faces");
- // mappings.add("/faces/*");
- // mappings.add("*.html");
- // mappings.add("/foo/*");
- // mappings.add("*.jsp");
- // mappings.add("/bar/*");
- //
- // // if no preference, then the first one should be found
- // MappingSearchResult result = searchServletMappings(mappings,
- // null, null);
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertEquals(result.getExtensionMapping(), "*.faces");
- //
- // result = searchServletMappings(mappings, "*.faces", "/faces/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertEquals(result.getExtensionMapping(), "*.faces");
- //
- // result = searchServletMappings(mappings, "*.html", "/foo/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/foo/*");
- // assertEquals(result.getExtensionMapping(), "*.html");
- //
- // result = searchServletMappings(mappings, "*.jsp", "/bar/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/bar/*");
- // assertEquals(result.getExtensionMapping(), "*.jsp");
- //
- // // one pref found, the other not: the first in is picked
- // result = searchServletMappings(mappings, "*.jsp", "/bar2/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertEquals(result.getExtensionMapping(), "*.jsp");
- //
- // // one pref found, the other not: the first in is picked
- // result = searchServletMappings(mappings, "*.jspx", "/bar/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/bar/*");
- // assertEquals(result.getExtensionMapping(), "*.faces");
- //
- // // neither found, so first of each
- // result = searchServletMappings(mappings, "*.jspx", "/bar2/*");
- // assertNotNull(result);
- // assertTrue(result.isResult());
- // assertEquals(result.getPrefixMapping(), "/faces/*");
- // assertEquals(result.getExtensionMapping(), "*.faces");
- // }
- //
- // public void testSearchServletMappings_NoMatches() {
- // final List<String> mappings = new ArrayList<String>();
- // // none of these are either prefix or extension mappings
- // mappings.add("/notaprefixmapping/");
- // mappings.add("/alsoNotAMatch/");
- // mappings.add("/");
- // mappings.add("file.jsp");
- // mappings.add("test.html");
- // mappings.add("foo.jspx");
- //
- // // should not find any matches
- // MappingSearchResult result = searchServletMappings(mappings,
- // null, null);
- // assertNotNull(result);
- // assertFalse(result.isResult());
- // assertNull(result.getPrefixMapping());
- // assertNull(result.getExtensionMapping());
- //
- // result = searchServletMappings(mappings, "*.faces", null);
- // assertNotNull(result);
- // assertFalse(result.isResult());
- // assertNull(result.getPrefixMapping());
- // assertNull(result.getExtensionMapping());
- //
- // result = searchServletMappings(mappings, null, "/faces/*");
- // assertNotNull(result);
- // assertFalse(result.isResult());
- // assertNull(result.getPrefixMapping());
- // assertNull(result.getExtensionMapping());
- //
- // result = searchServletMappings(mappings, "*.faces", "/faces/*");
- // assertNotNull(result);
- // assertFalse(result.isResult());
- // assertNull(result.getPrefixMapping());
- // assertNull(result.getExtensionMapping());
- // }
- //
- // /**
- // * Search the list of servlet-mappings for the first extension and prefix
- // mappings. The contents
- // * of mappings is assumed to be all url-pattern's.
- // *
- // * If prefExtMapping is not null, it is an extension mapping and
- // * it is in mappings, then it is returned. Otherwise, the first extension
- // * mapping in mappings is returned. Returns null if mappings does not
- // * contain an extension mapping. The same algorithm holds for
- // prefPrefixMapping and
- // * corresponding prefix mapping.
- // *
- // * See isExtensionMapping and isPrefixMapping for more information on url
- // patterns.
- // *
- // * @param mappings
- // * @param prefExtMapping
- // * @param prefPrefixMapping
- // * @return the result
- // */
- // public final MappingSearchResult searchServletMappings(
- // final List<String> mappings, String prefExtMapping,
- // String prefPrefixMapping) {
- // String firstExtFound = null;
- // String firstPrefixFound = null;
- // boolean foundExtMapping = false;
- // boolean foundPrefixMapping = false;
- //
- // // if the caller has no preferredMapping, then
- // // set it to something guaranteed to be non-null
- // // and which is guaranteed not to match anything
- // // that pass isExtensionMapping
- // if (prefExtMapping == null) {
- // prefExtMapping = "NOTANEXTENSIONMAPPING"; //$NON-NLS-1$
- // }
- //
- // // similarly, guarantee that if the caller has no
- // // preferred prefix mapping, that we set a non-null
- // // comp mapping
- // if (prefPrefixMapping == null) {
- // prefPrefixMapping = "NOTAPREFIXMAPPING"; //$NON-NLS-1$
- // }
- //
- // SEARCH_LOOP: for (String mapping : mappings) {
- // if (isExtensionMapping(mapping)) {
- // // can assum that mapping is non-null since
- // // it is an ext mapping
- // if (prefExtMapping.equals(mapping.trim())) {
- // firstExtFound = prefExtMapping;
- // continue;
- // }
- //
- // if (firstExtFound == null) {
- // firstExtFound = mapping.trim();
- // }
- // } else if (isPrefixMapping(mapping)) {
- // if (prefPrefixMapping.equals(mapping.trim())) {
- // firstPrefixFound = prefPrefixMapping;
- // continue;
- // }
- //
- // if (firstPrefixFound == null) {
- // firstPrefixFound = mapping.trim();
- // }
- // }
- //
- // if (foundExtMapping && foundPrefixMapping) {
- // break SEARCH_LOOP;
- // }
- // }
- //
- // return new MappingSearchResult(firstExtFound, firstPrefixFound);
- // }
- //
- // /**
- // * Servlet 2.3_SRV.11.2: a string that begins with a "/" and ends
- // * with "/*" is a prefix mapping
- // *
- // * @param mapping
- // * @return true if the mapping string represents a prefix mapping
- // */
- // public final boolean isPrefixMapping(final String mapping)
- // {
- // if (mapping == null || mapping.length() < 4)
- // {
- // return false;
- // }
- //
- // return mapping.charAt(0) == '/' && mapping.endsWith("/*"); //$NON-NLS-1$
- // }
- //
- // /**
- // * Servlet 2.3_SRV.11.2: a string that begins with "*."
- // * is an extension mapping
- // *
- // * @param mapping
- // * @return true if mapping is an extension mapping
- // */
- // public final boolean isExtensionMapping(final String mapping)
- // {
- // if (mapping == null)
- // {
- // return false;
- // }
- //
- // return mapping.startsWith("*."); //$NON-NLS-1$
- // }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils11.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils11.java
deleted file mode 100644
index 35d2363..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils11.java
+++ /dev/null
@@ -1,315 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.j2ee.common.CommonFactory;
-import org.eclipse.jst.j2ee.common.ParamValue;
-import org.eclipse.jst.j2ee.webapplication.ContextParam;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletMapping;
-import org.eclipse.jst.j2ee.webapplication.ServletType;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.WebType;
-import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory;
-import org.eclipse.jst.jsf.core.JSFVersion;
-
-//@Category(NoPluginEnvironment.class)
-public class TestJSFUtils11 extends TestJSFUtils
-{
- @Override
-// @Before
- public void setUp() throws Exception
- {
- super.setUp();
- }
-
- @Override
- protected WebAppAccessor createWebAccessor()
- {
- WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;
- return new WebAppTestAccessor(factory);
- }
-
- //@Test
- public void testUpdateWebApp_ExistingServlet_2_3()
- {
- testUpdateWebApp_ExistingServlet("2.3");
- }
-
- //@Test
- public void testUpdateWebApp_ExistingServlet_2_4()
- {
- testUpdateWebApp_ExistingServlet("2.4");
- }
-
- //@Test
- public void testUpdateWebApp_NewServlet_2_3()
- {
- testUpdateWebApp_NewServlet("2.3");
- }
-
- //@Test
- public void testUpdateWebApp_NewServlet_2_4()
- {
- testUpdateWebApp_NewServlet("2.4");
- }
-
- //@Test
- public void testRollbackWebApp_2_3()
- {
- super.testRollbackWebApp("2.3");
- }
-
- //@Test
- public void testRollbackWebApp_2_4()
- {
- super.testRollbackWebApp("2.4");
- }
-
- //@Test
- public void testGetFileUrlPath_NonNullCases_2_3()
- {
- super.testGetFileUrlPath_NonNullCases("2.3");
- }
-
- //@Test
- public void testGetFileUrlPath_NonNullCases_2_4()
- {
- super.testGetFileUrlPath_NonNullCases("2.4");
- }
-
- //@Test
- public void testGetFileUrlPath_NullCases_2_3()
- {
- super.testGetFileUrlPath_NullCases("2.3");
- }
-
- //@Test
- public void testGetFileUrlPath_NullCases_2_4()
- {
- super.testGetFileUrlPath_NullCases("2.4");
- }
-
- @Override
- protected void doPre25SpecificOrNoop(Path existingURL, Object webApp,
- Object servlet)
- {
- WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;
- // the servlet has a jsp type returns null
- ((Servlet) servlet).setWebType(factory.createJSPType());
- verifyNull(existingURL, webApp);
-
- // the servlet has a servlet type but null class returns null
- ((Servlet) servlet).setWebType(factory.createServletType());
- verifyNull(existingURL, webApp);
- }
-
- @Override
- protected JSFVersion getVersionToTestIn()
- {
- return JSFVersion.V1_1;
- }
-
- private static class WebAppTestAccessor extends WebAppAccessor
- {
- private WebapplicationFactory _factory;
-
- public WebAppTestAccessor(WebapplicationFactory factory)
- {
- _factory = factory;
- }
-
- @Override
- @SuppressWarnings("rawtypes")
- protected List getServletMappings_Servlet(final Object webApp,
- Object servlet)
- {
- return ((Servlet) servlet).getMappings();
- }
-
- @Override
- @SuppressWarnings("rawtypes")
- protected EList getServletMappings_WebApp(final Object webApp)
- {
- return ((WebApp) webApp).getServletMappings();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected void addMappingToWebApp(final Object webApp,
- final Object mapping)
- {
- getServletMappings_WebApp(webApp).add((ServletMapping) mapping);
- }
-
- @Override
- @SuppressWarnings("rawtypes")
- protected EList getServlets(final Object webApp)
- {
- return ((WebApp) webApp).getServlets();
- }
-
- @Override
- protected void setServletClass(Object servlet, String name)
- {
- ((ServletType) ((Servlet) servlet).getWebType()).setClassName(name);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected void setContextParam(final Object webApp, final Object param, final String version)
- {
- if ("2.3".equals(version))
- {
- ((WebApp) webApp).getContexts().add(param);
- }
- else
- {
- ((WebApp) webApp).getContextParams().add(param);
- }
- }
-
- @Override
- protected Object createContextParam(final String name,
- final String value, final String version)
- {
- if ("2.3".equals(version))
- {
- final ContextParam param = _factory.createContextParam();
- param.setParamName(name);
- param.setParamValue(value);
- return param;
- }
- final ParamValue param = CommonFactory.eINSTANCE.createParamValue();
- param.setName(name);
- param.setValue(value);
- return param;
- }
-
- @Override
- protected void setUrlPattern(final Object mapping,
- final List<String> patterns)
- {
- assertEquals(
- "Webapp 2.4 and before support only one pattern per mapping",
- 1, patterns.size());
- ((ServletMapping) mapping).setUrlPattern(patterns.get(0));
- }
-
- @Override
- protected void setMappingData(final Object webApp,
- final List<String> urlPatterns, final Object servlet,
- final Object mapping)
- {
- ((ServletMapping) mapping).setServlet((Servlet) servlet);
- for (final String pattern : urlPatterns)
- {
- ((ServletMapping) mapping).setUrlPattern(pattern);
- }
- ((ServletMapping) mapping).setWebApp((WebApp) webApp);
- }
-
- @Override
- protected ServletMapping createServletMapping()
- {
- return _factory.createServletMapping();
- }
-
- @Override
- protected void verifyLoadOnStartup(final Object defaultServlet,
- final Integer expectedValue)
- {
- assertEquals(expectedValue, ((Servlet) defaultServlet)
- .getLoadOnStartup());
- }
-
- @Override
- protected void verifyServlet(final Object defaultServlet,
- final String className)
- {
- final WebType webType = ((Servlet) defaultServlet).getWebType();
- assertTrue(webType.isServletType());
- final ServletType servletType = (ServletType) ((Servlet) defaultServlet)
- .getWebType();
- assertEquals(className, servletType.getClassName());
- }
-
- @Override
- protected WebApp createWebApp(final String version)
- {
- final WebApp webApp = _factory.createWebApp();
- webApp.setVersion(version);
- return webApp;
- }
-
- @Override
- protected Servlet getServlet(final Object webApp,
- final String servletName)
- {
- final Servlet defaultServlet = ((WebApp) webApp)
- .getServletNamed(servletName);
- if (defaultServlet != null)
- {
- assertEquals(servletName, defaultServlet.getServletName());
- }
- return defaultServlet;
- }
-
- @Override
- protected Servlet createServlet(final String servletName,
- final String servletClass)
- {
- final Servlet servlet = _factory.createServlet();
- servlet.setServletName(servletName);
- servlet.setWebType(_factory.createServletType());
- ((ServletType) servlet.getWebType()).setClassName(servletClass);
- return servlet;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void addServletToWebApp(Object webApp, Object servlet)
- {
- getServlets(webApp).add(servlet);
- }
-
- @Override
- protected void setServletOnMapping(Object mapping, Object servlet)
- {
- ((ServletMapping) mapping).setServlet((Servlet) servlet);
- }
-
- @Override
- protected void verifyMapping(Object mapping,
- String jsfDefaultServletName, String pattern)
- {
- assertEquals(jsfDefaultServletName, ((ServletMapping) mapping)
- .getServlet().getServletName());
- assertEquals(pattern, ((ServletMapping) mapping).getUrlPattern());
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- protected List getContextParams(Object webApp, String version)
- {
- if ("2.3".equals(version))
- {
- return ((WebApp)webApp).getContexts();
- }
- return ((WebApp)webApp).getContextParams();
- }
-
- @Override
- protected String getContextParamValue(Object param, String version)
- {
- if ("2.3".equals(version))
- {
- return ((ContextParam)param).getParamValue();
- }
- return ((ParamValue)param).getValue();
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils12.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils12.java
deleted file mode 100644
index 4c55f7b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils12.java
+++ /dev/null
@@ -1,435 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.javaee.core.JavaeeFactory;
-import org.eclipse.jst.javaee.core.ParamValue;
-import org.eclipse.jst.javaee.core.UrlPatternType;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.ServletMapping;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.javaee.web.WebAppVersionType;
-import org.eclipse.jst.javaee.web.WebFactory;
-import org.eclipse.jst.jsf.core.JSFVersion;
-
-//@Category(NoPluginEnvironment.class)
-public class TestJSFUtils12 extends TestJSFUtils
-{
-// @Before
- public void setUp() throws Exception
- {
- super.setUp();
- // _factory = WebFactory.eINSTANCE;
- }
-
- @Override
- protected JSFVersion getVersionToTestIn()
- {
- return JSFVersion.V1_2;
- }
-
- @Override
- protected WebAppAccessor createWebAccessor()
- {
- return new WebAppTestAccessor();
- }
-
- //@Test
- public void testUpdateWebApp_ExistingServlet_2_5()
- {
- testUpdateWebApp_ExistingServlet("2.5");
- }
-
- //@Test
- public void testUpdateWebApp_NewServlet_2_5()
- {
- testUpdateWebApp_NewServlet("2.5");
- }
-
- //@Test
- public void testRollbackWebApp_2_5()
- {
- super.testRollbackWebApp("2.5");
- }
-
- //@Test
- public void testGetFileUrlPath_NonNullCases_2_5()
- {
- super.testGetFileUrlPath_NonNullCases("2.5");
- }
-
- //@Test
- public void testGetFileUrlPath_NullCases_2_5()
- {
- super.testGetFileUrlPath_NullCases("2.5");
- }
-
- protected static class WebAppTestAccessor extends WebAppAccessor
- {
- private WebFactory _factory;
-
- public WebAppTestAccessor()
- {
- _factory = WebFactory.eINSTANCE;
- }
- @Override
- protected WebApp createWebApp(String version)
- {
- WebApp webApp = _factory.createWebApp();
- webApp.setVersion(WebAppVersionType.get(version));
- return webApp;
- }
-
- @Override
- protected Servlet createServlet(String servletName, String servletClass)
- {
- final Servlet servlet = _factory.createServlet();
- servlet.setServletName(servletName);
- servlet.setServletClass(servletClass);
- return servlet;
- }
-
- @Override
- protected Object createServletMapping()
- {
- return _factory.createServletMapping();
- }
-
- @Override
- protected void setServletClass(Object servlet, String name)
- {
- ((Servlet) servlet).setServletClass(name);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- protected List getServlets(Object webApp)
- {
- return ((WebApp) webApp).getServlets();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void addMappingToWebApp(Object webApp, Object mapping)
- {
- getServletMappings_WebApp(webApp).add((ServletMapping) mapping);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void addServletToWebApp(Object webApp, Object servlet)
- {
- getServlets(webApp).add(servlet);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- protected List getServletMappings_WebApp(Object webApp)
- {
- return ((WebApp) webApp).getServletMappings();
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- protected List getServletMappings_Servlet(final Object webApp,Object servlet)
- {
- List<ServletMapping> mappings = new ArrayList<ServletMapping>();
- for (final ServletMapping mapping : ((WebApp)webApp).getServletMappings())
- {
- if (mapping.getServletName() != null &&
- mapping.getServletName().equals(((Servlet)servlet).getServletName()))
- {
- mappings.add(mapping);
- }
- }
- return mappings;
- }
-
- @Override
- protected void setMappingData(Object webApp, List<String> urlPatterns,
- Object servlet, Object mapping)
- {
- ((ServletMapping) mapping).setServletName(((Servlet) servlet).getServletName());
- setUrlPattern(mapping, urlPatterns);
-// ((ServletMapping) mapping).setWebApp((WebApp) webApp);
- }
-
- @Override
- protected void setUrlPattern(Object mapping, List<String> patterns)
- {
- ((ServletMapping) mapping).getUrlPatterns().clear();
- for (final String pattern : patterns)
- {
- UrlPatternType newPattern = JavaeeFactory.eINSTANCE.createUrlPatternType();
- newPattern.setValue(pattern);
- ((ServletMapping) mapping).getUrlPatterns().add(newPattern);
- }
- }
-
- @Override
- protected Object createContextParam(String name, String value, final String version)
- {
- ParamValue paramValue =
- JavaeeFactory.eINSTANCE.createParamValue();
- paramValue.setParamName(name);
- paramValue.setParamValue(value);
- return paramValue;
- }
-
- @Override
- protected void setContextParam(Object webApp, Object param, final String version)
- {
- ((WebApp)webApp).getContextParams().add((ParamValue) param);
- }
-
- @Override
- protected Servlet getServlet(Object webApp, String servletName)
- {
- List<Servlet> servlets = ((WebApp)webApp).getServlets();
- for (final Servlet servlet : servlets)
- {
- if (servlet.getServletName().equals(servletName))
- {
- return servlet;
- }
- }
- return null;
- }
-
- @Override
- protected void verifyServlet(Object defaultServlet, String className)
- {
- assertEquals(className, ((Servlet) defaultServlet).getServletClass());
- }
-
- @Override
- protected void verifyLoadOnStartup(Object defaultServlet,
- Integer expectedValue)
- {
- assertEquals(expectedValue, ((Servlet)defaultServlet).getLoadOnStartup());
- }
-
- @Override
- protected void setServletOnMapping(Object mapping, Object servlet)
- {
- ((ServletMapping)mapping).setServletName(((Servlet)servlet).getServletName());
- }
- @Override
- protected void verifyMapping(Object mapping,
- String jsfDefaultServletName, String pattern)
- {
- assertEquals(jsfDefaultServletName, ((ServletMapping)mapping).getServletName());
- boolean foundPattern = false;
- for (final UrlPatternType urlPattern : ((ServletMapping)mapping).getUrlPatterns())
- {
- if (pattern.equals(urlPattern.getValue()))
- {
- foundPattern = true;
- break;
- }
- }
- assertTrue(foundPattern);
- }
- @SuppressWarnings("rawtypes")
- @Override
- protected List getContextParams(Object webApp, String version)
- {
- return ((WebApp)webApp).getContextParams();
- }
- @Override
- protected String getContextParamValue(Object param, String version)
- {
- return ((ParamValue)param).getParamValue();
- }
-
- }
- //
- // //@Test
- // public void testGetFileUrlPath_NonNullCases()
- // {
- // // a web app with valid servlet and extension mapping
- // WebApp webApp = _factory.createWebApp();
- // Servlet servlet = _factory.createServlet();
- // servlet.setServletClass(JSFUtils.JSF_SERVLET_CLASS);
- // servlet.setServletName("JSF Servlet");
- // webApp.getServlets().add(servlet);
- // ServletMapping mapping = _factory.createServletMapping();
- // mapping.setServletName("JSF Servlet");
- // UrlPatternType pattern = JavaeeFactory.eINSTANCE.createUrlPatternType();
- // pattern.setValue(".faces");
- // mapping.getUrlPatterns().add(pattern);
- // webApp.getServletMappings().add(mapping);
- // IPath fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- // IResource.FILE, new Path("/WebContent/test.jsp")), new Path(
- // "/test.jsp"));
- // assertEquals("/test.faces", fileUrlPath.toString());
- //
- // // web app with valid servlet and non-default extension mapping
- // fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- // IResource.FILE, new Path("/WebContent/test.xhtml")), new Path(
- // "/test.xhtml"));
- // assertEquals("/test.faces", fileUrlPath.toString());
- //
- // // web app with valid servlet and path-based mapping
- // pattern.setValue("/faces");
- // fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- // IResource.FILE, new Path("/WebContent/test.jsp")), new Path(
- // "/test.jsp"));
- // assertEquals("/faces/test.jsp", fileUrlPath.toString());
- //
- // // web app with valid servlet and path-based mapping match *
- // pattern.setValue("/faces/*");
- // fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- // IResource.FILE, new Path("/WebContent/test.jsp")), new Path(
- // "/test.jsp"));
- // assertEquals("/faces/test.jsp", fileUrlPath.toString());
- //
- // // web app with valid servlet and extension mapping based on a
- // // non-default, default extension
- // pattern.setValue(".jspx");
- // ParamValue param = JavaeeFactory.eINSTANCE.createParamValue();
- // param.setParamName(JSFUtils.JSF_DEFAULT_SUFFIX_CONTEXT_PARAM);
- // param.setParamValue(".xhtml");
- // webApp.getContextParams().add(param);
- // fileUrlPath = _jsfUtils.getFileUrlPath(webApp, new MockResource(
- // IResource.FILE, new Path("/WebContent/test.xhtml")), new Path(
- // "/test.xhtml"));
- // assertEquals("/test.jspx", fileUrlPath.toString());
- // }
- //
- // //@Test
- // public void testGetFileUrlPath_NullCases()
- // {
- // // a null webApp object produces a null path
- // Path existingURL = new Path("foobar");
- // verifyNull(existingURL, null);
- //
- // // a non-null value that is not instanceof WebApp returns a null path
- // verifyNull(existingURL, new Object());
- // // a web app with no servlet produces a null path
- //
- // WebApp webApp = _factory.createWebApp();
- // verifyNull(existingURL, webApp);
- //
- // // a web app with no meaningful servlet returns null
- // Servlet servlet = _factory.createServlet();
- // webApp.getServlets().add(servlet);
- // verifyNull(existingURL, webApp);
- //
- // // wrong servlet class name
- // servlet.setServletClass("com.wrong.Servlet");
- // verifyNull(existingURL, webApp);
- //
- // // multiple wrong class names
- // servlet = _factory.createServlet();
- // servlet.setServletClass("com.AnotherWrong.Servlet");
- // webApp.getServlets().add(servlet);
- //
- // assertEquals(2, webApp.getServlets().size());
- // verifyNull(existingURL, webApp);
- //
- // // valid servlet class, but no mappings
- // servlet.setServletClass(JSFUtils.JSF_SERVLET_CLASS);
- // verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- // new Path("/somepath")));
- // verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- // new Path("/somepath.xhtml")));
- //
- // // has mapping but it's empty
- // ServletMapping mapping = _factory.createServletMapping();
- // webApp.getServletMappings().add(mapping);
- // assertEquals(1, webApp.getServletMappings().size());
- // verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- // new Path("/somepath.xhtml")));
- //
- // // empty mapping that matches to servlet
- // mapping.setServletName(servlet.getServletName());
- // assertEquals(1, webApp.getServletMappings().size());
- // // assertTrue(servlet.getMappings().contains(mapping));
- // verifyNull(existingURL, webApp, new MockResource(IResource.FILE,
- // new Path("/somepath.xhtml")));
- // }
- //
- // private void verifyNull(Path existingURL, Object webApp, IResource res)
- // {
- // assertNull(_jsfUtils.getFileUrlPath(webApp, res, null));
- // assertNull(_jsfUtils.getFileUrlPath(webApp, res, existingURL));
- // }
- //
- // private void verifyNull(Path existingURL, Object webApp)
- // {
- // verifyNull(existingURL, webApp, null);
- // }
- //
- // protected ServletMapping createServletMapping()
- // {
- // return null;
- // }
- //
- // protected void setServletClass(Servlet servlet, String name)
- // {
- // }
- //
- // protected EList getServlets(final WebApp webApp)
- // {
- // return null;
- // }
- //
- // protected void addToWebApp(final WebApp webApp, final ServletMapping
- // mapping)
- // {
- // }
- //
- // protected EList getServletMappings(final WebApp webApp)
- // {
- // return null;
- // }
- //
- // protected List getServletMappings(Servlet servlet)
- // {
- // return null;
- // }
- //
- // protected void setMappingData(final WebApp webApp, final List<String>
- // urlPatterns, final Servlet servlet,
- // final ServletMapping mapping)
- // {
- // }
- //
- // protected void setUrlPattern(final ServletMapping mapping, final
- // List<String> patterns)
- // {
- // }
- //
- // protected ContextParam createContextParam(final String name, final String
- // value)
- // {
- // return null;
- // }
- //
- // protected void setContextParam(final WebApp webApp, final ContextParam
- // param)
- // {
- // }
- //
- // protected void addToWebApp(final WebApp webApp, final Servlet servlet)
- // {
- // }
- //
- // protected Servlet getServlet(final WebApp webApp, final String
- // servletName)
- // {
- // return null;
- // }
- //
- // protected void verifyServlet(final Servlet defaultServlet, final String
- // className)
- // {
- // }
- //
- // protected void verifyLoadOnStartup(final Servlet defaultServlet, final
- // Integer expectedValue)
- // {
- // }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils20.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils20.java
deleted file mode 100644
index 7826aa5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestJSFUtils20.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-import org.eclipse.jst.jsf.core.JSFVersion;
-
-
-public class TestJSFUtils20 extends TestJSFUtils12
-{
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- assertEquals(JSFVersion.V2_0, _jsfUtils.getVersion());
- }
-
- @Override
- protected JSFVersion getVersionToTestIn()
- {
- return JSFVersion.V2_0;
- }
-
- //@Test
- public void testUpdateWebApp_ExistingServlet_3_0()
- {
- super.testUpdateWebApp_ExistingServlet("3.0");
- }
-
- //@Test
- public void testUpdateWebApp_NewServlet_3_0()
- {
- super.testUpdateWebApp_NewServlet("3.0");
- }
-
- //@Test
- public void testRollbackWebApp_3_0()
- {
- super.testRollbackWebApp("3.0");
- }
-
- //@Test
- public void testGetFileUrlPath_NonNullCases_3_0()
- {
- super.testGetFileUrlPath_NonNullCases("3.0");
- }
-
- //@Test
- public void testGetFileUrlPath_NullCases_3_0()
- {
- super.testGetFileUrlPath_NullCases("3.0");
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestUtilSuite.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestUtilSuite.java
deleted file mode 100644
index 8474f9f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestUtilSuite.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-
-/**
- * @author cbateman
- *
- */
-//@RunWith(Suite.class)
-//@Suite.SuiteClasses({
-// TestJSFUtils11.class,
-// TestJSFUtils12.class,
-// TestJSFUtils20.class
-//})
-public class TestUtilSuite
-{
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestableJSFUtils.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestableJSFUtils.java
deleted file mode 100644
index 71e2ca8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/project/facet/TestableJSFUtils.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.project.facet;
-
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class TestableJSFUtils extends JSFUtils
-{
- private final JSFUtils _delegate;
-
- public TestableJSFUtils(final JSFUtils jsfUtils,
- final IModelProvider modelProvider)
- {
- super(jsfUtils.getVersion(), modelProvider);
- Assert.assertNotNull(jsfUtils);
- Assert.assertNotNull(modelProvider);
- _delegate = jsfUtils;
- }
-
- public String getDisplayName_testable(final IDataModel config)
- {
- return super.getDisplayName(config);
- }
-
- public String getServletClassname_testable(final IDataModel config)
- {
- return super.getServletClassname(config);
- }
-
- public List<String> getServletMappings_testable(IDataModel config)
- {
- return super.getServletMappings(config);
- }
-
- public boolean isJSFPage_testable(final IResource resource)
- {
- return super.isJSFPage(resource);
- }
-
- public boolean isValidKnownExtension_testable(String fileExtension)
- {
- return super.isValidKnownExtension(fileExtension);
- }
-
- public void printConfigFile_testable(final OutputStream os)
- {
- super.printConfigFile(os);
- }
-
- @Override
- public void doVersionSpecificConfigFile(PrintWriter pw)
- {
- _delegate.doVersionSpecificConfigFile(pw);
- }
-
- @Override
- public void updateWebApp(Object webApp, IDataModel config)
- {
- _delegate.updateWebApp(webApp, config);
- }
-
- @Override
- public void rollbackWebApp(Object webApp)
- {
- _delegate.rollbackWebApp(webApp);
- }
-
- @Override
- public IPath getFileUrlPath(Object webAppObj, IResource resource,
- IPath existingURL)
- {
- return _delegate.getFileUrlPath(webAppObj, resource, existingURL);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/region/TestRegion2ElementAdapter.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/region/TestRegion2ElementAdapter.java
deleted file mode 100644
index 9f869c7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/region/TestRegion2ElementAdapter.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.region;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.common.dom.AttrDOMAdapter;
-import org.eclipse.jst.jsf.common.dom.AttributeIdentifier;
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.core.internal.region.Region2AttrAdapter;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-public class TestRegion2ElementAdapter extends TestCase
-{
-
- private final static int OFFSET_OUTPUT_TEXT_WITH_EL =
- 883;
- private final static int OFFSET_PANELGRID_WITH_NO_EL =
- 958;
- private final static int OFFSET_OUTPUTLABEL_WITH_NO_EL =
- 990;
- private final static int OFFSET_INPUTTEXT_WITH_BOTH =
- 1044;
- private final static int OFFSET_COMMANDBUTTON_WITH_TWO_EL =
- 1255;
-
- private final static Map<String, String> OUTPUTLABEL_ATTRIBUTES;
- private final static Map<String, String> INPUTTEXT_ATTRIBUTES;
- private final static Map<String, String> COMMANDBUTTON_ATTRIBUTES;
-
- private WebProjectTestEnvironment _webProjectTestEnv;
- private IResource _res1;
- private IStructuredModel _model;
- private IStructuredDocument _sdoc;
-
- static
- {
- Map<String, String> map = new HashMap<String, String>();
- map.put("for", "userId");
- map.put("value", "Username:");
- OUTPUTLABEL_ATTRIBUTES = Collections.unmodifiableMap(map);
-
- map = new HashMap<String, String>();
- map.put("id", "userId");
- map.put("value", "#{loginRequest.id}");
- INPUTTEXT_ATTRIBUTES = Collections.unmodifiableMap(map);
-
- map = new HashMap<String, String>();
- map.put("action", "#{appController.loginActions}");
- map.put("value", "#{bundle['login.button.value']}");
- COMMANDBUTTON_ATTRIBUTES = Collections.unmodifiableMap(map);
-
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _webProjectTestEnv =
- new WebProjectTestEnvironment(getClass().getName()
- + "_" + getName());
- _webProjectTestEnv.createProject(false);
- assertNotNull(_webProjectTestEnv);
- assertNotNull(_webProjectTestEnv.getTestProject());
- assertTrue(_webProjectTestEnv.getTestProject().isAccessible());
-
- _res1 =
- _webProjectTestEnv.loadResourceInWebRoot(TestsPlugin
- .getDefault().getBundle(),
- "/testfiles/jsps/testdata1.jsp.data", "/testdata1.jsp");
- _model =
- StructuredModelManager.getModelManager().getModelForRead(
- (IFile) _res1);
- assert (_model instanceof DOMModelForJSP);
- _sdoc = _model.getStructuredDocument();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- try
- {
- super.tearDown();
- }
- finally
- {
- _model.releaseFromRead();
- }
-
- }
-
- public void testSanity()
- {
- assertExpectedTag(OFFSET_OUTPUT_TEXT_WITH_EL, "h", "outputText",
- ITLDConstants.URI_JSF_HTML);
- final Map<String, String> expectedMap = new HashMap<String, String>();
- expectedMap.put("value", "#{bundle['page.header']}");
- assertExpectedAttributes(OFFSET_OUTPUT_TEXT_WITH_EL, expectedMap);
-
- assertExpectedTag(OFFSET_PANELGRID_WITH_NO_EL, "h", "panelGrid",
- ITLDConstants.URI_JSF_HTML);
- expectedMap.clear();
- expectedMap.put("columns", "2");
- assertExpectedAttributes(OFFSET_PANELGRID_WITH_NO_EL, expectedMap);
-
- assertExpectedTag(OFFSET_OUTPUTLABEL_WITH_NO_EL, "h", "outputLabel",
- ITLDConstants.URI_JSF_HTML);
- assertExpectedAttributes(OFFSET_OUTPUTLABEL_WITH_NO_EL,
- OUTPUTLABEL_ATTRIBUTES);
-
- assertExpectedTag(OFFSET_INPUTTEXT_WITH_BOTH, "h", "inputText",
- ITLDConstants.URI_JSF_HTML);
- assertExpectedAttributes(OFFSET_INPUTTEXT_WITH_BOTH,
- INPUTTEXT_ATTRIBUTES);
-
- assertExpectedTag(OFFSET_COMMANDBUTTON_WITH_TWO_EL, "h",
- "commandButton", ITLDConstants.URI_JSF_HTML);
- assertExpectedAttributes(OFFSET_COMMANDBUTTON_WITH_TWO_EL,
- COMMANDBUTTON_ATTRIBUTES);
-
- }
-
- /**
- * Single attribute, EL only
- *
- * @throws Exception
- */
- public void testOutputTextWithEL() throws Exception
- {
- final IndexedRegion region =
- JSFTestUtil.getIndexedRegion(_sdoc,
- OFFSET_OUTPUT_TEXT_WITH_EL);
- final IDOMNode domNode = (IDOMNode) region;
-
- final ITextRegion textRegion =
- domNode
- .getFirstStructuredDocumentRegion();
- final Region2ElementAdapter adapter =
- new Region2ElementAdapter(
- textRegion);
-
- // verify element
- assertEquals("h:outputText", adapter.getNodeName());
- assertEquals("outputText", adapter.getLocalName());
- assertEquals("h", adapter.getPrefix());
- assertEquals(ITLDConstants.URI_JSF_HTML, adapter.getNamespace());
- assertEquals(1, adapter.getAttributes().size());
-
- // verify the TagIdentifier
- final TagIdentifier tagId = adapter.getTagId();
- assertNotNull(tagId);
- assertEquals(ITLDConstants.URI_JSF_HTML, tagId.getUri());
- assertEquals(IJSFConstants.TAG_OUTPUTTEXT, tagId.getTagName());
- assertEquals(IJSFConstants.TAG_IDENTIFIER_OUTPUTTEXT, tagId);
-
- // verify only attribute
- assertTrue(adapter.getAttributes().containsKey("value"));
- final AttrDOMAdapter attr = adapter.getAttributes().get("value");
- assertEquals("value", attr.getLocalName());
- assertEquals("value", attr.getNodeName());
- assertEquals("#{bundle['page.header']}", attr.getValue());
-
- // verify the AttributeIdentifier
- final AttributeIdentifier attrId = attr.getAttributeIdentifier();
- assertNotNull(attrId);
- assertEquals(tagId, attrId.getTagIdentifier());
- assertEquals(attr.getNodeName(), attrId.getName());
- }
-
- /**
- * Single attribute No EL
- *
- * @throws Exception
- */
- public void testPanelGridWithNoEL() throws Exception
- {
- final IndexedRegion region =
- JSFTestUtil.getIndexedRegion(_sdoc,
- OFFSET_PANELGRID_WITH_NO_EL);
- final IDOMNode domNode = (IDOMNode) region;
-
- final ITextRegion textRegion =
- domNode
- .getFirstStructuredDocumentRegion();
- final Region2ElementAdapter adapter =
- new Region2ElementAdapter(
- textRegion);
-
- // verify element
- assertEquals("h:panelGrid", adapter.getNodeName());
- assertEquals("panelGrid", adapter.getLocalName());
- assertEquals("h", adapter.getPrefix());
- assertEquals(ITLDConstants.URI_JSF_HTML, adapter.getNamespace());
- assertEquals(1, adapter.getAttributes().size());
-
- // verify the TagIdentifier
- final TagIdentifier tagId = adapter.getTagId();
- assertNotNull(tagId);
- assertEquals(ITLDConstants.URI_JSF_HTML, tagId.getUri());
- assertEquals(IJSFConstants.TAG_PANELGRID, tagId.getTagName());
- assertEquals(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID, tagId);
-
- // verify only attribute
- assertTrue(adapter.getAttributes().containsKey("columns"));
- final AttrDOMAdapter attr = adapter.getAttributes().get("columns");
- assertEquals("columns", attr.getLocalName());
- assertEquals("columns", attr.getNodeName());
- assertEquals("2", attr.getValue());
-
- // verify the AttributeIdentifier
- final AttributeIdentifier attrId = attr.getAttributeIdentifier();
- assertNotNull(attrId);
- assertEquals(tagId, attrId.getTagIdentifier());
- assertEquals(attr.getNodeName(), attrId.getName());
- }
-
- /**
- * Two non-EL attributes
- *
- * @throws Exception
- */
- public void testOutputLabelWithNoEL() throws Exception
- {
- final IndexedRegion region =
- JSFTestUtil.getIndexedRegion(_sdoc,
- OFFSET_OUTPUTLABEL_WITH_NO_EL);
- final IDOMNode domNode = (IDOMNode) region;
-
- final ITextRegion textRegion =
- domNode
- .getFirstStructuredDocumentRegion();
- final Region2ElementAdapter adapter =
- new Region2ElementAdapter(
- textRegion);
-
- // verify element
- assertEquals("h:outputLabel", adapter.getNodeName());
- assertEquals("outputLabel", adapter.getLocalName());
- assertEquals("h", adapter.getPrefix());
- assertEquals(ITLDConstants.URI_JSF_HTML, adapter.getNamespace());
-
- // verify the TagIdentifier
- final TagIdentifier tagId = adapter.getTagId();
- assertNotNull(tagId);
- assertEquals(ITLDConstants.URI_JSF_HTML, tagId.getUri());
- assertEquals(IJSFConstants.TAG_OUTPUTLABEL, tagId.getTagName());
- assertEquals(IJSFConstants.TAG_IDENTIFIER_OUTPUTLABEL, tagId);
-
- assertEquals(OUTPUTLABEL_ATTRIBUTES.size(), adapter.getAttributes()
- .size());
- for (final Map.Entry<String, String> entry : OUTPUTLABEL_ATTRIBUTES
- .entrySet())
- {
- AttrDOMAdapter attrAdapter =
- adapter.getAttributes().get(
- entry.getKey());
- assertNotNull(attrAdapter);
- assertEquals(entry.getKey(), attrAdapter.getNodeName());
- assertEquals(entry.getValue(), attrAdapter.getValue());
- // verify the AttributeIdentifier
- final AttributeIdentifier attrId =
- attrAdapter
- .getAttributeIdentifier();
- assertNotNull(attrId);
- assertEquals(tagId, attrId.getTagIdentifier());
- assertEquals(attrAdapter.getNodeName(), attrId.getName());
- }
-
- }
-
- /**
- * One non-EL attribute, One EL attribute
- *
- * @throws Exception
- */
- public void testInputTextWithBoth() throws Exception
- {
- final IndexedRegion region =
- JSFTestUtil.getIndexedRegion(_sdoc,
- OFFSET_INPUTTEXT_WITH_BOTH);
- final IDOMNode domNode = (IDOMNode) region;
-
- final ITextRegion textRegion =
- domNode
- .getFirstStructuredDocumentRegion();
- final Region2ElementAdapter adapter =
- new Region2ElementAdapter(
- textRegion);
-
- // verify element
- assertEquals("h:inputText", adapter.getNodeName());
- assertEquals("inputText", adapter.getLocalName());
- assertEquals("h", adapter.getPrefix());
- assertEquals(ITLDConstants.URI_JSF_HTML, adapter.getNamespace());
-
- // verify the TagIdentifier
- final TagIdentifier tagId = adapter.getTagId();
- assertNotNull(tagId);
- assertEquals(ITLDConstants.URI_JSF_HTML, tagId.getUri());
- assertEquals(IJSFConstants.TAG_INPUTTEXT, tagId.getTagName());
- assertEquals(IJSFConstants.TAG_IDENTIFIER_INPUTTEXT, tagId);
-
- assertEquals(INPUTTEXT_ATTRIBUTES.size(), adapter.getAttributes()
- .size());
- for (final Map.Entry<String, String> entry : INPUTTEXT_ATTRIBUTES
- .entrySet())
- {
- AttrDOMAdapter attrAdapter =
- adapter.getAttributes().get(
- entry.getKey());
- assertNotNull(attrAdapter);
- assertEquals(entry.getKey(), attrAdapter.getNodeName());
- assertEquals(entry.getValue(), attrAdapter.getValue());
- // verify the AttributeIdentifier
- final AttributeIdentifier attrId =
- attrAdapter
- .getAttributeIdentifier();
- assertNotNull(attrId);
- assertEquals(tagId, attrId.getTagIdentifier());
- assertEquals(attrAdapter.getNodeName(), attrId.getName());
- }
-
- }
-
- /**
- * Two EL, no non-EL
- *
- * @throws Exception
- */
- public void testCommandButtonWithTwoEL() throws Exception
- {
- final IndexedRegion region =
- JSFTestUtil.getIndexedRegion(_sdoc,
- OFFSET_COMMANDBUTTON_WITH_TWO_EL);
- final IDOMNode domNode = (IDOMNode) region;
-
- final ITextRegion textRegion =
- domNode
- .getFirstStructuredDocumentRegion();
- final Region2ElementAdapter adapter =
- new Region2ElementAdapter(
- textRegion);
-
- // verify element
- assertEquals("h:commandButton", adapter.getNodeName());
- assertEquals("commandButton", adapter.getLocalName());
- assertEquals("h", adapter.getPrefix());
- assertEquals(ITLDConstants.URI_JSF_HTML, adapter.getNamespace());
-
- // verify the TagIdentifier
- final TagIdentifier tagId = adapter.getTagId();
- assertNotNull(tagId);
- assertEquals(ITLDConstants.URI_JSF_HTML, tagId.getUri());
- assertEquals(IJSFConstants.TAG_COMMANDBUTTON, tagId.getTagName());
- assertEquals(IJSFConstants.TAG_IDENTIFIER_COMMANDBUTTON, tagId);
-
- assertEquals(COMMANDBUTTON_ATTRIBUTES.size(), adapter.getAttributes()
- .size());
- for (final Map.Entry<String, String> entry : COMMANDBUTTON_ATTRIBUTES
- .entrySet())
- {
- AttrDOMAdapter attrAdapter =
- adapter.getAttributes().get(
- entry.getKey());
- assertNotNull(attrAdapter);
- assertEquals(entry.getKey(), attrAdapter.getNodeName());
- assertEquals(entry.getValue(), attrAdapter.getValue());
- // verify the AttributeIdentifier
- final AttributeIdentifier attrId =
- attrAdapter
- .getAttributeIdentifier();
- assertNotNull(attrId);
- assertEquals(tagId, attrId.getTagIdentifier());
- assertEquals(attrAdapter.getNodeName(), attrId.getName());
- }
- }
-
- /**
- * Ensure that we can pass the element or attribute adapter back and get the
- * corresponding region
- */
- public void testAdapterToRegionMappings() throws Exception
- {
- final IndexedRegion region =
- JSFTestUtil.getIndexedRegion(_sdoc,
- OFFSET_INPUTTEXT_WITH_BOTH);
- final IDOMNode domNode = (IDOMNode) region;
-
- final ITextRegion textRegion =
- domNode
- .getFirstStructuredDocumentRegion();
- final Region2ElementAdapter adapter =
- new Region2ElementAdapter(
- textRegion);
-
- assertEquals(OFFSET_INPUTTEXT_WITH_BOTH, adapter.getTextRegion()
- .getStart());
-
- assertEquals(textRegion, adapter.getTextRegion());
-
- Region2AttrAdapter attrAdapter = adapter.getAttributes().get("id");
- assertEquals(OFFSET_INPUTTEXT_WITH_BOTH+13, attrAdapter.getStartOffset());
- assertExpectedAttributeName(attrAdapter, 13, 2);
- // length is 9 instead of 8 because of trailing whitespace
- assertExpectedAttributeValue(attrAdapter, 16, 9);
-
- attrAdapter = adapter.getAttributes().get("value");
- assertEquals(OFFSET_INPUTTEXT_WITH_BOTH+25, attrAdapter.getStartOffset());
- assertExpectedAttributeName(attrAdapter, 25, 5);
- // length is 9 instead of 8 because of trailing whitespace
- assertExpectedAttributeValue(attrAdapter, 31, 20);
- }
-
- private void assertExpectedAttributeName(
- final Region2AttrAdapter attrAdapter, final int expectedStart,
- final int expectedLength)
- {
- final ITextRegion nameRegion = attrAdapter.getAttributeNameRegion();
- assertEquals(expectedStart, nameRegion.getStart());
- assertEquals(expectedLength, nameRegion.getLength());
- }
-
- private void assertExpectedAttributeValue(
- final Region2AttrAdapter attrAdapter, final int expectedStart,
- final int expectedLength)
- {
- final ITextRegion valueRegion = attrAdapter.getAttributeValueRegion();
- assertEquals(expectedStart, valueRegion.getStart());
- assertEquals(expectedLength, valueRegion.getLength());
-
- }
-
- private void assertExpectedTag(final int offset, final String prefix,
- final String tagName, final String uri)
- {
- final IndexedRegion region =
- JSFTestUtil
- .getIndexedRegion(_sdoc, offset);
- assertTrue(region instanceof IDOMElement);
-
- assertEquals(prefix + ":" + tagName, ((IDOMElement) region)
- .getNodeName());
- assertEquals(tagName, ((IDOMElement) region).getLocalName());
- assertEquals(prefix, ((IDOMElement) region).getPrefix());
- }
-
- private void assertExpectedAttributes(final int offset,
- final Map<String, String> attributes)
- {
- final IndexedRegion region =
- JSFTestUtil
- .getIndexedRegion(_sdoc, offset);
- assertTrue(region instanceof IDOMElement);
-
- final IDOMElement domElement = (IDOMElement) region;
-
- assertExpectedAttributes(new Iterator<Node>()
- {
- int curElement = 0;
-
- public boolean hasNext()
- {
- return (curElement < domElement.getAttributes().getLength());
- }
-
- public Node next()
- {
- return domElement.getAttributes().item(curElement++);
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException("");
-
- }
-
- }, attributes);
- }
-
- private void assertExpectedAttributes(final Iterator<Node> check,
- final Map<String, String> expectedAttributes)
- {
- int count = 0;
- for (; check.hasNext();)
- {
- Node node = check.next();
- assertTrue(expectedAttributes.containsKey(node.getNodeName()));
- assertEquals(expectedAttributes.get(node.getNodeName()), node
- .getNodeValue());
- count++;
- }
- assertEquals(expectedAttributes.size(), count);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AbstractTestListener.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AbstractTestListener.java
deleted file mode 100644
index 7b808b8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AbstractTestListener.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import java.util.EventObject;
-
-import org.eclipse.jst.jsf.common.internal.resource.EventResult;
-import org.eclipse.jst.jsf.common.internal.resource.ILifecycleListener;
-
-abstract class AbstractTestListener<EVENTTYPE extends EventObject> implements ILifecycleListener<EVENTTYPE>
-{
-
- public abstract EventResult acceptEvent(final EVENTTYPE event);
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AllLifecycleListenerTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AllLifecycleListenerTests.java
deleted file mode 100644
index c71dc6a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/AllLifecycleListenerTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import org.eclipse.jst.jsf.test.util.junit4.FastTest;
-import org.junit.experimental.categories.Categories;
-import org.junit.experimental.categories.Categories.IncludeCategory;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Categories.class)
-@IncludeCategory(FastTest.class)
-@SuiteClasses(
-{ FastLifecycleListenerTests.class, FastLifecycleListenerTests_Scenario.class })
-public class AllLifecycleListenerTests
-{
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/ClasspathTestListener.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/ClasspathTestListener.java
deleted file mode 100644
index d6ddd43..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/ClasspathTestListener.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jst.jsf.common.internal.resource.ClasspathEntryLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.EventResult;
-import org.eclipse.jst.jsf.common.internal.resource.IClasspathLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.IClasspathLifecycleListener.ClasspathLifecycleEvent;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJDTWorkspaceContext;
-
-class ClasspathTestListener extends
- AbstractTestListener<ClasspathLifecycleEvent> implements
- IClasspathLifecycleListener
-{
- private final List<EventData> _events = new ArrayList<EventData>();
- private final MockJDTWorkspaceContext _jdtContext;
-
- public ClasspathTestListener(final MockJDTWorkspaceContext jdtContext)
- {
- _jdtContext = jdtContext;
- }
-
- public ClasspathTestListener(final MockJDTWorkspaceContext jdtContext,
- final ClasspathEntryLifecycleListener listener)
- {
- this(jdtContext);
- listener.addListener(this);
- }
-
- public void fireAndExpect(final ElementChangedEvent fire,
- final List<EventData> expectedData)
- {
- fireEvent(fire);
- assertEquals(expectedData.size(), _events.size());
- for (final EventData data : expectedData)
- {
- data.assertContainedIn(_events);
- }
- }
-
- public void fireAndExpect(final ElementChangedEvent fire,
- final IJavaElement javaElement, final ClasspathLifecycleEvent.Type type)
- {
- fireAndExpect(fire, Collections.singletonList(new EventData(
- javaElement, type)));
- }
-
- public void fireAndExpectNull(final ElementChangedEvent fire)
- {
- fireEvent(fire);
- assertTrue(_events.isEmpty());
- }
-
- protected void fireEvent(final ElementChangedEvent event)
- {
- _events.clear();
- _jdtContext.fireElementChangedEvent(event);
- }
-
- public static class EventData
- {
- private final IJavaElement _affectedElement;
- private final ClasspathLifecycleEvent.Type _type;
-
- // private final EventType _eventType;
- // private final ReasonType _reasonType;
- public EventData(final IJavaElement affectedElement, final ClasspathLifecycleEvent.Type type)
- {
- super();
- _affectedElement = affectedElement;
- _type = type;
- }
-
- public EventData(final ClasspathLifecycleEvent event)
- {
- this(event.getAffectedElement(), event.getType());
- }
-
- public void assertContainedIn(final List<EventData> events)
- {
- for (final EventData event : events)
- {
- if (isEqual(event))
- {
- return;
- }
- }
- Assert.fail("Event not found in list: " + this.toString());
- }
-
- public boolean isEqual(final EventData eventData)
- {
- return (_affectedElement.equals(eventData._affectedElement)
- && _type == eventData._type);
- }
-
- @Override
- public String toString()
- {
- return String.format(
- "Classpath Entry: %s",
- _affectedElement.toString());
- }
- }
-
- @Override
- public EventResult acceptEvent(final ClasspathLifecycleEvent event)
- {
- _events.add(new EventData(event));
- return EventResult.getDefaultEventResult();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastClasspathEntryLifecycleTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastClasspathEntryLifecycleTests.java
deleted file mode 100644
index 0c86f4d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastClasspathEntryLifecycleTests.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jst.jsf.common.internal.resource.ClasspathEntryLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.IClasspathLifecycleListener.ClasspathLifecycleEvent;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJDTWorkspaceContext;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaCoreMediator;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaProject;
-import org.eclipse.jst.jsf.test.util.mock.java.MockPackageFragmentRoot;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class FastClasspathEntryLifecycleTests
-{
- private MockWorkspaceContext _wsContext;
- private MockJavaChangeEventFactory _factory;
- private MockProject _project;
- private MockJDTWorkspaceContext _jdtContext;
- private MockJavaProject _javaProject;
-
- @Before
- public void setUp() throws Exception
- {
- _wsContext = new MockWorkspaceContext();
- _project = _wsContext.createProject("SomeTestProject");
- _jdtContext = new MockJDTWorkspaceContext(_wsContext);
- _javaProject = _jdtContext.createJavaProject(_project);
- _factory = new MockJavaChangeEventFactory(_jdtContext);
- }
-
- @Test
- public void testAddJarTo()
- {
- final ClasspathEntryLifecycleListener listener = new ClasspathEntryLifecycleListener(
- _project, new MockJavaCoreMediator(_jdtContext));
- ClasspathTestListener testListener = new ClasspathTestListener(
- _jdtContext, listener);
- IPackageFragmentRoot fragRoot = new MockPackageFragmentRoot(
- _javaProject, new Path(
- "/WebContent/WEB-INF/lib/my.jar"));
- ElementChangedEvent event = _factory.createSimpleJarAdded(_project,
- fragRoot);
- testListener.fireAndExpect(event, event.getDelta().getElement(),
- ClasspathLifecycleEvent.Type.ADDED);
- listener.dispose();
- }
-
- @Test
- public void testRemoveJarFrom()
- {
- final ClasspathEntryLifecycleListener listener = new ClasspathEntryLifecycleListener(
- _project, new MockJavaCoreMediator(_jdtContext));
- ClasspathTestListener testListener = new ClasspathTestListener(
- _jdtContext, listener);
- IPackageFragmentRoot fragRoot = new MockPackageFragmentRoot(
- _javaProject, new Path(
- "/WebContent/WEB-INF/lib/my.jar"));
- ElementChangedEvent event = _factory.createSimpleJarRemoved(_project,
- fragRoot);
- testListener.fireAndExpect(event, event.getDelta().getElement(),
- ClasspathLifecycleEvent.Type.REMOVED);
- listener.dispose();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests.java
deleted file mode 100644
index 541b327..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests.java
+++ /dev/null
@@ -1,261 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockFile;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockResourceChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class FastLifecycleListenerTests
-{
- private MockWorkspaceContext _wsContext;
- private MockResourceChangeEventFactory _factory;
- private MockProject _project;
- private MockFile _file;
-
- @Before
- public void setUp() throws Exception
- {
- _wsContext = new MockWorkspaceContext();
- _project = _wsContext.createProject("SomeTestProject");
- _file = (MockFile) _project.getFile("myfile.txt");
- _factory = new MockResourceChangeEventFactory(_wsContext);
- }
-
- @Test
- public void testAddRemoveListener()
- {
- final LifecycleListener listener = new LifecycleListener(_file,
- _wsContext.getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory.createSimpleFileChange(
- _file, true);
- tester.fireAndExpect(event, _file, EventType.RESOURCE_CHANGED,
- ReasonType.RESOURCE_CHANGED_CONTENTS);
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
- @Test
- public void testAddRemoveResource()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory.createSimpleFileChange(
- _file, true);
- tester.fireAndExpectNull(event);
- assertEquals(0, _wsContext.getWorkspace().getListeners().size());
-
- // now add the resource and verify the event
- listener.addResource(_file);
- tester.fireAndExpect(event, _file, EventType.RESOURCE_CHANGED,
- ReasonType.RESOURCE_CHANGED_CONTENTS);
- assertEquals(1, _wsContext.getWorkspace().getListeners().size());
-
- // remove it again and verify no event.
- listener.removeResource(_file);
- tester.fireAndExpectNull(event);
- assertEquals(0, _wsContext.getWorkspace().getListeners().size());
- }
-
- @Test(expected = IllegalStateException.class)
- public void testDispose_AddListener()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- listener.dispose();
- listener.addListener(new MyTestListener(_wsContext));
- }
-
- @Test(expected = IllegalStateException.class)
- public void testDispose_RemoveListener()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- listener.dispose();
- listener.removeListener(new MyTestListener(_wsContext));
- }
-
- @Test
- public void testDispose_AddRemoveResource()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- listener.dispose();
- listener.addResource(_file);
- listener.removeResource(_file);
- }
-
- @Test
- public void testFileChangedEvents()
- {
- final LifecycleListener listener = new LifecycleListener(_file,
- _wsContext.getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- IResourceChangeEvent event = _factory.createSimpleFileChange(_file,
- true);
- tester.fireAndExpect(event, _file, EventType.RESOURCE_CHANGED,
- ReasonType.RESOURCE_CHANGED_CONTENTS);
-
- event = _factory.createSimpleFileRemove(_file);
- tester.fireAndExpect(event, _file, EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_DELETED);
-
- event = _factory.createSimpleFileAdded(_file);
-
- // we are listening for the file so this fire an added
- tester.fireAndExpect(event, _file, EventType.RESOURCE_ADDED,
- ReasonType.RESOURCE_ADDED);
- // now remove the file and expect null
- listener.removeResource(_file);
- tester.fireAndExpectNull(event);
-
- // now add the file's parent and fire again
- listener.addResource(_file.getParent());
- tester.fireAndExpect(event, _file, EventType.RESOURCE_ADDED,
- ReasonType.RESOURCE_ADDED_TO_CONTAINER);
- }
-
- @Test
- public void testProjectChangeEvents_ProjectClosed()
- {
- final LifecycleListener listener = new LifecycleListener(_project,
- _wsContext.getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory
- .createSimpleProjectClosed(_project);
- tester.fireAndExpect(event, _project, EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_PROJECT_CLOSED);
-
- // remove the project and add the file
- listener.removeResource(_project);
- listener.addResource(_file);
- tester.fireAndExpect(event, _file, EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_PROJECT_CLOSED);
- }
-
- @Test
- public void testProjectChangeEvents_ProjectDeleted()
- {
- final LifecycleListener listener = new LifecycleListener(_project,
- _wsContext.getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory
- .createSimpleProjectDeleted(_project);
- tester.fireAndExpect(event, _project, EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_DELETED);
-
- // remove the project and add the file
- listener.removeResource(_project);
- listener.addResource(_file);
- tester.fireAndExpect(event, _file, EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_PROJECT_DELETED);
- }
-
- @Test(expected = NullPointerException.class)
- public void testPassNullTo_Workspace_Constructor()
- {
- new LifecycleListener(null);
- }
-
- @Test(expected = NullPointerException.class)
- public void testPassNullToResource_Workspace_Constructor()
- {
- boolean failed = false;
- try
- {
- new LifecycleListener((IResource) null, _wsContext.getWorkspace());
- } catch (final NullPointerException npe)
- {
- failed = true;
- }
- assertTrue(failed);
-
- failed = false;
-
- try
- {
- new LifecycleListener(_file, null);
- } catch (final NullPointerException npe)
- {
- failed = true;
- }
-
- assertTrue(failed);
-
- new LifecycleListener((IResource) null, null);
- }
-
- @Test(expected = NullPointerException.class)
- public void testPassNullToListResource_Workspace_Constructor()
- {
- boolean failed = false;
- try
- {
- new LifecycleListener((List<IResource>) null, _wsContext
- .getWorkspace());
- } catch (final NullPointerException npe)
- {
- failed = true;
- }
- assertTrue(failed);
-
- failed = false;
- try
- {
- new LifecycleListener(new ArrayList<IResource>(), null);
- } catch (final NullPointerException npe)
- {
- failed = true;
- }
-
- assertTrue(failed);
-
- failed = false;
- try
- {
- List<IResource> resources = new ArrayList<IResource>();
- resources.add(_file);
- resources.add(null);
- new LifecycleListener(resources, _wsContext.getWorkspace());
- } catch (NullPointerException npe)
- {
- failed = true;
- }
-
- assertTrue(failed);
- new LifecycleListener((IResource) null, null);
- }
-
- @Test(expected = NullPointerException.class)
- public void testPassNullToAddResource()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext.getWorkspace());
- listener.addResource(null);
- }
-
- @Test(expected = NullPointerException.class)
- public void testPassNullToAddListener()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext.getWorkspace());
- listener.addListener(null);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests_Scenario.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests_Scenario.java
deleted file mode 100644
index ee7f237..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/FastLifecycleListenerTests_Scenario.java
+++ /dev/null
@@ -1,340 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import static junit.framework.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.core.tests.resource.MyTestListener.EventData;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockFile;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockResourceChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class FastLifecycleListenerTests_Scenario
-{
- private MockWorkspaceContext _wsContext;
- private MockResourceChangeEventFactory _factory;
- private MockProject _project;
- private MockFile _file;
- private IFolder _folderInProject;
- private IFolder _folderInFolder;
-
- @Before
- public void setUp() throws Exception
- {
- _wsContext = new MockWorkspaceContext();
- _project = _wsContext.createProject("SomeTestProject");
- _folderInProject = _project.getFolder("/folder");
- _folderInFolder = _project.getFolder("/folder/folderInFolder");
- _file = (MockFile) _project.getFile("/folder/myfile.txt");
- _factory = new MockResourceChangeEventFactory(_wsContext);
- }
-
- /**
- * Add a new file to a folder.
- */
- @Test
- public void testAddFile()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory
- .createSimpleFileAdded(_file);
- // we shouldn't expect an event because there are no resources
- // registered
- tester.fireAndExpectNull(event);
-
- listener.addResource(_file);
- tester.fireAndExpect(event, _file,
- // IMPORTANT: ReasonType is RESOURCE_ADDED because _file is listened for
- EventType.RESOURCE_ADDED, ReasonType.RESOURCE_ADDED);
- listener.removeResource(_file);
-
- listener.addResource(_file.getParent());
- tester.fireAndExpect(
- event,
- _file,
- // IMPORTANT: ReasonType is RESOURCE_ADDED_TO_CONTAINTER because
- // _file's
- // parent is being listened for.
- EventType.RESOURCE_ADDED,
- ReasonType.RESOURCE_ADDED_TO_CONTAINER);
-
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
- /**
- * Remove a file from a folder.
- */
- @Test
- public void testRemoveFile()
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory
- .createSimpleFileRemove(_file);
- // we shouldn't expect an event because there are no resources
- // registered
- tester.fireAndExpectNull(event);
-
- listener.addResource(_file);
- tester.fireAndExpect(event, _file,
- // IMPORTANT: ReasonType is RESOURCE_DELETED because _file is listened
- // for
- EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_DELETED);
- listener.removeResource(_file);
-
- listener.addResource(_file.getParent());
- tester.fireAndExpect(
- event,
- _file,
- // IMPORTANT: ReasonType is RESOURCE_DELETED_FROM_CONTAINER
- // because
- // _file's parent is being listened for.
- EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_DELETED_FROM_CONTAINER);
-
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
- /**
- * Add a new folder.
- */
- @Test
- public void testAddFolderToProject()
- {
- assertEquals(_project, _folderInProject.getParent());
- verifyAddFolderTo(_folderInProject);
- }
-
- /**
- * Add a new folder to a folder.
- */
- @Test
- public void testAddFolderToFolder()
- {
- verifyAddFolderTo(_folderInFolder);
- }
-
- public void verifyAddFolderTo(final IFolder folder)
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory
- .createSimpleFolderAdded(folder);
- // we shouldn't expect an event because there are no resources
- // registered
- tester.fireAndExpectNull(event);
-
- listener.addResource(folder);
- tester.fireAndExpect(event, folder,
- // IMPORTANT: ReasonType is RESOURCE_ADDED because folder is listened
- // for
- EventType.RESOURCE_ADDED, ReasonType.RESOURCE_ADDED);
- listener.removeResource(folder);
-
- listener.addResource(folder.getParent());
- tester.fireAndExpect(event,
- folder,
- // IMPORTANT: ReasonType is RESOURCE_ADDED_TO_CONTAINER because
- // folder's parent is being listened for.
- EventType.RESOURCE_ADDED,
- ReasonType.RESOURCE_ADDED_TO_CONTAINER);
-
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
- @Test
- public void testRemoveFolderFromProject()
- {
- verifyRemoveFolderFrom(_folderInProject);
- }
-
- @Test
- public void testRemoveFolderFromFolder()
- {
- verifyRemoveFolderFrom(_folderInFolder);
- }
-
- public void verifyRemoveFolderFrom(final IFolder folder)
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IResourceChangeEvent event = _factory
- .createSimpleFolderDeleted(folder);
- // we shouldn't expect an event because there are no resources
- // registered
- tester.fireAndExpectNull(event);
-
- listener.addResource(folder);
- tester.fireAndExpect(event, folder,
- // IMPORTANT: ReasonType is RESOURCE_DELETED because folder is listened
- // for
- EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_DELETED);
- listener.removeResource(folder);
-
- listener.addResource(folder.getParent());
- tester.fireAndExpect(
- event,
- folder,
- // IMPORTANT: ReasonType is RESOURCE_DELETED_FROM_CONTAINER
- // because
- // folder's parent is being listened for.
- EventType.RESOURCE_INACCESSIBLE,
- ReasonType.RESOURCE_DELETED_FROM_CONTAINER);
-
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
- @Test
- public void testRenameFolderInProject()
- {
- verifyRenameFolder(_folderInProject);
- }
-
- @Test
- public void testRenameFolderInFolder()
- {
- verifyRenameFolder(_folderInFolder);
- }
-
- private void verifyRenameFolder(final IFolder folder)
- {
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IFolder newFolder = _project.getFolder(folder
- .getProjectRelativePath().removeLastSegments(1).append(
- "NewFolderName"));
- final IResourceChangeEvent event = _factory.createSimpleFolderRename(
- folder, newFolder);
- // we shouldn't expect an event because there are no resources
- // registered
- tester.fireAndExpectNull(event);
- EventData oldFolderChange = new EventData(folder,
- EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_MOVED);
- listener.addResource(folder);
- tester.fireAndExpect(event, Collections.singletonList(oldFolderChange));
- listener.removeResource(folder);
-
- List<EventData> eventData = new ArrayList<MyTestListener.EventData>();
- eventData.add(new EventData(folder,
- EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_MOVED_CONTAINER));
- eventData.add(new EventData(newFolder, EventType.RESOURCE_ADDED,
- ReasonType.RESOURCE_MOVED_CONTAINER));
- listener.addResource(folder.getParent());
- tester.fireAndExpect(event,
- eventData);
-
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
- @Test
- public void testRenameFile()
- {
- verifyRenameFile(_file);
- }
-
- private void verifyRenameFile(final IFile file)
- {
- List<EventData> eventData = new ArrayList<MyTestListener.EventData>();
-
- final LifecycleListener listener = new LifecycleListener(_wsContext
- .getWorkspace());
- final MyTestListener tester = new MyTestListener(_wsContext, listener);
- final IFile newFile = _project.getFile(file
- .getProjectRelativePath().removeLastSegments(1).append(
- "NewFileName"));
- final IResourceChangeEvent event = _factory.createSimpleFileRename(
- file, newFile);
- // we shouldn't expect an event because there are no resources
- // registered
- tester.fireAndExpectNull(event);
- EventData oldFileChange = new EventData(file,
- EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_MOVED);
- listener.addResource(file);
- eventData.add(oldFileChange);
- tester.fireAndExpect(event, eventData);
- listener.addResource(newFile);
- eventData.add(new EventData(newFile,
- EventType.RESOURCE_ADDED, ReasonType.RESOURCE_MOVED));
- tester.fireAndExpect(event, eventData);
- listener.removeResource(file);
- listener.removeResource(newFile);
- eventData.clear();
-
- eventData.add(new EventData(file,
- EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_MOVED_CONTAINER));
- eventData.add(new EventData(newFile, EventType.RESOURCE_ADDED,
- ReasonType.RESOURCE_MOVED_CONTAINER));
- listener.addResource(file.getParent());
- tester.fireAndExpect(event,
- eventData);
-
- // now remove and verify we no longer get the event.
- listener.removeListener(tester);
- tester.fireAndExpectNull(event);
- }
-
-// /**
-// * Move a folder from one place to another
-// */
-// @Test
-// public void testMoveFolderIn()
-// {
-// final LifecycleListener listener = new LifecycleListener(_wsContext
-// .getWorkspace());
-// final MyTestListener tester = new MyTestListener(_wsContext, listener);
-// final IFolder newFolder = _project.getFolder("/someOtherFolder");
-// final IResourceChangeEvent event = _factory.createSimpleFolderRename(
-// _folderInFolder, newFolder);
-// // we shouldn't expect an event because there are no resources
-// // registered
-// tester.fireAndExpectNull(event);
-// EventData oldFolderChange = new EventData(_folderInFolder,
-// EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_MOVED);
-// listener.addResource(_folderInFolder);
-// tester.fireAndExpect(event, Collections.singletonList(oldFolderChange));
-// listener.removeResource(_folderInFolder);
-//
-// List<EventData> eventData = new ArrayList<MyTestListener.EventData>();
-// eventData.add(new EventData(_folderInFolder,
-// EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_MOVED_CONTAINER));
-// eventData.add(new EventData(newFolder, EventType.RESOURCE_ADDED,
-// ReasonType.RESOURCE_MOVED_CONTAINER));
-// listener.addResource(_folderInFolder.getParent());
-// tester.fireAndExpect(event,
-// eventData);
-//
-// // now remove and verify we no longer get the event.
-// listener.removeListener(tester);
-// tester.fireAndExpectNull(event);
-// }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/LifecycleStressTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/LifecycleStressTest.java
deleted file mode 100644
index 4f647dc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/LifecycleStressTest.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsf.common.internal.ITestTracker;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.PerfTracker;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class LifecycleStressTest extends TestCase
-{
- private final static int NUM_PROJECTS = 50;
- private final static int NUM_FILES = 100;
-
- private Map<IProject, List<IFile>> _resources;
- private LifecycleListener _listener;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _resources = new HashMap<IProject, List<IFile>>();
- _listener = new LifecycleListener(ResourcesPlugin.getWorkspace());
-
- for (int i = 0; i < NUM_PROJECTS; i++)
- {
- final WebProjectTestEnvironment webProjectTestEnv =
- new WebProjectTestEnvironment(getProjectName(getName(), i));
- webProjectTestEnv.createProject(false);
- assertNotNull(webProjectTestEnv);
- assertNotNull(webProjectTestEnv.getTestProject());
- assertTrue(webProjectTestEnv.getTestProject().isAccessible());
-
- final List<IFile> list = new ArrayList<IFile>();
-
- for (int j = 0; j < NUM_FILES; j++)
- {
- final IFile file =
- (IFile) webProjectTestEnv.loadResourceInWebRoot(
- TestsPlugin.getDefault().getBundle(),
- "/testfiles/jsps/testdata1.jsp.data",
- "/testdata_" + j + ".jsp");
-
- list.add(file);
- _listener.addResource(file);
- }
- _resources.put(webProjectTestEnv.getTestProject(), list);
- }
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- for (final IProject project : _resources.keySet())
- {
- try
- {
- project.close(null);
- project.delete(true, null);
- }
- catch (final CoreException ce)
- {
- ce.printStackTrace(System.err);
- }
- }
-
- _resources.clear();
- }
-
- public void testChanges() throws Exception
- {
- final int NUM_ITERATIONS = 1000;
- final int[] projectIdx = new int[NUM_ITERATIONS];
- final int[] fileIdx = new int[NUM_ITERATIONS];
-
- final Random random = new Random();
-
- for (int i = 0; i < NUM_ITERATIONS; i++)
- {
- projectIdx[i] = random.nextInt(NUM_PROJECTS);
- fileIdx[i] = random.nextInt(NUM_FILES);
- }
-
- traceIntArray(System.out, "Project sequence: ", projectIdx);
- traceIntArray(System.out, "File sequence: ", fileIdx);
-
- final LifecycleTestTracker tracker = new LifecycleTestTracker(NUM_ITERATIONS);
- _listener.setTestTracker(tracker);
-
- for (int i = 0; i < NUM_ITERATIONS; i++)
- {
- final IProject project =
- ResourcesPlugin.getWorkspace().getRoot().getProject(
- getProjectName(getName(), projectIdx[i]));
- final List<IFile> fileList = _resources.get(project);
- final MockListener listener = new MockListener();
- _listener.addListener(listener);
-
- // simulates a content change
- fileList.get(fileIdx[i]).touch(null);
-
- listener.assertAcceptedEvent(fileList.get(fileIdx[i]),
- EventType.RESOURCE_CHANGED,
- ReasonType.RESOURCE_CHANGED_CONTENTS);
- _listener.removeListener(listener);
- }
-
- tracker.report(System.out);
- }
-
- private String getProjectName(final String testName, final int idx)
- {
- return getClass().getName() + "_" + testName + idx;
- }
-
- private void traceIntArray(final PrintStream stream, final String prefix,
- final int[] intArray)
- {
- stream.print(prefix);
-
- for (int i = 0; i < intArray.length - 1; i++)
- {
- stream.print(intArray[i] + ",");
- }
-
- stream.print(intArray[intArray.length - 1]);
- stream.print("\n");
- }
-
- private static class LifecycleTestTracker implements ITestTracker
- {
- private final PerfTracker _resourceChangedTimes;
- // private final PerfTracker _findMemberTimes;
-
- private long _lastResourceChangedId;
- // private long _lastFindMemberChangedId;
- private long _curResourceChangedTime;
-
- // private long _curFindMemberChangedTime;
-
- public LifecycleTestTracker(final int numberOfDataPoints)
- {
- _resourceChangedTimes =
- new PerfTracker("ResourceChanged", numberOfDataPoints + 100);
- // _findMemberTimes =
- // new PerfTracker("findMember",
- // numberOfDataPoints*NUM_FILES*NUM_PROJECTS+100);
- }
-
- public void fireEvent(final Event event, final long seqId,
- final String eventLabel)
- {
- // get the current as quickly as possible
- final long curTime = System.nanoTime();
-
- switch (event)
- {
- case START_TRACKING:
- if ("trackMethod_resourceChanged".equals(eventLabel))
- {
- _curResourceChangedTime = curTime;
- _lastResourceChangedId = seqId;
- }
- else if ("testFindMember".equals(eventLabel))
- {
- // _curFindMemberChangedTime = curTime;
- // _lastFindMemberChangedId = seqId;
- }
- break;
-
- case STOP_TRACKING:
- if ("trackMethod_resourceChanged".equals(eventLabel))
- {
- assertEquals(_lastResourceChangedId, seqId);
- _resourceChangedTimes.recordTime(curTime
- - _curResourceChangedTime);
- }
- else if ("testFindMember".equals(eventLabel))
- {
- // assertEquals(_lastFindMemberChangedId, seqId);
- // _findMemberTimes.recordTime(curTime -
- // _curFindMemberChangedTime);
- }
- break;
- }
- }
-
- public void report(final PrintStream stream)
- {
- _resourceChangedTimes.printReport(System.out);
- // _findMemberTimes.printReport(System.out);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MockListener.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MockListener.java
deleted file mode 100644
index f7899cf..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MockListener.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.common.internal.resource.EventResult;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-
-class MockListener implements IResourceLifecycleListener
-{
- private List<ResourceLifecycleEvent> _acceptedEvents =
- new ArrayList<ResourceLifecycleEvent>();
-
- public EventResult acceptEvent(ResourceLifecycleEvent event)
- {
- _acceptedEvents.add(event);
- return new EventResult();
- }
-
- public void assertAcceptedResourceInaccessible(final IResource res, final ReasonType reason)
- {
- assertAcceptedEvent(res, EventType.RESOURCE_INACCESSIBLE, reason);
- }
-
- public void assertNoAcceptedResourceInaccessible(final IResource res, final ReasonType reason)
- {
- assertNoAcceptedEvent(res, EventType.RESOURCE_INACCESSIBLE, reason);
- }
-
- public void assertNoAcceptedEvent(final IResource res, final EventType eventType, final ReasonType reason)
- {
- for (ResourceLifecycleEvent event : _acceptedEvents)
- {
- if (event.getEventType() == eventType
- && event.getAffectedResource().equals(res))
- {
- if (reason == event.getReasonType())
- {
- TestLifecycleListener.fail("Expected not to find RESOURCE_INACCESSIBLE event for resource: "+res.toString()); }
- }
- }
- }
-
- public void assertAcceptedEvent(final IResource res, final EventType eventType, final ReasonType reason)
- {
- for (ResourceLifecycleEvent event : _acceptedEvents)
- {
- if (event.getEventType() == eventType
- && event.getReasonType() == reason
- && event.getAffectedResource().equals(res))
- {
- if (reason == event.getReasonType())
- {
- return;
- }
- else
- {
- // this output is diagnostic and doesn't necessarily
- // indicate a problem
- System.out.printf("Expected event found with different result: %s instead of %s", event.getReasonType().toString(), reason.toString());
- }
- }
- }
-
- // if we get to here then we have failed to find the expected
- // event
- TestLifecycleListener.fail("Expected to find" + eventType + " event, reason "+reason+" for resource: "+res.toString());
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MyTestListener.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MyTestListener.java
deleted file mode 100644
index 88c4965..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MyTestListener.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.jst.jsf.common.internal.resource.EventResult;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-
-class MyTestListener extends AbstractTestListener<ResourceLifecycleEvent> implements IResourceLifecycleListener
-{
- private final List<EventData> _events = new ArrayList<EventData>();
- private final MockWorkspaceContext _wsContext;
-
- public MyTestListener(final MockWorkspaceContext wsContext)
- {
- _wsContext = wsContext;
- }
-
- public MyTestListener(final MockWorkspaceContext wsContext,
- final LifecycleListener listener)
- {
- listener.addListener(this);
- _wsContext = wsContext;
- }
-
- public EventResult acceptEvent(final ResourceLifecycleEvent event)
- {
- _events.add(new EventData(event));
- return EventResult.getDefaultEventResult();
- }
-
- public void fireAndExpect(final IResourceChangeEvent fire,
- final List<EventData> expectedData)
- {
- fireEvent(fire);
- assertEquals(expectedData.size(), _events.size());
- for (final EventData data : expectedData)
- {
- data.assertContainedIn(_events);
- }
- }
-
- public void fireAndExpect(final IResourceChangeEvent fire,
- final IResource expectedResource, final EventType eventType,
- final ReasonType reasonType)
- {
- fireAndExpect(fire, Collections.singletonList(new EventData(
- expectedResource, eventType, reasonType)));
- }
-
- public void fireAndExpectNull(final IResourceChangeEvent fire)
- {
- fireEvent(fire);
- assertTrue(_events.isEmpty());
- }
-
- protected void fireEvent(final IResourceChangeEvent event)
- {
- _events.clear();
- _wsContext.fireWorkspaceEvent(event);
- }
-
- public static class EventData
- {
- private final IResource _expectedResource;
- private final EventType _eventType;
- private final ReasonType _reasonType;
-
- public EventData(final IResource expectedResource,
- final EventType eventType, final ReasonType reasonType)
- {
- super();
- _expectedResource = expectedResource;
- _eventType = eventType;
- _reasonType = reasonType;
- }
-
- public EventData(final ResourceLifecycleEvent event)
- {
- this(event.getAffectedResource(), event.getEventType(), event.getReasonType());
- }
-
- public final IResource getExpectedResource()
- {
- return _expectedResource;
- }
-
- public final EventType getEventType()
- {
- return _eventType;
- }
-
- public final ReasonType getReasonType()
- {
- return _reasonType;
- }
-
- public void assertContainedIn(final List<EventData> events)
- {
- for (final EventData event : events)
- {
- if (isEqual(event))
- {
- return;
- }
- }
- Assert.fail("Event not found in list: "+this.toString());
- }
-
- public boolean isEqual(final EventData eventData)
- {
- return (_expectedResource.equals(eventData.getExpectedResource())
- &&( _eventType == eventData.getEventType())
- && (_reasonType == eventData.getReasonType()));
- }
-
- public String toString()
- {
- return String.format("Resource: %s, Event Type: %s, ReasonType: %s",
- _expectedResource, _eventType, _reasonType);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestDefaultJarLocator.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestDefaultJarLocator.java
deleted file mode 100644
index 0eb8e13..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestDefaultJarLocator.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-
-import java.io.File;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jst.jsf.common.internal.resource.ClasspathJarFile;
-import org.eclipse.jst.jsf.common.internal.resource.DefaultJarLocator;
-import org.eclipse.jst.jsf.common.internal.resource.IJarLocator.JarChangeEvent;
-import org.eclipse.jst.jsf.common.internal.resource.IJarLocator.JarChangeEvent.Type;
-import org.eclipse.jst.jsf.common.internal.resource.IJarLocator.JarChangeListener;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJDTWorkspaceContext;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaCoreMediator;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaProject;
-import org.eclipse.jst.jsf.test.util.mock.java.MockPackageFragmentRoot;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestDefaultJarLocator
-{
- private MockWorkspaceContext _wsContext;
- private MockProject _project;
- private MockJavaChangeEventFactory _factory;
- private MockJDTWorkspaceContext _jdtContext;
- private MockJavaProject _javaProject;
-
- @Before
- public void setUp() throws Exception
- {
- _wsContext = new MockWorkspaceContext();
- _project = _wsContext.createProject("SomeTestProject");
- _jdtContext = new MockJDTWorkspaceContext(_wsContext);
- _factory = new MockJavaChangeEventFactory(_jdtContext);
- _jdtContext.createCPELibraryInProject(_project, new Path(
- "/WEB-INF/WebContent/lib/nocareContents.jar"), new File(
- "./testfiles/faces-all-bogus.jar"));
- _javaProject = _jdtContext.createJavaProject(_project);
- }
-
- @Test
- public void testStart() throws Exception
- {
- final DefaultJarLocator jarLocator = new DefaultJarLocator(
- new MockJavaCoreMediator(_jdtContext));
- jarLocator.start(_project);
- }
-
- @Test
- public void testLocate()
- {
- final DefaultJarLocator jarLocator = new DefaultJarLocator(
- new MockJavaCoreMediator(_jdtContext));
- jarLocator.start(_project);
- Collection<? extends ClasspathJarFile> locate = jarLocator.locate(_project);
- assertEquals(1, locate.size());
- Collection<? extends ClasspathJarFile> jars = jarLocator.getJars(_project);
- assertEquals(1, locate.size());
- assertEquals(locate, jars);
- }
-
- @Test
- public void testAddJar()
- {
- final DefaultJarLocator jarLocator = new DefaultJarLocator(
- new MockJavaCoreMediator(_jdtContext));
- jarLocator.start(_project);
- final JarChangeEvent[] trappedEvents = new JarChangeEvent[1];
- jarLocator.addListener(new JarChangeListener()
- {
- @Override
- public void changed(final JarChangeEvent event)
- {
- trappedEvents[0] = event;
- }
- });
- IPackageFragmentRoot fragRoot = new MockPackageFragmentRoot(
- _javaProject, new Path(
- "/WebContent/WEB-INF/lib/my.jar"));
- final ElementChangedEvent event = _factory.createSimpleJarAdded(
- _project, fragRoot);
- _jdtContext.fireElementChangedEvent(event);
- assertNotNull(trappedEvents[0]);
- assertEquals(Type.JAR_ADDED, trappedEvents[0].getType());
- assertEquals("/WebContent/WEB-INF/lib/my.jar", trappedEvents[0]
- .getJar().getPath().toString());
- }
-
- @Test
- public void testRemoveJar()
- {
- final DefaultJarLocator jarLocator = new DefaultJarLocator(
- new MockJavaCoreMediator(_jdtContext));
- jarLocator.start(_project);
- final JarChangeEvent[] trappedEvents = new JarChangeEvent[1];
- jarLocator.addListener(new JarChangeListener()
- {
- @Override
- public void changed(final JarChangeEvent event)
- {
- trappedEvents[0] = event;
- }
- });
- IPackageFragmentRoot fragRoot = new MockPackageFragmentRoot(
- _javaProject, new Path(
- "/WebContent/WEB-INF/lib/my.jar"));
- final ElementChangedEvent event = _factory.createSimpleJarRemoved(
- _project, fragRoot);
- _jdtContext.fireElementChangedEvent(event);
- assertNotNull(trappedEvents[0]);
- assertEquals(Type.JAR_REMOVED, trappedEvents[0].getType());
- assertEquals("/WebContent/WEB-INF/lib/my.jar", trappedEvents[0]
- .getJar().getPath().toString());
- }
-
- @Test(expected = IllegalStateException.class)
- public void testLocateWithoutStart()
- {
- final DefaultJarLocator jarLocator = new DefaultJarLocator(
- new MockJavaCoreMediator(_jdtContext));
- jarLocator.locate(_project);
- }
-
- @Test(expected = IllegalStateException.class)
- public void testGetJarsWithoutStart()
- {
- final DefaultJarLocator jarLocator = new DefaultJarLocator(
- new MockJavaCoreMediator(_jdtContext));
- jarLocator.getJars(_project);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestLifecycleListener.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestLifecycleListener.java
deleted file mode 100644
index 54b6eea..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestLifecycleListener.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsf.common.internal.resource.EventResult;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestLifecycleListener extends TestCase
-{
- private WebProjectTestEnvironment _webProjectTestEnv;
- private IResource _res1;
- private IResource _res2;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- _webProjectTestEnv = new WebProjectTestEnvironment(
- getClass().getName()+"_" + getName());
- _webProjectTestEnv.createProject(false);
- assertNotNull(_webProjectTestEnv);
- assertNotNull(_webProjectTestEnv.getTestProject());
- assertTrue(_webProjectTestEnv.getTestProject().isAccessible());
-
- _res1 = _webProjectTestEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/jsps/testdata1.jsp.data", "/testdata1.jsp");
- _res2 = _webProjectTestEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/jsps/testdata1.jsp.data", "/testdata2.jsp");
- }
-
- private void testInaccessibleCondition(IResource res, Runnable runnable, ReasonType reason)
- {
- assertTrue(res.isAccessible());
-
- LifecycleListener testListener = new LifecycleListener(res, ResourcesPlugin.getWorkspace());
- MockListener mockListener = new MockListener();
- testListener.addListener(mockListener);
-
- runnable.run();
-
- mockListener.assertAcceptedResourceInaccessible(res, reason);
- assertFalse(res.isAccessible());
-
- testListener.removeListener(mockListener);
- testListener.dispose();
- }
-
- private void testInaccessibleConditionMultiple(List<IResource> resources, Runnable runnable, List<ReasonType> reasons)
- {
- assertEquals(resources.size(), reasons.size());
-
- for (IResource res : resources)
- {
- assertTrue(res.isAccessible());
- }
-
- LifecycleListener testListener = new LifecycleListener(resources, ResourcesPlugin.getWorkspace());
- MockListener mockListener = new MockListener();
- testListener.addListener(mockListener);
-
- runnable.run();
-
- for (int i = 0; i < resources.size(); i++)
- {
- final IResource res = resources.get(i);
- final ReasonType reason = reasons.get(i);
- mockListener.assertAcceptedResourceInaccessible(res,reason);
- assertFalse(res.isAccessible());
- }
-
- testListener.removeListener(mockListener);
- testListener.dispose();
- }
-
- public void testProjectClosedForProject() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now close the project
- try {
- _webProjectTestEnv.getTestProject().close(null);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- };
- testInaccessibleCondition(_webProjectTestEnv.getTestProject(), runnable, ReasonType.RESOURCE_PROJECT_CLOSED);
- }
-
- public void testProjectClosedForContainedResource() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now close the project
- try {
- _webProjectTestEnv.getTestProject().close(null);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- };
- testInaccessibleCondition(_res1, runnable, ReasonType.RESOURCE_PROJECT_CLOSED);
- }
-
- public void testProjectDeletedForProject() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now delete the project
- try {
- _webProjectTestEnv.getTestProject().delete(true, null);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- };
- testInaccessibleCondition(_webProjectTestEnv.getTestProject(), runnable, ReasonType.RESOURCE_DELETED);
- }
-
- public void testProjectDeletedForContainedResource() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now delete the project
- try
- {
- _webProjectTestEnv.getTestProject().delete(true, null);
- } catch (CoreException e)
- {
- throw new RuntimeException(e);
- }
- }
- };
- testInaccessibleCondition(_res1, runnable, ReasonType.RESOURCE_PROJECT_DELETED);
- }
-
- public void testResourceDeleted() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now delete the resource
- try {
- _res1.delete(true, null);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- };
- testInaccessibleCondition(_res1, runnable, ReasonType.RESOURCE_DELETED);
- }
-
- public void testMultipleResourcesDeleted() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now delete the resource
- try {
- _res1.delete(true, null);
- _res2.delete(true, null);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- };
-
- List<IResource> resources = new ArrayList<IResource>();
- resources.add(_res1);
- resources.add(_res2);
- List<ReasonType> reasons = new ArrayList<ReasonType>();
- reasons.add(ReasonType.RESOURCE_DELETED);
- reasons.add(ReasonType.RESOURCE_DELETED);
- testInaccessibleConditionMultiple(resources, runnable, reasons);
- }
-
- public void testMultipleResourcesProjectClosed() throws Exception
- {
- final Runnable runnable = new Runnable()
- {
- public void run()
- {
- // now delete the resource
- try {
- _res1.getProject().close(null);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
- };
-
- List<IResource> resources = new ArrayList<IResource>();
- resources.add(_res1);
- resources.add(_res2);
- List<ReasonType> reasons = new ArrayList<ReasonType>();
- reasons.add(ReasonType.RESOURCE_PROJECT_CLOSED);
- reasons.add(ReasonType.RESOURCE_PROJECT_CLOSED);
- testInaccessibleConditionMultiple(resources, runnable, reasons);
- }
-
- public void testAddResource() throws Exception
- {
- assertTrue(_res1.isAccessible());
- assertTrue(_res2.isAccessible());
-
- LifecycleListener testListener = new LifecycleListener(_res1, ResourcesPlugin.getWorkspace());
- MockListener mockListener = new MockListener();
- testListener.addListener(mockListener);
- testListener.addResource(_res2);
-
- _res1.getProject().close(null);
-
- mockListener.assertAcceptedResourceInaccessible(_res1, ReasonType.RESOURCE_PROJECT_CLOSED);
- mockListener.assertAcceptedResourceInaccessible(_res2, ReasonType.RESOURCE_PROJECT_CLOSED);
- assertFalse(_res1.isAccessible());
- assertFalse(_res2.isAccessible());
-
- testListener.removeListener(mockListener);
- testListener.dispose();
- }
-
- public void testAddRemoveResource() throws Exception
- {
- assertTrue(_res1.isAccessible());
- assertTrue(_res2.isAccessible());
-
- LifecycleListener testListener = new LifecycleListener(_res1, ResourcesPlugin.getWorkspace());
- MockListener mockListener = new MockListener();
- testListener.addListener(mockListener);
- testListener.addResource(_res2);
- testListener.removeResource(_res1);
-
- _res1.getProject().close(null);
-
- // we removed res1, so should find an event for it
- mockListener.assertNoAcceptedResourceInaccessible(_res1, ReasonType.RESOURCE_PROJECT_CLOSED);
- mockListener.assertAcceptedResourceInaccessible(_res2, ReasonType.RESOURCE_PROJECT_CLOSED);
- assertFalse(_res1.isAccessible());
- assertFalse(_res2.isAccessible());
-
- testListener.removeListener(mockListener);
- testListener.dispose();
- }
-
- public void testRemoveListenerResource() throws Exception
- {
- assertTrue(_res1.isAccessible());
- assertTrue(_res2.isAccessible());
-
- LifecycleListener testListener = new LifecycleListener(_res1, ResourcesPlugin.getWorkspace());
- testListener.addResource(_res2);
- MockListener mockListener = new MockListener();
- MockListener mockListener2 = new MockListener();
-
- testListener.addListener(mockListener);
- testListener.addListener(mockListener2);
- _res1.delete(true, null);
-
- // both listeners should get the event on res1
- mockListener.assertAcceptedResourceInaccessible(_res1, ReasonType.RESOURCE_DELETED);
- mockListener2.assertAcceptedResourceInaccessible(_res1, ReasonType.RESOURCE_DELETED);
- assertFalse(_res1.isAccessible());
-
- // remove the listener for mock2
- testListener.removeListener(mockListener2);
-
- _res2.delete(true, null);
-
- // the first mockListener should get it
- mockListener.assertAcceptedResourceInaccessible(_res2, ReasonType.RESOURCE_DELETED);
- // the second one was removed before the delete
- // so it should not have accepted an event
- mockListener2.assertNoAcceptedResourceInaccessible(_res2, ReasonType.RESOURCE_DELETED);
- assertFalse(_res2.isAccessible());
-
- testListener.removeListener(mockListener);
- testListener.dispose();
- }
-
- public void testResourceChangedEvent() throws Exception
- {
- assertTrue(_res1.isAccessible());
- assertTrue(_res2.isAccessible());
-
- LifecycleListener testListener = new LifecycleListener(_res1, ResourcesPlugin.getWorkspace());
- testListener.addResource(_res2);
- MockListener mockListener = new MockListener();
- testListener.addListener(mockListener);
-
- // simulate a content change
- _res1.touch(null);
-
- mockListener.assertAcceptedEvent(_res1, EventType.RESOURCE_CHANGED, ReasonType.RESOURCE_CHANGED_CONTENTS);
-
- testListener.removeListener(mockListener);
- testListener.dispose();
- }
-
- public void testDisposeAfterEvent() throws Exception
- {
- LifecycleListener testListener = new LifecycleListener(_res1, ResourcesPlugin.getWorkspace());
- MockListenerThatDoesDispose mockListener = new MockListenerThatDoesDispose();
- testListener.addListener(mockListener);
-
- _res1.delete(true, null);
-
- assertTrue(testListener.isDisposed());
-
- boolean caughtAssertion = false;
- try
- {
- testListener.addListener(mockListener);
- }
- catch (IllegalStateException ae)
- {
- caughtAssertion = true;
- }
-
- assertTrue(caughtAssertion);
- }
-
- /**
- * A mock object that tests the disposeAfterEvent flag.
- * @author cbateman
- *
- */
- private class MockListenerThatDoesDispose implements IResourceLifecycleListener
- {
- public EventResult acceptEvent(ResourceLifecycleEvent event)
- {
- EventResult result = EventResult.getDisposeAfterEventResult();
- return result;
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestResourceTracker.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestResourceTracker.java
deleted file mode 100644
index 66f5372..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestResourceTracker.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.resource;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.internal.resource.LifecycleListener;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceTracker;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockFile;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockResourceChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestResourceTracker
-{
-
- private static class TestableResourceTracker extends
- ResourceTracker<IResource>
- {
- private boolean _inAccessibleFired;
- private ReasonType _inAccessibleReason;
- private boolean _changeFired;
- private ReasonType _changeReason;
- private boolean _addFired;
- private List<ReasonType> _addReason = new ArrayList<ReasonType>();
-
- public TestableResourceTracker(final IResource resource)
- {
- super(resource);
- }
-
- @Override
- protected void fireResourceInAccessible(final IResource resource, final ReasonType reasonType)
- {
- _inAccessibleFired = true;
- _inAccessibleReason = reasonType;
- }
-
- @Override
- protected void fireResourceChanged(final IResource resource, final ReasonType reasonType)
- {
- _changeFired = true;
- _changeReason = reasonType;
- }
-
- @Override
- protected void fireResourceAdded(final IResource affectedResource,
- final ReasonType reasonType)
- {
- _addFired = true;
- _addReason.add(reasonType);
- }
-
- public final boolean isInAccessibleFired()
- {
- return _inAccessibleFired;
- }
-
- public final ReasonType getInAccessibleReason()
- {
- return _inAccessibleReason;
- }
-
- public final boolean isChangeFired()
- {
- return _changeFired;
- }
-
- public final ReasonType getChangeReason()
- {
- return _changeReason;
- }
-
- public final boolean isAddFired()
- {
- return _addFired;
- }
-
- public final List<ReasonType> getAddReason()
- {
- return _addReason;
- }
-
- }
-
- private MockResourceChangeEventFactory _eventFactory;
- private MockWorkspaceContext _wsContext;
- private MockFile _testResource;
- private TestableResourceTracker _resourceTracker;
- private LifecycleListener _lifecycleListener;
- private MockFile _uninterestedInRes;
-
- @Before
- public void setUp() throws Exception
- {
- _wsContext = new MockWorkspaceContext();
- _eventFactory = new MockResourceChangeEventFactory(_wsContext);
- final MockProject createProject = _wsContext.createProject(new Path(
- "TestResourceTracker_Project"));
- _testResource = (MockFile) createProject
- .getFile("/WebContent/resources/foo/resource/somelib/foo.xhtml");
- _uninterestedInRes = (MockFile) createProject
- .getFile("/WebContent/resources/foo/resource/uninterestedInMe/foo.xhtml");
- _resourceTracker = new TestableResourceTracker(_testResource);
- _lifecycleListener = new LifecycleListener(_wsContext.getWorkspace());
- _lifecycleListener.addListener(_resourceTracker);
- _lifecycleListener.addResource(_testResource);
- _lifecycleListener.addResource(_uninterestedInRes);
- }
-
- @After
- public void tearDown()
- {
- _resourceTracker.dispose();
- }
-
- @Test
- public void testGetResource()
- {
- assertSame(_testResource, _resourceTracker.getResource());
- }
-
- @Test
- public void testGetLastModifiedStamp()
- {
- assertEquals(0, _resourceTracker.getLastModifiedStamp());
- }
-
- @Test
- public void testFireResourceInAccessible()
- {
- final IResourceChangeEvent event = _eventFactory
- .createSimpleProjectDeleted((MockProject) _testResource
- .getProject());
- _wsContext.fireWorkspaceEvent(event);
- assertTrue(_resourceTracker.isInAccessibleFired());
- assertEquals(ReasonType.RESOURCE_PROJECT_DELETED, _resourceTracker
- .getInAccessibleReason());
- assertFalse(_resourceTracker.isAddFired());
- assertFalse(_resourceTracker.isChangeFired());
- }
-
- @Test
- public void testFireResourceChanged()
- {
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileChange(_testResource, true);
- _wsContext.fireWorkspaceEvent(event);
- assertTrue(_resourceTracker.isChangeFired());
- assertEquals(ReasonType.RESOURCE_CHANGED_CONTENTS, _resourceTracker
- .getChangeReason());
- assertFalse(_resourceTracker.isAddFired());
- assertFalse(_resourceTracker.isInAccessibleFired());
- }
-
- @Test
- public void testFireResourceAdded()
- {
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileAdded(_testResource);
- _wsContext.fireWorkspaceEvent(event);
- assertTrue(_resourceTracker.isAddFired());
- assertEquals(1, _resourceTracker.getAddReason().size());
- assertEquals(ReasonType.RESOURCE_ADDED, _resourceTracker.getAddReason().get(0));
- assertFalse(_resourceTracker.isInAccessibleFired());
- assertFalse(_resourceTracker.isChangeFired());
- }
-
- @Test
- public void testResourceFilter()
- {
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileChange(_uninterestedInRes, true);
- _wsContext.fireWorkspaceEvent(event);
- assertFalse(_resourceTracker.isInAccessibleFired());
- assertFalse(_resourceTracker.isAddFired());
- assertFalse(_resourceTracker.isChangeFired());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/sanity/TestJSFFacetedTestEnvironment.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/sanity/TestJSFFacetedTestEnvironment.java
deleted file mode 100644
index 13d0812..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/sanity/TestJSFFacetedTestEnvironment.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.sanity;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-import junit.framework.TestCase;
-
-/**
- * This is a sanity test for the utility calss JSFFactedTestEnvironment and is
- * not mean to be run as part of the application test suite.
- *
- * @author cbateman
- *
- */
-public class TestJSFFacetedTestEnvironment extends TestCase
-{
- /**
- * Test creation of a basic JSF 1.1 faceted test environment
- * @throws Exception
- */
- public void testVersion_1_1_Facet() throws Exception
- {
- WebProjectTestEnvironment webTestEnv = new WebProjectTestEnvironment(getName());
- webTestEnv.createProject(false);
-
- JSFFacetedTestEnvironment testEnv = new JSFFacetedTestEnvironment(webTestEnv);
- testEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
- /**
- * Test creation of a basic JSF 1.1 faceted test environment
- * @throws Exception
- */
- public void testVersion_1_2_Facet() throws Exception
- {
- WebProjectTestEnvironment webTestEnv = new WebProjectTestEnvironment(getName());
- webTestEnv.createProject(false);
-
- JSFFacetedTestEnvironment testEnv = new JSFFacetedTestEnvironment(webTestEnv);
- testEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_2);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/serialization/TLDAttributeSerializationTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/serialization/TLDAttributeSerializationTests.java
deleted file mode 100644
index ba2e9f9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/serialization/TLDAttributeSerializationTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.serialization;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.eclipse.jst.jsf.core.tests.mock.MockTLDAttributeDeclaration;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDTagAttribute;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TLDAttributeSerializationTests
-{
- private MockTLDAttributeDeclaration _decl;
- private TLDTagAttribute _attribute;
-
- @Before
- public void setUp() throws Exception
- {
-
- _decl = new MockTLDAttributeDeclaration("mockAttr", "mockDesc", "mockId", true);
- _attribute = new TLDTagAttribute(_decl);
- }
-
- @Test
- public void testWriteRead() throws Exception
- {
- assertFalse(_attribute.hasBeenDeserialized());
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- ObjectOutputStream serializationStream = new ObjectOutputStream(stream);
- serializationStream.writeObject(_attribute);
- ByteArrayInputStream inStream = new ByteArrayInputStream(stream.toByteArray());
- ObjectInputStream deserializeStream = new ObjectInputStream(inStream);
- Object readObject = deserializeStream.readObject();
- assertNotNull(readObject);
- assertTrue(readObject instanceof TLDTagAttribute);
- TLDTagAttribute tagAttribute = (TLDTagAttribute) readObject;
- assertEquals("mockAttr", tagAttribute.getName());
- assertEquals("mockDesc", tagAttribute.getDescription());
- assertEquals(true, tagAttribute.isRequired());
- assertTrue(tagAttribute.hasBeenDeserialized());
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/ConcreteAxiomaticSetTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/ConcreteAxiomaticSetTest.java
deleted file mode 100644
index 3c4ee0a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/ConcreteAxiomaticSetTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.ConcreteAxiomaticSet;
-
-public class ConcreteAxiomaticSetTest extends TestCase
-{
- AxiomaticSet _primaryColours;
- AxiomaticSet _secondaryColours;
- AxiomaticSet _allMainColours;
-
- AxiomaticSet _palette;
- AxiomaticSet _overlappingSet;
- AxiomaticSet _emptySet;
-
- @SuppressWarnings("unchecked")
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // make concreteSet1 disjoint with concreteSet2 and non-disjoint with concrete3
-
- _emptySet = new ConcreteAxiomaticSet();
-
- _primaryColours = new ConcreteAxiomaticSet();
- _primaryColours.add("blue");
- _primaryColours.add("red");
- _primaryColours.add("yellow");
-
- _secondaryColours = new ConcreteAxiomaticSet();
- _secondaryColours.add("green");
- _secondaryColours.add("purple");
- _secondaryColours.add("orange");
-
- _allMainColours = new ConcreteAxiomaticSet();
- _allMainColours.add("blue");
- _allMainColours.add("red");
- _allMainColours.add("yellow");
- _allMainColours.add("green");
- _allMainColours.add("purple");
- _allMainColours.add("orange");
-
- _palette = new ConcreteAxiomaticSet();
- _palette.add("blue");
- _palette.add("green");
- _palette.add("burgundy");
-
- _overlappingSet = new ConcreteAxiomaticSet();
- _overlappingSet.add("blue");
- _overlappingSet.add("red");
- _overlappingSet.add("yellow");
- _overlappingSet.add("green");
- _overlappingSet.add("purple");
- _overlappingSet.add("burgundy");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- _primaryColours = null;
- _secondaryColours = null;
- _palette = null;
- _emptySet = null;
- }
-
- public void testIntersect()
- {
- // intersect the empty is set an identity
- assertTrue(_primaryColours.intersect(_secondaryColours).isEmpty());
-
- // non-disjoint intersection not empty
- assertFalse(_primaryColours.intersect(_palette).isEmpty());
- assertEquals(1, _primaryColours.intersect(_palette).size());
- assertEquals("blue", _primaryColours.intersect(_palette).getFirstElement());
-
- // intersection is commutative
- assertEquals(_primaryColours.intersect(_palette), _palette.intersect(_primaryColours));
- //intersection is associative
- assertEquals(_primaryColours.intersect(_overlappingSet).intersect(_palette)
- , _overlappingSet.intersect(_palette).intersect(_primaryColours));
-
- // intersection of disjoint sets are empty
- assertTrue(_primaryColours.intersect(_secondaryColours).isEmpty());
-
- // intersection of subset of a set with the set is the subset
- assertEquals(_primaryColours, _allMainColours.intersect(_primaryColours));
- assertEquals(_secondaryColours, _allMainColours.intersect(_secondaryColours));
- }
-
- public void testIsEquivalent()
- {
- // identity: a set is equal to itself
- assertTrue(_primaryColours.isEquivalent(_primaryColours));
-
- // two unequal sets are not equivalent
- assertFalse(_primaryColours.isEquivalent(_secondaryColours));
- }
-
- public void testUnion()
- {
- // union with empty is identity
- assertEquals(_primaryColours, _primaryColours.union(_emptySet));
-
- // primary and secondary union to allMain
- assertEquals(_allMainColours, _primaryColours.union(_secondaryColours));
-
- // union is commutative
- assertEquals(_primaryColours.union(_secondaryColours)
- , _secondaryColours.union(_primaryColours));
- // union is associative
- assertEquals(_primaryColours.union(_secondaryColours).union(_overlappingSet),
- _secondaryColours.union(_overlappingSet).union(_primaryColours));
- }
-
- public void testIsDisjoint() {
- // primary colours and secondary have no common elements
- assertTrue(_primaryColours.isDisjoint(_secondaryColours));
-
- // all sets are disjoint with the empty set
- assertTrue(_primaryColours.isDisjoint(_emptySet));
- assertTrue(_secondaryColours.isDisjoint(_emptySet));
- assertTrue(_emptySet.isDisjoint(_allMainColours));
-
- // subset is not disjoint with set
- assertFalse(_primaryColours.isDisjoint(_allMainColours));
- }
-
- public void testGetFirstElement()
- {
- // TODO:
- }
-
- public void testSubtract() {
- // A - B = A if A and B are disjoint
- assertEquals(_primaryColours, _primaryColours.subtract(_secondaryColours));
-
- // A - B = C where A = B U C and B and C are disjoint
- assertEquals(_secondaryColours, _allMainColours.subtract(_primaryColours));
- assertEquals(_primaryColours, _allMainColours.subtract(_secondaryColours));
-
- // A - B = A if B is empty
- assertEquals(_secondaryColours, _secondaryColours.subtract(_emptySet));
-
- AxiomaticSet remainder = _allMainColours.subtract(_overlappingSet);
- assertEquals(1, remainder.size());
- assertTrue(remainder.contains("orange"));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/NodeSetTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/NodeSetTest.java
deleted file mode 100644
index 96ed6ab..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/NodeSetTest.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.set;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.set.mapping.ElementToTagIdentifierMapping;
-import org.eclipse.jst.jsf.core.tagmatcher.XPathMatchingAlgorithm;
-import org.eclipse.jst.jsf.core.tests.tagmatcher.BaseTagMatcherTestCase;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-
-public class NodeSetTest extends BaseTagMatcherTestCase
-{
- private AxiomaticSet _ancestorsOfInputText;
- private AxiomaticSet _ancestorsOfCommandButton;
- private AxiomaticSet _ancestorsOfOutputText;
- private AxiomaticSet _inputTextSingletonSet;
-
- @Override
- protected void setUp() throws Exception
- {
- _srcFileName = "/testfiles/jsps/testdata1.jsp.data";
- _destFileName = "/testdata1.jsp";
-
- super.setUp();
-
- _ancestorsOfInputText = getAncestorsOf("/view/html/body/form/panelGrid/inputText", 5);
- _ancestorsOfCommandButton = getAncestorsOf("/view/html/body/form/commandButton", 4);
- _ancestorsOfOutputText = getAncestorsOf("/view/html/body/form/h1/outputText", 5);
-
- Document doc = ((IDOMModel)_structuredModel).getDocument();
- XPathMatchingAlgorithm matcher = new XPathMatchingAlgorithm("/view/html/body/form/panelGrid/inputText");
- _inputTextSingletonSet = matcher.evaluate(doc);
- assertEquals(1, _inputTextSingletonSet.size());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testIntersect()
- {
- AxiomaticSet set1 =
- _ancestorsOfInputText.intersect(_ancestorsOfCommandButton);
- set1 = new ElementToTagIdentifierMapping().map(set1);
- assertEquals(4, set1.size());
- assertTrue(set1.contains(IJSFConstants.TAG_IDENTIFIER_FORM));
- assertTrue(set1.contains(IJSFConstants.TAG_IDENTIFIER_VIEW));
- // should not contain panelgrid because command button not in it
- assertFalse(set1.contains(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID));
-
- AxiomaticSet set2 =
- _ancestorsOfOutputText.intersect(_ancestorsOfCommandButton);
- set2 = new ElementToTagIdentifierMapping().map(set2);
- assertEquals(4, set2.size());
- assertTrue(set2.contains(IJSFConstants.TAG_IDENTIFIER_FORM));
- assertTrue(set2.contains(IJSFConstants.TAG_IDENTIFIER_VIEW));
-
- // result is same as command button's ancestors, but output text
- // has an additional h1 ancestor
- assertFalse(set2.equals(new ElementToTagIdentifierMapping().map(_ancestorsOfOutputText)));
- assertTrue(set2.equals(new ElementToTagIdentifierMapping().map(_ancestorsOfCommandButton)));
- }
-
- public void testIsEquivalent() throws Exception
- {
- // this == compareTo
- assertTrue(_ancestorsOfInputText.isEquivalent(_ancestorsOfInputText));
-
- // this._data == compareTo._data
- //assertTrue(_ancestorsOfInputText.isEquivalent((AxiomaticSet) ((NodeSet)_ancestorsOfInputText).clone()));
-
- // this.size() != compareTo.size();
- assertFalse(_ancestorsOfInputText.isEquivalent(_ancestorsOfCommandButton));
-
- // this.size() == compareTo.size() but contents not same
- assertFalse(_ancestorsOfInputText.isEquivalent(_ancestorsOfOutputText));
-
- // this.size() == compareTo.size() AND contents same
- assertTrue(_ancestorsOfInputText.isEquivalent(getAncestorsOf("/view/html/body/form/panelGrid/inputText", -1)));
- }
-
- public void testUnion()
- {
- AxiomaticSet set1 =
- _ancestorsOfInputText.union(_ancestorsOfCommandButton);
- set1 = new ElementToTagIdentifierMapping().map(set1);
- assertEquals(5, set1.size());
- assertTrue(set1.contains(IJSFConstants.TAG_IDENTIFIER_FORM));
- assertTrue(set1.contains(IJSFConstants.TAG_IDENTIFIER_VIEW));
- assertTrue(set1.contains(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID));
-
- AxiomaticSet set2 =
- _ancestorsOfOutputText.union(_ancestorsOfCommandButton);
- set2 = new ElementToTagIdentifierMapping().map(set2);
- assertEquals(5, set2.size());
- assertTrue(set2.contains(IJSFConstants.TAG_IDENTIFIER_FORM));
- assertTrue(set2.contains(IJSFConstants.TAG_IDENTIFIER_VIEW));
- assertFalse(set2.contains(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID));
- }
-
- public void testIsDisjoint()
- {
- assertFalse(_ancestorsOfInputText.isDisjoint(_ancestorsOfCommandButton));
- assertFalse(_ancestorsOfInputText.isDisjoint(_ancestorsOfOutputText));
- assertFalse(_ancestorsOfInputText.isDisjoint(_ancestorsOfInputText));
-
- assertTrue(_ancestorsOfInputText.isDisjoint(_inputTextSingletonSet));
- assertTrue(_ancestorsOfOutputText.isDisjoint(_inputTextSingletonSet));
- assertTrue(_ancestorsOfCommandButton.isDisjoint(_inputTextSingletonSet));
- }
-
- public void testSubtract()
- {
- // the only non-common parent is the panel grid
- AxiomaticSet set1 = _ancestorsOfInputText.subtract(_ancestorsOfCommandButton);
- set1 = new ElementToTagIdentifierMapping().map(set1);
- assertEquals(1, set1.size());
- assertTrue(set1.contains(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID));
-
- // all of command button's parents are also parents of inputText
- set1 = _ancestorsOfCommandButton.subtract(_ancestorsOfInputText);
- set1 = new ElementToTagIdentifierMapping().map(set1);
- assertEquals(0, set1.size());
-
- // no common elements
- set1 = _ancestorsOfCommandButton.subtract(_inputTextSingletonSet);
- assertEquals(_ancestorsOfCommandButton, set1);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestElementToTagIdentifierMapping.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestElementToTagIdentifierMapping.java
deleted file mode 100644
index 2c6438e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestElementToTagIdentifierMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.set;
-
-import org.eclipse.jst.jsf.core.tests.tagmatcher.BaseTagMatcherTestCase;
-
-public class TestElementToTagIdentifierMapping extends BaseTagMatcherTestCase
-{
- protected void setUp() throws Exception
- {
- _srcFileName = "/testfiles/jsps/testdata1.jsp.data";
- _destFileName = "/testdata1.jsp";
- super.setUp();
- }
-
- public void testElementToIdMapping()
- {
- // TODO:
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestMemberConstraint.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestMemberConstraint.java
deleted file mode 100644
index e4ca157..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestMemberConstraint.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.set;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.ConcreteAxiomaticSet;
-import org.eclipse.jst.jsf.core.set.constraint.MemberConstraint;
-
-public class TestMemberConstraint extends TestCase
-{
- private AxiomaticSet _set1;
- private AxiomaticSet _set2;
- private AxiomaticSet _set3;
-
- private AxiomaticSet _constraintSet1;
- private AxiomaticSet _constraintSet2;
- private AxiomaticSet _constraintSet3;
-
- public void testMemberConstraint()
- {
- // A is always a subset of itself
- assertTrue(new MemberConstraint(_set1).passesConstraint(_set1));
- assertTrue(new MemberConstraint(_set2).passesConstraint(_set2));
- assertTrue(new MemberConstraint(_set3).passesConstraint(_set3));
-
- // constraint 1
- assertTrue(new MemberConstraint(_constraintSet1).passesConstraint(_set1));
- Diagnostic fail = new MemberConstraint(_constraintSet1).isSatisfied(_set2);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertEquals(1, fail.getData().size());
- assertTrue(fail.getData().contains("element2"));
- fail = new MemberConstraint(_constraintSet1).isSatisfied(_set3);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertEquals(1, fail.getData().size());
- assertTrue(fail.getData().contains("element2"));
-
- // constraint 2
- fail = new MemberConstraint(_constraintSet2).isSatisfied(_set1);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertTrue(fail.getData().contains("element7"));
- assertEquals(1, fail.getData().size());
- assertTrue(new MemberConstraint(_constraintSet2).passesConstraint(_set2));
- fail = new MemberConstraint(_constraintSet2).isSatisfied(_set3);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertEquals(1, fail.getData().size());
- assertTrue(fail.getData().contains("element7"));
-
- // constraint 3
- fail = new MemberConstraint(_constraintSet3).isSatisfied(_set1);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertEquals(1, fail.getData().size());
- assertTrue(fail.getData().contains("element7"));
- fail = new MemberConstraint(_constraintSet3).isSatisfied(_set2);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertEquals(2, fail.getData().size());
- assertTrue(fail.getData().contains("element1"));
- assertTrue(fail.getData().contains("element2"));
- fail = new MemberConstraint(_constraintSet3).isSatisfied(_set3);
- assertEquals(Diagnostic.ERROR, fail.getSeverity());
- assertEquals(2, fail.getData().size());
- assertTrue(fail.getData().contains("element2"));
- assertTrue(fail.getData().contains("element7"));
-
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- List<String> items = new ArrayList<String>();
- items.add("element1");
- items.add("element2");
- items.add("element3");
- items.add("element4");
- _set1 = createSet(items);
-
- items.clear();
- items.add("element5");
- items.add("element6");
- items.add("element7");
- items.add("element8");
- _set2 = createSet(items);
-
- items.clear();
- items.add("element1");
- items.add("element5");
- _set3 = createSet(items);
-
- // setup a constraint set that will pass for set1
- // fail for set2 (they are disjoint) and fail for set3
- items.clear();
- items.add("element2");
- _constraintSet1 = createSet(items);
-
- // setup a constraint set that will pass for set2
- // fail for set1 and fail for set3
- items.clear();
- items.add("element7");
- _constraintSet2 = createSet(items);
-
- // setup a constraint set that will fail on all three
- // even though it has common element with all sets
- items.clear();
- items.add("element1"); // match 1 and 3
- items.add("element2"); // match 1
- items.add("element7"); // match 2
- _constraintSet3 = createSet(items);
- }
-
- @SuppressWarnings("unchecked")
- protected AxiomaticSet createSet(List<String> items)
- {
- ConcreteAxiomaticSet set = new ConcreteAxiomaticSet();
- set = new ConcreteAxiomaticSet();
- for (Iterator<String> it = items.iterator(); it.hasNext();)
- {
- set.add(it.next());
- }
- return set;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestXPathValidation.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestXPathValidation.java
deleted file mode 100644
index 7dfdc65..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/set/TestXPathValidation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.set;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.ConcreteAxiomaticSet;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
-import org.eclipse.jst.jsf.core.set.constraint.MemberConstraint;
-import org.eclipse.jst.jsf.core.set.mapping.ElementToTagIdentifierMapping;
-import org.eclipse.jst.jsf.core.tagmatcher.XPathMatchingAlgorithm;
-import org.eclipse.jst.jsf.core.tests.tagmatcher.BaseTagMatcherTestCase;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class TestXPathValidation extends BaseTagMatcherTestCase {
-
- protected void setUp() throws Exception
- {
- _srcFileName = "/testfiles/jsps/testdata1.jsp.data";
- _destFileName = "/testdata1.jsp";
-
- super.setUp();
- }
-
- @SuppressWarnings("unchecked")
- public void testValidateParentMembership()
- {
- AxiomaticSet inputAncestors = getAncestorsOfInputText();
-
- //map the set to TagIds
- inputAncestors = new ElementToTagIdentifierMapping().map(inputAncestors);
- // create constraint set: form and view must be parents of inputText
- AxiomaticSet constraintSet = new ConcreteAxiomaticSet();
- constraintSet.add(TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, "form"));
- constraintSet.add(TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_CORE, "view"));
-
- // create an apply member constraint
- MemberConstraint memberConstraint = new MemberConstraint(constraintSet);
- assertTrue(memberConstraint.passesConstraint(inputAncestors));
-
- // test a constraint set that isn't satisfied: no ancestor is inputLabel
- constraintSet.clear();
- constraintSet.add(TagIdentifierFactory.createJSPTagWrapper(ITLDConstants.URI_JSF_HTML, "inputLabel"));
- memberConstraint = new MemberConstraint(constraintSet);
- assertTrue(memberConstraint.failsConstraint(inputAncestors));
- }
-
- protected AxiomaticSet getAncestorsOfInputText()
- {
- Document doc = ((IDOMModel)_structuredModel).getDocument();
- System.out.println(System.currentTimeMillis());
- XPathMatchingAlgorithm matcher = new XPathMatchingAlgorithm("/view/html/body/form/panelGrid/inputText");
- AxiomaticSet set = matcher.evaluate(doc);
- assertEquals(1, set.size());
-
- // get all of the ancestors of the inputText
- final Node inputText = (Node) set.getFirstElement();
- matcher = new XPathMatchingAlgorithm("ancestor::*");
- return matcher.evaluate(inputText);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/ConcatStrategy.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/ConcatStrategy.java
deleted file mode 100644
index 14a5b90..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/ConcatStrategy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.strategy;
-
-import java.util.regex.Pattern;
-
-import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
-
-class ConcatStrategy implements IIdentifiableStrategy<String, String, String>
-{
- private final Pattern _pattern;
- private final String _concat;
- private final String _id;
-
- public ConcatStrategy(final Pattern pattern, final String toConcat, final String id)
- {
- _pattern = pattern;
- _concat = toConcat;
- _id = id;
- }
-
- public String perform(String input) throws Exception
- {
- if (_pattern.matcher(input).matches())
- {
- return input.concat(_concat);
- }
- return getNoResult();
- }
-
- public String getNoResult()
- {
- return null;
- }
-
- public String getId()
- {
- return _id;
- }
-
- public String getDisplayName()
- {
- return "Concat strategy, id="+getId();
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/StrategyCompositeTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/StrategyCompositeTests.java
deleted file mode 100644
index 67eb0b8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/strategy/StrategyCompositeTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.strategy;
-
-import static junit.framework.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.eclipse.jst.jsf.common.internal.strategy.SimpleStrategyComposite;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class StrategyCompositeTests
-{
- private ConcatStrategy _concatStrategyAAAbbb;
- private ConcatStrategy _concatStrategyAAAccc;
- private ConcatStrategy _concatStrategyBBBccc;
- private ConcatStrategy _concatStrategyCCCaaa;
- private List<ConcatStrategy> _strategies;
-
- @Before
- public void setup() throws Exception
- {
- _concatStrategyAAAbbb = new ConcatStrategy(Pattern.compile("^AAA.*"), "bbb", "AAA");
- _concatStrategyAAAccc = new ConcatStrategy(Pattern.compile("^AAA.*"), "ccc", "AAA");
- _concatStrategyBBBccc = new ConcatStrategy(Pattern.compile("^BBB.*"), "ccc", "BBB");
- _concatStrategyCCCaaa = new ConcatStrategy(Pattern.compile("^CCC.*"), "aaa", "CCC");
- _strategies = new ArrayList<ConcatStrategy>();
- _strategies.add(_concatStrategyAAAbbb);
- _strategies.add(_concatStrategyAAAccc);
- _strategies.add(_concatStrategyBBBccc);
- _strategies.add(_concatStrategyCCCaaa);
- }
-
- @Test
- public void testDefaultPerform()
- {
- SimpleStrategyComposite<String, String, String, String, ConcatStrategy> testComposite
- = new SimpleStrategyComposite<String, String, String, String, ConcatStrategy>(_strategies);
- assertEquals("AAAbbb", testComposite.perform("AAA"));
- assertEquals("AAAqqqbbb", testComposite.perform("AAAqqq"));
- assertEquals("BBBtccc", testComposite.perform("BBBt"));
- assertEquals("CCC_____aaa", testComposite.perform("CCC_____"));
- }
-
-// @Test
-// public void testListMergePerform()
-// {
-// final List<String> composedResult = new ArrayList<String>();
-// new MergingCompositionStrategy.ListMergingCompositionStrategy<String, List<String>, ConcatStrategy>(composedResult, Collections.EMPTY_LIST);
-// SimpleStrategyComposite<String, String, String, ConcatStrategy> testComposite
-// = new SimpleStrategyComposite<String, String, String, ConcatStrategy>(_strategies,
-// );
-// }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/BaseTagMatcherTestCase.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/BaseTagMatcherTestCase.java
deleted file mode 100644
index 4e7d89d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/BaseTagMatcherTestCase.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.tagmatcher;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tagmatcher.XPathMatchingAlgorithm;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-
-
-public class BaseTagMatcherTestCase extends TestCase {
- /**
- * The dynamic web project test environment
- */
- protected WebProjectTestEnvironment _testEnv;
- /**
- * A handle to the Java project test environment
- */
- protected JDTTestEnvironment _jdtTestEnv;
- /**
- * Name of the test data file containing the JSP source for this test
- */
- protected String _srcFileName;
- /**
- * Name of the file and path where the JSP source should be put in the
- * test project
- */
- protected String _destFileName;
-
- /**
- * The file handle to the JSP in the workspace
- */
- protected IFile _testJSP;
- /**
- * The SSE structured model for the JSP
- */
- protected IStructuredModel _structuredModel;
- /**
- * The SSE structured document for the JSP
- */
- protected IStructuredDocument _structuredDocument;
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80");
-
- _testEnv = new WebProjectTestEnvironment("ELValidationTest_"+this.getClass().getName()+"_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- // load a dummy tld for core
- // NOTE: the TLDs seem to need to be loaded BEFORE any JSPs that use them.
- // probably adding the jsp kicks off something that searches for TLD's that doesn't
- // get kicked if the TLDs are added after.
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/myfaces_core.tld.data", "META-INF/myfaces_core.tld");
-
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/myfaces_html.tld.data", "META-INF/myfaces_html.tld");
-
- _testJSP = (IFile) _testEnv.loadResourceInWebRoot
- (TestsPlugin.getDefault().getBundle(),
- _srcFileName, _destFileName);
-
- _structuredModel = StructuredModelManager.getModelManager().getModelForRead(_testJSP);
- _structuredDocument = _structuredModel.getStructuredDocument();
-
- // initialize test case for faces 1.1
- JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- if (_structuredModel != null)
- {
- _structuredModel.releaseFromRead();
- }
- _testEnv.getTestProject().close(null);
- }
-
- protected final AxiomaticSet getAncestorsOf(String xpathToChild, int expectedAncestors)
- {
- Document doc = ((IDOMModel)_structuredModel).getDocument();
- XPathMatchingAlgorithm matcher = new XPathMatchingAlgorithm(xpathToChild);
- AxiomaticSet set = matcher.evaluate(doc);
- assertEquals(1, set.size());
-
- // get all of the ancestors of the inputText
- final Node inputText = (Node) set.getFirstElement();
- matcher = new XPathMatchingAlgorithm("ancestor::*");
- AxiomaticSet result = matcher.evaluate(inputText);
-
- assertNotNull(result);
-
- if (expectedAncestors >= 0)
- {
- assertEquals(expectedAncestors, result.size());
- }
-
- return result;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/TestXPathTagMatcher.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/TestXPathTagMatcher.java
deleted file mode 100644
index 6e8dfbe..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/tagmatcher/TestXPathTagMatcher.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.tagmatcher;
-
-import java.util.Iterator;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.set.mapping.ElementToTagIdentifierMapping;
-import org.eclipse.jst.jsf.core.tagmatcher.XPathMatchingAlgorithm;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class TestXPathTagMatcher extends BaseTagMatcherTestCase {
-
- protected void setUp() throws Exception {
- _srcFileName = "/testfiles/jsps/testdata1.jsp.data";
- _destFileName = "/testdata1.jsp";
- super.setUp();
- }
-
- public void testSimpleMatches()
- {
- // get the view tag
- Document doc = ((IDOMModel)_structuredModel).getDocument();
- System.out.println(System.currentTimeMillis());
- XPathMatchingAlgorithm viewMatcher = new XPathMatchingAlgorithm("/view");
- AxiomaticSet set = viewMatcher.evaluate(doc);
- System.out.println(System.currentTimeMillis());
-
- // get an input nested along a form path
- assertEquals(1, set.size());
- IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_structuredDocument, 529);
- IDOMContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
-
- Node node = resolver.getNode();//(Node) set.getFirstElement();
- assertEquals("f:view", node.getNodeName());
- System.out.println(CMUtil.getElementNamespaceURI((Element) node));
- XPathMatchingAlgorithm matcher = new XPathMatchingAlgorithm("html/body/form/panelGrid/inputText");
- set = matcher.evaluate(node);
- System.out.println(System.currentTimeMillis());
- assertEquals(1, set.size());
-
- // get all of the ancestors of the inputText
- final Node inputText = (Node) set.getFirstElement();
- System.out.println(CMUtil.getElementNamespaceURI((Element) inputText));
- matcher = new XPathMatchingAlgorithm("ancestor::*");
- set = matcher.evaluate(inputText);
- assertEquals(5,set.size());
-
- set = new ElementToTagIdentifierMapping().map(set);
-
- for (final Iterator<?> it = set.iterator(); it.hasNext();)
- {
- TagIdentifier tagId = (TagIdentifier) it.next();
- System.out.println(tagId.getUri());
- System.out.println(tagId.getTagName());
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeComparatorTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeComparatorTests.java
deleted file mode 100644
index 3f76745..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeComparatorTests.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.core.tests.types;
-
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparator;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparatorDiagnosticFactory;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparatorPreferences;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-
-/**
- * Unit tests for the composite type comparator. Indirectly exercises
- * type transfomer and coercers.
- *
- * @author cbateman
- *
- */
-public class TypeComparatorTests extends TestCase
-{
- // basic types
- private final CompositeType simpleString =
- new CompositeType("Ljava.lang.String;", IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType simpleInteger =
- new CompositeType(Signature.SIG_INT, IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType simpleLong =
- new CompositeType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType simpleBoolean =
- new CompositeType(Signature.SIG_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType simpleDouble =
- new CompositeType(Signature.SIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
-
- // boxed types
- private final CompositeType boxedInteger =
- new CompositeType("Ljava.lang.Integer;", IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType boxedLong =
- new CompositeType("Ljava.lang.Long;", IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType boxedBoolean =
- new CompositeType("Ljava.lang.Boolean;", IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType boxedDouble =
- new CompositeType("Ljava.lang.Double;", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- // single interface types
- private final CompositeType comparableType =
- new CompositeType("Ljava.lang.Comparable;", IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType mapType =
- new CompositeType("Ljava.util.Map;", IAssignable.ASSIGNMENT_TYPE_RHS);
-
-
- // multi-types
- private final CompositeType objectAndComparable =
- new CompositeType(new String[] {"Ljava.lang.Object;", "Ljava.lang.Comparable;"}
- , IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType objectAndMap =
- new CompositeType(new String[] {"Ljava.lang.Object;", "Ljava.util.Map;"}
- , IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType objectAndCollection =
- new CompositeType(new String[] {"Ljava.lang.Object;", "Ljava.util.Collection;"}
- , IAssignable.ASSIGNMENT_TYPE_RHS);
-
- // read/write types
- private final CompositeType readWritePrimitiveLong =
- new CompositeType(Signature.SIG_LONG,
- IAssignable.ASSIGNMENT_TYPE_RHS | IAssignable.ASSIGNMENT_TYPE_LHS);
- private final CompositeType readWriteString =
- new CompositeType("Ljava.lang.String;",
- IAssignable.ASSIGNMENT_TYPE_LHS | IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType readWriteObject =
- new CompositeType("Ljava.lang.Object;",
- IAssignable.ASSIGNMENT_TYPE_LHS | IAssignable.ASSIGNMENT_TYPE_RHS);
- private final CompositeType writeOnlyObject =
- new CompositeType("Ljava.lang.Object;",IAssignable.ASSIGNMENT_TYPE_LHS);
-
- // method types
- private final static String actionMethodSig =
- Signature.createMethodSignature(new String[0]
- , "Ljava.lang.String;");
- private final static String actionListenerSig =
- Signature.createMethodSignature
- (new String[]{"Ljavax.faces.event.ActionEvent;"}
- , Signature.SIG_VOID);
- private final static String hasReturnAndArgSig =
- Signature.createMethodSignature
- (new String[]{"Ljavax.faces.event.ActionEvent;"}
- , "Ljava.lang.String;");
- private final static String sameNumArgsDiffTypeSig =
- Signature.createMethodSignature
- (new String[]{"Ljava.lang.String;"}
- , "Ljava.lang.String;");
-
- private final CompositeType actionMethod =
- new CompositeType(actionMethodSig,
- IAssignable.ASSIGNMENT_TYPE_NONE);
- private final CompositeType actionListener =
- new CompositeType(actionListenerSig,
- IAssignable.ASSIGNMENT_TYPE_NONE);
- private final CompositeType hasReturnAndArg =
- new CompositeType(hasReturnAndArgSig,
- IAssignable.ASSIGNMENT_TYPE_NONE);
-
- private final CompositeType actionAndActionListener =
- new CompositeType(new String[] {actionMethodSig, actionListenerSig}
- , IAssignable.ASSIGNMENT_TYPE_NONE);
- private final CompositeType sameNumArgsDiffType =
- new CompositeType(new String[] {sameNumArgsDiffTypeSig}
- , IAssignable.ASSIGNMENT_TYPE_NONE);
-
- private final CompositeType takesUnboxedInt =
- new CompositeType(Signature.createMethodSignature(new String[]{Signature.SIG_INT}, Signature.SIG_VOID)
- , IAssignable.ASSIGNMENT_TYPE_NONE);
- private final CompositeType takesBoxedInt =
- new CompositeType(Signature.createMethodSignature(new String[]{TypeConstants.TYPE_BOXED_INTEGER}, Signature.SIG_VOID)
- , IAssignable.ASSIGNMENT_TYPE_NONE);
-
-
- private TypeComparator _typeComparator;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _typeComparator = new TypeComparator(new TypeComparatorDiagnosticFactory(new TypeComparatorPreferences()));
- }
-
- /**
- * Sanity check on simple types
- */
- public void testSimpleTypes()
- {
- // simple integers always same
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(simpleInteger, simpleInteger);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple longs always same
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleLong, simpleLong);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple double always same
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleDouble, simpleDouble);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple boolean always same
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleBoolean, simpleBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple strings always same
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleString, simpleString);
- assertTrue(result.getSeverity() == Diagnostic.OK);
- }
-
- /**
- * test type compatibility coercing to integer
- */
- public void testIntegerCoercions()
- {
- // simple longs can coerce to integer
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(simpleInteger, simpleLong);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple doubles can coerce to integer
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleInteger, simpleDouble);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // strings can coerce to integer
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleInteger, simpleString);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // booleans cannot coerce to integer
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleInteger, simpleBoolean);
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
-
- /**
- * test type compatibility coercing to long
- */
- public void testLongCoercions()
- {
- // simple integer can coerce to long
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(simpleLong, simpleInteger);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple doubles can coerce to long
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleLong, simpleDouble);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // strings can coerce to long
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleLong, simpleString);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // booleans cannot coerce to long
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleLong, simpleBoolean);
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
-
- public void testBooleanCoercions()
- {
- // noop: boolean should always coerce to boolean
- Diagnostic result =
- _typeComparator.calculateTypeCompatibility
- (simpleBoolean, simpleBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // noop: works also for boxed
- result =
- _typeComparator.calculateTypeCompatibility
- (simpleBoolean, boxedBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // noop: works also for boxed
- result =
- _typeComparator.calculateTypeCompatibility
- (boxedBoolean, simpleBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // always coerce strings to booleans
- result =
- _typeComparator.calculateTypeCompatibility
- (simpleBoolean, simpleString);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // no number -> boolean coercion
- result =
- _typeComparator.calculateTypeCompatibility
- (simpleBoolean, simpleDouble);
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
-
-
- /**
- * test type compatibility coercing to double
- */
- public void testDoubleCoercions()
- {
- // simple longs can coerce to double
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(simpleDouble, simpleLong);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // simple integer can coerce to double
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleDouble, simpleInteger);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // strings can coerce to double
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleDouble, simpleString);
-
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // booleans cannot coerce to double
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleDouble, simpleBoolean);
-
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
- /**
- * test type compatibility coercing to string
- */
- public void testStringCoercions()
- {
- // everything coerces to String
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(simpleString, simpleLong);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // everything coerces to String
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleString, simpleDouble);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // everything coerces to String
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleString, simpleInteger);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // everything coerces to String
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleString, simpleBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
- }
-
- /**
- * Test compatibilty of boxed types when their simple type is expected
- */
- public void testSimpleToBoxConversions()
- {
- // Integer should convert to int
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(simpleInteger, boxedInteger);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // Long should convert to long
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleLong, boxedLong);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // Double should convert to double
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleDouble, boxedDouble);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // Boolean should convert to boolean
- result =
- _typeComparator.
- calculateTypeCompatibility(simpleBoolean, boxedBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
- }
-
- /**
- * Test compatibilty of simple types when their boxed type is expected
- */
- public void testBoxToSimpleConversions()
- {
- // int should convert to Integer
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(boxedInteger, simpleInteger);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // long should convert to Long
- result =
- _typeComparator.
- calculateTypeCompatibility(boxedLong, simpleLong);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // double should convert to Double
- result =
- _typeComparator.
- calculateTypeCompatibility(boxedDouble, simpleDouble);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // boolean should convert to Boolean
- result =
- _typeComparator.
- calculateTypeCompatibility(boxedBoolean, simpleBoolean);
- assertTrue(result.getSeverity() == Diagnostic.OK);
- }
-
- /**
- * Test compatiblity when an interface is expected against a list of
- * possible types
- */
- public void testObjectLists()
- {
- // check for comparable
- Diagnostic result =
- _typeComparator.
- calculateTypeCompatibility(comparableType, objectAndComparable);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // not comparable
- result = _typeComparator.
- calculateTypeCompatibility(comparableType, objectAndCollection);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // check for map
- result =
- _typeComparator.
- calculateTypeCompatibility(mapType, objectAndMap);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // not map
- result = _typeComparator.
- calculateTypeCompatibility(mapType, objectAndCollection);
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
-
- /**
- * Tests assignability, for example when read/write expected, but only
- * read-only returned.
- */
- public void testAssignability()
- {
- // can assign read/write to read-only
- Diagnostic result =
- _typeComparator.calculateTypeCompatibility(simpleLong, readWritePrimitiveLong);
- assertEquals(result.getSeverity(), Diagnostic.OK);
-
- // can NOT assign read-only to read/write
- result =
- _typeComparator.calculateTypeCompatibility(readWritePrimitiveLong, simpleLong);
- assertNotSame(result.getSeverity(), Diagnostic.OK);
-
- // check bi-directional type comparison -- e.g when a read/write string
- // is expected, we can always coerce object to string.
- result =
- _typeComparator.calculateTypeCompatibility(readWriteString, readWriteObject);
- assertNotSame(result.getSeverity(), Diagnostic.OK);
-
- // this should fail because a readable object is expected, but one
- // is not provided (i.e. "not gettable")
- result =
- _typeComparator.calculateTypeCompatibility(readWriteObject, writeOnlyObject);
- assertNotSame(result.getSeverity(), Diagnostic.OK);
- }
-
- public void testMethodSignatures()
- {
- // compare a method to itself should always work; return type, no args
- Diagnostic result =
- _typeComparator.calculateTypeCompatibility(actionMethod, actionMethod);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // compare same when method has no return but args
- result =
- _typeComparator.calculateTypeCompatibility(actionListener, actionListener);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // methods are not compatible
- result =
- _typeComparator.calculateTypeCompatibility(actionMethod, actionListener);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // reverse order makes no diff
- result =
- _typeComparator.calculateTypeCompatibility(actionListener,actionMethod);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // same signature must succeed
- result =
- _typeComparator.calculateTypeCompatibility(hasReturnAndArg,hasReturnAndArg);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // boxed vs. unboxed arguments should succeed for same type
- result = _typeComparator.calculateTypeCompatibility(takesBoxedInt, takesUnboxedInt);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // and in reverse...
- result = _typeComparator.calculateTypeCompatibility(takesUnboxedInt, takesBoxedInt);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // won't satify, event though return matches
- result = _typeComparator.calculateTypeCompatibility(actionMethod, hasReturnAndArg);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // nor in reverse..
- result = _typeComparator.calculateTypeCompatibility(hasReturnAndArg, actionMethod);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // won't satify, event though args matches
- result = _typeComparator.calculateTypeCompatibility(actionListener, hasReturnAndArg);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // nor in reverse...
- result = _typeComparator.calculateTypeCompatibility(hasReturnAndArg, actionListener);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // check same return and arg count, diff arg
- result = _typeComparator.calculateTypeCompatibility(hasReturnAndArg, sameNumArgsDiffType);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
-
- // test multiple
-
- // this will succeed because actionMethod is in the list
- result = _typeComparator.calculateTypeCompatibility(actionAndActionListener, actionMethod);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // this will succeed because actionListener is in the list
- result = _typeComparator.calculateTypeCompatibility(actionAndActionListener, actionListener);
- assertTrue(result.getSeverity() == Diagnostic.OK);
-
- // this will fail because hasReturnAndArg is not in the list
- result = _typeComparator.calculateTypeCompatibility(actionAndActionListener, hasReturnAndArg);
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
-
- public void testValueMethodMix()
- {
- // a value binding will never be compatible with a method binding
- Diagnostic result =
- _typeComparator.calculateTypeCompatibility(actionMethod, readWriteObject);
- assertFalse(result.getSeverity() == Diagnostic.OK);
-
- // nor in reverse...
- result =
- _typeComparator.calculateTypeCompatibility(readWriteObject,actionMethod);
- assertFalse(result.getSeverity() == Diagnostic.OK);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeTransformerTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeTransformerTests.java
deleted file mode 100644
index faed0c6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/types/TypeTransformerTests.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.core.tests.types;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.TypeTransformer;
-
-/**
- * @author cbateman
- *
- */
-public class TypeTransformerTests extends TestCase {
-
- private final static CompositeType primitiveLong =
- new CompositeType("J", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType primitiveInteger =
- new CompositeType("I", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType primitiveLongArray =
- new CompositeType("[J", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType primitiveIntegerArrayArray =
- new CompositeType("[[I", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType boxedLong =
- new CompositeType("Ljava.lang.Long;", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType boxedInteger =
- new CompositeType("Ljava.lang.Integer;", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType boxedLongArray =
- new CompositeType("[Ljava.lang.Long;", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- private final static CompositeType boxedIntegerArrayArray =
- new CompositeType("[[Ljava.lang.Integer;", IAssignable.ASSIGNMENT_TYPE_RHS);
-
- /**
- * Simple test for boxing primitives
- */
- public void testBoxPrimitives()
- {
- CompositeType newType = TypeTransformer.transformBoxPrimitives(primitiveLong);
- assertTrue(exactMatch(newType, boxedLong));
- newType = TypeTransformer.transformBoxPrimitives(primitiveInteger);
- assertTrue(exactMatch(newType, boxedInteger));
- newType = TypeTransformer.transformBoxPrimitives(primitiveLongArray);
- assertTrue(exactMatch(newType, boxedLongArray));
- newType = TypeTransformer.transformBoxPrimitives(primitiveIntegerArrayArray);
- assertTrue(exactMatch(newType, boxedIntegerArrayArray));
- }
-
- /**
- * Simple test for unboxing primitives
- */
- public void testUnboxPrimitives()
- {
- CompositeType newType = TypeTransformer.transformUnboxPrimitives(boxedLong);
- assertTrue(exactMatch(newType, primitiveLong));
- newType = TypeTransformer.transformUnboxPrimitives(boxedInteger);
- assertTrue(exactMatch(newType, primitiveInteger));
- newType = TypeTransformer.transformUnboxPrimitives(boxedLongArray);
- assertTrue(exactMatch(newType, primitiveLongArray));
- newType = TypeTransformer.transformUnboxPrimitives(boxedIntegerArrayArray);
- assertTrue(exactMatch(newType, primitiveIntegerArrayArray));
- }
-
-
- private static boolean exactMatch(CompositeType t1, CompositeType t2)
- {
- String[] s1 = t1.getSignatures();
- String[] s2 = t2.getSignatures();
-
- if (s1.length != s2.length)
- {
- return false;
- }
-
- for (int i = 0; i < s1.length; i++)
- {
- if (!s1[i].equals(s2[i]))
- {
- return false;
- }
- }
-
- // if we get to here, just verify assignability
- if (t1.getAssignmentTypeMask() != t2.getAssignmentTypeMask())
- {
- return false;
- }
-
- // if we get to here, then signatures and assignability match
- // exactly. So exactMatch
- return true;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFCoreUtilHelper.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFCoreUtilHelper.java
deleted file mode 100644
index 042f721..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFCoreUtilHelper.java
+++ /dev/null
@@ -1,623 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.util;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jst.j2ee.internal.web.archive.operations.WebFacetProjectCreationDataModelProvider;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.AbstractTagRegistryFactoryProvider;
-import org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.ITagRegistryFactoryInfo;
-import org.eclipse.jst.jsf.core.internal.ITagRegistryFactoryProvider;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.mock.MockJSPTagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory;
-import org.eclipse.jst.jsf.designtime.resolver.ISymbolContextResolver;
-import org.eclipse.jst.jsf.designtime.resolver.StructuredDocumentSymbolResolverFactory;
-import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-@SuppressWarnings("deprecation")
-public final class JSFCoreUtilHelper
-{
- private static final String JSFRUNTIMEJARSDIR = "jsfRuntimeJarsDirectoryV";
- private static String JSF11Path = "";
- private static String JSF12Path = "";
- private static String JSF20Path = "";
-
- /**
- * Constructs jsfLib using this plugin's install path and "testfiles" subdirectory
- * @param id
- * @param name
- * @param archivefiles
- * @param bImpl
- * @return
- */
- public static JSFLibrary constructJSFLib(
- final String id,
- final String name,
- final String[] archivefiles,
- final boolean bImpl) {
-
- final String pathTestFiles = TestsPlugin.getInstallLocation().getPath() + "testfiles/";
-
- return constructJSFLib(id, name, pathTestFiles, archivefiles, bImpl);
- }
-
- /**
- * @param id
- * @param name
- * @param pluginRelativePathToArchiveFiles
- * @param archivefiles
- * @param bImpl
- * @return JSF Library
- */
- public static JSFLibrary constructJSFLib(
- final String id,
- final String name,
- final String basePathToArchiveFiles,
- final String[] archivefiles,
- final boolean bImpl) {
-
- ArchiveFile archiveFile = null;
- String testData;
- final JSFLibrary jsfLib = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
-// jsfLib.setID(id);
- jsfLib.setName(name);
- jsfLib.setImplementation(bImpl);
-
- for (final String archivefile2 : archivefiles) {
- testData = basePathToArchiveFiles + archivefile2;
- archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(testData);
- archiveFile.setJSFLibrary(jsfLib);
- }
-
- return jsfLib;
- }
-
- /**
- * Create a Dynamic Web application with given name using default operation.
- * If project with given name already exists, then it returns that project.
- *
- * @param aProjectName Project name.
- * @return IProject instance.
- * @throws Exception on error.
- */
- public static IProject createWebProject(final String aProjectName) throws Exception {
- final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(aProjectName);
- if (!project.exists()) {
- final IDataModel dataModel = DataModelFactory.createDataModel(new WebFacetProjectCreationDataModelProvider());
- dataModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProjectName);
- dataModel.getDefaultOperation().execute(new NullProgressMonitor(), null);
- }
- return ResourcesPlugin.getWorkspace().getRoot().getProject(aProjectName);
- }
-
- /**
- * If the JSF Library registry is empty, it will seed it with an Impl and non-Impl library
- */
- public static void createJSFLibraryRegistry(){
- if (JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getAllJSFLibraries().size() < 2){
- //create Impl
- JSFLibrary lib = constructJSFLib("AN-IMPL-LIB", "/testfiles/JSFLib/", true, false);
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().addJSFLibrary(lib);
- //create non-Impl. Uses same jars but declares it to be non implementation
- lib = constructJSFLib("A-NON-IMPL-LIB", "/testfiles/JSFLib/", false, false);
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().addJSFLibrary(lib);
- //create plugin impl
- lib = constructJSFLib("AN-IMPL-LIB-PP", "/testfiles/JSFLib/", true, true);
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().addJSFLibrary(lib);
- //create plugin-non impl
-
- }
- }
-
- /**
- * Convenience method to get new JSFLibraryRegistry instance from factory.
- * Note that the returned instance is not associated with a resource and so
- * cannot be loaded or saved unless a resource is created and the returned
- * instance is set in the resource contents.
- *
- * @return JSFLibraryRegistry instance.
- */
- public static JSFLibraryRegistry getNewJSFLibraryRegistry() {
- return JSFLibraryRegistryFactory.eINSTANCE.createJSFLibraryRegistry();
- }
-
- /**
- * Convenience method to get the JSFLibraryRegistry instance
- * (which will cause the loadJSFLibraryRegistry() and
- * loadJSFLibraryExtensions() methods to be called and will
- * subsequently allow saveJSFLibraryRegistry() to be called,
- * if desired).
- *
- * @return JSFLibraryRegistry instance from JSFCorePlugin.
- */
- public static JSFLibraryRegistry getJSFLibraryRegistryFromJSFLibraryHelper() {
- return JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- }
-
- /**
- * Creates a JSF Library from all the jars and zips found at the relative path from this plugin
- *
- * @param name
- * @param relPathToArchives
- * @param isImpl
- * @param isFakedPlugginLib
- * @return JSFLibrary
- */
- public static JSFLibrary constructJSFLib(
- final String name,
- final String relPathToArchives,
- final boolean isImpl,
- final boolean isFakedPlugginLib) {
-
- JSFLibrary jsfLib = null;
- if (isFakedPlugginLib){
- jsfLib = JSFLibraryRegistryFactory.eINSTANCE.createPluginProvidedJSFLibrary();
-// jsfLib.setID("fakePluginLib_"+name);
- } else {
- jsfLib = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
- }
-
- jsfLib.setName(name);
- jsfLib.setImplementation(isImpl);
-
- final File pathTestFiles = new File(TestsPlugin.getInstallLocation().getPath()
- + File.separator + relPathToArchives);
- final FilenameFilter jars = new FilenameFilter(){
- public boolean accept(File dir, String name_) {
- if (name_.length() >=5){
- String lastChars = name_.toLowerCase().substring(name_.length() - 4);
- if (lastChars.equals(".jar") || lastChars.equals(".zip")) {
- return true;
- }
- }
- return false;
- }
- };
-
- final String[] fileNames = pathTestFiles.list(jars);
- for (final String fileName2 : fileNames) {
- final String fileName = pathTestFiles.getAbsolutePath().concat(File.separator).concat(fileName2);
- final ArchiveFile archiveFile = JSFLibraryRegistryFactory.eINSTANCE.createArchiveFile();
- archiveFile.setRelativeToWorkspace(false);
- archiveFile.setSourceLocation(fileName);
- archiveFile.setJSFLibrary(jsfLib);
- }
-
- return jsfLib;
- }
-
- /**
- * @param jsfVersion
- * @return Directory name for jsf runtime jars.
- * <br>Will be null if not set in JSFRUNTIMEJARSDIRV<b>X.X</b> system property
- */
- public static String getJSFRuntimeJarsDirectory(final JSFVersion jsfVersion) {
- final String propertyName = JSFRUNTIMEJARSDIR+jsfVersion.toString();
- String res = System.getProperty(propertyName);
- if (res == null) {
- //check env var also
- res = System.getenv(propertyName);
- }
-
- // do some tracing the first time a new value is returned for 1.1 or 1.2
- if (jsfVersion == JSFVersion.V1_1
- && JSF11Path != res)
- {
- System.out.printf("Using jsf runtime path %s for propertyName %s\n", res, propertyName);
- JSF11Path = res;
- }
- else if (jsfVersion == JSFVersion.V1_2
- && JSF12Path != res)
- {
- System.out.printf("Using jsf runtime path %s for propertyName %s\n", res, propertyName);
- JSF12Path = res;
- }
- else if (jsfVersion == JSFVersion.V2_0
- && JSF20Path != res) {
- System.out.printf("Using jsf runtime path %s for propertyName %s\n", res, propertyName);
- JSF20Path = res;
- }
- return res;
- }
-
- /**
- * Returns true if the environment property holding the name of the directory that points at the
- * runtime jars exist.
- * <p>
- * The expected property name is jsfRuntimeJarsDirectoryVXX where XX is the
- * JSFVersion. <br>i.e "jsfRuntimeJarsDirectoryV1.1", or "jsfRuntimeJarsDirectoryV1.2"
- * <p>
- * It <b>does</b> check for the existence of the directory.<br>
- * It <b>does not</b> check for any jars within that directory.
- *
- * @param jsfVersion as String. ie. "1.1", or "1.2"
- * @return true if the property is set
- */
- public static boolean isJSFRuntimeJarsDirectoryPropertySet(final JSFVersion jsfVersion) {
- final String dirName = getJSFRuntimeJarsDirectory(jsfVersion);
- if (dirName != null && dirName.trim().length() != 0)
- {
- final File dir = new File(dirName);
-
- if (dir.exists() && dir.isDirectory())
- {
- return true;
- }
- else
- {
- System.err.printf("Dir: %s either doesn't exists or is not a directory\n",dirName);
- }
- }
- else
- {
- System.err.println("dirName is null");
- }
-
- return false;
- }
-
- public static boolean createRegistryAndAddReferences(final JSFFacetedTestEnvironment jsfFacedEnv, final String[] archiveFiles, final JSFVersion jsfVersion) throws CoreException {
- final JSFLibraryRegistry jsfLibRegistry =
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
-
- if (archiveFiles != null)
- {
- final String libIDandName = "_internalJSFRuntimeLibraryV" + jsfVersion + "_";
- final JSFLibrary jsfImpl = JSFCoreUtilHelper.
- constructJSFLib(libIDandName, libIDandName,"", archiveFiles, true);
- jsfLibRegistry.addJSFLibrary(jsfImpl);
- JSFLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
- jsfFacedEnv.addJSFLibraryReference(jsfImpl, true);
- return true;
- }
-
- return false;
- }
-
- public static String[] getJSFRuntimeJarNames(final JSFVersion version) throws IOException
- {
- String[] jarNames = null;
- final String dirName = getJSFRuntimeJarsDirectory(version);
- System.out.printf("Using dirName: %s\n", dirName);
- if (dirName != null) {
- final File dir = new File(dirName);
- if (dir.exists() && dir.isDirectory()) {
- final File[] jars = dir.listFiles();
- if (jars != null && jars.length > 0) {
- jarNames = new String[jars.length];
- for (int i = 0; i < jars.length; i++) {
- jarNames[i] = jars[i].getAbsolutePath();
- }
- }
- }
- else
- {
- throw new FileNotFoundException(dirName+" is either does not exist or is not a directory");
- }
- }
- else
- {
- throw new FileNotFoundException("dirName is null");
- }
- return jarNames;
- }
-
- public static boolean isJSFRuntimeJarsDirectoryValid(final JSFVersion jsfVersion)
- {
- try
- {
- return getJSFRuntimeJarNames(jsfVersion) != null;
- }
- catch (final IOException e)
- {
- return false;
- }
- }
-
- /**
- * Attempts to create and initialize a JSF library for the jar files stored at the location
- * pointed to by the standard env variable (@see getJSFRuntimeJarsDirectory)
- * @param jsfVersion
- * @param jsfFacetedTestEnv
- * @return true if successful
- * @throws Exception
- */
- public static boolean addJSFRuntimeJarsToClasspath(final JSFVersion jsfVersion, final JSFFacetedTestEnvironment jsfFacetedTestEnv) throws Exception
- {
- final String[] jarNames = getJSFRuntimeJarNames(jsfVersion);
- return createRegistryAndAddReferences(jsfFacetedTestEnv, jarNames, jsfVersion);
- }
-
- /**
- * @param testClass
- * @param jsfVersion
- * @return a message informing a test suite runner that the environment variable
- * isn't correct for finding JSF library jar files
- */
- public static String getTestRequiresJSFRuntimeMessage(final Class<?> testClass, final JSFVersion jsfVersion) {
- final StringBuffer sb = new StringBuffer();
- sb.append("Unable to run test suite \"");
- sb.append(testClass.getName());
- sb.append("\"; JSF runtime (v");
- sb.append(jsfVersion.toString());
- sb.append(") is required but not present.\nSystem property or environment variable \"jsfRuntimeJarsDirectoryV");
- sb.append(jsfVersion.toString());
- sb.append("\" must be set to point to a directory containing JSF runtime (v");
- sb.append(jsfVersion.toString());
- sb.append(") JARs.");
- return sb.toString();
- }
-// /**
-// * Creates a JSF Library from all the jars and zips found at the relative
-// * path from this plugin.
-// *
-// * @param ID
-// * @param name
-// * @param relPathToArchives
-// * @param isImpl
-// * @param isFakedPlugginLib
-// * @return JSFLibrary
-// */
-// public static JSFLibrary constructJSFLib(
-// String ID,
-// String name,
-// String relPathToArchives,
-// boolean isImpl,
-// boolean isFakedPlugginLib) {
-//
-// JSFLibrary jsfLib = constructJSFLib(name, relPathToArchives, isImpl, isFakedPlugginLib);
-//// jsfLib.setID(ID);
-// return jsfLib;
-// }
-
- /**
- * @param jspFile
- * @param offset
- * @return the context wrapper. Caller must ensure dispose is called so
- * model is released when finished.
- * @throws Exception
- */
- public static void assertELSanity(final IFile jspFile, final int offset,
- final String attrName, final String elExpr) throws Exception {
- ContextWrapper wrapper = null;
- try {
- wrapper = JSFCoreUtilHelper.getDocumentContext(jspFile, offset);
- final IStructuredDocumentContext context = wrapper.getContext();
- final IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
- final Node node = resolver.getNode();
- // bJSFTestUtil.getIndexedRegion((IStructuredDocument)
- // context.getStructuredDocument(), 589);
- Assert.assertTrue(node instanceof Attr);
- Assert.assertEquals(attrName, ((Attr) node).getNodeName());
- Assert.assertEquals(elExpr, ((Attr) node).getNodeValue());
- } finally {
- if (wrapper != null) {
- wrapper.dispose();
- }
- }
- }
-
- public static void assertELVariableSanity(final IFile jspFile,
- final String varName) throws Exception {
- ContextWrapper contextWrapper = null;
-
- try {
- contextWrapper = JSFCoreUtilHelper.getDocumentContext(jspFile, -1);
- final ISymbolContextResolver symbolResolver = StructuredDocumentSymbolResolverFactory
- .getInstance().getSymbolContextResolver(
- contextWrapper.getContext());
- final ISymbol bundleVar = symbolResolver.getVariable(varName);
- Assert.assertNotNull(bundleVar);
- } finally {
- if (contextWrapper != null) {
- contextWrapper.dispose();
- }
- }
- }
-
-
- public static ContextWrapper getDocumentContext(final IFile jspFile,
- final int offset) throws Exception {
- final IModelManager modelManager = StructuredModelManager
- .getModelManager();
-
- IStructuredModel model = null;
-
- model = modelManager.getModelForRead(jspFile);
- Assert.assertTrue(model instanceof DOMModelForJSP);
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(model.getStructuredDocument(), offset);
- return new ContextWrapper(context, model);
- }
-
- public static class ContextWrapper {
- private final IStructuredDocumentContext _context;
- private final IStructuredModel _model;
-
- public ContextWrapper(final IStructuredDocumentContext context,
- final IStructuredModel model) {
- super();
- _context = context;
- _model = model;
- }
-
- public IStructuredDocumentContext getContext() {
- return _context;
- }
-
- public IStructuredModel getModel() {
- return _model;
- }
-
- public void dispose() {
- _model.releaseFromRead();
- }
- }
-
- public static void injectTestTagRegistryFactoryProvider(
- ITagRegistryFactoryProvider abstractTagRegistryFactoryProvider)
- {
- CompositeTagRegistryFactory.getInstance().setTestInjectedProvider(abstractTagRegistryFactoryProvider);
- }
-
- public static ITagRegistryFactoryProvider createSimpleRegistryFactory()
- {
- return new JSPandFaceletTagRegistryFactoryProvider();
- }
-
- private static class JSPandFaceletTagRegistryFactoryProvider extends AbstractTagRegistryFactoryProvider
- {
- @Override
- public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
- {
- Set<IContentType> contentTypes = new HashSet<IContentType>();
- final IContentTypeManager typeManager = Platform.getContentTypeManager();
-
- IContentType jspContentType =
- typeManager.getContentType("org.eclipse.jst.jsp.core.jspsource");
- contentTypes.add(jspContentType);
- Set<ITagRegistryFactoryInfo> infos = new HashSet<ITagRegistryFactoryInfo>();
- infos.add(new MyTagRegistryFactoryInfo(contentTypes, new MyTagRegistryFactory(), "JSP Test Factory", "Test ONLY!!! USER SHOULD NEVER SEE THIS"));
-
- IContentType htmlContentType =
- typeManager.getContentType("org.eclipse.wst.html.core.htmlsource");
- contentTypes.add(htmlContentType);
- infos.add(new MyTagRegistryFactoryInfo(contentTypes, new MyTagRegistryFactory(), "Facelet Test Factory", "Test ONLY!!! USER SHOULD NEVER SEE THIS"));
-
-
- return infos;
- }
- }
-
- private static class MyTagRegistryFactory extends TagRegistryFactory
- {
- private final String _displayName;
-
- MyTagRegistryFactory()
- {
- _displayName = "TEST ONLY!!! YOU SHOULD NOT SEE THIS!!";
- }
-
- public String getDisplayName()
- {
- return _displayName;
- }
-
- @Override
- public ITagRegistry createTagRegistry(IProject project)
- throws TagRegistryFactoryException
- {
- return new MockJSPTagRegistry();
- }
-
- @Override
- public boolean isInstance(IProject project)
- {
- // always create a new one.
- return false;
- }
-
- @Override
- public boolean projectIsValid(IProject project) {
- if (project == null)
- {
- return false;
- }
-
- return true;
- }
-
- }
-
- private static class MyTagRegistryFactoryInfo implements ITagRegistryFactoryInfo
- {
- private final Set<IContentType> _contentTypes;
- private final TagRegistryFactory _factory;
- private final String _id;
- private final String _description;
-
- /**
- * @param contentTypes
- * @param factory
- * @param id
- * @param description
- */
- public MyTagRegistryFactoryInfo(final Set<IContentType> contentTypes,
- TagRegistryFactory factory, String id, String description)
- {
- _contentTypes = contentTypes;
- _factory = factory;
- _id = id;
- _description = description;
- }
-
- public Set<IContentType> getContentTypes()
- {
- return _contentTypes;
- }
-
- public TagRegistryFactory getTagRegistryFactory()
- {
- return _factory;
- }
-
- public String getId()
- {
- return _id;
- }
-
- public String getDescription()
- {
- return _description;
- }
-
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFFacetedTestEnvironment.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFFacetedTestEnvironment.java
deleted file mode 100644
index bae76d6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/JSFFacetedTestEnvironment.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.core.tests.util;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action.Type;
-
-/**
- * Augments a ProjectEnvironment with JSF faceting
- *
- * @author cbateman
- *
- */
-@SuppressWarnings("deprecation")
-public class JSFFacetedTestEnvironment
-{
- private final WebProjectTestEnvironment _projectTestEnvironment;
- private JSFFacetInstallDataModelProvider _modelProvider;
- private IDataModel _model;
-
- /**
- * @param projectTestEnvironment
- */
- public JSFFacetedTestEnvironment(
- final WebProjectTestEnvironment projectTestEnvironment)
- {
- super();
- _projectTestEnvironment = projectTestEnvironment;
- }
-
- /**
- * Initialize the facet
- *
- * @param version --
- * the version of the facet. Valid strings are constant publics
- * on this class starting FACET_VERSION
- */
- public void initialize(final String version) throws CoreException,
- ExecutionException
- {
- final IProject project = _projectTestEnvironment.getTestProject();
- // NO LONGER seeding JSFLib registry if not present
- // call generateJSFLibraryRegistry if needed
-
- _modelProvider = new JSFFacetInstallDataModelProvider();
- _model = DataModelFactory.createDataModel(_modelProvider);
- _model.setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
- project.getName());
-
- final Set<Action> actions = getAddFacetActions(version);
-
- final IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- facetedProject.modify(actions, null);
-
- //Commenting out for [Bug 225130] Failing JSF Junits due to change in FacetProjectCreationOperation
- //FacetProjectCreationOperation.addDefaultFactets(facetedProject, null);
- }
-
- private Set<Action> getAddFacetActions(final String jsfVersion)
- {
- final Set<Action> actions = new HashSet<Action>();
- final IProjectFacetVersion jsfFacet = getJSFFacet(jsfVersion);
-
- actions.add(new IFacetedProject.Action((Type) _model
- .getProperty(IFacetDataModelProperties.FACET_TYPE), jsfFacet,
- _model));
-
- return actions;
- }
-
- private IProjectFacetVersion getJSFFacet(final String version)
- {
- final IProjectFacet facet = ProjectFacetsManager
- .getProjectFacet(IJSFCoreConstants.JSF_CORE_FACET_ID);
- return facet.getVersion(version);
- }
-
- public void generateJSFLibraryRegistry()
- {
- JSFCoreUtilHelper.createJSFLibraryRegistry();
- }
-
- public void addJSFLibraryReference(final JSFLibrary lib, final boolean isDeployed)
- throws CoreException
- {
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(
- this._projectTestEnvironment);
- final IPath path = new Path(
- JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID)
- .append(lib.getID());
-
- IClasspathEntry cpEntry = null;
- if (isDeployed)
- {
- final IClasspathAttribute depAttrib = JavaCore
- .newClasspathAttribute(
- IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
- ClasspathDependencyUtil.getDefaultRuntimePath(true)
- .toString());
- cpEntry = JavaCore.newContainerEntry(path, null,
- new IClasspathAttribute[]
- { depAttrib }, true);
- }
- else
- {
- cpEntry = JavaCore.newContainerEntry(path);
- }
- jdtTestEnv.addClasspathEntry(cpEntry);
- }
-
- /**
- * Dispose of held resources
- */
- public void dispose()
- {
- if (_model != null)
- {
- _model.dispose();
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestCMUtil.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestCMUtil.java
deleted file mode 100644
index 9b0a3f8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestCMUtil.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.util;
-
-import java.util.zip.ZipFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class TestCMUtil extends TestCase {
-
- private WebProjectTestEnvironment _webProject;
- private IProject _project;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80");
-
- final ZipFile zipFile = JSFTestUtil.createZipFile(TestsPlugin.getDefault().getBundle()
- , "/testfiles/testzips/TLDTests.zip");
-
- _webProject = new WebProjectTestEnvironment(this, JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.4"));
- _webProject.createFromZip(zipFile, true);
- assertNotNull(_webProject);
-
- _project = _webProject.getTestProject();
- assertNotNull(_project);
- assertTrue(_project.isAccessible());
-
- }
-
- public void testGetURIFromDoc() {
-
- for (ITaglibRecord tldRec : TaglibIndex.getAvailableTaglibRecords(_project.getFullPath())){
- if (tldRec.getDescriptor().getShortName().equals("tags"))
- assertEquals("/WEB-INF/tags", CMUtil.getURIFromTaglibRecord(tldRec, _project));
- else if (tldRec.getDescriptor().getShortName().equals("moreTags"))
- assertEquals("/WEB-INF/tags/moreTags", CMUtil.getURIFromTaglibRecord(tldRec, _project));
- else if (tldRec.getDescriptor().getShortName().equals("mysample"))
- assertEquals("/WEB-INF/SampleTagLib.tld", CMUtil.getURIFromTaglibRecord(tldRec, _project));
- else if (tldRec.getDescriptor().getShortName().equals("XXXXmysample"))
- assertEquals("/WEB-INF/tlds/XXXXSampleTagLib.tld", CMUtil.getURIFromTaglibRecord(tldRec, _project));
- else if (tldRec.getDescriptor().getShortName().equals("uri-supplied"))
- assertEquals("uri-supplied", CMUtil.getURIFromTaglibRecord(tldRec, _project));
- }
- }
-
- public void testGetURIFromTaglibRecord() {
-
- CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- for (ITaglibRecord tldRec : TaglibIndex.getAvailableTaglibRecords(_project.getFullPath())){
- TLDDocument tldDoc = (TLDDocument)factory.createCMDocument(tldRec);
- if (tldRec.getDescriptor().getShortName().equals("tags"))
- assertEquals("/WEB-INF/tags", CMUtil.getURIFromDoc(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("moreTags"))
- assertEquals("/WEB-INF/tags/moreTags", CMUtil.getURIFromDoc(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("mysample"))
- assertEquals("/WEB-INF/SampleTagLib.tld", CMUtil.getURIFromDoc(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("XXXXmysample"))
- assertEquals("/WEB-INF/tlds/XXXXSampleTagLib.tld", CMUtil.getURIFromDoc(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("uri-supplied"))
- assertEquals("uri-supplied", CMUtil.getURIFromDoc(tldDoc, _project));
- }
- }
-
- public void testIsTagDirDocument() {
-
- CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- for (ITaglibRecord tldRec : TaglibIndex.getAvailableTaglibRecords(_project.getFullPath())){
-
- TLDDocument tldDoc = (TLDDocument)factory.createCMDocument(tldRec);
- if (tldRec.getDescriptor().getShortName().equals("tags"))
- assertTrue(CMUtil.isTagDirDocument(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("moreTags"))
- assertTrue(CMUtil.isTagDirDocument(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("mysample"))
- assertFalse(CMUtil.isTagDirDocument(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("XXXXmysample"))
- assertFalse(CMUtil.isTagDirDocument(tldDoc, _project));
- else if (tldRec.getDescriptor().getShortName().equals("uri-supplied"))
- assertFalse(CMUtil.isTagDirDocument(tldDoc, _project));
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanIntrospector.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanIntrospector.java
deleted file mode 100644
index 34ab6a9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanIntrospector.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.core.tests.util;
-
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.util.JDTBeanIntrospector;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.common.util.JDTBeanPropertyWorkingCopy;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Tester fot he JDTBeanIntrospector class
- *
- * @author cbateman
- *
- */
-public class TestJDTBeanIntrospector extends TestCase
-{
- // TODO: test the getAllMethods. also ensure that we get coverage of the
- // case
- // where a type has no supers
- private JDTTestEnvironment _jdtTestEnvironment;
- private IType _testBean1Type;
- private IType _testBeanSubclassType;
- private IType _testBeanGenericType;
- private IType _testInterface;
- private Map<String, JDTBeanProperty> _properties;
- private Map<String, JDTBeanProperty> _subClassProperties;
- private Map<String, JDTBeanProperty> _genericTypeProperties;
- private Map<String, JDTBeanProperty> _interfaceProperties;
-
- private final static String srcFolderName = "src";
- private final static String packageName1 = "com.test";
- private final static String testBeanName1 = "TestBean1";
- private final static String testBeanSubclassName1 =
- "TestBean1Subclass";
- private final static String testAnotherBeanName = "AnotherBean";
- private final static String testBeanGenericName =
- "TestBeanGeneric";
- private final static String testBeanInterface = "IBeanInterface";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJDTBeanIntrospector_"
- + getClass().getName() + "_" + getName());
- projectTestEnvironment.createProject(true);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
- TestFileResource codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data");
- String code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanName1, code);
-
- _testBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanName1);
- assertNotNull(_testBean1Type);
-
- // load TestBean1Subclass
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1Subclass.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanSubclassName1, code);
-
- _testBeanSubclassType =
- _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanSubclassName1);
- assertNotNull(_testBeanSubclassType);
- // sanity to make sure we don't somehow accidently get the same class
- assertNotSame(_testBean1Type, _testBeanSubclassType);
-
- // load anotherBean
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/AnotherBean.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testAnotherBeanName, code);
-
- assertNotNull(_jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testAnotherBeanName));
-
- // load TestBeanGeneric
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBeanGeneric.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanGenericName, code);
-
- _testBeanGenericType =
- _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanGenericName);
- assertNotNull(_testBeanGenericType);
-
- // load IBeanInterface
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/IBeanInterface.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanInterface, code);
-
- _testInterface = _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanInterface);
- assertNotNull(_testInterface);
- assertTrue(_testInterface.exists());
-
- // introspect after classes loaded to ensure all dependencies
- // are in the project
- JDTBeanIntrospector beanIntrospector =
- new JDTBeanIntrospector(_testBean1Type);
- _properties = beanIntrospector.getProperties();
-
- beanIntrospector = new JDTBeanIntrospector(_testBeanSubclassType);
- _subClassProperties = beanIntrospector.getProperties();
-
- beanIntrospector = new JDTBeanIntrospector(_testBeanGenericType);
- _genericTypeProperties = beanIntrospector.getProperties();
-
- beanIntrospector = new JDTBeanIntrospector(_testInterface);
- _interfaceProperties = beanIntrospector.getProperties();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- final IProject project = _jdtTestEnvironment.getJavaProject().getProject();
-
- try
- {
- project.close(null);
- project.delete(true, null);
- }
- catch (final CoreException ce)
- {
- ce.printStackTrace(System.err);
- }
- }
-
- /**
- * Basic high-level sanity check on the generate properties map
- */
- public void testMapSanity()
- {
- final int NUM_PROPS = 15;
-
- checkMapSanity(_properties, NUM_PROPS);
- // sub class an locally defined property in addition to what
- // is inherited
- checkMapSanity(_subClassProperties, NUM_PROPS + 1);
-
- checkMapSanity(_genericTypeProperties, 6);
- }
-
- private void checkMapSanity(final Map<String, JDTBeanProperty> properties,
- final int numProps)
- {
- assertEquals("Check extra or missing properties", numProps, properties
- .size());
- assertNull("Empty string is invalid property name", properties.get(""));
- assertNull("Null is not a valid property name", properties.get(null));
-
- // ensure type correctness of all values
- for (final JDTBeanProperty value : properties.values())
- {
- // no working copies should slip their way in
- assertFalse(value instanceof JDTBeanPropertyWorkingCopy);
- }
- }
-
- /**
- *
- */
- public void testStringProp1()
- {
- testStringProp1(_properties);
- }
-
- /**
- * Test the inherited stringProp1 property
- */
- public void testStringProp1SubClass()
- {
- testStringProp1(_subClassProperties);
- }
-
- private void testStringProp1(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("stringProp1");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a String", "Ljava.lang.String;",
- property.getTypeSignature());
- assertNotNull("IType should resolve", property.getType());
- }
-
- /**
- *
- */
- public void testBooleanIsProp1()
- {
- testBooleanIsProp1(_properties);
- }
-
- /**
- * Test inherited property
- */
- public void testBooleanIsProp1SubClass()
- {
- testBooleanIsProp1(_subClassProperties);
- }
-
- private void testBooleanIsProp1(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("booleanIsProp1");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a boolean", Signature.SIG_BOOLEAN,
- property.getTypeSignature());
- assertNull("IType won't resolve", property.getType());
- }
-
- /**
- *
- */
- public void testBooleanIsProp2()
- {
- testBooleanIsProp2(_properties);
- }
-
- /**
- * Test inherited property
- */
- public void testBooleanIsProp2SubClass()
- {
- testBooleanIsProp2(_subClassProperties);
- }
-
- private void testBooleanIsProp2(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("booleanIsProp2");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a boolean", Signature.SIG_BOOLEAN,
- property.getTypeSignature());
- assertNull("IType won't resolve", property.getType());
- assertEquals("Make sure the is getter is chosen", "isBooleanIsProp2",
- property.getGetter().getElementName());
- }
-
- /**
- *
- */
- public void testNotBooleanIsProp1()
- {
- testNotBooleanIsProp1(_properties);
- }
-
- /**
- * test inherited
- */
- public void testNotBooleanIsProp1SubClass()
- {
- testNotBooleanIsProp1(_subClassProperties);
- }
-
- /**
- *
- */
- private void testNotBooleanIsProp1(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("notBooleanIsProp1");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a boolean", Signature.SIG_BOOLEAN,
- property.getTypeSignature());
- assertNull("IType won't resolve", property.getType());
- assertEquals("Make sure the get getter is chosen",
- "getNotBooleanIsProp1", property.getGetter().getElementName());
- }
-
- /**
- * test property
- */
- public void testStringProperty2()
- {
- testStringProperty2(_properties);
- }
-
- /**
- * test inherited
- */
- public void testStringProperty2SubClass()
- {
- testStringProperty2(_subClassProperties);
- }
-
- /**
- *
- */
- private void testStringProperty2(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("stringProperty2");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertFalse("No setter for this property", property.isWritable());
- assertEquals("Signature must be for a String", "Ljava.lang.String;",
- property.getTypeSignature());
- assertNotNull("IType should resolve", property.getType());
- }
-
- /**
- *
- */
- public void testReadonlyStringProperty()
- {
- testReadonlyStringProperty(_properties);
- }
-
- /**
- * inherited
- */
- public void testReadonlyStringPropertySubClass()
- {
- testReadonlyStringProperty(_subClassProperties);
- }
-
- /**
- *
- */
- private void testReadonlyStringProperty(
- final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("readonlyStringProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertFalse("No setter for this property", property.isWritable());
- assertEquals("Signature must be for a String", "Ljava.lang.String;",
- property.getTypeSignature());
- assertNotNull("IType should resolve", property.getType());
- }
-
- /**
- * test property
- */
- public void testReadonlyBooleanProperty()
- {
- testReadonlyBooleanProperty(_properties);
- }
-
- /**
- * test inherited property
- */
- public void testReadonlyBooleanPropertySubClass()
- {
- testReadonlyBooleanProperty(_subClassProperties);
- }
-
- /**
- *
- */
- private void testReadonlyBooleanProperty(
- final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("readonlyBooleanProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertFalse("No setter for this property", property.isWritable());
- assertEquals("Signature must be for a boolean", Signature.SIG_BOOLEAN,
- property.getTypeSignature());
- assertNull("IType won't resolve", property.getType());
- }
-
- /**
- *
- */
- public void testWriteonlyStringProperty()
- {
- testWriteonlyStringProperty(_properties);
- }
-
- /**
- * test inherited
- */
- public void testWriteonlyStringPropertySubClass()
- {
- testWriteonlyStringProperty(_subClassProperties);
- }
-
- /**
- *
- */
- private void testWriteonlyStringProperty(
- final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("writeonlyStringProperty");
- assertNotNull(property);
-
- assertFalse("No getter for this property", property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a String", "Ljava.lang.String;",
- property.getTypeSignature());
- assertNotNull("IType should resolve", property.getType());
- }
-
- /**
- * test property
- */
- public void testStringArrayProperty()
- {
- testStringArrayProperty(_properties);
- }
-
- /**
- * test inherited
- */
- public void testStringArrayPropertySubClass()
- {
- testStringArrayProperty(_subClassProperties);
- }
-
- /**
- *
- */
- private void testStringArrayProperty(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("stringArrayProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a String[]", "[Ljava.lang.String;",
- property.getTypeSignature());
- assertNotNull("Should resolve the base type", property.getType());
- assertEquals(1, property.getArrayCount());
- }
-
- /**
- *
- */
- public void testCollectionProperty()
- {
- testCollectionProperty(_properties);
- }
-
- /**
- * test inherited
- */
- public void testCollectionPropertySubClass()
- {
- testCollectionProperty(_subClassProperties);
- }
-
- /**
- *
- */
- private void testCollectionProperty(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("collectionProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a Collection",
- "Ljava.util.Collection;", property.getTypeSignature());
- assertNotNull("Should have a type", property.getType());
- }
-
- /**
- *
- */
- public void testMapProperty()
- {
- testMapProperty(_properties);
- }
-
- /**
- *
- */
- public void testMapPropertySubClass()
- {
- testMapProperty(_subClassProperties);
- }
-
- /**
- *
- */
- private void testMapProperty(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("mapProperty");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for a Map", "Ljava.util.Map;", property
- .getTypeSignature());
- assertNotNull("Should have a type", property.getType());
- }
-
- /**
- * test a locally defined bean type
- */
- public void testAnotherBean()
- {
- testAnotherBean(_properties);
- }
-
- /**
- * test inherited
- */
- public void testAnotherBeanSubClass()
- {
- testAnotherBean(_subClassProperties);
- }
-
- private void testAnotherBean(final Map<String, JDTBeanProperty> properties)
- {
- final JDTBeanProperty property = properties.get("anotherBean");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be for com.test.AnotherBean",
- "Lcom.test.AnotherBean;", property.getTypeSignature());
- assertNotNull("Should have a type", property.getType());
- }
-
- /**
- * Test a property that's in the sub-class but not the parent
- */
- public void testSubclassOnly()
- {
- final String inheritedPropertyName = "locallyDefinedProperty";
-
- // ensure we didn't some how put an inherited property into the
- // parent
- assertNull(_properties.get(inheritedPropertyName));
- final JDTBeanProperty property =
- _subClassProperties.get(inheritedPropertyName);
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- // no setter
- assertFalse(property.isWritable());
- assertEquals("Signature must be for a String", "Ljava.lang.String;",
- property.getTypeSignature());
- assertNotNull("Should have a type", property.getType());
-
- }
-
- public void testGenericListOfStringProperty() throws Exception
- {
- final JDTBeanProperty property = _genericTypeProperties.get("listOfStrings");
- assertEquals(TypeConstants.TYPE_LIST, property.getTypeSignature());
-
- assertEquals(1, property.getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, property
- .getTypeParameterSignatures().get(0));
- }
-
- public void testGenericArrayListOfStringProperty() throws Exception
- {
- final JDTBeanProperty property =
- _genericTypeProperties.get("arrayListOfStrings");
- assertEquals("Ljava.util.ArrayList;", property.getTypeSignature());
-
- assertEquals(1, property.getTypeParameterSignatures().size());
- assertEquals(TypeConstants.TYPE_STRING, property
- .getTypeParameterSignatures().get(0));
- }
-
- public void testGenericListOfListOfStringProperty() throws Exception
- {
- final JDTBeanProperty property =
- _genericTypeProperties.get("listOfListOfStrings");
- assertEquals("Ljava.util.List;", property.getTypeSignature(true));
- assertEquals("Ljava.util.List<Ljava.util.List<Ljava.lang.String;>;>;",
- property.getTypeSignature(false));
-
- assertEquals(1, property.getTypeParameterSignatures().size());
- assertEquals("Ljava.util.List<Ljava.lang.String;>;", property
- .getTypeParameterSignatures().get(0));
- }
-
- public void testGenericMapOfString_StringProperty() throws Exception
- {
- final JDTBeanProperty property =
- _genericTypeProperties.get("mapOfString_String");
- assertEquals("Ljava.util.Map;", property.getTypeSignature(true));
- assertEquals("Ljava.util.Map<Ljava.lang.String;Ljava.lang.String;>;",
- property.getTypeSignature(false));
-
- assertEquals(2, property.getTypeParameterSignatures().size());
- assertEquals("Ljava.lang.String;", property
- .getTypeParameterSignatures().get(0));
- assertEquals("Ljava.lang.String;", property
- .getTypeParameterSignatures().get(1));
- }
-
- // test regression of https://bugs.eclipse.org/bugs/show_bug.cgi?id=197506
- public void testUnboundedProperty_List() throws Exception
- {
- final JDTBeanProperty property = _genericTypeProperties.get("unboundedList");
- assertEquals("Ljava.util.List;", property.getTypeSignature(true));
- assertEquals("Ljava.util.List<Ljava.lang.Object;>;", property
- .getTypeSignature(false));
-
- assertEquals(1, property.getTypeParameterSignatures().size());
- assertEquals("Ljava.lang.Object;", property
- .getTypeParameterSignatures().get(0));
- }
-
- public void testPropertyInheritedFromInterface() throws Exception
- {
- final JDTBeanProperty property = _interfaceProperties.get("inheritedThroughInterface");
- assertNotNull(property);
-
- assertTrue(property.isReadable());
- assertTrue(property.isWritable());
- assertEquals("Signature must be int", Signature.SIG_INT,
- property.getTypeSignature());
- assertNull("IType won't resolve", property.getType());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanPropertyWorkingCopy.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanPropertyWorkingCopy.java
deleted file mode 100644
index 652145b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJDTBeanPropertyWorkingCopy.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.tests.util;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.common.util.JDTBeanPropertyWorkingCopy;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Tests basic operations on the jdt bean property
- *
- * @author cbateman
- *
- */
-public class TestJDTBeanPropertyWorkingCopy extends TestCase
-{
- private JDTTestEnvironment _jdtTestEnvironment;
- private IType _testBean1Type;
-
- private final static String srcFolderName = "src";
- private final static String packageName1 = "com.test";
- private final static String testBeanName1 = "TestBean1";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJDTBeanPropertyWorkingCopy"
- + getClass().getName() + "_" + getName());
- projectTestEnvironment.createProject(true);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- // load TestBean1
- final TestFileResource codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data");
- final String code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanName1, code);
-
- _testBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanName1);
- assertNotNull(_testBean1Type);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- final IProject project = _jdtTestEnvironment.getJavaProject().getProject();
-
- try
- {
- project.close(null);
- project.delete(true, null);
- }
- catch (final CoreException ce)
- {
- ce.printStackTrace(System.err);
- }
- }
-
- /**
- * Test simple dt bean introspection
- */
- public void testSimpleBeanProperty()
- {
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type.getMethod("getStringProp1", new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setStringProp1", new String[]
- { "QString;" });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
-
- workingCopy.addSetter(simpleSetter);
- workingCopy.setGetter(simpleGetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // we provided both a get and set, so should be readable and writable
- assertTrue(beanProperty.isReadable());
- assertTrue(beanProperty.isWritable());
-
- // the getter and setter methods should match the ones we gave
- assertTrue(beanProperty.getGetter() == simpleGetter);
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // the type should resolve to a String
- assertEquals("Ljava.lang.String;",beanProperty.getTypeSignature());
-
- // should be able to resolve the IType
- assertNotNull(beanProperty.getType());
- }
-
- /**
- * Test a simple dt bean based on a boolean "is" getter
- */
- public void testSimpleIsBeanProperty()
- {
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type.getMethod("isBooleanIsProp1", new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setBooleanIsProp1", new String[]
- { Signature.SIG_BOOLEAN });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
-
- workingCopy.addSetter(simpleSetter);
- workingCopy.setGetter(simpleGetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // we provided both a get and set, so should be readable and writable
- assertTrue(beanProperty.isReadable());
- assertTrue(beanProperty.isWritable());
-
- // the getter and setter methods should match the ones we gave
- assertTrue(beanProperty.getGetter() == simpleGetter);
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // the type should resolve to a String
- assertEquals(Signature.SIG_BOOLEAN
- , beanProperty.getTypeSignature());
-
- // should be a boolean so no IType
- assertNull(beanProperty.getType());
- }
-
- /**
- * Assert that where there is both and "is" and "get" accessor for a boolean
- * property, the "is" accessor is always the one that is used
- */
- public void testIsAccessorTakesPrecedence()
- {
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleIsGetter =
- _testBean1Type.getMethod("isBooleanIsProp2", new String[0]);
- final IMethod simpleGetter =
- _testBean1Type.getMethod("getBooleanIsProp2", new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setBooleanIsProp2", new String[]
- { Signature.SIG_BOOLEAN });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
- assertNotNull(simpleIsGetter);
-
- workingCopy.setIsGetter(simpleIsGetter);
- workingCopy.addSetter(simpleSetter);
- workingCopy.setGetter(simpleGetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // we provided both a get and set, so should be readable and writable
- assertTrue(beanProperty.isReadable());
- assertTrue(beanProperty.isWritable());
-
- // the getter and setter methods should match the ones we gave
- // MOST IMPORTANT is that the is getter is selected
- assertTrue(beanProperty.getGetter() == simpleIsGetter);
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // the type should resolve to a String
- assertEquals(Signature.SIG_BOOLEAN
- , beanProperty.getTypeSignature());
-
- // should be a boolean so no IType
- assertNull(beanProperty.getType());
- }
-
- // TODO: this test belongs in the bean introspector tests
- // /**
- // * The is accessor should not be used if it is not a boolean return type
- // */
- // public void testIsAccessorNotUsedIfNotBoolean()
- // {
- // JDTBeanPropertyWorkingCopy workingCopy =
- // new JDTBeanPropertyWorkingCopy(_testBean1Type);
- //
- // IMethod simpleIsGetter = _testBean1Type.getMethod("isNotBooleanIsProp1",
- // new String[0]);
- // IMethod simpleGetter = _testBean1Type.getMethod("getNotBooleanIsProp1",
- // new String[0]);
- // IMethod simpleSetter = _testBean1Type.getMethod("setNotBooleanIsProp1",
- // new String[] {Signature.SIG_BOOLEAN});
- //
- // workingCopy.setIsGetter(simpleIsGetter);
- // workingCopy.addSetter(simpleSetter);
- // workingCopy.setGetter(simpleGetter);
- //
- // JDTBeanProperty beanProperty = workingCopy.toValueObjects();
- // assertNotNull(beanProperty);
- //
- // // we provided both a get and set, so should be readable and writable
- // assertTrue(beanProperty.isReadable());
- // assertTrue(beanProperty.isWritable());
- //
- // // the getter and setter methods should match the ones we gave
- // // MOST IMPORTANT is that the is getter is NOT selected
- // assertTrue(beanProperty.getGetter() == simpleGetter);
- // assertTrue(beanProperty.getSetter() == simpleSetter);
- //
- // // the type should resolve to a String
- // assertTrue(Signature.SIG_BOOLEAN.equals(beanProperty.getTypeSignature()));
- //
- // // should be a boolean so no IType
- // assertNull(beanProperty.getType());
- //
- // }
-
- /**
- * A setter should be ignored if it doesn't match the getter's return type
- */
- public void testDoNotUseSetterIfDoesNotMatchGetterType()
- {
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type.getMethod("getStringProperty2", new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setStringProperty2", new String[]
- { Signature.SIG_INT });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
-
- workingCopy.addSetter(simpleSetter);
- workingCopy.setGetter(simpleGetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // valid getter so readable
- assertTrue(beanProperty.isReadable());
- // setter should be ignored so not writable
- assertFalse(beanProperty.isWritable());
-
- // getter should match
- assertTrue(beanProperty.getGetter() == simpleGetter);
-
- // setter should be null since the one given is ignored
- assertNull(beanProperty.getSetter());
-
- // the type should resolve to a String
- assertEquals("Ljava.lang.String;", beanProperty.getTypeSignature());
-
- // should be an IType for a String
- assertNotNull(beanProperty.getType());
- }
-
- /**
- * test read-only bean properties
- */
- public void testReadonlyBeanProperty()
- {
- // readonly get
- JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type.getMethod("getReadonlyStringProperty",
- new String[0]);
- assertNotNull(simpleGetter);
-
- workingCopy.addSetter(null);
- workingCopy.setGetter(simpleGetter);
-
- JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // valid getter so readable
- assertTrue(beanProperty.isReadable());
- // setter is null so should no be writable
- assertTrue(!beanProperty.isWritable());
-
- // getter should match
- assertTrue(beanProperty.getGetter() == simpleGetter);
-
- // setter should be null
- assertNull(beanProperty.getSetter());
-
- // the type should resolve to a String
- assertEquals("Ljava.lang.String;", beanProperty.getTypeSignature());
-
- // should be an IType for a String
- assertNotNull(beanProperty.getType());
-
- workingCopy = new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- // readonly is getter
- final IMethod isGetter =
- _testBean1Type.getMethod("isReadonlyBooleanProperty",
- new String[0]);
- assertNotNull(isGetter);
-
- workingCopy.addSetter(null);
- workingCopy.setGetter(isGetter);
-
- beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // valid getter so readable
- assertTrue(beanProperty.isReadable());
- // setter null so not writable
- assertFalse(beanProperty.isWritable());
-
- // getter should match the isGetter
- assertTrue(beanProperty.getGetter() == isGetter);
-
- // setter should be null
- assertNull(beanProperty.getSetter());
-
- // the type should resolve to a String
- assertEquals(Signature.SIG_BOOLEAN
- , beanProperty.getTypeSignature());
-
- // should not be an IType for a boolean
- assertNull(beanProperty.getType());
- }
-
- /**
- * Test a simple write-only bean
- */
- public void testWriteonlyBeanProperty()
- {
- // readonly get
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setWriteonlyStringProperty",
- new String[]
- { "QString;" });
- assertNotNull(simpleSetter);
-
- workingCopy.addSetter(simpleSetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // not readable
- assertFalse(beanProperty.isReadable());
- // writable
- assertTrue(beanProperty.isWritable());
-
- // setter should match
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // getter should be null
- assertNull(beanProperty.getGetter());
-
- // the type should resolve to a String
- assertEquals("Ljava.lang.String;", beanProperty.getTypeSignature());
-
- // should be an IType for a String
- assertNotNull(beanProperty.getType());
- }
-
- /**
- *
- */
- public void testStringArrayProperty()
- {
- // readonly get
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type.getMethod("getStringArrayProperty",
- new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setStringArrayProperty", new String[]
- { "[QString;" });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
-
- workingCopy.setGetter(simpleGetter);
- workingCopy.addSetter(simpleSetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // readable
- assertTrue(beanProperty.isReadable());
- // writable
- assertTrue(beanProperty.isWritable());
-
- // getter/setter should match
- assertTrue(beanProperty.getGetter() == simpleGetter);
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // the type should resolve to a String[]
- assertEquals("[Ljava.lang.String;",
- beanProperty.getTypeSignature());
-
- // Should resolve to base type (String)
- assertNotNull(beanProperty.getType());
- }
-
- /**
- *
- */
- public void testCollectionProperty()
- {
- // readonly get
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type
- .getMethod("getCollectionProperty", new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setCollectionProperty", new String[]
- { "QCollection;" });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
-
- workingCopy.setGetter(simpleGetter);
- workingCopy.addSetter(simpleSetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // readable
- assertTrue(beanProperty.isReadable());
- // writable
- assertTrue(beanProperty.isWritable());
-
- // getter/setter should match
- assertTrue(beanProperty.getGetter() == simpleGetter);
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // the type should resolve to java.util.Collection
- assertEquals("Ljava.util.Collection;", beanProperty
- .getTypeSignature());
-
- // should resolve a type
- assertNotNull(beanProperty.getType());
- }
-
- /**
- *
- */
- public void testMapProperty()
- {
- // readonly get
- final JDTBeanPropertyWorkingCopy workingCopy =
- new JDTBeanPropertyWorkingCopy(_testBean1Type);
-
- final IMethod simpleGetter =
- _testBean1Type.getMethod("getMapProperty", new String[0]);
- final IMethod simpleSetter =
- _testBean1Type.getMethod("setMapProperty", new String[]
- { "QMap;" });
- assertNotNull(simpleGetter);
- assertNotNull(simpleSetter);
-
- workingCopy.setGetter(simpleGetter);
- workingCopy.addSetter(simpleSetter);
-
- final JDTBeanProperty beanProperty = workingCopy.toValueObject();
- assertNotNull(beanProperty);
-
- // readable
- assertTrue(beanProperty.isReadable());
- // writable
- assertTrue(beanProperty.isWritable());
-
- // getter/setter should match
- assertTrue(beanProperty.getGetter() == simpleGetter);
- assertTrue(beanProperty.getSetter() == simpleSetter);
-
- // the type should resolve to java.util.Map
- assertEquals("Ljava.util.Map;", beanProperty.getTypeSignature());
-
- // should resolve a type
- assertNotNull(beanProperty.getType());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJSFAppConfigUtils.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJSFAppConfigUtils.java
deleted file mode 100644
index 3f3cdf0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestJSFAppConfigUtils.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.util;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Unit test for JSFAppConfigUtils
- *
- * @author cbateman
- *
- */
-public class TestJSFAppConfigUtils extends TestCase
-{
-
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
- }
-
- public void testIsJSFProject()
- {
- WebProjectTestEnvironment env = createTestEnv(IJSFCoreConstants.FACET_VERSION_1_1, getName());
- assertTrue(JSFAppConfigUtils.isValidJSFProject(env.getTestProject()));
- }
-
- public void testIsNotJSFProject()
- {
- WebProjectTestEnvironment env = createTestEnv(null, getName());
- assertFalse(JSFAppConfigUtils.isValidJSFProject(env.getTestProject()));
- }
-
- public void testIsJSFProjectByVersion()
- {
- WebProjectTestEnvironment env = createTestEnv(IJSFCoreConstants.FACET_VERSION_1_1,getName()+"1");
- assertTrue(JSFAppConfigUtils.isValidJSFProject(env.getTestProject(),IJSFCoreConstants.JSF_VERSION_1_0));
- assertTrue(JSFAppConfigUtils.isValidJSFProject(env.getTestProject(),IJSFCoreConstants.JSF_VERSION_1_1));
- assertFalse(JSFAppConfigUtils.isValidJSFProject(env.getTestProject(), IJSFCoreConstants.JSF_VERSION_1_2));
-
- env = createTestEnv(IJSFCoreConstants.FACET_VERSION_1_2, getName()+"2");
- assertTrue(JSFAppConfigUtils.isValidJSFProject(env.getTestProject(),IJSFCoreConstants.JSF_VERSION_1_0));
- assertTrue(JSFAppConfigUtils.isValidJSFProject(env.getTestProject(),IJSFCoreConstants.JSF_VERSION_1_1));
- assertTrue(JSFAppConfigUtils.isValidJSFProject(env.getTestProject(), IJSFCoreConstants.JSF_VERSION_1_2));
- }
-
- private WebProjectTestEnvironment createTestEnv(String facetVersion, String name)
- {
- WebProjectTestEnvironment testEnv =
- new WebProjectTestEnvironment(this.getClass().getName()+"_"+name);
- testEnv.createProject(true);
- assertNotNull(testEnv);
- assertNotNull(testEnv.getTestProject());
- assertTrue(testEnv.getTestProject().isAccessible());
-
- if (facetVersion != null)
- {
- JSFFacetedTestEnvironment jsfFacedEnv =
- new JSFFacetedTestEnvironment(testEnv);
-
- try
- {
- jsfFacedEnv.initialize(facetVersion);
- }
- catch (CoreException ce)
- {
- // propagate
- throw new RuntimeException(ce);
- } catch (ExecutionException e) {
- // propagate
- throw new RuntimeException(e);
- }
- }
-
- return testEnv;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestTypeUtil.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestTypeUtil.java
deleted file mode 100644
index 4b53ce7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/TestTypeUtil.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.core.tests.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.util.TypeUtil;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestTypeUtil extends TestCase
-{
- private JDTTestEnvironment _jdtTestEnvironment;
- private IType _testBean1Type;
- private IType _testBeanSubclassType;
- private IType _testBeanGenericType;
- private IType _testEnum1Type;
- private IType _binaryType;
-
- // private Map<String, JDTBeanProperty> _properties;
- // private Map<String, JDTBeanProperty> _subClassProperties;
- // private Map<String, JDTBeanProperty> _genericTypeProperties;
-
- private final static String srcFolderName = "src";
- private final static String packageName1 = "com.test";
- private final static String testBeanName1 = "TestBean1";
- private final static String testBeanSubclassName1 = "TestBean1Subclass";
- private final static String testAnotherBeanName = "AnotherBean";
- private final static String testBeanGenericName = "TestBeanGeneric";
- private final static String testEnumName1 = "TestEnum1";
-
- // private final static String testEnumName2 = "TestEnum2";
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- final WebProjectTestEnvironment projectTestEnvironment = new WebProjectTestEnvironment(
- "TestTypeUtil" + getClass().getName() + "_" + getName());
- projectTestEnvironment.createProject(true);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
- TestFileResource codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data");
- String code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanName1, code);
-
- _testBean1Type = _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanName1);
- assertNotNull(_testBean1Type);
-
- // load TestBean1Subclass
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1Subclass.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanSubclassName1, code);
-
- _testBeanSubclassType = _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanSubclassName1);
- assertNotNull(_testBeanSubclassType);
- // sanity to make sure we don't somehow accidently get the same class
- assertNotSame(_testBean1Type, _testBeanSubclassType);
-
- // load anotherBean
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/AnotherBean.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testAnotherBeanName, code);
-
- assertNotNull(_jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testAnotherBeanName));
-
- // load TestBeanGeneric
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBeanGeneric.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testBeanGenericName, code);
-
- _testBeanGenericType = _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testBeanGenericName);
- assertNotNull(_testBeanGenericType);
-
- // load TestEnum1
- codeRes = new TestFileResource();
- codeRes.load(TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestEnum1.java.data");
- code = codeRes.toString();
- _jdtTestEnvironment.addSourceFile(srcFolderName, packageName1,
- testEnumName1, code);
-
- _testEnum1Type = _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + testEnumName1);
- assertNotNull(_testEnum1Type);
- assertTrue(_testEnum1Type.isEnum());
-
- final IClasspathEntry entry = _jdtTestEnvironment.addJarClasspathEntry(
- TestsPlugin.getDefault().getBundle(),
- "/testfiles/signatures.jar");
- assertNotNull(entry);
-
- _binaryType = _jdtTestEnvironment.getJavaProject().findType(
- packageName1 + "." + "BinaryType");
- assertNotNull(_binaryType);
- // 7 methods plus 1 implicit constructor
- assertEquals(7+1, _binaryType.getMethods().length);
-
- // introspect after classes loaded to ensure all dependencies
- // are in the project
- // JDTBeanIntrospector beanIntrospector =
- // new JDTBeanIntrospector(_testBean1Type);
- //
- // _properties = beanIntrospector.getProperties();
- //
- // beanIntrospector =
- // new JDTBeanIntrospector(_testBeanSubclassType);
- //
- // _subClassProperties = beanIntrospector.getProperties();
-
- // beanIntrospector =
- // new JDTBeanIntrospector(_testBeanGenericType);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /**
- * only simple tests required, mainly to assert that the eraseTypeParameters
- * is defaulted to true, since the method should be fully equivalent to
- * resolveTypeSignature(type, signature, true)
- */
- // public void testResolveTypeITypeString() {
- // fail("nbla");
- // }
- public void testResolveTypeSignatureITypeString()
- {
- // this one should be the same regardless of type erasure
- assertEquals(TypeConstants.TYPE_STRING, TypeUtil.resolveTypeSignature(
- _testBean1Type, "QString;", true));
- assertEquals(TypeConstants.TYPE_STRING, TypeUtil.resolveTypeSignature(
- _testBean1Type, "QString;", false));
-
- // no parameters are provided here, so we should see the same result
- assertEquals(TypeConstants.TYPE_COLLECTION, TypeUtil
- .resolveTypeSignature(_testBean1Type, "QCollection;", true));
- assertEquals(TypeConstants.TYPE_COLLECTION, TypeUtil
- .resolveTypeSignature(_testBean1Type, "QCollection;", false));
- assertEquals(TypeConstants.TYPE_MAP, TypeUtil.resolveTypeSignature(
- _testBean1Type, "QMap;", true));
- assertEquals(TypeConstants.TYPE_MAP, TypeUtil.resolveTypeSignature(
- _testBean1Type, "QMap;", false));
-
- // in this case, the provided signature has type erasure, so the answer
- // will different depending on typeErasure flag
- final String typeSigWithErasure = TypeUtil.resolveTypeSignature(
- _testBean1Type, "QMap<QString;QString;>;", true);
- assertEquals(TypeConstants.TYPE_MAP, typeSigWithErasure);
- final String typeSigNoErasure = TypeUtil.resolveTypeSignature(
- _testBean1Type, "QMap<QString;QString;>;", false);
- assertEquals("Ljava.util.Map<Ljava.lang.String;Ljava.lang.String;>;",
- typeSigNoErasure);
-
- // test resolution of type paramaters
- final IType mapType = TypeUtil.resolveType(_jdtTestEnvironment
- .getJavaProject(), "Ljava.util.Map;");
- assertNotNull(mapType);
- assertEquals(TypeConstants.TYPE_JAVAOBJECT, TypeUtil
- .resolveTypeSignature(mapType, "TV;", false));
-
- // unfound signature
- assertEquals("QSomeNotRealClass;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "QSomeNotRealClass;", false));
-
- // arrays
- assertEquals("[I", TypeUtil.resolveTypeSignature(_testBean1Type, "[I"));
-
- assertEquals("[Ljava.lang.String;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "[QString;"));
-
- assertEquals("[Ljava.util.Map;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "[QMap;"));
-
- assertEquals("[Ljava.util.Collection;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "[QCollection;"));
-
- // array of arrays
- assertEquals("[[[Ljava.lang.String;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "[[[QString;"));
-
- // cover cases where wildcards and/or capture are used. All should be
- // equivalent to the case for
- // the same signature without wildcards and capture
-
- // with type erasure
- runWildcardAndCapture(typeSigWithErasure, true);
- // and without type erasure
- runWildcardAndCapture(typeSigNoErasure, false);
- }
-
- private void runWildcardAndCapture(final String expected,
- final boolean typeErasure)
- {
- // extends
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<+QString;+QString;>;", typeErasure));
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<+QString;QString;>;", typeErasure));
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<QString;+QString;>;", typeErasure));
- // super
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<-QString;-QString;>;", typeErasure));
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<-QString;QString;>;", typeErasure));
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<QString;-QString;>;", typeErasure));
- // star
- // this one is distinct because * are converted to Object
- final String expected1 = "Ljava.util.Map"
- + (typeErasure ? ";"
- : "<Ljava.lang.Object;Ljava.lang.Object;>;");
- assertEquals(expected1, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<**>;", typeErasure));
- final String expected2 = "Ljava.util.Map"
- + (typeErasure ? ";"
- : "<Ljava.lang.Object;Ljava.lang.String;>;");
- assertEquals(expected2, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<*QString;>;", typeErasure));
- final String expected3 = "Ljava.util.Map"
- + (typeErasure ? ";"
- : "<Ljava.lang.String;Ljava.lang.Object;>;");
- assertEquals(expected3, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<QString;*>;", typeErasure));
- // capture extends
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<!+QString;!+QString;>;", typeErasure));
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<!+QString;QString;>;", typeErasure));
- assertEquals(expected, TypeUtil.resolveTypeSignature(_testBean1Type,
- "QMap<QString;!+QString;>;", typeErasure));
-
- assertEquals("Ljava.lang.String;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "!+QString;", typeErasure));
-
- // test regression on
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=197506
- assertEquals("Ljava.lang.Object;", TypeUtil.resolveTypeSignature(
- _testBean1Type, "*", typeErasure));
- }
-
- public void testCanNeverBeEqual()
- {
- // one of the arguments is the enum base
- assertFalse(TypeUtil.canNeverBeEqual(TypeConstants.TYPE_ENUM_BASE,
- "Lcom.test.SomeEnum;"));
- assertFalse(TypeUtil.canNeverBeEqual("Lcom.test.SomeEnum;",
- TypeConstants.TYPE_ENUM_BASE));
-
- assertTrue(TypeUtil.canNeverBeEqual("Lcom.test.SomeEnum1;",
- "Lcom.test.SomeEnum2;"));
- assertFalse(TypeUtil.canNeverBeEqual("Lcom.test.SomeEnum1;",
- "Lcom.test.SomeEnum1;"));
- }
-
- public void testIsEnumsCompareCompatible()
- {
- // one of the arguments is the enum base
- assertTrue(TypeUtil.isEnumsCompareCompatible(
- TypeConstants.TYPE_ENUM_BASE, "Lcom.test.SomeEnum;"));
- assertTrue(TypeUtil.isEnumsCompareCompatible("Lcom.test.SomeEnum;",
- TypeConstants.TYPE_ENUM_BASE));
-
- assertFalse(TypeUtil.isEnumsCompareCompatible("Lcom.test.SomeEnum1;",
- "Lcom.test.SomeEnum2;"));
- assertTrue(TypeUtil.isEnumsCompareCompatible("Lcom.test.SomeEnum1;",
- "Lcom.test.SomeEnum1;"));
- }
-
- // public void testResolveTypeSignatureITypeStringBoolean() {
- // fail("Not yet implemented");
- // }
- //
- public void testGetSignature()
- {
- assertEquals("Lcom.test.TestBean1;", TypeUtil
- .getSignature(_testBean1Type));
- }
-
- public void testResolveMethodSignature() throws Exception
- {
- assertEquals("()Ljava.lang.String;", TypeUtil.resolveMethodSignature(
- _testBean1Type, "()QString;"));
- assertEquals("(Ljava.lang.String;)V", TypeUtil.resolveMethodSignature(
- _testBean1Type, "(QString;)V"));
- assertEquals("(Ljava.lang.String;Z)V", TypeUtil.resolveMethodSignature(
- _testBean1Type, "(QString;Z)V"));
-
- IMethod method = _testBean1Type.getMethod("getStringProp1", null);
- assertEquals("()Ljava.lang.String;", TypeUtil.resolveMethodSignature(
- _testBean1Type, method.getSignature()));
-
- method = _testBean1Type.getMethod("setStringProperty2", new String[]
- { "I" });
- assertEquals("(I)V", TypeUtil.resolveMethodSignature(_testBean1Type,
- method.getSignature()));
-
- // test binary methods
- // the framework returns method signatures using "/" instead of "."
- // separators when the IType is BinaryType
-
- // sanity: _binaryType must a JDT BinaryType impl for this test to
- // be valid
- assertTrue(_binaryType.isBinary());
- assertEquals("()Ljava.lang.String;", TypeUtil.resolveMethodSignature(
- _binaryType, _binaryType.getMethod("getStringProperty", null)
- .getSignature()));
-
- assertEquals("(Ljava.lang.String;)V", TypeUtil.resolveMethodSignature(
- _binaryType, _binaryType.getMethod("setStringProperty",
- new String[]
- { "Ljava.lang.String;" }).getSignature()));
-
- assertEquals("()I", TypeUtil.resolveMethodSignature(_binaryType,
- _binaryType.getMethod("getIntegerProperty", null)
- .getSignature()));
-
- assertEquals("(I)V", TypeUtil.resolveMethodSignature(_binaryType,
- _binaryType.getMethod("setIntegerProperty", new String[]
- { "I" }).getSignature()));
-
- assertEquals("()Lcom.test.BinaryPropertyAndMethodType;", TypeUtil
- .resolveMethodSignature(_binaryType, _binaryType.getMethod(
- "getUserDefined", null).getSignature()));
-
- assertEquals("(Lcom.test.BinaryPropertyAndMethodType;)V", TypeUtil
- .resolveMethodSignature(_binaryType, _binaryType.getMethod(
- "setUserDefined", new String[]
- { "Lcom.test.BinaryPropertyAndMethodType;" })
- .getSignature()));
-
- assertEquals(
- "(Ljava.lang.String;Lcom.test.BinaryPropertyAndMethodType;I)I",
- TypeUtil
- .resolveMethodSignature(
- _binaryType,
- _binaryType
- .getMethod(
- "methodWithMultipleArgs",
- new String[]
- {
- "Ljava.lang.String;",
- "Lcom.test.BinaryPropertyAndMethodType;",
- "I" }).getSignature()));
- }
-
- // public void testGetFullyQualifiedName() {
- // fail("Not yet implemented");
- // }
- //
- public void testResolveTypeIJavaProjectString()
- {
- assertNotNull(TypeUtil.resolveType(
- _jdtTestEnvironment.getJavaProject(), "Ljava.lang.String;"));
- assertEquals(_testBean1Type, TypeUtil.resolveType(_jdtTestEnvironment
- .getJavaProject(), "Lcom.test.TestBean1;"));
- }
-
- public void testMatchTypeParameterToArgument() throws Exception
- {
- final IType mapType = TypeUtil.resolveType(_jdtTestEnvironment
- .getJavaProject(), "Ljava.util.Map;");
- assertNotNull(mapType);
-
- final List<String> args = new ArrayList<String>();
- args.add("Ljava.lang.String;");
- args.add("Lcom.test.TestBean1;");
-
- // TestBean1 is the "V" in Map<K,V>
- assertEquals("Lcom.test.TestBean1;", TypeUtil
- .matchTypeParameterToArgument(mapType, "TV;", args));
-
- // there is no "Q" type arg
- assertNull(TypeUtil.matchTypeParameterToArgument(mapType, "TQ;", args));
- // there is no "garbonzo" type arg
- assertNull(TypeUtil.matchTypeParameterToArgument(mapType, "Tgarbonzo;",
- args));
- }
-
- public void testIsEnumMember() throws Exception
- {
- assertTrue(TypeUtil.isEnumMember(_testEnum1Type, "red"));
- assertTrue(TypeUtil.isEnumMember(_testEnum1Type, "blue"));
- assertTrue(TypeUtil.isEnumMember(_testEnum1Type, "green"));
- assertTrue(TypeUtil.isEnumMember(_testEnum1Type, "yellow"));
- assertTrue(TypeUtil.isEnumMember(_testEnum1Type, "purple"));
- assertTrue(TypeUtil.isEnumMember(_testEnum1Type, "orange"));
-
- assertFalse(TypeUtil.isEnumMember(_testEnum1Type, "mauve"));
- assertFalse(TypeUtil.isEnumMember(_testEnum1Type, "pink"));
-
- // test the enum base type.. all things may be members of it
- final IType type = _jdtTestEnvironment.getJavaProject().findType(
- "java.lang.Enum");
- assertNotNull(type);
- // assertTrue(type.isEnum());
- assertTrue(TypeUtil.isEnumMember(type, "red"));
- assertTrue(TypeUtil.isEnumMember(type, "pink"));
- assertTrue(TypeUtil.isEnumMember(type, "anything"));
- assertTrue(TypeUtil.isEnumMember(type, "deadbeef"));
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/UtilSuite.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/UtilSuite.java
deleted file mode 100644
index 6876e95..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/util/UtilSuite.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Runs all util package tests as a suite
- *
- * @author cbateman
- *
- */
-public class UtilSuite {
-
- /**
- * @return the test suite
- */
- public static Test suite() {
- TestSuite suite = new TestSuite("Tests for org.eclipse.jst.jsf.core.tests.util");
- //$JUnit-BEGIN$
-
- suite.addTestSuite(TestJDTBeanPropertyWorkingCopy.class);
- suite.addTestSuite(TestJDTBeanIntrospector.class);
-
- suite.addTestSuite(TestCMUtil.class);
-
- //$JUnit-END$
- return suite;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIReporter.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIReporter.java
deleted file mode 100644
index 8559c84..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIReporter.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-/**
- *
- */
-package org.eclipse.jst.jsf.core.tests.validation;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-class MockIReporter implements IReporter
-{
- private List<IMessage> _messages = new ArrayList<IMessage>();
- private Map<Integer, List<IMessage>> _messagesByOffset =
- new TreeMap<Integer, List<IMessage>>();
-
- public void addMessage(final IValidator origin, final IMessage message)
- {
- _messages.add(message);
-
- // index the message by offset
- getMessageListForOffset(message.getOffset()).add(message);
- }
-
- public void displaySubtask(final IValidator validator, final IMessage message) {
- // do nothing, might eventually want to log this
- }
-
- public List<IMessage> getMessageListForOffset(final int offset)
- {
- List<IMessage> messages = _messagesByOffset.get(offset);
-
- if (messages == null)
- {
- messages = new ArrayList<IMessage>();
- _messagesByOffset.put(offset, messages);
- }
-
- return messages;
- }
-
- public List<IMessage> getMessages() {
- return _messages;
- }
-
- public boolean isCancelled() {
- // do nothing; unused.
- return false;
- }
-
- public void removeAllMessages(final IValidator origin)
- {
- throw new UnsupportedOperationException("This reporter is for specific test purposes only");
- }
-
- public void removeAllMessages(final IValidator origin, final Object object)
- {
- throw new UnsupportedOperationException("This reporter is for specific test purposes only");
- }
-
- public void removeMessageSubset(final IValidator validator, final Object obj,
- final String groupName)
- {
- throw new UnsupportedOperationException("This reporter is for specific test purposes only");
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIValidationContext.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIValidationContext.java
deleted file mode 100644
index 8d35d34..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockIValidationContext.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.validation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-public class MockIValidationContext implements IValidationContext
-{
- private final List<IFile> _files;
-
- public MockIValidationContext(final List<IFile> files)
- {
- _files = files;
- }
-
- public String[] getURIs()
- {
- final List<String> uris = new ArrayList<String>();
-
- for (final IFile file : _files)
- {
- uris.add(file.getFullPath().toString());
- }
- return uris.toArray(new String[uris.size()]);
- }
-
- public Object loadModel(String symbolicName)
- {
- throw new UnsupportedOperationException("currently not used in testing");
- }
-
- public Object loadModel(String symbolicName, Object[] parms)
- {
- throw new UnsupportedOperationException("currently not used in testing");
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockValidationReporter.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockValidationReporter.java
deleted file mode 100644
index a948679..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/MockValidationReporter.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.validation;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import junit.framework.Assert;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.ReporterAdapter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class MockValidationReporter extends ReporterAdapter
-{
- private final List<ReportedProblem> _reportedProblems;
- private Map<Integer, List<ReportedProblem>> _messagesByOffset =
- new TreeMap<Integer, List<ReportedProblem>>();
-
- public MockValidationReporter()
- {
- _reportedProblems = new ArrayList<ReportedProblem>();
- }
-
- @Override
- public void report(Diagnostic diagnostic, int start, int length)
- {
- ReportedProblem problem = new ReportedProblem(diagnostic,start,length);
- _reportedProblems.add(problem);
-
- // index the message by offset
- getMessageListForOffset(start).add(problem);
- }
-
- @Override
- public void report(IMessage message)
- {
- final ReportedProblem problem = new ReportedProblem(message);
- _reportedProblems.add(problem);
-
- // index the message by offset
- getMessageListForOffset(message.getOffset()).add(problem);
- }
-
- public void reset()
- {
- _reportedProblems.clear();
- _messagesByOffset.clear();
- }
-
- public List<ReportedProblem> getReportedProblems()
- {
- return Collections.unmodifiableList(_reportedProblems);
- }
-
- public List<ReportedProblem> getMessageListForOffset(final int offset)
- {
- List<ReportedProblem> messages = _messagesByOffset.get(offset);
-
- if (messages == null || messages.size() == 0)
- {
- for (final Map.Entry<Integer, List<ReportedProblem>> entry : _messagesByOffset.entrySet())
- {
- int entryOffset = entry.getKey().intValue();
- // if the offset looked for is within +/-5 of an entry,
- // dump it to stderr for debugging slightly off offsets
- if (offset >= entryOffset - 5 && offset <= entryOffset+5)
- {
- System.err.printf("Offset %d requested not found but close is: %d", offset, entryOffset);
- }
- }
- messages = new ArrayList<ReportedProblem>();
- _messagesByOffset.put(offset, messages);
- }
-
- return messages;
- }
-
- public void assertExpectedMessage(
- final int offset, final int length, final int severity)
- {
- assertExpectedMessage(offset, length, severity, null);
- }
-
- public void assertExpectedMessage(
- final int offset, final int length, final int severity, final Integer code)
- {
- final List<ReportedProblem> reportedProblems = getMessageListForOffset(offset);
-
- Assert.assertTrue(reportedProblems.size() > 0);
-
- for (final ReportedProblem problem : reportedProblems)
- {
- if (problem.getLength() == length && problem.getSeverity() == severity)
- {
- if (code == null || code == Integer.valueOf(problem.getErrorCode()))
- {
- // we found the expected message
- return;
- }
- }
- }
-
- String failMessage = "";
-
- for (final ReportedProblem problem : reportedProblems)
- {
- failMessage +=
- String.format("\n at offset offset %d, code=%d, length=%d, message=%s", problem.getOffset(),
- problem.getErrorCode(), problem.getLength(), problem.getText());
- }
- Assert.fail(String.format(
- "Failed to find expected message at offset %d%s, length %d, found instead %s"
- , offset, length, (code == null ? "" : ", with errorCode "+code), failMessage));
-
- }
-
- public static class ReportedProblem
- {
- private final int _offset;
- private final int _length;
- private final int _severity;
- private final String _text;
- private final int _errorCode;
-
- public ReportedProblem(final Diagnostic problem, final int start, final int length)
- {
- _severity = convertSeverity(problem);
- _offset = start;
- _length = length;
- _text = problem.getMessage();
- _errorCode = problem.getCode();
- }
-
- private ReportedProblem(final IMessage message)
- {
- _severity = message.getSeverity();
- _offset = message.getOffset();
- _length = message.getLength();
- _text = message.getText();
- _errorCode = -1;
- }
-
- /**
- * @param severity
- * @return a Message severity equivilent to diagnostic.getSeverity()
- */
- private static int convertSeverity(final Diagnostic problem)
- {
- switch (problem.getSeverity())
- {
- case Diagnostic.ERROR:
- return IMessage.HIGH_SEVERITY;
- case Diagnostic.WARNING:
- return IMessage.NORMAL_SEVERITY;
- case Diagnostic.INFO:
- return IMessage.LOW_SEVERITY;
- case Diagnostic.OK:
- default:
- // no bits set
- return 0;
- }
- }
-
- public int getOffset()
- {
- return _offset;
- }
-
- public int getLength()
- {
- return _length;
- }
-
- public int getSeverity()
- {
- return _severity;
- }
-
- public String getText()
- {
- return _text;
- }
-
- public int getErrorCode()
- {
- return _errorCode;
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticValidation_AttrValueConverter.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticValidation_AttrValueConverter.java
deleted file mode 100644
index aba04d9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticValidation_AttrValueConverter.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.validation;
-
-import java.util.zip.ZipFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsf.validation.internal.XMLViewDefnValidator;
-import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class TestJSPSemanticValidation_AttrValueConverter extends TestCase
-{
- private WebProjectTestEnvironment _webProject;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.uk.oracle.com", "80");
-
- final ZipFile zipFile = JSFTestUtil.createZipFile(TestsPlugin
- .getDefault().getBundle(),
- "/testfiles/testzips/valueHolderTest11.zip");
-
- _webProject = new WebProjectTestEnvironment(this,
- JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet(
- "jst.web").getVersion("2.4"));
- _webProject.createFromZip(zipFile, true);
-
- // initialize test case for faces 1.1
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(
- _webProject);
- // jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- JSFCoreUtilHelper.addJSFRuntimeJarsToClasspath(JSFVersion.V1_1,
- jsfFacedEnv);
- }
-
- public void testSanity() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path(
- "WebContent/Case1_NoExplicitConverter.jspx"));
- assertTrue(jspFile.isAccessible());
-
- IStructuredModel jspModel = null;
- try
- {
- jspModel = StructuredModelManager.getModelManager()
- .getModelForRead(jspFile);
- assert (jspModel instanceof DOMModelForJSP);
- }
- finally
- {
- if (jspModel != null)
- {
- jspModel.releaseFromRead();
- }
- }
- }
-
- public void testCase1_NoExplicitConverter() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path(
- "WebContent/Case1_NoExplicitConverter.jspx"));
- assertTrue(jspFile.isAccessible());
-
- final MockValidationReporter mockReporter = new MockValidationReporter();
- final XMLViewDefnValidator validator = new XMLViewDefnValidator();
- validator.validateView(jspFile, mockReporter);
- assertEquals(1, mockReporter.getReportedProblems().size());
-
- mockReporter.assertExpectedMessage(10683, 27, IMessage.NORMAL_SEVERITY);
- }
-
- public void testCase1a_NoExplicitConverterWithForClass() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path(
- "WebContent/Case1a_NoExplicitConverterWithForClass.jspx"));
- assertTrue(jspFile.isAccessible());
-
- final MockValidationReporter mockReporter = new MockValidationReporter();
- final XMLViewDefnValidator validator = new XMLViewDefnValidator();
- validator.validateView(jspFile, mockReporter);
- assertEquals(0, mockReporter.getReportedProblems().size());
- }
-
- public void testCase2_ExplicitConverterKnown() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path(
- "WebContent/Case2_ExplicitConverterKnown.jspx"));
- assertTrue(jspFile.isAccessible());
-
- final MockValidationReporter mockReporter = new MockValidationReporter();
- final XMLViewDefnValidator validator = new XMLViewDefnValidator();
- validator.validateView(jspFile, mockReporter);
- assertEquals(11, mockReporter.getReportedProblems().size());
-
- mockReporter.assertExpectedMessage(2410, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(2509, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(2612, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(2717, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(2832, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(2950, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(3060, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(3169, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(3282, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(3398, 29, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(3510, 29, IMessage.NORMAL_SEVERITY);
- }
-
- public void testCase2_ExplicitUnknownConverter() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path(
- "WebContent/Case3_ExplicitUnknownConverter.jspx"));
- assertTrue(jspFile.isAccessible());
-
- final MockValidationReporter mockReporter = new MockValidationReporter();
- final XMLViewDefnValidator validator = new XMLViewDefnValidator();
- validator.validateView(jspFile, mockReporter);
- assertEquals(1, mockReporter.getReportedProblems().size());
-
- mockReporter.assertExpectedMessage(804, 29, IMessage.NORMAL_SEVERITY);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_AttributeValues.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_AttributeValues.java
deleted file mode 100644
index 86bcab1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_AttributeValues.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.validation;
-
-import java.util.zip.ZipFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.common.internal.types.TypeComparatorDiagnosticFactory;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsf.validation.internal.XMLViewDefnValidator;
-import org.eclipse.jst.jsf.validation.internal.strategy.ContainmentValidatingStrategy;
-import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class TestJSPSemanticsValidator_AttributeValues extends TestCase
-{
- private WebProjectTestEnvironment _webProject;
- private boolean _containmentValidationEnabled;
-
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80");
-
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=296496
- final ZipFile zipFile = JSFTestUtil.createZipFile(TestsPlugin.getDefault().getBundle()
- , "/testfiles/testzips/ValidationTestProject1.zip");
-
- _webProject = new WebProjectTestEnvironment(this, JavaFacetUtils.JAVA_50, ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.4"));
- _webProject.createFromZip(zipFile, true);
- */
- final ZipFile zipFile = JSFTestUtil.createZipFile(
- TestsPlugin.getDefault().getBundle(),
- "/testfiles/testzips/ValidationTestProject2.zip");
- _webProject = new WebProjectTestEnvironment(
- this,
- JavaFacet.VERSION_1_5,
- ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.4"));
- _webProject.createFromZip2(zipFile, true);
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(JSFCoreUtilHelper.createSimpleRegistryFactory());
- Job.getJobManager().beginRule(_webProject.getTestProject(), null);
- _containmentValidationEnabled = ContainmentValidatingStrategy.isEnabled();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- Job.getJobManager().endRule(_webProject.getTestProject());
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(null);
- }
-
- public void testSanity() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path("WebContent/NonELValidation.jsp"));
- assertTrue(jspFile.isAccessible());
-
- IStructuredModel jspModel = null;
- try
- {
- jspModel = StructuredModelManager.getModelManager().getModelForRead(jspFile);
- assert(jspModel instanceof DOMModelForJSP);
- }
- finally
- {
- if (jspModel != null)
- {
- jspModel.releaseFromRead();
- }
- }
- }
-
- public void testNonELValidation() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path("WebContent/NonELValidation.jsp"));
- assertTrue(jspFile.isAccessible());
-
- final MockValidationReporter mockReporter = new MockValidationReporter();
- final XMLViewDefnValidator validator = new XMLViewDefnValidator();
- validator.validateView(jspFile, mockReporter);
-
- // there should only be 3, but because we don't want to have the jars
- // in the path, we trigger a containment warning on the loadBundle
- // since the f:view in the doc can't be fully resolved.
- assertEquals(_containmentValidationEnabled ? 4 : 3, mockReporter.getReportedProblems().size());
-
- mockReporter.assertExpectedMessage(591, 25, IMessage.HIGH_SEVERITY);
- mockReporter.assertExpectedMessage(936, 1, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(969, 9, IMessage.NORMAL_SEVERITY);
- }
-
- public void testELValidation() throws Exception
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path("WebContent/ELValidation.jsp"));
- assertTrue(jspFile.isAccessible());
-
- final MockValidationReporter mockReporter = new MockValidationReporter();
- final XMLViewDefnValidator validator = new XMLViewDefnValidator();
- validator.validateView(jspFile, mockReporter);
-
- // there should only be 5, but because we don't want to have the jars
- // in the path, we trigger a containment warning on the loadBundle
- // since the f:view in the doc can't be fully resolved.
- // at 845 we also get two, one for syntax error and one for missing bracket
- assertEquals(_containmentValidationEnabled ? 10 : 9, mockReporter.getReportedProblems().size());
-
- mockReporter.assertExpectedMessage(603, 2, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(648, 4, IMessage.NORMAL_SEVERITY);
- // the default severity for no var messages is now low.
- mockReporter.assertExpectedMessage(696, 5, IMessage.LOW_SEVERITY);
- mockReporter.assertExpectedMessage(753, 6, IMessage.NORMAL_SEVERITY);
- mockReporter.assertExpectedMessage(802, 4, IMessage.HIGH_SEVERITY);
-
- // two on this one: syntax error and missing bracket
- mockReporter.assertExpectedMessage(846, 5, IMessage.HIGH_SEVERITY);
- mockReporter.assertExpectedMessage(847, 3, IMessage.NORMAL_SEVERITY);
-
- mockReporter.assertExpectedMessage(946, 24, IMessage.NORMAL_SEVERITY, TypeComparatorDiagnosticFactory.PROPERTY_NOT_WRITABLE_ID);
-
- mockReporter.assertExpectedMessage(1015, 40, IMessage.HIGH_SEVERITY);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_Containment.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_Containment.java
deleted file mode 100644
index 4ae6ba8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_Containment.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.validation;
-
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.core.internal.region.Region2ElementAdapter;
-import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsf.validation.internal.JSFValidationContext;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator.IValidationReporter;
-import org.eclipse.jst.jsf.validation.internal.el.diagnostics.DiagnosticFactory;
-import org.eclipse.jst.jsf.validation.internal.strategy.ContainmentValidatingStrategy;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * White box testing that validation of tag containment skips JSP fragments
- * and only marks the first instance of a tag containment problem
- *
- * @author cbateman
- *
- */
-public class TestJSPSemanticsValidator_Containment extends TestCase
-{
- private WebProjectTestEnvironment _testEnv;
- private IFile _jspFile;
- private IFile _jspFragmentFile;
- private IStructuredModel _jspStructuredModel;
- private IStructuredDocument _jspStructuredDocument;
- private IStructuredModel _jspFragStructuredModel;
- private IStructuredDocument _jspFragStructuredDocument;
- private boolean _containmentValidationEnabled;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- _testEnv = new WebProjectTestEnvironment("ContainmentValidationTest"+this.getClass().getName()+"_"+getName());
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- // load a dummy tld for core
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/jsf-core.tld.data", "META-INF/jsf-core.tld");
-
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/myfaces_html.tld.data", "META-INF/myfaces_html.tld");
-
- _jspFile = (IFile)
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/jsps/testContainment.jsp.data", "testContainment.jsp");
-
- _jspStructuredModel = StructuredModelManager.getModelManager().getModelForRead(_jspFile);
- _jspStructuredDocument = _jspStructuredModel.getStructuredDocument();
-
- _jspFragmentFile = (IFile)
- _testEnv.loadResourceInWebRoot(TestsPlugin.getDefault().getBundle()
- , "/testfiles/jsps/testContainment.jsp.data", "testContainment.jsf");
-
- _jspFragStructuredModel = StructuredModelManager.getModelManager().getModelForRead(_jspFile);
- _jspFragStructuredDocument = _jspFragStructuredModel.getStructuredDocument();
-
- // initialize test case for faces 1.1
- final JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _containmentValidationEnabled = ContainmentValidatingStrategy.isEnabled();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if (_jspStructuredModel != null)
- {
- _jspStructuredModel.releaseFromRead();
- }
-
- if (_jspFragStructuredModel != null)
- {
- _jspFragStructuredModel.releaseFromRead();
- }
- }
-
- public void testContainmentInJSP() throws Exception
- {
- // instantiate the validator once since this is how it would
- // called against a single file. This is critical to test
- // that only the first instance of improper containment
- // gets flagged.
- final MockValidationReporter reporter = new MockValidationReporter();
- final ContainmentValidatingStrategy validator =
- createContainmentValidator(_jspFile, reporter);
-
- final IStructuredDocumentContext correctlyNested =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_jspStructuredDocument, 487);
- checkTag(correctlyNested, validator, reporter, 0);
- reporter.reset();
-
- final IStructuredDocumentContext firstIncorrectlyNested =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_jspStructuredDocument, 538);
- checkTag(firstIncorrectlyNested, validator, reporter, _containmentValidationEnabled ? 1 : 0);
- reporter.reset();
-
- final IStructuredDocumentContext secondIncorrectlyNested =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_jspStructuredDocument, 568);
- checkTag(secondIncorrectlyNested, validator, reporter, 0);
- reporter.reset();
- }
-
- public void testContainmentInJSPFrag() throws Exception
- {
- // instantiate the validator once since this is how it would
- // called against a single file. This is critical to test
- // that only the first instance of improper containment
- // gets flagged.
- final MockValidationReporter reporter = new MockValidationReporter();
- final ContainmentValidatingStrategy validator =
- createContainmentValidator(_jspFragmentFile, reporter);
-
- { // should all be zero, since no contain validation in jsp frags
- final IStructuredDocumentContext correctlyNested =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_jspFragStructuredDocument, 487);
- checkTag(correctlyNested, validator, reporter, 0);
- reporter.reset();
- }
-
- { // should all be zero, since no contain validation in jsp frags
- final IStructuredDocumentContext firstIncorrectlyNested =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_jspFragStructuredDocument, 538);
- checkTag(firstIncorrectlyNested, validator, reporter, 0);
- reporter.reset();
- }
-
- { // should all be zero, since no contain validation in jsp frags
- final IStructuredDocumentContext secondIncorrectlyNested =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_jspFragStructuredDocument, 568);
- checkTag(secondIncorrectlyNested, validator, reporter, 0);
- reporter.reset();
- }
- }
-
- private void checkTag(final IStructuredDocumentContext context
- , final ContainmentValidatingStrategy validator
- , MockValidationReporter reporter
- , final int expectedCount) throws Exception
- {
- final IndexedRegion region = JSFTestUtil.getIndexedRegion
- ((IStructuredDocument) context.getStructuredDocument()
- , context.getDocumentPosition());
-
- final IDOMNode domNode = (IDOMNode) region;
- final Node node = (Node) region;
- assertTrue(node instanceof Element);
- final Element elem = (Element) node;
- assertEquals(IJSFConstants.TAG_INPUTTEXT, elem.getLocalName());
- System.out.println(CMUtil.getElementNamespaceURI(elem));
-
- validator.validate(
- new Region2ElementAdapter(domNode.getFirstStructuredDocumentRegion()));
-
- assertEquals(expectedCount, reporter.getReportedProblems().size());
- }
-
- private ContainmentValidatingStrategy createContainmentValidator(final IFile file,
- IValidationReporter reporter)
- {
- final ValidationPreferences prefs = new ValidationPreferences(
- JSFCorePlugin.getDefault().getPreferenceStore());
- prefs.load();
- final DiagnosticFactory diagnosticFactory = new DiagnosticFactory();
-
- final IDTViewHandler viewHandler = DTAppManagerUtil
- .getViewHandler(file.getProject());
-
- final JSFValidationContext validationContext =
- new JSFValidationContext(
- false, prefs, viewHandler,
- diagnosticFactory, file, reporter,
- null);
-
- return new ContainmentValidatingStrategy(validationContext);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/XMLViewDefnValidatorTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/XMLViewDefnValidatorTests.java
deleted file mode 100644
index 5dba2d3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/XMLViewDefnValidatorTests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.core.tests.validation;
-
-import java.util.zip.ZipFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * General testing for the XMLViewDefnValidator.
- *
- * @author cbateman
- *
- */
-public class XMLViewDefnValidatorTests extends TestCase
-{
- private WebProjectTestEnvironment _webProject;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- final ZipFile zipFile = JSFTestUtil.createZipFile(TestsPlugin.getDefault().getBundle()
- , "/testfiles/testzips/ValidationTestProject1.zip");
-
- _webProject = new WebProjectTestEnvironment(this, JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.4"));
- _webProject.createFromZip(zipFile, true);
- }
-
- public void testSanity()
- {
- final IProject project = _webProject.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
-
- final IFile jspFile = project.getFile(new Path("WebContent/NonELValidation.jsp"));
- assertTrue(jspFile.isAccessible());
- }
-
- public void testUnzip()
- {
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/test.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/test.xml
deleted file mode 100644
index c1b2c7c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.."/> -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jst.jsf.core.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.jst.jsf.core.tests.*xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jsf-folder" value="${eclipse-home}/jsf_folder"/>
- <delete dir="${jsf-folder}" quiet="true"/>
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jsf-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jst.jsf.core.tests.AllTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.jst.jsf.core.tests.*xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/AnotherBean.java.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/AnotherBean.java.data
deleted file mode 100644
index 0fc24ed..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/AnotherBean.java.data
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.test;
-
-public class AnotherBean
-{
- public String getProperty();
- {
- return "";
- }
-
- public void setProperty(String prop)
- {
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/IBeanInterface.java.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/IBeanInterface.java.data
deleted file mode 100644
index 3759441..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/IBeanInterface.java.data
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.test;
-
-public interface IBeanInterface
-{
- int getInheritedThroughInterface();
- void setInheritedThroughInterface(int value);
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-beanutils-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-beanutils-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-beanutils-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-collections-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-collections-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-collections-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-digester-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-digester-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-digester-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-logging-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-logging-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/commons-logging-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-api-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-api-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-api-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-impl-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-impl-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jsf-impl-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jstl-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jstl-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/jstl-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/EmptyJSFLibraryRegistryV1.xml.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/EmptyJSFLibraryRegistryV1.xml.data
deleted file mode 100644
index 8a52566..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/EmptyJSFLibraryRegistryV1.xml.data
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<jsflibreg:JSFLibraryRegistry xmlns:jsflibreg="http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd"/> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1.xml.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1.xml.data
deleted file mode 100644
index c589157..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1.xml.data
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<jsflibreg:JSFLibraryRegistry xmlns:jsflibreg="http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd">
-<JSFLibraries ID="1173982473046" Name="ri" Deployed="false" Implementation="true">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/myfaces-impl-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-beanutils-1.7.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-codec-1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-collections-3.1.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-digester-1.6.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-el-1.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-lang-2.1.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-logging-1.0.4.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/jstl-1.1.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/myfaces-api-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
- <JSFLibraries ID="1173982919437" Name="tomahawk" Deployed="false">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomahawk/tomahawk-1.1.3/lib/tomahawk-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
- <JSFLibraries ID="1173984147125" Name="sun-ri" Deployed="false" Implementation="true">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jstl.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-beanutils.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-collections.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-digester.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-logging.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jsf-api.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jsf-impl.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
-</jsflibreg:JSFLibraryRegistry> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1_expectedMigrationResult.xml.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1_expectedMigrationResult.xml.data
deleted file mode 100644
index b0277be..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV1_expectedMigrationResult.xml.data
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<jsflibreg:JSFLibraryRegistry xmlns:jsflibreg="http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd">
- <JSFLibraries Name="ri" Deployed="false" Implementation="true">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/myfaces-impl-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-beanutils-1.7.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-codec-1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-collections-3.1.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-digester-1.6.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-el-1.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-lang-2.1.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-logging-1.0.4.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/jstl-1.1.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/myfaces-api-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
- <JSFLibraries Name="tomahawk" Deployed="false">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomahawk/tomahawk-1.1.3/lib/tomahawk-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
- <JSFLibraries Name="sun-ri" Deployed="false" Implementation="true">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jstl.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-beanutils.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-collections.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-digester.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-logging.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jsf-api.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jsf-impl.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
-</jsflibreg:JSFLibraryRegistry>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV2.xml.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV2.xml.data
deleted file mode 100644
index 065ad6b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/registryFiles/ValidNonEmptyJSFLibraryRegistryV2.xml.data
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<jsflibreg:JSFLibraryRegistry xmlns:jsflibreg="http://www.eclipse.org/webtools/jsf/schema/jsflibraryregistry.xsd" DefaultImplementationID="ri">
- <JSFLibraries Name="ri" Deployed="false" Implementation="true">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/myfaces-impl-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-beanutils-1.7.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-codec-1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-collections-3.1.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-digester-1.6.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-el-1.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-lang-2.1.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/commons-logging-1.0.4.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/jstl-1.1.0.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/myfaces/myfaces-core-1.1.3/lib/myfaces-api-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
- <JSFLibraries Name="tomahawk" Deployed="false">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomahawk/tomahawk-1.1.3/lib/tomahawk-1.1.3.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
- <JSFLibraries Name="sun-ri" Deployed="false" Implementation="true">
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jstl.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-beanutils.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-collections.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-digester.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/commons-logging.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jsf-api.jar" RelativeDestLocation="WEB-INF/lib"/>
- <ArchiveFiles RelativeToWorkspace="false" SourceLocation="C:/cam/tomcat/apache-tomcat-5.5.15/server/lib/jsf-impl.jar" RelativeDestLocation="WEB-INF/lib"/>
- </JSFLibraries>
-</jsflibreg:JSFLibraryRegistry> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/standard-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/standard-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/JSFLib/standard-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1.java.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1.java.data
deleted file mode 100644
index e3a5304..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1.java.data
+++ /dev/null
@@ -1,141 +0,0 @@
-package com.test;
-
-import java.util.*;
-
-public class TestBean1
-{
-// simple bean properties
- public String getStringProp1()
- {
- return "";
- }
-
- public void setStringProp1(String prop)
- {
- }
-
-// simple boolean with is getter
- public boolean isBooleanIsProp1()
- {
- return true;
- }
-
- public void setBooleanIsProp1(boolean property)
- {
- }
-
-// boolean "is" takes precedence over get
- public boolean isBooleanIsProp2()
- {
- return true;
- }
-
- public boolean getBooleanIsProp2()
- {
- return false;
- }
-
- public void setBooleanIsProp2(boolean property)
- {
- }
-
-// don't use is getter when type is not boolean
- public String isNotBooleanIsProp1()
- {
- return "";
- }
-
- public boolean getNotBooleanIsProp1()
- {
- return true;
- }
-
- public void setNotBooleanIsProp1(boolean property)
- {
- }
-
-// don't use setter if parameter is not matching the getter
- public String getStringProperty2()
- {
- return "";
- }
-
- // incorrect parameter -- should be String
- public void setStringProperty2(int wrongParam)
- {
- }
-
- // readonly property -- no setter
- public String getReadonlyStringProperty()
- {
- return "readonly";
- }
-
- // readonly is property -- no setter
- public boolean isReadonlyBooleanProperty()
- {
- return true;
- }
-
- // write only property -- no getter
- public void setWriteonlyStringProperty(String val)
- {
- return "blah";
- }
-
-// bogus getter -- "" is not a bean name
- public String get()
- {
- return "";
- }
-
-// String array getter
- public String[] getStringArrayProperty()
- {
- }
-
- public void setStringArrayProperty(String[] arrayProp)
- {
-
- }
-
-// Collection property
- public Collection getCollectionProperty()
- {
- return new ArrayList();
- }
-
- public void setCollectionProperty(Collection prop)
- {
- }
-
-// Map property
- public Map getMapProperty()
- {
- return new HashMap();
- }
-
- public void setMapProperty(Map prop)
- {
- }
-
-// Another bean property
- public AnotherBean getAnotherBean()
- {
- return null;
- }
-
- public void setAnotherBean(AnotherBean anotherBean)
- {
- }
-// Int array property
- public int[] getIntArrayProperty()
- {
- return new int[] {0,1,2};
- }
-// array of array of string
- public String[][] getArrayOfArrayOfStringProperty()
- {
- return new String[3][];
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1Subclass.java.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1Subclass.java.data
deleted file mode 100644
index 8662033..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBean1Subclass.java.data
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.test;
-
-
-public class TestBean1Subclass extends TestBean1
-{
- public String getLocallyDefinedProperty()
- {
- return "";
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBeanGeneric.java.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBeanGeneric.java.data
deleted file mode 100644
index ace0225..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestBeanGeneric.java.data
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.test;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-
-public class TestBeanGeneric
-{
- public List<String> getListOfStrings()
- {
- return new ArrayList<String>();
- }
-
- public ArrayList<String> getArrayListOfStrings()
- {
- return new ArrayList<String>();
- }
-
- public List<List<String>> getListOfListOfStrings()
- {
- return new ArrayList<List<String>>();
- }
-
- public Map<String, String> getMapOfString_String()
- {
- return new HashMap<String, String>();
- }
-
- public List<?> getUnboundedList()
- {
- return new ArrayList<Object>();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestEnum1.java.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestEnum1.java.data
deleted file mode 100644
index 203499c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/TestEnum1.java.data
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.eclipse.jst.jsf.core.tests.util;
-
-public enum TestEnum1
-{
- red, blue, green, yellow, orange, purple
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2.jar
deleted file mode 100644
index 7e369c6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2_nofacesconfig.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2_nofacesconfig.jar
deleted file mode 100644
index 1f3a814..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/fail2_nofacesconfig.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/noextdata.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/noextdata.jar
deleted file mode 100644
index 380fe7f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/noextdata.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/withextdata.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/withextdata.jar
deleted file mode 100644
index 2cf0da5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/appconfig/withextdata.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-all-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-all-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-all-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-api-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-api-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-api-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-impl-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-impl-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/faces-impl-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_1.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_1.xml
deleted file mode 100644
index fbc7d0f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_1.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config>
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_2.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_2.xml
deleted file mode 100644
index ddd61c7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-1_2.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
- version="1.2">
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-2_0.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-2_0.xml
deleted file mode 100644
index f711d93..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/expected-faces-config-2_0.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/jsflibrary-api-1.1.3.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/jsflibrary-api-1.1.3.jar
deleted file mode 100644
index f4fac81..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/jsflibrary-api-1.1.3.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/no-version-entry/jsflibrary-api-1.1.3.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/no-version-entry/jsflibrary-api-1.1.3.jar
deleted file mode 100644
index 5cff505..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/no-version-entry/jsflibrary-api-1.1.3.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/nonstandard_implementation_version/jsflibrary-api-1.1.3.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/nonstandard_implementation_version/jsflibrary-api-1.1.3.jar
deleted file mode 100644
index 4bc7917..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/facet/nonstandard_implementation_version/jsflibrary-api-1.1.3.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsf-core.tld.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsf-core.tld.data
deleted file mode 100644
index b54e2ea..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsf-core.tld.data
+++ /dev/null
@@ -1,30 +0,0 @@
-<taglib xmlns="http://java.sun.com/JSP/TagLibraryDescriptor">
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>f</short-name>
- <uri>http://java.sun.com/jsf/core</uri>
- <display-name>JSF core tag library.</display-name>
- <description>
- This tag library implements the standard JSF core tags.
- </description>
-
- <tag>
- <name>view</name>
- <tag-class>org.apache.myfaces.taglib.core.ViewTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Creates a JSF View, which is a container that holds all of the
- components that are part of the view.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>locale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The locale of this view. Default: the default locale from the configuration file.</description>
- </attribute>
- </tag>
-
-
-</taglib>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/NonELAttributeValues.jsp.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/NonELAttributeValues.jsp.data
deleted file mode 100644
index e69de29..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/NonELAttributeValues.jsp.data
+++ /dev/null
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testContainment.jsp.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testContainment.jsp.data
deleted file mode 100644
index 810575e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testContainment.jsp.data
+++ /dev/null
@@ -1,19 +0,0 @@
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
- uri="http://java.sun.com/jsf/html" prefix="h"%><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Insert title here</title>
-</head>
-<body>
-
-<f:view><h:form>
- <h:inputText></h:inputText>
- </h:form></f:view>
- <h:inputText></h:inputText>
- <h:inputText></h:inputText>
-</body>
-</html>
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testdata1.jsp.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testdata1.jsp.data
deleted file mode 100644
index ad170d3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/jsps/testdata1.jsp.data
+++ /dev/null
@@ -1,40 +0,0 @@
-
-<%@page contentType="text/html"%>
-<%@page pageEncoding="UTF-8"%>
-<%--
-The taglib directive below imports the JSTL library. If you uncomment it,
-you must also add the JSTL library to the project. The Add Library... action
-on Libraries node in Projects view can be used to add the JSTL 1.1 library.
---%>
-
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<f:view>
- <f:loadBundle var="bundle" basename="resources.LoginPageBundle" />
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title><h:outputText value="#{bundle['page.title']}"/></title>
- <link rel="stylesheet" href="style/style.css" media="screen"/>
- </head>
- <body>
- <h:form id="mainForm">
- <h1><h:outputText value="#{bundle['page.header']}"/></h1>
- <h:messages/>
- <h:panelGrid columns="2">
- <h:outputLabel for="userId" value="Username:"/>
- <h:inputText id="userId" value="#{loginRequest.id}"/>
- <h:outputLabel for="password" value="Password:"/>
- <h:inputSecret id="password" value="#{loginRequest.passwordPlainText}"/>
- </h:panelGrid>
- <h:commandButton action="#{appController.loginActions}" value="#{bundle['login.button.value']}"/>
- </h:form>
-
- </body>
-</html>
-</f:view> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/CaseInsensitive.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/CaseInsensitive.xml
deleted file mode 100644
index 606a584..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/CaseInsensitive.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<p:grammar-annotations
- xmlns:p="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema ../../../org.eclipse.jst.jsf.core/schema/grammar-annotations.xsd "
- caseSensitive="false">
- <cm-element name="Foo">
- <cm-attribute name="Value">
- <property name="Type">
- <value>String1</value>
- </property>
- </cm-attribute>
- <property name="Type">
- <value>String1</value>
- </property>
- </cm-element>
-</p:grammar-annotations>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileA.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileA.xml
deleted file mode 100644
index 54b9844..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileA.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<p:grammar-annotations xmlns:p="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema ../../../org.eclipse.jst.jsf.core/schema/grammar-annotations.xsd ">
- <cm-element name="Foo">
- <cm-attribute name="Value">
- <property name="Type">
- <value>String1</value>
- </property>
- </cm-attribute>
- <property name="Type">
- <value>String1</value>
- </property>
- </cm-element>
-</p:grammar-annotations>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileB.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileB.xml
deleted file mode 100644
index 60cf5fa..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/FileB.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<p:grammar-annotations xmlns:p="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://org.eclipse.jst.jsf.core/grammarAnnotationSchema ../../../org.eclipse.jst.jsf.core/schema/grammar-annotations.xsd ">
- <cm-element name="Foo">
- <cm-attribute name="Value">
- <property name="Type">
- <value>String2</value>
- </property>
- </cm-attribute>
- <property name="Type">
- <value>String2</value>
- </property>
- </cm-element>
-</p:grammar-annotations>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.properties b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.properties
deleted file mode 100644
index ea290ee..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-NLS1=a day in the life
-NLS2=another string
-
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.xml b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.xml
deleted file mode 100644
index 73c8ea8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<grammar-annotation
- xmlns="http://org.eclipse.jsf.core/grammarAnnotationSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://org.eclipse.jsf.core/grammarAnnotationSchema D:\\EclipseWTPLatest\\WTPWorkspace\\org.eclipse.jst.jsf.core\\schema\\grammar-annotations.xsd ">
- <cm-element name="validator">
- <cm-attribute name="validatorId">
- <property name="attr-val-content-assistant">
- <value>com.eclipse.jst.jsf.ui.internal.ValidatorAttrValueContentAssistant</value>
- </property>
- <property name="faces-datatype">
- <value>com.eclipse.jst.jsf.core.internal.model.datatype.Validator</value>
- </property>
- </cm-attribute>
- </cm-element>
- <cm-element name="nopropsOrAttrs">
- </cm-element>
- <cm-element name="noAttrs">
- <property name="A">
- <value>a</value>
- </property>
- <property name="B">
- <value>b</value>
- </property>
- </cm-element>
- <cm-element name="loaded">
- <cm-attribute name="att1">
- <property name="A1">
- <value>a1</value>
- </property>
- <property name="B1">
- <value>b1</value>
- </property>
- </cm-attribute>
- <cm-attribute name="att2">
- <property name="A2">
- <value>a2</value>
- </property>
- <property name="B2">
- <value>b2</value>
- </property>
- </cm-attribute>
- <cm-attribute name="att3">
- <property name="A3">
- <value>a3</value>
- </property>
- <property name="B3">
- <value>b3</value>
- </property>
- <property name="multival">
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </property>
- </cm-attribute>
- <property name="A">
- <value>a</value>
- </property>
- <property name="B">
- <value>b</value>
- </property>
- <property name="multival">
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </property>
- </cm-element>
- <cm-element name="NLS">
- <cm-attribute name="NLS">
- <property name="NLS1">
- <value>%NLS1</value>
- </property>
- <property name="NLS2">
- <value>%NLS2</value>
- </property>
- <property name="NLS3">
- <value>%NLS3</value>
- </property>
- <property name="multival">
- <value>%NLS1</value>
- <value>%NLS2</value>
- </property>
- </cm-attribute>
- <property name="NLS1">
- <value>%NLS1</value>
- </property>
- <property name="NLS2">
- <value>%NLS2</value>
- </property>
- <property name="NLS3">
- <value>%NLS3</value>
- </property>
- <property name="multival">
- <value>%NLS1</value>
- <value>%NLS2</value>
- </property>
- <property name="NullVal">
- <value></value>
- </property>
- </cm-element>
-</grammar-annotation>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test_en_US.properties b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test_en_US.properties
deleted file mode 100644
index 6491523..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/metadata/jsf_test_en_US.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-NLS1=a day in the life(en_US)
-NLS2=another string(en_US)
-
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_core.tld.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_core.tld.data
deleted file mode 100644
index 9e547d2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_core.tld.data
+++ /dev/null
@@ -1,781 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- * Copyright 2004,2005,2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib xmlns="http://java.sun.com/JSP/TagLibraryDescriptor">
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>f</short-name>
- <uri>http://java.sun.com/jsf/core</uri>
- <display-name>JSF core tag library.</display-name>
- <description>
- This tag library implements the standard JSF core tags.
- </description>
- <!--
-======================================================
- Listener, that does all the startup work (configuration, init).
-======================================================
--->
- <listener>
- <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
- </listener>
- <!--
-======================================================
- actionListener
-======================================================
--->
- <tag>
- <name>actionListener</name>
- <tag-class>org.apache.myfaces.taglib.core.ActionListenerTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag creates an instance of the specified ActionListener, and
- associates it with the nearest parent UIComponent.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <attribute>
- <name>type</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The fully qualified class name of the ActionListener class.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- attribute
-======================================================
--->
- <tag>
- <name>attribute</name>
- <tag-class>javax.faces.webapp.AttributeTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag associates an attribute with the nearest parent
- UIComponent.
- &lt;p&gt;
- When the value is not an EL expression, this tag has the same effect
- as calling component.getAttributes.put(name, value). When the attribute
- name specified matches a standard property of the component, that
- property is set. However it is also valid to assign attributes
- to components using any arbitrary name; the component itself won't
- make any use of these but other objects such as custom renderers,
- validators or action listeners can later retrieve the attribute
- from the component by name.
- &lt;p&gt;
- When the value is an EL expression, this tag has the same effect
- as calling component.setValueBinding. A call to method
- component.getAttributes().get(name) will then cause that
- expression to be evaluated and the result of the expression is
- returned, not the original EL expression string.
- &lt;p&gt;
- See the javadoc for UIComponent.getAttributes for more details.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The name of the attribute.</description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The attribute's value.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- converter
-======================================================
--->
- <tag>
- <name>convertDateTime</name>
- <tag-class>org.apache.myfaces.taglib.core.ConvertDateTimeTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag associates a date time converter with the nearest parent UIComponent.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>dateStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The style of the date. Values include: default, short, medium, long, and full.</description>
- </attribute>
- <attribute>
- <name>locale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The name of the locale to be used, instead of the default.</description>
- </attribute>
- <attribute>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.</description>
- </attribute>
- <attribute>
- <name>timeStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The style of the time. Values include: default, short, medium, long, and full.</description>
- </attribute>
- <attribute>
- <name>timeZone</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The time zone to use instead of GMT (the default timezone). When
- this value is a value-binding to a TimeZone instance, that
- timezone is used. Otherwise this value is treated as a String
- containing a timezone id, ie as the ID parameter of method
- java.util.TimeZone.getTimeZone(String).
- </description>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Specifies whether the date, time, or both should be
- parsed/formatted. Values include: date, time, and both.
- Default based on setting of timeStyle and dateStyle.
- </description>
- </attribute>
- </tag>
- <tag>
- <name>converter</name>
- <tag-class>javax.faces.webapp.ConverterTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag creates an instance of the specified Converter, and
- associates it with the nearest parent UIComponent.
- </description>
- <attribute>
- <name>converterId</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The converter's registered ID.</description>
- </attribute>
- </tag>
- <tag>
- <name>convertNumber</name>
- <tag-class>org.apache.myfaces.taglib.core.ConvertNumberTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag creates a number formatting converter and associates it
- with the nearest parent UIComponent.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>currencyCode</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>ISO 4217 currency code</description>
- </attribute>
- <attribute>
- <name>currencySymbol</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The currency symbol used to format a currency value. Defaults
- to the currency symbol for locale.
- </description>
- </attribute>
- <attribute>
- <name>groupingUsed</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Specifies whether output will contain grouping separators. Default: true.</description>
- </attribute>
- <attribute>
- <name>integerOnly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Specifies whether only the integer part of the input will be parsed. Default: false.</description>
- </attribute>
- <attribute>
- <name>locale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The name of the locale to be used, instead of the default as
- specified in the faces configuration file.
- </description>
- </attribute>
- <attribute>
- <name>maxFractionDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The maximum number of digits in the fractional portion of the number.</description>
- </attribute>
- <attribute>
- <name>maxIntegerDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The maximum number of digits in the integer portion of the number.</description>
- </attribute>
- <attribute>
- <name>minFractionDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The minimum number of digits in the fractional portion of the number.</description>
- </attribute>
- <attribute>
- <name>minIntegerDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The minimum number of digits in the integer portion of the number.</description>
- </attribute>
- <attribute>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.</description>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The type of formatting/parsing to be performed. Values include:
- number, currency, and percent. Default: number.
- </description>
- </attribute>
- </tag>
- <!--
-======================================================
- facet
-======================================================
--->
- <tag>
- <name>facet</name>
- <tag-class>javax.faces.webapp.FacetTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This tag adds its child as a facet of the nearest parent UIComponent.
- A child consisting of multiple elements should be nested within a
- container component (i.e., within an h:panelGroup for HTML library
- components).
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The name of the facet to be created. This must be a static value.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- loadBundle
-======================================================
--->
- <tag>
- <name>loadBundle</name>
- <tag-class>org.apache.myfaces.taglib.core.LoadBundleTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Loads a resource bundle and saves it as a variable in the request scope.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>basename</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The base name of the resource bundle.</description>
- </attribute>
- <attribute>
- <name>var</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The name of the variable in request scope that the resources
- are saved to. This must be a static value.
- </description>
- </attribute>
- </tag>
- <!--
-======================================================
- param
-======================================================
--->
- <tag>
- <name>param</name>
- <tag-class>org.apache.myfaces.taglib.core.ParamTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag associates a parameter name-value pair with the nearest
- parent UIComponent. A UIComponent is created to represent this
- name-value pair, and stored as a child of the parent component; what
- effect this has depends upon the renderer of that parent component.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UIParameter attributes -->
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>A String containing the name of the parameter.</description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The value of this parameter.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- selectitem
-======================================================
--->
- <tag>
- <name>selectItem</name>
- <tag-class>org.apache.myfaces.taglib.core.SelectItemTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag associates a single SelectItem with the nearest
- parent UIComponent. The item represents a single option
- for a component such as an h:selectBooleanCheckbox or h:selectOneMenu.
- See also component selectItems.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UISelectItem attributes -->
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>itemDisabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- If true, this component will not be saved during state saving.
- </description>
- </attribute>
- <attribute>
- <name>itemDescription</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>An optional description for this item.</description>
- </attribute>
- <attribute>
- <name>itemLabel</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The locale-specific label that will be displayed to the user for this item.
- </description>
- </attribute>
- <attribute>
- <name>itemValue</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The value of this item, of the same type as the parent component's value.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An EL expression that refers to a javax.faces.model.SelectItem instance.
- </description>
- </attribute>
- </tag>
- <!--
-======================================================
- selectitems
-======================================================
--->
- <tag>
- <name>selectItems</name>
- <tag-class>org.apache.myfaces.taglib.core.SelectItemsTag</tag-class>
- <body-content>empty</body-content>
- <description>
- This tag associates a set of selection list items with the nearest
- parent UIComponent. The set of SelectItem objects is retrieved via
- a value-binding.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UISelectItems attributes -->
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An EL expression that specifies the contents of the selection list.
- The expression can refer to one of the following:
- &lt;ol&gt;
- &lt;li&gt;A single SelectItem&lt;/li&gt;
- &lt;li&gt;An array or Collection of SelectItem instances&lt;/li&gt;
- &lt;li&gt;A Map. The contents of the Map are used to create SelectItem
- instances, where the SelectItem's label is the map's key value,
- and the SelectItem's value is the map's value. When using a
- map, it is recommended that an ordered implementation such as
- java.util.TreeMap is used.&lt;/li&gt;
- &lt;/ol&gt;
- The value properties of each of the SelectItems must be of the same
- basic type as the parent component's value.
-
- </description>
- </attribute>
- </tag>
- <!--
-======================================================
- subview
-======================================================
--->
- <tag>
- <name>subview</name>
- <tag-class>org.apache.myfaces.taglib.core.SubviewTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This tag associates a set of UIComponents with the nearest parent
- UIComponent. It acts as a naming container to make the IDs of its
- component elements unique.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>id</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- </tag>
- <!--
-======================================================
- validators
-======================================================
--->
- <tag>
- <name>validateDoubleRange</name>
- <tag-class>org.apache.myfaces.taglib.core.ValidateDoubleRangeTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Creates a validator and associateds it with the nearest parent
- UIComponent. When invoked, the validator ensures that values are
- valid doubles that lie within the minimum and maximum values specified.
-
- Commonly associated with a h:inputText entity.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <!-- validator min/max attributes -->
- <attribute>
- <name>minimum</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The smallest value that should be considered valid.</description>
- </attribute>
- <attribute>
- <name>maximum</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The largest value that should be considered valid.</description>
- </attribute>
- </tag>
- <tag>
- <name>validateLength</name>
- <tag-class>org.apache.myfaces.taglib.core.ValidateLengthTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Creates a validator and associateds it with the nearest parent
- UIComponent. When invoked, the validator ensures that values are
- valid strings with a length that lies within the minimum and maximum
- values specified.
-
- Commonly associated with a h:inputText entity.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <!-- validator min/max attributes -->
- <attribute>
- <name>minimum</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The smallest value that should be considered valid.</description>
- </attribute>
- <attribute>
- <name>maximum</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The largest value that should be considered valid.</description>
- </attribute>
- </tag>
- <tag>
- <name>validateLongRange</name>
- <tag-class>org.apache.myfaces.taglib.core.ValidateLongRangeTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Creates a validator and associateds it with the nearest parent
- UIComponent. When invoked, the validator ensures that values
- are valid longs that lie within the minimum and maximum values specified.
-
- Commonly associated with a h:inputText entity.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <!-- validator min/max attributes -->
- <attribute>
- <name>minimum</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The smallest value that should be considered valid.</description>
- </attribute>
- <attribute>
- <name>maximum</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The largest value that should be considered valid.</description>
- </attribute>
- </tag>
- <tag>
- <name>validator</name>
- <tag-class>javax.faces.webapp.ValidatorTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Creates a validator and associates it with the nearest parent
- UIComponent. During the validation phase (or the apply-request-values
- phase for immediate components), if the associated component has any
- submitted value and the conversion of that value to the required
- type has succeeded then the specified validator type is
- invoked to test the validity of the converted value.
- &lt;p&gt;
- Commonly associated with an h:inputText entity, but may be applied to
- any input component.
- &lt;p&gt;
- Some validators may allow the component to use attributes to define
- component-specific validation constraints; see the f:attribute tag.
- See also the "validator" attribute of all input components, which
- allows a component to specify an arbitrary validation &lt;i&gt;method&lt;/i&gt;
- (rather than a registered validation type, as this tag does).
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <attribute>
- <name>validatorId</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The registered ID of the desired Validator.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- valueChangeListener
-======================================================
--->
- <tag>
- <name>valueChangeListener</name>
- <tag-class>org.apache.myfaces.taglib.core.ValueChangeListenerTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Adds the specified ValueChangeListener to the nearest parent
- UIComponent (which is expected to be a UIInput component).
- Whenever the form containing the parent UIComponent is submitted,
- an instance of the specified type is created. If the submitted
- value from the component is different from the component's current
- value then a ValueChangeEvent is queued. When the ValueChangeEvent
- is processed (at end of the validate phase for non-immediate components,
- or at end of the apply-request-values phase for immediate components)
- the object's processValueChange method is invoked.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <attribute>
- <name>type</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The name of a Java class that implements ValueChangeListener.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- verbatim
-======================================================
--->
- <tag>
- <name>verbatim</name>
- <tag-class>org.apache.myfaces.taglib.core.VerbatimTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Outputs its body as verbatim text. No JSP tags within the verbatim
- tag (including JSF tags) are evaluated; the content is treated
- simply as literal text to be copied to the response.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <attribute>
- <name>escape</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>If true, generated markup is escaped. Default: false.</description>
- </attribute>
- </tag>
- <!--
-======================================================
- view
-======================================================
--->
- <tag>
- <name>view</name>
- <tag-class>org.apache.myfaces.taglib.core.ViewTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Creates a JSF View, which is a container that holds all of the
- components that are part of the view.
-
- Unless otherwise specified, all attributes accept static values or EL expressions.
- </description>
- <attribute>
- <name>locale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The locale of this view. Default: the default locale from the configuration file.</description>
- </attribute>
- </tag>
-</taglib>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_html.tld.data b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_html.tld.data
deleted file mode 100644
index 386e895..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/myfaces_html.tld.data
+++ /dev/null
@@ -1,6200 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib xmlns="http://java.sun.com/JSP/TagLibraryDescriptor">
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>h</short-name>
- <uri>http://java.sun.com/jsf/html</uri>
- <display-name>JSF HTML tag library.</display-name>
- <description>
- This tag library implements the standard JSF HTML tags.
- </description>
- <!--
-*************************************************************************************
-Start of revised 1.0 conforming tags (in alphabetical order)
-*************************************************************************************
--->
- <!-- column -->
- <tag>
- <name>column</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlColumnTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This tag is commonly used as a child of the dataTable tag, to
- represent a column of data. It can be decorated with "header" and
- "footer" facets to drive the output of header and footer rows.
- Row values are specified via its children.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- </tag>
- <!-- commandButton -->
- <tag>
- <name>commandButton</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlCommandButtonTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This tag renders as an HTML input element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the commandButton tag -->
- <!-- UICommand attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>action</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Specifies the action to take when this command is invoked.
-
- If the value is an expression, it is expected to be a method
- binding EL expression that identifies an action method. An action method
- accepts no parameters and has a String return value, called the action
- outcome, that identifies the next view displayed. The phase that this
- event is fired in can be controlled via the immediate attribute.
-
- If the value is a string literal, it is treated as a navigation outcome
- for the current view. This is functionally equivalent to a reference to
- an action method that returns the string literal.
- </description>
- </attribute>
- <attribute>
- <name>actionListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression that identifies an action listener method
- to be invoked if this component is activated by the user. An action
- listener method accepts a parameter of type javax.faces.event.ActionEvent
- and returns void. The phase that this event is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which action events
- should fire. During normal event processing, action methods and
- action listener methods are fired during the "invoke application"
- phase of request processing. If this attribute is set to "true",
- these methods are fired instead at the end of the "apply request
- values" phase.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 button attributes -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: A hint to the user agent about the content type of the linked resource.</description>
- </attribute>
- <attribute>
- <name>size</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial width of this control.</description>
- </attribute>
- <!-- HtmlCommandButton attributes -->
- <attribute>
- <name>image</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The URL of an image that renders in place of the button.</description>
- </attribute>
- </tag>
- <!-- commandLink -->
- <tag>
- <name>commandLink</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlCommandLinkTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This tag renders as an HTML a element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the commandLink tag -->
- <!-- UICommand attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>action</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Specifies the action to take when this command is invoked.
-
- If the value is an expression, it is expected to be a method
- binding EL expression that identifies an action method. An action method
- accepts no parameters and has a String return value, called the action
- outcome, that identifies the next view displayed. The phase that this
- event is fired in can be controlled via the immediate attribute.
-
- If the value is a string literal, it is treated as a navigation outcome
- for the current view. This is functionally equivalent to a reference to
- an action method that returns the string literal.
- </description>
- </attribute>
- <attribute>
- <name>actionListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression that identifies an action listener method
- to be invoked if this component is activated by the user. An action
- listener method accepts a parameter of type javax.faces.event.ActionEvent
- and returns void. The phase that this event is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which action events
- should fire. During normal event processing, action methods and
- action listener methods are fired during the "invoke application"
- phase of request processing. If this attribute is set to "true",
- these methods are fired instead at the end of the "apply request
- values" phase.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 anchor (=a) attributes -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>charset</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the character encoding of the linked resource.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: A hint to the user agent about the content type of the linked resource.</description>
- </attribute>
- <attribute>
- <name>target</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Names the frame that should display content generated by invoking this action. </description>
- </attribute>
- <attribute>
- <name>coords</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The coordinates of regions within a client side image map.</description>
- </attribute>
- <!-- "href" is a special LinkRenderer attribute -->
- <attribute>
- <name>hreflang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The language of the linked resource.</description>
- </attribute>
- <!-- "name" cannot be set by user -->
- <attribute>
- <name>rel</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: The relationship between the current document and
- the linked resource.
- </description>
- </attribute>
- <attribute>
- <name>rev</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: The type(s) describing the reverse link for the linked
- resource.
- </description>
- </attribute>
- <attribute>
- <name>shape</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: The shape of a region in a client side image map.
- </description>
- </attribute>
- </tag>
- <!-- data_table -->
- <tag>
- <name>dataTable</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlDataTableTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This component renders as an HTML table element. It has as its
- children h:column entities, which describe the columns of the table.
- It can be decorated with facets named "header" and "footer" to
- specify header and footer rows.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the dataTable tag -->
- <!-- UIPanel attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>columnClasses</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- A comma separated list of CSS class names to apply to td elements in
- each column.
- </description>
- </attribute>
- <attribute>
- <name>footerClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class to be applied to footer cells.</description>
- </attribute>
- <attribute>
- <name>headerClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class to be applied to header cells.</description>
- </attribute>
- <attribute>
- <name>rowClasses</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- A comma separated list of CSS class names to apply to td elements in
- each row.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 table attributes -->
- <attribute>
- <name>align</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Specifies the horizontal alignment of this element. Deprecated in HTML 4.01.</description>
- </attribute>
- <attribute>
- <name>border</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the width of the border of this element, in pixels. Deprecated in HTML 4.01.</description>
- </attribute>
- <attribute>
- <name>bgcolor</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The background color of this element.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>cellpadding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Specifies the amount of empty space between the cell border and
- its contents. It can be either a pixel length or a percentage.
- </description>
- </attribute>
- <attribute>
- <name>cellspacing</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Specifies the amount of space between the cells of the table.
- It can be either a pixel length or a percentage of available
- space.
- </description>
- </attribute>
- <attribute>
- <name>frame</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Controls what part of the frame that surrounds a table is
- visible. Values include: void, above, below, hsides, lhs,
- rhs, vsides, box, and border.
- </description>
- </attribute>
- <attribute>
- <name>rules</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Controls how rules are rendered between cells. Values include:
- none, groups, rows, cols, and all.
- </description>
- </attribute>
- <attribute>
- <name>summary</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Provides a summary of the contents of the table, for
- accessibility purposes.
- </description>
- </attribute>
- <attribute>
- <name>width</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Specifies the desired width of the table, as a pixel length or
- a percentage of available space.
- </description>
- </attribute>
- <!-- UIData attributes -->
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>An EL expression that specifies the data model that backs this table. The value can be of any type.
-
- A value of type DataModel is used directly. Array-like parameters of type java.util.List, array of Object,
- java.sql.ResultSet, or javax.servlet.jsp.jstl.sql.Result are wrapped in a DataModel.
-
- Other values are wrapped in a DataModel as a single row.</description>
- </attribute>
- <attribute>
- <name>var</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Defines the name of the request-scope variable that will hold the current row during iteration. This value must be a static value.</description>
- </attribute>
- <attribute>
- <name>rows</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The number of rows to be displayed. Specify zero for all remaining rows in the table.</description>
- </attribute>
- <attribute>
- <name>first</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The index of the first row to be displayed, where 0 is the first row.</description>
- </attribute>
- </tag>
- <!-- form -->
- <tag>
- <name>form</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlFormTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders an HTML form element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIForm attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 form attributes -->
- <attribute>
- <name>target</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Names the frame that should display content generated by invoking this action. </description>
- </attribute>
- <attribute>
- <name>accept</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Provides a comma-separated list of content types that the
- server processing this form can handle.
- </description>
- </attribute>
- <attribute>
- <name>acceptCharset</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: The list of character encodings accepted by the server for this
- form.
- </description>
- </attribute>
- <attribute>
- <name>enctype</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: The content type used to submit this form to the server.
- </description>
- </attribute>
- <attribute>
- <name>onreset</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when this form is reset.</description>
- </attribute>
- <attribute>
- <name>onsubmit</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when this form is submitted.</description>
- </attribute>
- </tag>
- <!-- graphic_image -->
- <tag>
- <name>graphicImage</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlGraphicImageTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders an HTML img element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIGraphic attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>url</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An alias for the "value" attribute.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The URL of the image. If the URL starts with a '/', it is relative
- to the context path of the web application.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- The subset of HTML 4.0 img attributes that are supported by the JSF 1.1 specification -->
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>height</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Overrides the natural height of this image, by specifying height in pixels.</description>
- </attribute>
- <attribute>
- <name>ismap</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies server-side image map handling for this image.</description>
- </attribute>
- <attribute>
- <name>longdesc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: A link to a long description of the image.</description>
- </attribute>
- <!-- "name" attribute cannot be set directly by user -->
- <!-- "src" attribute cannot be set directly, use "url" instead! -->
- <attribute>
- <name>usemap</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies an image map to use with this image.</description>
- </attribute>
- <attribute>
- <name>width</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Overrides the natural width of this image, by specifying width in pixels.</description>
- </attribute>
- </tag>
- <!-- input_hidden -->
- <tag>
- <name>inputHidden</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlInputHiddenTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders as an HTML input tag with its type set to "hidden".
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- </tag>
- <!-- input_secret -->
- <tag>
- <name>inputSecret</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlInputSecretTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders as an HTML input tag with its type set to "password".
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- todo: not all html_input_attributes are used for input_secret
- in RI (e.g. datafld, datasrc, ...) -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 input attributes -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>align</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Specifies the horizontal alignment of this element. Deprecated in HTML 4.01.</description>
- </attribute>
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>maxlength</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The maximum number of characters allowed to be entered.</description>
- </attribute>
- <attribute>
- <name>size</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The initial width of this control, in characters.</description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- SecretRenderer attributes -->
- <attribute>
- <name>redisplay</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- If true, the value will be re-sent (in plaintext) when the form
- is rerendered (see JSF.7.4.4). Default is false.
- </description>
- </attribute>
- </tag>
- <!-- input_text -->
- <tag>
- <name>inputText</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlInputTextTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders a HTML input element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the inputText tag -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 input attributes -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>align</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Specifies the horizontal alignment of this element. Deprecated in HTML 4.01.</description>
- </attribute>
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>maxlength</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The maximum number of characters allowed to be entered.</description>
- </attribute>
- <attribute>
- <name>size</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The initial width of this control, in characters.</description>
- </attribute>
- </tag>
- <!-- input_textarea -->
- <tag>
- <name>inputTextarea</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlInputTextareaTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders a HTML textarea element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the inputTextarea tag -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 textarea attributes -->
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>cols</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The width of this element, in characters.</description>
- </attribute>
- <attribute>
- <name>rows</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The height of this element, in characters.</description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- </tag>
- <!-- message -->
- <tag>
- <name>message</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlMessageTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders the first FacesMessage that is assigned to the component
- referenced by the "for" attribute.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the message tag -->
- <!-- UIMessage attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>for</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An EL expression, returning a String, with the unique ID of the component
- for which messages should be displayed. This string has the same format
- as that accepted by the UIComponent.findComponent() method.
- </description>
- </attribute>
- <attribute>
- <name>showSummary</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An EL expression, returning a boolean, that controls whether the
- summary text of the associated messages is displayed. Default: true.
- </description>
- </attribute>
- <attribute>
- <name>showDetail</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An EL expression, returning a boolean, that controls whether the
- detail text of the associated messages is displayed. Default: false.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HtmlMessage attributes -->
- <attribute>
- <name>infoClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "INFO".</description>
- </attribute>
- <attribute>
- <name>infoStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "INFO".</description>
- </attribute>
- <attribute>
- <name>warnClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "WARN".</description>
- </attribute>
- <attribute>
- <name>warnStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "WARN".</description>
- </attribute>
- <attribute>
- <name>errorClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "ERROR".</description>
- </attribute>
- <attribute>
- <name>errorStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "ERROR".</description>
- </attribute>
- <attribute>
- <name>fatalClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "FATAL".</description>
- </attribute>
- <attribute>
- <name>fatalStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "FATAL".</description>
- </attribute>
- <attribute>
- <name>tooltip</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- If true, the message summary will be rendered as a tooltip (i.e. HTML title attribute).
- </description>
- </attribute>
- </tag>
- <!-- messages -->
- <tag>
- <name>messages</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlMessagesTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders all or some FacesMessages depending on the "for" and
- "globalOnly" attributes:&lt;br&gt;
- &lt;ul&gt;
- &lt;li&gt;If globalOnly = true, only global messages, that have no
- associated clientId, will be displayed.&lt;/li&gt;
- &lt;li&gt;else if there is a "for" attribute, only messages that are
- assigned to the component referenced by the "for" attribute
- are displayed.&lt;/li&gt;
- &lt;li&gt;else all messages are displayed.&lt;/li&gt;
- &lt;/ul&gt;
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- all standard attributes of the messages tag -->
- <!-- UIMessages attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>showSummary</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that controls whether the summary text of the
- associated messages is displayed. Default: true.
- </description>
- </attribute>
- <attribute>
- <name>showDetail</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that controls whether the detail text of the
- associated messages is displayed. Default: false.
- </description>
- </attribute>
- <attribute>
- <name>globalOnly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that controls whether global messages (those without
- IDs) should be displayed. Default: true.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HtmlMessages attributes -->
- <attribute>
- <name>infoClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "INFO".</description>
- </attribute>
- <attribute>
- <name>infoStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "INFO".</description>
- </attribute>
- <attribute>
- <name>warnClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "WARN".</description>
- </attribute>
- <attribute>
- <name>warnStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "WARN".</description>
- </attribute>
- <attribute>
- <name>errorClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "ERROR".</description>
- </attribute>
- <attribute>
- <name>errorStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "ERROR".</description>
- </attribute>
- <attribute>
- <name>fatalClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS class to be used for messages with severity "FATAL".</description>
- </attribute>
- <attribute>
- <name>fatalStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>CSS style to be used for messages with severity "FATAL".</description>
- </attribute>
- <attribute>
- <name>layout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The layout: "table" or "list". Default: list</description>
- </attribute>
- <attribute>
- <name>tooltip</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- If true, the message summary will be rendered as a tooltip (i.e. HTML title attribute).
- </description>
- </attribute>
- </tag>
- <!-- outputLabel -->
- <tag>
- <name>outputLabel</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlOutputLabelTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders a HTML label element.
-
- In addition to the JSF specification, MyFaces allows it to directly
- give an output text via the "value" attribute.
-
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the outputLabel tag -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 label attributes -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <!-- "for" is a specific LabelRenderer attribute -->
- <!-- LabelRenderer attributes -->
- <attribute>
- <name>for</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The client ID of the target input element of this label.</description>
- </attribute>
- </tag>
- <!-- output_link -->
- <tag>
- <name>outputLink</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlOutputLinkTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders a HTML a element. Child f:param elements are added to the href
- attribute as query parameters. Other children are rendered as the link text or image.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 anchor (=a) attributes -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>charset</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the character encoding of the linked resource.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: A hint to the user agent about the content type of the linked resource.</description>
- </attribute>
- <attribute>
- <name>target</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Names the frame that should display content generated by invoking this action. </description>
- </attribute>
- <attribute>
- <name>coords</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The coordinates of regions within a client side image map.</description>
- </attribute>
- <!-- "href" is a special LinkRenderer attribute -->
- <attribute>
- <name>hreflang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: The language of the linked resource.</description>
- </attribute>
- <!-- "name" cannot be set by user -->
- <attribute>
- <name>rel</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: The relationship between the current document and
- the linked resource.
- </description>
- </attribute>
- <attribute>
- <name>rev</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: The type(s) describing the reverse link for the linked
- resource.
- </description>
- </attribute>
- <attribute>
- <name>shape</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: The shape of a region in a client side image map.
- </description>
- </attribute>
- </tag>
- <!-- output_message -->
- <tag>
- <name>outputFormat</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlOutputFormatTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders as text, applying the child f:param values to the value
- attribute as a MessageFormat string. If this element has an ID
- or CSS style properties, the text is wrapped in a span element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <attribute>
- <name>escape</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Indicates whether rendered markup should be escaped.
- Default: true
- </description>
- </attribute>
- </tag>
- <!-- output_text -->
- <tag>
- <name>outputText</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlOutputTextTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Renders the value of the associated UIOutput component. If this
- element has an ID or CSS style properties, the text is wrapped in
- a span element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <attribute>
- <name>escape</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Indicates whether rendered markup should be escaped.
- Default: true
- </description>
- </attribute>
- </tag>
- <!-- panel_grid -->
- <tag>
- <name>panelGrid</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlPanelGridTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This element renders as an HTML table with specified number of
- columns. Children of this element are rendered as cells in the
- table, filling rows from left to right. Facets named "header"
- and "footer" are optional and specify the content of the thead
- and tfoot rows, respectively.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- UIPanel attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 table attributes -->
- <attribute>
- <name>align</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Specifies the horizontal alignment of this element. Deprecated in HTML 4.01.</description>
- </attribute>
- <attribute>
- <name>border</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the width of the border of this element, in pixels. Deprecated in HTML 4.01.</description>
- </attribute>
- <attribute>
- <name>bgcolor</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The background color of this element.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>cellpadding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Specifies the amount of empty space between the cell border and
- its contents. It can be either a pixel length or a percentage.
- </description>
- </attribute>
- <attribute>
- <name>cellspacing</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Specifies the amount of space between the cells of the table.
- It can be either a pixel length or a percentage of available
- space.
- </description>
- </attribute>
- <attribute>
- <name>frame</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Controls what part of the frame that surrounds a table is
- visible. Values include: void, above, below, hsides, lhs,
- rhs, vsides, box, and border.
- </description>
- </attribute>
- <attribute>
- <name>rules</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Controls how rules are rendered between cells. Values include:
- none, groups, rows, cols, and all.
- </description>
- </attribute>
- <attribute>
- <name>summary</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Provides a summary of the contents of the table, for
- accessibility purposes.
- </description>
- </attribute>
- <attribute>
- <name>width</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- HTML: Specifies the desired width of the table, as a pixel length or
- a percentage of available space.
- </description>
- </attribute>
- <attribute>
- <name>columnClasses</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- A comma separated list of CSS class names to apply to td elements in
- each column.
- </description>
- </attribute>
- <attribute>
- <name>footerClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class to be applied to footer cells.</description>
- </attribute>
- <attribute>
- <name>headerClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class to be applied to header cells.</description>
- </attribute>
- <attribute>
- <name>rowClasses</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- A comma separated list of CSS class names to apply to td elements in
- each row.
- </description>
- </attribute>
- <!-- GridRenderer attributes -->
- <attribute>
- <name>columns</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Specifies the number of columns in the grid.</description>
- </attribute>
- </tag>
- <tag>
- <name>panelGroup</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlPanelGroupTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- This element is used to group other components where the
- specification requires one child element. If any of the HTML or
- CSS attributes are set, its content is rendered within a span element.
-
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
- </description>
- <!-- all standard attributes of the panelGroup tag -->
- <!-- UIPanel attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- </tag>
- <tag>
- <name>selectBooleanCheckbox</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectBooleanCheckboxTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to choose a "true" or "false" value, presented as a
- checkbox.
- &lt;p&gt;
- Renders as an HTML input tag with its type set to "checkbox", and
- its name attribute set to the id. The "checked" attribute is rendered
- if the value of this component is true.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UISelectBoolean attributes -->
- <!-- "selected" attribute is covered by HTML "checked" attribute -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 input attributes for type "checkbox" -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- </tag>
- <tag>
- <name>selectManyCheckbox</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectManyCheckboxTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to select zero or more items from a set of
- available options. This is presented as a table with one cell per
- available option; each cell contains a checkbox and the option's
- label. The "layout" attribute determines whether the checkboxes
- are laid out horizontally or vertically.
- &lt;p&gt;
- The set of available options is defined by adding child
- f:selectItem or f:selectItems components to this component.
- &lt;p&gt;
- The value attribute must be a value-binding expression to a
- property of type List, Object array or primitive array. That
- "collection" is expected to contain objects of the same type as
- SelectItem.getValue() returns for the child SelectItem objects.
- On rendering, any child whose value is in the list will be
- selected initially. During the update phase, the property setter
- is called to replace the original collection with a completely
- new collection object of the appropriate type. The new collection
- object contains the value of each child SelectItem object that
- is currently selected.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- all standard attributes of the selectManyCheckbox tag -->
- <!-- UISelectMany attributes -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 input attributes for type "checkbox" -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <!-- CheckboxListRenderer attributes -->
- <attribute>
- <name>layout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>Controls the layout direction of the child elements. Values include:
- lineDirection (vertical) and pageDirection (horzontal).</description>
- </attribute>
- <!--TODO: disabledClass, enabledClass -->
- <attribute>
- <name>enabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class assigned to the label element for enabled choices.</description>
- </attribute>
- <attribute>
- <name>disabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class assigned to the label element for enabled choices.</description>
- </attribute>
- </tag>
- <tag>
- <name>selectManyListbox</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectManyListboxTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to select zero or more items from a set of
- available options. This is presented as a listbox which allows
- multiple rows in the list to be selected simultaneously.
- &lt;p&gt;
- The set of available options is defined by adding child
- f:selectItem or f:selectItems components to this component.
- &lt;p&gt;
- The list is rendered as an HTML select element. The "multiple"
- attribute is set on the element and the size attribute is set to
- the provided value, defaulting to the number of items in the list
- if no value is provided. If the size is set to 1, then a
- "drop-down" list (aka "combo-box") is presented, though if this is
- the intention then a selectManyMenu should be used instead.
- &lt;p&gt;
- The value attribute must be a value-binding expression to a
- property of type List, Object array or primitive array. That
- "collection" is expected to contain objects of the same type as
- SelectItem.getValue() returns for the child SelectItem objects.
- On rendering, any child whose value is in the list will be
- selected initially. During the update phase, the property is set
- to contain a "collection" of values for those child SelectItem
- objects that are currently selected.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UISelectMany attributes -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 select attributes -->
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <!-- "multiple" cannot be set manually -->
- <!-- "name" cannot be set manually -->
- <!-- "size" cannot be set directly for it is a MenuRenderer specific attribute -->
- <!-- ListboxRenderer attributes -->
- <attribute>
- <name>size</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>see JSF Spec.</description>
- </attribute>
- <attribute>
- <name>enabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>disabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>selectManyMenu</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectManyMenuTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to select zero or more items from a set of available
- options. This is presented as a drop-down "combo-box" which allows
- multiple rows in the list to be selected simultaneously.
- &lt;p&gt;
- The set of available options is defined by adding child
- f:selectItem or f:selectItems components to this component.
- &lt;p&gt;
- Renders as an HTML select element, with the choices made up of
- child f:selectItem or f:selectItems elements. The multiple
- attribute is set and the size attribute is set to 1.
- &lt;p&gt;
- The value attribute must be a value-binding expression to a
- property of type List, Object array or primitive array. That
- "collection" is expected to contain objects of the same type as
- SelectItem.getValue() returns for the child SelectItem objects.
- On rendering, any child whose value is in the list will be
- selected initially. During the update phase, the property is set
- to contain a "collection" of values for those child SelectItem
- objects that are currently selected.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UISelectMany attributes -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 select attributes -->
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <!-- "multiple" cannot be set manually -->
- <!-- "name" cannot be set manually -->
- <!-- "size" cannot be set directly for it is a MenuRenderer specific attribute -->
- <attribute>
- <name>enabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>disabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>selectOneListbox</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectOneListboxTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to choose one option from a set of options.
- &lt;p&gt;
- Rendered as a listbox with the MULTIPLE attribute set to false.
- &lt;p&gt;
- The available choices are defined via child f:selectItem or
- f:selectItems elements. The size of the listbox defaults to the
- number of available choices; if size is explicitly set to a
- smaller value, then scrollbars will be rendered. If size is set
- to 1 then a "drop-down menu" (aka "combo-box") is rendered, though
- if this is the intent then selectOneMenu should be used instead.
- &lt;p&gt;
- The value attribute of this component is read to determine
- which of the available options is initially selected; its value
- should match the "value" property of one of the child SelectItem
- objects.
- &lt;p&gt;
- On submit of the enclosing form, the value attribute's bound
- property is updated to contain the "value" property from the
- chosen SelectItem.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- UISelectOne attributes -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 select attributes -->
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <!-- "multiple" cannot be set manually -->
- <!-- "name" cannot be set manually -->
- <!-- "size" cannot be set directly for it is a MenuRenderer specific attribute -->
- <!-- ListboxRenderer attributes -->
- <attribute>
- <name>size</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>see JSF Spec.</description>
- </attribute>
- <attribute>
- <name>enabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>disabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
- <!-- selectOneMenu -->
- <tag>
- <name>selectOneMenu</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectOneMenuTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to choose one option from a set of options.
- &lt;p&gt;
- Renders a drop-down menu (aka "combo-box") containing a set of
- choices, of which only one can be chosen at a time. The available
- choices are defined via child f:selectItem or f:selectItems
- elements.
- &lt;p&gt;
- The value attribute of this component is read to determine
- which of the available options is initially selected; its value
- should match the "value" property of one of the child SelectItem
- objects.
- &lt;p&gt;
- On submit of the enclosing form, the value attribute's bound property
- is updated to contain the "value" property from the chosen SelectItem.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- all standard attributes of the selectOneMenu tag -->
- <!-- UISelectOne attributes -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 select attributes -->
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <!-- "multiple" cannot be set manually -->
- <!-- "name" cannot be set manually -->
- <!-- "size" cannot be set directly for it is a MenuRenderer specific attribute -->
- <attribute>
- <name>enabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>disabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
- <!-- selectOneRadio -->
- <tag>
- <name>selectOneRadio</name>
- <tag-class>org.apache.myfaces.taglib.html.HtmlSelectOneRadioTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Allow the user to choose one option from a set of options.
- &lt;p&gt;
- Renders as an HTML table element, containing an input element for
- each child f:selectItem or f:selectItems elements. The input
- elements are rendered as type radio.
- &lt;p&gt;
- The value attribute of this component is read to determine
- which of the available options is initially selected; its value should
- match the "value" property of one of the child SelectItem objects.
- &lt;p&gt;
- On submit of the enclosing form, the value attribute's bound property
- is updated to contain the "value" property from the chosen SelectItem.
- &lt;p&gt;
- Unless otherwise specified, all attributes accept static values
- or EL expressions.
-
- </description>
- <!-- all standard attributes of the selectOneRadio tag -->
- <!-- UISelectOne attributes -->
- <!-- UIInput attributes -->
- <!-- UIOutput attributes -->
- <!-- UIComponent attributes -->
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- The developer-assigned ID of this component. The ID must be unique
- within the scope of the tag's enclosing naming container (e.g.
- h:form or f:subview). This value must be a static value.
- </description>
- </attribute>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Identifies a backing bean property (of type UIComponent or appropriate
- subclass) to bind to this component instance. This value must be an
- EL expression.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether this component should be rendered.
- Default value: true.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>The initial value of this component.</description>
- </attribute>
- <attribute>
- <name>converter</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- An expression that specifies the Converter for this component.
- If the value binding expression is a String, the String is used
- as an ID to look up a Converter. If the value binding expression
- is a Converter, uses that instance as the converter.
-
- The value can either be a static value (ID case only) or an EL expression.
- </description>
- </attribute>
- <attribute>
- <name>immediate</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that identifies the phase during which value change
- events should fire. During normal event processing, value change
- events are fired during the "invoke application" phase of request
- processing. If this attribute is set to "true", these methods are
- fired instead at the end of the "apply request values" phase.
- </description>
- </attribute>
- <attribute>
- <name>required</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A boolean value that indicates whether an input value is required.
- If this value is true, and no input value is provided, the error
- message javax.faces.component.UIInput.REQUIRED is posted.
- </description>
- </attribute>
- <attribute>
- <name>validator</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting FacesContext, UIComponent,
- and Object parameters, and returning void, that validates the
- component's local value.
- </description>
- </attribute>
- <attribute>
- <name>valueChangeListener</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- A method binding EL expression, accepting a ValueChangeEvent parameter
- and returning void. The specified method is invoked if this component
- is modified. The phase that this handler is fired in can be controlled
- via the immediate attribute.
- </description>
- </attribute>
- <!-- HTML 4.0 universal attributes -->
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: The base language of this document.</description>
- </attribute>
- <attribute>
- <name>style</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: CSS styling instructions.</description>
- </attribute>
- <attribute>
- <name>title</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
- </attribute>
- <!-- HTML 4.0 event-handler attributes -->
- <attribute>
- <name>onclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is clicked.</description>
- </attribute>
- <attribute>
- <name>ondblclick</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the element is double-clicked.</description>
- </attribute>
- <attribute>
- <name>onmousedown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is released over this element.</description>
- </attribute>
- <attribute>
- <name>onmouseover</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
- </attribute>
- <attribute>
- <name>onmousemove</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
- </attribute>
- <attribute>
- <name>onmouseout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
- </attribute>
- <attribute>
- <name>onkeypress</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed over this element.</description>
- </attribute>
- <attribute>
- <name>onkeydown</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is pressed down over this element.</description>
- </attribute>
- <attribute>
- <name>onkeyup</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>HTML: Script to be invoked when a key is released over this element.</description>
- </attribute>
- <!-- HTML 4.0 input attributes for type "radio" -->
- <attribute>
- <name>accesskey</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Sets the access key for this element.</description>
- </attribute>
- <attribute>
- <name>alt</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
- </attribute>
- <attribute>
- <name>disabled</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: When true, this element cannot receive focus.</description>
- </attribute>
- <attribute>
- <name>onblur</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element loses focus.</description>
- </attribute>
- <attribute>
- <name>onfocus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element receives focus.</description>
- </attribute>
- <attribute>
- <name>onchange</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is modified.</description>
- </attribute>
- <attribute>
- <name>onselect</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies a script to be invoked when the element is selected.</description>
- </attribute>
- <attribute>
- <name>readonly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- HTML: When true, indicates that this component cannot be modified by the user.
- The element may receive focus unless it has also been disabled.
- </description>
- </attribute>
- <attribute>
- <name>tabindex</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>HTML: Specifies the position of this element within the tab order of the document.</description>
- </attribute>
- <attribute>
- <name>datafld</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>datasrc</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <attribute>
- <name>dataformatas</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>Reserved for future use.</description>
- </attribute>
- <!-- RadioRenderer attributes -->
- <attribute>
- <name>layout</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>
- Orientation of the options list. Valid values are
- "pageDirection" for a vertical layout, or "lineDirection" for
- horizontal. The default value is "lineDirection".
- </description>
- </attribute>
- <attribute>
- <name>border</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- <description>Width in pixels of the border to be drawn around the table containing the options list.</description>
- </attribute>
- <attribute>
- <name>enabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>disabledClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-</taglib>
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/sandbox-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/sandbox-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/sandbox-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/signatures.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/signatures.jar
deleted file mode 100644
index c3465e5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/signatures.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests.zip
deleted file mode 100644
index c0a0837..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests2.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests2.zip
deleted file mode 100644
index d0caf81..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TLDTests2.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/Test2Project.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/Test2Project.zip
deleted file mode 100644
index 1ea895b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/Test2Project.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject.zip
deleted file mode 100644
index b2bcaf4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject1.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject1.zip
deleted file mode 100644
index 5456b1c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/TestProject1.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject1.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject1.zip
deleted file mode 100644
index d93579a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject1.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject2.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject2.zip
deleted file mode 100644
index ba57954..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/ValidationTestProject2.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/valueHolderTest11.zip b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/valueHolderTest11.zip
deleted file mode 100644
index ddb0429..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/testzips/valueHolderTest11.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/tomahawk-bogus.jar b/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/tomahawk-bogus.jar
deleted file mode 100644
index de4b037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/testfiles/tomahawk-bogus.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.cvsignore
deleted file mode 100644
index d04a685..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-@dot
-javaCompiler...args
-build.xml
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.project b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.project
deleted file mode 100644
index b9c0cfc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.designtime.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index ab9b786..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:02:31 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index daddec6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-#Fri Jul 13 13:50:02 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index ab0d9de..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,38 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.designtime.tests
-Bundle-Version: 1.12.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.designtime.tests.DesignTimeTestsPlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.junit;bundle-version="3.8.1",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.test.util;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.core.tests;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.core.commands;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.facesconfig;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.common.modulecore,
- org.eclipse.wst.sse.core,
- org.eclipse.jface.text,
- org.eclipse.ui.editors,
- org.eclipse.jst.common.project.facet.core,
- org.eclipse.wst.common.project.facet.core,
- org.eclipse.jst.common.frameworks,
- org.eclipse.jdt.ui,
- org.eclipse.jst.jsf.common.runtime;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.jsp.core,
- org.eclipse.wst.xml.core,
- org.eclipse.jst.jsf.common.runtime.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jdt.core.manipulation;bundle-version="[1.3.0,1.4.0]"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jst.jsf.designtime.tests;x-internal:=true,
- org.eclipse.jst.jsf.designtime.tests.resources
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/about.html
deleted file mode 100644
index 04d4782..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/build.properties
deleted file mode 100644
index a7373ee..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- test.xml,\
- testdata/,\
- plugin.properties,\
- about.html
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/plugin.properties
deleted file mode 100644
index 0e3cd99..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-Bundle-Name.0=JavaServer Faces Tools - DesignTime Tests Plug-in
-Bundle-Vendor.0=Eclipse.org \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/AllTests.java
deleted file mode 100644
index 03fb386..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/AllTests.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import org.eclipse.jst.jsf.designtime.tests.views.TestJSPViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.tests.views.persistence.TestSerializableTLDTagElement;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * The test suite for all tests on jsf.designtime
- *
- * @author cbateman
- *
- */
-public class AllTests {
-// private static boolean _inited;
-// private static boolean _jsfRuntimePresentV11;
-// private static boolean _jsfRuntimePresentV12;
-
- /**
- * @return the all tests suite
- */
- public static Test suite() {
- // tests tied to runtimes
-// if (!_inited) {
-// _jsfRuntimePresentV11 = JSFCoreUtilHelper
-// .isJSFRuntimeJarsDirectoryPropertySet(JSFVersion.V1_1);
-// _jsfRuntimePresentV12 = JSFCoreUtilHelper
-// .isJSFRuntimeJarsDirectoryPropertySet(JSFVersion.V1_2);
-// final boolean oneIsPresent =
-// (_jsfRuntimePresentV11 || _jsfRuntimePresentV12);
-// final boolean bothArePresent =
-// (_jsfRuntimePresentV11 && _jsfRuntimePresentV12);
-//
-// if (!oneIsPresent) {
-// final TestSuite suite = new TestSuite(
-// "Error: JSF runtimes not found");
-//
-// suite.addTestSuite(ErrorTestCase.class);
-//
-// return suite;
-// }
-//
-// if (!bothArePresent) {
-// System.err.println
-// ("Warning: only one of JSF 1.1 and 1.2 runtimes are present");
-// }
-// _inited = true;
-// }
-
- final TestSuite suite = new TestSuite(
- "Test for org.eclipse.jst.jsf.designtime.tests");
- // $JUnit-BEGIN$
- suite.addTestSuite(TestDefaultBeanSymbolSourceProvider.class);
- suite.addTestSuite(TestResourceBundleMapSource.class);
- suite.addTestSuite(TestDefaultPropertyResolver.class);
- suite.addTestSuite(TestAbstractDataModelVariableFactory.class);
- suite.addTestSuite(TestDefaultDTMethodResolver.class);
- suite.addTestSuite(TestDefaultDTVariableResolver.class);
- suite.addTestSuite(TestDTJSPExternalContext.class);
- suite.addTestSuite(TestJSPDefaultSymbolFactory.class);
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=219215
- // suite.addTestSuite(TestJSPModelProcessor.class);
- suite.addTestSuite(TestStartupHandler.class);
- suite.addTestSuite(TestDesignTimeApplicationManager.class);
- suite.addTestSuite(TestJSPViewDefnAdapter.class);
- suite.addTestSuite(TestSerializableTLDTagElement.class);
- suite.addTestSuite(TestJSF20ImplicitVariables.class);
- suite.addTestSuite(TestJSF20DefaultBeanSymbolSourceProvider.class);
- //addTestSuite(suite, JSPViewSuite.class);
-
- // $JUnit-END$
- return suite;
- }
-
-// private static void addTestSuite(final TestSuite suite, final Class<?> klass) {
-// if (_jsfRuntimePresentV11) {
-// suite.addTestSuite(klass);
-// }
-// if (_jsfRuntimePresentV12) {
-// suite.addTestSuite(klass);
-// }
-// }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeFastTests.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeFastTests.java
deleted file mode 100644
index 0cc683f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeFastTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests;
-
-import org.eclipse.jst.jsf.designtime.tests.resources.FastResourceLocatorSuite;
-import org.eclipse.jst.jsf.test.util.junit4.FastTest;
-import org.junit.experimental.categories.Categories;
-import org.junit.experimental.categories.Categories.IncludeCategory;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Categories.class)
-@IncludeCategory(FastTest.class)
-@SuiteClasses(
-{ FastResourceLocatorSuite.class})
-public class DesignTimeFastTests
-{
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeTestsPlugin.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeTestsPlugin.java
deleted file mode 100644
index 8815c49..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/DesignTimeTestsPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class DesignTimeTestsPlugin extends AbstractUIPlugin {
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.designtime.tests";
-
- // The shared instance
- private static DesignTimeTestsPlugin plugin;
-
- /**
- * The constructor
- */
- public DesignTimeTestsPlugin() {
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(final BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static DesignTimeTestsPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestAbstractDataModelVariableFactory.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestAbstractDataModelVariableFactory.java
deleted file mode 100644
index 966407f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestAbstractDataModelVariableFactory.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.IAssignable;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.internal.types.ValueType;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.IBoundedMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.internal.util.IObjectSymbolBasedValueType;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.internal.symbols.DataModelVariableTestFacade;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestAbstractDataModelVariableFactory extends TestCase
-{
- private JSFFacetedTestEnvironment _jsfFacetedTestEnvironment;
- private JDTTestEnvironment _jdtTestEnvironment;
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestAbstractDataModelVariableFactory_"+getName());
- projectTestEnvironment.createProject(false);
-
- _jsfFacetedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFacetedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- try
- {
- final IProject project = _jdtTestEnvironment.getJavaProject().getProject();
- project.close(null);
- project.delete(true, null);
- }
- catch (CoreException ce)
- {
- ce.printStackTrace(System.err);
- }
- }
-
- public final void testCreateArraySymbol()
- {
- // test array of int. Should yield a scalar symbol for int
- createAndVerifyArraySymbol("intArray", Signature.SIG_INT, 1, Signature.SIG_INT, 0);
- // test array of String. Should yield a string
- createAndVerifyArraySymbol("stringArray", TypeConstants.TYPE_STRING, 1, TypeConstants.TYPE_STRING, 0);
- // test an array of array of strings. Should yield an array of Strings
- createAndVerifyArraySymbol("stringArrayArray", TypeConstants.TYPE_STRING, 2, TypeConstants.TYPE_STRING, 1);
- }
-
- private ISymbol createAndVerifyArraySymbol(final String name, final String typeSignature, final int arrayCount, final String expectedResultSignature, final int expectedArrayCount)
- {
- final DataModelVariableTestFacade testFacade = new DataModelVariableTestFacade();
-
- final ISymbol symbol = testFacade.testCreateArraySymbol(name, Signature.createArraySignature(typeSignature, arrayCount), _jdtTestEnvironment.getJavaProject());
- assertTrue(symbol instanceof IInstanceSymbol);
- final IInstanceSymbol instanceSymbol = (IInstanceSymbol) symbol;
- assertTrue(instanceSymbol.getTypeDescriptor() instanceof IJavaTypeDescriptor2);
- final IJavaTypeDescriptor2 typeDesc = (IJavaTypeDescriptor2) instanceSymbol.getTypeDescriptor();
- assertEquals(name, symbol.getName());
- assertEquals(Signature.createArraySignature(expectedResultSignature,expectedArrayCount),typeDesc.getTypeSignature());
- assertEquals(expectedArrayCount, typeDesc.getArrayCount());
-
- return symbol;
- }
-
-
- public final void testCreateFromList()
- {
- final String[] stringArgType = new String[] {TypeConstants.TYPE_STRING};
- final String[] listOfStringArgType =
- new String[] {"Ljava.util.List<Ljava.lang.String;>;"};
-
- final DataModelVariableTestFacade testFacade = new DataModelVariableTestFacade();
-
- // test non-parameterized list
- ValueType valueType = new ValueType(TypeConstants.TYPE_LIST, new String[0], new String[0], new String[0],false, IAssignable.ASSIGNMENT_TYPE_RHS);
- ISymbol symbol = testFacade.testCreateFromList("rawList", valueType, _jdtTestEnvironment.getJavaProject());
- {
- // should create the same as passing directly to default
- final ISymbol compareSymbol = testFacade.getSymbolFactory()
- .createDefaultSymbol("rawListDefault",
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL,
- null);
- assertTrue(symbol instanceof IComponentSymbol);
- assertTrue(compareSymbol instanceof IComponentSymbol);
-
- final IComponentSymbol s1 = (IComponentSymbol) symbol;
- final IComponentSymbol s2 = (IComponentSymbol) compareSymbol;
- assertSame(s1, s2);
- }
-
- // test list of strings
- valueType = new ValueType(TypeConstants.TYPE_LIST, stringArgType, new String[0], new String[0], false, IAssignable.ASSIGNMENT_TYPE_RHS);
- symbol = testFacade.testCreateFromList("string", valueType, _jdtTestEnvironment.getJavaProject());
- assertTrue(symbol instanceof IComponentSymbol);
- assertEquals(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, ((IComponentSymbol)symbol).getRuntimeSource());
- assertEquals(TypeConstants.TYPE_STRING, ((IComponentSymbol)symbol).getTypeDescriptor().getTypeSignature());
- assertEquals(0, ((IComponentSymbol)symbol).getTypeDescriptor().getTypeParameterSignatures().size());
-
- // test list of list of strings
- valueType = new ValueType(TypeConstants.TYPE_LIST, listOfStringArgType, new String[0], new String[0], false, IAssignable.ASSIGNMENT_TYPE_RHS);
- symbol = testFacade.testCreateFromList("listOfString", valueType, _jdtTestEnvironment.getJavaProject());
- assertTrue(symbol instanceof IComponentSymbol);
- assertEquals(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, ((IComponentSymbol)symbol).getRuntimeSource());
- assertEquals(TypeConstants.TYPE_LIST, ((IComponentSymbol)symbol).getTypeDescriptor().getTypeSignature());
- assertEquals(1, ((IComponentSymbol)symbol).getTypeDescriptor().getTypeParameterSignatures().size());
- assertEquals("Ljava.lang.String;", ((IComponentSymbol)symbol).getTypeDescriptor().getTypeParameterSignatures().get(0));
- // next level: get the nested string in the list
- valueType = IObjectSymbolBasedValueType.getInstance(symbol);
- symbol = testFacade.testCreateFromList("subListOfString", valueType, _jdtTestEnvironment.getJavaProject());
- assertTrue(symbol instanceof IComponentSymbol);
- assertEquals(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, ((IComponentSymbol)symbol).getRuntimeSource());
- assertEquals(TypeConstants.TYPE_STRING, ((IComponentSymbol)symbol).getTypeDescriptor().getTypeSignature());
- assertEquals(0, ((IComponentSymbol)symbol).getTypeDescriptor().getTypeParameterSignatures().size());
- }
-
- private void assertSame(final IComponentSymbol s1, final IComponentSymbol s2)
- {
- // ensure we don't pass the same ref twice by accident
- assertFalse(s1 == s2);
- assertEquals(s1.getRuntimeSource(), s2.getRuntimeSource());
- assertEquals(s1.getDetailedDescription(), s2.getDetailedDescription());
- assertEquals(s1.getTypeDescriptor().getTypeSignature(), s2.getTypeDescriptor().getTypeSignature());
- }
-
- public final void testCreateScalarSymbol()
- {
- createAndVerifyScalar("String", TypeConstants.TYPE_STRING);
- createAndVerifyScalar("List", TypeConstants.TYPE_LIST);
- createAndVerifyScalar("ListOfString", "Ljava.util.List<Ljava.lang.String;>;");
- createAndVerifyScalar("ArrayOfInteger", Signature.createArraySignature(TypeConstants.TYPE_BOXED_INTEGER, 1));
- }
-
- private void createAndVerifyScalar(final String name, final String signature)
- {
- final DataModelVariableTestFacade testFacade = new DataModelVariableTestFacade();
- final ISymbol symbol = testFacade.testCreateScalarSymbol("", signature, _jdtTestEnvironment.getJavaProject());
- assertTrue(symbol instanceof IComponentSymbol);
- final IComponentSymbol compSymbol = (IComponentSymbol) symbol;
- assertEquals(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, ((IComponentSymbol)symbol).getRuntimeSource());
- assertEquals(Signature.getTypeErasure(signature), compSymbol.getTypeDescriptor().getTypeSignature());
-
- final String[] typeArgs = Signature.getTypeArguments(signature);
- for (int i = 0; i < typeArgs.length; i++)
- {
- assertEquals(typeArgs[i], compSymbol.getTypeDescriptor().getTypeParameterSignatures().get(i));
- }
- }
-
- public final void testCreateDefaultSymbol()
- {
- final DataModelVariableTestFacade testFacade = new DataModelVariableTestFacade();
- final ISymbol defaultSymbol = testFacade.getSymbolFactory()
- .createDefaultSymbol("foo",
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL,
- "Test raw list dataTableVariable");
- assertNotNull(defaultSymbol);
- assertEquals("foo", defaultSymbol.getName());
- assertTrue(defaultSymbol instanceof IComponentSymbol);
- final IComponentSymbol symbol = (IComponentSymbol) defaultSymbol;
- assert(symbol.getTypeDescriptor() instanceof IBoundedMapTypeDescriptor);
- assertEquals(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL, symbol.getRuntimeSource());
- assertNotNull(symbol.getDetailedDescription());
- }
-
- public final void testCreateFromType()
- {
- final DataModelVariableTestFacade testFacade = new DataModelVariableTestFacade();
- // test each of known branches against the construction method that's expected to be called
-
- // an array of something should yield the same thing as createArraySymbol
- {
- final String arraySig = "[Ljava.lang.String;";
- final ValueType valueType = new ValueType(arraySig, new String[0], new String[0], new String[0], false, IAssignable.ASSIGNMENT_TYPE_RHS);
- final ISymbol array1 = testFacade.createFromType("array", valueType, _jdtTestEnvironment.getJavaProject());
- final ISymbol array2 = testFacade.testCreateArraySymbol("array2", arraySig, _jdtTestEnvironment.getJavaProject());
- assertSame((IComponentSymbol)array1, (IComponentSymbol)array2);
- }
-
- // if it's a list should be the same as createFromList
- {
- final String listSig = TypeConstants.TYPE_LIST;
- final ValueType valueType = new ValueType(listSig, new String[0], new String[0], new String[0], false, IAssignable.ASSIGNMENT_TYPE_RHS);
- final ISymbol list1 = testFacade.createFromType("list", valueType, _jdtTestEnvironment.getJavaProject());
- final ISymbol list2 = testFacade.testCreateFromList("list2", valueType, _jdtTestEnvironment.getJavaProject());
- assertSame((IComponentSymbol)list1, (IComponentSymbol)list2);
- }
-
- // if it's a DataModel, should be the same as default
- {
- final String dataModelSig = TypeConstants.TYPE_DATA_MODEL;
- final ValueType valueType = new ValueType(dataModelSig, new String[0], new String[0], new String[0], false, IAssignable.ASSIGNMENT_TYPE_RHS);
- final ISymbol dataModel1 = testFacade.createFromType("dataModel", valueType, _jdtTestEnvironment.getJavaProject());
- final ISymbol dataModel2 = testFacade.getSymbolFactory()
- .createDefaultSymbol("dataModel2",
- ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL,
- "Row variable for dataTable");
- assertSame((IComponentSymbol)dataModel1, (IComponentSymbol)dataModel2);
- }
-
- // if it's just some non-special object, like a String, then should be same as scalar
- {
- final String stringSig = TypeConstants.TYPE_STRING;
- final ValueType valueType = new ValueType(stringSig, new String[0], new String[0], new String[0], false, IAssignable.ASSIGNMENT_TYPE_RHS);
- final ISymbol scalar1 = testFacade.createFromType("scalar1", valueType, _jdtTestEnvironment.getJavaProject());
- final ISymbol scalar2 = testFacade.testCreateScalarSymbol("scalar2", stringSig, _jdtTestEnvironment.getJavaProject());
- assertSame((IComponentSymbol)scalar1, (IComponentSymbol)scalar2);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTFacesContext.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTFacesContext.java
deleted file mode 100644
index 00909b3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTFacesContext.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.context.IDTExternalContext;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot;
-import org.eclipse.jst.jsf.designtime.internal.view.IViewRootHandle;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class TestDTFacesContext extends TestCase
-{
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private WebProjectTestEnvironment _webProjectTestEnv;
- private IFile _testJSP;
-
-
- private final static String TESTJSP1_PATH = "testdata1.jsp";
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- _webProjectTestEnv= new WebProjectTestEnvironment(getProjectName(), JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.5"));
- _webProjectTestEnv.createProject(false);
-
- _webProjectTestEnv.
- loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_2_0.xml.data",
- "/WEB-INF/faces-config.xml");
- final IResource res = _webProjectTestEnv.loadResourceInWebRoot(
- DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/testdata1.jsp.data", TESTJSP1_PATH);
- _testJSP = (IFile) res;
-
- new JDTTestEnvironment(_webProjectTestEnv);
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(
- _webProjectTestEnv);
- _jsfFactedTestEnvironment
- .initialize(IJSFCoreConstants.FACET_VERSION_2_0);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetDTExternalContext()
- {
- final DTFacesContext facesContext = getFacesContext(_testJSP);
- assertNotNull(facesContext);
- final IDTExternalContext externalContext = facesContext.getDTExternalContext(_testJSP);
- assertNotNull(externalContext);
- assertEquals(0, externalContext.getNoneMap().size());
- // the JSP page define a variable for a dataTable and a loadBundle
- assertEquals(2, externalContext.getRequestMap().size());
- assertEquals(0, externalContext.getSessionMap().size());
- assertEquals(0, externalContext.getApplicationMap().size());
-
- // verify the context path
- assertEquals(getProjectName(), externalContext.getRequestContextPath());
- }
-
- public void testGetViewRoot()
- {
- // other tests on viewroot in view.*
- final DTFacesContext facesContext = getFacesContext(_testJSP);
- IViewRootHandle handle = facesContext.getViewRootHandle();
- final DTUIViewRoot viewRoot = handle.updateViewRoot();
- assertNotNull(viewRoot);
- assertEquals("/"+TESTJSP1_PATH, viewRoot.getViewId());
-
- assertNotNull(viewRoot.getViewMap());
- }
-
- public void _testAdaptContextObject() {
- final DTFacesContext facesContext = getFacesContext(_testJSP);
- final IResource res = facesContext.adaptContextObject();
- assertEquals(_testJSP, res);
- }
-
- private DTFacesContext getFacesContext(final IFile jspFile)
- {
- final IProject project = _webProjectTestEnv.getTestProject();
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(project);
-
- return manager.getFacesContext(jspFile);
-
- }
-
- private String getProjectName()
- {
- return "TestDesignTimeApplicationManager_" + getName();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTJSPExternalContext.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTJSPExternalContext.java
deleted file mode 100644
index a6f2540..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTJSPExternalContext.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTJSPExternalContext;
-import org.eclipse.jst.jsf.designtime.context.IDTExternalContext;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestDTJSPExternalContext extends TestCase
-{
- private IFile _testJSP1;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment(getProjectName());
- projectTestEnvironment.createProject(false);
-
- final JDTTestEnvironment jdtTestEnvironment =
- new JDTTestEnvironment(projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "bundles", "bundle1.properties");
-
- final IResource res = projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP1 = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(JSFCoreUtilHelper.createSimpleRegistryFactory());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(null);
- }
-
- public void testDefaultDoGetMapForScopeInt()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_testJSP1.getProject());
-
- {
- final IDTExternalContext externalContext =
- manager.getFacesContext(_testJSP1).getDTExternalContext(_testJSP1);
-
- final Map<String, ISymbol> requestMap = externalContext.getRequestMap();
- final Collection<ISymbol> symbols = requestMap.values();
- // there is a bundle defined in the test JSP
- // also a data table row variable
- assertEquals(2, symbols.size());
- assertContainsVariable(symbols,"bundle");
- assertContainsVariable(symbols,"row");
- }
-
- {
- final TestableDTJSPExternalContext externalContext =
- new TestableDTJSPExternalContext(_testJSP1);
-
- final Map<String, ISymbol> requestMap = externalContext.getRequestMap();
- Collection<ISymbol> symbols = requestMap.values();
- assertEquals(1, symbols.size());
- assertContainsVariable(symbols,"requestSymbol");
-
- final Map<String, ISymbol> sessionMap = externalContext.getSessionMap();
- symbols = sessionMap.values();
- assertEquals(1, symbols.size());
- assertContainsVariable(symbols,"sessionSymbol");
-
- final Map<String, ISymbol> applicationMap = externalContext.getApplicationMap();
- symbols = applicationMap.values();
- assertEquals(1, symbols.size());
- assertContainsVariable(symbols,"applicationSymbol");
-
- final Map<String, ISymbol> noneMap = externalContext.getNoneMap();
- symbols = noneMap.values();
- assertEquals(1, symbols.size());
- assertContainsVariable(symbols,"noneSymbol");
-
-// final Map<String, ISymbol> viewMap = externalContext.getFlashMap();
-// symbols = viewMap.values();
-// assertEquals(1, symbols.size());
-// assertContainsVariable(symbols,"flashSymbol");
-
- externalContext.trace(System.out);
- }
- }
-
- public void testGetRequestContextPath()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_testJSP1.getProject());
- final IDTExternalContext externalContext =
- manager.getFacesContext(_testJSP1).getDTExternalContext(_testJSP1);
- assertTrue(externalContext instanceof DTJSPExternalContext);
- assertEquals(getProjectName(), externalContext.getRequestContextPath());
- }
- private void assertContainsVariable(final Collection<ISymbol> variables, final String name)
- {
- for (final ISymbol variable : variables)
- {
- if (name.equals(variable.getName()))
- {
- assertTrue(variable instanceof IInstanceSymbol);
- return;
- }
- }
-
- fail("Expected variable not found: "+name);
- }
-
- private String getProjectName()
- {
- return "TestDTJSPExternalContext"+getName();
- }
-
- private class TestableDTJSPExternalContext extends DTJSPExternalContext
- {
- protected TestableDTJSPExternalContext(final IAdaptable jspFile)
- {
- super(jspFile);
- }
-
- @Override
- protected Map<String, ISymbol> doGetMapForScope(final int scopeMask)
- {
- switch(scopeMask)
- {
- case ISymbolConstants.SYMBOL_SCOPE_REQUEST:
- return initRequestMap();
-
- case ISymbolConstants.SYMBOL_SCOPE_SESSION:
- return initSessionMap();
-
- case ISymbolConstants.SYMBOL_SCOPE_APPLICATION:
- return initApplicationMap();
-
- case ISymbolConstants.SYMBOL_SCOPE_NONE:
- return initNoneMap();
-
-// case ISymbolConstants.SYMBOL_SCOPE_FLASH:
-// return initFlashMap();
-//
- }
-
- throw new IllegalArgumentException();
- }
-
- private Map<String, ISymbol> initRequestMap()
- {
- final Map<String, ISymbol> map = new HashMap<String, ISymbol>();
- final ISymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("requestSymbol");
- map.put("requestSymbol", symbol);
-
- return map;
- }
-
- private Map<String, ISymbol> initSessionMap()
- {
- final Map<String, ISymbol> map = new HashMap<String, ISymbol>();
-
- final ISymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("sessionSymbol");
- map.put("sessionSymbol", symbol);
-
- return map;
- }
-
- private Map<String, ISymbol> initApplicationMap()
- {
- final Map<String, ISymbol> map = new HashMap<String, ISymbol>();
-
- final ISymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("applicationSymbol");
- map.put("applicationSymbol", symbol);
-
- return map;
- }
-
- private Map<String, ISymbol> initNoneMap()
- {
- final Map<String, ISymbol> map = new HashMap<String, ISymbol>();
-
- final ISymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("noneSymbol");
- map.put("noneSymbol", symbol);
-
- return map;
- }
-
-// private Map<String, ISymbol> initFlashMap()
-// {
-// final Map<String, ISymbol> map = new HashMap<String, ISymbol>();
-//
-// final ISymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
-// symbol.setName("flashSymbol");
-// map.put("flashSymbol", symbol);
-//
-// return map;
-// }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultBeanSymbolSourceProvider.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultBeanSymbolSourceProvider.java
deleted file mode 100644
index b6cf143..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultBeanSymbolSourceProvider.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.symbols.DefaultBeanSymbolSourceProvider;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * JUnit tests for org.eclipse.jst.jsf.designtime.DefaultBeanSymbolSourceProvider
- *
- * @author cbateman
- *
- */
-public class TestDefaultBeanSymbolSourceProvider extends TestCase
-{
- private JDTTestEnvironment _jdtTestEnvironment;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private IFile _facesConfigFile;
-
- private final static String SRC_FOLDER_NAME = "src";
- private final static String PACKAGE_NAME = "com.test";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestDefaultBeanSymbolSourceProvider_"+getName());
- projectTestEnvironment.createProject(false);
- _facesConfigFile = (IFile) projectTestEnvironment.
- loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config.xml.data",
- "/WEB-INF/faces-config.xml");
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- JSFTestUtil.loadSourceClass(
- TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data", "TestBean1", SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /**
- * Test the external sanity of the suite (i.e. that the test data is in sync)
- */
- public void testSanity()
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] symbol =
- provider.getSymbols(_facesConfigFile, ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- assertNotNull(symbol);
- assertEquals("Check that test suite is in sync with setup()", symbol.length, 4);
- }
-
- /**
- *
- */
- public void testAllScopes()
- {
- final String[] names = new String[]{"myBean_request", "myBean_session", "myBean_application", "myBean_none"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_ALL, names.length, names);
- }
-
- /**
- * Check mask by request scope
- */
- public void testOnlyRequestBeans()
- {
- final String[] names = new String[]{"myBean_request"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_REQUEST, names.length, names);
- }
-
- /**
- * Check mask by Session scope
- */
- public void testOnlySessionBeans()
- {
- final String[] names = new String[]{"myBean_session"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_SESSION, names.length, names);
- }
-
- /**
- * Check mask by Application scope
- */
- public void testOnlyApplicationBeans()
- {
- final String[] names = new String[]{"myBean_application"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_APPLICATION, names.length, names);
- }
- /**
- * Check mask by None scope
- */
- public void testOnlyNoneBeans()
- {
- final String[] names = new String[]{"myBean_none"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_NONE, names.length, names);
- }
-
- private void testScopeBeans(final int scope, final int expectedSize, final String[] expectedNames)
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] symbols =
- provider.getSymbols(_facesConfigFile, scope);
-
- assertEquals(expectedSize, symbols.length);
-
- for (int j = 0; j < expectedNames.length; j++)
- {
- final String expectedName = expectedNames[j];
- assertNotNull(expectedName);
- boolean found = false;
-
- FIND_IN_SYMBOLS:
- for (int i = 0; i < symbols.length; i++)
- {
- if (expectedName.equals(symbols[i].getName()))
- {
- found = true;
- break FIND_IN_SYMBOLS;
- }
- }
-
- assertTrue(found);
- }
- }
-
- /**
- * Test the get symbol by prefix
- */
- public void testPrefixSearch()
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] symbols =
- provider.getSymbols("myBean_n", _facesConfigFile, ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- assertEquals(1, symbols.length);
- assertEquals("myBean_none", symbols[0].getName());
- }
-
- /**
- * Test getting a symbol it's name
- */
- public void testGetSymbolByName()
- {
- testGetSymbolByName("myBean_none");
- testGetSymbolByName("myBean_application");
- testGetSymbolByName("myBean_session");
- testGetSymbolByName("myBean_request");
- }
-
- private void testGetSymbolByName(final String expectedName)
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol symbol =
- provider.getSymbol(expectedName, _facesConfigFile,
- ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- assertNotNull(symbol);
- assertEquals(expectedName, symbol.getName());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTMethodResolver.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTMethodResolver.java
deleted file mode 100644
index 9cf4776..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTMethodResolver.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTMethodResolver;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestDefaultDTMethodResolver extends TestCase
-{
- private JDTTestEnvironment _jdtTestEnvironment;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
-
- private IType _methodBeanType;
-
- private final static String SRC_FOLDER_NAME = "src";
- private final static String PACKAGE_NAME = "com.test";
- private final static String TESTBEAN1_NAME = "MethodBean";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestDefaultMethodResolver_"
- + getName());
- projectTestEnvironment.createProject(false);
-
- _jsfFactedTestEnvironment =
- new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment
- .initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/MethodBean.java.data", TESTBEAN1_NAME,
- SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _methodBeanType =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + TESTBEAN1_NAME);
- assertNotNull(_methodBeanType);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- try
- {
- final IProject project =
- _jdtTestEnvironment.getJavaProject().getProject();
- project.close(null);
- project.delete(true, null);
- }
- catch (final CoreException ce)
- {
- ce.printStackTrace(System.err);
- }
- }
-
- public void testGetMethod()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("myBean2");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_methodBeanType);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTMethodResolver methodResolver =
- new DefaultDTMethodResolver();
-
- IMethodSymbol methodSymbol =
- methodResolver.getMethod(symbol, "actionMethod");
- assertNotNull(methodSymbol);
- assertEquals("actionMethod", methodSymbol.getName());
- assertEquals("()Ljava.lang.String;", methodSymbol.getSignature());
-
- methodSymbol =
- methodResolver.getMethod(symbol, "actionMethodWithParam");
- assertNotNull(methodSymbol);
- assertEquals("actionMethodWithParam", methodSymbol.getName());
- assertEquals("(Ljava.lang.String;)Ljava.lang.String;", methodSymbol
- .getSignature());
-
- // method not found
- methodSymbol = methodResolver.getMethod(symbol, "notAMethod");
- assertNull(methodSymbol);
- }
-
- public void testGetMethods()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("myBean2");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_methodBeanType);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTMethodResolver methodResolver =
- new DefaultDTMethodResolver();
-
- final ISymbol[] symbols = methodResolver.getMethods(symbol);
- assertNotNull(symbols);
- assertEquals(11, symbols.length);
- assertContains(symbols, "actionMethod", "()Ljava.lang.String;");
- assertContains(symbols, "actionMethodWithParam",
- "(Ljava.lang.String;)Ljava.lang.String;");
- }
-
- private void assertContains(final ISymbol[] methods, final String name,
- final String signature)
- {
- IMethodSymbol methodSymbol = null;
-
- for (final ISymbol symbol : methods)
- {
- if (name.equals(symbol.getName()))
- {
- assertTrue(symbol instanceof IMethodSymbol);
- if (((IMethodSymbol) symbol).getSignature().equals(signature))
- {
- methodSymbol = (IMethodSymbol) symbol;
- }
- }
- }
-
- assertNotNull(methodSymbol);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTVariableResolver.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTVariableResolver.java
deleted file mode 100644
index a42dd50..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTVariableResolver.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.ITypeDescriptor;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTVariableResolver;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanScopeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestDefaultDTVariableResolver extends TestCase
-{
- private IType _testBean1Type;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private JDTTestEnvironment _jdtTestEnvironment;
- private IFile _testJSP1;
-
- private final static String SRC_FOLDER_NAME = "src";
- private final static String PACKAGE_NAME = "com.test";
- private final static String TESTBEAN1_NAME = "TestBean1";
-
-
- @Override
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestDefaultPropertyResolver_"+getName());
- projectTestEnvironment.createProject(false);
-
- final IResource res = projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP1 = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- final IProject project = projectTestEnvironment.getTestProject();
-
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForWrite(project, null);
-
- final FacesConfigType model = edit.getFacesConfig();
- final ManagedBeanClassType beanClass = FacesConfigFactory.eINSTANCE.createManagedBeanClassType();
- beanClass.setTextContent("com.test.TestBean1");
-
- final ManagedBeanNameType beanName = FacesConfigFactory.eINSTANCE.createManagedBeanNameType();
- beanName.setTextContent("testBean1");
-
- final ManagedBeanScopeType beanScope = FacesConfigFactory.eINSTANCE.createManagedBeanScopeType();
- beanScope.setTextContent("session");
-
- final ManagedBeanType bean = FacesConfigFactory.eINSTANCE.createManagedBeanType();
- bean.setManagedBeanClass(beanClass);
- bean.setManagedBeanName(beanName);
- bean.setManagedBeanScope(beanScope);
-
- model.getManagedBean().add(bean);
-
- edit.save(null);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- _jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "bundles", "bundle1.properties");
-
- JSFTestUtil.loadSourceClass(
- DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/TestBean1.java.data", TESTBEAN1_NAME, SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testBean1Type = _jdtTestEnvironment.getJavaProject().findType(PACKAGE_NAME+"."+TESTBEAN1_NAME);
- assertNotNull(_testBean1Type);
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(JSFCoreUtilHelper.createSimpleRegistryFactory());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(null);
- }
-
- public void testResolveVariable()
- {
- checkBuiltinVariables();
- checkSymbolMaps();
- checkManagedBeanVariable();
- }
-
- private void checkBuiltinVariables()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance
- (_jdtTestEnvironment.getProjectEnvironment().getTestProject());
-
- final DefaultDTVariableResolver variableResolver = new DefaultDTVariableResolver();
- final ISymbol symbol = variableResolver.resolveVariable
- (manager.getFacesContext(_testJSP1), "applicationScope", _testJSP1);
- assertNotNull(symbol);
- }
-
- private void checkSymbolMaps()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance
- (_jdtTestEnvironment.getProjectEnvironment().getTestProject());
-
- final DefaultDTVariableResolver variableResolver = new DefaultDTVariableResolver();
- final ISymbol symbol = variableResolver.resolveVariable
- (manager.getFacesContext(_testJSP1), "bundle", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IComponentSymbol);
-
- final IComponentSymbol compSymbol = (IComponentSymbol) symbol;
- assertEquals("bundle", compSymbol.getName());
- final ITypeDescriptor typeDesc = compSymbol.getTypeDescriptor();
- assertTrue(typeDesc instanceof IMapTypeDescriptor);
- }
-
- private void checkManagedBeanVariable()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance
- (_jdtTestEnvironment.getProjectEnvironment().getTestProject());
-
- final DefaultDTVariableResolver variableResolver = new DefaultDTVariableResolver();
- final ISymbol symbol = variableResolver.resolveVariable
- (manager.getFacesContext(_testJSP1), "testBean1", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IBeanInstanceSymbol);
-
- final IBeanInstanceSymbol compSymbol = (IBeanInstanceSymbol) symbol;
- assertEquals("testBean1", compSymbol.getName());
- final ITypeDescriptor typeDesc = compSymbol.getTypeDescriptor();
- assertTrue(typeDesc instanceof IJavaTypeDescriptor2);
- assertEquals("Lcom.test.TestBean1;", typeDesc.getTypeSignature());
- }
-
- public void testGetAllVariables()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance
- (_jdtTestEnvironment.getProjectEnvironment().getTestProject());
-
- final DefaultDTVariableResolver variableResolver = new DefaultDTVariableResolver();
-
- final ISymbol[] variables = variableResolver.getAllVariables
- (manager.getFacesContext(_testJSP1), _testJSP1);
-
- assertContainsVariable(variables, "applicationScope");
- assertContainsVariable(variables, "sessionScope");
- assertContainsVariable(variables, "requestScope");
- assertContainsVariable(variables, "cookie");
- assertContainsVariable(variables, "facesContext");
- assertContainsVariable(variables, "header");
- assertContainsVariable(variables, "headerValues");
- assertContainsVariable(variables, "initParam");
- assertContainsVariable(variables, "param");
- assertContainsVariable(variables, "paramValues");
- assertContainsVariable(variables, "view");
- assertContainsVariable(variables, "testBean1");
- assertContainsVariable(variables, "bundle");
-
- //this is a JSF1.x context... there should be no JSF2.0 implicit variables
- assertDoesNotContainVariable(variables, "viewScope");
- assertDoesNotContainVariable(variables, "flash");
- assertDoesNotContainVariable(variables, "cc");
- assertDoesNotContainVariable(variables, "component");
- assertDoesNotContainVariable(variables, "resource");
- }
-
- private void assertContainsVariable(final ISymbol[] variables, final String name)
- {
- for (final ISymbol variable : variables)
- {
- if (name.equals(variable.getName()))
- {
- assertTrue(variable instanceof IInstanceSymbol);
- return;
- }
- }
-
- fail("Expected variable not found: "+name);
- }
-
- private void assertDoesNotContainVariable(final ISymbol[] variables, final String name)
- {
- for (final ISymbol variable : variables)
- {
- if (name.equals(variable.getName()))
- {
- fail("Variable was not expected to be found: "+name);
- return;
- }
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultPropertyResolver.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultPropertyResolver.java
deleted file mode 100644
index 9bba12c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultPropertyResolver.java
+++ /dev/null
@@ -1,842 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-import org.eclipse.jst.jsf.common.util.JDTBeanIntrospector;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBoundedMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IComponentSymbol;
-import org.eclipse.jst.jsf.context.symbol.IJavaTypeDescriptor2;
-import org.eclipse.jst.jsf.context.symbol.IMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IObjectSymbol;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.SymbolFactory;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.internal.symbols.ResourceBundleMapSourceFactory;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-/**
- * Unit tests for the default property resolver
- *
- * @author cbateman
- *
- */
-public class TestDefaultPropertyResolver extends TestCase
-{
- private static final int NUM_PROPERTIES_TEST_BEAN_1 = 6; // includes
- // java.lang.Object.getClass()
- private JDTTestEnvironment _jdtTestEnvironment;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
-
- private IType _testBean1Type;
- private IType _testMapBean1Type;
- private IType _testBean2Type;
- private IType _testBean3Type;
- private IType _testBeanWithMapProp;
- private IType _testListBeanType;
- private IType _testBeanWithListPropType;
- private IType _testBeanWithGenericProperties;
-
- private final static String SRC_FOLDER_NAME = "src";
- private final static String PACKAGE_NAME = "com.test";
- private final static String TESTBEAN1_NAME = "TestBean1";
- private final static String TESTBEAN2_NAME = "TestBean2";
- private final static String TESTBEAN3_NAME = "TestBean3";
- private final static String MAPBEAN_NAME = "MapBean";
- private final static String BEANWITHMAPPROP_NAME =
- "BeanWithMapProp";
- private final static String LISTBEAN_NAME = "ListBean";
- private final static String BEANWITHLISTPROP_NAME =
- "BeanWithListProp";
- private final static String BEANWITHGENERICPROP_NAME =
- "TestBeanWithGenericProperties";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.uk.oracle.com", "80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestDefaultPropertyResolver_"
- + getName());
- projectTestEnvironment.createProject(false);
-
- _jsfFactedTestEnvironment =
- new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment
- .initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- _jdtTestEnvironment.addResourceFile(SRC_FOLDER_NAME,
- new ByteArrayInputStream(input.toBytes()), "bundles",
- "bundle1.properties");
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/TestBean1.java.data", TESTBEAN1_NAME,
- SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + TESTBEAN1_NAME);
- assertNotNull(_testBean1Type);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/MapBean.java.data", MAPBEAN_NAME,
- SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testMapBean1Type =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + MAPBEAN_NAME);
- assertNotNull(_testMapBean1Type);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/TestBean2.java.data", TESTBEAN2_NAME,
- SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testBean2Type =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + TESTBEAN2_NAME);
- assertNotNull(_testBean2Type);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/TestBean3.java.data", TESTBEAN3_NAME,
- SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testBean3Type =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + TESTBEAN3_NAME);
- assertNotNull(_testBean3Type);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/BeanWithMapProp.java.data",
- BEANWITHMAPPROP_NAME, SRC_FOLDER_NAME, PACKAGE_NAME,
- _jdtTestEnvironment);
- _testBeanWithMapProp =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + BEANWITHMAPPROP_NAME);
- assertNotNull(_testBeanWithMapProp);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/ListBean.java.data", LISTBEAN_NAME,
- SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testListBeanType =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + LISTBEAN_NAME);
- assertNotNull(_testListBeanType);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(), "/testdata/BeanWithListProp.java.data",
- BEANWITHLISTPROP_NAME, SRC_FOLDER_NAME, PACKAGE_NAME,
- _jdtTestEnvironment);
- _testBeanWithListPropType =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + BEANWITHLISTPROP_NAME);
- assertNotNull(_testBeanWithListPropType);
-
- JSFTestUtil.loadSourceClass(DesignTimeTestsPlugin.getDefault()
- .getBundle(),
- "/testdata/TestBeanWithGenericProperties.java.data",
- BEANWITHGENERICPROP_NAME, SRC_FOLDER_NAME, PACKAGE_NAME,
- _jdtTestEnvironment);
- _testBeanWithGenericProperties =
- _jdtTestEnvironment.getJavaProject().findType(
- PACKAGE_NAME + "." + BEANWITHGENERICPROP_NAME);
- assertNotNull(_testBeanWithGenericProperties);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- try
- {
- final IProject project =
- _jdtTestEnvironment.getJavaProject().getProject();
- project.close(null);
- project.delete(true, null);
- }
- catch (final CoreException ce)
- {
- ce.printStackTrace(System.err);
- }
- }
-
- /**
- * Test precondition sanity
- */
- public void testSanity()
- {
- JDTBeanIntrospector beanIntrospector =
- new JDTBeanIntrospector(_testBean1Type);
- Map<String, JDTBeanProperty> props = beanIntrospector.getProperties();
- assertEquals(NUM_PROPERTIES_TEST_BEAN_1, props.size());
- assertTrue(props.containsKey("stringProp1"));
- assertTrue(props.containsKey("booleanIsProp1"));
-
- beanIntrospector = new JDTBeanIntrospector(_testMapBean1Type);
- props = beanIntrospector.getProperties();
- // has 2 as a bean: isEmpty -> empty property + class
- assertEquals(2, props.size());
-
- beanIntrospector = new JDTBeanIntrospector(_testBean2Type);
- props = beanIntrospector.getProperties();
- // two props: myBean3, class
- assertEquals(2, props.size());
-
- beanIntrospector = new JDTBeanIntrospector(_testBean3Type);
- props = beanIntrospector.getProperties();
- // two props: one of type TestBean2 + class
- assertEquals(2, props.size());
-
- beanIntrospector = new JDTBeanIntrospector(_testBeanWithMapProp);
- props = beanIntrospector.getProperties();
- // two props: one of type Map + class
- assertEquals(2, props.size());
-
- beanIntrospector = new JDTBeanIntrospector(_testListBeanType);
- props = beanIntrospector.getProperties();
- // includes isEmpty and class
- assertEquals(3, props.size());
-
- beanIntrospector = new JDTBeanIntrospector(_testBeanWithListPropType);
- props = beanIntrospector.getProperties();
- assertEquals(2, props.size());
-
- beanIntrospector =
- new JDTBeanIntrospector(_testBeanWithGenericProperties);
- props = beanIntrospector.getProperties();
- assertEquals(3, props.size());
- }
-
- /**
- * Test a basic simple bean symbol to see if we resolve properties correctly
- */
- public void testBeanInstanceSymbol()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("myBean");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testBean1Type);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- final ISymbol[] properties = propResolver.getAllProperties(symbol);
- assertEquals(NUM_PROPERTIES_TEST_BEAN_1, properties.length);
- final Map<String, ISymbol> checkProps = new HashMap<String, ISymbol>();
- for (final ISymbol propSymbol : properties)
- {
- checkProps.put(propSymbol.getName(), propSymbol);
- }
-
- assertTrue(checkProps.containsKey("stringProp1"));
- assertTrue(checkProps.containsKey("booleanIsProp1"));
-
- {
- final ISymbol stringProp1 =
- propResolver.getProperty(symbol, "stringProp1");
- assertNotNull(stringProp1);
- assertTrue(stringProp1 instanceof IPropertySymbol);
- assertTrue(((IPropertySymbol) stringProp1).getTypeDescriptor()
- .getTypeSignature().equals(TypeConstants.TYPE_STRING));
- final IPropertySymbol mapStringProp1 =
- (IPropertySymbol) checkProps.get("stringProp1");
- assertEquals(((IPropertySymbol) stringProp1).getTypeDescriptor()
- .getTypeSignature(), mapStringProp1.getTypeDescriptor()
- .getTypeSignature());
- }
-
- {
- final ISymbol booleanIsProp =
- propResolver.getProperty(symbol, "booleanIsProp1");
- assertNotNull(booleanIsProp);
- assertTrue(booleanIsProp instanceof IPropertySymbol);
- assertTrue(((IPropertySymbol) booleanIsProp).getTypeDescriptor()
- .getTypeSignature().equals(Signature.SIG_BOOLEAN));
- final IPropertySymbol mapBooleanProp =
- (IPropertySymbol) checkProps.get("booleanIsProp1");
- assertEquals(((IPropertySymbol) booleanIsProp).getTypeDescriptor()
- .getTypeSignature(), mapBooleanProp.getTypeDescriptor()
- .getTypeSignature());
- }
- }
-
- /**
- * Test an unconstrained Map bean
- */
- public void testMapBeanInstanceSymbol()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("myMapBean");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testMapBean1Type);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- final ISymbol[] properties = propResolver.getAllProperties(symbol);
- // there no design-time identifiable properties
- // note that this is different that what JDTBeanIntrospector returns
- // since the default property resolver first coerces to a Map
- // so there are no propeties
- assertEquals(0, properties.length);
-
- // but being that it's an unbounded Map, it may have any number
- // of arbitrary "unconstrained" properties
- for (int i = 0; i < 25; i++)
- {
- final String unconstrainedPropName =
- "someName" + i * 7 + "withNonSequentialNumber" + i * 11;
- final ISymbol someProperty1 =
- propResolver.getProperty(symbol, unconstrainedPropName);
- assertNotNull(someProperty1);
- assertEquals(unconstrainedPropName, someProperty1.getName());
- assertTrue(someProperty1 instanceof IPropertySymbol);
- // completely unconstrained properties should come back as java
- // object
- assertEquals(TypeConstants.TYPE_JAVAOBJECT,
- ((IPropertySymbol) someProperty1).getTypeDescriptor()
- .getTypeSignature());
- }
- }
-
- /**
- * Test a component with map source
- */
- public void testComponentBeanInstanceSymbol()
- {
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("myComponentSymbol");
- final IMapTypeDescriptor typeDesc =
- SymbolFactory.eINSTANCE.createIMapTypeDescriptor();
- final Map<String, String> mapSource = new HashMap<String, String>();
- mapSource.put("prop1", "propValue1");
- mapSource.put("prop2", "propValue2");
- mapSource.put("dotted.property", "dottedPropertyValue");
- typeDesc.setMapSource(mapSource);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- final ISymbol[] properties = propResolver.getAllProperties(symbol);
-
- // should have three properties
- assertEquals(3, properties.length);
-
- // loop 10 times through the inner loop assertions to
- // verify that getAllProperties and getProperties are
- // idempotent
- for (int j = 0; j < 10; j++)
- {
- // should have properties from mapSource above
- // these should all be equivalent to those returned by getProperty
- // since the object is a map first and foremost (e.g. not a bean
- // cast to a Map)
- for (final ISymbol propertie : properties)
- {
- // make sure the property's name matches a value in map source
- // for the dotted one, we make an exception
- assertTrue(mapSource.containsKey(propertie.getName())
- || (propertie.getName().startsWith("dotted")));
- // should be a property symbol
- assertTrue(propertie instanceof IPropertySymbol);
- final IPropertySymbol propSymbol = (IPropertySymbol) propertie;
-
- // get the symbol by name
- final ISymbol symbolById =
- propResolver.getProperty(symbol, propSymbol.getName());
- // should have the same name whether in getAll or get
- assertEquals(propSymbol.getName(), symbolById.getName());
- // we don't have an absolute "equals" for symbols, but can at
- // least
- // verify type equivalence
- assertEquals(propSymbol.getTypeDescriptor().getTypeSignature(),
- ((IObjectSymbol) symbolById).getTypeDescriptor()
- .getTypeSignature());
- }
- }
-
- // verify that the dotted property is intermediate and that
- // dotted.property is there
- final ISymbol symbolById = propResolver.getProperty(symbol, "dotted");
- assertNotNull(symbolById);
- assertTrue(((IPropertySymbol) symbolById).isIntermediate());
- final ISymbol dottedProp =
- propResolver.getProperty(symbolById, "property");
- assertTrue(dottedProp instanceof IPropertySymbol);
- assertEquals(TypeConstants.TYPE_STRING, ((IPropertySymbol) dottedProp)
- .getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * Tests a property of property for a bean instance i.e. var.prop1.prop2
- */
- public void testBeanPropertyOnBeanProperty()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("myBean2");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testBean2Type);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- {
- final ISymbol[] properties = propResolver.getAllProperties(symbol);
- assertEquals(2, properties.length); // should have defined property
- // plus class
-
- // check props
- final Map<String, IPropertySymbol> gotProps =
- new HashMap<String, IPropertySymbol>();
-
- for (final ISymbol propertie : properties)
- {
- final IPropertySymbol propSymbol = (IPropertySymbol) propertie;
- assertEquals(propSymbol.getTypeDescriptor().getTypeSignature(),
- ((IObjectSymbol) propResolver.getProperty(symbol,
- propSymbol.getName())).getTypeDescriptor()
- .getTypeSignature());
- gotProps.put(propSymbol.getName(), propSymbol);
- }
-
- assertTrue(gotProps.containsKey("myBean3"));
- assertTrue(gotProps.containsKey("class"));
- }
- // next run recursively on myBean3 10 props deep
- ISymbol curBase = symbol;
- // note, when i is even, the property is myBean3 on TestBean2
- // when i is odd, the property is myBean2 on TestBean3
- for (int i = 0; i < 10; i++)
- {
- final ISymbol[] properties = propResolver.getAllProperties(curBase);
- assertEquals(2, properties.length); // has class property as well as
- // expected in it
- final IPropertySymbol propSymbol =
- (IPropertySymbol) findSymbol(i % 2 == 0 ? "myBean3"
- : "myBean2", properties);
-
- // i is even
- if (i % 2 == 0)
- {
- assertEquals("myBean3", propSymbol.getName());
- assertEquals("Lcom.test.TestBean3;", propSymbol
- .getTypeDescriptor().getTypeSignature());
- curBase = propSymbol;
- }
- // i is odd
- else
- {
- assertEquals("myBean2", propSymbol.getName());
- assertEquals("Lcom.test.TestBean2;", propSymbol
- .getTypeDescriptor().getTypeSignature());
- curBase = propSymbol;
- }
- curBase = propSymbol;
- }
- }
-
- /**
- * Test the case where a bean property is of type Map
- */
- public void testBeanWithMapProperty()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("BeanWithMapProp");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testBeanWithMapProp);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- ISymbol[] properties = propResolver.getAllProperties(symbol);
-
- // should be two properties: mapProp and class
- assertEquals(2, properties.length);
- assertNotNull(findSymbol("mapProp", properties));
- assertEquals(findSymbol("mapProp", properties).getName(), propResolver
- .getProperty(symbol, "mapProp").getName());
-
- final IPropertySymbol mapProp =
- (IPropertySymbol) propResolver.getProperty(symbol, "mapProp");
- assertEquals("Lcom.test.MapBean;", mapProp.getTypeDescriptor()
- .getTypeSignature());
-
- properties = propResolver.getAllProperties(mapProp);
- assertEquals(0, properties.length);
-
- final IPropertySymbol unboundedProp =
- (IPropertySymbol) propResolver.getProperty(mapProp, "foo");
- assertEquals(TypeConstants.TYPE_JAVAOBJECT, unboundedProp
- .getTypeDescriptor().getTypeSignature());
- }
-
- /**
- * Verify that bean properties of type array are resolved properly using the
- * getProperty(base, offset) method.
- */
- public void testBeanWithArrayProperty()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("BeanWithArrayProp");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testBean1Type);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
-
- // test array of strings property
- {
- final ISymbol arrayOfStringsProperty =
- propResolver.getProperty(symbol, "stringArrayProperty");
-
- assertTrue(arrayOfStringsProperty instanceof IPropertySymbol);
- final IPropertySymbol arrayOfStringsPropertySymbol =
- (IPropertySymbol) arrayOfStringsProperty;
- assertEquals(Signature.createArraySignature(
- TypeConstants.TYPE_STRING, 1), arrayOfStringsPropertySymbol
- .getTypeDescriptor().getTypeSignature());
- assertTrue(arrayOfStringsPropertySymbol.getTypeDescriptor()
- .isArray());
- assertEquals(TypeConstants.TYPE_STRING,
- arrayOfStringsPropertySymbol.getTypeDescriptor()
- .getArrayElement().getTypeDescriptor()
- .getTypeSignature());
-
- // now the real property resolver test
- // get an array element
- final ISymbol arrayElement =
- propResolver.getProperty(arrayOfStringsPropertySymbol, 0);
- assertTrue(arrayElement instanceof IObjectSymbol);
- final IObjectSymbol arrayElementSymbol =
- (IObjectSymbol) arrayElement;
- assertNotNull(((IJavaTypeDescriptor2) arrayElementSymbol
- .getTypeDescriptor()).getType());
- assertEquals(TypeConstants.TYPE_STRING, arrayElementSymbol
- .getTypeDescriptor().getTypeSignature());
- }
-
- // test array of int property
- {
- final ISymbol arrayOfIntProperty =
- propResolver.getProperty(symbol, "intArrayProperty");
-
- assertTrue(arrayOfIntProperty instanceof IPropertySymbol);
- final IPropertySymbol arrayOfIntPropertySymbol =
- (IPropertySymbol) arrayOfIntProperty;
- assertEquals(Signature.createArraySignature(Signature.SIG_INT, 1),
- arrayOfIntPropertySymbol.getTypeDescriptor()
- .getTypeSignature());
- assertTrue(arrayOfIntPropertySymbol.getTypeDescriptor().isArray());
- assertEquals(Signature.SIG_INT, arrayOfIntPropertySymbol
- .getTypeDescriptor().getArrayElement().getTypeDescriptor()
- .getTypeSignature());
-
- // now the real property resolver test
- // get an array element
- final ISymbol arrayElement =
- propResolver.getProperty(arrayOfIntPropertySymbol, 0);
- assertTrue(arrayElement instanceof IObjectSymbol);
- final IObjectSymbol arrayElementSymbol =
- (IObjectSymbol) arrayElement;
- // type will be null since int has no corresponding IType (not an
- // object)
- assertNull(((IJavaTypeDescriptor2) arrayElementSymbol
- .getTypeDescriptor()).getType());
- assertEquals(Signature.SIG_INT, arrayElementSymbol
- .getTypeDescriptor().getTypeSignature());
- }
-
- // test array of array of strings
- {
- final ISymbol arrayOfIntProperty =
- propResolver.getProperty(symbol,
- "arrayOfArrayOfStringProperty");
-
- assertTrue(arrayOfIntProperty instanceof IPropertySymbol);
- final IPropertySymbol arrayOfIntPropertySymbol =
- (IPropertySymbol) arrayOfIntProperty;
- assertEquals(Signature.createArraySignature(
- TypeConstants.TYPE_STRING, 2), arrayOfIntPropertySymbol
- .getTypeDescriptor().getTypeSignature());
- assertTrue(arrayOfIntPropertySymbol.getTypeDescriptor().isArray());
- assertEquals(Signature.createArraySignature(
- TypeConstants.TYPE_STRING, 1), arrayOfIntPropertySymbol
- .getTypeDescriptor().getArrayElement().getTypeDescriptor()
- .getTypeSignature());
-
- // now the real property resolver test
- // get an array element
- final ISymbol arrayElement =
- propResolver.getProperty(arrayOfIntPropertySymbol, 0);
- assertTrue(arrayElement instanceof IObjectSymbol);
- final IObjectSymbol arrayElementSymbol =
- (IObjectSymbol) arrayElement;
- assertNotNull(((IJavaTypeDescriptor2) arrayElementSymbol
- .getTypeDescriptor()).getType());
- assertEquals(Signature.createArraySignature(
- TypeConstants.TYPE_STRING, 1), arrayElementSymbol
- .getTypeDescriptor().getTypeSignature());
-
- // the elements of the array are arrays themselves
- assertTrue(arrayElementSymbol.getTypeDescriptor().isArray());
- final ISymbol arrayElementElement =
- propResolver.getProperty(arrayElementSymbol, 0);
- assertTrue(arrayElementElement instanceof IObjectSymbol);
- final IObjectSymbol arrayElementElementSymbol =
- (IObjectSymbol) arrayElementElement;
- assertNotNull(((IJavaTypeDescriptor2) arrayElementElementSymbol
- .getTypeDescriptor()).getType());
- assertEquals(TypeConstants.TYPE_STRING, arrayElementElementSymbol
- .getTypeDescriptor().getTypeSignature());
- }
- }
-
- /**
- * Test an unconstrained Map bean
- */
- public void testListBeanInstanceSymbol()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("myListBean");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testListBeanType);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- final ISymbol[] properties = propResolver.getAllProperties(symbol);
-
- // should have no properties since a list won't be treated like
- // anything but a list
- assertEquals(0, properties.length);
-
- // but being that it's an unbounded List, it may have any number
- // of arbitrary "unconstrained" properties a different indices
- for (int i = 0; i < 25; i++)
- {
- final ISymbol someProperty1 = propResolver.getProperty(symbol, i);
- assertNotNull(someProperty1);
- assertTrue(someProperty1 instanceof IPropertySymbol);
- // completely unconstrained properties should come back as java
- // object
- assertEquals(TypeConstants.TYPE_JAVAOBJECT,
- ((IPropertySymbol) someProperty1).getTypeDescriptor()
- .getTypeSignature());
- }
- }
-
- /**
- * Test a property on a bean that is a list
- */
- public void testBeanWithListProperty()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("beanWithListProp");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testBeanWithListPropType);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- ISymbol[] properties = propResolver.getAllProperties(symbol);
-
- // should be just one property plus Object.class
- assertEquals(2, properties.length);
- assertNotNull(findSymbol("listProp", properties));
- assertEquals(findSymbol("listProp", properties).getName(), propResolver
- .getProperty(symbol, "listProp").getName());
-
- final IPropertySymbol listProp =
- (IPropertySymbol) propResolver.getProperty(symbol, "listProp");
- assertEquals("Lcom.test.ListBean;", listProp.getTypeDescriptor()
- .getTypeSignature());
-
- properties = propResolver.getAllProperties(listProp);
-
- // has isEmpty and one bean props
- assertEquals(0, properties.length);
-
- final IPropertySymbol unboundedProp =
- (IPropertySymbol) propResolver.getProperty(listProp, 0);
- assertEquals(TypeConstants.TYPE_JAVAOBJECT, unboundedProp
- .getTypeDescriptor().getTypeSignature());
-
- // list base symbols do not have non-numeric keys
- assertNull(propResolver.getProperty(listProp, "anyKey"));
- }
-
- public void testGenericListProperty()
- {
- final IBeanInstanceSymbol symbol =
- SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
- symbol.setName("beanWithListProp");
- final IJavaTypeDescriptor2 typeDesc =
- SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
- typeDesc.setType(_testBeanWithGenericProperties);
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- ISymbol[] properties = propResolver.getAllProperties(symbol);
-
- // should be just one property plus Object.class
- assertEquals(3, properties.length);
- assertNotNull(findSymbol("listOfStrings", properties));
- assertEquals(findSymbol("listOfStrings", properties).getName(),
- propResolver.getProperty(symbol, "listOfStrings").getName());
-
- final IPropertySymbol listProp =
- (IPropertySymbol) propResolver.getProperty(symbol,
- "listOfStrings");
- assertEquals(TypeConstants.TYPE_LIST, listProp.getTypeDescriptor()
- .getTypeSignature());
-
- properties = propResolver.getAllProperties(listProp);
-
- // has isEmpty and one bean props
- assertEquals(0, properties.length);
-
- final IPropertySymbol unboundedProp =
- (IPropertySymbol) propResolver.getProperty(listProp, 0);
- assertEquals(TypeConstants.TYPE_STRING, unboundedProp
- .getTypeDescriptor().getTypeSignature());
- }
-
- public void testBoundedTypeDescriptor()
- {
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("componentSymbol");
- final IBoundedMapTypeDescriptor typeDesc =
- SymbolFactory.eINSTANCE.createIBoundedMapTypeDescriptor();
- typeDesc.setMapSource(new HashMap<String, String>());
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- final ISymbol propSymbol = propResolver.getProperty(symbol, "anyProp");
-
- assertNotNull(propSymbol);
- assertTrue(propSymbol instanceof IPropertySymbol);
- assertEquals(TypeConstants.TYPE_JAVAOBJECT,
- ((IPropertySymbol) propSymbol).getTypeDescriptor()
- .getTypeSignature());
- }
-
- public void testDottedPropertyNames() throws Exception
- {
- checkDottedBundleNames();
- // TODO: should add coverage for dotted, non-bundles...
- }
-
- private void checkDottedBundleNames() throws Exception
- {
- final Map<?, ?> map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _jdtTestEnvironment.getProjectEnvironment()
- .getTestProject(), "bundles.bundle1");
- assertNotNull(map);
- assertEquals(3, map.size());
-
- final IMapTypeDescriptor typeDesc =
- SymbolFactory.eINSTANCE.createIMapTypeDescriptor();
- typeDesc.setMapSource(map);
- final IComponentSymbol symbol =
- SymbolFactory.eINSTANCE.createIComponentSymbol();
- symbol.setName("dottedMapSource");
- symbol.setTypeDescriptor(typeDesc);
-
- final DefaultDTPropertyResolver propResolver =
- new DefaultDTPropertyResolver();
- {
- ISymbol oneDot = propResolver.getProperty(symbol, "one");
- assertNotNull(oneDot);
- assertTrue(oneDot instanceof IPropertySymbol);
- assertTrue(((IPropertySymbol) oneDot).isIntermediate());
-
- oneDot = propResolver.getProperty(symbol, "one.dot");
- assertNotNull(oneDot);
- assertTrue(oneDot instanceof IPropertySymbol);
- assertFalse(((IPropertySymbol) oneDot).isIntermediate());
- }
-
- {
- ISymbol twoDots = propResolver.getProperty(symbol, "two");
- assertNotNull(twoDots);
- assertTrue(twoDots instanceof IPropertySymbol);
- assertTrue(((IPropertySymbol) twoDots).isIntermediate());
-
- twoDots = propResolver.getProperty(symbol, "two.dot");
- assertNotNull(twoDots);
- assertTrue(twoDots instanceof IPropertySymbol);
- assertTrue(((IPropertySymbol) twoDots).isIntermediate());
-
- twoDots = propResolver.getProperty(symbol, "two.dot.property");
- assertNotNull(twoDots);
- assertTrue(twoDots instanceof IPropertySymbol);
- assertFalse(((IPropertySymbol) twoDots).isIntermediate());
-
- }
- }
-
- private ISymbol findSymbol(final String name, final ISymbol[] symbols)
- {
- for (final ISymbol symbol : symbols)
- {
- if (symbol.getName().equals(name))
- {
- return symbol;
- }
- }
-
- return null;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDesignTimeApplicationManager.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDesignTimeApplicationManager.java
deleted file mode 100644
index 370676b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDesignTimeApplicationManager.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.ui.refactoring.RenameSupport;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.context.DTJSPExternalContext;
-import org.eclipse.jst.jsf.designtime.context.IDTExternalContext;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.internal.view.DefaultDTViewHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-public class TestDesignTimeApplicationManager extends TestCase {
- private IFile _testJSP;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private WebProjectTestEnvironment _webProjectTestEnv;
- private JDTTestEnvironment _jdtTestEnv;
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- _webProjectTestEnv= new WebProjectTestEnvironment(
- "TestDesignTimeApplicationManager" + getName());
- _webProjectTestEnv.createProject(false);
-
- _jdtTestEnv = new JDTTestEnvironment(_webProjectTestEnv);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- _jdtTestEnv.addResourceFile("src", new ByteArrayInputStream(
- input.toBytes()), "bundles", "bundle1.properties");
-
- final IResource res = _webProjectTestEnv.loadResourceInWebRoot(
- DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(
- _webProjectTestEnv);
- _jsfFactedTestEnvironment
- .initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetFacesContext()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
-
- final DTFacesContext facesContext = manager.getFacesContext(_testJSP);
- assertNotNull(facesContext);
-
- // exercise the default locator
- final IDTExternalContext externalContext =
- facesContext.getDTExternalContext(_testJSP);
- assertNotNull(externalContext);
- assertEquals(_testJSP, facesContext.adaptContextObject());
- }
-
- public void testBug147729() throws Exception
- {
- // if the project is renamed, it is actually moved. This causes
- // the IProject to have it's persistent props seemlessly copied,
- // but the DesignTimeApplicationManager was not being correctly
- // updated
- DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_webProjectTestEnv.getTestProject());
- assertNotNull(manager.getPropertyResolver());
-
- manager.setPropertyResolverProvider("my.test.blah");
- assertEquals("my.test.blah", manager.getPropertyResolverProvider());
-
- final RenameSupport renameSupport =
- RenameSupport.create(_jdtTestEnv.getJavaProject(), "RenamedProject"+getName(), RenameSupport.UPDATE_REFERENCES);
- renameSupport.perform(new Shell(), PlatformUI.getWorkbench().getActiveWorkbenchWindow());
-
- assertFalse(_jdtTestEnv.getJavaProject().getProject().isAccessible());
- final IProject project =
- ResourcesPlugin.getWorkspace().getRoot().getProject("RenamedProject"+getName());
-
- assertTrue(project.isAccessible());
-
- manager = DesignTimeApplicationManager.getInstance(project);
- assertNotNull(manager);
- // ensure that the resolver provider persistent key gets
- // transferred after the rename
- assertEquals("my.test.blah", manager.getPropertyResolverProvider());
- }
-
- public void testGetVariableResolver()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- final AbstractDTVariableResolver variableResolver =
- manager.getVariableResolver();
- assertNotNull(variableResolver);
- }
-
- public void testGetPropertyResolver()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- final AbstractDTPropertyResolver propertyResolver = manager
- .getPropertyResolver();
- assertNotNull(propertyResolver);
- }
-
- public void testGetMethodResolver()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- final AbstractDTMethodResolver methodResolver = manager
- .getMethodResolver();
- assertNotNull(methodResolver);
- }
-
- public void testFileWithNoDT()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- final IFile file1 = _testJSP.getProject().getFile(new Path("fakefile1"));
- // file object exists but underlying IResource is not
- assertNotNull(file1);
- assertFalse(file1.isAccessible());
-
- // therefore, there will be no dt for this file
- assertFalse(manager.hasDTFacesContext(file1));
- assertNull(manager.getFacesContext(file1));
- }
-
- public void testGetDefaultPropertyResolver()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- final AbstractDTPropertyResolver defaultPropertyResolver =
- manager.getDefaultPropertyResolver();
- assertNotNull(defaultPropertyResolver);
- assertTrue(defaultPropertyResolver instanceof DefaultDTPropertyResolver);
- }
-
- public void testGetExternalContextProvider()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // default value
- assertEquals("org.eclipse.jst.jsf.core.externalcontext.default"
- , manager.getExternalContextProvider());
- }
-
- public void testGetMethodResolverProvider()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // default value
- assertEquals("org.eclipse.jst.jsf.core.methodresolver.default",
- manager.getMethodResolverProvider());
- }
-
- public void testGetVariableResolverProvider()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // default value
- assertEquals("org.eclipse.jst.jsf.core.variableresolver.default.decorative",
- manager.getVariableResolverProvider());
- }
-
- public void testSetVariableResolverProvider() throws Exception
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // get the default variable resolver
- final AbstractDTVariableResolver variableResolver = manager.getVariableResolver();
-
- manager.setVariableResolverProvider("foo.bar.variableResolver");
- // default value
- assertEquals("foo.bar.variableResolver"
- , manager.getVariableResolverProvider());
-
- // this should return the same var resolver, since the id is false
- // and an alternative won't be found
- assertEquals(variableResolver, manager.getVariableResolver());
- }
-
- public void testSetPropertyResolverProvider() throws Exception
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // get the default property resolver
- final AbstractDTPropertyResolver propertyResolver = manager.getPropertyResolver();
-
- manager.setPropertyResolverProvider("foo.bar.propertyResolver");
- // default value
- assertEquals("foo.bar.propertyResolver"
- , manager.getPropertyResolverProvider());
-
- // this should return the same property resolver, since the id is false
- // and an alternative won't be found
- assertEquals(propertyResolver, manager.getPropertyResolver());
- }
-
- public void testSetMethodResolverProvider() throws Exception
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // get the default method resolver
- final AbstractDTMethodResolver methodResolver = manager.getMethodResolver();
-
- manager.setMethodResolverProvider("foo.bar.methodResolver");
- // default value
- assertEquals("foo.bar.methodResolver"
- , manager.getMethodResolverProvider());
-
- // this should return the same method resolver, since the id is false
- // and an alternative won't be found
- assertEquals(methodResolver, manager.getMethodResolver());
- }
-
- public void testSetExternalContextProvider() throws Exception
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // get the default external context
- final DTFacesContext facesContext = manager.getFacesContext(_testJSP);
- final IDTExternalContext externalContext =
- facesContext.getDTExternalContext(_testJSP);
- assertTrue(externalContext instanceof DTJSPExternalContext);
-
- manager.setExternalContextProvider("foo.bar.externalContextLocator");
- // default value
- assertEquals("foo.bar.externalContextLocator"
- , manager.getExternalContextProvider());
-
- // this should return the same external context, since the id is false
- // and an alternative won't be found
- assertTrue(facesContext.getDTExternalContext(_testJSP) instanceof DTJSPExternalContext);
- }
-
- public void testGetPropertyResolverProvider()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- // default value
- assertEquals(
- "org.eclipse.jst.jsf.core.propertyresolver.default.decorative",
- manager.getPropertyResolverProvider());
- }
-
- public void testGetViewHandler()
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- IDTViewHandler viewHandler = manager.getViewHandler();
- assertNotNull(viewHandler);
- assertTrue(viewHandler instanceof DefaultDTViewHandler);
-
- }
-
- public void testSetViewHandler() throws Exception
- {
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(_testJSP.getProject());
- assertNotNull(manager);
-
- final IFile settingsFile = getSettingsFile(_testJSP.getProject());
- assertFalse(settingsFile.isAccessible());
-
- manager.setViewHandlerId("foobar.chicken.on.a.bun");
- assertTrue(settingsFile.isAccessible());
-
- Properties props = new Properties();
- props.load(settingsFile.getContents());
- assertEquals("foobar.chicken.on.a.bun", props.getProperty("ViewHandler"));
- }
-
- public void testSetAndReloadSettings() throws Exception
- {
- final IProject project = _testJSP.getProject();
- final DesignTimeApplicationManager manager = DesignTimeApplicationManager
- .getInstance(project);
- assertNotNull(manager);
-
- final IFile settingsFile = getSettingsFile(project);
- assertFalse(settingsFile.isAccessible());
-
- manager.setViewHandlerId("foobar.chicken.on.a.bun");
- assertTrue(settingsFile.isAccessible());
-
- Properties props = new Properties();
- props.load(settingsFile.getContents());
- assertEquals("foobar.chicken.on.a.bun", props.getProperty("ViewHandler"));
-
- // now, close and reopen the project
- project.close(null);
- assertFalse(project.isOpen());
- project.open(null);
- assertTrue(project.isOpen());
-
- final DesignTimeApplicationManager newManager = DesignTimeApplicationManager
- .getInstance(project);
- assertNotNull(newManager.getViewHandler());
- }
-
- private static IFile getSettingsFile(final IProject project)
- {
- return project.getFolder(new Path(".settings")).getFile("org.eclipse.jst.jsf.designtime.appmgr.prefs");
- }
-
- // public void testSetExternalContextProvider()
- // {
- // final DesignTimeApplicationManager manager =
- // DesignTimeApplicationManager.getInstance(_testJSP.getProject());
- //
- // manager.setExternalContextProvider(resolverPluginId);
- // }
- //
- // public void testGetExternalContextProvider() {
- // //fail("Not yet implemented");
- // }
- //
- // public void testSetVariableResolverProvider() {
- // //fail("Not yet implemented");
- // }
- // public void testSetPropertyResolverProvider() {
- // //fail("Not yet implemented");
- // }
- //
- // public void testSetMethodResolverProvider() {
- // //fail("Not yet implemented");
- // }
- //
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20DefaultBeanSymbolSourceProvider.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20DefaultBeanSymbolSourceProvider.java
deleted file mode 100644
index 97a95f5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20DefaultBeanSymbolSourceProvider.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.symbols.DefaultBeanSymbolSourceProvider;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * JUnit tests for org.eclipse.jst.jsf.designtime.DefaultBeanSymbolSourceProvider
- *
- * @author cbateman
- *
- */
-public class TestJSF20DefaultBeanSymbolSourceProvider extends TestCase
-{
- private JDTTestEnvironment _jdtTestEnvironment;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private IFile _facesConfigFile;
-
- private final static String SRC_FOLDER_NAME = "src";
- private final static String PACKAGE_NAME = "com.test";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJSF20DefaultBeanSymbolSourceProvider_"+getName(), JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.5"));
- projectTestEnvironment.createProject(false);
- _facesConfigFile = (IFile) projectTestEnvironment.
- loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_2_0.xml.data",
- "/WEB-INF/faces-config.xml");
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_2_0);
-
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- JSFTestUtil.loadSourceClass(
- TestsPlugin.getDefault().getBundle(),
- "/testfiles/TestBean1.java.data", "TestBean1", SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /**
- * Test the external sanity of the suite (i.e. that the test data is in sync)
- */
- public void testSanity()
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] symbol =
- provider.getSymbols(_facesConfigFile, ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- assertNotNull(symbol);
- assertEquals("Check that test suite is in sync with setup()", symbol.length, 5);
- }
-
- /**
- *
- */
- public void testAllScopes()
- {
- final String[] names = new String[]{"myBean_request", "myBean_session", "myBean_application", "myBean_none", "myBean_view"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_ALL, names.length, names);
- }
-
- /**
- * Check mask by request scope
- */
- public void testOnlyRequestBeans()
- {
- final String[] names = new String[]{"myBean_request"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_REQUEST, names.length, names);
- }
-
- /**
- * Check mask by Session scope
- */
- public void testOnlySessionBeans()
- {
- final String[] names = new String[]{"myBean_session"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_SESSION, names.length, names);
- }
-
- /**
- * Check mask by Application scope
- */
- public void testOnlyApplicationBeans()
- {
- final String[] names = new String[]{"myBean_application"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_APPLICATION, names.length, names);
- }
- /**
- * Check mask by None scope
- */
- public void testOnlyNoneBeans()
- {
- final String[] names = new String[]{"myBean_none"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_NONE, names.length, names);
- }
-
- /**
- * Check mask by View scope
- */
- public void testOnlyViewBeans()
- {
- final String[] names = new String[]{"myBean_view"};
- testScopeBeans(ISymbolConstants.SYMBOL_SCOPE_VIEW, names.length, names);
- }
-
- private void testScopeBeans(final int scope, final int expectedSize, final String[] expectedNames)
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] symbols =
- provider.getSymbols(_facesConfigFile, scope);
-
- assertEquals(expectedSize, symbols.length);
-
- for (int j = 0; j < expectedNames.length; j++)
- {
- final String expectedName = expectedNames[j];
- assertNotNull(expectedName);
- boolean found = false;
-
- FIND_IN_SYMBOLS:
- for (int i = 0; i < symbols.length; i++)
- {
- if (expectedName.equals(symbols[i].getName()))
- {
- found = true;
- break FIND_IN_SYMBOLS;
- }
- }
-
- assertTrue(found);
- }
- }
-
- /**
- * Test the get symbol by prefix
- */
- public void testPrefixSearch()
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol[] symbols =
- provider.getSymbols("myBean_n", _facesConfigFile, ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- assertEquals(1, symbols.length);
- assertEquals("myBean_none", symbols[0].getName());
- }
-
- /**
- * Test getting a symbol it's name
- */
- public void testGetSymbolByName()
- {
- testGetSymbolByName("myBean_none");
- testGetSymbolByName("myBean_application");
- testGetSymbolByName("myBean_session");
- testGetSymbolByName("myBean_request");
- testGetSymbolByName("myBean_view");
- }
-
- private void testGetSymbolByName(final String expectedName)
- {
- final DefaultBeanSymbolSourceProvider provider =
- DefaultBeanSymbolSourceProvider.getInstance();
-
- final ISymbol symbol =
- provider.getSymbol(expectedName, _facesConfigFile,
- ISymbolConstants.SYMBOL_SCOPE_ALL);
-
- assertNotNull(symbol);
- assertEquals(expectedName, symbol.getName());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20ImplicitVariables.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20ImplicitVariables.java
deleted file mode 100644
index 40af98c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSF20ImplicitVariables.java
+++ /dev/null
@@ -1,259 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests;
-
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.context.symbol.ERuntimeSource;
-import org.eclipse.jst.jsf.context.symbol.IBoundedMapTypeDescriptor;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.ITypeDescriptor;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTPropertyResolver;
-import org.eclipse.jst.jsf.designtime.el.DefaultDTVariableResolver;
-import org.eclipse.jst.jsf.designtime.symbols.DefaultBuiltInSymbolProvider;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanScopeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.junit.Before;
-
-/**
- * Tests the implicit JSF2.0 variables excercising {@link DefaultBuiltInSymbolProvider}, {@link DefaultDTVariableResolver}, and {@link DefaultDTPropertyResolver}
- *
- */
-public class TestJSF20ImplicitVariables extends TestCase
-{
- private IType _testBean1Type;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private JDTTestEnvironment _jdtTestEnvironment;
- private IFile _testJSP1;
-
- private final static String SRC_FOLDER_NAME = "src";
- private final static String PACKAGE_NAME = "com.test";
- private final static String TESTBEAN1_NAME = "TestBean1";
- private static final String ATTRS_SYMBOL_NAME = "attrs";
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJSF20ImplicitVariables_"+getName(), JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.5"));
- projectTestEnvironment.createProject(true);
-
- final IResource res = projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP1 = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_2_0);
-
- final IProject project = projectTestEnvironment.getTestProject();
-
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForWrite(project, null);
-
- final FacesConfigType model = edit.getFacesConfig();
- final ManagedBeanClassType beanClass = FacesConfigFactory.eINSTANCE.createManagedBeanClassType();
- beanClass.setTextContent("com.test.TestBean1");
-
- final ManagedBeanNameType beanName = FacesConfigFactory.eINSTANCE.createManagedBeanNameType();
- beanName.setTextContent("testBean1");
-
- final ManagedBeanScopeType beanScope = FacesConfigFactory.eINSTANCE.createManagedBeanScopeType();
- beanScope.setTextContent("session");
-
- final ManagedBeanType bean = FacesConfigFactory.eINSTANCE.createManagedBeanType();
- bean.setManagedBeanClass(beanClass);
- bean.setManagedBeanName(beanName);
- bean.setManagedBeanScope(beanScope);
-
- model.getManagedBean().add(bean);
-
- edit.save(null);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
- _jdtTestEnvironment = new JDTTestEnvironment(projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- _jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "bundles", "bundle1.properties");
-
- JSFTestUtil.loadSourceClass(
- DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/TestBean1.java.data", TESTBEAN1_NAME, SRC_FOLDER_NAME, PACKAGE_NAME, _jdtTestEnvironment);
- _testBean1Type = _jdtTestEnvironment.getJavaProject().findType(PACKAGE_NAME+"."+TESTBEAN1_NAME);
- assertNotNull(_testBean1Type);
- JSFCoreUtilHelper.injectTestTagRegistryFactoryProvider(JSFCoreUtilHelper.createSimpleRegistryFactory());
-
- }
-
- public void testCCSymbol() {
- DefaultDTVariableResolver resolver = new DefaultDTVariableResolver();
- DTFacesContext context = DesignTimeApplicationManager.getInstance(_jdtTestEnvironment.getJavaProject().getProject()).getFacesContext(_testJSP1);
- ISymbol symbol = resolver.resolveVariable(context, "cc", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IInstanceSymbol);
- assertEquals(ERuntimeSource.BUILT_IN_SYMBOL_LITERAL, ((IInstanceSymbol)symbol).getRuntimeSource());
-
- DefaultDTPropertyResolver propresolver = new DefaultDTPropertyResolver();
- ISymbol[] props = propresolver.getAllProperties(symbol);
- assertContainsVariable(props, ATTRS_SYMBOL_NAME);
-// assertContainsVariable(props, "attributes"); //need real jars on cp
-
- //tests "attrs"
- ISymbol propSymbol = propresolver.getProperty(symbol, ATTRS_SYMBOL_NAME);
- assertNotNull(propSymbol);
- assertTrue(propSymbol instanceof IInstanceSymbol);
- ITypeDescriptor typeDesc = ((IInstanceSymbol)propSymbol).getTypeDescriptor();
- assertTrue(typeDesc instanceof IBoundedMapTypeDescriptor);
-
-// assertNull(propresolver.getProperty(symbol, "unknown"));
- }
-
- public void testComponentSymbol() {
- DefaultDTVariableResolver resolver = new DefaultDTVariableResolver();
- DTFacesContext context = DesignTimeApplicationManager.getInstance(_jdtTestEnvironment.getJavaProject().getProject()).getFacesContext(_testJSP1);
- ISymbol symbol = resolver.resolveVariable(context, "component", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IInstanceSymbol);
- assertEquals(ERuntimeSource.BUILT_IN_SYMBOL_LITERAL, ((IInstanceSymbol)symbol).getRuntimeSource());
-
- DefaultDTPropertyResolver propresolver = new DefaultDTPropertyResolver();
- ISymbol[] props = propresolver.getAllProperties(symbol);
- assertContainsVariable(props, ATTRS_SYMBOL_NAME);
-// assertContainsVariable(props, "attributes"); //need real jars on cp
-
- //tests "attrs" for component
- ISymbol propSymbol = propresolver.getProperty(symbol, ATTRS_SYMBOL_NAME);
- assertNotNull(propSymbol);
- assertTrue(propSymbol instanceof IInstanceSymbol);
- ITypeDescriptor typeDesc = ((IInstanceSymbol)propSymbol).getTypeDescriptor();
- assertTrue(typeDesc instanceof IBoundedMapTypeDescriptor);
-
-// assertNull(propresolver.getProperty(symbol, "unknown"));
-
- }
-
- public void testResourceSymbol() {
- DefaultDTVariableResolver resolver = new DefaultDTVariableResolver();
- DTFacesContext context = DesignTimeApplicationManager.getInstance(_jdtTestEnvironment.getJavaProject().getProject()).getFacesContext(_testJSP1);
- ISymbol symbol = resolver.resolveVariable(context, "resource", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IInstanceSymbol);
- assertEquals(ERuntimeSource.BUILT_IN_SYMBOL_LITERAL, ((IInstanceSymbol)symbol).getRuntimeSource());
- ITypeDescriptor typeDesc = ((IInstanceSymbol)symbol).getTypeDescriptor();
- assertTrue(typeDesc instanceof IBoundedMapTypeDescriptor);
- }
-
- public void testViewScopeSymbol() {
- DefaultDTVariableResolver resolver = new DefaultDTVariableResolver();
- DTFacesContext context = DesignTimeApplicationManager.getInstance(_jdtTestEnvironment.getJavaProject().getProject()).getFacesContext(_testJSP1);
- ISymbol symbol = resolver.resolveVariable(context, "viewScope", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IInstanceSymbol);
- assertEquals(ERuntimeSource.BUILT_IN_SYMBOL_LITERAL, ((IInstanceSymbol)symbol).getRuntimeSource());
- ITypeDescriptor typeDesc = ((IInstanceSymbol)symbol).getTypeDescriptor();
- assertTrue(typeDesc instanceof IBoundedMapTypeDescriptor);
-
- }
-
- public void testFlashScopeSymbol() {
- DefaultDTVariableResolver resolver = new DefaultDTVariableResolver();
- DTFacesContext context = DesignTimeApplicationManager.getInstance(_jdtTestEnvironment.getJavaProject().getProject()).getFacesContext(_testJSP1);
- ISymbol symbol = resolver.resolveVariable(context, "flash", _testJSP1);
- assertNotNull(symbol);
- assertTrue(symbol instanceof IInstanceSymbol);
- assertEquals(ERuntimeSource.BUILT_IN_SYMBOL_LITERAL, ((IInstanceSymbol)symbol).getRuntimeSource());
- ITypeDescriptor typeDesc = ((IInstanceSymbol)symbol).getTypeDescriptor();
- assertTrue(typeDesc instanceof IBoundedMapTypeDescriptor);
- }
-
- public void testGetAllVariables()
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance
- (_jdtTestEnvironment.getProjectEnvironment().getTestProject());
-
- final DefaultDTVariableResolver variableResolver = new DefaultDTVariableResolver();
-
- final ISymbol[] variables = variableResolver.getAllVariables
- (manager.getFacesContext(_testJSP1), _testJSP1);
-
- assertEquals(19, variables.length);
-
- //jsf1.x - implicits
- assertContainsVariable(variables, "applicationScope");
- assertContainsVariable(variables, "sessionScope");
- assertContainsVariable(variables, "requestScope");
- assertContainsVariable(variables, "cookie");
- assertContainsVariable(variables, "facesContext");
- assertContainsVariable(variables, "header");
- assertContainsVariable(variables, "headerValues");
- assertContainsVariable(variables, "initParam");
- assertContainsVariable(variables, "param");
- assertContainsVariable(variables, "paramValues");
- assertContainsVariable(variables, "view");
-
- //jsf2.0 - implicits
- assertContainsVariable(variables, "viewScope");
- assertContainsVariable(variables, "flash");
- assertContainsVariable(variables, "cc");
- assertContainsVariable(variables, "component");
- assertContainsVariable(variables, "resource");
-
- //external
- assertContainsVariable(variables, "testBean1");
- assertContainsVariable(variables, "bundle");
- assertContainsVariable(variables, "row");
-
- }
-
- private void assertContainsVariable(final ISymbol[] variables, final String name)
- {
- for (final ISymbol variable : variables)
- {
- if (name.equals(variable.getName()))
- {
- assertTrue(variable instanceof IInstanceSymbol);
- return;
- }
- }
-
- fail("Expected variable not found: "+name);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPDefaultSymbolFactory.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPDefaultSymbolFactory.java
deleted file mode 100644
index d4ba8d0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPDefaultSymbolFactory.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.internal.jsp.JSPDefaultSymbolFactory;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-public class TestJSPDefaultSymbolFactory extends TestCase
-{
- private IFile _testJSP;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private IStructuredModel _structuredModel;
- private IStructuredDocument _structuredDocument;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJSPDefaultSymbolFactory_"+getName());
- projectTestEnvironment.createProject(false);
-
- final JDTTestEnvironment jdtTestEnvironment =
- new JDTTestEnvironment(projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "bundles", "bundle1.properties");
-
- final IResource res =
- projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
-
- _structuredModel = StructuredModelManager.getModelManager().getModelForRead(_testJSP);
- _structuredDocument = _structuredModel.getStructuredDocument();
-
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- _structuredModel.releaseFromRead();
- }
-
- public void testSupports()
- {
- final JSPDefaultSymbolFactory factory = new JSPDefaultSymbolFactory();
-
- // must be a structured document context
- assertFalse(factory.supports(_testJSP));
-
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_structuredDocument, 0);
-
- // must work for a JSP document context
- assertTrue(factory.supports(context));
- }
-
- public void testCreate()
- {
- final JSPDefaultSymbolFactory factory = new JSPDefaultSymbolFactory();
-
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE
- .getContext(_structuredDocument, 0);
-
- ISymbol var =
- factory.create("notAVariable"
- , ISymbolConstants.SYMBOL_SCOPE_REQUEST, context, new ArrayList<Object>(), null);
- assertNull(var);
-
- var = factory.create("bundle"
- , ISymbolConstants.SYMBOL_SCOPE_REQUEST
- , IStructuredDocumentContextFactory.INSTANCE.getContext(_structuredDocument, 552)
- , new ArrayList<Object>(), null);
-
- // load bundle introduces a variable
- assertNotNull(var);
- assertTrue(var instanceof IInstanceSymbol);
- assertEquals("bundle", var.getName());
-
- var = factory.create("row"
- , ISymbolConstants.SYMBOL_SCOPE_REQUEST
- , IStructuredDocumentContextFactory.INSTANCE.getContext(_structuredDocument, 1361)
- , new ArrayList<Object>(), null);
-
- // data table introduces a variable
- assertNotNull(var);
- assertTrue(var instanceof IInstanceSymbol);
- assertEquals("row", var.getName());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPModelProcessor.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPModelProcessor.java
deleted file mode 100644
index a92493e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPModelProcessor.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.TreeSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.internal.jsp.JSPModelProcessor;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-public class TestJSPModelProcessor extends TestCase
-{
- private static final int NUM_JSPS = 25;
- private static final int WAIT_ITERATIONS = 50;
- private static final int WAIT_SLEEP_TIME_MS = 100;
-
- private IFile _testJSP1;
- private List<IFile> _jsps;
-
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- final WebProjectTestEnvironment projectTestEnvironment =
- new WebProjectTestEnvironment("TestJSPModelProcessor_"+getName());
- projectTestEnvironment.createProject(false);
-
- final JDTTestEnvironment jdtTestEnvironment =
- new JDTTestEnvironment(projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "bundles", "bundle1.properties");
-
- _testJSP1 = (IFile) projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
-
- _jsps = new ArrayList<IFile>(NUM_JSPS);
- for (int i = 0; i < NUM_JSPS; i++)
- {
- _jsps.add((IFile) projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata_"+i+".jsp"));
- }
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
- @Override
- protected void tearDown() throws Exception {
- }
-
- public void testGet() throws Exception
- {
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertNotNull(processor);
- assertFalse(processor.isDisposed());
- }
-
- public void testGetMapForScope() throws Exception
- {
- // if we not refreshed yet, then should be no symbols
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertNotNull(processor);
-
- Map<Object, ISymbol> scopeMap =
- processor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_REQUEST_STRING);
- assertTrue(scopeMap.isEmpty());
-
- scopeMap =
- processor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_SESSION_STRING);
- assertTrue(scopeMap.isEmpty());
-
- scopeMap =
- processor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_APPLICATION_STRING);
- assertTrue(scopeMap.isEmpty());
-
- scopeMap =
- processor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_NONE_STRING);
- assertTrue(scopeMap.isEmpty());
- }
-
- public void testRefreshAndGet() throws Exception
- {
- final IModelManager modelManager = StructuredModelManager.getModelManager();
-
- IStructuredModel model = null;
-
- try
- {
- model = modelManager.getModelForRead(_testJSP1);
-
- // we should be the only one with a handle
- System.out.println(model.getReferenceCountForRead());
- assertFalse(model.isSharedForRead());
-
- // if we not refreshed yet, then should be no symbols
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertNotNull(processor);
- System.out.println(model.getReferenceCountForRead());
- // we should be the only one with a handle
- assertFalse(model.isSharedForRead());
-
- Map<Object, ISymbol> scopeMap =
- processor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_REQUEST_STRING);
- assertTrue(scopeMap.isEmpty());
- System.out.println(model.getReferenceCountForRead());
- // we should be the only one with a handle
- assertFalse(model.isSharedForRead());
-
- processor.refresh(!JSPModelProcessor.FORCE_REFRESH, JSPModelProcessor.RUN_ON_CURRENT_THREAD);
- System.out.println(model.getReferenceCountForRead());
- // we should be the only one with a handle
- assertFalse(model.isSharedForRead());
-
- // after refresh we should have a symbol for the loadBundle and the dataTable
- scopeMap =
- processor.getMapForScope(ISymbolConstants.SYMBOL_SCOPE_REQUEST_STRING);
- assertFalse(scopeMap.isEmpty());
- assertEquals(2, scopeMap.size());
-
- // we should be the only one with a handle
- System.out.println(model.getReferenceCountForRead());
- assertFalse(model.isSharedForRead());
- }
- finally
- {
- if (model != null)
- {
- model.releaseFromRead();
- }
- }
- }
-
- public void testFileDeletion_RegressionBug199480() throws Exception
- {
- // Regression for bug 199480
- // ensure that the deletion of a resource with a JSPModelProcessor
- // on it without an editor close event is still disposed of due
- // to the resource change event.
- // if we not refreshed yet, then should be no symbols
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertNotNull(processor);
- assertFalse(processor.isDisposed());
-
- JSFTestUtil.safeDelete(_testJSP1, 10, 1000);
-
- // file is deleted, so the processor should dispose itself on the
- // resource change event
- waitForAndAssertProcessorDisposed(processor, true);
- }
-
- public void testProjectClosure() throws Exception
- {
- final IModelManager modelManager = StructuredModelManager.getModelManager();
-
- IStructuredModel model = null;
-
- try
- {
- model = modelManager.getModelForRead(_testJSP1);
-
- // we should be the only one with a handle
-// assertFalse(model.isSharedForRead());
-
- // ensure that if the enclosing project of the associated IFile
- // is closed, then the processor gets disposed
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertFalse(model.isSharedForRead());
- assertNotNull(processor);
- // we should still be the only one with a handle since JSPModelProcessor
- // doesn't hold it.
- assertFalse(processor.isDisposed());
- processor.refresh(!JSPModelProcessor.FORCE_REFRESH, JSPModelProcessor.RUN_ON_CURRENT_THREAD);
- assertFalse(model.isSharedForRead());
-
- _testJSP1.getProject().close(null);
-
- // file is deleted, so the processor should dispose itself on the
- // resource change event
- waitForAndAssertProcessorDisposed(processor, true);
- // final check, with processor disposed, still not shared
- assertFalse(model.isSharedForRead());
- }
- finally
- {
- if (model != null)
- {
- model.releaseFromRead();
- }
- }
- }
-
- public void testProjectDeletion() throws Exception
- {
- final IModelManager modelManager = StructuredModelManager.getModelManager();
-
- IStructuredModel model = null;
-
- try
- {
- model = modelManager.getModelForRead(_testJSP1);
-
- // we should be the only one with a handle
- //assertFalse(model.isSharedForRead());
-
- // ensure that if the enclosing project of the associated IFile
- // is deleted, then the processor gets disposed
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertNotNull(processor);
- assertFalse(processor.isDisposed());
-// assertFalse(model.isSharedForRead());
- // we should still be the only one with a handle since JSPModelProcessor
- // doesn't hold it.
- processor.refresh(!JSPModelProcessor.FORCE_REFRESH, JSPModelProcessor.RUN_ON_CURRENT_THREAD);
- assertFalse(model.isSharedForRead());
-
- JSFTestUtil.safeDelete(_testJSP1, 10, 1000);
-
- // file is deleted, so the processor should dispose itself on the
- // resource change event
- waitForAndAssertProcessorDisposed(processor, true);
- assertFalse(model.isSharedForRead());
- }
- finally
- {
- if (model != null)
- {
- model.releaseFromRead();
- }
- }
- }
-
- public void testChangeRefresh() throws Exception
- {
- // random order of access to the jsps, but always the same between runs
- final int order[] = new int[] {6,19,10,16,14,4,13,11,24,2,3,23,20,15,17,9,1,5,22,12,21,8,18,0,7};
- assertEquals(NUM_JSPS, order.length);
-
- for (final int element : order)
- {
- final IFile file = _jsps.get(element);
-
- final JSPModelProcessor processor = JSPModelProcessor.get(file);
- // the processor model should start out dirty since it won't
- // get refreshed unless the resource detects a change or if
- // it is explicitly refreshed
- assertTrue(processor.isModelDirty());
-
- // this should trigger a change event and update the model
- file.touch(null);
-
- Thread.sleep(2000);
- waitForAndAssertProcessorDirty(processor, false);
-
- // now delete the file and ensure the processor is disposed
- JSFTestUtil.safeDelete(file, 10, 1000);
-
- // file is deleted, so the processor should dispose itself on the
- // resource change event
- waitForAndAssertProcessorDisposed(processor, true);
- }
- }
-
- public void testFileDoesnotExist()
- {
- IFile file = _testJSP1.getProject().getFile("/doesNotExist.jsp");
- assertFalse(file.isAccessible());
- boolean caughtException = false;
- try
- {
- JSPModelProcessor.get(file);
- }
- catch (CoreException e)
- {
- caughtException = true;
- }
- assertTrue(caughtException);
- }
-
- public void testExplicitRefresh() throws Exception
- {
- // random order of access to the jsps, but always the same between runs
- final int order[] = new int[] {6,19,10,16,14,4,13,11,24,2,3,23,20,15,17,9,1,5,22,12,21,8,18,0,7};
- assertEquals(NUM_JSPS, order.length);
-
- for (final int element : order)
- {
- final IFile file = _jsps.get(element);
-
- final JSPModelProcessor processor = JSPModelProcessor.get(file);
- // the processor model should start out dirty since it won't
- // get refreshed unless the resource detects a change or if
- // it is explicitly refreshed
- // we should be the only one with a handle
- waitForAndAssertProcessorDirty(processor, true);
-
- // since the model is dirty this should trigger a refresh
- processor.refresh(!JSPModelProcessor.FORCE_REFRESH, JSPModelProcessor.RUN_ON_CURRENT_THREAD);
-
- waitForAndAssertProcessorDirty(processor, false);
-
- // now delete the file and ensure the processor is disposed
- JSFTestUtil.safeDelete(file, 10, 1000);
-
- waitForAndAssertProcessorDisposed(processor, true);
- }
- }
-
- private void waitForAndAssertProcessorDirty(
- final JSPModelProcessor processor, final boolean expectedValue)
- throws Exception
- {
- int i = 0;
-
- while (i++ < WAIT_ITERATIONS
- && (processor.isModelDirty() != expectedValue))
- {
- Thread.sleep(WAIT_SLEEP_TIME_MS);
- }
- assertEquals(expectedValue, processor.isModelDirty());
- }
-
- private void waitForAndAssertProcessorDisposed(
- final JSPModelProcessor processor, final boolean expectedValue)
- throws Exception
- {
- int i = 0;
-
- while (i++ < WAIT_ITERATIONS
- && (processor.isDisposed() != expectedValue))
- {
- Thread.sleep(WAIT_SLEEP_TIME_MS);
- }
- // file is deleted, so the processor should dispose itself on the
- // resource change event
- assertEquals(expectedValue, processor.isDisposed());
- }
-
- public static void main(final String[] args)
- {
- final Set<Integer> set = new TreeSet<Integer>();
-
- final Random random = new Random();
-
- while(set.size() < NUM_JSPS)
- {
- final Integer value = Integer.valueOf(Math.abs(random.nextInt()) % NUM_JSPS);
-
- if (!set.contains(value))
- {
- System.out.printf("%d,", value);
- set.add(value);
- }
- }
- }
-}
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleMapSource.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleMapSource.java
deleted file mode 100644
index c1cea72..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleMapSource.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.designtime.internal.symbols.ResourceBundleMapSourceFactory;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.ProjectTestEnvironment;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-
-/**
- * Test cases for ResourceBundleMapSource
- *
- * @author cbateman
- *
- */
-public class TestResourceBundleMapSource extends TestCase
-{
-
- private static final String BUNDLE1_PATH = "bundles";
- private static final String BUNDLE1_NAME = "bundle1.properties";
-
- // private static final String BUNDLE2_PATH = "bundles";
- // private static final String BUNDLE2_NAME = "bundle2.properties";
-
- private IProject _project1;
- private IProject _project2;
- private IProject _project3;
- private IFile _bundle1;
-
- // private IFile _bundle2;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- List<IResource> resources =
- initProject("BundleResourceTestProject1_" + getName(),
- "/testdata/bundle1.resources.data", BUNDLE1_PATH,
- BUNDLE1_NAME);
- _bundle1 = (IFile) resources.get(0);
- _project1 = (IProject) resources.get(1);
-
- resources =
- initProject("BundleResourceTestProject2_" + getName(),
- "/testdata/bundle2.resources.data", BUNDLE1_PATH,
- BUNDLE1_NAME);
- // _bundle2 = (IFile) resources.get(0);
- _project2 = (IProject) resources.get(1);
-
- resources =
- initProject("BundleResourceTestProject3_" + getName(),
- "/testdata/bundle1.resources.data", BUNDLE1_PATH,
- BUNDLE1_NAME);
- _project3 = (IProject) resources.get(1);
- }
-
- private List<IResource> initProject(final String projectName,
- final String dataFilePath, final String bundlePath,
- final String bundleName) throws Exception
- {
- final List<IResource> resources = new ArrayList<IResource>();
- final ProjectTestEnvironment testEnv =
- new ProjectTestEnvironment(projectName);
- testEnv.createProject(false);
- final JDTTestEnvironment jdtTestEnv = new JDTTestEnvironment(testEnv);
- final TestFileResource input = new TestFileResource();
- input
- .load(DesignTimeTestsPlugin.getDefault().getBundle(),
- dataFilePath);
- resources.add(jdtTestEnv.addResourceFile("src",
- new ByteArrayInputStream(input.toBytes()), bundlePath,
- bundleName));
-
- final IProject project = testEnv.getTestProject();
- assertNotNull(project);
- assertTrue(project.isAccessible());
- resources.add(project);
- return resources;
- }
-
- /**
- * Basic sanity check that properties files can be loaded and contain what's
- * expected
- */
- public void testSanity() throws Exception
- {
- Map<?, ?> map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project1, "bundles.bundle1");
- assertNotNull(map);
- assertEquals(map.size(), 3);
-
- map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project2, "bundles.bundle1");
- assertNotNull(map);
- assertEquals(map.size(), 3);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- JSFTestUtil.safeDelete(_project1, 25, 100);
- JSFTestUtil.safeDelete(_project2, 25, 100);
- JSFTestUtil.safeDelete(_project3, 25, 100);
- }
-
- /**
- * Verify the expected contents of bundle1 in project1
- */
- public void testContentsProject1Bundle1() throws Exception
- {
- final Map<?, ?> map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project1, "bundles.bundle1");
- assertTrue(map.containsKey("prop1"));
- assertEquals("blah", map.get("prop1"));
- assertTrue(map.containsKey("one.dot"));
- assertEquals("blah1", map.get("one.dot"));
- assertTrue(map.containsKey("two.dot.property"));
- assertEquals("blah3", map.get("two.dot.property"));
- }
-
- /**
- * Verify the expected contents of bundle1 in project2
- */
- public void testContentsProject2Bundle1() throws Exception
- {
- final Map<?, ?> map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project2, "bundles.bundle1");
- assertTrue(map.containsKey("x_prop1"));
- assertEquals("x_blah", map.get("x_prop1"));
- assertTrue(map.containsKey("x_one.dot"));
- assertEquals("x_blah1", map.get("x_one.dot"));
- assertTrue(map.containsKey("x_two.dot.property"));
- assertEquals("x_blah3", map.get("x_two.dot.property"));
- }
-
- /**
- * Regression test of https://bugs.eclipse.org/bugs/show_bug.cgi?id=196452.
- *
- * This verifies that if the bundle file is deleted then a reload on the
- * bundle correctly cleans up the map
- *
- * @throws CoreException
- * @throws IOException
- * @throws JavaModelException
- */
- public void testBundleDelete() throws JavaModelException, IOException,
- CoreException
- {
- // test the initial state, before outside meddling
- final Map<?, ?> map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project1, "bundles.bundle1");
- assertTrue(map.containsKey("prop1"));
- assertEquals("blah", map.get("prop1"));
- assertTrue(map.containsKey("one.dot"));
- assertEquals("blah1", map.get("one.dot"));
- assertTrue(map.containsKey("two.dot.property"));
- assertEquals("blah3", map.get("two.dot.property"));
-
- // now fiddle with the file
- final File bundleFile = _bundle1.getLocation().toFile();
- assertTrue(bundleFile.delete());
- _bundle1.refreshLocal(IResource.DEPTH_INFINITE, null);
-
- // the condition we are testing for is that the file is no
- // longer accessible but the map tolerates this by becoming empty
- assertFalse(_bundle1.isAccessible());
-
- // the map should now return empty and querying keys should
- // return null
- assertTrue(map.isEmpty());
- assertNull(map.get("prop1"));
- assertNull(map.get("one.dot"));
- assertNull(map.get("two.dot.property"));
- }
-
- /**
- * Regression test of https://bugs.eclipse.org/bugs/show_bug.cgi?id=196452.
- *
- * This verifies that if the bundle file is modified outside of Eclipse,
- * then a reload on the bundle doesn't throw an out of sync exception.
- *
- * @throws CoreException
- * @throws IOException
- * @throws JavaModelException
- */
- public void testProjectCloseCleanup() throws Exception
- {
- // test the initial state, before outside meddling
- Map<?, ?> map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project3, "bundles.bundle1");
- assertTrue(map.containsKey("prop1"));
- assertEquals("blah", map.get("prop1"));
- assertTrue(map.containsKey("one.dot"));
- assertEquals("blah1", map.get("one.dot"));
- assertTrue(map.containsKey("two.dot.property"));
- assertEquals("blah3", map.get("two.dot.property"));
-
- // now close the project
- // this will trigger a NOT_ACCESSIBLE event on the project
- _project3.close(null);
-
- // map should now be safely disposed
- assertEquals(0, map.size());
-
- boolean expectedExceptionThrown = false;
-
- try
- {
- map =
- ResourceBundleMapSourceFactory.getResourceBundleMapSource(
- _project3, "bundles.bundle1");
- }
- catch (final CoreException ce)
- {
- // this code should run since _project3 is closed
- // and therefore inaccessible
- expectedExceptionThrown = true;
- }
-
- assertTrue(expectedExceptionThrown);
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleSymbolSourceProvider.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleSymbolSourceProvider.java
deleted file mode 100644
index b4966d3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestResourceBundleSymbolSourceProvider.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.context.symbol.IInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolConstants;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
-import org.eclipse.jst.jsf.core.jsfappconfig.internal.JSFAppConfigManagerFactory;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.internal.symbols.ResourceBundleSymbolSourceProvider;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceBundleType;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class TestResourceBundleSymbolSourceProvider extends TestCase
-{
- private IFile _testJSP;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
- private WebProjectTestEnvironment _projectTestEnvironment;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- _projectTestEnvironment =
- new WebProjectTestEnvironment(
- "TestResourceBundleSymbolSourceProvider_"+getName()
- , JavaFacet.VERSION_1_5
- , ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion("2.5")
- );
- _projectTestEnvironment.createProject(false);
-
- final JDTTestEnvironment jdtTestEnvironment =
- new JDTTestEnvironment(_projectTestEnvironment);
-
- TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle()
- ,"/testdata/bundle1.resources.data");
- jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "beans", "bundle.properties");
-
- input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle()
- ,"/testdata/bundle2.resources.data");
- jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "beans", "bundle2.properties");
-
- /*IFile facesConfigFile = (IFile) */
- _projectTestEnvironment
- .loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/faces-config_1_2.xml.data",
- "/WEB-INF/faces-config.xml");
-
- final IResource res =
- _projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(_projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_2);
-
- //_structuredModel = StructuredModelManager.getModelManager().getModelForRead(_testJSP);
- //_structuredDocument = _structuredModel.getStructuredDocument();
- }
-
- public void testSanity()
- {
- final IJSFAppConfigManager appconfigMgr = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(_projectTestEnvironment.getTestProject());
- final List<ResourceBundleType> resourceBundles = appconfigMgr.getResourceBundles();
- assertEquals(2, resourceBundles.size());
- }
-
- public void testGetSymbolsIAdaptableInt()
- {
- final ResourceBundleSymbolSourceProvider sourceProvider =
- new ResourceBundleSymbolSourceProvider();
-
- final ISymbol[] symbols =
- sourceProvider.getSymbols(_testJSP, ISymbolConstants.SYMBOL_SCOPE_ALL);
- assertEquals(2, symbols.length);
-
- final List<String> testProps = new ArrayList<String>();
- testProps.add("prop1");
- // these two are dotted and so only the first segment is used in the base property
- testProps.add("one");
- testProps.add("two");
-
- assertContains(symbols, "resBundleProp1", testProps);
-
- testProps.clear();
- testProps.add("x_prop1");
- // these two are dotted and so only the first segment is used in the base property
- testProps.add("x_one");
- testProps.add("x_two");
-
- assertContains(symbols, "resBundleProp2", testProps);
- }
-
- @SuppressWarnings({ "unchecked"})
- private void assertContains(final ISymbol[] symbols, final String varName,final List<String> properties)
- {
- final List<String> copyProperties = new ArrayList<String>(properties);
- final List<String> propsNotFound = new ArrayList<String>();
-
- boolean foundSymbol = false;
-
- for (final ISymbol symbol : symbols)
- {
- if (varName.equals(symbol.getName()))
- {
- foundSymbol = true;
- assertTrue(symbol instanceof IInstanceSymbol);
- final IInstanceSymbol varSymbol = (IInstanceSymbol) symbol;
- final List<IPropertySymbol> props =
- varSymbol.getTypeDescriptor().getProperties();
-
- for (final Object element : props)
- {
- final IPropertySymbol prop = (IPropertySymbol) element;
- if (copyProperties.contains(prop.getName()))
- {
- copyProperties.remove(prop.getName());
- }
- else
- {
- propsNotFound.add(prop.getName());
- }
- }
- }
- }
-
- assertTrue("Symbol not found", foundSymbol);
- assertTrue(String.format("%d properties not found, %s not found, not matched %s"
- , copyProperties.size()
- , Arrays.toString(copyProperties.toArray(new String[0]))
- , Arrays.toString(propsNotFound.toArray(new String[0])))
- ,copyProperties.isEmpty());
- }
-// public void testIsProvider()
-// {
-// fail("Not yet implemented");
-// }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestStartupHandler.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestStartupHandler.java
deleted file mode 100644
index df80424..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestStartupHandler.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests;
-
-import java.io.ByteArrayInputStream;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.internal.jsp.JSPModelProcessor;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.TestFileResource;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CloseResourceAction;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.ResourceUtil;
-
-/**
- * Some basic coverage of the editor open listener registered by the
- * StartupHandler
- *
- * @author cbateman
- *
- */
-public class TestStartupHandler extends TestCase
-{
- private IFile _testJSP1;
- private WebProjectTestEnvironment _projectTestEnvironment;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com","80");
-
- _projectTestEnvironment =
- new WebProjectTestEnvironment("TestStartupHandler_"+getName());
- _projectTestEnvironment.createProject(false);
-
- final JDTTestEnvironment jdtTestEnvironment =
- new JDTTestEnvironment(_projectTestEnvironment);
-
- final TestFileResource input = new TestFileResource();
- input.load(DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/bundle1.resources.data");
- jdtTestEnvironment.addResourceFile("src"
- , new ByteArrayInputStream(input.toBytes())
- , "bundles", "bundle1.properties");
-
- final IResource res = _projectTestEnvironment.loadResourceInWebRoot(DesignTimeTestsPlugin.getDefault().getBundle()
- , "/testdata/testdata1.jsp.data", "testdata1.jsp");
- _testJSP1 = (IFile) res;
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(_projectTestEnvironment);
- _jsfFactedTestEnvironment.initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testLaunchEditor() throws Exception
- {
- final IWorkbenchPage curPage =
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- final IEditorPart editor =
- IDE.openEditor
- (curPage
- , _testJSP1);
- assertNotNull(editor);
- final IEditorPart foundEditor = ResourceUtil.findEditor(curPage, _testJSP1);
- assertEquals(editor, foundEditor);
-
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- // should have a second reference due to the open editor
- assertNotNull(processor);
- assertFalse(processor.isDisposed());
- curPage.closeEditor(foundEditor, false);
-
- // closing the editor part should have no effect on the processor
- // being disposed
- assertFalse(processor.isDisposed());
- final JSPModelProcessor notDuplicate = JSPModelProcessor.get(_testJSP1);
- assertEquals(processor, notDuplicate);
- }
-
- /**
- * Ensure that if an editor with a JSPModelProcessor attached is closed
- * through the action of closing the enclosing IProject, then StartupHandler
- * detects this and correctly disposes the model processor.
- *
- * @throws Exception
- */
- public void testBug196760() throws Exception
- {
- final IWorkbenchPage curPage =
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- final IEditorPart editor = IDE.openEditor(curPage, _testJSP1);
- assertNotNull(editor);
- final IEditorPart foundEditor = ResourceUtil.findEditor(curPage, _testJSP1);
- assertEquals(editor, foundEditor);
-
- final JSPModelProcessor processor = JSPModelProcessor.get(_testJSP1);
- assertNotNull(processor);
- assertFalse(processor.isDisposed());
-
- // close project with with user action
- final CloseResourceAction action =
- new CloseResourceAction(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow())
- {
- public void superRun()
- {
- super.run();
-
- int numTries = 0;
-
- while(_projectTestEnvironment.getTestProject().isOpen())
- {
- try {
- numTries++;
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- // fall through
- }
-
- if (numTries > 10)
- {
- throw new RuntimeException("Number of tries exceeeded 10");
- }
- }
- }
-
- @Override
- public void run()
- {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()
- {
- public void run()
- {
- superRun();
- }
- });
- }
- };
-
- action.selectionChanged(new StructuredSelection(_projectTestEnvironment.getTestProject()));
- action.run();
-
- // if the editor is closed due a project close, ensure that the processor is properly
- // disposed
- assertFalse(_projectTestEnvironment.getTestProject().isOpen());
-
- // assert that the processor is disposed because its parent project
- // has been closed
- assertTrue(processor.isDisposed());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/ChangeTester.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/ChangeTester.java
deleted file mode 100644
index e047c3b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/ChangeTester.java
+++ /dev/null
@@ -1,179 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.jst.jsf.test.util.mock.MockFile;
-import org.eclipse.jst.jsf.test.util.mock.MockResourceChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-
-public abstract class ChangeTester<EVENTTYPE, CHANGETYPE>
-{
- protected final List<EVENTTYPE> _events = new ArrayList<EVENTTYPE>();
- private final MockWorkspaceContext _context;
- private final MockResourceChangeEventFactory _eventFactory;
- private final IFolder _resourceRoot;
-
- /**
- * @param context
- * @param factory
- * @param resourceRoot
- */
- public ChangeTester(final MockWorkspaceContext context,
- final MockResourceChangeEventFactory factory,
- final IFolder resourceRoot)
- {
- _context = context;
- _eventFactory = factory;
- _resourceRoot = resourceRoot;
- }
-
- public void fireResourceFileContentsChange(final String resourceId)
- {
- installListener();
- final IFile file = getFile(resourceId);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileChange((MockFile) file, true);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- public void fireResourceFileAdd(final String resourceId)
- {
- installListener();
- final IFile file = _resourceRoot.getFile(resourceId);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileAdded((MockFile) file);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- private IFile getFile(final String resourceId)
- {
- final IFile file = _resourceRoot.getFile(resourceId);
- assertNotNull(file);
- assertTrue(file.exists());
- return file;
- }
-
- private IFolder getFolder(final String folderName)
- {
- final IFolder folder = _resourceRoot.getFolder(folderName);
- assertNotNull(folder);
- assertTrue(folder.exists());
- return folder;
- }
-
- protected abstract void installListener();
-
- protected abstract boolean isChangeType(final EVENTTYPE event,
- final CHANGETYPE type);
-
- public void fireResourceFileDelete(final String resourceId)
- {
- installListener();
- final IFile file = getFile(resourceId);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileRemove((MockFile) file);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- public void fireResourceFolderAdd(final String folderName)
- {
- installListener();
- final IFolder folder = getFolder(folderName);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFolderAdded(folder);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- public void fireResourceFolderDelete(final String folderName)
- {
- installListener();
- final IFolder folder = getFolder(folderName);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFolderDeleted(folder);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- public void fireResourceFileDeleteRecusive(final String folderName)
- {
- installListener();
- final IFolder folder = getFolder(folderName);
- final IResourceChangeEvent event = _eventFactory
- .createRecursiveFolderDeleted(folder);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- protected abstract void removeListener();
-
- public void fireResourceFolderRename(final String folderName,
- final String newFolderName)
- {
- installListener();
- final IFolder folder = getFolder(folderName);
- final IFolder newFolder = getFolder(newFolderName);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFolderRename(folder, newFolder);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- public void fireResourceFileRename(String fileName, String newFileName)
- {
- installListener();
- final IFile folder = getFile(fileName);
- final IFile newFolder = getFile(newFileName);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileRename(folder, newFolder);
- _context.fireWorkspaceEvent(event);
- removeListener();
- }
-
- public EVENTTYPE getEvent(final int eventNum)
- {
- return _events.get(eventNum);
- }
-
- public EVENTTYPE getSingleEvent(final CHANGETYPE type)
- {
- List<EVENTTYPE> events = getEvent(type);
- if (events.isEmpty())
- {
- throw new AssertionError();
- } else if (events.size() > 1)
- {
- throw new AssertionError();
- }
- return events.get(0);
- }
-
- public List<EVENTTYPE> getEvent(final CHANGETYPE type)
- {
- List<EVENTTYPE> foundEvents = new ArrayList<EVENTTYPE>();
- for (final EVENTTYPE event : _events)
- {
- if (isChangeType(event, type))
- {
- foundEvents.add(event);
- }
- }
- return foundEvents;
- }
-
- public void assertNumEvents(final int numEvents)
- {
- assertEquals(numEvents, _events.size());
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/FastResourceLocatorSuite.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/FastResourceLocatorSuite.java
deleted file mode 100644
index 65a1707..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/FastResourceLocatorSuite.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import org.eclipse.jst.jsf.test.util.junit4.FastTest;
-import org.junit.experimental.categories.Categories;
-import org.junit.experimental.categories.Categories.IncludeCategory;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Categories.class)
-@IncludeCategory(FastTest.class)
-@SuiteClasses({TestResourceIdentifierFactory.class,
- TestJarBasedJSFResource.class, TestJarBasedJSFResourceLocator.class,
- TestWorkspaceBasedJSFResource.class, TestWorkspaceBasedResourceLocator.class,
- TestJSFResource.class})
-public class FastResourceLocatorSuite
-{
- // do nothing, the annotations define the suite in JUnit 4
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJSFResource.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJSFResource.java
deleted file mode 100644
index 036f643..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJSFResource.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
-import org.eclipse.jst.jsf.common.internal.resource.ContentTypeResolver;
-import org.eclipse.jst.jsf.designtime.internal.resources.JSFResource;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifier;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockContentTypeManager;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestJSFResource
-{
- private TestableJSFResource _xhtmlJsfResource;
- private TestableJSFResource _xhtmlNotAJSFResource;
-
- @Before
- public void testSetup() throws Exception
- {
- final ContentTypeResolver contentTypeResolver = new ContentTypeResolver(new MockContentTypeManager());
- _xhtmlJsfResource = new TestableJSFResource(new ResourceIdentifier("someResource.xhtml"), contentTypeResolver);
- _xhtmlNotAJSFResource = new TestableJSFResource(new ResourceIdentifier("someResource.foo"), contentTypeResolver);
- }
-
- @Test
- public void testIsContentType()
- {
- assertTrue(_xhtmlJsfResource.isContentType("org.eclipse.wst.html.core.htmlsource"));
- assertFalse(_xhtmlNotAJSFResource.isContentType("org.eclipse.wst.html.core.htmlsource")); }
-
-
-
- private final static class TestableJSFResource extends JSFResource
- {
-
- private TestableJSFResource(final ResourceIdentifier id,
- final ContentTypeResolver contentTypeResolver)
- {
- super(id, contentTypeResolver);
- }
-
- @Override
- public boolean isAccessible()
- {
- return true;
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResource.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResource.java
deleted file mode 100644
index 1078adc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResource.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-
-import org.eclipse.jst.jsf.common.internal.resource.ContentTypeResolver;
-import org.eclipse.jst.jsf.common.internal.util.JarUtilities;
-import org.eclipse.jst.jsf.designtime.internal.resources.JarBasedJSFResource;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifier;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory.InvalidIdentifierException;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockContentTypeManager;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestJarBasedJSFResource
-{
- private JarFile _jarFile;
- private ZipEntry _entry;
- private ContentTypeResolver _contentTypeResolver;
-
- @Before
- public void setUp() throws IOException
- {
- final File file = new File("./testdata/jsfResources.jar");
- assertTrue(file.exists());
- _jarFile = new JarFile(file.getAbsoluteFile());
- _entry = _jarFile.getEntry("META-INF/resources/mylib/tag1.xhtml");
- assertNotNull(_entry);
- _contentTypeResolver = new ContentTypeResolver(
- new MockContentTypeManager());
- }
-
- @Test
- public void testJarBasedJSFResource() throws MalformedURLException,
- InvalidIdentifierException
- {
- final URL url = JarUtilities.INSTANCE.createJarUrl(_jarFile,
- (JarEntry) _entry);
- final ResourceIdentifier id = new ResourceIdentifierFactory()
- .createLibraryResource("mylib/tag1.xhtml");
-
- final JarBasedJSFResource resource = new JarBasedJSFResource(id, url,
- _contentTypeResolver);
- assertSame(id, resource.getId());
- assertSame(url, resource.getJarURL());
- assertTrue(resource.isAccessible());
- }
-
- @Test
- public void testJarBasedJSFResource_BadUrl() throws MalformedURLException,
- InvalidIdentifierException
- {
- final URL url = JarUtilities.INSTANCE.createJarUrl("/SomeBadPath", "");
- final ResourceIdentifier id = new ResourceIdentifierFactory()
- .createLibraryResource("mylib/tag1.xhtml");
-
- final JarBasedJSFResource resource = new JarBasedJSFResource(id, url,
- _contentTypeResolver);
- assertSame(id, resource.getId());
- assertSame(url, resource.getJarURL());
- // the url is bad, so we won't get anything.
- assertFalse(resource.isAccessible());
- }
-
- @Test
- public void testJarBasedJSFResource_GoodUrlBadEntry()
- throws MalformedURLException, InvalidIdentifierException
- {
- final URL url = JarUtilities.INSTANCE.createJarUrl(_jarFile,
- (JarEntry) _entry);
- final ResourceIdentifier id = new ResourceIdentifierFactory()
- .createLibraryResource("mylib/notATag1.xhtml");
-
- final JarBasedJSFResource resource = new JarBasedJSFResource(id, url,
- _contentTypeResolver);
- assertSame(id, resource.getId());
- assertSame(url, resource.getJarURL());
- // the url is good, but there is no entry for notATag1,
- // so we won't get anything.
- assertFalse(resource.isAccessible());
- }
-
- @Test
- public void testJarEntryURL() throws IOException, URISyntaxException
- {
- final URL url = JarUtilities.INSTANCE.createJarUrl(_jarFile,
- (JarEntry) _entry);
- assertNotNull(url);
- final URLConnection jarConnection = url.openConnection();
- assertTrue(jarConnection instanceof JarURLConnection);
- final JarEntry jarEntry = ((JarURLConnection) jarConnection)
- .getJarEntry();
- assertNotNull(jarEntry);
- assertEquals(_entry.getName(), jarEntry.getName());
- assertEquals(_entry.isDirectory(), jarEntry.isDirectory());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResourceLocator.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResourceLocator.java
deleted file mode 100644
index dab04fe..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResourceLocator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.internal.locator.ILocatorChangeListener;
-import org.eclipse.jst.jsf.common.internal.resource.ContentTypeResolver;
-import org.eclipse.jst.jsf.common.internal.resource.DefaultJarLocator;
-import org.eclipse.jst.jsf.common.internal.resource.IJarLocator;
-import org.eclipse.jst.jsf.designtime.internal.resources.IJSFResourceFragment;
-import org.eclipse.jst.jsf.designtime.internal.resources.JarBasedJSFResourceLocator;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockContentTypeManager;
-import org.eclipse.jst.jsf.test.util.mock.MockFile;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJDTWorkspaceContext;
-import org.eclipse.jst.jsf.test.util.mock.java.MockJavaCoreMediator;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestJarBasedJSFResourceLocator
-{
- private IJarLocator _jarProvider;
- private JarBasedJSFResourceLocator _locator;
- private MockJDTWorkspaceContext _jdtContext;
- private MockWorkspaceContext _wsContext;
- private MockProject _project;
- private MockFile _jarIFile;
-
- @SuppressWarnings("unchecked")
- @Before
- public void setUp()
- {
- _wsContext = new MockWorkspaceContext();
- _project = _wsContext.createProject("TestProject");
- File jarFile = new File("./testdata/jsfResources.jar");
- assertTrue(jarFile.exists());
- _jdtContext = new MockJDTWorkspaceContext(_wsContext);
- _jdtContext.createCPELibraryInProject(_project, new Path(
- "/WebContent/WEB-INF/lib/jsfResources.jar"), jarFile);
- _jarProvider = new DefaultJarLocator(new MockJavaCoreMediator(
- _jdtContext));
- _locator = new JarBasedJSFResourceLocator(Collections.EMPTY_LIST,
- new CopyOnWriteArrayList<ILocatorChangeListener>(),
- _jarProvider, new ContentTypeResolver(
- new MockContentTypeManager()));
- }
-
- @Test
- public void testLocate()
- {
-
- _locator.start(_project);
- // we can pass null here since our jar provider doesn't care about projects.
- final List<IJSFResourceFragment> foundResources = _locator.locate(_project);
- assertEquals(2, foundResources.size());
- final Set<String> foundResourceIds = new HashSet<String>();
- for (final IJSFResourceFragment res : foundResources)
- {
- foundResourceIds.add(res.getId().toString());
- }
- // contains a directory for mylib
- assertTrue(foundResourceIds.contains("mylib"));
- assertTrue(foundResourceIds.contains("mylib/tag1.xhtml"));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestResourceIdentifierFactory.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestResourceIdentifierFactory.java
deleted file mode 100644
index 603fc20..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestResourceIdentifierFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.regex.Pattern;
-
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifier;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory.InvalidIdentifierException;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestResourceIdentifierFactory
-{
- private ResourceIdentifierFactory _factory;
-
- @Before
- public void setUp() throws Exception
- {
- _factory = new ResourceIdentifierFactory();
- }
-
- @Test
- public void testCreateLibraryResource() throws InvalidIdentifierException
- {
- ResourceIdentifier id = _factory.createLibraryResource("resourceOnly");
- assertEquals("resourceOnly", id.getResourceName());
-
- id = _factory.createLibraryResource("libName/resourceName");
- assertEquals("resourceName", id.getResourceName());
- assertEquals("libName", id.getLibraryName());
-
- id = _factory.createLibraryResource("libName/1_0/resourceName");
- assertEquals("resourceName", id.getResourceName());
- assertEquals("libName", id.getLibraryName());
-
- id = _factory.createLibraryResource("locale/libraryName/1_0/resourceName");
- assertEquals("resourceName", id.getResourceName());
- assertEquals("libraryName", id.getLibraryName());
-
- id = _factory.createLibraryResource("libraryName/1_0/resourceName/resourceVersion");
- assertEquals("resourceName", id.getResourceName());
- assertEquals("libraryName", id.getLibraryName());
-
- id = _factory.createLibraryResource("locale/libraryName/resourceName/resourceVersion");
- assertEquals("resourceName", id.getResourceName());
- assertEquals("libraryName", id.getLibraryName());
-
- id = _factory.createLibraryResource("locale/libraryName/1_0/resourceName/resourceVersion");
- assertEquals("resourceName", id.getResourceName());
- assertEquals("libraryName", id.getLibraryName());
- }
-
- @Test(expected = InvalidIdentifierException.class)
- public void testCreateLibraryResource_InvalidId_BadLibVersion() throws InvalidIdentifierException
- {
- _factory.createLibraryResource("libraryName/bad_version/resourceName");
- }
-
- @Test
- public void testVersionPatternMatch()
- {
- Pattern versionPattern = ResourceIdentifierFactory.VersionPattern;
- assertTrue(versionPattern.matcher("1").matches());
- assertTrue(versionPattern.matcher("12").matches());
- assertTrue(versionPattern.matcher("123").matches());
- assertTrue(versionPattern.matcher("1_0").matches());
- assertTrue(versionPattern.matcher("12_10").matches());
- assertTrue(versionPattern.matcher("129_10").matches());
- assertTrue(versionPattern.matcher("12_10_1").matches());
-
- assertFalse(versionPattern.matcher("_").matches());
- assertFalse(versionPattern.matcher("1_").matches());
- assertFalse(versionPattern.matcher("_0").matches());
- assertFalse(versionPattern.matcher("1_0_").matches());
- assertFalse(versionPattern.matcher("a").matches());
- assertFalse(versionPattern.matcher("a_0").matches());
- assertFalse(versionPattern.matcher("1_0a").matches());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedJSFResource.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedJSFResource.java
deleted file mode 100644
index db17f26..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedJSFResource.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.internal.resource.ContentTypeResolver;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory.InvalidIdentifierException;
-import org.eclipse.jst.jsf.designtime.internal.resources.WorkspaceJSFResource;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockContentTypeManager;
-import org.eclipse.jst.jsf.test.util.mock.MockFile;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestWorkspaceBasedJSFResource
-{
- private WorkspaceJSFResource _res;
- private MockFile _file;
-
- @Before
- public void setUp() throws Exception
- {
- _file = new MockFile(new Path("SomeProject/WebContent/resources/mylib/tag1.xhtml"));
- _res = new WorkspaceJSFResource(new ResourceIdentifierFactory().createLibraryResource("mylib/tag1.xhtml"), _file, new ContentTypeResolver(new MockContentTypeManager()));
- }
-
- @Test
- public void testIsAccessible() throws InvalidIdentifierException
- {
- // isAccessible on this type of JSFResource is simply a pass through
- // to isAccessible on the underlying resource
- _file.setExists(true);
- assertTrue(_res.isAccessible());
-
- _file.setExists(false);
- assertFalse(_res.isAccessible());
- }
-
- @Test
- public void testGetResource()
- {
- assertEquals(_file, _res.getResource());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedResourceLocator.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedResourceLocator.java
deleted file mode 100644
index 9252809..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedResourceLocator.java
+++ /dev/null
@@ -1,426 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.common.internal.locator.ILocatorChangeListener;
-import org.eclipse.jst.jsf.common.internal.resource.ContentTypeResolver;
-import org.eclipse.jst.jsf.designtime.internal.resources.IJSFResourceFragment;
-import org.eclipse.jst.jsf.designtime.internal.resources.IJSFResourceFragment.Type;
-import org.eclipse.jst.jsf.designtime.internal.resources.IWorkspaceJSFResourceFragment;
-import org.eclipse.jst.jsf.designtime.internal.resources.JSFResource;
-import org.eclipse.jst.jsf.designtime.internal.resources.JSFResourceChangeListener;
-import org.eclipse.jst.jsf.designtime.internal.resources.JSFResourceChangeListener.JSFResourceChangedEvent;
-import org.eclipse.jst.jsf.designtime.internal.resources.JSFResourceChangeListener.JSFResourceChangedEvent.CHANGE_TYPE;
-import org.eclipse.jst.jsf.designtime.internal.resources.JSFResourceContainer;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceFragmentIdentifier;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifier;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory;
-import org.eclipse.jst.jsf.designtime.internal.resources.ResourceIdentifierFactory.InvalidIdentifierException;
-import org.eclipse.jst.jsf.designtime.internal.resources.WorkspaceJSFResource;
-import org.eclipse.jst.jsf.designtime.internal.resources.WorkspaceJSFResourceContainer;
-import org.eclipse.jst.jsf.designtime.internal.resources.WorkspaceJSFResourceLocator;
-import org.eclipse.jst.jsf.test.util.junit4.BugRegressionTest;
-import org.eclipse.jst.jsf.test.util.junit4.NoPluginEnvironment;
-import org.eclipse.jst.jsf.test.util.mock.MockContainer;
-import org.eclipse.jst.jsf.test.util.mock.MockContentTypeManager;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockResource;
-import org.eclipse.jst.jsf.test.util.mock.MockResourceChangeEventFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockVirtualComponentQuery;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestWorkspaceBasedResourceLocator
-{
- private WorkspaceJSFResourceLocator _locator;
- private MockWorkspaceContext _context;
- private MockProject _project;
- private MockContainer _webContentFolder;
- private IFolder _resourceRoot;
- private MockResourceChangeEventFactory _eventFactory;
- private ResourceIdentifierFactory _resourceIdFactory;
- private ChangeTester<JSFResourceChangedEvent, CHANGE_TYPE> _changeTester;
-
- @SuppressWarnings(
- { "unchecked" })
- @Before
- public void setUp() throws Exception
- {
- _context = new MockWorkspaceContext();
- final File file = new File("./testdata/TestProject.zip");
- assertTrue(file.exists());
- final ZipFile zipFile = new ZipFile(file);
- _project = _context.loadProject(
- new Path("TestProjectTaglibDescriptor"), zipFile, "Test2/");
- _project.loadAllMembers();
- _webContentFolder = (MockContainer) _context.getResource(_project
- .getFullPath().append("/WebContent"));
- assertNotNull(_webContentFolder);
- _resourceRoot = _webContentFolder.getFolder(new Path("resources"));
- _locator = new WorkspaceJSFResourceLocator(
- Collections.EMPTY_LIST,
- new CopyOnWriteArrayList<ILocatorChangeListener>(),
- new MockVirtualComponentQuery(_project.getFolder("/WebContent")),
- new ContentTypeResolver(new MockContentTypeManager()), _context
- .getWorkspace());
- _eventFactory = new MockResourceChangeEventFactory(_context);
- _resourceIdFactory = new ResourceIdentifierFactory();
- _changeTester = new ChangeTester<JSFResourceChangedEvent, CHANGE_TYPE>(
- _context, _eventFactory, _resourceRoot)
- {
- private JSFResourceChangeListener _listener;
-
- @Override
- protected void installListener()
- {
- _events.clear();
- _listener = new JSFResourceChangeListener()
- {
- @Override
- public void changed(final JSFResourceChangedEvent event)
- {
- _events.add(event);
- }
- };
- _locator.addListener(_listener);
- }
-
- @Override
- protected boolean isChangeType(final JSFResourceChangedEvent event,
- final CHANGE_TYPE type)
- {
- return event.getChangeType() == type;
- }
-
- @Override
- protected void removeListener()
- {
- _locator.removeListener(_listener);
- }
- };
- }
-
- @Test
- public void testLocate()
- {
- _locator.start(_project);
- // we can pass null here since our jar provider doesn't care about
- // projects.
- final List<IJSFResourceFragment> foundResources = _locator
- .locate(_project);
- assertEquals(3, foundResources.size());
- final Set<String> foundResourceIds = new HashSet<String>();
- for (final IJSFResourceFragment res : foundResources)
- {
- foundResourceIds.add(res.getId().toString());
- }
- // contains a directory for mylib
- assertTrue(foundResourceIds.contains("mylib333"));
- assertTrue(foundResourceIds.contains("mylib333/tag1.xhtml"));
- }
-
- @Test
- public void testResourceChangeContents_File()
- throws InvalidIdentifierException
- {
- _locator.start(_project);
- final IJSFResourceFragment changeThis = findById(_locator,
- "mylib333/tag1.xhtml");
- _changeTester.fireResourceFileContentsChange("mylib333/tag1.xhtml");
- _changeTester.assertNumEvents(1);
- final JSFResourceChangedEvent event = _changeTester.getEvent(0);
- assertEquals(CHANGE_TYPE.CHANGED, event.getChangeType());
- assertEquals(changeThis, event.getOldValue());
- assertEquals(changeThis, event.getNewValue());
- }
-
- @Test
- public void testRemoveChange_File() throws InvalidIdentifierException
- {
- _locator.start(_project);
- final IJSFResourceFragment changeThis = findById(_locator,
- "mylib333/tag1.xhtml");
- assertEquals(3, _locator.locate(_project).size());
- _changeTester.fireResourceFileDelete("mylib333/tag1.xhtml");
- _changeTester.assertNumEvents(1);
- final JSFResourceChangedEvent event = _changeTester.getEvent(0);
- assertEquals(CHANGE_TYPE.REMOVED, event.getChangeType());
- assertEquals(changeThis, event.getOldValue());
- assertEquals(null, event.getNewValue());
- assertEquals(2, _locator.locate(_project).size());
- }
-
- @Test
- public void testAddChange_File_ExistingLib()
- {
- _locator.start(_project);
- assertEquals(3, _locator.locate(_project).size());
- _changeTester.fireResourceFileAdd("mylib333/tag2.xhtml");
- _changeTester.assertNumEvents(1);
- final JSFResourceChangedEvent event = _changeTester.getEvent(0);
- assertEquals(CHANGE_TYPE.ADDED, event.getChangeType());
- assertNull(event.getOldValue());
- assertNotNull(event.getNewValue());
- assertEquals(4, _locator.locate(_project).size());
- }
-
- @Test
- public void testAddChange_Folder_NewLib()
- {
- _locator.start(_project);
- assertEquals(3, _locator.locate(_project).size());
- _changeTester.fireResourceFolderAdd("mylib999");
- _changeTester.assertNumEvents(1);
- final JSFResourceChangedEvent event = _changeTester.getEvent(0);
- assertEquals(CHANGE_TYPE.ADDED, event.getChangeType());
- assertNull(event.getOldValue());
- assertNotNull(event.getNewValue());
- assertEquals(Type.CONTAINER, event.getNewValue().getType());
- final JSFResourceContainer newValue = (JSFResourceContainer) event
- .getNewValue();
- assertTrue(newValue instanceof WorkspaceJSFResourceContainer);
- final IResource resource = ((WorkspaceJSFResourceContainer) newValue)
- .getResource();
- assertEquals(IResource.FOLDER, resource.getType());
- assertEquals("mylib999", resource.getName());
- assertEquals(Type.CONTAINER, newValue.getType());
- assertEquals(4, _locator.locate(_project).size());
- }
-
- @Test
- public void testMoveChange_Folder_Rename()
- {
- _locator.start(_project);
- assertEquals(3, _locator.locate(_project).size());
- _changeTester.fireResourceFolderRename("mylib333", "mylib1111");
- _changeTester.assertNumEvents(3);
- {
- final JSFResourceChangedEvent event = _changeTester
- .getSingleEvent(CHANGE_TYPE.ADDED);
- assertEquals(CHANGE_TYPE.ADDED, event.getChangeType());
- assertNull(event.getOldValue());
- assertNotNull(event.getNewValue());
- assertEquals(Type.CONTAINER, event.getNewValue().getType());
- final JSFResourceContainer newValue = (JSFResourceContainer) event
- .getNewValue();
- assertTrue(newValue instanceof WorkspaceJSFResourceContainer);
- final IResource resource = ((WorkspaceJSFResourceContainer) newValue)
- .getResource();
- assertEquals(IResource.FOLDER, resource.getType());
- assertEquals("mylib1111", resource.getName());
- assertEquals(Type.CONTAINER, newValue.getType());
- }
- {
- final List<JSFResourceChangedEvent> events = _changeTester
- .getEvent(CHANGE_TYPE.REMOVED);
- assertEquals(2, events.size());
- JSFResourceChangedEvent event = events.get(0);
- {
- assertNotNull(event.getOldValue());
- assertNull(event.getNewValue());
- assertEquals(Type.CONTAINER, event.getOldValue().getType());
- final JSFResourceContainer oldValue = (JSFResourceContainer) event
- .getOldValue();
- assertTrue(oldValue instanceof WorkspaceJSFResourceContainer);
- final IResource resource = ((WorkspaceJSFResourceContainer) oldValue)
- .getResource();
- assertEquals(IResource.FOLDER, resource.getType());
- assertEquals("mylib333", resource.getName());
- assertEquals(Type.CONTAINER, oldValue.getType());
- }
- event = events.get(1);
- {
- assertNotNull(event.getOldValue());
- assertNull(event.getNewValue());
- assertEquals(Type.RESOURCE, event.getOldValue().getType());
- final IWorkspaceJSFResourceFragment oldValue = (IWorkspaceJSFResourceFragment) event
- .getOldValue();
- final IResource resource = (oldValue)
- .getResource();
- assertEquals(IResource.FILE, resource.getType());
- assertEquals("tag1.xhtml", resource.getName());
- }
- }
- assertEquals(3, _locator.locate(_project).size());
- }
-
- @Test
- public void testMoveChange_File_Rename()
- {
- _locator.start(_project);
- assertEquals(3, _locator.locate(_project).size());
- _changeTester.fireResourceFileRename("mylib333/tag1.xhtml",
- "mylib333/tag2.xhtml");
- _changeTester.assertNumEvents(2);
- {
- final JSFResourceChangedEvent event = _changeTester
- .getSingleEvent(CHANGE_TYPE.ADDED);
- assertEquals(CHANGE_TYPE.ADDED, event.getChangeType());
- assertNull(event.getOldValue());
- assertNotNull(event.getNewValue());
- assertEquals(Type.RESOURCE, event.getNewValue().getType());
- final JSFResource newValue = (JSFResource) event.getNewValue();
- assertTrue(newValue instanceof WorkspaceJSFResource);
- final IResource resource = ((WorkspaceJSFResource) newValue)
- .getResource();
- assertEquals(IResource.FILE, resource.getType());
- assertEquals("tag2.xhtml", resource.getName());
- assertEquals("mylib333/tag2.xhtml", newValue.getId().toString());
- assertEquals(Type.RESOURCE, newValue.getType());
- }
- {
- final JSFResourceChangedEvent event = _changeTester
- .getSingleEvent(CHANGE_TYPE.REMOVED);
- assertEquals(CHANGE_TYPE.REMOVED, event.getChangeType());
- assertNotNull(event.getOldValue());
- assertNull(event.getNewValue());
- assertEquals(Type.RESOURCE, event.getOldValue().getType());
- final JSFResource oldValue = (JSFResource) event.getOldValue();
- assertTrue(oldValue instanceof WorkspaceJSFResource);
- final IResource resource = ((WorkspaceJSFResource) oldValue)
- .getResource();
- assertEquals(IResource.FILE, resource.getType());
- assertEquals("tag1.xhtml", resource.getName());
- assertEquals("mylib333/tag1.xhtml", oldValue.getId().toString());
- }
- assertEquals(3, _locator.locate(_project).size());
- }
-
- @Test
- @BugRegressionTest(bugNumber = 312358)
- public void testResourceRootDoesntExist()
- {
- ((MockResource) _resourceRoot).setExists(false);
- _locator.start(_project);
- // the workspace listener should get added event though the resource
- // root doesn't yet exist.
- assertEquals(1, _context.getWorkspace().getListeners().size());
- // simulate adding the folder
- ((MockResource) _resourceRoot).setExists(true);
- _changeTester.fireResourceFolderAdd("");
- _changeTester.assertNumEvents(1);
- // simulate adding a sub-folder
- _changeTester.fireResourceFolderAdd("ezcomp");
- _changeTester.assertNumEvents(1);
- final List<JSFResourceChangedEvent> events = _changeTester
- .getEvent(CHANGE_TYPE.ADDED);
- assertEquals(1, events.size());
- final JSFResourceChangedEvent event = events.get(0);
- final ResourceFragmentIdentifier id = event.getNewValue().getId();
- assertTrue(event.getNewValue().getType() == Type.CONTAINER);
- assertEquals("ezcomp", id.getLibraryName());
- }
-
- @Test
- @BugRegressionTest(bugNumber = 312358)
- public void testRemoveResourceRootAndAdd()
- {
- _locator.start(_project);
- assertEquals(1, _context.getWorkspace().getListeners().size());
- // delete the folder
- _changeTester.fireResourceFolderDelete("");
- // should get an event for root, lib333 and lib333/tag1.xhtml
- _changeTester.assertNumEvents(3);
- // should still be listening event after root is removed in case
- // it gets added back
- assertEquals(1, _context.getWorkspace().getListeners().size());
- // now add back the folder
- _changeTester.fireResourceFolderAdd("");
- _changeTester.assertNumEvents(1);
- {
- final JSFResourceChangedEvent event = _changeTester
- .getSingleEvent(CHANGE_TYPE.ADDED);
- assertEquals("", event.getNewValue().getId().toString());
- }
- // now add a child to the resource root and assert we discover it.
- _changeTester.fireResourceFolderAdd("ezcomp");
- _changeTester.assertNumEvents(1);
- {
- final JSFResourceChangedEvent event = _changeTester
- .getSingleEvent(CHANGE_TYPE.ADDED);
- assertEquals("ezcomp", event.getNewValue().getId().toString());
- }
- }
-
- @Test
- @BugRegressionTest(bugNumber = 312358)
- public void testAddNoneResourceFolderToWebContent()
- {
- _locator.start(_project);
- assertEquals(1, _context.getWorkspace().getListeners().size());
- // delete the folder
- _changeTester.fireResourceFolderAdd("../foobar");
- _changeTester.assertNumEvents(0);
- }
-
- @Test
- @BugRegressionTest(bugNumber = 312358)
- public void testRemoveRecursiveFolder()
- {
- _locator.start(_project);
- assertEquals(1, _context.getWorkspace().getListeners().size());
- // delete the folder
- _changeTester.fireResourceFileDeleteRecusive("");
- final int expectedEvents = 3;
- _changeTester.assertNumEvents(expectedEvents);
- final List<JSFResourceChangedEvent> events = _changeTester
- .getEvent(CHANGE_TYPE.REMOVED);
- assertEquals(expectedEvents, events.size());
- final Set<String> ids = new HashSet<String>();
- for (final JSFResourceChangedEvent event : events)
- {
- ids.add(event.getOldValue().getId().toString());
- }
- assertTrue(ids.contains(""));
- assertTrue(ids.contains("mylib333"));
- assertTrue(ids.contains("mylib333/tag1.xhtml"));
- assertEquals(expectedEvents, ids.size());
- }
-
- @Test
- @BugRegressionTest(bugNumber = 314145)
- public void testRenameFileInRootFolder()
- {
- _locator.start(_project);
- assertEquals(1, _context.getWorkspace().getListeners().size());
- _changeTester.fireResourceFileRename("../t11.jsp", "../t11.jspx");
- // the workspace resource locator shouldn't care if something outside
- // the resources sub-dir changes.
- _changeTester.assertNumEvents(0);
- }
-
- private IJSFResourceFragment findById(
- final WorkspaceJSFResourceLocator locator, final String id)
- throws InvalidIdentifierException
- {
- final ResourceIdentifier resId = _resourceIdFactory
- .createLibraryResource(id);
- assertNotNull(resId);
- final List<IJSFResourceFragment> located = _locator.locate(_project);
- for (final IJSFResourceFragment res : located)
- {
- if (res.getId().equals(resId))
- {
- return res;
- }
- }
- return null;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestDTUIViewRoot.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestDTUIViewRoot.java
deleted file mode 100644
index 515c489..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestDTUIViewRoot.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.tests.DesignTimeTestsPlugin;
-import org.eclipse.jst.jsf.test.util.JDTTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-
-public class TestDTUIViewRoot extends TestCase {
-
- private static final String TESTJSP1_PATH = "testdata1.jsp";
-
- private WebProjectTestEnvironment _webProjectTestEnv;
- //private IFile _testJSP;
- private JSFFacetedTestEnvironment _jsfFactedTestEnvironment;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true,
- "www-proxy.us.oracle.com", "80");
-
- _webProjectTestEnv = new WebProjectTestEnvironment(getProjectName());
- _webProjectTestEnv.createProject(false);
-
- /*final IResource res =*/ _webProjectTestEnv.loadResourceInWebRoot(
- DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/testdata1.jsp.data", TESTJSP1_PATH);
- //_testJSP = (IFile) res;
-
- new JDTTestEnvironment(_webProjectTestEnv);
-
- _jsfFactedTestEnvironment = new JSFFacetedTestEnvironment(
- _webProjectTestEnv);
- _jsfFactedTestEnvironment
- .initialize(IJSFCoreConstants.FACET_VERSION_1_1);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- private String getProjectName() {
- return "TestDTUIViewRoot" + getName();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestJSPViewDefnAdapter.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestJSPViewDefnAdapter.java
deleted file mode 100644
index 953e1a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/TestJSPViewDefnAdapter.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter.DTELExpression;
-import org.eclipse.jst.jsf.designtime.tests.DesignTimeTestsPlugin;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-public class TestJSPViewDefnAdapter extends TestCase
-{
- private final String ENV_JSF_VERSION = "jsfRuntimeVersion";
-
- private JSFVersion _jsfVersion;
-
- private WebProjectTestEnvironment _webProjectTestEnv;
-
- private IFile _jspFile;
-
- private IStructuredModel _structuredModel;
-
- private final static ELData EMPTY_EXPR =
- new ELData(
- " ",
- 566);
- private final static ELData VAR_EXPR =
- new ELData(
- "myBean",
- 599);
- private final static ELData BEAN_PROP_EXPR =
- new ELData(
- "myBean.property",
- 635);
- private final static ELData BUILTIN_PROP_EXPR =
- new ELData(
- "paramValues.foo",
- 680);
- private final static ELData METHOD_EXPR =
- new ELData(
- "myBean.actionMethod",
- 729);
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- final String version = System.getProperty(ENV_JSF_VERSION);
-
- if (version == null)
- {
- _jsfVersion = JSFVersion.V1_1;
- }
- else
- {
- _jsfVersion = JSFVersion.valueOfString(version);
- }
- // only 1.1 and 1.2 are supported
- assertTrue(_jsfVersion == JSFVersion.V1_1
- || _jsfVersion == JSFVersion.V1_2);
-
- // assertNotNull(JSFCoreUtilHelper.getJSFRuntimeJarsDirectory(_jsfVersion));
- //
- final String jst_web_version =
- (_jsfVersion == JSFVersion.V1_1) ? "2.4"
- : ((_jsfVersion == JSFVersion.V1_2) ? "2.5" : null);
- assertNotNull(jst_web_version);
-
- final String jst_jsf_version = _jsfVersion.toString();
-
- _webProjectTestEnv =
- new WebProjectTestEnvironment(getClass().getName() + "_"
- + getName(), JavaFacet.VERSION_1_5,
- ProjectFacetsManager.getProjectFacet("jst.web")
- .getVersion(jst_web_version));
-
- _webProjectTestEnv.createProject(false);
- assertNotNull(_webProjectTestEnv);
- assertNotNull(_webProjectTestEnv.getTestProject());
- assertTrue(_webProjectTestEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacetedTestEnv =
- new JSFFacetedTestEnvironment(_webProjectTestEnv);
- jsfFacetedTestEnv.initialize(jst_jsf_version);
-
- _jspFile =
- (IFile) _webProjectTestEnv.loadResourceInWebRoot(
- DesignTimeTestsPlugin.getDefault().getBundle(),
- "/testdata/testdata2.jsp.data", "testdata2.jsp");
-
- _structuredModel =
- StructuredModelManager.getModelManager().getModelForRead(
- _jspFile);
-
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- _structuredModel.releaseFromRead();
- }
-
- public final void testSanity()
- {
- final IStructuredDocument sdoc =
- _structuredModel.getStructuredDocument();
- assertNotNull(sdoc);
-
- EMPTY_EXPR.assertELText(sdoc);
- VAR_EXPR.assertELText(sdoc);
- BEAN_PROP_EXPR.assertELText(sdoc);
- BUILTIN_PROP_EXPR.assertELText(sdoc);
- METHOD_EXPR.assertELText(sdoc);
- }
-
- public final void testGetELExpressionIModelContext() throws Exception
- {
- assertTrue(DesignTimeApplicationManager
- .hasJSFDesignTime(_webProjectTestEnv.getTestProject()));
-
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_webProjectTestEnv
- .getTestProject());
- assertNotNull(manager);
-
- IDTViewHandler handler = manager.getViewHandler();
- DTFacesContext facesContext = manager.getFacesContext(_jspFile);
- assertNotNull(facesContext);
- assertTrue(handler.supportsViewDefinition(_jspFile));
-
- XMLViewDefnAdapter adapter =
- (XMLViewDefnAdapter) handler.getViewMetadataAdapterFactory(
- facesContext).createAdapter(facesContext, "");
- final IStructuredDocument sdoc = _structuredModel.getStructuredDocument();
-
- checkELExpression(adapter, sdoc, EMPTY_EXPR);
- checkELExpression(adapter, sdoc, VAR_EXPR);
- checkELExpression(adapter, sdoc, BEAN_PROP_EXPR);
- checkELExpression(adapter, sdoc, BUILTIN_PROP_EXPR);
- checkELExpression(adapter, sdoc, METHOD_EXPR);
- }
-
- private void checkELExpression(final XMLViewDefnAdapter adapter,
- final IStructuredDocument sdoc, final ELData elData)
- throws Exception
- {
- final String expectedText = elData._expectedText;
- final int offset = elData._offset;
-
- // ensure that at ever valid offset in the EL expression, we get a
- // valid el text back with it's sdoc's offset set to the start offset
- // of the region.
- for (int i = 0; i < expectedText.length(); i++)
- {
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(sdoc,offset+i);
- final DTELExpression elExpr = adapter.getELExpression(context);
-
- assertEquals(expectedText.trim(), elExpr.getText().trim());
- assertEquals(offset, elExpr.getDocumentContext().getDocumentPosition());
- }
- }
-
- private static class ELData
- {
- private final String _expectedText;
- private final int _offset;
-
- ELData(final String expectedText, int offset)
- {
- _expectedText = expectedText;
- _offset = offset;
- }
-
- IStructuredDocumentContext getContext(IStructuredDocument sdoc)
- {
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(sdoc,
- _offset);
- assertNotNull(context);
- return context;
- }
-
- String getELText(IStructuredDocument sdoc)
- {
- final ITextRegionContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(getContext(sdoc));
-
- assertEquals(DOMJSPRegionContexts.JSP_VBL_CONTENT, resolver
- .getRegionType());
- return resolver.getRegionText();
- }
-
- void assertELText(IStructuredDocument sdoc)
- {
- assertEquals(_expectedText, getELText(sdoc));
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseStrategyTestClass.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseStrategyTestClass.java
deleted file mode 100644
index 2cee600..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseStrategyTestClass.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.JSPTagResolvingStrategy;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.CompositeVerifier;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.Verifier;
-
-public abstract class BaseStrategyTestClass extends BaseTestClass
-{
- protected JSPTagResolvingStrategy _strategy;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _strategy = createStrategy();
- }
-
- // TODO: fix problems related to finding renderer type in commandButton
- public final void testResolveTLDElementDeclaration()
- {
- for (final String uri : getTestUris())
- {
- final Map<String, ITagElement> tags = TestUtil
- .constructTagElements(TestUtil.getTags(_tagRecords
- .get(uri)), _strategy);
-
- final List<Verifier> verifiers = createVerifiers(tags, uri);
-
- final CompositeVerifier compVerifier =
- new CompositeVerifier(verifiers,
- getExpectedTagCount(uri).getMin(),
- getExpectedTagCount(uri).getMax());
-
- compVerifier.verify(tags);
- }
- }
-
- protected abstract JSPTagResolvingStrategy createStrategy();
-
- protected abstract List<String> getTestUris();
-
- protected ExpectedTagCount getExpectedTagCount(final String uri)
- {
- if (ITLDConstants.URI_JSF_CORE.equals(uri))
- {
- switch(_jsfVersion)
- {
- case V1_0:
- case V1_1:
- return new ExpectedTagCount(18,18);
-
- case V1_2:
- return new ExpectedTagCount(20, 20);
-
- default:
- throw new IllegalStateException("Unknown version: "+_jsfVersion);
- }
- }
- else if (ITLDConstants.URI_JSF_HTML.equals(uri))
- {
- return new ExpectedTagCount(25,25);
- }
-
- return null;
- }
-
- static class ExpectedTagCount
- {
- private final int _min;
- private final int _max;
- public ExpectedTagCount(final int min, final int max)
- {
- super();
- assertTrue(min <= max);
- this._max = max;
- this._min = min;
- }
- public final int getMin()
- {
- return _min;
- }
- public final int getMax()
- {
- return _max;
- }
- }
-
- @SuppressWarnings("unchecked")
- protected List<Verifier> createVerifiers(
- final Map<String, ITagElement> tagElements, final String uri)
- {
- if (ITLDConstants.URI_JSF_CORE.equals(uri))
- {
- switch (_jsfVersion)
- {
- case V1_0:
- case V1_1:
- return VerifyRegistryUtil.CORE_VERIFIERS_11;
-
- case V1_2:
- return VerifyRegistryUtil.CORE_VERIFIERS_12;
-
- default:
- return Collections.EMPTY_LIST;
- }
- }
- else if (ITLDConstants.URI_JSF_HTML.equals(uri))
- {
- return VerifyRegistryUtil.HTML_VERIFIERS;
- }
-
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseTestClass.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseTestClass.java
deleted file mode 100644
index 30893fc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/BaseTestClass.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * Does the basic setup for JSP tests.
- *
- * @author cbateman
- *
- */
-abstract class BaseTestClass extends TestCase
-{
-
- protected WebProjectTestEnvironment _webProjectTestEnv;
- protected Map<String, ITaglibRecord> _tagRecords;
- protected JSFVersion _jsfVersion;
-
- private final String ENV_JSF_VERSION = "jsfRuntimeVersion";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- final String version = System.getProperty(ENV_JSF_VERSION);
-
- if (version == null)
- {
- fail("No version specified in " + ENV_JSF_VERSION);
- }
-
- _jsfVersion = JSFVersion.valueOfString(version);
- // only 1.1 and 1.2 are supported
- assertTrue(_jsfVersion == JSFVersion.V1_1
- || _jsfVersion == JSFVersion.V1_2);
-
- assertNotNull(JSFCoreUtilHelper.getJSFRuntimeJarsDirectory(_jsfVersion));
-
- final String jst_web_version = (_jsfVersion == JSFVersion.V1_1) ? "2.4"
- : ((_jsfVersion == JSFVersion.V1_2) ? "2.5" : null);
- assertNotNull(jst_web_version);
-
- final String jst_jsf_version = _jsfVersion.toString();
-
- _webProjectTestEnv = new WebProjectTestEnvironment(getClass().getName()
- + "_" + getName(), JavaFacet.VERSION_1_5, ProjectFacetsManager
- .getProjectFacet("jst.web").getVersion(jst_web_version));
-
- _webProjectTestEnv.createProject(false);
- assertNotNull(_webProjectTestEnv);
- assertNotNull(_webProjectTestEnv.getTestProject());
- assertTrue(_webProjectTestEnv.getTestProject().isAccessible());
-
- final JSFFacetedTestEnvironment jsfFacetedTestEnv = new JSFFacetedTestEnvironment(
- _webProjectTestEnv);
- jsfFacetedTestEnv.initialize(jst_jsf_version);
-
- assertTrue(JSFCoreUtilHelper.addJSFRuntimeJarsToClasspath(_jsfVersion,
- jsfFacetedTestEnv));
-
- final ITaglibRecord[] tldrecs = TaglibIndex
- .getAvailableTaglibRecords(_webProjectTestEnv.getTestProject()
- .getFullPath());
- _tagRecords = new HashMap<String, ITaglibRecord>();
- for (final ITaglibRecord taglibRecord : tldrecs)
- {
- _tagRecords
- .put(taglibRecord.getDescriptor().getURI(), taglibRecord);
- }
-
- assertNotNull(_tagRecords.get(ITLDConstants.URI_JSF_CORE));
- assertNotNull(_tagRecords.get(ITLDConstants.URI_JSF_HTML));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/JSPViewSuite.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/JSPViewSuite.java
deleted file mode 100644
index 493f18e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/JSPViewSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JSPViewSuite
-{
- public static Test suite()
- {
- // $JUnit-BEGIN$
- final TestSuite suite = new TestSuite(
- "Test for org.eclipse.jst.jsf.designtime.tests.JSPViewSuite");
-
- suite.addTestSuite(TestDefaultJSPTagResolver.class);
- if ("1.1".equals(System.getProperty("jsfRuntimeVersion")))
- {
- suite.addTestSuite(TestTagAnalyzer.class);
- }
- suite.addTestSuite(TestTagIntrospectingStrategy.class);
- suite.addTestSuite(TestTLDNamespace.class);
- suite.addTestSuite(TestTLDTagRegistry.class);
-
- return suite;
- // $JUnit-END$
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestDefaultJSPTagResolver.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestDefaultJSPTagResolver.java
deleted file mode 100644
index 6c0a91d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestDefaultJSPTagResolver.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.DefaultJSPTagResolver;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.JSPTagResolvingStrategy;
-
-public class TestDefaultJSPTagResolver extends BaseStrategyTestClass
-{
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testGetId()
- {
- assertEquals("org.eclipse.jst.jsf.metadata.DefaultJSPTagResolver", _strategy.getId());
- }
-
- @Override
- protected JSPTagResolvingStrategy createStrategy()
- {
- return new DefaultJSPTagResolver(_webProjectTestEnv.getTestProject());
- }
-
- @Override
- protected List<String> getTestUris()
- {
- return Collections.unmodifiableList(Arrays.asList(new String[]
- { ITLDConstants.URI_JSF_CORE, ITLDConstants.URI_JSF_HTML }));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDNamespace.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDNamespace.java
deleted file mode 100644
index c81a61d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDNamespace.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.internal.policy.IdentifierOrderedIteratorPolicy;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.CompositeTagResolvingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.DefaultJSPTagResolver;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TagIntrospectingStrategy;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-
-public class TestTLDNamespace extends BaseTestClass
-{
- private TLDNamespace _coreNS;
- private TLDNamespace _htmlNS;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- final List<String> policies = new ArrayList<String>();
- policies.add(DefaultJSPTagResolver.ID);
- policies.add(TagIntrospectingStrategy.ID);
- final IdentifierOrderedIteratorPolicy<String> idOrderedPolicy =
- new IdentifierOrderedIteratorPolicy<String>(policies);
-
- final CompositeTagResolvingStrategy<TLDElementDeclaration> compStrategy =
- new CompositeTagResolvingStrategy<TLDElementDeclaration>(idOrderedPolicy);
-
- compStrategy.addStrategy(new TagIntrospectingStrategy(
- _webProjectTestEnv.getTestProject()));
- compStrategy.addStrategy(new DefaultJSPTagResolver(_webProjectTestEnv
- .getTestProject()));
-
- final TLDDocument coreDoc = TestUtil.getDocument(_tagRecords
- .get(ITLDConstants.URI_JSF_CORE));
- _coreNS = new TLDNamespace(coreDoc, compStrategy);
-
- final TLDDocument htmlDoc = TestUtil.getDocument(_tagRecords
- .get(ITLDConstants.URI_JSF_HTML));
- _htmlNS = new TLDNamespace(htmlDoc, compStrategy);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testGetNSUri()
- {
- assertEquals(ITLDConstants.URI_JSF_CORE, _coreNS.getNSUri());
- assertEquals(ITLDConstants.URI_JSF_HTML, _htmlNS.getNSUri());
- }
-
- public void testGetViewElements()
- {
- final Map<String, ITagElement> coreElements = TestUtil
- .constructTagElements(_coreNS.getViewElements());
-
- if (_jsfVersion == JSFVersion.V1_2)
- {
- VerifyRegistryUtil.runVerifiers(VerifyRegistryUtil.CORE_VERIFIERS_12, coreElements);
- }
- else
- {
- VerifyRegistryUtil.runVerifiers(VerifyRegistryUtil.CORE_VERIFIERS_11, coreElements);
- }
-
- final Map<String, ITagElement> htmlElements = TestUtil
- .constructTagElements(_htmlNS.getViewElements());
- VerifyRegistryUtil.runVerifiers(VerifyRegistryUtil.HTML_VERIFIERS,
- htmlElements);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDTagRegistry.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDTagRegistry.java
deleted file mode 100644
index b8b8bea..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTLDTagRegistry.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory.TagRegistryFactoryException;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.TLDRegistryManager.MyRegistryFactory;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.CompositeVerifier;
-
-public class TestTLDTagRegistry extends BaseTestClass
-{
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testGetRegistry() throws TagRegistryFactoryException
- {
- final ITagRegistry registry = new MyRegistryFactory()
- .createTagRegistry(_webProjectTestEnv.getTestProject());
-
- assertNotNull(registry);
- }
-
- public void testGetAllTagLibraries() throws TagRegistryFactoryException
- {
- final ITagRegistry registry = new MyRegistryFactory()
- .createTagRegistry(_webProjectTestEnv.getTestProject());
-
- assertNotNull(registry);
-
- final Collection<? extends Namespace> libraries = registry
- .getAllTagLibraries();
-
- final Map<String, Map<String, ITagElement>> elements = new HashMap<String, Map<String, ITagElement>>();
-
- for (final Namespace ns : libraries)
- {
- for (final Iterator<?> it = ns.getViewElements().iterator(); it
- .hasNext();)
- {
- final ITagElement tagElement = (ITagElement) it.next();
- assertNotNull(
- "Tag element shouldn't be null: " + ns.getNSUri(),
- tagElement);
-
- Map<String, ITagElement> elementMap = elements.get(ns
- .getNSUri());
-
- if (elementMap == null)
- {
- elementMap = new HashMap<String, ITagElement>();
- elements.put(ns.getNSUri(), elementMap);
- }
-
- elementMap.put(tagElement.getName(), tagElement);
- }
- }
-
- assertTrue(elements.containsKey(ITLDConstants.URI_JSF_CORE));
- assertTrue(elements.containsKey(ITLDConstants.URI_JSF_HTML));
-
- verifyCore(elements.get(ITLDConstants.URI_JSF_CORE));
- verifyHtml(elements.get(ITLDConstants.URI_JSF_HTML));
- }
-
- private void verifyCore(final Map<String, ITagElement> tagElements)
- {
- CompositeVerifier compVerifier = null;
-
- switch (_jsfVersion)
- {
- case V1_0:
- case V1_1:
- compVerifier = new CompositeVerifier(
- VerifyRegistryUtil.CORE_VERIFIERS_11, 18, 18);
- break;
- case V1_2:
- compVerifier = new CompositeVerifier(
- VerifyRegistryUtil.CORE_VERIFIERS_12, 20, 20);
- break;
- }
-
- assertNotNull(compVerifier);
- compVerifier.verify(tagElements);
- }
-
- private void verifyHtml(final Map<String, ITagElement> tagElements)
- {
- CompositeVerifier compVerifier = new CompositeVerifier(
- VerifyRegistryUtil.HTML_VERIFIERS, 25, 25);
-
- compVerifier.verify(tagElements);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagAnalyzer.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagAnalyzer.java
deleted file mode 100644
index ccecb41..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagAnalyzer.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IComponentTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement.TagType;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDTagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer.TagAnalyzer;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-
-public class TestTagAnalyzer extends BaseTestClass
-{
- private TLDElementDeclaration _inputTextTag;
- private TLDElementDeclaration _commandButtonTag;
- private TLDElementDeclaration _convertDateTimeTag;
-// private TLDElementDeclaration _validateDoubleRangeTag;
-// private TLDElementDeclaration _convertNumberTag;
-// private TLDElementDeclaration _validateLengthTag;
- private TLDElementDeclaration _validateLongRangeTag;
- private TLDElementDeclaration _facetTag;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- final ITaglibRecord coreTags = _tagRecords
- .get(ITLDConstants.URI_JSF_CORE);
- final ITaglibRecord htmlTags = _tagRecords
- .get(ITLDConstants.URI_JSF_HTML);
-
- _convertDateTimeTag = TestUtil.getTag(coreTags, "convertDateTime");
- // TODO:
-// _validateDoubleRangeTag = TestUtil.getTag(coreTags,
-// "validateDoubleRange");
-// _convertNumberTag = TestUtil.getTag(coreTags, "convertNumber");
-// _validateLengthTag = TestUtil.getTag(coreTags, "validateLength");
- _validateLongRangeTag = TestUtil.getTag(coreTags, "validateLongRange");
- _facetTag = TestUtil.getTag(coreTags, "facet");
-
- _inputTextTag = TestUtil.getTag(htmlTags, "inputText");
- _commandButtonTag = TestUtil.getTag(htmlTags, "commandButton");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testFindComponentType()
- {
- final String componentType = TagAnalyzer.findComponentType(
- _inputTextTag, _webProjectTestEnv.getTestProject());
- assertEquals("javax.faces.HtmlInputText", componentType);
- }
-
- // TODO: introspection of converters and validators is flaky at best
- // and very dependent on what's on the classpath
-// public void testFindConverterType()
-// {
-// final String converterType = TagAnalyzer.findConverterType(
-// _convertDateTimeTag, _webProjectTestEnv.getTestProject());
-//
-// // TODO: this doesn't work and may never work for JSF 1.2 without
-// // meta-data because of the *ELTag's.
-// assertEquals(null, converterType);
-// }
-//
-// public void testFindValidatorType()
-// {
-// final String validatorType = TagAnalyzer.findValidatorType(
-// _validateDoubleRangeTag, _webProjectTestEnv.getTestProject());
-//
-// // TODO: this doesn't work and may never work for JSF 1.2 without
-// // meta-data because of the *ELTag's.
-// assertEquals("javax.faces.DoubleRange", validatorType);
-// }
-
- public void testCreateTLDTagElement()
- {
- final IProject project = _webProjectTestEnv.getTestProject();
- verifyCommandButton((IComponentTagElement) TagAnalyzer
- .createTLDTagElement(_commandButtonTag, project));
-
- verifyCommandButton((IComponentTagElement) TagAnalyzer
- .createTLDTagElement(_commandButtonTag, project));
- // TODO:
-// verifyNumberConverter(((IConverterTagElement) TagAnalyzer
-// .createTLDTagElement(_convertNumberTag, project)));
-// verifyLengthValidator(((IValidatorTagElement) TagAnalyzer
-// .createTLDTagElement(_validateLengthTag, project)));
- verifyFacetHandler(((IHandlerTagElement) TagAnalyzer
- .createTLDTagElement(_facetTag, project)));
- // XXX: verify robustness when the TLDElementDeclaration has a
- // bad tagClass name.
- }
-
- public void testCreateComponentTagElement()
- {
- final TLDTagElement tagElement = TagAnalyzer.createComponentTagElement(
- _commandButtonTag, _webProjectTestEnv.getTestProject());
- assertNotNull(tagElement);
- assertTrue(tagElement instanceof IComponentTagElement);
- verifyCommandButton((IComponentTagElement) tagElement);
- }
-
- private void verifyCommandButton(
- final IComponentTagElement componentTagElement)
- {
- assertEquals(TagType.COMPONENT, componentTagElement.getType());
- final ComponentTypeInfo componentTypeInfo = componentTagElement
- .getComponent();
- assertEquals("javax.faces.component.html.HtmlCommandButton",
- componentTypeInfo.getClassName());
- assertEquals("javax.faces.HtmlCommandButton", componentTypeInfo
- .getComponentType());
- assertEquals("javax.faces.Command", componentTypeInfo
- .getComponentFamily());
-
- new Exception("TODO: derive renderer type from configuration files where possible")
- .printStackTrace(System.err);
- //assertEquals("javax.faces.Button", componentTypeInfo.getRenderFamily());
- }
-
- // TODO: converter and validator introspection are flaky at best
-// public void testCreateConverterTagElement()
-// {
-// final TLDTagElement tagElement = TagAnalyzer.createConverterTagElement(
-// _convertNumberTag, _webProjectTestEnv.getTestProject());
-// assertNotNull(tagElement);
-// assertTrue(tagElement instanceof IConverterTagElement);
-// verifyNumberConverter((IConverterTagElement) tagElement);
-// }
-//
-// private void verifyNumberConverter(
-// final IConverterTagElement converterTagElement)
-// {
-// assertEquals(TagType.CONVERTER, converterTagElement.getType());
-// final ConverterTypeInfo converterTypeInfo = converterTagElement
-// .getConverter();
-// assertEquals("javax.faces.convert.NumberConverter", converterTypeInfo
-// .getClassName());
-// assertEquals("javax.faces.Number", converterTypeInfo.getConverterId());
-// }
-//
-// public void testCreateValidatorTagElement()
-// {
-// final TLDTagElement tagElement = TagAnalyzer.createValidatorTagElement(
-// _validateLengthTag, _webProjectTestEnv.getTestProject());
-// assertNotNull(tagElement);
-// assertTrue(tagElement instanceof IValidatorTagElement);
-// verifyLengthValidator((IValidatorTagElement) tagElement);
-// }
-//
-// private void verifyLengthValidator(
-// final IValidatorTagElement validatorTagElement)
-// {
-// assertEquals(TagType.VALIDATOR, validatorTagElement.getType());
-// final ValidatorTypeInfo converterTypeInfo = validatorTagElement
-// .getValidator();
-// assertEquals("javax.faces.validator.LengthValidator", converterTypeInfo
-// .getClassName());
-// assertEquals("javax.faces.Length", converterTypeInfo.getValidatorId());
-// }
-
- public void testCreateHandlerTagElement() throws Exception
- {
- final IType type = JavaCore.create(_webProjectTestEnv.getTestProject())
- .findType(_facetTag.getTagclass());
- final TLDTagElement tagElement = TagAnalyzer.createHandlerTagElement(
- _facetTag, type);
- assertNotNull(tagElement);
- assertTrue(tagElement instanceof IHandlerTagElement);
- verifyFacetHandler((IHandlerTagElement) tagElement);
- }
-
- private void verifyFacetHandler(IHandlerTagElement tagElement)
- {
- assertEquals(TagHandlerType.FACET, tagElement.getTagHandlerType());
- }
-
- public void testGetJSFComponentTagType() throws Exception
- {
- { // inputText is a component
- final String inputTextTagClass = _inputTextTag.getTagclass();
- final IType tagClassType = JavaCore.create(
- _webProjectTestEnv.getTestProject()).findType(
- inputTextTagClass);
- assertEquals(IJSFTagElement.TagType.COMPONENT, TagAnalyzer
- .getJSFComponentTagType(tagClassType, _webProjectTestEnv
- .getTestProject()));
- }
-
- { // validateLongRange is a validator
- final String validateLongRangeTagClass = _validateLongRangeTag
- .getTagclass();
- final IType tagClassType = JavaCore.create(
- _webProjectTestEnv.getTestProject()).findType(
- validateLongRangeTagClass);
- assertEquals(IJSFTagElement.TagType.VALIDATOR, TagAnalyzer
- .getJSFComponentTagType(tagClassType, _webProjectTestEnv
- .getTestProject()));
- }
-
- { // convertDateTime
- final String converterDateTimeTagClass = _convertDateTimeTag
- .getTagclass();
- final IType tagClassType = JavaCore.create(
- _webProjectTestEnv.getTestProject()).findType(
- converterDateTimeTagClass);
- assertEquals(IJSFTagElement.TagType.CONVERTER, TagAnalyzer
- .getJSFComponentTagType(tagClassType, _webProjectTestEnv
- .getTestProject()));
-
- }
-
- { // loadBundle is not a component tag
-
- final ITaglibRecord coreTags = _tagRecords
- .get(ITLDConstants.URI_JSF_CORE);
-
- final TLDElementDeclaration loadBundleTag = TestUtil.getTag(
- coreTags, "loadBundle");
-
- assertNotNull(loadBundleTag);
- final String loadBundleTagClass = loadBundleTag.getTagclass();
- final IType tagClassType = JavaCore.create(
- _webProjectTestEnv.getTestProject()).findType(
- loadBundleTagClass);
- assertNull(TagAnalyzer.getJSFComponentTagType(tagClassType,
- _webProjectTestEnv.getTestProject()));
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagIntrospectingStrategy.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagIntrospectingStrategy.java
deleted file mode 100644
index 38d1a29..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestTagIntrospectingStrategy.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.JSPTagResolvingStrategy;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TagIntrospectingStrategy;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.ComponentTagVerifier;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.ConverterTagVerifier;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.ValidatorTagVerifier;
-import org.eclipse.jst.jsf.designtime.tests.views.model.jsp.VerifyRegistryUtil.Verifier;
-
-public class TestTagIntrospectingStrategy extends BaseStrategyTestClass
-{
- @Override
- protected JSPTagResolvingStrategy createStrategy()
- {
- return new TagIntrospectingStrategy(_webProjectTestEnv.getTestProject());
- }
-
- public void testGetNotFoundIndicator()
- {
- assertNull(_strategy.getNotFoundIndicator());
- }
-
- public void testGetId()
- {
- assertEquals("org.eclipse.jst.jsf.designtime.TagIntrospectingStrategy",
- _strategy.getId());
- }
-
- @Override
- protected List<String> getTestUris()
- {
- return Collections.unmodifiableList(Arrays.asList(new String[]
- { ITLDConstants.URI_JSF_CORE, ITLDConstants.URI_JSF_HTML }));
- }
-
- @Override
- protected List<Verifier> createVerifiers(
- final Map<String, ITagElement> tagElements, final String uri)
- {
- if (ITLDConstants.URI_JSF_CORE.equals(uri))
- {
- return createCoreVerifiers(_jsfVersion, tagElements);
- }
- else if (ITLDConstants.URI_JSF_HTML.equals(uri))
- {
- return createHtmlVerifiers(_jsfVersion, tagElements);
- }
- return super.createVerifiers(tagElements, uri);
- }
-
- private static List<Verifier> createHtmlVerifiers(JSFVersion jsfVersion,
- Map<String, ITagElement> tagElements) {
- // Copy the standard verifiers, but replace the component ones with
- // clones that validate null renderer.
- List<Verifier> verifiers = new ArrayList<Verifier>(VerifyRegistryUtil.HTML_VERIFIERS);
-
- List<Verifier> replacements = new ArrayList<Verifier>();
- for (final Iterator<Verifier> it = verifiers.iterator(); it.hasNext();)
- {
- final Verifier next = it.next();
- if (next instanceof ComponentTagVerifier)
- {
- final ComponentTagVerifier replacementVerifier =
- cloneVerifierWithNullRenderType((ComponentTagVerifier) next);
- it.remove();
- replacements.add(replacementVerifier);
- }
- }
-
- for (final Verifier verifier : replacements)
- {
- verifiers.add(verifier);
- }
-
- return Collections.unmodifiableList(verifiers);
- }
-
- private static ComponentTagVerifier cloneVerifierWithNullRenderType(final ComponentTagVerifier tagVerifier)
- {
- ComponentTypeInfo typeInfo = tagVerifier._typeInfo;
- ComponentTypeInfo newTypeInfo = new ComponentTypeInfo(typeInfo.getComponentType(), typeInfo.getClassName(), typeInfo.getSuperClasses(), typeInfo.getInterfaces(), typeInfo.getComponentFamily(), null);
- return new ComponentTagVerifier(tagVerifier._tagId, newTypeInfo);
- }
-
- @Override
- protected ExpectedTagCount getExpectedTagCount(String uri)
- {
- if (ITLDConstants.URI_JSF_CORE.equals(uri))
- {
- switch (_jsfVersion)
- {
- case V1_0:
- case V1_1:
- return new ExpectedTagCount(14, 15);
- case V1_2:
- return new ExpectedTagCount(13, 15);
- default:
- throw new IllegalStateException(_jsfVersion.toString());
- }
- }
- // default
- return super.getExpectedTagCount(uri);
- }
-
- static List<Verifier> createCoreVerifiers(final JSFVersion jsfVersion,
- final Map<String, ITagElement> tagElements)
- {
- // default for JSF 1.2 where we can resolve converters and validators
- // using tags
- ConverterTypeInfo dateTimeConverterTypeInfo = ConverterTypeInfo.UNKNOWN;
- ConverterTypeInfo numberConverterTypeInfo = ConverterTypeInfo.UNKNOWN;
- ValidatorTypeInfo doubleRangeValidatorTypeInfo = ValidatorTypeInfo.UNKNOWN;
- ValidatorTypeInfo lengthValidatorTypeInfo = ValidatorTypeInfo.UNKNOWN;
- ValidatorTypeInfo longRangeValidatorTypeInfo = ValidatorTypeInfo.UNKNOWN;
-
- if (jsfVersion == JSFVersion.V1_2)
- {
- assertTrue("Size was " + tagElements.size()
- + " but expected [13,15]",
- tagElements.size() >= 13 && tagElements.size() <= 15);
- // the JSF 1.2 impl doesn't resolve converters and validators
-
- // MyFaces resolves extra.
-
- if (tagElements.size() == 15)
- {
- doubleRangeValidatorTypeInfo = RuntimeTestUtil.VALIDATORINFO_DOUBLERANGE;
- lengthValidatorTypeInfo = RuntimeTestUtil.VALIDATORINFO_LENGTH;
- longRangeValidatorTypeInfo = RuntimeTestUtil.VALIDATORINFO_LONGRANGE;
- }
- }
- else
- {
- // ri doesn't respect the getComponentType contract so MyFaces
- // will resolve 15, ri only 14
- assertTrue("Size was " + tagElements.size()
- + " but expected [14,15]", tagElements.size() >= 14
- && tagElements.size() <= 15);
- // this only get resolver properly if the classpath is set up with
- // the right pre-req's, so there's no point in testing right now.
-// dateTimeConverterTypeInfo = RuntimeTestUtil.CONVERTERINFO_DATETIME;
-// numberConverterTypeInfo = RuntimeTestUtil.CONVERTERINFO_NUMBER;
-// doubleRangeValidatorTypeInfo = RuntimeTestUtil.VALIDATORINFO_DOUBLERANGE;
-// lengthValidatorTypeInfo = RuntimeTestUtil.VALIDATORINFO_LENGTH;
-// longRangeValidatorTypeInfo = RuntimeTestUtil.VALIDATORINFO_LONGRANGE;
- }
- final List<Verifier> verifiers = new ArrayList<Verifier>();
- if (jsfVersion != JSFVersion.V1_2)
- {
- verifiers.add(VerifyRegistryUtil.ATTRIBUTE_VERIFIER);
- }
-
- verifiers.add(new ConverterTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_CONVERTDATETIME,
- dateTimeConverterTypeInfo));
- verifiers.add(VerifyRegistryUtil.CONVERTER_VERIFIER);
- verifiers.add(new ConverterTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_CONVERTNUMBER,
- numberConverterTypeInfo));
- verifiers.add(VerifyRegistryUtil.FACET_VERIFIER);
- verifiers.add(VerifyRegistryUtil.PARAM_VERIFIER);
- verifiers.add(VerifyRegistryUtil.SELECTITEM_VERIFIER);
- verifiers.add(VerifyRegistryUtil.SELECTITEMS_VERIFIER);
- verifiers.add(VerifyRegistryUtil.SUBVIEW_VERIFIER);
- verifiers.add(new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATEDOUBLERANGE,
- doubleRangeValidatorTypeInfo));
- verifiers.add(new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATELENGTH,
- lengthValidatorTypeInfo));
- verifiers.add(new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATELONGRANGE,
- longRangeValidatorTypeInfo));
- verifiers.add(VerifyRegistryUtil.VALIDATOR_VERIFIER);
- verifiers.add(VerifyRegistryUtil.VERBATIM_VERIFIER);
-
- return verifiers;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestUtil.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestUtil.java
deleted file mode 100644
index 44b5842..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/TestUtil.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.ITagResolvingStrategy;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Local test utility functions.
- *
- * @author cbateman
- *
- */
-final class TestUtil extends Assert
-{
- public static TLDDocument getDocument(final ITaglibRecord record)
- {
- final CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- final TLDDocument doc = (TLDDocument) factory.createCMDocument(record);
- return doc;
- }
-
- public static TLDElementDeclaration getTag(final ITaglibRecord record,
- final String name)
- {
- final TLDDocument doc = getDocument(record);
- assertNotNull(doc);
- final CMNode cmNode = doc.getElements().getNamedItem(name);
- assertTrue(cmNode instanceof TLDElementDeclaration);
- return (TLDElementDeclaration) cmNode;
- }
-
- public static List<TLDElementDeclaration> getTags(final ITaglibRecord record)
- {
- final TLDDocument doc = getDocument(record);
- assertNotNull(doc);
- final CMNamedNodeMap nodes = doc.getElements();
-
- final List<TLDElementDeclaration> tags = new ArrayList<TLDElementDeclaration>();
- for (final Iterator<?> it = nodes.iterator(); it.hasNext();)
- {
- final CMNode cmNode = (CMNode) it.next();
- assertTrue(cmNode instanceof TLDElementDeclaration);
- tags.add((TLDElementDeclaration) cmNode);
- }
- return tags;
- }
-
- public static Map<String, ITagElement> constructTagElements(Collection<? extends ITagElement> elements)
- {
- Map<String, ITagElement> map = new HashMap<String, ITagElement>();
-
- for (ITagElement element : elements)
- {
- map.put(element.getName(), element);
- }
-
- return map;
- }
-
- public static Map<String, ITagElement> constructTagElements(
- final List<TLDElementDeclaration> tlds,
- final ITagResolvingStrategy<TLDElementDeclaration, String> strategy)
- {
- final Map<String, ITagElement> tagElements =
- new HashMap<String, ITagElement>();
- for (final TLDElementDeclaration tld : tlds)
- {
- final ITagElement tagElement = strategy.resolve(tld);
- if (tagElement != null)
- {
- assertNotNull(tagElement.getName());
- tagElements.put(tagElement.getName(), tagElement);
- }
- }
-
- return tagElements;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/VerifyRegistryUtil.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/VerifyRegistryUtil.java
deleted file mode 100644
index a7ad4f5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/model/jsp/VerifyRegistryUtil.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.designtime.tests.views.model.jsp;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Assert;
-import junit.framework.AssertionFailedError;
-
-import org.eclipse.jst.jsf.common.dom.TagIdentifier;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IComponentTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IConverterTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IValidatorTagElement;
-import org.eclipse.jst.jsf.common.runtime.tests.model.RuntimeTestUtil;
-import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
-
-public class VerifyRegistryUtil extends Assert
-{
- // core verifiers
- public static final Verifier ACTIONLISTENENER_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_ACTIONLISTENER);
-
- public static final Verifier ATTRIBUTE_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_ATTRIBUTE);
-
- public static final Verifier CONVERTDATETIME_VERIFIER = new ConverterTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_CONVERTDATETIME,
- RuntimeTestUtil.CONVERTERINFO_DATETIME);
-
- public static final Verifier CONVERTER_VERIFIER = new ConverterTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_CONVERTER, ConverterTypeInfo.UNKNOWN);
-
- public static final Verifier CONVERTNUMBER_VERIFIER = new ConverterTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_CONVERTNUMBER,
- RuntimeTestUtil.CONVERTERINFO_NUMBER);
-
- public static final Verifier FACET_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_FACET);
-
- public static final Verifier LOADBUNDLE_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_LOADBUNDLE);
-
- public static final Verifier PARAM_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_PARAM, RuntimeTestUtil.COMPINFO_PARAM);
-
- public static final Verifier PHASELISTENER_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_PHASELISTENER);
-
- public static final Verifier SELECTITEM_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTITEM,
- RuntimeTestUtil.COMPINFO_SELECTITEM);
-
- public static final Verifier SELECTITEMS_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTITEMS,
- RuntimeTestUtil.COMPINFO_SELECTITEMS);
-
- public static final Verifier SETPROPERTYACTIONLISTENER_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_SETPROPERTYACTIONLISTENER);
-
- public static final Verifier SUBVIEW_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SUBVIEW,
- RuntimeTestUtil.COMPINFO_SUBVIEW);
-
- public static final Verifier VALIDATEDOUBLERANGE_VERIFIER = new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATEDOUBLERANGE,
- RuntimeTestUtil.VALIDATORINFO_DOUBLERANGE);
-
- public static final Verifier VALIDATELENGTH_VERIFIER = new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATELENGTH,
- RuntimeTestUtil.VALIDATORINFO_LENGTH);
-
- public static final Verifier VALIDATELONGRANGE_VERIFIER = new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATELONGRANGE,
- RuntimeTestUtil.VALIDATORINFO_LONGRANGE);
-
- public static final Verifier VALIDATOR_VERIFIER = new ValidatorTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALIDATOR, ValidatorTypeInfo.UNKNOWN);
-
- public static final Verifier VALUECHANGELISTENER_VERIFIER = new TagHandlerVerifier(
- IJSFConstants.TAG_IDENTIFIER_VALUECHANGELISTENER);
-
- public static final Verifier VERBATIM_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VERBATIM,
- RuntimeTestUtil.COMPINFO_VERBATIM);
-
- public static final Verifier VIEW_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_VIEW, RuntimeTestUtil.COMPINFO_VIEW);
-
- // html verifier
- public static final Verifier COLUMN_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_COLUMN,
- RuntimeTestUtil.COMPINFO_COLUMN);
-
- public static final Verifier COMMANDBUTTON_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_COMMANDBUTTON,
- RuntimeTestUtil.COMPINFO_COMMAND);
-
- public static final Verifier COMMANDLINK_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_COMMANDLINK,
- RuntimeTestUtil.COMPINFO_COMMANDLINK);
-
- public static final Verifier DATATABLE_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_DATA_TABLE,
- RuntimeTestUtil.COMPINFO_DATATABLE);
-
- public static final Verifier FORM_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_FORM, RuntimeTestUtil.COMPINFO_FORM);
-
- public static final Verifier GRAPHICIMAGE_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_GRAPHICIMAGE,
- RuntimeTestUtil.COMPINFO_GRAPHIC);
-
- public static final Verifier INPUTHIDDEN_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_INPUTHIDDEN,
- RuntimeTestUtil.COMPINFO_HIDDEN);
-
- public static final Verifier INPUTSECRET_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_INPUTSECRET,
- RuntimeTestUtil.COMPINFO_SECRET);
-
- public static final Verifier INPUTTEXT_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_INPUTTEXT,
- RuntimeTestUtil.COMPINFO_INPUTTEXT);
-
- public static final Verifier INPUTTEXTAREA_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_INPUTTEXTAREA,
- RuntimeTestUtil.COMPINFO_INPUTTEXTAREA);
-
- public static final Verifier MESSAGE_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_MESSAGE,
- RuntimeTestUtil.COMPINFO_MESSAGE);
-
- public static final Verifier MESSAGES_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_MESSAGES,
- RuntimeTestUtil.COMPINFO_MESSAGES);
-
- public static final Verifier OUTPUTFORMAT_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_OUTPUTFORMAT,
- RuntimeTestUtil.COMPINFO_OUTPUTFORMAT);
-
- public static final Verifier OUTPUTLABEL_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_OUTPUTLABEL,
- RuntimeTestUtil.COMPINFO_OUTPUTLABEL);
-
- public static final Verifier OUTPUTLINK_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_OUTPUTLINK,
- RuntimeTestUtil.COMPINFO_OUTPUTLINK);
-
- public static final Verifier OUTPUTTEXT_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_OUTPUTTEXT,
- RuntimeTestUtil.COMPINFO_OUTPUTTEXT);
-
- public static final Verifier PANELGRID_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_PANEL_GRID,
- RuntimeTestUtil.COMPINFO_PANELGRID);
-
- public static final Verifier PANELGROUP_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_PANEL_GROUP,
- RuntimeTestUtil.COMPINFO_PANELGROUP);
-
- public static final Verifier SELECTBOOLEANCHECKBOX_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX,
- RuntimeTestUtil.COMPINFO_SELECTBOOLEANCHECKBOX);
-
- public static final Verifier SELECTMANYCHECKBOX_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTMANYCHECKBOX,
- RuntimeTestUtil.COMPINFO_SELECTMANYCHECKBOX);
-
- public static final Verifier SELECTMANYLISTBOX_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTMANYLISTBOX,
- RuntimeTestUtil.COMPINFO_SELECTMANYLISTBOX);
-
- public static final Verifier SELECTMANYMENU_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTMANYMENU,
- RuntimeTestUtil.COMPINFO_SELECTMANYMENU);
-
- public static final Verifier SELECTONELISTBOX_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTONELISTBOX,
- RuntimeTestUtil.COMPINFO_SELECTONELISTBOX);
-
- public static final Verifier SELECTONEMENU_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTONEMENU,
- RuntimeTestUtil.COMPINFO_SELECTONEMENU);
-
- public static final Verifier SELECTONERADIO_VERIFIER = new ComponentTagVerifier(
- IJSFConstants.TAG_IDENTIFIER_SELECTONERADIO,
- RuntimeTestUtil.COMPINFO_SELECTONERADIO);
-
- public static final List<Verifier> CORE_VERIFIERS_11;
- public static final List<Verifier> CORE_VERIFIERS_12;
-
- public static final List<Verifier> HTML_VERIFIERS;
-
- static
- {
- List<Verifier> verifiers = new ArrayList<Verifier>();
-
- verifiers.add(ACTIONLISTENENER_VERIFIER);
- verifiers.add(ATTRIBUTE_VERIFIER);
- verifiers.add(CONVERTDATETIME_VERIFIER);
- verifiers.add(CONVERTER_VERIFIER);
- verifiers.add(CONVERTNUMBER_VERIFIER);
- verifiers.add(FACET_VERIFIER);
- verifiers.add(LOADBUNDLE_VERIFIER);
- verifiers.add(PARAM_VERIFIER);
- verifiers.add(SELECTITEM_VERIFIER);
- verifiers.add(SELECTITEMS_VERIFIER);
- verifiers.add(SUBVIEW_VERIFIER);
- verifiers.add(VALIDATEDOUBLERANGE_VERIFIER);
- verifiers.add(VALIDATELENGTH_VERIFIER);
- verifiers.add(VALIDATELONGRANGE_VERIFIER);
- verifiers.add(VALIDATOR_VERIFIER);
- verifiers.add(VALUECHANGELISTENER_VERIFIER);
- verifiers.add(VERBATIM_VERIFIER);
- verifiers.add(VIEW_VERIFIER);
-
- CORE_VERIFIERS_11 = Collections.unmodifiableList(verifiers);
-
- verifiers = new ArrayList<Verifier>(CORE_VERIFIERS_11);
- verifiers.add(PHASELISTENER_VERIFIER);
- verifiers.add(SETPROPERTYACTIONLISTENER_VERIFIER);
- CORE_VERIFIERS_12 = Collections.unmodifiableList(verifiers);
-
- verifiers = new ArrayList<Verifier>();
-
- verifiers.add(COLUMN_VERIFIER);
- verifiers.add(COMMANDBUTTON_VERIFIER);
- verifiers.add(COMMANDLINK_VERIFIER);
- verifiers.add(DATATABLE_VERIFIER);
- verifiers.add(FORM_VERIFIER);
- verifiers.add(GRAPHICIMAGE_VERIFIER);
- verifiers.add(INPUTHIDDEN_VERIFIER);
- verifiers.add(INPUTSECRET_VERIFIER);
- verifiers.add(INPUTTEXT_VERIFIER);
- verifiers.add(INPUTTEXTAREA_VERIFIER);
- verifiers.add(MESSAGE_VERIFIER);
- verifiers.add(MESSAGES_VERIFIER);
- verifiers.add(OUTPUTFORMAT_VERIFIER);
- verifiers.add(OUTPUTLABEL_VERIFIER);
- verifiers.add(OUTPUTLINK_VERIFIER);
- verifiers.add(OUTPUTTEXT_VERIFIER);
- verifiers.add(PANELGRID_VERIFIER);
- verifiers.add(PANELGROUP_VERIFIER);
- verifiers.add(SELECTBOOLEANCHECKBOX_VERIFIER);
- verifiers.add(SELECTMANYCHECKBOX_VERIFIER);
- verifiers.add(SELECTMANYLISTBOX_VERIFIER);
- verifiers.add(SELECTMANYMENU_VERIFIER);
- verifiers.add(SELECTONELISTBOX_VERIFIER);
- verifiers.add(SELECTONEMENU_VERIFIER);
- verifiers.add(SELECTONERADIO_VERIFIER);
-
- HTML_VERIFIERS = Collections.unmodifiableList(verifiers);
- }
-
- public static void runVerifiers(final List<Verifier> verifiers,
- final Map<String, ITagElement> tags)
- {
- for (final Verifier verifier : verifiers)
- {
- verifier.verify(tags);
- }
- }
-
- abstract static class Verifier
- {
- protected final TagIdentifier _tagId;
-
- public Verifier(final TagIdentifier tagId)
- {
- _tagId = tagId;
- }
-
- public abstract void verify(final Map<String, ITagElement> tagElements);
- }
-
- abstract static class TypeVerifier<TAGTYPEINFO> extends Verifier
- {
- protected final TAGTYPEINFO _typeInfo;
-
- public TypeVerifier(final TagIdentifier tagId,
- final TAGTYPEINFO typeInfo)
- {
- super(tagId);
- _typeInfo = typeInfo;
- }
- }
-
- static class ConverterTagVerifier extends TypeVerifier<ConverterTypeInfo>
- {
- public ConverterTagVerifier(final TagIdentifier tagId,
- final ConverterTypeInfo typeInfo)
- {
- super(tagId, typeInfo);
- }
-
- @Override
- public void verify(final Map<String, ITagElement> tagElements)
- {
- final ITagElement tagElement = tagElements.remove(_tagId
- .getTagName());
- assertTrue("Expected element to be converter: "
- + _tagId.getTagName(),
- tagElement instanceof IConverterTagElement);
-
- final IConverterTagElement converterTag = (IConverterTagElement) tagElement;
- final ConverterTypeInfo converterTypeInfo = converterTag
- .getConverter();
- // do verifySame from common.runtime.tests
- try
- {
- RuntimeTestUtil.verifySame(_typeInfo, converterTypeInfo);
- }
- catch (final AssertionFailedError afe)
- {
- System.err.printf("Failure occurred in tag %s\n", _tagId
- .asQName().toString());
- throw afe;
- }
- }
- }
-
- static class ValidatorTagVerifier extends TypeVerifier<ValidatorTypeInfo>
- {
- public ValidatorTagVerifier(final TagIdentifier tagId,
- final ValidatorTypeInfo typeInfo)
- {
- super(tagId, typeInfo);
- }
-
- @Override
- public void verify(final Map<String, ITagElement> tagElements)
- {
- final ITagElement tagElement = tagElements.remove(_tagId
- .getTagName());
- assertTrue("Expected element to be validator: "
- + _tagId.getTagName(),
- tagElement instanceof IValidatorTagElement);
- final IValidatorTagElement validatorTag = (IValidatorTagElement) tagElement;
- final ValidatorTypeInfo validatorTypeInfo = validatorTag
- .getValidator();
- // do verifySame from common.runtime.tests
- try
- {
- RuntimeTestUtil.verifySame(_typeInfo, validatorTypeInfo);
- }
- catch (final AssertionFailedError afe)
- {
- System.err.printf("Failure occurred in tag %s\n", _tagId
- .asQName().toString());
- throw afe;
- }
- }
- }
-
- static class ComponentTagVerifier extends TypeVerifier<ComponentTypeInfo>
- {
- public ComponentTagVerifier(final TagIdentifier tagId,
- final ComponentTypeInfo typeInfo)
- {
- super(tagId, typeInfo);
- }
-
- @Override
- public void verify(final Map<String, ITagElement> tagElements)
- {
- final ITagElement tagElement = tagElements.remove(_tagId
- .getTagName());
- assertTrue("Expected element to be component: "
- + _tagId.getTagName(),
- tagElement instanceof IComponentTagElement);
- final IComponentTagElement componentTag = (IComponentTagElement) tagElement;
- final ComponentTypeInfo componentTypeInfo = componentTag
- .getComponent();
- // do verifySame from common.runtime.tests
- try
- {
- RuntimeTestUtil.verifySame(_typeInfo, componentTypeInfo);
- }
- catch (final AssertionFailedError afe)
- {
- System.err.printf("Failure occurred in tag %s\n", _tagId
- .asQName().toString());
- throw afe;
- }
- }
- }
-
- public static class JSFTagElementVerifier extends Verifier
- {
- public JSFTagElementVerifier(final TagIdentifier tagId)
- {
- super(tagId);
- }
-
- @Override
- public void verify(final Map<String, ITagElement> tagElements)
- {
- final ITagElement tagElement = tagElements.remove(_tagId
- .getTagName());
- assertTrue("Expected jsf element to be jsf tag: "
- + _tagId.getTagName(), tagElement instanceof IJSFTagElement);
- }
- }
-
- public static class TagHandlerVerifier extends Verifier
- {
- public TagHandlerVerifier(final TagIdentifier tagId)
- {
- super(tagId);
- }
-
- @Override
- public void verify(final Map<String, ITagElement> tagElements)
- {
- final ITagElement tagElement = tagElements.remove(_tagId
- .getTagName());
- assertTrue("Expected handler element to be jsf tag: "
- + _tagId.getTagName(), tagElement instanceof ITagElement);
- }
- }
-
- public static class CompositeVerifier
- {
- private final List<Verifier> _verifiers;
- private final int _minExpectedTags;
- private final int _maxExpectedTags;
-
- public CompositeVerifier(final List<Verifier> verifiers,
- final int minExpectedTags, final int maxExpectedTags)
- {
- _verifiers = verifiers;
- _minExpectedTags = minExpectedTags;
- _maxExpectedTags = maxExpectedTags;
- }
-
- public void verify(final Map<String, ITagElement> tags)
- {
- final int size = tags.size();
-
- assertTrue(size >= _minExpectedTags);
- assertTrue(size <= _maxExpectedTags);
-
- runVerifiers(_verifiers, tags);
-
- assertTrue(tags.size() <= (size - _minExpectedTags));
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/persistence/TestSerializableTLDTagElement.java b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/persistence/TestSerializableTLDTagElement.java
deleted file mode 100644
index a71a04e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/persistence/TestSerializableTLDTagElement.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.views.persistence;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Map;
-import java.util.zip.ZipFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.tests.TestsPlugin;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.CMNodeNamedMapAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDTagElement;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor.NullAttributeAdvisor;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class TestSerializableTLDTagElement extends TestCase
-{
-
- private WebProjectTestEnvironment _webProject;
- private TLDElementDeclaration _sampleTldElementDeclaration;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=296496
- final ZipFile zipFile = JSFTestUtil.createZipFile(TestsPlugin
- .getDefault().getBundle(), "/testfiles/testzips/TLDTests.zip");
-
- _webProject = new WebProjectTestEnvironment(this,
- JavaFacetUtils.JAVA_50, ProjectFacetsManager.getProjectFacet(
- "jst.web").getVersion("2.4"));
- _webProject.createFromZip(zipFile, true);
- */
- final ZipFile zipFile = JSFTestUtil.createZipFile(TestsPlugin
- .getDefault().getBundle(), "/testfiles/testzips/TLDTests2.zip");
- _webProject = new WebProjectTestEnvironment(this,
- JavaFacet.VERSION_1_5, ProjectFacetsManager.getProjectFacet(
- "jst.web").getVersion("2.4"));
- _webProject.createFromZip2(zipFile, true);
- assertNotNull(_webProject);
-
- _sampleTldElementDeclaration = findElementDeclaration(_webProject
- .getTestProject(), "uri-supplied", "useBean");
- assertNotNull(_sampleTldElementDeclaration);
- }
-
- // regression for: https://bugs.eclipse.org/bugs/show_bug.cgi?id=260931
- public void testSerialization() throws Exception
- {
- final TLDTagElement tldTagElement = new TLDTagElement(_sampleTldElementDeclaration, new NullAttributeAdvisor());
- verifyUseBean(tldTagElement);
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- ObjectOutputStream outStream = new ObjectOutputStream(out);
- outStream.writeObject(tldTagElement);
- ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
- ObjectInputStream inStream = new ObjectInputStream(in);
- Object readObject = inStream.readObject();
- assertNotNull(readObject);
- assertTrue(readObject instanceof TLDTagElement);
- verifyUseBean((TLDTagElement) readObject);
- // from the bug: CMNodeNamedMapAdapter should never get serialized as the attribute handler map.
- assertFalse(((TLDTagElement)readObject).getAttributeHandlers() instanceof CMNodeNamedMapAdapter);
- }
-
- private void verifyUseBean(final TLDTagElement tldTagElement)
- {
- assertEquals("useBean", tldTagElement.getName());
- assertEquals("uri-supplied", tldTagElement.getUri());
- assertEquals("sample.http.taglib.UseBeanTag", tldTagElement.getTagHandlerClassName());
- Map<?, ?> attributeHandlers = tldTagElement.getAttributeHandlers();
- assertTrue(attributeHandlers.containsKey("id"));
- assertTrue(attributeHandlers.containsKey("cls"));
- assertTrue(attributeHandlers.containsKey("type"));
- assertTrue(attributeHandlers.containsKey("request"));
- assertTrue(attributeHandlers.containsKey("scope"));
- assertEquals(5, attributeHandlers.size());
- }
-
- private static TLDElementDeclaration findElementDeclaration(
- final IProject project, final String shortName, final String name)
- {
- final ITaglibRecord tagRecord = findTagRecord(project, shortName);
- assertNotNull(tagRecord);
- final CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
- final TLDDocument doc = (TLDDocument) factory
- .createCMDocument(tagRecord);
- assertNotNull(doc);
- return (TLDElementDeclaration) doc.getElements().getNamedItem(name);
- }
-
- private static ITaglibRecord findTagRecord(final IProject project,
- final String shortName)
- {
- for (final ITaglibRecord record : TaglibIndex
- .getAvailableTaglibRecords(project.getFullPath()))
- {
- if (shortName.equals(record.getDescriptor().getShortName()))
- {
- return record;
- }
- }
- return null;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/test.xml b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/test.xml
deleted file mode 100644
index e8508c2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/test.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.."/> -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jst.jsf.designtime.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
- <property name="extraVMargs" value="-DjsfRuntimeJarsDirectoryV1.1=${testDir}/${jsf1.1Dir}"/>
- <echo message="extraVMargs ${extraVMargs}" />
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.jst.jsf.designtime.tests.*xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jsf-folder" value="${eclipse-home}/jsf_folder"/>
- <delete dir="${jsf-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jsf-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jst.jsf.designtime.tests.AllTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.jst.jsf.designtime.tests.*xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithListProp.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithListProp.java.data
deleted file mode 100644
index e7425e3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithListProp.java.data
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.test;
-
-public class BeanWithListProp
-{
- private ListBean _myBean1;
-
- // test a property of type Map
- public ListBean getListProp()
- {
- return _myBean1;
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithMapProp.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithMapProp.java.data
deleted file mode 100644
index d449c2d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/BeanWithMapProp.java.data
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.test;
-
-public class BeanWithMapProp
-{
- private MapBean _myBean1;
-
- // test a property of type Map
- public MapBean getMapProp()
- {
- return _myBean1;
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/ListBean.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/ListBean.java.data
deleted file mode 100644
index 4abadc7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/ListBean.java.data
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.test;
-
-import java.util.AbstractList;
-
-/**
- * A bean class that implements java.util.List
- *
- * @author cbateman
- *
- */
-public class ListBean extends AbstractList
-{
- public Object get(int index) {
- return null;
- }
-
- public int size() {
- return 0;
- }
-
- /**
- * Simulate a
- * @return
- */
- public String getStringProperty()
- {
- return "";
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MapBean.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MapBean.java.data
deleted file mode 100644
index 031333b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MapBean.java.data
+++ /dev/null
@@ -1,13 +0,0 @@
-package package com.test;
-
-
-import java.util.AbstractMap;
-import java.util.Collections;
-import java.util.Set;
-
-public class MapBean extends AbstractMap
-{
- public Set entrySet() {
- return Collections.EMPTY_SET;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MethodBean.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MethodBean.java.data
deleted file mode 100644
index b657a03..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/MethodBean.java.data
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-public class MethodBean
-{
- public String actionMethod()
- {
- return "chicken";
- }
-
- public String actionMethodWithParam(String arg)
- {
- return arg;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean1.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean1.java.data
deleted file mode 100644
index 47606fc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean1.java.data
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.test;
-
-import java.util.*;
-
-public class TestBean1
-{
-// simple bean properties
- public String getStringProp1()
- {
- return "";
- }
-
- public void setStringProp1(String prop)
- {
- }
-
-// simple boolean with is getter
- public boolean isBooleanIsProp1()
- {
- return true;
- }
-
- public void setBooleanIsProp1(boolean property)
- {
- }
-// array of string property
- public String[] getStringArrayProperty()
- {
- return new String[] {"a", "b", "c"};
- }
-// array of integer property
- public int[] getIntArrayProperty()
- {
- return new int[] {0,1,2};
- }
-// array of array of string
- public String[][] getArrayOfArrayOfStringProperty()
- {
- return new String[3][];
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean2.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean2.java.data
deleted file mode 100644
index d50dc27..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean2.java.data
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.test;
-
-public class TestBean2
-{
- private TestBean1 _myBean1;
-
- // test recursive properties like var.x.y.x.x.y...
- public TestBean3 getMyBean3()
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean3.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean3.java.data
deleted file mode 100644
index 7b1d1f1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBean3.java.data
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.test;
-
-public class TestBean3
-{
- // test recursive properties like var.x.y.x.x.y...
- public TestBean2 getMyBean2()
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBeanWithGenericProperties.java.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBeanWithGenericProperties.java.data
deleted file mode 100644
index d8c4b89..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestBeanWithGenericProperties.java.data
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.test;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-
-public class TestBeanWithGenericProperties
-{
- public List<String> getListOfStrings()
- {
- return new ArrayList<String>();
- }
-
- public Map<String, String> getMapOfStringsKeyedByString()
- {
- return new HashMap<String, String>();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestProject.zip b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestProject.zip
deleted file mode 100644
index abce390..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/TestProject.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle1.resources.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle1.resources.data
deleted file mode 100644
index 388355e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle1.resources.data
+++ /dev/null
@@ -1,3 +0,0 @@
-prop1=blah
-one.dot=blah1
-two.dot.property=blah3 \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle2.resources.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle2.resources.data
deleted file mode 100644
index c20ba77..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/bundle2.resources.data
+++ /dev/null
@@ -1,3 +0,0 @@
-x_prop1=x_blah
-x_one.dot=x_blah1
-x_two.dot.property=x_blah3 \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config.xml.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config.xml.data
deleted file mode 100644
index fab426b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config.xml.data
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config>
- <managed-bean>
- <managed-bean-name>myBean_none</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>none</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_request</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_session</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_application</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- <description>This is my description of myBean_application</description>
- </managed-bean>
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_1_2.xml.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_1_2.xml.data
deleted file mode 100644
index 1f06473..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_1_2.xml.data
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
- version="1.2">
- <application>
- <resource-bundle>
- <base-name>beans.bundle</base-name>
- <var>resBundleProp1</var>
- </resource-bundle>
- <resource-bundle>
- <base-name>beans.bundle2</base-name>
- <var>resBundleProp2</var>
- </resource-bundle>
- </application>
-</faces-config>
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_2_0.xml.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_2_0.xml.data
deleted file mode 100644
index 413257a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/faces-config_2_0.xml.data
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
-
- <managed-bean>
- <managed-bean-name>myBean_none</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>none</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_request</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_session</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_application</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- <description>This is my description of myBean_application</description>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>myBean_view</managed-bean-name>
- <managed-bean-class>com.test.TestBean1</managed-bean-class>
- <managed-bean-scope>view</managed-bean-scope>
- </managed-bean>
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/jsfResources.jar b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/jsfResources.jar
deleted file mode 100644
index 40d5512..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/jsfResources.jar
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/tag1.xhtml b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/tag1.xhtml
deleted file mode 100644
index e69de29..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/tag1.xhtml
+++ /dev/null
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata1.jsp.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata1.jsp.data
deleted file mode 100644
index b784cba..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata1.jsp.data
+++ /dev/null
@@ -1,54 +0,0 @@
-
-<%@page contentType="text/html"%>
-<%@page pageEncoding="UTF-8"%>
-<%--
-The taglib directive below imports the JSTL library. If you uncomment it,
-you must also add the JSTL library to the project. The Add Library... action
-on Libraries node in Projects view can be used to add the JSTL 1.1 library.
---%>
-
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<f:view>
- <f:loadBundle var="bundle" basename="bundles.bundle1"/>
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title><h:outputText value="#{bundle['page.title']}"/></title>
- <link rel="stylesheet" href="style/style.css" media="screen"/>
- </head>
- <body>
- <h:form id="mainForm">
- <h1><h:outputText value="#{bundle['page.header']}"/></h1>
- <h:messages/>
- <h:panelGrid columns="2">
- <h:outputLabel for="userId" value="Username:"/>
- <h:inputText id="userId" value="#{loginRequest.id}"/>
- <h:outputLabel for="password" value="Password:"/>
- <h:inputSecret id="password" value="#{loginRequest.passwordPlainText}"/>
- </h:panelGrid>
- <h:commandButton action="#{appController.loginActions}" value="#{bundle['login.button.value']}"/><br>
- <h:dataTable var="row" border="1">
- <h:column id="column1">
- <f:facet name="header">
- <h:outputText value="column1"></h:outputText>
- </f:facet>
- </h:column>
- <h:column id="column2">
- <f:facet name="header">
- <h:outputText value="column2"></h:outputText>
- </f:facet>
- </h:column>
- </h:dataTable>
- </h:form>
-
- </body>
-</html>
-</f:view>
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata2.jsp.data b/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata2.jsp.data
deleted file mode 100644
index d9dc5ea..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/testdata/testdata2.jsp.data
+++ /dev/null
@@ -1,29 +0,0 @@
-<%@page contentType="text/html"%>
-<%@page pageEncoding="UTF-8"%>
-
-<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <f:view>
- <h1>JSP Page</h1>
- <!-- no errors -->
- <h:outputText value="#{}"/>
- <h:outputText value="#{ }"/>
- <h:outputText value="#{myBean}"/>
- <h:outputText value="#{myBean.property}"/>
- <h:outputText value="#{paramValues.foo}"/>
- <h:commandButton action="#{myBean.actionMethod}"/>
- </f:view>
- </body>
-</html>
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.cvsignore
deleted file mode 100644
index 419e3f5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-@dot
-build.xml
-javaCompiler...args
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.project b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.project
deleted file mode 100644
index 1af8ce9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.facesconfig.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6eb60cc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:03:16 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 191e9f8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,62 +0,0 @@
-#Thu Sep 27 19:31:11 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 83e1cc7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.facesconfig.tests;singleton:=true
-Bundle-Version: 1.1.2.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.facesconfig.tests.TestsPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.0,2.0.0)",
- org.junit;bundle-version="3.8.1",
- org.eclipse.jst.jsf.facesconfig;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.jsf.test.util;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="[1.1.0,2.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jst.jsf.facesconfig.tests;x-internal:=true,
- org.eclipse.jst.jsf.facesconfig.tests.read;x-internal:=true,
- org.eclipse.jst.jsf.facesconfig.tests.util;x-internal:=true,
- org.eclipse.jst.jsf.facesconfig.tests.write;x-internal:=true
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/_readme.txt b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/_readme.txt
deleted file mode 100644
index 10c9fc4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/_readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-Requires plugin "org.eclipse.wst.common.tests.collector" in same workbench instance. \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/about.html
deleted file mode 100644
index 72f94ad..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/build.properties
deleted file mode 100644
index 6ecf2e7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2008 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- template/,\
- test.xml,\
- plugin.properties,\
- about.html
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/plugin.properties
deleted file mode 100644
index c860c63..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/plugin.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle Corporation.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-###############################################################################
-# Properties for the faces config test plugin
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = JavaServer Faces Tools - FacesConfig Tests Plug-in \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/AllFacesConfigTests.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/AllFacesConfigTests.java
deleted file mode 100644
index e168c33..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/AllFacesConfigTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.eclipse.jst.jsf.facesconfig.tests.read.AllReadTests;
-import org.eclipse.jst.jsf.facesconfig.tests.write.AllWriteTests;
-
-
-/**
- * Container for all JSF tooling unit tests.
- *
- * @author spaxton
- */
-public class AllFacesConfigTests extends TestSuite {
-
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new AllFacesConfigTests();
- }
-
- public AllFacesConfigTests() {
- super();
- addTest(AllReadTests.suite());
- addTest(AllWriteTests.suite());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/TestsPlugin.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/TestsPlugin.java
deleted file mode 100644
index 2f5f47e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/TestsPlugin.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class TestsPlugin extends AbstractUIPlugin {
-
- //The shared instance.
- private static TestsPlugin plugin;
-
- /**
- * The constructor.
- */
- public TestsPlugin() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- * @return the default instance
- */
- public static TestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.jst.jsf.facesconfig.tests", path);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/AllReadTests.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/AllReadTests.java
deleted file mode 100644
index 2b72ade..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/AllReadTests.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestSuite;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase.TestConfiguration;
-
-/**
- * Wrapper suite for all the tests against the .util package.
- *
- * @author xjiang
- * @author spaxton
- * @author le-ake m. G kristos
- */
-public class AllReadTests {
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("FacesConfig Model Read Translation");
- suite.addTest(Faces_1_1_suite());
- suite.addTest(Faces_1_2_suite());
- suite.addTest(Faces_2_0_suite());
- return suite;
- }
-
- private static Test Faces_2_0_suite()
- {
- TestConfiguration testConfiguration = new TestConfiguration();
- testConfiguration.put(BaseReadTestCase.CONFIG_FILE_KEY, "WEB-INF/faces-config_2_0.xml");
- testConfiguration.put(BaseReadTestCase.FACES_VERSION_KEY, IJSFCoreConstants.JSF_VERSION_2_0);
-
- TestSuite suite =
- new ConfigurableTestSuite(testConfiguration, "Faces 2.0 Model Tests");
- suite.addTest(new ConfigurableTestSuite(ReadFacesConfigElementsTestCase_2_0.class, "Faces-config - Each Element"));
- suite.addTest(new ConfigurableTestSuite(ReadApplicationTestCase_2_0.class, "Application Test"));
- suite.addTest(new ConfigurableTestSuite(ReadFactoryTestCase_2_0.class, "Factory Test"));
- suite.addTest(new ConfigurableTestSuite(ReadNavigationRuleTestCase_2_0.class, "Navigation Rule Test"));
- suite.addTest(new ConfigurableTestSuite(ReadManagedBeanTestCase_2_0.class, "Managed-Bean Test"));
- suite.addTest(new ConfigurableTestSuite(ReadRenderKitTestCase_2_0.class, "Render-kit Test"));
-
- Faces_base_suite(suite, testConfiguration);
- return suite;
- }
-
- private static Test Faces_1_2_suite()
- {
- TestConfiguration testConfiguration = new TestConfiguration();
- testConfiguration.put(BaseReadTestCase.CONFIG_FILE_KEY, "WEB-INF/faces-config_1_2.xml");
- testConfiguration.put(BaseReadTestCase.FACES_VERSION_KEY, IJSFCoreConstants.JSF_VERSION_1_2);
-
- TestSuite suite =
- new ConfigurableTestSuite(testConfiguration, "Faces 1.2 Model Tests");
- suite.addTest(new ConfigurableTestSuite(ReadApplicationTestCase_1_2.class, "Application Test"));
- suite.addTest(new ConfigurableTestSuite(ReadFacesConfigElementsTestCase_1_2.class,
- "Faces-config - Each Element"));
- // Factory
- suite.addTest(new ConfigurableTestSuite(ReadFactoryTestCase_1_2.class,
- "Facesconfig -Factory "));
- // Converter
- suite.addTest(new ConfigurableTestSuite(ReadConverterTestCase_1_2.class,
- "Converter Test - Single"));
- // Lifecycle
- suite.addTest(new ConfigurableTestSuite(ReadLifecycleTestCase_1_2.class,
- "Lifecycle Test - Single"));
- // Navigation
- suite.addTest(new ConfigurableTestSuite(ReadNavigationRuleTestCase_1_2.class,
- "Navigation Rule"));
- // Validator
- suite.addTest(new ConfigurableTestSuite(ReadValidatorTestCase_1_2.class,
- "Validator Test - Single"));
- // Managed Bean
- suite.addTest(new ConfigurableTestSuite(ReadManagedBeanTestCase_1_2.class,
- "Managed-Bean Test"));
- // Render-kit
- suite.addTest(new ConfigurableTestSuite(ReadRenderKitTestCase_1_2.class,
- "Render-kit Test"));
-
- Faces_base_suite(suite, testConfiguration);
- return suite;
- }
-
- private static Test Faces_1_1_suite()
- {
- TestConfiguration testConfiguration = new TestConfiguration();
- testConfiguration.put(BaseReadTestCase.CONFIG_FILE_KEY, BaseReadTestCase.CONFIG_FILE_DEFAULT);
- testConfiguration.put(BaseReadTestCase.FACES_VERSION_KEY, IJSFCoreConstants.JSF_VERSION_1_1);
-
- TestSuite suite =
- new ConfigurableTestSuite(testConfiguration, "Faces 1.1 Model Tests");
- suite.addTest(new ConfigurableTestSuite(ReadFacesConfigElementsTestCase.class,
- "Faces-config - Each Element"));
- // Application
- suite.addTest(new ConfigurableTestSuite(ReadApplicationTestCase.class,
- "Application Test"));
- // Factory
- suite.addTest(new ConfigurableTestSuite(ReadFactoryTestCase.class,
- "Facesconfig -Factory "));
- // Converter
- suite.addTest(new ConfigurableTestSuite(ReadConverterTestCase.class,
- "Converter Test - Single"));
- // Lifecycle
- suite.addTest(new ConfigurableTestSuite(ReadLifecycleTestCase.class,
- "Lifecycle Test - Single"));
- Faces_base_suite(suite, testConfiguration);
- // Navigation
- suite.addTest(new ConfigurableTestSuite(ReadNavigationRuleTestCase.class,
- "Navigation Rule"));
- // Validator
- suite.addTest(new ConfigurableTestSuite(ReadValidatorTestCase.class,
- "Validator Test - Single"));
- // Managed Bean
- suite.addTest(new ConfigurableTestSuite(ReadManagedBeanTestCase.class,
- "Managed-Bean Test"));
- // Render-kit
- suite.addTest(new ConfigurableTestSuite(ReadRenderKitTestCase.class,
- "Render-kit Test"));
-
- return suite;
- }
-
- private static void Faces_base_suite(TestSuite suite, TestConfiguration configuration)
- {
- // Component
- suite.addTest(new ConfigurableTestSuite(ReadComponentTestCase.class,
- "Component Test"));
- suite.addTest(new ConfigurableTestSuite(ReadAttributeComponentTestCase.class,
- "Component-->Attribute Test"));
- suite.addTest(new ConfigurableTestSuite(ReadFacetComponentTestCase.class,
- "Component-->Facet Test"));
- suite.addTest(new ConfigurableTestSuite(ReadPropertyComponentTestCase.class,
- "Component-->Property Test"));
-
- suite.addTest(new ConfigurableTestSuite(ReadAttributeConverterTestCase.class,
- "Converter-->Attribute Test"));
- suite.addTest(new ConfigurableTestSuite(ReadPropertyConverterTestCase.class,
- "Converter-->Property Test"));
-
- // Managed Bean
- suite.addTest(new ConfigurableTestSuite(
- ReadManagedBeanManagedPropertyTestCase.class,
- "Managed-Bean Property"));
-
- // Referenced Bean
- suite.addTest(new ConfigurableTestSuite(ReadReferencedBeanTestCase.class,
- "Referenced-Bean Test"));
-
- // Render-kit
- suite.addTest(new ConfigurableTestSuite(ReadRendererTestCase.class,
- "Render-kit-->Renderer Test"));
- suite.addTest(new ConfigurableTestSuite(ReadAttributeRendererTestCase.class,
- "Render-kit-->Renderer-->Attribute"));
- suite.addTest(new ConfigurableTestSuite(ReadFacetRendererTestCase.class,
- "Render-kit-->Renderer-->Facet"));
-
- // Validator
- suite.addTest(new ConfigurableTestSuite(ReadAttributeValidatorTestCase.class,
- "Validator-->Attribute Test - Single"));
- suite.addTest(new ConfigurableTestSuite(ReadPropertyValidatorTestCase.class,
- "Validator-->Property Test"));
-
- // Extended data
- suite.addTest(new ConfigurableTestSuite(ReadExtensionDataTestCase.class,
- "Extension Data Test 1"));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/BaseReadTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/BaseReadTestCase.java
deleted file mode 100644
index 461ef71..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/BaseReadTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.tests.util.WizardUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase;
-
-public class BaseReadTestCase extends ConfigurableTestCase
-{
- final static String CONFIG_FILE_KEY = "config-file-key";
- final static String FACES_VERSION_KEY = "faces-version-key";
- final static String CONFIG_FILE_DEFAULT = "";
-
- protected IProject project;
- protected String _facesConfigFile;
- protected String _facesVersion;
-
- public BaseReadTestCase(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- initialize(_testConfiguration);
-
- WizardUtil.createProject(getName());
- project = WizardUtil.getTestProject(getName());
- }
-
- protected FacesConfigArtifactEdit getArtifactEditForRead()
- {
- FacesConfigArtifactEdit edit = null;
-
- if (CONFIG_FILE_DEFAULT.equals(_facesConfigFile))
- {
- edit = FacesConfigArtifactEdit
- .getFacesConfigArtifactEditForRead(project, null);
- }
- else
- {
- edit = FacesConfigArtifactEdit
- .getFacesConfigArtifactEditForRead(project, _facesConfigFile);
- }
-
- assertNotNull(edit);
- return edit;
- }
-
- protected void initialize(TestConfiguration testConfiguration)
- {
- if (_testConfiguration != null)
- {
- _facesConfigFile = _testConfiguration.get(CONFIG_FILE_KEY);
- assertNotNull(_facesConfigFile);
- _facesVersion = _testConfiguration.get(FACES_VERSION_KEY);
- assertNotNull(_facesVersion);
- }
- else
- {
- // defaults to 1.1; subs should override for higher versions
- _facesConfigFile = CONFIG_FILE_DEFAULT;
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_1;
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase.java
deleted file mode 100644
index a275862..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ActionListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultRenderKitIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.LocaleConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.MessageBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationHandlerType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.StateManagerType;
-import org.eclipse.jst.jsf.facesconfig.emf.SupportedLocaleType;
-import org.eclipse.jst.jsf.facesconfig.emf.VariableResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-/*
- * This Junit class is used to test that the different of child lists
- * of Application are correctly populated.
- */
-public class ReadApplicationTestCase extends BaseReadTestCase
-{
- public ReadApplicationTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the empty navigation rule. Since
- * I am supplying a single faces-config.xml file as a testing file, I had to
- * testcases fit in to it by controlling the conditions
- *
- */
- public void testSingleApplication() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- assertEquals(1, application1.getActionListener().size());
- assertEquals(1, application1.getDefaultRenderKitId().size());
- assertEquals(1, application1.getLocaleConfig().size());
- assertEquals(1, application1.getMessageBundle().size());
- assertEquals(1, application1.getNavigationHandler().size());
- assertEquals(1, application1.getPropertyResolver().size());
- assertEquals(1, application1.getStateManager().size());
- assertEquals(1, application1.getVariableResolver().size());
- assertEquals(1, application1.getViewHandler().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- ApplicationType getApplication1(FacesConfigArtifactEdit edit)
- {
- ApplicationType application1 =
- FacesConfigModelUtil.findApplicationById
- (edit.getFacesConfig().getApplication(), "application1");
- assertNotNull(application1);
- return application1;
- }
-
- /*
- * Testing for action-listener
- *
- */
- public void testActionListener() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- ActionListenerType actionListener =
- FacesConfigModelUtil.findActionListenerById
- (application1.getActionListener(), "actionListener1");
- assertNotNull(actionListener);
- assertEquals("Action listener",
- actionListener.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for default-render-kit-id
- *
- */
- public void testDefaultRenderKitId() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- DefaultRenderKitIdType defaultRenderKit =
- FacesConfigModelUtil.findDefaultRenderKitIdTypeById
- (application1.getDefaultRenderKitId(), "defaultRenderKit1");
- assertNotNull(defaultRenderKit);
- assertEquals("some renderer kit",
- defaultRenderKit.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for a single entry of message-bundle
- *
- */
- public void testMessageBundle() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- MessageBundleType messageBundleType =
- FacesConfigModelUtil.findMessageBundleTypeById
- (application1.getMessageBundle(), "messageBundle1");
- assertNotNull(messageBundleType);
- assertEquals("some messeage bundle goes here",
- messageBundleType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for a single entry of navigation-handler
- *
- */
- public void testNavigationHandler() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- NavigationHandlerType navigationHandlerType =
- (NavigationHandlerType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getNavigationHandler(), "navigationHandler1");
- assertNotNull(navigationHandlerType);
- assertEquals("navigation handler",
- navigationHandlerType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for a single entry of view-handler
- *
- */
- public void testViewHandler() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- ViewHandlerType viewHandlerType =
- (ViewHandlerType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getViewHandler(), "viewHandler1");
- assertNotNull(viewHandlerType);
- assertEquals("view handler",
- viewHandlerType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for a single entry of state-manager
- *
- */
- public void testStateManager() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- StateManagerType stateManagerType =
- (StateManagerType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getStateManager(), "stateManager1");
- assertNotNull(stateManagerType);
- assertEquals("state manager",
- stateManagerType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * Testing for the variable-resolver
- */
-
- public void testSingleVariableResolver() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- VariableResolverType variableResolverType =
- (VariableResolverType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getVariableResolver(), "variableResolver1");
- assertNotNull(variableResolverType);
- assertEquals("com.ibm.faces.databind.SelectItemsVarResolver",
- variableResolverType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for the property-resolver
- */
- public void testSinglePropertyResolver() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- PropertyResolverType propertyResolverType =
- (PropertyResolverType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getPropertyResolver(), "propertyResolver1");
- assertNotNull(propertyResolverType);
- assertEquals("com.ibm.faces.databind.SelectItemsPropResolver",
- propertyResolverType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for the local-config within an application
- */
- public void testLocalConfig() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- LocaleConfigType localeConfigType =
- (LocaleConfigType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getLocaleConfig(), "localeConfig1");
- assertNotNull(localeConfigType);
-
- assertEquals("en", localeConfigType.getDefaultLocale().getTextContent());
- assertEquals("defaultLocale1", localeConfigType.getDefaultLocale().getId());
-
- assertEquals(2, localeConfigType.getSupportedLocale().size());
-
- SupportedLocaleType supportedLocaleType =
- (SupportedLocaleType)
- FacesConfigModelUtil.findEObjectElementById(
- localeConfigType.getSupportedLocale(),
- "supportedLocale_en");
- assertNotNull(supportedLocaleType);
- assertEquals("en", supportedLocaleType.getTextContent().trim());
-
- supportedLocaleType =
- (SupportedLocaleType)
- FacesConfigModelUtil.findEObjectElementById(
- localeConfigType.getSupportedLocale(),
- "supportedLocale_de");
- assertNotNull(supportedLocaleType);
- assertEquals("de", supportedLocaleType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_1_2.java
deleted file mode 100644
index 9f463f4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_1_2.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.BaseNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.ELResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.VarType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadApplicationTestCase_1_2 extends ReadApplicationTestCase {
-
- public ReadApplicationTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testELResolver()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- ELResolverType elResolverType =
- (ELResolverType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getELResolver(), "el-resolver-id");
- assertNotNull(elResolverType);
- assertEquals("com.test.MyELResolver",
- elResolverType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testResourceBundle()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- ResourceBundleType resourceBundle =
- (ResourceBundleType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getResourceBundle(), "resourceBundleId1");
- assertNotNull(resourceBundle);
-
- // test descriptioni
- {
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil.findEObjectElementById
- (resourceBundle.getDescription(), "resourceBundleDesc");
- assertEquals("Resource Bundle description blah"
- , descType.getTextContent());
- }
- // test displayname
- {
- DisplayNameType displayNameType =
- (DisplayNameType) FacesConfigModelUtil.findEObjectElementById
- (resourceBundle.getDisplayName(), "resourceBundleDisplayName");
- assertEquals("Resource Bundle display name blah"
- , displayNameType.getTextContent());
- }
- // test icon
- {
- IconType iconType =
- (IconType) FacesConfigModelUtil.findEObjectElementById
- (resourceBundle.getIcon(), "resourceBundleId");
- assertEquals("resourceBundle-smallIcon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("resourceBundle-largeIcon"
- , iconType.getLargeIcon().getTextContent());
- }
-
- BaseNameType baseName = resourceBundle.getBaseName();
- assertNotNull(baseName);
- assertEquals("com.test.Bundle", baseName.getTextContent());
-
- VarType var = resourceBundle.getVar();
- assertNotNull(var);
- assertEquals("bundleVar", var.getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testApplicationExtension()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- ApplicationExtensionType applicationExt =
- (ApplicationExtensionType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getApplicationExtension(), "applicatinExtension1");
- assertNotNull(applicationExt);
- assertEquals(1,
- applicationExt.getChildNodes().size());
- DynamicElement element =
- (DynamicElement) applicationExt.getChildNodes().get(0);
- assertEquals("some-extension-data", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_2_0.java
deleted file mode 100644
index 58edf16..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadApplicationTestCase_2_0.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultValidatorsType;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceHandlerType;
-import org.eclipse.jst.jsf.facesconfig.emf.SourceClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.SystemEventClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.SystemEventListenerClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.SystemEventListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorIdType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadApplicationTestCase_2_0 extends ReadApplicationTestCase_1_2 {
-
- public ReadApplicationTestCase_2_0(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_2_0.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_2_0;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
-// public void testPartialTraversal()
-// {
-// FacesConfigArtifactEdit edit = null;
-// try {
-// edit = getArtifactEditForRead();
-// assertNotNull(edit.getFacesConfig());
-// ApplicationType application1 = getApplication1(edit);
-// PartialTraversalType partialTraversal =
-// (PartialTraversalType)
-// FacesConfigModelUtil.findEObjectElementById
-// (application1.getPartialTraversal(), "partial-traversal-id");
-// assertNotNull(partialTraversal);
-// assertEquals("com.test.MyPartialTraversal",
-// partialTraversal.getTextContent().trim());
-// } finally {
-// if (edit != null) {
-// edit.dispose();
-// }
-// }
-// }
-
- public void testResourceHandler()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- ResourceHandlerType resourceHandler =
- (ResourceHandlerType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getResourceHandler(), "resource-handler-id");
- assertNotNull(resourceHandler);
- assertEquals("com.test.MyResourceHandler",
- resourceHandler.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testSystemEventListener()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- SystemEventListenerType systemEventListener =
- (SystemEventListenerType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getSystemEventListener(), "system-event-listener-id");
- assertNotNull(systemEventListener);
-
- SystemEventListenerClassType systemEventListenerClass = systemEventListener.getSystemEventListenerClass();
-// (SystemEventListenerClassType)
-// FacesConfigModelUtil.findEObjectElementById
-// (systemEventListener.getSystemEventListenerClass(), "system-event-listener-class-id");
- assertNotNull(systemEventListenerClass);
- assertEquals("com.test.MySystemEventListener",
- systemEventListenerClass.getTextContent().trim());
-
- SystemEventClassType systemEventClass = systemEventListener.getSystemEventClass();
-// (SystemEventClassType)
-// FacesConfigModelUtil.findEObjectElementById
-// (systemEventListener.getSystemEventClass(), "system-event-class-id");
- assertNotNull(systemEventClass);
- assertEquals("com.test.MySystemEvent",
- systemEventClass.getTextContent().trim());
-
- SourceClassType sourceClass = systemEventListener.getSourceClass();
-// (SourceClassType)
-// FacesConfigModelUtil.findEObjectElementById
-// (systemEventListener.getSourceClass(), "source-class-id");
- assertNotNull(sourceClass);
- assertEquals("com.test.MySource",
- sourceClass.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValidator()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ApplicationType application1 = getApplication1(edit);
- DefaultValidatorsType defaultValidators =
- (DefaultValidatorsType)
- FacesConfigModelUtil.findEObjectElementById
- (application1.getDefaultValidators(), "default-validators-id");
- assertNotNull(defaultValidators);
- ValidatorIdType validatorId =
- (ValidatorIdType)
- FacesConfigModelUtil.findEObjectElementById
- (defaultValidators.getValidatorId(), "validator-id-id");
- assertNotNull(validatorId);
- assertEquals("MyValidator",
- validatorId.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeComponentTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeComponentTestCase.java
deleted file mode 100644
index 5497767..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeComponentTestCase.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This clas is used to test the Attribute inside Component Element
- *
- */
-public class ReadAttributeComponentTestCase extends BaseReadTestCase {
-
- public ReadAttributeComponentTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the existence of a single
- * attribute in the Compoenent Element. While testing I had just one with
- * everything (all children) inside it
- */
- public void testSingleAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ComponentType getComponent1(FacesConfigType facesConfigType)
- {
- return (ComponentType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfigType.getComponent(), "component1");
- }
-
- private AttributeType getAttribute1(FacesConfigType facesConfigType)
- {
- ComponentType component1 = getComponent1(facesConfigType);
- assertNotNull(component1);
- return (AttributeType) FacesConfigModelUtil
- .findEObjectElementById
- (component1.getAttribute(), "componentAttribute1");
- }
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDescription()
- ,"componentAttribute1_descripton1");
- assertEquals("attribute-description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDisplayName()
- ,"componentAttribute1_displayName1");
- assertEquals("attribute-display-name"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attrType = getAttribute1(edit.getFacesConfig());
- assertNotNull(attrType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (attrType.getIcon(), "componentAttribute1_icon1");
- assertNotNull(iconType);
-
- assertEquals("attribute-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("attribute-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testAttributeNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
-
- assertEquals("attribute-name"
- ,attribute1.getAttributeName().getTextContent());
- assertEquals("attribute-class"
- ,attribute1.getAttributeClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("attribute-suggested-value"
- ,attributeType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("value5"
- , attributeType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
- public void testAttributeExtension() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- if (edit.getFacesConfig() != null) {
- EList comp = edit.getFacesConfig().getComponent();
- assertTrue(!comp.isEmpty());
- for (int i = 0; i < comp.size(); i++) {
- ComponentType compType = (ComponentType) comp
- .get(i);
- assertTrue(!compType.getAttribute().isEmpty());
-
- EList attr = compType.getAttribute();
- for (int k = 0; k < attr.size(); k++) {
- AttributeType attrType = (AttributeType) attr.get(k);
- EList ext= attrType.getAttributeExtension();
- assertTrue(ext.size()!=0);
- }
- }
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeConverterTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeConverterTestCase.java
deleted file mode 100644
index b898ad3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeConverterTestCase.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test for the existence of all
- * items with in attribute of the Converter Element
- *
- */
-public class ReadAttributeConverterTestCase extends BaseReadTestCase {
-
- public ReadAttributeConverterTestCase(String name) {
- super(name);
- }
-
- /*
- * checks to see if there exists an atribute in the first place
- *
- */
- public void testSingleAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private AttributeType getAttribute1(FacesConfigType facesConfig)
- {
- ConverterType converter1 =
- (ConverterType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getConverter(), "converter1");
- assertNotNull(converter1);
-
- return (AttributeType)
- FacesConfigModelUtil
- .findEObjectElementById(converter1.getAttribute()
- , "converter1Attribute");
- }
-
-
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDescription()
- ,"converter1_attribute_description");
- assertEquals("converter-attribute-description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDisplayName()
- ,"converter1_attribute_display-name");
- assertEquals("converter-attribute-display-name"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attrType = getAttribute1(edit.getFacesConfig());
- assertNotNull(attrType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (attrType.getIcon(), "converter1_attribute_icon");
- assertNotNull(iconType);
-
- assertEquals("converter1-attribute-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("converter1-attribute-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testAttributeNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
-
- assertEquals("converter1-attribute-name"
- ,attribute1.getAttributeName().getTextContent());
- assertEquals("converter1-attribute-class"
- ,attribute1.getAttributeClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("converter1-attribute-suggested-value"
- ,attributeType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("converter1-default-value"
- , attributeType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
- public void testAttributeExtension() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- if (edit.getFacesConfig() != null) {
- EList comp = edit.getFacesConfig().getComponent();
- assertTrue(!comp.isEmpty());
- for (int i = 0; i < comp.size(); i++) {
- ComponentType compType = (ComponentType) comp
- .get(i);
- assertTrue(!compType.getAttribute().isEmpty());
-
- EList attr = compType.getAttribute();
- for (int k = 0; k < attr.size(); k++) {
- AttributeType attrType = (AttributeType) attr.get(k);
- EList ext= attrType.getAttributeExtension();
- assertTrue(ext.size()!=0);
- }
- }
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeRendererTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeRendererTestCase.java
deleted file mode 100644
index e576458..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeRendererTestCase.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadAttributeRendererTestCase extends BaseReadTestCase {
-
- public ReadAttributeRendererTestCase(String name) {
- super(name);
- }
-
- /*
- * checks to see if there exists an atribute in the first place
- *
- */
- public void testSingleAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private AttributeType getAttribute1(FacesConfigType facesConfig)
- {
- RenderKitType renderKit =
- (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfig.getRenderKit(), "renderKit1");
- assertNotNull(renderKit);
-
- RendererType renderer =
- (RendererType) FacesConfigModelUtil
- .findEObjectElementById
- (renderKit.getRenderer(), "renderKit1Renderer");
- assertNotNull(renderer);
-
- return (AttributeType) FacesConfigModelUtil
- .findEObjectElementById
- (renderer.getAttribute(), "renderKit1RendererAttribute1");
- }
-
-
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDescription()
- ,"renderKit1RendererAttribute1Description");
- assertEquals("renderer-attribute-attribute-description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDisplayName()
- ,"renderKit1RendererAttribute1DisplayName");
- assertEquals("renderer-attribute-display-name"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attrType = getAttribute1(edit.getFacesConfig());
- assertNotNull(attrType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (attrType.getIcon(), "renderKit1RendererAttribute1Icon");
- assertNotNull(iconType);
-
- assertEquals("renderer-attribute-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("renderer-attribute-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testAttributeNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
-
- assertEquals("renderer attribute name"
- ,attribute1.getAttributeName().getTextContent());
- assertEquals("renderer Attribute Class"
- ,attribute1.getAttributeClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("renderer attribute suggested value"
- ,attributeType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("renderer attribute default value"
- , attributeType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
- public void testAttributeExtension() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- if (edit.getFacesConfig() != null) {
- EList comp = edit.getFacesConfig().getComponent();
- assertTrue(!comp.isEmpty());
- for (int i = 0; i < comp.size(); i++) {
- ComponentType compType = (ComponentType) comp
- .get(i);
- assertTrue(!compType.getAttribute().isEmpty());
-
- EList attr = compType.getAttribute();
- for (int k = 0; k < attr.size(); k++) {
- AttributeType attrType = (AttributeType) attr.get(k);
- EList ext= attrType.getAttributeExtension();
- assertTrue(ext.size()!=0);
- }
- }
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeValidatorTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeValidatorTestCase.java
deleted file mode 100644
index cbdf4d3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadAttributeValidatorTestCase.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test Attibute part in the Validator Element
- *
- */
-public class ReadAttributeValidatorTestCase extends BaseReadTestCase {
-
- public ReadAttributeValidatorTestCase(String name) {
- super(name);
- }
-
- /*
- * checks to see if there exists an atribute in the first place
- *
- */
- public void testSingleAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private AttributeType getAttribute1(FacesConfigType facesConfig)
- {
- ValidatorType validator1 =
- (ValidatorType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getValidator(), "validator1");
- assertNotNull(validator1);
-
- return (AttributeType)
- FacesConfigModelUtil
- .findEObjectElementById(validator1.getAttribute()
- , "validator1_attribute");
- }
-
-
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDescription()
- ,"validator1_attribute_description");
- assertEquals("validator-attribute-description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
- assertNotNull(attributeType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (attributeType.getDisplayName()
- ,"validator1_attribute_displayName");
- assertEquals("validator-attribute-display-name"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attrType = getAttribute1(edit.getFacesConfig());
- assertNotNull(attrType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (attrType.getIcon(), "validator1_attribute_icon");
- assertNotNull(iconType);
-
- assertEquals("validator-attribute-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("validator-attribute-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testAttributeNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attribute1 = getAttribute1(edit.getFacesConfig());
- assertNotNull(attribute1);
-
- assertEquals("validator-attribute-name"
- ,attribute1.getAttributeName().getTextContent());
- assertEquals("validator-attribute-class"
- ,attribute1.getAttributeClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("validator-attribute-suggested-value"
- ,attributeType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AttributeType attributeType =
- getAttribute1(edit.getFacesConfig());
-
- assertEquals("validator-default-value"
- , attributeType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
- public void testAttributeExtension() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- if (edit.getFacesConfig() != null) {
- EList comp = edit.getFacesConfig().getComponent();
- assertTrue(!comp.isEmpty());
- for (int i = 0; i < comp.size(); i++) {
- ComponentType compType = (ComponentType) comp
- .get(i);
- assertTrue(!compType.getAttribute().isEmpty());
-
- EList attr = compType.getAttribute();
- for (int k = 0; k < attr.size(); k++) {
- AttributeType attrType = (AttributeType) attr.get(k);
- EList ext= attrType.getAttributeExtension();
- assertTrue(ext.size()!=0);
- }
- }
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadComponentTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadComponentTestCase.java
deleted file mode 100644
index a3bcc41..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadComponentTestCase.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test for Component with in faces-config
- * root Element.
- *
- */
-public class ReadComponentTestCase extends BaseReadTestCase {
-
- public ReadComponentTestCase(String name) {
- super(name);
- }
-
- /*
- * assert there is at least one Component listed
- */
- public void testSingleComponent() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertNotNull(getComponent1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ComponentType getComponent1(FacesConfigType facesConfig)
- {
- return (ComponentType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getComponent(), "component1");
- }
-
- // Test for the Descirption
- public void testNonEmptyDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- final ComponentType component1 =
- getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- final DescriptionType descriptionType =
- (DescriptionType) FacesConfigModelUtil.
- findEObjectElementById
- (component1.getDescription(), "componentDescription1");
- assertNotNull(descriptionType);
- assertEquals("my component", descriptionType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- *Check for the Display name
- *
- */
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- final ComponentType component1 =
- getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- final DisplayNameType displayNameType =
- (DisplayNameType) FacesConfigModelUtil.
- findEObjectElementById
- (component1.getDisplayName(), "componentDisplayName1");
- assertNotNull(displayNameType);
- assertEquals("My component", displayNameType.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * get the icon of a compnent
- *
- */
- public void testNonEmptyIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- final ComponentType component1 =
- getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- final IconType iconType =
- (IconType) FacesConfigModelUtil.
- findEObjectElementById
- (component1.getIcon(), "componentIcon1");
- assertNotNull(iconType);
-
- assertEquals("small-icon",
- iconType.getSmallIcon().getTextContent().trim());
- assertEquals("large-icon",
- iconType.getLargeIcon().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * check to see there is the Component-type and the Component-class
- */
- public void testNonEmptyComponentTypeAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull (edit.getFacesConfig());
- ComponentType component1 = getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- assertEquals("component-type", component1.getComponentType().getTextContent());
- assertEquals("ComponentClass", component1.getComponentClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /**
- * check for the attribute part of the Component
- * @see ReadAttributeComponentTestCase for the full test of the
- * component attributes
- */
- public void testAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull (edit.getFacesConfig());
- ComponentType component1 = getComponent1(edit.getFacesConfig());
-
- // full testing of attribute is in ReadAttributeComponentTestCase
- assertEquals(1, component1.getAttribute().size());
- assertEquals("componentAttribute1",
- ((AttributeType)component1.getAttribute().get(0)).getId());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * check to see there is property listed in the input file
- * @see ReadPropertyComponentTestCase for full test of component
- * property
- */
- public void testProperty() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ComponentType component1 = getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- assertEquals(1, component1.getProperty().size());
- assertEquals("componentProperty1", ((PropertyType)component1.getProperty().get(0)).getId());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testFacet()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ComponentType component1 = getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- assertEquals(1, component1.getFacet().size());
- assertEquals("componentFacet1", ((FacetType)component1.getFacet().get(0)).getId());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Check for hte Component-Extension inside Component
- */
-
- public void testComponentExtension() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ComponentType component1 = getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- ComponentExtensionType extType =
- (ComponentExtensionType) FacesConfigModelUtil
- .findEObjectElementById(component1.getComponentExtension()
- , "componentExtension1");
- assertNotNull(extType);
- //assertEquals("component-extension", extType.getAny().get(0));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase.java
deleted file mode 100644
index 5257508..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the Converter which is one of
- * many items inside the root elemnt faces-config in the configuration
- * information hierarchy of the faces-config.xml file
- *
- */
-public class ReadConverterTestCase extends BaseReadTestCase {
- public ReadConverterTestCase(String name) {
- super(name);
- }
-
- /*
- * Check to see if this element exists. There sould be at least one
- * of such kind listed in the file.
- */
- public void testSingleConverter() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertNotNull(getConverter1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- ConverterType getConverter1(FacesConfigType facesConfig)
- {
- return
- (ConverterType) FacesConfigModelUtil.
- findEObjectElementById
- (facesConfig.getConverter(), "converter1");
- }
-
- private ConverterType getConverter2(FacesConfigType facesConfig)
- {
-
- return
- (ConverterType) FacesConfigModelUtil.
- findEObjectElementById
- (facesConfig.getConverter(), "converter2");
- }
-
- // Test for the Descirption
- public void testDescriptionGroup() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ConverterType converter1 = getConverter1(edit.getFacesConfig());
- assertNotNull(converter1);
-
- // test descriptioni
- {
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil.findEObjectElementById
- (converter1.getDescription(), "converter1Description");
- assertEquals("converter-description"
- , descType.getTextContent());
- }
- // test displayname
- {
- DisplayNameType displayNameType =
- (DisplayNameType) FacesConfigModelUtil.findEObjectElementById
- (converter1.getDisplayName(), "converter1DisplayName");
- assertEquals("converter-display-name"
- , displayNameType.getTextContent());
- }
- // test icon
- {
- IconType iconType =
- (IconType) FacesConfigModelUtil.findEObjectElementById
- (converter1.getIcon(), "converter1Icon");
- assertEquals("converter-small-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("converter-large-icon"
- , iconType.getLargeIcon().getTextContent());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testValidatorSingleValueProperties() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- // we need two different converters because converter-for-class
- // and converter-id are mutually exclusive
- final ConverterType converter1 = getConverter1(edit.getFacesConfig());
- assertNotNull(converter1);
-
- assertEquals("converter-for-class"
- , converter1.getConverterForClass().getTextContent());
- assertEquals("converter-class"
- , converter1.getConverterClass().getTextContent());
-
- final ConverterType converter2 = getConverter2(edit.getFacesConfig());
- assertNotNull(converter2);
-
- assertEquals("converter2-id"
- , converter2.getConverterId().getTextContent());
- assertEquals("converter2-class"
- , converter2.getConverterClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Test the attribute sub-property of validators.
- * Note: the attribute itself is tested in ReadAttributeConverterTestCase
- * this test case just tests the presence of the attribute
- */
- public void testAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ConverterType converter1 = getConverter1(edit.getFacesConfig());
- assertEquals(1, converter1.getAttribute().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Test the property sub-property of validators
- * Note: the attribute itself is tested in ReadPropertyConverterTestCase
- * this test case just tests for the presence of the property
- */
- public void testProperty() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ConverterType converter1 = getConverter1(edit.getFacesConfig());
- assertEquals(1, converter1.getProperty().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase_1_2.java
deleted file mode 100644
index e09a992..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadConverterTestCase_1_2.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadConverterTestCase_1_2 extends ReadConverterTestCase
-{
- public ReadConverterTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testConverterExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ConverterType converter1 = getConverter1(edit.getFacesConfig());
- assertNotNull(converter1);
-
- assertEquals(1, converter1.getConverterExtension().size());
- ConverterExtensionType converterExtensionType =
- (ConverterExtensionType) converter1.getConverterExtension().get(0);
- assertEquals(1, converterExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) converterExtensionType.getChildNodes().get(0);
- assertEquals("converter-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadExtensionDataTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadExtensionDataTestCase.java
deleted file mode 100644
index 515bd03..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadExtensionDataTestCase.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicAttribute;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * Read test for extension data
- *
- * @author cbateman
- *
- */
-public class ReadExtensionDataTestCase extends BaseReadTestCase
-{
- public ReadExtensionDataTestCase(String name) {
- super(name);
- }
-
- /*
- * Check for hte Component-Extension inside Component
- */
-
- public void testSingleElementRoot() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = FacesConfigArtifactEdit
- .getFacesConfigArtifactEditForRead(project,
- "WEB-INF/faces-config-ext-data1.xml");
- assertNotNull(edit.getFacesConfig());
- ComponentType component1 = getComponent1(edit.getFacesConfig());
- assertNotNull(component1);
-
- ComponentExtensionType extType =
- (ComponentExtensionType) FacesConfigModelUtil
- .findEObjectElementById(component1.getComponentExtension()
- , "singleRootComponentExt");
- assertNotNull(extType);
- List elements = extType.getChildNodes();
- assertEquals(1, elements.size());
- DynamicElement singleRoot = (DynamicElement) elements.get(0);
- assertEquals("any-data", singleRoot.getName());
-
- assertEquals(1, singleRoot.getAttributes().size());
- DynamicAttribute attribute =
- (DynamicAttribute) singleRoot.getAttributes().get(0);
- assertEquals("attribute", attribute.getName());
- assertEquals("any-data-attribute", attribute.getValue());
-
- assertEquals(2, singleRoot.getChildNodes().size());
-
- DynamicElement firstChild =
- (DynamicElement) singleRoot.getChildNodes().get(0);
- assertEquals("first-child", firstChild.getName());
- assertEquals("someData", firstChild.getTextContent());
-
- DynamicElement secondChild =
- (DynamicElement) singleRoot.getChildNodes().get(1);
- assertEquals("second-child", secondChild.getName());
- assertEquals("second Child's data", secondChild.getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ComponentType getComponent1(FacesConfigType facesConfig)
- {
- return (ComponentType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getComponent(), "component1");
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase.java
deleted file mode 100644
index 3ee50a7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the FacesConfigFactoryImpl
- * class.
- *
- */
-public class ReadFacesConfigElementsTestCase extends BaseReadTestCase {
-
- public ReadFacesConfigElementsTestCase(String name) {
- super(name);
- }
-
- /*
- * Test the applicaion element of faces-config.xml
- *
- */
- public final void testApplication() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getApplication().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Test the factory element of faces-config.xml
- *
- */
- public final void testFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getFactory().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
- /*
- * Test the component element of faces-config.xml
- *
- */
- public final void testComponent() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getComponent().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Test the managed-bean element of faces-config.xml
- *
- */
- public final void testManagedBean() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(3, edit.getFacesConfig().getManagedBean().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * Test the referenced-bean element of faces-config.xml
- *
- */
- public final void testReferencedBean() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getReferencedBean().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * Test the render-kit element of faces-config.xml
- *
- */
- public final void testRenderKit() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getRenderKit().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
- /*
- * Testing for the validator elment of the config file
- */
-
- public final void testValidator() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getValidator().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Testing for the converter elment of the config file
- */
-
- public final void testConverter() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(2, edit.getFacesConfig().getConverter().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Testing for the navigation rule list population
- */
- public final void testNavigationRule()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(2, edit.getFacesConfig().getNavigationRule().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Testing for the lifecycle list population
- */
- public final void testLifecycle()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getLifecycle().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_1_2.java
deleted file mode 100644
index fa596ac..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_1_2.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigExtensionType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadFacesConfigElementsTestCase_1_2 extends
- ReadFacesConfigElementsTestCase
-{
- public ReadFacesConfigElementsTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testFacesConfigExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getFacesConfigExtension().size());
- FacesConfigExtensionType facesConfigExt =
- (FacesConfigExtensionType) edit.getFacesConfig().getFacesConfigExtension().get(0);
- assertEquals(1, facesConfigExt.getChildNodes().size());
- DynamicElement element = (DynamicElement) facesConfigExt.getChildNodes().get(0);
- assertEquals("faces-config-extended-data", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_2_0.java
deleted file mode 100644
index 0652b43..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacesConfigElementsTestCase_2_0.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.AbsoluteOrderingType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultValueType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.NameType;
-import org.eclipse.jst.jsf.facesconfig.emf.OrderingOrderingType;
-import org.eclipse.jst.jsf.facesconfig.emf.OrderingType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.SuggestedValueType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadFacesConfigElementsTestCase_2_0 extends
- ReadFacesConfigElementsTestCase
-{
- public ReadFacesConfigElementsTestCase_2_0(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_2_0.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_2_0;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public final void testOrdering() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getOrdering().size());
-
- OrderingType ordering = (OrderingType)edit.getFacesConfig().getOrdering().get(0);
-// (OrderingType)
-// FacesConfigModelUtil.findEObjectElementById
-// (edit.getFacesConfig().getOrdering(), "ordering-id");
- assertNotNull(ordering);
-
- OrderingOrderingType after = ordering.getAfter();
- assertNotNull(after);
- assertNotNull(after.getName());
- assertEquals("afterName", ((NameType)after.getName().get(0)).getTextContent().trim());
- assertNotNull(after.getOthers());
- assertEquals("after-others-id", after.getOthers().getId().trim());
-
- OrderingOrderingType before = ordering.getBefore();
- assertNotNull(before);
- assertNotNull(before.getName());
- assertEquals("beforeName", ((NameType)before.getName().get(0)).getTextContent().trim());
- assertNotNull(before.getOthers());
- assertEquals("before-others-id", before.getOthers().getId().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public final void testAbsoluteOrdering() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- AbsoluteOrderingType absoluteOrdering = edit.getFacesConfig().getAbsoluteOrdering();
- assertNotNull(absoluteOrdering);
-
- assertNotNull(absoluteOrdering.getName());
- assertEquals("absoluteOrderingName", ((NameType)absoluteOrdering.getName().get(0)).getTextContent().trim());
- assertNotNull(absoluteOrdering.getOthers());
- assertEquals("absolute-ordering-others-id", absoluteOrdering.getOthers().getId().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public final void testName() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertNotNull(edit.getFacesConfig().getName());
- assertEquals("facesconfigName", edit.getFacesConfig().getName().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public final void testBehavior() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getBehavior().size());
-
- BehaviorType behavior = (BehaviorType)edit.getFacesConfig().getBehavior().get(0);
-// (BehaviorType)
-// FacesConfigModelUtil.findEObjectElementById
-// (edit.getFacesConfig().getBehavior(), "behavior-id");
- assertNotNull(behavior);
-
- DescriptionType descriptionType = (DescriptionType) FacesConfigModelUtil.
- findEObjectElementById(behavior.getDescription(), "behaviorDescription1");
- assertNotNull(descriptionType);
- assertEquals("my behavior", descriptionType.getTextContent().trim());
-
- final DisplayNameType displayNameType =
- (DisplayNameType) FacesConfigModelUtil.
- findEObjectElementById(behavior.getDisplayName(), "behaviorDisplayName1");
- assertNotNull(displayNameType);
- assertEquals("My behavior", displayNameType.getTextContent().trim());
-
- final IconType iconType =
- (IconType) FacesConfigModelUtil.
- findEObjectElementById(behavior.getIcon(), "behaviorIcon1");
- assertNotNull(iconType);
-
- assertEquals("small-icon", iconType.getSmallIcon().getTextContent().trim());
- assertEquals("large-icon", iconType.getLargeIcon().getTextContent().trim());
-
- assertEquals("behavior-id-id", behavior.getBehaviorId().getTextContent().trim());
- assertEquals("behavior-class", behavior.getBehaviorClass().getTextContent().trim());
- assertEquals(1, behavior.getAttribute().size());
- assertEquals(1, behavior.getProperty().size());
-
- assertEquals(1, behavior.getBehaviorExtension().size());
- BehaviorExtensionType behaviorExtensionType =
- (BehaviorExtensionType) behavior.getBehaviorExtension().get(0);
- assertEquals(2, behaviorExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) behaviorExtensionType.getChildNodes().get(0);
- assertEquals("a", element.getName());
- element = (DynamicElement) behaviorExtensionType.getChildNodes().get(1);
- assertEquals("behavior-extension-tag", element.getName());
-
- //behavior attrs
- assertEquals(1,behavior.getAttribute().size());
- AttributeType attr = (AttributeType)behavior.getAttribute().get(0);
- assertNotNull(attr);
- AttributeNameType attrName = attr.getAttributeName();
- assertEquals("behavior1AttributeName", attrName.getId());
- assertEquals("behavior1AttributeName", attrName.getTextContent());
- AttributeClassType attrClass = attr.getAttributeClass();
- assertEquals("behavior1AttributeClass", attrClass.getId());
- assertEquals("behavior1AttributeClass", attrClass.getTextContent());
- List<DescriptionType> descs = attr.getDescription();
- assertEquals(2, descs.size());
- DescriptionType desc = (DescriptionType)descs.get(0);
- assertEquals("behavior1AttributeDescription1", desc.getId());
- assertEquals("behavior1AttributeDescription1", desc.getTextContent());
- List<DisplayNameType> disps= attr.getDisplayName();
- assertEquals(2, disps.size());
- DisplayNameType disp = (DisplayNameType)disps.get(0);
- assertEquals("behavior1AttributeDisplayName1", disp.getId());
- assertEquals("fr", disp.getLang());
- assertEquals("behavior1AttributeDisplayName1", disp.getTextContent());
- List<IconType> icons = attr.getIcon();
- assertEquals(1, icons.size());
- IconType icon = (IconType)icons.get(0);
- assertEquals("behavior1AttributeSmallIcon", icon.getSmallIcon().getTextContent());
- assertEquals("behavior1AttributeLargeIcon", icon.getLargeIcon().getTextContent());
- DefaultValueType defVal = attr.getDefaultValue();
- assertNotNull(defVal);
- assertEquals("behavior1AttributeDefaultValue", defVal.getId());
- assertEquals("behavior1AttributeDefaultValue", defVal.getTextContent());
- SuggestedValueType sugVal = attr.getSuggestedValue();
- assertNotNull(sugVal);
- assertEquals("behavior1AttributeSuggestedValue", sugVal.getId());
- assertEquals("behavior1AttributeSuggestedValue", sugVal.getTextContent());
- List<AttributeExtensionType> attrExts = attr.getAttributeExtension();
- assertEquals(2, attrExts.size());
- AttributeExtensionType attrExt = (AttributeExtensionType)attrExts.get(0);
- assertEquals("behavior1AttributeExtension1", attrExt.getId());
-// assertEquals("<a>B</a>", attrExt.getTextContent()); //NOT WORKING
- assertEquals(1, attrExt.getChildNodes().size());
-
- //behavior props
- List<PropertyType> props = behavior.getProperty();
- assertEquals(1, props.size());
- PropertyType prop = (PropertyType)props.get(0);
- assertEquals("behavior1Property", prop.getId());
- assertNull(prop.getDefaultValue());
- assertEquals(1, prop.getDescription().size());
- desc = (DescriptionType)prop.getDescription().get(0);
- assertNull(desc.getId());
- assertEquals("behavior1PropertyDescription", desc.getTextContent());
- disp = (DisplayNameType)prop.getDisplayName().get(0);
- assertNull(disp.getId());
- assertEquals("behavior1PropertyDisplayName", disp.getTextContent());
- assertEquals(1, prop.getIcon().size());
- icon = (IconType)prop.getIcon().get(0);
- assertEquals("behavior1PropertySmallIcon", icon.getSmallIcon().getId());
- assertEquals("behavior1PropertySmallIcon", icon.getSmallIcon().getTextContent());
- assertEquals("behavior1PropertyName", prop.getPropertyName().getTextContent());
- assertEquals("behavior1PropertyClass", prop.getPropertyClass().getTextContent());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public final void testMetadataComplete() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(true, edit.getFacesConfig().isMetadataComplete());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetComponentTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetComponentTestCase.java
deleted file mode 100644
index 8cefa8a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetComponentTestCase.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * Test the FacetType on a ComponentType
- *
- * @author cbateman
- *
- */
-public class ReadFacetComponentTestCase extends BaseReadTestCase {
-
- public ReadFacetComponentTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the existence of a single
- * attribute in the Compoenent Element. While testing I had just one with
- * everything (all children) inside it
- */
- public void testSingleFacet() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facet1 = getFacet1(edit.getFacesConfig());
- assertNotNull(facet1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ComponentType getComponent1(FacesConfigType facesConfigType)
- {
- return (ComponentType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfigType.getComponent(), "component1");
- }
-
- private FacetType getFacet1(FacesConfigType facesConfigType)
- {
- ComponentType component1 = getComponent1(facesConfigType);
- assertNotNull(component1);
- return (FacetType) FacesConfigModelUtil
- .findEObjectElementById
- (component1.getFacet(), "componentFacet1");
- }
-
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facetType =
- getFacet1(edit.getFacesConfig());
- assertNotNull(facetType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (facetType.getDescription()
- ,"componentFacet1_descripton1");
- assertEquals("Facet1 Description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facetType =
- getFacet1(edit.getFacesConfig());
- assertNotNull(facetType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (facetType.getDisplayName()
- ,"componentFacet1_displayName1");
- assertEquals("Component Facet 1"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facetType = getFacet1(edit.getFacesConfig());
- assertNotNull(facetType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (facetType.getIcon(), "componentFacet1_icon1");
- assertNotNull(iconType);
-
- assertEquals("facet-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("facet-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- *
- */
- public void testFacetName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facet1 = getFacet1(edit.getFacesConfig());
- assertNotNull(facet1);
-
- assertEquals("facetName_chieb_sieb"
- ,facet1.getFacetName().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetRendererTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetRendererTestCase.java
deleted file mode 100644
index a47d49d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFacetRendererTestCase.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadFacetRendererTestCase extends BaseReadTestCase {
-
- public ReadFacetRendererTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the existence of a single
- * attribute in the Compoenent Element. While testing I had just one with
- * everything (all children) inside it
- */
- public void testSingleFacet() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facet1 = getFacet1(edit.getFacesConfig());
- assertNotNull(facet1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private FacetType getFacet1(FacesConfigType facesConfigType)
- {
- RenderKitType renderKit =
- (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfigType.getRenderKit(), "renderKit1");
- assertNotNull(renderKit);
-
- RendererType renderer =
- (RendererType) FacesConfigModelUtil
- .findEObjectElementById
- (renderKit.getRenderer(), "renderKit1Renderer");
- assertNotNull(renderer);
-
- return (FacetType) FacesConfigModelUtil
- .findEObjectElementById
- (renderer.getFacet(), "renderKit1Renderer1Facet1");
- }
-
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facetType =
- getFacet1(edit.getFacesConfig());
- assertNotNull(facetType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (facetType.getDescription()
- ,"renderKit1Renderer1Facet1Description");
- assertEquals("RendererFacetDescription"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facetType =
- getFacet1(edit.getFacesConfig());
- assertNotNull(facetType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (facetType.getDisplayName()
- ,"renderKit1Renderer1Facet1DisplayName");
- assertEquals("RendererFacetDisplayName"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facetType = getFacet1(edit.getFacesConfig());
- assertNotNull(facetType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (facetType.getIcon(), "renderKit1Renderer1Facet1Icon");
- assertNotNull(iconType);
-
- assertEquals("facet-renderer-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("facet-renderer-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- *
- */
- public void testFacetName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacetType facet1 = getFacet1(edit.getFacesConfig());
- assertNotNull(facet1);
-
- assertEquals("rendererFacetName"
- ,facet1.getFacetName().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase.java
deleted file mode 100644
index 4b7b0d8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitFactoryType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-/*
-* This Junit class is used to test the FacesConfigFactoryImpl
-* class.
-*
-*/
-public class ReadFactoryTestCase extends BaseReadTestCase {
-
- public ReadFactoryTestCase(String name) {
- super(name);
- }
-
- /*
- * Test the applicaion element of faces-config.xml
- *
- */
- public void testEmptyFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getFactory().size());
- assertNotNull(getFactoryType1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- FactoryType getFactoryType1(FacesConfigType facesConfig)
- {
- return (FactoryType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getFactory(), "factory1");
- }
- /*
- * Test the application-factory element of Factory in faces-config.xml
- *
- */
- public void testApplicationFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- ApplicationFactoryType applicationFactoryType1 =
- (ApplicationFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getApplicationFactory(), "applicationFactory1");
- assertNotNull(applicationFactoryType1);
- assertEquals("application-factory",
- applicationFactoryType1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Test the faces-context-factory element of Factory in faces-config.xml
- */
- public void testFacesContextFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- FacesContextFactoryType facesContextFactoryType1 =
- (FacesContextFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getFacesContextFactory(), "facesContextFactory1");
- assertNotNull(facesContextFactoryType1);
- assertEquals("faces-context-factory",
- facesContextFactoryType1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * Test the application-factory element of Factory in faces-config.xml
- *
- */
- public void testLifeCycleFactory() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- LifecycleFactoryType lifecycleFactoryType1 =
- (LifecycleFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getLifecycleFactory(), "lifecycleFactory1");
- assertNotNull(lifecycleFactoryType1);
- assertEquals("lifecycle-factory",
- lifecycleFactoryType1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Test the renderkit-factory element
- */
- public void testRenderkitFactory()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- RenderKitFactoryType renderKitFactoryType1 =
- (RenderKitFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getRenderKitFactory(), "renderKitFactory1");
- assertNotNull(renderKitFactoryType1);
- assertEquals("render-kit-factory",
- renderKitFactoryType1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_1_2.java
deleted file mode 100644
index 0082634..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_1_2.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadFactoryTestCase_1_2 extends ReadFactoryTestCase {
- public ReadFactoryTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testFactoryExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
-
- assertEquals(1, factoryType1.getFactoryExtension().size());
- FactoryExtensionType factoryExtensionType =
- (FactoryExtensionType) factoryType1.getFactoryExtension().get(0);
- assertEquals(1, factoryExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) factoryExtensionType.getChildNodes().get(0);
- assertEquals("factory-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_2_0.java
deleted file mode 100644
index 815f634..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadFactoryTestCase_2_0.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.ExceptionHandlerFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ExternalContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.PartialViewContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.TagHandlerDelegateFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ViewDeclarationLanguageFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.VisitContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadFactoryTestCase_2_0 extends ReadFactoryTestCase_1_2 {
- public ReadFactoryTestCase_2_0(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_2_0.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_2_0;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testExceptionHandlerFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- ExceptionHandlerFactoryType exceptionHandlerFactory1 =
- (ExceptionHandlerFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getExceptionHandlerFactory(), "exceptionHandlerFactory1");
- assertNotNull(exceptionHandlerFactory1);
- assertEquals("exception-handler-factory",
- exceptionHandlerFactory1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testExternalContextFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- ExternalContextFactoryType externalContextFactory1 =
- (ExternalContextFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getExternalContextFactory(), "externalContextFactory1");
- assertNotNull(externalContextFactory1);
- assertEquals("external-context-factory",
- externalContextFactory1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testPartialViewContextFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- PartialViewContextFactoryType partialViewContextFactory1 =
- (PartialViewContextFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getPartialViewContextFactory(), "partialViewContextFactory1");
- assertNotNull(partialViewContextFactory1);
- assertEquals("partial-view-context-factory",
- partialViewContextFactory1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testViewDeclarationLanguageFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- ViewDeclarationLanguageFactoryType viewDeclarationLanguageFactory1 =
- (ViewDeclarationLanguageFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getViewDeclarationLanguageFactory(), "viewDeclarationLanguageFactory1");
- assertNotNull(viewDeclarationLanguageFactory1);
- assertEquals("view-declaration-language-factory",
- viewDeclarationLanguageFactory1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testTagHandlerDelegateFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- TagHandlerDelegateFactoryType tagHandlerDelegateFactory1 =
- (TagHandlerDelegateFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getTagHandlerDelegateFactory(), "tagHandlerDelegateFactory1");
- assertNotNull(tagHandlerDelegateFactory1);
- assertEquals("tag-handler-delegate-factory",
- tagHandlerDelegateFactory1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testVisitContextFactory() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- FactoryType factoryType1 = getFactoryType1(edit.getFacesConfig());
- assertNotNull(factoryType1);
- VisitContextFactoryType visitContextFactory =
- (VisitContextFactoryType) FacesConfigModelUtil.findEObjectElementById
- (factoryType1.getVisitContextFactory(), "visitContextFactory1");
- assertNotNull(visitContextFactory);
- assertEquals("visit-context-factory",
- visitContextFactory.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase.java
deleted file mode 100644
index 7d7fcbd..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
-import org.eclipse.jst.jsf.facesconfig.emf.PhaseListenerType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-/*
- * This Junit class is used to test the lifecycle which is one of
- * many items inside the root elemnt faces-config in the configuration
- * information hierarchy of the faces-config.xml file
- *
- */
-public class ReadLifecycleTestCase extends BaseReadTestCase {
-
- public ReadLifecycleTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the empty navigation rule. Since
- * I am supplying a single faces-config.xml file as a testing file, I had to
- * testcases fit in to it by controlling the conditions
- *
- */
- public void testLifecycle() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertEquals(1, edit.getFacesConfig().getLifecycle().size());
- assertNotNull(getLifecycleType1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- LifecycleType getLifecycleType1(FacesConfigType facesConfig)
- {
- return (LifecycleType)
- FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getLifecycle(),
- "lifecycle1");
- }
-
- // Test for the Descirption
- public void testPhaseListener() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- LifecycleType lifecycle1 = getLifecycleType1(edit.getFacesConfig());
- assertNotNull(lifecycle1);
- PhaseListenerType phaseListener1 = (PhaseListenerType) FacesConfigModelUtil
- .findEObjectElementById(lifecycle1.getPhaseListener(), "phaseListener1");
- assertNotNull(phaseListener1);
- assertEquals("org.eclipse.wtp.jsf.tests.ValueResourcePhaseListener",
- phaseListener1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase_1_2.java
deleted file mode 100644
index ac5991c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadLifecycleTestCase_1_2.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadLifecycleTestCase_1_2 extends ReadLifecycleTestCase {
-
- public ReadLifecycleTestCase_1_2(String name) {
- super(name);
- }
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testLifecycleExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- LifecycleType lifecycle1 = getLifecycleType1(edit.getFacesConfig());
- assertNotNull(lifecycle1);
-
- assertEquals(1, lifecycle1.getLifecycleExtension().size());
- LifecycleExtensionType lifecycleExtensionType =
- (LifecycleExtensionType) lifecycle1.getLifecycleExtension().get(0);
- assertEquals(1, lifecycleExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) lifecycleExtensionType.getChildNodes().get(0);
- assertEquals("lifecycle-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanManagedPropertyTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanManagedPropertyTestCase.java
deleted file mode 100644
index 2037da0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanManagedPropertyTestCase.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedPropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValueType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the Managed-Property
- * of the Managed-Bean Element
- *
- */
-public class ReadManagedBeanManagedPropertyTestCase extends
- BaseReadTestCase {
-
- public ReadManagedBeanManagedPropertyTestCase(String name) {
- super(name);
- }
-
- /*
- * Check to see there is at least one property that exists within attribute
- *
- */
- public void testSingleManagedProperty() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertNotNull(getManagedProperty(
- "managedBean1Property1", edit.getFacesConfig()));
- assertNotNull(getManagedProperty("managedBean1Property2"
- , edit.getFacesConfig()));
- assertNotNull(getManagedProperty("managedBeanMapProperty"
- , edit.getFacesConfig()));
- assertNotNull(getManagedProperty("managedBeanListProperty"
- , edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ManagedPropertyType getManagedProperty(String property, FacesConfigType facesConfig)
- {
- ManagedBeanType bean = (ManagedBeanType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getManagedBean(), "managedBean1");
- assertNotNull(bean);
- return (ManagedPropertyType)
- FacesConfigModelUtil
- .findEObjectElementById(bean.getManagedProperty(), property);
- }
-
- /*
- * Get the Description. It simply checks to see if there is at least
- * one such item
- *
- */
-
- public void testManagedBeanDescriptionGroup() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedPropertyType property =
- getManagedProperty("managedBean1Property1"
- , edit.getFacesConfig());
- assertNotNull(property);
-
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil
- .findEObjectElementById(property.getDescription()
- , "managedBean1Property1_description");
- assertNotNull(descType);
- assertEquals("managed-property-description", descType.getTextContent());
-
- DisplayNameType displayName =
- (DisplayNameType) FacesConfigModelUtil
- .findEObjectElementById(property.getDisplayName()
- , "managedBean1Property1_displayName");
- assertNotNull(displayName);
- assertEquals("managed-property-display-name"
- , displayName.getTextContent());
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById(property.getIcon()
- , "managedBean1Property1_icon");
- assertNotNull(iconType);
- assertEquals("managedBean1-property-small-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("managedBean1-property-large-icon"
- , iconType.getLargeIcon().getTextContent());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * Get both the Property-name and Property-class. It simply checks to see if
- * there is at least one each items and check if the names are identical
- * as given in the input xml file.
- *
- */
- public void testValueManagedProperty() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedPropertyType property =
- getManagedProperty("managedBean1Property1"
- , edit.getFacesConfig());
- assertNotNull(property);
-
- assertEquals("bean-property-name"
- , property.getPropertyName().getTextContent());
- assertEquals("bean-property-class"
- , property.getPropertyClass().getTextContent());
- assertEquals("bean-propertyValue1"
- , property.getValue().getTextContent());
- assertNull(property.getNullValue());
- assertNull(property.getMapEntries());
- assertNull(property.getListEntries());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testNullValueManagedProperty()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedPropertyType property =
- getManagedProperty("managedBean1Property2"
- , edit.getFacesConfig());
- assertNotNull(property);
-
- assertEquals("bean-property2-name"
- , property.getPropertyName().getTextContent());
- assertEquals("bean-property2-class"
- , property.getPropertyClass().getTextContent());
- assertNotNull(property.getNullValue());
- assertNull(property.getValue());
- assertNull(property.getMapEntries());
- assertNull(property.getListEntries());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testMapValueManagedProperty()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedPropertyType property =
- getManagedProperty("managedBeanMapProperty"
- , edit.getFacesConfig());
- assertNotNull(property);
-
- assertEquals("map-bean-name"
- , property.getPropertyName().getTextContent());
- assertEquals("map-bean-class"
- , property.getPropertyClass().getTextContent());
- assertNotNull(property.getMapEntries());
-
- MapEntriesType mapEntries = property.getMapEntries();
- assertEquals("propertyMapEntryKey",
- mapEntries.getKeyClass().getTextContent());
- assertEquals("propertyMapEntryValueClass",
- mapEntries.getValueClass().getTextContent());
-
- MapEntryType mapEntry =
- (MapEntryType) FacesConfigModelUtil
- .findEObjectElementById(mapEntries.getMapEntry(), "mapPropertyEntryWithValue");
- assertNotNull(mapEntry);
- assertEquals("propertyMapKey1"
- , mapEntry.getKey().getTextContent());
- assertEquals("propertyMapValue1"
- , mapEntry.getValue().getTextContent());
- assertNull(mapEntry.getNullValue());
- mapEntry =
- (MapEntryType) FacesConfigModelUtil
- .findEObjectElementById(mapEntries.getMapEntry(), "mapPropertyEntryWithNullValue");
- assertNotNull(mapEntry);
- assertEquals("propertyMapKey2"
- , mapEntry.getKey().getTextContent());
- assertNotNull(mapEntry.getNullValue());
- assertNull(mapEntry.getValue());
-
- assertNull(property.getNullValue());
- assertNull(property.getValue());
- assertNull(property.getListEntries());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testListValueManagedProperty()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedPropertyType property =
- getManagedProperty("managedBeanListProperty"
- , edit.getFacesConfig());
- assertNotNull(property);
-
- assertEquals("list-bean-name"
- , property.getPropertyName().getTextContent());
- assertEquals("list-bean-class"
- , property.getPropertyClass().getTextContent());
- assertNotNull(property.getListEntries());
-
- ListEntriesType listEntries = property.getListEntries();
- assertEquals(1, listEntries.getValue().size());
- assertEquals(1, listEntries.getNullValue().size());
-
- ValueType valueType = (ValueType) listEntries.getValue().get(0);
-
- assertEquals("managedBeanListPropertyValue",
- valueType.getTextContent());
-
- assertNull(property.getNullValue());
- assertNull(property.getValue());
- assertNull(property.getMapEntries());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase.java
deleted file mode 100644
index e736831..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValueType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the managed-bean which is one of
- * many items inside the root elemnt faces-config in the configuration
- * information hierarchy of the faces-config.xml file
- *
- */
-public class ReadManagedBeanTestCase extends BaseReadTestCase {
-
- public ReadManagedBeanTestCase(String name) {
- super(name);
- }
-
- /*
- *Test to see if there is at least one managed-bean.
- *This should be specified in the file for reading (faces-config)
- */
- public void testManagedBean() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertNotNull(getManagedBean("managedBean1", edit.getFacesConfig()));
- assertNotNull(getManagedBean("mapBean1", edit.getFacesConfig()));
- assertNotNull(getManagedBean("listBean1", edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- ManagedBeanType getManagedBean(String name, FacesConfigType facesConfig)
- {
- return (ManagedBeanType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getManagedBean(), name);
- }
-
- // Test for the Descirption
- public void testDescriptionGroup() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- final ManagedBeanType managedBean1 =
- getManagedBean("managedBean1", edit.getFacesConfig());
-
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil
- .findEObjectElementById(managedBean1.getDescription()
- , "managedBean1Description");
- assertNotNull(descType);
- assertEquals("managed-bean-description", descType.getTextContent());
-
- DisplayNameType displayName =
- (DisplayNameType) FacesConfigModelUtil
- .findEObjectElementById(managedBean1.getDisplayName()
- , "managedBean1DisplayName");
- assertNotNull(displayName);
- assertEquals("managed-bean-display-name"
- , displayName.getTextContent());
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById(managedBean1.getIcon()
- , "managedBean1Icon");
- assertNotNull(iconType);
- assertEquals("managedBean1-small-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("managedBean1-large-icon"
- , iconType.getLargeIcon().getTextContent());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * Check for a managed-bean-class
- */
- public void testSingleValuedProperties() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- {
- final ManagedBeanType managedBean1 =
- getManagedBean("managedBean1", edit.getFacesConfig());
-
- assertEquals("managedBeanName",
- managedBean1.getManagedBeanName().getTextContent());
- assertEquals("managed-bean-class",
- managedBean1.getManagedBeanClass().getTextContent());
- assertEquals("request",
- managedBean1.getManagedBeanScope().getTextContent());
- }
-
- {
- final ManagedBeanType mapBean1 =
- getManagedBean("mapBean1", edit.getFacesConfig());
-
- assertEquals("mapBean1",
- mapBean1.getManagedBeanName().getTextContent());
- assertEquals("mapBean1-class",
- mapBean1.getManagedBeanClass().getTextContent());
- assertEquals("request",
- mapBean1.getManagedBeanScope().getTextContent());
- }
-
- {
- final ManagedBeanType listBean1 =
- getManagedBean("listBean1", edit.getFacesConfig());
-
- assertEquals("listBean1",
- listBean1.getManagedBeanName().getTextContent());
- assertEquals("listBean1-class",
- listBean1.getManagedBeanClass().getTextContent());
- assertEquals("request",
- listBean1.getManagedBeanScope().getTextContent());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testMapBeanProperties()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType bean =
- getManagedBean("mapBean1"
- , edit.getFacesConfig());
- assertNotNull(bean);
-
- MapEntriesType mapEntries = bean.getMapEntries();
-
- assertEquals("mapBeanEntryKey",
- mapEntries.getKeyClass().getTextContent());
- assertEquals("mapBeanEntryValueClass",
- mapEntries.getValueClass().getTextContent());
-
- MapEntryType mapEntry =
- (MapEntryType) FacesConfigModelUtil
- .findEObjectElementById(mapEntries.getMapEntry(), "mapBeanEntryWithValue");
- assertNotNull(mapEntry);
- assertEquals("mapBeanKey1"
- , mapEntry.getKey().getTextContent());
- assertEquals("mapBeanValue1"
- , mapEntry.getValue().getTextContent());
- assertNull(mapEntry.getNullValue());
-
- mapEntry =
- (MapEntryType) FacesConfigModelUtil
- .findEObjectElementById(mapEntries.getMapEntry(), "mapBeanEntryWithNullValue");
- assertNotNull(mapEntry);
- assertEquals("mapBeanKey2"
- , mapEntry.getKey().getTextContent());
- assertNotNull(mapEntry.getNullValue());
- assertNull(mapEntry.getValue());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testListBeanProperties()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType bean =
- getManagedBean("listBean1"
- , edit.getFacesConfig());
- assertNotNull(bean);
-
- ListEntriesType listEntries = bean.getListEntries();
-
- assertEquals("listBeanListPropertyClass",
- listEntries.getValueClass().getTextContent());
- assertEquals(1, listEntries.getValue().size());
- assertEquals(1, listEntries.getNullValue().size());
-
- ValueType valueType = (ValueType)listEntries.getValue().get(0);
- assertNotNull(valueType);
- assertEquals("listBeanListPropertyValue", valueType.getTextContent().trim());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_1_2.java
deleted file mode 100644
index b28e4dc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_1_2.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadManagedBeanTestCase_1_2 extends ReadManagedBeanTestCase
-{
- public ReadManagedBeanTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testManagedBeanExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType managedBean1 =
- getManagedBean("managedBean1", edit.getFacesConfig());
- assertNotNull(managedBean1);
-
- assertEquals(1, managedBean1.getManagedBeanExtension().size());
- ManagedBeanExtensionType managedBeanExtensionType =
- (ManagedBeanExtensionType) managedBean1.getManagedBeanExtension().get(0);
- assertEquals(1, managedBeanExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) managedBeanExtensionType.getChildNodes().get(0);
- assertEquals("managed-bean-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_2_0.java
deleted file mode 100644
index 10949b1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadManagedBeanTestCase_2_0.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadManagedBeanTestCase_2_0 extends ReadManagedBeanTestCase_1_2
-{
- public ReadManagedBeanTestCase_2_0(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_2_0.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_2_0;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testEagerAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- final ManagedBeanType managedBean1 =
- getManagedBean("managedBean1", edit.getFacesConfig());
-
- assertNotNull(managedBean1);
- assertEquals(true, managedBean1.isEager());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase.java
deleted file mode 100644
index fdf1e55..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the FacesConfigFactoryImpl
- * class.
- *
- */
-
-
-public class ReadNavigationRuleTestCase extends BaseReadTestCase {
-
- public ReadNavigationRuleTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the existence of at least
- * one navigation-rule
- */
- public void testSingleNavigationRule() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Verify that display is populated
- */
- public void testDisplayName()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit);
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- NavigationRuleType navRule =
- FacesConfigModelUtil.
- findNavigationHandlerRuleByDisplayName(navRules, "display name 1");
- assertNotNull(navRule);
-
- // verify that xml:lang's are being populated
- navRule = FacesConfigModelUtil.
- findNavigationHandlerRuleByDescriptionText(navRules,
- "A navigation rule with lang attributes");
- assertNotNull(navRule);
-
- DisplayNameType displayNameType = FacesConfigModelUtil.
- findDisplayNameType(navRule.getDisplayName(), "English Display Name");
- assertNotNull(displayNameType);
- assertEquals("en", displayNameType.getLang());
-
- displayNameType = FacesConfigModelUtil.
- findDisplayNameType(navRule.getDisplayName(), "Nom D'Affichage De Français");
- assertNotNull(displayNameType);
- assertEquals("fr", displayNameType.getLang());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- // Test for the Descirption
-
- public void testNonEmptyDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit);
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- NavigationRuleType navRule =
- FacesConfigModelUtil.
- findNavigationHandlerRuleByDescriptionText(navRules,
- "Descri 1");
- assertNotNull(navRule);
-
- // verify that xml:lang's are being populated
- navRule = FacesConfigModelUtil.
- findNavigationHandlerRuleByDescriptionText(navRules,
- "A navigation rule with lang attributes");
- assertNotNull(navRule);
-
- DescriptionType descType = FacesConfigModelUtil.
- findDescriptionType(navRule.getDescription(), "A navigation rule with lang attributes");
- assertNotNull(descType);
- assertEquals("en", descType.getLang());
-
- descType = FacesConfigModelUtil.
- findDescriptionType(navRule.getDescription(), "What color is it?");
- assertNotNull(descType);
- assertEquals("en-US", descType.getLang());
-
- descType = FacesConfigModelUtil.
- findDescriptionType(navRule.getDescription(), "What colour is it?");
- assertNotNull(descType);
- assertEquals("en-GB", descType.getLang());
-
- descType = FacesConfigModelUtil.
- findDescriptionType(navRule.getDescription(), "Quelle couleur est lui?");
- assertNotNull(descType);
- assertEquals("fr", descType.getLang());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Test for the exisence of navigation-cases
- */
-
- public void testNonEmptyNavigationCases() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
-
- // test first navigation rule
- NavigationRuleType navRule =
- FacesConfigModelUtil
- .findNavigationHandlerRuleByDisplayName
- (navRules, "display name 1");
- assertNotNull(navRule);
-
- assertEquals(2, navRule.getNavigationCase().size());
- NavigationCaseType navCase = FacesConfigModelUtil.
- findNavigationCaseByDisplayName(navRule.getNavigationCase(),
- "what display name");
- assertNotNull(navCase);
-
- assertNotNull(navCase.getFromAction());
- assertEquals("#{from-action}", navCase.getFromAction().getTextContent());
-
- assertNotNull(navCase.getFromOutcome());
- assertEquals("drilldown", navCase.getFromOutcome().getTextContent());
-
- assertNotNull(navCase.getToViewId());
- assertEquals("/edit.jsp", navCase.getToViewId().getTextContent());
-
- assertNotNull(navCase.getRedirect());
-
-
- navCase = FacesConfigModelUtil.
- findNavigationCaseByDisplayName(navRule.getNavigationCase(),
- "second navigation case");
- assertNotNull(navCase);
-
-
- assertNotNull(navCase.getFromAction());
- assertEquals("#{action2}", navCase.getFromAction().getTextContent());
-
- assertNotNull(navCase.getFromOutcome());
- assertEquals("outcome2", navCase.getFromOutcome().getTextContent());
-
- assertNotNull(navCase.getToViewId());
- assertEquals("/edit2.jsp", navCase.getToViewId().getTextContent());
-
- assertNull(navCase.getRedirect());
-
- // test second navigation rule
- navRule =
- FacesConfigModelUtil
- .findNavigationHandlerRuleByDisplayName
- (navRules, "English Display Name");
- assertNotNull(navRule);
-
- navCase = FacesConfigModelUtil.
- findNavigationCaseByDisplayName(navRule.getNavigationCase(),
- "second navigation rule navcase");
- assertNotNull(navCase);
-
- assertNotNull(navCase.getFromAction());
- assertEquals("#{action3}", navCase.getFromAction().getTextContent());
-
- assertNotNull(navCase.getFromOutcome());
- assertEquals("outcome3", navCase.getFromOutcome().getTextContent());
-
- assertNotNull(navCase.getToViewId());
- assertEquals("/edit3.jsp", navCase.getToViewId().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
- /*
- * assert the existence of icon
- */
-
- public void testNonEmptyIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- NavigationRuleType navRule =
- FacesConfigModelUtil
- .findNavigationHandlerRuleByDisplayName
- (navRules, "display name 1");
-
- assertNotNull(navRule);
- EList icons = navRule.getIcon();
- assertEquals(1, icons.size());
- IconType iconType = (IconType) icons.get(0);
- assertNotNull(iconType.getSmallIcon());
- assertEquals("myicon", iconType.getSmallIcon().getTextContent());
- assertNull(iconType.getLargeIcon());
-
- navRule =
- FacesConfigModelUtil
- .findNavigationHandlerRuleByDisplayName
- (navRules, "English Display Name");
- assertNotNull(navRule);
-
- icons = navRule.getIcon();
- assertEquals(2, icons.size());
-
- IconType icon =
- FacesConfigModelUtil.
- findIconTypeByLang(icons, null);
- assertNotNull(icon);
- assertNotNull(icon.getSmallIcon());
- assertEquals("small-icon", icon.getSmallIcon().getTextContent());
- assertNotNull(icon.getLargeIcon());
- assertEquals("large-icon", icon.getLargeIcon().getTextContent());
-
- icon = FacesConfigModelUtil.
- findIconTypeByLang(icons, "en");
- assertNotNull(icon);
- assertNotNull(icon.getSmallIcon());
- assertEquals("en_small-icon", icon.getSmallIcon().getTextContent());
- assertNotNull(icon.getLargeIcon());
- assertEquals("en_large-icon", icon.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testFromViewIdType()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- NavigationRuleType navRule =
- FacesConfigModelUtil
- .findNavigationHandlerRuleByDisplayName
- (navRules, "display name 1");
- assertNotNull(navRule);
- assertEquals("/Page1.jsp",navRule.getFromViewId().getTextContent());
-
- navRule =
- FacesConfigModelUtil
- .findNavigationHandlerRuleByDisplayName
- (navRules, "English Display Name");
- assertNotNull(navRule);
- assertEquals("/Page1.jsp",navRule.getFromViewId().getTextContent());
- }
- finally
- {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_1_2.java
deleted file mode 100644
index 298d25b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_1_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadNavigationRuleTestCase_1_2 extends ReadNavigationRuleTestCase
-{
- public ReadNavigationRuleTestCase_1_2(String name) {
- super(name);
- }
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testNavigationRuleExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertEquals(2, navRules.size());
- NavigationRuleType navigation1 =
- (NavigationRuleType) navRules.get(0);
-
- assertEquals(1, navigation1.getNavigationRuleExtension().size());
- NavigationRuleExtensionType navigationRuleExtensionType =
- (NavigationRuleExtensionType) navigation1.getNavigationRuleExtension().get(0);
- assertEquals(1, navigationRuleExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) navigationRuleExtensionType.getChildNodes().get(0);
- assertEquals("navigation-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_2_0.java
deleted file mode 100644
index 80a5632..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadNavigationRuleTestCase_2_0.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.emf.RedirectType;
-import org.eclipse.jst.jsf.facesconfig.emf.RedirectViewParamType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadNavigationRuleTestCase_2_0 extends ReadNavigationRuleTestCase_1_2
-{
- public ReadNavigationRuleTestCase_2_0(String name) {
- super(name);
- }
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_2_0.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_2_0;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testIf()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit);
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- NavigationRuleType navRule =
- FacesConfigModelUtil.
- findNavigationHandlerRuleByDisplayName(navRules, "display name 1");
- assertNotNull(navRule);
-
- NavigationCaseType navCase = FacesConfigModelUtil.
- findNavigationCaseByDisplayName(navRule.getNavigationCase(),
- "what display name");
- assertNotNull(navCase);
- assertEquals("#{el-expression}", navCase.getIf().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testRedirect()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit);
- EList navRules = edit.getFacesConfig().getNavigationRule();
- assertTrue(!navRules.isEmpty());
- NavigationRuleType navRule =
- FacesConfigModelUtil.
- findNavigationHandlerRuleByDisplayName(navRules, "display name 1");
- assertNotNull(navRule);
-
- NavigationCaseType navCase = FacesConfigModelUtil.
- findNavigationCaseByDisplayName(navRule.getNavigationCase(),
- "what display name");
- assertNotNull(navCase);
-
- RedirectType redirect = navCase.getRedirect();
- assertNotNull(redirect);
- assertEquals(true, redirect.isIncludeViewParams());
- redirect.getViewParam();
- RedirectViewParamType viewParam =
- (RedirectViewParamType)
- FacesConfigModelUtil.findEObjectElementById
- (redirect.getViewParam(), "view-param-id");
- assertNotNull(viewParam);
- assertEquals("viewParamName", viewParam.getName().getTextContent().trim());
- assertEquals("viewParamValue", viewParam.getValue().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyComponentTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyComponentTestCase.java
deleted file mode 100644
index 7bb2f12..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyComponentTestCase.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * Test component property
- *
- * @author cbateman
- *
- */
-public class ReadPropertyComponentTestCase extends BaseReadTestCase {
-
- public ReadPropertyComponentTestCase(String name) {
- super(name);
- }
-
- public void testProperty()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType attribute1 = getProperty1(edit.getFacesConfig());
- assertNotNull(attribute1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
-
- }
-
- private ComponentType getComponent1(FacesConfigType facesConfigType)
- {
- return (ComponentType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfigType.getComponent(), "component1");
- }
-
- private PropertyType getProperty1(FacesConfigType facesConfigType)
- {
- ComponentType component1 = getComponent1(facesConfigType);
- assertNotNull(component1);
- return (PropertyType) FacesConfigModelUtil
- .findEObjectElementById
- (component1.getProperty(), "componentProperty1");
- }
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (propertyType.getDescription()
- ,"componentProperty1_descripton1");
- assertEquals("myDescript blah blah"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (propertyType.getDisplayName()
- ,"componentProperty1_displayName1");
- assertEquals("Component Property 1"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType = getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (propertyType.getIcon(), "componentProperty1_icon1");
- assertNotNull(iconType);
-
- assertEquals("property-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("property-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testPropertyNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType property1 = getProperty1(edit.getFacesConfig());
- assertNotNull(property1);
-
- assertEquals("property1"
- ,property1.getPropertyName().getTextContent());
- assertEquals("ComponentProperty"
- ,property1.getPropertyClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- assertEquals("suggestedValue"
- ,propertyType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- assertEquals("defaultValue6"
- , propertyType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
-// public void testPropertyExtension() {
-// FacesConfigArtifactEdit edit = null;
-// try {
-// edit = FacesConfigArtifactEdit
-// .getFacesConfigArtifactEditForRead(project);
-// if (edit.getFacesConfig() != null) {
-// EList comp = edit.getFacesConfig().getComponent();
-// assertTrue(!comp.isEmpty());
-// for (int i = 0; i < comp.size(); i++) {
-// ComponentType compType = (ComponentType) comp
-// .get(i);
-// assertTrue(!compType.getAttribute().isEmpty());
-//
-// EList attr = compType.getAttribute();
-// for (int k = 0; k < attr.size(); k++) {
-// AttributeType attrType = (AttributeType) attr.get(k);
-// EList ext= attrType.getAttributeExtension();
-// assertTrue(ext.size()!=0);
-// System.out.println("The size of attribute-extension is >>?? " + ext.size() );
-// }
-// }
-// }
-// } finally {
-// if (edit != null) {
-// edit.dispose();
-// }
-// }
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyConverterTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyConverterTestCase.java
deleted file mode 100644
index b750e4e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyConverterTestCase.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * Tests the property on a converter
- *
- * @author cbateman
- */
-public class ReadPropertyConverterTestCase extends BaseReadTestCase
-{
- public ReadPropertyConverterTestCase(String name) {
- super(name);
- }
-
- public void testProperty()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType property1 = getProperty1(edit.getFacesConfig());
- assertNotNull(property1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ConverterType getConverter1(FacesConfigType facesConfigType)
- {
- return (ConverterType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfigType.getConverter(), "converter1");
- }
-
- private PropertyType getProperty1(FacesConfigType facesConfigType)
- {
- ConverterType converter1 = getConverter1(facesConfigType);
- assertNotNull(converter1);
-
- return (PropertyType) FacesConfigModelUtil
- .findEObjectElementById
- (converter1.getProperty(), "converter1Property");
- }
-
- /*
- * This is to test the description child inside of Attribute
- *
- */
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (propertyType.getDescription()
- ,"converter1_property_description");
- assertEquals("converter-property-description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (propertyType.getDisplayName()
- ,"converter1_property_display-name");
- assertEquals("converter-property-display-name"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType = getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (propertyType.getIcon(), "converter1_property_icon");
- assertNotNull(iconType);
-
- assertEquals("converter1-property-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("converter1-property-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testPropertyNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType property1 = getProperty1(edit.getFacesConfig());
- assertNotNull(property1);
-
- assertEquals("converter-property-name"
- ,property1.getPropertyName().getTextContent());
- assertEquals("converter-property-propertyClass"
- ,property1.getPropertyClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- assertEquals("converter-property-suggested-value"
- ,propertyType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- assertEquals("converter-property-default-value"
- , propertyType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
-// public void testPropertyExtension() {
-// FacesConfigArtifactEdit edit = null;
-// try {
-// edit = FacesConfigArtifactEdit
-// .getFacesConfigArtifactEditForRead(project);
-// if (edit.getFacesConfig() != null) {
-// EList comp = edit.getFacesConfig().getComponent();
-// assertTrue(!comp.isEmpty());
-// for (int i = 0; i < comp.size(); i++) {
-// ComponentType compType = (ComponentType) comp
-// .get(i);
-// assertTrue(!compType.getAttribute().isEmpty());
-//
-// EList attr = compType.getAttribute();
-// for (int k = 0; k < attr.size(); k++) {
-// AttributeType attrType = (AttributeType) attr.get(k);
-// EList ext= attrType.getAttributeExtension();
-// assertTrue(ext.size()!=0);
-// System.out.println("The size of attribute-extension is >>?? " + ext.size() );
-// }
-// }
-// }
-// } finally {
-// if (edit != null) {
-// edit.dispose();
-// }
-// }
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyValidatorTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyValidatorTestCase.java
deleted file mode 100644
index d74c004..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadPropertyValidatorTestCase.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadPropertyValidatorTestCase extends BaseReadTestCase {
-
- public ReadPropertyValidatorTestCase(String name) {
- super(name);
- }
-
- public void testProperty()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType property1 = getProperty1(edit.getFacesConfig());
- assertNotNull(property1);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
-
- }
-
- private ValidatorType getValidator1(FacesConfigType facesConfigType)
- {
- return (ValidatorType) FacesConfigModelUtil
- .findEObjectElementById
- (facesConfigType.getValidator(), "validator1");
- }
-
- private PropertyType getProperty1(FacesConfigType facesConfigType)
- {
- ValidatorType validator1 = getValidator1(facesConfigType);
- assertNotNull(validator1);
- return (PropertyType) FacesConfigModelUtil
- .findEObjectElementById
- (validator1.getProperty(), "validator1_property");
- }
- /*
- * This is to test the description child inside of Attribute
- *
- */
-
- public void testDescription() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- DescriptionType descType =
- (DescriptionType)FacesConfigModelUtil.findEObjectElementById
- (propertyType.getDescription()
- ,"validator1_property_description");
- assertEquals("validator-property-description"
- , descType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * A simple test to check if the Display Name is present
- * within the faces-config.xml file
- */
-
- public void testDisplayName() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- final DisplayNameType displayNameType =
- (DisplayNameType)FacesConfigModelUtil.findEObjectElementById
- (propertyType.getDisplayName()
- ,"validator1_property_displayName");
- assertEquals("validator-property-display-name"
- , displayNameType.getTextContent().trim());
- }
- finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks to see if there is an icon defined
- *
- */
- public void testIcon() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType = getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById
- (propertyType.getIcon(), "validator1_property_icon");
- assertNotNull(iconType);
-
- assertEquals("validator-property-small-icon",
- iconType.getSmallIcon().getTextContent());
- assertEquals("validator-property-large-icon",
- iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of two items.
- * They are the required items by all renderers
- * They are : attribute-name and attribute-class.
- * It thought it was better to put them together instead of
- * writing single -separate methods for each of them.
- *Simply, extract the names and check if same the one
- *in faces-config.xml
- */
- public void testPropertyNameAndClass() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType property1 = getProperty1(edit.getFacesConfig());
- assertNotNull(property1);
-
- assertEquals("validator-property-name"
- ,property1.getPropertyName().getTextContent());
- assertEquals("validator-property-class"
- ,property1.getPropertyClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * Checks for the item suggested-value within attribute
- *
- */
- public void testSuggestedValue() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- assertEquals("validator property suggested value"
- ,propertyType.getSuggestedValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testDefaultValue()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- PropertyType propertyType =
- getProperty1(edit.getFacesConfig());
- assertNotNull(propertyType);
-
- assertEquals("validator property default value"
- , propertyType.getDefaultValue().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks for the item attribute-extension within attribute
- * TODO: not currently supported
- */
-// public void testPropertyExtension() {
-// FacesConfigArtifactEdit edit = null;
-// try {
-// edit = FacesConfigArtifactEdit
-// .getFacesConfigArtifactEditForRead(project);
-// if (edit.getFacesConfig() != null) {
-// EList comp = edit.getFacesConfig().getComponent();
-// assertTrue(!comp.isEmpty());
-// for (int i = 0; i < comp.size(); i++) {
-// ComponentType compType = (ComponentType) comp
-// .get(i);
-// assertTrue(!compType.getAttribute().isEmpty());
-//
-// EList attr = compType.getAttribute();
-// for (int k = 0; k < attr.size(); k++) {
-// AttributeType attrType = (AttributeType) attr.get(k);
-// EList ext= attrType.getAttributeExtension();
-// assertTrue(ext.size()!=0);
-// System.out.println("The size of attribute-extension is >>?? " + ext.size() );
-// }
-// }
-// }
-// } finally {
-// if (edit != null) {
-// edit.dispose();
-// }
-// }
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadReferencedBeanTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadReferencedBeanTestCase.java
deleted file mode 100644
index 3457e60..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadReferencedBeanTestCase.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ReferencedBeanType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-/*
- * This Junit class is used to test the referenced-bean which is one of
- * many items inside the root elemnt faces-config in the configuration
- * information hierarchy of the faces-config.xml file
- *
- */
-public class ReadReferencedBeanTestCase extends BaseReadTestCase {
-
- public ReadReferencedBeanTestCase(String name) {
- super(name);
- }
-
-
- /*
- * check for the existence of referenced-bean with in
- * the root element - faces-config. There should be at least
- * one of such kind (item)
- */
- public void testSingleReferncedBean() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertNotNull(getReferencedBean1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private ReferencedBeanType getReferencedBean1(FacesConfigType facesConfig)
- {
- return (ReferencedBeanType)
- FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getReferencedBean()
- , "referencedBean1");
- }
-
- // Test for the Descirption
- public void testDescriptionGroup() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ReferencedBeanType referencedBean =
- getReferencedBean1(edit.getFacesConfig());
- assertNotNull(referencedBean);
-
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil
- .findEObjectElementById(referencedBean.getDescription()
- , "referencedBean1Description");
- assertNotNull(descType);
- assertEquals("Referenced Bean Desc", descType.getTextContent());
-
- DisplayNameType displayName =
- (DisplayNameType) FacesConfigModelUtil
- .findEObjectElementById(referencedBean.getDisplayName()
- , "referencedBean1DisplayName");
- assertNotNull(displayName);
- assertEquals("referenced-bean-display"
- , displayName.getTextContent());
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById(referencedBean.getIcon()
- , "referencedBean1Icon");
- assertNotNull(iconType);
- assertEquals("referenced-bean-small-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("referenced-bean-large-icon"
- , iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
- /*
- * check for refrenced-bean-name
- */
- public void testSingleValuedProperties(){
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ReferencedBeanType referencedBean =
- getReferencedBean1(edit.getFacesConfig());
- assertNotNull(referencedBean);
-
- assertEquals("referencedBeanName"
- ,referencedBean.getReferencedBeanName().getTextContent().trim());
- assertEquals("referenced-bean-class"
- ,referencedBean.getReferencedBeanClass().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase.java
deleted file mode 100644
index 4d289c9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the render which is one of
- * many items inside the root elemnt faces-config in the configuration
- * information hierarchy of the faces-config.xml file
- *
- */
-public class ReadRenderKitTestCase extends BaseReadTestCase {
-
- public ReadRenderKitTestCase(String name) {
- super(name);
- }
-
- /*
- *Test to see if there is at least one render-kit.
- *This should be specified in the file for reading (faces-config)
- */
- public void testSingleRenderKit() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertNotNull(getRenderKit1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- RenderKitType getRenderKit1(FacesConfigType facesConfig)
- {
- return (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getRenderKit(), "renderKit1");
- }
-
- // Test for the Descirption
- public void testDescriptionGroup()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit = getRenderKit1(edit.getFacesConfig());
- assertNotNull(renderKit);
-
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil
- .findEObjectElementById(renderKit.getDescription()
- , "renderKit1Description");
- assertNotNull(descType);
- assertEquals("Render kit Desc", descType.getTextContent());
-
- DisplayNameType displayName =
- (DisplayNameType) FacesConfigModelUtil
- .findEObjectElementById(renderKit.getDisplayName()
- , "renderKit1DisplayName");
- assertNotNull(displayName);
- assertEquals("Render kit disp name"
- , displayName.getTextContent());
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById(renderKit.getIcon()
- , "renderKit1Icon");
- assertNotNull(iconType);
- assertEquals("small-renderkit-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("large-renderkit-icon"
- , iconType.getLargeIcon().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * chech for hte render-kit-id element
- */
-
- public void testSingleValuedProperties() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit = getRenderKit1(edit.getFacesConfig());
- assertNotNull(renderKit);
-
- assertEquals("render-kit-Id"
- ,renderKit.getRenderKitId().getTextContent());
- assertEquals("render-kit-class"
- ,renderKit.getRenderKitClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Checks to see if there is at least one renderer
- * Note: testing of the renderer is done in ReadRendererTestCase
- */
- public void testRenderer() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- RenderKitType renderKit = getRenderKit1(edit.getFacesConfig());
- assertNotNull(renderKit);
-
- assertEquals(1, renderKit.getRenderer().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
-
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_1_2.java
deleted file mode 100644
index d49942b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_1_2.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadRenderKitTestCase_1_2 extends ReadRenderKitTestCase {
- public ReadRenderKitTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testRenderKitExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit1 = getRenderKit1(edit.getFacesConfig());
- assertNotNull(renderKit1);
-
- assertEquals(1, renderKit1.getRenderKitExtension().size());
- RenderKitExtensionType renderKitExtensionType =
- (RenderKitExtensionType) renderKit1.getRenderKitExtension().get(0);
- assertEquals(1, renderKitExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) renderKitExtensionType.getChildNodes().get(0);
- assertEquals("render-kit-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_2_0.java
deleted file mode 100644
index a57a673..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRenderKitTestCase_2_0.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererType;
-import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererTypeType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadRenderKitTestCase_2_0 extends ReadRenderKitTestCase_1_2 {
- public ReadRenderKitTestCase_2_0(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_2_0.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_2_0;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testClientBehaviorRenderer() {
-
- FacesConfigArtifactEdit edit = null;
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit1 = getRenderKit1(edit.getFacesConfig());
- assertNotNull(renderKit1);
-
- ClientBehaviorRendererType clientBehaviorRenderer1 = (ClientBehaviorRendererType)renderKit1.getClientBehaviorRenderer().get(0);
-// (ClientBehaviorRendererType) FacesConfigModelUtil.findEObjectElementById
-// (renderKit1.getClientBehaviorRenderer(), "client-behavior-renderer-id");
- assertNotNull(clientBehaviorRenderer1);
-
- ClientBehaviorRendererTypeType clientBehaviorRendererType1 = clientBehaviorRenderer1.getClientBehaviorRendererType();
- assertNotNull(clientBehaviorRendererType1);
- assertEquals("MyClientBehaviorRendererType",
- clientBehaviorRendererType1.getTextContent().trim());
-
- ClientBehaviorRendererClassType clientBehaviorRendererClass1 = clientBehaviorRenderer1.getClientBehaviorRendererClass();
- assertNotNull(clientBehaviorRendererClass1);
- assertEquals("com.test.MyClientBehaviorRenderer",
- clientBehaviorRendererClass1.getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRendererTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRendererTestCase.java
deleted file mode 100644
index 9116c17..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadRendererTestCase.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the for the existence of
- * renderer
- */
-public class ReadRendererTestCase extends BaseReadTestCase {
-
- public ReadRendererTestCase(String name) {
- super(name);
- }
-
- /*
- * Check to see if there at least one Renderer in place
- */
- public void testSingleRenderer() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertNotNull(getRenderer1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- private RendererType getRenderer1(FacesConfigType facesConfig)
- {
- RenderKitType renderKitType =
- (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getRenderKit()
- , "renderKit1");
- assertNotNull(renderKitType);
-
- return
- (RendererType) FacesConfigModelUtil
- .findEObjectElementById(renderKitType.getRenderer()
- , "renderKit1Renderer");
- }
-
- /*
- * check for Description. It simply checks to see if there is at least
- * one such item
- *
- */
-
- public void testDescriptionGroup() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RendererType renderKit = getRenderer1(edit.getFacesConfig());
- assertNotNull(renderKit);
-
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil
- .findEObjectElementById(renderKit.getDescription()
- , "renderKit1RendererDescription");
- assertNotNull(descType);
- assertEquals("my renderer description", descType.getTextContent());
-
- DisplayNameType displayName =
- (DisplayNameType) FacesConfigModelUtil
- .findEObjectElementById(renderKit.getDisplayName()
- , "renderKit1RendererDisplayName");
- assertNotNull(displayName);
- assertEquals("my renderer display name"
- , displayName.getTextContent());
-
- IconType iconType =
- (IconType) FacesConfigModelUtil
- .findEObjectElementById(renderKit.getIcon()
- , "renderKit1RendererIcon");
- assertNotNull(iconType);
- assertEquals("renderer-small-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("renderer-large-icon"
- , iconType.getLargeIcon().getTextContent());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * This one tests for the existence of three items
- * They are the required items by all renderers
- * They are : renderer-type, renderer-class and component-family.
- * It thought it was better to put them together instead of
- * writing single -separate methods for all of them.
- */
- public void testStringForRequiredEntries() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RendererType renderer = getRenderer1(edit.getFacesConfig());
- assertNotNull(renderer);
-
- assertEquals("renderer-type"
- , renderer.getRendererType().getTextContent());
- assertEquals("renderer-class"
- , renderer.getRendererClass().getTextContent());
- assertEquals("component-family"
- ,renderer.getComponentFamily().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Basic check. See ReadAttributeRendererTestCase for detailed
- * testing
- */
- public void testAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RendererType renderer = getRenderer1(edit.getFacesConfig());
- assertNotNull(renderer);
-
- assertEquals(1, renderer.getAttribute().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testFacet()
- {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RendererType renderer = getRenderer1(edit.getFacesConfig());
- assertNotNull(renderer);
-
- assertEquals(1, renderer.getFacet().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /*
- * check for Renderer-Extension. It simply checks to see if there is at least
- * one such item
- *
- */
-
- public void testRendererExtension() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- if (edit.getFacesConfig() != null) {
- EList renderKit = edit.getFacesConfig().getRenderKit();
- assertTrue(!renderKit.isEmpty());
- for (int i = 0; i < renderKit.size(); i++) {
- RenderKitType rendererType = (RenderKitType) renderKit
- .get(i);
- assertTrue(!rendererType.getRenderer().isEmpty());
- EList rend = rendererType.getRenderer();
- for (int k = 0; k < rend.size(); k++) {
- RendererType rendType = (RendererType) rend.get(k);
- EList ext= rendType.getRendererExtension();
- assertTrue(ext.size()!=0);
- }
- }
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase.java
deleted file mode 100644
index c313b71..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the validator which is one of
- * many items inside the root elemnt faces-config in the configuration
- * information hierarchy of the faces-config.xml file
- *
- */
-public class ReadValidatorTestCase extends BaseReadTestCase {
-
- public ReadValidatorTestCase(String name) {
- super(name);
- }
-
- /*
- * The following method is used to test for the empty navigation rule. Since
- * I am supplying a single faces-config.xml file as a testing file, I had to
- * testcases fit in to it by controlling the conditions
- *
- */
- public void testSingleValidator() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- assertNotNull(getValidator1(edit.getFacesConfig()));
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- ValidatorType getValidator1(FacesConfigType facesConfig)
- {
- return (ValidatorType)
- FacesConfigModelUtil
- .findEObjectElementById(facesConfig.getValidator(), "validator1");
- }
-
- // Test for the Descirption
- public void testDescriptionGroup() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
- ValidatorType validator1 = getValidator1(edit.getFacesConfig());
- assertNotNull(validator1);
-
- // test descriptioni
- {
- DescriptionType descType =
- (DescriptionType) FacesConfigModelUtil.findEObjectElementById
- (validator1.getDescription(), "validator1_description");
- assertEquals("validator-description"
- , descType.getTextContent());
- }
- // test displayname
- {
- DisplayNameType displayNameType =
- (DisplayNameType) FacesConfigModelUtil.findEObjectElementById
- (validator1.getDisplayName(), "validator1_displayName");
- assertEquals("validator-display-name"
- , displayNameType.getTextContent());
- }
- // test icon
- {
- IconType iconType =
- (IconType) FacesConfigModelUtil.findEObjectElementById
- (validator1.getIcon(), "validator1_icon");
- assertEquals("validator-small-icon"
- , iconType.getSmallIcon().getTextContent());
- assertEquals("validator-large-icon"
- , iconType.getLargeIcon().getTextContent());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testValidatorSingleValueProperties() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ValidatorType validator1 = getValidator1(edit.getFacesConfig());
- assertNotNull(validator1);
-
- assertEquals("validator-Id", validator1.getValidatorId().getTextContent());
- assertEquals("validator-class", validator1.getValidatorClass().getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-
-
- /**
- * Test the attribute sub-property of validators.
- * Note: the attribute itself is tested in ReadAttributeValidatorTestCase
- * this test case just tests the presence of the attribute
- */
- public void testAttribute() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ValidatorType validator = getValidator1(edit.getFacesConfig());
- assertEquals(1, validator.getAttribute().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- /**
- * Test the property sub-property of validators
- * Note: the attribute itself is tested in ReadPropertyValidatorTestCase
- * this test case just tests for the presence of the property
- */
- public void testProperty() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ValidatorType validator = getValidator1(edit.getFacesConfig());
- assertEquals(1, validator.getProperty().size());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase_1_2.java
deleted file mode 100644
index 5144498..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/read/ReadValidatorTestCase_1_2.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.read;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class ReadValidatorTestCase_1_2 extends ReadValidatorTestCase
-{
- public ReadValidatorTestCase_1_2(String name) {
- super(name);
- }
-
- protected void initialize(TestConfiguration testConfiguration) {
- // override base when not in a configurable test suite
- if(_testConfiguration == null)
- {
- _facesConfigFile = "WEB-INF/faces-config_1_2.xml";
- _facesVersion = IJSFCoreConstants.JSF_VERSION_1_2;
- }
- else
- {
- super.initialize(testConfiguration);
- }
- }
-
- public void testValidatorExtension() {
-
- FacesConfigArtifactEdit edit = null;
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ValidatorType validator1 = getValidator1(edit.getFacesConfig());
- assertNotNull(validator1);
-
- assertEquals(1, validator1.getValidatorExtension().size());
- ValidatorExtensionType validatorExtensionType =
- (ValidatorExtensionType) validator1.getValidatorExtension().get(0);
- assertEquals(1, validatorExtensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) validatorExtensionType.getChildNodes().get(0);
- assertEquals("validator-extension-tag", element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/CommonStructuresUtil.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/CommonStructuresUtil.java
deleted file mode 100644
index 5931793..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/CommonStructuresUtil.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.util;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultValueType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.KeyClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.KeyType;
-import org.eclipse.jst.jsf.facesconfig.emf.LargeIconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedPropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntryType;
-import org.eclipse.jst.jsf.facesconfig.emf.NullValueType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.SmallIconType;
-import org.eclipse.jst.jsf.facesconfig.emf.SuggestedValueType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValueClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValueType;
-
-/**
- * Provides utility methods to quickly create and match common structures using
- * a specific prefix
- *
- */
-public final class CommonStructuresUtil extends TestCase {
- private static final String TEST_SANITY = "testSanity";
- private final static FacesConfigPackage _facesConfigPackage = FacesConfigPackage.eINSTANCE;
- private final static FacesConfigFactory _facesConfigFactory = _facesConfigPackage
- .getFacesConfigFactory();
-
- public static final String ID = "id";
- public static final String LANG = "lang";
- public static final String NAME = "name";
- public static final String CLASS = "class";
- public static final String VALUE = "value";
- private static final String KEY = "key";
-
- private static final String DESCRIPTION_VALUE = "description";
- private static final String DISPLAY_VALUE = "displayValue";
- private static final String ICON = "icon";
- private static final String SMALL_ICON = createPreficedString("small", ICON);
- private static final String LARGE_ICON = createPreficedString("large", ICON);;
-
- private static final String SUGGESTED_VALUE = createPreficedString(
- "suggested", VALUE);
- private static final String DEFAULT_VALUE = createPreficedString("default",
- VALUE);;
-
- private static final String ATTRIBUTE = "attribute";
- private static final String ATTRIBUTE_NAME = createPreficedString(
- ATTRIBUTE, NAME);
- private static final String ATTRIBUTE_CLASS = createPreficedString(
- ATTRIBUTE, CLASS);
-
- private static final String PROPERTY = "property";
- private static final String PROPERTY_NAME = createPreficedString(PROPERTY,
- NAME);
- private static final String PROPERTY_CLASS = createPreficedString(PROPERTY,
- CLASS);
-
- private static final String FACET = "facet";
- private static final String FACET_NAME = createPreficedString(FACET, NAME);
-
- private static final String MANAGED_PROPERTY = "managed-property";
- private static final String MAP_ENTRIES = "map-entries";
- private static final String MAP_ENTRIES_KEY_CLASS =
- createPreficedString(MAP_ENTRIES, "key-class");
- private static final String MAP_ENTRIES_VALUE_CLASS =
- createPreficedString(MAP_ENTRIES, "value-class");
- private static final String MAP_ENTRY = "map-entry";
-
- private static final String LIST_ENTRIES = "list-entries";
- private static final String LIST_ENTRIES_VALUE_CLASS =
- createPreficedString(LIST_ENTRIES, "value-class");
-
- public static DescriptionType createDescription(final String prefix) {
- DescriptionType description = _facesConfigFactory
- .createDescriptionType();
- description.setTextContent(createPreficedString(prefix,
- DESCRIPTION_VALUE));
- description.setId(createPreficedString(prefix, ID));
- description.setLang(createPreficedString(prefix, LANG));
- return description;
- }
-
- public static void assertMatchesDescription(String prefix,
- DescriptionType description) {
- assertEquals(createPreficedString(prefix, DESCRIPTION_VALUE),
- description.getTextContent());
- assertEquals(createPreficedString(prefix, ID), description.getId());
- assertEquals(createPreficedString(prefix, LANG), description.getLang());
- }
-
- public static DisplayNameType createDisplayName(final String prefix) {
- DisplayNameType displayName = _facesConfigFactory
- .createDisplayNameType();
- displayName.setTextContent(createPreficedString(prefix, DISPLAY_VALUE));
- displayName.setId(createPreficedString(prefix, ID));
- displayName.setLang(createPreficedString(prefix, LANG));
- return displayName;
- }
-
- public static void assertMatchesDisplayName(String prefix,
- DisplayNameType displayName) {
- assertEquals(createPreficedString(prefix, DISPLAY_VALUE), displayName
- .getTextContent());
- assertEquals(createPreficedString(prefix, ID), displayName.getId());
- assertEquals(createPreficedString(prefix, LANG), displayName.getLang());
- }
-
- public static IconType createIcon(final String prefix) {
- IconType iconType = _facesConfigFactory.createIconType();
- iconType.setId(createPreficedString(prefix, createPreficedString(ICON,
- ID)));
- iconType.setLang(createPreficedString(prefix, LANG));
- SmallIconType smallIconType = _facesConfigFactory.createSmallIconType();
- smallIconType.setTextContent(createPreficedString(prefix, SMALL_ICON));
-
- LargeIconType largeIconType = _facesConfigFactory.createLargeIconType();
- largeIconType.setTextContent(createPreficedString(prefix, LARGE_ICON));
-
- iconType.setSmallIcon(smallIconType);
- iconType.setLargeIcon(largeIconType);
- return iconType;
- }
-
- public static void assertMatchesIcon(final String prefix,
- final IconType iconType) {
- assertEquals(createPreficedString(prefix,
- createPreficedString(ICON, ID)), iconType.getId());
- assertEquals(createPreficedString(prefix, LANG), iconType.getLang());
-
- SmallIconType smallIconType = iconType.getSmallIcon();
- assertEquals(createPreficedString(prefix, SMALL_ICON), smallIconType
- .getTextContent());
-
- LargeIconType largeIconType = iconType.getLargeIcon();
- assertEquals(createPreficedString(prefix, LARGE_ICON), largeIconType
- .getTextContent());
- }
-
- public static AttributeType createAttribute(String prefix) {
- final String ATTRIBUTE_PREFIX = createPreficedString(prefix, ATTRIBUTE);
-
- AttributeType attrType = _facesConfigFactory.createAttributeType();
-
- attrType.getDescription().add(createDescription(ATTRIBUTE_PREFIX));
- attrType.getDisplayName().add(createDisplayName(ATTRIBUTE_PREFIX));
- attrType.getIcon().add(createIcon(ATTRIBUTE_PREFIX));
-
- AttributeNameType attributeNameType = _facesConfigFactory
- .createAttributeNameType();
- attributeNameType.setTextContent(createPreficedString(prefix,
- ATTRIBUTE_NAME));
- attributeNameType.setId(createPreficedString(prefix,
- createPreficedString(ATTRIBUTE_NAME, ID)));
- attrType.setAttributeName(attributeNameType);
-
- AttributeClassType attributeClassType = _facesConfigFactory
- .createAttributeClassType();
- attributeClassType.setTextContent(createPreficedString(prefix,
- ATTRIBUTE_CLASS));
- attributeClassType.setId(createPreficedString(prefix,
- createPreficedString(ATTRIBUTE_CLASS, ID)));
- attrType.setAttributeClass(attributeClassType);
-
- DefaultValueType defaultValueType = _facesConfigFactory
- .createDefaultValueType();
- defaultValueType.setTextContent(createPreficedString(prefix,
- createPreficedString(ATTRIBUTE, DEFAULT_VALUE)));
- defaultValueType.setId(createPreficedString(prefix,
- createPreficedString(ATTRIBUTE, createPreficedString(
- DEFAULT_VALUE, ID))));
- attrType.setDefaultValue(defaultValueType);
-
- SuggestedValueType suggestedValueType = _facesConfigFactory
- .createSuggestedValueType();
- suggestedValueType.setTextContent(createPreficedString(prefix,
- createPreficedString(ATTRIBUTE, SUGGESTED_VALUE)));
- suggestedValueType.setId(createPreficedString(prefix,
- createPreficedString(ATTRIBUTE, createPreficedString(
- SUGGESTED_VALUE, ID))));
-
- attrType.setSuggestedValue(suggestedValueType);
-
- attrType.setId(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE, ID)));
-
- return attrType;
- }
-
- public static void assertMatchAttribute(String prefix,
- AttributeType attrType) {
- final String ATTRIBUTE_PREFIX = createPreficedString(prefix, ATTRIBUTE);
-
- assertEquals(1, attrType.getDescription().size());
- assertMatchesDescription(ATTRIBUTE_PREFIX, (DescriptionType) attrType
- .getDescription().get(0));
-
- assertEquals(1, attrType.getDisplayName().size());
- assertMatchesDisplayName(ATTRIBUTE_PREFIX, (DisplayNameType) attrType
- .getDisplayName().get(0));
-
- assertEquals(1, attrType.getIcon().size());
- assertMatchesIcon(ATTRIBUTE_PREFIX, (IconType) attrType.getIcon()
- .get(0));
-
- AttributeNameType attributeNameType = attrType.getAttributeName();
- assertEquals(createPreficedString(prefix, ATTRIBUTE_NAME),
- attributeNameType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE_NAME, ID)), attributeNameType.getId());
-
- AttributeClassType attributeClassType = attrType.getAttributeClass();
- assertEquals(createPreficedString(prefix, ATTRIBUTE_CLASS),
- attributeClassType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE_CLASS, ID)), attributeClassType.getId());
-
- DefaultValueType defaultValueType = attrType.getDefaultValue();
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE, DEFAULT_VALUE)), defaultValueType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE, createPreficedString(DEFAULT_VALUE, ID))),
- defaultValueType.getId());
-
- SuggestedValueType suggestedValueType = attrType.getSuggestedValue();
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE, SUGGESTED_VALUE)), suggestedValueType
- .getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE, createPreficedString(SUGGESTED_VALUE, ID))),
- suggestedValueType.getId());
-
- assertEquals(createPreficedString(prefix, createPreficedString(
- ATTRIBUTE, ID)), attrType.getId());
- }
-
- public static PropertyType createProperty(final String prefix) {
- final String PROPERTY_PREFIX = createPreficedString(prefix, PROPERTY);
-
- PropertyType propertyType = _facesConfigFactory.createPropertyType();
-
- propertyType.getDescription().add(createDescription(PROPERTY_PREFIX));
- propertyType.getDisplayName().add(createDisplayName(PROPERTY_PREFIX));
- propertyType.getIcon().add(createIcon(PROPERTY_PREFIX));
-
- PropertyNameType propertyNameType = _facesConfigFactory
- .createPropertyNameType();
- propertyNameType.setTextContent(createPreficedString(prefix,
- PROPERTY_NAME));
- propertyNameType.setId(createPreficedString(prefix,
- createPreficedString(PROPERTY_NAME, ID)));
- propertyType.setPropertyName(propertyNameType);
-
- PropertyClassType propertyClassType = _facesConfigFactory
- .createPropertyClassType();
- propertyClassType.setTextContent(createPreficedString(prefix,
- PROPERTY_CLASS));
- propertyClassType.setId(createPreficedString(prefix,
- createPreficedString(PROPERTY_CLASS, ID)));
- propertyType.setPropertyClass(propertyClassType);
-
- DefaultValueType defaultValueType = _facesConfigFactory
- .createDefaultValueType();
- defaultValueType.setTextContent(createPreficedString(prefix,
- createPreficedString(PROPERTY, DEFAULT_VALUE)));
- defaultValueType.setId(createPreficedString(prefix,
- createPreficedString(PROPERTY, createPreficedString(
- DEFAULT_VALUE, ID))));
- propertyType.setDefaultValue(defaultValueType);
-
- SuggestedValueType suggestedValueType = _facesConfigFactory
- .createSuggestedValueType();
- suggestedValueType.setTextContent(createPreficedString(prefix,
- createPreficedString(PROPERTY, SUGGESTED_VALUE)));
- suggestedValueType.setId(createPreficedString(prefix,
- createPreficedString(PROPERTY, createPreficedString(
- SUGGESTED_VALUE, ID))));
- propertyType.setSuggestedValue(suggestedValueType);
-
- propertyType.setId(createPreficedString(prefix, createPreficedString(
- PROPERTY, ID)));
-
- return propertyType;
- }
-
- public static void assertMatchProperty(final String prefix,
- final PropertyType property) {
- final String PROPERTY_PREFIX = createPreficedString(prefix, PROPERTY);
-
- assertEquals(1, property.getDescription().size());
- assertMatchesDescription(PROPERTY_PREFIX, (DescriptionType) property
- .getDescription().get(0));
-
- assertEquals(1, property.getDisplayName().size());
- assertMatchesDisplayName(PROPERTY_PREFIX, (DisplayNameType) property
- .getDisplayName().get(0));
-
- assertEquals(1, property.getIcon().size());
- assertMatchesIcon(PROPERTY_PREFIX, (IconType) property.getIcon().get(0));
-
- PropertyNameType propertyNameType = property.getPropertyName();
- assertEquals(createPreficedString(prefix, PROPERTY_NAME),
- propertyNameType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY_NAME, ID)), propertyNameType.getId());
-
- PropertyClassType propertyClassType = property.getPropertyClass();
- assertEquals(createPreficedString(prefix, PROPERTY_CLASS),
- propertyClassType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY_CLASS, ID)), propertyClassType.getId());
-
- DefaultValueType defaultValueType = property.getDefaultValue();
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY, DEFAULT_VALUE)), defaultValueType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY, createPreficedString(DEFAULT_VALUE, ID))),
- defaultValueType.getId());
-
- SuggestedValueType suggestedValueType = property.getSuggestedValue();
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY, SUGGESTED_VALUE)), suggestedValueType
- .getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY, createPreficedString(SUGGESTED_VALUE, ID))),
- suggestedValueType.getId());
-
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY, ID)), property.getId());
-
- }
-
- public static FacetType createFacet(final String prefix) {
- final String FACET_PREFIX = createPreficedString(prefix, FACET);
-
- final FacetType facet = _facesConfigFactory.createFacetType();
-
- facet.getDescription().add(createDescription(FACET_PREFIX));
- facet.getDisplayName().add(createDisplayName(FACET_PREFIX));
- facet.getIcon().add(createIcon(FACET_PREFIX));
-
- FacetNameType facetNameType = _facesConfigFactory.createFacetNameType();
- facetNameType.setTextContent(createPreficedString(prefix, FACET_NAME));
- facetNameType.setId(createPreficedString(prefix, createPreficedString(
- FACET_NAME, ID)));
- facet.setFacetName(facetNameType);
-
- facet.setId(createPreficedString(prefix,
- createPreficedString(FACET, ID)));
-
- return facet;
- }
-
- public static void assertMatchFacet(final String prefix, FacetType facet) {
- final String FACET_PREFIX = createPreficedString(prefix, FACET);
-
- assertEquals(1, facet.getDescription().size());
- assertMatchesDescription(FACET_PREFIX, (DescriptionType) facet
- .getDescription().get(0));
-
- assertEquals(1, facet.getDisplayName().size());
- assertMatchesDisplayName(FACET_PREFIX, (DisplayNameType) facet
- .getDisplayName().get(0));
-
- assertEquals(1, facet.getIcon().size());
- assertMatchesIcon(FACET_PREFIX, (IconType) facet.getIcon().get(0));
-
- FacetNameType propertyNameType = facet.getFacetName();
- assertEquals(createPreficedString(prefix, FACET_NAME), propertyNameType
- .getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- FACET_NAME, ID)), propertyNameType.getId());
-
- assertEquals(createPreficedString(prefix, createPreficedString(FACET,
- ID)), facet.getId());
- }
-
- public static ManagedPropertyType createManagedPropertyBase(
- final String prefix) {
- final String MANAGED_PROPERTY_PREFIX = createPreficedString(prefix,
- MANAGED_PROPERTY);
-
- final ManagedPropertyType managedProperty = _facesConfigFactory
- .createManagedPropertyType();
-
- managedProperty.getDescription().add(
- createDescription(MANAGED_PROPERTY_PREFIX));
- managedProperty.getDisplayName().add(
- createDisplayName(MANAGED_PROPERTY_PREFIX));
- managedProperty.getIcon().add(createIcon(MANAGED_PROPERTY_PREFIX));
-
- PropertyNameType propertyNameType = _facesConfigFactory
- .createPropertyNameType();
- propertyNameType.setTextContent(createPreficedString(prefix,
- PROPERTY_NAME));
- propertyNameType.setId(createPreficedString(prefix,
- createPreficedString(PROPERTY_NAME, ID)));
- managedProperty.setPropertyName(propertyNameType);
-
- PropertyClassType propertyClassType = _facesConfigFactory
- .createPropertyClassType();
- propertyClassType.setTextContent(createPreficedString(prefix,
- PROPERTY_CLASS));
- propertyClassType.setId(createPreficedString(prefix,
- createPreficedString(PROPERTY_CLASS, ID)));
- managedProperty.setPropertyClass(propertyClassType);
-
- return managedProperty;
- }
-
- public static void assertMatchManagedPropertyBase(final String prefix,
- final ManagedPropertyType managedProperty) {
- final String MANAGED_PROPERTY_PREFIX = createPreficedString(prefix,
- MANAGED_PROPERTY);
-
- assertEquals(1, managedProperty.getDescription().size());
- assertMatchesDescription(MANAGED_PROPERTY_PREFIX,
- (DescriptionType) managedProperty.getDescription().get(0));
-
- assertEquals(1, managedProperty.getDisplayName().size());
- assertMatchesDisplayName(MANAGED_PROPERTY_PREFIX,
- (DisplayNameType) managedProperty.getDisplayName().get(0));
-
- assertEquals(1, managedProperty.getIcon().size());
- assertMatchesIcon(MANAGED_PROPERTY_PREFIX, (IconType) managedProperty
- .getIcon().get(0));
-
- {
- PropertyNameType propertyNameType = managedProperty
- .getPropertyName();
- assertEquals(createPreficedString(prefix, PROPERTY_NAME),
- propertyNameType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY_NAME, ID)), propertyNameType.getId());
- }
-
- {
- PropertyClassType propertyClassType = managedProperty
- .getPropertyClass();
-
- assertEquals(createPreficedString(prefix, PROPERTY_CLASS),
- propertyClassType.getTextContent());
- assertEquals(createPreficedString(prefix, createPreficedString(
- PROPERTY_CLASS, ID)), propertyClassType.getId());
- }
-
- }
-
- public static ValueType createValue(final String prefix) {
- final String VALUE_PREFIX = createPreficedString(prefix, VALUE);
- final ValueType value = _facesConfigFactory.createValueType();
-
- value.setTextContent(VALUE_PREFIX);
- value.setId(createPreficedString(VALUE_PREFIX, ID));
-
- return value;
- }
-
- public static void assertMatchValue(final String prefix, ValueType value)
- {
- final String VALUE_PREFIX = createPreficedString(prefix, VALUE);
-
- assertEquals(VALUE_PREFIX, value.getTextContent());
- assertEquals(createPreficedString(VALUE_PREFIX, ID), value.getId());
- }
-
- public static MapEntriesType createMapEntries(final String prefix)
- {
- final String MAP_ENTRIES_PREFIX =
- createPreficedString(prefix,
- createPreficedString(MANAGED_PROPERTY, MAP_ENTRIES));
- final MapEntriesType mapEntries =
- _facesConfigFactory.createMapEntriesType();
-
- {
- KeyClassType keyClass = _facesConfigFactory.createKeyClassType();
- keyClass.setTextContent(createPreficedString(prefix,MAP_ENTRIES_KEY_CLASS));
- keyClass.setId(createPreficedString(prefix,
- createPreficedString(MAP_ENTRIES_KEY_CLASS, ID)));
- mapEntries.setKeyClass(keyClass);
- }
-
- {
- ValueClassType valueClass = _facesConfigFactory.createValueClassType();
- valueClass.setTextContent(MAP_ENTRIES_VALUE_CLASS);
- valueClass.setId(createPreficedString(MAP_ENTRIES_VALUE_CLASS, ID));
- mapEntries.setValueClass(valueClass);
- }
-
- {
- MapEntryType mapEntry = _facesConfigFactory.createMapEntryType();
- mapEntry.setId(createPreficedString(MAP_ENTRY, ID));
- KeyType keyType = _facesConfigFactory.createKeyType();
- keyType.setId(createPreficedString(createPreficedString(MAP_ENTRY, ID), KEY));
- keyType.setTextContent(createPreficedString(MAP_ENTRY, KEY));
- mapEntry.setKey(keyType);
- mapEntry.setValue(createValue(MAP_ENTRIES_PREFIX));
-
- mapEntries.getMapEntry().add(mapEntry);
- }
-
- {
- MapEntryType mapEntry = _facesConfigFactory.createMapEntryType();
- mapEntry.setId(createPreficedString(createPreficedString(MAP_ENTRY, ID), "2"));
- KeyType keyType = _facesConfigFactory.createKeyType();
- keyType.setId(createPreficedString(createPreficedString(createPreficedString(MAP_ENTRY, ID), KEY),"2"));
- keyType.setTextContent(createPreficedString(createPreficedString(MAP_ENTRY, KEY), "2"));
- mapEntry.setKey(keyType);
- NullValueType nullValue = _facesConfigFactory.createNullValueType();
- nullValue.setId(createPreficedString("null", MAP_ENTRY));
- mapEntry.setNullValue(nullValue);
-
- mapEntries.getMapEntry().add(mapEntry);
- }
-
- mapEntries.setId(createPreficedString(MAP_ENTRIES_PREFIX, ID));
-
- return mapEntries;
- }
-
- public static void assertMatchMapEntries(final String prefix, MapEntriesType mapEntries)
- {
- final String MAP_ENTRIES_PREFIX =
- createPreficedString(prefix,
- createPreficedString(MANAGED_PROPERTY, MAP_ENTRIES));
-
- {
- KeyClassType keyClass = mapEntries.getKeyClass();
- assertEquals(createPreficedString(prefix,MAP_ENTRIES_KEY_CLASS)
- , keyClass.getTextContent());
- assertEquals(createPreficedString(prefix,
- createPreficedString(MAP_ENTRIES_KEY_CLASS, ID))
- , keyClass.getId());
- }
-
- {
- ValueClassType valueClass = mapEntries.getValueClass();
- assertEquals(MAP_ENTRIES_VALUE_CLASS, valueClass.getTextContent());
- assertEquals(createPreficedString(MAP_ENTRIES_VALUE_CLASS, ID)
- , valueClass.getId());
- }
-
- assertEquals(2, mapEntries.getMapEntry().size());
- {
- MapEntryType mapEntry =
- (MapEntryType) mapEntries.getMapEntry().get(0);
- assertEquals(createPreficedString(MAP_ENTRY, ID)
- , mapEntry.getId());
-
- KeyType keyType = mapEntry.getKey();
- assertEquals(createPreficedString(createPreficedString(MAP_ENTRY, ID), KEY)
- , keyType.getId());
- assertEquals(createPreficedString(MAP_ENTRY, KEY)
- , keyType.getTextContent());
- assertMatchValue(MAP_ENTRIES_PREFIX, mapEntry.getValue());
- }
-
- {
- MapEntryType mapEntry =
- (MapEntryType) mapEntries.getMapEntry().get(1);
- assertEquals(createPreficedString(createPreficedString(MAP_ENTRY, ID), "2")
- , mapEntry.getId());
-
- KeyType keyType = mapEntry.getKey();
- assertEquals(createPreficedString(
- createPreficedString(createPreficedString(MAP_ENTRY, ID), KEY), "2")
- , keyType.getId());
-
- NullValueType nullValue = mapEntry.getNullValue();
- assertEquals(createPreficedString("null", MAP_ENTRY), nullValue.getId());
- }
-
- assertEquals(createPreficedString(MAP_ENTRIES_PREFIX, ID)
- , mapEntries.getId());
- }
-
- public static ListEntriesType createListEntries(final String prefix)
- {
- final String LIST_ENTRIES_PREFIX =
- createPreficedString(prefix,
- createPreficedString(MANAGED_PROPERTY, LIST_ENTRIES));
- final ListEntriesType listEntries =
- _facesConfigFactory.createListEntriesType();
-
- {
- ValueClassType valueClass = _facesConfigFactory.createValueClassType();
- valueClass.setTextContent(LIST_ENTRIES_VALUE_CLASS);
- valueClass.setId(createPreficedString(LIST_ENTRIES_VALUE_CLASS, ID));
- listEntries.setValueClass(valueClass);
- }
-
- listEntries.getValue().add(createValue(LIST_ENTRIES_PREFIX));
- listEntries.setId(createPreficedString(LIST_ENTRIES_PREFIX, ID));
-
- return listEntries;
- }
-
- public static void assertMatchListEntries(final String prefix, ListEntriesType listEntries)
- {
- final String LIST_ENTRIES_PREFIX =
- createPreficedString(prefix,
- createPreficedString(MANAGED_PROPERTY, LIST_ENTRIES));
-
- {
- ValueClassType valueClass = listEntries.getValueClass();
- assertEquals(LIST_ENTRIES_VALUE_CLASS, valueClass.getTextContent());
- assertEquals(createPreficedString(LIST_ENTRIES_VALUE_CLASS, ID)
- , valueClass.getId());
- }
-
- assertEquals(1,listEntries.getValue().size());
- ValueType value = (ValueType) listEntries.getValue().get(0);
- assertMatchValue(LIST_ENTRIES_PREFIX, value);
-
- assertEquals(createPreficedString(LIST_ENTRIES_PREFIX, ID), listEntries.getId());
- }
-
- public static String createPreficedString(final String prefix,
- final String value) {
- return prefix + "-" + value;
- }
-
- /**
- * Tests that what is created by each method is successfully matched by the
- * corresponding match method
- */
- public void testSanity() {
- assertMatchesDescription(TEST_SANITY, createDescription(TEST_SANITY));
- assertMatchesDisplayName(TEST_SANITY, createDisplayName(TEST_SANITY));
- assertMatchesIcon(TEST_SANITY, createIcon(TEST_SANITY));
- assertMatchAttribute(TEST_SANITY, createAttribute(TEST_SANITY));
- assertMatchProperty(TEST_SANITY, createProperty(TEST_SANITY));
- assertMatchFacet(TEST_SANITY, createFacet(TEST_SANITY));
- assertMatchManagedPropertyBase(TEST_SANITY,
- createManagedPropertyBase(TEST_SANITY));
- assertMatchValue(TEST_SANITY, createValue(TEST_SANITY));
- assertMatchMapEntries(TEST_SANITY, createMapEntries(TEST_SANITY));
- assertMatchListEntries(TEST_SANITY, createListEntries(TEST_SANITY));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/FacesConfigModelUtil.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/FacesConfigModelUtil.java
deleted file mode 100644
index 381f4fb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/FacesConfigModelUtil.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jst.jsf.facesconfig.emf.ActionListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultRenderKitIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.MessageBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-
-/**
- * Utility methods for model handling in tests
- *
- */
-public final class FacesConfigModelUtil
-{
- /**
- * @param navHandlers
- * @param descriptionText
- * @return the navigation rule from the list navRules
- * whose description text matches descriptionText or null if
- * not found
- */
- public static NavigationRuleType findNavigationHandlerRuleByDescriptionText(List navRules, String descriptionText)
- {
- if (descriptionText == null)
- {
- return null;
- }
-
- for (final Iterator it = navRules.iterator(); it.hasNext();)
- {
- final NavigationRuleType navHandlerType =
- (NavigationRuleType) it.next();
-
- if (findDescriptionType(navHandlerType.getDescription(), descriptionText) != null)
- {
- return navHandlerType;
- }
- }
-
- // not found
- return null;
- }
-
- /**
- * @param navRules
- * @param displayName
- * @return the the navigation rule from the list navRules
- * whose display nmae text matches displayName or null if
- * not found
- */
- public static NavigationRuleType findNavigationHandlerRuleByDisplayName(List navRules, String displayName)
- {
- if (displayName == null)
- {
- return null;
- }
-
- for (final Iterator it = navRules.iterator(); it.hasNext();)
- {
- final NavigationRuleType navHandlerType =
- (NavigationRuleType) it.next();
-
- if (findDisplayNameType(navHandlerType.getDisplayName(), displayName) != null)
- {
- return navHandlerType;
- }
- }
-
- // not found
- return null;
- }
-
-
- /**
- * @param descTypes
- * @param matchText
- * @return the DisplayNameType from descTypes corresponding to
- * matchText or null if not in list. String.equals() is used
- * to match
- */
- public static DisplayNameType findDisplayNameType(List descTypes, String matchText)
- {
- if (matchText == null)
- {
- return null;
- }
-
- for (final Iterator it = descTypes.iterator(); it.hasNext();)
- {
- final DisplayNameType descType = (DisplayNameType) it.next();
- if (matchText.equals(descType.getTextContent()))
- {
- return descType;
- }
- }
-
- // if get through list and not found, then return null
- return null;
- }
-
- /**
- * @param descTypes
- * @param matchText
- * @return the DescriptionType from descTypes corresponding to
- * matchText or null if not in list. String.equals() is used
- * to match
- */
- public static DescriptionType findDescriptionType(List descTypes, String matchText)
- {
- if (matchText == null)
- {
- return null;
- }
-
- for (final Iterator it = descTypes.iterator(); it.hasNext();)
- {
- final DescriptionType descType = (DescriptionType) it.next();
- if (matchText.equals(descType.getTextContent()))
- {
- return descType;
- }
- }
-
- // if get through list and not found, then return null
- return null;
- }
-
- public static IconType findIconTypeByLang(List iconTypes, String xmlLangMatch)
- {
- for (final Iterator it = iconTypes.iterator(); it.hasNext();)
- {
- final IconType icon = (IconType) it.next();
- if (xmlLangMatch == null && icon.getLang() == null)
- {
- return icon;
- }
- else if (xmlLangMatch != null && xmlLangMatch.equals(icon.getLang()))
- {
- return icon;
- }
- }
-
- // not found
- return null;
- }
-
- public static NavigationCaseType findNavigationCaseByDisplayName(List navigationCases, String displayName)
- {
- for (final Iterator it = navigationCases.iterator(); it.hasNext();)
- {
- final NavigationCaseType navCase = (NavigationCaseType) it.next();
-
- if (displayName != null &&
- findDisplayNameType(navCase.getDisplayName(), displayName) != null)
- {
- return navCase;
- }
- }
-
- // not found
- return null;
- }
-
- public static ApplicationType findApplicationById(List applications, String id)
- {
- for (final Iterator it = applications.iterator(); it.hasNext();)
- {
- final ApplicationType app = (ApplicationType) it.next();
-
- if (id != null && id.equals(app.getId()))
- {
- return app;
- }
- }
-
- // not found
- return null;
- }
-
- public static ActionListenerType findActionListenerById(List actionListeners, String id)
- {
- for (final Iterator it = actionListeners.iterator(); it.hasNext();)
- {
- final ActionListenerType app = (ActionListenerType) it.next();
-
- if (id != null && id.equals(app.getId()))
- {
- return app;
- }
- }
-
- // not found
- return null;
- }
-
- /**
- * @param defaultRenderKits
- * @param id
- * @return
- */
- public static DefaultRenderKitIdType findDefaultRenderKitIdTypeById(List defaultRenderKits, String id)
- {
- for (final Iterator it = defaultRenderKits.iterator(); it.hasNext();)
- {
- final DefaultRenderKitIdType renderKitId = (DefaultRenderKitIdType) it.next();
-
- if (id != null && id.equals(renderKitId.getId()))
- {
- return renderKitId;
- }
- }
-
- // not found
- return null;
- }
-
- public static MessageBundleType findMessageBundleTypeById(List messageBundles, String id)
- {
- for (final Iterator it = messageBundles.iterator(); it.hasNext();)
- {
- final MessageBundleType messageBundle = (MessageBundleType) it.next();
-
- if (id != null && id.equals(messageBundle.getId()))
- {
- return messageBundle;
- }
- }
-
- // not found
- return null;
- }
-
- public static EObject findEObjectElementById(List eObjects, String id)
- {
- for (final Iterator it = eObjects.iterator(); it.hasNext();)
- {
- final EObject eObject = (EObject) it.next();
-
- final EStructuralFeature feature =
- eObject.eClass().getEStructuralFeature("id");
- if (feature != null)
- {
- Object value = eObject.eGet(feature);
-
- if (value instanceof String
- && value.equals(id))
- {
- return eObject;
- }
- }
- }
- // not found
- return null;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/WizardUtil.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/WizardUtil.java
deleted file mode 100644
index 636efc0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/util/WizardUtil.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.j2ee.internal.web.archive.operations.WebFacetProjectCreationDataModelProvider;
-import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.osgi.framework.Bundle;
-
-/**
- * Utility class for launching JSF-related wizard operations.
- *
- * @author spaxton
- */
-public class WizardUtil extends Assert {
- private static boolean projectCreated = false;
- private static final String FACESCONFIG_PROJECT_NAME = "FacesConfigUnitTest";
- private static final String FACESCONFIG_EAR_PROJECT_NAME = FACESCONFIG_PROJECT_NAME + "EAR";
-
- public static boolean isProjectCreated() {
- return projectCreated;
- }
-
- public static void createProject(String nameSuffix) {
- if(!isProjectCreated()) {
- // first delete the projects of these names, if present
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IResource oldWebProj = workspace.getRoot().getProject(createProjectName(nameSuffix));
- IResource oldEarProj = workspace.getRoot().getProject(createEarProjectName(nameSuffix));
-
- try {
- workspace.delete(new IResource[] { oldWebProj, oldEarProj }, true, null);
- } catch (CoreException ce) {
- ce.printStackTrace();
- }
-
-
- try {
- WebProjectTestEnvironment testEnv = new WebProjectTestEnvironment(createProjectName(nameSuffix));
- testEnv.createProject(false);
- assertNotNull(testEnv);
- assertNotNull(testEnv.getTestProject());
- assertTrue(testEnv.getTestProject().isAccessible());
-
- IProject project = testEnv.getTestProject();
- checkAndAddFacesConfig(project);
- } catch (Exception t) {
- throw new RuntimeException(t);
- }
-
- projectCreated = true;
- }
- }
-
- protected static IProject createWebProject(String projectName) throws Exception {
- if(!isProjectCreated()) {
- IDataModel dataModel = DataModelFactory.createDataModel(new WebFacetProjectCreationDataModelProvider());
- dataModel.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projectName);
- dataModel.getDefaultOperation().execute(new NullProgressMonitor(), null);
- }
- return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- }
-
- public static void setProjectDirtied() {
- projectCreated = false;
- }
-
- /**
- * Forces recreation of the test project - to be used after unit tests
- * that dirty the project state.
- * @param nameSuffix TODO
- */
- public static void recreateProject(String nameSuffix) {
- setProjectDirtied();
- createProject(nameSuffix);
- }
-
- /**
- * Should call createProject first.
- * @return the test project
- * @param nameSuffix TODO
- */
- public static IProject getTestProject(String nameSuffix) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- return workspace.getRoot().getProject(createProjectName(nameSuffix));
- }
-
- private static String createProjectName(final String nameSuffix)
- {
- // TODO: do we need separate projects for each test?
- return FACESCONFIG_PROJECT_NAME;//+"_"+nameSuffix;
- }
-
- private static String createEarProjectName(final String nameSuffix)
- {
- // TODO: do we need separate projects for each test?
- return FACESCONFIG_EAR_PROJECT_NAME;//+"_"+nameSuffix;
- }
-
- private static void checkAndAddFacesConfig(IProject project) {
- IContainer container = ComponentCore.createComponent(project).getRootFolder().getFolder("/WEB-INF").getUnderlyingFolder();
- IFile facesConfigFile = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config.xml"))); //$NON-NLS-1$
- IFile facesConfigFile1 = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config1.xml"))); //$NON-NLS-1$
- IFile facesConfigFile2 = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config2.xml"))); //$NON-NLS-1$
- IFile facesConfigFile3 = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config3.xml"))); //$NON-NLS-1$
- IFile facesConfigFileExtData = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config-ext-data1.xml"))); //$NON-NLS-1$
-
-
- IFile facesConfig_1_2File = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config_1_2.xml"))); //$NON-NLS-1$
- IFile facesConfig_2_0File = ResourcesPlugin.getWorkspace().getRoot().getFile(container.getFullPath().append(new Path("faces-config_2_0.xml"))); //$NON-NLS-1$
-
- if(facesConfigFile.exists()) {
- return;
- }
-
- final IPath facesConfigPath = new Path("/template/faces-config.xml");
- final IPath facesConfig1Path = new Path("/template/faces-config1.xml");
- final IPath facesConfig2Path = new Path("/template/faces-config2.xml");
- final IPath facesConfig3Path = new Path("/template/faces-config3.xml");
- final IPath facesConfigExtData1Path = new Path("/template/faces-config-ext-data1.xml");
- final IPath facesConfig_1_2_Path = new Path("/template/faces-config_1_2.xml");
- final IPath facesConfig_2_0_Path = new Path("/template/faces-config_2_0.xml");
-
- final Bundle myBundle = Platform.getBundle("org.eclipse.jst.jsf.facesconfig.tests");
- // there is no faces-config, so add our starting template
- try {
-
- {
- final String sourcePath = FileLocator.toFileURL(FileLocator.find(myBundle, facesConfigPath,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File f = new File(sourcePath);
- final FileInputStream sourceStream = new FileInputStream(f);
- facesConfigFile.create(sourceStream, true, null);
- sourceStream.close();
- }
- {
- final String sourcePath1 = FileLocator.toFileURL(FileLocator.find(myBundle,facesConfig1Path,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File f1 = new File(sourcePath1);
- final FileInputStream sourceStream1 = new FileInputStream(f1);
- facesConfigFile1.create(sourceStream1, true, null);
- sourceStream1.close();
- }
- {
- final String sourcePath2 = FileLocator.toFileURL(FileLocator.find(myBundle, facesConfig2Path,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File f2 = new File(sourcePath2);
- final FileInputStream sourceStream2 = new FileInputStream(f2);
- facesConfigFile2.create(sourceStream2, true, null);
- sourceStream2.close();
- }
- {
- final String sourcePath3 = FileLocator.toFileURL(FileLocator.find(myBundle, facesConfig3Path,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File f3 = new File(sourcePath3);
- final FileInputStream sourceStream3 = new FileInputStream(f3);
- facesConfigFile3.create(sourceStream3, true, null);
- sourceStream3.close();
- }
-
- {
- final String sourcePathExtData1 = FileLocator.toFileURL(FileLocator.find(myBundle, facesConfigExtData1Path,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File fext = new File(sourcePathExtData1);
- final FileInputStream sourceStreamExt1 = new FileInputStream(fext);
- facesConfigFileExtData.create(sourceStreamExt1, true, null);
- sourceStreamExt1.close();
- }
-
- {
- final String sourcePathFacesConfig_1_2 =
- FileLocator.toFileURL(FileLocator.find(myBundle, facesConfig_1_2_Path,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File fext = new File(sourcePathFacesConfig_1_2);
- final FileInputStream sourceStreamExt1 = new FileInputStream(fext);
- facesConfig_1_2File.create(sourceStreamExt1, true, null);
- sourceStreamExt1.close();
- }
-
- {
- final String sourcePathFacesConfig_2_0 =
- FileLocator.toFileURL(FileLocator.find(myBundle, facesConfig_2_0_Path,null)).getPath().toString(); //$NON-NLS-1$ //$NON-NLS-2$
- final File fext = new File(sourcePathFacesConfig_2_0);
- final FileInputStream sourceStreamExt2 = new FileInputStream(fext);
- facesConfig_2_0File.create(sourceStreamExt2, true, null);
- sourceStreamExt2.close();
- }
-
- } catch (IOException ioe) {
- ioe.printStackTrace(System.err);
- } catch (CoreException ce) {
- ce.printStackTrace(System.err);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/AllWriteTests.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/AllWriteTests.java
deleted file mode 100644
index 0cc4c86..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/AllWriteTests.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestSuite;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase.TestConfiguration;
-
-/**
- * Wrapper suite for all the tests against the .util package.
- *
- * @author spaxton
- * @author le-ake m. G kristos
- */
-public class AllWriteTests {
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("FacesConfig Model Write/Read Translation");
- suite.addTest(Faces_1_1_suite());
- suite.addTest(Faces_1_2_suite());
- suite.addTest(Faces_2_0_suite());
- return suite;
- }
-
- private static Test Faces_2_0_suite()
- {
- TestConfiguration testConfiguration = new TestConfiguration();
- testConfiguration.put(BaseWriteTestCase.CONFIG_FILE_KEY, "WEB-INF/faces-config3.xml");
- testConfiguration.put(BaseWriteTestCase.FACES_VERSION_KEY, IJSFCoreConstants.JSF_VERSION_2_0);
-
- TestSuite suite =
- new ConfigurableTestSuite(testConfiguration, "Faces 2.0 Model Tests");
- suite.addTest(new ConfigurableTestSuite(WriteFacesConfigTestCase_2_0.class, "Write Facesconfig Test"));
- suite.addTest(new ConfigurableTestSuite(WriteApplicationTestCase_2_0.class, "Write Application Test"));
- suite.addTest(new ConfigurableTestSuite(WriteFactoryTestCase_2_0.class, "Write Factory Test"));
- suite.addTest(new ConfigurableTestSuite(WriteManagedBeanTestCase_2_0.class, "Write Managed-bean Test"));
- suite.addTest(new ConfigurableTestSuite(WriteNavigationRuleTestCase_2_0.class, "Write Navigation Rule Test"));
- suite.addTest(new ConfigurableTestSuite(WriteRenderKitTestCase_2_0.class, "Write Render-kit Test"));
-
- Faces_common_suite(suite, testConfiguration);
-
- return suite;
- }
-
- private static Test Faces_1_2_suite()
- {
- TestConfiguration testConfiguration = new TestConfiguration();
- testConfiguration.put(BaseWriteTestCase.CONFIG_FILE_KEY, "WEB-INF/faces-config2.xml");
- testConfiguration.put(BaseWriteTestCase.FACES_VERSION_KEY, IJSFCoreConstants.JSF_VERSION_1_2);
-
- TestSuite suite =
- new ConfigurableTestSuite(testConfiguration, "Faces 1.2 Model Tests");
- suite.addTest(new ConfigurableTestSuite(
- WriteApplicationTestCase_1_2.class,
- "Write application"));
- suite.addTest(new ConfigurableTestSuite(
- WriteConverterTestCase_1_2.class,
- "Write converter Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteFactoryTestCase_1_2.class,
- "Write factory "));
- suite.addTest(new ConfigurableTestSuite(
- WriteLifecycleTestCase_1_2.class,
- "Write Lifecycle Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteManagedBeanTestCase_1_2.class,
- "Write Managed-bean Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteNavigationRuleTestCase_1_2.class,
- "Write navigation rule"));
- suite.addTest(new ConfigurableTestSuite(
- WriteRenderKitTestCase_1_2.class,
- "Write Render-kit Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteValidatorTestCase_1_2.class,
- "Write Validator Test"));
- suite.addTest(new ConfigurableTestSuite(
- FacesConfigExtensionTestCase.class,
- "Write Facesconfig Extension Test"));
-
-
- Faces_common_suite(suite, testConfiguration);
-
- return suite;
- }
-
- private static Test Faces_1_1_suite()
- {
- TestConfiguration testConfiguration = new TestConfiguration();
- testConfiguration.put(BaseWriteTestCase.CONFIG_FILE_KEY, "WEB-INF/faces-config1.xml");
- testConfiguration.put(BaseWriteTestCase.FACES_VERSION_KEY, IJSFCoreConstants.JSF_VERSION_1_1);
-
- TestSuite suite =
- new ConfigurableTestSuite(testConfiguration, "Faces 1.1 Model Tests");
-
- suite.addTest(new ConfigurableTestSuite(
- WriteApplicationTestCase.class,
- "Write application"));
- suite.addTest(new ConfigurableTestSuite(
- WriteConverterTestCase.class,
- "Write converter Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteFactoryTestCase.class,
- "Write factory "));
- suite.addTest(new ConfigurableTestSuite(
- WriteLifecycleTestCase.class,
- "Write Lifecycle Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteManagedBeanTestCase.class,
- "Write Managed-bean Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteNavigationRuleTestCase.class,
- "Write navigation rule "));
- suite.addTest(new ConfigurableTestSuite(
- WriteRenderKitTestCase.class,
- "Write Render-kit Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteValidatorTestCase.class,
- "Write Validator Test"));
- Faces_common_suite(suite, testConfiguration);
-
- return suite;
- }
-
- private static void Faces_common_suite(TestSuite suite, TestConfiguration configuration)
- {
- suite.addTest(new ConfigurableTestSuite(
- CommonStructuresUtil.class,
- "Sanity Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteComponentTestCase.class,
- "Write Component Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteReferencedBeanTestCase.class,
- "Write ReferencedBean Test"));
- suite.addTest(new ConfigurableTestSuite(
- WriteComponentExtensionDataTestCase.class,
- "Write Component Extension Data"));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/BaseWriteTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/BaseWriteTestCase.java
deleted file mode 100644
index 285e845..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/BaseWriteTestCase.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.tests.util.WizardUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-
-public class BaseWriteTestCase extends ConfigurableTestCase
-{
- final static String CONFIG_FILE_KEY = "config-file-key";
- final static String FACES_VERSION_KEY = "faces-version-key";
-
- protected IProject project;
- protected String _facesConfigFile;
- protected String _facesVersion;
-
- public BaseWriteTestCase(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- initialize(_testConfiguration);
-
- JSFTestUtil.setValidationEnabled(false);
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.uk.oracle.com", "80");
-
- WizardUtil.createProject(getName());
- project = WizardUtil.getTestProject(getName());
- }
-
- protected FacesConfigArtifactEdit getArtifactEditForRead()
- {
- FacesConfigArtifactEdit edit = FacesConfigArtifactEdit
- .getFacesConfigArtifactEditForRead(project, _facesConfigFile);
- assertNotNull(edit);
- return edit;
- }
-
- protected FacesConfigArtifactEdit getArtifactEditForWrite()
- {
- FacesConfigArtifactEdit edit = FacesConfigArtifactEdit
- .getFacesConfigArtifactEditForWrite(project, _facesConfigFile);
- assertNotNull(edit);
- return edit;
- }
-
- protected void initialize(TestConfiguration testConfiguration)
- {
- if (_testConfiguration != null)
- {
- _facesConfigFile = _testConfiguration.get(CONFIG_FILE_KEY);
- assertNotNull(_facesConfigFile);
- _facesVersion = _testConfiguration.get(FACES_VERSION_KEY);
- assertNotNull(_facesVersion);
- }
- }
-
- protected DynamicElement createDynamicElement(String name)
- {
- DynamicElement element =
- FacesConfigFactory.eINSTANCE.createDynamicElement();
- element.setName(name);
- return element;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/FacesConfigExtensionTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/FacesConfigExtensionTestCase.java
deleted file mode 100644
index f886d1f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/FacesConfigExtensionTestCase.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class FacesConfigExtensionTestCase extends BaseWriteTestCase {
- private static final String FACES_CONFIG = "faces-config";
-
- private final static String FACES_CONFIG_EXTENSION = CommonStructuresUtil
- .createPreficedString(FACES_CONFIG, "extension");
- private final static String FACES_CONFIG_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(FACES_CONFIG_EXTENSION, "id");
- private final static String FACES_CONFIG_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(FACES_CONFIG_EXTENSION, "tag");
-
- public FacesConfigExtensionTestCase(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- // test should not be used with 1.1
- assertNotSame(IJSFCoreConstants.JSF_VERSION_1_1, _facesVersion);
- }
-
- public void testFacesConfigExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- FacesConfigType facesConfigType = edit.getFacesConfig();
-
- FacesConfigExtensionType extensionType = facesConfigFactory
- .createFacesConfigExtensionType();
- extensionType.setId(FACES_CONFIG_EXTENSION_ID);
-
- extensionType.getChildNodes().add(
- createDynamicElement(FACES_CONFIG_EXTENSION_TAG));
-
- facesConfigType.getFacesConfigExtension().add(extensionType);
-
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigType facesConfig = edit.getFacesConfig();
-
- assertEquals(1, facesConfig.getFacesConfigExtension().size());
- FacesConfigExtensionType extensionType = (FacesConfigExtensionType) facesConfig
- .getFacesConfigExtension().get(0);
- assertEquals(FACES_CONFIG_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType
- .getChildNodes().get(0);
- assertEquals(FACES_CONFIG_EXTENSION_TAG, element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase.java
deleted file mode 100644
index 8f3c7e5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ActionListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultLocaleType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultRenderKitIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.LocaleConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.MessageBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationHandlerType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.StateManagerType;
-import org.eclipse.jst.jsf.facesconfig.emf.SupportedLocaleType;
-import org.eclipse.jst.jsf.facesconfig.emf.VariableResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This class is used to test wether the writing into the faces-config.xml file
- * is being done propertly and the outputs are as expected
- *
- */
-public class WriteApplicationTestCase extends BaseWriteTestCase {
- private static final String SUPPORTED_LOCALE_TYPE = "supported-locale-type";
-
- private static final String DEFAULT_LOCALE = "default-locale";
-
- private final static String actionListener = "action-listener";
- private final static String variableResolver = "variable-resolver";
- private final static String defaultRenderKitId = "default-render-kit-id";
- private final static String messageBundle = "message-bundle";
- private final static String navigationHandler = "navigation-handler";
- private final static String viewHandler = "view-handler";
- private final static String stateManager = "state-manager";
- private final static String propertyResolver = "property-resolver";
-
- private final static String APPLICATION_ID = "application-id";
-
- public WriteApplicationTestCase(String name) {
- super(name);
- }
-
- /*
- * Do the writing here to all the attributes
- *
- */
- public void testWriteApplication() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
-
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ApplicationType newApplication = facesConfigFactory
- .createApplicationType();
- newApplication.setId(APPLICATION_ID);
-
- ActionListenerType actionList = facesConfigFactory
- .createActionListenerType();
- actionList.setTextContent(actionListener);
- newApplication.getActionListener().add(actionList);
-
- VariableResolverType variableResolverType = facesConfigFactory
- .createVariableResolverType();
- variableResolverType.setTextContent(variableResolver);
- newApplication.getVariableResolver().add(variableResolverType);
-
- DefaultRenderKitIdType renderKitIdType = facesConfigFactory
- .createDefaultRenderKitIdType();
- renderKitIdType.setTextContent(defaultRenderKitId);
- newApplication.getDefaultRenderKitId().add(renderKitIdType);
-
- MessageBundleType messageBundleType = facesConfigFactory
- .createMessageBundleType();
- messageBundleType.setTextContent(messageBundle);
- newApplication.getMessageBundle().add(messageBundleType);
-
- NavigationHandlerType navigationHandlerType = facesConfigFactory
- .createNavigationHandlerType();
- navigationHandlerType.setTextContent(navigationHandler);
- newApplication.getNavigationHandler().add(navigationHandlerType);
-
- ViewHandlerType viewHandlerType = facesConfigFactory
- .createViewHandlerType();
- viewHandlerType.setTextContent(viewHandler);
- newApplication.getViewHandler().add(viewHandlerType);
-
- StateManagerType stateManagerType = facesConfigFactory
- .createStateManagerType();
- stateManagerType.setTextContent(stateManager);
- newApplication.getStateManager().add(stateManagerType);
-
- PropertyResolverType propertyResolverType = facesConfigFactory
- .createPropertyResolverType();
- propertyResolverType.setTextContent(propertyResolver);
- newApplication.getPropertyResolver().add(propertyResolverType);
-
- LocaleConfigType localConfigType = facesConfigFactory
- .createLocaleConfigType();
- DefaultLocaleType defaultLocaleType = facesConfigFactory
- .createDefaultLocaleType();
- defaultLocaleType.setTextContent(DEFAULT_LOCALE);
- localConfigType.setDefaultLocale(defaultLocaleType);
-
- SupportedLocaleType supportedLocalType = facesConfigFactory
- .createSupportedLocaleType();
- supportedLocalType.setTextContent(SUPPORTED_LOCALE_TYPE);
- localConfigType.getSupportedLocale().add(supportedLocalType);
-
- newApplication.getLocaleConfig().add(localConfigType);
-
- edit.getFacesConfig().getApplication().add(newApplication);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- // assert that the file has been disposed
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- // now read back the file
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ApplicationType application =
- (ApplicationType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig().getApplication(), APPLICATION_ID);
-
- assertEquals(1, application.getActionListener().size());
- assertEquals(actionListener, ((ActionListenerType) application
- .getActionListener().get(0)).getTextContent());
-
- assertEquals(1, application.getVariableResolver().size());
- assertEquals(variableResolver, ((VariableResolverType) application
- .getVariableResolver().get(0)).getTextContent());
-
- assertEquals(1, application.getDefaultRenderKitId().size());
- assertEquals(defaultRenderKitId,
- ((DefaultRenderKitIdType) application
- .getDefaultRenderKitId().get(0)).getTextContent());
-
- assertEquals(1, application.getMessageBundle().size());
- assertEquals(messageBundle, ((MessageBundleType) application
- .getMessageBundle().get(0)).getTextContent());
-
- assertEquals(1, application.getNavigationHandler().size());
- assertEquals(navigationHandler,
- ((NavigationHandlerType) application.getNavigationHandler()
- .get(0)).getTextContent());
-
- assertEquals(1, application.getViewHandler().size());
- assertEquals(viewHandler, ((ViewHandlerType) application
- .getViewHandler().get(0)).getTextContent());
-
- assertEquals(1, application.getStateManager().size());
- assertEquals(stateManager, ((StateManagerType) application
- .getStateManager().get(0)).getTextContent());
-
- assertEquals(1, application.getPropertyResolver().size());
- assertEquals(propertyResolver, ((PropertyResolverType) application
- .getPropertyResolver().get(0)).getTextContent());
-
- assertEquals(1, application.getLocaleConfig().size());
- LocaleConfigType localConfigType = (LocaleConfigType) application
- .getLocaleConfig().get(0);
-
- assertEquals(DEFAULT_LOCALE, localConfigType.getDefaultLocale()
- .getTextContent());
- assertEquals(1, localConfigType.getSupportedLocale().size());
-
- assertEquals(SUPPORTED_LOCALE_TYPE,
- ((SupportedLocaleType) localConfigType.getSupportedLocale()
- .get(0)).getTextContent());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_1_2.java
deleted file mode 100644
index 2025b6c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_1_2.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.BaseNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.ELResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.VarType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteApplicationTestCase_1_2 extends WriteApplicationTestCase
-{
- protected final static String APPLICATION_ID_1_2 = "application-id-1_2";
- protected final static String EL_RESOLVER = "org.test.MyELResolver";
- protected final static String RESOURCE_BUNDLE = "resourceBundle";
- protected final static String BASE_NAME = "baseName";
- protected final static String VAR = "varX";
- protected final static String APPLICATION_EXTENSION = "application-extension";
-
- public WriteApplicationTestCase_1_2(String name)
- {
- super(name);
- }
-
- public void test12Features()
- {
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
-
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ApplicationType newApplication = facesConfigFactory
- .createApplicationType();
- newApplication.setId(APPLICATION_ID_1_2);
-
- ELResolverType elResolver = facesConfigFactory.createELResolverType();
- elResolver.setId(CommonStructuresUtil.createPreficedString(EL_RESOLVER, "id"));
- elResolver.setTextContent(EL_RESOLVER);
-
- newApplication.getELResolver().add(elResolver);
-
- ResourceBundleType resourceBundle =
- facesConfigFactory.createResourceBundleType();
-
- resourceBundle.getDescription().add(
- CommonStructuresUtil.createDescription(RESOURCE_BUNDLE));
- resourceBundle.getDisplayName().add(
- CommonStructuresUtil.createDisplayName(RESOURCE_BUNDLE));
- resourceBundle.getIcon().add(
- CommonStructuresUtil.createIcon(RESOURCE_BUNDLE));
-
- {
- BaseNameType baseNameType = facesConfigFactory.createBaseNameType();
- baseNameType.setId(CommonStructuresUtil.createPreficedString(BASE_NAME, "id"));
- baseNameType.setTextContent(BASE_NAME);
- resourceBundle.setBaseName(baseNameType);
- }
-
- {
- VarType varType = facesConfigFactory.createVarType();
- varType.setId(CommonStructuresUtil.createPreficedString(VAR, "id"));
- varType.setTextContent(VAR);
- resourceBundle.setVar(varType);
- }
- resourceBundle.setId(CommonStructuresUtil.createPreficedString(RESOURCE_BUNDLE, "id"));
- newApplication.getResourceBundle().add(resourceBundle);
-
- ApplicationExtensionType appExt =
- facesConfigFactory.createApplicationExtensionType();
- appExt.setId(
- CommonStructuresUtil.createPreficedString(APPLICATION_EXTENSION, "id"));
-
- DynamicElement element = createDynamicElement(
- CommonStructuresUtil.createPreficedString(APPLICATION_EXTENSION, "tag"));
- appExt.getChildNodes().add(element);
- newApplication.getApplicationExtension().add(appExt);
-
- edit.getFacesConfig().getApplication().add(newApplication);
- edit.save(null);
- }
- finally
- {
- if (edit != null) {
- edit.dispose();
- // assert that the file has been disposed
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- // now read back the file
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-// assertEquals(1, edit.getFacesConfig().getApplication().size());
- ApplicationType application =
- (ApplicationType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig().getApplication(), APPLICATION_ID_1_2);
- assertNotNull(application);
-
- assertEquals(1, application.getELResolver().size());
- ELResolverType elResolver = (ELResolverType) application .getELResolver().get(0);
- assertEquals(CommonStructuresUtil.createPreficedString(EL_RESOLVER, "id"),
- elResolver.getId());
- assertEquals(EL_RESOLVER, elResolver.getTextContent());
-
- assertEquals(1, application.getResourceBundle().size());
- ResourceBundleType resourceBundle =
- (ResourceBundleType) application.getResourceBundle().get(0);
-
- assertEquals(1, resourceBundle.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription
- (RESOURCE_BUNDLE, (DescriptionType) resourceBundle.getDescription().get(0));
-
- assertEquals(1, resourceBundle.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName
- (RESOURCE_BUNDLE, (DisplayNameType) resourceBundle.getDisplayName().get(0));
-
- assertEquals(1, resourceBundle.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon
- (RESOURCE_BUNDLE, (IconType) resourceBundle.getIcon().get(0));
-
- {
- BaseNameType baseNameType = resourceBundle.getBaseName();
- assertEquals(CommonStructuresUtil.createPreficedString(BASE_NAME, "id"),
- baseNameType.getId());
- assertEquals(BASE_NAME, baseNameType.getTextContent());
- }
-
- {
- VarType varType = resourceBundle.getVar();
- assertEquals(CommonStructuresUtil.createPreficedString(VAR, "id"),
- varType.getId());
- assertEquals(VAR, varType.getTextContent());
-
- }
- assertEquals(CommonStructuresUtil.createPreficedString(RESOURCE_BUNDLE, "id"),
- resourceBundle.getId());
-
- ApplicationExtensionType appExt =
- (ApplicationExtensionType) FacesConfigModelUtil
- .findEObjectElementById(application.getApplicationExtension()
- , CommonStructuresUtil.createPreficedString(APPLICATION_EXTENSION, "id"));
-
- assertEquals(1, appExt.getChildNodes().size());
- DynamicElement element =
- (DynamicElement) appExt.getChildNodes().get(0);
- assertEquals(CommonStructuresUtil.createPreficedString(APPLICATION_EXTENSION, "tag")
- ,element.getName());
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
- }
-
-// private ApplicationType getApplication(FacesConfigType facesConfig)
-// {
-// FacesConfigModelUtil
-// }
-}
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_2_0.java
deleted file mode 100644
index 49f8a70..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteApplicationTestCase_2_0.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-import org.eclipse.jst.jsf.facesconfig.emf.DefaultValidatorsType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ResourceHandlerType;
-import org.eclipse.jst.jsf.facesconfig.emf.SourceClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.SystemEventClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.SystemEventListenerClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.SystemEventListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorIdType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteApplicationTestCase_2_0 extends WriteApplicationTestCase_1_2
-{
- private final static String APPLICATION_ID_2_0 = "application-id-2_0";
-// private final static String PARTIAL_TRAVERSAL = "partial-traversal";
- private final static String RESOURCE_HANDLER = "resource-handler";
- private final static String SYSTEM_EVENT_LISTENER = "system-event-listener";
- private final static String SYSTEM_EVENT_LISTENER_CLASS = "system-event-listener-class";
- private final static String SYSTEM_EVENT_CLASS = "system-event-class";
- private final static String SOURCE_CLASS = "source-class";
- private final static String DEFAULT_VALIDATORS="default-validators";
- private final static String VALIDATOR_ID="validator-id";
-
- public WriteApplicationTestCase_2_0(String name)
- {
- super(name);
- }
-
- public void testApplication20()
- {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
-
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ApplicationType newApplication = facesConfigFactory
- .createApplicationType();
- newApplication.setId(APPLICATION_ID_2_0);
-
-// PartialTraversalType partialTraversal = facesConfigFactory.createPartialTraversalType();
-// partialTraversal.setTextContent(PARTIAL_TRAVERSAL);
-// newApplication.getPartialTraversal().add(partialTraversal);
-
- ResourceHandlerType resourceHandlerType = facesConfigFactory.createResourceHandlerType();
- resourceHandlerType.setTextContent(RESOURCE_HANDLER);
- newApplication.getResourceHandler().add(resourceHandlerType);
-
- SystemEventListenerType systemEventListener = facesConfigFactory.createSystemEventListenerType();
- systemEventListener.setId(SYSTEM_EVENT_LISTENER);
- newApplication.getSystemEventListener().add(systemEventListener);
- SystemEventListenerClassType systemEventListenerClass = facesConfigFactory.createSystemEventListenerClassType();
- systemEventListenerClass.setTextContent(SYSTEM_EVENT_LISTENER_CLASS);
- systemEventListener.setSystemEventListenerClass(systemEventListenerClass);
- SystemEventClassType systemEventClass = facesConfigFactory.createSystemEventClassType();
- systemEventClass.setTextContent(SYSTEM_EVENT_CLASS);
- systemEventListener.setSystemEventClass(systemEventClass);
- SourceClassType sourceClass = facesConfigFactory.createSourceClassType();
- sourceClass.setTextContent(SOURCE_CLASS);
- systemEventListener.setSourceClass(sourceClass);
-
- DefaultValidatorsType defaultValidators = facesConfigFactory.createDefaultValidatorsType();
- defaultValidators.setId(DEFAULT_VALIDATORS);
- newApplication.getDefaultValidators().add(defaultValidators);
- ValidatorIdType validatorId = facesConfigFactory.createValidatorIdType();
- validatorId.setTextContent(VALIDATOR_ID);
- defaultValidators.getValidatorId().add(validatorId);
-
- edit.getFacesConfig().getApplication().add(newApplication);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- // assert that the file has been disposed
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- // now read back the file
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ApplicationType application =
- (ApplicationType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig().getApplication(), APPLICATION_ID_2_0);
-
-// assertEquals(1, application.getPartialTraversal().size());
-// assertEquals(PARTIAL_TRAVERSAL, ((PartialTraversalType) application
-// .getPartialTraversal().get(0)).getTextContent());
-
- assertEquals(1, application.getResourceHandler().size());
- assertEquals(RESOURCE_HANDLER, ((ResourceHandlerType) application
- .getResourceHandler().get(0)).getTextContent());
-
- assertEquals(1, application.getSystemEventListener().size());
- SystemEventListenerType systemEventListener = ((SystemEventListenerType) application
- .getSystemEventListener().get(0));
- assertEquals(SYSTEM_EVENT_LISTENER, systemEventListener.getId());
-// assertEquals(1, systemEventListener.getSystemEventListenerClass().size());
-// assertEquals(SYSTEM_EVENT_LISTENER_CLASS, ((SystemEventListenerClassType) systemEventListener
-// .getSystemEventListenerClass().get(0)).getTextContent());
-
- assertEquals(SYSTEM_EVENT_LISTENER_CLASS,systemEventListener
- .getSystemEventListenerClass().getTextContent());
-
-// assertEquals(1, systemEventListener.getSystemEventClass().size());
-// assertEquals(SYSTEM_EVENT_CLASS, ((SystemEventClassType) systemEventListener
-// .getSystemEventClass().get(0)).getTextContent());
- assertEquals(SYSTEM_EVENT_CLASS, systemEventListener
- .getSystemEventClass().getTextContent());
-
-// assertEquals(1, systemEventListener.getSourceClass().size());
-// assertEquals(SOURCE_CLASS, ((SourceClassType) systemEventListener
-// .getSourceClass().get(0)).getTextContent());
-
- assertEquals(SOURCE_CLASS, systemEventListener
- .getSourceClass().getTextContent());
-
- assertEquals(1, application.getDefaultValidators().size());
- DefaultValidatorsType defaultValidators = (DefaultValidatorsType)application.getDefaultValidators().get(0);
- assertEquals(DEFAULT_VALIDATORS, defaultValidators.getId());
- assertEquals(1, defaultValidators.getValidatorId().size());
- assertEquals(VALIDATOR_ID, ((ValidatorIdType)defaultValidators.getValidatorId().get(0)).getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentExtensionDataTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentExtensionDataTestCase.java
deleted file mode 100644
index 7bccd9f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentExtensionDataTestCase.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentTypeType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteComponentExtensionDataTestCase extends BaseWriteTestCase {
- private static final String COMPONENT_ID = "component1";
-
- private static final String COMPONENT_CLASS = "component-class";
-
- private static final String COMPONENT_TYPE = "component-type";
-
- public WriteComponentExtensionDataTestCase(String name) {
- super(name);
- }
-
-
- public void testWriteExtensionData()
- {
- FacesConfigArtifactEdit edit = null;
- try
- {
- edit = FacesConfigArtifactEdit
- .getFacesConfigArtifactEditForWrite(project, "WEB-INF/faces-config-ext-data1.xml");
- assertNotNull(edit);
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ComponentType newComponent =
- (ComponentType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getComponent(), COMPONENT_ID);
-
- {
- ComponentTypeType componentTypeType = facesConfigFactory.createComponentTypeType();
- componentTypeType.setTextContent(COMPONENT_TYPE);
- componentTypeType.setId(CommonStructuresUtil.createPreficedString(COMPONENT_TYPE
- , CommonStructuresUtil.ID));
- newComponent.setComponentType(componentTypeType);
- }
-
- {
- ComponentClassType componentClassType = facesConfigFactory.createComponentClassType();
- componentClassType.setTextContent(COMPONENT_CLASS);
- componentClassType.setId(CommonStructuresUtil.createPreficedString(COMPONENT_CLASS
- , CommonStructuresUtil.ID));
- newComponent.setComponentClass(componentClassType);
- }
-
-// ComponentExtensionType extType =
-// facesConfigFactory.createComponentExtensionType();
-// extType.setId(CommonStructuresUtil.createPreficedString(COMPONENT, "extension-id"));
-//
-// DynamicElement singleRoot = facesConfigFactory.createDynamicElement();
-// singleRoot.setName("any-data");
-// DynamicAttribute attribute = facesConfigFactory.createDynamicAttribute();
-// attribute.setName("some-attribute");
-// attribute.setValue("some-value");
-// singleRoot.getAttributes().add(attribute);
-//
-// DynamicElement firstChild = facesConfigFactory.createDynamicElement();
-// firstChild.setName("first-child");
-// singleRoot.getChildNodes().add(firstChild);
-//
-// DynamicElement secondChild =
-// facesConfigFactory.createDynamicElement();
-// secondChild.setName("second-child");
-// //secondChild.setTextContent("secondChild text content");
-// singleRoot.getChildNodes().add(secondChild);
-// extType.getChildNodes().add(singleRoot);
-// newComponent.getComponentExtension().add(extType);
-
- edit.getFacesConfig().getComponent().add(newComponent);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentTestCase.java
deleted file mode 100644
index 2cf30b8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteComponentTestCase.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentTypeType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteComponentTestCase extends BaseWriteTestCase {
-
- private static final String COMPONENT = "component";
-
- private static final String COMPONENT_CLASS = "component-class";
-
- private static final String COMPONENT_TYPE = "component-type";
-
- public WriteComponentTestCase(String name) {
- super(name);
- }
-
- public void testWriteComponent() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ComponentType newComponent = facesConfigFactory
- .createComponentType();
-
- newComponent.getDescription().add(CommonStructuresUtil.createDescription(COMPONENT));
- newComponent.getDisplayName().add(CommonStructuresUtil.createDisplayName(COMPONENT));
- newComponent.getIcon().add(CommonStructuresUtil.createIcon(COMPONENT));
-
- {
- ComponentTypeType componentTypeType = facesConfigFactory.createComponentTypeType();
- componentTypeType.setTextContent(COMPONENT_TYPE);
- componentTypeType.setId(CommonStructuresUtil.createPreficedString(COMPONENT_TYPE
- , CommonStructuresUtil.ID));
- newComponent.setComponentType(componentTypeType);
- }
-
- {
- ComponentClassType componentClassType = facesConfigFactory.createComponentClassType();
- componentClassType.setTextContent(COMPONENT_CLASS);
- componentClassType.setId(CommonStructuresUtil.createPreficedString(COMPONENT_CLASS
- , CommonStructuresUtil.ID));
- newComponent.setComponentClass(componentClassType);
- }
-
- // attributes
- newComponent.getAttribute().add(CommonStructuresUtil.createAttribute(COMPONENT));
-
- // property section
- newComponent.getProperty().add(CommonStructuresUtil.createProperty(COMPONENT));
-
- // facets
- newComponent.getFacet().add(CommonStructuresUtil.createFacet(COMPONENT));
-
- // component-extension
- ComponentExtensionType ext =
- facesConfigFactory.createComponentExtensionType();
-
- DynamicElement element = facesConfigFactory.createDynamicElement();
- element.setName("some-meta-data");
- ext.getChildNodes().add(element);
- newComponent.getComponentExtension().add(ext);
-
- edit.getFacesConfig().getComponent().add(newComponent);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertEquals(1, edit.getFacesConfig().getComponent().size());
-
- final ComponentType component =
- (ComponentType) edit.getFacesConfig().getComponent().get(0);
-
- assertEquals(1, component.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription
- (COMPONENT, (DescriptionType) component.getDescription().get(0));
-
- assertEquals(1, component.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName
- (COMPONENT, (DisplayNameType)component.getDisplayName().get(0));
-
- assertEquals(1, component.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon
- (COMPONENT, (IconType)component.getIcon().get(0));
- {
- ComponentTypeType componentTypeType = component.getComponentType();
- assertEquals(COMPONENT_TYPE
- , componentTypeType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(COMPONENT_TYPE
- , CommonStructuresUtil.ID)
- , componentTypeType.getId());
- }
-
- {
- ComponentClassType componentClassType = component.getComponentClass();
- assertEquals(COMPONENT_CLASS
- , componentClassType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(COMPONENT_CLASS
- , CommonStructuresUtil.ID)
- , componentClassType.getId());
- }
-
- assertEquals(1, component.getAttribute().size());
- CommonStructuresUtil.assertMatchAttribute(COMPONENT
- ,(AttributeType) component.getAttribute().get(0));
-
- assertEquals(1, component.getProperty().size());
- CommonStructuresUtil.assertMatchProperty(COMPONENT
- ,(PropertyType) component.getProperty().get(0));
-
- assertEquals(1, component.getFacet().size());
- CommonStructuresUtil.assertMatchFacet(COMPONENT
- ,(FacetType) component.getFacet().get(0));
-
- // component-extension
- assertEquals(1, component.getComponentExtension().size());
- ComponentExtensionType ext =
- (ComponentExtensionType) component.getComponentExtension().get(0);
-
- assertEquals(1, ext.getChildNodes().size());
- DynamicElement element =
- (DynamicElement)ext.getChildNodes().get(0);
- assertEquals("some-meta-data", element.getName());
-
- } finally {
-
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase.java
deleted file mode 100644
index 7009418..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterForClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteConverterTestCase extends BaseWriteTestCase {
- protected static final String CONVERTER = "converter";
- private static final String CONVERTER_CLASS =
- CommonStructuresUtil.createPreficedString(CONVERTER, CommonStructuresUtil.CLASS);
- private static final String CONVERTER_CLASS_FOR =
- CommonStructuresUtil.createPreficedString(CONVERTER
- , CommonStructuresUtil.createPreficedString(CommonStructuresUtil.CLASS, "for"));
- protected static final String CONVERTER_ID =
- CommonStructuresUtil.createPreficedString(CONVERTER, CommonStructuresUtil.ID);
-
- public WriteConverterTestCase(String name) {
- super(name);
- }
-
- public void testWriteConverter() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- ConverterType converter = facesConfigFactory.createConverterType();
-
- converter.getDescription().add(CommonStructuresUtil.createDescription(CONVERTER));
- converter.getDisplayName().add(CommonStructuresUtil.createDisplayName(CONVERTER));
- converter.getIcon().add(CommonStructuresUtil.createIcon(CONVERTER));
-
- {
- ConverterClassType converterClassType = facesConfigFactory.createConverterClassType();
- converterClassType.setTextContent(CONVERTER_CLASS);
- converterClassType.setId(CommonStructuresUtil.createPreficedString(CONVERTER_CLASS
- , CommonStructuresUtil.ID));
- converter.setConverterClass(converterClassType);
- }
-
- {
- ConverterForClassType converterForClassType = facesConfigFactory.createConverterForClassType();
- converterForClassType.setTextContent(CONVERTER_CLASS_FOR);
- converterForClassType.setId(CommonStructuresUtil.createPreficedString(CONVERTER_CLASS_FOR
- , CommonStructuresUtil.ID));
- converter.setConverterForClass(converterForClassType);
- }
- {
- ConverterIdType converterId = facesConfigFactory.createConverterIdType();
- converterId.setTextContent(CONVERTER_ID);
- converterId.setId(CommonStructuresUtil.createPreficedString(CONVERTER_CLASS_FOR
- , CommonStructuresUtil.ID));
- converter.setConverterId(converterId);
- }
-
- converter.getAttribute().add(CommonStructuresUtil.createAttribute(CONVERTER));
- converter.getProperty().add(CommonStructuresUtil.createProperty(CONVERTER));
-
- converter.setId(CONVERTER_ID);
-
- edit.getFacesConfig().getConverter().add(converter);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ConverterType converter =
- (ConverterType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig().getConverter(), CONVERTER_ID);
- assertNotNull(converter);
-
- assertEquals(1, converter.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription
- (CONVERTER, (DescriptionType) converter.getDescription().get(0));
-
- assertEquals(1, converter.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName
- (CONVERTER, (DisplayNameType) converter.getDisplayName().get(0));
-
- assertEquals(1, converter.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon
- (CONVERTER, (IconType) converter.getIcon().get(0));
-
- ConverterClassType converterClassType = converter.getConverterClass();
- assertEquals(CONVERTER_CLASS, converterClassType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(CONVERTER_CLASS
- , CommonStructuresUtil.ID)
- , converterClassType.getId());
-
- ConverterForClassType converterForClassType = converter.getConverterForClass();
- assertEquals(CONVERTER_CLASS_FOR, converterForClassType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(CONVERTER_CLASS_FOR
- , CommonStructuresUtil.ID)
- , converterForClassType.getId());
-
- ConverterIdType converterId = converter.getConverterId();
- assertEquals(CONVERTER_ID, converterId.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(CONVERTER_CLASS_FOR
- , CommonStructuresUtil.ID)
- , converterId.getId());
-
- converter.getAttribute().add(CommonStructuresUtil.createAttribute(CONVERTER));
- converter.getProperty().add(CommonStructuresUtil.createProperty(CONVERTER));
-
- assertEquals(CommonStructuresUtil.createPreficedString(CONVERTER
- , CommonStructuresUtil.ID)
- , converter.getId());
- } finally {
- //assertTrue(result != null && result.equals(sTestString));
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase_1_2.java
deleted file mode 100644
index 18dca28..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteConverterTestCase_1_2.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteConverterTestCase_1_2 extends WriteConverterTestCase {
-
- private final static String EXTENDED_CONVERTER_ID = "extended-converter-id";
-
- private final static String CONVERTER_EXTENSION = CommonStructuresUtil
- .createPreficedString(CONVERTER, "extension");
- private final static String CONVERTER_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(CONVERTER_EXTENSION, "id");
- private final static String CONVERTER_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(CONVERTER_EXTENSION, "tag");
-
- public WriteConverterTestCase_1_2(String name) {
- super(name);
- }
-
- public void testConverterExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ConverterType converter = facesConfigFactory.createConverterType();
- converter.setId(EXTENDED_CONVERTER_ID);
-
- ConverterExtensionType extensionType =
- facesConfigFactory.createConverterExtensionType();
- extensionType.setId(CONVERTER_EXTENSION_ID);
-
- extensionType.getChildNodes().add(createDynamicElement(CONVERTER_EXTENSION_TAG));
-
- converter.getConverterExtension().add(extensionType);
- edit.getFacesConfig().getConverter().add(converter);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ConverterType converter =
- (ConverterType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig().getConverter(), EXTENDED_CONVERTER_ID);
- assertNotNull(converter);
-
- assertEquals(1, converter.getConverterExtension().size());
- ConverterExtensionType extensionType =
- (ConverterExtensionType) converter.getConverterExtension().get(0);
- assertEquals(CONVERTER_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType.getChildNodes().get(0);
- assertEquals(CONVERTER_EXTENSION_TAG, element.getName());
- }
- finally
- {
-
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFacesConfigTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFacesConfigTestCase_2_0.java
deleted file mode 100644
index a591b99..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFacesConfigTestCase_2_0.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.core.IJSFCoreConstants;
-import org.eclipse.jst.jsf.facesconfig.emf.AbsoluteOrderingType;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.BehaviorType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.NameType;
-import org.eclipse.jst.jsf.facesconfig.emf.OrderingOrderingType;
-import org.eclipse.jst.jsf.facesconfig.emf.OrderingOthersType;
-import org.eclipse.jst.jsf.facesconfig.emf.OrderingType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteFacesConfigTestCase_2_0 extends FacesConfigExtensionTestCase {
-
- private final static String FACESCONFIG_NAME = "facesconfig-name";
-// private final static String ORDERING_ID = "ordering-id";
- private final static String ABSOLUTE_ORDERING_NAME = "ordering-name";
- private final static String ABSOLUTE_ORDERING_OTHERS_ID = "ordering-name-others-id";
- private final static String BEFORE_ORDERING_NAME = "before-ordering-name";
- private final static String BEFORE_ORDERING_OTHERS_ID = "before-ordering-name-others-id";
- private final static String AFTER_ORDERING_NAME = "after-ordering-name";
- private final static String AFTER_ORDERING_OTHERS_ID = "after-ordering-name-others-id";
- private final static String BEHAVIOR = "behavior";
-// private final static String BEHAVIOR_ID = "behavior-id";
- private final static String BEHAVIOR_ID_ID = "behavior-id-id";
- private final static String BEHAVIOR_CLASS = "behavior-class";
- private final static String BEHAVIOR_EXTENSION_ID = "behavior-extension-id";
- private final static String BEHAVIOR_EXTENSION = "behavior-extension";
-
- public WriteFacesConfigTestCase_2_0(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- assertEquals(IJSFCoreConstants.JSF_VERSION_2_0, _facesVersion);
- }
-
- public void testFacesConfig20() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- FacesConfigType facesConfigType = edit.getFacesConfig();
-
- {
- //Ordering
- OrderingType ordering = facesConfigFactory.createOrderingType();
-// ordering.setId(ORDERING_ID);
- facesConfigType.getOrdering().add(ordering);
- OrderingOrderingType before = facesConfigFactory.createOrderingOrderingType();
- NameType beforeOrderingName = facesConfigFactory.createNameType();
- beforeOrderingName.setTextContent(BEFORE_ORDERING_NAME);
- before.getName().add(beforeOrderingName);
- OrderingOthersType others = facesConfigFactory.createOrderingOthersType();
- others.setId(BEFORE_ORDERING_OTHERS_ID);
- before.setOthers(others);
- ordering.setBefore(before);
- OrderingOrderingType after = facesConfigFactory.createOrderingOrderingType();
- NameType afterOrderingName = facesConfigFactory.createNameType();
- afterOrderingName.setTextContent(AFTER_ORDERING_NAME);
- after.getName().add(afterOrderingName);
- OrderingOthersType others2 = facesConfigFactory.createOrderingOthersType();
- others2.setId(AFTER_ORDERING_OTHERS_ID);
- after.setOthers(others2);
- ordering.setAfter(after);
- }
-
- {
- //Absolute Ordering
- AbsoluteOrderingType absoluteOrdering = facesConfigFactory.createAbsoluteOrderingType();
- NameType orderingName = facesConfigFactory.createNameType();
- orderingName.setTextContent(ABSOLUTE_ORDERING_NAME);
- absoluteOrdering.getName().add(orderingName);
- OrderingOthersType others = facesConfigFactory.createOrderingOthersType();
- others.setId(ABSOLUTE_ORDERING_OTHERS_ID);
- absoluteOrdering.setOthers(others);
- facesConfigType.setAbsoluteOrdering(absoluteOrdering);
- }
-
- //Name
- NameType name = facesConfigFactory.createNameType();
- name.setTextContent(FACESCONFIG_NAME);
- facesConfigType.setName(name);
-
- {
- //Behavior
- BehaviorType behavior = facesConfigFactory.createBehaviorType();
-// behavior.setId(BEHAVIOR_ID);
- facesConfigType.getBehavior().add(behavior);
-
- behavior.getDescription().add(CommonStructuresUtil.createDescription(BEHAVIOR));
- behavior.getDisplayName().add(CommonStructuresUtil.createDisplayName(BEHAVIOR));
- behavior.getIcon().add(CommonStructuresUtil.createIcon(BEHAVIOR));
-
- BehaviorIdType behaviorId = facesConfigFactory.createBehaviorIdType();
- behaviorId.setTextContent(BEHAVIOR_ID_ID);
- behavior.setBehaviorId(behaviorId);
-
- BehaviorClassType behaviorClass = facesConfigFactory.createBehaviorClassType();
- behaviorClass.setTextContent(BEHAVIOR_CLASS);
- behavior.setBehaviorClass(behaviorClass);
-
- AttributeType attribute = facesConfigFactory.createAttributeType();
- behavior.getAttribute().add(attribute);
-
- PropertyType property = facesConfigFactory.createPropertyType();
- behavior.getProperty().add(property);
-
- BehaviorExtensionType extensionType = facesConfigFactory.createBehaviorExtensionType();
- extensionType.setId(BEHAVIOR_EXTENSION_ID);
- extensionType.getChildNodes().add(createDynamicElement(BEHAVIOR_EXTENSION));
- behavior.getBehaviorExtension().add(extensionType);
- }
-
- //Metadata Complete
- facesConfigType.setMetadataComplete(true);
-
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigType facesConfig = edit.getFacesConfig();
-
- {
- //Ordering
- assertEquals(1, facesConfig.getOrdering().size());
- OrderingType ordering = (OrderingType)facesConfig.getOrdering().get(0);
-// assertEquals(ORDERING_ID, ordering.getId());
-
- OrderingOrderingType before = ordering.getBefore();
- assertEquals(1, before.getName().size());
- NameType name = (NameType)before.getName().get(0);
- assertEquals(BEFORE_ORDERING_NAME, name.getTextContent().trim());
- assertEquals(BEFORE_ORDERING_OTHERS_ID, before.getOthers().getId());
-
- OrderingOrderingType after = ordering.getAfter();
- assertEquals(1, after.getName().size());
- NameType afterNname = (NameType)after.getName().get(0);
- assertEquals(AFTER_ORDERING_NAME, afterNname.getTextContent().trim());
- assertEquals(AFTER_ORDERING_OTHERS_ID, after.getOthers().getId());
- }
-
- {
- //Absolute Ordering
- AbsoluteOrderingType absoluteOrdering = facesConfig.getAbsoluteOrdering();
- assertNotNull(absoluteOrdering);
- assertEquals(1, absoluteOrdering.getName().size());
- assertEquals(ABSOLUTE_ORDERING_NAME, ((NameType)absoluteOrdering.getName().get(0)).getTextContent().trim());
- assertNotNull(absoluteOrdering.getOthers());
- assertEquals(ABSOLUTE_ORDERING_OTHERS_ID, absoluteOrdering.getOthers().getId().trim());
- }
-
- {
- //Name
- NameType name = facesConfig.getName();
- assertNotNull(name);
- assertEquals(FACESCONFIG_NAME, name.getTextContent().trim());
- }
-
- {
- //Behavior
- assertEquals(1, facesConfig.getBehavior().size());
- BehaviorType behavior = (BehaviorType)facesConfig.getBehavior().get(0);
- assertEquals(1, behavior.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription
- (BEHAVIOR, (DescriptionType) behavior.getDescription().get(0));
-
- assertEquals(1, behavior.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName
- (BEHAVIOR, (DisplayNameType)behavior.getDisplayName().get(0));
-
- assertEquals(1, behavior.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon
- (BEHAVIOR, (IconType)behavior.getIcon().get(0));
-
- BehaviorIdType behaviorId = behavior.getBehaviorId();
- assertEquals(BEHAVIOR_ID_ID, behaviorId.getTextContent().trim());
-
- BehaviorClassType behaviorClass = behavior.getBehaviorClass();
- assertEquals(BEHAVIOR_CLASS, behaviorClass.getTextContent().trim());
-
- assertEquals(1, behavior.getAttribute().size());
- assertEquals(1, behavior.getProperty().size());
-
- assertEquals(1, behavior.getBehaviorExtension().size());
- BehaviorExtensionType ext =
- (BehaviorExtensionType) behavior.getBehaviorExtension().get(0);
- assertEquals(BEHAVIOR_EXTENSION_ID, ext.getId());
- assertEquals(1, ext.getChildNodes().size());
- DynamicElement element = (DynamicElement) ext.getChildNodes().get(0);
- assertEquals(BEHAVIOR_EXTENSION, element.getName());
- }
-
- //Metadata Complete
- assertEquals(true, facesConfig.isMetadataComplete());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase.java
deleted file mode 100644
index 15f2b4b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitFactoryType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/*
- * This Junit class is used to test the FacesConfigFactoryImpl
- * class.
- */
-public class WriteFactoryTestCase extends BaseWriteTestCase {
- protected final static String FACTORY = "factory";
- private final static String APPLICATION_FACTORY = "application-factory";
- private final static String FACESCONTEXT_FACTORY = "faces-context-factory";
- private final static String LIFECYCLE_FACTORY = "lifecycle-factory";
- private final static String RENDERKIT_FACTORY = "render-kit-factory";
- private final static String FACTORY_ID = CommonStructuresUtil
- .createPreficedString(FACTORY, CommonStructuresUtil.ID);
-
- public WriteFactoryTestCase(String name) {
- super(name);
- }
-
- public void testFactory() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- FactoryType newfactory = facesConfigFactory.createFactoryType();
-
- {
- ApplicationFactoryType newApplicationFactory = facesConfigFactory.createApplicationFactoryType();
- newApplicationFactory.setTextContent(APPLICATION_FACTORY);
- newApplicationFactory.setId(CommonStructuresUtil
- .createPreficedString(APPLICATION_FACTORY, CommonStructuresUtil.ID));
- newfactory.getApplicationFactory().add(newApplicationFactory);
- }
-
- {
- FacesContextFactoryType facesContextFactory = facesConfigFactory.createFacesContextFactoryType();
- facesContextFactory.setTextContent(FACESCONTEXT_FACTORY);
- facesContextFactory.setId(CommonStructuresUtil
- .createPreficedString(FACESCONTEXT_FACTORY, CommonStructuresUtil.ID));
- newfactory.getFacesContextFactory().add(facesContextFactory);
- }
-
- {
- LifecycleFactoryType lifecycleFactory = facesConfigFactory.createLifecycleFactoryType();
- lifecycleFactory.setTextContent(LIFECYCLE_FACTORY);
- lifecycleFactory.setId(CommonStructuresUtil
- .createPreficedString(LIFECYCLE_FACTORY, CommonStructuresUtil.ID));
- newfactory.getLifecycleFactory().add(lifecycleFactory);
- }
-
- {
- RenderKitFactoryType renderKit = facesConfigFactory.createRenderKitFactoryType();
- renderKit.setTextContent(RENDERKIT_FACTORY);
- renderKit.setId(CommonStructuresUtil
- .createPreficedString(RENDERKIT_FACTORY, CommonStructuresUtil.ID));
- newfactory.getRenderKitFactory().add(renderKit);
- }
-
- newfactory.setId(FACTORY_ID);
-
- edit.getFacesConfig().getFactory().add(newfactory);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FactoryType newFactory =
- (FactoryType) FacesConfigModelUtil
- .findEObjectElementById(
- edit.getFacesConfig().getFactory(), FACTORY_ID);
- assertNotNull(newFactory);
-
- {
- assertEquals(1, newFactory.getApplicationFactory().size());
- ApplicationFactoryType newApplicationFactory =
- (ApplicationFactoryType) newFactory.getApplicationFactory().get(0);
-
- assertEquals(APPLICATION_FACTORY, newApplicationFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(APPLICATION_FACTORY, CommonStructuresUtil.ID)
- , newApplicationFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getFacesContextFactory().size());
- FacesContextFactoryType facesContextFactory =
- (FacesContextFactoryType) newFactory.getFacesContextFactory().get(0);
-
- assertEquals(FACESCONTEXT_FACTORY, facesContextFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(FACESCONTEXT_FACTORY, CommonStructuresUtil.ID)
- , facesContextFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getLifecycleFactory().size());
- LifecycleFactoryType lifecycleFactory =
- (LifecycleFactoryType) newFactory.getLifecycleFactory().get(0);
-
- assertEquals(LIFECYCLE_FACTORY, lifecycleFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(LIFECYCLE_FACTORY, CommonStructuresUtil.ID)
- , lifecycleFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getRenderKitFactory().size());
- RenderKitFactoryType renderKit =
- (RenderKitFactoryType) newFactory.getRenderKitFactory().get(0);
-
- assertEquals(RENDERKIT_FACTORY, renderKit.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(RENDERKIT_FACTORY, CommonStructuresUtil.ID)
- ,renderKit.getId());
- }
-
- assertEquals(CommonStructuresUtil
- .createPreficedString(FACTORY, CommonStructuresUtil.ID)
- ,newFactory.getId());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_1_2.java
deleted file mode 100644
index 82c191a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_1_2.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteFactoryTestCase_1_2 extends WriteFactoryTestCase {
- private final static String EXTENDED_FACTORY_ID = "extended-factory-id";
-
- private final static String FACTORY_EXTENSION = CommonStructuresUtil
- .createPreficedString(FACTORY, "extension");
- private final static String FACTORY_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(FACTORY_EXTENSION, "id");
- private final static String FACTORY_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(FACTORY_EXTENSION, "tag");
-
- public WriteFactoryTestCase_1_2(String name) {
- super(name);
- }
-
- public void testFactoryExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- FactoryType factory = facesConfigFactory.createFactoryType();
- factory.setId(EXTENDED_FACTORY_ID);
-
- FactoryExtensionType extensionType =
- facesConfigFactory.createFactoryExtensionType();
- extensionType.setId(FACTORY_EXTENSION_ID);
-
- extensionType.getChildNodes().add(createDynamicElement(FACTORY_EXTENSION_TAG));
-
- factory.getFactoryExtension().add(extensionType);
- edit.getFacesConfig().getFactory().add(factory);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FactoryType factory =
- (FactoryType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig().getFactory(), EXTENDED_FACTORY_ID);
- assertNotNull(factory);
-
- assertEquals(1, factory.getFactoryExtension().size());
- FactoryExtensionType extensionType =
- (FactoryExtensionType) factory.getFactoryExtension().get(0);
- assertEquals(FACTORY_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType.getChildNodes().get(0);
- assertEquals(FACTORY_EXTENSION_TAG, element.getName());
- }
- finally
- {
-
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_2_0.java
deleted file mode 100644
index b38243a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteFactoryTestCase_2_0.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.ExceptionHandlerFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ExternalContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.PartialViewContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.TagHandlerDelegateFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ViewDeclarationLanguageFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.VisitContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteFactoryTestCase_2_0 extends WriteFactoryTestCase_1_2 {
- private final static String EXCEPTIONHANDLER_FACTORY = "exception-handler-factory";
- private final static String EXTERNALCONTEXT_FACTORY = "external-context-factory";
- private final static String PARTIALVIEWCONTEXT_FACTORY = "partial-view-context-factory";
- private final static String VIEWDECLARATIONLANGUAGE_FACTORY = "view-declaration-language-factory";
- private final static String TAGHANDLERDELEGATE_FACTORY = "tag-handler-delegate-factory";
- private final static String VISITCONTEXT_FACTORY = "visit-context-factory";
- private final static String FACTORY_ID = CommonStructuresUtil
- .createPreficedString(FACTORY+"20", CommonStructuresUtil.ID);
-
- public WriteFactoryTestCase_2_0(String name) {
- super(name);
- }
-
- public void testFactory20() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- FactoryType newfactory = facesConfigFactory.createFactoryType();
-
- {
- ExceptionHandlerFactoryType newExceptionHandlerFactory = facesConfigFactory.createExceptionHandlerFactoryType();
- newExceptionHandlerFactory.setTextContent(EXCEPTIONHANDLER_FACTORY);
- newExceptionHandlerFactory.setId(CommonStructuresUtil
- .createPreficedString(EXCEPTIONHANDLER_FACTORY, CommonStructuresUtil.ID));
- newfactory.getExceptionHandlerFactory().add(newExceptionHandlerFactory);
- }
-
- {
- ExternalContextFactoryType externalContextFactory = facesConfigFactory.createExternalContextFactoryType();
- externalContextFactory.setTextContent(EXTERNALCONTEXT_FACTORY);
- externalContextFactory.setId(CommonStructuresUtil
- .createPreficedString(EXTERNALCONTEXT_FACTORY, CommonStructuresUtil.ID));
- newfactory.getExternalContextFactory().add(externalContextFactory);
- }
-
- {
- PartialViewContextFactoryType partialViewContextFactory = facesConfigFactory.createPartialViewContextFactoryType();
- partialViewContextFactory.setTextContent(PARTIALVIEWCONTEXT_FACTORY);
- partialViewContextFactory.setId(CommonStructuresUtil
- .createPreficedString(PARTIALVIEWCONTEXT_FACTORY, CommonStructuresUtil.ID));
- newfactory.getPartialViewContextFactory().add(partialViewContextFactory);
- }
-
- {
- ViewDeclarationLanguageFactoryType viewDeclarationLanguageFactory = facesConfigFactory.createViewDeclarationLanguageFactoryType();
- viewDeclarationLanguageFactory.setTextContent(VIEWDECLARATIONLANGUAGE_FACTORY);
- viewDeclarationLanguageFactory.setId(CommonStructuresUtil
- .createPreficedString(VIEWDECLARATIONLANGUAGE_FACTORY, CommonStructuresUtil.ID));
- newfactory.getViewDeclarationLanguageFactory().add(viewDeclarationLanguageFactory);
- }
-
- {
- TagHandlerDelegateFactoryType tagHandlerDelegateFactory = facesConfigFactory.createTagHandlerDelegateFactoryType();
- tagHandlerDelegateFactory.setTextContent(TAGHANDLERDELEGATE_FACTORY);
- tagHandlerDelegateFactory.setId(CommonStructuresUtil
- .createPreficedString(TAGHANDLERDELEGATE_FACTORY, CommonStructuresUtil.ID));
- newfactory.getTagHandlerDelegateFactory().add(tagHandlerDelegateFactory);
- }
-
- {
- VisitContextFactoryType visitContextFactory = facesConfigFactory.createVisitContextFactoryType();
- visitContextFactory.setTextContent(VISITCONTEXT_FACTORY);
- visitContextFactory.setId(CommonStructuresUtil
- .createPreficedString(VISITCONTEXT_FACTORY, CommonStructuresUtil.ID));
- newfactory.getVisitContextFactory().add(visitContextFactory);
- }
-
- newfactory.setId(FACTORY_ID);
-
- edit.getFacesConfig().getFactory().add(newfactory);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- FactoryType newFactory =
- (FactoryType) FacesConfigModelUtil
- .findEObjectElementById(
- edit.getFacesConfig().getFactory(), FACTORY_ID);
- assertNotNull(newFactory);
-
- {
- assertEquals(1, newFactory.getExceptionHandlerFactory().size());
- ExceptionHandlerFactoryType newExceptionHandlerFactory =
- (ExceptionHandlerFactoryType) newFactory.getExceptionHandlerFactory().get(0);
-
- assertEquals(EXCEPTIONHANDLER_FACTORY, newExceptionHandlerFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(EXCEPTIONHANDLER_FACTORY, CommonStructuresUtil.ID)
- , newExceptionHandlerFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getExternalContextFactory().size());
- ExternalContextFactoryType externalContextFactory =
- (ExternalContextFactoryType) newFactory.getExternalContextFactory().get(0);
-
- assertEquals(EXTERNALCONTEXT_FACTORY, externalContextFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(EXTERNALCONTEXT_FACTORY, CommonStructuresUtil.ID)
- , externalContextFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getPartialViewContextFactory().size());
- PartialViewContextFactoryType partialViewContextFactory =
- (PartialViewContextFactoryType) newFactory.getPartialViewContextFactory().get(0);
-
- assertEquals(PARTIALVIEWCONTEXT_FACTORY, partialViewContextFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(PARTIALVIEWCONTEXT_FACTORY, CommonStructuresUtil.ID)
- , partialViewContextFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getViewDeclarationLanguageFactory().size());
- ViewDeclarationLanguageFactoryType ViewDeclarationLanguageFactory =
- (ViewDeclarationLanguageFactoryType) newFactory.getViewDeclarationLanguageFactory().get(0);
-
- assertEquals(VIEWDECLARATIONLANGUAGE_FACTORY, ViewDeclarationLanguageFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(VIEWDECLARATIONLANGUAGE_FACTORY, CommonStructuresUtil.ID)
- ,ViewDeclarationLanguageFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getTagHandlerDelegateFactory().size());
- TagHandlerDelegateFactoryType tagHandlerDelegateFactory =
- (TagHandlerDelegateFactoryType) newFactory.getTagHandlerDelegateFactory().get(0);
-
- assertEquals(TAGHANDLERDELEGATE_FACTORY, tagHandlerDelegateFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(TAGHANDLERDELEGATE_FACTORY, CommonStructuresUtil.ID)
- ,tagHandlerDelegateFactory.getId());
- }
-
- {
- assertEquals(1, newFactory.getVisitContextFactory().size());
- VisitContextFactoryType visitContextFactory =
- (VisitContextFactoryType) newFactory.getVisitContextFactory().get(0);
-
- assertEquals(VISITCONTEXT_FACTORY, visitContextFactory.getTextContent());
- assertEquals(CommonStructuresUtil
- .createPreficedString(VISITCONTEXT_FACTORY, CommonStructuresUtil.ID)
- ,visitContextFactory.getId());
- }
-
- assertEquals(FACTORY_ID, newFactory.getId());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase.java
deleted file mode 100644
index 0f2766b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
-import org.eclipse.jst.jsf.facesconfig.emf.PhaseListenerType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteLifecycleTestCase extends BaseWriteTestCase
-{
- protected final static String LIFECYCLE = "lifecycle";
- private final static String PHASELISTENER = "phase-listener";
- private final static String LIFECYCLE_ID =
- CommonStructuresUtil.createPreficedString(LIFECYCLE, CommonStructuresUtil.ID);
-
- public WriteLifecycleTestCase(String name) {
- super(name);
- }
-
- public void testWriteLifecycle() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- LifecycleType newLifecycle = facesConfigFactory
- .createLifecycleType();
- PhaseListenerType newPhaseListener = facesConfigFactory
- .createPhaseListenerType();
- newPhaseListener.setTextContent(PHASELISTENER);
- newPhaseListener.setId(CommonStructuresUtil.createPreficedString(
- PHASELISTENER, CommonStructuresUtil.ID));
- newLifecycle.getPhaseListener().add(newPhaseListener);
-
- newLifecycle.setId(LIFECYCLE_ID);
-
- edit.getFacesConfig().getLifecycle().add(newLifecycle);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- LifecycleType newLifecycle =
- (LifecycleType) FacesConfigModelUtil
- .findEObjectElementById(
- edit.getFacesConfig().getLifecycle(), LIFECYCLE_ID);
- assertNotNull(newLifecycle);
-
- assertEquals(1, newLifecycle.getPhaseListener().size());
- PhaseListenerType newPhaseListener =
- (PhaseListenerType) newLifecycle.getPhaseListener().get(0);
-
- assertEquals(PHASELISTENER, newPhaseListener.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(
- PHASELISTENER, CommonStructuresUtil.ID)
- , newPhaseListener.getId());
-
- assertEquals(CommonStructuresUtil.createPreficedString(
- LIFECYCLE, CommonStructuresUtil.ID)
- , newLifecycle.getId());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase_1_2.java
deleted file mode 100644
index 81e28e8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteLifecycleTestCase_1_2.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteLifecycleTestCase_1_2 extends WriteLifecycleTestCase {
- private final static String EXTENDED_LIFECYCLE_ID = "extended-lifecycle-id";
-
- private final static String LIFECYCLE_EXTENSION = CommonStructuresUtil
- .createPreficedString(LIFECYCLE, "extension");
- private final static String LIFECYCLE_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(LIFECYCLE_EXTENSION, "id");
- private final static String LIFECYCLE_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(LIFECYCLE_EXTENSION, "tag");
-
- public WriteLifecycleTestCase_1_2(String name) {
- super(name);
- }
-
- public void testLifecycleExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- LifecycleType lifecycle = facesConfigFactory.createLifecycleType();
- lifecycle.setId(EXTENDED_LIFECYCLE_ID);
-
- LifecycleExtensionType extensionType = facesConfigFactory
- .createLifecycleExtensionType();
- extensionType.setId(LIFECYCLE_EXTENSION_ID);
-
- extensionType.getChildNodes().add(
- createDynamicElement(LIFECYCLE_EXTENSION_TAG));
-
- lifecycle.getLifecycleExtension().add(extensionType);
- edit.getFacesConfig().getLifecycle().add(lifecycle);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- LifecycleType lifecycle = (LifecycleType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getLifecycle(), EXTENDED_LIFECYCLE_ID);
- assertNotNull(lifecycle);
-
- assertEquals(1, lifecycle.getLifecycleExtension().size());
- LifecycleExtensionType extensionType = (LifecycleExtensionType) lifecycle
- .getLifecycleExtension().get(0);
- assertEquals(LIFECYCLE_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType
- .getChildNodes().get(0);
- assertEquals(LIFECYCLE_EXTENSION_TAG, element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase.java
deleted file mode 100644
index 0544933..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ListEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanScopeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedPropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.MapEntriesType;
-import org.eclipse.jst.jsf.facesconfig.emf.NullValueType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValueType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteManagedBeanTestCase extends BaseWriteTestCase {
-
- protected final static String MANAGED_BEAN = "managed-bean";
- private final static String SCOPE = "scope";
- private final static String MANAGED_BEAN_NAME =
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN, CommonStructuresUtil.NAME);
- private final static String MANAGED_BEAN_SCOPE =
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN, SCOPE);
- private final static String MANAGED_BEAN_CLASS =
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN, CommonStructuresUtil.CLASS);
- private final static String MANAGED_BEAN_PROPERTY =
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN, "property");
-
- public WriteManagedBeanTestCase(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- FacesConfigArtifactEdit edit = null;
- try
- {
- edit =
- getArtifactEditForWrite();
- edit.getFacesConfig().getManagedBean().clear();
- edit.save(null);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
- }
-
- public void testWriteManagedBean()
- {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- ManagedBeanType managedBean = createManagedBeanBase();
-
-
- { // null value
- ManagedPropertyType managedPropWithNullValue =
- CommonStructuresUtil
- .createManagedPropertyBase(
- CommonStructuresUtil.createPreficedString("null", MANAGED_BEAN_PROPERTY));
-
- NullValueType nullValue = facesConfigFactory.createNullValueType();
- nullValue.setId(
- CommonStructuresUtil.createPreficedString(
- CommonStructuresUtil.createPreficedString("null", MANAGED_BEAN_PROPERTY)
- , CommonStructuresUtil.ID));
- managedPropWithNullValue.setNullValue(nullValue);
- managedBean.getManagedProperty().add(managedPropWithNullValue);
- }
-
- { // value property
- ManagedPropertyType managedPropWithValue =
- CommonStructuresUtil
- .createManagedPropertyBase(
- CommonStructuresUtil.createPreficedString("value", MANAGED_BEAN_PROPERTY));
-
- managedPropWithValue.setValue
- (CommonStructuresUtil.createValue(MANAGED_BEAN_PROPERTY));
- managedBean.getManagedProperty().add(managedPropWithValue);
- }
-
- { // map property
- ManagedPropertyType managedMapProp =
- CommonStructuresUtil
- .createManagedPropertyBase(
- CommonStructuresUtil.createPreficedString("map", MANAGED_BEAN_PROPERTY));
-
- managedMapProp.setMapEntries(
- (CommonStructuresUtil.createMapEntries(MANAGED_BEAN_PROPERTY)));
- managedBean.getManagedProperty()
- .add(managedMapProp);
- }
-
- { // list property
- ManagedPropertyType managedListProp =
- CommonStructuresUtil
- .createManagedPropertyBase(
- CommonStructuresUtil.createPreficedString("list", MANAGED_BEAN_PROPERTY));
-
- managedListProp.setListEntries(
- (CommonStructuresUtil.createListEntries(MANAGED_BEAN_PROPERTY)));
- managedBean.getManagedProperty()
- .add(managedListProp);
- }
-
- edit.getFacesConfig().getManagedBean().add(managedBean);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertEquals(1, edit.getFacesConfig().getManagedBean().size());
-
- ManagedBeanType managedBean =
- (ManagedBeanType) edit.getFacesConfig().getManagedBean().get(0);
-
- assertMatchManagedBeanBase(managedBean);
-
- assertEquals(4, managedBean.getManagedProperty().size());
-
- { // null value
- ManagedPropertyType managedPropWithNullValue =
- (ManagedPropertyType) managedBean.getManagedProperty().get(0);
-
- CommonStructuresUtil.assertMatchManagedPropertyBase
- (CommonStructuresUtil.createPreficedString("null", MANAGED_BEAN_PROPERTY)
- ,managedPropWithNullValue);
-
- NullValueType nullValue = managedPropWithNullValue.getNullValue();
- assertEquals(CommonStructuresUtil.createPreficedString(
- CommonStructuresUtil.createPreficedString("null", MANAGED_BEAN_PROPERTY)
- , CommonStructuresUtil.ID)
- , nullValue.getId());
- }
-
- { // value property
- ManagedPropertyType managedPropWithValue =
- (ManagedPropertyType) managedBean.getManagedProperty().get(1);
-
- CommonStructuresUtil.assertMatchManagedPropertyBase
- (CommonStructuresUtil.createPreficedString("value", MANAGED_BEAN_PROPERTY)
- ,managedPropWithValue);
-
- ValueType valueType = managedPropWithValue.getValue();
- CommonStructuresUtil.assertMatchValue(MANAGED_BEAN_PROPERTY, valueType);
- }
-
- { // map property
- ManagedPropertyType managedMapProp =
- (ManagedPropertyType) managedBean.getManagedProperty().get(2);
-
- CommonStructuresUtil
- .assertMatchManagedPropertyBase(
- CommonStructuresUtil.createPreficedString("map", MANAGED_BEAN_PROPERTY)
- , managedMapProp);
-
- CommonStructuresUtil.assertMatchMapEntries(MANAGED_BEAN_PROPERTY
- ,managedMapProp.getMapEntries());
- }
-
- { // list property
- ManagedPropertyType managedListProp =
- (ManagedPropertyType) managedBean.getManagedProperty().get(3);
-
- CommonStructuresUtil
- .assertMatchManagedPropertyBase(
- CommonStructuresUtil.createPreficedString("list", MANAGED_BEAN_PROPERTY)
- , managedListProp);
-
- CommonStructuresUtil.assertMatchListEntries(MANAGED_BEAN_PROPERTY
- , managedListProp.getListEntries());
- }
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testWriteMapManagedBean()
- {
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType managedBean = createManagedBeanBase();
- managedBean.setMapEntries(CommonStructuresUtil.createMapEntries(MANAGED_BEAN));
-
- edit.getFacesConfig().getManagedBean().add(managedBean);
- edit.save(null);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertEquals(1, edit.getFacesConfig().getManagedBean().size());
- ManagedBeanType managedBean =
- (ManagedBeanType) edit.getFacesConfig().getManagedBean().get(0);
-
- assertMatchManagedBeanBase(managedBean);
- MapEntriesType mapEntries = managedBean.getMapEntries();
- CommonStructuresUtil.assertMatchMapEntries(MANAGED_BEAN, mapEntries);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
- }
-
- public void testWriteListManagedBean()
- {
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType managedBean = createManagedBeanBase();
- managedBean.setListEntries(CommonStructuresUtil.createListEntries(MANAGED_BEAN));
- edit.getFacesConfig().getManagedBean().add(managedBean);
- edit.save(null);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertEquals(1, edit.getFacesConfig().getManagedBean().size());
- ManagedBeanType managedBean =
- (ManagedBeanType) edit.getFacesConfig().getManagedBean().get(0);
-
- assertMatchManagedBeanBase(managedBean);
- ListEntriesType mapEntries = managedBean.getListEntries();
- CommonStructuresUtil.assertMatchListEntries(MANAGED_BEAN, mapEntries);
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
- }
-
- private ManagedBeanType createManagedBeanBase()
- {
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- ManagedBeanType managedBean = facesConfigFactory.createManagedBeanType();
-
- managedBean.getDescription().add(CommonStructuresUtil.createDescription(MANAGED_BEAN));
- managedBean.getDisplayName().add(CommonStructuresUtil.createDisplayName(MANAGED_BEAN));
- managedBean.getIcon().add(CommonStructuresUtil.createIcon(MANAGED_BEAN));
-
- {
- ManagedBeanNameType managedBeanNameType = facesConfigFactory.createManagedBeanNameType();
- managedBeanNameType.setTextContent(MANAGED_BEAN_NAME);
- managedBeanNameType.setId(
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN_NAME
- , CommonStructuresUtil.ID));
- managedBean.setManagedBeanName(managedBeanNameType);
- }
-
- {
- ManagedBeanClassType managedBeanClassType = facesConfigFactory.createManagedBeanClassType();
- managedBeanClassType.setTextContent(MANAGED_BEAN_CLASS);
- managedBeanClassType.setId(
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN_CLASS
- , CommonStructuresUtil.ID));
- managedBean.setManagedBeanClass(managedBeanClassType);
- }
-
- {
- ManagedBeanScopeType managedBeanScopeType = facesConfigFactory.createManagedBeanScopeType();
- managedBeanScopeType.setTextContent(MANAGED_BEAN_SCOPE);
- managedBeanScopeType.setId(
- CommonStructuresUtil.createPreficedString(MANAGED_BEAN_SCOPE
- , CommonStructuresUtil.ID));
- managedBean.setManagedBeanScope(managedBeanScopeType);
- }
-
- return managedBean;
- }
-
-
- private void assertMatchManagedBeanBase(ManagedBeanType managedBean)
- {
- {
- assertEquals(1, managedBean.getDescription().size());
- DescriptionType description =
- (DescriptionType) managedBean.getDescription().get(0);
- CommonStructuresUtil.assertMatchesDescription(MANAGED_BEAN, description);
- }
-
- {
- assertEquals(1, managedBean.getDisplayName().size());
- DisplayNameType displayName =
- (DisplayNameType) managedBean.getDisplayName().get(0);
- CommonStructuresUtil.assertMatchesDisplayName(MANAGED_BEAN, displayName);
- }
-
- {
- assertEquals(1, managedBean.getIcon().size());
- IconType icon =
- (IconType) managedBean.getIcon().get(0);
- CommonStructuresUtil.assertMatchesIcon(MANAGED_BEAN, icon);
- }
-
- {
- ManagedBeanNameType managedBeanNameType = managedBean.getManagedBeanName();
- assertEquals(MANAGED_BEAN_NAME, managedBeanNameType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(MANAGED_BEAN_NAME
- , CommonStructuresUtil.ID)
- ,managedBeanNameType.getId());
- }
-
- {
- ManagedBeanClassType managedBeanClassType = managedBean.getManagedBeanClass();
- assertEquals(MANAGED_BEAN_CLASS, managedBeanClassType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(MANAGED_BEAN_CLASS
- , CommonStructuresUtil.ID)
- , managedBeanClassType.getId());
- }
-
- {
- ManagedBeanScopeType managedBeanScopeType = managedBean.getManagedBeanScope();
- assertEquals(MANAGED_BEAN_SCOPE, managedBeanScopeType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(MANAGED_BEAN_SCOPE
- , CommonStructuresUtil.ID)
- , managedBeanScopeType.getId());
- }
- }
-}
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_1_2.java
deleted file mode 100644
index 3ad821d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_1_2.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteManagedBeanTestCase_1_2 extends WriteManagedBeanTestCase {
- private final static String EXTENDED_MANAGED_BEAN_ID = "extended-managed-bean-id";
-
- private final static String MANAGED_BEAN_EXTENSION = CommonStructuresUtil
- .createPreficedString(MANAGED_BEAN, "extension");
- private final static String MANAGED_BEAN_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(MANAGED_BEAN_EXTENSION, "id");
- private final static String MANAGED_BEAN_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(MANAGED_BEAN_EXTENSION, "tag");
-
- public WriteManagedBeanTestCase_1_2(String name) {
- super(name);
- }
-
- public void testManagedBeanExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ManagedBeanType managedBean = facesConfigFactory.createManagedBeanType();
- managedBean.setId(EXTENDED_MANAGED_BEAN_ID);
-
- ManagedBeanExtensionType extensionType = facesConfigFactory
- .createManagedBeanExtensionType();
- extensionType.setId(MANAGED_BEAN_EXTENSION_ID);
-
- extensionType.getChildNodes().add(
- createDynamicElement(MANAGED_BEAN_EXTENSION_TAG));
-
- managedBean.getManagedBeanExtension().add(extensionType);
- edit.getFacesConfig().getManagedBean().add(managedBean);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType managedBean = (ManagedBeanType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getManagedBean(), EXTENDED_MANAGED_BEAN_ID);
- assertNotNull(managedBean);
-
- assertEquals(1, managedBean.getManagedBeanExtension().size());
- ManagedBeanExtensionType extensionType = (ManagedBeanExtensionType) managedBean
- .getManagedBeanExtension().get(0);
- assertEquals(MANAGED_BEAN_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType
- .getChildNodes().get(0);
- assertEquals(MANAGED_BEAN_EXTENSION_TAG, element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_2_0.java
deleted file mode 100644
index e5e86b9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteManagedBeanTestCase_2_0.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteManagedBeanTestCase_2_0 extends WriteManagedBeanTestCase_1_2 {
- private final static String EXTENDED_MANAGED_BEAN_ID20 = "extended-managed-bean-id-20";
-
- public WriteManagedBeanTestCase_2_0(String name) {
- super(name);
- }
-
- public void testManagedBeanExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- ManagedBeanType managedBean = facesConfigFactory.createManagedBeanType();
- managedBean.setId(EXTENDED_MANAGED_BEAN_ID20);
- managedBean.setEager(true);
-
- edit.getFacesConfig().getManagedBean().add(managedBean);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ManagedBeanType managedBean = (ManagedBeanType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getManagedBean(), EXTENDED_MANAGED_BEAN_ID20);
- assertNotNull(managedBean);
- assertEquals(true, managedBean.isEager());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase.java
deleted file mode 100644
index 76c1159..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FromActionType;
-import org.eclipse.jst.jsf.facesconfig.emf.FromOutcomeType;
-import org.eclipse.jst.jsf.facesconfig.emf.FromViewIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.emf.ToViewIdType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteNavigationRuleTestCase extends BaseWriteTestCase {
- protected static final String NAVIGATION_RULE = "navigation-rule";
- private static final String FROM_VIEW_ID = "from-view-id";
- private static final String FROM_VIEW_ID_ID =
- CommonStructuresUtil.createPreficedString(FROM_VIEW_ID, CommonStructuresUtil.ID);
- private static final String NAVIGATION_RULE_ID =
- CommonStructuresUtil.createPreficedString(NAVIGATION_RULE, CommonStructuresUtil.ID);
-
- private static final String NAVIGATION_CASE = "navigation-case";
- private static final String FROM_ACTION = "from-action";
- private static final String NAVIGATION_CASE_FROM_ACTION =
- CommonStructuresUtil.createPreficedString(NAVIGATION_CASE,FROM_ACTION);
- private static final String FROM_OUTCOME = "from-outcome";
- private static final String NAVIGATION_CASE_FROM_OUTCOME =
- CommonStructuresUtil.createPreficedString(NAVIGATION_CASE,FROM_OUTCOME);
- private static final String TO_VIEW_ID = "from-view-id";
- private static final String NAVIGATION_CASE_TO_VIEW_ID =
- CommonStructuresUtil.createPreficedString(NAVIGATION_CASE,TO_VIEW_ID);
-
- public WriteNavigationRuleTestCase(String name) {
- super(name);
- }
-
-
- public void testWriteNavigationRule() {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- NavigationRuleType navigationRule = facesConfigFactory.createNavigationRuleType();
-
- navigationRule.getDescription().add(CommonStructuresUtil.createDescription(NAVIGATION_RULE));
- navigationRule.getDisplayName().add(CommonStructuresUtil.createDisplayName(NAVIGATION_RULE));
- navigationRule.getIcon().add(CommonStructuresUtil.createIcon(NAVIGATION_RULE));
-
- FromViewIdType fromViewIdType = facesConfigFactory.createFromViewIdType();
- fromViewIdType.setTextContent(FROM_VIEW_ID);
- fromViewIdType.setId(FROM_VIEW_ID_ID);
- navigationRule.setFromViewId(fromViewIdType);
-
- NavigationCaseType navCaseType = facesConfigFactory.createNavigationCaseType();
-
- navCaseType.getDescription().add(CommonStructuresUtil.createDescription(NAVIGATION_CASE));
- navCaseType.getDisplayName().add(CommonStructuresUtil.createDisplayName(NAVIGATION_CASE));
- navCaseType.getIcon().add(CommonStructuresUtil.createIcon(NAVIGATION_CASE));
-
- {
- FromActionType fromActionType = facesConfigFactory.createFromActionType();
- fromActionType.setTextContent(NAVIGATION_CASE_FROM_ACTION);
- fromActionType.setId(
- CommonStructuresUtil.createPreficedString(NAVIGATION_CASE_FROM_ACTION
- , CommonStructuresUtil.ID));
- navCaseType.setFromAction(fromActionType);
- }
-
- {
- FromOutcomeType fromOutcomeType = facesConfigFactory.createFromOutcomeType();
- fromOutcomeType.setTextContent(NAVIGATION_CASE_FROM_OUTCOME);
- fromOutcomeType.setId(
- CommonStructuresUtil.createPreficedString(NAVIGATION_CASE_FROM_OUTCOME
- , CommonStructuresUtil.ID));
- navCaseType.setFromOutcome(fromOutcomeType);
- }
-
- {
- ToViewIdType toViewIdType = facesConfigFactory.createToViewIdType();
- toViewIdType.setTextContent(NAVIGATION_CASE_TO_VIEW_ID);
- toViewIdType.setId(
- CommonStructuresUtil.createPreficedString(NAVIGATION_CASE_TO_VIEW_ID
- , CommonStructuresUtil.ID));
- navCaseType.setToViewId(toViewIdType);
- }
-
- navigationRule.getNavigationCase().add(navCaseType);
- navigationRule.setId(NAVIGATION_RULE_ID);
-
- edit.getFacesConfig().getNavigationRule().add(navigationRule);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- NavigationRuleType navigationRule =
- (NavigationRuleType) FacesConfigModelUtil
- .findEObjectElementById(
- edit.getFacesConfig().getNavigationRule(), NAVIGATION_RULE_ID);
- assertNotNull(navigationRule);
-
-
- assertEquals(1, navigationRule.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription
- (NAVIGATION_RULE, (DescriptionType) navigationRule.getDescription().get(0));
-
- assertEquals(1, navigationRule.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName
- (NAVIGATION_RULE, (DisplayNameType) navigationRule.getDisplayName().get(0));
-
- assertEquals(1, navigationRule.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon
- (NAVIGATION_RULE, (IconType) navigationRule.getIcon().get(0));
-
- FromViewIdType fromViewIdType = navigationRule.getFromViewId();
- assertEquals(FROM_VIEW_ID, fromViewIdType.getTextContent());
- assertEquals(FROM_VIEW_ID_ID, fromViewIdType.getId());
-
- assertEquals(1, navigationRule.getNavigationCase().size());
- NavigationCaseType navCaseType =
- (NavigationCaseType) navigationRule.getNavigationCase().get(0);
-
- assertEquals(1, navCaseType.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription(NAVIGATION_CASE
- ,(DescriptionType)navCaseType.getDescription().get(0));
-
- assertEquals(1, navCaseType.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName(NAVIGATION_CASE
- ,(DisplayNameType)navCaseType.getDisplayName().get(0));
-
- assertEquals(1, navCaseType.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon(NAVIGATION_CASE
- ,(IconType)navCaseType.getIcon().get(0));
-
- navCaseType.getIcon().add(CommonStructuresUtil.createIcon(NAVIGATION_CASE));
-
- {
- FromActionType fromActionType = navCaseType.getFromAction();
- assertEquals(NAVIGATION_CASE_FROM_ACTION
- ,fromActionType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(NAVIGATION_CASE_FROM_ACTION
- , CommonStructuresUtil.ID)
- ,fromActionType.getId());
- }
-
- {
- FromOutcomeType fromOutcomeType = navCaseType.getFromOutcome();
- assertEquals(NAVIGATION_CASE_FROM_OUTCOME, fromOutcomeType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(NAVIGATION_CASE_FROM_OUTCOME
- , CommonStructuresUtil.ID)
- ,fromOutcomeType.getId());
- }
-
- {
- ToViewIdType toViewIdType = navCaseType.getToViewId();
- assertEquals(NAVIGATION_CASE_TO_VIEW_ID, toViewIdType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(NAVIGATION_CASE_TO_VIEW_ID
- , CommonStructuresUtil.ID)
- ,toViewIdType.getId());
- }
-
- assertEquals(CommonStructuresUtil.createPreficedString(NAVIGATION_RULE, CommonStructuresUtil.ID)
- , navigationRule.getId());
- }
- finally
- {
- if (edit != null)
- {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_1_2.java
deleted file mode 100644
index 55edada..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_1_2.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * @author cbateman
- *
- */
-public class WriteNavigationRuleTestCase_1_2 extends
- WriteNavigationRuleTestCase {
- private final static String EXTENDED_NAVIGATION_RULE_ID = "extended-navigation-rule-id";
-
- private final static String NAVIGATION_RULE_EXTENSION = CommonStructuresUtil
- .createPreficedString(NAVIGATION_RULE, "extension");
- private final static String NAVIGATION_RULE_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(NAVIGATION_RULE_EXTENSION, "id");
- private final static String NAVIGATION_RULE_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(NAVIGATION_RULE_EXTENSION, "tag");
-
- public WriteNavigationRuleTestCase_1_2(String name) {
- super(name);
- }
-
- public void testNavigationRuleExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- NavigationRuleType navigationRule = facesConfigFactory.createNavigationRuleType();
- navigationRule.setId(EXTENDED_NAVIGATION_RULE_ID);
-
- NavigationRuleExtensionType extensionType = facesConfigFactory
- .createNavigationRuleExtensionType();
- extensionType.setId(NAVIGATION_RULE_EXTENSION_ID);
-
- extensionType.getChildNodes().add(
- createDynamicElement(NAVIGATION_RULE_EXTENSION_TAG));
-
- navigationRule.getNavigationRuleExtension().add(extensionType);
- edit.getFacesConfig().getNavigationRule().add(navigationRule);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- NavigationRuleType navigationRule = (NavigationRuleType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getNavigationRule(), EXTENDED_NAVIGATION_RULE_ID);
- assertNotNull(navigationRule);
-
- assertEquals(1, navigationRule.getNavigationRuleExtension().size());
- NavigationRuleExtensionType extensionType = (NavigationRuleExtensionType) navigationRule
- .getNavigationRuleExtension().get(0);
- assertEquals(NAVIGATION_RULE_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType
- .getChildNodes().get(0);
- assertEquals(NAVIGATION_RULE_EXTENSION_TAG, element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_2_0.java
deleted file mode 100644
index 28dc8dc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteNavigationRuleTestCase_2_0.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IfType;
-import org.eclipse.jst.jsf.facesconfig.emf.NameType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.emf.RedirectType;
-import org.eclipse.jst.jsf.facesconfig.emf.RedirectViewParamType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValueType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-/**
- * @author cbateman
- *
- */
-public class WriteNavigationRuleTestCase_2_0 extends
- WriteNavigationRuleTestCase_1_2 {
- private final static String NAVIGATION_RULE_ID = "navigation-rule-id-20";
- private final static String NAVIGATION_CASE_ID = "navigation-case-id-20";
- private final static String IFEXPRESSION = "if-expr";
- private final static String NAME = "name";
- private final static String VALUE = "value";
-
- public WriteNavigationRuleTestCase_2_0(String name) {
- super(name);
- }
-
- public void testNavigationRule20() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- NavigationRuleType navigationRule = facesConfigFactory.createNavigationRuleType();
- navigationRule.setId(NAVIGATION_RULE_ID);
-
- NavigationCaseType navigationCase = facesConfigFactory.createNavigationCaseType();
- navigationCase.setId(NAVIGATION_CASE_ID);
- navigationRule.getNavigationCase().add(navigationCase);
-
- IfType ifexpr = facesConfigFactory.createIfType();
- ifexpr.setTextContent(IFEXPRESSION);
- navigationCase.setIf(ifexpr);
-
- RedirectType redirect = facesConfigFactory.createRedirectType();
- redirect.setIncludeViewParams(true);
- navigationCase.setRedirect(redirect);
-
- RedirectViewParamType viewParam = facesConfigFactory.createRedirectViewParamType();
- redirect.getViewParam().add(viewParam);
-
- NameType name = facesConfigFactory.createNameType();
- name.setTextContent(NAME);
- viewParam.setName(name);
- ValueType value = facesConfigFactory.createValueType();
- value.setTextContent(VALUE);
- viewParam.setValue(value);
-
- edit.getFacesConfig().getNavigationRule().add(navigationRule);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- NavigationRuleType navigationRule = (NavigationRuleType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getNavigationRule(), NAVIGATION_RULE_ID);
- assertNotNull(navigationRule);
-
- NavigationCaseType navigationCase = (NavigationCaseType) FacesConfigModelUtil
- .findEObjectElementById(navigationRule.getNavigationCase(), NAVIGATION_CASE_ID);
- assertNotNull(navigationCase);
-
- IfType ifexpr = navigationCase.getIf();
- assertNotNull(ifexpr);
- assertEquals(IFEXPRESSION, ifexpr.getTextContent().trim());
-
- RedirectType redirect = navigationCase.getRedirect();
- assertNotNull(redirect);
- assertEquals(true, redirect.isIncludeViewParams());
-
- assertEquals(1, redirect.getViewParam().size());
- RedirectViewParamType viewParam = (RedirectViewParamType)redirect.getViewParam().get(0);
- assertEquals(NAME, viewParam.getName().getTextContent().trim());
- assertEquals(VALUE, viewParam.getValue().getTextContent().trim());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteReferencedBeanTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteReferencedBeanTestCase.java
deleted file mode 100644
index 0ec475f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteReferencedBeanTestCase.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.ReferencedBeanClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ReferencedBeanNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ReferencedBeanType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteReferencedBeanTestCase extends BaseWriteTestCase {
- private final static String REFERENCED_BEAN = "referenced-bean";
- private final static String REFERENCED_BEAN_NAME =
- CommonStructuresUtil.createPreficedString(REFERENCED_BEAN, CommonStructuresUtil.NAME);
- private final static String REFERENCED_BEAN_CLASS =
- CommonStructuresUtil.createPreficedString(REFERENCED_BEAN, CommonStructuresUtil.CLASS);
-
- public WriteReferencedBeanTestCase(String name) {
- super(name);
- }
-
- public void testWriteReferencedBeanToFileTwo()
- {
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- ReferencedBeanType referencedBean = facesConfigFactory.createReferencedBeanType();
-
- referencedBean.getDescription().add(CommonStructuresUtil.createDescription(REFERENCED_BEAN));
- referencedBean.getDisplayName().add(CommonStructuresUtil.createDisplayName(REFERENCED_BEAN));
- referencedBean.getIcon().add(CommonStructuresUtil.createIcon(REFERENCED_BEAN));
-
- {
- ReferencedBeanNameType referencedBeanNameType =
- facesConfigFactory.createReferencedBeanNameType();
- referencedBeanNameType.setTextContent(REFERENCED_BEAN_NAME);
- referencedBeanNameType.setId(
- CommonStructuresUtil.createPreficedString(
- REFERENCED_BEAN_NAME, CommonStructuresUtil.ID));
- referencedBean.setReferencedBeanName(referencedBeanNameType);
- }
-
- {
- ReferencedBeanClassType referencedBeanClassType =
- facesConfigFactory.createReferencedBeanClassType();
- referencedBeanClassType.setTextContent(REFERENCED_BEAN_CLASS);
- referencedBeanClassType.setId(
- CommonStructuresUtil.createPreficedString(
- REFERENCED_BEAN_CLASS, CommonStructuresUtil.ID));
- referencedBean.setReferencedBeanClass(referencedBeanClassType);
- }
-
- referencedBean.setId(
- CommonStructuresUtil.createPreficedString(REFERENCED_BEAN,CommonStructuresUtil.ID));
-
- edit.getFacesConfig().getReferencedBean().add(referencedBean);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- assertEquals(1, edit.getFacesConfig().getReferencedBean().size());
- ReferencedBeanType referencedBean = (ReferencedBeanType)
- edit.getFacesConfig().getReferencedBean().get(0);
-
- CommonStructuresUtil.assertMatchesDescription(REFERENCED_BEAN
- , (DescriptionType) referencedBean.getDescription().get(0));
- CommonStructuresUtil.assertMatchesDisplayName(REFERENCED_BEAN
- , (DisplayNameType) referencedBean.getDisplayName().get(0));
- CommonStructuresUtil.assertMatchesIcon(REFERENCED_BEAN
- , (IconType) referencedBean.getIcon().get(0));
-
- {
- ReferencedBeanNameType referencedBeanNameType =
- referencedBean.getReferencedBeanName();
- assertEquals(REFERENCED_BEAN_NAME, referencedBeanNameType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(
- REFERENCED_BEAN_NAME, CommonStructuresUtil.ID)
- , referencedBeanNameType.getId());
- }
-
- {
- ReferencedBeanClassType referencedBeanClassType =
- referencedBean.getReferencedBeanClass();
- assertEquals(REFERENCED_BEAN_CLASS, referencedBeanClassType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(
- REFERENCED_BEAN_CLASS, CommonStructuresUtil.ID)
- , referencedBeanClassType.getId());
- }
-
- assertEquals(CommonStructuresUtil.createPreficedString(REFERENCED_BEAN,CommonStructuresUtil.ID)
- , referencedBean.getId());
- }
- finally
- {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase.java
deleted file mode 100644
index 4536838..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentFamilyType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.FacetType;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererType;
-import org.eclipse.jst.jsf.facesconfig.emf.RendererTypeType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteRenderKitTestCase extends BaseWriteTestCase
-{
- protected final static String RENDER_KIT = "render-kit";
- private final static String RENDER_KIT_ID =
- CommonStructuresUtil.createPreficedString(RENDER_KIT, CommonStructuresUtil.ID);
- private final static String RENDER_KIT_CLASS =
- CommonStructuresUtil.createPreficedString(RENDER_KIT, CommonStructuresUtil.CLASS);
- private final static String RENDERER = "renderer";
- private final static String COMPONENT_FAMILY = "component-family";
- private final static String RENDERER_COMPONENT_FAMILY =
- CommonStructuresUtil.createPreficedString(RENDERER, COMPONENT_FAMILY);
- private final static String RENDERER_TYPE =
- CommonStructuresUtil.createPreficedString(RENDERER, "type");
- private final static String RENDERER_CLASS =
- CommonStructuresUtil.createPreficedString(RENDERER, CommonStructuresUtil.CLASS);
-
- public WriteRenderKitTestCase(String name) {
- super(name);
- }
-
- public void testWriteRenderKit() {
- //IProject project = WizardUtil.getTestProject();
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- RenderKitType renderKit = facesConfigFactory.createRenderKitType();
-
- renderKit.getDescription().add(CommonStructuresUtil.createDescription(RENDER_KIT));
- renderKit.getDisplayName().add(CommonStructuresUtil.createDisplayName(RENDER_KIT));
- renderKit.getIcon().add(CommonStructuresUtil.createIcon(RENDER_KIT));
-
- {
- RenderKitIdType renderKitIdType = facesConfigFactory.createRenderKitIdType();
- renderKitIdType.setTextContent(RENDER_KIT);
- renderKitIdType.setId
- (CommonStructuresUtil.createPreficedString(RENDER_KIT, CommonStructuresUtil.ID));
- renderKit.setRenderKitId(renderKitIdType);
- }
-
- {
- RenderKitClassType renderKitClassType = facesConfigFactory.createRenderKitClassType();
- renderKitClassType.setTextContent(RENDER_KIT_CLASS);
- renderKitClassType.setId(
- CommonStructuresUtil.createPreficedString(RENDER_KIT_CLASS, CommonStructuresUtil.ID));
- renderKit.setRenderKitClass(renderKitClassType);
- }
-
- RendererType renderer = facesConfigFactory.createRendererType();
-
- renderer.getDescription().add(CommonStructuresUtil.createDescription(RENDERER));
- renderer.getDisplayName().add(CommonStructuresUtil.createDisplayName(RENDERER));
- renderer.getIcon().add(CommonStructuresUtil.createIcon(RENDERER));
-
- {
- ComponentFamilyType componentFamily =
- facesConfigFactory.createComponentFamilyType();
- componentFamily.setTextContent(RENDERER_COMPONENT_FAMILY);
- componentFamily.setId(
- CommonStructuresUtil.createPreficedString(RENDERER_COMPONENT_FAMILY, CommonStructuresUtil.ID));
- renderer.setComponentFamily(componentFamily);
- }
-
- {
- RendererTypeType rendererTypeType = facesConfigFactory.createRendererTypeType();
- rendererTypeType.setTextContent(RENDERER_TYPE);
- rendererTypeType.setId(
- CommonStructuresUtil.createPreficedString(RENDERER_TYPE, CommonStructuresUtil.ID));
- renderer.setRendererType(rendererTypeType);
- }
-
- {
- RendererClassType rendererClassType = facesConfigFactory.createRendererClassType();
- rendererClassType.setTextContent(RENDERER_CLASS);
- rendererClassType.setId(
- CommonStructuresUtil.createPreficedString(RENDERER_CLASS, CommonStructuresUtil.ID));
- renderer.setRendererClass(rendererClassType);
- }
-
- renderer.getAttribute().add(CommonStructuresUtil.createAttribute(RENDERER));
- renderer.getFacet().add(CommonStructuresUtil.createFacet(RENDERER));
- renderer.setId(CommonStructuresUtil.createPreficedString(RENDERER, CommonStructuresUtil.ID));
-
- renderKit.getRenderer().add(renderer);
- renderKit.setId(RENDER_KIT_ID);
-
- edit.getFacesConfig().getRenderKit().add(renderKit);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit = (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getRenderKit(), RENDER_KIT_ID);
- assertNotNull(renderKit);
-
- assertEquals(1, renderKit.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription(RENDER_KIT,
- (DescriptionType) renderKit.getDescription().get(0));
-
- assertEquals(1, renderKit.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName(RENDER_KIT,
- (DisplayNameType) renderKit.getDisplayName().get(0));
-
- assertEquals(1, renderKit.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon(RENDER_KIT,
- (IconType) renderKit.getIcon().get(0));
-
- {
-
- RenderKitIdType renderKitIdType = renderKit.getRenderKitId();
- assertEquals(RENDER_KIT, renderKitIdType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(RENDER_KIT, CommonStructuresUtil.ID)
- , renderKitIdType.getId());
- }
-
- {
- RenderKitClassType renderKitClassType = renderKit.getRenderKitClass();
- assertEquals(RENDER_KIT_CLASS, renderKitClassType.getTextContent());
- assertEquals(
- CommonStructuresUtil.createPreficedString(RENDER_KIT_CLASS, CommonStructuresUtil.ID)
- ,renderKitClassType.getId());
- }
-
- assertEquals(1, renderKit.getRenderer().size());
- RendererType renderer = (RendererType) renderKit.getRenderer().get(0);
-
- assertEquals(1, renderer.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription(RENDERER
- ,(DescriptionType) renderer.getDescription().get(0));
-
- assertEquals(1, renderer.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName(RENDERER
- , (DisplayNameType) renderer.getDisplayName().get(0));
-
- assertEquals(1, renderer.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon(RENDERER
- , (IconType) renderer.getIcon().get(0));
-
- {
- ComponentFamilyType componentFamily = renderer.getComponentFamily();
-
- assertEquals(RENDERER_COMPONENT_FAMILY
- , componentFamily.getTextContent());
-
- assertEquals(CommonStructuresUtil.createPreficedString(RENDERER_COMPONENT_FAMILY, CommonStructuresUtil.ID)
- , componentFamily.getId());
- }
-
- {
- RendererTypeType rendererTypeType = renderer.getRendererType();
- assertEquals(RENDERER_TYPE
- , rendererTypeType.getTextContent());
-
- assertEquals(CommonStructuresUtil.createPreficedString(RENDERER_TYPE, CommonStructuresUtil.ID)
- , rendererTypeType.getId());
- }
-
- {
- RendererClassType rendererClassType = renderer.getRendererClass();
- assertEquals(RENDERER_CLASS, rendererClassType.getTextContent());
- assertEquals(CommonStructuresUtil.createPreficedString(RENDERER_CLASS, CommonStructuresUtil.ID)
- , rendererClassType.getId());
- }
-
- assertEquals(1, renderer.getAttribute().size());
- CommonStructuresUtil.assertMatchAttribute(RENDERER
- , (AttributeType) renderer.getAttribute().get(0));
-
- assertEquals(1, renderer.getFacet().size());
- CommonStructuresUtil.assertMatchFacet(RENDERER
- , (FacetType) renderer.getFacet().get(0));
-
- assertEquals(CommonStructuresUtil.createPreficedString(RENDERER, CommonStructuresUtil.ID)
- , renderer.getId());
-
- assertEquals(CommonStructuresUtil.createPreficedString(RENDER_KIT, CommonStructuresUtil.ID)
- , renderKit.getId());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_1_2.java
deleted file mode 100644
index 550a150..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_1_2.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteRenderKitTestCase_1_2 extends WriteRenderKitTestCase
-{
- private final static String EXTENDED_RENDERKIT_ID = "extended-renderkit-rule-id";
-
- private final static String RENDERKIT_EXTENSION = CommonStructuresUtil
- .createPreficedString(RENDER_KIT, "extension");
- private final static String RENDERKIT_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(RENDERKIT_EXTENSION, "id");
- private final static String RENDERKIT_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(RENDERKIT_EXTENSION, "tag");
-
- public WriteRenderKitTestCase_1_2(String name) {
- super(name);
- }
-
- public void testRenderKitExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- RenderKitType renderKit = facesConfigFactory.createRenderKitType();
- renderKit.setId(EXTENDED_RENDERKIT_ID);
-
- RenderKitExtensionType extensionType = facesConfigFactory
- .createRenderKitExtensionType();
- extensionType.setId(RENDERKIT_EXTENSION_ID);
-
- extensionType.getChildNodes().add(
- createDynamicElement(RENDERKIT_EXTENSION_TAG));
-
- renderKit.getRenderKitExtension().add(extensionType);
- edit.getFacesConfig().getRenderKit().add(renderKit);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit = (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getRenderKit(), EXTENDED_RENDERKIT_ID);
- assertNotNull(renderKit);
-
- assertEquals(1, renderKit.getRenderKitExtension().size());
- RenderKitExtensionType extensionType = (RenderKitExtensionType) renderKit
- .getRenderKitExtension().get(0);
- assertEquals(RENDERKIT_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType
- .getChildNodes().get(0);
- assertEquals(RENDERKIT_EXTENSION_TAG, element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_2_0.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_2_0.java
deleted file mode 100644
index 9856834..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteRenderKitTestCase_2_0.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererType;
-import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererTypeType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-
-public class WriteRenderKitTestCase_2_0 extends WriteRenderKitTestCase_1_2
-{
- private final static String RENDER_KIT_ID =
- CommonStructuresUtil.createPreficedString(RENDER_KIT+"20", CommonStructuresUtil.ID);
-// private final static String CLIENT_BEHAVIOR_RENDERER= "client-behavior-renderer";
- private final static String CLIENT_BEHAVIOR_RENDERER_TYPE= "client-behavior-renderer-type";
- private final static String CLIENT_BEHAVIOR_RENDERER_CLASS= "client-behavior-renderer-class";
-
- public WriteRenderKitTestCase_2_0(String name) {
- super(name);
- }
-
- public void testRenderKit20() {
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- RenderKitType renderKit = facesConfigFactory.createRenderKitType();
-
- renderKit.getDescription().add(CommonStructuresUtil.createDescription(RENDER_KIT));
- renderKit.getDisplayName().add(CommonStructuresUtil.createDisplayName(RENDER_KIT));
- renderKit.getIcon().add(CommonStructuresUtil.createIcon(RENDER_KIT));
-
- {
- ClientBehaviorRendererType clientBehaviorRenderer = facesConfigFactory.createClientBehaviorRendererType();
-// clientBehaviorRenderer.setId
-// (CommonStructuresUtil.createPreficedString(CLIENT_BEHAVIOR_RENDERER, CommonStructuresUtil.ID));
- renderKit.getClientBehaviorRenderer().add(clientBehaviorRenderer);
- ClientBehaviorRendererTypeType clientBehaviorRendererType = facesConfigFactory.createClientBehaviorRendererTypeType();
- clientBehaviorRendererType.setTextContent(CLIENT_BEHAVIOR_RENDERER_TYPE);
- clientBehaviorRenderer.setClientBehaviorRendererType(clientBehaviorRendererType);
- ClientBehaviorRendererClassType clientBehaviorRendererClass = facesConfigFactory.createClientBehaviorRendererClassType();
- clientBehaviorRendererClass.setTextContent(CLIENT_BEHAVIOR_RENDERER_CLASS);
- clientBehaviorRenderer.setClientBehaviorRendererClass(clientBehaviorRendererClass);
- }
-
- renderKit.setId(RENDER_KIT_ID);
- EList list = edit.getFacesConfig().getRenderKit();
- list.add(renderKit);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- RenderKitType renderKit = (RenderKitType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getRenderKit(), RENDER_KIT_ID);
- assertNotNull(renderKit);
-
- assertEquals(1, renderKit.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription(RENDER_KIT,
- (DescriptionType) renderKit.getDescription().get(0));
-
- assertEquals(1, renderKit.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName(RENDER_KIT,
- (DisplayNameType) renderKit.getDisplayName().get(0));
-
- assertEquals(1, renderKit.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon(RENDER_KIT,
- (IconType) renderKit.getIcon().get(0));
-
- {
- assertEquals(1, renderKit.getClientBehaviorRenderer().size());
- ClientBehaviorRendererType clientBehaviorRenderer = (ClientBehaviorRendererType)renderKit.getClientBehaviorRenderer().get(0);
- ClientBehaviorRendererTypeType clientBehaviorRendererType = clientBehaviorRenderer.getClientBehaviorRendererType();
- assertEquals(CLIENT_BEHAVIOR_RENDERER_TYPE, clientBehaviorRendererType.getTextContent());
- ClientBehaviorRendererClassType clientBehaviorRendererClass = clientBehaviorRenderer.getClientBehaviorRendererClass();
- assertEquals(CLIENT_BEHAVIOR_RENDERER_CLASS, clientBehaviorRendererClass.getTextContent());
- }
- assertEquals(RENDER_KIT_ID, renderKit.getId());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase.java
deleted file mode 100644
index 17e4293..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.facesconfig.emf.AttributeType;
-import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType;
-import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.IconType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.WizardUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteValidatorTestCase extends BaseWriteTestCase {
- IProject project = null;
-
- protected final static String VALIDATOR = "validator";
- private final static String VALIDATOR_CLASS =
- CommonStructuresUtil.createPreficedString(VALIDATOR, CommonStructuresUtil.CLASS);
- private final static String VALIDATOR_ID =
- CommonStructuresUtil.createPreficedString(VALIDATOR, CommonStructuresUtil.ID);
-
- public WriteValidatorTestCase(String name) {
- super(name);
- }
- protected void setUp() throws Exception {
- super.setUp();
- WizardUtil.createProject(getName());
- project = WizardUtil.getTestProject(getName());
- }
-
- public void testWriteValidator()
- {
- FacesConfigArtifactEdit edit = null;
-
- try
- {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
-
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage.getFacesConfigFactory();
-
- ValidatorType validator = facesConfigFactory.createValidatorType();
-
- {
- ValidatorIdType validatorIdType = facesConfigFactory.createValidatorIdType();
- validatorIdType.setTextContent(VALIDATOR_ID);
- validatorIdType.setId(
- CommonStructuresUtil.createPreficedString(VALIDATOR_ID, CommonStructuresUtil.ID));
- validator.setValidatorId(validatorIdType);
- }
-
- {
- ValidatorClassType validatorClassType = facesConfigFactory.createValidatorClassType();
- validatorClassType.setTextContent(VALIDATOR_CLASS);
- validatorClassType.setId(
- CommonStructuresUtil.createPreficedString(VALIDATOR_CLASS, CommonStructuresUtil.ID));
- validator.setValidatorClass(validatorClassType);
- }
-
- validator.getDescription().add(
- CommonStructuresUtil.createDescription(VALIDATOR));
- validator.getDisplayName().add(
- CommonStructuresUtil.createDisplayName(VALIDATOR));
- validator.getIcon().add(
- CommonStructuresUtil.createIcon(VALIDATOR));
-
- validator.getAttribute().add(
- CommonStructuresUtil.createAttribute(VALIDATOR));
- validator.getProperty().add(
- CommonStructuresUtil.createProperty(VALIDATOR));
-
- validator.setId(VALIDATOR_ID);
-
- edit.getFacesConfig().getValidator().add(validator);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try
- {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ValidatorType validator = (ValidatorType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getValidator(), VALIDATOR_ID);
- assertNotNull(validator);
-
- {
- ValidatorIdType validatorIdType = validator.getValidatorId();
- assertEquals(VALIDATOR_ID, validatorIdType.getTextContent());
- assertEquals(
- CommonStructuresUtil.createPreficedString(VALIDATOR_ID, CommonStructuresUtil.ID)
- , validatorIdType.getId()
- );
- }
-
- {
- ValidatorClassType validatorClassType = validator.getValidatorClass();
-
- assertEquals(VALIDATOR_CLASS, validatorClassType.getTextContent());
- assertEquals(
- CommonStructuresUtil.createPreficedString(VALIDATOR_CLASS, CommonStructuresUtil.ID)
- , validatorClassType.getId());
- }
-
- assertEquals(1, validator.getDescription().size());
- CommonStructuresUtil.assertMatchesDescription(VALIDATOR
- , (DescriptionType) validator.getDescription().get(0));
-
- assertEquals(1, validator.getDisplayName().size());
- CommonStructuresUtil.assertMatchesDisplayName(VALIDATOR
- , (DisplayNameType) validator.getDisplayName().get(0));
-
- assertEquals(1, validator.getIcon().size());
- CommonStructuresUtil.assertMatchesIcon(VALIDATOR
- , (IconType) validator.getIcon().get(0));
-
- assertEquals(1, validator.getAttribute().size());
- CommonStructuresUtil.assertMatchAttribute(VALIDATOR
- , (AttributeType) validator.getAttribute().get(0));
-
- assertEquals(1, validator.getProperty().size());
- CommonStructuresUtil.assertMatchProperty(VALIDATOR
- , (PropertyType) validator.getProperty().get(0));
-
- assertEquals(CommonStructuresUtil.createPreficedString(VALIDATOR, CommonStructuresUtil.ID)
- , validator.getId());
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase_1_2.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase_1_2.java
deleted file mode 100644
index e6a272b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/src/org/eclipse/jst/jsf/facesconfig/tests/write/WriteValidatorTestCase_1_2.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 Oracle Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facesconfig.tests.write;
-
-import org.eclipse.jst.jsf.facesconfig.emf.DynamicElement;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorExtensionType;
-import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
-import org.eclipse.jst.jsf.facesconfig.tests.util.CommonStructuresUtil;
-import org.eclipse.jst.jsf.facesconfig.tests.util.FacesConfigModelUtil;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-
-public class WriteValidatorTestCase_1_2 extends WriteValidatorTestCase {
- private final static String EXTENDED_VALIDATOR_ID = "extended-validator-id";
-
- private final static String VALIDATOR_EXTENSION = CommonStructuresUtil
- .createPreficedString(VALIDATOR, "extension");
- private final static String VALIDATOR_EXTENSION_ID = CommonStructuresUtil
- .createPreficedString(VALIDATOR_EXTENSION, "id");
- private final static String VALIDATOR_EXTENSION_TAG = CommonStructuresUtil
- .createPreficedString(VALIDATOR_EXTENSION, "tag");
-
- public WriteValidatorTestCase_1_2(String name) {
- super(name);
- }
-
- public void testValidatorExtension() {
- FacesConfigArtifactEdit edit = null;
-
- try {
- edit = getArtifactEditForWrite();
- assertNotNull(edit.getFacesConfig());
- FacesConfigPackage facesConfigPackage = FacesConfigPackage.eINSTANCE;
- FacesConfigFactory facesConfigFactory = facesConfigPackage
- .getFacesConfigFactory();
-
- ValidatorType validator = facesConfigFactory.createValidatorType();
- validator.setId(EXTENDED_VALIDATOR_ID);
-
- ValidatorExtensionType extensionType = facesConfigFactory
- .createValidatorExtensionType();
- extensionType.setId(VALIDATOR_EXTENSION_ID);
-
- extensionType.getChildNodes().add(
- createDynamicElement(VALIDATOR_EXTENSION_TAG));
-
- validator.getValidatorExtension().add(extensionType);
- edit.getFacesConfig().getValidator().add(validator);
- edit.save(null);
- } finally {
- if (edit != null) {
- edit.dispose();
- assertTrue(edit.isDisposed());
- edit = null;
- }
- }
-
- try {
- edit = getArtifactEditForRead();
- assertNotNull(edit.getFacesConfig());
-
- ValidatorType validator = (ValidatorType) FacesConfigModelUtil
- .findEObjectElementById(edit.getFacesConfig()
- .getValidator(), EXTENDED_VALIDATOR_ID);
- assertNotNull(validator);
-
- assertEquals(1, validator.getValidatorExtension().size());
- ValidatorExtensionType extensionType = (ValidatorExtensionType) validator
- .getValidatorExtension().get(0);
- assertEquals(VALIDATOR_EXTENSION_ID, extensionType.getId());
-
- assertEquals(1, extensionType.getChildNodes().size());
- DynamicElement element = (DynamicElement) extensionType
- .getChildNodes().get(0);
- assertEquals(VALIDATOR_EXTENSION_TAG, element.getName());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config-ext-data1.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config-ext-data1.xml
deleted file mode 100644
index db514ec..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config-ext-data1.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
-<faces-config>
- <component id="component1">
- <component-type>component</component-type>
- <component-class>componentClass</component-class>
- <component-extension id="singleRootComponentExt">
- <any-data attribute="any-data-attribute">
- <first-child>someData</first-child>
- <second-child>second Child's data</second-child>
- </any-data>
- </component-extension>
- </component>
-
-</faces-config> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config.xml
deleted file mode 100644
index e777aec..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config.xml
+++ /dev/null
@@ -1,411 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
-<faces-config>
-
- <lifecycle id="lifecycle1">
- <phase-listener id="phaseListener1">
- org.eclipse.wtp.jsf.tests.ValueResourcePhaseListener
- </phase-listener>
- </lifecycle>
-
-
- <factory id="factory1">
- <application-factory id="applicationFactory1">application-factory</application-factory>
- <faces-context-factory id="facesContextFactory1">
- faces-context-factory
- </faces-context-factory>
- <lifecycle-factory id="lifecycleFactory1">lifecycle-factory</lifecycle-factory>
- <render-kit-factory id="renderKitFactory1">render-kit-factory</render-kit-factory>
- </factory>
-
- <!-- Component -->
- <component id="component1">
- <description id="componentDescription1">my component</description>
- <display-name id="componentDisplayName1">My component</display-name>
- <icon id="componentIcon1">
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <component-type>component-type</component-type>
- <component-class>ComponentClass</component-class>
- <facet id="componentFacet1">
- <description id="componentFacet1_descripton1">Facet1 Description</description>
- <display-name id="componentFacet1_displayName1">Component Facet 1</display-name>
- <icon id="componentFacet1_icon1">
- <small-icon>facet-small-icon</small-icon>
- <large-icon>facet-large-icon</large-icon>
- </icon>
- <facet-name>facetName_chieb_sieb</facet-name>
- <facet-extension><extendedBlah></extendedBlah></facet-extension>
- </facet>
- <attribute id="componentAttribute1">
- <description id="componentAttribute1_descripton1">attribute-description</description>
- <display-name id="componentAttribute1_displayName1">attribute-display-name</display-name>
- <icon id="componentAttribute1_icon1">
- <small-icon>attribute-small-icon</small-icon>
- <large-icon>attribute-large-icon</large-icon>
- </icon>
- <attribute-name>attribute-name</attribute-name>
- <attribute-class>attribute-class</attribute-class>
- <default-value>value5</default-value>
- <suggested-value>attribute-suggested-value</suggested-value>
- <attribute-extension><attr-extension/></attribute-extension>
- </attribute>
- <property id="componentProperty1">
- <description id="componentProperty1_descripton1">myDescript blah blah</description>
- <display-name id="componentProperty1_displayName1">Component Property 1</display-name>
- <icon id="componentProperty1_icon1">
- <small-icon>property-small-icon</small-icon>
- <large-icon>property-large-icon</large-icon>
- </icon>
- <property-name id="componentProperty1_propertyName">property1</property-name>
- <property-class id="componentProperty1_propertyClass">ComponentProperty</property-class>
- <default-value>defaultValue6</default-value>
- <suggested-value>suggestedValue</suggested-value>
- </property>
- <component-extension id="componentExtension1"><foo></foo></component-extension>
- </component>
-
-
- <!-- managed-bean -->
- <managed-bean id="managedBean1">
- <description id="managedBean1Description">managed-bean-description</description>
- <display-name id="managedBean1DisplayName">managed-bean-display-name</display-name>
- <icon id="managedBean1Icon">
- <small-icon>managedBean1-small-icon</small-icon>
- <large-icon>managedBean1-large-icon</large-icon>
- </icon>
- <managed-bean-name>managedBeanName</managed-bean-name>
- <managed-bean-class>managed-bean-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property id="managedBean1Property1">
- <description id="managedBean1Property1_description">managed-property-description</description>
- <display-name id="managedBean1Property1_displayName">managed-property-display-name</display-name>
- <icon id="managedBean1Property1_icon">
- <small-icon>managedBean1-property-small-icon</small-icon>
- <large-icon>managedBean1-property-large-icon</large-icon>
- </icon>
- <property-name>bean-property-name</property-name>
- <property-class>bean-property-class</property-class>
- <value>bean-propertyValue1</value>
- </managed-property>
- <managed-property id="managedBean1Property2">
- <property-name>bean-property2-name</property-name>
- <property-class>bean-property2-class</property-class>
- <null-value/>
- </managed-property>
- <managed-property id="managedBeanMapProperty">
- <property-name>map-bean-name</property-name>
- <property-class>map-bean-class</property-class>
- <map-entries>
- <key-class>propertyMapEntryKey</key-class>
- <value-class>propertyMapEntryValueClass</value-class>
- <map-entry id="mapPropertyEntryWithValue">
- <key>propertyMapKey1</key>
- <value>propertyMapValue1</value>
- </map-entry>
- <map-entry id="mapPropertyEntryWithNullValue">
- <key>propertyMapKey2</key>
- <null-value/>
- </map-entry>
- </map-entries>
- </managed-property>
- <managed-property id="managedBeanListProperty">
- <property-name>list-bean-name</property-name>
- <property-class>list-bean-class</property-class>
- <list-entries>
- <value-class>managedBeanListPropertyClass</value-class>
- <value id="managedBeanListProperty_value">managedBeanListPropertyValue</value>
- <null-value/>
- </list-entries>
- </managed-property>
- </managed-bean>
-
- <managed-bean id="mapBean1">
- <managed-bean-name>mapBean1</managed-bean-name>
- <managed-bean-class>mapBean1-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <map-entries>
- <key-class>mapBeanEntryKey</key-class>
- <value-class>mapBeanEntryValueClass</value-class>
- <map-entry id="mapBeanEntryWithValue">
- <key>mapBeanKey1</key>
- <value>mapBeanValue1</value>
- </map-entry>
- <map-entry id="mapBeanEntryWithNullValue">
- <key>mapBeanKey2</key>
- <null-value/>
- </map-entry>
- </map-entries>
- </managed-bean>
-
- <managed-bean id="listBean1">
- <managed-bean-name>listBean1</managed-bean-name>
- <managed-bean-class>listBean1-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <list-entries>
- <value-class>listBeanListPropertyClass</value-class>
- <value id="listBeanListProperty_value">listBeanListPropertyValue</value>
- <null-value/>
- </list-entries>
- </managed-bean>
-
- <converter id="converter1">
- <description id="converter1Description">converter-description</description>
- <display-name id="converter1DisplayName">converter-display-name</display-name>
- <icon id="converter1Icon">
- <small-icon>converter-small-icon</small-icon>
- <large-icon>converter-large-icon</large-icon>
- </icon>
- <converter-for-class>converter-for-class</converter-for-class>
- <converter-class>converter-class</converter-class>
- <attribute id="converter1Attribute">
- <description id="converter1_attribute_description">converter-attribute-description</description>
- <display-name id="converter1_attribute_display-name">converter-attribute-display-name</display-name>
- <icon id="converter1_attribute_icon">
- <small-icon>converter1-attribute-small-icon</small-icon>
- <large-icon>converter1-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>converter1-attribute-name</attribute-name>
- <attribute-class>converter1-attribute-class</attribute-class>
- <default-value>converter1-default-value</default-value>
- <suggested-value>converter1-attribute-suggested-value</suggested-value>
- <attribute-extension>
- <attr-extension/>
- </attribute-extension>
- </attribute>
- <property id="converter1Property">
- <description id="converter1_property_description">converter-property-description</description>
- <display-name id="converter1_property_display-name">converter-property-display-name</display-name>
- <icon id="converter1_property_icon">
- <small-icon>converter1-property-small-icon</small-icon>
- <large-icon>converter1-property-large-icon</large-icon>
- </icon>
- <property-name>converter-property-name</property-name>
- <property-class>converter-property-propertyClass</property-class>
- <default-value>converter-property-default-value</default-value>
- <suggested-value>converter-property-suggested-value</suggested-value>
- </property>
- </converter>
-
- <converter id="converter2">
- <converter-id>converter2-id</converter-id>
- <converter-class>converter2-class</converter-class>
- </converter>
-
- <!-- Referenced-bean -->
- <referenced-bean id="referencedBean1">
- <description id="referencedBean1Description">Referenced Bean Desc</description>
- <display-name id="referencedBean1DisplayName">referenced-bean-display</display-name>
- <icon id="referencedBean1Icon">
- <small-icon>referenced-bean-small-icon</small-icon>
- <large-icon>referenced-bean-large-icon</large-icon>
- </icon>
- <referenced-bean-name>
- referencedBeanName
- </referenced-bean-name>
- <referenced-bean-class>
- referenced-bean-class
- </referenced-bean-class>
- </referenced-bean>
-
- <!-- Render kit -->
- <render-kit id="renderKit1">
- <description id="renderKit1Description">Render kit Desc</description>
- <display-name id="renderKit1DisplayName">Render kit disp name</display-name>
- <icon id="renderKit1Icon">
- <small-icon>small-renderkit-icon</small-icon>
- <large-icon>large-renderkit-icon</large-icon>
- </icon>
- <render-kit-id>render-kit-Id</render-kit-id>
- <render-kit-class>render-kit-class</render-kit-class>
- <renderer id="renderKit1Renderer">
- <description id="renderKit1RendererDescription">my renderer description</description>
- <display-name id="renderKit1RendererDisplayName">my renderer display name</display-name>
- <icon id="renderKit1RendererIcon">
- <small-icon>renderer-small-icon</small-icon>
- <large-icon>renderer-large-icon</large-icon>
- </icon>
- <component-family>component-family</component-family>
- <renderer-type>renderer-type</renderer-type>
- <renderer-class>renderer-class</renderer-class>
- <facet id="renderKit1Renderer1Facet1">
- <description id="renderKit1Renderer1Facet1Description">RendererFacetDescription</description>
- <display-name id="renderKit1Renderer1Facet1DisplayName">RendererFacetDisplayName</display-name>
- <icon id="renderKit1Renderer1Facet1Icon">
- <small-icon>facet-renderer-small-icon</small-icon>
- <large-icon>facet-renderer-large-icon</large-icon>
- </icon>
- <facet-name>rendererFacetName</facet-name>
- <facet-extension></facet-extension>
- </facet>
- <attribute id="renderKit1RendererAttribute1">
- <description id="renderKit1RendererAttribute1Description">renderer-attribute-attribute-description</description>
- <display-name id="renderKit1RendererAttribute1DisplayName">renderer-attribute-display-name</display-name>
- <icon id="renderKit1RendererAttribute1Icon">
- <small-icon>renderer-attribute-small-icon</small-icon>
- <large-icon>renderer-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>renderer attribute name</attribute-name>
- <attribute-class>renderer Attribute Class</attribute-class>
- <default-value>renderer attribute default value</default-value>
- <suggested-value>renderer attribute suggested value</suggested-value>
- <attribute-extension>
- <renderer-extension/>
- </attribute-extension>
- <attribute-extension>
- <blah-extension/>
- </attribute-extension>
- </attribute>
- <renderer-extension>
- <renderer-extension-1/>
- </renderer-extension>
- <renderer-extension>
- <renderer-extension-2/>
- </renderer-extension>
- <renderer-extension>
- <renderer-extension-3/>
- </renderer-extension>
-
- </renderer>
- </render-kit>
-
- <!-- Validator rules -->
- <validator id="validator1">
- <description id="validator1_description">validator-description</description>
- <display-name id="validator1_displayName">validator-display-name</display-name>
- <icon id="validator1_icon">
- <small-icon>validator-small-icon</small-icon>
- <large-icon>validator-large-icon</large-icon>
- </icon>
- <validator-id>validator-Id</validator-id>
- <validator-class>validator-class</validator-class>
- <attribute id="validator1_attribute">
- <description id="validator1_attribute_description">validator-attribute-description</description>
- <display-name id="validator1_attribute_displayName">validator-attribute-display-name</display-name>
- <icon id="validator1_attribute_icon">
- <small-icon>validator-attribute-small-icon</small-icon>
- <large-icon>validator-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>validator-attribute-name</attribute-name>
- <attribute-class>validator-attribute-class</attribute-class>
- <default-value>validator-default-value</default-value>
- <suggested-value>validator-attribute-suggested-value</suggested-value>
- <attribute-extension>
- <attribute-extension/>
- </attribute-extension>
- </attribute>
- <property id="validator1_property">
- <description id="validator1_property_description">validator-property-description</description>
- <display-name id="validator1_property_displayName">validator-property-display-name</display-name>
- <icon id="validator1_property_icon">
- <small-icon>validator-property-small-icon</small-icon>
- <large-icon>validator-property-large-icon</large-icon>
- </icon>
- <property-name>validator-property-name</property-name>
- <property-class>validator-property-class</property-class>
- <default-value>validator property default value</default-value>
- <suggested-value>validator property suggested value</suggested-value>
- <property-extension><future/></property-extension>
- </property>
- </validator>
-
- <!-- variable/property resolver registration -->
- <application id="application1">
- <action-listener id="actionListener1">Action listener</action-listener>
- <variable-resolver id="variableResolver1">
- com.ibm.faces.databind.SelectItemsVarResolver
- </variable-resolver>
- <default-render-kit-id id="defaultRenderKit1">some renderer kit</default-render-kit-id>
- <message-bundle id="messageBundle1">some messeage bundle goes here</message-bundle>
- <navigation-handler id="navigationHandler1">navigation handler</navigation-handler>
- <view-handler id="viewHandler1">view handler</view-handler>
- <state-manager id="stateManager1">state manager</state-manager>
-
- <property-resolver id="propertyResolver1">
- com.ibm.faces.databind.SelectItemsPropResolver
- </property-resolver>
- <locale-config id="localeConfig1">
- <default-locale id="defaultLocale1">en</default-locale>
- <supported-locale id="supportedLocale_en">en</supported-locale>
- <supported-locale id="supportedLocale_de">de</supported-locale>
- </locale-config>
- </application>
-
- <navigation-rule>
- <description>Descri 1</description>
- <display-name>display name 1</display-name>
- <icon>
- <small-icon>myicon</small-icon>
- </icon>
- <from-view-id>/Page1.jsp</from-view-id>
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
-
- <display-name>what display name</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{from-action}</from-action>
- <from-outcome>drilldown</from-outcome>
- <to-view-id>/edit.jsp</to-view-id>
- <redirect/>
- </navigation-case>
-
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <display-name>second navigation case</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{action2}</from-action>
- <from-outcome>outcome2</from-outcome>
- <to-view-id>/edit2.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <description xml:lang="en">A navigation rule with lang attributes</description>
- <description xml:lang="en-US">What color is it?</description>
- <description xml:lang="en-GB">What colour is it?</description>
- <description xml:lang="fr">Quelle couleur est lui?</description>
- <display-name xml:lang="en">English Display Name</display-name>
- <display-name xml:lang="fr">Nom D'Affichage De Français</display-name>
-
- <icon xml:lang="en">
- <small-icon>en_small-icon</small-icon>
- <large-icon>en_large-icon</large-icon>
- </icon>
- <icon>
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <from-view-id>/Page1.jsp</from-view-id>
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <display-name>second navigation rule navcase</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{action3}</from-action>
- <from-outcome>outcome3</from-outcome>
- <to-view-id>/edit3.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config1.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config1.xml
deleted file mode 100644
index c26e90f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
-<faces-config>
-
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config2.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config2.xml
deleted file mode 100644
index 4801809..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
- version="1.2">
-
-
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
-
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config3.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config3.xml
deleted file mode 100644
index 0a611ce..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config3.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
-
-
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
-
-
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_1_2.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_1_2.xml
deleted file mode 100644
index 2c46e99..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_1_2.xml
+++ /dev/null
@@ -1,433 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
- version="1.2">
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
- <lifecycle id="lifecycle1">
- <phase-listener id="phaseListener1">
- org.eclipse.wtp.jsf.tests.ValueResourcePhaseListener
- </phase-listener>
- <lifecycle-extension><lifecycle-extension-tag/></lifecycle-extension>
- </lifecycle>
-
-
- <factory id="factory1">
- <application-factory id="applicationFactory1">application-factory</application-factory>
- <faces-context-factory id="facesContextFactory1">
- faces-context-factory
- </faces-context-factory>
- <lifecycle-factory id="lifecycleFactory1">lifecycle-factory</lifecycle-factory>
- <render-kit-factory id="renderKitFactory1">render-kit-factory</render-kit-factory>
- <factory-extension><factory-extension-tag/></factory-extension>
- </factory>
-
- <!-- Component -->
- <component id="component1">
- <description id="componentDescription1">my component</description>
- <display-name id="componentDisplayName1">My component</display-name>
- <icon id="componentIcon1">
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <component-type>component-type</component-type>
- <component-class>ComponentClass</component-class>
- <facet id="componentFacet1">
- <description id="componentFacet1_descripton1">Facet1 Description</description>
- <display-name id="componentFacet1_displayName1">Component Facet 1</display-name>
- <icon id="componentFacet1_icon1">
- <small-icon>facet-small-icon</small-icon>
- <large-icon>facet-large-icon</large-icon>
- </icon>
- <facet-name>facetName_chieb_sieb</facet-name>
- <facet-extension><extendedBlah></extendedBlah></facet-extension>
- </facet>
- <attribute id="componentAttribute1">
- <description id="componentAttribute1_descripton1">attribute-description</description>
- <display-name id="componentAttribute1_displayName1">attribute-display-name</display-name>
- <icon id="componentAttribute1_icon1">
- <small-icon>attribute-small-icon</small-icon>
- <large-icon>attribute-large-icon</large-icon>
- </icon>
- <attribute-name>attribute-name</attribute-name>
- <attribute-class>attribute-class</attribute-class>
- <default-value>value5</default-value>
- <suggested-value>attribute-suggested-value</suggested-value>
- <attribute-extension><attr-extension/></attribute-extension>
- </attribute>
- <property id="componentProperty1">
- <description id="componentProperty1_descripton1">myDescript blah blah</description>
- <display-name id="componentProperty1_displayName1">Component Property 1</display-name>
- <icon id="componentProperty1_icon1">
- <small-icon>property-small-icon</small-icon>
- <large-icon>property-large-icon</large-icon>
- </icon>
- <property-name id="componentProperty1_propertyName">property1</property-name>
- <property-class id="componentProperty1_propertyClass">ComponentProperty</property-class>
- <default-value>defaultValue6</default-value>
- <suggested-value>suggestedValue</suggested-value>
- </property>
- <component-extension id="componentExtension1"><foo></foo></component-extension>
- </component>
-
-
- <!-- managed-bean -->
- <managed-bean id="managedBean1">
- <description id="managedBean1Description">managed-bean-description</description>
- <display-name id="managedBean1DisplayName">managed-bean-display-name</display-name>
- <icon id="managedBean1Icon">
- <small-icon>managedBean1-small-icon</small-icon>
- <large-icon>managedBean1-large-icon</large-icon>
- </icon>
- <managed-bean-name>managedBeanName</managed-bean-name>
- <managed-bean-class>managed-bean-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property id="managedBean1Property1">
- <description id="managedBean1Property1_description">managed-property-description</description>
- <display-name id="managedBean1Property1_displayName">managed-property-display-name</display-name>
- <icon id="managedBean1Property1_icon">
- <small-icon>managedBean1-property-small-icon</small-icon>
- <large-icon>managedBean1-property-large-icon</large-icon>
- </icon>
- <property-name>bean-property-name</property-name>
- <property-class>bean-property-class</property-class>
- <value>bean-propertyValue1</value>
- </managed-property>
- <managed-property id="managedBean1Property2">
- <property-name>bean-property2-name</property-name>
- <property-class>bean-property2-class</property-class>
- <null-value/>
- </managed-property>
- <managed-property id="managedBeanMapProperty">
- <property-name>map-bean-name</property-name>
- <property-class>map-bean-class</property-class>
- <map-entries>
- <key-class>propertyMapEntryKey</key-class>
- <value-class>propertyMapEntryValueClass</value-class>
- <map-entry id="mapPropertyEntryWithValue">
- <key>propertyMapKey1</key>
- <value>propertyMapValue1</value>
- </map-entry>
- <map-entry id="mapPropertyEntryWithNullValue">
- <key>propertyMapKey2</key>
- <null-value/>
- </map-entry>
- </map-entries>
- </managed-property>
- <managed-property id="managedBeanListProperty">
- <property-name>list-bean-name</property-name>
- <property-class>list-bean-class</property-class>
- <list-entries>
- <value-class>managedBeanListPropertyClass</value-class>
- <value id="managedBeanListProperty_value">managedBeanListPropertyValue</value>
- <null-value/>
- </list-entries>
- </managed-property>
- <managed-bean-extension><managed-bean-extension-tag/></managed-bean-extension>
- </managed-bean>
-
- <managed-bean id="mapBean1">
- <managed-bean-name>mapBean1</managed-bean-name>
- <managed-bean-class>mapBean1-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <map-entries>
- <key-class>mapBeanEntryKey</key-class>
- <value-class>mapBeanEntryValueClass</value-class>
- <map-entry id="mapBeanEntryWithValue">
- <key>mapBeanKey1</key>
- <value>mapBeanValue1</value>
- </map-entry>
- <map-entry id="mapBeanEntryWithNullValue">
- <key>mapBeanKey2</key>
- <null-value/>
- </map-entry>
- </map-entries>
- </managed-bean>
-
- <managed-bean id="listBean1">
- <managed-bean-name>listBean1</managed-bean-name>
- <managed-bean-class>listBean1-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <list-entries>
- <value-class>listBeanListPropertyClass</value-class>
- <value id="listBeanListProperty_value">listBeanListPropertyValue</value>
- <null-value/>
- </list-entries>
- </managed-bean>
-
- <converter id="converter1">
- <description id="converter1Description">converter-description</description>
- <display-name id="converter1DisplayName">converter-display-name</display-name>
- <icon id="converter1Icon">
- <small-icon>converter-small-icon</small-icon>
- <large-icon>converter-large-icon</large-icon>
- </icon>
- <converter-for-class>converter-for-class</converter-for-class>
- <converter-class>converter-class</converter-class>
- <attribute id="converter1Attribute">
- <description id="converter1_attribute_description">converter-attribute-description</description>
- <display-name id="converter1_attribute_display-name">converter-attribute-display-name</display-name>
- <icon id="converter1_attribute_icon">
- <small-icon>converter1-attribute-small-icon</small-icon>
- <large-icon>converter1-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>converter1-attribute-name</attribute-name>
- <attribute-class>converter1-attribute-class</attribute-class>
- <default-value>converter1-default-value</default-value>
- <suggested-value>converter1-attribute-suggested-value</suggested-value>
- <attribute-extension>
- <attr-extension/>
- </attribute-extension>
- </attribute>
- <property id="converter1Property">
- <description id="converter1_property_description">converter-property-description</description>
- <display-name id="converter1_property_display-name">converter-property-display-name</display-name>
- <icon id="converter1_property_icon">
- <small-icon>converter1-property-small-icon</small-icon>
- <large-icon>converter1-property-large-icon</large-icon>
- </icon>
- <property-name>converter-property-name</property-name>
- <property-class>converter-property-propertyClass</property-class>
- <default-value>converter-property-default-value</default-value>
- <suggested-value>converter-property-suggested-value</suggested-value>
- </property>
- <converter-extension><converter-extension-tag/></converter-extension>
- </converter>
-
- <converter id="converter2">
- <converter-id>converter2-id</converter-id>
- <converter-class>converter2-class</converter-class>
- </converter>
-
- <!-- Referenced-bean -->
- <referenced-bean id="referencedBean1">
- <description id="referencedBean1Description">Referenced Bean Desc</description>
- <display-name id="referencedBean1DisplayName">referenced-bean-display</display-name>
- <icon id="referencedBean1Icon">
- <small-icon>referenced-bean-small-icon</small-icon>
- <large-icon>referenced-bean-large-icon</large-icon>
- </icon>
- <referenced-bean-name>
- referencedBeanName
- </referenced-bean-name>
- <referenced-bean-class>
- referenced-bean-class
- </referenced-bean-class>
- </referenced-bean>
-
- <!-- Render kit -->
- <render-kit id="renderKit1">
- <description id="renderKit1Description">Render kit Desc</description>
- <display-name id="renderKit1DisplayName">Render kit disp name</display-name>
- <icon id="renderKit1Icon">
- <small-icon>small-renderkit-icon</small-icon>
- <large-icon>large-renderkit-icon</large-icon>
- </icon>
- <render-kit-id>render-kit-Id</render-kit-id>
- <render-kit-class>render-kit-class</render-kit-class>
- <renderer id="renderKit1Renderer">
- <description id="renderKit1RendererDescription">my renderer description</description>
- <display-name id="renderKit1RendererDisplayName">my renderer display name</display-name>
- <icon id="renderKit1RendererIcon">
- <small-icon>renderer-small-icon</small-icon>
- <large-icon>renderer-large-icon</large-icon>
- </icon>
- <component-family>component-family</component-family>
- <renderer-type>renderer-type</renderer-type>
- <renderer-class>renderer-class</renderer-class>
- <facet id="renderKit1Renderer1Facet1">
- <description id="renderKit1Renderer1Facet1Description">RendererFacetDescription</description>
- <display-name id="renderKit1Renderer1Facet1DisplayName">RendererFacetDisplayName</display-name>
- <icon id="renderKit1Renderer1Facet1Icon">
- <small-icon>facet-renderer-small-icon</small-icon>
- <large-icon>facet-renderer-large-icon</large-icon>
- </icon>
- <facet-name>rendererFacetName</facet-name>
- <facet-extension></facet-extension>
- </facet>
- <attribute id="renderKit1RendererAttribute1">
- <description id="renderKit1RendererAttribute1Description">renderer-attribute-attribute-description</description>
- <display-name id="renderKit1RendererAttribute1DisplayName">renderer-attribute-display-name</display-name>
- <icon id="renderKit1RendererAttribute1Icon">
- <small-icon>renderer-attribute-small-icon</small-icon>
- <large-icon>renderer-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>renderer attribute name</attribute-name>
- <attribute-class>renderer Attribute Class</attribute-class>
- <default-value>renderer attribute default value</default-value>
- <suggested-value>renderer attribute suggested value</suggested-value>
- <attribute-extension>
- <renderer-extension/>
- </attribute-extension>
- <attribute-extension>
- <blah-extension/>
- </attribute-extension>
- </attribute>
- <renderer-extension>
- <renderer-extension-1/>
- </renderer-extension>
- <renderer-extension>
- <renderer-extension-2/>
- </renderer-extension>
- <renderer-extension>
- <renderer-extension-3/>
- </renderer-extension>
- </renderer>
- <render-kit-extension><render-kit-extension-tag/></render-kit-extension>
- </render-kit>
-
- <!-- Validator rules -->
- <validator id="validator1">
- <description id="validator1_description">validator-description</description>
- <display-name id="validator1_displayName">validator-display-name</display-name>
- <icon id="validator1_icon">
- <small-icon>validator-small-icon</small-icon>
- <large-icon>validator-large-icon</large-icon>
- </icon>
- <validator-id>validator-Id</validator-id>
- <validator-class>validator-class</validator-class>
- <attribute id="validator1_attribute">
- <description id="validator1_attribute_description">validator-attribute-description</description>
- <display-name id="validator1_attribute_displayName">validator-attribute-display-name</display-name>
- <icon id="validator1_attribute_icon">
- <small-icon>validator-attribute-small-icon</small-icon>
- <large-icon>validator-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>validator-attribute-name</attribute-name>
- <attribute-class>validator-attribute-class</attribute-class>
- <default-value>validator-default-value</default-value>
- <suggested-value>validator-attribute-suggested-value</suggested-value>
- <attribute-extension>
- <attribute-extension/>
- </attribute-extension>
- </attribute>
- <property id="validator1_property">
- <description id="validator1_property_description">validator-property-description</description>
- <display-name id="validator1_property_displayName">validator-property-display-name</display-name>
- <icon id="validator1_property_icon">
- <small-icon>validator-property-small-icon</small-icon>
- <large-icon>validator-property-large-icon</large-icon>
- </icon>
- <property-name>validator-property-name</property-name>
- <property-class>validator-property-class</property-class>
- <default-value>validator property default value</default-value>
- <suggested-value>validator property suggested value</suggested-value>
- <property-extension><future/></property-extension>
- </property>
- <validator-extension><validator-extension-tag/></validator-extension>
- </validator>
-
- <!-- variable/property resolver registration -->
- <application id="application1">
- <action-listener id="actionListener1">Action listener</action-listener>
- <variable-resolver id="variableResolver1">
- com.ibm.faces.databind.SelectItemsVarResolver
- </variable-resolver>
- <default-render-kit-id id="defaultRenderKit1">some renderer kit</default-render-kit-id>
- <message-bundle id="messageBundle1">some messeage bundle goes here</message-bundle>
- <navigation-handler id="navigationHandler1">navigation handler</navigation-handler>
- <view-handler id="viewHandler1">view handler</view-handler>
- <state-manager id="stateManager1">state manager</state-manager>
-
- <property-resolver id="propertyResolver1">
- com.ibm.faces.databind.SelectItemsPropResolver
- </property-resolver>
- <locale-config id="localeConfig1">
- <default-locale id="defaultLocale1">en</default-locale>
- <supported-locale id="supportedLocale_en">en</supported-locale>
- <supported-locale id="supportedLocale_de">de</supported-locale>
- </locale-config>
- <el-resolver id="el-resolver-id">com.test.MyELResolver</el-resolver>
- <resource-bundle id="resourceBundleId1">
- <description id="resourceBundleDesc">Resource Bundle description blah</description>
- <display-name id="resourceBundleDisplayName">Resource Bundle display name blah</display-name>
- <icon id="resourceBundleId">
- <small-icon>resourceBundle-smallIcon</small-icon>
- <large-icon>resourceBundle-largeIcon</large-icon>
- </icon>
- <base-name>com.test.Bundle</base-name>
- <var>bundleVar</var>
- </resource-bundle>
- <application-extension id="applicatinExtension1">
- <some-extension-data/>
- </application-extension>
- </application>
-
- <navigation-rule>
- <description>Descri 1</description>
- <display-name>display name 1</display-name>
- <icon>
- <small-icon>myicon</small-icon>
- </icon>
- <from-view-id>/Page1.jsp</from-view-id>
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
-
- <display-name>what display name</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{from-action}</from-action>
- <from-outcome>drilldown</from-outcome>
- <to-view-id>/edit.jsp</to-view-id>
- <redirect/>
- </navigation-case>
-
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <display-name>second navigation case</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{action2}</from-action>
- <from-outcome>outcome2</from-outcome>
- <to-view-id>/edit2.jsp</to-view-id>
- </navigation-case>
-
- <navigation-rule-extension><navigation-extension-tag/></navigation-rule-extension>
- </navigation-rule>
-
- <navigation-rule>
- <description xml:lang="en">A navigation rule with lang attributes</description>
- <description xml:lang="en-US">What color is it?</description>
- <description xml:lang="en-GB">What colour is it?</description>
- <description xml:lang="fr">Quelle couleur est lui?</description>
- <display-name xml:lang="en">English Display Name</display-name>
- <display-name xml:lang="fr">Nom D'Affichage De Français</display-name>
-
- <icon xml:lang="en">
- <small-icon>en_small-icon</small-icon>
- <large-icon>en_large-icon</large-icon>
- </icon>
- <icon>
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <from-view-id>/Page1.jsp</from-view-id>
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <display-name>second navigation rule navcase</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{action3}</from-action>
- <from-outcome>outcome3</from-outcome>
- <to-view-id>/edit3.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
- <faces-config-extension>
- <faces-config-extended-data/>
- </faces-config-extension>
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_2_0.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_2_0.xml
deleted file mode 100644
index 72e48bf..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/template/faces-config_2_0.xml
+++ /dev/null
@@ -1,521 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0" metadata-complete="true">
-<!-- =========== FULL CONFIGURATION FILE ================================== -->
-
- <ordering id="ordering-id">
- <after>
- <name>afterName</name>
- <others id="after-others-id"></others>
- </after>
- <before>
- <name>beforeName</name>
- <others id="before-others-id"></others>
- </before>
- </ordering>
-
- <absolute-ordering id="absolute-ordering-id">
- <name>absoluteOrderingName</name>
- <others id="absolute-ordering-others-id"></others>
- </absolute-ordering>
-
- <name>facesconfigName</name>
-
- <behavior id="behavior-id">
- <description id="behaviorDescription1">my behavior</description>
- <display-name id="behaviorDisplayName1">My behavior</display-name>
- <icon id="behaviorIcon1">
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <behavior-id>behavior-id-id</behavior-id>
- <behavior-class>behavior-class</behavior-class>
- <attribute id="behavior1Attribute">
- <description id="behavior1AttributeDescription1">behavior1AttributeDescription1</description>
- <description id="behavior1AttributeDescription2">behavior1AttributeDescription2</description>
- <display-name id="behavior1AttributeDisplayName1" xml:lang="fr">behavior1AttributeDisplayName1</display-name>
- <display-name id="behavior1AttributeDisplayName2">behavior1AttributeDisplayName2</display-name>
- <icon id="behavior1AttributeIcon" >
- <small-icon id="behavior1AttributeSmallIcon">behavior1AttributeSmallIcon</small-icon>
- <large-icon id="behavior1AttributeLargeIcon" >behavior1AttributeLargeIcon</large-icon>
- </icon>
- <attribute-name id="behavior1AttributeName">behavior1AttributeName</attribute-name>
- <attribute-class id="behavior1AttributeClass">behavior1AttributeClass</attribute-class>
- <default-value id="behavior1AttributeDefaultValue">behavior1AttributeDefaultValue</default-value>
- <suggested-value id="behavior1AttributeSuggestedValue">behavior1AttributeSuggestedValue</suggested-value>
- <attribute-extension id="behavior1AttributeExtension1"><a>B</a></attribute-extension>
- <attribute-extension id="behavior1AttributeExtension2">
- <faces-config version="2.0"></faces-config>
- </attribute-extension>
- </attribute>
- <property id="behavior1Property">
- <description>behavior1PropertyDescription</description>
- <display-name>behavior1PropertyDisplayName</display-name>
- <icon id="behavior1PropertyIcon" >
- <small-icon id="behavior1PropertySmallIcon">behavior1PropertySmallIcon</small-icon>
- </icon>
- <property-name>behavior1PropertyName</property-name>
- <property-class>behavior1PropertyClass</property-class>
- </property>
- <behavior-extension>
- <a>B</a>
- <behavior-extension-tag/>
- </behavior-extension>
-
- </behavior>
-
- <lifecycle id="lifecycle1">
- <phase-listener id="phaseListener1">
- org.eclipse.wtp.jsf.tests.ValueResourcePhaseListener
- </phase-listener>
- <lifecycle-extension><lifecycle-extension-tag/></lifecycle-extension>
- </lifecycle>
-
-
- <factory id="factory1">
- <application-factory id="applicationFactory1">application-factory</application-factory>
- <exception-handler-factory id="exceptionHandlerFactory1">exception-handler-factory</exception-handler-factory>
- <external-context-factory id="externalContextFactory1">external-context-factory</external-context-factory>
- <partial-view-context-factory id="partialViewContextFactory1">partial-view-context-factory</partial-view-context-factory>
- <faces-context-factory id="facesContextFactory1">faces-context-factory</faces-context-factory>
- <lifecycle-factory id="lifecycleFactory1">lifecycle-factory</lifecycle-factory>
- <view-declaration-language-factory id="viewDeclarationLanguageFactory1">view-declaration-language-factory</view-declaration-language-factory>
- <tag-handler-delegate-factory id="tagHandlerDelegateFactory1">tag-handler-delegate-factory</tag-handler-delegate-factory>
- <render-kit-factory id="renderKitFactory1">render-kit-factory</render-kit-factory>
- <visit-context-factory id="visitContextFactory1">visit-context-factory</visit-context-factory>
- <factory-extension><factory-extension-tag/></factory-extension>
- </factory>
-
- <!-- Component -->
- <component id="component1">
- <description id="componentDescription1">my component</description>
- <display-name id="componentDisplayName1">My component</display-name>
- <icon id="componentIcon1">
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <component-type>component-type</component-type>
- <component-class>ComponentClass</component-class>
- <facet id="componentFacet1">
- <description id="componentFacet1_descripton1">Facet1 Description</description>
- <display-name id="componentFacet1_displayName1">Component Facet 1</display-name>
- <icon id="componentFacet1_icon1">
- <small-icon>facet-small-icon</small-icon>
- <large-icon>facet-large-icon</large-icon>
- </icon>
- <facet-name>facetName_chieb_sieb</facet-name>
- <facet-extension><extendedBlah></extendedBlah></facet-extension>
- </facet>
- <attribute id="componentAttribute1">
- <description id="componentAttribute1_descripton1">attribute-description</description>
- <display-name id="componentAttribute1_displayName1">attribute-display-name</display-name>
- <icon id="componentAttribute1_icon1">
- <small-icon>attribute-small-icon</small-icon>
- <large-icon>attribute-large-icon</large-icon>
- </icon>
- <attribute-name>attribute-name</attribute-name>
- <attribute-class>attribute-class</attribute-class>
- <default-value>value5</default-value>
- <suggested-value>attribute-suggested-value</suggested-value>
- <attribute-extension><attr-extension/></attribute-extension>
- </attribute>
- <property id="componentProperty1">
- <description id="componentProperty1_descripton1">myDescript blah blah</description>
- <display-name id="componentProperty1_displayName1">Component Property 1</display-name>
- <icon id="componentProperty1_icon1">
- <small-icon>property-small-icon</small-icon>
- <large-icon>property-large-icon</large-icon>
- </icon>
- <property-name id="componentProperty1_propertyName">property1</property-name>
- <property-class id="componentProperty1_propertyClass">ComponentProperty</property-class>
- <default-value>defaultValue6</default-value>
- <suggested-value>suggestedValue</suggested-value>
- </property>
- <component-extension id="componentExtension1"><foo></foo></component-extension>
- </component>
-
-
- <!-- managed-bean -->
- <managed-bean id="managedBean1" eager="true">
- <description id="managedBean1Description">managed-bean-description</description>
- <display-name id="managedBean1DisplayName">managed-bean-display-name</display-name>
- <icon id="managedBean1Icon">
- <small-icon>managedBean1-small-icon</small-icon>
- <large-icon>managedBean1-large-icon</large-icon>
- </icon>
- <managed-bean-name>managedBeanName</managed-bean-name>
- <managed-bean-class>managed-bean-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property id="managedBean1Property1">
- <description id="managedBean1Property1_description">managed-property-description</description>
- <display-name id="managedBean1Property1_displayName">managed-property-display-name</display-name>
- <icon id="managedBean1Property1_icon">
- <small-icon>managedBean1-property-small-icon</small-icon>
- <large-icon>managedBean1-property-large-icon</large-icon>
- </icon>
- <property-name>bean-property-name</property-name>
- <property-class>bean-property-class</property-class>
- <value>bean-propertyValue1</value>
- </managed-property>
- <managed-property id="managedBean1Property2">
- <property-name>bean-property2-name</property-name>
- <property-class>bean-property2-class</property-class>
- <null-value/>
- </managed-property>
- <managed-property id="managedBeanMapProperty">
- <property-name>map-bean-name</property-name>
- <property-class>map-bean-class</property-class>
- <map-entries>
- <key-class>propertyMapEntryKey</key-class>
- <value-class>propertyMapEntryValueClass</value-class>
- <map-entry id="mapPropertyEntryWithValue">
- <key>propertyMapKey1</key>
- <value>propertyMapValue1</value>
- </map-entry>
- <map-entry id="mapPropertyEntryWithNullValue">
- <key>propertyMapKey2</key>
- <null-value/>
- </map-entry>
- </map-entries>
- </managed-property>
- <managed-property id="managedBeanListProperty">
- <property-name>list-bean-name</property-name>
- <property-class>list-bean-class</property-class>
- <list-entries id="x">
- <value-class>managedBeanListPropertyClass</value-class>
- <value>managedBeanListPropertyValue</value>
- <null-value/>
- </list-entries>
- </managed-property>
- <managed-bean-extension><managed-bean-extension-tag/></managed-bean-extension>
- </managed-bean>
-
- <managed-bean id="mapBean1">
- <managed-bean-name>mapBean1</managed-bean-name>
- <managed-bean-class>mapBean1-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <map-entries>
- <key-class>mapBeanEntryKey</key-class>
- <value-class>mapBeanEntryValueClass</value-class>
- <map-entry id="mapBeanEntryWithValue">
- <key>mapBeanKey1</key>
- <value>mapBeanValue1</value>
- </map-entry>
- <map-entry id="mapBeanEntryWithNullValue">
- <key>mapBeanKey2</key>
- <null-value/>
- </map-entry>
- </map-entries>
- </managed-bean>
-
- <managed-bean id="listBean1">
- <managed-bean-name>listBean1</managed-bean-name>
- <managed-bean-class>listBean1-class</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <list-entries>
- <value-class>listBeanListPropertyClass</value-class>
- <value>listBeanListPropertyValue</value>
- <null-value/>
- </list-entries>
- </managed-bean>
-
- <converter id="converter1">
- <description id="converter1Description">converter-description</description>
- <display-name id="converter1DisplayName">converter-display-name</display-name>
- <icon id="converter1Icon">
- <small-icon>converter-small-icon</small-icon>
- <large-icon>converter-large-icon</large-icon>
- </icon>
- <converter-for-class>converter-for-class</converter-for-class>
- <converter-class>converter-class</converter-class>
- <attribute id="converter1Attribute">
- <description id="converter1_attribute_description">converter-attribute-description</description>
- <display-name id="converter1_attribute_display-name">converter-attribute-display-name</display-name>
- <icon id="converter1_attribute_icon">
- <small-icon>converter1-attribute-small-icon</small-icon>
- <large-icon>converter1-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>converter1-attribute-name</attribute-name>
- <attribute-class>converter1-attribute-class</attribute-class>
- <default-value>converter1-default-value</default-value>
- <suggested-value>converter1-attribute-suggested-value</suggested-value>
- <attribute-extension>
- <attr-extension/>
- </attribute-extension>
- </attribute>
- <property id="converter1Property">
- <description id="converter1_property_description">converter-property-description</description>
- <display-name id="converter1_property_display-name">converter-property-display-name</display-name>
- <icon id="converter1_property_icon">
- <small-icon>converter1-property-small-icon</small-icon>
- <large-icon>converter1-property-large-icon</large-icon>
- </icon>
- <property-name>converter-property-name</property-name>
- <property-class>converter-property-propertyClass</property-class>
- <default-value>converter-property-default-value</default-value>
- <suggested-value>converter-property-suggested-value</suggested-value>
- </property>
- <converter-extension><converter-extension-tag/></converter-extension>
- </converter>
-
- <converter id="converter2">
- <converter-id>converter2-id</converter-id>
- <converter-class>converter2-class</converter-class>
- </converter>
-
- <!-- Referenced-bean -->
- <referenced-bean id="referencedBean1">
- <description id="referencedBean1Description">Referenced Bean Desc</description>
- <display-name id="referencedBean1DisplayName">referenced-bean-display</display-name>
- <icon id="referencedBean1Icon">
- <small-icon>referenced-bean-small-icon</small-icon>
- <large-icon>referenced-bean-large-icon</large-icon>
- </icon>
- <referenced-bean-name>
- referencedBeanName
- </referenced-bean-name>
- <referenced-bean-class>
- referenced-bean-class
- </referenced-bean-class>
- </referenced-bean>
-
- <!-- Render kit -->
- <render-kit id="renderKit1">
- <description id="renderKit1Description">Render kit Desc</description>
- <display-name id="renderKit1DisplayName">Render kit disp name</display-name>
- <icon id="renderKit1Icon">
- <small-icon>small-renderkit-icon</small-icon>
- <large-icon>large-renderkit-icon</large-icon>
- </icon>
- <render-kit-id>render-kit-Id</render-kit-id>
- <render-kit-class>render-kit-class</render-kit-class>
- <renderer id="renderKit1Renderer">
- <description id="renderKit1RendererDescription">my renderer description</description>
- <display-name id="renderKit1RendererDisplayName">my renderer display name</display-name>
- <icon id="renderKit1RendererIcon">
- <small-icon>renderer-small-icon</small-icon>
- <large-icon>renderer-large-icon</large-icon>
- </icon>
- <component-family>component-family</component-family>
- <renderer-type>renderer-type</renderer-type>
- <renderer-class>renderer-class</renderer-class>
- <facet id="renderKit1Renderer1Facet1">
- <description id="renderKit1Renderer1Facet1Description">RendererFacetDescription</description>
- <display-name id="renderKit1Renderer1Facet1DisplayName">RendererFacetDisplayName</display-name>
- <icon id="renderKit1Renderer1Facet1Icon">
- <small-icon>facet-renderer-small-icon</small-icon>
- <large-icon>facet-renderer-large-icon</large-icon>
- </icon>
- <facet-name>rendererFacetName</facet-name>
- <facet-extension></facet-extension>
- </facet>
- <attribute id="renderKit1RendererAttribute1">
- <description id="renderKit1RendererAttribute1Description">renderer-attribute-attribute-description</description>
- <display-name id="renderKit1RendererAttribute1DisplayName">renderer-attribute-display-name</display-name>
- <icon id="renderKit1RendererAttribute1Icon">
- <small-icon>renderer-attribute-small-icon</small-icon>
- <large-icon>renderer-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>renderer attribute name</attribute-name>
- <attribute-class>renderer Attribute Class</attribute-class>
- <default-value>renderer attribute default value</default-value>
- <suggested-value>renderer attribute suggested value</suggested-value>
- <attribute-extension>
- <renderer-extension/>
- </attribute-extension>
- <attribute-extension>
- <blah-extension/>
- </attribute-extension>
- </attribute>
- <renderer-extension>
- <renderer-extension-1/>
- </renderer-extension>
- <renderer-extension>
- <renderer-extension-2/>
- </renderer-extension>
- <renderer-extension>
- <renderer-extension-3/>
- </renderer-extension>
- </renderer>
- <client-behavior-renderer id="client-behavior-renderer-id">
- <client-behavior-renderer-type id="client-behavior-renderer-type-id">MyClientBehaviorRendererType</client-behavior-renderer-type>
- <client-behavior-renderer-class id="client-behavior-renderer-class-id">com.test.MyClientBehaviorRenderer</client-behavior-renderer-class>
- </client-behavior-renderer>
- <render-kit-extension><render-kit-extension-tag/></render-kit-extension>
- </render-kit>
-
- <!-- Validator rules -->
- <validator id="validator1">
- <description id="validator1_description">validator-description</description>
- <display-name id="validator1_displayName">validator-display-name</display-name>
- <icon id="validator1_icon">
- <small-icon>validator-small-icon</small-icon>
- <large-icon>validator-large-icon</large-icon>
- </icon>
- <validator-id>validator-Id</validator-id>
- <validator-class>validator-class</validator-class>
- <attribute id="validator1_attribute">
- <description id="validator1_attribute_description">validator-attribute-description</description>
- <display-name id="validator1_attribute_displayName">validator-attribute-display-name</display-name>
- <icon id="validator1_attribute_icon">
- <small-icon>validator-attribute-small-icon</small-icon>
- <large-icon>validator-attribute-large-icon</large-icon>
- </icon>
- <attribute-name>validator-attribute-name</attribute-name>
- <attribute-class>validator-attribute-class</attribute-class>
- <default-value>validator-default-value</default-value>
- <suggested-value>validator-attribute-suggested-value</suggested-value>
- <attribute-extension>
- <attribute-extension/>
- </attribute-extension>
- </attribute>
- <property id="validator1_property">
- <description id="validator1_property_description">validator-property-description</description>
- <display-name id="validator1_property_displayName">validator-property-display-name</display-name>
- <icon id="validator1_property_icon">
- <small-icon>validator-property-small-icon</small-icon>
- <large-icon>validator-property-large-icon</large-icon>
- </icon>
- <property-name>validator-property-name</property-name>
- <property-class>validator-property-class</property-class>
- <default-value>validator property default value</default-value>
- <suggested-value>validator property suggested value</suggested-value>
- <property-extension><future/></property-extension>
- </property>
- <validator-extension><validator-extension-tag/></validator-extension>
- </validator>
-
- <!-- variable/property resolver registration -->
- <application id="application1">
- <action-listener id="actionListener1">Action listener</action-listener>
- <variable-resolver id="variableResolver1">
- com.ibm.faces.databind.SelectItemsVarResolver
- </variable-resolver>
- <default-render-kit-id id="defaultRenderKit1">some renderer kit</default-render-kit-id>
- <message-bundle id="messageBundle1">some messeage bundle goes here</message-bundle>
- <navigation-handler id="navigationHandler1">navigation handler</navigation-handler>
- <view-handler id="viewHandler1">view handler</view-handler>
- <state-manager id="stateManager1">state manager</state-manager>
-
- <property-resolver id="propertyResolver1">
- com.ibm.faces.databind.SelectItemsPropResolver
- </property-resolver>
- <locale-config id="localeConfig1">
- <default-locale id="defaultLocale1">en</default-locale>
- <supported-locale id="supportedLocale_en">en</supported-locale>
- <supported-locale id="supportedLocale_de">de</supported-locale>
- </locale-config>
- <el-resolver id="el-resolver-id">com.test.MyELResolver</el-resolver>
-<!--
- <partial-traversal id="partial-traversal-id">com.test.MyPartialTraversal</partial-traversal>
--->
- <resource-handler id="resource-handler-id">com.test.MyResourceHandler</resource-handler>
- <system-event-listener id="system-event-listener-id">
- <system-event-listener-class id="system-event-listener-class-id">com.test.MySystemEventListener</system-event-listener-class>
- <system-event-class id="system-event-class-id">com.test.MySystemEvent</system-event-class>
- <source-class id="source-class-id">com.test.MySource</source-class>
- </system-event-listener>
- <default-validators id="default-validators-id">
- <validator-id id="validator-id-id">MyValidator</validator-id>
- </default-validators>
- <resource-bundle id="resourceBundleId1">
- <description id="resourceBundleDesc">Resource Bundle description blah</description>
- <display-name id="resourceBundleDisplayName">Resource Bundle display name blah</display-name>
- <icon id="resourceBundleId">
- <small-icon>resourceBundle-smallIcon</small-icon>
- <large-icon>resourceBundle-largeIcon</large-icon>
- </icon>
- <base-name>com.test.Bundle</base-name>
- <var>bundleVar</var>
- </resource-bundle>
- <application-extension id="applicatinExtension1">
- <some-extension-data/>
- </application-extension>
- </application>
-
- <navigation-rule>
- <description>Descri 1</description>
- <display-name>display name 1</display-name>
- <icon>
- <small-icon>myicon</small-icon>
- </icon>
- <from-view-id>/Page1.jsp</from-view-id>
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
-
- <display-name>what display name</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{from-action}</from-action>
- <from-outcome>drilldown</from-outcome>
- <if>#{el-expression}</if>
- <to-view-id>/edit.jsp</to-view-id>
- <redirect include-view-params="true">
- <view-param id="view-param-id">
- <name>viewParamName</name>
- <value>viewParamValue</value>
- </view-param>
- </redirect>
- </navigation-case>
-
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <display-name>second navigation case</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{action2}</from-action>
- <from-outcome>outcome2</from-outcome>
- <if>s</if>
- <to-view-id>/edit2.jsp</to-view-id>
- </navigation-case>
-
- <navigation-rule-extension><navigation-extension-tag/></navigation-rule-extension>
- </navigation-rule>
-
- <navigation-rule>
- <description xml:lang="en">A navigation rule with lang attributes</description>
- <description xml:lang="en-US">What color is it?</description>
- <description xml:lang="en-GB">What colour is it?</description>
- <description xml:lang="fr">Quelle couleur est lui?</description>
- <display-name xml:lang="en">English Display Name</display-name>
- <display-name xml:lang="fr">Nom D'Affichage De Français</display-name>
-
- <icon xml:lang="en">
- <small-icon>en_small-icon</small-icon>
- <large-icon>en_large-icon</large-icon>
- </icon>
- <icon>
- <small-icon>small-icon</small-icon>
- <large-icon>large-icon</large-icon>
- </icon>
- <from-view-id>/Page1.jsp</from-view-id>
- <navigation-case>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <description>nav case descr 2</description>
- <display-name>second navigation rule navcase</display-name>
- <icon>
- <small-icon>small-icon</small-icon>
- </icon>
- <from-action>#{action3}</from-action>
- <from-outcome>outcome3</from-outcome>
- <to-view-id>/edit3.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
- <faces-config-extension>
- <faces-config-extended-data/>
- </faces-config-extension>
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/test.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/test.xml
deleted file mode 100644
index 9e13525..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <!-- <property name="eclipse-home" value="${basedir}\..\.."/> -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jst.jsf.facesconfig.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org.eclipse.jst.jsf.facesconfig.tests.*xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jsf-folder" value="${eclipse-home}/jsf_folder"/>
- <delete dir="${jsf-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jsf-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jst.jsf.facesconfig.tests.AllFacesConfigTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org.eclipse.jst.jsf.facesconfig.tests.*xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.classpath b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.cvsignore
deleted file mode 100644
index 9e05837..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-temp.folder
-@dot
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.project b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.project
deleted file mode 100644
index 256ea38..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.facesconfig.ui.test</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6f7ae6b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:03:34 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d0f6e88..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,62 +0,0 @@
-#Thu Sep 27 19:45:35 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/META-INF/MANIFEST.MF
deleted file mode 100644
index 023f0b4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 2.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.f0
-Bundle-SymbolicName: org.eclipse.jst.jsf.facesconfig.ui.test
-Bundle-Version: 1.1.0.qualifier
-Bundle-Vendor: %Bundle-Vendor.f0
-Fragment-Host: org.eclipse.jst.jsf.facesconfig.ui;bundle-version="[1.0.0,2.0.0)"
-Bundle-Localization: plugin
-Require-Bundle: org.junit;bundle-version="3.8.1",
- org.eclipse.jst.jsf.test.util;bundle-version="[1.0.0,2.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/about.html b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/about.html
deleted file mode 100644
index 72f94ad..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/build.properties b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/build.properties
deleted file mode 100644
index 1b8e399..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- test-file/,\
- test.xml,\
- about.html
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/plugin.properties
deleted file mode 100644
index 31a8f76..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-Bundle-Vendor.f0=Eclipse.org
-Bundle-Name.f0=JavaServer Faces Tools - FacesConfig UI Test Fragment
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/section/ComponentsPageTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/section/ComponentsPageTest.java
deleted file mode 100644
index ab09b7b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/section/ComponentsPageTest.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.ui.page.ComponentsPage;
-import org.eclipse.jst.jsf.facesconfig.ui.page.detail.FacesConfigDetailsPage;
-import org.eclipse.jst.jsf.facesconfig.ui.test.FacesConfigEditorTest;
-
-/**
- * The test case for the master sections in ComponentsPage.
- *
- * @author sfshi
- *
- */
-public class ComponentsPageTest extends FacesConfigEditorTest {
-
- ComponentsPage componentsPage;
-
- FacesConfigMasterSection[] facesConfigMasterSections;
-
- FacesConfigType facesConfig;
-
- /**
- * Open the faces config file, then switch to "Components" page.
- *
- * @see org.eclipse.jst.jsf.facesconfig.ui.test.FacesConfigEditorTest#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- editor.setActiveEditorPage(ComponentsPage.PAGE_ID);
- componentsPage = (ComponentsPage) editor.getActiveEditor();
- assertNotNull(componentsPage);
- facesConfigMasterSections = componentsPage
- .getFacesConfigMasterSections();
- assertEquals(facesConfigMasterSections.length, 4);
-
- facesConfig = editor.getFacesConfig();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.facesconfig.ui.test.FacesConfigEditorTest#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testComponentMasterSection() {
- /** Expand the "Component" secton, then click "Add" button */
- ComponentMasterSection componentSection = (ComponentMasterSection) facesConfigMasterSections[0];
- componentSection.getSection().setExpanded(true);
- assertFalse(componentSection.getRemoveButton().isEnabled());
- componentSection.addButtonSelected(null);
- ISelection selection = componentSection.getSelection();
- assertTrue(selection != null && !selection.isEmpty());
- assertEquals(facesConfig.getComponent().size(), 1);
-
- assertTrue(selection instanceof StructuredSelection);
- FacesConfigDetailsPage detailPage = (FacesConfigDetailsPage)componentsPage
- .getPage(componentsPage
- .getPageKey(((StructuredSelection) selection)
- .getFirstElement()));
- assertNotNull(detailPage);
-
- assertTrue(componentSection.getRemoveButton().isEnabled());
- componentSection.removeButtonSelected(null);
- componentSection.refresh();
- selection = componentSection.getSelection();
- assertTrue(selection == null || selection.isEmpty());
- assertEquals(facesConfig.getComponent().size(), 0);
- assertFalse(componentSection.getRemoveButton().isEnabled());
- }
-
- public void testConverterMasterSection() {
-
- /** Expand the "Converter" secton, then click "Add" button */
- ConverterMasterSection converterSection = (ConverterMasterSection) facesConfigMasterSections[1];
- converterSection.getSection().setExpanded(true);
- assertFalse(converterSection.getRemoveButton().isEnabled());
- converterSection.addButtonSelected(null);
- ISelection selection = converterSection.getSelection();
- assertTrue(selection != null && !selection.isEmpty());
- assertEquals(facesConfig.getConverter().size(), 1);
-
- assertTrue(selection instanceof StructuredSelection);
- FacesConfigDetailsPage detailPage = (FacesConfigDetailsPage)componentsPage
- .getPage(componentsPage
- .getPageKey(((StructuredSelection) selection)
- .getFirstElement()));
- assertNotNull(detailPage);
-
- assertTrue(converterSection.getRemoveButton().isEnabled());
- converterSection.removeButtonSelected(null);
- converterSection.refresh();
- selection = converterSection.getSelection();
- assertTrue(selection == null || selection.isEmpty());
- assertEquals(facesConfig.getConverter().size(), 0);
- assertFalse(converterSection.getRemoveButton().isEnabled());
- }
-
- public void testRenderKitMasterSection() {
-
- /** Expand the "RenderKit" secton, then click "Add" button */
- RenderkitMasterSection renderkitSection = (RenderkitMasterSection) facesConfigMasterSections[2];
- renderkitSection.getSection().setExpanded(true);
- assertFalse(renderkitSection.getRemoveButton().isEnabled());
- renderkitSection.addButtonSelected(null);
- ISelection selection = renderkitSection.getSelection();
- assertTrue(selection != null && !selection.isEmpty());
- assertEquals(facesConfig.getRenderKit().size(), 1);
-
- assertTrue(selection instanceof StructuredSelection);
- FacesConfigDetailsPage detailPage = (FacesConfigDetailsPage)componentsPage
- .getPage(componentsPage
- .getPageKey(((StructuredSelection) selection)
- .getFirstElement()));
- assertNotNull(detailPage);
-
- assertTrue(renderkitSection.getRemoveButton().isEnabled());
- renderkitSection.removeButtonSelected(null);
- renderkitSection.refresh();
- selection = renderkitSection.getSelection();
- assertTrue(selection == null || selection.isEmpty());
- assertEquals(facesConfig.getRenderKit().size(), 0);
- assertFalse(renderkitSection.getRemoveButton().isEnabled());
- }
-
- public void testValidatorMasterSection() {
-
- /** Expand the "Validator" secton, then click "Add" button */
- ValidatorMasterSection section = (ValidatorMasterSection) facesConfigMasterSections[3];
- section.getSection().setExpanded(true);
- assertFalse(section.getRemoveButton().isEnabled());
- section.addButtonSelected(null);
- ISelection selection = section.getSelection();
- assertTrue(selection != null && !selection.isEmpty());
- assertEquals(facesConfig.getValidator().size(), 1);
-
- assertTrue(selection instanceof StructuredSelection);
- FacesConfigDetailsPage detailPage = (FacesConfigDetailsPage)componentsPage
- .getPage(componentsPage
- .getPageKey(((StructuredSelection) selection)
- .getFirstElement()));
- assertNotNull(detailPage);
-
- assertTrue(section.getRemoveButton().isEnabled());
- section.removeButtonSelected(null);
- section.refresh();
- selection = section.getSelection();
- assertTrue(selection == null || selection.isEmpty());
- assertEquals(facesConfig.getValidator().size(), 0);
- assertFalse(section.getRemoveButton().isEnabled());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/AllTestCases.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/AllTestCases.java
deleted file mode 100644
index 69f421c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/AllTestCases.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.facesconfig.ui.section.ComponentsPageTest;
-import org.eclipse.jst.jsf.facesconfig.ui.wizard.NewManagedBeanWizardTest;
-
-/**
- * The test suite for faces config editor. Before run it, make sure that this
- * plugin is in the same folder with "org.eclipse.jst.jsf.facesconfig.ui"
- * plugin.
- *
- * @author sfshi
- *
- */
-public class AllTestCases {
- public static Test suite() {
- TestSuite suite = new TestSuite("Test Suite for FacesConfig Editor");
-
- suite.addTestSuite(OpenADFDemoFacesConfigTest.class);
-
- suite.addTestSuite(ComponentsPageTest.class);
-
- suite.addTestSuite(WebrootUtilTest.class);
-
- suite.addTestSuite(ManagedBeanUtilTest.class);
-
- suite.addTestSuite(JSPUtilTest.class);
-
- suite.addTestSuite(GEMPreferencesTest.class);
-
- suite.addTestSuite(NewManagedBeanWizardTest.class);
-
- suite.addTestSuite(PageflowEditorTest.class);
-
-// 246164 - Invalid JUnit test - to be uncommented when test is fixed
-// suite.addTestSuite(TestNotificationsOnNonUIThread.class);
- return suite;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/FacesConfigEditorTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/FacesConfigEditorTest.java
deleted file mode 100644
index 97f8ef0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/FacesConfigEditorTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.facesconfig.ui.FacesConfigEditor;
-import org.eclipse.jst.jsf.facesconfig.ui.test.util.TestUtil;
-import org.eclipse.jst.jsf.test.util.JSFTestUtil;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * The base class for test cases, other test cases could extends this. In this
- * test case, an empty jsf project will be created and the default faces config
- * file will be opened with FacesConfig Editor.
- *
- * @author sfshi
- *
- */
-public abstract class FacesConfigEditorTest extends TestCase {
- public IProject project;
-
- public FacesConfigEditor editor;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- project = TestUtil.createProjectFromZip("emptyjsfproject",
- "emptyjsfproject.zip");
- IPerspectiveRegistry reg = PlatformUI.getWorkbench()
- .getPerspectiveRegistry();
-
- IPerspectiveDescriptor j2eePersp = reg
- .findPerspectiveWithId("org.eclipse.jst.j2ee.J2EEPerspective");
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .setPerspective(j2eePersp);
- openEditor();
-
- }
-
- protected void openEditor() throws PartInitException, InterruptedException {
- editor = (FacesConfigEditor) openWithEditor("WebContent/WEB-INF/faces-config.xml");
-
- // wait for pages to load for up to 30s
- editor.doPageLoad(60000);
- }
-
- protected IEditorPart openWithEditor(String name) throws PartInitException {
- IPath filePath = new Path(name);
- IFile facesConfigFile = project.getFile(filePath);
- assertNotNull(facesConfigFile);
- assertTrue("The facesconfig file doesn't exists.", facesConfigFile
- .exists());
- IEditorInput fileInput = new FileEditorInput(facesConfigFile);
- IEditorPart editor1 = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(
- fileInput, FacesConfigEditor.EDITOR_ID);
- assertNotNull(editor1);
-
- return editor1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- closeEditor();
- TestUtil.removeResource(project);
-// JSFTestUtil.safeDelete(project, 10, 200);
- }
-
- protected void closeEditor() throws Exception {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editor, false);
-
- editor = null;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/GEMPreferencesTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/GEMPreferencesTest.java
deleted file mode 100644
index 6b21f7d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/GEMPreferencesTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import java.util.Iterator;
-
-import junit.framework.Assert;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jst.jsf.facesconfig.ui.preference.GEMPreferences;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author sfshi
- *
- */
-public class GEMPreferencesTest extends FacesConfigEditorTest {
-
- private String GEM_PREFERENCE_ID = "org.eclipse.jst.jsf.facesconfig.ui.preference.GEMPreferences";
-
- private static class PreferenceDialogWrapper extends PreferenceDialog {
- public PreferenceDialogWrapper(Shell parentShell,
- PreferenceManager manager) {
- super(parentShell, manager);
- }
-
- protected boolean showPage(IPreferenceNode node) {
- return super.showPage(node);
- }
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.facesconfig.ui.preference.GEMPreferences#GEMPreferences()}.
- */
- public void testGEMPreferences() {
-
- PreferenceDialog dialog = null;
- PreferenceManager manager = PlatformUI.getWorkbench()
- .getPreferenceManager();
- dialog = new PreferenceDialogWrapper(getShell(), manager);
- dialog.create();
-
- for (Iterator<?> iterator = manager.getElements(
- PreferenceManager.PRE_ORDER).iterator(); iterator.hasNext();) {
- IPreferenceNode node = (IPreferenceNode) iterator.next();
- if (node.getId().equals(GEM_PREFERENCE_ID)) {
- ((PreferenceDialogWrapper) dialog).showPage(node);
- }
- }
- Assert.assertNotNull(dialog);
- dialog.setBlockOnOpen(false);
- dialog.open();
-
- Assert.assertTrue(dialog.getSelectedPage() instanceof GEMPreferences);
- GEMPreferences page = (GEMPreferences) dialog.getSelectedPage();
- assertNotNull(page);
- // there is no much open mehtods for testing....
- }
-
- protected static Shell getShell() {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/JSPUtilTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/JSPUtilTest.java
deleted file mode 100644
index 5829037..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/JSPUtilTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.util.JSPUtil;
-import org.eclipse.jst.jsf.facesconfig.ui.test.util.TestUtil;
-
-/**
- * @author sfshi
- *
- */
-public class JSPUtilTest extends FacesConfigEditorTest {
-
- /**
- * Test method for {@link org.eclipse.jst.jsf.facesconfig.ui.pageflow.util.JSPUtil#getActionListInJSPFile(java.lang.String)}.
- * @throws Exception
- */
- public void testGetActionListInJSPFile() throws Exception {
- TestUtil.copyFile(project, "WebContent", "page1.jsp");
-
- List<?> actionNodes = JSPUtil.getActionListInJSPFile("/emptyjsfproject/WebContent/page1.jsp");
- assertEquals(3, actionNodes.size());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/ManagedBeanUtilTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/ManagedBeanUtilTest.java
deleted file mode 100644
index 23b8a58..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/ManagedBeanUtilTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
-import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.ManagedBeanType;
-import org.eclipse.jst.jsf.facesconfig.ui.util.ManagedBeanUtil;
-
-/**
- * @author sfshi
- *
- */
-public class ManagedBeanUtilTest extends FacesConfigEditorTest {
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.facesconfig.ui.util.ManagedBeanUtil#isBeanDuplicate(org.eclipse.core.resources.IProject, java.lang.String)}.
- */
- @SuppressWarnings("unchecked")
- public void testIsBeanDuplicate() {
- String mbeanName = "testBean";
- assertFalse(ManagedBeanUtil.isBeanDuplicate(project, mbeanName));
-
- FacesConfigType facesConfig = editor.getFacesConfig();
- ManagedBeanType bean1 = FacesConfigFactory.eINSTANCE
- .createManagedBeanType();
- ManagedBeanNameType bean1Name = FacesConfigFactory.eINSTANCE
- .createManagedBeanNameType();
- bean1Name.setTextContent(mbeanName);
- bean1.setManagedBeanName(bean1Name);
- facesConfig.getManagedBean().add(bean1);
-
- assertTrue(ManagedBeanUtil.isBeanDuplicate(project, mbeanName));
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.facesconfig.ui.util.ManagedBeanUtil#getDefaultManagedBeanName(org.eclipse.core.resources.IProject, java.lang.String)}.
- */
- @SuppressWarnings("unchecked")
- public void testGetDefaultManagedBeanName() {
- String mbeanName = "testBean";
- assertEquals(mbeanName, ManagedBeanUtil.getDefaultManagedBeanName(
- project, mbeanName));
-
- FacesConfigType facesConfig = editor.getFacesConfig();
- ManagedBeanType bean1 = FacesConfigFactory.eINSTANCE
- .createManagedBeanType();
- ManagedBeanNameType bean1Name = FacesConfigFactory.eINSTANCE
- .createManagedBeanNameType();
- bean1Name.setTextContent(mbeanName);
- bean1.setManagedBeanName(bean1Name);
- facesConfig.getManagedBean().add(bean1);
-
- assertEquals("testBean1", ManagedBeanUtil.getDefaultManagedBeanName(
- project, mbeanName));
-
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/OpenADFDemoFacesConfigTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/OpenADFDemoFacesConfigTest.java
deleted file mode 100644
index 02a0658..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/OpenADFDemoFacesConfigTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 Sybase, Inc. and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;