Skip to main content
summaryrefslogtreecommitdiffstats
blob: 364711bb7e4f248903f9d20dfdb6a77e58aadd49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*******************************************************************************
 * Copyright (c) 2004, 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.jsp.core.internal.contentmodel.tld;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDFunction;
import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;

public class TLDFunctionImpl implements TLDFunction {
	private String fClassName = null;
	private String fDescription = null;
	private String fDisplayName = null;
	private String fExample = null;
	private List fExtensions = new ArrayList(0);
	private String fIcon = null;
	private String fName = null;

	private CMDocument fOwnerDocument = null;
	private String fSignature = null;

	public TLDFunctionImpl(CMDocument owner) {
		super();
		fOwnerDocument = owner;
	}

	/**
	 * @return Returns the className.
	 */
	public String getClassName() {
		return fClassName;
	}
	/**
	 * @return Returns the description.
	 */
	public String getDescription() {
		return fDescription;
	}

	/**
	 * @return Returns the displayName.
	 */
	public String getDisplayName() {
		return fDisplayName;
	}

	/**
	 * @return Returns the example.
	 */
	public String getExample() {
		return fExample;
	}

	/**
	 * @return Returns the extensions.
	 */
	public List getExtensions() {
		return fExtensions;
	}

	/**
	 * @return Returns the icon.
	 */
	public String getIcon() {
		return fIcon;
	}

	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return fName;
	}

	/**
	 * @return Returns the ownerDocument.
	 */
	public CMDocument getOwnerDocument() {
		return fOwnerDocument;
	}

	/**
	 * @return Returns the signature.
	 */
	public String getSignature() {
		return fSignature;
	}

	/**
	 * @param className
	 *            The className to set.
	 */
	public void setClassName(String className) {
		fClassName = className;
	}
	/**
	 * @param description The description to set.
	 */
	public void setDescription(String description) {
		fDescription = description;
	}

	/**
	 * @param displayName
	 *            The displayName to set.
	 */
	public void setDisplayName(String displayName) {
		fDisplayName = displayName;
	}

	/**
	 * @param example
	 *            The example to set.
	 */
	public void setExample(String example) {
		fExample = example;
	}

	/**
	 * @param icon
	 *            The icon to set.
	 */
	public void setIcon(String icon) {
		fIcon = icon;
	}

	/**
	 * @param name
	 *            The name to set.
	 */
	public void setName(String name) {
		fName = name;
	}

	/**
	 * @param signature
	 *            The signature to set.
	 */
	public void setSignature(String signature) {
		fSignature = signature;
	}
}

Back to the top

-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.classpath7
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.cvsignore4
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.project28
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.contentassist.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.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.java20
-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/AllLifecycleListenerTests.java16
-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.java85
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MyTestListener.java135
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestLifecycleListener.java371
-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.java154
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_Containment.java217
-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.java93
-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.java111
-rw-r--r--jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTJSPExternalContext.java225
-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.java230
-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.java393
-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.java375
-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.java162
-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.java59
-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.java301
-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.java120
-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/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.properties19
-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.properties19
-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.xml90
-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.MF39
-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/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.java184
-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.java114
-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.java97
-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.java301
-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.java295
-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.java108
-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.properties19
-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.java392
-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
755 files changed, 0 insertions, 89493 deletions
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/.cvsignore b/jsf/features/org.eclipse.jst.jsf.tests.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/.project b/jsf/features/org.eclipse.jst.jsf.tests.feature/.project
deleted file mode 100644
index 589d846..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/.settings/org.eclipse.core.resources.prefs b/jsf/features/org.eclipse.jst.jsf.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index e6a2792..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:04:27 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/build.properties b/jsf/features/org.eclipse.jst.jsf.tests.feature/build.properties
deleted file mode 100644
index 1816059..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/build.properties
+++ /dev/null
@@ -1,16 +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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- feature.properties,\
- license.html
-src.includes = build.properties
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/eclipse_update_120.jpg b/jsf/features/org.eclipse.jst.jsf.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/epl-v10.html b/jsf/features/org.eclipse.jst.jsf.tests.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/feature.properties b/jsf/features/org.eclipse.jst.jsf.tests.feature/feature.properties
deleted file mode 100644
index 280f406..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/feature.properties
+++ /dev/null
@@ -1,157 +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
-###############################################################################
-feature.name=JSF Tooling Tests Feature
-feature.provider=Eclipse.org
-feature.description=JSF Tooling for WTP Automated Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-feature.copyright=\
-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\
-\n\
-Contributors:\n\
- Oracle Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-Eclipse Foundation Software User Agreement\n\
-April 14, 2010\n\
-\n\
-Usage Of Content\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the\n\
-Eclipse Foundation is provided to you under the terms and conditions of\n\
-the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
-provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse Foundation source code\n\
-repository ("Repository") in software modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
-Update License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties" found within a Feature.\n\
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
-terms and conditions (or references to such terms and conditions) that\n\
-govern your use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-\n\Use of Provisioning Technology\n\
-\n\
-The Eclipse Foundation makes available provisioning software, examples of which include,\n\
-but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
-the purpose of allowing users to install software, documentation, information and/or\n\
-other materials (collectively "Installable Software"). This capability is provided with\n\
-the intent of allowing such users to install, extend and update Eclipse-based products.\n\
-Information about packaging Installable Software is available at\n\
-http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
-\n\
-You may use Provisioning Technology to allow other parties to install Installable Software.\n\
-You shall be responsible for enabling the applicable license agreements relating to the\n\
-Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
-in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
-making it available in accordance with the Specification, you further acknowledge your\n\
-agreement to, and the acquisition of all necessary rights to permit the following:\n\
-\n\
- 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
- the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
- extending or updating the functionality of an Eclipse-based product.\n\
- 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
- Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
- 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
- govern the use of the Installable Software ("Installable Software Agreement") and such\n\
- Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
- with the Specification. Such Installable Software Agreement must inform the user of the\n\
- terms and conditions that govern the Installable Software and must solicit acceptance by\n\
- the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
- indication of agreement by the user, the provisioning Technology will complete installation\n\
- of the Installable Software.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use, and\n\
-re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/feature.xml b/jsf/features/org.eclipse.jst.jsf.tests.feature/feature.xml
deleted file mode 100644
index 9c6c279..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/feature.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jst.jsf.tests.feature"
- label="%feature.name"
- version="3.2.0.qualifier"
- provider-name="%feature.provider">
-
- <description>
- %feature.description
- </description>
-
- <copyright>
- %feature.copyright
- </copyright>
-
- <license url="license.html">
- %feature.license
- </license>
-
- <plugin
- id="org.eclipse.jst.jsf.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.ui.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.metadata.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.contentassist.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.metadataprocessingtests2"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.designtime.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.context.symbol.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.test.util"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.facesconfig.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.validation.el.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.facesconfig.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"
- fragment="true"/>
-
- <plugin
- id="org.eclipse.jst.pagedesigner.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jst.jsf.common.runtime.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jsf/features/org.eclipse.jst.jsf.tests.feature/license.html b/jsf/features/org.eclipse.jst.jsf.tests.feature/license.html
deleted file mode 100644
index c184ca3..0000000
--- a/jsf/features/org.eclipse.jst.jsf.tests.feature/license.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>April 14, 2010</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation 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 provided with this Content and is also 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>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
- repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
- href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- (&quot;Specification&quot;).</p>
-
-<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
- in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
- Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
- on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
- Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
- the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
- indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-</body>
-</html>
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 3985222..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.common.runtime.tests/build.properties
+++ /dev/null
@@ -1,14 +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/,\
- .
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 a20bb8b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/JSFCoreFastTests.java
+++ /dev/null
@@ -1,20 +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.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 })
-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/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/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 0c8b5c4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MockListener.java
+++ /dev/null
@@ -1,85 +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.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 7160969..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/MyTestListener.java
+++ /dev/null
@@ -1,135 +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.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 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/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 95dd2fb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/resource/TestLifecycleListener.java
+++ /dev/null
@@ -1,371 +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.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 4ceab47..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_AttributeValues.java
+++ /dev/null
@@ -1,154 +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.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;
-
- @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);
- }
-
- @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(4, 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(10, 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 4b11112..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/validation/TestJSPSemanticsValidator_Containment.java
+++ /dev/null
@@ -1,217 +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;
-
-
- @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);
- }
-
- @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, 1);
- 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 8a29bb4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/AllTests.java
+++ /dev/null
@@ -1,93 +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);
- //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 d0dc1aa..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTFacesContext.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.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.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;
-
-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());
- _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();
- }
-
- 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());
- }
-
- 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 68372e6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDTJSPExternalContext.java
+++ /dev/null
@@ -1,225 +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");
-
- 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();
- }
-
- 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;
- }
- }
-}
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 27fea48..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDefaultDTVariableResolver.java
+++ /dev/null
@@ -1,230 +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");
- }
-
- 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/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 b76f5df..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestDesignTimeApplicationManager.java
+++ /dev/null
@@ -1,393 +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/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 7892ab0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/TestJSPModelProcessor.java
+++ /dev/null
@@ -1,375 +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.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 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 aa92791..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/ChangeTester.java
+++ /dev/null
@@ -1,162 +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);
- }
-
- public void fireResourceFileAdd(final String resourceId)
- {
- installListener();
- final IFile file = _resourceRoot.getFile(resourceId);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFileAdded((MockFile) file);
- _context.fireWorkspaceEvent(event);
- }
-
- 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);
-
- }
-
- public void fireResourceFolderAdd(final String folderName)
- {
- installListener();
- final IFolder folder = getFolder(folderName);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFolderAdded(folder);
- _context.fireWorkspaceEvent(event);
- }
-
- public void fireResourceFolderDelete(final String folderName)
- {
- installListener();
- final IFolder folder = getFolder(folderName);
- final IResourceChangeEvent event = _eventFactory
- .createSimpleFolderDeleted(folder);
- _context.fireWorkspaceEvent(event);
- }
-
- 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);
- }
-
- 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);
- }
- 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 acf9a40..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestJarBasedJSFResourceLocator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.eclipse.jst.jsf.designtime.tests.resources;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.jar.JarFile;
-
-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.IJarProvider;
-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.MockJarProvider;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(NoPluginEnvironment.class)
-public class TestJarBasedJSFResourceLocator
-{
- private IJarProvider _jarProvider;
- private JarBasedJSFResourceLocator _locator;
-
- @SuppressWarnings("unchecked")
- @Before
- public void setUp()
- {
- final JarFile jar = MockJarProvider.getJar("./testdata/jsfResources.jar");
- _jarProvider = new MockJarProvider(jar);
- _locator = new JarBasedJSFResourceLocator(Collections.EMPTY_LIST, new CopyOnWriteArrayList<ILocatorChangeListener>(), _jarProvider, new ContentTypeResolver(new MockContentTypeManager()));
- }
-
- @Test
- public void testLocate()
- {
-
- _locator.start(new MockProject(new Path("foo"), null));
- // we can pass null here since our jar provider doesn't care about projects.
- final List<IJSFResourceFragment> foundResources = _locator.locate(null);
- 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 a25810a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/resources/TestWorkspaceBasedResourceLocator.java
+++ /dev/null
@@ -1,301 +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.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.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.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.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)
- {
- @Override
- protected void installListener()
- {
- _events.clear();
- _locator.addListener(new JSFResourceChangeListener()
- {
- @Override
- public void changed(final JSFResourceChangedEvent event)
- {
- _events.add(event);
- }
- });
- }
-
- @Override
- protected boolean isChangeType(final JSFResourceChangedEvent event,
- final CHANGE_TYPE type)
- {
- return event.getChangeType() == type;
- }
- };
- }
-
- @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(2);
- {
- 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 JSFResourceChangedEvent event = _changeTester
- .getSingleEvent(CHANGE_TYPE.REMOVED);
- assertEquals(CHANGE_TYPE.REMOVED, event.getChangeType());
- 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());
-
- }
- 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());
- }
-
-
- 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 9bd9a7e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.designtime.tests/src/org/eclipse/jst/jsf/designtime/tests/views/persistence/TestSerializableTLDTagElement.java
+++ /dev/null
@@ -1,120 +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/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 9b93706..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.tests/build.properties
+++ /dev/null
@@ -1,19 +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
-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 9b685df..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/build.properties
+++ /dev/null
@@ -1,19 +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
-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;
-import org.eclipse.core.runtime.CoreException;
-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.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @author sfshi
- *
- */
-public class OpenADFDemoFacesConfigTest extends TestCase {
-
- IProject project;
-
- FacesConfigEditor editor;
-
- /**
- * Create the ADF Demo project from zip file.
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
-
- project = TestUtil.createProjectFromZip("adfDemoProject",
- "adfDemoProject.zip");
- }
-
- /**
- * Close the editor without saving, then remove the project.
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editor, false);
- project.close(null);
-// project.delete(IProject.FORCE | IProject.ALWAYS_DELETE_PROJECT_CONTENT,
-// new MockProgressMonitor());
- }
-
- /**
- * Use FacesConfigEditor to open the faces-config.xml file.
- *
- * @throws CoreException
- */
- public void testOpenFacesConfigFile() throws CoreException, InterruptedException {
- IPath filePath = new Path("WebContent/WEB-INF/faces-config.xml");
- IFile facesConfigFile = project.getFile(filePath);
- assertNotNull(facesConfigFile);
- assertTrue("The facesconfig file doesn't exists.", facesConfigFile
- .exists());
- IEditorInput fileInput = new FileEditorInput(facesConfigFile);
- editor = (FacesConfigEditor) PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(
- fileInput, FacesConfigEditor.EDITOR_ID);
- assertNotNull(editor);
-
- // wait for the editor to signal its pages have been loaded.
- // throw exception of wait is longer than
- editor.doPageLoad(60000);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/PageflowEditorTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/PageflowEditorTest.java
deleted file mode 100644
index 92ac81e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/PageflowEditorTest.java
+++ /dev/null
@@ -1,235 +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.FacesConfigType;
-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.ui.FacesConfigEditor;
-import org.eclipse.jst.jsf.facesconfig.ui.page.IntroductionPage;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.PageflowEditor;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.command.AddConnectionCommand;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.command.AddNodeCommand;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.command.DeleteConnectionCommand;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.command.DeleteNodeCommand;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.command.ReconnectConnectionCommand;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.Pageflow;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowFactory;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowLink;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowPage;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.synchronization.TransformUtil;
-import org.eclipse.ui.actions.ActionFactory;
-
-/**
- * @author hmeng
- */
-
-public class PageflowEditorTest extends FacesConfigEditorTest {
- private static final String LIST_JSP = "/list.jsp";
-
- private static final String INDEX_JSP = "/index.jsp";
-
- private static final String INDEX1_JSP = "/index1.jsp";
-
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- editor.setActiveEditorPage(PageflowEditor.PAGE_ID);
- }
-
- public void testAddElements() {
- editor.setActiveEditorPage(PageflowEditor.PAGE_ID);
- Pageflow pageflow = getPageflow();
- PageflowPage source = createPage(INDEX_JSP);
- assertTrue(pageflow.getNodes().contains(source));
-
- PageflowPage target = createPage(LIST_JSP);
- assertTrue(pageflow.getNodes().contains(target));
-
- PageflowLink link = createLink(source, target);
-
- assertTrue(pageflow.getLinks().contains(link));
- FacesConfigType facesConfig = getFacesConfig();
- NavigationRuleType rule = (NavigationRuleType) facesConfig
- .getNavigationRule().get(0);
- NavigationCaseType caseType = (NavigationCaseType) rule
- .getNavigationCase().get(0);
- assertTrue(rule.getFromViewId().getTextContent().equals(INDEX_JSP));
- assertTrue(caseType.getToViewId().getTextContent().equals(LIST_JSP));
- }
-
- private PageflowLink createLink(PageflowPage source, PageflowPage target) {
- AddConnectionCommand connectionCommand = new AddConnectionCommand();
- connectionCommand.setSource(source);
- connectionCommand.setTarget(target);
- PageflowLink link = PageflowFactory.eINSTANCE.createPFLink();
- connectionCommand.setPFLink(link);
- editor.getDelegatingCommandStack().execute(
- connectionCommand);
- return link;
- }
-
- private PageflowPage createPage(String sourcePath) {
- PageflowPage source = PageflowFactory.eINSTANCE.createPFPage();
- source.setPath(sourcePath);
- AddNodeCommand command = new AddNodeCommand();
- command.setParent(getPageflow());
- command.setChild(source);
- editor.getDelegatingCommandStack().execute(
- command);
- return source;
- }
-
- private FacesConfigType getFacesConfig() {
- return editor.getFacesConfig();
- }
-
- public void testDeleteNode() {
- testAddElements();
- Pageflow pageflow = getPageflow();
- DeleteNodeCommand command = new DeleteNodeCommand(pageflow);
- command.setParent(pageflow);
- PageflowPage page = TransformUtil.findPage(INDEX_JSP, pageflow);
- command.setChild(page);
- command.execute();
- assertTrue(!pageflow.getNodes().contains(page));
- assertTrue(pageflow.getLinks().size() == 0);
- assertTrue(getFacesConfig().getNavigationRule().size() == 0);
- }
-
- public void testDeleteLink() {
- testAddElements();
- Pageflow pageflow = getPageflow();
- DeleteConnectionCommand command = new DeleteConnectionCommand();
- PageflowPage page = TransformUtil.findPage(INDEX_JSP, pageflow);
- PageflowLink link = (PageflowLink) page.getOutlinks().get(0);
- command.setSource(link.getSource());
- command.setTarget(link.getTarget());
- command.setPFLink(link);
- command.execute();
- assertTrue(link.getFCElements().isEmpty());
- assertTrue(link.eAdapters().size() == 0);
- assertTrue(!pageflow.getLinks().contains(link));
- assertTrue(pageflow.getLinks().size() == 0);
- assertTrue(getFacesConfig().getNavigationRule().size() == 0);
- }
-
- public void testAddNavigationCase() {
- testAddElements();
- NavigationRuleType rule = (NavigationRuleType) getFacesConfig()
- .getNavigationRule().get(0);
- rule.getNavigationCase().remove(0);
- assertTrue(getPageflow().getLinks().size() == 0);
- }
-
- public void testSetPFProperty() {
- testAddElements();
- PageflowPage page = TransformUtil.findPage(INDEX_JSP, getPageflow());
- page.setPath(INDEX1_JSP);
- NavigationRuleType rule = (NavigationRuleType) getFacesConfig()
- .getNavigationRule().get(0);
- assertTrue(getFacesConfig().getNavigationRule().size() == 1);
- assertTrue(rule.getFromViewId().getTextContent().equals(INDEX1_JSP));
- }
-
- public void testSetFCProperty() {
- testAddElements();
- NavigationRuleType rule = (NavigationRuleType) getFacesConfig()
- .getNavigationRule().get(0);
- rule.getFromViewId().setTextContent(INDEX1_JSP);
- assertTrue(getPageflow().getLinks().size() == 1);
- assertTrue(((PageflowPage) ((PageflowLink) getPageflow().getLinks()
- .get(0)).getSource()).getPath().equals(INDEX1_JSP));
- }
-
- private Pageflow getPageflow() {
- return editor.getPageflowPage().getPageflow();
- }
-
- public void testChangeLinkTarget() {
- testAddElements();
- ReconnectConnectionCommand command = new ReconnectConnectionCommand();
- PageflowPage page = createPage(INDEX1_JSP);
- command.setSource(page);
- PageflowLink link = (PageflowLink) getPageflow().getLinks().get(0);
- command.setPFLink(link);
- command.execute();
- NavigationRuleType rule = (NavigationRuleType) getFacesConfig()
- .getNavigationRule().get(0);
- Object element1 = link.getSource().getFCElements().getData().get(0);
- Object element2 = link.getTarget().getFCElements().getData().get(0);
- assertTrue(link.getSource().getFCElements().getData().size() == 1);
- assertTrue(link.getTarget().getFCElements().getData().size() == 1);
- assertTrue(element1 == rule.getFromViewId());
-
- assertTrue(((ToViewIdType) element2).eContainer().eContainer() == rule);
- assertTrue(getFacesConfig().getNavigationRule().size() == 1);
- assertTrue(rule.getFromViewId().getTextContent().equals(INDEX1_JSP));
- }
-
- public void testUndo() {
- testAddElements();
- Pageflow pageflow = getPageflow();
- DeleteConnectionCommand command = new DeleteConnectionCommand();
- PageflowPage page = TransformUtil.findPage(INDEX_JSP, pageflow);
- PageflowLink link = (PageflowLink) page.getOutlinks().get(0);
- command.setPFLink(link);
- editor.setActiveEditorPage(PageflowEditor.PAGE_ID);
- editor.getDelegatingCommandStack().execute(command);
- assertTrue(getFacesConfig().getNavigationRule().size() == 0);
- assertTrue(getPageflow().getLinks().size() == 0);
- editor.getDelegatingCommandStack().undo();
- assertTrue(getFacesConfig().getNavigationRule().size() == 1);
- assertTrue(getPageflow().getLinks().size() == 1);
- }
-
- public void testRedo() {
- testUndo();
- editor.getDelegatingCommandStack().redo();
- assertTrue(getFacesConfig().getNavigationRule().size() == 0);
- assertTrue(getPageflow().getLinks().size() == 0);
- }
-
- public void testEditorSwitch() throws Exception {
- editor.setFocus();
- editor.setActivePage(IntroductionPage.class.getName());
- assertTrue(editor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.UNDO.getId()) == null);
- assertTrue(editor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.REDO.getId()) == null);
- testAddElements();
- editor.setActivePage(PageflowEditor.PAGE_ID);
- assertTrue(editor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.UNDO.getId())
- .isEnabled());
-
- editor.setActivePage(IntroductionPage.class.getName());
- assertTrue(editor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.UNDO.getId()) == null);
- assertTrue(editor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.REDO.getId()) == null);
- FacesConfigEditor anotherEditor = (FacesConfigEditor) openWithEditor("WebContent/WEB-INF/faces-config1.xml");
- anotherEditor.setFocus();
- assertTrue(anotherEditor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.UNDO.getId()) == null);
- assertTrue(anotherEditor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.REDO.getId()) == null);
- editor.setFocus();
- editor.setActiveEditorPage(PageflowEditor.PAGE_ID);
- assertTrue(editor.getActionBarContributor().getActionBars()
- .getGlobalActionHandler(ActionFactory.UNDO.getId())
- .isEnabled());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/TestNotificationsOnNonUIThread.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/TestNotificationsOnNonUIThread.java
deleted file mode 100644
index ec0dd21..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/TestNotificationsOnNonUIThread.java
+++ /dev/null
@@ -1,537 +0,0 @@
-package org.eclipse.jst.jsf.facesconfig.ui.test;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.facesconfig.emf.ActionListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
-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.ComponentClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentFamilyType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentType;
-import org.eclipse.jst.jsf.facesconfig.emf.ComponentTypeType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterForClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
-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.FacesContextFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.FromOutcomeType;
-import org.eclipse.jst.jsf.facesconfig.emf.FromViewIdType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleFactoryType;
-import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
-import org.eclipse.jst.jsf.facesconfig.emf.LocaleConfigType;
-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.MessageBundleType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationHandlerType;
-import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType;
-import org.eclipse.jst.jsf.facesconfig.emf.PhaseListenerType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyNameType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.PropertyType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitClassType;
-import org.eclipse.jst.jsf.facesconfig.emf.RenderKitFactoryType;
-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.emf.StateManagerType;
-import org.eclipse.jst.jsf.facesconfig.emf.ToViewIdType;
-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.emf.VariableResolverType;
-import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
-import org.eclipse.jst.jsf.facesconfig.ui.FacesConfigEditor;
-import org.eclipse.jst.jsf.facesconfig.ui.page.ComponentsPage;
-import org.eclipse.jst.jsf.facesconfig.ui.page.ManagedBeanPage;
-import org.eclipse.jst.jsf.facesconfig.ui.page.OthersPage;
-import org.eclipse.jst.jsf.facesconfig.ui.page.OverviewPage;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.PageflowEditor;
-import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * This test covers :
- * [Bug 233506] [hotbug_request] SWTException in Faces config. file editor
- * [Bug 244486] [hotbug_request] JSF Tools: widget disposed exception, when model shared with other editors
- *
- */
-public class TestNotificationsOnNonUIThread extends FacesConfigEditorTest {
-
- public void setUp()throws Exception {
- super.setUp();
- initializeEditor();
- }
-
- private void initializeEditor() {
- UIJob job = new UIJob("Initialize FCE Editor Pages") {
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- //the following should ensure that all of the adapters and listeners on the pages are initialized
- editor.setActiveEditorPage(OverviewPage.PAGE_ID);
- editor.setActiveEditorPage(PageflowEditor.PAGE_ID);
- editor.setActiveEditorPage(ManagedBeanPage.PAGE_ID);
- editor.setActiveEditorPage(ComponentsPage.PAGE_ID);
- editor.setActiveEditorPage(OthersPage.PAGE_ID);
- editor.setActiveEditorPage(FacesConfigEditor.SOURCE_PAGE_ID);
- return Status.OK_STATUS;
- }
-
- };
- job.runInUIThread(new NullProgressMonitor());
-
- }
-
- private void executeTest(FCRunnable runnable) throws Exception {
- FacesConfigArtifactEdit edit = null;
- try {
- edit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForWrite(project, "WEB-INF/faces-config.xml");
- runnable.setFCEdit(edit);
- Thread execThread = new Thread(runnable);
- assert (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay().getThread() != Thread.currentThread());
- execThread.run();
- execThread.join();
- } finally {
- if (edit != null){
- edit.save(null);
- edit.dispose();
- edit = null;
- }
- }
-
- }
-
- public void testCreateFCElementsWithEditorOpen () throws Exception {
- internalCreateNavigationElements();
- closeAndReopenEditor();
- internalCreateComponentElements();
- closeAndReopenEditor();
- internalCreateManagedBeanElement();
- closeAndReopenEditor();
- internalCreateOtherPageElements();
- }
-
- public void testCreateFCElementsWithEditorOpenedThenClosed () throws Exception {
- internalCreateNavigationElements();
- closeEditor();
- internalCreateComponentElements();
-// closeAndReopenEditor();
- internalCreateManagedBeanElement();
-// closeAndReopenEditor();
- internalCreateOtherPageElements();
- }
-
- public void testCreateFCElementsWithEditorSometimesOpen () throws Exception {
- closeEditor();
- internalCreateNavigationElements();
- closeAndReopenEditor();
- internalCreateComponentElements();
- closeEditor();
- internalCreateManagedBeanElement();
- closeAndReopenEditor();
- internalCreateOtherPageElements();
- }
-
- private void closeAndReopenEditor() throws Exception {
- closeEditor();
- openEditor();
- initializeEditor();
- }
-
- private void internalCreateNavigationElements() throws Exception{
- WorkbenchPlugin.log("internalCreateNavigationElements");
- if (editor!= null)
- this.editor.setActiveEditorPage(PageflowEditor.PAGE_ID);
- executeTest(new FCRunnable() {
- public void run(FacesConfigArtifactEdit edit){
- createNavRule(edit);
- }
- });
- }
-
- private void internalCreateComponentElements() throws Exception{
- WorkbenchPlugin.log("internalCreateComponentElements");
- if (editor!= null)
- editor.setActiveEditorPage(ComponentsPage.PAGE_ID);
- executeTest(new FCRunnable() {
- public void run(FacesConfigArtifactEdit edit){
- createComp(edit);
- createConv(edit);
- createRenderkit(edit);
- createVal(edit);
- }
-
- });
- }
-
- private void internalCreateManagedBeanElement() throws Exception{
- WorkbenchPlugin.log("internalCreateManagedBeanElement");
- if (editor!= null)
- editor.setActiveEditorPage(ManagedBeanPage.PAGE_ID);
- executeTest(new FCRunnable() {
- public void run(FacesConfigArtifactEdit edit){
- createMBean(edit);
- }
-
- });
- }
-
- private void internalCreateOtherPageElements() throws Exception{
- WorkbenchPlugin.log("internalCreateOtherPageElements");
- if (editor!= null)
- editor.setActiveEditorPage(OthersPage.PAGE_ID);
- executeTest(new FCRunnable() {
- public void run(FacesConfigArtifactEdit edit){
- createActionListener(edit);
- createDefRenderKit(edit);
- createLocaleConfig(edit);
- createMessageBundle(edit);
- createNavHandler(edit);
- createPropertyResolver(edit);
- createStateManager(edit);
- createVarResolver(edit);
- createViewHandler(edit);
- createAppFactory(edit);
- createFCFactory(edit);
- createLCFactory(edit);
- createRKFactory(edit);
- createPhaseListener(edit);
- }
-
- });
- }
-
- @SuppressWarnings("unchecked")
- private void createPhaseListener(FacesConfigArtifactEdit edit){
- LifecycleType app = getOrCreateLCType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- PhaseListenerType t = fac.createPhaseListenerType();
- t.setTextContent("PhaseListener"+System.currentTimeMillis());
- app.getPhaseListener().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private LifecycleType getOrCreateLCType(
- FacesConfigArtifactEdit edit) {
-
- List<LifecycleType> lcs = edit.getFacesConfig().getLifecycle();
- if (lcs == null || lcs.size() == 0){
- LifecycleType lc = FacesConfigFactory.eINSTANCE.createLifecycleType();
- edit.getFacesConfig().getLifecycle().add(lc);
- return lc;
- }
- return lcs.get(0);
- }
-
- @SuppressWarnings("unchecked")
- private void createRKFactory(FacesConfigArtifactEdit edit) {
- FactoryType app = getOrCreateFactoryType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- RenderKitFactoryType t = fac.createRenderKitFactoryType();
- t.setTextContent("RKFac");
- app.getRenderKitFactory().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createLCFactory(FacesConfigArtifactEdit edit) {
- FactoryType app = getOrCreateFactoryType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- LifecycleFactoryType t = fac.createLifecycleFactoryType();
- t.setTextContent("lifeCycleFac");
- app.getLifecycleFactory().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createFCFactory(FacesConfigArtifactEdit edit) {
- FactoryType app = getOrCreateFactoryType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- FacesContextFactoryType t = fac.createFacesContextFactoryType();
- t.setTextContent("FCFac");
- app.getFacesContextFactory().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createAppFactory(FacesConfigArtifactEdit edit) {
- FactoryType app = getOrCreateFactoryType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- ApplicationFactoryType t = fac.createApplicationFactoryType();
- t.setTextContent("appFac");
- app.getApplicationFactory().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private FactoryType getOrCreateFactoryType(
- FacesConfigArtifactEdit edit) {
- List<FactoryType> facs = edit.getFacesConfig().getFactory();
- if (facs == null || facs.size() == 0){
- FactoryType fac = FacesConfigFactory.eINSTANCE.createFactoryType();
- edit.getFacesConfig().getFactory().add(fac);
- return fac;
- }
- return facs.get(0);
-
- }
-
- @SuppressWarnings("unchecked")
- private void createViewHandler(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- ViewHandlerType t = fac.createViewHandlerType();
- t.setTextContent("ViewHandler");
- app.getViewHandler().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createVarResolver(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- VariableResolverType t = fac.createVariableResolverType();
- t.setTextContent("VarResolver");
- app.getVariableResolver().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createStateManager(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- StateManagerType t = fac.createStateManagerType();
- t.setTextContent("StateMgr");
- app.getStateManager().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createPropertyResolver(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- PropertyResolverType t = fac.createPropertyResolverType();
- t.setTextContent("PropResolver");
- app.getPropertyResolver().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createNavHandler(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- NavigationHandlerType t = fac.createNavigationHandlerType();
- t.setTextContent("NavHdlr");
- app.getNavigationHandler().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createMessageBundle(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- MessageBundleType t = fac.createMessageBundleType();
- t.setTextContent("messageBundle");
- app.getMessageBundle().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createLocaleConfig(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- LocaleConfigType t = fac.createLocaleConfigType();
- DefaultLocaleType lc = fac.createDefaultLocaleType();
- lc.setTextContent("en");
- t.setDefaultLocale(lc);
- app.getLocaleConfig().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createActionListener(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- ActionListenerType t = fac.createActionListenerType();
- t.setTextContent("actionListener");
- app.getActionListener().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private void createDefRenderKit(FacesConfigArtifactEdit edit) {
- ApplicationType app = getOrCreateAppType(edit);
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- DefaultRenderKitIdType t = fac.createDefaultRenderKitIdType();
- t.setTextContent("defRenderKit");
- app.getDefaultRenderKitId().add(t);
- }
-
- @SuppressWarnings("unchecked")
- private ApplicationType getOrCreateAppType(
- FacesConfigArtifactEdit edit) {
- List<ApplicationType> apps = edit.getFacesConfig().getApplication();
- if (apps == null || apps.size() == 0){
- ApplicationType app = FacesConfigFactory.eINSTANCE.createApplicationType();
- edit.getFacesConfig().getApplication().add(app);
- return app;
- }
- return apps.get(0);
- }
-
- @SuppressWarnings("unchecked")
- private void createComp(FacesConfigArtifactEdit edit) {
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- ComponentType comp = fac.createComponentType();
- ComponentTypeType ttype = fac.createComponentTypeType();
- ttype.setTextContent("comp"+String.valueOf(System.currentTimeMillis()));
- comp.setComponentType(ttype);
- ComponentClassType klass = fac.createComponentClassType();
- klass.setTextContent("com.foo.burger");
- comp.setComponentClass(klass);
- edit.getFacesConfig().getComponent().add(comp);
- }
-
- @SuppressWarnings("unchecked")
- private void createConv(FacesConfigArtifactEdit edit) {
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- ConverterType conv = fac.createConverterType();
- ConverterClassType klass = fac.createConverterClassType();
- klass.setTextContent("com.foo.burger");
- conv.setConverterClass(klass);
-// ConverterIdType id= fac.createConverterIdType();
-// id.setTextContent("Conv"+System.currentTimeMillis());
-// conv.setConverterId(id);
- ConverterForClassType forKlass = fac.createConverterForClassType();
- forKlass.setTextContent("com.foo.burger.converter");
- conv.setConverterForClass(forKlass);
-
- AttributeType attr = fac.createAttributeType();
- AttributeClassType aKlass = fac.createAttributeClassType();
- AttributeNameType aName = fac.createAttributeNameType();
- aName.setTextContent("foo");
- aKlass.setTextContent("com.foo.burger");
- attr.setAttributeClass(aKlass);
- attr.setAttributeName(aName);
- conv.getAttribute().add(attr);
-
- PropertyType prop = fac.createPropertyType();
- PropertyClassType pKlass = fac.createPropertyClassType();
- PropertyNameType pName = fac.createPropertyNameType();
- pKlass.setTextContent("aProp");
- pName.setTextContent("com.foo.Bar");
- prop.setPropertyClass(pKlass);
- prop.setPropertyName(pName);
- conv.getProperty().add(prop);
-
- edit.getFacesConfig().getConverter().add(conv);
- }
-
-
- @SuppressWarnings("unchecked")
- private void createVal(FacesConfigArtifactEdit edit) {
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- ValidatorType val = fac.createValidatorType();
- ValidatorClassType klass = fac.createValidatorClassType();
- klass.setTextContent("com.foo.burger");
- val.setValidatorClass(klass);
- ValidatorIdType id= fac.createValidatorIdType();
- id.setTextContent("Conv"+System.currentTimeMillis());
- val.setValidatorId(id);
-
- AttributeType attr = fac.createAttributeType();
- AttributeClassType aKlass = fac.createAttributeClassType();
- AttributeNameType aName = fac.createAttributeNameType();
- aName.setTextContent("foo");
- aKlass.setTextContent("com.foo.burger");
- attr.setAttributeClass(aKlass);
- attr.setAttributeName(aName);
- val.getAttribute().add(attr);
-
- PropertyType prop = fac.createPropertyType();
- PropertyClassType pKlass = fac.createPropertyClassType();
- PropertyNameType pName = fac.createPropertyNameType();
- pKlass.setTextContent("aProp");
- pName.setTextContent("com.foo.Bar");
- prop.setPropertyClass(pKlass);
- prop.setPropertyName(pName);
- val.getProperty().add(prop);
-
- edit.getFacesConfig().getValidator().add(val);
- }
-
- @SuppressWarnings("unchecked")
- private void createRenderkit(FacesConfigArtifactEdit edit) {
- FacesConfigFactory fac = FacesConfigFactory.eINSTANCE;
- RenderKitType rt = fac.createRenderKitType();
- RenderKitIdType id = fac.createRenderKitIdType();
- id.setTextContent("foo"+System.currentTimeMillis());
- rt.setRenderKitId(id);
- RenderKitClassType klass = fac.createRenderKitClassType();
- klass.setTextContent("fooClass");
- rt.setRenderKitClass(klass);
-
- RendererType r = fac.createRendererType();
- RendererClassType rk = fac.createRendererClassType();
- rk.setTextContent("com.fooey");
- r.setRendererClass(rk);
- RendererTypeType rtt = fac.createRendererTypeType();
- rtt.setTextContent("rendererTypeType");
- r.setRendererType(rtt);
- ComponentFamilyType c = fac.createComponentFamilyType();
- c.setTextContent("componentFamilyType");
- r.setComponentFamily(c);
- rt.getRenderer().add(r);
-
- edit.getFacesConfig().getRenderKit().add(rt);
- }
-
- @SuppressWarnings("unchecked")
- private void createNavRule(FacesConfigArtifactEdit edit) {
- NavigationRuleType newNavRule = FacesConfigFactory.eINSTANCE.createNavigationRuleType();
- FromViewIdType fromView = FacesConfigFactory.eINSTANCE.createFromViewIdType();
- fromView.setTextContent("JSP"+String.valueOf(System.currentTimeMillis()));
- newNavRule.setFromViewId(fromView);
- NavigationCaseType newCase = FacesConfigFactory.eINSTANCE.createNavigationCaseType();
- ToViewIdType view = FacesConfigFactory.eINSTANCE.createToViewIdType();
- view.setTextContent("jsp2");
- newCase.setToViewId(view);
- FromOutcomeType fromOutcome = FacesConfigFactory.eINSTANCE.createFromOutcomeType();
- fromOutcome.setTextContent("la-la-la");
- newCase.setFromOutcome(fromOutcome);
- newNavRule.getNavigationCase().add(newCase);
- edit.getFacesConfig().getNavigationRule().add(newNavRule);
- }
-
- @SuppressWarnings("unchecked")
- private void createMBean(FacesConfigArtifactEdit edit) {
- ManagedBeanType newBean = FacesConfigFactory.eINSTANCE.createManagedBeanType();
- ManagedBeanNameType name = FacesConfigFactory.eINSTANCE.createManagedBeanNameType();
- ManagedBeanScopeType scope = FacesConfigFactory.eINSTANCE.createManagedBeanScopeType();
- scope.setTextContent("session");
- name.setTextContent("Foobar"+String.valueOf(System.currentTimeMillis()));
- ManagedBeanClassType klass = FacesConfigFactory.eINSTANCE.createManagedBeanClassType();
- klass.setTextContent("com.foo.Bar");
- newBean.setManagedBeanName(name);
- newBean.setManagedBeanClass(klass);
- newBean.setManagedBeanScope(scope);
- edit.getFacesConfig().getManagedBean().add(newBean);
- }
-
- abstract class FCRunnable implements Runnable {
- FacesConfigArtifactEdit _edit;
- public void setFCEdit(FacesConfigArtifactEdit edit) {
- _edit = edit;
- }
- protected abstract void run(FacesConfigArtifactEdit edit);
- public final void run() {
- run(_edit);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/WebrootUtilTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/WebrootUtilTest.java
deleted file mode 100644
index 61e2be8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/WebrootUtilTest.java
+++ /dev/null
@@ -1,132 +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.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.jsf.facesconfig.ui.util.WebrootUtil;
-
-/**
- * @author sfshi
- *
- */
-public class WebrootUtilTest extends FacesConfigEditorTest {
-
- private static final String WEB_CONTENT_PATH = "/emptyjsfproject/WebContent";
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#getWebPath(org.eclipse.core.runtime.IPath)}.
- */
- public void testGetWebPathIPath() {
- // TODO:
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#isUnderWebContentFolder(org.eclipse.core.resources.IResource)}.
- *
- * @throws CoreException
- */
- public void testIsUnderWebContentFolder() throws CoreException {
- IResource resource = project.getFile(new Path("WebContent/web.xml"));
- assertTrue(WebrootUtil.isUnderWebContentFolder(resource));
-
- IFolder folder = WebrootUtil.getWebContentFolder(project);
- IFile page1 = folder.getFile("page1.jsp");
- page1.create(null, true, new NullProgressMonitor());
-
- assertTrue(WebrootUtil.isUnderWebContentFolder(page1));
-
- IFile file1 = project.getFile("file1.txt");
- file1.create(null, true, new NullProgressMonitor());
-
- assertFalse(WebrootUtil.isUnderWebContentFolder(file1));
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#getWebContentPath(org.eclipse.core.resources.IProject)}.
- */
- public void testGetWebContentPath() {
-
- IPath path = WebrootUtil.getWebContentPath(project);
- assertNotNull(path);
- assertEquals(path.toString(), WEB_CONTENT_PATH);
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#getWebContentFolder(org.eclipse.core.resources.IProject)}.
- */
- public void testGetWebContentFolder() {
- IFolder folder = WebrootUtil.getWebContentFolder(project);
- assertNotNull(folder);
- assertTrue(folder.exists());
- assertEquals(folder.getFullPath().toString(), WEB_CONTENT_PATH);
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#getWebContentFolderDepth(org.eclipse.core.resources.IProject)}.
- */
- public void testGetWebContentFolderDepth() {
- assertEquals(2, WebrootUtil.getWebContentFolderDepth(project));
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#isValidWebFile(org.eclipse.core.runtime.IPath)}.
- * @throws CoreException
- */
- public void testIsValidWebFile() throws CoreException {
-
- IFolder folder = WebrootUtil.getWebContentFolder(project);
- IFile page1 = folder.getFile("page1.jsp");
- page1.create(null, true, new NullProgressMonitor());
-
- assertTrue(WebrootUtil.isValidWebFile(page1.getFullPath()));
-
- IFile page2 = folder.getFile("page2.jsv");
- page2.create(null, true, new NullProgressMonitor());
- assertTrue(WebrootUtil.isValidWebFile(page2.getFullPath()));
-
- IFile file1 = project.getFile("file1.txt");
- file1.create(null, true, new NullProgressMonitor());
-
- assertFalse(WebrootUtil.isValidWebFile(file1.getFullPath()));
-
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#getWebPath(java.lang.String)}.
- */
- public void testGetWebPathString() {
- // TODO:
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jst.jsf.common.ui.internal.utils.WebrootUtil#getPageNameFromWebPath(java.lang.String)}.
- */
- public void testGetPageNameFromWebPath() {
- // TODO:
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/TestUtil.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/TestUtil.java
deleted file mode 100644
index 05ea790..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/TestUtil.java
+++ /dev/null
@@ -1,306 +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.util;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.internal.core.builder.JavaBuilder;
-import org.eclipse.jst.jsf.facesconfig.ui.EditorPlugin;
-
-/**
- * Test utility to create project and its files.
- *
- * @author Yang Liu, Xiao-guang Zhang
- *
- * @version
- */
-public class TestUtil {
- //private static final String TEST_FILE_FOLDER = "../org.eclipse.jst.jsf.facesconfig.ui.test/test-file/";
- private static final String TEST_FILE_FOLDER = "/test-file/";
- /**
- *
- * @param prjname
- * @param path
- * relative to this plugin's "casefiles/projects" folder.
- * @return
- * @throws Exception
- */
- public static IProject createProjectFromZip(String prjname, String path)
- throws Exception {
-
- URL url = FileLocator.find(EditorPlugin.getDefault().getBundle(), new Path(TEST_FILE_FOLDER + path), null);
-
- InputStream stream = url.openStream();
- return createProjectFromZip(prjname, stream);
- }
-
- /**
- * create a project from a zip file.
- *
- * @param prjname
- * @param zipStream
- * @throws Exception
- */
- public static IProject createProjectFromZip(final String prjname,
- final InputStream zipStream) throws Exception {
- final IProject[] holder = new IProject[1];
- IWorkspaceRunnable r = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IProject prj = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(prjname);
- if (!prj.exists()) {
- prj.create(null);
- }
- prj.open(null);
- try {
- expandZip(zipStream, prj);
- } catch (Exception ex) {
- throw new CoreException(new Status(0,
- "org.eclipse.jst.jsf.facesconfig.ui.test", 0, ex
- .getMessage(), ex));
- }
- holder[0] = prj;
- }
- };
-
- ResourcesPlugin.getWorkspace().run(r, null);
- return holder[0];
- }
-
- /**
- * build a project
- *
- * @param project
- * @param monitor
- */
- public static void buildProject(IProject project, IProgressMonitor monitor) {
- try {
- project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- } catch (CoreException e) {
- e.printStackTrace(System.err);
- }
- }
-
- /**
- * expand the zip stream into the specified folder.
- *
- * @param zipStream
- * @param dir
- * @throws Exception
- */
- public static void expandZip(InputStream zipStream, IContainer dir)
- throws Exception {
- ZipInputStream zis = null;
-
- try {
- // first, count number of items in zip file
- zis = new ZipInputStream(zipStream);
- ZipEntry ze = zis.getNextEntry();
- while (ze != null) {
- if (ze.isDirectory()) {
- IFolder folder = dir.getFolder(new Path(ze.getName()));
- if (!folder.exists()) {
- ensurePath(folder);
- folder.create(true, true, null);
- }
- } else {
- IFile file = dir.getFile(new Path(ze.getName()));
- ensurePath(file);
- // use ZipStreamWrapper to prevent zis being closed
- if (file.exists()) {
- file.setContents(new ZipStreamWrapper(zis),
- IResource.NONE, null);
- } else {
- file.create(new ZipStreamWrapper(zis), true, null);
- }
- }
-
- ze = zis.getNextEntry();
- }
- } finally {
- try {
- if (zis != null)
- zis.close();
- } catch (Exception ex) {
- // ignore
- }
- }
- }
-
- /**
- * @param file
- * @throws CoreException
- */
- private static void ensurePath(IResource file) throws CoreException {
- IContainer container = file.getParent();
- if (!container.exists()) {
- ensurePath(container);
- ((IFolder) container).create(true, true, null);
- }
- }
-
- /**
- * this method will copy file from the sourcePath folder of this plugin into
- * the target path related with the destination project.
- *
- * @param project
- * @param sourcePath -
- * Source path, must be a relative path to test plugin
- * @param targetPath -
- * Target path, must be relative path to eclispe project.
- *
- * @return
- */
- public static IFile copyFile(IProject project, String targetPath,
- String sourcePath) throws Exception {
-
- URL url = FileLocator.find(EditorPlugin.getDefault().getBundle(), new Path(TEST_FILE_FOLDER + sourcePath), null);
- InputStream stream = url.openStream();
-
- IFile file = null;
- IPath path = new Path(sourcePath);
- if (targetPath != null && targetPath.length() > 0) {
- IFolder folder = project.getFolder(targetPath);
- file = folder.getFile(path.lastSegment());
- } else {
- file = project.getFile(path.lastSegment());
- }
-
- if (!file.exists()) {
- ensurePath(file);
- file.create(stream, true, null);
- } else {
- file.setContents(stream, IFile.FORCE, null);
- }
-
- return file;
- }
-
- /**
- * this method will create page file from the "pages" folder of this plugin
- * into the webroot folder of the destination project.
- *
- * @param filePath -
- * file path, must be relative path to destination project.
- *
- * @return
- */
- public static IFile createFile(IProject project, String filePath,
- String content) throws Exception {
- IFile file = project.getFile(filePath);
- ensurePath(file);
- ByteArrayInputStream stream = new ByteArrayInputStream(content
- .getBytes());
- file.create(stream, true, null);
- return file;
- }
-
- /**
- * this method will get the page file from the "pages" folder of this plugin
- * as a string.
- *
- * @param path -
- * related with plugin
- * @return
- * @throws Exception
- */
- public static String getFileAsString(String path) throws Exception {
-
- URL url = FileLocator.find(EditorPlugin.getDefault().getBundle(), new Path(TEST_FILE_FOLDER + path), null);
- InputStream stream = url.openStream();
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(stream));
- StringBuffer buffer = new StringBuffer();
- char[] temp = new char[256];
- int count;
- while ((count = reader.read(temp)) > 0) {
- buffer.append(temp, 0, count);
- }
- reader.close();
- stream.close();
- return buffer.toString();
- }
-
- public static String removeAllWhitespace(String s) {
- StringBuffer buffer = new StringBuffer(s.length());
- for (int i = 0, length = s.length(); i < length; i++) {
- if (!Character.isWhitespace(s.charAt(i))) {
- buffer.append(s.charAt(i));
- }
- }
- return buffer.toString();
- }
-
- /**
- * remove resource, following schedule rule.
- *
- * @param prj
- * @throws CoreException
- */
- public static void removeResource(final IResource prj) throws CoreException {
- if (prj instanceof IFile) {
- ((IFile) prj).delete(true, false, null);
- return;
- }
- IWorkspaceRunnable r = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- prj.delete(true, monitor);
- }
- };
- ResourcesPlugin.getWorkspace().run(r, prj, 0, null);
- }
-
- /**
- * To verify if this java resource(such as project or folder) can be
- * compiled.
- *
- * @param javaFile
- * @return true if the resource contains no error, otherwise return false.
- */
- public static boolean isValidJavaResource(IResource resource) {
- IMarker[] markers = JavaBuilder.getProblemsFor(resource);
- if (markers != null && markers.length > 0) {
- for (int i = 0; i < markers.length; i++) {
- IMarker curr = markers[i];
- if (curr == null) {
- continue;
- }
- if (curr.getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR) {
- return false;
- }
- }
- }
- return true;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/ZipStreamWrapper.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/ZipStreamWrapper.java
deleted file mode 100644
index 6eed1f5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/test/util/ZipStreamWrapper.java
+++ /dev/null
@@ -1,59 +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.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipInputStream;
-
-/**
- * @author Yang Liu
- * @version
- */
-public class ZipStreamWrapper extends InputStream
-{
-
- private ZipInputStream zipStream;
-
- /**
- *
- */
- public ZipStreamWrapper(ZipInputStream stream)
- {
- super();
- this.zipStream = stream;
- }
-
- /* (non-Javadoc)
- * @see java.io.InputStream#read()
- */
- public int read() throws IOException
- {
- return zipStream.read();
- }
-
- /* (non-Javadoc)
- * @see java.io.InputStream#read(byte[])
- */
- public int read(byte[] b) throws IOException
- {
- return zipStream.read(b);
- }
-
- /* (non-Javadoc)
- * @see java.io.InputStream#read(byte[], int, int)
- */
- public int read(byte[] b, int off, int len) throws IOException
- {
- return zipStream.read(b, off, len);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/wizard/NewManagedBeanWizardTest.java b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/wizard/NewManagedBeanWizardTest.java
deleted file mode 100644
index 6e464a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/src/org/eclipse/jst/jsf/facesconfig/ui/wizard/NewManagedBeanWizardTest.java
+++ /dev/null
@@ -1,67 +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.wizard;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.jsf.facesconfig.ui.EditorPlugin;
-import org.eclipse.jst.jsf.facesconfig.ui.test.FacesConfigEditorTest;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author sfshi
- *
- */
-public class NewManagedBeanWizardTest extends FacesConfigEditorTest {
-
- NewManagedBeanWizard wizard;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.facesconfig.ui.test.FacesConfigEditorTest#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsf.facesconfig.ui.test.FacesConfigEditorTest#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testManagedBeanWizard() {
- NewManagedBeanWizard wizard1 = new NewManagedBeanWizard(project);
- wizard1.setForcePreviousAndNextButtons(true);
-
- Shell shell = EditorPlugin.getActiveShell();
- WizardDialog wizardDialog = new WizardDialog(shell, wizard1);
- wizardDialog.create();
- wizardDialog.setBlockOnOpen(true);
-
- assertTrue(wizard1.getStartingPage() instanceof ManagedBeanClassSelectionPage);
- ManagedBeanClassSelectionPage page1 = (ManagedBeanClassSelectionPage) wizard1
- .getStartingPage();
- IWizardPage page2 = wizard1.getNextPage(page1);
- assertTrue(page2 instanceof ManagedBeanPropertyPage);
- // page1.searchRadioButton.setSelection(true);
- // assertFalse(page1.isPageComplete());
- // page1.createRadioButton.setSelection(true);
-
- // assertTrue(page1.isPageComplete());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/adfDemoProject.zip b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/adfDemoProject.zip
deleted file mode 100644
index 7db028f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/adfDemoProject.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/emptyjsfproject.zip b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/emptyjsfproject.zip
deleted file mode 100644
index 269f899..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/emptyjsfproject.zip
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/page1.jsp b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/page1.jsp
deleted file mode 100644
index 32753e1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test-file/page1.jsp
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-
-<HTML>
-
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
-<TITLE>CarStore</TITLE>
-<link rel="stylesheet" type="text/css"
- href='<%= request.getContextPath() + "/stylesheet.css" %>'>
-</HEAD>
-
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-
-<BODY BGCOLOR="white">
-
-<f:view>
-
- <h:form>
-
- <h:commandButton value="Button 1" action="action1" />
-
- <h:commandButton action="action2" value="Button 2" />
-
- <h:commandLink value="Link 1" action="action3" />
-
- </h:form>
-
- <jsp:include page="bottomMatter.jsp" />
-
-</f:view>
-</BODY>
-
-</HTML>
diff --git a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test.xml b/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/test.xml
deleted file mode 100644
index 4e4f46f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.facesconfig.ui.test/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.ui.test"/>
- <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.ui.test.*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.ui.test.AllTestCases" />
- <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.ui.test.*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.metadata.tests/.classpath b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.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.metadata.tests/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.cvsignore
deleted file mode 100644
index 9bffb0f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-temp.folder
-build.xml
-javaCompiler.jsfmetadatatests.jar.args
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.project b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.project
deleted file mode 100644
index 6f604a6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.metadata.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.metadata.tests/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index e4ba2d6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:03:48 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index e5bbef2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-#Thu Aug 23 17:19: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.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.metadata.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index b807dfc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,42 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.metadata.tests;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin
-Bundle-Localization: plugin
-Bundle-ClassPath: jsfmetadatatests.jar
-Require-Bundle: org.eclipse.jst.jsf.common;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.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.junit;bundle-version="3.8.1",
- org.eclipse.wst.sse.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.jsp.core;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.jst.pagedesigner;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jface;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.core;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.common.frameworks;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsf.core.tests;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.validation,
- org.eclipse.jst.pagedesigner.jsf.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.gef;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.jst.common.project.facet.core,
- org.eclipse.jst.jsf.common.runtime;bundle-version="[1.0.201,2.0.0)"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jst.jsf.common.metadata.tests;x-internal:=true,
- org.eclipse.jst.jsf.metadata.tests;x-internal:=true,
- org.eclipse.jst.jsf.metadata.tests.metadataprocessing;x-internal:=true,
- org.eclipse.jst.jsf.metadata.tests.metadataprocessing.features;x-internal:=true,
- org.eclipse.jst.jsf.metadata.tests.metadataprocessing.types;x-internal:=true,
- org.eclipse.jst.jsf.metadata.tests.taglibprocessing;x-internal:=true
-Plugin-Class: org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.properties
deleted file mode 100644
index b76f72b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.properties
+++ /dev/null
@@ -1,11 +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
-###############################################################################
-NLS=This is externalized text \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.xml
deleted file mode 100644
index 7464182..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/RootOfPluginTest.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- id="RootOfPluginTest">
-
- <trait id="T1">
- <value>%NLS</value>
- </trait>
-
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/about.html b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/about.html
deleted file mode 100644
index 04d4782..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.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.metadata.tests/build.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/build.properties
deleted file mode 100644
index 2bf449e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.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
-#
-###############################################################################
-bin.includes = META-INF/,\
- jsfmetadatatests.jar,\
- testfiles/,\
- plugin.xml,\
- test.xml,\
- about.html,\
- plugin.properties,\
- RootOfPluginTest.properties,\
- RootOfPluginTest.xml
-source.jsfmetadatatests.jar = src/
-output.jsfmetadatatests.jar = bin/
-jars.compile.order = jsfmetadatatests.jar
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.properties
deleted file mode 100644
index b01168d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.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 - Metadata Tests Plug-in
-Bundle-Vendor.0=Eclipse.org
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.xml
deleted file mode 100644
index edbadcf..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/plugin.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.jst.jsf.common.standardMetaDataFiles">
- <standardMetaDataFile
- location="/testfiles/metadata/jsf_test.xml"
- uri="http://org.eclipse.jsf/test"/>
- <standardMetaDataFile
- location="/testfiles/metadata/jsf_test.xml"
- uri="http://org.eclipse.jsf/test2"/>
- <standardMetaDataFile
- location="/testfiles/metadata/FileA.xml"
- uri="http://org.eclipse.jsf/mergetest1"/>
- <standardMetaDataFile
- location="/testfiles/metadata/FileB.xml"
- uri="http://org.eclipse.jsf/mergetest1"/>
- <standardMetaDataFile
- location="/testfiles/metadata/FileIncludeExternalModel.xml"
- uri="http://org.eclipse.jsf/mergetest2"/>
- <standardMetaDataFile
- location="/testfiles/metadata/doesntexist.xml"
- uri=" http://org.eclipse.jsf/missingFile "/>
- <standardMetaDataFile
- location="/testfiles/metadata/jsf_metadataprocessing.xml"
- uri=" http://org.eclipse.jsf/metadataprocessing"/>
- <standardMetaDataFile
- location="/testfiles/metadata/jsf_tagprocessing.xml"
- uri="http://org.eclipse.jsf/tagprocessing"/>
- <standardMetaDataFile
- location="/testfiles/metadata/jsf_tinytest.xml"
- uri="http://org.eclipse.jsf/tinytest"/>
- <standardMetaDataFile
- location="testfiles/metadata/TinyIncludeTest.xml"
- uri="TinyIncludeTest"/>
- <standardMetaDataFile
- location="./RootOfPluginTest.xml"
- uri="RootOfPluginTest"/>
- <standardMetaDataFile
- location="/testfiles/metadata/traithelpertest.xml"
- locator="org.eclipse.jst.jsf.common.metadata.tests.MyMDLocator"
- uri="http://org.eclipse.jsf/traithelpertest"/>
- <standardMetaDataFile
- location="/testfiles/metadata/quickEditSectionTest.xml"
- uri="http://org.eclipse.jsf/quickEditSectionTest"/>
- <standardMetaDataFile
- location="/testfiles/metadata/propertyDescriptorTest.xml"
- uri="http://org.eclipse.jsf/propertyDescriptorTest"/>
- <standardMetaDataFile
- location="/testfiles/metadata/missingMDModelTest.xml"
- uri="http://org.eclipse.jsf/missingMDModelTest"/>
-
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes">
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.StringType"
- id="MyStringArrayType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.metadata.tests.metadataprocessing.types.MyBooleanType"
- id="MyBooleanType"/>
- <attributeValueRuntimeType
- class="org.eclipse.jst.jsf.taglibprocessing.attributevalues.LongType"
- id="MyLongType"/>
- <attributeValueRuntimeType id="NoImplType"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.MetaDataEnabledFeatures">
- <MetaDataEnabledFeature
- class="org.eclipse.jst.jsf.metadata.tests.metadataprocessing.MetaDataEnabledBarkAdapter"
- typeid="org.eclipse.jst.jsf.core.attributevalues.BooleanType"/>
- <MetaDataEnabledFeature
- class="org.eclipse.jst.jsf.metadata.tests.metadataprocessing.MetaDataEnabledBarkAdapter"
- typeid="org.eclipse.jst.jsf.metadata.tests.MyBooleanType"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.common.domainQueryFactory">
- <factory
- class="org.eclipse.jst.jsf.common.metadata.tests.updated.FakeDomainQueryFactory">
- </factory>
- </extension>
-<!--
- <extension
- point="org.eclipse.jst.jsf.common.mdModelManagerFactory">
- <factory
- class="org.eclipse.jst.jsf.common.metadata.tests.TestMDModelManagerFactory">
- </factory>
- </extension>
--->
-</plugin>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractBaseMetaDataTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractBaseMetaDataTestCase.java
deleted file mode 100644
index 82fb387..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractBaseMetaDataTestCase.java
+++ /dev/null
@@ -1,160 +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.common.metadata.tests;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-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.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-public abstract class AbstractBaseMetaDataTestCase extends TestCase {
- protected static final String projName = "TestCommonMetadataProject";
- protected static final String domain = "TagLibraryDomain";
- protected static final String badDomain = "TagLibDomain";
- protected static final String baseTestUri = "http://org.eclipse.jsf/test";
-
- protected static final String TYPE_TAG_FILE = "tagFile";
- protected static final String TYPE_TAG = "tag";
- protected static final String TYPE_TAG_ATTRIBUTE = "attribute";
-
- protected IProject project;
- protected WebProjectTestEnvironment projectTestEnvironment;
- protected IStructuredDocumentContext docContext;
-
- private boolean debug_info = false;
- private long startTime;
- private String debugTitle;
-
- public void setUp() throws Exception {
- super.setUp();
-
- debug_info = false;
-
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- JSFTestUtil.setValidationEnabled(false);
-
- projectTestEnvironment =
- new WebProjectTestEnvironment(projName/*+"_"+getClass().getName()+"_"+getName()*/);
- projectTestEnvironment.createProject(true);
-
- project = projectTestEnvironment.getTestProject();
-
- projectTestEnvironment.loadResourceInWebRoot(MetadataTestsPlugin.getDefault().getBundle(),
- "/testfiles/metadata/TestJSP.jsp",
- "/TestJSP.jsp");
-
- String path = "/WebContent/TestJSP.jsp";
- int offset = 33;// # not important to tests
-
- docContext = getDocContext(path, offset);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-// projectTestEnvironment.getTestProject().close(null);
-// projectTestEnvironment.getTestProject().delete(true, null);
- }
-
-
-
- private IStructuredDocumentContext getDocContext(String path, int offset) throws Exception{
- IFile jspFile = project.getFile(new Path(path));
- assertTrue(jspFile.exists());
-
- final IModelManager modelManager = StructuredModelManager
- .getModelManager();
-
- IStructuredModel model = null;
-
- model = modelManager.getModelForRead(jspFile);
- assertTrue(model instanceof DOMModelForJSP);
-
- return IStructuredDocumentContextFactory.INSTANCE.getContext(
- model.getStructuredDocument(), offset);
-
- }
-
- protected void showDebugInfo(boolean show){
- debug_info = show;
- }
-
- protected void dumpMDTree(Entity entity, int indent) {
- if (debug_info){
- printLine("Entity: "+entity.getId(),indent);
- indent++;
- for(Iterator<?> it=entity.getTraits().iterator();it.hasNext();){
- Trait t = (Trait)it.next();
- printLine("Trait: "+t.getId()+"["+ getValue(t)+ "]", indent);
- }
- for (Iterator<?> it=entity.getChildEntities().iterator();it.hasNext();){
- dumpMDTree((Entity)it.next(), indent);
- }
- }
- }
-
- private String getValue(Trait trait) {
- if (trait.getValue() instanceof ListOfValues){
- List<?> l = TraitValueHelper.getValueAsListOfStrings(trait);
- StringBuffer buf = new StringBuffer();
- for (Iterator<?> it=l.iterator();it.hasNext();){
- buf.append((String)it.next());
- buf.append(", ");
- }
- if (buf.toString().length() > 0)
- return buf.toString().substring(0, buf.toString().length() - 2);
- return null;
- }
- return TraitValueHelper.getValueAsString(trait);
- }
-
- private void printLine(String line, int indent) {
- StringBuffer buf = new StringBuffer();
- for (int i=0;i<indent;i++){
- buf.append(" ");
- }
- buf.append(line);
- System.out.println(buf.toString());
- }
-
- protected void endTime() {
- if (debug_info){
- long delta = System.nanoTime() - startTime;
- printLine("Time for "+debugTitle+"(ms)= "+String.valueOf(delta/1000000), 0);
- }
- }
-
- protected void startTime(String debugTitle) {
- if (debug_info){
- this.debugTitle = debugTitle;
- startTime = System.nanoTime();
- printLine("",0);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractEntityQueryVisitorTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractEntityQueryVisitorTest.java
deleted file mode 100644
index fe4a21c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractEntityQueryVisitorTest.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.query.AbstractEntityQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-
-public class AbstractEntityQueryVisitorTest extends TestCase {
- private NullEntityQueryVisitor visitor;
- protected void setUp() throws Exception {
- super.setUp();
- visitor = new NullEntityQueryVisitor();
- }
-
- public void testFindEntities() {
- Assert.assertNotNull(visitor);
- Assert.assertEquals(EmptyResultSet.class, visitor.findEntities(null, null).getClass());
- }
-
- private class NullEntityQueryVisitor extends AbstractEntityQueryVisitor{
-
- @Override
- public void visit(Entity entity) {
- // nada
- }
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractMetaDataVisitorTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractMetaDataVisitorTest.java
deleted file mode 100644
index 3e07d83..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractMetaDataVisitorTest.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.query.AbstractMetaDataVisitor;
-
-public class AbstractMetaDataVisitorTest extends TestCase {
- private NullMetaDataVisitor visitor;
- protected void setUp() throws Exception {
- super.setUp();
- visitor = new NullMetaDataVisitor();
- }
-
- public void testFindTraits() {
- Assert.assertNotNull(visitor);
- Assert.assertEquals(false, visitor.stopVisiting());
- }
-
- private class NullMetaDataVisitor extends AbstractMetaDataVisitor{
- //
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractTraitQueryVisitorTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractTraitQueryVisitorTest.java
deleted file mode 100644
index 707de54..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AbstractTraitQueryVisitorTest.java
+++ /dev/null
@@ -1,43 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.AbstractTraitQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-
-public class AbstractTraitQueryVisitorTest extends TestCase {
- private NullTraitQueryVisitor visitor;
- protected void setUp() throws Exception {
- super.setUp();
- visitor = new NullTraitQueryVisitor();
- }
-
- public void testFindTraits() {
- Assert.assertNotNull(visitor);
- Assert.assertEquals(EmptyResultSet.class, visitor.findTraits(null, null).getClass());
- }
-
- private class NullTraitQueryVisitor extends AbstractTraitQueryVisitor{
-
- @Override
- public void visit(Trait trait) {
- //nada
- }
-
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AllDeprecatedMetadataTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AllDeprecatedMetadataTests.java
deleted file mode 100644
index 2889270..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/AllDeprecatedMetadataTests.java
+++ /dev/null
@@ -1,42 +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.common.metadata.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllDeprecatedMetadataTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Tests for org.eclipse.jst.jsf.common.metadata (deprecated)");
- //$JUnit-BEGIN$
- suite.addTestSuite(EmptyResultSetTest.class);
- suite.addTestSuite(MetaDataExceptionTest.class);
- suite.addTestSuite(AbstractMetaDataVisitorTest.class);
- suite.addTestSuite(AbstractEntityQueryVisitorTest.class);
- suite.addTestSuite(AbstractTraitQueryVisitorTest.class);
- suite.addTestSuite(TraitValueHelperTests.class);
- suite.addTestSuite(MetaDataQueryHelperTests.class);
- suite.addTestSuite(ModelProviderAdapterTests.class);
-
- suite.addTestSuite(TraitImplTests.class);
- suite.addTestSuite(IncludeEntityGroupImplTests.class);
- suite.addTestSuite(EntityImplTests.class);
- suite.addTestSuite(ModelImplTests.class);
- suite.addTestSuite(MergeTests.class);
- suite.addTestSuite(TinyTestTests.class);
-
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EmptyResultSetTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EmptyResultSetTest.java
deleted file mode 100644
index 0065d20..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EmptyResultSetTest.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-
-public class EmptyResultSetTest extends TestCase {
- private IResultSet _results;
-
- public void setUp() throws Exception {
- _results = new EmptyResultSet();
- }
-
- public void testCloseAndIsClosed() {
- Assert.assertFalse(_results.isClosed());
- try {
- _results.close();
- Assert.assertTrue(_results.isClosed());
- } catch (MetaDataException e) {
- fail("testCloseAndIsClosed with Exception: "+e.getMessage());
- }
- }
-
- public void testGetResults() {
- try {
- Assert.assertEquals(0, _results.getResults().size());
- } catch (MetaDataException e) {
- fail("testGetResults: should NOT be MetaDataException");
- }
- try {
- _results.close();
- Assert.assertEquals(0, _results.getResults().size());
- fail("testGetResults: should be MetaDataException");
- } catch (MetaDataException e) {
- //test passes
- }
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EntityImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EntityImplTests.java
deleted file mode 100644
index 89bc3c9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/EntityImplTests.java
+++ /dev/null
@@ -1,87 +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.common.metadata.tests;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-public class EntityImplTests extends AbstractBaseMetaDataTestCase {
- protected ITaglibDomainMetaDataModelContext baseContext;
- Model model;
- Entity entity;
- public void setUp() throws Exception {
- super.setUp();
-
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, baseTestUri);
- model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- assertNotNull(model);
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded");
- assertNotNull(entity);
- }
-
- public void testGetChildEntities() {
- //childEntities
- assertNotNull(entity.getChildEntities());
- //should be 1 from eg2, plus 3
- assertEquals(4, entity.getChildEntities().size());
- }
-
- public void testGetTraits() {
- //traits
- assertNotNull(entity.getTraits());
- //should be 1 from eg2, plus 3
- assertEquals(4, entity.getTraits().size());
- }
-
- public void testGetIncludeGroups() {
- //IncludeGroups
- assertNotNull(entity.getIncludeGroups());
- assertEquals(1, entity.getIncludeGroups().size());
- }
-
- public void testGetId() {
- assertNotNull(entity.getId());
- assertEquals("loaded", entity.getId() );
- }
-
- public void testSetId() {
- String id = entity.getId();
- entity.setId("new");
- assertEquals("new",entity.getId());
- entity.setId(id);
- }
-
- public void testGetType() {
- //type
- assertNotNull(entity.getType());
- assertEquals(entity.getType(), TYPE_TAG);
- }
-
- public void testSetType() {
- String type = entity.getType();
- entity.setType("new");
- assertEquals("new",entity.getType());
- entity.setType(type);
- }
-
- public void testAccept() {
-// Query tests excercises this
- }
-
- public void testGetModel() {
- assertNotNull(entity.getModel());
- assertEquals(model, entity.getModel());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/IncludeEntityGroupImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/IncludeEntityGroupImplTests.java
deleted file mode 100644
index 69062d2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/IncludeEntityGroupImplTests.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.common.metadata.tests;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-public class IncludeEntityGroupImplTests extends AbstractBaseMetaDataTestCase {
- protected ITaglibDomainMetaDataModelContext baseContext;
- IncludeEntityGroup group;
-
- public void setUp() throws Exception {
- super.setUp();
-
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, baseTestUri);
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded");
- assertNotNull(entity);
- group = (IncludeEntityGroup)entity.getIncludeGroups().get(0);
- }
- public void testGetId() {
- assertEquals("eg2", group.getId());
- }
-
- public void testSetId() {
- String id = group.getId();
- group.setId("new");
- assertEquals("new",group.getId());
- group.setId(id);
- }
-
- public void testGetModelUri() {
- assertNull(group.getModelUri());
- }
-
- public void testSetModelUri() {
- String uri = null;
- group.setModelUri("new");
- assertEquals("new",group.getModelUri());
- group.setModelUri(uri);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MergeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MergeTests.java
deleted file mode 100644
index b91ed53..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MergeTests.java
+++ /dev/null
@@ -1,202 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-public class MergeTests extends AbstractBaseMetaDataTestCase {
- private boolean _debugInfo = false;
-
- public void testIncludeMerge(){
- showDebugInfo(_debugInfo);
- String uri = "TinyIncludeTest";
- ITaglibDomainMetaDataModelContext modelContext
- = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- startTime(uri);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- endTime();
- assertNotNull(model);
-
- dumpMDTree(model, 0);
-
- //expect 0 model traits and 1 entity
- assertEquals(0, model.getTraits().size());
- assertEquals(1, model.getChildEntities().size());
-
-
- //expect 2 traits on A
- Entity A_Entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "A");
- assertEquals(2, A_Entity.getTraits().size());
- Trait t = TaglibDomainMetaDataQueryHelper.getTrait(A_Entity, "T1");
- assertNotNull(t);
- assertEquals("A1", TraitValueHelper.getValueAsString(t));
- t = TaglibDomainMetaDataQueryHelper.getTrait(A_Entity, "T2");
- assertNotNull(t);
- assertEquals("T2FromEG", TraitValueHelper.getValueAsString(t));
-
- //expect 2 child entities for A
- assertEquals(2, A_Entity.getChildEntities().size());
- Entity a_Entity = TaglibDomainMetaDataQueryHelper.getEntity(A_Entity, "a");
- assertNotNull(a_Entity);
- assertEquals(1, a_Entity.getTraits().size());
- assertEquals(2, a_Entity.getChildEntities().size());
- Entity subA_Entity = TaglibDomainMetaDataQueryHelper.getEntity(A_Entity, "sub-A");
- assertNotNull(subA_Entity);
- Entity subSubA_Entity = TaglibDomainMetaDataQueryHelper.getEntity(subA_Entity, "sub-sub-A");
- assertNotNull(subSubA_Entity);
-
- }
-
-
-
- public void testMergeOfFileAandFileB(){
- showDebugInfo(_debugInfo);
- String uri = "http://org.eclipse.jsf/mergetest1";
- ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- startTime(uri);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- assertNotNull(model);
- endTime();
-
- dumpMDTree(model, 0);
-
- //check model traits -
- assertEquals(3, model.getTraits().size());
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(model, "Dupe");
- assertNotNull(trait);
- assertEquals("dupe from A", TraitValueHelper.getValueAsString(trait));
-
- //check model entities
- assertEquals(5, model.getChildEntities().size());
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "A");
- assertNotNull(entity);
- entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "B");
- assertNotNull(entity);
-
- //check merge of traits within entities
- entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "Dupe");
- assertNotNull(entity);
- assertEquals(2, entity.getTraits().size());
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromA", TraitValueHelper.getValueAsString(trait));
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "B1");
- assertNotNull(trait);
-
- //check merge of entities within entities
- assertEquals(2, entity.getChildEntities().size());
- Entity secondEntity = TaglibDomainMetaDataQueryHelper.getEntity(entity, "a");
- assertNotNull(secondEntity);
- assertEquals(2, secondEntity.getTraits().size());
- trait = TaglibDomainMetaDataQueryHelper.getTrait(secondEntity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromA", TraitValueHelper.getValueAsString(trait));
-
- //check merge of traits with included entities
- entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "DupeWithInclude");
- assertNotNull(entity);
- assertEquals(2, entity.getTraits().size());
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1", TraitValueHelper.getValueAsString(trait));
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "B");
- assertNotNull(trait);
- assertEquals("trait SHOULD appear in merge from eg2", TraitValueHelper.getValueAsString(trait));
-
- //check merge of entities with includes
- assertEquals(2, entity.getChildEntities().size());
- secondEntity = TaglibDomainMetaDataQueryHelper.getEntity(entity, "a");
- assertNotNull(secondEntity);
- //assertEquals(1, secondEntity.getTraits().size());//do not expect 2 as extra trait from include group is not included
- assertEquals(2, secondEntity.getTraits().size());//do NOW expect 2 as extra trait from include group IS included (https://bugs.eclipse.org/bugs/show_bug.cgi?id=191564)
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1", TraitValueHelper.getValueAsString(trait));
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A1");
- assertNotNull(trait);
-
- //check merge of entities with includes where all come from include
- entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "DupeWithInclude2");
- assertNotNull(entity);
- assertEquals(1, entity.getTraits().size());
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromEG1", TraitValueHelper.getValueAsString(trait));
-
- assertEquals(1, entity.getChildEntities().size());
- secondEntity = TaglibDomainMetaDataQueryHelper.getEntity(entity, "a");
- assertNotNull(secondEntity);
- assertEquals(2, secondEntity.getTraits().size());
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromEG1", TraitValueHelper.getValueAsString(trait));
-
- }
-
- /**
- * All entities and traits come from external model in this test
- */
- public void testIncludeExternalModel(){
- showDebugInfo(_debugInfo);
- String uri = "http://org.eclipse.jsf/mergetest2";
- ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- startTime(uri);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- endTime();
- assertNotNull(model);
-
- dumpMDTree(model, 0);
-
- //check model traits
- assertEquals(1, model.getTraits().size());
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(model, "A1");
- assertNotNull(trait);
- assertEquals("A1FromEG1", TraitValueHelper.getValueAsString(trait));
-
- //check model entities
- assertEquals(1, model.getChildEntities().size());
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "a");
- assertNotNull(entity);
- assertEquals(0, entity.getChildEntities().size());
- assertEquals(2, entity.getTraits().size());
- }
-
- public void testLoadJSFCore(){
- showDebugInfo(_debugInfo);
- String uri = "http://java.sun.com/jsf/core";
- ITaglibDomainMetaDataModelContext modelContext =
- TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- startTime(uri);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- endTime();
- assertNotNull(model);
-
-// dumpMDTree(model, 0);
- }
-
- public void testLoadJSFHTML(){
- showDebugInfo(_debugInfo);
- String uri = "http://java.sun.com/jsf/html";
- ITaglibDomainMetaDataModelContext modelContext =
- TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(project, uri);
- startTime(uri);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- endTime();
- assertNotNull(model);
-
-// dumpMDTree(model, 0);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataExceptionTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataExceptionTest.java
deleted file mode 100644
index acd51dc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataExceptionTest.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import java.io.IOException;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-
-public class MetaDataExceptionTest extends TestCase {
-
- public void testMetaDataException() {
- MetaDataException e = new MetaDataException();
- Assert.assertNotNull(e);
- }
-
- public void testMetaDataExceptionString() {
- MetaDataException e = new MetaDataException("Foo");
- Assert.assertNotNull(e);
- Assert.assertEquals("Foo", e.getMessage());
- }
-
- public void testMetaDataExceptionStringThrowable() {
- IOException cause = new IOException("FooBar");
- MetaDataException e = new MetaDataException("Foo", cause );
- Assert.assertNotNull(e);
- Assert.assertEquals(cause, e.getCause());
- Assert.assertNotNull(e.getCause());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataQueryHelperTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataQueryHelperTests.java
deleted file mode 100644
index 64cbaa7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MetaDataQueryHelperTests.java
+++ /dev/null
@@ -1,286 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.ITraitQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.HierarchicalSearchControl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SearchControl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleEntityQueryVisitorImpl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleTraitQueryVisitorImpl;
-
-/**
- * Thoroughly excercises the TaglibDomainMetaDataQueryHelper APIs that will end up touching many of the metadata areas in normal circumstances
- * where there is only a single standard metadata model for a given URI.
- *
- */
-/*******************************************************************************
- * 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 and/or initial documentation
- *******************************************************************************/
-
-@SuppressWarnings("deprecation")
-public class MetaDataQueryHelperTests extends AbstractBaseMetaDataTestCase {
-
- protected ITaglibDomainMetaDataModelContext baseContext;
- protected ITaglibDomainMetaDataModelContext nullProjectContext;
- protected ITaglibDomainMetaDataModelContext negativeContextBadUri;
- protected ITaglibDomainMetaDataModelContext negativeContextBadDomain;
-
- public void setUp() throws Exception {
- super.setUp();
-
- //setup model contexts
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, baseTestUri);
- nullProjectContext = new TaglibDomainMetaDataModelContextImpl(domain, null, baseTestUri);
- negativeContextBadUri = new TaglibDomainMetaDataModelContextImpl(domain, project, "blah");
- negativeContextBadDomain = new TaglibDomainMetaDataModelContextImpl(badDomain, project, baseTestUri);
- }
-
- /**
- * Test getModel method but also performs basic read unit tests on Model
- */
- public void testGetModel() {
- //base
- //positive test
- Model model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- assertNotNull(baseTestUri+" model should not be null.",model);
-
- //null proj
-
- model = TaglibDomainMetaDataQueryHelper.getModel(nullProjectContext);
- assertNotNull(baseTestUri+" model should not be null.",model);
- //id
- assertNotNull(model.getId());
- assertEquals(baseTestUri+" is not same as model.getId()",baseTestUri, model.getId() );
-
-
-
- //negative tests
- model = TaglibDomainMetaDataQueryHelper.getModel(negativeContextBadUri);
- assertNull(model);
-
- model = TaglibDomainMetaDataQueryHelper.getModel(negativeContextBadDomain);
- assertNotNull(model);//will use default strategy to load
- }
-
- public void testGetEntityIMetaDataModelContextString() {
- //positive
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded");
- assertNotNull(entity);
-
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded/att3");
- assertNotNull(entity);
-
- //negative
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "doesnotexist");
- assertNull(entity);
- }
-
- /**
- * Return multiple entities
- * Partially tests SimpleEntityQueryVisitorImpl searchControl
- */
- public void testGetEntitiesIMetaDataModelContextStringIEntityQueryVisitor() {
- IEntityQueryVisitor visitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(1, HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- IResultSet rs = TaglibDomainMetaDataQueryHelper.getEntities(baseContext, "loaded", visitor);
- assertNotNull(rs);
- Entity entity = null;
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(1, rs.getResults().size());
- entity = (Entity)rs.getResults().get(0);
- assertNotNull(entity);
- assertEquals(entity.getId(), "loaded");
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
-
- //test returning multiple (2)
- visitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(SearchControl.COUNT_LIMIT_NONE, HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- rs = TaglibDomainMetaDataQueryHelper.getEntities(baseContext, "loaded", visitor);
- assertNotNull(rs);
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(2, rs.getResults().size());
- entity = (Entity)rs.getResults().get(0);
- assertNotNull(entity);
- assertEquals(entity.getId(), "loaded");
- Entity secondentity = (Entity)rs.getResults().get(1);
- assertNotNull(secondentity);
- assertEquals("loaded", secondentity.getId());
- assertFalse(secondentity == entity);
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
- }
-
- public void testGetTraitEntityString() {
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded/att3");
-
- //positive
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "A3");
- assertNotNull(trait);
-
- //negative
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "Z3");
- assertNull(trait);
- }
-
- /**
- * Return multiple traits
- * Also tests SimpleEntityQueryVisitorImpl and IResultSet
- */
- public void testGetTraits() {
- //TEST with 1 count
- ITraitQueryVisitor visitor = new SimpleTraitQueryVisitorImpl(new SearchControl(1));
- Model model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- IResultSet rs = TaglibDomainMetaDataQueryHelper.getTraits(model, "model-trait", visitor);
- assertNotNull(rs);
- Trait trait = null;
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(1, rs.getResults().size());
- trait = (Trait)rs.getResults().get(0);
- assertNotNull(trait);
- assertEquals("model-trait", trait.getId());
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
-
- //test with COUNT_LIMIT_NONE
- visitor = new SimpleTraitQueryVisitorImpl(new SearchControl(SearchControl.COUNT_LIMIT_NONE));
- rs = TaglibDomainMetaDataQueryHelper.getTraits(model, "model-trait", visitor);
- assertNotNull(rs);
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(2, rs.getResults().size());
- trait = (Trait)rs.getResults().get(0);
- assertNotNull(trait);
- assertEquals("model-trait", trait.getId());
- Trait secondTrait = (Trait)rs.getResults().get(1);
- assertNotNull(secondTrait);
- assertEquals("model-trait", secondTrait.getId());
- assertFalse(trait == secondTrait);
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
-
- }
-
- public void testGetEntityEntityString() {
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded");
- //positive
- entity = TaglibDomainMetaDataQueryHelper.getEntity(entity, "att3");
- assertNotNull(entity);
-
- //negative
- entity = TaglibDomainMetaDataQueryHelper.getEntity(entity, "zzz");
- assertNull(entity);
- }
-
- public void testGetEntitiesEntityStringIEntityQueryVisitor() {
- //negative test
-
- IResultSet rs = TaglibDomainMetaDataQueryHelper.getEntities(negativeContextBadUri, "foo", new SimpleEntityQueryVisitorImpl());
- assertNotNull(rs);
- try {
- assertEquals(0, rs.getResults().size());
- } catch (MetaDataException e) {
- fail(e.getMessage());
- }
- }
-
- public void testGetTraitIMetaDataModelContextStringString() {
- //positive
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(baseContext, "loaded/att3", "A3");
- assertNotNull(trait);
-
- //negative
- trait = TaglibDomainMetaDataQueryHelper.getTrait(baseContext, "loaded/att3", "zzz");
- assertNull(trait);
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(baseContext, "doesnotexist", "A3");
- assertNull(trait);
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(negativeContextBadDomain, "doesnotexist", "A3");
- assertNull(trait);
- }
-
- public void testResultSets() {
- IResultSet rs = TaglibDomainMetaDataQueryHelper.getEntities(baseContext, "loaded", new SimpleEntityQueryVisitorImpl());
- assertNotNull(rs);
- try {
- assertEquals(2, rs.getResults().size());
- assertFalse(rs.isClosed());
- rs.close();
- assertTrue(rs.isClosed());
- } catch (MetaDataException e1) {
- fail(e1.getMessage());
- }
-
- try {
- rs.getResults();
- fail("Expected MetaDataException ");
- } catch (MetaDataException e2) {
- //pass
- }
- }
-
- public void testGetEntityBeyondMDDepth() {
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "loaded/does_not_exist/nor_this");
- assertNull(entity);
- }
-
- public void testGetEntityBadEntityKey() {
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "");
- assertNull(entity);
-
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, null);
- assertNull(entity);
-
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "/");
- assertNull(entity);
-
- }
-
- public void testNullProject() {
- Model model = TaglibDomainMetaDataQueryHelper.getModel(nullProjectContext);
- assertNotNull(model);
- Model model1 = TaglibDomainMetaDataQueryHelper.getModel(nullProjectContext);
- assertEquals(model, model1);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MissingMDExtensionModelTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MissingMDExtensionModelTests.java
deleted file mode 100644
index 1f1dd1c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MissingMDExtensionModelTests.java
+++ /dev/null
@@ -1,122 +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.metadata.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-/**
- * Tests loading of models when an emf model extension is missing.
- * <p/>
- * Expected behavior is for model to load all entities and traits even if extension model is not
- * loaded. The trait values will be missing where the trait value model is missing.
- * In these cases, an error should be logged to the JSFCommonPlugin.
- * <p>
- *
- * <p/>
- * Note: if xsi:type prefix is bad, or no uri to model was provided, then model will NOT load.
- * This JUnit does not test for the model not loading in this case.
- *
- */
-public class MissingMDExtensionModelTests extends AbstractBaseMetaDataTestCase {
- protected ITaglibDomainMetaDataModelContext baseContext;
- Model model;
- Trait trait;
-
- public void setUp() throws Exception {
- super.setUp();
- String uri = "http://org.eclipse.jsf/missingMDModelTest";
-
- LogListener logListener = new LogListener();
- try {
-
- JSFCommonPlugin.getPlugin().getLog().addLogListener(logListener);
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, uri);
- model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- assertNotNull(model);
- if (JSFCommonPlugin.getPlugin().isDebugging() &&
- Boolean.valueOf(Platform.getDebugOption(JSFCommonPlugin.PLUGIN_ID+"/debug/metadataload")).booleanValue()){
- //assert log entries
- assertTrue(logListener.getMessages().size() > 2);
- }
- } finally {
- JSFCommonPlugin.getPlugin().getLog().removeLogListener(logListener);
- }
- }
-
- public void testModelLoadWithMissingECoreExtensionModel() {
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "Tag/Attr1");
- assertNotNull(entity);
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "attribute-value-runtime-type");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertEquals("org.eclipse.jst.jsf.core.attributevalues.StringType", TraitValueHelper.getValueAsString(trait));
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "bogusTrait");
- //trait ain't bogus, but value will be
- assertNotNull(trait);
- //value should be null
- assertNull(trait.getValue());
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "reallybogusTrait");
- //trait ain't bogus, but value will be
- assertNotNull(trait);
- //value should be null
- assertNull(trait.getValue());
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "valid-values");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
-
-
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "Tag/DefaultAttr");
- assertNotNull(entity);
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "attribute-value-runtime-type");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertEquals("org.eclipse.jst.jsf.core.attributevalues.StringType", TraitValueHelper.getValueAsString(trait));
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "bogusTrait");
- //trait ain't bogus, but value will be
- assertNotNull(trait);
- //value should be null
- assertNull(trait.getValue());
- }
-
- class LogListener implements ILogListener {
-
- private List<IStatus> statusMsgs;
- public LogListener(){
- this.statusMsgs = new ArrayList<IStatus>();
- }
- public void logging(IStatus status, String plugin) {
- statusMsgs.add(status);
- }
-
- public List<IStatus> getMessages(){
- return statusMsgs;
- }
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelImplTests.java
deleted file mode 100644
index 4273b74..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelImplTests.java
+++ /dev/null
@@ -1,115 +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.common.metadata.tests;
-
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-public class ModelImplTests extends AbstractBaseMetaDataTestCase {
- protected ITaglibDomainMetaDataModelContext baseContext;
- Model model;
- public void setUp() throws Exception {
- super.setUp();
-
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, baseTestUri);
- model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- assertNotNull(model);
- }
- public void testAccept() {
-// fail("Not yet implemented");
- }
-
- public void testGetModel() {
- assertNotNull(model.getModel());
- assertEquals(model.getModel(), model);
- assertEquals(baseTestUri, model.getId());
- }
-
- public void testGetSourceModelProvider() {
- //getSourceModelProvider
- assertNotNull(model.getSourceModelProvider());
- assertTrue(model.getSourceModelProvider() instanceof IMetaDataSourceModelProvider);
- }
-
- public void testSetSourceModelProvider() {
-// fail("Not yet implemented");
- }
-
- public void testGetCurrentModelContext() {
- //context
- assertNotNull(model.getCurrentModelContext());
- assertEquals(model.getCurrentModelContext().getProject(), project);
- assertEquals(model.getCurrentModelContext().getDomain(), domain);
- assertEquals(model.getCurrentModelContext().getUri(), baseTestUri);
- }
-
- public void testSetCurrentModelContext() {
-// fail("Not yet implemented");
- }
-
- public void testGetEntityGroups() {
- //EntityGroups
- assertNotNull(model.getEntityGroups());
- assertEquals(2, model.getEntityGroups().size());
- }
-
- public void testFindIncludeGroup() {
- assertNotNull(model.findIncludeGroup("eg1"));
- }
-
- public void testGetChildEntities() {
- //childEntities
- assertNotNull(model.getChildEntities());
- assertEquals(6, model.getChildEntities().size());
- }
-
- public void testGetTraits() {
- //traits
- assertNotNull(model.getTraits());
- assertEquals(2, model.getTraits().size());
- }
-
- public void testGetIncludeGroups() {
- //IncludeGroups
- assertNotNull(model.getIncludeGroups());
- assertEquals(0, model.getIncludeGroups().size());
- }
-
- public void testGetId() {
- //id
- assertNotNull(model.getId());
- assertEquals(baseTestUri+" is not same as model.getId()",baseTestUri, model.getId() );
- }
-
- public void testSetId() {
- String id = model.getId();
- model.setId("newid");
- assertEquals("newid",model.getId());
- model.setId(id);
- }
-
- public void testGetType() {
- //type
- assertNotNull(model.getType());
- assertEquals(model.getType(), TYPE_TAG_FILE);
- }
-
- public void testSetType() {
- String type = model.getType();
- model.setType("newid");
- assertEquals("newid",model.getType());
- model.setType(type);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelProviderAdapterTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelProviderAdapterTests.java
deleted file mode 100644
index 09b9bb6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/ModelProviderAdapterTests.java
+++ /dev/null
@@ -1,97 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import java.util.ResourceBundle;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IClassLoaderProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IImageDescriptorProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IResourceBundleProvider;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.swt.graphics.Image;
-
-public class ModelProviderAdapterTests extends TestCase {
- private final String JSF_HTML_URI = "http://java.sun.com/jsf/html";
- private final String IMAGES_BASE = "/icons/palette/JSFHTML/small/";
-
- private Trait _trait;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- ITaglibDomainMetaDataModelContext context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(null, JSF_HTML_URI);
- Model model = TaglibDomainMetaDataQueryHelper.getModel(context);
- assertNotNull(model);
- //get the trait that was defined by the "palette" md file. This will establish the correct sourceModelProvider.
- _trait = TaglibDomainMetaDataQueryHelper.getTrait(model, "display-label");
- assertNotNull(_trait);
- }
-
- public void testImageDescriptorProvider() {
-
- IImageDescriptorProvider imageProvider = (IImageDescriptorProvider)_trait.getSourceModelProvider().getAdapter(IImageDescriptorProvider.class);
- assertNotNull(imageProvider);
- ImageDescriptor id = imageProvider.getImageDescriptor(IMAGES_BASE+"JSF_COMMANDBUTTON");
- assertNotNull(id);
- Image image = id.createImage();
- assertNotNull(image);
- image.dispose();
-
- }
-
-//Comment out till resourceBundleHelper issues on Linux is resolved: https://bugs.eclipse.org/bugs/show_bug.cgi?id=202537
- public void testResourceBundlerProvider() {
-
- IResourceBundleProvider bundleProvider = (IResourceBundleProvider)_trait.getSourceModelProvider().getAdapter(IResourceBundleProvider.class);
- assertNotNull(bundleProvider);
-
- ResourceBundle bundle = bundleProvider.getResourceBundle();
- assertNotNull(bundle);
-
- assertNotNull(bundle.getString("JSFHTML.display-label"));
- assertEquals("JSF HTML", bundle.getString("JSFHTML.display-label"));
- assertNotNull(bundle.getString("column.display-label"));
- assertEquals("Column", bundle.getString("column.display-label"));
-
- //
- ITaglibDomainMetaDataModelContext context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(null, "RootOfPluginTest");
- Model model = TaglibDomainMetaDataQueryHelper.getModel(context);
- assertNotNull(model);
- _trait = TaglibDomainMetaDataQueryHelper.getTrait(model, "T1");
- assertNotNull(_trait);
- bundleProvider = (IResourceBundleProvider)_trait.getSourceModelProvider().getAdapter(IResourceBundleProvider.class);
- assertNotNull(bundleProvider);
- bundle = bundleProvider.getResourceBundle();
- assertNotNull(bundle.getString("NLS"));
- assertEquals("This is externalized text", bundle.getString("NLS"));
- }
-
- @SuppressWarnings({ })
- public void testClassloaderProvider() {
-
- IClassLoaderProvider classLoaderProvider = (IClassLoaderProvider)_trait.getSourceModelProvider().getAdapter(IClassLoaderProvider.class);
- assertNotNull(classLoaderProvider);
- Class<?> klass = classLoaderProvider.loadClass("java.lang.String");
- assertNotNull(klass);
-
- // when all MD was moved from WPE to tagsupport plugin, there was no longer a plugin specific class to load here. FIX ME later.
-// klass = classLoaderProvider.loadClass("org.eclipse.jst.pagedesigner.jsf.ui.util.JSFUIPluginResourcesUtil");
-// assertNotNull(klass);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MyMDLocator.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MyMDLocator.java
deleted file mode 100644
index cb701d0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/MyMDLocator.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.jst.jsf.common.metadata.internal.PluginRelativeStandardMetaDataSourceFileLocator;
-
-/**
- * Simple class extending PluginRelativeStandardMetaDataSourceFileLocator to test locator extension on ext-pt.
- *
- */
-public class MyMDLocator extends PluginRelativeStandardMetaDataSourceFileLocator {
- public MyMDLocator(){
- super();
- }
-
- @Override
- public InputStream getInputStream() throws IOException {
- this.getFileInfo().toString();//doing this just to get code coverage
- return super.getInputStream();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TinyTestTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TinyTestTests.java
deleted file mode 100644
index 8145684..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TinyTestTests.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.common.metadata.tests;
-
-import org.eclipse.emf.ecore.xml.type.AnyType;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-public class TinyTestTests extends AbstractBaseMetaDataTestCase {
- protected ITaglibDomainMetaDataModelContext baseContext;
- Model model;
- Trait trait;
-
- public void setUp() throws Exception {
- super.setUp();
- String uri = "http://org.eclipse.jsf/tinytest";
-
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, uri);
- model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- assertNotNull(model);
- }
-
- public void testGetValue() {
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "A/copy1");
- assertNotNull(entity);
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "model-trait");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof AnyType);
- assertEquals("ATrait", TraitValueHelper.getValueAsString(trait));
-
- entity = TaglibDomainMetaDataQueryHelper.getEntity(baseContext, "B/copy1");
- assertNotNull(entity);
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "model-trait");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof AnyType);
- assertEquals("ATrait", TraitValueHelper.getValueAsString(trait));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitImplTests.java
deleted file mode 100644
index a07b8f8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitImplTests.java
+++ /dev/null
@@ -1,72 +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.common.metadata.tests;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-public class TraitImplTests extends AbstractBaseMetaDataTestCase {
- protected ITaglibDomainMetaDataModelContext baseContext;
- Model model;
- Trait trait;
-
- public void setUp() throws Exception {
- super.setUp();
-
- baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, baseTestUri);
- model = TaglibDomainMetaDataQueryHelper.getModel(baseContext);
- assertNotNull(model);
- trait = TaglibDomainMetaDataQueryHelper.getTrait(baseContext, "loaded", "A");
- assertNotNull(trait);
- }
-
- public void testGetValue() {
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof EObject);
- assertEquals("a", TraitValueHelper.getValueAsString(trait));
- }
-
- public void testSetValue() {
-// fail("Not yet implemented");
- }
-
- public void testGetSourceModel() {
- assertNotNull(trait.getSourceModelProvider());
- assertTrue(trait.getSourceModelProvider().getSourceModel() instanceof Model);
- }
-
- public void testSetSourceModel() {
-// Set during model load. no need to test.
- }
-
- public void testGetId() {
- //id
- assertNotNull(trait.getId());
- assertEquals("A", trait.getId() );
- }
-
- public void testSetId() {
- String id = trait.getId();
- trait.setId("new");
- assertEquals("new",trait.getId());
- trait.setId(id);
- }
-
- public void testAccept() {
-// Excercised by Query tests
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitValueHelperTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitValueHelperTests.java
deleted file mode 100644
index e407dd3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/TraitValueHelperTests.java
+++ /dev/null
@@ -1,265 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.tests;
-
-import java.util.List;
-import java.util.Locale;
-
-import junit.framework.Assert;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase;
-
-public class TraitValueHelperTests extends ConfigurableTestCase {
- private final String uri = "http://org.eclipse.jsf/traithelpertest";
- private Entity entity;
- private Entity nlsEntity;
-
- public TraitValueHelperTests(){
- super();
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- ITaglibDomainMetaDataModelContext context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(null, uri);
- entity = TaglibDomainMetaDataQueryHelper.getEntity(context, "tag/attr1");
- Assert.assertNotNull(entity);
-
- nlsEntity = TaglibDomainMetaDataQueryHelper.getEntity(context, "NLS/NLS");
- Assert.assertNotNull(nlsEntity);
- }
-
- public void testGetValueType() {
- //singleString
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "singleString");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AnyType", TraitValueHelper.getValueType(trait).getName());
-
- //anInteger
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "anInteger");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AnyType", TraitValueHelper.getValueType(trait).getName());
-
- //multivalStrings
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "multivalStrings");
- Assert.assertNotNull(trait);
- Assert.assertEquals("ListOfValues", TraitValueHelper.getValueType(trait).getName());
-
- //multivalIntegers
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "multivalIntegers");
- Assert.assertNotNull(trait);
- Assert.assertEquals("ListOfValues", TraitValueHelper.getValueType(trait).getName());
-
- //null tests
- Assert.assertNull( TraitValueHelper.getValueType(null));
- EObject val = trait.getValue();
- trait.setValue(null);
- Assert.assertNull( TraitValueHelper.getValueType(trait));
- trait.setValue(val);
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AnyType", TraitValueHelper.getValueType(trait).getName());
- }
-
- public void testGetValue() {
- //singleString
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "singleString");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AString", (String)TraitValueHelper.getValue(trait));
-
- //anInteger
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "anInteger");
- Assert.assertNotNull(trait);
- Assert.assertEquals(1, Integer.parseInt((String)TraitValueHelper.getValue(trait)));
-
- //aTrueInt
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "aTrueInt");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertTrue(trait.getValue() instanceof SimpleAnyType);
- Assert.assertTrue(((SimpleAnyType)trait.getValue()).getInstanceType().getInstanceClassName().equals("int"));
- Assert.assertEquals("1", TraitValueHelper.getValue(trait));
-
- //null tests
- Assert.assertNull( TraitValueHelper.getValue(null));
- EObject val = trait.getValue();
- trait.setValue(null);
- Assert.assertNull( TraitValueHelper.getValue(trait));
- //reset
- trait.setValue(val);
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertNull(TraitValueHelper.getValue(trait));
- }
-
- public void testGetValueAsString() {
- //singleString
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "singleString");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AString", TraitValueHelper.getValueAsString(trait));
-
- //anInteger
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "anInteger");
- Assert.assertNotNull(trait);
- Assert.assertEquals("1", TraitValueHelper.getValueAsString(trait));
-
-
- //null tests
- Assert.assertNull( TraitValueHelper.getValue(null));
- EObject val = trait.getValue();
- trait.setValue(null);
- Assert.assertNull( TraitValueHelper.getValue(trait));
- trait.setValue(val);
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertEquals(null, TraitValueHelper.getValueAsString(trait));
- }
-
- public void testGetValueAsListOfStrings() {
- //multivalStrings
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "multivalStrings");
- Assert.assertNotNull(trait);
- Assert.assertTrue(TraitValueHelper.getValueAsListOfStrings(trait) instanceof List<?>);
- List<?> vals = TraitValueHelper.getValueAsListOfStrings(trait);
- Assert.assertEquals(3, vals.size());
- Assert.assertTrue(vals.get(0) instanceof String);
- Assert.assertEquals("A", (String)vals.get(0));
- Assert.assertEquals("B", (String)vals.get(1));
- Assert.assertEquals("C", (String)vals.get(2));
-
- //multivalIntegers
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "multivalIntegers");
- Assert.assertNotNull(trait);
- Assert.assertTrue(TraitValueHelper.getValueAsListOfStrings(trait) instanceof List<?>);
- vals = TraitValueHelper.getValueAsListOfStrings(trait);
- Assert.assertEquals(3, vals.size());
- Assert.assertTrue(vals.get(0) instanceof String);
- Assert.assertEquals("1", (String)vals.get(0));
- Assert.assertEquals("2", (String)vals.get(1));
- Assert.assertEquals("3", (String)vals.get(2));
- }
-
- public void testGetNLSValue() {
- //single NLS String
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(nlsEntity, "NLS");
- Assert.assertNotNull(trait);
- Assert.assertEquals("%NLS1", TraitValueHelper.getValue(trait));
- if (Locale.getDefault().getCountry().equalsIgnoreCase("us") &&
- Locale.getDefault().getLanguage().equalsIgnoreCase("en")) {
- Assert.assertEquals("a day in the life(en_US)", TraitValueHelper.getValueAsString(trait));
- }
-
- //multiple NLS Strings
- trait = TaglibDomainMetaDataQueryHelper.getTrait(nlsEntity, "multivalNLS");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertTrue(trait.getValue() instanceof ListOfValues);
- List<?> vals = TraitValueHelper.getValueAsListOfStrings(trait);
- Assert.assertEquals(2, vals.size());
- if (Locale.getDefault().getCountry().equalsIgnoreCase("us") &&
- Locale.getDefault().getLanguage().equalsIgnoreCase("en")) {
- Assert.assertEquals("a day in the life(en_US)", vals.get(0));
- Assert.assertEquals("another string(en_US)", vals.get(1));
- }
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertEquals(null, TraitValueHelper.getValueAsString(trait));
- }
-
- public void testGetValueAsBoolean() {
- //valid true
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "BooleanVal");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertEquals(true, TraitValueHelper.getValueAsBoolean(trait));
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "NullBooleanVal");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertEquals(false, TraitValueHelper.getValueAsBoolean(trait));
- }
-
- public void testStringValueType() {
- final ITaglibDomainMetaDataModelContext context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(null, uri);
- final Model m = TaglibDomainMetaDataQueryHelper.getModel(context);
- assertNotNull(m);
-
- final Trait t = TaglibDomainMetaDataQueryHelper.getTrait( m, "TraitId");
- assertNotNull(t);
-
- final EObject obj = (EObject)t.getValue();
- assertEquals("StringValue", obj.eClass().getName());
- assertEquals("TraitValue", TraitValueHelper.getValueAsString(t));
-
- }
-
- public void testBooleanValueType() {
- final ITaglibDomainMetaDataModelContext context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(null, uri);
- final Model m = TaglibDomainMetaDataQueryHelper.getModel(context);
- assertNotNull(m);
-
- //true
- final Trait t2 = TaglibDomainMetaDataQueryHelper.getTrait( m, "TraitId2");
- assertNotNull(t2);
-
- final EObject obj2 = (EObject)t2.getValue();
- assertEquals("BooleanValue", obj2.eClass().getName());
- assertEquals(true, TraitValueHelper.getValueAsBoolean(t2));
- assertEquals("true", TraitValueHelper.getValueAsString(t2));
-
- //false
- final Trait t3 = TaglibDomainMetaDataQueryHelper.getTrait( m, "TraitId3");
- assertNotNull(t3);
-
- final EObject obj3 = (EObject)t3.getValue();
- assertEquals("BooleanValue", obj3.eClass().getName());
- assertEquals(false, TraitValueHelper.getValueAsBoolean(t3));
-
- }
-
-// @SuppressWarnings("restriction")
-// public void testGetValueInstanceClassName() {
-// Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "singleString");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("java.lang.String", TraitValueHelper.getValueInstanceClassName(trait));
-//
-// trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "anInteger");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("java.lang.String", TraitValueHelper.getValueInstanceClassName(trait));
-//
-// trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "aTrueInt");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("int", TraitValueHelper.getValueInstanceClassName(trait));
-//
-// trait = TaglibDomainMetaDataQueryHelper.getTrait(entity, "multivalStrings");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl", TraitValueHelper.getValueInstanceClassName(trait));
-//
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractBaseMetaDataTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractBaseMetaDataTestCase.java
deleted file mode 100644
index 8fc0762..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractBaseMetaDataTestCase.java
+++ /dev/null
@@ -1,170 +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.common.metadata.tests.updated;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-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.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-public abstract class AbstractBaseMetaDataTestCase extends TestCase {
- protected static final String projName = "TestCommonMetadataProject";
- protected static final String domain = "TagLibraryDomain";
- protected static final String badDomain = "TagLibDomain";
- protected static final String baseTestUri = "http://org.eclipse.jsf/test";
-
- protected static final String TYPE_TAG_FILE = "tagFile";
- protected static final String TYPE_TAG = "tag";
- protected static final String TYPE_TAG_ATTRIBUTE = "attribute";
-
- protected IProject project;
- protected WebProjectTestEnvironment projectTestEnvironment;
- protected IStructuredDocumentContext docContext;
-
- private boolean debug_info = false;
- private long startTime;
- private String debugTitle;
-
- public void setUp() throws Exception {
- String path = "/WebContent/TestJSP.jsp";
- int offset = 33;// # not important to tests
-
-// MockWorkspaceContext context = new MockWorkspaceContext();
-// project = context.createProject("TestCommonMetadataProject"+"_"+getName());
-// IFolder folder = project.getFolder("/WebContent");
-// MockResource webContentFolder = context.getResource(folder.getFullPath());
-// assertNotNull(webContentFolder);
-// IFile myJsp = project.getFile(path);
-// URL url = FileLocator.find(MetadataTestsPlugin.getDefault().getBundle(), new Path("/testfiles/metadata/TestJSP.jsp"), null);
-// URL fileUrl = FileLocator.toFileURL(url);
-// File file = new File(fileUrl.toURI());
-//// File file = new File(MetadataTestsPlugin.getDefault().getBundle().getLocation()+ "/testfiles/metadata/TestJSP.jsp");
-// if (file.exists())
-// myJsp.setContents(new FileInputStream(file), 0, null);
-
-
- super.setUp();
-
- debug_info = false;
-
- JSFTestUtil.setInternetProxyPreferences(true, "www-proxy.us.oracle.com", "80");
-
- JSFTestUtil.setValidationEnabled(false);
-
- projectTestEnvironment =
- new WebProjectTestEnvironment(projName/*+"_"+getClass().getName()+"_"+getName()*/);
- projectTestEnvironment.createProject(true);
-
- project = projectTestEnvironment.getTestProject();
-
- projectTestEnvironment.loadResourceInWebRoot(MetadataTestsPlugin.getDefault().getBundle(),
- "/testfiles/metadata/TestJSP.jsp",
- "/TestJSP.jsp");
-
-
-
- docContext = getDocContext(path, offset);
-
-
- }
-
-
- private IStructuredDocumentContext getDocContext(String path, int offset) throws Exception{
- IFile jspFile = project.getFile(new Path(path));
- assertTrue(jspFile.exists());
-
- final IModelManager modelManager = StructuredModelManager
- .getModelManager();
-
- IStructuredModel model = null;
-
- model = modelManager.getModelForRead(jspFile);
- assertTrue(model instanceof DOMModelForJSP);
-
- return IStructuredDocumentContextFactory.INSTANCE.getContext(
- model.getStructuredDocument(), offset);
-
- }
-
- protected void showDebugInfo(boolean show){
- debug_info = show;
- }
-
- protected void dumpMDTree(Entity entity, int indent) {
- if (debug_info){
- printLine("Entity: "+entity.getId(),indent);
- indent++;
- for(Iterator<?> it=entity.getTraits().iterator();it.hasNext();){
- Trait t = (Trait)it.next();
- printLine("Trait: "+t.getId()+"["+ getValue(t)+ "]", indent);
- }
- for (Iterator<?> it=entity.getChildEntities().iterator();it.hasNext();){
- dumpMDTree((Entity)it.next(), indent);
- }
- }
- }
-
- private String getValue(Trait trait) {
- if (trait.getValue() instanceof ListOfValues){
- List<?> l = TraitValueHelper.getValueAsListOfStrings(trait);
- StringBuffer buf = new StringBuffer();
- for (Iterator<?> it=l.iterator();it.hasNext();){
- buf.append((String)it.next());
- buf.append(", ");
- }
- if (buf.toString().length() > 0)
- return buf.toString().substring(0, buf.toString().length() - 2);
- return null;
- }
- return TraitValueHelper.getValueAsString(trait);
- }
-
- private void printLine(String line, int indent) {
- StringBuffer buf = new StringBuffer();
- for (int i=0;i<indent;i++){
- buf.append(" ");
- }
- buf.append(line);
- System.out.println(buf.toString());
- }
-
- protected void endTime() {
- if (debug_info){
- long delta = System.nanoTime() - startTime;
- printLine("Time for "+debugTitle+"(ms)= "+String.valueOf(delta/1000000), 0);
- }
- }
-
- protected void startTime(String debugTitle) {
- if (debug_info){
- this.debugTitle = debugTitle;
- startTime = System.nanoTime();
- printLine("",0);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractEntityQueryVisitorTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractEntityQueryVisitorTests.java
deleted file mode 100644
index 3709eef..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractEntityQueryVisitorTests.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.query.AbstractEntityQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-
-public class AbstractEntityQueryVisitorTests extends TestCase {
- private NullEntityQueryVisitor visitor;
- protected void setUp() throws Exception {
- super.setUp();
- visitor = new NullEntityQueryVisitor();
- }
-
- public void testFindEntities() {
- Assert.assertNotNull(visitor);
- Assert.assertEquals(EmptyResultSet.class, visitor.findEntities(null, null).getClass());
- }
-
- private class NullEntityQueryVisitor extends AbstractEntityQueryVisitor{
-
- @Override
- public void visit(Entity entity) {
- // nada
- }
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractMetaDataVisitorTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractMetaDataVisitorTests.java
deleted file mode 100644
index 7d06cc0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractMetaDataVisitorTests.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.query.AbstractMetaDataVisitor;
-
-public class AbstractMetaDataVisitorTests extends TestCase {
- private NullMetaDataVisitor visitor;
- protected void setUp() throws Exception {
- super.setUp();
- visitor = new NullMetaDataVisitor();
- }
-
- public void testFindTraits() {
- Assert.assertNotNull(visitor);
- Assert.assertEquals(false, visitor.stopVisiting());
- }
-
- private class NullMetaDataVisitor extends AbstractMetaDataVisitor{
- //
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractTraitQueryVisitorTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractTraitQueryVisitorTests.java
deleted file mode 100644
index 3c4595d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AbstractTraitQueryVisitorTests.java
+++ /dev/null
@@ -1,43 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.AbstractTraitQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-
-public class AbstractTraitQueryVisitorTests extends TestCase {
- private NullTraitQueryVisitor visitor;
- protected void setUp() throws Exception {
- super.setUp();
- visitor = new NullTraitQueryVisitor();
- }
-
- public void testFindTraits() {
- Assert.assertNotNull(visitor);
- Assert.assertEquals(EmptyResultSet.class, visitor.findTraits(null, null).getClass());
- }
-
- private class NullTraitQueryVisitor extends AbstractTraitQueryVisitor{
-
- @Override
- public void visit(Trait trait) {
- //nada
- }
-
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AllUpdatedMetadataTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AllUpdatedMetadataTests.java
deleted file mode 100644
index 7e8b2ae..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/AllUpdatedMetadataTests.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.common.metadata.tests.updated;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllUpdatedMetadataTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for updated org.eclipse.jst.jsf.common.metadata.tests");
- //$JUnit-BEGIN$
- //model
- suite.addTestSuite(ModelImplTests.class);
- suite.addTestSuite(EntityImplTests.class);
- suite.addTestSuite(TraitImplTests.class);
- suite.addTestSuite(IncludeEntityGroupImplTests.class);
-
- suite.addTestSuite(MergeTests.class);
- suite.addTestSuite(TinyTestTests.class);
-
- suite.addTestSuite(MetaDataModelManagerFactoryTests.class);
- suite.addTestSuite(ModelProviderAdapterTests.class);
-
- //query
- suite.addTestSuite(EmptyResultSetTests.class);
- suite.addTestSuite(MetaDataExceptionTests.class);
- suite.addTestSuite(AbstractMetaDataVisitorTests.class);
- suite.addTestSuite(AbstractEntityQueryVisitorTests.class);
- suite.addTestSuite(AbstractTraitQueryVisitorTests.class);
- suite.addTestSuite(TraitValueHelperTests.class);
- suite.addTestSuite(MetaDataQueryFactoryTests.class);
- suite.addTestSuite(MetaDataQueryContextFactoryTests.class);
- suite.addTestSuite(MetaDataQueryHelperTests.class);
-
- suite.addTestSuite(MissingMDExtensionModelTests.class);
-
- //taglib query
- suite.addTestSuite(TaglibMetaDataQueryTests.class);
-
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EmptyResultSetTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EmptyResultSetTests.java
deleted file mode 100644
index a15e2cd..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EmptyResultSetTests.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-
-public class EmptyResultSetTests extends TestCase {
- private IResultSet _results;
-
- public void setUp() throws Exception {
- _results = new EmptyResultSet();
- }
-
- public void testCloseAndIsClosed() {
- Assert.assertFalse(_results.isClosed());
- try {
- _results.close();
- Assert.assertTrue(_results.isClosed());
- } catch (MetaDataException e) {
- fail("testCloseAndIsClosed with Exception: "+e.getMessage());
- }
- }
-
- public void testGetResults() {
- try {
- Assert.assertEquals(0, _results.getResults().size());
- } catch (MetaDataException e) {
- fail("testGetResults: should NOT be MetaDataException");
- }
- try {
- _results.close();
- Assert.assertEquals(0, _results.getResults().size());
- fail("testGetResults: should be MetaDataException");
- } catch (MetaDataException e) {
- //test passes
- }
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EntityImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EntityImplTests.java
deleted file mode 100644
index 01d3ceb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/EntityImplTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.common.metadata.tests.updated;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-
-public class EntityImplTests extends AbstractBaseMetaDataTestCase {
- protected IMetaDataModelContext baseContext;
- Model model;
- Entity entity;
-
- public void setUp() throws Exception {
- super.setUp();
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- model = query.findTagLibraryModel(baseTestUri);
- assertNotNull(model);
- entity = query.findTagEntity(model, "loaded");
- assertNotNull(entity);
- }
-
- public void testGetChildEntities() {
- //childEntities
- assertNotNull(entity.getChildEntities());
- //should be 1 from eg2, plus 3
- assertEquals(4, entity.getChildEntities().size());
- }
-
- public void testGetTraits() {
- //traits
- assertNotNull(entity.getTraits());
- //should be 1 from eg2, plus 3
- assertEquals(4, entity.getTraits().size());
- }
-
- public void testGetIncludeGroups() {
- //IncludeGroups
- assertNotNull(entity.getIncludeGroups());
- assertEquals(1, entity.getIncludeGroups().size());
- }
-
- public void testGetId() {
- assertNotNull(entity.getId());
- assertEquals("loaded", entity.getId() );
- }
-
- public void testSetId() {
- String id = entity.getId();
- entity.setId("new");
- assertEquals("new",entity.getId());
- entity.setId(id);
- }
-
- public void testGetType() {
- //type
- assertNotNull(entity.getType());
- assertEquals(entity.getType(), TYPE_TAG);
- }
-
- public void testSetType() {
- String type = entity.getType();
- entity.setType("new");
- assertEquals("new",entity.getType());
- entity.setType(type);
- }
-
- public void testAccept() {
-// Query tests excercises this
- }
-
- public void testGetModel() {
- assertNotNull(entity.getModel());
- assertEquals(model, entity.getModel());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/FakeDomainQueryFactory.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/FakeDomainQueryFactory.java
deleted file mode 100644
index f6bb280..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/FakeDomainQueryFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.internal.AbstractMetaDataDomainQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.AbstractMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IEntityPredicateMatcher;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.ITraitPredicateMatcher;
-
-public class FakeDomainQueryFactory extends AbstractMetaDataDomainQueryFactory {
-
- public static final String FAKE_MD_DOMAIN = "MyFakeDomain";
-
- public FakeDomainQueryFactory() {
- super(FAKE_MD_DOMAIN);
- }
-
- public IMetaDataQuery createQuery(IMetaDataDomainContext context) {
- return new AbstractMetaDataQuery(null, context) {
-
- public IResultSet<Entity> findEntities(
- IEntityPredicateMatcher entityMatcher) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IResultSet<Trait> findTraits(
- IEntityPredicateMatcher entityMatcher,
- ITraitPredicateMatcher traitMatcher)
- {
- // TODO Auto-generated method stub
- return null;
- }
- };
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/IncludeEntityGroupImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/IncludeEntityGroupImplTests.java
deleted file mode 100644
index 877d5eb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/IncludeEntityGroupImplTests.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.common.metadata.tests.updated;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-
-public class IncludeEntityGroupImplTests extends AbstractBaseMetaDataTestCase {
- IncludeEntityGroup group;
-
- public void setUp() throws Exception {
- super.setUp();
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(baseTestUri);
- assertNotNull(model);
- Entity entity = query.findTagEntity(model, "loaded");
- assertNotNull(entity);
- group = (IncludeEntityGroup)entity.getIncludeGroups().get(0);
- }
- public void testGetId() {
- assertEquals("eg2", group.getId());
- }
-
- public void testSetId() {
- String id = group.getId();
- group.setId("new");
- assertEquals("new",group.getId());
- group.setId(id);
- }
-
- public void testGetModelUri() {
- assertNull(group.getModelUri());
- }
-
- public void testSetModelUri() {
- String uri = null;
- group.setModelUri("new");
- assertEquals("new",group.getModelUri());
- group.setModelUri(uri);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MergeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MergeTests.java
deleted file mode 100644
index 61c8e26..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MergeTests.java
+++ /dev/null
@@ -1,207 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-
-public class MergeTests extends AbstractBaseMetaDataTestCase {
- private boolean _debugInfo = false;
-
- public void testIncludeMerge(){
- showDebugInfo(_debugInfo);
- String uri = "TinyIncludeTest";
- startTime(uri);
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(uri);
- endTime();
- assertNotNull(model);
-
- dumpMDTree(model, 0);
-
- //expect 0 model traits and 1 entity
- assertEquals(0, model.getTraits().size());
- assertEquals(1, model.getChildEntities().size());
-
-
- //expect 2 traits on A
- Entity A_Entity = query.findTagEntity(model, "A");
- assertEquals(2, A_Entity.getTraits().size());
- Trait t = query.findTrait(A_Entity, "T1");
- assertNotNull(t);
- assertEquals("A1", TraitValueHelper.getValueAsString(t));
- t = query.findTrait(A_Entity, "T2");
- assertNotNull(t);
- assertEquals("T2FromEG", TraitValueHelper.getValueAsString(t));
-
- //expect 2 child entities for A
- assertEquals(2, A_Entity.getChildEntities().size());
- Entity a_Entity = query.findTagAttributeEntity(A_Entity, "a");
- assertNotNull(a_Entity);
- assertEquals(1, a_Entity.getTraits().size());
- assertEquals(2, a_Entity.getChildEntities().size());
- Entity subA_Entity = query.getQueryHelper().getEntity(A_Entity, "sub-A");
- assertNotNull(subA_Entity);
- Entity subSubA_Entity = query.getQueryHelper().getEntity(subA_Entity, "sub-sub-A");
- assertNotNull(subSubA_Entity);
-
- }
-
-
-
- public void testMergeOfFileAandFileB(){
- showDebugInfo(_debugInfo);
- String uri = "http://org.eclipse.jsf/mergetest1";
- startTime(uri);
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(uri);
- assertNotNull(model);
- endTime();
-
- dumpMDTree(model, 0);
-
- //check model traits -
- assertEquals(3, model.getTraits().size());
- Trait trait = query.findTrait(model, "Dupe");
- assertNotNull(trait);
- assertEquals("dupe from A", TraitValueHelper.getValueAsString(trait));
-
- //check model entities
- assertEquals(5, model.getChildEntities().size());
- Entity entity = query.findTagEntity(model, "A");
- assertNotNull(entity);
- entity = query.findTagEntity(model, "B");
- assertNotNull(entity);
-
- //check merge of traits within entities
- entity = query.findTagEntity(model, "Dupe");
- assertNotNull(entity);
- assertEquals(2, entity.getTraits().size());
- trait = query.findTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromA", TraitValueHelper.getValueAsString(trait));
- trait = query.findTrait(entity, "B1");
- assertNotNull(trait);
-
- //check merge of entities within entities
- assertEquals(2, entity.getChildEntities().size());
- Entity secondEntity = query.findTagAttributeEntity(entity, "a");
- assertNotNull(secondEntity);
- assertEquals(2, secondEntity.getTraits().size());
- trait = query.findTrait(secondEntity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromA", TraitValueHelper.getValueAsString(trait));
-
- //check merge of traits with included entities
- entity = query.findTagEntity(model, "DupeWithInclude");
- assertNotNull(entity);
- assertEquals(2, entity.getTraits().size());
- trait = query.findTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1", TraitValueHelper.getValueAsString(trait));
- trait = query.findTrait(entity, "B");
- assertNotNull(trait);
- assertEquals("trait SHOULD appear in merge from eg2", TraitValueHelper.getValueAsString(trait));
-
- //check merge of entities with includes
- assertEquals(2, entity.getChildEntities().size());
- secondEntity = query.findTagAttributeEntity(entity, "a");
- assertNotNull(secondEntity);
- //assertEquals(1, secondEntity.getTraits().size());//do not expect 2 as extra trait from include group is not included
- assertEquals(2, secondEntity.getTraits().size());//do NOW expect 2 as extra trait from include group IS included (https://bugs.eclipse.org/bugs/show_bug.cgi?id=191564)
- trait = query.findTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1", TraitValueHelper.getValueAsString(trait));
- trait = query.findTrait(entity, "A1");
- assertNotNull(trait);
-
- //check merge of entities with includes where all come from include
- entity = query.findTagEntity(model, "DupeWithInclude2");
- assertNotNull(entity);
- assertEquals(1, entity.getTraits().size());
- trait = query.findTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromEG1", TraitValueHelper.getValueAsString(trait));
-
- assertEquals(1, entity.getChildEntities().size());
- secondEntity = query.findTagAttributeEntity(entity, "a");
- assertNotNull(secondEntity);
- assertEquals(2, secondEntity.getTraits().size());
- trait = query.findTrait(entity, "A1");
- assertNotNull(trait);
- assertEquals("A1FromEG1", TraitValueHelper.getValueAsString(trait));
-
- }
-
- /**
- * All entities and traits come from external model in this test
- */
- public void testIncludeExternalModel(){
- showDebugInfo(_debugInfo);
- String uri = "http://org.eclipse.jsf/mergetest2";
- startTime(uri);
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(uri);
- endTime();
- assertNotNull(model);
-
- dumpMDTree(model, 0);
-
- //check model traits
- assertEquals(1, model.getTraits().size());
- Trait trait = query.findTrait(model, "A1");
- assertNotNull(trait);
- assertEquals("A1FromEG1", TraitValueHelper.getValueAsString(trait));
-
- //check model entities
- assertEquals(1, model.getChildEntities().size());
- Entity entity = query.findTagEntity(model, "a");
- assertNotNull(entity);
- assertEquals(0, entity.getChildEntities().size());
- assertEquals(2, entity.getTraits().size());
- }
-
- public void testLoadJSFCore(){
- showDebugInfo(_debugInfo);
- String uri = "http://java.sun.com/jsf/core";
- startTime(uri);
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(uri);
- endTime();
- assertNotNull(model);
-
-// dumpMDTree(model, 0);
- }
-
- public void testLoadJSFHTML(){
- showDebugInfo(_debugInfo);
- String uri = "http://java.sun.com/jsf/html";
- startTime(uri);
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(uri);
- endTime();
- assertNotNull(model);
-
-// dumpMDTree(model, 0);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataExceptionTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataExceptionTests.java
deleted file mode 100644
index 4f313e0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataExceptionTests.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import java.io.IOException;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-
-public class MetaDataExceptionTests extends TestCase {
-
- public void testMetaDataException() {
- MetaDataException e = new MetaDataException();
- Assert.assertNotNull(e);
- }
-
- public void testMetaDataExceptionString() {
- MetaDataException e = new MetaDataException("Foo");
- Assert.assertNotNull(e);
- Assert.assertEquals("Foo", e.getMessage());
- }
-
- public void testMetaDataExceptionStringThrowable() {
- IOException cause = new IOException("FooBar");
- MetaDataException e = new MetaDataException("Foo", cause );
- Assert.assertNotNull(e);
- Assert.assertEquals(cause, e.getCause());
- Assert.assertNotNull(e.getCause());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataModelManagerFactoryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataModelManagerFactoryTests.java
deleted file mode 100644
index 64e70f1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataModelManagerFactoryTests.java
+++ /dev/null
@@ -1,60 +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 and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelManager;
-import org.eclipse.jst.jsf.common.metadata.internal.MetaDataModelManagerFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-
-public class MetaDataModelManagerFactoryTests extends TestCase {
-
- private IProject _project;
-
- public void setUp() throws Exception {
- MockWorkspaceContext context = new MockWorkspaceContext();
- _project = context.createProject("MetaDataModelManagerFactoryTests"+"_"+getName());
- }
-
- public void testDefaultMDModelManagerSetup() {
- //test extension must be removed for this to work
- IMetaDataModelManager mgr = MetaDataModelManagerFactory.getMetaDataModelManagerInstance(_project);
- assertNotNull(mgr);
- assertEquals("org.eclipse.jst.jsf.common.metadata.internal.MetaDataModelManager", mgr.getClass().getName());
-
- //verify getting same instance when called the second time
- IMetaDataModelManager mgr2 = MetaDataModelManagerFactory.getMetaDataModelManagerInstance(_project);
- assertNotNull(mgr2);
- assertEquals(mgr, mgr2);
-
- }
-
-//// test extension disabled becuz it screws up tests
-// public void testExtPtMDModelManagerSetup() {
-// IMetaDataModelManager mgr = MetaDataModelManagerFactory.getMetaDataModelManagerInstance(projectTestEnvironment.getTestProject());
-// assertNotNull(mgr);
-// assertEquals("TestMDModelManager", mgr.getClass().getSimpleName());;
-// }
-
- public void testTestableMDModelManagerSetup() throws Exception {
- _project.setSessionProperty(MetaDataModelManagerFactory.TESTABLE_FACTORY_SESSION_KEY, new TestMDModelManagerFactory());
- IMetaDataModelManager mgr = MetaDataModelManagerFactory.getMetaDataModelManagerInstance(_project);
- assertNotNull(mgr);
- assertEquals("TestMDModelManager", mgr.getClass().getSimpleName());
-
- IMetaDataModelManager mgr2 = MetaDataModelManagerFactory.getMetaDataModelManagerInstance(_project);
- assertNotNull(mgr2);
- assertEquals(mgr, mgr2);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryContextFactoryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryContextFactoryTests.java
deleted file mode 100644
index 8e9008b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryContextFactoryTests.java
+++ /dev/null
@@ -1,55 +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 and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataModelManagerContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.junit.Test;
-
-public class MetaDataQueryContextFactoryTests extends TestCase{
-
- @Test
- public void testGetInstance() {
- MetaDataQueryContextFactory factory = MetaDataQueryContextFactory.getInstance();
- assertNotNull(factory);
- MetaDataQueryContextFactory factory2 = MetaDataQueryContextFactory.getInstance();
- assertNotNull(factory2);
- assertSame(factory, factory2);
- }
-
- @Test
- public void testCreateTaglibDomainContext() {
- MetaDataQueryContextFactory factory = MetaDataQueryContextFactory.getInstance();
- assertNotNull(factory);
-
- IProject project = new MockWorkspaceContext().createProject("test");
- IMetaDataDomainContext context = factory.createTaglibDomainModelContext(project);
- assertNotNull(context);
- assertEquals("TagLibraryDomain", context.getDomainId());
- assertNotNull(context.getAdapter((IProject.class)));
- assertTrue(context instanceof IMetaDataModelManagerContext);
- assertSame(((IMetaDataModelManagerContext)context).getProject(), project);
-
-// tests deprecated null project taglibdomain... even though not supposed to pass null project
- context = factory.createTaglibDomainModelContext(null);
- assertNotNull(context);
- assertEquals("TagLibraryDomain", context.getDomainId());
- assertNull(context.getAdapter((IProject.class)));
- assertTrue(context instanceof IMetaDataModelManagerContext);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryFactoryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryFactoryTests.java
deleted file mode 100644
index 437085b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryFactoryTests.java
+++ /dev/null
@@ -1,95 +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 and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataModelManagerContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.junit.Test;
-
-public class MetaDataQueryFactoryTests extends TestCase {
-
- private IProject _project;
-
- public void setUp() throws Exception {
- MockWorkspaceContext context = new MockWorkspaceContext();
- _project = context.createProject("MetaDataQueryFactoryTests"+"_"+getName());
- }
-
- @Test
- public void testGetInstance() {
- final MetaDataQueryFactory factory = MetaDataQueryFactory.getInstance();
- assertNotNull(factory);
-
- final MetaDataQueryFactory factory2 = MetaDataQueryFactory.getInstance();
- assertNotNull(factory2);
- assertSame(factory, factory2);
- }
-
-// @Test
-// public void testCreateQueryWithNullProject() {
-// //tested null project query... may not be valid anymore
-// IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainContext(null);
-// final IMetaDataQuery q = MetaDataQueryFactory.getInstance().createQuery(context);
-// assertNotNull(q);
-// assertTrue(q instanceof ITaglibMetaDataQuery);
-//
-// //check get new instance on each call
-// final ITaglibMetaDataQuery q2 = MetaDataQueryFactory.getInstance().createQuery(context);
-// assertNotNull(q2);
-// assertNotSame(q, q2);
-//
-// }
-
- @Test
- public void testCreateQuery() {
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(_project);
- final IMetaDataQuery q = MetaDataQueryFactory.getInstance().createQuery(context);
- assertNotNull(q);
- assertTrue(q instanceof ITaglibDomainMetaDataQuery);
-
- //check get new instance on each call
- final ITaglibDomainMetaDataQuery q2 = MetaDataQueryFactory.getInstance().createQuery(context);
- assertNotNull(q2);
- assertNotSame(q, q2);
-
- IMetaDataModelManagerContext fakeDomainContext = new IMetaDataModelManagerContext() {
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(final Class adapter) {
- if (adapter == IProject.class)
- return _project;
- return null;
- }
-
- public String getDomainId() {
- return FakeDomainQueryFactory.FAKE_MD_DOMAIN;
- }
-
- public IProject getProject() {
- return _project;
- }
- };
- final IMetaDataQuery q3 = MetaDataQueryFactory.getInstance().createQuery(fakeDomainContext);
- assertNotNull(q3);
- assertNotSame(q, q3);
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryHelperTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryHelperTests.java
deleted file mode 100644
index d3c2ff7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MetaDataQueryHelperTests.java
+++ /dev/null
@@ -1,315 +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 and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.EmptyResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.ITraitQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-import org.eclipse.jst.jsf.common.metadata.query.internal.AbstractMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.HierarchicalSearchControl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataModelManagerContext;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SearchControl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleEntityQueryVisitorImpl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleTraitQueryVisitorImpl;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.junit.Before;
-import org.junit.Test;
-
-public class MetaDataQueryHelperTests extends AbstractBaseMetaDataTestCase {
-
- private IMetaDataQuery _query;
- private MetaDataQueryHelper _helper;
- @Before
- public void setUp() throws Exception {
- super.setUp();
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- _query = MetaDataQueryFactory.getInstance().createQuery(context);
- assertNotNull(_query);
- _helper = (MetaDataQueryHelper)_query.getQueryHelper();
- assertNotNull(_helper);
-
-// baseContext = new TaglibDomainMetaDataModelContextImpl(domain, project, baseTestUri);
-// nullProjectContext = new TaglibDomainMetaDataModelContextImpl(domain, null, baseTestUri);
-// negativeContextBadUri = new TaglibDomainMetaDataModelContextImpl(domain, project, "blah");
-// negativeContextBadDomain = new TaglibDomainMetaDataModelContextImpl(badDomain, project, baseTestUri);
- }
-
- /**
- * Test getModel method but also performs basic read unit tests on Model
- */
- public void testGetModel() {
- //base
- //positive test
- Model model = _helper.getModel(baseTestUri);
- assertNotNull(baseTestUri+" model should not be null.",model);
-
- //null proj
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(null);
- IMetaDataQuery nullProjectQuery = _query = MetaDataQueryFactory.getInstance().createQuery(context);
- model = nullProjectQuery.getQueryHelper().getModel(baseTestUri);
- assertNotNull(baseTestUri+" model should not be null.",model);
- //id
- assertNotNull(model.getId());
- assertEquals(baseTestUri+" is not same as model.getId()",baseTestUri, model.getId() );
-
-
-
- //negative tests
- context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- IMetaDataQuery badUriQuery = MetaDataQueryFactory.getInstance().createQuery(context);
- model = badUriQuery.getQueryHelper().getModel("blah");
- assertNull(model);
-
- IMetaDataModelManagerContext badContext = new IMetaDataModelManagerContext() {
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- if (adapter == IProject.class)
- return project;
- return null;
- }
-
- public String getDomainId() {
- return "badDomainKey";
- }
-
- public IProject getProject() {
- return project;
- }
- };
-
- MetadataTestsPlugin.getDefault().getLog().log(new Status(IStatus.INFO, MetadataTestsPlugin.ID_BUNDLE, "***** UnsupportedOperationException about to occur because of Test ! *****")); //$NON-NLS-1$
- IMetaDataQuery badDomainQuery = MetaDataQueryFactory.getInstance().createQuery(badContext);
- assertNull(badDomainQuery);
- }
-
- public void testGetEntityIMetaDataModelContextString() {
- Model model = _helper.getModel(baseTestUri);
- //positive
- Entity entity = _helper.getEntity(model, "loaded");
- assertNotNull(entity);
-
- entity = _helper.getEntity(model, "loaded/att3");
- assertNotNull(entity);
-
- //negative
- entity = _helper.getEntity(model, "doesnotexist");
- assertNull(entity);
- }
-
- /**
- * Return multiple entities
- * Partially tests SimpleEntityQueryVisitorImpl searchControl
- */
- public void testGetEntitiesIMetaDataModelContextStringIEntityQueryVisitor() {
- Model model = _helper.getModel(baseTestUri);
- IEntityQueryVisitor visitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(1, HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- IResultSet rs = _helper.getEntities(model, "loaded", visitor);
- assertNotNull(rs);
- Entity entity = null;
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(1, rs.getResults().size());
- entity = (Entity)rs.getResults().get(0);
- assertNotNull(entity);
- assertEquals(entity.getId(), "loaded");
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
-
- //test returning multiple (2)
- visitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(SearchControl.COUNT_LIMIT_NONE, HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- rs = _helper.getEntities(model, "loaded", visitor);
- assertNotNull(rs);
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(2, rs.getResults().size());
- entity = (Entity)rs.getResults().get(0);
- assertNotNull(entity);
- assertEquals(entity.getId(), "loaded");
- Entity secondentity = (Entity)rs.getResults().get(1);
- assertNotNull(secondentity);
- assertEquals("loaded", secondentity.getId());
- assertFalse(secondentity == entity);
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
- }
-
- public void testGetTraitEntityString() {
- Model model = _helper.getModel(baseTestUri);
- Entity entity = _helper.getEntity(model, "loaded/att3");
-
- //positive
- Trait trait = _helper.getTrait(entity, "A3");
- assertNotNull(trait);
-
- //negative
- trait = _helper.getTrait(entity, "Z3");
- assertNull(trait);
- }
-
- /**
- * Return multiple traits
- * Also tests SimpleEntityQueryVisitorImpl and IResultSet
- */
- public void testGetTraits() {
- //TEST with 1 count
- ITraitQueryVisitor visitor = new SimpleTraitQueryVisitorImpl(new SearchControl(1));
- Model model = _helper.getModel(baseTestUri);
- IResultSet rs = _helper.getTraits(model, "model-trait", visitor);
- assertNotNull(rs);
- Trait trait = null;
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(1, rs.getResults().size());
- trait = (Trait)rs.getResults().get(0);
- assertNotNull(trait);
- assertEquals("model-trait", trait.getId());
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
-
- //test with COUNT_LIMIT_NONE
- visitor = new SimpleTraitQueryVisitorImpl(new SearchControl(SearchControl.COUNT_LIMIT_NONE));
- rs = _helper.getTraits(model, "model-trait", visitor);
- assertNotNull(rs);
- try {
- assertFalse(rs instanceof EmptyResultSet);
- assertEquals(2, rs.getResults().size());
- trait = (Trait)rs.getResults().get(0);
- assertNotNull(trait);
- assertEquals("model-trait", trait.getId());
- Trait secondTrait = (Trait)rs.getResults().get(1);
- assertNotNull(secondTrait);
- assertEquals("model-trait", secondTrait.getId());
- assertFalse(trait == secondTrait);
- rs.close();
- } catch (MetaDataException e) {
- //MetaDataException not currently being thrown
- fail(e.getMessage());
- }
-
- }
-
- public void testGetEntityEntityString() {
- Model model = _helper.getModel(baseTestUri);
- Entity entity = _helper.getEntity(model, "loaded");
- //positive
- entity = _helper.getEntity(entity, "att3");
- assertNotNull(entity);
-
- //negative
- entity = _helper.getEntity(entity, "zzz");
- assertNull(entity);
- }
-
- public void testGetEntitiesEntityStringIEntityQueryVisitor() {
-
- //negative test
-
- IResultSet rs = _helper.getEntities("badURI", "foo", new SimpleEntityQueryVisitorImpl());
- assertNotNull(rs);
- try {
- assertEquals(0, rs.getResults().size());
- } catch (MetaDataException e) {
- fail(e.getMessage());
- }
- }
-
- public void testGetTraitIMetaDataModelContextStringString() {
- //positive
- Trait trait = _helper.getTrait(baseTestUri, "loaded/att3", "A3");
- assertNotNull(trait);
-
- //negative
- trait = _helper.getTrait(baseTestUri, "loaded/att3", "zzz");
- assertNull(trait);
-
- trait = _helper.getTrait(baseTestUri, "doesnotexist", "A3");
- assertNull(trait);
-
- trait = _helper.getTrait("badDomain", "doesnotexist", "A3");
- assertNull(trait);
- }
-
- public void testResultSets() {
- IResultSet rs = _helper.getEntities(baseTestUri, "loaded", new SimpleEntityQueryVisitorImpl());
- assertNotNull(rs);
- try {
- assertEquals(2, rs.getResults().size());
- assertFalse(rs.isClosed());
- rs.close();
- assertTrue(rs.isClosed());
- } catch (MetaDataException e1) {
- fail(e1.getMessage());
- }
-
- try {
- rs.getResults();
- fail("Expected MetaDataException ");
- } catch (MetaDataException e2) {
- //pass
- }
- }
-
- public void testGetEntityBeyondMDDepth() {
- Entity entity = _helper.getEntity(baseTestUri, "loaded/does_not_exist/nor_this");
- assertNull(entity);
- }
-
- public void testGetEntityBadEntityKey() {
- Entity entity = _helper.getEntity(baseTestUri, "");
- assertNull(entity);
-
- entity = _helper.getEntity(baseTestUri, null);
- assertNull(entity);
-
- entity = _helper.getEntity(baseTestUri, "/");
- assertNull(entity);
-
- }
-
- @Test
- public void testSubclassability() {
- IMetaDataQueryHelper myHelper = new MyMetaDataQueryHelper();
- _query.setQueryHelper(myHelper);
- assertSame(_query.getQueryHelper(), myHelper);
-
- }
-
- private class MyMetaDataQueryHelper extends MetaDataQueryHelper {
- MyMetaDataQueryHelper() {
- super(((AbstractMetaDataQuery)_query).getManager(), ((AbstractMetaDataQuery)_query).getDomainContext());
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MissingMDExtensionModelTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MissingMDExtensionModelTests.java
deleted file mode 100644
index 8597179..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/MissingMDExtensionModelTests.java
+++ /dev/null
@@ -1,125 +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.metadata.tests.updated;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-
-/**
- * Tests loading of models when an emf model extension is missing.
- * <p/>
- * Expected behavior is for model to load all entities and traits even if extension model is not
- * loaded. The trait values will be missing where the trait value model is missing.
- * In these cases, an error should be logged to the JSFCommonPlugin.
- * <p>
- *
- * <p/>
- * Note: if xsi:type prefix is bad, or no uri to model was provided, then model will NOT load.
- * This JUnit does not test for the model not loading in this case.
- *
- */
-public class MissingMDExtensionModelTests extends AbstractBaseMetaDataTestCase {
- private ITaglibDomainMetaDataQuery _query;
- Model model;
- Trait trait;
-
- public void setUp() throws Exception {
- super.setUp();
- String uri = "http://org.eclipse.jsf/missingMDModelTest";
-
- LogListener logListener = new LogListener();
- try {
-
- JSFCommonPlugin.getPlugin().getLog().addLogListener(logListener);
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- _query = MetaDataQueryFactory.getInstance().createQuery(context);
- model = _query.findTagLibraryModel(uri);
- assertNotNull(model);
- if (JSFCommonPlugin.getPlugin().isDebugging() &&
- Boolean.valueOf(Platform.getDebugOption(JSFCommonPlugin.PLUGIN_ID+"/debug/metadataload")).booleanValue()){
- //assert log entries
- assertTrue(logListener.getMessages().size() > 2);
- }
- } finally {
- JSFCommonPlugin.getPlugin().getLog().removeLogListener(logListener);
- }
- }
-
- public void testModelLoadWithMissingECoreExtensionModel() {
- Entity entity = _query.getQueryHelper().getEntity(model, "Tag/Attr1");
- assertNotNull(entity);
- trait = _query.findTrait(entity, "attribute-value-runtime-type");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertEquals("org.eclipse.jst.jsf.core.attributevalues.StringType", TraitValueHelper.getValueAsString(trait));
-
- trait = _query.findTrait(entity, "bogusTrait");
- //trait ain't bogus, but value will be
- assertNotNull(trait);
- //value should be null
- assertNull(trait.getValue());
-
- trait = _query.findTrait(entity, "reallybogusTrait");
- //trait ain't bogus, but value will be
- assertNotNull(trait);
- //value should be null
- assertNull(trait.getValue());
-
- trait = _query.findTrait(entity, "valid-values");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
-
-
- entity = _query.getQueryHelper().getEntity(model, "Tag/DefaultAttr");
- assertNotNull(entity);
- trait = _query.findTrait(entity, "attribute-value-runtime-type");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertEquals("org.eclipse.jst.jsf.core.attributevalues.StringType", TraitValueHelper.getValueAsString(trait));
-
- trait = _query.findTrait(entity, "bogusTrait");
- //trait ain't bogus, but value will be
- assertNotNull(trait);
- //value should be null
- assertNull(trait.getValue());
- }
-
- class LogListener implements ILogListener {
-
- private List<IStatus> statusMsgs;
- public LogListener(){
- this.statusMsgs = new ArrayList<IStatus>();
- }
- public void logging(IStatus status, String plugin) {
- statusMsgs.add(status);
- }
-
- public List<IStatus> getMessages(){
- return statusMsgs;
- }
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelImplTests.java
deleted file mode 100644
index e04c7ae..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelImplTests.java
+++ /dev/null
@@ -1,110 +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.common.metadata.tests.updated;
-
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-
-public class ModelImplTests extends AbstractBaseMetaDataTestCase {
-
- Model model;
- public void setUp() throws Exception {
- super.setUp();
-
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- model = query.findTagLibraryModel(baseTestUri);
- assertNotNull(model);
- }
-
- public void testGetModel() {
- assertNotNull(model.getModel());
- assertEquals(model.getModel(), model);
- }
-
- public void testGetModelId() {
- assertEquals(baseTestUri, model.getId());
- }
-
- public void testGetSourceModelProvider() {
- //getSourceModelProvider
- assertNotNull(model.getSourceModelProvider());
- assertTrue(model.getSourceModelProvider() instanceof IMetaDataSourceModelProvider);
- }
-
- public void testSetSourceModelProvider() {
-// fail("Not yet implemented");
- }
-
- public void testSetCurrentModelContext() {
-// fail("Not yet implemented");
- }
-
- public void testGetEntityGroups() {
- //EntityGroups
- assertNotNull(model.getEntityGroups());
- assertEquals(2, model.getEntityGroups().size());
- }
-
- public void testFindIncludeGroup() {
- assertNotNull(model.findIncludeGroup("eg1"));
- }
-
- public void testGetChildEntities() {
- //childEntities
- assertNotNull(model.getChildEntities());
- assertEquals(6, model.getChildEntities().size());
- }
-
- public void testGetTraits() {
- //traits
- assertNotNull(model.getTraits());
- assertEquals(2, model.getTraits().size());
- }
-
- public void testGetIncludeGroups() {
- //IncludeGroups
- assertNotNull(model.getIncludeGroups());
- assertEquals(0, model.getIncludeGroups().size());
- }
-
- public void testGetId() {
- //id
- assertNotNull(model.getId());
- assertEquals(baseTestUri+" is not same as model.getId()", baseTestUri, model.getId() );
- }
-
- public void testSetId() {
- String id = model.getId();
- model.setId("newid");
- assertEquals("newid",model.getId());
- model.setId(id);
- }
-
- public void testGetType() {
- //type
- assertNotNull(model.getType());
- assertEquals(model.getType(), TYPE_TAG_FILE);
- }
-
- public void testSetType() {
- String type = model.getType();
- model.setType("newid");
- assertEquals("newid",model.getType());
- model.setType(type);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelProviderAdapterTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelProviderAdapterTests.java
deleted file mode 100644
index 08a16b6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/ModelProviderAdapterTests.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import java.util.ResourceBundle;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IClassLoaderProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IImageDescriptorProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.IResourceBundleProvider;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-import org.eclipse.swt.graphics.Image;
-
-public class ModelProviderAdapterTests extends TestCase {
- private final String JSF_HTML_URI = "http://java.sun.com/jsf/html";
- private final String IMAGES_BASE = "/icons/palette/JSFHTML/small/";
-
- private Trait _trait;
-
- protected void setUp() throws Exception {
- super.setUp();
- IProject project = new MockWorkspaceContext().createProject("testProject");
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel(JSF_HTML_URI);
- assertNotNull(model);
- //get the trait that was defined by the "palette" md file. This will establish the correct sourceModelProvider.
- _trait = query.findTrait(model, "display-label");
- assertNotNull(_trait);
- }
-
- public void testImageDescriptorProvider() {
-
- IImageDescriptorProvider imageProvider = (IImageDescriptorProvider)_trait.getSourceModelProvider().getAdapter(IImageDescriptorProvider.class);
- assertNotNull(imageProvider);
- ImageDescriptor id = imageProvider.getImageDescriptor(IMAGES_BASE+"JSF_COMMANDBUTTON");
- assertNotNull(id);
- Image image = id.createImage();
- assertNotNull(image);
- image.dispose();
-
- }
-
-//Comment out till resourceBundleHelper issues on Linux is resolved: https://bugs.eclipse.org/bugs/show_bug.cgi?id=202537
- public void testResourceBundlerProvider() {
-
- IResourceBundleProvider bundleProvider = (IResourceBundleProvider)_trait.getSourceModelProvider().getAdapter(IResourceBundleProvider.class);
- assertNotNull(bundleProvider);
-
- ResourceBundle bundle = bundleProvider.getResourceBundle();
- assertNotNull(bundle);
-
- assertNotNull(bundle.getString("JSFHTML.display-label"));
- assertEquals("JSF HTML", bundle.getString("JSFHTML.display-label"));
- assertNotNull(bundle.getString("column.display-label"));
- assertEquals("Column", bundle.getString("column.display-label"));
-
- //
- IProject project = new MockWorkspaceContext().createProject("testProject");
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model model = query.findTagLibraryModel("RootOfPluginTest");
- assertNotNull(model);
- _trait = query.findTrait(model, "T1");
- assertNotNull(_trait);
- bundleProvider = (IResourceBundleProvider)_trait.getSourceModelProvider().getAdapter(IResourceBundleProvider.class);
- assertNotNull(bundleProvider);
- bundle = bundleProvider.getResourceBundle();
- assertNotNull(bundle.getString("NLS"));
- assertEquals("This is externalized text", bundle.getString("NLS"));
- }
-
- @SuppressWarnings({ })
- public void testClassloaderProvider() {
-
- IClassLoaderProvider classLoaderProvider = (IClassLoaderProvider)_trait.getSourceModelProvider().getAdapter(IClassLoaderProvider.class);
- assertNotNull(classLoaderProvider);
- Class<?> klass = classLoaderProvider.loadClass("java.lang.String");
- assertNotNull(klass);
-
- // when all MD was moved from WPE to tagsupport plugin, there was no longer a plugin specific class to load here. FIX ME later.
-// klass = classLoaderProvider.loadClass("org.eclipse.jst.pagedesigner.jsf.ui.util.JSFUIPluginResourcesUtil");
-// assertNotNull(klass);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TaglibMetaDataQueryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TaglibMetaDataQueryTests.java
deleted file mode 100644
index a6a7f89..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TaglibMetaDataQueryTests.java
+++ /dev/null
@@ -1,279 +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 and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-import org.eclipse.jst.jsf.common.metadata.query.internal.AbstractMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.IPredicateMatcher;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainEntityPredicateMatcher;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainPredicateMatcherFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TaglibMetaDataQueryTests extends AbstractBaseMetaDataTestCase {
-
- private ITaglibDomainMetaDataQuery _query;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- _query = MetaDataQueryFactory.getInstance().createQuery(context);
- assertNotNull(_query);
- }
-
- @Test
- public void testFindTagLibraryModel() {
- Model model = _query.findTagLibraryModel(baseTestUri);
- assertNotNull(model);
- assertEquals(baseTestUri, model.getId());
-
- Model model2 = _query.findTagLibraryModel(baseTestUri);
- assertNotNull(model2);
- assertSame(model, model2);
-
- Model model3 = _query.findTagLibraryModel("http://org.eclipse.jsf/test2");
- assertNotNull(model3);
- assertNotSame(model, model3);
- }
-
- @Test
- public void testFindTagEntity() {
- Model tagLib = _query.findTagLibraryModel(baseTestUri);
- assertNotNull(tagLib);
- Entity tag = _query.findTagEntity(tagLib, "loaded");
- assertNotNull(tag);
- assertEquals("loaded", tag.getId());
- }
-
- @Test
- public void testFindTagAttributeEntity() {
- Model tagLib = _query.findTagLibraryModel(baseTestUri);
- assertNotNull(tagLib);
- Entity tag = _query.findTagEntity(tagLib, "loaded");
- assertNotNull(tag);
- Entity attr = _query.findTagAttributeEntity(tag, "att2");
- assertNotNull(attr);
- assertEquals("att2", attr.getId());
- }
-
- @Test
- public void testFindTrait() {
- Model tagLib = _query.findTagLibraryModel(baseTestUri);
- assertNotNull(tagLib);
- Trait trait = _query.findTrait(tagLib, "model-trait");
- assertNotNull(trait);
- }
-
- @Test
- public void testAbstractSuper() {
- assertNotNull(((AbstractMetaDataQuery)_query).getManager());
- IMetaDataDomainContext context = ((AbstractMetaDataQuery)_query).getDomainContext();
- assertNotNull(context);
- assertEquals(domain, context.getDomainId());
- assertNotNull(context.getAdapter(IProject.class));
- assertSame(project, context.getAdapter(IProject.class));
- }
-
- @Test
- public void testHelperAvailable() {
- assertNotNull(_query.getQueryHelper());
- }
-
-// -----------------------------------------------------------------------------------------------------------------------
-// --- Tests below are implicitly testing the TaglibDomainRegexQueryMatcherFactory and the predicate matchers it produces:
-// --- * TaglibDomainEntityIdRegexPredicateMatcher
-// --- * TaglibDomainTraitIdRegexPredicateMatcher
-
- @Test
- public void testFindModelWithQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher matcher = matcherFactory.createTagLibraryModelMatcher(baseTestUri);
- try {
- IResultSet<Entity> models = _query.findEntities(matcher);
- assertNotNull(models);
- assertEquals(1, models.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindSingleTagWithQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher matcher = matcherFactory.createTagEntityMatcher(baseTestUri, "NLS");
- try {
- IResultSet<Entity> entities = _query.findEntities(matcher);
- assertNotNull(entities);
- assertEquals(1, entities.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindMultipleTagsWithQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher matcher = matcherFactory.createTagEntityMatcher(baseTestUri, "loaded");
- try {
- IResultSet<Entity> tagEntities = _query.findEntities(matcher);
- assertNotNull(tagEntities);
- assertTrue(tagEntities.getResults().size() == 2);
- } catch (MetaDataException e) {
- fail();
- }
-
- matcher = matcherFactory.createTagEntityMatcher(baseTestUri, ".*");
- try {
- IResultSet<Entity> tagEntities = _query.findEntities(matcher);
- assertNotNull(tagEntities);
- assertTrue(tagEntities.getResults().size() == 6);
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindSingleTagAttributeWithQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher matcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, "loaded", "att2");
- try {
- IResultSet<Entity> tagAttrEntities = _query.findEntities(matcher);
- assertNotNull(tagAttrEntities);
- assertTrue(tagAttrEntities.getResults().size() == 1);
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindMultipleTagAttrsWithQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher matcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, "loaded", ".*");
- try {
- IResultSet<Entity> tagAttrEntities = _query.findEntities(matcher);
- assertNotNull(tagAttrEntities);
- assertEquals(5, tagAttrEntities.getResults().size()); //4 from 1st loaded, plus 1 from second
- } catch (MetaDataException e) {
- fail();
- }
-
- matcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, "NLS", ".*");
- try {
- IResultSet<Entity> tagAttrEntities = _query.findEntities(matcher);
- assertNotNull(tagAttrEntities);
- assertEquals(1, tagAttrEntities.getResults().size() );
- } catch (MetaDataException e) {
- fail();
- }
-
- matcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, ".*", "att*");
- try {
- IResultSet<Entity> tagAttrEntities = _query.findEntities(matcher);
- assertNotNull(tagAttrEntities);
- assertEquals(4, tagAttrEntities.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindSingleTagAttrWithMultiQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher matcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, "loaded", ".*");
- Entity tagAttrEntity = _query.findEntity(matcher);
- assertNotNull(tagAttrEntity);
- }
-
- @Test
- public void testFindSingleTraitWithSingleEntityQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher entityMatcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, "loaded", "att2");
- IPredicateMatcher<Trait> traitMatcher = matcherFactory.createTraitMatcher("A2");
- try {
- IResultSet<Trait> traits = _query.findTraits(entityMatcher, traitMatcher);
- assertNotNull(traits );
- assertEquals(1, traits.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindMultipleTraitsWithSingleEntityQuerySpec() {
-
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher entityMatcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, "loaded", "att2");
-
- //which traits beginning with "A" are available on "loaded" tag
- IPredicateMatcher<Trait> traitMatcher = matcherFactory.createTraitMatcher("^[AB]2");
- try {
- IResultSet<Trait> traits = _query.findTraits(entityMatcher, traitMatcher);
- assertNotNull(traits );
- assertEquals(2, traits.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindMultipleTraitsWithMultipleEntityQuerySpec() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher entityMatcher = matcherFactory.createTagEntityMatcher(baseTestUri, ".*");
- //which traits beginning with "A" are available on any tag
- IPredicateMatcher<Trait> traitMatcher = matcherFactory.createTraitMatcher("^A.*");
- try {
- IResultSet<Trait> traits = _query.findTraits(entityMatcher, traitMatcher);
- assertNotNull(traits);
- assertEquals(2, traits.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
-
- //which traits beginning with "A" or "a" are available on any tag attribute
- entityMatcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, ".*", ".*");
- traitMatcher = matcherFactory.createTraitMatcher("^[aA].*");
- try {
- IResultSet<Trait> traits = _query.findTraits(entityMatcher, traitMatcher);
- assertNotNull(traits);
- assertEquals(6, traits.getResults().size());
- } catch (MetaDataException e) {
- fail();
- }
- }
-
- @Test
- public void testFindSingleTraitFromMultipleEntityQuerySpecWithSearchControl() {
- ITaglibDomainPredicateMatcherFactory matcherFactory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher entityMatcher = matcherFactory.createTagEntityMatcher(baseTestUri, ".*");
- //which traits beginning with "A" are available on any tag... but stop and return only the first
- IPredicateMatcher<Trait> traitMatcher = matcherFactory.createTraitMatcher("^A.*");
- Trait trait = _query.findTrait(entityMatcher, traitMatcher);
- assertNotNull(trait);
-
- //which traits beginning with "A" or "a" are available on any tag attribute... but stop and return only the first
- entityMatcher = matcherFactory.createTagAttributeEntityMatcher(baseTestUri, ".*", ".*");
- traitMatcher = matcherFactory.createTraitMatcher("^[aA].*");
- trait = _query.findTrait(entityMatcher, traitMatcher);
- assertNotNull(trait);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TestMDModelManagerFactory.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TestMDModelManagerFactory.java
deleted file mode 100644
index 827a7ce..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TestMDModelManagerFactory.java
+++ /dev/null
@@ -1,41 +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 and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.AbstractMetaDataModelManager;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelManager;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelManagerFactory;
-
-
-public class TestMDModelManagerFactory implements IMetaDataModelManagerFactory {
-
- public IMetaDataModelManager getInstance(IProject project) {
- return new TestMDModelManager();
- }
-
- private static class TestMDModelManager extends AbstractMetaDataModelManager {
-
- public Model getModel(IMetaDataModelContext modelContext) {
- return null;
- }
-
- @SuppressWarnings("unused")
- public Object getAdapter(Class adapter) {
- // TODO Auto-generated method stub
- return null;
- }
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TinyTestTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TinyTestTests.java
deleted file mode 100644
index f0cea47..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TinyTestTests.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.common.metadata.tests.updated;
-
-import org.eclipse.emf.ecore.xml.type.AnyType;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-
-public class TinyTestTests extends AbstractBaseMetaDataTestCase {
- Model model;
- Trait trait;
- private ITaglibDomainMetaDataQuery _query;
-
- public void setUp() throws Exception {
- super.setUp();
- String uri = "http://org.eclipse.jsf/tinytest";
-
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(null);
- _query = MetaDataQueryFactory.getInstance().createQuery(context);
- model = _query.findTagLibraryModel(uri);
- assertNotNull(model);
- }
-
- public void testGetValue() {
- Entity entity = _query.findTagEntity(model, "A/copy1");
- assertNotNull(entity);
- trait = _query.findTrait(entity, "model-trait");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof AnyType);
- assertEquals("ATrait", TraitValueHelper.getValueAsString(trait));
-
- entity = _query.getQueryHelper().getEntity(model, "B/copy1");
- assertNotNull(entity);
- trait = _query.findTrait(entity, "model-trait");
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof AnyType);
- assertEquals("ATrait", TraitValueHelper.getValueAsString(trait));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitImplTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitImplTests.java
deleted file mode 100644
index cbb9937..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitImplTests.java
+++ /dev/null
@@ -1,73 +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.common.metadata.tests.updated;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-
-public class TraitImplTests extends AbstractBaseMetaDataTestCase {
- Model model;
- Trait trait;
-
- public void setUp() throws Exception {
- super.setUp();
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(null);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- model = query.findTagLibraryModel(baseTestUri);
- assertNotNull(model);
- trait = query.getQueryHelper().getTrait(baseTestUri, "loaded", "A");
- assertNotNull(trait);
- }
-
- public void testGetValue() {
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof EObject);
- assertEquals("a", TraitValueHelper.getValueAsString(trait));
- }
-
- public void testSetValue() {
-// fail("Not yet implemented");
- }
-
- public void testGetSourceModel() {
- assertNotNull(trait.getSourceModelProvider());
- assertTrue(trait.getSourceModelProvider().getSourceModel() instanceof Model);
- }
-
- public void testSetSourceModel() {
-// Set during model load. no need to test.
- }
-
- public void testGetId() {
- //id
- assertNotNull(trait.getId());
- assertEquals("A", trait.getId() );
- }
-
- public void testSetId() {
- String id = trait.getId();
- trait.setId("new");
- assertEquals("new",trait.getId());
- trait.setId(id);
- }
-
- public void testAccept() {
-// Excercised by Query tests
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitValueHelperTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitValueHelperTests.java
deleted file mode 100644
index 4d0fe8f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/common/metadata/tests/updated/TraitValueHelperTests.java
+++ /dev/null
@@ -1,270 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.tests.updated;
-
-import java.util.List;
-import java.util.Locale;
-
-import junit.framework.Assert;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper2;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase;
-
-public class TraitValueHelperTests extends ConfigurableTestCase {
- private final String uri = "http://org.eclipse.jsf/traithelpertest";
- private Entity entity;
- private Entity nlsEntity;
- private ITaglibDomainMetaDataQuery _query;
- private TraitValueHelper2 _helper;
-
- public TraitValueHelperTests(){
- super();
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(null);
- _query = MetaDataQueryFactory.getInstance().createQuery(context);
- entity = _query.getQueryHelper().getEntity(uri, "tag/attr1");
- Assert.assertNotNull(entity);
-
- nlsEntity = _query.getQueryHelper().getEntity(uri, "NLS/NLS");
- Assert.assertNotNull(nlsEntity);
-
- _helper = new TraitValueHelper2();
- }
-
- public void testGetValueType() {
- //singleString
- Trait trait = _query.getQueryHelper().getTrait(entity, "singleString");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AnyType", _helper.getValueType(trait).getName());
-
- //anInteger
- trait = _query.getQueryHelper().getTrait(entity, "anInteger");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AnyType", _helper.getValueType(trait).getName());
-
- //multivalStrings
- trait = _query.getQueryHelper().getTrait(entity, "multivalStrings");
- Assert.assertNotNull(trait);
- Assert.assertEquals("ListOfValues", _helper.getValueType(trait).getName());
-
- //multivalIntegers
- trait = _query.getQueryHelper().getTrait(entity, "multivalIntegers");
- Assert.assertNotNull(trait);
- Assert.assertEquals("ListOfValues", _helper.getValueType(trait).getName());
-
- //null tests
- Assert.assertNull( _helper.getValueType(null));
- EObject val = trait.getValue();
- trait.setValue(null);
- Assert.assertNull( _helper.getValueType(trait));
- trait.setValue(val);
-
- trait = _query.getQueryHelper().getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AnyType", _helper.getValueType(trait).getName());
- }
-
- public void testGetValue() {
- //singleString
- Trait trait = _query.getQueryHelper().getTrait(entity, "singleString");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AString", (String)_helper.getValue(trait));
-
- //anInteger
- trait = _query.getQueryHelper().getTrait(entity, "anInteger");
- Assert.assertNotNull(trait);
- Assert.assertEquals(1, Integer.parseInt((String)_helper.getValue(trait)));
-
- //aTrueInt
- trait = _query.getQueryHelper().getTrait(entity, "aTrueInt");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertTrue(trait.getValue() instanceof SimpleAnyType);
- Assert.assertTrue(((SimpleAnyType)trait.getValue()).getInstanceType().getInstanceClassName().equals("int"));
- Assert.assertEquals("1", _helper.getValue(trait));
-
- //null tests
- Assert.assertNull( _helper.getValue(null));
- EObject val = trait.getValue();
- trait.setValue(null);
- Assert.assertNull( _helper.getValue(trait));
- //reset
- trait.setValue(val);
-
- trait = _query.getQueryHelper().getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertNull(_helper.getValue(trait));
- }
-
- public void testGetValueAsString() {
- //singleString
- Trait trait = _query.getQueryHelper().getTrait(entity, "singleString");
- Assert.assertNotNull(trait);
- Assert.assertEquals("AString", _helper.getValueAsString(trait));
-
- //anInteger
- trait = _query.getQueryHelper().getTrait(entity, "anInteger");
- Assert.assertNotNull(trait);
- Assert.assertEquals("1", _helper.getValueAsString(trait));
-
-
- //null tests
- Assert.assertNull( _helper.getValue(null));
- EObject val = trait.getValue();
- trait.setValue(null);
- Assert.assertNull( _helper.getValue(trait));
- trait.setValue(val);
-
- trait = _query.getQueryHelper().getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertEquals(null, _helper.getValueAsString(trait));
- }
-
- public void testGetValueAsListOfStrings() {
- //multivalStrings
- Trait trait = _query.getQueryHelper().getTrait(entity, "multivalStrings");
- Assert.assertNotNull(trait);
- Assert.assertTrue(_helper.getValueAsListOfStrings(trait) instanceof List<?>);
- List<?> vals = _helper.getValueAsListOfStrings(trait);
- Assert.assertEquals(3, vals.size());
- Assert.assertTrue(vals.get(0) instanceof String);
- Assert.assertEquals("A", (String)vals.get(0));
- Assert.assertEquals("B", (String)vals.get(1));
- Assert.assertEquals("C", (String)vals.get(2));
-
- //multivalIntegers
- trait = _query.getQueryHelper().getTrait(entity, "multivalIntegers");
- Assert.assertNotNull(trait);
- Assert.assertTrue(_helper.getValueAsListOfStrings(trait) instanceof List<?>);
- vals = _helper.getValueAsListOfStrings(trait);
- Assert.assertEquals(3, vals.size());
- Assert.assertTrue(vals.get(0) instanceof String);
- Assert.assertEquals("1", (String)vals.get(0));
- Assert.assertEquals("2", (String)vals.get(1));
- Assert.assertEquals("3", (String)vals.get(2));
- }
-
- public void testGetNLSValue() {
- //single NLS String
- Trait trait = _query.getQueryHelper().getTrait(nlsEntity, "NLS");
- Assert.assertNotNull(trait);
- Assert.assertEquals("%NLS1", _helper.getValue(trait));
- if (Locale.getDefault().getCountry().equalsIgnoreCase("us") &&
- Locale.getDefault().getLanguage().equalsIgnoreCase("en")) {
- Assert.assertEquals("a day in the life(en_US)", _helper.getValueAsString(trait));
- }
-
- //multiple NLS Strings
- trait = _query.getQueryHelper().getTrait(nlsEntity, "multivalNLS");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertTrue(trait.getValue() instanceof ListOfValues);
- List<?> vals = _helper.getValueAsListOfStrings(trait);
- Assert.assertEquals(2, vals.size());
- if (Locale.getDefault().getCountry().equalsIgnoreCase("us") &&
- Locale.getDefault().getLanguage().equalsIgnoreCase("en")) {
- Assert.assertEquals("a day in the life(en_US)", vals.get(0));
- Assert.assertEquals("another string(en_US)", vals.get(1));
- }
-
- trait = _query.getQueryHelper().getTrait(entity, "NullVal");
- Assert.assertNotNull(trait);
- Assert.assertEquals(null, _helper.getValueAsString(trait));
- }
-
- public void testGetValueAsBoolean() {
- //valid true
- Trait trait = _query.getQueryHelper().getTrait(entity, "BooleanVal");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertEquals(true, _helper.getValueAsBoolean(trait));
-
- trait = _query.getQueryHelper().getTrait(entity, "NullBooleanVal");
- Assert.assertNotNull(trait);
- Assert.assertNotNull(trait.getValue());
- Assert.assertEquals(false, _helper.getValueAsBoolean(trait));
- }
-
- public void testStringValueType() {
- final Model m = _query.getQueryHelper().getModel(uri);
- assertNotNull(m);
-
- final Trait t = _query.getQueryHelper().getTrait( m, "TraitId");
- assertNotNull(t);
-
- final EObject obj = (EObject)t.getValue();
- assertEquals("StringValue", obj.eClass().getName());
- assertEquals("TraitValue", _helper.getValueAsString(t));
-
- }
-
- public void testBooleanValueType() {
- final Model m = _query.getQueryHelper().getModel(uri);
- assertNotNull(m);
-
- //true
- final Trait t2 = _query.getQueryHelper().getTrait( m, "TraitId2");
- assertNotNull(t2);
-
- final EObject obj2 = (EObject)t2.getValue();
- assertEquals("BooleanValue", obj2.eClass().getName());
- assertEquals(true, _helper.getValueAsBoolean(t2));
- assertEquals("true", _helper.getValueAsString(t2));
-
- //false
- final Trait t3 = _query.getQueryHelper().getTrait( m, "TraitId3");
- assertNotNull(t3);
-
- final EObject obj3 = (EObject)t3.getValue();
- assertEquals("BooleanValue", obj3.eClass().getName());
- assertEquals(false, _helper.getValueAsBoolean(t3));
-
- }
-
-// @SuppressWarnings("restriction")
-// public void testGetValueInstanceClassName() {
-// Trait trait = _query.getQueryHelper().getTrait(entity, "singleString");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("java.lang.String", _helper.getValueInstanceClassName(trait));
-//
-// trait = _query.getQueryHelper().getTrait(entity, "anInteger");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("java.lang.String", _helper.getValueInstanceClassName(trait));
-//
-// trait = _query.getQueryHelper().getTrait(entity, "aTrueInt");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("int", _helper.getValueInstanceClassName(trait));
-//
-// trait = _query.getQueryHelper().getTrait(entity, "multivalStrings");
-// Assert.assertNotNull(trait);
-// Assert.assertNotNull(trait.getValue());
-// Assert.assertEquals("org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl", _helper.getValueInstanceClassName(trait));
-//
-// }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/AllTests.java
deleted file mode 100644
index 253bb36..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/AllTests.java
+++ /dev/null
@@ -1,208 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.common.metadata.tests.AllDeprecatedMetadataTests;
-import org.eclipse.jst.jsf.common.metadata.tests.updated.AllUpdatedMetadataTests;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.AttributeValueRuntimeTypeExtensionsTests;
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.AttributeValueRuntimeTypeFactoryTests;
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.AttributeValueRuntimeTypesRegistryTests;
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.MetaDataProcessorsFactoryTests;
-import org.eclipse.jst.jsf.metadata.tests.pagedesigner.PaletteTests;
-import org.eclipse.jst.jsf.metadata.tests.pagedesigner.PropertyDescriptorTests;
-import org.eclipse.jst.jsf.metadata.tests.pagedesigner.QuickEditSectionsTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ActionTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.BooleanTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.CSSClassTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.CSSStyleTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.CharacterTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ColorTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ComponentBindingTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ComponentIDTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ContentTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.CurrencyCodeTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.DoubleTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.EnumeratedDoubleTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.EnumeratedIntegerTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.EnumeratedLongTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.FacesConfigConverterIDTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.FacesConfigValidatorIDTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.IntegerTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.JSFHTMLTestCase;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.JavaClassTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.LanguageCodeTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.LengthTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.LinkTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.LocaleTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.LongTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.MethodBindingTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.NumberPatternTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.StringTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.TimeZoneTypeTest;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ValueBindingTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.taglibprocessing.ValueTypeTests;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV11;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV12;
-
-public class AllTests {
-
- private static boolean _inited;
- private static boolean _jsfRuntimePresentV11;
- private static boolean _jsfRuntimePresentV12;
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test Suite for org.eclipse.jst.jsf.metadata.tests");
- //$JUnit-BEGIN$
-
-// //model
-// addTestSuite(suite, TraitImplTests.class);
-// addTestSuite(suite, IncludeEntityGroupImplTests.class);
-// addTestSuite(suite, EntityImplTests.class);
-// addTestSuite(suite, ModelImplTests.class);
-// addTestSuite(suite, MergeTests.class);
-// addTestSuite(suite, TinyTestTests.class);
-//
-// addTestSuite(suite, MissingMDExtensionModelTests.class);
-//
-//// //query + main API
-// addTestSuite(suite, EmptyResultSetTest.class);
-// addTestSuite(suite, MetaDataExceptionTest.class);
-// addTestSuite(suite, AbstractMetaDataVisitorTest.class);
-// addTestSuite(suite, AbstractEntityQueryVisitorTest.class);
-// addTestSuite(suite, AbstractTraitQueryVisitorTest.class);
-// addTestSuite(suite, MetaDataQueryHelperTests.class);
-// addTestSuite(suite, TraitValueHelperTests.class);
-// addTestSuite(suite, ModelProviderAdapterTests.class);
-
- suite.addTest(AllDeprecatedMetadataTests.suite());
- suite.addTest(AllUpdatedMetadataTests.suite());
-
-// //metadataprocessing
- addTestSuite(suite, MetaDataProcessorsFactoryTests.class);
- addTestSuite(suite, AttributeValueRuntimeTypeExtensionsTests.class);
- addTestSuite(suite, AttributeValueRuntimeTypesRegistryTests.class);
- addTestSuite(suite, AttributeValueRuntimeTypeFactoryTests.class);
-
- //PageDesigner Metadata tests
- addTestSuite(suite, PropertyDescriptorTests.class);
- addTestSuite(suite, QuickEditSectionsTests.class);
-
-// //taglib processing
- //Tests NOT requiring JSF Implementation
- addTestSuite(suite, StringTypeTest.class);
- addTestSuite(suite, BooleanTypeTest.class);
- addTestSuite(suite, IntegerTypeTest.class);
- addTestSuite(suite, EnumeratedIntegerTypeTest.class);
- addTestSuite(suite, LongTypeTest.class);
- addTestSuite(suite, EnumeratedLongTypeTest.class);
- addTestSuite(suite, DoubleTypeTest.class);
- addTestSuite(suite, EnumeratedDoubleTypeTest.class);
-
- addTestSuite(suite, ColorTypeTest.class);
- addTestSuite(suite, LanguageCodeTypeTest.class);
- addTestSuite(suite, LocaleTypeTest.class);
- addTestSuite(suite, CurrencyCodeTypeTest.class);
- addTestSuite(suite, TimeZoneTypeTest.class);
- addTestSuite(suite, LengthTypeTest.class);
- addTestSuite(suite, NumberPatternTypeTest.class);
-// addTestSuite(suite, RelativePathTypeTest.class);
-// addTestSuite(suite, WebPathTypeTest.class);
- addTestSuite(suite, CharacterTypeTest.class);
-// addTestSuite(suite, ScriptTypeTest.class);
- addTestSuite(suite, LinkTypeTest.class);
- addTestSuite(suite, ContentTypeTest.class);
-// addTestSuite(suite, URITypeTest.class);
-
- //Tests requiring JSF Implementation
- addTestSuite(suite, JavaClassTypeTest.class);
- addTestSuite(suite, FacesConfigConverterIDTypeTests.class);
- addTestSuite(suite, FacesConfigValidatorIDTypeTests.class);
- addTestSuite(suite, MethodBindingTypeTests.class);
- addTestSuite(suite, ComponentIDTypeTests.class);
- addTestSuite(suite, ComponentBindingTypeTests.class);
- addTestSuite(suite, ValueBindingTypeTests.class);
- addTestSuite(suite, ValueTypeTests.class);
- addTestSuite(suite, ActionTypeTests.class);
-
- addTestSuite(suite, CSSClassTypeTests.class);
- addTestSuite(suite, CSSStyleTypeTests.class);
-
- addTestSuite(suite, JSFHTMLTestCase.class);
-// addTestSuite(suite, JSFCoreTestCase.class);
- addTestSuite(suite, PaletteTests.class);
-
- //$JUnit-END$
- return suite;
- }
-
- private static void addTestSuite(TestSuite suite, Class<? extends TestCase> klass) {
- if (!_inited) {
- _jsfRuntimePresentV11 = JSFCoreUtilHelper.isJSFRuntimeJarsDirectoryPropertySet(JSFVersion.V1_1);
- _jsfRuntimePresentV12 = JSFCoreUtilHelper.isJSFRuntimeJarsDirectoryPropertySet(JSFVersion.V1_2);
- _inited = true;
- }
- if (IJSFRuntimeRequiredV11.class.isAssignableFrom(klass)){
- if (_jsfRuntimePresentV11)
- suite.addTestSuite(klass);
- else
- System.err.println("Warning: JSF Runtime v1.1 is required and not present - "+klass.getName()+" test was skipped.");
- } else if (IJSFRuntimeRequiredV12.class.isAssignableFrom(klass)){
- if (_jsfRuntimePresentV12)
- suite.addTestSuite(klass);
- else
- System.err.println("Warning: JSF Runtime v1.2 is required and not present - "+klass.getName()+" test was skipped.");
- } else {
- suite.addTestSuite(klass);
- }
- }
-
- /**
- * Old tests that no longer need to run since moving to new metadata system
- */
- public void Oldsuite() {
-// TestSuite suite = new TestSuite(
-// "Test for org.eclipse.jst.jsf.metadata.tests");
-// //$JUnit-BEGIN$
-//
-// //annotations
-// addTestSuite(suite, AnnotationMapTestCases.class);
-// addTestSuite(suite, AnnotationHelperTestCases.class);
-// addTestSuite(suite, DuplicateAnnotationsTestCases.class);
-// addTestSuite(suite, CaseInsensitiveAnnotationsTestCases.class);
-// addTestSuite(suite, NegativeAnnotationFileTestCases.class);
-//
-// //metadataprocessing
-// addTestSuite(suite, MetaDataProcessorsFactoryTests.class);
-// addTestSuite(suite, AttributeValueRuntimeTypeExtensionsTests.class);
-// addTestSuite(suite, AttributeValueRuntimeTypesRegistryTests.class);
-// addTestSuite(suite, AttributeValueRuntimeTypeFactoryTests.class);
-//
-// //taglib processing
-// addTestSuite(suite, StringTypeTest.class);
-// addTestSuite(suite, BooleanTypeTest.class);
-// addTestSuite(suite, IntegerTypeTest.class);
-// addTestSuite(suite, LongTypeTest.class);
-// addTestSuite(suite, DoubleTypeTest.class);
-// addTestSuite(suite, JavaClassTypeTest.class);
-
- //$JUnit-END$
-// return suite;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/MetadataTestsPlugin.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/MetadataTestsPlugin.java
deleted file mode 100644
index 5e5c5e5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/MetadataTestsPlugin.java
+++ /dev/null
@@ -1,58 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MetadataTestsPlugin extends Plugin {
-
- public static final String ID_BUNDLE = "org.eclipse.jst.jsf.metadata.tests";
-
- //The shared instance.
- private static MetadataTestsPlugin plugin;
-
- /**
- * The constructor.
- */
- public MetadataTestsPlugin() {
- 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 shared instance.
- */
- public static MetadataTestsPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AllMetaDataProcessingTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AllMetaDataProcessingTests.java
deleted file mode 100644
index f7431b5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AllMetaDataProcessingTests.java
+++ /dev/null
@@ -1,31 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllMetaDataProcessingTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test suite for org.eclipse.jst.jsf.metadata.tests.metadataprocessing");
- //$JUnit-BEGIN$
- suite.addTestSuite(AttributeValueRuntimeTypesRegistryTests.class);
- suite.addTestSuite(AttributeValueRuntimeTypeFactoryTests.class);
- suite.addTestSuite(MetaDataProcessorsFactoryTests.class);
- suite.addTestSuite(AttributeValueRuntimeTypeExtensionsTests.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeExtensionsTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeExtensionsTests.java
deleted file mode 100644
index 25f454a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeExtensionsTests.java
+++ /dev/null
@@ -1,69 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing;
-
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.features.IBarker;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-
-public class AttributeValueRuntimeTypeExtensionsTests extends TestCase {
- private String uri1 = "http://org.eclipse.jsf/metadataprocessing";
-
- public void testBarkerExt(){
- List<?> barkProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IBarker.class, null, uri1,
- "MyTag", "MyLongAttr"); //invalid
-
- Assert.assertNotNull(barkProcessors);
- Assert.assertTrue(barkProcessors.isEmpty());
-
-
- }
-
- public void testGetPossibleValsWithExtensions(){
- List<?> processors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, null, uri1,
- "MyTag", "BooleanAttr");
-
- Assert.assertNotNull(processors);
- Assert.assertFalse(processors.isEmpty());
- Assert.assertEquals(processors.size(), 2); //there should be a Boolean and BarkProcessor capable of handling IPossibleValues
-// Iterator it = processors.iterator();
-// while (it.hasNext()){
-// dumpPossibleValues((IPossibleValues)it.next());
-// }
-
- }
-
- public void testNonFeatureExt(){
- List<?> testProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(Test.class//invalid
- ,null, uri1, "MyTag", "BooleanAttr");
-
- Assert.assertNotNull(testProcessors);
- Assert.assertTrue(testProcessors.isEmpty());
-
-
- }
-// private void dumpPossibleValues(IPossibleValues p){
-// Iterator it = p.getPossibleValues().iterator();
-// while (it.hasNext()){
-// System.out.println((String)it.next());
-// }
-// }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeFactoryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeFactoryTests.java
deleted file mode 100644
index 9b7f4f8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypeFactoryTests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing;
-
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.eclipse.jst.jsf.metadataprocessors.ITypeDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.internal.AttributeValueRuntimeTypeFactory;
-
-public class AttributeValueRuntimeTypeFactoryTests extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jst.jsf.metadataprocessors.internal.AttributeValueRuntimeTypeFactory.getTypes(String)'
- * Also tests the simple AbstractMetaDataEnabledType class
- */
- public void testGetTypes() {
- AttributeValueRuntimeTypeFactory factory = AttributeValueRuntimeTypeFactory.getInstance();
- Assert.assertNotNull(factory);
-
- ITypeDescriptor atype = factory.getType(AttributeValueRuntimeTypesRegistryTests.BOOLEANTYPE_ID);
- Assert.assertNotNull(atype);
- Assert.assertNotNull(atype.getTypeExtension().getClassName());
- Assert.assertTrue(atype.getTypeExtension().getBundleID().equals(MetadataTestsPlugin.ID_BUNDLE));
- Assert.assertTrue(atype.getTypeExtension().getTypeID().equals(AttributeValueRuntimeTypesRegistryTests.BOOLEANTYPE_ID));
- List<?> features = atype.getFeatureAdapters(IPossibleValues.class);
- Assert.assertNotNull(features);
- Assert.assertFalse(features.isEmpty());
- Assert.assertEquals(2, features.size()); //we expect MyBooleanType and MetaDataEnabledBarkProcessor
-
- atype = factory.getType(AttributeValueRuntimeTypesRegistryTests.STRINGARRAYTYPE_ID);
- Assert.assertNotNull(atype);
- Assert.assertNotNull(atype.getTypeExtension().getClassName());
- Assert.assertTrue(atype.getTypeExtension().getBundleID().equals(MetadataTestsPlugin.ID_BUNDLE));
- Assert.assertTrue(atype.getTypeExtension().getTypeID().equals(AttributeValueRuntimeTypesRegistryTests.STRINGARRAYTYPE_ID));
-
- }
-
- public void testNoImplTest(){
- AttributeValueRuntimeTypeFactory factory = AttributeValueRuntimeTypeFactory.getInstance();
- Assert.assertNotNull(factory);
-
- ITypeDescriptor atype = factory.getType(AttributeValueRuntimeTypesRegistryTests.NOIMPLTYPE_ID);
- Assert.assertNotNull(atype);
- Assert.assertNotNull(atype.getTypeExtension().getClassName());
- Assert.assertTrue(atype.getTypeExtension().getBundleID().equals(MetadataTestsPlugin.ID_BUNDLE));
-
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypesRegistryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypesRegistryTests.java
deleted file mode 100644
index 6768547..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/AttributeValueRuntimeTypesRegistryTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.eclipse.jst.jsf.metadataprocessors.internal.AbstractMetaDataEnabledType;
-import org.eclipse.jst.jsf.metadataprocessors.internal.AttributeValueRuntimeTypeRegistry;
-
-public class AttributeValueRuntimeTypesRegistryTests extends TestCase {
- public final static String BOOLEANTYPE_ID = MetadataTestsPlugin.ID_BUNDLE + ".MyBooleanType";
- public final static String STRINGARRAYTYPE_ID = MetadataTestsPlugin.ID_BUNDLE + ".MyStringArrayType";
- public final static String NOIMPLTYPE_ID = MetadataTestsPlugin.ID_BUNDLE + ".NoImplType";
-
- /*
- * Test method for 'org.eclipse.jst.jsf.metadataprocessors.internal.AbstractMetaDataEnabledTypeRegistry.getTypes(String)'
- */
- public void testGetTypes() {
- AttributeValueRuntimeTypeRegistry reg = AttributeValueRuntimeTypeRegistry.getInstance();
-
- Assert.assertNotNull(reg.getType(BOOLEANTYPE_ID));
- Object obj = reg.getType(BOOLEANTYPE_ID);
- Assert.assertTrue( obj instanceof AbstractMetaDataEnabledType);
- AbstractMetaDataEnabledType type = (AbstractMetaDataEnabledType)obj;
-
- Assert.assertTrue(type.getBundleID().equals(MetadataTestsPlugin.ID_BUNDLE));
- Assert.assertTrue(type.getTypeID().equals(BOOLEANTYPE_ID));
- Assert.assertTrue(type.getClassName().equals("org.eclipse.jst.jsf.metadata.tests.metadataprocessing.types.MyBooleanType"));
-
- Assert.assertNotNull(reg.getType(STRINGARRAYTYPE_ID));
- obj = reg.getType(STRINGARRAYTYPE_ID);
- Assert.assertTrue( obj instanceof AbstractMetaDataEnabledType);
- type = (AbstractMetaDataEnabledType)obj;
-
- Assert.assertTrue(type.getBundleID().equals(MetadataTestsPlugin.ID_BUNDLE));
- Assert.assertTrue(type.getTypeID().equals(STRINGARRAYTYPE_ID));
- Assert.assertTrue(type.getClassName().equals("org.eclipse.jst.jsf.taglibprocessing.attributevalues.StringType"));
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataEnabledBarkAdapter.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataEnabledBarkAdapter.java
deleted file mode 100644
index 6acbf8e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataEnabledBarkAdapter.java
+++ /dev/null
@@ -1,52 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.features.IBarker;
-import org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-
-/**
- * Test class implementing existing and new fetaure type for
- * testing the MetaDataEnabledFeature Extension
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class MetaDataEnabledBarkAdapter extends AbstractMetaDataEnabledFeature
- implements
- IBarker, IPossibleValues{
-
- public MetaDataEnabledBarkAdapter() {
- super();
- }
-
- public boolean canBark() {
- return true;
- }
-
- public List<?> getBarks() {
- return getTraitValueAsListOfStrings("barks");
-// //notice that we want to use the bundle id of the extender
-// return CMAnnotationHelper.getCMAttributePropertyValues(MetadataTestsPlugin.ID_BUNDLE, getCMAnnotationContext().getUri(),
-// getCMAnnotationContext().getElementName(), getCMAnnotationContext().getAttributeName(),
-// "barks");
- }
-
- public List<?> getPossibleValues() {
- return getBarks();
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataProcessorsFactoryTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataProcessorsFactoryTests.java
deleted file mode 100644
index 694f64d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/MetaDataProcessorsFactoryTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing;
-
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-import org.eclipse.jst.jsf.metadata.tests.metadataprocessing.features.IBarker;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-
-public class MetaDataProcessorsFactoryTests extends AbstractBaseMetaDataTestCase {
- private String uri1 = "http://org.eclipse.jsf/metadataprocessing";
-
- /*
- * Test method for
- * 'org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessorsFactory.getAttributeValueRuntimeTypeProcessors(Class,
- * String, String, String)'
- */
- public void testGetAttributeValueRuntimeTypeProcessors() {
-
- List<?> possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, docContext, uri1,
- "MyTag", "MyBooleanAttr");
- Assert.assertNotNull(possibleValueProcessors);
- Assert.assertFalse(possibleValueProcessors.isEmpty());
- Assert.assertTrue(possibleValueProcessors.size() == 2);
-
- IPossibleValues processor = (IPossibleValues)possibleValueProcessors.get(0);
- Assert.assertNotNull(processor.getPossibleValues());
-// dumpPossibleValues(processor);
-
- possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, docContext, uri1,
- "MyTag", "MyValidValsAttr");
-
- Assert.assertNotNull(possibleValueProcessors);
- Assert.assertFalse(possibleValueProcessors.isEmpty());
- processor = (IPossibleValues)possibleValueProcessors.get(0);
- dumpPossibleValues(processor);
-
- //negative tests
- //not a valid attribute annotation
- possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, docContext, uri1,
- "MyTag", "bogus"); //invalid
-
- Assert.assertTrue(possibleValueProcessors.isEmpty());
-
- //missing runtime-type annotation
- possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, docContext, uri1,
- "MyTag", "MyNonMetaDataEnabledAttr"); //invalid
-
- Assert.assertTrue(possibleValueProcessors.isEmpty());
-
- //missing processor type
- possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, docContext, uri1,
- "MyTag", "MyMissingType"); //value in attr-val-runtime-type is invalid
-
- Assert.assertNotNull(possibleValueProcessors);
- Assert.assertTrue(possibleValueProcessors.isEmpty());
-
- //invalid processor - type exists but does not support specified type
- possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, docContext, uri1,
- "MyTag", "MyLongAttr"); //invalid
-
- Assert.assertNotNull(possibleValueProcessors);
- Assert.assertTrue(possibleValueProcessors.isEmpty());
-
- //get extended feature - Bark Processors
- List<?> barkProcessors = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(IBarker.class, docContext, uri1,
- "MyTag", "BooleanAttr"); //invalid
-
- Assert.assertNotNull(barkProcessors);
- Assert.assertTrue(!barkProcessors.isEmpty());
- Assert.assertTrue(barkProcessors.size() == 1);
-
- IBarker barker = (IBarker)barkProcessors.get(0);
- Iterator<?> it = barker.getBarks().iterator();
- while (it.hasNext()){
- System.out.println((String)it.next());
- }
-
- }
- // IT IS NO LONGER POSSIBLE FOR THE SAME ENTITY TO HAVE MORE THAN ONE TRAIT VALUE FOR THE SAME TRAIT.
- // NEW METADATA FRAMEWORK WILL MERGE INTO SINGLE MODEL WHERE ONLY THE FIRST TRAIT WILL BE PRESENT
-
-// public void testDualTypeTest(){
-// System.out.println("---------------- DualTypeTest ------------------");
-// //second plugin (metadataprocessingtests2 marks the same attr with another type
-// List possibleValueProcessors = MetaDataEnabledProcessingFactory.getInstance().
-// getAttributeValueRuntimeTypeFeatureProcessors(IPossibleValues.class, null, uri1,
-// "MyTag", "MyDualTypeAttr");
-// Assert.assertNotNull(possibleValueProcessors);
-// Assert.assertEquals(2,possibleValueProcessors.size()); //expect StringType + NoImplPossibleVals
-//
-// List vals = new ArrayList();
-// Iterator it = possibleValueProcessors.iterator();
-// while (it.hasNext()){
-// IPossibleValues p = (IPossibleValues)it.next();
-// vals.addAll(p.getPossibleValues());
-// dumpPossibleValues(p);
-// }
-// Assert.assertTrue(vals.size() == 8);
-// System.out.println("---------------- END DualTypeTest ------------------");
-// }
-
- private void dumpPossibleValues(IPossibleValues p){
- Iterator<?> it = p.getPossibleValues().iterator();
- while (it.hasNext()){
- Object obj = it.next();
- if (obj instanceof String)
- System.out.println((String)obj);
- else if (obj instanceof IPossibleValue)
- System.out.println(((IPossibleValue)obj).getDisplayValue());
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/features/IBarker.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/features/IBarker.java
deleted file mode 100644
index 1d84b6e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/features/IBarker.java
+++ /dev/null
@@ -1,22 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing.features;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-
-public interface IBarker extends IMetaDataEnabledFeature {
-
- public boolean canBark();
- public List<?> getBarks();
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyBooleanType.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyBooleanType.java
deleted file mode 100644
index 70fb00e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyBooleanType.java
+++ /dev/null
@@ -1,29 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing.types;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.taglibprocessing.attributevalues.BooleanType;
-
-/**
- * Subclass of boolean type used by tests to prove feature extensions
- *
- */
-public class MyBooleanType extends BooleanType {
-
- public List<?> getPossibleValues() {
- System.out.println("MyBooleanType: getPossibleValues()");
- return super.getPossibleValues();
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyLongType.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyLongType.java
deleted file mode 100644
index 28d21be..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/metadataprocessing/types/MyLongType.java
+++ /dev/null
@@ -1,27 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.metadataprocessing.types;
-
-import org.eclipse.jst.jsf.taglibprocessing.attributevalues.LongType;
-
-/**
- * Subclass of boolean type used by tests to prove feature extensions
- *
- */
-public class MyLongType extends LongType {
-
- public boolean isValidValue(String value) {
- System.out.println("MyLongType: isValidValue(value)");
- return super.isValidValue(value);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PaletteTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PaletteTests.java
deleted file mode 100644
index fc5525f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PaletteTests.java
+++ /dev/null
@@ -1,266 +0,0 @@
-package org.eclipse.jst.jsf.metadata.tests.pagedesigner;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV11;
-import org.eclipse.jst.jsf.metadata.tests.util.JSPTestCase;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.pagedesigner.editors.palette.IPaletteContext;
-import org.eclipse.jst.pagedesigner.editors.palette.TagToolPaletteEntry;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.PaletteItemManager;
-import org.eclipse.jst.pagedesigner.editors.palette.impl.TaglibPaletteDrawer;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * Spot tests the palette exercising the PaletteItemManager and PaletteHelper to ensure that the metadata is being loaded properly.
- *
- * Assumes Sun v1.1 implementation and that the JSTL v1.1 jstl.jar and standard.jar are present
- */
-public class PaletteTests extends JSPTestCase implements IJSFRuntimeRequiredV11 {
-
- private static String HTML_ID = "HTML";
- private static String HTML_URI = ITLDConstants.URI_HTML.toUpperCase();
- private static String HTML_LABEL = "HTML 4.0";
- private static String HTML_DESC = "HTML Tags";
- private static String HTML_BUTTON_ID = "INPUT.BUTTON";
- private static String HTML_BUTTON_LABEL = "Button";
- private static String HTML_BUTTON_DESC = "An INPUT element with TYPE=SUBMIT represents an input option, typically a button, that instructs the user agent to submit the form";
- private static String HTML_BUTTON_SMALL_ICON = "HTML_INPUT_BUTTON.gif";
- private static String HTML_A_ID = "a";
- private static String HTML_A_LABEL = "Link";
- private static String HTML_A_DESC = "This element allows the user to navigate the content of the document";
- private static String HTML_A_SMALL_ICON = "HTML_A.gif";
-
- private static String JSP_ID = "jsp11";
- private static String JSP_URI = "jsp11";
- private static String JSP_LABEL = "JSP";
- private static String JSP_DESC = "JSP Tags";
- private static String JSP_DIR_INCLUDE_ID = "jsp:directive.include";
- private static String JSP_DIR_INCLUDE_LABEL = "Directive.Include";
- private static String JSP_DIR_INCLUDE_DESC = "Includes a resource of text or code when the JSP page is translated";
- private static String JSP_DIR_INCLUDE_SMALL_ICON = "JSP_DIRECTIVE.INCLUDE.gif";
-
- private static String JSFHTML_LABEL = "JSF HTML";
- private static String JSFHTML_DESC = "This tag library contains JavaServer Faces component tags for all UIComponent + HTML RenderKit Renderer combinations defined in the JavaServer Faces Specification.";
- private static String JSFHTML_DEFAULT_PREFIX = "h";
- private static String JSFHTML_COMMAND_BTN_ID = "commandButton";
- private static String JSFHTML_COMMAND_BTN_LABEL = "Command Button";
- private static String JSFHTML_COMMAND_BTN_DESC = "Renders an HTML \"input\" element.Decode BehaviorObtain the Map from the \"requestParameterMap\" property of the ExternalContext. If the value in theMap for the value of the \"clientId\" property of the component is null, create a String by concatenating t...";
- private static String JSFHTML_COMMAND_BTN_SMALL_ICON = "JSF_COMMANDBUTTON.gif";
-
- private static String JSFCORE_LABEL = "JSF Core";
- private static String JSFCORE_DESC = "The core JavaServer Faces custom actions that are independent of any particular RenderKit.";
- private static String JSFCORE_DEFAULT_PREFIX = "f";
- private static String JSFCORE_ACTION_LISTENER_ID = "actionListener";
- private static String JSFCORE_ACTION_LISTENER_LABEL = "actionListener";
- private static String JSFCORE_ACTION_LISTENER__DESC = "Register an ActionListener instance on the UIComponent associated with the closest parent UIComponent custom action.";
- private static String JSFCORE_ACTION_LISTENER_ICON = "JSF_ACTIONLISTENER.gif";
-
- private static String JSTL_CORE_URI = "http://java.sun.com/jsp/jstl/core";
- private static String JSTLCORE_LABEL = "JSTL core";
- private static String JSTLCORE_DESC = "JSTL 1.1 core library";
- private static String JSTLCORE_DEFAULT_PREFIX = "c";
- private static String JSTLCORE_IF_ID = "if";
- private static String JSTLCORE_IF_LABEL = "if";
- private static String JSTLCORE_IF_DESC = "Simple conditional tag, which evalutes its body if the supplied condition is true and optionally exposes a Boolean scripting variable representing the evaluation of this condition";
- private static String JSTLCORE_IF_ICON = "PD_Palette_Default.gif";
-
- public PaletteTests() {
- super( JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
-
- }
-
- @SuppressWarnings("deprecation")
- public void testLoadJSPModel() {
- Model JSP11Model = TaglibDomainMetaDataQueryHelper.getModel(
- TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(
- _testEnv.getTestProject(), CMDocType.JSP11_DOC_TYPE));
-
- assertNotNull(JSP11Model);
-
- Model jsp11Model = TaglibDomainMetaDataQueryHelper.getModel(
- TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(
- _testEnv.getTestProject(), "jsp11"));
-
-
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(_testEnv.getTestProject());
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
- Model JSP11Model_2 = query.getQueryHelper().getModel(CMDocType.JSP11_DOC_TYPE);
- assertNotNull(JSP11Model_2);
- assertSame(jsp11Model, JSP11Model_2);
-
- Model jsp11Model_2 = query.getQueryHelper().getModel("jsp11");
- assertNotNull(jsp11Model_2);
- assertSame(jsp11Model, jsp11Model_2);
- }
-
- public void testPalletteDrawers() {
- final IFile file = _testEnv.getTestProject().getFile("xxx.jsp");//note jsp does not need to exist
- final IPaletteContext context = PaletteItemManager.createPaletteContext(file);
- final PaletteItemManager mgr = PaletteItemManager.getInstance(context);
- assertNotNull(mgr);
-
- CMDocument doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- TaglibPaletteDrawer drawer = mgr.getPaletteHelper().getOrCreateTaglibPaletteDrawer(mgr, doc, CMDocType.HTML_DOC_TYPE);
- verifyHTMLDrawer(drawer);
-
- doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
- drawer = mgr.getPaletteHelper().getOrCreateTaglibPaletteDrawer(mgr, doc, CMDocType.JSP11_DOC_TYPE);
- verifyJSPDrawer(drawer);
-
- drawer = getTaglibPaletteDrawer(mgr, ITLDConstants.URI_JSF_HTML);
- if (drawer != null)
- verifyJSFHTMLDrawer(drawer);
-
- drawer = getTaglibPaletteDrawer(mgr, ITLDConstants.URI_JSF_CORE);
- if (drawer != null)
- verifyJSFCoreDrawer(drawer);
-
- drawer = getTaglibPaletteDrawer(mgr, JSTL_CORE_URI);
- if (drawer != null)
- verifyJSTLCoreDrawer(drawer);
-
- mgr.release(context);
- }
-
- private TaglibPaletteDrawer getTaglibPaletteDrawer(final PaletteItemManager mgr, final String uri) {
- ITaglibRecord[] tldrecs = TaglibIndex.getAvailableTaglibRecords(_testEnv.getTestProject().getFullPath());
- for (int i=0;i<tldrecs.length;i++){
- if (uri.equals(tldrecs[i].getDescriptor().getURI())) {
- return mgr.getPaletteHelper().configPaletteItemsByTLD(mgr, tldrecs[i]);
- }
- }
- return null;
- }
-
- private void verifyJSFHTMLDrawer(final TaglibPaletteDrawer drawer) {
- assertNotNull(drawer);
- verifyDrawer(drawer, "JSF HTML", ITLDConstants.URI_JSF_HTML, ITLDConstants.URI_JSF_HTML, JSFHTML_DEFAULT_PREFIX, JSFHTML_LABEL, JSFHTML_DESC );
- for (final Object o : drawer.getChildren()) {
- verifyJSFHTMLTagItem((TagToolPaletteEntry)o);
- }
-
- }
-
- private void verifyJSFCoreDrawer(final TaglibPaletteDrawer drawer) {
- assertNotNull(drawer);
- verifyDrawer(drawer, "JSF Core", ITLDConstants.URI_JSF_CORE, ITLDConstants.URI_JSF_CORE, JSFCORE_DEFAULT_PREFIX, JSFCORE_LABEL, JSFCORE_DESC );
- for (final Object o : drawer.getChildren()) {
- verifyJSFCoreTagItem((TagToolPaletteEntry)o);
- }
-
- }
-
- private void verifyHTMLDrawer(final TaglibPaletteDrawer drawer) {
- assertNotNull(drawer);
- verifyDrawer(drawer, "HTML", HTML_ID, HTML_URI, null, HTML_LABEL, HTML_DESC );
- for (final Object o : drawer.getChildren()) {
- verifyHTMLTagItem((TagToolPaletteEntry)o);
- }
-
- }
-
- private void verifyJSPDrawer(final TaglibPaletteDrawer drawer) {
- assertNotNull(drawer);
- verifyDrawer(drawer, "JSP", JSP_ID, JSP_URI, null, JSP_LABEL, JSP_DESC );
- for (final Object o : drawer.getChildren()) {
- verifyJSPTagItem((TagToolPaletteEntry)o);
- }
-
- }
- private void verifyHTMLTagItem(final TagToolPaletteEntry tagTool) {
- assertNotNull(tagTool);
- if (tagTool.getId().equals(HTML_BUTTON_ID)) {
- verifyTagTool(tagTool, HTML_BUTTON_LABEL, HTML_BUTTON_DESC, HTML_BUTTON_SMALL_ICON);
- }
- else if (tagTool.getId().equals(HTML_A_ID)) {
- verifyTagTool(tagTool, HTML_A_LABEL, HTML_A_DESC, HTML_A_SMALL_ICON);
- }
-
- }
-
- private void verifyJSFHTMLTagItem(final TagToolPaletteEntry tagTool) {
- assertNotNull(tagTool);
- if (tagTool.getId().equals(JSFHTML_COMMAND_BTN_ID)) {
- verifyTagTool(tagTool, JSFHTML_COMMAND_BTN_LABEL, JSFHTML_COMMAND_BTN_DESC, JSFHTML_COMMAND_BTN_SMALL_ICON);
- }
-
- }
-
- private void verifyJSFCoreTagItem(final TagToolPaletteEntry tagTool) {
- assertNotNull(tagTool);
- if (tagTool.getId().equals(JSFCORE_ACTION_LISTENER_ID)) {
- verifyTagTool(tagTool, JSFCORE_ACTION_LISTENER_LABEL, JSFCORE_ACTION_LISTENER__DESC, JSFCORE_ACTION_LISTENER_ICON);
- }
-
- }
- private void verifyJSPTagItem(final TagToolPaletteEntry tagTool) {
- assertNotNull(tagTool);
- if (tagTool.getId().equals(JSP_DIR_INCLUDE_ID)) {
- verifyTagTool(tagTool, JSP_DIR_INCLUDE_LABEL, JSP_DIR_INCLUDE_DESC, JSP_DIR_INCLUDE_SMALL_ICON);
- }
- }
-
- private void verifyJSTLCoreDrawer(final TaglibPaletteDrawer drawer) {
- assertNotNull(drawer);
- verifyDrawer(drawer, "JSTL Core", JSTL_CORE_URI, JSTL_CORE_URI, JSTLCORE_DEFAULT_PREFIX, JSTLCORE_LABEL, JSTLCORE_DESC);
- for (final Object o : drawer.getChildren()) {
- verifyJSTLCoreTagItem((TagToolPaletteEntry)o);
- }
-
- }
- private void verifyJSTLCoreTagItem(final TagToolPaletteEntry tagTool) {
- assertNotNull(tagTool);
- if (tagTool.getId().equals(JSTLCORE_IF_ID)) {
- verifyTagTool(tagTool, JSTLCORE_IF_LABEL, JSTLCORE_IF_DESC, JSTLCORE_IF_ICON);
- }
- }
-
- private void verifyDrawer(final TaglibPaletteDrawer drawer, String drawerID, final String id , final String uri, final String prefix,
- final String label, final String desc) {
-
- assertEquals(drawerID+": bad id", id, drawer.getId());
- assertEquals(drawerID+": bad uri", uri , drawer.getURI());
- assertEquals(drawerID+": bad label",label, drawer.getLabel());
- assertEquals(drawerID+": bad desc", desc, drawer.getDescription());
- assertEquals(drawerID+": bad default prefix", prefix, drawer.getDefaultPrefix());
- }
-
- private void verifyTagTool(final TagToolPaletteEntry tagTool,
- final String label, final String desc, final String iconName) {
-
- assertEquals(tagTool.getId()+": bad label", label, tagTool.getLabel());
- assertEquals(tagTool.getId()+": bad desc", desc, tagTool.getDescription());
- assertNotNull(tagTool.getId()+": missing small icon", tagTool.getSmallIcon());
-
- //the following is not very safe... relying on image.toString() returning something in the form of the following example:
- // URLImageDescriptor(bundleentry://379.fwk23328673/icons/palette/HTML/small/HTML_INPUT_BUTTON.gif)
- final String actualSmallIcon = tagTool.getSmallIcon().toString();
- final String frag = actualSmallIcon.substring(actualSmallIcon.length() - iconName.length() - 1);
- assertTrue(tagTool.getId()+": bad image", frag.indexOf(iconName) == 0);
- }
-
- public void testNullProjectPalette() {
- final IFile file = null;
- final IPaletteContext context = PaletteItemManager.createPaletteContext(file);
- final PaletteItemManager mgr = PaletteItemManager.getInstance(context);
- assertNotNull(mgr);
-
- //should have JSP tag categories - HTML and JSP only
- assertTrue(mgr.getTagRegistryIdentifier().getContentType().isAssociatedWith("xxx.jsp"));
- assertTrue(mgr.getAllCategories().size() == 2);
- assertNotNull(mgr.getTaglibPalletteDrawer(CMDocType.HTML_DOC_TYPE));
- assertNotNull(mgr.getTaglibPalletteDrawer(CMDocType.JSP11_DOC_TYPE));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PropertyDescriptorTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PropertyDescriptorTests.java
deleted file mode 100644
index 6bd8613..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/PropertyDescriptorTests.java
+++ /dev/null
@@ -1,116 +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
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.pagedesigner;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-import org.eclipse.jst.pagedesigner.properties.ITabbedPropertiesConstants;
-
-//TODO: can use beefing up
-public class PropertyDescriptorTests extends SingleJSPTestCase {
-
- // unused private static QualifiedName qn = new QualifiedName("test","model");
- private String uri = "http://org.eclipse.jsf/propertyDescriptorTest";
- private Model _model;
- private int _offset = 423;
-
-
- public PropertyDescriptorTests() {
- super("/testfiles/jsps/propertyDescTests.jsp",
- "/propertyDescTests.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
-
- public void setUp() throws Exception {
- if (_model == null) {
- super.setUp();
- getModel();
- }
- }
-
- private Model getModel() {
- if (_model == null) {
- ITaglibDomainMetaDataModelContext modelContext = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(null, uri);
- _model = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- }
-
- return _model;
- }
-
- public void testBasics(){
- assertNotNull(getModel());
- assertEquals(1, getModel().getChildEntities().size());
-
- Entity tag = TaglibDomainMetaDataQueryHelper.getEntity(getModel(), "Tag");
- assertNotNull(tag);
- assertTrue(tag.getChildEntities().size() == 3);
-
- testAttr1(tag);
- testDefaultAttr(tag);
-
- }
-
-
- private void testAttr1(Entity tag){
- Entity attr1 = TaglibDomainMetaDataQueryHelper.getEntity(tag, "Attr1");
- assertNotNull(attr1);
- assertTrue(attr1.getTraits().size() > 2);
-
- List<IMetaDataEnabledFeature> pds = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(IPropertyPageDescriptor.class, getStructuredDocumentContext(_structuredDocument, _offset), attr1);
- assertNotNull(pds);
- IPropertyPageDescriptor pd = (IPropertyPageDescriptor)pds.get(0);
- assertNotNull(pd);
- assertEquals("CategoryName", pd.getCategory());
- assertEquals("This is a description.", pd.getDescription());
- assertTrue(pd.isRequired());
- assertEquals("MyAttr1:", pd.getLabel());
-
- }
-
- private void testDefaultAttr(Entity tag){
- Entity attr1 = TaglibDomainMetaDataQueryHelper.getEntity(tag, "DefaultAttr");
- assertNotNull(attr1);
-
- List<IMetaDataEnabledFeature> pds = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(IPropertyPageDescriptor.class, getStructuredDocumentContext(_structuredDocument, _offset), attr1);
- assertNotNull(pds);
- IPropertyPageDescriptor pd = (IPropertyPageDescriptor)pds.get(0);
- assertNotNull(pd);
- assertEquals(ITabbedPropertiesConstants.OTHER_CATEGORY, pd.getCategory());
- assertNull(pd.getDescription());
- assertFalse(pd.isRequired());
- assertEquals("DefaultAttr:", pd.getLabel());
-
- }
-
-
- public void testLocatePropertyPageDescForBooleanTagAttr() {
- Entity boolAttr = TaglibDomainMetaDataQueryHelper.getEntity(getModel(), "Tag/boolAttr");
- assertNotNull(boolAttr);
-
- List<IMetaDataEnabledFeature> pds = MetaDataEnabledProcessingFactory.getInstance().getAttributeValueRuntimeTypeFeatureProcessors(IPropertyPageDescriptor.class, getStructuredDocumentContext(_structuredDocument, _offset), boolAttr);
- assertNotNull(pds);
- IPropertyPageDescriptor pd = (IPropertyPageDescriptor)pds.get(0);
- assertNotNull(pd);
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/QuickEditSectionsTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/QuickEditSectionsTests.java
deleted file mode 100644
index 83faab6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/pagedesigner/QuickEditSectionsTests.java
+++ /dev/null
@@ -1,68 +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
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.pagedesigner;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.JSPTestCase;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.QuickEditTabSections;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SECTION_TYPE;
-import org.eclipse.jst.pagedesigner.editors.properties.quickedittabsections.SectionInfo;
-
-//TODO: can use beefing up
-public class QuickEditSectionsTests extends JSPTestCase {
- private String _uri;
- private ITaglibDomainMetaDataModelContext _context;
-
- public QuickEditSectionsTests () {
- super( JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
-
- }
- public void setUp() throws Exception{
- super.setUp();
-
- _uri = "http://org.eclipse.jsf/quickEditSectionTest";
- _context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(_testEnv.getTestProject(), _uri);
- }
-
- public void testQuickEditTabSections(){
- Model model = TaglibDomainMetaDataQueryHelper.getModel(_context);
- assertNotNull(model);
- Entity entity = TaglibDomainMetaDataQueryHelper.getEntity(model, "A");
- assertNotNull(entity);
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(entity , QuickEditTabSections.TRAIT_ID);
- assertNotNull(trait);
- assertNotNull(trait.getValue());
- assertTrue(trait.getValue() instanceof QuickEditTabSections);
- QuickEditTabSections sections = (QuickEditTabSections)trait.getValue();
- assertEquals(3, sections.getSections().size());
-
- SectionInfo section = sections.getSections().get(0);
- assertEquals("attr1", section.getId());
- assertEquals(SECTION_TYPE.ATTRIBUTE, section.getType());
-
- section = sections.getSections().get(1);
- assertEquals("attr2", section.getId());
- assertEquals(SECTION_TYPE.ATTRIBUTE, section.getType());
-
- section = sections.getSections().get(2);
- assertEquals("section1", section.getId());
- assertEquals(SECTION_TYPE.SECTION, section.getType());
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ActionTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ActionTypeTests.java
deleted file mode 100644
index af5c851..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ActionTypeTests.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-
-public class ActionTypeTests extends SingleJSPTestCase {
- private final String tagName = "commandButton";
- private final String attrName = "action";
-
- public ActionTypeTests(){
- super( "/testfiles/jsps/actionTypeTest.jsp.data/",
- "/actionTypeTest.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
-
- public void testGetPossibleValues() {
- IPossibleValues pv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(pv);
-
- assertEquals(2, pv.getPossibleValues().size());
- assertPossibleValues(pv.getPossibleValues(), new String[] {
- "gotoWelcome",
- "gotoSomeplaceElse"});
-
- }
-
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- assertTrue(vv.isValidValue("gotoWelcome"));
- assertTrue(vv.isValidValue("gotoSomeplaceElse"));
- assertFalse(vv.isValidValue("gotoSomeplace"));
- assertEquals(1, vv.getValidationMessages().size());
- IValidationMessage msg = (IValidationMessage)vv.getValidationMessages().get(0);
- assertEquals(IStatus.WARNING, msg.getSeverity());
- assertEquals("The action value does not match a navigation case outcome.", msg.getMessage());
- vv.getValidationMessages().clear();
- assertFalse(vv.isValidValue(""));
- msg = (IValidationMessage)vv.getValidationMessages().get(0);
- assertEquals(IStatus.WARNING, msg.getSeverity());
- assertEquals("The action attribute must be a non-zero length String or a method binding matching a navigation case outcome.", msg.getMessage());
-
- }
-
- public void testGetExpectedRuntimeType() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (Exception e) {
- }
-
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/AllTests.java
deleted file mode 100644
index 61744b4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/AllTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.tests.util.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV11;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV12;
-
-public class AllTests {
-
- private static boolean _inited;
- private static boolean _jsfRuntimePresentV11;
- private static boolean _jsfRuntimePresentV12;
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jst.jsf.metadata.tests.taglibprocessing");
- //$JUnit-BEGIN$
- //Tests NOT requiring JSF Implementation
- addTestSuite(suite, StringTypeTest.class);
- addTestSuite(suite, BooleanTypeTest.class);
- addTestSuite(suite, IntegerTypeTest.class);
- addTestSuite(suite, EnumeratedIntegerTypeTest.class);
- addTestSuite(suite, LongTypeTest.class);
- addTestSuite(suite, EnumeratedLongTypeTest.class);
- addTestSuite(suite, DoubleTypeTest.class);
- addTestSuite(suite, EnumeratedDoubleTypeTest.class);
-
- addTestSuite(suite, ColorTypeTest.class);
- addTestSuite(suite, LanguageCodeTypeTest.class);
- addTestSuite(suite, LocaleTypeTest.class);
- addTestSuite(suite, CurrencyCodeTypeTest.class);
- addTestSuite(suite, TimeZoneTypeTest.class);
- addTestSuite(suite, LengthTypeTest.class);
- addTestSuite(suite, NumberPatternTypeTest.class);
-// addTestSuite(suite, RelativePathTypeTest.class);
-// addTestSuite(suite, WebPathTypeTest.class);
- addTestSuite(suite, CharacterTypeTest.class);
-// addTestSuite(suite, ScriptTypeTest.class);
- addTestSuite(suite, LinkTypeTest.class);
- addTestSuite(suite, ContentTypeTest.class);
-// addTestSuite(suite, URITypeTest.class);
-
- //Tests requiring JSF Implementation
- addTestSuite(suite, JavaClassTypeTest.class);
- addTestSuite(suite, FacesConfigConverterIDTypeTests.class);
- addTestSuite(suite, FacesConfigValidatorIDTypeTests.class);
- addTestSuite(suite, MethodBindingTypeTests.class);
- addTestSuite(suite, ComponentIDTypeTests.class);
- addTestSuite(suite, ComponentBindingTypeTests.class);
- addTestSuite(suite, ValueBindingTypeTests.class);
- addTestSuite(suite, ValueTypeTests.class);
- addTestSuite(suite, ActionTypeTests.class);
-
- addTestSuite(suite, CSSClassTypeTests.class);
- addTestSuite(suite, CSSStyleTypeTests.class);
-
- addTestSuite(suite,JSFHTMLTestCase.class);
-
- //$JUnit-END$
- return suite;
- }
- private static void addTestSuite(TestSuite suite, Class<? extends TestCase> klass) {
- if (!_inited) {
- _jsfRuntimePresentV11 = JSFCoreUtilHelper.isJSFRuntimeJarsDirectoryPropertySet(JSFVersion.V1_1);
- _jsfRuntimePresentV12 = JSFCoreUtilHelper.isJSFRuntimeJarsDirectoryPropertySet(JSFVersion.V1_2);
- _inited = true;
- }
- if (IJSFRuntimeRequiredV11.class.isAssignableFrom(klass)){
- if (_jsfRuntimePresentV11)
- suite.addTestSuite(klass);
- else
- System.err.println("Warning: JSF Runtime v1.1 is required and not present - "+klass.getName()+" test was skipped.");
- } else if (IJSFRuntimeRequiredV12.class.isAssignableFrom(klass)){
- if (_jsfRuntimePresentV12)
- suite.addTestSuite(klass);
- else
- System.err.println("Warning: JSF Runtime v1.2 is required and not present - "+klass.getName()+" test was skipped.");
- } else {
- suite.addTestSuite(klass);
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/BooleanTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/BooleanTypeTest.java
deleted file mode 100644
index 3b4fdb0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/BooleanTypeTest.java
+++ /dev/null
@@ -1,69 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-
-public class BooleanTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertFalse(possibleValueAdapters.isEmpty());
- Assert.assertEquals(2, possibleValueAdapters.size());
- IPossibleValues pv =(IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertEquals(pv.getPossibleValues().size(), 2);//true and false
-
-
- //validate BarkProcessorFeature does not kick in for this tag
- //as the tests have added a second impl of IPossibleVals check
-// pv =(IPossibleValues)getBarkProcessingBundle(possibleValueAdapters);
- pv =(IPossibleValues)possibleValueAdapters.get(1);
- Assert.assertNotNull(pv);
- //bark annotation is not on the MyTag element MyAttr attr
- Assert.assertTrue(pv.getPossibleValues().isEmpty());
-
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("true"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("false"));
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("False"));
- Assert.assertEquals(vv.getValidationMessages().size(), 0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("bogus"));
- Assert.assertEquals(vv.getValidationMessages().size(), 1);
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
- Assert.assertTrue(((IDefaultValue)defaultValueAdapters.get(0)).getDefaultValue().equals("true"));
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSClassTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSClassTypeTests.java
deleted file mode 100644
index 08619ce..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSClassTypeTests.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class CSSClassTypeTests extends SingleJSPTestCase {
- private final String tagName = "inputText";
- private final String attrName = "styleClass";
-
- public CSSClassTypeTests(){
- super( "/testfiles/jsps/cssTypesTest.jsp.data/",
- "/cssTypesTest.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
-
- public void setUp() throws Exception {
- super.setUp();
- _testEnv.loadResourceInWebRoot(MetadataTestsPlugin.getDefault().getBundle(),
- "/testfiles/jsps/mystyle.css.data",
- "mystyle.css");
-
- _testEnv.loadResourceInWebRoot(MetadataTestsPlugin.getDefault().getBundle(),
- "/testfiles/jsps/foo.css.data",
- "foo.css");
- }
-
- public void testGetPossibleValues() {
- IPossibleValues pv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(pv);
- assertEquals(12, pv.getPossibleValues().size());
- }
-
- public void testIsValidValue() {
- //valid values not currently supported
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv);
-
- }
-
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSStyleTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSStyleTypeTests.java
deleted file mode 100644
index 3458269..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CSSStyleTypeTests.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class CSSStyleTypeTests extends SingleJSPTestCase {
- private final String tagName = "commandButton";
- private final String attrName = "class";
-
- public CSSStyleTypeTests(){
- super( "/testfiles/jsps/cssTypesTest.jsp.data/",
- "/cssTypesTest.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
-
- public void testGetPossibleValues() {
- IPossibleValues pv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(pv);
-
-// TODO: fill me in
- }
-
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv);
-
-
- }
-
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CharacterTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CharacterTypeTest.java
deleted file mode 100644
index d67c58e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CharacterTypeTest.java
+++ /dev/null
@@ -1,43 +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
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class CharacterTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues() {
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertTrue(possibleValueAdapters.isEmpty());
-
- }
-
- public void testValidValuesValues() {
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues pvs = (IValidValues) validValuesAdapters.get(0);
- Assert.assertTrue(pvs.isValidValue("a"));
-
-
- //negative
- Assert.assertFalse(pvs.isValidValue("ab"));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue("_a"));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue(""));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue(" a "));
- pvs.getValidationMessages().clear();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ColorTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ColorTypeTest.java
deleted file mode 100644
index 84177f8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ColorTypeTest.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.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class ColorTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertFalse(possibleValueAdapters.isEmpty());
-
- IPossibleValues pvs = (IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertTrue(pvs.getPossibleValues().size() == 16 );
- Assert.assertTrue(pvs.getPossibleValues().get(1) instanceof IPossibleValue);
- IPossibleValue pv = (IPossibleValue)pvs.getPossibleValues().get(1);
- Assert.assertTrue(pv.getValue().equalsIgnoreCase("silver"));
- Assert.assertNotNull(pv.getIcon());
- Assert.assertTrue(pv.getIcon() instanceof ImageDescriptor);
- Assert.assertEquals(192, pv.getIcon().getImageData().getRGBs()[0].red);
- Assert.assertEquals(192, pv.getIcon().getImageData().getRGBs()[0].green);
- Assert.assertEquals(192, pv.getIcon().getImageData().getRGBs()[0].blue);
-
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("Black"));
- Assert.assertTrue(vv.isValidValue("BLACK"));
- Assert.assertTrue(vv.isValidValue("black"));
- Assert.assertTrue(vv.isValidValue(" BLACK "));
- Assert.assertTrue(vv.isValidValue("Silver"));
- Assert.assertTrue(vv.isValidValue("Gray"));
- Assert.assertTrue(vv.isValidValue("White"));
- Assert.assertTrue(vv.isValidValue("Red"));
- Assert.assertTrue(vv.isValidValue("Purple"));
- Assert.assertTrue(vv.isValidValue("Fuchsia"));
- Assert.assertTrue(vv.isValidValue("Green"));
- Assert.assertTrue(vv.isValidValue("Lime"));
- Assert.assertTrue(vv.isValidValue("Olive"));
- Assert.assertTrue(vv.isValidValue("Yellow"));
- Assert.assertTrue(vv.isValidValue("Navy"));
- Assert.assertTrue(vv.isValidValue("Blue"));
- Assert.assertTrue(vv.isValidValue("Teal"));
- Assert.assertTrue(vv.isValidValue("Aqua"));
-
- Assert.assertFalse(vv.isValidValue("BlackAndBlue"));
- vv.getValidationMessages().clear();
-
- Assert.assertTrue(vv.isValidValue("#FFFFFF"));
- Assert.assertTrue(vv.isValidValue("#0FFFFF"));
- Assert.assertTrue(vv.isValidValue("#000001"));
- Assert.assertFalse(vv.isValidValue("1#FFFFF"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("FFFFFF"));
- vv.getValidationMessages().clear();
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue() != null);
- Assert.assertTrue(dv.getDefaultValue().equalsIgnoreCase("Black"));
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
- public void testGetExpectedReturnType(){
- Assert.assertNotNull(validELValuesAdapters);
- IValidELValues vvel = (IValidELValues)validELValuesAdapters.get(0);
- try {
- Assert.assertEquals("String", vvel.getExpectedRuntimeType().toUserReadableString());
- } catch (ELIsNotValidException e) {
- fail("testGetExpectedReturnType");
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentBindingTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentBindingTypeTests.java
deleted file mode 100644
index 400e34e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentBindingTypeTests.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class ComponentBindingTypeTests extends SingleJSPTestCase {
- private final String tagName = "inputText";
- private final String attrName = "binding";
-
- public ComponentBindingTypeTests() {
- super( "/testfiles/jsps/facesConfigValidatorIDType.jsp.data/",
- "/facesConfigValidatorIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
- protected void setUp() throws Exception {
- super.setUp();
-
-// addJavaFile("MyBean");
- }
-
- public void testGetExpectedRuntimeType() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (ELIsNotValidException e) {
- }
-
- }
-
- public void testPossibleValues() {
- IPossibleValues vv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv); //possible value is not supported!
-
- }
-
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- assertFalse(vv.isValidValue("All non-EL is invalid!"));
- assertNotNull(vv.getValidationMessages());
- assertEquals(1, vv.getValidationMessages().size());
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentIDTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentIDTypeTests.java
deleted file mode 100644
index 845e827..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ComponentIDTypeTests.java
+++ /dev/null
@@ -1,103 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class ComponentIDTypeTests extends SingleJSPTestCase {
-
- private final String tagName = "commandButton";
- private final String attrName = "id";
-
- public ComponentIDTypeTests() {
- super( "/testfiles/jsps/facesConfigValidatorIDType.jsp.data/",
- "/facesConfigValidatorIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
- protected void setUp() throws Exception {
- super.setUp();
-
-// addJavaFile("MyBean");
- }
-
- public void testGetExpectedRuntimeType() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- fail("Expected ELIsNotValidException");
- } catch (ELIsNotValidException e) {
- }
-
- }
-
- public void testPossibleValues() {
- IPossibleValues vv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv); //possible value is not supported!
-
- }
-
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-//
-// assertTrue(vv.isValidValue("every non zero length string is valid!"));
-// assertNotNull(vv.getValidationMessages());
-// assertEquals(0, vv.getValidationMessages().size());
-// assertFalse(vv.isValidValue(""));
-
- //positive tests
- Assert.assertTrue(vv.isValidValue("A"));
- Assert.assertTrue(vv.isValidValue("Aa"));
- Assert.assertTrue(vv.isValidValue("z.abc"));
- Assert.assertTrue(vv.isValidValue("A1"));
- Assert.assertTrue(vv.isValidValue("A-1"));
- Assert.assertTrue(vv.isValidValue("A_a"));
- Assert.assertTrue(vv.isValidValue("A:a"));
- Assert.assertTrue(vv.isValidValue("A_"));
- Assert.assertTrue(vv.isValidValue("a."));
- Assert.assertTrue(vv.isValidValue("Aa."));
- Assert.assertTrue(vv.isValidValue("_Aa"));
-
- //negative tests
- Assert.assertFalse(vv.isValidValue(" "));
- vv.getValidationMessages().clear();
-
- //will fail when we have proper regex validation
-// Assert.assertFalse(vv.isValidValue("1Aa"));
-// vv.getValidationMessages().clear();
-// Assert.assertFalse(vv.isValidValue(":Aa"));
-// vv.getValidationMessages().clear();
-// Assert.assertFalse(vv.isValidValue("-Aa"));
-// vv.getValidationMessages().clear();
-// Assert.assertFalse(vv.isValidValue(".Aa"));
-// vv.getValidationMessages().clear();
-
- // FIXME the below is currently failing and is commented out.
-// Assert.assertFalse(vv.isValidValue("A$!a"));
-// vv.getValidationMessages().clear();
-// Assert.assertFalse(vv.isValidValue("A:!a"));
-// vv.getValidationMessages().clear();
-// Assert.assertFalse(vv.isValidValue("A(a"));
-// vv.getValidationMessages().clear();
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ContentTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ContentTypeTest.java
deleted file mode 100644
index 0ff164b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ContentTypeTest.java
+++ /dev/null
@@ -1,44 +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
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class ContentTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues() {
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertFalse(possibleValueAdapters.isEmpty());
-
- IPossibleValues pvs = (IPossibleValues) possibleValueAdapters.get(0);
- Assert.assertTrue(pvs.getPossibleValues().size() >= 8);
- }
-
- public void testValidValuesValues() {
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues pvs = (IValidValues) validValuesAdapters.get(0);
- Assert.assertTrue(pvs.isValidValue("a"));
- Assert.assertTrue(pvs.isValidValue("foo_bar"));
-
- //negative
- Assert.assertFalse(pvs.isValidValue(""));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue(" "));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue(null));
- pvs.getValidationMessages().clear();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CurrencyCodeTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CurrencyCodeTypeTest.java
deleted file mode 100644
index 1e56f5b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/CurrencyCodeTypeTest.java
+++ /dev/null
@@ -1,51 +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.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-
-/**
- *
- *
- */
-public class CurrencyCodeTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- IPossibleValues pvs = (IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertEquals(173, pvs.getPossibleValues().size());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- //positive tests
- assertTrue(vv.isValidValue("USD"));
- assertTrue(vv.isValidValue("AOA"));
- //negative tests
- vv.getValidationMessages().clear();
- assertFalse(vv.isValidValue("XXX"));
- }
-
- public void testPropertyPageDescriptor(){
- Assert.assertNotNull(propertyPageDescriptorAdapters);
- Assert.assertFalse(propertyPageDescriptorAdapters.isEmpty());
-
- IPropertyPageDescriptor ppd =(IPropertyPageDescriptor)propertyPageDescriptorAdapters.get(0);
- assertEquals(false, ppd.isRequired());
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/DoubleTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/DoubleTypeTest.java
deleted file mode 100644
index 91c79d4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/DoubleTypeTest.java
+++ /dev/null
@@ -1,82 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class DoubleTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertTrue(possibleValueAdapters.isEmpty());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
-
- Assert.assertFalse(vv.isValidValue("0"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("188.23"));
- Assert.assertTrue(vv.isValidValue("245.32"));
- Assert.assertFalse(vv.isValidValue("0.0"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("False"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-1001"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555555555555555555"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555f9"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("2e1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue() == null);
-// Assert.assertTrue(dv.getDefaultValue().equals("10"));
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
- public void testGetExpectedReturnType(){
- Assert.assertNotNull(validELValuesAdapters);
- IValidELValues vvel = (IValidELValues)validELValuesAdapters.get(0);
- try {
- Assert.assertEquals("double", vvel.getExpectedRuntimeType().toUserReadableString());
- } catch (ELIsNotValidException e) {
- fail("testGetExpectedReturnType");
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedDoubleTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedDoubleTypeTest.java
deleted file mode 100644
index c0c8b6f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedDoubleTypeTest.java
+++ /dev/null
@@ -1,43 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class EnumeratedDoubleTypeTest extends TaglibProcessingTestCase {
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("188.23"));
- Assert.assertTrue(vv.isValidValue("245.32"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("6"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue().equals("188.23"));
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedIntegerTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedIntegerTypeTest.java
deleted file mode 100644
index eefba28..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedIntegerTypeTest.java
+++ /dev/null
@@ -1,46 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class EnumeratedIntegerTypeTest extends TaglibProcessingTestCase {
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("0"));
- Assert.assertTrue(vv.isValidValue("3"));
- Assert.assertTrue(vv.isValidValue("5"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("6"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- // TODO: dead?
- /*IValidationMessage msg = (IValidationMessage)*/vv.getValidationMessages().get(0);
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue().equals("10"));
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedLongTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedLongTypeTest.java
deleted file mode 100644
index 8c157f5..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/EnumeratedLongTypeTest.java
+++ /dev/null
@@ -1,49 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-
-public class EnumeratedLongTypeTest extends TaglibProcessingTestCase {
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("0"));
- Assert.assertTrue(vv.isValidValue("3"));
- Assert.assertTrue(vv.isValidValue("5"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("6"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- IValidationMessage msg = (IValidationMessage)vv.getValidationMessages().get(0);
- Assert.assertEquals("bogus validation message", msg.getMessage());
- Assert.assertEquals(99, msg.getSeverity());
- Assert.assertEquals("X99", msg.getCode());
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue().equals("3"));
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigConverterIDTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigConverterIDTypeTests.java
deleted file mode 100644
index ab1c0d1..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigConverterIDTypeTests.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
- package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class FacesConfigConverterIDTypeTests extends SingleJSPTestCase {
-
- public FacesConfigConverterIDTypeTests() {
- super( "/testfiles/jsps/facesConfigConverterIDType.jsp.data/",
- "/facesConfigConverterIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- addJavaFile("MyConverter");
- }
-
-// public void testSanity() {
-// final IJavaProject javaProject = _jdtTestEnv.getJavaProject();
-// assertNotNull(javaProject);
-// assertNotNull(_structuredDocument);
-// }
-
- public void testPossibleValues() {
- IPossibleValues pv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, "inputText", "converter");
- assertNotNull(pv);
-
- assertEquals(13, pv.getPossibleValues().size());
-
- assertPossibleValues(pv.getPossibleValues(),
- new String[]{
- "com.foo.myconverter",
- "javax.faces.BigDecimal",
- "javax.faces.BigInteger",
- "javax.faces.Byte",
- "javax.faces.Boolean",
- "javax.faces.Character",
- "javax.faces.DateTime",
- "javax.faces.Double",
- "javax.faces.Float",
- "javax.faces.Integer",
- "javax.faces.Number",
- "javax.faces.Long",
- "javax.faces.Short"} );
-
- }
- public void testGetExpectedRuntimeValue() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, "inputText", "converter");
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (Exception e) {
- }
- }
-
- public void testValidValues() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, "inputText", "converter");
- assertNotNull(vv);
-
- assertTrue(vv.isValidValue("com.foo.myconverter"));
- assertTrue(vv.isValidValue("javax.faces.BigDecimal"));
- assertTrue(vv.isValidValue("javax.faces.BigInteger"));
- assertTrue(vv.isValidValue("javax.faces.Byte"));
- assertTrue(vv.isValidValue("javax.faces.Boolean"));
- assertTrue(vv.isValidValue("javax.faces.Character"));
- assertTrue(vv.isValidValue("javax.faces.DateTime"));
- assertTrue(vv.isValidValue("javax.faces.Double"));
- assertTrue(vv.isValidValue("javax.faces.Float"));
- assertTrue(vv.isValidValue("javax.faces.Integer"));
- assertTrue(vv.isValidValue("javax.faces.Number"));
- assertTrue(vv.isValidValue("javax.faces.Long"));
- assertTrue(vv.isValidValue("javax.faces.Short"));
-
- assertFalse(vv.isValidValue("com.foo.myconvertersubclass1"));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigValidatorIDTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigValidatorIDTypeTests.java
deleted file mode 100644
index ca4d72f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/FacesConfigValidatorIDTypeTests.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.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class FacesConfigValidatorIDTypeTests extends SingleJSPTestCase {
- private final String tagName = "validator";
- private final String attrName = "validatorId";
-
- public FacesConfigValidatorIDTypeTests() {
- super( "/testfiles/jsps/facesConfigValidatorIDType.jsp.data/",
- "/facesConfigValidatorIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- addJavaFile("MyValidator");
- }
-
-// public void testSanity() {
-// final IJavaProject javaProject = _jdtTestEnv.getJavaProject();
-// assertNotNull(javaProject);
-// assertNotNull(_structuredDocument);
-// }
-
- public void testPossibleValues() {
- IPossibleValues pv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_CORE_URI, tagName, attrName);
- assertNotNull(pv);
-
- assertEquals(4, pv.getPossibleValues().size());
-
- assertPossibleValues(pv.getPossibleValues(),
- new String[]{
- "com.foo.myvalidator",
- "javax.faces.DoubleRange",
- "javax.faces.Length",
- "javax.faces.LongRange"} );
-
- }
-
- public void testGetExpectedRuntimeValue() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_CORE_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (Exception e) {
- }
- }
-
- public void testValidValues() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_CORE_URI, tagName, attrName);
- assertNotNull(vv);
-
- assertTrue(vv.isValidValue("com.foo.myvalidator"));
- assertTrue(vv.isValidValue("javax.faces.DoubleRange"));
- assertTrue(vv.isValidValue("javax.faces.Length"));
- assertTrue(vv.isValidValue("javax.faces.LongRange"));
-
- assertFalse(vv.isValidValue("com.foo.myconverter"));
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/IntegerTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/IntegerTypeTest.java
deleted file mode 100644
index 0d04745..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/IntegerTypeTest.java
+++ /dev/null
@@ -1,74 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class IntegerTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertTrue(possibleValueAdapters.isEmpty());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("0"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- Assert.assertTrue(vv.isValidValue("255"));
- Assert.assertFalse(vv.isValidValue("False"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555555555555555555"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555f9"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("2e1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue() != null);
- Assert.assertTrue(dv.getDefaultValue().equals("10"));
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
- public void testGetExpectedReturnType(){
- Assert.assertNotNull(validELValuesAdapters);
- IValidELValues vvel = (IValidELValues)validELValuesAdapters.get(0);
- try {
- Assert.assertEquals("int", vvel.getExpectedRuntimeType().toUserReadableString());
- } catch (ELIsNotValidException e) {
- fail("testGetExpectedReturnType");
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFCoreTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFCoreTestCase.java
deleted file mode 100644
index 058c8ad..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFCoreTestCase.java
+++ /dev/null
@@ -1,18 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-public abstract class JSFCoreTestCase extends TaglibProcessingTestCase{
- public void setUp(){
- uri = "http://java.sun.com/jsf/core";
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFHTMLTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFHTMLTestCase.java
deleted file mode 100644
index b15c217..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JSFHTMLTestCase.java
+++ /dev/null
@@ -1,181 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataDomainContext;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryContextFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.MetaDataQueryFactory;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainEntityPredicateMatcher;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainMetaDataQuery;
-import org.eclipse.jst.jsf.common.metadata.query.internal.taglib.ITaglibDomainPredicateMatcherFactory;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV11;
-import org.eclipse.jst.jsf.metadata.tests.util.JSPTestCase;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfo;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfos;
-import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
-import org.eclipse.jst.jsf.test.util.mock.MockProject;
-import org.eclipse.jst.jsf.test.util.mock.MockWorkspaceContext;
-
-public class JSFHTMLTestCase extends JSPTestCase implements IJSFRuntimeRequiredV11{
- private String _uri;
- private ITaglibDomainMetaDataModelContext _context;
- private static final boolean DEBUG = false;
-
- public JSFHTMLTestCase () {
- super( JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
-
- }
- public void setUp() throws Exception{
- super.setUp();
-
-// projectTestEnvironment.loadResourceInWebRoot(MetadataTestsPlugin.getDefault().getBundle(),
-// "/testfiles/html_basic.tld",
-// "/WEB-INF/lib/html_basic.tld");
-
- _uri = "http://java.sun.com/jsf/html";
- _context = TaglibDomainMetaDataQueryHelper.createMetaDataModelContext(_testEnv.getTestProject(), _uri);
- }
-
- public void testPaletteInfos(){
- Model model = TaglibDomainMetaDataQueryHelper.getModel(_context);
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(model , PaletteInfos.TRAIT_ID);
- assertNotNull(trait);
- assertTrue(trait.getValue() instanceof PaletteInfos);
- PaletteInfos pis = (PaletteInfos)trait.getValue();
- PaletteInfo cmdBtn = pis.findPaletteInfoById("commandButton");
- assertNotNull(cmdBtn);
- assertEquals("Command Button", cmdBtn.getDisplayLabel());
-
- PaletteInfo info = pis.findPaletteInfoById("inputText");
- assertNotNull(info);
- //requires jsf html tld to work!
- assertNotNull(info.getDisplayLabel());
- assertNotNull(info.getDescription());
- assertNull(info.getExpert());
- assertNull(info.getHidden());
- assertFalse(info.isExpert());
- assertFalse(info.isHidden());
- assertNotNull(info.getSmallIcon());
- assertNotNull(info.getLargeIcon());
- }
-
- public void testCreateInfos(){
- Trait trait = TaglibDomainMetaDataQueryHelper.getTrait(_context , "dataTable", TagCreationInfo.TRAIT_ID);
- assertNotNull(trait);
- assertTrue(trait.getValue() instanceof TagCreationInfo);
- TagCreationInfo tci = (TagCreationInfo)trait.getValue();
-
- Object template = tci.getTemplate();
- assertNotNull(template);
- assertTrue(template instanceof String);
-
- trait = TaglibDomainMetaDataQueryHelper.getTrait(_context , "commandLink", TagCreationInfo.TRAIT_ID);
- assertNotNull(trait);
- assertTrue(trait.getValue() instanceof TagCreationInfo);
- tci = (TagCreationInfo)trait.getValue();
- assertNotNull(tci.getAttributes());
- assertNotNull(tci.getTemplate());
- assertEquals(0, tci.getAttributes().size());
-
- }
-
- public void testQuery() throws Exception {
- //tests querying JSF_HTML using new APIs
- MockProject project = new MockWorkspaceContext().createProject("test");
- IMetaDataDomainContext context = MetaDataQueryContextFactory.getInstance().createTaglibDomainModelContext(project);
- ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(context);
-
- Model tagLib = query.findTagLibraryModel(_uri);
- assertNotNull(tagLib);
-
- Entity tag = query.findTagEntity(tagLib, "commandButton");
- assertNotNull(tag);
-
- Entity tagAttr = query.findTagAttributeEntity(tag, "value");
- assertNotNull(tagAttr);
-
- Trait trait1 = query.findTrait(tagLib, "paletteInfos");
- assertNotNull(trait1);
-
- Trait trait2 = query.findTrait(tag, "small-icon");
- assertNotNull(trait2);
-
- Trait trait3 = query.findTrait(tagAttr, "attribute-value-runtime-type");
- assertNotNull(trait3);
-
- //All tags beginning with c (case-insensitve)
- ITaglibDomainPredicateMatcherFactory factory = MetaDataQueryContextFactory.getInstance().getTaglibDomainPredicateMatcherFactory();
- ITaglibDomainEntityPredicateMatcher entityMatcher = factory.createTagEntityMatcher(_uri, "^[cC].*");
- IResultSet<Entity> tags = query.findEntities(entityMatcher);
- assertNotNull(tags.getResults());
- assertEquals(3, tags.getResults().size());
- dumpEntities(tags.getResults(), "All tags beginning with c (case-insensitive)");
-
-
- //DISABLING BELOW SINCE IT MAY BE TOUGH TO MAINTAIN
-// //All traits with attribute-value-runtime-types for tag attrs beginning with l, m, n,..., or p (case-sensitive)
-// entityMatcher = factory.createTagAttributeEntityMatcher(_uri,"^[d].*", "^[a-c].*");
-// IPredicateMatcher<Trait> traitMatcher = factory.createTraitMatcher("attribute-value-runtime-type");
-// IResultSet<Trait> traits = query.findTraits(entityMatcher, traitMatcher);
-// assertNotNull(traits.getResults());
-//// assertEquals(3, traits.getResults().size());
-// dumpTraits(traits.getResults(), "All traits with attribute-value-runtime-types for tag attrs on tags beginning beginning with a, b, or c (case-sensitive)");
-
-
- }
- private void dumpEntities(List<Entity> tags, String title) throws Exception {
- if (DEBUG ) {
- printHeader(title);
- for (final Entity tag: tags) {
- System.out.println(tag.getModel().getId()+"/"+tag.getId());
- }
- printFooter(tags.size());
- }
- }
-
-// private void dumpTraits(List<Trait> traits, String title) throws Exception {
-// if (DEBUG ) {
-// printHeader(title);
-// for (final Trait trait: traits) {
-// System.out.println(trait.getId() + "(for: "+trait.eContainer().toString()+")");
-// }
-// printFooter(traits.size());
-// }
-// }
-
- private void printHeader(String title) {
- System.out.println();
- System.out.println(title);
- printSeparator();
- }
-
- private void printFooter(int size) {
- printSeparator();
- System.out.println("Size: "+size);
- System.out.println();
-
- }
-
- private void printSeparator() {
- System.out.println("--------------------------------------------------------");
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JavaClassTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JavaClassTypeTest.java
deleted file mode 100644
index 900d79d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/JavaClassTypeTest.java
+++ /dev/null
@@ -1,138 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.IJSFRuntimeRequiredV11;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class JavaClassTypeTest extends SingleJSPTestCase implements IJSFRuntimeRequiredV11 {
-
- public JavaClassTypeTest() {
- super("/testfiles/jsps/javaClassType.jsp.data",
- "/javaClassType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
-
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- //add source files
- addJavaFile("MyConverter");
- addJavaFile("MyConverterSubclass1");
- addJavaFile("MyConverterSubclass2");
- addJavaFile("MyConverterSubclass3");
- addJavaFile("MySubclassOfMyConverterSubclass1");
-
- }
-
-// public void testSanity() {
-// final IJavaProject javaProject = _jdtTestEnv.getJavaProject();
-// assertNotNull(javaProject);
-// assertNotNull(_structuredDocument);
-// }
-
- public void testPossibleValues() {
-
- IPossibleValues pv = (IPossibleValues)getProcessor(IPossibleValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType1");
- assertNotNull(pv.getPossibleValues());
- assertEquals(3, pv.getPossibleValues().size());
- // all classes implement
- assertPossibleValues(pv.getPossibleValues(),
- new String[]{
- "com.foo.MyConverterSubclass1",
- "com.foo.MyConverterSubclass2",
- "com.foo.MySubclassOfMyConverterSubclass1"} );
- //Below is not currently working ... need to fix results with valid-superclass set
-// pv = (IPossibleValues)getProcessor(IPossibleValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType2");
-// assertNotNull(pv.getPossibleValues());
-// assertTrue(pv.getPossibleValues().size() == 5);
-// assertPossibleValues(pv.getPossibleValues(),
-// new String[]{
-// "com.foo.MyConverter",
-// "com.foo.MyConverterSubclass1",
-// "com.foo.MyConverterSubclass2",
-// "com.foo.MyConverterSubclass3",
-// "com.foo.MySubclassOfMyConverterSubclass1"} );
-
- pv = (IPossibleValues)getProcessor(IPossibleValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType3");
- assertNotNull(pv.getPossibleValues());
- assertEquals(3, pv.getPossibleValues().size());
- assertPossibleValues(pv.getPossibleValues(),
- new String[]{
- "com.foo.MyConverterSubclass2",
- "com.foo.MyConverterSubclass3",
- "com.foo.MySubclassOfMyConverterSubclass1"} );
-
- //Below is not currently working... need to fix results with multiple valid-interfaces set
-// pv = (IPossibleValues)getProcessor(IPossibleValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType4");
-// assertNotNull(pv.getPossibleValues());
-// assertTrue(pv.getPossibleValues().size() == 2);
-// assertPossibleValues(pv.getPossibleValues(),
-// new String[]{
-// "com.foo.MyConverterSubclass2",
-// "com.foo.MySubclassOfMyConverterSubclass1"} );
- }
-
-
-
- public void testValidValues() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_CORE_URI, "actionListener", "type");
-
- assertNotNull(vv);
- assertFalse(vv.isValidValue("foobar"));
- //below is valid only when using Sun impl
- //assertTrue(vv.isValidValue("com.sun.faces.application.ActionListenerImpl"));
-
- //single interface
- vv = (IValidValues)getProcessor(IValidValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType1");
- assertNotNull(vv);
- assertFalse(vv.isValidValue("com.foo.MyConverter"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass1"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass2"));
- assertFalse(vv.isValidValue("com.foo.MyConverterSubclass3"));
- assertTrue(vv.isValidValue("com.foo.MySubclassOfMyConverterSubclass1"));
-
- //superclass test
- vv = (IValidValues)getProcessor(IValidValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType2");
- assertNotNull(vv);
- assertTrue(vv.isValidValue("com.foo.MyConverter"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass1"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass2"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass3"));
- assertTrue(vv.isValidValue("com.foo.MySubclassOfMyConverterSubclass1"));
-
- //superclass + single interface test
- vv = (IValidValues)getProcessor(IValidValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType3");
- assertNotNull(vv);
- assertFalse(vv.isValidValue("com.foo.MyConverter"));
- assertFalse(vv.isValidValue("com.foo.MyConverterSubclass1"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass2"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass3"));
- assertTrue(vv.isValidValue("com.foo.MySubclassOfMyConverterSubclass1"));
-
- //superclass + multiple interface test
- vv = (IValidValues)getProcessor(IValidValues.class, TAG_TEST_URI, TAG_TEST_TAG, "JavaClassType4");
- assertNotNull(vv);
- assertFalse(vv.isValidValue("com.foo.MyConverter"));
- assertFalse(vv.isValidValue("com.foo.MyConverterSubclass1"));
- assertTrue(vv.isValidValue("com.foo.MyConverterSubclass2"));
- assertFalse(vv.isValidValue("com.foo.MyConverterSubclass3"));
- assertTrue(vv.isValidValue("com.foo.MySubclassOfMyConverterSubclass1"));
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LanguageCodeTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LanguageCodeTypeTest.java
deleted file mode 100644
index 15c7be8..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LanguageCodeTypeTest.java
+++ /dev/null
@@ -1,48 +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.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-
-public class LanguageCodeTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- IPossibleValues pvs = (IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertEquals(58, pvs.getPossibleValues().size());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- //positive tests
- assertTrue(vv.isValidValue("en"));
- //negative tests
- vv.getValidationMessages().clear();
- assertFalse(vv.isValidValue("xxx"));
- }
-
- public void testPropertyPageDescriptor(){
- Assert.assertNotNull(propertyPageDescriptorAdapters);
- Assert.assertFalse(propertyPageDescriptorAdapters.isEmpty());
-
- IPropertyPageDescriptor ppd =(IPropertyPageDescriptor)propertyPageDescriptorAdapters.get(0);
- //positive tests
- assertEquals("ACategory", ppd.getCategory());
- assertEquals(false, ppd.isRequired());
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LengthTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LengthTypeTest.java
deleted file mode 100644
index ba71ccc..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LengthTypeTest.java
+++ /dev/null
@@ -1,95 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class LengthTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertTrue(possibleValueAdapters.isEmpty());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("0"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- Assert.assertTrue(vv.isValidValue("100"));
- Assert.assertTrue(vv.isValidValue("101"));
- Assert.assertFalse(vv.isValidValue("False"));
- Assert.assertFalse(vv.isValidValue("False"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555555555555555555"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555f9"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("2e1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- //test percentages
- Assert.assertTrue(vv.isValidValue("20%"));
- Assert.assertFalse(vv.isValidValue("%20"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("2%0"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("%"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("1x"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("x"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-10%"));
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-20"));
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("100%"));
-
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue() != null);
- Assert.assertTrue(dv.getDefaultValue().equals("100%"));
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
- public void testGetExpectedReturnType(){
- Assert.assertNotNull(validELValuesAdapters);
- IValidELValues vvel = (IValidELValues)validELValuesAdapters.get(0);
- try {
- Assert.assertEquals("int", vvel.getExpectedRuntimeType().toUserReadableString());
- } catch (ELIsNotValidException e) {
- fail("testGetExpectedReturnType");
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LinkTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LinkTypeTest.java
deleted file mode 100644
index e17a3bb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LinkTypeTest.java
+++ /dev/null
@@ -1,44 +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
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class LinkTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues() {
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertFalse(possibleValueAdapters.isEmpty());
-
- IPossibleValues pvs = (IPossibleValues) possibleValueAdapters.get(0);
- Assert.assertTrue(pvs.getPossibleValues().size() >= 8);
- }
-
- public void testValidValuesValues() {
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues pvs = (IValidValues) validValuesAdapters.get(0);
- Assert.assertTrue(pvs.isValidValue("a"));
- Assert.assertTrue(pvs.isValidValue("Chapter"));
-
- //negative
- Assert.assertFalse(pvs.isValidValue(""));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue(" "));
- pvs.getValidationMessages().clear();
- Assert.assertFalse(pvs.isValidValue(null));
- pvs.getValidationMessages().clear();
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LocaleTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LocaleTypeTest.java
deleted file mode 100644
index 13d29da..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LocaleTypeTest.java
+++ /dev/null
@@ -1,72 +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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.taglibprocessing.attributevalues.MultiSignatureEnumerationType;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-
-/**
- * Tests {@link LocaleTypeTest} and {@link MultiSignatureEnumerationType} *
- */
-public class LocaleTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- IPossibleValues pvs = (IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertTrue( pvs.getPossibleValues().size() > 50);//there are a bunch and it depends on the env.
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- //positive tests
- assertTrue(vv.isValidValue("en"));
- //negative tests
- vv.getValidationMessages().clear();
- assertFalse(vv.isValidValue("xxx"));
- }
-
- public void testPropertyPageDescriptor(){
- Assert.assertNotNull(propertyPageDescriptorAdapters);
- Assert.assertFalse(propertyPageDescriptorAdapters.isEmpty());
-
- IPropertyPageDescriptor ppd =(IPropertyPageDescriptor)propertyPageDescriptorAdapters.get(0);
- //positive test
- assertEquals("ACategory", ppd.getCategory());
- assertEquals(false, ppd.isRequired());
-
- }
-
- public void testELValidValues() {
- //value can be String (non-EL) or an EL expression pointing at Locale
- Assert.assertNotNull(validELValuesAdapters);
- Assert.assertFalse(validELValuesAdapters.isEmpty());
-
- IValidELValues vv =(IValidELValues)validELValuesAdapters.get(0);
- try {
- String[] validSigs = vv.getExpectedRuntimeType().getSignatures();
- assertEquals(2, validSigs.length);
- assertEquals("Ljava.util.Locale;", validSigs[0]);
- assertEquals("Ljava.lang.String;", validSigs[1]);
- } catch (ELIsNotValidException e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LongTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LongTypeTest.java
deleted file mode 100644
index ca13ed4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/LongTypeTest.java
+++ /dev/null
@@ -1,82 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class LongTypeTest extends TaglibProcessingTestCase {
-
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertTrue(possibleValueAdapters.isEmpty());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("0"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("1000"));
- Assert.assertTrue(vv.isValidValue("-1000"));
- Assert.assertFalse(vv.isValidValue("-10L"));
- Assert.assertFalse(vv.isValidValue("False"));
- Assert.assertFalse(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("-1001"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertTrue(vv.isValidValue("-1"));
- Assert.assertTrue(vv.getValidationMessages().size()==0);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555555555555555555"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("555f9"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- vv.getValidationMessages().clear();
- Assert.assertFalse(vv.isValidValue("2e1"));
- Assert.assertTrue(vv.getValidationMessages().size()==1);
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)defaultValueAdapters.get(0);
- Assert.assertTrue(dv.getDefaultValue() == null);
-// Assert.assertTrue(dv.getDefaultValue().equals("10"));
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
- public void testGetExpectedReturnType(){
- Assert.assertNotNull(validELValuesAdapters);
- IValidELValues vvel = (IValidELValues)validELValuesAdapters.get(0);
- try {
- Assert.assertEquals("long", vvel.getExpectedRuntimeType().toUserReadableString());
- } catch (ELIsNotValidException e) {
- fail("testGetExpectedReturnType");
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/MethodBindingTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/MethodBindingTypeTests.java
deleted file mode 100644
index 03556f7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/MethodBindingTypeTests.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage;
-
-public class MethodBindingTypeTests extends SingleJSPTestCase {
- private final String tagName = "inputText";
- private final String attrName = "validator";
-
- public MethodBindingTypeTests() {
- super( "/testfiles/jsps/facesConfigValidatorIDType.jsp.data/",
- "/facesConfigValidatorIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
- protected void setUp() throws Exception {
- super.setUp();
-
- addJavaFile("MyBean");
- }
-
- public void testGetExpectedRuntimeType() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (Exception e) {
- }
-
- }
-
- public void testPossibleValues() {
- IPossibleValues vv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv); //possible value is not supported!
-
- }
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- assertFalse(vv.isValidValue("everything is invalid!"));
- assertNotNull(vv.getValidationMessages());
- assertEquals(1, vv.getValidationMessages().size());
- //throw in some coverage on IValidationMessage
- IValidationMessage msg = (IValidationMessage)vv.getValidationMessages().get(0);
- assertEquals("MethodBinding attribute values must be EL expressions.", msg.getMessage());
- assertNull(msg.getCode());
- assertEquals(IStatus.WARNING, msg.getSeverity());
-
- assertFalse(vv.isValidValue(""));
-
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/NumberPatternTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/NumberPatternTypeTest.java
deleted file mode 100644
index 5e852a9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/NumberPatternTypeTest.java
+++ /dev/null
@@ -1,31 +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
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-
-public class NumberPatternTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues() {
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertFalse(possibleValueAdapters.isEmpty());
-
- IPossibleValues pvs = (IPossibleValues) possibleValueAdapters.get(0);
- Assert.assertTrue(pvs.getPossibleValues().size() >= 8);
- }
-
- public void testValidValuesValues() {
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertTrue(validValuesAdapters.isEmpty());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/StringTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/StringTypeTest.java
deleted file mode 100644
index 4cb5d10..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/StringTypeTest.java
+++ /dev/null
@@ -1,69 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-
-public class StringTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- Assert.assertFalse(possibleValueAdapters.isEmpty());
-
- IPossibleValues pv =(IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertTrue(pv.getPossibleValues().size() == 4);
-
- IPossibleValue val = (IPossibleValue)pv.getPossibleValues().get(0);
- Assert.assertFalse(val.getDisplayValue().equals(val.getValue()));
-
- Assert.assertNotNull(val.getIcon());
- Assert.assertFalse(val.getIcon().getClass().getName().equals("org.eclipse.jface.resource.MissingImageDescriptor"));// equals("/testfiles/icons/attr_val.gif"));
- Assert.assertTrue(val.getIcon().getClass().getName().equals("org.eclipse.jface.resource.URLImageDescriptor"));// equals("/icons/foo.gif"));
-
- Assert.assertTrue(val.isDefaultValue());
-
- val = (IPossibleValue)pv.getPossibleValues().get(1);
- Assert.assertFalse(val.getDisplayValue().equals(val.getValue()));
- Assert.assertFalse(val.isDefaultValue());
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)possibleValueAdapters.get(0);
- Assert.assertTrue(vv.isValidValue("A"));
- Assert.assertTrue(vv.isValidValue("B"));
- Assert.assertFalse(vv.isValidValue("a"));
-
- }
-
- public void testDefaultValues(){
- Assert.assertNotNull(defaultValueAdapters);
- Assert.assertFalse(defaultValueAdapters.isEmpty());
-
- IDefaultValue dv =(IDefaultValue)possibleValueAdapters.get(0);
- Assert.assertNotNull(dv.getDefaultValue());
-
- }
-
- public void testCreateValues(){
- Assert.assertNotNull(createValuesAdapters);
- Assert.assertTrue(createValuesAdapters.isEmpty());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TaglibProcessingTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TaglibProcessingTestCase.java
deleted file mode 100644
index 7bde25d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TaglibProcessingTestCase.java
+++ /dev/null
@@ -1,68 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.metadata.tests.AbstractBaseMetaDataTestCase;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.ICreateValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
-
-public abstract class TaglibProcessingTestCase extends AbstractBaseMetaDataTestCase {
-// protected IStructuredDocumentContext docContext;
- protected String uri = "http://org.eclipse.jsf/tagprocessing";
- protected String bundle = "org.eclipse.jst.jsf.core";
- protected String barkerBundle = MetadataTestsPlugin.ID_BUNDLE;
- protected String tag = "MyTag";
- protected String attributeName;
-
- protected List<?> possibleValueAdapters;
- protected List<?> validValuesAdapters;
- protected List<?> defaultValueAdapters;
- protected List<?> createValuesAdapters;
- protected List<?> validELValuesAdapters;
- protected List<?> propertyPageDescriptorAdapters;
-
- public void setUp() throws Exception{
- super.setUp();
-
- possibleValueAdapters = getProcessorAdapters(IPossibleValues.class);
- validValuesAdapters = getProcessorAdapters(IValidValues.class);
- defaultValueAdapters = getProcessorAdapters(IDefaultValue.class);
- createValuesAdapters = getProcessorAdapters(ICreateValues.class);
- validELValuesAdapters = getProcessorAdapters(IValidELValues.class);
- propertyPageDescriptorAdapters = getProcessorAdapters(IPropertyPageDescriptor.class);
- }
-
- private String getAttributeNameFromTest(){
- if (attributeName == null){
- attributeName = this.getClass().getName();
- attributeName = attributeName.substring(attributeName.lastIndexOf(".") + 1);
- attributeName = attributeName.substring(0,attributeName.length() - 4);
- }
- return attributeName;
- }
-
- protected List<? extends IMetaDataEnabledFeature> getProcessorAdapters(Class<?> featureClass) {
- return MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(featureClass, docContext,
- uri, tag , getAttributeNameFromTest());
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TimeZoneTypeTest.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TimeZoneTypeTest.java
deleted file mode 100644
index a606be4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/TimeZoneTypeTest.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.metadata.tests.taglibprocessing;
-
-import java.util.Locale;
-
-import junit.framework.Assert;
-
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class TimeZoneTypeTest extends TaglibProcessingTestCase {
- public void testPossibleValues(){
- Assert.assertNotNull(possibleValueAdapters);
- IPossibleValues pvs = (IPossibleValues)possibleValueAdapters.get(0);
- Assert.assertTrue( pvs.getPossibleValues().size() > 50);//there are a bunch and it depends on the env.
- }
-
- public void testValidValues(){
- Assert.assertNotNull(validValuesAdapters);
- Assert.assertFalse(validValuesAdapters.isEmpty());
-
- IValidValues vv =(IValidValues)validValuesAdapters.get(0);
- //positive tests
- if (Locale.getDefault().getDisplayLanguage().equals(Locale.ENGLISH.getDisplayLanguage()))
- assertTrue(vv.isValidValue("America/Edmonton"));
- //negative tests
- vv.getValidationMessages().clear();
- assertFalse(vv.isValidValue("xxx"));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueBindingTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueBindingTypeTests.java
deleted file mode 100644
index 38be8cb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueBindingTypeTests.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class ValueBindingTypeTests extends SingleJSPTestCase {
- private final String tagName = "outputText";
- private final String attrName = "value";
-
- public ValueBindingTypeTests() {
- super( "/testfiles/jsps/facesConfigValidatorIDType.jsp.data/",
- "/facesConfigValidatorIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
- protected void setUp() throws Exception {
- super.setUp();
-
- addJavaFile("MyBean");
- }
-
- public void testGetExpectedRuntimeType() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (Exception e) {
- }
-
- }
-
- public void testPossibleValues() {
- IPossibleValues vv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv); //possible value is not supported!
-
- }
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv); // non-EL valid vals not checked
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueTypeTests.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueTypeTests.java
deleted file mode 100644
index 2d1de98..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/taglibprocessing/ValueTypeTests.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.taglibprocessing;
-
-import org.eclipse.jst.jsf.common.internal.types.CompositeType;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadata.tests.util.SingleJSPTestCase;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues;
-import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues;
-
-public class ValueTypeTests extends SingleJSPTestCase {
- private final String tagName = "inputText";
- private final String attrName = "value";
-
- public ValueTypeTests() {
- super( "/testfiles/jsps/facesConfigValidatorIDType.jsp.data/",
- "/facesConfigValidatorIDType.jsp",
- JSFVersion.V1_1,
- "/testfiles/web/faces-config_1_1.xml.data");
- }
- protected void setUp() throws Exception {
- super.setUp();
-
- addJavaFile("MyBean");
- }
-
- public void testGetExpectedRuntimeType() {
- IValidELValues vv = (IValidELValues)getProcessor(IValidELValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- try {
- assertNotNull(vv.getExpectedRuntimeType());
- assertTrue(vv.getExpectedRuntimeType() instanceof CompositeType);
- } catch (Exception e) {
- }
-
- }
-
- public void testPossibleValues() {
- IPossibleValues vv = (IPossibleValues)getProcessor(IPossibleValues.class, JSF_HTML_URI, tagName, attrName);
- assertNull(vv); //possible value is not supported!
-
- }
- public void testIsValidValue() {
- IValidValues vv = (IValidValues)getProcessor(IValidValues.class, JSF_HTML_URI, tagName, attrName);
- assertNotNull(vv);
-
- assertTrue(vv.isValidValue("anything"));
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/BaseTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/BaseTestCase.java
deleted file mode 100644
index 81c448f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/BaseTestCase.java
+++ /dev/null
@@ -1,194 +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.metadata.tests.util;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase;
-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;
-
-/**
- * Base class for all JSP test cases in this plugin
- *
- * @author cbateman
- *
- */
-public abstract class BaseTestCase extends ConfigurableTestCase
-{
- public static final String PROXY_SETTING_HOST = "proxySettings_Host";
- public static final String PROXY_SETTING_PORT = "proxySettings_Port";
- public static final String JSF_FACET_VERSION = "jsfFacetVersion";
-
- private final JSFVersion _defaultJSFVersion;
-
- /**
- * Default constructor
- */
- public BaseTestCase(JSFVersion defaultJSFVersion)
- {
- super();
- _defaultJSFVersion = defaultJSFVersion;
- }
-
- /**
- * @param name
- */
- public BaseTestCase(String name, JSFVersion defaultJSFVersion) {
- super(name);
- _defaultJSFVersion = defaultJSFVersion;
- }
-
- /**
- * The dynamic web project test environment
- */
- protected WebProjectTestEnvironment _testEnv;
- /**
- * A handle to the Java project test environment
- */
- protected JDTTestEnvironment _jdtTestEnv;
-
- private MyConfiguration _configuration;
-
-
- protected void doStandaloneSetup()
- {
- super.doStandaloneSetup();
- _configuration = new MyConfiguration("www-proxy.uk.oracle.com","80",_defaultJSFVersion);
- }
-
- protected void doTestSuiteSetup()
- {
- super.doTestSuiteSetup();
- _configuration = new MyConfiguration(_testConfiguration);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- JSFTestUtil.setValidationEnabled(false);
-
- if (_configuration.isProxyEnabled())
- {
- JSFTestUtil.setInternetProxyPreferences
- (true, _configuration.getProxyHostName()
- , _configuration.getProxyPort());
- }
-
- // if JSF 1.1, use web facet 2.4, if higher then use 2.5
- final String webProjVersion =
- (_configuration.getJsfVersion() == JSFVersion.V1_0
- || _configuration.getJsfVersion() == JSFVersion.V1_1)
- ? "2.4" : "2.5";
-
- _testEnv = new WebProjectTestEnvironment
- ("MetaDataTest_"+this.getClass().getName()+"_"+getName()+"_"+_configuration.getJsfVersion()
- , JavaFacet.VERSION_1_5
- , ProjectFacetsManager.getProjectFacet( "jst.web" ).getVersion(webProjVersion));
- _testEnv.createProject(false);
- assertNotNull(_testEnv);
- assertNotNull(_testEnv.getTestProject());
- assertTrue(_testEnv.getTestProject().isAccessible());
-
- // sub-classes may custom their JSF env; primarily to decide what version
- // of JSF
- configureJSFEnvironment();
-
- _jdtTestEnv = new JDTTestEnvironment(_testEnv);
- configureJDTTestEnvironment(_jdtTestEnv);
- }
-
- /**
- * Used to configure the JSF environment. After successful
- * return, sub-classes must ensure that their JSF facet is
- * installed and that there is at least one faces-config (in WEB-INF)
- * installed
- *
- * @throws Exception
- */
- protected abstract JSFFacetedTestEnvironment configureJSFEnvironment() throws Exception;
-
- /**
- * Add all Java and property file resources to the Java source path
- * needed for testing. Sub-classes may override.
- *
- * @param jdtTestEnv
- * @throws Exception
- */
- protected void configureJDTTestEnvironment(JDTTestEnvironment jdtTestEnv) throws Exception
- {
- }
-
- protected void tearDown() throws Exception
- {
- _testEnv.getTestProject().close(null);
- //_testEnv.getTestProject().delete(true, null);
- }
-
-
- protected void addJavaFile(String file) throws IOException,
- JavaModelException, CoreException {
- TestFileResource resource = new TestFileResource();
- resource.load(MetadataTestsPlugin.getDefault().getBundle(), "/testfiles/java/"+file+".java.data");
- _jdtTestEnv.addSourceFile("src", "com.foo", file, resource.toString());
- }
-
-
- private static class MyConfiguration
- {
- private final String _proxyHostName;
- private final String _proxyPort;
- private final JSFVersion _jsfVersion;
-
- MyConfiguration(final String proxyHostName, final String proxyPort, final JSFVersion jsfVersion)
- {
- _proxyHostName = proxyHostName;
- _proxyPort = proxyPort;
- _jsfVersion = jsfVersion;
- }
-
- MyConfiguration(TestConfiguration configuration)
- {
- _proxyHostName = configuration.get(BaseTestCase.PROXY_SETTING_HOST);
- _proxyPort = configuration.get(BaseTestCase.PROXY_SETTING_PORT);
- _jsfVersion = JSFVersion.valueOfString(configuration.get(BaseTestCase.JSF_FACET_VERSION));
- }
-
- public boolean isProxyEnabled()
- {
- return _proxyHostName != null && _proxyPort != null;
- }
-
- public String getProxyHostName() {
- return _proxyHostName;
- }
-
- public String getProxyPort() {
- return _proxyPort;
- }
-
- public JSFVersion getJsfVersion() {
- return _jsfVersion;
- }
-
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequired.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequired.java
deleted file mode 100644
index b369070..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequired.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.util;
-
-/**
- * Interface alerts the test suite that a JSF runtime is required.
- */
-public interface IJSFRuntimeRequired {
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV11.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV11.java
deleted file mode 100644
index 6156dad..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV11.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.util;
-
-/**
- * Interface alerts the test suite that a v1.1 JSF runtime is required.
- */
-public interface IJSFRuntimeRequiredV11 extends IJSFRuntimeRequired {
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV12.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV12.java
deleted file mode 100644
index f02531a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/IJSFRuntimeRequiredV12.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.util;
-
-/**
- * Interface alerts the test suite that a v1.2 JSF runtime is required.
- */
-public interface IJSFRuntimeRequiredV12 extends IJSFRuntimeRequired {
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/JSPTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/JSPTestCase.java
deleted file mode 100644
index 9a94761..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/JSPTestCase.java
+++ /dev/null
@@ -1,172 +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 - initial implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.metadata.tests.util;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-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.JSFCoreUtilHelper;
-import org.eclipse.jst.jsf.core.tests.util.JSFFacetedTestEnvironment;
-import org.eclipse.jst.jsf.metadata.tests.MetadataTestsPlugin;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-public class JSPTestCase extends BaseTestCase
-{
- public static final String FACES_CONFIG_FILE = "facesConfigFile";
- public static final String JSF_CORE_URI = "http://java.sun.com/jsf/core";
- public static final String JSF_HTML_URI = "http://java.sun.com/jsf/html";
- public static final String TAG_TEST_URI = "http://org.eclipse.jsf/tagprocessing";
- public static final String TAG_TEST_TAG = "MyTag";
-
- /**
- * Test config
- */
- private MyConfiguration _myConfig;
- private final JSFVersion _defaultJSFVersion;
- private final String _defaultFacesConfigFile;
-
- private String[] _runtimeJars;
-
-
- public JSPTestCase(final JSFVersion defaultJSFVersion, final String defaultFacesConfigFile)
- {
- super(defaultJSFVersion);
- _defaultJSFVersion = defaultJSFVersion;
- _defaultFacesConfigFile = defaultFacesConfigFile;
- }
-
- protected void doStandaloneSetup()
- {
- super.doStandaloneSetup();
-
- // NOTE: defaults to 1.1 tests for standalone testing
- _myConfig = new MyConfiguration
- (_defaultJSFVersion
- , _defaultFacesConfigFile);
- }
-
- protected void doTestSuiteSetup()
- {
- super.doTestSuiteSetup();
-
- _myConfig = new MyConfiguration(_testConfiguration);
- }
-
- @Override
- protected JSFFacetedTestEnvironment configureJSFEnvironment() throws Exception
- {
- final JSFVersion version = _myConfig.getFacetVersion();
- JSFFacetedTestEnvironment jsfFacedEnv = new JSFFacetedTestEnvironment(_testEnv);
- jsfFacedEnv.initialize(version.toString());
-
- try {
- initializeJSFRuntime();
- JSFCoreUtilHelper.createRegistryAndAddReferences(jsfFacedEnv, _runtimeJars, version);
- } catch (NoJSFRuntimeFoundException e) {
- //
- }
-
- _testEnv.loadResourceInWebRoot(MetadataTestsPlugin.getDefault().getBundle(),
- _myConfig.getFacesConfigFile(),
- "/WEB-INF/faces-config.xml");
- return jsfFacedEnv;
- }
-
-
- // dead?
-// private String[] getArchiveFiles() {
-//// getJsfImplEnv();
-// return null;
-// }
-
- protected IFile loadJSP(final String srcFileName, final String destFileName) throws Exception
- {
- return (IFile) _testEnv.loadResourceInWebRoot
- (MetadataTestsPlugin.getDefault().getBundle(),
- srcFileName, destFileName);
- }
-
- /**
- * @param document
- * @param docPos
- * @return the text at docPos in document or null if no such text
- */
- protected String getText(IStructuredDocument document, int docPos)
- {
- final IStructuredDocumentContext context =
- getStructuredDocumentContext(document, docPos);
- final ITextRegionContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getTextRegionResolver(context);
- return stripQuotes(resolver.getRegionText());
- }
-
- protected IStructuredDocumentContext getStructuredDocumentContext(IStructuredDocument document, int docPos) {
- return IStructuredDocumentContextFactory.INSTANCE.getContext(document, docPos);
- }
- private String stripQuotes(String text) {
- if (text != null && text.startsWith("\""))
- return text.substring(1, text.length() -1);
- return text;
- }
-
- protected static class MyConfiguration
- {
- private final JSFVersion _facetVersion;
- private final String _facesConfigFile;
-
- MyConfiguration(JSFVersion facetVersion, String facesConfigFile)
- {
- super();
- _facetVersion = facetVersion;
- _facesConfigFile = facesConfigFile;
- }
-
- MyConfiguration(TestConfiguration testConfiguration)
- {
- _facetVersion = JSFVersion.valueOfString(testConfiguration.get(BaseTestCase.JSF_FACET_VERSION));
- _facesConfigFile = testConfiguration.get(FACES_CONFIG_FILE);
- }
-
- public JSFVersion getFacetVersion() {
- return _facetVersion;
- }
-
- public String getFacesConfigFile() {
- return _facesConfigFile;
- }
- }
-
- protected void initializeJSFRuntime() throws NoJSFRuntimeFoundException{
- String dir = JSFCoreUtilHelper.getJSFRuntimeJarsDirectory(_defaultJSFVersion);
- if (dir == null || !jarsFound(dir) )
- throw new NoJSFRuntimeFoundException();
- }
-
- private boolean jarsFound(String dir) {
- java.io.File dirFile = new java.io.File(dir);
- if (dirFile.exists() && dirFile.isDirectory()) {
- File [] files = dirFile.listFiles();
- if (files.length > 0) {
- _runtimeJars = new String[files.length];
- for (int i=0;i<files.length;i++){
- _runtimeJars[i] = files[i].getAbsolutePath();
- }
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/NoJSFRuntimeFoundException.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/NoJSFRuntimeFoundException.java
deleted file mode 100644
index 0f03393..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/NoJSFRuntimeFoundException.java
+++ /dev/null
@@ -1,17 +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
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.metadata.tests.util;
-
-@SuppressWarnings("serial")
-public class NoJSFRuntimeFoundException extends Exception {
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/SingleJSPTestCase.java b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/SingleJSPTestCase.java
deleted file mode 100644
index 680240b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/src/org/eclipse/jst/jsf/metadata/tests/util/SingleJSPTestCase.java
+++ /dev/null
@@ -1,113 +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.metadata.tests.util;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jst.jsf.core.JSFVersion;
-import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-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 abstract class SingleJSPTestCase extends JSPTestCase
-{
-
- public static final String FACES_CONFIG_FILE_NAME_1_1 = "/testfiles/web/faces-config_1_1.xml.data";
- public static final String FACES_CONFIG_FILE_NAME_1_2 = "/testfiles/web/faces-config_1_2.xml.data";
-
- /**
- * 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;
- /**
- * Name of the test data file containing the JSP source for this test
- */
- private final String _srcFileName;
-
- /**
- * Name of the file and path where the JSP source should be put in the
- * test project
- */
- protected final String _destFileName;
-
-
- protected SingleJSPTestCase(final String srcFileName, final String destFileName, final JSFVersion defaultJSFVersion, final String defaultFacesConfigFile)
- {
- super(defaultJSFVersion, defaultFacesConfigFile);
- _srcFileName = srcFileName;
- _destFileName = destFileName;
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _testJSP = loadJSP(_srcFileName, _destFileName);
-
- _structuredModel = StructuredModelManager.getModelManager().getModelForRead(_testJSP);
- _structuredDocument = _structuredModel.getStructuredDocument();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- if (_structuredModel != null)
- {
- _structuredModel.releaseFromRead();
- }
- }
-
- protected IMetaDataEnabledFeature getProcessor(Class<?> klass, String uri, String tagname, String attrName) {
- List<?> ret = MetaDataEnabledProcessingFactory.getInstance().
- getAttributeValueRuntimeTypeFeatureProcessors(klass,
- getStructuredDocumentContext(_structuredDocument, 1), //just need to establish the project; don't really care about offset. should consider improving API
- uri,
- tagname,
- attrName);
-
- if (ret.isEmpty())
- return null;
-
- return (IMetaDataEnabledFeature)ret.get(0);
-
- }
-
- protected void assertPossibleValues(List<?> possibleValues, String[] strings) {
-
- for (int i=0;i < strings.length;i++) {
- boolean found = false;
- for (int j=0;j < possibleValues.size();j++) {
- IPossibleValue val = (IPossibleValue)possibleValues.get(j);
- if (strings[i].equals(val.getValue())){
- found = true;
- break;
- }
- }
- if (! found)
- fail(strings[i] + " was not found as a possible value");
- }
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/test.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/test.xml
deleted file mode 100644
index 5a30f19..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.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.metadata.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.metadata.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.metadata.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.metadata.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.metadata.tests/testfiles/icons/attr_val.gif b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/icons/attr_val.gif
deleted file mode 100644
index d4cb425..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/icons/attr_val.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyBean.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyBean.java.data
deleted file mode 100644
index 8ed374c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyBean.java.data
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.foo;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-
-public class MyBean implements Validator {
-
- public void validate(FacesContext arg0, UIComponent arg1, Object arg2)
- throws ValidatorException {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverter.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverter.java.data
deleted file mode 100644
index c496e49..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverter.java.data
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.foo;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-public class MyConverter implements javax.faces.convert.Converter{
-
- public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
- return null;
- }
-
- public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
- return null;
- }
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass1.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass1.java.data
deleted file mode 100644
index 6a422e0..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass1.java.data
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.foo;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-
-public class MyConverterSubclass1 extends MyConverter implements javax.xml.xpath.XPathFunctionResolver {
-
- public XPathFunction resolveFunction(QName functionName, int arity) {
- return null;
- }
-
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass2.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass2.java.data
deleted file mode 100644
index 04a2902..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass2.java.data
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.foo;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-
-public class MyConverterSubclass2 extends MyConverter implements javax.xml.xpath.XPathFunctionResolver, javax.xml.xpath.XPathVariableResolver{
-
- public XPathFunction resolveFunction(QName functionName, int arity) {
- return null;
- }
-
- public Object resolveVariable(QName variableName) {
- return null;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass3.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass3.java.data
deleted file mode 100644
index ed42a5a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyConverterSubclass3.java.data
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.foo;
-
-import javax.xml.namespace.QName;
-
-public class MyConverterSubclass3 extends MyConverter implements javax.xml.xpath.XPathVariableResolver{
-
- public Object resolveVariable(QName variableName) {
- return null;
- }
-
-}
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MySubclassOfMyConverterSubclass1.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MySubclassOfMyConverterSubclass1.java.data
deleted file mode 100644
index d3c4118..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MySubclassOfMyConverterSubclass1.java.data
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.foo;
-
-import javax.xml.namespace.QName;
-
-public class MySubclassOfMyConverterSubclass1 extends MyConverterSubclass1 implements javax.xml.xpath.XPathVariableResolver{
-
- public Object resolveVariable(QName variableName) {
- return null;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyValidator.java.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyValidator.java.data
deleted file mode 100644
index ce4808f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/java/MyValidator.java.data
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.foo;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.ValidatorException;
-
-public class MyValidator implements javax.faces.validator.Validator{
-
- public void validate(FacesContext arg0, UIComponent arg1, Object arg2)
- throws ValidatorException {
-
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/JSFPage.jsp b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/JSFPage.jsp
deleted file mode 100644
index 0904c6e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/JSFPage.jsp
+++ /dev/null
@@ -1,16 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Insert title here</title>
-</head>
-<body>
- <f:view>
- <f:actionListener type="#{foobar}"/>
- </f:view>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/actionTypeTest.jsp.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/actionTypeTest.jsp.data
deleted file mode 100644
index 49d0091..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/actionTypeTest.jsp.data
+++ /dev/null
@@ -1,17 +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:commandButton action="gotoWelcome"></h:commandButton>
- </h:form></f:view>
- </body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.html b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.html
deleted file mode 100644
index 76e48b9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!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">
-<link rel="stylesheet" href="mystyle.css">
-<link rel="stylesheet" href="foo.css">
-<style type="text/css">
- body {
- color: purple;
- background-color: red; }
- </style>
-<title>Insert title here</title>
-</head>
-<body class="" style="">
- <b style="color: green;">Hello</b>
- <a id="a" class="" style="color: HoneyDew " href="Foo" /></output>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.jsp.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.jsp.data
deleted file mode 100644
index 50f35e2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/cssTypesTest.jsp.data
+++ /dev/null
@@ -1,15 +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">
-<link rel="stylesheet" href="mystyle.css">
-<link rel="stylesheet" href="foo.css">
-<title>Insert title here</title>
-</head>
-<body>
- <h:inputText styleClass=""/>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigConverterIDType.jsp.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigConverterIDType.jsp.data
deleted file mode 100644
index f83af7f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigConverterIDType.jsp.data
+++ /dev/null
@@ -1,18 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<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>
- <f:converter converterId="com.foo.myconverter"/>
- </h:inputText>
- </h:form></f:view>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigValidatorIDType.jsp.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigValidatorIDType.jsp.data
deleted file mode 100644
index 3114833..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/facesConfigValidatorIDType.jsp.data
+++ /dev/null
@@ -1,18 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<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>
- <f:validator validatorId="com.foo.myvalidator"/>
- </h:inputText>
- </h:form></f:view>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/foo.css.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/foo.css.data
deleted file mode 100644
index b4b1cc2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/foo.css.data
+++ /dev/null
@@ -1,157 +0,0 @@
-BODY, P, LI, UL, OL {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 97%;
- color:#000000;
- list-style-position: outside;
-}
-
-A:link {
- font-family: Arial, Helvetica, sans-serif;
- color:#663300;
-
-}
-
-A:active {
- font-family: Arial, Helvetica, sans-serif;
- color:#ff6600;
-
-}
-
-A:visited {
- font-family: Arial, Helvetica, sans-serif;
- color:#996633;
-
-}
-
-A.navigation:link
-{
- font-family: Arial, Helvetica, sans-serif;
- font-size:65%;
- color:#996633;
-}
-
-A.navigation:active
-{
- font-family: Arial, Helvetica, sans-serif;
- font-size:65%;
- color:#996633;
-}
-
-A.navigation:visited
-{
- font-family: Arial, Helvetica, sans-serif;
- font-size:65%;
- color:#996633;
-}
-
-p.listpara
-{text-indent: 15%}
-
-H1 {
- font-family: Arial, Helvetica, sans-serif;
- font-size:170%;
- color:#336699;
- border : solid #CCCC99;
- width : 100%;
- border-width : 0px 0px 2px 0px;
-}
-
-H2 {
- font-family: Arial, Helvetica, sans-serif;
- font-size:130%;
- color:#336699;
- border : solid #cccc99;
- border-width : 0px 0px 2px 0px;
- width : 100%;
-}
-
-H3 {
- font-family: Arial, Helvetica, sans-serif;
- font-size:110%;
- color:#336699;
- width : 100%;
-}
-
-H4 {
- font-family: Arial, Helvetica, sans-serif;
- font-size:92%;
- color:#000000;
- font-weight: bold;
- width : 100%;
-}
-
-.code_no_color {
- color : #000000;
- font-family : "Courier New", "Courier", "monospace";
-}
-
-code {
- color : #336699;
- font-family : "Courier New", "Courier", "monospace";
-}
-
-P.indent {
- text-indent: 9%;
-}
-
-table.borders {
- border : 1% solid #BDB76B;
-}
-
-TR {
- text-align : left;
- vertical-align : top;
-}
-
-TH {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11pt;
- color:#000000;
- font-weight: bold;
-}
-
-TD {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11pt%;
- color:#000000;
-}
-
-.smalltext {
- font-size:80%;
-}
-
-p.note {
- display: block;
- font-family: Arial, Helvetica, Geneva, sans-serif;
- font-size: 95%;
-}
-
-p.warning {
- display: block;
- font-family: Arial, Helvetica, Geneva, sans-serif;
- font-size: 95%;
-}
-
-pre {
- font-family: "Courier New", Courier, mono;
- font-size: 92%;
- text-indent : 15%;
-}
-
-.GUITag {
- font-family: Arial, Helvetica, Geneva, sans-serif;
- font-size: 95%;
- font-weight: bold;
- font-style: normal;
-}
-
-.PropertyName {
- font-family: "Courier New", Courier, mono;
- font-style: normal;
-}
-
-.GlossaryItem {
- color : #008080;
- font-family: Arial, Helvetica, sans-serif;
- font-size : 95%;
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/javaClassType.jsp.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/javaClassType.jsp.data
deleted file mode 100644
index 5d1228f..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/javaClassType.jsp.data
+++ /dev/null
@@ -1,17 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Insert title here</title>
-</head>
-<body>
- <f:view>
- <f:actionListener type="foobar"/>
- <f:actionListener type="com.sun.faces.application.ActionListenerImpl"/>
- </f:view>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/mystyle.css.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/mystyle.css.data
deleted file mode 100644
index e02e1cb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/mystyle.css.data
+++ /dev/null
@@ -1,31 +0,0 @@
-body {
- padding-left: 11em;
- font-family: Georgia, "Times New Roman",
- Times, serif;
-}
-ul.navbar {
- list-style-type: none;
- padding: 0;
- margin: 0;
- position: absolute;
- top: 2em;
- left: 1em;
- width: 9em }
-h1 {
- font-family: Helvetica, Geneva, Arial,
- SunSans-Regular, sans-serif }
-ul.navbar li {
- background: white;
- margin: 0.5em 0;
- padding: 0.3em;
- border-right: 1em solid black }
-ul.navbar a {
- text-decoration: none }
-a:link {
- color: blue }
-a:visited {
- color: purple }
-address {
- margin-top: 1em;
- padding-top: 1em;
- border-top: thin dotted }
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/propertyDescTests.jsp b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/propertyDescTests.jsp
deleted file mode 100644
index 2da57b6..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/jsps/propertyDescTests.jsp
+++ /dev/null
@@ -1,13 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%@ taglib prefix="x" uri="http://org.eclipse.jsf/propertyDescriptorTest" %>
-<!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>
- <x:Tag Attr1="y" boolAttr="true" DeafultAttr="x"/>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileA.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileA.xml
deleted file mode 100644
index 21c6f7e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileA.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/mergetest1">
-
- <trait id="A1">
- <value>A1</value>
- </trait>
- <trait id="Dupe">
- <value>dupe from A</value>
- </trait>
-
- <entity id="A">
- <trait id="A1">
- <value>A1</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1</value>
- </trait>
- </entity>
- </entity>
-
- <entity id="Dupe">
- <trait id="A1">
- <value>A1FromA</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1FromA</value>
- </trait>
- </entity>
- </entity>
-
- <entity id="DupeWithInclude">
- <include-entity-group id="eg1"/>
- <trait id="A1">
- <value>A1</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1</value>
- </trait>
- </entity>
- </entity>
-
- <entity id="DupeWithInclude2">
- <include-entity-group id="eg1"/>
- </entity>
-
- <entityGroup id="eg1">
- <trait id="A1">
- <value>A1FromEG1</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1FromEG1</value>
- </trait>
- <trait id="aFromEG1">
- <value>aFromEG1</value>
- </trait>
- </entity>
- </entityGroup>
-
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileB.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileB.xml
deleted file mode 100644
index 4c2496e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileB.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/mergetest1">
-
- <trait id="B1">
- <value>B1</value>
- </trait>
- <trait id="Dupe">
- <value>dupe from B</value>
- </trait>
-
- <entity id="B">
- <trait id="B1">
- <value>B1</value>
- </trait>
- <entity id="b">
- <trait id="B1">
- <value>B1</value>
- </trait>
- </entity>
- </entity>
-
- <entity id="Dupe">
- <trait id="A1">
- <value>A1FromB</value>
- </trait>
- <trait id="B1">
- <value>B1</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1</value>
- </trait>
- <trait id="B1">
- <value>B1</value>
- </trait>
- </entity>
- <entity id="b"></entity>
- </entity>
-
- <entity id="DupeWithInclude">
- <include-entity-group id="eg1"/>
- <include-entity-group id="eg2"/>
- <trait id="A1">
- <value>A1</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1</value>
- </trait>
- </entity>
- </entity>
-
- <entityGroup id="eg1">
- <!-- All traits and entities should not be merged... Should come from FileA -->
- <trait id="B">
- <value>trait SHOULD NOT appear in merge</value>
- </trait>
- <trait id="A1">
- <value>A1FromEG1-B</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1FromEG1-1</value>
- </trait>
- <trait id="aFromEG1">
- <value>aFromEG1-1</value>
- </trait>
- </entity>
- </entityGroup>
-
- <entityGroup id="eg2">
- <!-- All traits and entities should first come from eg1... Should come from FileA -->
- <trait id="B">
- <value>trait SHOULD appear in merge from eg2</value>
- </trait>
- <trait id="A1">
- <value>A1FromEG1-B</value>
- </trait>
- <entity id="a">
- <trait id="A1">
- <value>A1FromEG2-B</value>
- </trait>
- <trait id="aFromEG1">
- <value>aFromEG2-B</value>
- </trait>
- </entity>
- <entity id="b">
- <trait id="bFromEG2">
- <value>bFromEG2-B</value>
- </trait>
- </entity>
- </entityGroup>
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileIncludeExternalModel.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileIncludeExternalModel.xml
deleted file mode 100644
index fea1e94..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/FileIncludeExternalModel.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/mergetest2">
-
- <include-entity-group id="eg1" uri="http://org.eclipse.jsf/mergetest1"/>
-
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TestJSP.jsp b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TestJSP.jsp
deleted file mode 100644
index be13202..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TestJSP.jsp
+++ /dev/null
@@ -1,16 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Insert title here</title>
-</head>
-<body>
- <f:view>
- <MyTag attr1="foo"/>
- </f:view>
-</body>
-</html> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TinyIncludeTest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TinyIncludeTest.xml
deleted file mode 100644
index 150bf3d..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/TinyIncludeTest.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="TinyIncludeTest">
-
- <entity id="A">
- <include-entity-group id="eg"/>
- <include-entity-group id="eg2"/>
- <trait id="T1">
- <value>A1</value>
- </trait>
- <entity id="a">
- <trait id="t1">
- <value>A1</value>
- </trait>
- </entity>
- </entity>
-
- <entityGroup id="eg">
- <include-entity-group id="egbogus"/> <!-- SHOULD BE IGNORED - entityGroups should not contain entityGroups -->
- <trait id="T1">
- <value>T1FromEG</value>
- </trait>
- <trait id="T2">
- <value>T2FromEG</value>
- </trait>
- <entity id="sub-A">
- <trait id="a-T1">T1</trait>
- </entity>
- <entity id="a">
- <trait id="t1">
- <value>t1FromEG-a</value>
- </trait>
- <entity id="sub-a">
- <trait id="a-T1">a-T1FromEG</trait>
- </entity>
- <entity id="bFromEG">
- </entity>
- </entity>
- </entityGroup>
- <entityGroup id="eg2"> <!-- Since "eg" comes before "eg2" in A, none of the eg2 entity and traits should be used as they have all identical ids except for the sub-sub-a entity-->
- <trait id="T2">
- <value>T2FromEG2</value>
- </trait>
- <entity id="sub-A">
- <trait id="a-T1">a-T1FromEG2</trait>
- <entity id="sub-sub-A"/>
- </entity>
-
- </entityGroup>
- <entityGroup id="egbogus">
- <trait id="eg2Trait">
- <value>never merged</value>
- </trait>
- <entity id="eg2Entity">
- </entity>
- </entityGroup>
- <!-- EXPECTED MERGE RESULT
- <entity id="A">
- <trait id="T1">
- <value>A1</value>
- </trait>
- <trait id="T2">
- <value>T2FromEG</value>
- </trait>
- <entity id="a">
- <trait id="t1">
- <value>A1</value>
- </trait>
- <entity id="sub-a">
- <trait id="a-T1">T1</trait>
- </entity>
- <entity id="bFromEG">
- </entity>
- </entity>
- <entity id="sub-A">
- <trait id="a-T1">T1</trait>
- </entity>
- </entity>
- -->
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_metadataprocessing.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_metadataprocessing.xml
deleted file mode 100644
index f6da689..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_metadataprocessing.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/metadataprocessing"
- type="tagFile">
-
- <entity type="tag" id="MyTag">
- <entity type="attribute" id="MyBooleanAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.MyBooleanType</value>
- </trait>
- </entity>
- <entity type="attribute" id="BooleanAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.BooleanType</value>
- </trait>
- <trait id="barks">
- <value xsi:type="mdt:ListOfValues">
- <item>woof</item>
- <item>ruff</item>
- <item>howlll</item>
- </value>
- </trait>
- </entity>
- <entity type="attribute" id="NutherBooleanAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.BooleanType</value>
- </trait>
- <trait id="barks">
- <value xsi:type="mdt:ListOfValues">
- <item>WOOF</item>
- <item>RUFF</item>
- <item>HOWLLL</item>
- </value>
- </trait>
- </entity>
- <entity type="attribute" id="MyValidValsAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.MyStringArrayType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>AFirstVal</item>
- <item>ASecondVal</item>
- <item>AThirdVal</item>
- <item>AFourthVal</item>
- </value>
- </trait>
- </entity>
- <entity type="attribute" id="MyNonMetaDataEnabledAttr">
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>AFirstVal</item>
- <item>ASecondVal</item>
- <item>AThirdVal</item>
- <item>AFourthVal</item>
- </value>
- </trait>
- </entity>
- <entity type="attribute" id="MyNoImplMetaDataEnabledAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.NoImplType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>AFirstVal</item>
- <item>ASecondVal</item>
- <item>AThirdVal</item>
- <item>AFourthVal</item>
- </value>
- </trait>
- </entity>
- <entity type="attribute" id="MyDualTypeAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.MyStringArrayType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>AFirstVal</item>
- <item>ASecondVal</item>
- <item>AThirdVal</item>
- <item>AFourthVal</item>
- </value>
- </trait>
- </entity>
- <entity type="attribute" id="MyLongAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.MyLongType</value>
- </trait>
- </entity>
- <entity type="attribute" id="MyMissingType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.WhereIsIt</value>
- </trait>
- </entity>
- <entity type="attribute" id="ValidatorID">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.IdentifierType</value>
- </trait>
- <trait id="identifier-type">
- <value>javax.faces.validator</value>
- </trait>
- </entity>
- </entity>
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tagprocessing.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tagprocessing.xml
deleted file mode 100644
index 2d34c62..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tagprocessing.xml
+++ /dev/null
@@ -1,251 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<md:metadatamodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:md="http://org.eclipse.jst.jsf.common.metadata/metadata.ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/tagprocessing"
- type="tagFile">
-
- <entity id="MyTag">
- <entity id="BooleanType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.BooleanType</value>
- </trait>
- <trait id="default-value">
- <value>true</value>
- </trait>
- </entity>
- <entity id="StringType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.StringType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- <item>D</item>
- </value>
- </trait>
- <trait id="displayed-values">
- <value xsi:type="mdt:ListOfValues">
- <item>A FirstVal</item>
- <item>B SecondVal</item>
- <item>C ThirdVal</item>
- <item>D FourthVal</item>
- </value>
- </trait>
- <trait id="small-icon">
- <value>/testfiles/icons/attr_val.gif</value>
- </trait>
- <trait id="default-value">
- <value>A</value>
- </trait>
- </entity>
- <entity id="IntegerType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.IntegerType</value>
- </trait>
- <trait id="valid-minimum"><value>0</value></trait>
- <trait id="valid-maximum"><value>255</value></trait>
- <trait id="default-value"><value>10</value></trait>
- </entity>
- <entity id="LengthType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.LengthType</value>
- </trait>
- <trait id="valid-minimum"><value>0%</value></trait> <!-- Check that min/max are ignored. Not valid for length type -->
- <trait id="valid-maximum"><value>100%</value></trait>
- <trait id="default-value"><value>100%</value></trait>
- </entity>
- <entity id="EnumeratedIntegerType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.IntegerType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>0</item>
- <item>3</item>
- <item>5</item>
- </value>
- </trait>
- <trait id="default-value"><value>10</value></trait>
- </entity>
- <entity id="LongType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.LongType</value>
- </trait>
- <trait id="valid-minimum"><value>-1000</value></trait>
- <trait id="valid-maximum"><value>1000</value></trait>
- </entity>
- <entity id="EnumeratedLongType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.LongType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>0</item>
- <item>3</item>
- <item>5</item>
- </value>
- </trait>
- <trait id="valid-values-message"><value>bogus validation message</value></trait>
- <trait id="valid-values-severity"><value>99</value></trait>
- <trait id="valid-values-code"><value>X99</value></trait>
- <trait id="default-value"><value>3</value></trait>
- </entity>
- <entity id="DoubleType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.DoubleType</value>
- </trait>
- <trait id="valid-minimum"><value>188.23</value></trait>
- <trait id="valid-maximum"><value>245.32</value></trait>
- </entity>
- <entity id="EnumeratedDoubleType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.DoubleType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>188.23</item>
- <item>245.32</item>
- <item>1</item>
- </value>
- </trait>
- <trait id="default-value"><value>188.23</value></trait>
- </entity>
- <entity id="JavaClassType1">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.JavaClassType</value>
- </trait>
- <trait id="valid-interfaces">
- <value>javax.xml.xpath.XPathFunctionResolver</value>
- </trait>
- </entity>
- <entity id="JavaClassType2">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.JavaClassType</value>
- </trait>
- <trait id="valid-superclass">
- <value>com.foo.MyConverter</value>
- </trait>
- </entity>
- <entity id="JavaClassType3">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.JavaClassType</value>
- </trait>
- <trait id="valid-interfaces">
- <value>javax.xml.xpath.XPathVariableResolver</value>
- </trait>
- <trait id="valid-superclass">
- <value>com.foo.MyConverter</value>
- </trait>
- </entity>
- <entity id="JavaClassType4">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.JavaClassType</value>
- </trait>
- <trait id="valid-interfaces">
- <value xsi:type="mdt:ListOfValues">
- <item>javax.xml.xpath.XPathVariableResolver</item>
- <item>javax.xml.xpath.XPathFunctionResolver</item>
- </value>
- </trait>
- <trait id="valid-superclass">
- <value>com.foo.MyConverter</value>
- </trait>
- </entity>
- <entity id="MethodBindingType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.MethodBindingType</value>
- </trait>
- </entity>
- <entity id="ColorType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.ColorType</value>
- </trait>
- <trait id="default-value"><value>Black</value></trait>
- </entity>
- <entity id="LanguageCodeType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.LanguageCodeType</value>
- </trait>
- <trait id="category">
- <value>ACategory</value>
- </trait>
- </entity>
- <entity id="LocaleType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.LocaleType</value>
- </trait>
- <trait id="category">
- <value>ACategory</value>
- </trait>
- </entity>
- <entity id="CurrencyCodeType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.CurrencyCodeType</value>
- </trait>
- </entity>
- <entity id="TimeZoneType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.TimeZoneType</value>
- </trait>
- </entity>
- <entity id="RelativePathType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.RelativePathType</value>
- </trait>
- </entity>
- <entity id="WebPathType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.WebPathType</value>
- </trait>
- </entity>
- <entity id="JavaScriptType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.JavaScriptType</value>
- </trait>
- </entity>
- <entity id="CSSClassType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.CSSClassType</value>
- </trait>
- </entity>
- <entity id="CSSStyleType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.CSSStyleType</value>
- </trait>
- </entity>
- <entity id="ComponentIDType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.ComponentIDType</value>
- </trait>
- </entity>
- <entity id="CharacterType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.CharacterType</value>
- </trait>
- </entity>
- <entity id="ScriptType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.ScriptType</value>
- </trait>
- </entity>
- <entity id="LinkType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.LinkType</value>
- </trait>
- </entity>
- <entity id="ContentType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.ContentType</value>
- </trait>
- </entity>
- <entity id="NumberPatternType">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.NumberPatternType</value>
- </trait>
- </entity>
- </entity>
- </md:metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.properties
deleted file mode 100644
index fb51ea4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.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
-###############################################################################
-NLS1=a day in the life
-NLS2=another string
-
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.xml
deleted file mode 100644
index adc008e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/test"
- type="tagFile">
-
- <trait id="model-trait">
- <value>ATrait</value>
- </trait>
-
- <!-- Note that this is fot testing multiple trait queries. Not recommended! -->
- <trait id="model-trait">
- <value>DupeTrait</value>
- </trait>
-
- <entity type="tag" id="validator">
- <entity type="attribute" id="validatorId">
- <trait id="attr-val-content-assistant">
- <value>com.eclipse.wtp.jsf.ui.internal.ValidatorAttrValueContentAssistant</value>
- </trait>
- <trait id="attr-val-runtime-type">
- <value>com.eclipse.wtp.jsf.core.internal.model.datatype.Validator</value>
- </trait>
- </entity>
- </entity>
- <entity type="tag" id="nopropsOrAttrs">
- </entity>
- <entity type="tag" id="noAttrs">
- <trait id="A">
- <value>a</value>
- </trait>
- <trait id="B">
- <value>b</value>
- </trait>
- </entity>
- <entity type="tag" id="loaded">
- <include-entity-group id="eg2"/>
- <entity type="attribute" id="att1">
- <trait id="A1">
- <value>a1</value>
- </trait>
- <trait id="B1">
- <value>b1</value>
- </trait>
- </entity>
- <entity type="attribute" id="att2">
- <trait id="A2">
- <value>a2</value>
- </trait>
- <trait id="B2">
- <value>b2</value>
- </trait>
- </entity>
- <entity type="attribute" id="att3">
- <trait id="A3">
- <value>a3</value>
- </trait>
- <trait id="B3">
- <value>b3</value>
- </trait>
- <trait id="multival">
- <value xsi:type="mdt:ListOfValues">
- <item>1</item>
- <item>2</item>
- <item>3</item>
- </value>
- </trait>
- </entity>
- <trait id="A">
- <value>a</value>
- </trait>
- <trait id="B">
- <value>b</value>
- </trait>
- <trait id="multival">
- <value xsi:type="mdt:ListOfValues">
- <item>1</item>
- <item>2</item>
- <item>3</item>
- </value>
- </trait>
- </entity>
- <entity type="tag" id="NLS">
- <entity type="attribute" id="NLS">
- <trait id="NLS1">
- <value>%NLS1</value>
- </trait>
- <trait id="NLS2">
- <value>%NLS2</value>
- </trait>
- <trait id="NLS3">
- <value>%NLS3</value>
- </trait>
- <trait id="multival">
- <value xsi:type="mdt:ListOfValues">
- <item>%NLS1</item>
- <item>%NLS2</item>
- </value>
- </trait>
- </entity>
- <trait id="NLS1">
- <value>%NLS1</value>
- </trait>
- <trait id="NLS2">
- <value>%NLS2</value>
- </trait>
- <trait id="NLS3">
- <value>%NLS3</value>
- </trait>
- <trait id="multival">
- <value xsi:type="mdt:ListOfValues">
- <item>%NLS1</item>
- <item>%NLS2</item>
- </value>
- </trait>
- <trait id="NullVal">
- <value></value>
- </trait>
- </entity>
- <!-- Note that this is fot testing multiple entity queries. Not recommended. -->
- <entity type="tag" id="loaded">
- <entity type="attribute" id="secondLoadedAtt1">
- <trait id="A1">
- <value>a1</value>
- </trait>
- <trait id="B1">
- <value>b1</value>
- </trait>
- </entity>
- </entity>
-
- <entityGroup id="eg1">
- <entity id="eg1-A"></entity>
- </entityGroup>
- <entityGroup id="eg2">
- <trait id="eg2-A"><value>XXX</value> </trait>
- <entity id="eg2-A"></entity>
- </entityGroup>
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test_en_US.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test_en_US.properties
deleted file mode 100644
index c30f767..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_test_en_US.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
-###############################################################################
-NLS1=a day in the life(en_US)
-NLS2=another string(en_US)
-
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tinytest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tinytest.xml
deleted file mode 100644
index 54868e2..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/jsf_tinytest.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/tinytest"
- type="tagFile">
-
- <entity id="A">
- <include-entity-group id="eg1"/>
- </entity>
- <entity id="B">
- <include-entity-group id="eg1"/>
- </entity>
- <entityGroup id="eg1">
- <entity id="copy1">
- <trait id="model-trait">
- <value>ATrait</value>
- </trait>
- </entity>
- </entityGroup>
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/missingMDModelTest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/missingMDModelTest.xml
deleted file mode 100644
index 9ad9a0e..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/missingMDModelTest.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- xmlns:bogus="http://org.eclipse.jsf/bogus.ecore"
- id="http://org.eclipse.jsf/missingMDModelTest"
- type="tagFile">
-
- <entity id="Tag">
- <entity id="Attr1">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.StringType</value>
- </trait>
- <trait id="bogusTrait">
- <value xsi:type="bogus:foobars">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- <item>D</item>
- </value>
- </trait>
- <trait id="reallybogusTrait">
- <value xsi:type="bogiss:foobars">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- <item>D</item>
- </value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- <item>D</item>
- </value>
- </trait>
- <trait id="displayed-values">
- <value xsi:type="mdt:ListOfValues">
- <item>A FirstVal</item>
- <item>B SecondVal</item>
- <item>C ThirdVal</item>
- <item>D FourthVal</item>
- </value>
- </trait>
- <trait id="display-label">
- <value>MyAttr1</value>
- </trait>
- <trait id="description">
- <value>This is a description.</value>
- </trait>
- <trait id="category">
- <value>CategoryName</value>
- </trait>
- <trait id="small-icon">
- <value>/testfiles/icons/attr_val.gif</value>
- </trait>
- <trait id="default-value">
- <value>A</value>
- </trait>
- <trait id="required">
- <value>true</value>
- </trait>
- </entity>
- <entity id="DefaultAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.StringType</value>
- </trait>
- <trait id="cell-editor">
- <value>org.eclipse.jface.viewers.TextCellEditor</value>
- </trait>
- <trait id="bogusTrait">
- <value xsi:type="bogus:foobars">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- <item>D</item>
- </value>
- </trait>
- </entity>
- <entity id="boolAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.BooleanType</value>
- </trait>
- </entity>
- </entity>
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/propertyDescriptorTest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/propertyDescriptorTest.xml
deleted file mode 100644
index cb87f4a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/propertyDescriptorTest.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- xmlns:qe="http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore"
- id="http://org.eclipse.jsf/propertyDescriptorTest"
- type="tagFile">
-
- <entity id="Tag">
- <entity id="Attr1">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.StringType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- <item>D</item>
- </value>
- </trait>
- <trait id="displayed-values">
- <value xsi:type="mdt:ListOfValues">
- <item>A FirstVal</item>
- <item>B SecondVal</item>
- <item>C ThirdVal</item>
- <item>D FourthVal</item>
- </value>
- </trait>
- <trait id="display-label">
- <value>MyAttr1</value>
- </trait>
- <trait id="description">
- <value>This is a description.</value>
- </trait>
- <trait id="category">
- <value>CategoryName</value>
- </trait>
- <trait id="small-icon">
- <value>/testfiles/icons/attr_val.gif</value>
- </trait>
- <trait id="default-value">
- <value>A</value>
- </trait>
- <trait id="required">
- <value>true</value>
- </trait>
- </entity>
- <entity id="DefaultAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.StringType</value>
- </trait>
- <trait id="cell-editor">
- <value>org.eclipse.jface.viewers.TextCellEditor</value>
- </trait>
- </entity>
- <entity id="boolAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.core.attributevalues.BooleanType</value>
- </trait>
- </entity>
- </entity>
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/quickEditSectionTest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/quickEditSectionTest.xml
deleted file mode 100644
index 9567ffd..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/quickEditSectionTest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- xmlns:qe="http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore"
- id="http://org.eclipse.jsf/quickEditSectionTest"
- type="tagFile">
-
- <entity id="A">
- <entity id="attr1"/>
- <entity id="attr2"/>
- <trait id="quick-edit-tab">
- <value xsi:type="qe:QuickEditTabSections">
- <section id="attr1" type="ATTRIBUTE" />
- <section id="attr2"/> <!-- ATTRIBUTE type is default -->
- <section id="section1" type="SECTION"/>
- </value>
- </trait>
- </entity>
-</metadatamodel> \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.properties
deleted file mode 100644
index fb51ea4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.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
-###############################################################################
-NLS1=a day in the life
-NLS2=another string
-
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.xml b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.xml
deleted file mode 100644
index 32ec01b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadatamodel
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:xmltype="http://www.eclipse.org/emf/2003/XMLType"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id="http://org.eclipse.jsf/traithelpertest"
- type="tagFile">
-
- <trait id="TraitId">
- <value xsi:type="mdt:StringValue">TraitValue</value>
- </trait>
-
- <trait id="TraitId2">
- <value xsi:type="mdt:BooleanValue">true</value>
- </trait>
-
- <trait id="TraitId3">
- <value xsi:type="mdt:BooleanValue">false</value>
- </trait>
-
-
- <entity id="tag">
-
- <entity type="attribute" id="attr1">
- <trait id="singleString">
- <value>AString</value>
- </trait>
- <trait id="anInteger">
- <value>1</value>
- </trait>
- <trait id="aTrueInt">
- <value xsi:type="ecore:EInt">1</value>
- </trait>
- <trait id="multivalIntegers">
- <value xsi:type="mdt:ListOfValues">
- <item>1</item>
- <item>2</item>
- <item>3</item>
- </value>
- </trait>
- <trait id="multivalStrings">
- <value xsi:type="mdt:ListOfValues">
- <item>A</item>
- <item>B</item>
- <item>C</item>
- </value>
- </trait>
- <trait id="NullVal">
- <value></value>
- </trait>
- <trait id="BooleanVal">
- <value>true</value>
- </trait>
- <trait id="NullBooleanVal">
- <value></value>
- </trait>
- </entity>
- </entity>
- <entity id="NLS">
- <entity id="NLS">
- <trait id="NLS">
- <value>%NLS1</value>
- </trait>
- <trait id="multivalNLS">
- <value xsi:type="mdt:ListOfValues">
- <item>%NLS1</item>
- <item>%NLS2</item>
- </value>
- </trait>
- </entity>
- <trait id="NullVal">
- <value>%NLS3</value>
- </trait>
- </entity>
-
-</metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest_en_US.properties b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest_en_US.properties
deleted file mode 100644
index c30f767..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/metadata/traithelpertest_en_US.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
-###############################################################################
-NLS1=a day in the life(en_US)
-NLS2=another string(en_US)
-
-
-
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/web/faces-config_1_1.xml.data b/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/web/faces-config_1_1.xml.data
deleted file mode 100644
index 6be8b5c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadata.tests/testfiles/web/faces-config_1_1.xml.data
+++ /dev/null
@@ -1,50 +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>
- <converter>
- <display-name>
- MyConverter</display-name>
- <converter-id>
- com.foo.myconverter</converter-id>
- <converter-class>
- com.foo.MyConverter</converter-class>
- </converter>
- <managed-bean>
- <managed-bean-name>
- myBean</managed-bean-name>
- <managed-bean-class>
- com.foo.MyBean</managed-bean-class>
- <managed-bean-scope>
- session</managed-bean-scope>
- </managed-bean>
- <navigation-rule>
- <display-name>
- actionTypeTest.jsp</display-name>
- <from-view-id>
- /actionTypeTest.jsp</from-view-id>
- <navigation-case>
- <from-outcome>gotoWelcome</from-outcome>
- <to-view-id>
- /welcome.jsp</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>gotoSomeplaceElse</from-outcome>
- <to-view-id>
- /heck.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
- <validator>
- <description>
- </description>
- <display-name>
- MyValidator</display-name>
- <validator-id>
- com.foo.myvalidator</validator-id>
- <validator-class>
- com.foo.MyValidator</validator-class>
- </validator>
-</faces-config>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.classpath b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.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.metadataprocessingtests2/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.cvsignore
deleted file mode 100644
index 3927467..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.project b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.project
deleted file mode 100644
index 27dce31..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.metadataprocessingtests2</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.metadataprocessingtests2/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 3feb572..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:03:56 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index df300a3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Tue Apr 10 09:31:09 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.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.metadataprocessingtests2/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/META-INF/MANIFEST.MF
deleted file mode 100644
index 569e417..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.metadataprocessingtests2;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.metadataprocessingtests2.Activator
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.0.0,2.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jst.jsf.metadataprocessingtests2;x-internal:=true
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/about.html b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/about.html
deleted file mode 100644
index 04d4782..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/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.metadataprocessingtests2/build.properties b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/build.properties
deleted file mode 100644
index a9a96c4..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/build.properties
+++ /dev/null
@@ -1,20 +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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- metadata/,\
- about.html,\
- plugin.properties
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/metadata/jsf_metadataprocessing2.xml b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/metadata/jsf_metadataprocessing2.xml
deleted file mode 100644
index 6b6e098..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/metadata/jsf_metadataprocessing2.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<md:metadatamodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:md="http://org.eclipse.jst.jsf.common.metadata/metadata.ecore"
- xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore"
- id=" http://org.eclipse.jsf/metadataprocessing"
- type="tagFile">
-
- <entity id="MyTag">
- <entity id="MyDualTypeAttr">
- <trait id="attribute-value-runtime-type">
- <value>org.eclipse.jst.jsf.metadata.tests.NoImplType</value>
- </trait>
- <trait id="valid-values">
- <value xsi:type="mdt:ListOfValues">
- <item>BFirstVal</item>
- <item>BSecondVal</item>
- <item>BThirdVal</item>
- <item>BFourthVal</item>
- </value>
- </trait>
- <trait id="small-icon"><value>/icons/attr_val.gif</value></trait>
- </entity>
- </entity>
-</md:metadatamodel>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.properties
deleted file mode 100644
index 5240b5a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/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 - MetadataprocessingTests2 Plug-in
-Bundle-Vendor.0=Eclipse.org \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.xml b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.xml
deleted file mode 100644
index a6708b3..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/plugin.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.jst.jsf.common.standardMetaDataFiles">
- <standardMetaDataFile
- location="/metadata/jsf_metadataprocessing2.xml"
- uri=" http://org.eclipse.jsf/metadataprocessing"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes">
- <attributeValueRuntimeType id="NoImplType"/>
- </extension>
- <extension
- point="org.eclipse.jst.jsf.core.MetaDataEnabledFeatures">
- <MetaDataEnabledFeature
- class="org.eclipse.jst.jsf.metadataprocessingtests2.NoImplPossibleVals"
- typeid="org.eclipse.jst.jsf.metadata.tests.NoImplType"/>
- </extension>
-
-</plugin>
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/Activator.java b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/Activator.java
deleted file mode 100644
index e8c2da7..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/Activator.java
+++ /dev/null
@@ -1,57 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessingtests2;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class Activator extends Plugin {
-
- //The shared instance.
- private static Activator plugin;
-
- /**
- * The constructor.
- */
- public Activator() {
- 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 shared instance.
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/NoImplPossibleVals.java b/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/NoImplPossibleVals.java
deleted file mode 100644
index 2679963..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.metadataprocessingtests2/src/org/eclipse/jst/jsf/metadataprocessingtests2/NoImplPossibleVals.java
+++ /dev/null
@@ -1,42 +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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.metadataprocessingtests2;
-
-
-import java.util.List;
-
-import org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-
-public class NoImplPossibleVals extends AbstractMetaDataEnabledFeature implements
- IPossibleValues {
-
- public NoImplPossibleVals() {
- super();
- }
-
- public List<?> getPossibleValues() {
- return getPossibleVals();
- }
-
- private List<?> getPossibleVals() {
- return getTraitValueAsListOfStrings(IPossibleValues.POSSIBLE_VALUES_PROP_NAME);
-// return CMAnnotationHelper.getCMAttributePropertyValues(getCMAnnotationContext().getBundleId(), getCMAnnotationContext().getUri(),
-// getCMAnnotationContext().getElementName(), getCMAnnotationContext().getAttributeName(),
-// IPossibleValues.POSSIBLE_VALUES_PROP_NAME);
-
- }
-
-
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/.classpath b/jsf/tests/org.eclipse.jst.jsf.test.util/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/.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.test.util/.cvsignore b/jsf/tests/org.eclipse.jst.jsf.test.util/.cvsignore
deleted file mode 100644
index f522003..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-temp.folder
-@dot
-build.xml
-javaCompiler...args
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/.project b/jsf/tests/org.eclipse.jst.jsf.test.util/.project
deleted file mode 100644
index 00bf754..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.test.util</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.test.util/.settings/org.eclipse.core.resources.prefs b/jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 3f60304..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 16:04:15 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.jdt.core.prefs b/jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b27249c..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-#Fri Aug 24 19:13:38 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.test.util/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.test.util/META-INF/MANIFEST.MF
deleted file mode 100644
index 80986ac..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,39 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.test.util
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.test.util.Activator
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)";visibility:=reexport,
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)";visibility:=reexport,
- org.eclipse.jst.j2ee.core;bundle-version="[1.1.0,1.3.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)";visibility:=reexport,
- org.junit;bundle-version="3.8.1",
- org.eclipse.wst.common.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.internet.cache;bundle-version="[1.0.201,1.2.0)",
- org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jst.common.frameworks;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jem.util;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.wst.sse.core,
- org.eclipse.wst.xml.core,
- org.eclipse.ui.ide;bundle-version="3.4.0",
- org.eclipse.jst.common.project.facet.core,
- org.eclipse.core.filesystem;visibility:=reexport,
- org.eclipse.equinox.common;bundle-version="3.6.0";visibility:=reexport,
- org.eclipse.core.jobs;bundle-version="3.5.0";visibility:=reexport,
- org.eclipse.core.contenttype;bundle-version="3.4.100";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="3.6.0";visibility:=reexport,
- org.eclipse.jst.jsf.common;bundle-version="1.2.0"
-Export-Package: org.eclipse.jst.jsf.test.util,
- org.eclipse.jst.jsf.test.util.junit4,
- org.eclipse.jst.jsf.test.util.mock
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/about.html b/jsf/tests/org.eclipse.jst.jsf.test.util/about.html
deleted file mode 100644
index 04d4782..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/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.test.util/build.properties b/jsf/tests/org.eclipse.jst.jsf.test.util/build.properties
deleted file mode 100644
index 37f1d3b..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/build.properties
+++ /dev/null
@@ -1,18 +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/,\
- .,\
- about.html,\
- plugin.properties
-javacSource=1.5
-javacTarget=1.5
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/plugin.properties b/jsf/tests/org.eclipse.jst.jsf.test.util/plugin.properties
deleted file mode 100644
index 4e06943..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/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 - JUnit Tests Util Plug-in
-Bundle-Vendor.0=Eclipse.org
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/Activator.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/Activator.java
deleted file mode 100644
index fcc3ca9..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/Activator.java
+++ /dev/null
@@ -1,77 +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.test.util;
-
-//Test1dd
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- /**
- * the plugin's unique id
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.test.util";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- 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 Activator getDefault() {
- return plugin;
- }
-
- /**
- * Default plugin log method
- *
- * @param message
- * @param t
- */
- public static void log(String message, Throwable t)
- {
- IStatus logInfo = new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), 0, message, t);
- plugin.getLog().log(logInfo);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestCase.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestCase.java
deleted file mode 100644
index 5b380ed..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestCase.java
+++ /dev/null
@@ -1,102 +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.test.util;
-
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-public class ConfigurableTestCase extends TestCase
-{
- protected TestConfiguration _testConfiguration;
-
-
- protected ConfigurableTestCase() {
- super();
- }
-
- public ConfigurableTestCase(String name)
- {
- super(name);
- }
-
-
- protected void setUp() throws Exception {
- super.setUp();
-
- if (_testConfiguration == null)
- {
- doStandaloneSetup();
- }
- else
- {
- doTestSuiteSetup();
- }
- }
-
- /**
- * sub-classes should override to do test configuration for
- * when the test is run stand-alone.
- *
- * Subs should always call super.doStandalonSetup to ensure all setup is performed
- */
- protected void doStandaloneSetup()
- {
- // no default behavior
- }
-
- /**
- * sub-classes should override to handle the case where
- * the testcase is run under a ConfigurableTestSuite that sets
- * the configuration automatically.
- *
- * Subs should always call super.doStandalonSetup to ensure all setup is performed
- */
- protected void doTestSuiteSetup()
- {
- // no default behavior
- }
-
- public void setConfiguration(TestConfiguration configuration)
- {
- _testConfiguration = configuration;
- }
-
- public static class TestConfiguration extends AbstractMap<String, String>
- {
- private HashMap<String, String> backingMap = new HashMap<String, String>();
-
- public Set<Entry<String,String>> entrySet()
- {
- return backingMap.entrySet();
- }
-
- public String put(String key, String value) {
- return backingMap.put(key, value);
- }
-
- /**
- * Produces a new TestConfiguration with a shallow copy of the backing map
- */
- @SuppressWarnings("unchecked")
- public Object clone()
- {
- TestConfiguration clone = new TestConfiguration();
- HashMap<String, String> newBackingMap = (HashMap<String, String>) backingMap.clone();
- clone.backingMap = newBackingMap;
- return clone;
- }
-
-
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestSuite.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestSuite.java
deleted file mode 100644
index 9c32f84..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ConfigurableTestSuite.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.test.util;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsf.test.util.ConfigurableTestCase.TestConfiguration;
-
-public class ConfigurableTestSuite extends TestSuite
-{
- protected TestConfiguration _configuration;
-
-
- /**
- * Use this constructor when adding to parent ConfigurableTestSuite
- * @param theClass
- * @param name
- */
- public ConfigurableTestSuite(Class<? extends TestCase> theClass, String name) {
- super(theClass, name);
- }
-
- public ConfigurableTestSuite(Class<?> theClass)
- {
- super(theClass);
- }
-
- public ConfigurableTestSuite(TestConfiguration configuration, String name)
- {
- super(name);
- _configuration = configuration;
- }
-
- public void runTest(Test test, TestResult result)
- {
- if (test instanceof ConfigurableTestCase)
- {
- ((ConfigurableTestCase)test)
- .setConfiguration(_configuration);
- }
- else if (test instanceof ConfigurableTestSuite)
- {
- ((ConfigurableTestSuite)test)._configuration =
- this._configuration;
- }
- super.runTest(test, result);
- }
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JDTTestEnvironment.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JDTTestEnvironment.java
deleted file mode 100644
index 5562807..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JDTTestEnvironment.java
+++ /dev/null
@@ -1,229 +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.test.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-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.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.osgi.framework.Bundle;
-
-/**
- * Test environment for doing project tests involving JDT dependencies
- * @author cbateman
- *
- */
-public class JDTTestEnvironment {
-
- private final ProjectTestEnvironment _projectTestEnvironment;
-
- /**
- * @param projectTestEnvironment
- * @throws CoreException
- */
- public JDTTestEnvironment(ProjectTestEnvironment projectTestEnvironment) throws CoreException
- {
- _projectTestEnvironment = projectTestEnvironment;
-
- IProject project = _projectTestEnvironment.getTestProject();
- if (!project.hasNature(JavaCore.NATURE_ID)) {
- IProjectDescription description = project.getDescription();
- String[] prevNatures= description.getNatureIds();
- String[] newNatures= new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length]= JavaCore.NATURE_ID;
- description.setNatureIds(newNatures);
- project.setDescription(description, new NullProgressMonitor());
- }
-
- IJavaProject javaProject = JavaCore.create(project);
-
- // make sure that the project root is not on the classpath
- IClasspathEntry[] entries =
- javaProject.getRawClasspath();
- List<IClasspathEntry> preservedEntries = new ArrayList<IClasspathEntry>();
-
- for (int i=0; i < entries.length; i++)
- {
- IClasspathEntry entry = entries[i];
-
- if (!entry.getPath().equals(project.getFullPath()))
- {
- preservedEntries.add(entry);
- }
- }
-
- javaProject.setRawClasspath(preservedEntries.toArray(new IClasspathEntry[0]),
- new NullProgressMonitor());
- }
-
- /**
- * @return the supporting IProject test environment
- */
- public ProjectTestEnvironment getProjectEnvironment()
- {
- return _projectTestEnvironment;
- }
-
- /**
- * @param name
- * @return the IFolder handle, creating it if it doesn't exist
- * @throws CoreException
- */
- public IFolder getSourceFolder(final String name) throws CoreException
- {
- IProject project = _projectTestEnvironment.getTestProject();
- IFolder folder = project.getFolder(name);
-
- if (!folder.exists())
- {
- folder.create(true, true, new NullProgressMonitor());
- IPath path = project.getFullPath().append("bin");
- IClasspathEntry entry = JavaCore.newSourceEntry(folder.getFullPath(), new IPath[]{path}, path);
- addClasspathEntry(entry);
- }
-
-
- return folder;
- }
-
- /**
- * Tries to add the newEntry to the java project's classpath
- * @param newEntry
- */
- public void addClasspathEntry(IClasspathEntry newEntry) throws JavaModelException
- {
- IClasspathEntry[] entries = getJavaProject().getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[entries.length+1];
- System.arraycopy(entries, 0, newEntries, 0, entries.length);
- newEntries[entries.length] = newEntry;
- getJavaProject().setRawClasspath(newEntries, new NullProgressMonitor());
- }
-
- /**
- * Try to load the jar file at pathToJarFile in bundle as a jar classpath entry
- *
- * @param bundle
- * @param pathToJarFile
- * @return the class path entry or null if unable to create
- * @throws JavaModelException if a problem occurs adding the classpath entry
- */
- public IClasspathEntry addJarClasspathEntry(Bundle bundle, String pathToJarFile) throws JavaModelException, IOException, URISyntaxException
- {
- IPath path = JSFTestUtil.getAbsolutePath(bundle, pathToJarFile);
- IClasspathEntry entry = JavaCore.newLibraryEntry(path, null, null);
-
- addClasspathEntry(entry);
-
- return entry;
- }
-
- /**
- * @param folderName
- * @return the package fragment root for the folder name; resource may or may not exist
- * @throws CoreException
- */
- public IPackageFragmentRoot getPackageFragmentRoot(final String folderName) throws CoreException
- {
- final IJavaProject javaProject = JavaCore.create(_projectTestEnvironment.getTestProject());
- IFolder folder = getSourceFolder(folderName);
- IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
-
- return root;
- }
-
- /**
- * Creates a new Java class file in the folder/package/file name specified with contents as the
- * the Java code.
- *
- * @param folder
- * @param packageName
- * @param className
- * @param contents
- * @return the created compiliation unit
- * @throws CoreException
- * @throws JavaModelException
- */
- public ICompilationUnit addSourceFile(final String folder, final String packageName, final String className, final String contents) throws CoreException, JavaModelException
- {
- IPackageFragmentRoot root = getPackageFragmentRoot(folder);
- IPackageFragment packageFrag = root.getPackageFragment(packageName);
-
- if (!packageFrag.exists())
- {
- packageFrag =
- root.createPackageFragment(packageName,
- true, new NullProgressMonitor());
- }
-
- ICompilationUnit newCompUnit =
- packageFrag.createCompilationUnit(className+".java", contents, true, new NullProgressMonitor());
- return newCompUnit;
- }
-
- /**
- * @param folderName
- * @param src
- * @param path
- * @param fileName
-
- * @return a new IFile corresponding to src being created and copied
- * into a new file at folderName/IPath
- * @throws IOException
- * @throws CoreException
- */
- public IFile addResourceFile(final String folderName, final InputStream src, final String path, final String fileName) throws CoreException
- {
- IPackageFragmentRoot root = getPackageFragmentRoot(folderName);
-
- IPackageFragment packageFrag = root.getPackageFragment(path);
-
- if (!packageFrag.exists())
- {
- packageFrag =
- root.createPackageFragment(path,
- true, new NullProgressMonitor());
- packageFrag.open(null);
- }
-
- final IFolder folder = (IFolder) packageFrag.getUnderlyingResource();
-
- IFile file = folder.getFile(new Path(fileName));
- file.create(src, true, null);
- return file;
- }
-
- /**
- * @return the IJavaProject instance for this test environment object
- */
- public IJavaProject getJavaProject()
- {
- return JavaCore.create(_projectTestEnvironment.getTestProject());
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JSFTestUtil.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JSFTestUtil.java
deleted file mode 100644
index 1e96551..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/JSFTestUtil.java
+++ /dev/null
@@ -1,416 +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.test.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.zip.ZipFile;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-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.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.internal.ConfigurationManager;
-import org.eclipse.wst.validation.internal.GlobalConfiguration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.osgi.framework.Bundle;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Test utility methods
- *
- * @author cbateman
- *
- */
-public final class JSFTestUtil
-{
- private static boolean _enableTrace = false;
-
- /**
- * Setting to true enables internal tracing in this class. The default
- * is false. There is no thread safety.
- *
- * @param enableTrace
- */
- public static void setEnableTrace(final boolean enableTrace)
- {
- _enableTrace = enableTrace;
- }
-
- /**
- * Used to turn off build validation to speed up testing
- *
- * @param isEnabled
- * @throws InvocationTargetException
- * @throws InvocationTargetException
- */
- public static void setValidationEnabled(final boolean isEnabled) throws InvocationTargetException
- {
- // old way (just in case)
- final GlobalConfiguration config = new GlobalConfiguration(ConfigurationManager.getManager().getGlobalConfiguration());
- config.setDisableAllValidation(!isEnabled);
- config.passivate();
- config.store();
-
- // new way
- ValidationFramework.getDefault().suspendAllValidation(!isEnabled);
- }
-
- /**
- * @param proxied
- * @param proxyHostName
- * @param proxyPort
- */
- public static void setInternetProxyPreferences(final boolean proxied, final String proxyHostName, final String proxyPort)
- {
- // disable
-// IProxyService proxy = ProxyManager.getProxyManager();
-//
-// if (proxied)
-// {
-// ProxyData proxyData = new ProxyData(IProxyData.HTTP_PROXY_TYPE);
-// proxyData.setHost(proxyHostName);
-// proxyData.setPassword(proxyPort);
-// try
-// {
-// proxy.setProxyData(new ProxyData[] {proxyData});
-// proxy.setProxiesEnabled(true);
-// }
-// catch (CoreException ce)
-// {
-// // TODO: is this recoverable? Maybe should throw up.
-// Activator.log("Error setting web proxy. Tests may fail or take a long time to run", ce);
-// }
-//
-// }
-// else
-// {
-// proxy.setProxiesEnabled(false);
-// }
- }
-
- /**
- * Loads the source file in bundle called fileName into the jdtTestEnvironment
- * under srcFolderName/packageName.beanClassName
- *
- * @param bundle
- * @param fileName
- * @param beanClassName
- * @param srcFolderName
- * @param packageName
- * @param jdtTestEnvironment
- * @throws Exception
- */
- public static void loadSourceClass(final Bundle bundle,
- final String fileName,
- final String beanClassName,
- final String srcFolderName,
- final String packageName,
- final JDTTestEnvironment jdtTestEnvironment) throws Exception
- {
- final TestFileResource codeRes = new TestFileResource();
- codeRes.load(bundle, fileName);
- final String code = codeRes.toString();
- jdtTestEnvironment.addSourceFile(srcFolderName, packageName, beanClassName, code);
- }
-
- public static ZipFile createZipFile(final Bundle bundle, final String entryName) throws IOException, URISyntaxException
- {
- return new ZipFile(new File(getAbsolutePath(bundle, entryName).toOSString()));
- }
-
- public static URI getPlatformAbsPath(final String relativePath) throws MalformedURLException, URISyntaxException
- {
-
- final File file = new File(Platform.getInstanceLocation().getURL().getFile() + File.separator + relativePath);
- return file.toURI();
- }
-
- public static IPath getAbsolutePath(final Bundle bundle, final String relativePath) throws IOException, URISyntaxException
- {
- final URL bundleUrl = bundle.getEntry(relativePath);
- Assert.assertNotNull(bundleUrl);
- final URL url = FileLocator.resolve(bundleUrl);
- return new Path(new File(url.getFile()).getAbsolutePath());
- }
-
- public static void savePlatformRelative(final TestFileResource testFile, final String relativePath) throws IOException, URISyntaxException
- {
- saveToFileSystem(testFile, getPlatformAbsPath(relativePath));
- }
-
- public static void saveToFileSystem(final TestFileResource testFile, final URI absPath) throws IOException
- {
- saveToFileSystem(testFile.toBytes(), absPath);
- }
-
- public static void saveToFileSystem(final byte[] buffer, final URI absPath) throws IOException
- {
- final File file = new File(absPath);
-
- FileOutputStream outFile = null;
-
- try
- {
- outFile=new FileOutputStream(file);
- outFile.write(buffer);
- }
- finally
- {
- if (outFile != null)
- {
- outFile.close();
- }
- }
-
- }
-
- public static void saveToFileSystem(final InputStream inStream, final URI absPath) throws IOException
- {
- ByteArrayOutputStream loadFromInputStream = loadFromInputStream(inStream);
- saveToFileSystem(loadFromInputStream.toByteArray(), absPath);
- }
-
- /**
- * @param testFile
- * @param absPath
- * @return true if the contents of testFile and the contents of what absPath point to
- * are the same based on a byte for byte comparison (Arrays.equal(byte[], byte[]).
- *
- * @throws IOException
- */
- public static boolean areEqual(final TestFileResource testFile, final URI absPath) throws IOException
- {
- final File file = new File(absPath);
-
- return Arrays.equals(loadFromFile(file).toByteArray(), testFile.toBytes());
- }
-
- public static ByteArrayOutputStream loadFromFile(final IFile file) throws IOException
- {
- InputStream inStream = null;
-
- try
- {
- inStream = file.getContents();
- return loadFromInputStream(inStream);
- }
- catch(final CoreException ce)
- {
- return new ByteArrayOutputStream();
- }
- finally
- {
- if (inStream != null)
- {
- inStream.close();
- }
- }
- }
-
- public static ByteArrayOutputStream loadFromFile(final File file) throws IOException
- {
- FileInputStream inFile = null;
-
- try
- {
- inFile=new FileInputStream(file);
- return loadFromInputStream(inFile);
- }
- finally
- {
- if (inFile != null)
- {
- inFile.close();
- }
- }
- }
-
- /**
- * Caller is responsible for closing the stream
- * @param stream
- * @return the byte stream loaded from the file
- * @throws IOException
- */
- public static ByteArrayOutputStream loadFromInputStream(final InputStream stream) throws IOException
- {
- final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- final byte[] inBuffer = new byte[1024];
- int bytesRead;
- int curPos = 0;
- while ((bytesRead = stream.read(inBuffer)) != -1)
- {
- buffer.write(inBuffer,0,bytesRead);
- curPos+=bytesRead;
- }
-
- return buffer;
- }
-
- public static IndexedRegion getIndexedRegion(final IStructuredDocument document, final int documentOffset)
- {
- // C.B: most of this logic was copied from ContentAssistUtils.getNodeAt
- // I chose to copy rather than just call that because ContentAssistUtils is
- // internal
- final IStructuredModel model = getStructuredModel(document);
- IndexedRegion region = null;
- if (model != null)
- {
- try
- {
- int lastOffset = documentOffset;
- region = model.getIndexedRegion(documentOffset);
- trace("Starting at region: "+region.toString());
- while (region == null && lastOffset >= 0) {
- lastOffset--;
- region = model.getIndexedRegion(lastOffset);
- trace("Iterating on region: "+region.toString());
- }
-
- trace("Finished with: "+region.toString()+", Class: "+region.getClass());
-
- // now we assume we have an element. But our context may be
- // on an attribute in that node, so we need to check
- if (region instanceof IDOMElement)
- {
- trace("Region is an IDOMElement");
- final IDOMElement domElement = (IDOMElement) region;
-
- final NamedNodeMap attributes = domElement.getAttributes();
-
- for (int i = 0; i < attributes.getLength(); i++)
- {
- final Node attrNode = attributes.item(i);
-
- if (attrNode instanceof IDOMAttr)
- {
- final IDOMAttr attr = (IDOMAttr) attrNode;
- trace("Examining attribute: "+attr.toString());
-
- if (documentOffset >= attr.getStartOffset()
- && documentOffset < attr.getEndOffset())
- {
- region = attr;
- trace("Found attribute: "+region.toString());
- break;
- }
- }
- }
- }
- }
- finally
- {
- trace("releasing model");
- model.releaseFromRead();
- }
- }
-
- trace("returning: "+region);
- return region;
- }
-
- private static void trace(final String message)
- {
- if (_enableTrace)
- {
- System.out.println("getIndexedRegion: "+message);
- }
- }
-
- /**
- * @param document
- * @return a structured model or null if one cannot be opened for document.
- * Note: the caller is responsible for releasing the instance of structured
- * model that gets returned.
- */
- private static IStructuredModel getStructuredModel(final IStructuredDocument document)
- {
- final IModelManager modelManager = StructuredModelManager.getModelManager();
-
- if (modelManager != null)
- {
- return StructuredModelManager.getModelManager().getModelForRead(document);
- }
-
- return null;
- }
-
- /**
- * Attempts to delete resource. If the delete operation throws a
- * CoreException, the call will sleep the thread for backOffInMs
- * before trying again. Will try a maximum of 'maxTries' times. If at that
- * point the resource still exists, an error will be logged and the method
- * will return.
- *
- * @param resource
- * @param maxTries
- * @param backInMs
- * @return true if the delete was successful.
- */
- public static boolean safeDelete(final IResource resource, final int maxTries, final int backOffInMs)
- {
- boolean success = false;
-
- DELETE_LOOP: for (int attempt = 0; attempt < maxTries; attempt++)
- {
- try
- {
- resource.delete(true, null);
- success = true;
- break DELETE_LOOP;
- }
- catch (CoreException e)
- {
- try
- {
- Thread.sleep(backOffInMs);
- }
- catch (InterruptedException e1)
- {
- // do nothing, just continue
- }
- }
- }
- if (!success)
- {
- System.err.println("Could not delete resource: "+resource.getLocation().toOSString());
- }
- return success;
- }
-
- private JSFTestUtil()
- {
- // no instantiation
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/LoadableResource.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/LoadableResource.java
deleted file mode 100644
index eacdc9a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/LoadableResource.java
+++ /dev/null
@@ -1,76 +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.test.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.osgi.framework.Bundle;
-
-/**
- * A resource that can be loaded into memory in a test plugin friendly way
- *
- * @author cbateman
- */
-public abstract class LoadableResource
-{
-
- /**
- * Attempts to load the code from the path relative to bundle
- *
- * @param bundle
- * @param path
- * @throws IOException
- */
- public void load(Bundle bundle, String path) throws IOException
- {
- URL url = bundle.getEntry(path);
-
- if (url == null)
- {
- throw new IOException("Could not locate "+path+" in bundle "+bundle.getSymbolicName());
- }
-
- InputStream stream = null;
-
- try
- {
- stream = url.openStream();
- byte[] buffer = new byte[2048];
- int bytesRead = 0;
-
- while ((bytesRead = stream.read(buffer)) != -1)
- {
- bufferLoaded(buffer, bytesRead);
- }
- }
- finally
- {
- if (stream != null)
- {
- stream.close();
- }
- }
- }
-
- /**
- * Called by load to indicate that numBytes starting from offset 0
- * have been loaded. Sub-classes must implement to handle the buffer,
- * usually it will be appended into a running buffer until loadCompleted
- * is called to indicate that all data has been loaded.
- *
- * @param buffer
- * @param numBytes
- */
- protected abstract void bufferLoaded(byte[] buffer, int numBytes);
-
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/PerfTracker.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/PerfTracker.java
deleted file mode 100644
index 9a6eceb..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/PerfTracker.java
+++ /dev/null
@@ -1,83 +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.test.util;
-
-import java.io.PrintStream;
-import java.text.MessageFormat;
-
-public class PerfTracker {
- private long _max = Long.MIN_VALUE; // ensure any value compared to to this
- // will be bigger
- private long _maxIdx = 0;
- private long _min = Long.MAX_VALUE; // ensure any value compared to this
- // will be smaller
- private long _minIdx = 0;
- private long _runningTotal = 0;
- private final long[] _times;
- private int _numTimesRecorded = 0;
-
- private final String _name;
-
- public PerfTracker(final String name, final int numOfRuns) {
- _times = new long[numOfRuns];
- _name = name;
- }
-
- public void recordTime(long time) {
- _max = Math.max(_max, time);
- _maxIdx = _max == time ? _numTimesRecorded : _maxIdx;
-
- _min = Math.min(_min, time);
- _minIdx = _min == time ? _numTimesRecorded : _minIdx;
-
- _runningTotal += time;
-
- _times[_numTimesRecorded++] = time;
- }
-
- public void printReport(PrintStream outStream) {
- outStream
- .println("===================================================");
- outStream.println("Report for performance test: " + _name);
- outStream.println("Number of iterations: " + _numTimesRecorded);
- outStream
- .println("===================================================");
- outStream.println(MessageFormat.format("Max: {0}, Max Index: {1}",
- new Object[] { _max, _maxIdx }));
- outStream.println(MessageFormat.format("Min: {0}, Min Index: {1}",
- new Object[] { _min, _minIdx }));
- outStream.println(MessageFormat.format(
- "Avg: {0}, StdDev: {1}, StdDev Ignore Max/Min: {2}",
- new Object[] { average(), calculateStdDev(false),
- calculateStdDev(true) }));
- outStream
- .println("===================================================");
- outStream.println("");
- }
-
- private double average() {
- return _runningTotal / _numTimesRecorded;
- }
-
- private double calculateStdDev(boolean ignoreMaxMin) {
- double total = 0;
- final double avg = average();
- for (int i = 0; i < _numTimesRecorded; i++) {
- if (!ignoreMaxMin || ((i != _maxIdx) && (i != _minIdx))) {
- total += Math.pow((_times[i] - avg), 2) / _numTimesRecorded;
- }
- }
- return Math.sqrt(total);
- }
-} \ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ProjectTestEnvironment.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ProjectTestEnvironment.java
deleted file mode 100644
index dea626a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/ProjectTestEnvironment.java
+++ /dev/null
@@ -1,272 +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:
- * Oracle -- adapted WizardUtil class for EMF faces config model testing
- * IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.jsf.test.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-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.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-
-/**
- * Utility class for launching JSF-related wizard operations.
- *
- * @author spaxton, cbateman
- */
-public class ProjectTestEnvironment
-{
- /**
- * flag indicating if the project test env has been created
- */
- protected boolean _projectCreated = false;
-
- /**
- * the project name
- */
- protected final String _projectName;
- /**
- * the project
- */
- protected IProject _project;
-
- protected static final IOverwriteQuery OVERWRITE_ALL_QUERY =
- new IOverwriteQuery()
- {
- public String queryOverwrite(
- String pathString)
- {
- return IOverwriteQuery.ALL;
- }
- };
-
- /**
- * @param projectName
- */
- public ProjectTestEnvironment(final String projectName)
- {
- _projectName = projectName;
- }
-
- /**
- * @return true if the project is in a valid created state
- */
- public boolean isProjectCreated()
- {
- return _projectCreated;
- }
-
- /**
- * @param ignoreProjectExists --
- * only has impact if _projectName already exists in the
- * workspace. In this case, if set to true, then createProject
- * will return without error if the project exists (it will be
- * deleted and recreated)
- *
- * If set to false and the project exists, a runtime exception will be
- * thrown
- *
- * @return true if project is created
- */
- public boolean createProject(boolean ignoreProjectExists)
- {
- IProject project =
- ResourcesPlugin.getWorkspace().getRoot().getProject(
- _projectName);
-
- if (project.isAccessible() && !ignoreProjectExists)
- {
- throw new RuntimeException(
- "Project was not expected to exist but does: "
- + project.getName());
- }
-
- if (!isProjectCreated())
- {
- // first delete the projects of these names, if present
- deleteProject();
-
- if (!project.exists())
- {
- try
- {
- final IProgressMonitor monitor = new NullProgressMonitor();
- project.create(monitor);
- project.open(monitor);
- _project = project;
- _projectCreated = true;
- return true;
- }
- catch (CoreException ce)
- {
- ce.printStackTrace();
- }
- }
- }
- return false;
- }
-
- /**
- * Creates the new projecct from the specified zip file. createProject
- * is first called to create and open the empty project. The projectZip
- * is then used to populate the contents of the project.
- *
- * @param projectZip
- * @param ignoreProjectExists
- * @throws InvocationTargetException
- * @throws InterruptedException
- */
- public final void createFromZip(final ZipFile projectZip,
- final boolean ignoreProjectExists) throws InvocationTargetException, InterruptedException
- {
- // TODO: assert that the faceting in the zip matches what was set in the constructor.
- createProject(ignoreProjectExists);
- ZipFileStructureProvider zipFileStructureProvider =
- new ZipFileStructureProvider(
- projectZip)
- {
-
- @Override
- public String getFullPath(Object element)
- {
- final String fullName = super.getFullPath(element);
- IPath asPath = new Path(fullName);
-
- if (asPath.segmentCount() > 0)
- {
- boolean pathIsAbsolute = asPath.isAbsolute();
- String newFirstSegment = (pathIsAbsolute ? "/" : "") + _projectName;
- asPath = new Path(newFirstSegment+"/"+asPath.removeFirstSegments(1).toString());
- }
- return asPath.toString();
- }
-
- @Override
- public String getLabel(Object element)
- {
- if (element.equals(getRoot())) {
- return ((ZipEntry) element).getName();
- }
-
- return new Path(getFullPath(element)).lastSegment();
- }
- };
-
- final ImportOperation op =
- new ImportOperation(_project
- .getProjectRelativePath(),
- zipFileStructureProvider.getRoot(),
- zipFileStructureProvider,
- OVERWRITE_ALL_QUERY);
- op.setCreateContainerStructure(true);
- op.run(null);
- }
-
- /**
- * Creates the new project from the specified zip file. createProject
- * is first called to create and open the empty project. The projectZip
- * is then used to populate the contents of the project.
- *
- * Differs from createFromZip in that it passes the project path (relative
- * to workspace) to ImportOperation and so projectZip should contain only
- * intended contents of the project with no top-level "project" folder in
- * the zip file. This is to workaround bug 296496.
- *
- * @param projectZip
- * @param ignoreProjectExists
- * @throws InvocationTargetException
- * @throws InterruptedException
- */
- public final void createFromZip2(
- final ZipFile projectZip,
- final boolean ignoreProjectExists)
- throws InvocationTargetException, InterruptedException {
- // TODO: assert that the faceting in the zip matches what was set in the constructor.
- createProject(ignoreProjectExists);
- ZipFileStructureProvider zipFileStructureProvider =
- new ZipFileStructureProvider(projectZip);
- final ImportOperation op =
- new ImportOperation(
- _project.getFullPath(),
- zipFileStructureProvider.getRoot(),
- zipFileStructureProvider,
- OVERWRITE_ALL_QUERY);
- op.setCreateContainerStructure(true);
- op.run(null);
- }
-
- /**
- * Delete project
- */
- public void deleteProject()
- {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject oldWebProj = workspace.getRoot().getProject(_projectName);
-
- try
- {
- if (oldWebProj != null && oldWebProj.isAccessible())
- {
- workspace.delete(new IResource[]
- { oldWebProj }, true, null);
- }
- }
- catch (CoreException ce)
- {
- ce.printStackTrace();
- }
- }
-
- /**
- * Clears the _projectCreated flag, allowing createProject to be called to
- * reset the web project back to it's initial state
- */
- public void setProjectDirtied()
- {
- _projectCreated = false;
- }
-
- /**
- * Forces recreation of the test project - to be used after unit tests that
- * dirty the project state.
- */
- public void recreateProject()
- {
- setProjectDirtied();
- createProject(true);
- }
-
- /**
- * Should call createProject first.
- *
- * @return the IProject
- */
- public IProject getTestProject()
- {
- if (_projectCreated)
- {
- return _project;
- }
-
- return null;
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestFileResource.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestFileResource.java
deleted file mode 100644
index d6c0b1a..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestFileResource.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.test.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.UnsupportedEncodingException;
-
-
-
-/**
- * Represents a piece of java code (usually a full compilation unit) that is loaded
- * from a static test file somewhere.
- *
- * @author cbateman
- *
- */
-public class TestFileResource extends LoadableResource
-{
- private ByteArrayOutputStream _buffer = new ByteArrayOutputStream();
-
- /**
- * @return the contents
- */
- public String toString()
- {
- return _buffer.toString();
- }
-
- public String toString(final String encoding) throws UnsupportedEncodingException
- {
- return _buffer.toString(encoding);
-
- }
- /**
- * @return the contents as a byte array
- */
- public byte[] toBytes()
- {
- return _buffer.toByteArray();
- }
-
- protected void bufferLoaded(byte[] buffer, int numBytes)
- {
- _buffer.write(buffer, 0, numBytes);
- }
-}
diff --git a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestUtil.java b/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestUtil.java
deleted file mode 100644
index 72d5922..0000000
--- a/jsf/tests/org.eclipse.jst.jsf.test.util/src/org/eclipse/jst/jsf/test/util/TestUtil.java
+++ /dev/null
@@ -1,471 +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.test.util;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.framework.Bundle;
-
-/**
- * Test utility to create project and its files.
- *
- * @author Yang Liu, Xiao-guang Zhang
- *
- * @version
- */
-public class TestUtil
-{
-
-
- /**
- *
- * @param prjname
- * @param path
- * relative to this plugin's root folder.
- * @return
- * @throws Exception
- */
- public static IProject createProjectFromZip(Bundle bundle, String prjname,
- String path) throws Exception
- {
-
- URL url = FileLocator.find(bundle, new Path(path), null);
- // if this fails, it most likely that path is wrong.
- Assert.assertNotNull(url);
- return createProjectFromZip(prjname, url);
- }
-
- /**
- * build a project
- *
- * @param project
- * @param monitor
- */
- public static void buildProject(IProject project, IProgressMonitor monitor)
- {
- try
- {
- project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- } catch (CoreException e)
- {
- e.printStackTrace(System.err);
- }
- }
-
- /**
- * expand the zip stream into the specified folder.
- *
- * @param url
- * @param dir
- * @throws Exception
- */
- private static void expandZip(URL url, IContainer dir)
- throws Exception
- {
- ZipInputStream zis = null;
-
- try
- {
- // first, count number of items in zip file
- zis = new ZipInputStream(url.openStream());
- String prefix = getPrefix(zis);
- zis = new ZipInputStream(url.openStream());
- ZipEntry ze = zis.getNextEntry();
- while (ze != null)
- {
- String name = ze.getName();
- if (!name.startsWith(prefix))
- {
- ze = zis.getNextEntry();
- continue;
- }
- name = name.substring(prefix.length());
- if (ze.isDirectory())
- {
- IFolder folder = dir.getFolder(new Path(name));
- if (!folder.exists())
- {
- ensurePath(folder);
- folder.create(true, true, null);
- }
- }
- else
- {
- IFile file = dir.getFile(new Path(name));
- ensurePath(file);
- // use ZipStreamWrapper to prevent zis being closed
- if (file.exists())
- {
- file.setContents(new ZipStreamWrapper(zis),
- IResource.NONE, null);
- } else
- {
- file.create(new ZipStreamWrapper(zis), true, null);
- }
- }
-
- ze = zis.getNextEntry();
- }
- } finally
- {
- try
- {
- if (zis != null)
- zis.close();
- } catch (Exception ex)
- {
- // ignore
- }
- }
- }
-
- private static String getPrefix(ZipInputStream zipStream) throws IOException
- {
- ZipEntry ze = zipStream.getNextEntry();
- while (ze != null)
- {
- String name = ze.getName();
- if (name != null && name.endsWith(".project")
- && !ze.isDirectory())
- {
- int index = name.lastIndexOf(".project");
- return name.substring(0, index);
- }
- ze = zipStream.getNextEntry();
- }
- // if we get to here, then nothing to prepend
- return "";
- }
-
- /**
- * @param file
- * @throws CoreException
- */
- private static void ensurePath(IResource file) throws CoreException
- {
- IContainer container = file.getParent();
- if (!container.exists())
- {
- ensurePath(container);
- ((IFolder) container).create(true, true, null);
- }
- }
-
- /**
- * this method will copy file from the sourcePath folder of this plugin into
- * the target path related with the destination project.
- *
- * @param project
- * @param sourcePath
- * - Source path, must be a relative path to test plugin
- * @param targetPath
- * - Target path, must be relative path to eclispe project.
- *
- * @return
- */
- public static IFile copyFile(Bundle bundle, IProject project, String targetPath,
- String sourcePath) throws Exception