Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.jet.tests')
-rw-r--r--tests/org.eclipse.jet.tests/.classpath7
-rw-r--r--tests/org.eclipse.jet.tests/.cvsignore1
-rw-r--r--tests/org.eclipse.jet.tests/.project28
-rw-r--r--tests/org.eclipse.jet.tests/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.core.prefs59
-rw-r--r--tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--tests/org.eclipse.jet.tests/META-INF/MANIFEST.MF18
-rw-r--r--tests/org.eclipse.jet.tests/about.html29
-rw-r--r--tests/org.eclipse.jet.tests/build.properties10
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF17
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xmlbin150 -> 0 bytes
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xmlbin150 -> 0 bytes
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml4
-rw-r--r--tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml4
-rw-r--r--tests/org.eclipse.jet.tests/data/DOMInspector.xml11
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet41
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet.expected104
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java76
-rw-r--r--tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet6
-rw-r--r--tests/org.eclipse.jet.tests/data/bean.model.sample.xml22
-rw-r--r--tests/org.eclipse.jet.tests/data/beanModel.badlocation.xml21
-rw-r--r--tests/org.eclipse.jet.tests/data/beanModel.xml21
-rw-r--r--tests/org.eclipse.jet.tests/data/beanModel.xsd39
-rw-r--r--tests/org.eclipse.jet.tests/data/beans.xsd43
-rw-r--r--tests/org.eclipse.jet.tests/data/bug147714.jet11
-rw-r--r--tests/org.eclipse.jet.tests/data/dm-example.xml37
-rw-r--r--tests/org.eclipse.jet.tests/data/dm-example.xsd145
-rw-r--r--tests/org.eclipse.jet.tests/data/jetast.ecore97
-rw-r--r--tests/org.eclipse.jet.tests/data/library.xml25
-rw-r--r--tests/org.eclipse.jet.tests/data/library.xml.indisguise25
-rw-r--r--tests/org.eclipse.jet.tests/data/lineinfo.jet10
-rw-r--r--tests/org.eclipse.jet.tests/data/lineinfo.jet.expected.txt10
-rw-r--r--tests/org.eclipse.jet.tests/data/newproject.nolocation.xml4
-rw-r--r--tests/org.eclipse.jet.tests/data/newproject.xml4
-rw-r--r--tests/org.eclipse.jet.tests/data/newproject.xsd81
-rw-r--r--tests/org.eclipse.jet.tests/data/plain.xml21
-rw-r--r--tests/org.eclipse.jet.tests/data/sample.dataaccess10
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/changedTemplates/simple.v2.input.jet11
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet10
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet.expected.java118
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input2.jet10
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.loader.expected.java83
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat1
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat21
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat31
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat41
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.nopredefs.expected.java23
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.predefs.expected.java39
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup/ChildrenOnly.xml5
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup/MixedChildren.xml7
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup/ReallySpecialChildren.xml8
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup/SpecialChildrenOnly.xml5
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup/XMLSchemaWithGroups.xsd46
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup_2.4/ChildrenOnly.xml5
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup_2.4/MixedChildren.xml7
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup_2.4/ReallySpecialChildren.xml8
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup_2.4/SpecialChildrenOnly.xml5
-rw-r--r--tests/org.eclipse.jet.tests/data/substGroup_2.4/XMLSchemaWithGroups.xsd49
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet10
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.astdump.expected41
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.expected.java114
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected46
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java114
-rw-r--r--tests/org.eclipse.jet.tests/data/textTrimmingTests.jet70
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedComment.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedDeclaration.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedDirective.jet1
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedExpression.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedScriplet.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet3
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlStartWithoutEnd.jet8
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/README.txt4
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.ecore82
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.genmodel31
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.xsd16
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/humans.xml7
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.ecore102
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.genmodel31
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.xsd32
-rw-r--r--tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/humans.xml7
-rw-r--r--tests/org.eclipse.jet.tests/model/dataAccess.ecore24
-rw-r--r--tests/org.eclipse.jet.tests/model/dataAccess.genmodel25
-rw-r--r--tests/org.eclipse.jet.tests/plugin.properties19
-rw-r--r--tests/org.eclipse.jet.tests/plugin.xml48
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/Customer.java44
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/DataAccessFactory.java73
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/DataAccessPackage.java503
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/Employee.java71
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/Order.java110
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/Person.java81
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/impl/CustomerImpl.java147
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessFactoryImpl.java130
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessPackageImpl.java327
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/impl/EmployeeImpl.java217
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/impl/OrderImpl.java271
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/impl/PersonImpl.java215
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessAdapterFactory.java171
-rw-r--r--tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessSwitch.java195
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllSuites.java60
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java29
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/FileUtils.java93
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java22
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/LineInfoTests.java65
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestCompilationHelper.java163
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java478
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java370
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestSimplifiedCompiler.java431
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java225
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/AllTests.java19
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/EmfModelLoaderTests.java82
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/TestXMLDocumentLoads.java113
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/WorkspaceContextTests.java37
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/AllTests.java19
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/ResourceTemplateInputTest.java136
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverBuilderTest.java114
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverHelperFactoryTest.java126
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java19
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleDescriptions.java42
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java47
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleLoading.java76
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java83
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/AllTests.java17
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TagLibraryDataFactoryTests.java104
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TestTagLibManager.java58
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/AllTests.java17
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/LoadTagTests.java48
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/AllTests.java21
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatContextExtenderTests.java42
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatNowTagTests.java60
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/LowerCaseTagTests.java209
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UpperCaseTagTests.java209
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UuidTagTests.java56
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/AllTests.java17
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java70
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/TestImportsLocationTag.java136
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java117
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java17
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AbstractExprTest.java93
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java50
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorOrSelfTests.java86
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorTests.java82
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AttributeStepTests.java71
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BooleanFunctionTests.java61
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/Bug130552Workaround.java78
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BuiltinStringFunctionsTests.java214
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ChildStepTests.java145
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DOMInspectorTests.java185
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java58
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantTests.java60
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EMFResourceInspectorTests.java116
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java1052
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EStructuralFeatureSettingTests.java98
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ExpandedNameTests.java88
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingSiblingTests.java79
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingTests.java102
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/LogicalOpTests.java54
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberBinaryOpTests.java63
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberFunctionTests.java39
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ParentStepTests.java84
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingSiblingTests.java76
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingTests.java116
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RelOpTests.java328
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceAttributeInspectorTests.java406
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceInspectorTests.java482
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RootTests.java82
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/SelfStepTests.java117
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/StringFunctionTests.java61
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/VariableTests.java86
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathInspectorManagerTests.java45
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathOverDOMTests.java113
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathOverEcoreTests.java44
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathOverEmfXmlXsdTests.java127
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathParserDefects.java35
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathParserTests.java768
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/XPathTokenScannerTests.java259
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/AllTests.java28
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/CamelCaseFunctionTests.java42
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/CardinalityFunctionTests.java84
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/ClassNameFunctionTests.java44
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/EscapeJavaWhitespaceFunctionTests.java26
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/LowerCaseFunctionTests.java25
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/LowercaseFirstFunctionTests.java31
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/PackageNameFunctionTests.java44
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/RemoveWhitespaceFunctionTests.java23
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/TrimWhitespaceFunctionTests.java24
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/UpperCaseFirstFunctionTests.java41
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/UpperCaseFunctionTests.java25
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/functions/extras/XMLEncodeFunctionTests.java25
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/AbstractCopyElementTests.java82
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/AbstractEMFXMLSubclassTests.java114
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/AbstractSubstitutionGroupTests.java141
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/AllTests.java34
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/EMFXML24SubstitutionGroupTests.java40
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/EMFXMLCopyELementTests.java28
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/LegacyEMFXMLSubstitutionGroupTests.java28
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/XMLDOMCopyElementTests.java28
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/XMLSubclasses.java47
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/inspectors/XMLSubclassesWithoutMetadata.java48
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/DocumentRoot.java115
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/Human.java110
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/HumanFactory.java82
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/HumanPackage.java570
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/Man.java53
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/Root.java47
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/Woman.java53
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/DocumentRootImpl.java279
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/HumanFactoryImpl.java141
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/HumanImpl.java249
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/HumanPackageImpl.java453
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/ManImpl.java160
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/RootImpl.java149
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/impl/WomanImpl.java160
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/util/HumanAdapterFactory.java188
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/util/HumanResourceFactoryImpl.java55
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/util/HumanResourceImpl.java32
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/util/HumanSwitch.java216
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/util/HumanXMLProcessor.java51
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/validation/DocumentRootValidator.java28
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/validation/HumanValidator.java21
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/validation/ManValidator.java20
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/validation/RootValidator.java21
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human/validation/WomanValidator.java20
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/DocumentRoot.java115
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/Human.java110
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/Human2Factory.java82
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/Human2Package.java570
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/Man.java81
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/Root.java47
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/Woman.java81
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/DocumentRootImpl.java279
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/Human2FactoryImpl.java141
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/Human2PackageImpl.java481
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/HumanImpl.java249
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/ManImpl.java194
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/RootImpl.java149
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/impl/WomanImpl.java194
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/util/Human2AdapterFactory.java188
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/util/Human2ResourceFactoryImpl.java55
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/util/Human2ResourceImpl.java32
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/util/Human2Switch.java216
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/util/Human2XMLProcessor.java51
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/validation/DocumentRootValidator.java28
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/validation/HumanValidator.java21
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/validation/ManValidator.java20
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/validation/RootValidator.java21
-rw-r--r--tests/org.eclipse.jet.tests/src/org/example/human2/validation/WomanValidator.java20
-rw-r--r--tests/org.eclipse.jet.tests/test.xml66
-rw-r--r--tests/org.eclipse.jet.tests/text/description.txt27
251 files changed, 0 insertions, 22898 deletions
diff --git a/tests/org.eclipse.jet.tests/.classpath b/tests/org.eclipse.jet.tests/.classpath
deleted file mode 100644
index ce73933..0000000
--- a/tests/org.eclipse.jet.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.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.jet.tests/.cvsignore b/tests/org.eclipse.jet.tests/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/tests/org.eclipse.jet.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.jet.tests/.project b/tests/org.eclipse.jet.tests/.project
deleted file mode 100644
index b145280..0000000
--- a/tests/org.eclipse.jet.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jet.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/tests/org.eclipse.jet.tests/.settings/org.eclipse.core.resources.prefs b/tests/org.eclipse.jet.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 68bb836..0000000
--- a/tests/org.eclipse.jet.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,6 +0,0 @@
-#Thu Jan 12 10:55:42 EST 2006
-eclipse.preferences.version=1
-encoding//data/alljet2.jet=UTF-8
-encoding//data/alljet2.jet.expected=UTF-8
-encoding//data/beans.xsd=UTF8
-encoding//data/dm-example.xsd=UTF8
diff --git a/tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 96cf3d5..0000000
--- a/tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,59 +0,0 @@
-#Tue Apr 03 15:27:11 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-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.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-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.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=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.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.3
diff --git a/tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 2e01db6..0000000
--- a/tests/org.eclipse.jet.tests/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Thu Sep 25 16:24:39 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.javadoc=false
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\r\n * Copyright (c) ${year} IBM Corporation and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM - Initial API and implementation\r\n *\r\n * /\r\n *******************************************************************************/\r\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/tests/org.eclipse.jet.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jet.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index fda513c..0000000
--- a/tests/org.eclipse.jet.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jet.tests;singleton:=true
-Bundle-Version: 0.9.3.qualifier
-Bundle-ClassPath: tests.jar
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jet,
- org.junit,
- org.eclipse.emf.codegen,
- org.eclipse.core.runtime,
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.xsd,
- org.eclipse.core.filebuffers,
- org.eclipse.core.resources
-Bundle-Vendor: %providerName
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/tests/org.eclipse.jet.tests/about.html b/tests/org.eclipse.jet.tests/about.html
deleted file mode 100644
index d4f39ad..0000000
--- a/tests/org.eclipse.jet.tests/about.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!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>About</title>
-</head>
-<body lang="EN-US">
- <h3>About This Content</h3>
-
- <p>June 5, 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/org/documents/epl-v10.php">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
- and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
- <p align="right"><small><a href="#top">go to top</a></small></p>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.jet.tests/build.properties b/tests/org.eclipse.jet.tests/build.properties
deleted file mode 100644
index d2ceaa4..0000000
--- a/tests/org.eclipse.jet.tests/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-# NLS_MESSAGEFORMAT_VAR
-source.tests.jar = src/
-output.tests.jar = bin/
-bin.includes = META-INF/,\
- .,\
- data/,\
- plugin.xml,\
- about.html,\
- test.xml
-src.includes = about.html
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF b/tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF
deleted file mode 100644
index ff8d913..0000000
--- a/tests/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jet.tests;singleton:=true
-Bundle-Version: 0.7.0.qualifier
-Bundle-ClassPath: tests.jar
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jet,
- org.junit,
- org.eclipse.emf.codegen,
- org.eclipse.core.runtime,
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.xsd,
- org.eclipse.core.filebuffers,
- org.eclipse.core.resources
-Bundle-Vendor: %providerName
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml
deleted file mode 100644
index 368bb8c..0000000
--- a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml
deleted file mode 100644
index a167ef1..0000000
--- a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml
deleted file mode 100644
index 59bda64..0000000
--- a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<root>
- <a attr="b"/>
-</root>
diff --git a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml b/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml
deleted file mode 100644
index e93c6a2..0000000
--- a/tests/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<root>
- <a attr="b"/>
-</root>
diff --git a/tests/org.eclipse.jet.tests/data/DOMInspector.xml b/tests/org.eclipse.jet.tests/data/DOMInspector.xml
deleted file mode 100644
index dd08e67..0000000
--- a/tests/org.eclipse.jet.tests/data/DOMInspector.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<root rootAttr="test">
- <!-- a comment within root -->
- <a name="foo" name-with_hyphen="hello">
- <b>Some foo text.</b>
- </a>
- <a name="bar">
- <b>Some bar text.</b>
- </a>
-</root>
diff --git a/tests/org.eclipse.jet.tests/data/alljet2.jet b/tests/org.eclipse.jet.tests/data/alljet2.jet
deleted file mode 100644
index f38e90f..0000000
--- a/tests/org.eclipse.jet.tests/data/alljet2.jet
+++ /dev/null
@@ -1,41 +0,0 @@
-<%@jet class="Foo" package="org.eclipse.emf.examples"%>
-<%-- @header
-This is the header comment for the file
-It has many lines
---%>
-<%-- @class
-This is the class comment.
-It has many lines --%>
-Some top level text.
-<%= "An expression" %>
-<%!
-int foo() {
- return 3;
-}
-%>
-<%
-if(foo() > 0) {
- foo();
-}
-%>
-<%-- a comment --%>
-<test:container one="test one" two='test two'>
- <test:empty/>
- <test:container>
- some text <nontest:text attributes="foo"/>
- </test:container>
-</test:container>
-<%-- tags containing Java --%>
-<test:container>
- <%= foo(); %>
- <% if(foo() > 0) { %>
- some text
- <% } %>
-</test:container>
-<%-- Java container tags --%>
-<% if(foo() > 0) { %>
- some text
- <test:empty/>
- <test:container>
- </test:container>
-<% } %>
diff --git a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected b/tests/org.eclipse.jet.tests/data/alljet2.jet.expected
deleted file mode 100644
index 1208675..0000000
--- a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected
+++ /dev/null
@@ -1,104 +0,0 @@
-<directive name="jet" start="(1,1)" stop="(1,56)">
- <attribute name="class">Foo</attribute>
- <attribute name="package">org.eclipse.emf.examples</attribute>
-</directive>
-<data>
-</data>
-<comment start="(2,5)" stop="(5,1)"> @header
-This is the header comment for the file
-It has many lines
-</comment>
-<data>
-</data>
-<comment start="(6,5)" stop="(8,19)"> @class
-This is the class comment.
-It has many lines </comment>
-<data>
-Some top level text.
-</data>
-<expression start="(10,4)" stop="(10,21)"> "An expression" </expression>
-<data>
-</data>
-<declaration start="(11,4)" stop="(15,1)">
-int foo() {
- return 3;
-}
-</declaration>
-<data>
-</data>
-<scriptlet start="(16,3)" stop="(20,1)">
-if(foo() > 0) {
- foo();
-}
-</scriptlet>
-<data>
-</data>
-<comment start="(21,5)" stop="(21,16)"> a comment </comment>
-<data>
-</data>
-<tag name="test:container" start="(22,1)" stop="(22,47)">
- <attribute name="one">test one</attribute>
- <attribute name="two">test two</attribute>
- <content>
- <data>
- </data>
- <tag name="test:empty" start="(23,5)" stop="(23,18)">
- </tag>
- <data>
- </data>
- <tag name="test:container" start="(24,5)" stop="(24,21)">
- <content>
- <data>
- some text <nontest:text attributes="foo"/>
- </data>
- </content>
- </tag>
- <data>
-</data>
- </content>
-</tag>
-<data>
-</data>
-<comment start="(28,5)" stop="(28,27)"> tags containing Java </comment>
-<data>
-</data>
-<tag name="test:container" start="(29,1)" stop="(29,17)">
- <content>
- <data>
- </data>
- <expression start="(30,8)" stop="(30,16)"> foo(); </expression>
- <data>
- </data>
- <scriptlet start="(31,7)" stop="(31,24)"> if(foo() > 0) { </scriptlet>
- <data>
- some text
- </data>
- <scriptlet start="(33,7)" stop="(33,10)"> } </scriptlet>
- <data>
-</data>
- </content>
-</tag>
-<data>
-</data>
-<comment start="(35,5)" stop="(35,26)"> Java container tags </comment>
-<data>
-</data>
-<scriptlet start="(36,3)" stop="(36,20)"> if(foo() > 0) { </scriptlet>
-<data>
- some text
- </data>
-<tag name="test:empty" start="(38,9)" stop="(38,22)">
-</tag>
-<data>
- </data>
-<tag name="test:container" start="(39,9)" stop="(39,25)">
- <content>
- <data>
- </data>
- </content>
-</tag>
-<data>
-</data>
-<scriptlet start="(41,3)" stop="(41,6)"> } </scriptlet>
-<data>
-</data>
diff --git a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java b/tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java
deleted file mode 100644
index 80cdc4c..0000000
--- a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This is the header comment for the file
- * It has many lines
- */
-package org.eclipse.emf.examples;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-
-/**
- * This is the class comment.
- * It has many lines
- */
-public class Foo implements JET2Template {
-
-
-int foo() {
- return 3;
-}
-
- public Foo() {
- super();
- }
-
- private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
-
- public void generate(final JET2Context context, final JET2Writer __out) {
- JET2Writer out = __out;
- out.write("Some top level text."); //$NON-NLS-1$
- out.write(NL);
- out.write( "An expression" );
- out.write(NL);
-
-if(foo() > 0) {
- foo();
-}
-
- // a comment
- out.write("<test:container one=\"test one\" two='test two'>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" <test:empty/>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" <test:container>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" some text <nontest:text attributes=\"foo\"/>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" </test:container>"); //$NON-NLS-1$
- out.write(NL);
- out.write("</test:container>"); //$NON-NLS-1$
- out.write(NL);
- // tags containing Java
- out.write("<test:container>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" "); //$NON-NLS-1$
- out.write( foo(); );
- out.write(NL);
- if(foo() > 0) {
- out.write(" some text"); //$NON-NLS-1$
- out.write(NL);
- }
- out.write("</test:container>"); //$NON-NLS-1$
- out.write(NL);
- // Java container tags
- if(foo() > 0) {
- out.write(" some text"); //$NON-NLS-1$
- out.write(NL);
- out.write(" <test:empty/>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" <test:container>"); //$NON-NLS-1$
- out.write(NL);
- out.write(" </test:container>"); //$NON-NLS-1$
- out.write(NL);
- }
- }
-}
diff --git a/tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet b/tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet
deleted file mode 100644
index 99bf3cc..0000000
--- a/tests/org.eclipse.jet.tests/data/attributeParsingErrors.jet
+++ /dev/null
@@ -1,6 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
-
-<%-- The following line is missing a double quote (") on the 'var' attribute --%>
-<c:iterate select="foo" var="bar>
- some text parameterized by bar: <c:get select="$bar"/>
-</c:iterate> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/bean.model.sample.xml b/tests/org.eclipse.jet.tests/data/bean.model.sample.xml
deleted file mode 100644
index c2367f2..0000000
--- a/tests/org.eclipse.jet.tests/data/bean.model.sample.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<root>
- <project name="test.beans">
- <beanmodel name="Library" basePackage="base.pkg">
- <bean name="Author" project="foo">
- <attribute name="name" type="String" kind="FIELD"/>
- <attribute name="books" type="Book" kind="LIST"/>
- </bean>
- <bean name="Book">
- <attribute name="title" type="String" kind="FIELD">The book title</attribute>
- <attribute name="pages" type="int" kind="FIELD"/>
- <attribute name="authors" type="Book" kind="LIST"/>
- </bean>
- <bean name="Library">
- <attribute name="name" type="String" kind="FIELD"/>
- <attribute name="yearFounded" type="int" kind="FIELD"/>
- <attribute name="authors" type="Author" kind="LIST"/>
- <attribute name="books" type="Book" kind="LIST"/>
- <attribute name="openSince" type="int" kind="DERIVED"/>
- </bean>
- </beanmodel>
- </project>
-</root> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/beanModel.badlocation.xml b/tests/org.eclipse.jet.tests/data/beanModel.badlocation.xml
deleted file mode 100644
index e819cbf..0000000
--- a/tests/org.eclipse.jet.tests/data/beanModel.badlocation.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="missing.beanModel.xsd">
- <beanModel basePackage="org.example" name="Library">
- <bean name="Library">
- <attribute kind="FIELD" name="name" type="String"/>
- <attribute kind="FIELD" name="yearFounded" type="int"/>
- <attribute kind="DERIVED" name="yearsOpen" type="int"/>
- <attribute kind="LIST" name="books" type="Book"/>
- <attribute kind="LIST" name="authors" type="Author"/>
- </bean>
- <bean name="Book">
- <attribute kind="FIELD" name="title" type="String"/>
- <attribute kind="FIELD" name="pages" type="int"/>
- <attribute kind="LIST" name="author" type="Author"/>
- </bean>
- <bean name="Author">
- <attribute kind="FIELD" name="name" type="String"/>
- <attribute kind="LIST" name="books" type="Book"/>
- </bean>
- </beanModel>
-</root>
diff --git a/tests/org.eclipse.jet.tests/data/beanModel.xml b/tests/org.eclipse.jet.tests/data/beanModel.xml
deleted file mode 100644
index fb8d74c..0000000
--- a/tests/org.eclipse.jet.tests/data/beanModel.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="beanModel.xsd">
- <beanModel basePackage="org.example" name="Library">
- <bean name="Library">
- <attribute kind="FIELD" name="name" type="String"/>
- <attribute kind="FIELD" name="yearFounded" type="int"/>
- <attribute kind="DERIVED" name="yearsOpen" type="int"/>
- <attribute kind="LIST" name="books" type="Book"/>
- <attribute kind="LIST" name="authors" type="Author"/>
- </bean>
- <bean name="Book">
- <attribute kind="FIELD" name="title" type="String"/>
- <attribute kind="FIELD" name="pages" type="int"/>
- <attribute kind="LIST" name="author" type="Author"/>
- </bean>
- <bean name="Author">
- <attribute kind="FIELD" name="name" type="String"/>
- <attribute kind="LIST" name="books" type="Book"/>
- </bean>
- </beanModel>
-</root>
diff --git a/tests/org.eclipse.jet.tests/data/beanModel.xsd b/tests/org.eclipse.jet.tests/data/beanModel.xsd
deleted file mode 100644
index 13a285a..0000000
--- a/tests/org.eclipse.jet.tests/data/beanModel.xsd
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="root">
- <xsd:sequence>
- <xsd:element name="beanModel" type="beanModel" maxOccurs="unbounded" minOccurs="0"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="project">
- <xsd:sequence>
- <xsd:element name="beanModel" type="beanModel" maxOccurs="unbounded" minOccurs="0"></xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:complexType name="beanModel">
- <xsd:sequence>
- <xsd:element name="bean" type="bean" maxOccurs="unbounded" minOccurs="0"></xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"></xsd:attribute>
- <xsd:attribute name="basePackage" type="xsd:string"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:complexType name="bean">
- <xsd:sequence>
- <xsd:element name="attribute" type="attribute" maxOccurs="unbounded" minOccurs="0"></xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:complexType name="attribute">
- <xsd:attribute name="name" type="xsd:string"></xsd:attribute>
- <xsd:attribute name="type" type="xsd:string"></xsd:attribute>
- <xsd:attribute name="kind" type="xsd:string"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:element name="root" type="root"></xsd:element>
-</xsd:schema> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/beans.xsd b/tests/org.eclipse.jet.tests/data/beans.xsd
deleted file mode 100644
index f886846..0000000
--- a/tests/org.eclipse.jet.tests/data/beans.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.example.org/beans" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://www.example.org/beans">
- <xsd:complexType name="root">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="project" type="project"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="project">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="beanModel" type="beanModel"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="beanModel">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="bean" type="bean"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="basePackage" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="bean">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="attribute" type="attribute"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="attribute">
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="doc" type="xsd:string"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="kind" type="xsd:string"/>
- <xsd:attribute name="name-with_hyphen" type="xsd:string" use="optional"/>
- </xsd:complexType>
-
- <xsd:element name="root" type="root"/>
-
-</xsd:schema>
diff --git a/tests/org.eclipse.jet.tests/data/bug147714.jet b/tests/org.eclipse.jet.tests/data/bug147714.jet
deleted file mode 100644
index ec12e85..0000000
--- a/tests/org.eclipse.jet.tests/data/bug147714.jet
+++ /dev/null
@@ -1,11 +0,0 @@
-<%-- Bug 147714 requests the JET compiler to treat <tag ...> as <tag .../> if tag is an emptyTag.
-This is for compatibility with DPTK: http://www.alphaworks.ibm.com/tech/dptk.
-Since DPTK does not use namespace prefixes, the fix only applies to tags with not prefix.
---%>
-<%@taglib id="org.eclipse.jet.controlTags" prefix="c" %>
-<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="" %>
-
-<%-- line 8: expect error --%><c:get select="$foo">
-<%-- line 9: expect ok --%><c:get select="$foo"/>
-<%-- line 10: expect warning --%><nl>
-<%-- line 11: expect ok --%><nl/>
diff --git a/tests/org.eclipse.jet.tests/data/dm-example.xml b/tests/org.eclipse.jet.tests/data/dm-example.xml
deleted file mode 100644
index f03f715..0000000
--- a/tests/org.eclipse.jet.tests/data/dm-example.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="dm-example.xsl"?>
-<catalog xmlns="http://www.example.com/catalog"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.example.com/catalog
- dm-example.xsd"
- xml:lang="en"
- version="0.1">
-
-<!-- This example is for data model illustration only.
- It does not demonstrate good schema design. -->
-
-<tshirt code="T1534017" label=" Staind : Been Awhile "
- xlink:href="http://example.com/0,,1655091,00.html"
- sizes="M L XL">
- <title> Staind: Been Awhile Tee Black (1-sided) </title>
- <description>
- <html:p>
- Lyrics from the hit song 'It's Been Awhile'
- are shown in white, beneath the large
- 'Flock &amp; Weld' Staind logo.
- </html:p>
- </description>
- <price> 25.00 </price>
-</tshirt>
-
-<album code="A1481344" label=" Staind : Its Been A While "
- formats="CD">
- <title> It's Been A While </title>
- <description xsi:nil="true" />
- <price currency="USD"> 10.99 </price>
- <artist> Staind </artist>
-</album>
-
-</catalog> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/dm-example.xsd b/tests/org.eclipse.jet.tests/data/dm-example.xsd
deleted file mode 100644
index 0231cf3..0000000
--- a/tests/org.eclipse.jet.tests/data/dm-example.xsd
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:cat="http://www.example.com/catalog" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.example.com/catalog">
-
-<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-
-<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xlinks-2001.xsd"/>
-
-<xs:element name="catalog">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" ref="cat:_item"/>
- </xs:sequence>
- <xs:attribute fixed="0.1" name="version" type="xs:string" use="required"/>
- <xs:attribute ref="xml:base"/>
- <xs:attribute ref="xml:lang"/>
- </xs:complexType>
-</xs:element>
-
-<xs:element abstract="true" name="_item" type="cat:itemType"/>
-
-<xs:complexType name="itemType">
- <xs:sequence>
- <xs:element name="title" type="xs:token"/>
- <xs:element name="description" nillable="true" type="cat:description"/>
- <xs:element maxOccurs="unbounded" name="price" type="cat:price"/>
- </xs:sequence>
- <xs:attribute name="label" type="xs:token"/>
- <xs:attribute name="code" type="xs:ID" use="required"/>
- <xs:attributeGroup ref="xlink:simpleLink"/>
-</xs:complexType>
-
-<xs:element name="tshirt" substitutionGroup="cat:_item" type="cat:tshirtType"/>
-
-<xs:complexType name="tshirtType">
- <xs:complexContent>
- <xs:extension base="cat:itemType">
- <xs:attribute name="sizes" type="cat:clothesSizes" use="required"/>
- </xs:extension>
- </xs:complexContent>
-</xs:complexType>
-
-<xs:simpleType name="clothesSizes">
- <xs:union memberTypes="cat:sizeList">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="oneSize"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:union>
-</xs:simpleType>
-
-<xs:simpleType name="sizeList">
- <xs:restriction>
- <xs:simpleType>
- <xs:list itemType="cat:clothesSize"/>
- </xs:simpleType>
- <xs:minLength value="1"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:simpleType name="clothesSize">
- <xs:union memberTypes="cat:numberedSize cat:categorySize"/>
-</xs:simpleType>
-
-<xs:simpleType name="numberedSize">
- <xs:restriction base="xs:integer">
- <xs:enumeration value="4"/>
- <xs:enumeration value="6"/>
- <xs:enumeration value="8"/>
- <xs:enumeration value="10"/>
- <xs:enumeration value="12"/>
- <xs:enumeration value="14"/>
- <xs:enumeration value="16"/>
- <xs:enumeration value="18"/>
- <xs:enumeration value="20"/>
- <xs:enumeration value="22"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:simpleType name="categorySize">
- <xs:restriction base="xs:token">
- <xs:enumeration value="XS"/>
- <xs:enumeration value="S"/>
- <xs:enumeration value="M"/>
- <xs:enumeration value="L"/>
- <xs:enumeration value="XL"/>
- <xs:enumeration value="XXL"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:element name="album" substitutionGroup="cat:_item" type="cat:albumType"/>
-
-<xs:complexType name="albumType">
- <xs:complexContent>
- <xs:extension base="cat:itemType">
- <xs:sequence>
- <xs:element name="artist" type="xs:string"/>
- </xs:sequence>
- <xs:attribute name="formats" type="cat:formatsType" use="required"/>
- </xs:extension>
- </xs:complexContent>
-</xs:complexType>
-
-<xs:simpleType name="formatsType">
- <xs:list itemType="cat:formatType"/>
-</xs:simpleType>
-
-<xs:simpleType name="formatType">
- <xs:restriction base="xs:token">
- <xs:enumeration value="CD"/>
- <xs:enumeration value="MiniDisc"/>
- <xs:enumeration value="tape"/>
- <xs:enumeration value="vinyl"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:complexType mixed="true" name="description">
- <xs:sequence>
- <xs:any maxOccurs="unbounded" minOccurs="0" namespace="http://www.w3.org/1999/xhtml" processContents="lax"/>
- </xs:sequence>
- <xs:attribute ref="xml:lang"/>
-</xs:complexType>
-
-<xs:complexType name="price">
- <xs:simpleContent>
- <xs:extension base="cat:monetaryAmount">
- <xs:attribute default="USD" name="currency" type="cat:currencyType"/>
- </xs:extension>
- </xs:simpleContent>
-</xs:complexType>
-
-<xs:simpleType name="currencyType">
- <xs:restriction base="xs:token">
- <xs:pattern value="[A-Z]{3}"/>
- </xs:restriction>
-</xs:simpleType>
-
-<xs:simpleType name="monetaryAmount">
- <xs:restriction base="xs:decimal">
- <xs:fractionDigits value="3"/>
- <xs:pattern value="\d+\.(\d{2})?"/>
- </xs:restriction>
-</xs:simpleType>
-
-</xs:schema>
diff --git a/tests/org.eclipse.jet.tests/data/jetast.ecore b/tests/org.eclipse.jet.tests/data/jetast.ecore
deleted file mode 100644
index 7003325..0000000
--- a/tests/org.eclipse.jet.tests/data/jetast.ecore
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="jetast"
- nsURI="http:///org/eclipse/emf/jet2/compile/jetast.ecore" nsPrefix="org.eclipse.emf.jet2.compile.jetast">
- <eClassifiers xsi:type="ecore:EClass" name="JET2AST"/>
- <eClassifiers xsi:type="ecore:EClass" name="JET2ASTElement" abstract="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="line" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="start" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="end" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="ast" eType="#//JET2AST"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//JET2ASTElement"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Comment" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="commentStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="commentEnd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="comment" eType="#//JavaCharArray"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="JavaElement" abstract="true" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaEnd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaContent" eType="#//JavaCharArray"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="JET2Declaration" eSuperTypes="#//JavaElement"/>
- <eClassifiers xsi:type="ecore:EClass" name="JET2Expression" eSuperTypes="#//JavaElement"/>
- <eClassifiers xsi:type="ecore:EClass" name="JET2Scriptlet" eSuperTypes="#//JavaElement"/>
- <eClassifiers xsi:type="ecore:EClass" name="JET2CompilationUnit" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fileName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaOutputPackage" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaOutputClass" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="errors" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- changeable="false" derived="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="warnings" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
- changeable="false" derived="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="problems" upperBound="-1"
- eType="#//Problem" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="bodyElements" upperBound="-1"
- eType="#//JET2ASTElement" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Problem">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="originatingFileName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="lineNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="start" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="end" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="message" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="msgArgs" eType="#//ObjectArray"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="severity" eType="#//Severity"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="#//ProblemId"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="Severity">
- <eLiterals name="ERROR"/>
- <eLiterals name="WARNING" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="ProblemId">
- <eLiterals name="MissingXmlStartTag"/>
- <eLiterals name="MissingXmlEndTag" value="1"/>
- <eLiterals name="MissingRequiredAttribute" value="2"/>
- <eLiterals name="DuplicateXMLNamespacePrefix" value="3"/>
- <eLiterals name="UnknownTagLibrary" value="4"/>
- <eLiterals name="UnknownAttributeInTag" value="5"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="JET2Directive" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
- eType="#//Attribute" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="TextElement" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" eType="#//JavaCharArray"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XMLElement" abstract="true" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="tagDefinition" eType="#//TagDefinition"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XMLEmptyElement" eSuperTypes="#//XMLElement"/>
- <eClassifiers xsi:type="ecore:EClass" name="XMLBodyElement" eSuperTypes="#//XMLElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="endTagStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="endTagEnd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
- eType="#//Attribute" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="bodyElements" upperBound="-1"
- eType="#//JET2ASTElement" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Attribute" eSuperTypes="#//JET2ASTElement">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nameStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nameEnd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueEnd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="equalsOffset" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="JavaCharArray" instanceClassName="char[]"/>
- <eClassifiers xsi:type="ecore:EDataType" name="ObjectArray" instanceClassName="Object[]"/>
- <eClassifiers xsi:type="ecore:EDataType" name="TagDefinition" instanceClassName="org.eclipse.emf.jet2.taglib.TagDefinition"/>
-</ecore:EPackage>
diff --git a/tests/org.eclipse.jet.tests/data/library.xml b/tests/org.eclipse.jet.tests/data/library.xml
deleted file mode 100644
index 12e1c14..0000000
--- a/tests/org.eclipse.jet.tests/data/library.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:root xmlns:beans="http://www.example.org/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/beans beans.xsd ">
- <project name="test.beans">
- <beanModel basePackage="org.example" name="Library">
- <bean name="Library">
- <attribute kind="FIELD" name="name" type="String" name-with_hyphen="hello"/>
- <attribute kind="FIELD" name="yearFounded" type="int"/>
- <attribute kind="DERIVED" name="yearsOpen" type="int"/>
- <attribute kind="LIST" name="books" type="Book"/>
- <attribute kind="LIST" name="authors" type="Author"/>
- </bean>
- <bean name="Book">
- <attribute kind="FIELD" name="title" type="String"/>
- <attribute kind="FIELD" name="pages" type="int"/>
- <attribute kind="LIST" name="authors" type="Author"/>
- </bean>
- <bean name="Author">
- <attribute kind="FIELD" name="name" type="String">
- <doc>doc for Author.name</doc>
- </attribute>
- <attribute kind="LIST" name="books" type="Book"/>
- </bean>
- </beanModel>
- </project>
-</beans:root>
diff --git a/tests/org.eclipse.jet.tests/data/library.xml.indisguise b/tests/org.eclipse.jet.tests/data/library.xml.indisguise
deleted file mode 100644
index bd34f57..0000000
--- a/tests/org.eclipse.jet.tests/data/library.xml.indisguise
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:root xmlns:beans="http://www.example.org/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/beans beans.xsd ">
- <project name="test.beans">
- <beanModel basePackage="org.example" name="Library">
- <bean name="Library">
- <attribute kind="FIELD" name="name" type="String"/>
- <attribute kind="FIELD" name="yearFounded" type="int"/>
- <attribute kind="DERIVED" name="yearsOpen" type="int"/>
- <attribute kind="LIST" name="books" type="Book"/>
- <attribute kind="LIST" name="authors" type="Author"/>
- </bean>
- <bean name="Book">
- <attribute kind="FIELD" name="title" type="String"/>
- <attribute kind="FIELD" name="pages" type="int"/>
- <attribute kind="LIST" name="authors" type="Author"/>
- </bean>
- <bean name="Author">
- <attribute kind="FIELD" name="name" type="String">
- <doc>doc for Author.name</doc>
- </attribute>
- <attribute kind="LIST" name="books" type="Book"/>
- </bean>
- </beanModel>
- </project>
-</beans:root>
diff --git a/tests/org.eclipse.jet.tests/data/lineinfo.jet b/tests/org.eclipse.jet.tests/data/lineinfo.jet
deleted file mode 100644
index 2bc9dfc..0000000
--- a/tests/org.eclipse.jet.tests/data/lineinfo.jet
+++ /dev/null
@@ -1,10 +0,0 @@
-<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="test" %>
-"isAllUpper", "nl", "other", "tokenize", "upper"
-
-<test:tokenize string="a,b,c,d,e,f,g" sep="," var="token">
-<test:other>some text</test:other>
-<test:isAllUpper var="token">
-</test:isAllUpper>
-<test:upper>foo</test:upper><test:nl/>
-<test:other/>
-</test:tokenize> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/lineinfo.jet.expected.txt b/tests/org.eclipse.jet.tests/data/lineinfo.jet.expected.txt
deleted file mode 100644
index 4fecfd7..0000000
--- a/tests/org.eclipse.jet.tests/data/lineinfo.jet.expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-1:69:<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="test" %>
-2:48:"isAllUpper", "nl", "other", "tokenize", "upper"
-3:0:
-4:58:<test:tokenize string="a,b,c,d,e,f,g" sep="," var="token">
-5:34:<test:other>some text</test:other>
-6:29:<test:isAllUpper var="token">
-7:18:</test:isAllUpper>
-8:38:<test:upper>foo</test:upper><test:nl/>
-9:13:<test:other/>
-10:16:</test:tokenize>
diff --git a/tests/org.eclipse.jet.tests/data/newproject.nolocation.xml b/tests/org.eclipse.jet.tests/data/newproject.nolocation.xml
deleted file mode 100644
index 28ae5f1..0000000
--- a/tests/org.eclipse.jet.tests/data/newproject.nolocation.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<p:newProjectModel xmlns:p="org.eclipse.jet.transforms.newproject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <project name="test3.foo.bar"/> <!-- HELLO -->
-</p:newProjectModel>
diff --git a/tests/org.eclipse.jet.tests/data/newproject.xml b/tests/org.eclipse.jet.tests/data/newproject.xml
deleted file mode 100644
index 08c4b03..0000000
--- a/tests/org.eclipse.jet.tests/data/newproject.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<p:newProjectModel xmlns:p="org.eclipse.jet.transforms.newproject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="org.eclipse.jet.transforms.newproject newproject.xsd ">
- <project name="test3.foo.bar"/> <!-- HELLO -->
-</p:newProjectModel>
diff --git a/tests/org.eclipse.jet.tests/data/newproject.xsd b/tests/org.eclipse.jet.tests/data/newproject.xsd
deleted file mode 100644
index 55c11d1..0000000
--- a/tests/org.eclipse.jet.tests/data/newproject.xsd
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="org.eclipse.jet.transforms.newproject" xmlns="org.eclipse.jet.transforms.newproject">
-
- <xsd:element name="newProjectModel" type="newProjectModel"></xsd:element>
-
- <xsd:complexType name="newProjectModel">
- <xsd:sequence minOccurs="1">
- <xsd:element name="project" type="project" minOccurs="1"
- maxOccurs="1">
- </xsd:element>
- <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="project">
- <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
- <xsd:attribute name="bundleName" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The display name of the resulting JET project. If
- not specified, this defaults to the value specified
- in the 'name' parameter.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="bundleSymbolicName" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The id of the JET project. If not specified, this
- defaults to the name of the project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="bundleVersion" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The initial version number of the project. If not
- specified, this defaults to 1.0.0.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="bundleVendor" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The Vendor of the JET Project. If not specified,
- this defaults to the empty string.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="binDir" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The directory which will contain binary (compiled)
- Java classes. If not specified, the default is
- 'bin'.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="jet2javaDir" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The directory into which Java source files corresponding to JET templates will be written. The default is 'jet2java'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="templatesDir" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The directory to which initial tempates will be written. The default if 'templates'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="templateLoader" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The fully qualified Java Class name of the template loader class. The default is 'org.eclipse.jet.compiled._jet_transformation'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="startTemplate" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The path of the start template. This path is relative the the tempates directory specified by templatesDir. The default is 'main.jet'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:anyAttribute namespace="##other"></xsd:anyAttribute>
- </xsd:complexType>
-</xsd:schema> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/plain.xml b/tests/org.eclipse.jet.tests/data/plain.xml
deleted file mode 100644
index 254246d..0000000
--- a/tests/org.eclipse.jet.tests/data/plain.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Root1>
- <beanModel1 basePackage="org.example" name="Library">
- <bean1 name="Library">
- <attribute1 kind="FIELD" name="name" type="String"/>
- <attribute1 kind="FIELD" name="yearFounded" type="int"/>
- <attribute1 kind="DERIVED" name="yearsOpen" type="int"/>
- <attribute1 kind="LIST" name="books" type="Book"/>
- <attribute1 kind="LIST" name="authors" type="Author"/>
- </bean1>
- <bean1 name="Book">
- <attribute1 kind="FIELD" name="title" type="String"/>
- <attribute1 kind="FIELD" name="pages" type="int"/>
- <attribute1 kind="LIST" name="author" type="Author"/>
- </bean1>
- <bean1 name="Author">
- <attribute1 kind="FIELD" name="name" type="String"/>
- <attribute1 kind="LIST" name="books" type="Book"/>
- </bean1>
- </beanModel1>
-</Root1> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/sample.dataaccess b/tests/org.eclipse.jet.tests/data/sample.dataaccess
deleted file mode 100644
index 1a7865b..0000000
--- a/tests/org.eclipse.jet.tests/data/sample.dataaccess
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<dataAccess:Employee xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:dataAccess="http:///dataAccess.ecore" name="Bob Smith" address="123 Main St" employeeNumber="12345">
- <customers name="Sam Brown" address="55 Bank St">
- <orders orderNumber="101" date="2005-12-15T00:00:00.000-0500" quantity="25"/>
- <orders orderNumber="13" date="2005-11-15T00:00:00.000-0500" quantity="55"/>
- </customers>
- <customers name="Tim Safari" address="18 Elephant Rd">
- <orders orderNumber="77" date="2005-11-20T00:00:00.000-0500" quantity="3"/>
- </customers>
-</dataAccess:Employee>
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/changedTemplates/simple.v2.input.jet b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/changedTemplates/simple.v2.input.jet
deleted file mode 100644
index 3681ee5..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/changedTemplates/simple.v2.input.jet
+++ /dev/null
@@ -1,11 +0,0 @@
-<%@jet class="ChangedInput"%>
-<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="test" %>
-"isAllUpper", "nl", "other", "tokenize", "upper"
-
-<test:tokenize string="a,b,c,d,e,f,g" sep="," var="token">
-<test:other>some text</test:other>
-<test:isAllUpper var="token">
-</test:isAllUpper>
-<test:upper>foo</test:upper><test:nl/>
-<test:other/>
-</test:tokenize> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet
deleted file mode 100644
index 2bc9dfc..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet
+++ /dev/null
@@ -1,10 +0,0 @@
-<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="test" %>
-"isAllUpper", "nl", "other", "tokenize", "upper"
-
-<test:tokenize string="a,b,c,d,e,f,g" sep="," var="token">
-<test:other>some text</test:other>
-<test:isAllUpper var="token">
-</test:isAllUpper>
-<test:upper>foo</test:upper><test:nl/>
-<test:other/>
-</test:tokenize> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet.expected.java b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet.expected.java
deleted file mode 100644
index b0a469b..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet.expected.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.eclipse.jet.compiled;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.taglib.RuntimeTagElement;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class _jet_simplev2input implements JET2Template {
- private static final String _jetns_test = "org.eclipse.jet.tests.TestLibrary"; //$NON-NLS-1$
-
- public _jet_simplev2input() {
- super();
- }
-
- private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private static final TagInfo _td_test_tokenize_4_1 = new TagInfo("test:tokenize", //$NON-NLS-1$
- 4, 1,
- new String[] {
- "string", //$NON-NLS-1$
- "sep", //$NON-NLS-1$
- "var", //$NON-NLS-1$
- },
- new String[] {
- "a,b,c,d,e,f,g", //$NON-NLS-1$
- ",", //$NON-NLS-1$
- "token", //$NON-NLS-1$
- } );
- private static final TagInfo _td_test_other_5_1 = new TagInfo("test:other", //$NON-NLS-1$
- 5, 1,
- new String[] {
- },
- new String[] {
- } );
- private static final TagInfo _td_test_isAllUpper_6_1 = new TagInfo("test:isAllUpper", //$NON-NLS-1$
- 6, 1,
- new String[] {
- "var", //$NON-NLS-1$
- },
- new String[] {
- "token", //$NON-NLS-1$
- } );
- private static final TagInfo _td_test_upper_8_1 = new TagInfo("test:upper", //$NON-NLS-1$
- 8, 1,
- new String[] {
- },
- new String[] {
- } );
- private static final TagInfo _td_test_nl_8_29 = new TagInfo("test:nl", //$NON-NLS-1$
- 8, 29,
- new String[] {
- },
- new String[] {
- } );
- private static final TagInfo _td_test_other_9_1 = new TagInfo("test:other", //$NON-NLS-1$
- 9, 1,
- new String[] {
- },
- new String[] {
- } );
-
- public void generate(final JET2Context context, final JET2Writer __out) {
- JET2Writer out = __out;
- out.write("\"isAllUpper\", \"nl\", \"other\", \"tokenize\", \"upper\""); //$NON-NLS-1$
- out.write(NL);
- out.write(NL);
- RuntimeTagElement _jettag_test_tokenize_4_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "tokenize", "test:tokenize", _td_test_tokenize_4_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_tokenize_4_1.setRuntimeParent(null);
- _jettag_test_tokenize_4_1.setTagInfo(_td_test_tokenize_4_1);
- _jettag_test_tokenize_4_1.doStart(context, out);
- while (_jettag_test_tokenize_4_1.okToProcessBody()) {
- RuntimeTagElement _jettag_test_other_5_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _td_test_other_5_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_other_5_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_other_5_1.setTagInfo(_td_test_other_5_1);
- _jettag_test_other_5_1.doStart(context, out);
- while (_jettag_test_other_5_1.okToProcessBody()) {
- out.write("some text"); //$NON-NLS-1$
- _jettag_test_other_5_1.handleBodyContent(out);
- }
- _jettag_test_other_5_1.doEnd();
- out.write(NL);
- RuntimeTagElement _jettag_test_isAllUpper_6_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _td_test_isAllUpper_6_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_isAllUpper_6_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_isAllUpper_6_1.setTagInfo(_td_test_isAllUpper_6_1);
- _jettag_test_isAllUpper_6_1.doStart(context, out);
- while (_jettag_test_isAllUpper_6_1.okToProcessBody()) {
- _jettag_test_isAllUpper_6_1.handleBodyContent(out);
- }
- _jettag_test_isAllUpper_6_1.doEnd();
- RuntimeTagElement _jettag_test_upper_8_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "upper", "test:upper", _td_test_upper_8_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_upper_8_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_upper_8_1.setTagInfo(_td_test_upper_8_1);
- _jettag_test_upper_8_1.doStart(context, out);
- JET2Writer _jettag_test_upper_8_1_saved_out = out;
- while (_jettag_test_upper_8_1.okToProcessBody()) {
- out = out.newNestedContentWriter();
- out.write("foo"); //$NON-NLS-1$
- _jettag_test_upper_8_1.handleBodyContent(out);
- }
- out = _jettag_test_upper_8_1_saved_out;
- _jettag_test_upper_8_1.doEnd();
- RuntimeTagElement _jettag_test_nl_8_29 = context.getTagFactory().createRuntimeTag(_jetns_test, "nl", "test:nl", _td_test_nl_8_29); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_nl_8_29.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_nl_8_29.setTagInfo(_td_test_nl_8_29);
- _jettag_test_nl_8_29.doStart(context, out);
- _jettag_test_nl_8_29.doEnd();
- out.write(NL);
- RuntimeTagElement _jettag_test_other_9_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _td_test_other_9_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_other_9_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_other_9_1.setTagInfo(_td_test_other_9_1);
- _jettag_test_other_9_1.doStart(context, out);
- _jettag_test_other_9_1.doEnd();
- _jettag_test_tokenize_4_1.handleBodyContent(out);
- }
- _jettag_test_tokenize_4_1.doEnd();
- }
-}
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input2.jet b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input2.jet
deleted file mode 100644
index 2bc9dfc..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input2.jet
+++ /dev/null
@@ -1,10 +0,0 @@
-<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="test" %>
-"isAllUpper", "nl", "other", "tokenize", "upper"
-
-<test:tokenize string="a,b,c,d,e,f,g" sep="," var="token">
-<test:other>some text</test:other>
-<test:isAllUpper var="token">
-</test:isAllUpper>
-<test:upper>foo</test:upper><test:nl/>
-<test:other/>
-</test:tokenize> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.loader.expected.java b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.loader.expected.java
deleted file mode 100644
index 7cb9a2a..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.loader.expected.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.eclipse.jet.compiled;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jet.JET2TemplateLoader;
-import org.eclipse.jet.JET2TemplateLoaderExtension;
-import org.eclipse.jet.JET2Template;
-
-public class TemplateLoaderClass implements JET2TemplateLoader, JET2TemplateLoaderExtension {
-
- private static final class TemplateFactoryMethod {
-
- private final String templatePath;
- private final String templateClass;
-
- public TemplateFactoryMethod(String templatePath, String templateClass) {
- this.templatePath = templatePath;
- this.templateClass = templateClass;
-
- }
-
- public String getTemplateClass() {
- return this.templateClass;
- }
-
- public String getTemplatePath() {
- return this.templatePath;
- }
-
- public JET2Template newTemplate() {
- JET2Template template = null;
- try {
- template = (JET2Template) Class.forName(this.templateClass).newInstance();
- } catch (InstantiationException e) {
- // ignore
- } catch (IllegalAccessException e) {
- // ignore
- } catch (ClassNotFoundException e) {
- // ignore
- }
- return template;
- }
-
-
- }
-
- private Map pathToFactoryMap = null;
-
- private JET2TemplateLoader delegate = null;
-
- public TemplateLoaderClass() {
- super();
- }
-
- public JET2Template getTemplate(String templatePath) {
- if(this.pathToFactoryMap == null) {
- initPathToFactoryMap();
- }
- TemplateFactoryMethod factory = (TemplateFactoryMethod)this.pathToFactoryMap.get(templatePath);
- return factory == null ? this.delegate == null ? null : this.delegate.getTemplate(templatePath) : factory.newTemplate();
- }
-
- private void addTemplate(String templatePath, String templateClass) {
- this.pathToFactoryMap.put(templatePath,
- new TemplateFactoryMethod(templatePath, templateClass));
- }
-
- private void initPathToFactoryMap() {
- this.pathToFactoryMap = new HashMap(2);
- addTemplate("simple.v2.input.jet", "org.eclipse.jet.compiled._jet_simplev2input" ); //$NON-NLS-1$ //$NON-NLS-2$
- addTemplate("simple.v2.input2.jet", "org.eclipse.jet.compiled._jet_simplev2input2" ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void setDelegateLoader(JET2TemplateLoader loader) {
- this.delegate = loader;
- }
-
- public JET2TemplateLoader getDelegateLoader() {
- return this.delegate;
- }
-}
-
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat
deleted file mode 100644
index 23c0af8..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat
+++ /dev/null
@@ -1 +0,0 @@
-simple.v2.pat
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat2 b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat2
deleted file mode 100644
index 0ff28f8..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat2
+++ /dev/null
@@ -1 +0,0 @@
-simple.v2.pat2
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat3 b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat3
deleted file mode 100644
index 8ecde48..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat3
+++ /dev/null
@@ -1 +0,0 @@
-simple.v2.pat3
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat4 b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat4
deleted file mode 100644
index 768f2a8..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.pat4
+++ /dev/null
@@ -1 +0,0 @@
-simple.v2.pat4
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet
deleted file mode 100644
index e77b527..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-This template uses a predefined tag library:
-
-<c:get select="$useMe/@attr"/>
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.nopredefs.expected.java b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.nopredefs.expected.java
deleted file mode 100644
index 4757149..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.nopredefs.expected.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.eclipse.jet.compiled;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-
-public class _jet_simplev2usePredefTagLibs implements JET2Template {
-
- public _jet_simplev2usePredefTagLibs() {
- super();
- }
-
- private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
-
- public void generate(final JET2Context context, final JET2Writer __out) {
- JET2Writer out = __out;
- out.write("This template uses a predefined tag library:"); //$NON-NLS-1$
- out.write(NL);
- out.write(NL);
- out.write("<c:get select=\"$useMe/@attr\"/>"); //$NON-NLS-1$
- out.write(NL);
- }
-}
diff --git a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.predefs.expected.java b/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.predefs.expected.java
deleted file mode 100644
index bb5ad30..0000000
--- a/tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.predefs.expected.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.jet.compiled;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.taglib.RuntimeTagElement;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class _jet_simplev2usePredefTagLibs implements JET2Template {
- private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
-
- public _jet_simplev2usePredefTagLibs() {
- super();
- }
-
- private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private static final TagInfo _td_c_get_3_1 = new TagInfo("c:get", //$NON-NLS-1$
- 3, 1,
- new String[] {
- "select", //$NON-NLS-1$
- },
- new String[] {
- "$useMe/@attr", //$NON-NLS-1$
- } );
-
- public void generate(final JET2Context context, final JET2Writer __out) {
- JET2Writer out = __out;
- out.write("This template uses a predefined tag library:"); //$NON-NLS-1$
- out.write(NL);
- out.write(NL);
- RuntimeTagElement _jettag_c_get_3_1 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_3_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_c_get_3_1.setRuntimeParent(null);
- _jettag_c_get_3_1.setTagInfo(_td_c_get_3_1);
- _jettag_c_get_3_1.doStart(context, out);
- _jettag_c_get_3_1.doEnd();
- out.write(NL);
- }
-}
diff --git a/tests/org.eclipse.jet.tests/data/substGroup/ChildrenOnly.xml b/tests/org.eclipse.jet.tests/data/substGroup/ChildrenOnly.xml
deleted file mode 100644
index c806657..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup/ChildrenOnly.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:child name="Francis"/>
- <tns:child name="Jason"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup/MixedChildren.xml b/tests/org.eclipse.jet.tests/data/substGroup/MixedChildren.xml
deleted file mode 100644
index bd715e9..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup/MixedChildren.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:child name="James"/>
- <tns:specialChild name="Harry" specialNeed="Lots of Action"/>
- <tns:child name="Lilly"/>
- <tns:specialChild name="Dudley" specialNeed="Lots of Candy"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup/ReallySpecialChildren.xml b/tests/org.eclipse.jet.tests/data/substGroup/ReallySpecialChildren.xml
deleted file mode 100644
index f1e6f57..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup/ReallySpecialChildren.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:child name="James"/>
- <tns:specialChild name="Harry" specialNeed="Lots of Action"/>
- <tns:reallySpecialChild name="Harry" specialNeed="Lots of Action" reallySpecialNeed="And candy"/>
- <tns:child name="Lilly"/>
- <tns:specialChild name="Dudley" specialNeed="Lots of Candy"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup/SpecialChildrenOnly.xml b/tests/org.eclipse.jet.tests/data/substGroup/SpecialChildrenOnly.xml
deleted file mode 100644
index 36aa2ef..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup/SpecialChildrenOnly.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:specialChild name="Jim" specialNeed="Lots of Food"/>
- <tns:specialChild name="Bob" specialNeed="Lots of TV"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup/XMLSchemaWithGroups.xsd b/tests/org.eclipse.jet.tests/data/substGroup/XMLSchemaWithGroups.xsd
deleted file mode 100644
index edaf49d..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup/XMLSchemaWithGroups.xsd
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/XMLSchemaWithGroups" xmlns:tns="http://www.example.org/XMLSchemaWithGroups" elementFormDefault="qualified">
-
- <element name="topElement">
- <complexType>
- <sequence>
- <element ref="tns:child" maxOccurs="unbounded" minOccurs="0"></element>
- </sequence>
- </complexType>
- </element>
-
-
-
- <element name="child" type="tns:childComplexType">
- </element>
-
- <element name="specialChild" type="tns:SpecialChildComplexType" substitutionGroup="tns:child"></element>
- <complexType name="childComplexType">
- <sequence>
- <element name="hobby" maxOccurs="unbounded" minOccurs="0">
- <complexType>
- <attribute name="type" type="string" use="required"></attribute>
- </complexType>
- </element>
- </sequence>
- <attribute use="required" name="name" type="string"></attribute>
- </complexType>
-
- <complexType name="SpecialChildComplexType">
- <complexContent>
- <extension base="tns:childComplexType">
- <attribute name="specialNeed" type="string" use="required"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="reallySpecialChild" type="tns:ReallySpecialChildComplexType" substitutionGroup="tns:specialChild"></element>
- <complexType name="ReallySpecialChildComplexType">
- <complexContent>
- <extension base="tns:SpecialChildComplexType">
- <attribute name="reallySpecialNeed" type="string" use="required"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
-</schema> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/substGroup_2.4/ChildrenOnly.xml b/tests/org.eclipse.jet.tests/data/substGroup_2.4/ChildrenOnly.xml
deleted file mode 100644
index c806657..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup_2.4/ChildrenOnly.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:child name="Francis"/>
- <tns:child name="Jason"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup_2.4/MixedChildren.xml b/tests/org.eclipse.jet.tests/data/substGroup_2.4/MixedChildren.xml
deleted file mode 100644
index bd715e9..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup_2.4/MixedChildren.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:child name="James"/>
- <tns:specialChild name="Harry" specialNeed="Lots of Action"/>
- <tns:child name="Lilly"/>
- <tns:specialChild name="Dudley" specialNeed="Lots of Candy"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup_2.4/ReallySpecialChildren.xml b/tests/org.eclipse.jet.tests/data/substGroup_2.4/ReallySpecialChildren.xml
deleted file mode 100644
index f1e6f57..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup_2.4/ReallySpecialChildren.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:child name="James"/>
- <tns:specialChild name="Harry" specialNeed="Lots of Action"/>
- <tns:reallySpecialChild name="Harry" specialNeed="Lots of Action" reallySpecialNeed="And candy"/>
- <tns:child name="Lilly"/>
- <tns:specialChild name="Dudley" specialNeed="Lots of Candy"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup_2.4/SpecialChildrenOnly.xml b/tests/org.eclipse.jet.tests/data/substGroup_2.4/SpecialChildrenOnly.xml
deleted file mode 100644
index 36aa2ef..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup_2.4/SpecialChildrenOnly.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:topElement xmlns:tns="http://www.example.org/XMLSchemaWithGroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/XMLSchemaWithGroups XMLSchemaWithGroups.xsd ">
- <tns:specialChild name="Jim" specialNeed="Lots of Food"/>
- <tns:specialChild name="Bob" specialNeed="Lots of TV"/>
-</tns:topElement>
diff --git a/tests/org.eclipse.jet.tests/data/substGroup_2.4/XMLSchemaWithGroups.xsd b/tests/org.eclipse.jet.tests/data/substGroup_2.4/XMLSchemaWithGroups.xsd
deleted file mode 100644
index b0ff1a1..0000000
--- a/tests/org.eclipse.jet.tests/data/substGroup_2.4/XMLSchemaWithGroups.xsd
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/XMLSchemaWithGroups" xmlns:tns="http://www.example.org/XMLSchemaWithGroups" elementFormDefault="qualified"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- ecore:ignoreSubstitutionGroups="true">
-
- <element name="topElement">
- <complexType>
- <sequence>
- <element ref="tns:child" maxOccurs="unbounded" minOccurs="0"></element>
- </sequence>
- </complexType>
- </element>
-
-
-
- <element name="child" type="tns:childComplexType">
- </element>
-
- <element name="specialChild" type="tns:SpecialChildComplexType" substitutionGroup="tns:child"></element>
- <complexType name="childComplexType">
- <sequence>
- <element name="hobby" maxOccurs="unbounded" minOccurs="0">
- <complexType>
- <attribute name="type" type="string" use="required"></attribute>
- </complexType>
- </element>
- </sequence>
- <attribute use="required" name="name" type="string"></attribute>
- </complexType>
-
- <complexType name="SpecialChildComplexType">
- <complexContent>
- <extension base="tns:childComplexType">
- <attribute name="specialNeed" type="string" use="required"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="reallySpecialChild" type="tns:ReallySpecialChildComplexType" substitutionGroup="tns:specialChild"></element>
- <complexType name="ReallySpecialChildComplexType">
- <complexContent>
- <extension base="tns:SpecialChildComplexType">
- <attribute name="reallySpecialNeed" type="string" use="required"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
-
-</schema> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet b/tests/org.eclipse.jet.tests/data/taglibs.jet
deleted file mode 100644
index 2bc9dfc..0000000
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet
+++ /dev/null
@@ -1,10 +0,0 @@
-<%@taglib id="org.eclipse.jet.tests.TestLibrary" prefix="test" %>
-"isAllUpper", "nl", "other", "tokenize", "upper"
-
-<test:tokenize string="a,b,c,d,e,f,g" sep="," var="token">
-<test:other>some text</test:other>
-<test:isAllUpper var="token">
-</test:isAllUpper>
-<test:upper>foo</test:upper><test:nl/>
-<test:other/>
-</test:tokenize> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.astdump.expected b/tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.astdump.expected
deleted file mode 100644
index b99d6d3..0000000
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.astdump.expected
+++ /dev/null
@@ -1,41 +0,0 @@
-<directive name="taglib" line="1" col="1">
- <attribute name="id">org.eclipse.jet.tests.TestLibrary</attribute>
- <attribute name="prefix">test</attribute>
-</directive>
-<data>"isAllUpper", "nl", "other", "tokenize", "upper"
-
-</data>
-<tag name="test:tokenize" line="4" col="1">
- <attribute name="sep">,</attribute>
- <attribute name="var">token</attribute>
- <attribute name="string">a,b,c,d,e,f,g</attribute>
- <content>
- <data></data>
- <tag name="test:other" line="5" col="1">
- <content>
- <data>some text</data>
- </content>
- </tag>
- <data>
-</data>
- <tag name="test:isAllUpper" line="6" col="1">
- <attribute name="var">token</attribute>
- <content>
- <data></data>
- </content>
- </tag>
- <data></data>
- <tag name="test:upper" line="8" col="1">
- <content>
- <data>foo</data>
- </content>
- </tag>
- <tag name="test:nl" line="8" col="29">
- </tag>
- <data>
-</data>
- <tag name="test:other" line="9" col="1">
- </tag>
- <data></data>
- </content>
-</tag>
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.expected.java b/tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.expected.java
deleted file mode 100644
index 7e4b77e..0000000
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.JETASTParser.expected.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.eclipse.jet.compiled;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.taglib.RuntimeTagElement;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class X implements JET2Template {
- public static final String _jetns_test = "org.eclipse.jet.tests.TestLibrary"; //$NON-NLS-1$
-
- public X() {
- super();
- }
-
- public void generate(final JET2Context context, JET2Writer out) {
- final TagInfo _jettd_test_tokenize_4_1 = new TagInfo("test:tokenize", //$NON-NLS-1$
- 4, 1,
- new String[] {
- "sep", //$NON-NLS-1$
- "var", //$NON-NLS-1$
- "string", //$NON-NLS-1$
- },
- new String[] {
- ",", //$NON-NLS-1$
- "token", //$NON-NLS-1$
- "a,b,c,d,e,f,g", //$NON-NLS-1$
- } );
- final TagInfo _jettd_test_other_5_1 = new TagInfo("test:other", //$NON-NLS-1$
- 5, 1,
- new String[] {
- },
- new String[] {
- } );
- final TagInfo _jettd_test_isAllUpper_6_1 = new TagInfo("test:isAllUpper", //$NON-NLS-1$
- 6, 1,
- new String[] {
- "var", //$NON-NLS-1$
- },
- new String[] {
- "token", //$NON-NLS-1$
- } );
- final TagInfo _jettd_test_upper_8_1 = new TagInfo("test:upper", //$NON-NLS-1$
- 8, 1,
- new String[] {
- },
- new String[] {
- } );
- final TagInfo _jettd_test_nl_8_29 = new TagInfo("test:nl", //$NON-NLS-1$
- 8, 29,
- new String[] {
- },
- new String[] {
- } );
- final TagInfo _jettd_test_other_9_1 = new TagInfo("test:other", //$NON-NLS-1$
- 9, 1,
- new String[] {
- },
- new String[] {
- } );
- out.write( "\"isAllUpper\", \"nl\", \"other\", \"tokenize\", \"upper\"\r\n\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_tokenize_4_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "tokenize", "test:tokenize", _jettd_test_tokenize_4_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_tokenize_4_1.setRuntimeParent(null);
- _jettag_test_tokenize_4_1.setTagInfo(_jettd_test_tokenize_4_1);
- _jettag_test_tokenize_4_1.doStart(context, out);
- while (_jettag_test_tokenize_4_1.okToProcessBody()) {
- RuntimeTagElement _jettag_test_other_5_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_5_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_other_5_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_other_5_1.setTagInfo(_jettd_test_other_5_1);
- _jettag_test_other_5_1.doStart(context, out);
- while (_jettag_test_other_5_1.okToProcessBody()) {
- out.write( "some text" ); //$NON-NLS-1$
- _jettag_test_other_5_1.handleBodyContent(out);
- }
- _jettag_test_other_5_1.doEnd();
- out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_isAllUpper_6_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _jettd_test_isAllUpper_6_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_isAllUpper_6_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_isAllUpper_6_1.setTagInfo(_jettd_test_isAllUpper_6_1);
- _jettag_test_isAllUpper_6_1.doStart(context, out);
- while (_jettag_test_isAllUpper_6_1.okToProcessBody()) {
- _jettag_test_isAllUpper_6_1.handleBodyContent(out);
- }
- _jettag_test_isAllUpper_6_1.doEnd();
- RuntimeTagElement _jettag_test_upper_8_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "upper", "test:upper", _jettd_test_upper_8_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_upper_8_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_upper_8_1.setTagInfo(_jettd_test_upper_8_1);
- _jettag_test_upper_8_1.doStart(context, out);
- JET2Writer _jettag_test_upper_8_1_saved_out = out;
- while (_jettag_test_upper_8_1.okToProcessBody()) {
- out = out.newNestedContentWriter();
- out.write( "foo" ); //$NON-NLS-1$
- _jettag_test_upper_8_1.handleBodyContent(out);
- }
- out = _jettag_test_upper_8_1_saved_out;
- _jettag_test_upper_8_1.doEnd();
- RuntimeTagElement _jettag_test_nl_8_29 = context.getTagFactory().createRuntimeTag(_jetns_test, "nl", "test:nl", _jettd_test_nl_8_29); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_nl_8_29.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_nl_8_29.setTagInfo(_jettd_test_nl_8_29);
- _jettag_test_nl_8_29.doStart(context, out);
- _jettag_test_nl_8_29.doEnd();
- out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_other_9_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_9_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_other_9_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_other_9_1.setTagInfo(_jettd_test_other_9_1);
- _jettag_test_other_9_1.doStart(context, out);
- _jettag_test_other_9_1.doEnd();
- _jettag_test_tokenize_4_1.handleBodyContent(out);
- }
- _jettag_test_tokenize_4_1.doEnd();
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
deleted file mode 100644
index 459e7ce..0000000
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
+++ /dev/null
@@ -1,46 +0,0 @@
-<directive name="taglib" line="1" col="1">
- <attribute name="id">org.eclipse.jet.tests.TestLibrary</attribute>
- <attribute name="prefix">test</attribute>
-</directive>
-<data>
-"isAllUpper", "nl", "other", "tokenize", "upper"
-
-</data>
-<tag name="test:tokenize" line="4" col="1">
- <attribute name="string">a,b,c,d,e,f,g</attribute>
- <attribute name="sep">,</attribute>
- <attribute name="var">token</attribute>
- <content>
- <data>
-</data>
- <tag name="test:other" line="5" col="1">
- <content>
- <data>some text</data>
- </content>
- </tag>
- <data>
-</data>
- <tag name="test:isAllUpper" line="6" col="1">
- <attribute name="var">token</attribute>
- <content>
- <data>
-</data>
- </content>
- </tag>
- <data>
-</data>
- <tag name="test:upper" line="8" col="1">
- <content>
- <data>foo</data>
- </content>
- </tag>
- <tag name="test:nl" line="8" col="29">
- </tag>
- <data>
-</data>
- <tag name="test:other" line="9" col="1">
- </tag>
- <data>
-</data>
- </content>
-</tag>
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java b/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java
deleted file mode 100644
index 2209083..0000000
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.eclipse.jet.compiled;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.taglib.RuntimeTagElement;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class X implements JET2Template {
- public static final String _jetns_test = "org.eclipse.jet.tests.TestLibrary"; //$NON-NLS-1$
-
- public X() {
- super();
- }
-
- public void generate(final JET2Context context, JET2Writer out) {
- final TagInfo _jettd_test_tokenize_4_1 = new TagInfo("test:tokenize", //$NON-NLS-1$
- 4, 1,
- new String[] {
- "string", //$NON-NLS-1$
- "sep", //$NON-NLS-1$
- "var", //$NON-NLS-1$
- },
- new String[] {
- "a,b,c,d,e,f,g", //$NON-NLS-1$
- ",", //$NON-NLS-1$
- "token", //$NON-NLS-1$
- } );
- final TagInfo _jettd_test_other_5_1 = new TagInfo("test:other", //$NON-NLS-1$
- 5, 1,
- new String[] {
- },
- new String[] {
- } );
- final TagInfo _jettd_test_isAllUpper_6_1 = new TagInfo("test:isAllUpper", //$NON-NLS-1$
- 6, 1,
- new String[] {
- "var", //$NON-NLS-1$
- },
- new String[] {
- "token", //$NON-NLS-1$
- } );
- final TagInfo _jettd_test_upper_8_1 = new TagInfo("test:upper", //$NON-NLS-1$
- 8, 1,
- new String[] {
- },
- new String[] {
- } );
- final TagInfo _jettd_test_nl_8_29 = new TagInfo("test:nl", //$NON-NLS-1$
- 8, 29,
- new String[] {
- },
- new String[] {
- } );
- final TagInfo _jettd_test_other_9_1 = new TagInfo("test:other", //$NON-NLS-1$
- 9, 1,
- new String[] {
- },
- new String[] {
- } );
- out.write( "\"isAllUpper\", \"nl\", \"other\", \"tokenize\", \"upper\"\r\n\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_tokenize_4_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "tokenize", "test:tokenize", _jettd_test_tokenize_4_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_tokenize_4_1.setRuntimeParent(null);
- _jettag_test_tokenize_4_1.setTagInfo(_jettd_test_tokenize_4_1);
- _jettag_test_tokenize_4_1.doStart(context, out);
- while (_jettag_test_tokenize_4_1.okToProcessBody()) {
- RuntimeTagElement _jettag_test_other_5_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_5_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_other_5_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_other_5_1.setTagInfo(_jettd_test_other_5_1);
- _jettag_test_other_5_1.doStart(context, out);
- while (_jettag_test_other_5_1.okToProcessBody()) {
- out.write( "some text" ); //$NON-NLS-1$
- _jettag_test_other_5_1.handleBodyContent(out);
- }
- _jettag_test_other_5_1.doEnd();
- out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_isAllUpper_6_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _jettd_test_isAllUpper_6_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_isAllUpper_6_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_isAllUpper_6_1.setTagInfo(_jettd_test_isAllUpper_6_1);
- _jettag_test_isAllUpper_6_1.doStart(context, out);
- while (_jettag_test_isAllUpper_6_1.okToProcessBody()) {
- _jettag_test_isAllUpper_6_1.handleBodyContent(out);
- }
- _jettag_test_isAllUpper_6_1.doEnd();
- RuntimeTagElement _jettag_test_upper_8_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "upper", "test:upper", _jettd_test_upper_8_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_upper_8_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_upper_8_1.setTagInfo(_jettd_test_upper_8_1);
- _jettag_test_upper_8_1.doStart(context, out);
- JET2Writer _jettag_test_upper_8_1_saved_out = out;
- while (_jettag_test_upper_8_1.okToProcessBody()) {
- out = out.newNestedContentWriter();
- out.write( "foo" ); //$NON-NLS-1$
- _jettag_test_upper_8_1.handleBodyContent(out);
- }
- out = _jettag_test_upper_8_1_saved_out;
- _jettag_test_upper_8_1.doEnd();
- RuntimeTagElement _jettag_test_nl_8_29 = context.getTagFactory().createRuntimeTag(_jetns_test, "nl", "test:nl", _jettd_test_nl_8_29); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_nl_8_29.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_nl_8_29.setTagInfo(_jettd_test_nl_8_29);
- _jettag_test_nl_8_29.doStart(context, out);
- _jettag_test_nl_8_29.doEnd();
- out.write( "\r\n" ); //$NON-NLS-1$
- RuntimeTagElement _jettag_test_other_9_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_9_1); //$NON-NLS-1$ //$NON-NLS-2$
- _jettag_test_other_9_1.setRuntimeParent(_jettag_test_tokenize_4_1);
- _jettag_test_other_9_1.setTagInfo(_jettd_test_other_9_1);
- _jettag_test_other_9_1.doStart(context, out);
- _jettag_test_other_9_1.doEnd();
- _jettag_test_tokenize_4_1.handleBodyContent(out);
- }
- _jettag_test_tokenize_4_1.doEnd();
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/data/textTrimmingTests.jet b/tests/org.eclipse.jet.tests/data/textTrimmingTests.jet
deleted file mode 100644
index 1570482..0000000
--- a/tests/org.eclipse.jet.tests/data/textTrimmingTests.jet
+++ /dev/null
@@ -1,70 +0,0 @@
-<%@taglib id="org.eclipse.jet.controlTags" prefix="c"%>
-<%-- This template is used to verify text trimming rules. It is used by TextTrimmingTexts.java --%>
-
-<%-- text stripping around start/end tags that support stripping (e.g. c:iterate) --%>
-test 001
-<c:iterate select="foo" var="bar">
- some text with four spaces after
-</c:iterate>
-test 001
-
-<%-- text stripping around start/end tags that support stripping (e.g. c:iterate)
- with leading and trailing whitepace --%>
-test 002
- <c:iterate select="foo" var="bar">
- some text with four spaces after
- </c:iterate>
-test 002
-
-<%-- text stripping around start/end tags that support stripping (e.g. c:iterate)
- with multi-line tags --%>
-test 003
- <c:iterate
- select="foo"
- var="bar"
- >
- some text with four spaces after
- </c:iterate
- >
-test 003
-
-<%-- text stripping on directives --%>
-test 004
- <%@taglib id="org.eclipse.jet.workspaceTags" prefix="ws"%>
-test 004
-
-<%-- text stripping on scriptlet --%>
-test 005
- <%
- int x = 3;
-%>
-test 005
-
-<%-- text stripping on declarations --%>
-test 006
- <%!
- public int square(int arg) {
- return arg * arg;
- }
-%>
-test 006
-
-<%-- text stripping on empytags that supports stripping --%>
-test 007
- <c:include template="templates/foo.jet"/>
-test 007
-
-<%-- text stripping on empytags that does not support stripping --%>
-test 008
- <c:get select="templates/foo.jet"/>
-test 008
-
-<%-- text stripping on comments --%>
-test 009
- <%-- a comment --%>
-test 009
-
-<%-- text stripping an expression --%>
-test 010
- <%= x %>
-test 010
diff --git a/tests/org.eclipse.jet.tests/data/unclosedComment.jet b/tests/org.eclipse.jet.tests/data/unclosedComment.jet
deleted file mode 100644
index ba01d6f..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedComment.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
-
-<%-- String x = "Hello World!"; -%>
diff --git a/tests/org.eclipse.jet.tests/data/unclosedDeclaration.jet b/tests/org.eclipse.jet.tests/data/unclosedDeclaration.jet
deleted file mode 100644
index a12518f..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedDeclaration.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
-
-<%! public void foo() {} >
diff --git a/tests/org.eclipse.jet.tests/data/unclosedDirective.jet b/tests/org.eclipse.jet.tests/data/unclosedDirective.jet
deleted file mode 100644
index c822dec..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedDirective.jet
+++ /dev/null
@@ -1 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/unclosedExpression.jet b/tests/org.eclipse.jet.tests/data/unclosedExpression.jet
deleted file mode 100644
index b67abe9..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedExpression.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
-
-<%= "Hello World!" >
diff --git a/tests/org.eclipse.jet.tests/data/unclosedScriplet.jet b/tests/org.eclipse.jet.tests/data/unclosedScriplet.jet
deleted file mode 100644
index dd654a9..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedScriplet.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
-
-<% String x = "Hello World!"; >
diff --git a/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet b/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet
deleted file mode 100644
index 08f095f..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@taglib id="org.eclipse.jet.controlTags" prefix="test" %>
-
-</test:include
diff --git a/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet b/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
deleted file mode 100644
index 31f3ccf..0000000
--- a/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@taglib id="org.eclipse.jet.controlTags" prefix="test" %>
-
-<test:include template="foo"
diff --git a/tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet b/tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet
deleted file mode 100644
index a614208..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
-
-</test:start attr="value">
diff --git a/tests/org.eclipse.jet.tests/data/xmlStartWithoutEnd.jet b/tests/org.eclipse.jet.tests/data/xmlStartWithoutEnd.jet
deleted file mode 100644
index 54760f5..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlStartWithoutEnd.jet
+++ /dev/null
@@ -1,8 +0,0 @@
-<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
-
-<test:start attr="value">
-
-<test:start2 attr="two">
-
-</test:start>
-</test:start2> \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/README.txt b/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/README.txt
deleted file mode 100644
index bc89fcb..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This test case covers a specific defect:
-
-1) And XSD was used to define the .ecore model, but has not been used to maintain the model. The original XSD defined Human.
-2) The Human subclasses Man and Woman were directly defined in the .ecore model - they do not have Extended metadata.
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.ecore b/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.ecore
deleted file mode 100644
index 3e1a593..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.ecore
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="human"
- nsURI="http://www.example.org/human" nsPrefix="human">
- <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value=""/>
- <details key="kind" value="mixed"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="elementWildcard"/>
- <details key="name" value=":mixed"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
- eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
- transient="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="xmlns:prefix"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
- eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
- transient="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="xsi:schemaLocation"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="root" upperBound="-2" eType="#//Root"
- volatile="true" transient="true" derived="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="root"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Human">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Human"/>
- <details key="kind" value="empty"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="age" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="age"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Root">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Root"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="human" upperBound="-1"
- eType="#//Human" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="human"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Man" eSuperTypes="#//Human">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="likesCars" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Woman" eSuperTypes="#//Human">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="likesShopping" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.genmodel b/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.genmodel
deleted file mode 100644
index 8ee8d40..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.genmodel
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jet.tests/src"
- editDirectory="/org.eclipse.jet.tests.edit/src" editorDirectory="/org.eclipse.jet.tests.editor/src"
- modelPluginID="org.eclipse.jet.tests" modelName="Human" testsDirectory="/org.eclipse.jet.tests.tests/src"
- importerID="org.eclipse.xsd.ecore.importer" copyrightFields="false" language="">
- <foreignModel>../../dkb.xsd/human.xsd</foreignModel>
- <genPackages prefix="Human" basePackage="org.example" resource="XML" disposableProviderFactory="true"
- ecorePackage="human.ecore#/">
- <genClasses ecoreClass="human.ecore#//DocumentRoot">
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute human.ecore#//DocumentRoot/mixed"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference human.ecore#//DocumentRoot/xMLNSPrefixMap"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference human.ecore#//DocumentRoot/xSISchemaLocation"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference human.ecore#//DocumentRoot/root"/>
- </genClasses>
- <genClasses ecoreClass="human.ecore#//Human">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human.ecore#//Human/age"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human.ecore#//Human/name"/>
- </genClasses>
- <genClasses ecoreClass="human.ecore#//Root">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference human.ecore#//Root/human"/>
- </genClasses>
- <genClasses ecoreClass="human.ecore#//Man">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human.ecore#//Man/likesCars"/>
- </genClasses>
- <genClasses ecoreClass="human.ecore#//Woman">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human.ecore#//Woman/likesShopping"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.xsd b/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.xsd
deleted file mode 100644
index 425bcb3..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/human.xsd
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/human" xmlns:tns="http://www.example.org/human" elementFormDefault="qualified">
-
- <complexType name="Root">
- <sequence>
- <element name="human" type="tns:Human" maxOccurs="unbounded" minOccurs="0"></element>
- </sequence>
- </complexType>
-
- <complexType name="Human">
- <attribute name="name" type="string"></attribute>
- <attribute name="age" type="int"></attribute>
- </complexType>
-
- <element name="root" type="tns:Root"></element>
-</schema>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/humans.xml b/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/humans.xml
deleted file mode 100644
index 43ff947..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/no-metadata-on-subclasses/humans.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:root xmlns:tns="http://www.example.org/human" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- >
- <tns:human xsi:type="tns:Man" age="25" likesCars="true" name="John" />
- <tns:human age="32" name="Yoko" xsi:type="tns:Woman"
- likesShopping="true" />
-</tns:root>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.ecore b/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.ecore
deleted file mode 100644
index bf1144f..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.ecore
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="human2"
- nsURI="http://www.example.org/human2" nsPrefix="human2">
- <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value=""/>
- <details key="kind" value="mixed"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="elementWildcard"/>
- <details key="name" value=":mixed"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
- eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
- transient="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="xmlns:prefix"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
- eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
- transient="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="xsi:schemaLocation"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="root" upperBound="-2" eType="#//Root"
- volatile="true" transient="true" derived="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="root"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Human">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Human"/>
- <details key="kind" value="empty"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="age" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="age"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Man" eSuperTypes="#//Human">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Man"/>
- <details key="kind" value="empty"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="likesCars" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="likesCars"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Root">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Root"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="human" upperBound="-1"
- eType="#//Human" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="human"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Woman" eSuperTypes="#//Human">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Woman"/>
- <details key="kind" value="empty"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="likesShopping" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="likesShopping"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.genmodel b/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.genmodel
deleted file mode 100644
index e34124d..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.genmodel
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jet.tests/src"
- editDirectory="/org.eclipse.jet.tests.edit/src" editorDirectory="/org.eclipse.jet.tests.editor/src"
- modelPluginID="org.eclipse.jet.tests" modelName="Human2" importerID="org.eclipse.xsd.ecore.importer"
- copyrightFields="false">
- <foreignModel>../../dkb.xsd/human2.xsd</foreignModel>
- <genPackages prefix="Human2" basePackage="org.example" resource="XML" disposableProviderFactory="true"
- ecorePackage="human2.ecore#/">
- <genClasses ecoreClass="human2.ecore#//DocumentRoot">
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute human2.ecore#//DocumentRoot/mixed"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference human2.ecore#//DocumentRoot/xMLNSPrefixMap"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference human2.ecore#//DocumentRoot/xSISchemaLocation"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference human2.ecore#//DocumentRoot/root"/>
- </genClasses>
- <genClasses ecoreClass="human2.ecore#//Human">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human2.ecore#//Human/age"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human2.ecore#//Human/name"/>
- </genClasses>
- <genClasses ecoreClass="human2.ecore#//Man">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human2.ecore#//Man/likesCars"/>
- </genClasses>
- <genClasses ecoreClass="human2.ecore#//Root">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference human2.ecore#//Root/human"/>
- </genClasses>
- <genClasses ecoreClass="human2.ecore#//Woman">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute human2.ecore#//Woman/likesShopping"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.xsd b/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.xsd
deleted file mode 100644
index ca7fcf1..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/human2.xsd
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema targetNamespace="http://www.example.org/human2" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/human2">
-
- <complexType name="Root">
- <sequence>
- <element name="human" type="tns:Human" maxOccurs="unbounded" minOccurs="0"></element>
- </sequence>
- </complexType>
-
- <complexType name="Human">
- <attribute name="name" type="string"></attribute>
- <attribute name="age" type="int"></attribute>
- </complexType>
-
- <element name="root" type="tns:Root"></element>
-
- <complexType name="Man">
- <complexContent>
- <extension base="tns:Human">
- <attribute name="likesCars" type="boolean"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Woman">
- <complexContent>
- <extension base="tns:Human">
- <attribute name="likesShopping" type="boolean"></attribute>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/humans.xml b/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/humans.xml
deleted file mode 100644
index 6c82685..0000000
--- a/tests/org.eclipse.jet.tests/data/xmlSubclass/with-metadata/humans.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:root xmlns:tns="http://www.example.org/human2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- >
- <tns:human xsi:type="tns:Man" age="25" likesCars="true" name="John" />
- <tns:human age="32" name="Yoko" xsi:type="tns:Woman"
- likesShopping="true" />
-</tns:root>
diff --git a/tests/org.eclipse.jet.tests/model/dataAccess.ecore b/tests/org.eclipse.jet.tests/model/dataAccess.ecore
deleted file mode 100644
index 70725f8..0000000
--- a/tests/org.eclipse.jet.tests/model/dataAccess.ecore
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="dataAccess"
- nsURI="http:///dataAccess.ecore" nsPrefix="dataAccess">
- <eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="#//Person">
- <eStructuralFeatures xsi:type="ecore:EReference" name="orders" upperBound="-1"
- eType="#//Order" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Employee" eSuperTypes="#//Person">
- <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1"
- eType="#//Customer" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="employeeNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Order">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="orderNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="quantity" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Person">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="address" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/tests/org.eclipse.jet.tests/model/dataAccess.genmodel b/tests/org.eclipse.jet.tests/model/dataAccess.genmodel
deleted file mode 100644
index 583bb81..0000000
--- a/tests/org.eclipse.jet.tests/model/dataAccess.genmodel
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.test.jet2/src"
- modelPluginID="zzz.dataAccess" modelName="DataAccess" importerID="org.eclipse.emf.importer.ecore">
- <foreignModel>../../analysis/dataAccess.ecore</foreignModel>
- <genPackages prefix="DataAccess" disposableProviderFactory="true" ecorePackage="dataAccess.ecore#/">
- <genClasses ecoreClass="dataAccess.ecore#//Customer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference dataAccess.ecore#//Customer/orders"/>
- </genClasses>
- <genClasses ecoreClass="dataAccess.ecore#//Employee">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference dataAccess.ecore#//Employee/customers"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dataAccess.ecore#//Employee/employeeNumber"/>
- </genClasses>
- <genClasses ecoreClass="dataAccess.ecore#//Order">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dataAccess.ecore#//Order/orderNumber"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dataAccess.ecore#//Order/date"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dataAccess.ecore#//Order/quantity"/>
- </genClasses>
- <genClasses ecoreClass="dataAccess.ecore#//Person">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dataAccess.ecore#//Person/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dataAccess.ecore#//Person/address"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/tests/org.eclipse.jet.tests/plugin.properties b/tests/org.eclipse.jet.tests/plugin.properties
deleted file mode 100644
index ce9fddf..0000000
--- a/tests/org.eclipse.jet.tests/plugin.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# <copyright>
-# </copyright>
-#
-# $Id$
-
-# ====================================================================
-# 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 = JET JUnit Tests (Incubation)
-providerName = Eclipse.org
diff --git a/tests/org.eclipse.jet.tests/plugin.xml b/tests/org.eclipse.jet.tests/plugin.xml
deleted file mode 100644
index 7a12008..0000000
--- a/tests/org.eclipse.jet.tests/plugin.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.jet.tagLibraries">
- <tagLibrary
- id="TestLibrary"
- name="Test Library">
- <functionTag
- class="org.eclipse.emf.test.jet2.testTags.UpperTagElement"
- name="upper"/>
- <iteratingTag
- class="org.eclipse.emf.test.jet2.testTags.TokenizeTagElement"
- name="tokenize">
- <attribute
- name="string"
- use="required"/>
- <attribute
- name="sep"
- use="required"/>
- <attribute
- name="var"
- use="required"/>
- </iteratingTag>
- <conditionalTag
- class="org.eclipse.emf.test.jet2.testTags.IsAllUpperTagElement"
- name="isAllUpper">
- <attribute
- name="var"
- use="required"/>
- </conditionalTag>
- <emptyTag
- class="org.eclipse.emf.test.jet2.testTags.NLTagElement"
- name="nl"/>
- <otherTag
- class="org.eclipse.emf.test.jet2.testTags.OtherTagElement"
- name="other"/>
- </tagLibrary>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- uri = "http:///dataAccess.ecore"
- class = "dataAccess.DataAccessPackage"
- genModel = "model/dataAccess.genmodel" />
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/Customer.java b/tests/org.eclipse.jet.tests/src/dataAccess/Customer.java
deleted file mode 100644
index fe93ddf..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/Customer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Customer</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link dataAccess.Customer#getOrders <em>Orders</em>}</li>
- * </ul>
- * </p>
- *
- * @see dataAccess.DataAccessPackage#getCustomer()
- * @model
- * @generated
- */
-public interface Customer extends Person {
- /**
- * Returns the value of the '<em><b>Orders</b></em>' containment reference list.
- * The list contents are of type {@link dataAccess.Order}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Orders</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Orders</em>' containment reference list.
- * @see dataAccess.DataAccessPackage#getCustomer_Orders()
- * @model type="dataAccess.Order" containment="true" resolveProxies="false"
- * @generated
- */
- EList getOrders();
-
-} // Customer
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/DataAccessFactory.java b/tests/org.eclipse.jet.tests/src/dataAccess/DataAccessFactory.java
deleted file mode 100644
index 8a8059e..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/DataAccessFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see dataAccess.DataAccessPackage
- * @generated
- */
-public interface DataAccessFactory extends EFactory {
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- DataAccessFactory eINSTANCE = dataAccess.impl.DataAccessFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Customer</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Customer</em>'.
- * @generated
- */
- Customer createCustomer();
-
- /**
- * Returns a new object of class '<em>Employee</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Employee</em>'.
- * @generated
- */
- Employee createEmployee();
-
- /**
- * Returns a new object of class '<em>Order</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Order</em>'.
- * @generated
- */
- Order createOrder();
-
- /**
- * Returns a new object of class '<em>Person</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Person</em>'.
- * @generated
- */
- Person createPerson();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- DataAccessPackage getDataAccessPackage();
-
-} //DataAccessFactory
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/DataAccessPackage.java b/tests/org.eclipse.jet.tests/src/dataAccess/DataAccessPackage.java
deleted file mode 100644
index 3fbc798..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/DataAccessPackage.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see dataAccess.DataAccessFactory
- * @model kind="package"
- * @generated
- */
-public interface DataAccessPackage extends EPackage {
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "dataAccess";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http:///dataAccess.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "dataAccess";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- DataAccessPackage eINSTANCE = dataAccess.impl.DataAccessPackageImpl.init();
-
- /**
- * The meta object id for the '{@link dataAccess.impl.PersonImpl <em>Person</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.PersonImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getPerson()
- * @generated
- */
- int PERSON = 3;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PERSON__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Address</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PERSON__ADDRESS = 1;
-
- /**
- * The number of structural features of the '<em>Person</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PERSON_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link dataAccess.impl.CustomerImpl <em>Customer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.CustomerImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getCustomer()
- * @generated
- */
- int CUSTOMER = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CUSTOMER__NAME = PERSON__NAME;
-
- /**
- * The feature id for the '<em><b>Address</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CUSTOMER__ADDRESS = PERSON__ADDRESS;
-
- /**
- * The feature id for the '<em><b>Orders</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CUSTOMER__ORDERS = PERSON_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Customer</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CUSTOMER_FEATURE_COUNT = PERSON_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link dataAccess.impl.EmployeeImpl <em>Employee</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.EmployeeImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getEmployee()
- * @generated
- */
- int EMPLOYEE = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EMPLOYEE__NAME = PERSON__NAME;
-
- /**
- * The feature id for the '<em><b>Address</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EMPLOYEE__ADDRESS = PERSON__ADDRESS;
-
- /**
- * The feature id for the '<em><b>Customers</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EMPLOYEE__CUSTOMERS = PERSON_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Employee Number</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EMPLOYEE__EMPLOYEE_NUMBER = PERSON_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Employee</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EMPLOYEE_FEATURE_COUNT = PERSON_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link dataAccess.impl.OrderImpl <em>Order</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.OrderImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getOrder()
- * @generated
- */
- int ORDER = 2;
-
- /**
- * The feature id for the '<em><b>Order Number</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ORDER__ORDER_NUMBER = 0;
-
- /**
- * The feature id for the '<em><b>Date</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ORDER__DATE = 1;
-
- /**
- * The feature id for the '<em><b>Quantity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ORDER__QUANTITY = 2;
-
- /**
- * The number of structural features of the '<em>Order</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ORDER_FEATURE_COUNT = 3;
-
-
- /**
- * Returns the meta object for class '{@link dataAccess.Customer <em>Customer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Customer</em>'.
- * @see dataAccess.Customer
- * @generated
- */
- EClass getCustomer();
-
- /**
- * Returns the meta object for the containment reference list '{@link dataAccess.Customer#getOrders <em>Orders</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Orders</em>'.
- * @see dataAccess.Customer#getOrders()
- * @see #getCustomer()
- * @generated
- */
- EReference getCustomer_Orders();
-
- /**
- * Returns the meta object for class '{@link dataAccess.Employee <em>Employee</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Employee</em>'.
- * @see dataAccess.Employee
- * @generated
- */
- EClass getEmployee();
-
- /**
- * Returns the meta object for the containment reference list '{@link dataAccess.Employee#getCustomers <em>Customers</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Customers</em>'.
- * @see dataAccess.Employee#getCustomers()
- * @see #getEmployee()
- * @generated
- */
- EReference getEmployee_Customers();
-
- /**
- * Returns the meta object for the attribute '{@link dataAccess.Employee#getEmployeeNumber <em>Employee Number</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Employee Number</em>'.
- * @see dataAccess.Employee#getEmployeeNumber()
- * @see #getEmployee()
- * @generated
- */
- EAttribute getEmployee_EmployeeNumber();
-
- /**
- * Returns the meta object for class '{@link dataAccess.Order <em>Order</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Order</em>'.
- * @see dataAccess.Order
- * @generated
- */
- EClass getOrder();
-
- /**
- * Returns the meta object for the attribute '{@link dataAccess.Order#getOrderNumber <em>Order Number</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Order Number</em>'.
- * @see dataAccess.Order#getOrderNumber()
- * @see #getOrder()
- * @generated
- */
- EAttribute getOrder_OrderNumber();
-
- /**
- * Returns the meta object for the attribute '{@link dataAccess.Order#getDate <em>Date</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Date</em>'.
- * @see dataAccess.Order#getDate()
- * @see #getOrder()
- * @generated
- */
- EAttribute getOrder_Date();
-
- /**
- * Returns the meta object for the attribute '{@link dataAccess.Order#getQuantity <em>Quantity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Quantity</em>'.
- * @see dataAccess.Order#getQuantity()
- * @see #getOrder()
- * @generated
- */
- EAttribute getOrder_Quantity();
-
- /**
- * Returns the meta object for class '{@link dataAccess.Person <em>Person</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Person</em>'.
- * @see dataAccess.Person
- * @generated
- */
- EClass getPerson();
-
- /**
- * Returns the meta object for the attribute '{@link dataAccess.Person#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see dataAccess.Person#getName()
- * @see #getPerson()
- * @generated
- */
- EAttribute getPerson_Name();
-
- /**
- * Returns the meta object for the attribute '{@link dataAccess.Person#getAddress <em>Address</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Address</em>'.
- * @see dataAccess.Person#getAddress()
- * @see #getPerson()
- * @generated
- */
- EAttribute getPerson_Address();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- DataAccessFactory getDataAccessFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link dataAccess.impl.CustomerImpl <em>Customer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.CustomerImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getCustomer()
- * @generated
- */
- EClass CUSTOMER = eINSTANCE.getCustomer();
-
- /**
- * The meta object literal for the '<em><b>Orders</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference CUSTOMER__ORDERS = eINSTANCE.getCustomer_Orders();
-
- /**
- * The meta object literal for the '{@link dataAccess.impl.EmployeeImpl <em>Employee</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.EmployeeImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getEmployee()
- * @generated
- */
- EClass EMPLOYEE = eINSTANCE.getEmployee();
-
- /**
- * The meta object literal for the '<em><b>Customers</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference EMPLOYEE__CUSTOMERS = eINSTANCE.getEmployee_Customers();
-
- /**
- * The meta object literal for the '<em><b>Employee Number</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute EMPLOYEE__EMPLOYEE_NUMBER = eINSTANCE.getEmployee_EmployeeNumber();
-
- /**
- * The meta object literal for the '{@link dataAccess.impl.OrderImpl <em>Order</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.OrderImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getOrder()
- * @generated
- */
- EClass ORDER = eINSTANCE.getOrder();
-
- /**
- * The meta object literal for the '<em><b>Order Number</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ORDER__ORDER_NUMBER = eINSTANCE.getOrder_OrderNumber();
-
- /**
- * The meta object literal for the '<em><b>Date</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ORDER__DATE = eINSTANCE.getOrder_Date();
-
- /**
- * The meta object literal for the '<em><b>Quantity</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ORDER__QUANTITY = eINSTANCE.getOrder_Quantity();
-
- /**
- * The meta object literal for the '{@link dataAccess.impl.PersonImpl <em>Person</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see dataAccess.impl.PersonImpl
- * @see dataAccess.impl.DataAccessPackageImpl#getPerson()
- * @generated
- */
- EClass PERSON = eINSTANCE.getPerson();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PERSON__NAME = eINSTANCE.getPerson_Name();
-
- /**
- * The meta object literal for the '<em><b>Address</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PERSON__ADDRESS = eINSTANCE.getPerson_Address();
-
- }
-
-} //DataAccessPackage
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/Employee.java b/tests/org.eclipse.jet.tests/src/dataAccess/Employee.java
deleted file mode 100644
index fb499c5..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/Employee.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Employee</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link dataAccess.Employee#getCustomers <em>Customers</em>}</li>
- * <li>{@link dataAccess.Employee#getEmployeeNumber <em>Employee Number</em>}</li>
- * </ul>
- * </p>
- *
- * @see dataAccess.DataAccessPackage#getEmployee()
- * @model
- * @generated
- */
-public interface Employee extends Person {
- /**
- * Returns the value of the '<em><b>Customers</b></em>' containment reference list.
- * The list contents are of type {@link dataAccess.Customer}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customers</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customers</em>' containment reference list.
- * @see dataAccess.DataAccessPackage#getEmployee_Customers()
- * @model type="dataAccess.Customer" containment="true" resolveProxies="false"
- * @generated
- */
- EList getCustomers();
-
- /**
- * Returns the value of the '<em><b>Employee Number</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Employee Number</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Employee Number</em>' attribute.
- * @see #setEmployeeNumber(int)
- * @see dataAccess.DataAccessPackage#getEmployee_EmployeeNumber()
- * @model
- * @generated
- */
- int getEmployeeNumber();
-
- /**
- * Sets the value of the '{@link dataAccess.Employee#getEmployeeNumber <em>Employee Number</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Employee Number</em>' attribute.
- * @see #getEmployeeNumber()
- * @generated
- */
- void setEmployeeNumber(int value);
-
-} // Employee
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/Order.java b/tests/org.eclipse.jet.tests/src/dataAccess/Order.java
deleted file mode 100644
index f705a7d..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/Order.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess;
-
-import java.util.Date;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Order</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link dataAccess.Order#getOrderNumber <em>Order Number</em>}</li>
- * <li>{@link dataAccess.Order#getDate <em>Date</em>}</li>
- * <li>{@link dataAccess.Order#getQuantity <em>Quantity</em>}</li>
- * </ul>
- * </p>
- *
- * @see dataAccess.DataAccessPackage#getOrder()
- * @model
- * @generated
- */
-public interface Order extends EObject {
- /**
- * Returns the value of the '<em><b>Order Number</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order Number</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order Number</em>' attribute.
- * @see #setOrderNumber(int)
- * @see dataAccess.DataAccessPackage#getOrder_OrderNumber()
- * @model
- * @generated
- */
- int getOrderNumber();
-
- /**
- * Sets the value of the '{@link dataAccess.Order#getOrderNumber <em>Order Number</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order Number</em>' attribute.
- * @see #getOrderNumber()
- * @generated
- */
- void setOrderNumber(int value);
-
- /**
- * Returns the value of the '<em><b>Date</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Date</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Date</em>' attribute.
- * @see #setDate(Date)
- * @see dataAccess.DataAccessPackage#getOrder_Date()
- * @model
- * @generated
- */
- Date getDate();
-
- /**
- * Sets the value of the '{@link dataAccess.Order#getDate <em>Date</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Date</em>' attribute.
- * @see #getDate()
- * @generated
- */
- void setDate(Date value);
-
- /**
- * Returns the value of the '<em><b>Quantity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Quantity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Quantity</em>' attribute.
- * @see #setQuantity(int)
- * @see dataAccess.DataAccessPackage#getOrder_Quantity()
- * @model
- * @generated
- */
- int getQuantity();
-
- /**
- * Sets the value of the '{@link dataAccess.Order#getQuantity <em>Quantity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Quantity</em>' attribute.
- * @see #getQuantity()
- * @generated
- */
- void setQuantity(int value);
-
-} // Order
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/Person.java b/tests/org.eclipse.jet.tests/src/dataAccess/Person.java
deleted file mode 100644
index ca85dc4..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/Person.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Person</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link dataAccess.Person#getName <em>Name</em>}</li>
- * <li>{@link dataAccess.Person#getAddress <em>Address</em>}</li>
- * </ul>
- * </p>
- *
- * @see dataAccess.DataAccessPackage#getPerson()
- * @model
- * @generated
- */
-public interface Person extends EObject {
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see dataAccess.DataAccessPackage#getPerson_Name()
- * @model
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link dataAccess.Person#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Address</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Address</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Address</em>' attribute.
- * @see #setAddress(String)
- * @see dataAccess.DataAccessPackage#getPerson_Address()
- * @model
- * @generated
- */
- String getAddress();
-
- /**
- * Sets the value of the '{@link dataAccess.Person#getAddress <em>Address</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Address</em>' attribute.
- * @see #getAddress()
- * @generated
- */
- void setAddress(String value);
-
-} // Person
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/impl/CustomerImpl.java b/tests/org.eclipse.jet.tests/src/dataAccess/impl/CustomerImpl.java
deleted file mode 100644
index 39219ee..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/impl/CustomerImpl.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.impl;
-
-import dataAccess.Customer;
-import dataAccess.DataAccessPackage;
-import dataAccess.Order;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Customer</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link dataAccess.impl.CustomerImpl#getOrders <em>Orders</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class CustomerImpl extends PersonImpl implements Customer {
- /**
- * The cached value of the '{@link #getOrders() <em>Orders</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrders()
- * @generated
- * @ordered
- */
- protected EList orders = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected CustomerImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DataAccessPackage.Literals.CUSTOMER;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getOrders() {
- if (orders == null) {
- orders = new EObjectContainmentEList(Order.class, this, DataAccessPackage.CUSTOMER__ORDERS);
- }
- return orders;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DataAccessPackage.CUSTOMER__ORDERS:
- return ((InternalEList)getOrders()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DataAccessPackage.CUSTOMER__ORDERS:
- return getOrders();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DataAccessPackage.CUSTOMER__ORDERS:
- getOrders().clear();
- getOrders().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DataAccessPackage.CUSTOMER__ORDERS:
- getOrders().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DataAccessPackage.CUSTOMER__ORDERS:
- return orders != null && !orders.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //CustomerImpl
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessFactoryImpl.java b/tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessFactoryImpl.java
deleted file mode 100644
index 579e852..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessFactoryImpl.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.impl;
-
-import dataAccess.*;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class DataAccessFactoryImpl extends EFactoryImpl implements DataAccessFactory {
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DataAccessFactory init() {
- try {
- DataAccessFactory theDataAccessFactory = (DataAccessFactory)EPackage.Registry.INSTANCE.getEFactory("http:///dataAccess.ecore");
- if (theDataAccessFactory != null) {
- return theDataAccessFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new DataAccessFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DataAccessFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case DataAccessPackage.CUSTOMER: return createCustomer();
- case DataAccessPackage.EMPLOYEE: return createEmployee();
- case DataAccessPackage.ORDER: return createOrder();
- case DataAccessPackage.PERSON: return createPerson();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Customer createCustomer() {
- CustomerImpl customer = new CustomerImpl();
- return customer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Employee createEmployee() {
- EmployeeImpl employee = new EmployeeImpl();
- return employee;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Order createOrder() {
- OrderImpl order = new OrderImpl();
- return order;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Person createPerson() {
- PersonImpl person = new PersonImpl();
- return person;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DataAccessPackage getDataAccessPackage() {
- return (DataAccessPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- public static DataAccessPackage getPackage() {
- return DataAccessPackage.eINSTANCE;
- }
-
-} //DataAccessFactoryImpl
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessPackageImpl.java b/tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessPackageImpl.java
deleted file mode 100644
index 03d9bec..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/impl/DataAccessPackageImpl.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.impl;
-
-import dataAccess.Customer;
-import dataAccess.DataAccessFactory;
-import dataAccess.DataAccessPackage;
-import dataAccess.Employee;
-import dataAccess.Order;
-import dataAccess.Person;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class DataAccessPackageImpl extends EPackageImpl implements DataAccessPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass customerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass employeeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass orderEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass personEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see dataAccess.DataAccessPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private DataAccessPackageImpl() {
- super(eNS_URI, DataAccessFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static DataAccessPackage init() {
- if (isInited) return (DataAccessPackage)EPackage.Registry.INSTANCE.getEPackage(DataAccessPackage.eNS_URI);
-
- // Obtain or create and register package
- DataAccessPackageImpl theDataAccessPackage = (DataAccessPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof DataAccessPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new DataAccessPackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theDataAccessPackage.createPackageContents();
-
- // Initialize created meta-data
- theDataAccessPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theDataAccessPackage.freeze();
-
- return theDataAccessPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getCustomer() {
- return customerEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getCustomer_Orders() {
- return (EReference)customerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getEmployee() {
- return employeeEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getEmployee_Customers() {
- return (EReference)employeeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getEmployee_EmployeeNumber() {
- return (EAttribute)employeeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getOrder() {
- return orderEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOrder_OrderNumber() {
- return (EAttribute)orderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOrder_Date() {
- return (EAttribute)orderEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getOrder_Quantity() {
- return (EAttribute)orderEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getPerson() {
- return personEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPerson_Name() {
- return (EAttribute)personEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPerson_Address() {
- return (EAttribute)personEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DataAccessFactory getDataAccessFactory() {
- return (DataAccessFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- customerEClass = createEClass(CUSTOMER);
- createEReference(customerEClass, CUSTOMER__ORDERS);
-
- employeeEClass = createEClass(EMPLOYEE);
- createEReference(employeeEClass, EMPLOYEE__CUSTOMERS);
- createEAttribute(employeeEClass, EMPLOYEE__EMPLOYEE_NUMBER);
-
- orderEClass = createEClass(ORDER);
- createEAttribute(orderEClass, ORDER__ORDER_NUMBER);
- createEAttribute(orderEClass, ORDER__DATE);
- createEAttribute(orderEClass, ORDER__QUANTITY);
-
- personEClass = createEClass(PERSON);
- createEAttribute(personEClass, PERSON__NAME);
- createEAttribute(personEClass, PERSON__ADDRESS);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Add supertypes to classes
- customerEClass.getESuperTypes().add(this.getPerson());
- employeeEClass.getESuperTypes().add(this.getPerson());
-
- // Initialize classes and features; add operations and parameters
- initEClass(customerEClass, Customer.class, "Customer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getCustomer_Orders(), this.getOrder(), null, "orders", null, 0, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(employeeEClass, Employee.class, "Employee", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getEmployee_Customers(), this.getCustomer(), null, "customers", null, 0, -1, Employee.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getEmployee_EmployeeNumber(), ecorePackage.getEInt(), "employeeNumber", null, 0, 1, Employee.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(orderEClass, Order.class, "Order", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getOrder_OrderNumber(), ecorePackage.getEInt(), "orderNumber", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getOrder_Date(), ecorePackage.getEDate(), "date", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getOrder_Quantity(), ecorePackage.getEInt(), "quantity", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPerson_Address(), ecorePackage.getEString(), "address", null, 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-} //DataAccessPackageImpl
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/impl/EmployeeImpl.java b/tests/org.eclipse.jet.tests/src/dataAccess/impl/EmployeeImpl.java
deleted file mode 100644
index bcedc36..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/impl/EmployeeImpl.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.impl;
-
-import dataAccess.Customer;
-import dataAccess.DataAccessPackage;
-import dataAccess.Employee;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Employee</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link dataAccess.impl.EmployeeImpl#getCustomers <em>Customers</em>}</li>
- * <li>{@link dataAccess.impl.EmployeeImpl#getEmployeeNumber <em>Employee Number</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class EmployeeImpl extends PersonImpl implements Employee {
- /**
- * The cached value of the '{@link #getCustomers() <em>Customers</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomers()
- * @generated
- * @ordered
- */
- protected EList customers = null;
-
- /**
- * The default value of the '{@link #getEmployeeNumber() <em>Employee Number</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmployeeNumber()
- * @generated
- * @ordered
- */
- protected static final int EMPLOYEE_NUMBER_EDEFAULT = 0;
-
- /**
- * The cached value of the '{@link #getEmployeeNumber() <em>Employee Number</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmployeeNumber()
- * @generated
- * @ordered
- */
- protected int employeeNumber = EMPLOYEE_NUMBER_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EmployeeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DataAccessPackage.Literals.EMPLOYEE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getCustomers() {
- if (customers == null) {
- customers = new EObjectContainmentEList(Customer.class, this, DataAccessPackage.EMPLOYEE__CUSTOMERS);
- }
- return customers;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getEmployeeNumber() {
- return employeeNumber;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setEmployeeNumber(int newEmployeeNumber) {
- int oldEmployeeNumber = employeeNumber;
- employeeNumber = newEmployeeNumber;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DataAccessPackage.EMPLOYEE__EMPLOYEE_NUMBER, oldEmployeeNumber, employeeNumber));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DataAccessPackage.EMPLOYEE__CUSTOMERS:
- return ((InternalEList)getCustomers()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DataAccessPackage.EMPLOYEE__CUSTOMERS:
- return getCustomers();
- case DataAccessPackage.EMPLOYEE__EMPLOYEE_NUMBER:
- return new Integer(getEmployeeNumber());
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DataAccessPackage.EMPLOYEE__CUSTOMERS:
- getCustomers().clear();
- getCustomers().addAll((Collection)newValue);
- return;
- case DataAccessPackage.EMPLOYEE__EMPLOYEE_NUMBER:
- setEmployeeNumber(((Integer)newValue).intValue());
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DataAccessPackage.EMPLOYEE__CUSTOMERS:
- getCustomers().clear();
- return;
- case DataAccessPackage.EMPLOYEE__EMPLOYEE_NUMBER:
- setEmployeeNumber(EMPLOYEE_NUMBER_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DataAccessPackage.EMPLOYEE__CUSTOMERS:
- return customers != null && !customers.isEmpty();
- case DataAccessPackage.EMPLOYEE__EMPLOYEE_NUMBER:
- return employeeNumber != EMPLOYEE_NUMBER_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (employeeNumber: ");
- result.append(employeeNumber);
- result.append(')');
- return result.toString();
- }
-
-} //EmployeeImpl
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/impl/OrderImpl.java b/tests/org.eclipse.jet.tests/src/dataAccess/impl/OrderImpl.java
deleted file mode 100644
index 95c473f..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/impl/OrderImpl.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.impl;
-
-import dataAccess.DataAccessPackage;
-import dataAccess.Order;
-
-import java.util.Date;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Order</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link dataAccess.impl.OrderImpl#getOrderNumber <em>Order Number</em>}</li>
- * <li>{@link dataAccess.impl.OrderImpl#getDate <em>Date</em>}</li>
- * <li>{@link dataAccess.impl.OrderImpl#getQuantity <em>Quantity</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class OrderImpl extends EObjectImpl implements Order {
- /**
- * The default value of the '{@link #getOrderNumber() <em>Order Number</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderNumber()
- * @generated
- * @ordered
- */
- protected static final int ORDER_NUMBER_EDEFAULT = 0;
-
- /**
- * The cached value of the '{@link #getOrderNumber() <em>Order Number</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderNumber()
- * @generated
- * @ordered
- */
- protected int orderNumber = ORDER_NUMBER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDate() <em>Date</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDate()
- * @generated
- * @ordered
- */
- protected static final Date DATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDate() <em>Date</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDate()
- * @generated
- * @ordered
- */
- protected Date date = DATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getQuantity() <em>Quantity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuantity()
- * @generated
- * @ordered
- */
- protected static final int QUANTITY_EDEFAULT = 0;
-
- /**
- * The cached value of the '{@link #getQuantity() <em>Quantity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuantity()
- * @generated
- * @ordered
- */
- protected int quantity = QUANTITY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected OrderImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DataAccessPackage.Literals.ORDER;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getOrderNumber() {
- return orderNumber;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setOrderNumber(int newOrderNumber) {
- int oldOrderNumber = orderNumber;
- orderNumber = newOrderNumber;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DataAccessPackage.ORDER__ORDER_NUMBER, oldOrderNumber, orderNumber));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Date getDate() {
- return date;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setDate(Date newDate) {
- Date oldDate = date;
- date = newDate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DataAccessPackage.ORDER__DATE, oldDate, date));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getQuantity() {
- return quantity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setQuantity(int newQuantity) {
- int oldQuantity = quantity;
- quantity = newQuantity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DataAccessPackage.ORDER__QUANTITY, oldQuantity, quantity));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DataAccessPackage.ORDER__ORDER_NUMBER:
- return new Integer(getOrderNumber());
- case DataAccessPackage.ORDER__DATE:
- return getDate();
- case DataAccessPackage.ORDER__QUANTITY:
- return new Integer(getQuantity());
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DataAccessPackage.ORDER__ORDER_NUMBER:
- setOrderNumber(((Integer)newValue).intValue());
- return;
- case DataAccessPackage.ORDER__DATE:
- setDate((Date)newValue);
- return;
- case DataAccessPackage.ORDER__QUANTITY:
- setQuantity(((Integer)newValue).intValue());
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DataAccessPackage.ORDER__ORDER_NUMBER:
- setOrderNumber(ORDER_NUMBER_EDEFAULT);
- return;
- case DataAccessPackage.ORDER__DATE:
- setDate(DATE_EDEFAULT);
- return;
- case DataAccessPackage.ORDER__QUANTITY:
- setQuantity(QUANTITY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DataAccessPackage.ORDER__ORDER_NUMBER:
- return orderNumber != ORDER_NUMBER_EDEFAULT;
- case DataAccessPackage.ORDER__DATE:
- return DATE_EDEFAULT == null ? date != null : !DATE_EDEFAULT.equals(date);
- case DataAccessPackage.ORDER__QUANTITY:
- return quantity != QUANTITY_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (orderNumber: ");
- result.append(orderNumber);
- result.append(", date: ");
- result.append(date);
- result.append(", quantity: ");
- result.append(quantity);
- result.append(')');
- return result.toString();
- }
-
-} //OrderImpl
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/impl/PersonImpl.java b/tests/org.eclipse.jet.tests/src/dataAccess/impl/PersonImpl.java
deleted file mode 100644
index 9bb175b..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/impl/PersonImpl.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.impl;
-
-import dataAccess.DataAccessPackage;
-import dataAccess.Person;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Person</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link dataAccess.impl.PersonImpl#getName <em>Name</em>}</li>
- * <li>{@link dataAccess.impl.PersonImpl#getAddress <em>Address</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class PersonImpl extends EObjectImpl implements Person {
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAddress() <em>Address</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAddress()
- * @generated
- * @ordered
- */
- protected static final String ADDRESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAddress() <em>Address</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAddress()
- * @generated
- * @ordered
- */
- protected String address = ADDRESS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PersonImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return DataAccessPackage.Literals.PERSON;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DataAccessPackage.PERSON__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getAddress() {
- return address;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setAddress(String newAddress) {
- String oldAddress = address;
- address = newAddress;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DataAccessPackage.PERSON__ADDRESS, oldAddress, address));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DataAccessPackage.PERSON__NAME:
- return getName();
- case DataAccessPackage.PERSON__ADDRESS:
- return getAddress();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DataAccessPackage.PERSON__NAME:
- setName((String)newValue);
- return;
- case DataAccessPackage.PERSON__ADDRESS:
- setAddress((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case DataAccessPackage.PERSON__NAME:
- setName(NAME_EDEFAULT);
- return;
- case DataAccessPackage.PERSON__ADDRESS:
- setAddress(ADDRESS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DataAccessPackage.PERSON__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DataAccessPackage.PERSON__ADDRESS:
- return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", address: ");
- result.append(address);
- result.append(')');
- return result.toString();
- }
-
-} //PersonImpl
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessAdapterFactory.java b/tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessAdapterFactory.java
deleted file mode 100644
index 4ebb4e4..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessAdapterFactory.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.util;
-
-import dataAccess.*;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see dataAccess.DataAccessPackage
- * @generated
- */
-public class DataAccessAdapterFactory extends AdapterFactoryImpl {
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static DataAccessPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DataAccessAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = DataAccessPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected DataAccessSwitch modelSwitch =
- new DataAccessSwitch() {
- public Object caseCustomer(Customer object) {
- return createCustomerAdapter();
- }
- public Object caseEmployee(Employee object) {
- return createEmployeeAdapter();
- }
- public Object caseOrder(Order object) {
- return createOrderAdapter();
- }
- public Object casePerson(Person object) {
- return createPersonAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link dataAccess.Customer <em>Customer</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see dataAccess.Customer
- * @generated
- */
- public Adapter createCustomerAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link dataAccess.Employee <em>Employee</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see dataAccess.Employee
- * @generated
- */
- public Adapter createEmployeeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link dataAccess.Order <em>Order</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see dataAccess.Order
- * @generated
- */
- public Adapter createOrderAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link dataAccess.Person <em>Person</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see dataAccess.Person
- * @generated
- */
- public Adapter createPersonAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //DataAccessAdapterFactory
diff --git a/tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessSwitch.java b/tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessSwitch.java
deleted file mode 100644
index 95a0779..0000000
--- a/tests/org.eclipse.jet.tests/src/dataAccess/util/DataAccessSwitch.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package dataAccess.util;
-
-import dataAccess.*;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see dataAccess.DataAccessPackage
- * @generated
- */
-public class DataAccessSwitch {
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static DataAccessPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DataAccessSwitch() {
- if (modelPackage == null) {
- modelPackage = DataAccessPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- else {
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case DataAccessPackage.CUSTOMER: {
- Customer customer = (Customer)theEObject;
- Object result = caseCustomer(customer);
- if (result == null) result = casePerson(customer);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DataAccessPackage.EMPLOYEE: {
- Employee employee = (Employee)theEObject;
- Object result = caseEmployee(employee);
- if (result == null) result = casePerson(employee);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DataAccessPackage.ORDER: {
- Order order = (Order)theEObject;
- Object result = caseOrder(order);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DataAccessPackage.PERSON: {
- Person person = (Person)theEObject;
- Object result = casePerson(person);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Customer</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Customer</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseCustomer(Customer object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Employee</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Employee</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseEmployee(Employee object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Order</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Order</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseOrder(Order object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Person</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Person</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object casePerson(Person object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //DataAccessSwitch
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllSuites.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllSuites.java
deleted file mode 100644
index 75ae7b0..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllSuites.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests;
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllSuites extends TestSuite
-{
- private static Test[] suites = new Test []{
- org.eclipse.jet.tests.AllTests.suite(),
- };
-
- public static Test suite()
- {
- return new AllSuites("JET Build JUnit Test Suite");
- }
-
- public AllSuites()
- {
- super();
- populateSuite();
- }
-
- public AllSuites(Class theClass)
- {
- super(theClass);
- populateSuite();
- }
-
- public AllSuites(String name)
- {
- super(name);
- populateSuite();
- }
-
- protected void populateSuite()
- {
- for (int i = 0; i < suites.length; i++)
- {
- addTest(suites[i]);
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java
deleted file mode 100644
index c1fd966..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/AllTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.jet.tests;
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.jet.tests");
- suite.addTest(org.eclipse.jet.tests.compiler.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.xpath.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.xpath.inspectors.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.xpath.functions.extras.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.model.load.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.taglib.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.taglib.control.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.taglib.workspace.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.taglib.java.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.taglib.format.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.runtime.AllTests.suite());
- suite.addTest(org.eclipse.jet.tests.parser.resources.AllTests.suite());
- //$JUnit-BEGIN$
-
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/FileUtils.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/FileUtils.java
deleted file mode 100644
index 69af4fb..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/FileUtils.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.manipulation.ConvertLineDelimitersOperation;
-import org.eclipse.core.filebuffers.manipulation.FileBufferOperationRunner;
-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.core.runtime.Platform;
-
-/**
- * File utilities for Unit tests getting expected results from the JUnit project.
- *
- */
-public class FileUtils {
-
- /**
- *
- *
- */
- private FileUtils() {
- // prevent instantiation.
- }
-
- /**
- * Resolve a URL to a location string (file system absolute path).
- * @param urlString a URL string, possibly using the platform:/ format.
- * @return an absolute file system path corresponding to <code>urlString</code>
- * @throws IOException if an IO error occurs
- * @throws MalformedURLException if urlString is an invalid URL
- */
- public static String resolveURLToLocationString(String urlString) throws IOException, MalformedURLException {
- String fileName = Platform.resolve(new URL(urlString)).getFile();
- return fileName;
- }
-
- /**
- * Return the file contents as a string. This method also converts the file's line
- * separator to the current system's line separator if <code>convertNewLines</code> is <code>true</code>.
- * @param urlString a URL string, possibly using the platform:/ format.
- * @param convertNewLines Convert the file line separators to the system line separator.
- * @return the file contents
- * @throws IOException if an IO error occurs
- * @throws MalformedURLException if urlString is an invalid URL
- * @throws CoreException if an error occurs reading the file.
- */
- public static String getFileContents(String urlString, boolean convertNewLines) throws MalformedURLException, IOException, CoreException {
-
- final ITextFileBufferManager textBufferMgr = FileBuffers.getTextFileBufferManager();
- String fileName = resolveURLToLocationString(urlString);
-
- final IPath path = new Path(fileName);
- textBufferMgr.connect(path, new NullProgressMonitor());
- final ITextFileBuffer textFileBuffer = textBufferMgr.getTextFileBuffer(path);
-
- if(convertNewLines) {
- new FileBufferOperationRunner(textBufferMgr, null)
- .execute(
- new IPath[] { path },
- new ConvertLineDelimitersOperation(System.getProperty("line.separator")),
- new NullProgressMonitor());
- }
-
- final String result = textFileBuffer.getDocument().get();
- textBufferMgr.disconnect(path, new NullProgressMonitor());
- return result;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java
deleted file mode 100644
index 631c78c..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/AllTests.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.jet.tests.compiler;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.compiler");
- //$JUnit-BEGIN$
- suite.addTestSuite(TestJETParser.class);
- suite.addTestSuite(TestSimplifiedCompiler.class);
- suite.addTestSuite(TestJET2Parser.class);
- suite.addTest(TextTrimmingTests.suite());
- suite.addTest(TestCompilationHelper.suite());
- suite.addTestSuite(LineInfoTests.class);
-//$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/LineInfoTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/LineInfoTests.java
deleted file mode 100644
index 8e3885c..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/LineInfoTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.jet.tests.compiler;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.internal.parser.LineInfo;
-import org.eclipse.jet.tests.FileUtils;
-
-public class LineInfoTests extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jet.internal.parser.LineInfo.calculateLines(char[])'
- */
- public void testCalculateLines() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/lineinfo.jet";
- final String fileContents = FileUtils.getFileContents(urlString, false);
-
- final LineInfo[] lineInfo = LineInfo.calculateLines(fileContents.toCharArray());
- final String NL = System.getProperty("line.separator");
-
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < lineInfo.length; i++) {
- result.append(i + 1).append(":").append(lineInfo[i].getEnd() - lineInfo[i].getStart()).append(':')
- .append(fileContents.substring(lineInfo[i].getStart(), lineInfo[i].getEnd())).append(NL);
- }
-
- final String expectedContents = FileUtils.getFileContents(urlString + ".expected.txt", true);
- assertEquals(expectedContents, result.toString());
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.parser.LineInfo.getLineInfo(LineInfo[], int)'
- */
- public void testGetLineInfo() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/lineinfo.jet";
- final String fileContents = FileUtils.getFileContents(urlString, false);
-
- final LineInfo[] lineInfo = LineInfo.calculateLines(fileContents.toCharArray());
-
- try {
- LineInfo.getLineInfo(lineInfo, -1);
- fail();
- } catch(IllegalArgumentException e) {
- // success
- }
-
-
- final LineInfo startInfo = LineInfo.getLineInfo(lineInfo, 0);
- assertEquals(lineInfo[0], startInfo);
- assertEquals(0, startInfo.getStart());
-
- final LineInfo liInNL = LineInfo.getLineInfo(lineInfo, lineInfo[0].getEnd());
- assertEquals(lineInfo[0], liInNL);
-
- final int lastcharOffset = lineInfo[lineInfo.length - 1].getEnd() - 1;
- final LineInfo endInfo = LineInfo.getLineInfo(lineInfo, lastcharOffset);
- assertEquals(lineInfo[lineInfo.length - 1], endInfo);
-
- final int strOffset = fileContents.indexOf("a,b,c,d,e,f,g"); // this is on line 4, col 24
- final LineInfo strLineInfo = LineInfo.getLineInfo(lineInfo, strOffset);
- assertEquals(lineInfo[3], strLineInfo);
- assertTrue("in [start, end)", strLineInfo.getStart() <= strOffset && strOffset < strLineInfo.getEnd());
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestCompilationHelper.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestCompilationHelper.java
deleted file mode 100644
index 963a59b..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestCompilationHelper.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.compiler;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.core.parser.ast.JETASTVisitor;
-import org.eclipse.jet.core.parser.ast.JETCompilationUnit;
-import org.eclipse.jet.core.parser.ast.JavaDeclaration;
-import org.eclipse.jet.core.parser.ast.JavaElement;
-import org.eclipse.jet.core.parser.ast.JavaExpression;
-import org.eclipse.jet.core.parser.ast.JavaScriptlet;
-import org.eclipse.jet.internal.compiler.CompilationHelper;
-import org.eclipse.jet.tests.FileUtils;
-import org.eclipse.jface.text.Position;
-
-/**
- * @author pelder
- *
- */
-public class TestCompilationHelper extends TestCase {
-
- private static final String TEST_PLUGIN_BASE_URL = "platform:/plugin/org.eclipse.jet.tests/data/";
- private static final String TEST_PROJECT_NAME = TestCompilationHelper.class.getName() + " Tests";
- protected static IProject project;
- private CompilationHelper helper;
-
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(TestCompilationHelper.class)) {
- protected void setUp() throws Exception {
- setUpAllTests();
- }
-
- protected void tearDown() throws Exception {
- tearDownAllTests();
- }
- };
-
- return setup;
- }
-
- protected static void tearDownAllTests() {
- // TODO Auto-generated method stub
-
- }
-
- protected static void setUpAllTests() {
- String newProjectModel = "<newProjectModel>" +
- "<project" +
- " name=\"" + TEST_PROJECT_NAME + "\"" +
- "/>" +
- "</newProjectModel>";
-
- IStatus status = JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject", newProjectModel, new NullProgressMonitor());
- assertTrue("setUpAllTests", status.isOK());
- try {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
- }}, new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
-
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(TEST_PROJECT_NAME);
- assertTrue("Test project exists", project.exists());
-
- }
-
- protected void setUp() throws Exception {
- helper = new CompilationHelper(project);
- }
-
- public void testGetAST() {
- JETCompilationUnit ast = helper.getAST("templates/main.jet");
-
- assertNotNull(ast);
- assertFalse(ast.hasErrors() && ast.hasWarnings());
- }
-
- public void testGetASTFromSource() throws MalformedURLException, IOException, CoreException {
- String source = FileUtils.getFileContents(TEST_PLUGIN_BASE_URL + "simplifiedCompiler/templates/simple.v2.input.jet", true);
- JETCompilationUnit ast = helper.getASTFromSource(source);
-
- assertNotNull(ast);
- assertFalse(ast.hasErrors() && ast.hasWarnings());
- }
-
- public void testJavaCode() throws MalformedURLException, IOException, CoreException {
- String source = FileUtils.getFileContents(TEST_PLUGIN_BASE_URL + "simplifiedCompiler/templates/simple.v2.input.jet", true);
- JETCompilationUnit ast = helper.getASTFromSource(source);
-
- assertNotNull(ast);
- ast.setOutputJavaClassName("_jet_simplev2input");
- assertFalse(ast.hasErrors() && ast.hasWarnings());
-
- String code = helper.getJavaCode(ast);
- String expectedCode = FileUtils.getFileContents(TEST_PLUGIN_BASE_URL + "simplifiedCompiler/templates/simple.v2.input.jet.expected.java", true);
- assertEquals(expectedCode, code);
- }
-
- public void testJavaCode_ast_map() throws MalformedURLException, IOException, CoreException {
- String source = FileUtils.getFileContents(TEST_PLUGIN_BASE_URL + "alljet2.jet", true);
- JETCompilationUnit ast = helper.getASTFromSource(source);
-
- assertNotNull(ast);
- assertFalse(ast.hasErrors() && ast.hasWarnings());
-
- final Map elementPositions = new HashMap();
- final String code = helper.getJavaCode(ast, elementPositions);
- String expectedCode = FileUtils.getFileContents(TEST_PLUGIN_BASE_URL + "alljet2.jet.expected.java", true);
- assertEquals(expectedCode, code);
-
- ast.accept(new JETASTVisitor() {
- public boolean visit(JavaDeclaration declaration) {
- checkJavaElement(declaration);
-
- return true;
- }
-
- public boolean visit(JavaExpression expression) {
- checkJavaElement(expression);
-
- return true;
- }
-
- public boolean visit(JavaScriptlet scriptlet) {
- checkJavaElement(scriptlet);
-
- return true;
- }
-
- /**
- * @param element
- */
- private void checkJavaElement(JavaElement element) {
- Position position = (Position) elementPositions.get(element);
-
- assertEquals(element.getJavaContent(), code.substring(position.offset, position.offset + position.length));
- }
- });
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java
deleted file mode 100644
index f239946..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJET2Parser.java
+++ /dev/null
@@ -1,478 +0,0 @@
-package org.eclipse.jet.tests.compiler;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.compiler.Comment;
-import org.eclipse.jet.compiler.JET2ASTVisitor;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.JET2Declaration;
-import org.eclipse.jet.compiler.JET2Directive;
-import org.eclipse.jet.compiler.JET2Expression;
-import org.eclipse.jet.compiler.JET2Scriptlet;
-import org.eclipse.jet.compiler.Problem;
-import org.eclipse.jet.compiler.TextElement;
-import org.eclipse.jet.compiler.XMLBodyElement;
-import org.eclipse.jet.compiler.XMLBodyElementEnd;
-import org.eclipse.jet.compiler.XMLEmptyElement;
-import org.eclipse.jet.core.compiler.JETCompilerOptions;
-import org.eclipse.jet.core.parser.IProblem;
-import org.eclipse.jet.core.parser.ProblemSeverity;
-import org.eclipse.jet.internal.compiler.TemplateRunner;
-import org.eclipse.jet.internal.core.NewLineUtil;
-import org.eclipse.jet.taglib.TagLibraryReference;
-import org.eclipse.jet.tests.FileUtils;
-
-public class TestJET2Parser extends TestCase {
-
- /**
- * @author pelder
- *
- */
- public static class DumpAST implements JET2ASTVisitor {
-
- private final StringBuffer buffer = new StringBuffer();
- private int indent = 0;
- private final String NL = System.getProperty("line.separator");
-
- private void doIndent() {
- for(int i = 0; i < indent; i++) {
- buffer.append(" ");
- }
- }
-
- public String getLog() {
- return NewLineUtil.setLineTerminator(buffer, NL);
- }
-
-
- /**
- *
- */
- public DumpAST() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2CompilationUnit)
- */
- public void visit(JET2CompilationUnit compilationUnit) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#endVisit(org.eclipse.jet.compiler.JET2CompilationUnit)
- */
- public void endVisit(JET2CompilationUnit compilationUnit) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Declaration)
- */
- public void visit(JET2Declaration declaration) {
- doIndent();
- buffer.append("<declaration line=\"" + declaration.getLine() + "\" col=\"" + declaration.getColumn() + "\">");
- buffer.append(declaration.getJavaContent());
- buffer.append("</declaration>").append(NL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Directive)
- */
- public void visit(JET2Directive directive) {
- doIndent();
- buffer.append("<directive name=\"" + directive.getName() + "\" line=\"" + directive.getLine() + "\" col=\"" + directive.getColumn() + "\">").append(NL);
- indent++;
- for (Iterator i = directive.getAttributes().entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- doIndent();
- buffer.append("<attribute name=\"" + entry.getKey() + "\">");
- buffer.append(entry.getValue()).append("</attribute>").append(NL);
-
- }
- indent--;
- doIndent();
- buffer.append("</directive>").append(NL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Expression)
- */
- public void visit(JET2Expression expression) {
- doIndent();
- buffer.append("<expression line=\"" + expression.getLine() + "\" col=\"" + expression.getColumn() + "\">");
- buffer.append(expression.getJavaContent());
- buffer.append("</expression>").append(NL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Scriptlet)
- */
- public void visit(JET2Scriptlet scriptlet) {
- doIndent();
- buffer.append("<scriptlet line=\"" + scriptlet.getLine() + "\" col=\"" + scriptlet.getColumn() + "\">");
- buffer.append(scriptlet.getJavaContent());
- buffer.append("</scriptlet>").append(NL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.TextElement)
- */
- public void visit(TextElement text) {
- doIndent();
- buffer.append("<data>").append(text.getRawText()).append("</data>").append(NL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLEmptyElement)
- */
- public void visit(XMLEmptyElement xmlEmptyElement) {
- doIndent();
- buffer.append("<tag name=\"" + xmlEmptyElement.getName() + "\" line=\"" + xmlEmptyElement.getLine() + "\" col=\"" + xmlEmptyElement.getColumn() + "\">").append(NL);
- indent++;
- for (Iterator i = xmlEmptyElement.getAttributes().entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- doIndent();
- buffer.append("<attribute name=\"" + entry.getKey() + "\">" + entry.getValue() + "</attribute>").append(NL);
- }
- indent--;
- doIndent();
- buffer.append("</tag>").append(NL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLBodyElement)
- */
- public void visit(XMLBodyElement xmlBodyElement) {
- doIndent();
- buffer.append("<tag name=\"" + xmlBodyElement.getName() + "\" line=\"" + xmlBodyElement.getLine() + "\" col=\"" + xmlBodyElement.getColumn() + "\">").append(NL);
- indent++;
- for (Iterator i = xmlBodyElement.getAttributes().entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- doIndent();
- buffer.append("<attribute name=\"" + entry.getKey() + "\">" + entry.getValue() + "</attribute>").append(NL);
- }
- doIndent();
- buffer.append("<content>").append(NL);
- indent++;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jet.compiler.JET2ASTVisitor#endVisit(org.eclipse.jet.compiler.XMLBodyElement)
- */
- public void endVisit(XMLBodyElement xmlBodyElement) {
- indent--;
- doIndent();
- buffer.append("</content>").append(NL);
- indent--;
- doIndent();
- buffer.append("</tag>").append(NL);
- }
-
- public void visit(Comment comment) {
- doIndent();
- buffer.append("<comment line=\"" + comment.getLine() + "\" col=\"" + comment.getColumn() + "\">");
- buffer.append(comment.getCommentText());
- buffer.append("</comment>").append(NL);
- }
-
- public void visit(XMLBodyElementEnd xmlBodyElementEnd) {
- // do nothing
-
- }
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- }
- private FileInputStream getFileContentsAsStream(String urlString) throws IOException, MalformedURLException, FileNotFoundException {
- String fileName = FileUtils.resolveURLToLocationString(urlString);
- FileInputStream inputStream = new FileInputStream(new File(fileName));
- return inputStream;
- }
-
- /*
- * Test method for 'org.eclipse.jet.compiler.JET2Parser.compile(String, InputStream, String)'
- */
- public void testCompile() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/taglibs.jet";
-
- InputStream is = getFileContentsAsStream(urlString);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- DumpAST astDumper = new DumpAST();
- cu.accept(astDumper);
-
- assertEquals(FileUtils.getFileContents(urlString + ".astdump.expected", true), astDumper.getLog());
-
- }
-
- public void testCompilationUnit_getTagLibraryReferences() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/taglibs.jet";
-
- InputStream is = getFileContentsAsStream(urlString);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- final TagLibraryReference[] tlRefs = cu.getTagLibraryReferences();
- assertNotNull(tlRefs);
- assertEquals(1, tlRefs.length);
- assertEquals("test", tlRefs[0].getPrefix());
- assertEquals("org.eclipse.jet.tests.TestLibrary", tlRefs[0].getTagLibraryId());
- }
-
- public void testCodeGen() throws Exception {
- // HACK: Disabling this test on Unix/Linux/Mac until uniform treatment of
- // line separators in generated code is handled.
- if(System.getProperty("line.separator").length() != 2) {
- return;
- }
-
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/taglibs.jet";
-
- InputStream is = getFileContentsAsStream(urlString);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- cu.setOutputJavaPackage(JETCompilerOptions.DEFAULT_COMPILED_TEMPLATE_PACKAGE);
- cu.setOutputJavaClassName("X");
-
- String result = new TemplateRunner().generate("templates/jet2java.jet", Collections.singletonMap("cu", cu));
-
- assertEquals(FileUtils.getFileContents(urlString + ".expected.java", true), result);
-
- }
-
- public void testXMLStartAsEmpty_bug147714() throws MalformedURLException, FileNotFoundException, IOException {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/bug147714.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 3, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 8, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.MissingXmlEndTag, problems[0].getId());
-
- assertEquals("Problem 2 line number", 8, problems[1].getLineNumber());
- assertEquals("Problem 2 severity", ProblemSeverity.ERROR, problems[1].getProblemSeverity());
- assertEquals("Problem 2 id", IProblem.TagCannotHaveContent, problems[1].getId());
-
- assertEquals("Problem 2 line number", 10, problems[2].getLineNumber());
- assertEquals("Problem 2 severity", ProblemSeverity.WARNING, problems[2].getProblemSeverity());
- assertEquals("Problem 2 id", IProblem.TagInterpretedAsEmptyTag, problems[2].getId());
-
-
- }
-
- public void testUnclosedCommnetErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedComment.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.UnterminatedXMLTag, problems[0].getId());
-
- }
-
- public void testUnclosedDeclarationErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDeclaration.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.UnterminatedXMLTag, problems[0].getId());
-
- }
-
- public void testUnclosedDirectiveErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDirective.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 1, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.JETException, problems[0].getId());
-
- }
-
- public void testUnclosedExpressionErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedExpression.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.JETException, problems[0].getId());
-
- }
-
- public void testUnclosedScriptletErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedScriplet.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.JETException, problems[0].getId());
-
- }
-
- public void testUnclosedXMLEndErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedXMLEnd.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.UnterminatedXMLTag, problems[0].getId());
-
- }
-
- public void testUnclosedXMLStartErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/unclosedXMLStart.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertEquals("Number of problems", 1, problems.length);
-
-
- // This assertions correspond to comments in bug147714.jet
- assertEquals("Problem 1 line number", 3, problems[0].getLineNumber());
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.UnterminatedXMLTag, problems[0].getId());
-
- }
-
- /**
- * @param cu
- * @return
- */
- private Problem[] getSortedProblems(JET2CompilationUnit cu) {
- List problems = new ArrayList(cu.getProblems());
- // problems are not guaranteed to be in line order (should they)
- Collections.sort(problems, new Comparator() {
-
- public int compare(Object arg0, Object arg1) {
- Problem p0 = (Problem) arg0;
- Problem p1 = (Problem) arg1;
- int lineCompare = p0.getLineNumber() - p1.getLineNumber();
- if(lineCompare == 0) {
- return p0.getColOffset() - p1.getColOffset();
- } else {
- return lineCompare;
- }
- }});
-
- Problem[] problem = (Problem[]) problems.toArray(new Problem[problems.size()]);
- return problem;
- }
-
- public void testAttributeParsingErrors() throws Exception {
- String url = "platform:/plugin/org.eclipse.jet.tests/data/attributeParsingErrors.jet";
-
- InputStream is = getFileContentsAsStream(url);
-
- JET2CompilationUnit cu = new JET2CompilationUnit();
- cu.parse(is, "UTF-8");
-
- Problem[] problems = getSortedProblems(cu);
-
- assertTrue("At least one problem", problems.length > 0);
-
- assertEquals("Problem 1 severity", ProblemSeverity.ERROR, problems[0].getProblemSeverity());
- assertEquals("Problem 1 id", IProblem.JETException, problems[0].getId());
- assertEquals("Problem 1 line number", 4, problems[0].getLineNumber());
-
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java
deleted file mode 100644
index a680374..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestJETParser.java
+++ /dev/null
@@ -1,370 +0,0 @@
-package org.eclipse.jet.tests.compiler;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.core.parser.IProblem;
-import org.eclipse.jet.core.parser.ProblemSeverity;
-import org.eclipse.jet.internal.core.NewLineUtil;
-import org.eclipse.jet.internal.core.parser.jasper.CommentElementDelegate;
-import org.eclipse.jet.internal.core.parser.jasper.DeclarationElementDelegate;
-import org.eclipse.jet.internal.core.parser.jasper.JETCoreElement;
-import org.eclipse.jet.internal.core.parser.jasper.JETException;
-import org.eclipse.jet.internal.core.parser.jasper.JETMark;
-import org.eclipse.jet.internal.core.parser.jasper.JETParseEventListener2;
-import org.eclipse.jet.internal.core.parser.jasper.JETParser;
-import org.eclipse.jet.internal.core.parser.jasper.JETReader;
-import org.eclipse.jet.internal.core.parser.jasper.XMLElementDelegate;
-import org.eclipse.jet.tests.FileUtils;
-
-public class TestJETParser extends TestCase {
-
-
- private static class SavedProblem {
-
- private final ProblemSeverity severity;
- private final int problemId;
- private final String message;
- private final Object[] msgArgs;
- private final int start;
- private final int end;
- private final int line;
-
- public SavedProblem(ProblemSeverity severity, int problemId, String message, Object[] msgArgs, int start, int end, int line) {
- this.severity = severity;
- this.problemId = problemId;
- this.message = message;
- this.msgArgs = msgArgs;
- this.start = start;
- this.end = end;
- this.line = line;
- }
-
- /**
- * @return Returns the end.
- */
- public final int getEnd() {
- return end;
- }
-
- /**
- * @return Returns the line.
- */
- public final int getLine() {
- return line;
- }
-
- /**
- * @return Returns the message.
- */
- public final String getMessage() {
- return message;
- }
-
- /**
- * @return Returns the msgArgs.
- */
- public final Object[] getMsgArgs() {
- return msgArgs;
- }
-
- /**
- * @return Returns the problemId.
- */
- public final int getProblemId() {
- return problemId;
- }
-
- /**
- * @return Returns the severity.
- */
- public final ProblemSeverity getSeverity() {
- return severity;
- }
-
- /**
- * @return Returns the start.
- */
- public final int getStart() {
- return start;
- }
-
- }
-
- private static class AllJET2SyntaxListener implements JETParseEventListener2 {
-
- private final StringBuffer buffer = new StringBuffer();
- private int indent = 0;
- private final String NL = System.getProperty("line.separator");
- private final JETReader reader;
- private final List problems = new ArrayList();
-
-
- public AllJET2SyntaxListener(JETReader reader) {
- this.reader = reader;
- }
-
- public void beginPageProcessing() throws JETException {
- doIndent();
- buffer.append("<jet2>").append(NL);
- indent++;
- }
-
- private void doIndent() {
- for(int i = 0; i < indent; i++) {
- buffer.append(" ");
- }
- }
-
- public void endPageProcessing() throws JETException {
-// doIndent();
-// buffer.append("</jet2>").append(NL);
- }
-
- public String getLog() {
- return NewLineUtil.setLineTerminator(buffer, NL);
- }
-
- public void handleCharData(char[] chars) throws JETException {
- doIndent();
- buffer.append("<data>").append(chars).append("</data>").append(NL);
- }
-
- public void handleComment(JETMark start, JETMark stop) {
- doIndent();
- buffer.append("<comment start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">");
- buffer.append(reader.getChars(start,stop));
- buffer.append("</comment>").append(NL);
-
- }
-
- public void handleDeclaration(JETMark start, JETMark stop) {
- doIndent();
- buffer.append("<declaration start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">");
- buffer.append(reader.getChars(start,stop));
- buffer.append("</declaration>").append(NL);
-
- }
-
- public void handleDirective(String directive, JETMark start,
- JETMark stop, Map attributes) throws JETException {
- doIndent();
- buffer.append("<directive name=\"" + directive + "\" start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">").append(NL);
- indent++;
- for (Iterator i = attributes.entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- doIndent();
- buffer.append("<attribute name=\"" + entry.getKey() + "\">");
- buffer.append(entry.getValue()).append("</attribute>").append(NL);
-
- }
- indent--;
- doIndent();
- buffer.append("</directive>").append(NL);
- }
-
- public void handleExpression(JETMark start, JETMark stop, Map attributes)
- throws JETException {
- doIndent();
- buffer.append("<expression start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">");
- buffer.append(reader.getChars(start,stop));
- buffer.append("</expression>").append(NL);
- }
-
- public void handleScriptlet(JETMark start, JETMark stop, Map attributes)
- throws JETException {
- doIndent();
- buffer.append("<scriptlet start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">");
- buffer.append(reader.getChars(start,stop));
- buffer.append("</scriptlet>").append(NL);
- }
-
- public void handleXMLEmptyTag(String tagName, JETMark start, JETMark stop, Map attributeMap) {
- doIndent();
- buffer.append("<tag name=\"" + tagName + "\" start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">").append(NL);
- indent++;
- for (Iterator i = attributeMap.entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- doIndent();
- buffer.append("<attribute name=\"" + entry.getKey() + "\">" + entry.getValue() + "</attribute>").append(NL);
- }
- indent--;
- doIndent();
- buffer.append("</tag>").append(NL);
- }
-
- public void handleXMLEndTag(String tagName, JETMark start, JETMark stop) {
- indent--;
- doIndent();
- buffer.append("</content>").append(NL);
- indent--;
- doIndent();
- buffer.append("</tag>").append(NL);
- }
-
- public void handleXMLStartTag(String tagName, JETMark start, JETMark stop, Map attributeMap) {
- doIndent();
- buffer.append("<tag name=\"" + tagName + "\" start=\"" + start.toShortString() + "\" stop=\"" + stop.toShortString() + "\">").append(NL);
- indent++;
- for (Iterator i = attributeMap.entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- doIndent();
- buffer.append("<attribute name=\"" + entry.getKey() + "\">" + entry.getValue() + "</attribute>").append(NL);
- }
- doIndent();
- buffer.append("<content>").append(NL);
- indent++;
- }
-
- public boolean isKnownTag(String tagName) {
- return tagName.startsWith("test:");
- }
-
- /**
- * @return Returns the problems.
- */
- public final List getProblems() {
- return problems;
- }
-
- public void recordProblem(ProblemSeverity severity, int problemId, String message, Object[] msgArgs, int start, int end, int line, int colOffset) {
- problems.add(new SavedProblem(severity, problemId, message, msgArgs, start, end, line));
-
- }
-
- public boolean isKnownInvalidTagName(String tagName) {
- // TODO Auto-generated method stub
- return false;
- }
- }
-
- private AllJET2SyntaxListener doJET2Parse(String urlString) throws IOException, MalformedURLException, FileNotFoundException, JETException {
- String fileName = FileUtils.resolveURLToLocationString(urlString);
-
- FileInputStream inputStream = new FileInputStream(new File(fileName));
- JETReader reader = new JETReader(urlString, inputStream, "UTF8");
- AllJET2SyntaxListener listener = new AllJET2SyntaxListener(reader);
- JETParser.Directive directive = new JETParser.Directive();
- directive.getDirectives().add("jet");
- directive.getDirectives().add("taglib");
-
- JETCoreElement[] coreElements = new JETCoreElement[] {
- directive,
- new JETParser.Expression(),
- new CommentElementDelegate(),
- new DeclarationElementDelegate(),
- new JETParser.Scriptlet(),
- new XMLElementDelegate(),
- };
- JETParser parser = new JETParser(reader, listener, coreElements);
-
- parser.parse();
- return listener;
- }
-
- private void doUnclosedElementTest(String urlString, String openChars, int expectedProblemId) throws IOException, MalformedURLException, FileNotFoundException, JETException {
- final AllJET2SyntaxListener listener = doJET2Parse(urlString);
- final List problems = listener.getProblems();
- assertEquals(1, problems.size());
- SavedProblem problem = (SavedProblem) problems.get(0);
- assertEquals(ProblemSeverity.ERROR, problem.getSeverity());
- assertEquals(expectedProblemId, problem.getProblemId());
- }
-
- public void testAllJET2Syntax() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/alljet2.jet";
- AllJET2SyntaxListener listener = doJET2Parse(urlString);
-
- assertEquals(FileUtils.getFileContents(urlString + ".expected", true), listener.getLog());
- }
-
- public void testUnclosedComment() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedComment.jet";
- String openChars = "<%--";
-
- doUnclosedElementTest(urlString, openChars, IProblem.UnterminatedXMLTag);
-
-
- }
-
- public void testUnclosedDeclaration() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDeclaration.jet";
- String openChars = "<%!";
-
- doUnclosedElementTest(urlString, openChars, IProblem.UnterminatedXMLTag);
- }
-
- public void testUnclosedDirective() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedDirective.jet";
- String openChars = "<%@";
-
- try {
- doUnclosedElementTest(urlString, openChars, 0);
- fail();
- } catch(JETException e) {
- // success.
- }
- }
-
- public void testUnclosedExpression() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedExpression.jet";
- String openChars = "<%=";
-
- try {
- doUnclosedElementTest(urlString, openChars, 0);
- fail();
- } catch(JETException e) {
- // success.
- }
- }
-
- public void testUnclosedScriptlet() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedScriplet.jet";
- String openChars = "<%";
-
- try {
- doUnclosedElementTest(urlString, openChars, 0);
- fail();
- } catch(JETException e) {
- // success.
- }
- }
-
- public void testUnclosedXMLStart() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedXMLStart.jet";
- String openChars = "<";
-
- doUnclosedElementTest(urlString, openChars, IProblem.UnterminatedXMLTag);
- }
-
- public void testUnclosedXMLEnd() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/unclosedXMLEnd.jet";
- String openChars = "</";
-
- doUnclosedElementTest(urlString, openChars, IProblem.UnterminatedXMLTag);
- }
-
- public void testXMLEndWithAttributes() throws Exception {
- String urlString = "platform:/plugin/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet";
- String openChars = "</";
-
- doUnclosedElementTest(urlString, openChars, IProblem.UnterminatedXMLTag);
- }
-
- // this error is not detected by the parser, but by post parse processing.
-// public void testXMLStartWithoutEnd() throws Exception {
-// String urlString = "platform:/plugin/org.eclipse.jet.tests/data/xmlStartWithoutEnd.jet";
-// String openChars = "<test:start>";
-//
-// doUnclosedElementTest(urlString, openChars, Problem.MissingXmlEndTag);
-// }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestSimplifiedCompiler.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestSimplifiedCompiler.java
deleted file mode 100644
index f02e067..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TestSimplifiedCompiler.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.compiler;
-
-import java.io.Serializable;
-import java.net.URI;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.core.compiler.JETCompilerOptions;
-import org.eclipse.jet.core.parser.ITagLibraryResolver;
-import org.eclipse.jet.core.parser.ast.JETAST;
-import org.eclipse.jet.internal.compiler.SimplifiedCompiler;
-import org.eclipse.jet.internal.core.compiler.ICompilerOutput;
-import org.eclipse.jet.internal.core.compiler.IJETCompiler;
-import org.eclipse.jet.internal.core.compiler.IJETCompiler.CompileResult;
-import org.eclipse.jet.taglib.TagLibrary;
-import org.eclipse.jet.taglib.TagLibraryManager;
-import org.eclipse.jet.tests.FileUtils;
-
-/**
- * Test {@link SimplifiedCompiler}
- *
- */
-public class TestSimplifiedCompiler extends TestCase {
-
- private URI baseLocation;
- private URI changedBaseLocation;
- private CompilerOutput compilerOutput;
-
- private static final class CompilerOutput implements ICompilerOutput {
-
- private String code;
- private String encoding;
- private String outputFilePath;
- private String removeOutputFilePath;
-
- public String getCode() {
- return code;
- }
-
- public String getEncoding() {
- return encoding;
- }
-
- public void removeOutput(String outputFilePath) {
- removeOutputFilePath = outputFilePath;
- }
-
- public void writeOutput(String outputFilePath, String contents, String encoding) {
- this.outputFilePath = outputFilePath;
- this.code = contents;
- this.encoding = encoding;
-
- }
-
- public String getOutputFilePath() {
- return outputFilePath;
- }
-
- public String getRemoveOutputFilePath() {
- return removeOutputFilePath;
- }
-
- public void recordProblems(String templatePath, List problems) {
- // TODO Auto-generated method stub
-
- }
-
- public void preCompile(String templatePath) {
- // TODO Auto-generated method stub
-
- }
-
- }
-
- private static final class TagLibraryResolver implements ITagLibraryResolver {
-
- public TagLibrary getLibrary(String tagLibraryID) {
- return TagLibraryManager.getInstance().getTagLibrary(tagLibraryID);
- }
-
- }
- protected void setUp() throws Exception {
- super.setUp();
-
- baseLocation = new URI("platform:/plugin/org.eclipse.jet.tests/data/simplifiedCompiler/templates/");
- changedBaseLocation = new URI("platform:/plugin/org.eclipse.jet.tests/data/simplifiedCompiler/changedTemplates/");
- compilerOutput = new CompilerOutput();
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#compile(java.lang.String)}.
- * @throws Exception
- */
- public void testCompile() throws Exception {
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .tagLibraryResolver(new TagLibraryResolver())
- .build();
-
- final String templatePath = "simple.v2.input.jet";
- final CompileResult result = compiler.compile(templatePath);
-
- assertEquals(CompileResult.OK, result);
-
- final String expectedJavaCode = FileUtils.getFileContents(baseLocation.resolve(templatePath + ".expected.java").toString(), true);
-
- assertEquals(expectedJavaCode, compilerOutput.getCode());
- assertEquals("UTF-8", compilerOutput.getEncoding());
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#compile(java.lang.String)} in the
- * case where a template path with unknown extension is passed.
- */
- public void testCompile_unknownExtension() {
- // default compiler knows only the JET extension
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .build();
-
- final String templatePath = "template.with.unknown.extension";
-
- final CompileResult result = compiler.compile(templatePath);
-
- assertEquals(CompileResult.IGNORED, result);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#compile(java.lang.String)} in the
- * case where tag libraries are predefined.
- * @throws Exception
- */
- public void testCompile_predefinedTagLibraries() throws Exception {
- Map predefinedTagLibraries = new HashMap();
- predefinedTagLibraries.put("c", "org.eclipse.jet.controlTags");
- predefinedTagLibraries.put("f", "org.eclipse.jet.formatTags");
- // test a number of extensions, including those with leading/trailing blanks
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .predefinedTagLibraries(predefinedTagLibraries)
- .tagLibraryResolver(new TagLibraryResolver())
- .build();
-
- final String templatePath = "simple.v2.usePredefTagLibs.jet";
- final CompileResult result = compiler.compile(templatePath);
-
- assertEquals(CompileResult.OK, result);
-
- final String expectedJavaCode = FileUtils.getFileContents(baseLocation.resolve(templatePath + ".predefs.expected.java").toString(), true);
-
- assertEquals(expectedJavaCode, compilerOutput.getCode());
- assertEquals("UTF-8", compilerOutput.getEncoding());
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#compile(java.lang.String)} in the
- * case where no tag libraries are predefined.
- * @throws Exception
- */
- public void testCompile_noPredefinedTagLibraries() throws Exception {
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .build();
-
- final String templatePath = "simple.v2.usePredefTagLibs.jet";
- final CompileResult result = compiler.compile(templatePath);
-
- assertEquals(CompileResult.OK, result);
-
- final String expectedJavaCode = FileUtils.getFileContents(baseLocation.resolve(templatePath + ".nopredefs.expected.java").toString(), true);
-
- assertEquals(expectedJavaCode, compilerOutput.getCode());
- assertEquals("UTF-8", compilerOutput.getEncoding());
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#compile(java.lang.String)} in the
- * case more than one template extension is defined
- */
- public void testCompile_multipleExtensions() {
- Map options = new HashMap(JETCompilerOptions.getDefaultCompilerOptions());
- // test a number of extensions, including those with leading/trailing blanks
- options.put(JETCompilerOptions.OPTION_TEMPLATE_EXT, "pat, pat2 ,pat3,pat4");
- // default compiler knows only the JET extension
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .options(options)
- .build();
-
- Object cu;
- cu = compiler.compile("simple.v2.pat");
- assertNotNull("simple.v2.pat", cu);
- compiler.compile("simple.v2.pat2");
- assertNotNull("simple.v2.pat2", cu);
- compiler.compile("simple.v2.pat3");
- assertNotNull("simple.v2.pat3", cu);
- compiler.compile("simple.v2.pat4");
- assertNotNull("simple.v2.pat4", cu);
-
- }
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#finish()}.
- * @throws Exception
- */
- public void testFinish() throws Exception {
- Map options = new HashMap(JETCompilerOptions.getDefaultCompilerOptions());
- options.put(JETCompilerOptions.OPTION_USE_JAVA5, "false");
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .templateLoaderFQN("org.eclipse.jet.compiled.TemplateLoaderClass")
- .options(options)
- .build();
-
- final String templatePath1 = "simple.v2.input.jet";
- compiler.compile(templatePath1);
- final String templatePath2 = "simple.v2.input2.jet";
- compiler.compile(templatePath2);
-
- compiler.finish();
- assertEquals("org/eclipse/jet/compiled/TemplateLoaderClass.java", compilerOutput.getOutputFilePath());
- final String expectedJavaCode = FileUtils.getFileContents(baseLocation.resolve("simple.v2.loader.expected.java").toString(), true);
- assertEquals("code", expectedJavaCode, compilerOutput.getCode());
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#compile(java.lang.String)} in the
- * case where an output class is changed in successive compiles of a template
- */
- public void testCompile_withOuputClassNameChange() {
- IJETCompiler compiler = new SimplifiedCompiler.Builder(
- JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .build();
-
- final String templatePath = "simple.v2.input.jet";
- compiler.compile(templatePath);
-
- final String outputFilePath = compilerOutput.getOutputFilePath();
-
- assertNull(compilerOutput.getRemoveOutputFilePath());
-
- Serializable memento = compiler.getMemento();
-
- compiler = new SimplifiedCompiler.Builder(
- JETAST.JET_SPEC_V2, changedBaseLocation, compilerOutput)
- .savedState(memento)
- .build();
- compiler.compile(templatePath);
-
- assertEquals(outputFilePath, compilerOutput.getRemoveOutputFilePath());
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#clean()}
- */
- public void testClean() {
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .templateLoaderFQN("org.eclipse.jet.compiled.TemplateLoaderClass")
- .build();
-
- final String templatePath1 = "simple.v2.input.jet";
- compiler.compile(templatePath1);
- final String templatePath2 = "simple.v2.input2.jet";
- compiler.compile(templatePath2);
-
- compiler.finish();
-
- Serializable memento = compiler.getMemento();
-
- final Set removedFiles = new HashSet();
- IJETCompiler compiler2 = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation,
- new ICompilerOutput() {
-
- public void removeOutput(String outputFilePath) {
- removedFiles.add(outputFilePath);
- }
-
- public void writeOutput(String outputFilePath, String contents, String encoding) {
- // TODO Auto-generated method stub
-
- }
-
- public void recordProblems(String templatePath, List problems) {
- // TODO Auto-generated method stub
-
- }
-
- public void preCompile(String templatePath) {
- // TODO Auto-generated method stub
-
- }})
- .templateLoaderFQN("org.eclipse.jet.compiled.TemplateLoaderClass")
- .savedState(memento)
- .build();
-
- compiler2.clean();
-
- String expectedOutputPaths[] = new String[] {
- "org/eclipse/jet/compiled/_jet_simplev2input.java",
- "org/eclipse/jet/compiled/_jet_simplev2input2.java",
- "org/eclipse/jet/compiled/TemplateLoaderClass.java",
- };
-
- assertEquals(expectedOutputPaths.length, removedFiles.size());
- for (int i = 0; i < expectedOutputPaths.length; i++) {
- assertTrue("removedFiles contains " + expectedOutputPaths[i], removedFiles.contains(expectedOutputPaths[i]));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#remove()}
- */
- public void testRemove() {
- // this is essentially the testCompiler_withOutputNameChange test, but
- // we run remove instead of the second compile
- IJETCompiler compiler = new SimplifiedCompiler.Builder(
- JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .build();
-
- final String templatePath = "simple.v2.input.jet";
- compiler.compile(templatePath);
-
- final String outputFilePath = compilerOutput.getOutputFilePath();
-
- assertNull(compilerOutput.getRemoveOutputFilePath());
-
- Serializable memento = compiler.getMemento();
-
- compiler = new SimplifiedCompiler.Builder(
- JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .savedState(memento)
- .build();
- compiler.removeTemplate(templatePath);
-
- assertEquals(outputFilePath, compilerOutput.getRemoveOutputFilePath());
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#getTagLibaryDependencies()}
- */
- public void testGetTagLibaryDependencies_none() {
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .build();
-
- final String templatePath = "simple.v2.usePredefTagLibs.jet";
- final CompileResult result = compiler.compile(templatePath);
-
- assertEquals(CompileResult.OK, result);
-
- final String[] dependencies = compiler.getTagLibaryDependencies();
- assertEquals(0, dependencies.length);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#getTagLibaryDependencies()}
- */
- public void testGetTagLibaryDependencies_one() {
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .build();
-
- final String templatePath = "simple.v2.input.jet";
- final CompileResult result = compiler.compile(templatePath);
-
- assertEquals(CompileResult.OK, result);
-
- final String[] dependencies = compiler.getTagLibaryDependencies();
- assertEquals(1, dependencies.length);
- assertEquals("org.eclipse.jet.tests.TestLibrary", dependencies[0]);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#getTagLibaryDependencies()}
- */
- public void testGetTagLibaryDependencies_many() {
- Map predefinedTagLibraries = new HashMap();
- predefinedTagLibraries.put("c", "org.eclipse.jet.controlTags");
- predefinedTagLibraries.put("f", "org.eclipse.jet.formatTags");
- // test a number of extensions, including those with leading/trailing blanks
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .predefinedTagLibraries(predefinedTagLibraries)
- .build();
-
- final String templatePath = "simple.v2.input.jet";
- final CompileResult result = compiler.compile(templatePath);
- assertEquals(CompileResult.OK, result);
-
- final String[] dependencies = compiler.getTagLibaryDependencies();
- final Set depSet = new HashSet(Arrays.asList(dependencies));
- assertEquals(3, depSet.size());
- assertTrue("org.eclipse.jet.controlTags", depSet.contains("org.eclipse.jet.controlTags"));
- assertTrue("org.eclipse.jet.formatTags", depSet.contains("org.eclipse.jet.formatTags"));
- assertTrue("org.eclipse.jet.tests.TestLibrary", depSet.contains("org.eclipse.jet.tests.TestLibrary"));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.compiler.SimplifiedCompiler#getTagLibaryDependencies()}
- */
- public void testGetTagLibaryDependencies_afterStateSave() {
- Map predefinedTagLibraries = new HashMap();
- predefinedTagLibraries.put("c", "org.eclipse.jet.controlTags");
- predefinedTagLibraries.put("f", "org.eclipse.jet.formatTags");
- // test a number of extensions, including those with leading/trailing blanks
- IJETCompiler compiler = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .predefinedTagLibraries(predefinedTagLibraries)
- .build();
-
- final String templatePath = "simple.v2.input.jet";
- final CompileResult result = compiler.compile(templatePath);
- assertEquals(CompileResult.OK, result);
-
- final Serializable memento = compiler.getMemento();
-
- IJETCompiler compiler2 = new SimplifiedCompiler.Builder(JETAST.JET_SPEC_V2, baseLocation, compilerOutput)
- .predefinedTagLibraries(predefinedTagLibraries)
- .savedState(memento)
- .build();
-
-
- final String[] dependencies = compiler2.getTagLibaryDependencies();
- final Set depSet = new HashSet(Arrays.asList(dependencies));
- assertEquals(3, depSet.size());
- assertTrue("org.eclipse.jet.controlTags", depSet.contains("org.eclipse.jet.controlTags"));
- assertTrue("org.eclipse.jet.formatTags", depSet.contains("org.eclipse.jet.formatTags"));
- assertTrue("org.eclipse.jet.tests.TestLibrary", depSet.contains("org.eclipse.jet.tests.TestLibrary"));
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java
deleted file mode 100644
index f6e6b44..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/compiler/TextTrimmingTests.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package org.eclipse.jet.tests.compiler;
-
-import java.net.URI;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.jet.core.parser.DefaultTemplateResolver;
-import org.eclipse.jet.core.parser.ITagLibraryResolver;
-import org.eclipse.jet.core.parser.ast.JETAST;
-import org.eclipse.jet.core.parser.ast.JETASTParser;
-import org.eclipse.jet.core.parser.ast.JETASTVisitor;
-import org.eclipse.jet.core.parser.ast.JETCompilationUnit;
-import org.eclipse.jet.core.parser.ast.TextElement;
-import org.eclipse.jet.internal.parser.LineInfo;
-import org.eclipse.jet.taglib.TagLibrary;
-import org.eclipse.jet.taglib.TagLibraryManager;
-
-public class TextTrimmingTests extends TestCase {
-
- private final static class TagLibraryResolver implements ITagLibraryResolver {
-
- public TagLibrary getLibrary(String tagLibraryID) {
- return TagLibraryManager.getInstance().getTagLibrary(tagLibraryID);
- }
-
- }
- private static JETCompilationUnit cu;
- /**
- * Wrap this suite in a TestSetup so that we can do one-time setup
- * @return a wrapped TestSetup wrapped suite.
- */
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(TextTrimmingTests.class)) {
- protected void setUp() throws Exception {
- setUpAllTests();
- }
-
- protected void tearDown() throws Exception {
- tearDownAllTests();
- }
- };
-
- return setup;
- }
-
- private static void setUpAllTests() throws Exception {
- final URI baseLocation = new URI("platform:/plugin/org.eclipse.jet.tests/data/");
- final String templatePath = "textTrimmingTests.jet";
-
- cu = (JETCompilationUnit) new JETASTParser.Builder(JETAST.JET_SPEC_V2)
- .templateResolver(new DefaultTemplateResolver.Builder(baseLocation).build())
- .tagLibraryResolver(new TagLibraryResolver())
- .build()
- .parse(templatePath);
-
- assertFalse("Errors in test template", cu.hasErrors());
-
- }
-
- private static void tearDownAllTests() {
- // nothing to do
- }
-
-
- private String[] getLines(TextElement text, boolean strip) {
- char[] chars = strip ? text.getText() : text.getRawText();
- LineInfo[] lineInfos = LineInfo.calculateLines(chars);
- String[] lines = new String[lineInfos.length];
- for (int i = 0; i < lineInfos.length; i++) {
- lines[i] = new String(chars, lineInfos[i].getStart(), lineInfos[i].getEnd() - lineInfos[i].getStart()) + lineInfos[i].getDelimiter();
- }
- return lines;
- }
-
- private String[] getTextLinesInRange(JETCompilationUnit cu, final String testMarker, final boolean strip) {
- final StringBuffer linesBuffer = new StringBuffer();
- cu.accept(new JETASTVisitor() {
- private boolean rangeStarted = false;
- private boolean rangeEnded = false;
-
- public boolean visit(TextElement text) {
- if(rangeEnded) return true;
-
- String lines[] = getLines(text, strip);
- int i = 0;
- for (; i < lines.length && !rangeStarted; i++) {
- if(lines[i].startsWith(testMarker)) {
- rangeStarted = true;
- linesBuffer.append(lines[i]);
- }
- }
-
- for(; i < lines.length && rangeStarted && !rangeEnded; i++) {
- linesBuffer.append(lines[i]);
- if(lines[i].startsWith(testMarker)) {
- rangeEnded = true;
- }
- }
- return true;
- }
- });
- final LineInfo[] lineInfos = LineInfo.calculateLines(linesBuffer.toString().toCharArray());
- String[] lines = new String[lineInfos.length];
- for (int i = 0; i < lineInfos.length; i++) {
- lines[i] = linesBuffer.substring(lineInfos[i].getStart(), lineInfos[i].getEnd());
- }
- return lines;
- }
-
- public void testStartEndTagStripping() {
- final String TEST_CASE = "test 001";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(5, unstrippedText.length);
-
- assertEquals(3, strippedText.length);
- }
-
- public void testStartEndTagStripping2() {
- final String TEST_CASE = "test 002";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(5, unstrippedText.length);
-
- assertEquals(3, strippedText.length);
-
- }
-
- public void testStartEndTagStripping3() {
- final String TEST_CASE = "test 003";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(5, unstrippedText.length);
-
- assertEquals(3, strippedText.length);
-
- }
-
- public void testDirectiveStripping() {
- final String TEST_CASE = "test 004";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(2, strippedText.length);
-
- }
-
- public void testScriptletStripping() {
- final String TEST_CASE = "test 005";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(2, strippedText.length);
-
- }
-
- public void testDeclarationStripping() {
- final String TEST_CASE = "test 006";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(2, strippedText.length);
-
- }
-
- public void testEmptyTagStripping_supportsRemove() {
- final String TEST_CASE = "test 007";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(2, strippedText.length);
-
- }
-
-
- public void testEmptyTagStripping_noRemove() {
- final String TEST_CASE = "test 008";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(3, strippedText.length);
-
- }
-
- public void testCommentStripping() {
- final String TEST_CASE = "test 009";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(2, strippedText.length);
-
- }
-
- public void testExpressionStripping() {
- final String TEST_CASE = "test 010";
- String[] unstrippedText = getTextLinesInRange(cu, TEST_CASE, false);
- String[] strippedText = getTextLinesInRange(cu, TEST_CASE, true);
-
- assertEquals(3, unstrippedText.length);
-
- assertEquals(3, strippedText.length);
-
- }
-
-
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/AllTests.java
deleted file mode 100644
index 465fb9e..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/AllTests.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.jet.tests.model.load;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.model.load");
- //$JUnit-BEGIN$
- suite.addTestSuite(WorkspaceContextTests.class);
- suite.addTestSuite(TestXMLDocumentLoads.class);
- suite.addTestSuite(EmfModelLoaderTests.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/EmfModelLoaderTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/EmfModelLoaderTests.java
deleted file mode 100644
index 220e838..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/EmfModelLoaderTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.eclipse.jet.tests.model.load;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot;
-import org.eclipse.jet.internal.runtime.model.EMFModelLoader;
-import org.eclipse.jet.runtime.model.IModelLoader;
-
-public class EmfModelLoaderTests extends TestCase {
-
- private IModelLoader emfLoader;
- private URL baseURL;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- emfLoader = new EMFModelLoader();
- baseURL = new URL("platform:/plugin/org.eclipse.jet.tests/data/");
- }
- /*
- * Test method for 'org.eclipse.jet.internal.runtime.model.EMFModelLoader.load(URL)'
- */
- public void testLoad_generic_xml() throws Exception {
- final Object model = emfLoader.load(new URL(baseURL, "DOMInspector.xml"));
-
- assertNotNull("Loaded model is null", model);
-
- assertTrue("instanceof XmlDocumentRoot", model instanceof XMLTypeDocumentRoot);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.runtime.model.EMFModelLoader.load(URL)'
- */
- public void testLoad_xsd() throws Exception {
- final Object model = emfLoader.load(new URL(baseURL, "library.xml"));
-
- assertNotNull("Loaded model is null", model);
-
- assertTrue("instanceof EObject", model instanceof EObject);
- assertEquals("DocumentRoot", ((EObject)model).eClass().getName());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.runtime.model.EMFModelLoader.load(URL)'
- */
- public void testLoad_ecore() throws Exception {
- final Object model = emfLoader.load(new URL(baseURL, "sample.dataaccess"));
-
- assertNotNull("Loaded model is null", model);
-
- assertTrue("instanceof Resource", model instanceof Resource);
- Resource resource = (Resource) model;
- EObject first = (EObject) resource.getContents().get(0);
- assertEquals("Employee", first.eClass().getName());
- }
- /*
- * Test method for 'org.eclipse.jet.internal.runtime.model.EMFModelLoader.loadFromString(String)'
- */
- public void testLoadFromString() throws Exception {
- String document = "<root><a><b/><b/></a><a><c/></a></root>";
- final Object model = emfLoader.loadFromString(document, "xml");
-
- assertNotNull("Loaded model is null", model);
-
- assertTrue("instanceof XmlDocumentRoot", model instanceof XMLTypeDocumentRoot);
- }
-
- public void testLoad_URL_String() throws Exception {
- final Object model = emfLoader.load(new URL(baseURL, "library.xml.indisguise"), "xml");
-
- assertNotNull("Loaded model is null", model);
-
- assertTrue("instanceof EObject", model instanceof EObject);
- assertEquals("DocumentRoot", ((EObject)model).eClass().getName());
- }
-
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/TestXMLDocumentLoads.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/TestXMLDocumentLoads.java
deleted file mode 100644
index 52cf8b0..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/TestXMLDocumentLoads.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.jet.tests.model.load;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.jet.internal.runtime.model.EMFXMLModelLoader;
-
-public class TestXMLDocumentLoads extends TestCase {
-
-
- private EMFXMLModelLoader loader;
-
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
-
- loader = new EMFXMLModelLoader();
- }
-
- /**
- * This test verifies the the XML Model loader does not put dynamically loaded
- * XSD packages in the the default package registry. This is especially important
- * for XSD schemas without a target namespace.
- * @throws IOException
- */
- public void testPlainXML() throws IOException {
- final int pkgRegSz = EPackage.Registry.INSTANCE.size();
-
- URL plainURL = new URL("platform:/plugin/org.eclipse.jet.tests/data/plain.xml");
-
- final Object plainModel1 = loader.load(plainURL);
- assertNotNull(plainModel1);
-
- assertEquals(pkgRegSz, EPackage.Registry.INSTANCE.size());
-
- final Object plainModel2 = loader.load(plainURL);
- assertNotNull(plainModel2);
-
- assertEquals(pkgRegSz, EPackage.Registry.INSTANCE.size());
- }
-
- /**
- * This test verifies the the XML Model loader does not put dynamically loaded
- * XSD packages in the the default package registry. This is especially important
- * for XSD schemas without a target namespace.
- * @throws IOException
- */
- public void testXML_knownSchema_schemaLocation() throws IOException {
- final int pkgRegSz = EPackage.Registry.INSTANCE.size();
-
- URL newProjectURL = new URL("platform:/plugin/org.eclipse.jet.tests/data/newproject.xml");
- final Object newProjectModel = loader.load(newProjectURL);
- assertNotNull(newProjectModel);
-
- assertEquals(pkgRegSz, EPackage.Registry.INSTANCE.size());
- }
-
- /**
- * This test verifies the the XML Model loader does not put dynamically loaded
- * XSD packages in the the default package registry. This is especially important
- * for XSD schemas without a target namespace.
- * @throws IOException
- */
- public void testXML_knownSchema_noNamespaceSchemaLocation() throws IOException {
- final int pkgRegSz = EPackage.Registry.INSTANCE.size();
-
- URL beanModelURL = new URL("platform:/plugin/org.eclipse.jet.tests/data/beanModel.xml");
- final Object beanModel = loader.load(beanModelURL);
- assertNotNull(beanModel);
-
- assertEquals(pkgRegSz, EPackage.Registry.INSTANCE.size());
- }
-
- /**
- * This test verifies the the XML Model loader does not put dynamically loaded
- * XSD packages in the the default package registry. This is especially important
- * for XSD schemas without a target namespace.
- * @throws IOException
- */
- public void testXML_unknownSchema() throws IOException {
- final int pkgRegSz = EPackage.Registry.INSTANCE.size();
-
- URL newProjectURL = new URL("platform:/plugin/org.eclipse.jet.tests/data/newproject.nolocation.xml");
- final Object newProjectModel = loader.load(newProjectURL);
- assertNotNull(newProjectModel);
-
- assertEquals(pkgRegSz, EPackage.Registry.INSTANCE.size());
- }
-
- /**
- * This test verifies the the XML Model loader does not put dynamically loaded
- * XSD packages in the the default package registry. This is especially important
- * for XSD schemas without a target namespace.
- * @throws MalformedURLException
- */
- public void testXML_missingSchema_noNamespace() throws MalformedURLException {
- try {
- URL beanModelURL = new URL("platform:/plugin/org.eclipse.jet.tests/data/beanModel.badlocation.xml");
- loader.load(beanModelURL);
- fail();
- } catch (MalformedURLException e) {
- throw e;
- } catch (IOException e) {
- // success
- }
- }
-
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/WorkspaceContextTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/WorkspaceContextTests.java
deleted file mode 100644
index a6b8471..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/model/load/WorkspaceContextTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.eclipse.jet.tests.model.load;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.internal.runtime.model.WorkspaceLoadContext;
-import org.eclipse.jet.runtime.model.ILoadContext;
-
-public class WorkspaceContextTests extends TestCase {
-
- private ILoadContext definedContext;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- definedContext = new WorkspaceLoadContext();
- }
- /*
- * Test method for 'org.eclipse.jet.internal.runtime.model.WorkspaceLoadContext.getName()'
- */
- public void testGetName() {
- final String name = definedContext.getName();
-
- assertEquals("workspace", name);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.runtime.model.WorkspaceLoadContext.getContextUrl()'
- */
- public void testGetContextUrl() {
- final URL contextUrl = definedContext.getContextUrl();
-
- assertEquals("platform:/resource/", contextUrl.toExternalForm());
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/AllTests.java
deleted file mode 100644
index 515e2c8..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/AllTests.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.jet.tests.parser.resources;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.parser.resources");
- //$JUnit-BEGIN$
- suite.addTest(ResourceTemplateInputTest.suite());
- suite.addTest(WorkspaceTemplateResolverBuilderTest.suite());
- suite.addTest(WorkspaceTemplateResolverHelperFactoryTest.suite());
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/ResourceTemplateInputTest.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/ResourceTemplateInputTest.java
deleted file mode 100644
index 6b84bd2..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/ResourceTemplateInputTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.parser.resources;
-
-import java.io.Reader;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.core.parser.ITemplateInput;
-import org.eclipse.jet.core.parser.TemplateInputException;
-import org.eclipse.jet.internal.parser.resources.ResourceTemplateInput;
-
-/**
- * @author pelder
- *
- */
-public class ResourceTemplateInputTest extends TestCase {
-
- protected static IProject project;
-
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(ResourceTemplateInputTest.class)) {
- protected void setUp() throws Exception {
- setUpAllTests();
- }
-
- protected void tearDown() throws Exception {
- tearDownAllTests();
- }
- };
-
- return setup;
- }
-
- protected static void setUpAllTests() {
- String newProjectModel = "<newProjectModel>" +
- "<project" +
- " name=\"" + TEST_PROJECT_NAME + "\"" +
- "/>" +
- "</newProjectModel>";
-
- IStatus status = JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject", newProjectModel, new NullProgressMonitor());
- assertTrue("setUpAllTests", status.isOK());
- try {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
- }}, new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
-
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(TEST_PROJECT_NAME);
- assertTrue("Test project exists", project.exists());
-
- }
-
- protected static void tearDownAllTests() {
- // TODO Auto-generated method stub
-
- }
-
- protected ITemplateInput templateInput;
- private static final String TEST_PROJECT_NAME = "org.eclipse.jet.tests.resources.ResourceTemplateInput Tests";
-
- protected void setUp() throws Exception {
- super.setUp();
-
- IFile templateFile = project.getFile("templates/main.jet");
- templateInput = new ResourceTemplateInput(templateFile);
- }
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.ResourceTemplateInput#ResourceTemplateInput(org.eclipse.core.resources.IFile)}.
- */
- public void testResourceTemplateInput() {
-
- assertNotNull(templateInput);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.ResourceTemplateInput#getBaseLocation()}.
- * @throws URISyntaxException
- */
- public void testGetBaseLocation() throws URISyntaxException {
- URI baseLocation = templateInput.getBaseLocation();
-
- assertEquals(new URI("platform", "/resource/" + TEST_PROJECT_NAME + "/", null), baseLocation);
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.ResourceTemplateInput#getReader()}.
- * @throws TemplateInputException
- */
- public void testGetReader() throws TemplateInputException {
- Reader reader = templateInput.getReader();
- assertNotNull(reader);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.ResourceTemplateInput#getTemplatePath()}.
- */
- public void testGetTemplatePath() {
- String templatePath = templateInput.getTemplatePath();
-
- assertEquals("templates/main.jet", templatePath);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.ResourceTemplateInput#getEncoding()}.
- * @throws TemplateInputException
- * @throws CoreException
- */
- public void testGetEncoding() throws TemplateInputException, CoreException {
- String encoding = templateInput.getEncoding();
- assertEquals(project.getFile(templateInput.getTemplatePath()).getCharset(), encoding);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverBuilderTest.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverBuilderTest.java
deleted file mode 100644
index ac609f1..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverBuilderTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.parser.resources;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.core.parser.ITemplateResolver;
-import org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverBuilder;
-
-/**
- * @author pelder
- *
- */
-public class WorkspaceTemplateResolverBuilderTest extends TestCase {
-
- private static final String TEST_PROJECT_NAME = "org.eclipse.jet.tests.parser.Workspace Template Resover Builder Test";
- protected static IProject project;
-
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(WorkspaceTemplateResolverBuilderTest.class)) {
- protected void setUp() throws Exception {
- setUpAllTests();
- }
-
- protected void tearDown() throws Exception {
- tearDownAllTests();
- }
- };
-
- return setup;
- }
-
- protected static void tearDownAllTests() {
- // TODO Auto-generated method stub
-
- }
-
- protected static void setUpAllTests() {
- String newProjectModel = "<newProjectModel>" +
- "<project" +
- " name=\"" + TEST_PROJECT_NAME + "\"" +
- "/>" +
- "</newProjectModel>";
-
- IStatus status = JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject", newProjectModel, new NullProgressMonitor());
- assertTrue("setUpAllTests", status.isOK());
- try {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
- }}, new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
-
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(TEST_PROJECT_NAME);
- assertTrue("Test project exists", project.exists());
-
- }
-
- private WorkspaceTemplateResolverBuilder builder;
- protected void setUp() throws Exception {
- super.setUp();
-
- builder = new WorkspaceTemplateResolverBuilder(project);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverBuilder#WorkspaceTemplateResolverBuilder(org.eclipse.core.resources.IProject)}.
- * @throws URISyntaxException
- */
- public void testWorkspaceTemplateResolverBuilder() throws URISyntaxException {
- assertNotNull(builder);
- ITemplateResolver templateResolver = builder.build();
-
- URI[] baseLocations = templateResolver.getBaseLocations();
- assertEquals(1, baseLocations.length);
- assertEquals(new URI("platform", "/resource/" + TEST_PROJECT_NAME + "/", null), baseLocations[0]);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverBuilder#addAltBaseLocations(java.net.URI[])}.
- * @throws URISyntaxException
- */
- public void testAddAltBaseLocations() throws URISyntaxException {
- builder.addAltBaseLocations(new URI[] {
- new URI("file", "/c:/usr/altLocation/", null), });
-
- ITemplateResolver templateResolver = builder.build();
-
- URI[] baseLocations = templateResolver.getBaseLocations();
- assertEquals(2, baseLocations.length);
- assertEquals(new URI("file", "/c:/usr/altLocation/", null), baseLocations[1]);
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverHelperFactoryTest.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverHelperFactoryTest.java
deleted file mode 100644
index 8ac4153..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/parser/resources/WorkspaceTemplateResolverHelperFactoryTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.parser.resources;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.core.parser.ITemplateResolverHelper;
-import org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverHelperFactory;
-
-/**
- * @author pelder
- *
- */
-public class WorkspaceTemplateResolverHelperFactoryTest extends TestCase {
-
- private static final String TEST_PROJECT_NAME = "org.eclipse.jet.tests.parser.Workspace Template Resover Helper Factory Test";
- protected static IProject project;
-
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(WorkspaceTemplateResolverHelperFactoryTest.class)) {
- protected void setUp() throws Exception {
- setUpAllTests();
- }
-
- protected void tearDown() throws Exception {
- tearDownAllTests();
- }
- };
-
- return setup;
- }
-
- protected static void tearDownAllTests() {
- // TODO Auto-generated method stub
-
- }
-
- protected static void setUpAllTests() {
- String newProjectModel = "<newProjectModel>" +
- "<project" +
- " name=\"" + TEST_PROJECT_NAME + "\"" +
- "/>" +
- "</newProjectModel>";
-
- IStatus status = JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject", newProjectModel, new NullProgressMonitor());
- assertTrue("setUpAllTests", status.isOK());
- try {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
- }}, new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
-
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(TEST_PROJECT_NAME);
- assertTrue("Test project exists", project.exists());
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverHelperFactory#getTemplateResolverHelper(java.net.URI)}.
- * @throws URISyntaxException
- */
- public void testGetTemplateResolverHelper_project_platformURI() throws URISyntaxException {
-
- URI baseLocation = new URI("platform", "/resource/" + project.getName() + "/", null);
- ITemplateResolverHelper templateResolverHelper = WorkspaceTemplateResolverHelperFactory.getInstance().getTemplateResolverHelper(baseLocation);
- String templatePath = "templates/main.jet";
- assertTrue("template Exists", templateResolverHelper.inputExists(templatePath));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverHelperFactory#getTemplateResolverHelper(java.net.URI)}.
- * @throws URISyntaxException
- */
- public void testGetTemplateResolverHelper_folder_platformURI() throws URISyntaxException {
-
- URI baseLocation = new URI("platform", "/resource/" + project.getName() + "/templates/", null);
- ITemplateResolverHelper templateResolverHelper = WorkspaceTemplateResolverHelperFactory.getInstance().getTemplateResolverHelper(baseLocation);
- String templatePath = "main.jet";
- assertTrue("template Exists", templateResolverHelper.inputExists(templatePath));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverHelperFactory#getTemplateResolverHelper(java.net.URI)}.
- * @throws URISyntaxException
- */
- public void testGetTemplateResolverHelper_project_fileURI() throws URISyntaxException {
-
- URI baseLocation = project.getLocationURI();
- ITemplateResolverHelper templateResolverHelper = WorkspaceTemplateResolverHelperFactory.getInstance().getTemplateResolverHelper(baseLocation);
- String templatePath = "templates/main.jet";
- assertTrue("template Exists", templateResolverHelper.inputExists(templatePath));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.parser.resources.WorkspaceTemplateResolverHelperFactory#getTemplateResolverHelper(java.net.URI)}.
- * @throws URISyntaxException
- */
- public void testGetTemplateResolverHelper_folder_fileURI() throws URISyntaxException {
-
- URI baseLocation = project.getFolder("templates").getLocationURI();
- ITemplateResolverHelper templateResolverHelper = WorkspaceTemplateResolverHelperFactory.getInstance().getTemplateResolverHelper(baseLocation);
- String templatePath = "main.jet";
- assertTrue("template Exists", templateResolverHelper.inputExists(templatePath));
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java
deleted file mode 100644
index 1b5c8a9..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/AllTests.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.jet.tests.runtime;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.runtime");
- //$JUnit-BEGIN$
- suite.addTestSuite(TestBundleLoading.class);
- suite.addTestSuite(TestBundleJarUtil.class);
- suite.addTestSuite(TestBundleDescriptions.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleDescriptions.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleDescriptions.java
deleted file mode 100644
index 67d2751..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleDescriptions.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.jet.tests.runtime;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.taglib.TagLibraryReference;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-
-public class TestBundleDescriptions extends TestCase {
-
- public void testGetProjectDescription()
- {
- final IStatus result = JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject",
- "<newProjectModel><project name=\"foo.bar\"/></newProjectModel>",
- new NullProgressMonitor());
-
- assertTrue(result.isOK());
-
- final IJETBundleDescriptor desc = JET2Platform.getProjectDescription("foo.bar");
- assertNotNull(desc);
- assertEquals("foo.bar", desc.getId());
- assertEquals("foo.bar", desc.getName());
- final TagLibraryReference[] tlRefs = desc.getTagLibraryReferences();
- assertNotNull(tlRefs);
- assertEquals(4, tlRefs.length);
- assertEquals("c", tlRefs[0].getPrefix());
- assertEquals("java", tlRefs[1].getPrefix());
- assertEquals("f", tlRefs[2].getPrefix());
- assertEquals("ws", tlRefs[3].getPrefix());
- assertEquals("org.eclipse.jet.controlTags", tlRefs[0].getTagLibraryId());
- assertEquals("org.eclipse.jet.javaTags", tlRefs[1].getTagLibraryId());
- assertEquals("org.eclipse.jet.formatTags", tlRefs[2].getTagLibraryId());
- assertEquals("org.eclipse.jet.workspaceTags", tlRefs[3].getTagLibraryId());
- assertTrue(tlRefs[0].isAutoImport());
- assertTrue(tlRefs[1].isAutoImport());
- assertTrue(tlRefs[2].isAutoImport());
- assertFalse(tlRefs[3].isAutoImport());
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java
deleted file mode 100644
index 0eaf172..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleJarUtil.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.eclipse.jet.tests.runtime;
-
-import org.eclipse.jet.internal.runtime.BundleJarInfo;
-
-import junit.framework.TestCase;
-
-public class TestBundleJarUtil extends TestCase {
-
- private BundleJarInfo complexBJU;
- private BundleJarInfo simpleBJU;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- complexBJU = BundleJarInfo.createBundleJarInfo("a.b.c_1.2.3.x_yz_4.5.6.a_b_c.jar");
- simpleBJU = BundleJarInfo.createBundleJarInfo("a.b.c_1.2.3.jar");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetBundleSymbolicName_complex() {
- assertEquals("a.b.c_1.2.3.x_yz", complexBJU.getBundleSymbolicName());
- }
-
- public void testGetVersion_complex() {
- assertEquals("4.5.6.a_b_c", complexBJU.getVersion());
- }
-
- public void testGetJarName_complex() {
- assertEquals("a.b.c_1.2.3.x_yz_4.5.6.a_b_c.jar", complexBJU.getJarName());
- }
-
- public void testGetBundleSymbolicName_simple() {
- assertEquals("a.b.c", simpleBJU.getBundleSymbolicName());
- }
-
- public void testGetVersion_simple() {
- assertEquals("1.2.3", simpleBJU.getVersion());
- }
-
- public void testGetJarName_simple() {
- assertEquals("a.b.c_1.2.3.jar", simpleBJU.getJarName());
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleLoading.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleLoading.java
deleted file mode 100644
index c333464..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestBundleLoading.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.jet.tests.runtime;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2TemplateLoader;
-import org.eclipse.jet.taglib.TagLibraryReference;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-import org.eclipse.jet.transform.IJETBundleManager;
-import org.eclipse.jet.transform.IJETRunnable;
-
-public class TestBundleLoading extends TestCase {
-
- public void testLoadSimpleBundle() throws Exception {
- final IJETBundleManager bundleManager = JET2Platform.getJETBundleManager();
- final boolean[] executed = new boolean[1];
- executed[0] = false;
- bundleManager.run("org.eclipse.jet.transforms.newproject", new IJETRunnable() {
-
- public void run(IJETBundleDescriptor descriptor, JET2TemplateLoader templateLoader, IProgressMonitor monitor) {
- executed[0] = true;
- final JET2Template template = templateLoader.getTemplate(descriptor.getMainTemplate());
- assertNotNull(template);
-
- }}, new NullProgressMonitor());
-
- assertTrue("executed", executed[0]);
- }
-
- public void testGetBundles() throws Exception {
- String projectName = getClass().getName() + ".testGetBundles";
- String source = "<newProjectModel><project name=\"" + projectName
- + "\"/></newProjectModel>";
- JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject", source,
- new NullProgressMonitor());
-
- IJETBundleManager mgr = JET2Platform.getJETBundleManager();
-
- final IJETBundleDescriptor[] all = mgr.getAllJETBundleDescriptors();
- assertNotNull(all);
- assertTrue(all.length > 0);
-
- IJETBundleDescriptor myDescriptor = null;
- for (int i = 0; i < all.length; i++) {
- if (all[i].getId().equals(projectName)) {
- myDescriptor = all[i];
- break;
- }
- }
- assertNotNull(myDescriptor);
- assertEquals(projectName, myDescriptor.getId());
- }
-
- public void testGetDescriptionForProject() {
- String projectName = getClass().getName() + ".getDescriptionForProject";
- String source = "<newProjectModel><project name=\"" + projectName
- + "\"/></newProjectModel>";
- JET2Platform.runTransformOnString(
- "org.eclipse.jet.transforms.newproject", source,
- new NullProgressMonitor());
- IJETBundleManager mgr = JET2Platform.getJETBundleManager();
- final IJETBundleDescriptor descriptor = mgr
- .getDescriptorForProject(projectName);
- assertNotNull(descriptor);
- final TagLibraryReference[] tlrefs = descriptor
- .getTagLibraryReferences();
- assertEquals(4, tlrefs.length);
- assertEquals("c", tlrefs[0].getPrefix());
- assertEquals("java", tlrefs[1].getPrefix());
- assertEquals("f", tlrefs[2].getPrefix());
- assertEquals("ws", tlrefs[3].getPrefix());
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java
deleted file mode 100644
index d532460..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.runtime;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.internal.runtime.DirectoryBundleProvider;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-
-/**
- * @author pelder
- *
- */
-public class TestDirectoryBundleProvider extends TestCase {
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetAllJETBundleIds() throws Exception {
- // FIXME: Tests are specific to one development environment/machine
- DirectoryBundleProvider dbp = new DirectoryBundleProvider("c:/temp/plugins");
-
- final Set ids = dbp.getAllJETBundleIds();
-
-// assertEquals(1, ids.size());
- assertTrue("contains gp02.generator.pattern", ids.contains("gp02.generator.pattern"));
- assertFalse("does not contain org.eclipse.jet.doc", ids.contains("org.eclipse.jet.doc"));
- }
-
- public void testGetDescriptor() throws Exception {
- // FIXME: Tests are specific to one development environment/machine
- DirectoryBundleProvider dbp = new DirectoryBundleProvider("c:/temp/plugins");
-
- final IJETBundleDescriptor descriptor = dbp.getDescriptor("gp02.generator.pattern");
- assertNotNull("Descriptor", descriptor);
- assertEquals("gp02.generator.pattern", descriptor.getId());
- }
-
- public void testGetAllJETBundleDescriptors() throws Exception {
- // FIXME: Tests are specific to one development environment/machine
- DirectoryBundleProvider dbp = new DirectoryBundleProvider("c:/temp/plugins");
-
- final Collection col = dbp.getAllJETBundleDescriptors();
-
- for (Iterator i = col.iterator(); i.hasNext();) {
- IJETBundleDescriptor descriptor = (IJETBundleDescriptor) i.next();
- if(descriptor.getId().equals("gp02.generator.pattern")) {
- return;
- }
- }
- fail("gp02.generator.pattern not found");
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/AllTests.java
deleted file mode 100644
index 21f8f54..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/AllTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jet.tests.taglib;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.jet.tests.taglib");
- //$JUnit-BEGIN$
- suite.addTestSuite(TagLibraryDataFactoryTests.class);
- suite.addTestSuite(TestTagLibManager.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TagLibraryDataFactoryTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TagLibraryDataFactoryTests.java
deleted file mode 100644
index 3fe82d9..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TagLibraryDataFactoryTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.jet.tests.taglib;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jet.internal.JETActivatorWrapper;
-import org.eclipse.jet.internal.extensionpoints.TagLibraryDataFactory;
-import org.eclipse.jet.taglib.TagAttributeDefinition;
-import org.eclipse.jet.taglib.TagDefinition;
-import org.eclipse.jet.taglib.TagLibrary;
-
-public class TagLibraryDataFactoryTests extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jet.internal.extensionpoints.TagLibraryDataFactory.createTagLibrary(String, IConfigurationElement)'
- */
- public void testCreateTagLibraryStringIConfigurationElement() {
-
- final TagLibrary tagLibrary = getControlTagLibrary();
-
- assertNotNull("TagLibrary instance", tagLibrary);
- assertEquals("c", tagLibrary.getDefaultPrefix());
- assertEquals("org.eclipse.jet.controlTags", tagLibrary.getLibraryId());
- assertTrue("<c:get> found", tagLibrary.hasTag("get"));
- }
-
- /**
- * @return
- * @throws InvalidRegistryObjectException
- */
- private TagLibrary getControlTagLibrary() throws InvalidRegistryObjectException {
- IConfigurationElement element = null;
- final IExtension[] extensions = Platform.getExtensionRegistry().getExtensions("org.eclipse.jet");
- for (int i = 0; i < extensions.length; i++) {
- if("org.eclipse.jet.tagLibraries".equals(extensions[i].getExtensionPointUniqueIdentifier())) {
- element = extensions[i].getConfigurationElements()[0]; // the first tag library
- }
- }
- assertNotNull("Setup failure", element);
- final TagLibrary tagLibrary = TagLibraryDataFactory.INSTANCE.createTagLibrary("org.eclipse.jet", element);
- return tagLibrary;
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.extensionpoints.TagLibraryDataFactory.createTagLibraries(String, Object)'
- */
- public void testCreateTagLibraries() throws Exception {
- final TagLibrary tagLibrary = getControlTagLibrary();
-
- URL pluginURL = new URL("platform:/plugin/org.eclipse.jet/plugin.xml");
- Object pluginDocRoot = JETActivatorWrapper.INSTANCE.getLoaderManager().getLoader(pluginURL.toExternalForm(), null, null).load(pluginURL);
- assertNotNull("setup failure: doc root is null", pluginDocRoot);
-
- final TagLibrary[] libraries = TagLibraryDataFactory.INSTANCE.createTagLibraries("org.eclipse.jet", pluginDocRoot);
- assertNotNull("libraries not null", libraries);
- assertTrue("libraries.length > 0", libraries.length > 0);
-
- assertEquals(tagLibrary.getDefaultPrefix(), libraries[0].getDefaultPrefix());
- assertEquals(tagLibrary.getLibraryId(), libraries[0].getLibraryId());
- assertEquals(tagLibrary.getLibraryName(), libraries[0].getLibraryName());
- final String[] tagNames = tagLibrary.getTagNames();
- assertEquals(tagNames.length, libraries[0].getTagNames().length);
-
- for (int i = 0; i < tagNames.length; i++) {
- TagDefinition xtd = tagLibrary.getTagDefinition(tagNames[i]);
- TagDefinition ptd = libraries[0].getTagDefinition(tagNames[i]);
- assertNotNull(tagNames[i] + ": xtd", xtd);
- assertNotNull(tagNames[i] + ": ptd", ptd);
- assertEquals(tagNames[i], xtd.isContentAllowed(), ptd.isContentAllowed());
- assertEquals(tagNames[i], xtd.isDeprecated(), ptd.isDeprecated());
- assertEquals(tagNames[i], xtd.isEmptyTagAllowed(), ptd.isEmptyTagAllowed());
- assertEquals(tagNames[i], xtd.removeWhenContainingLineIsEmpty(), ptd.removeWhenContainingLineIsEmpty());
- assertEquals(tagNames[i], xtd.requiresNewWriter(), ptd.requiresNewWriter());
- assertEquals(tagNames[i], xtd.getDescription(), ptd.getDescription());
- assertEquals(tagNames[i], xtd.getKind(), ptd.getKind());
- assertEquals(tagNames[i], xtd.getName(), ptd.getName());
-
- final List xtdAttrs = xtd.getAttributeDefinitions();
- final List ptdAttrs = ptd.getAttributeDefinitions();
- assertNotNull(tagNames[i] + ": xtdAttrs", xtdAttrs);
- assertNotNull(tagNames[i] + ": ptdAttrs", ptdAttrs);
- assertEquals(xtdAttrs.size(), ptdAttrs.size());
-
- for (Iterator j = xtdAttrs.iterator(), k = ptdAttrs.iterator(); j.hasNext();) {
- TagAttributeDefinition xtad = (TagAttributeDefinition) j.next();
- TagAttributeDefinition ptad = (TagAttributeDefinition) k.next();
- final String attrName = xtad.getName();
- assertEquals(tagNames[i], attrName, ptad.getName());
- assertEquals(tagNames[i] + ":" + attrName, xtad.getDescription(), ptad.getDescription());
- assertEquals(tagNames[i] + ":" + attrName, xtad.isDeprecated(), ptad.isDeprecated());
- assertEquals(tagNames[i] + ":" + attrName, xtad.isRequired(), ptad.isRequired());
- assertEquals(tagNames[i] + ":" + attrName, xtad.getType(), ptad.getType());
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TestTagLibManager.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TestTagLibManager.java
deleted file mode 100644
index b118c60..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/TestTagLibManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.jet.tests.taglib;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.internal.taglib.InternalTagLibManager;
-import org.eclipse.jet.taglib.TagLibrary;
-
-public class TestTagLibManager extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.InternalTagLibManager.getTagLibrary(String)'
- */
- public void testGetTagLibrary() {
- InternalTagLibManager manager = new InternalTagLibManager();
- manager.startup();
- try {
- String libraryId = "org.eclipse.jet.tests.TestLibrary";
- TagLibrary tagLibrary = manager.getTagLibrary(libraryId);
- assertNotNull(tagLibrary);
- assertEquals(libraryId, tagLibrary.getLibraryId());
- } finally {
- manager.shutdown();
- }
- }
-
- public void testGetTagLibrary_invalidId() {
- InternalTagLibManager manager = new InternalTagLibManager();
- manager.startup();
- try {
- String libraryId = "org.eclipse.jet.tests.TestLibrary-invalid";
- TagLibrary tagLibrary = manager.getTagLibrary(libraryId);
- assertNull(tagLibrary);
- } finally {
- manager.shutdown();
- }
- }
-
- public void testTagLibrary_getTagsNames() {
- InternalTagLibManager manager = new InternalTagLibManager();
- manager.startup();
- try {
- String libraryId = "org.eclipse.jet.tests.TestLibrary";
- String[] expectedTagNames = new String[] {
- "isAllUpper", "nl", "other", "tokenize", "upper",
- };
- TagLibrary tagLibrary = manager.getTagLibrary(libraryId);
- assertNotNull(tagLibrary);
- String[] tagNames = tagLibrary.getTagNames();
- assertEquals(5, tagNames.length);
- for (int i = 0; i < tagNames.length; i++) {
- assertEquals(expectedTagNames[i], tagNames[i]);
- }
- } finally {
- manager.shutdown();
- }
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/AllTests.java
deleted file mode 100644
index f426e2c..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/AllTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jet.tests.taglib.control;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.taglib.control");
- //$JUnit-BEGIN$
- suite.addTestSuite(LoadTagTests.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/LoadTagTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/LoadTagTests.java
deleted file mode 100644
index fe941f8..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/control/LoadTagTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.jet.tests.taglib.control;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.BufferedJET2Writer;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.XPathContextExtender;
-import org.eclipse.jet.internal.taglib.control.LoadTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInfo;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-import org.eclipse.jet.transform.TransformContextExtender;
-
-public class LoadTagTests extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.control.LoadTag.doAction(TagInfo, JET2Context, JET2Writer)'
- */
- public void testDoAction() throws JET2TagException, CoreException {
-
- final String id = "org.eclipse.jet.transforms.newproject";
- JET2Context context = new JET2Context((Object)null);
- TransformContextExtender tce = new TransformContextExtender(context);
-
- final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(id);
- tce.setBundleDescriptor(descriptor);
-
- LoadTag tag = new LoadTag();
- TagInfo td = new TagInfo("", 1, 1,
- new String[] { "url", "var", "type" },
- new String[] { "templates/project/sample.xml.jet", "root", "xml" });
- tag.setTagInfo(td);
- tag.setContext(context);
- tag.setParent(null);
-
- BufferedJET2Writer out = new BodyContentWriter();
-
- tag.doAction(td, context, out);
-
- assertEquals("", out.getContent());
- final Object loadedDocument = XPathContextExtender.getInstance(context).resolveVariable("root");
- assertNotNull("loaded document", loadedDocument);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/AllTests.java
deleted file mode 100644
index 055c1af..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/AllTests.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.jet.tests.taglib.format;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.taglib.format");
- //$JUnit-BEGIN$
- suite.addTestSuite(UuidTagTests.class);
- suite.addTestSuite(LowerCaseTagTests.class);
- suite.addTestSuite(FormatNowTagTests.class);
- suite.addTestSuite(UpperCaseTagTests.class);
- suite.addTestSuite(FormatContextExtenderTests.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatContextExtenderTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatContextExtenderTests.java
deleted file mode 100644
index cb3ce9c..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatContextExtenderTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.jet.tests.taglib.format;
-
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.internal.taglib.format.FormatContextExtender;
-
-import junit.framework.TestCase;
-
-public class FormatContextExtenderTests extends TestCase {
-
- private FormatContextExtender fce;
-
- protected void setUp() throws Exception {
- super.setUp();
- fce = FormatContextExtender.getInstance(new JET2Context(null));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.FormatContextExtender.getMilliseconds()'
- */
- public void testGetMilliseconds() {
- final long ms1 = fce.getMilliseconds();
- assertTrue("positive", ms1 > 0);
- final long ms2 = fce.getMilliseconds();
- assertTrue(ms2 > ms1);
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.FormatContextExtender.getUnique()'
- */
- public void testGetUnique() {
- final int unique1 = fce.getUnique();
- assertEquals(1, unique1);
- final int unique2 = fce.getUnique();
- assertEquals(unique1 + 1, unique2);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatNowTagTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatNowTagTests.java
deleted file mode 100644
index 1bee89d..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/FormatNowTagTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.jet.tests.taglib.format;
-
-import java.util.Calendar;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.BufferedJET2Writer;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.internal.taglib.format.FormatNowTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class FormatNowTagTests extends TestCase {
-
- private BufferedJET2Writer out;
- private FormatNowTag tag;
- private TagInfo tagInfo;
- private JET2Context context;
-
- protected void setUp() throws Exception {
- super.setUp();
- this.out = new BodyContentWriter();
- this.tag = new FormatNowTag();
- context = new JET2Context(null);
- tag.setContext(context);
- tag.setOut(out);
- tag.setParent(null);
- tagInfo = new TagInfo("f:formatNow", 1, 1,
- new String[] {
- "pattern"
- },
- new String[] {
- "yyyy.MM.dd.HH.mm"
- });
- tag.setTagInfo(tagInfo);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.FormatNowTag.doAction(TagInfo, JET2Context, JET2Writer)'
- */
- public void testDoAction() throws JET2TagException {
- final Calendar now = Calendar.getInstance();
- tag.doAction(tagInfo, context, out);
-
- String formatted = out.getContent();
- final String[] parts = formatted.split("\\.");
- assertNotNull(parts);
- assertEquals(5, parts.length);
- assertEquals(now.get(Calendar.YEAR), Integer.parseInt(parts[0]));
- assertEquals(now.get(Calendar.MONTH) + 1, Integer.parseInt(parts[1]));
- assertEquals(now.get(Calendar.DAY_OF_MONTH), Integer.parseInt(parts[2]));
- assertEquals(now.get(Calendar.HOUR_OF_DAY), Integer.parseInt(parts[3]));
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/LowerCaseTagTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/LowerCaseTagTests.java
deleted file mode 100644
index 24226fc..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/LowerCaseTagTests.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.eclipse.jet.tests.taglib.format;
-
-import java.text.MessageFormat;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.internal.l10n.JET2Messages;
-import org.eclipse.jet.internal.taglib.format.LowerCaseTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class LowerCaseTagTests extends TestCase {
-
- private BodyContentWriter out;
- private LowerCaseTag lowerCaseTag;
- private JET2Context context;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- out = new BodyContentWriter();
- lowerCaseTag = new LowerCaseTag();
- lowerCaseTag.setParent(null);
- lowerCaseTag.setOut(out);
- context = new JET2Context(null);
- lowerCaseTag.setContext(context);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_noAttrs() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {}, new String[] {});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("test", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset"}, new String[] {"1"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("Test", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_tooBigOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset"}, new String[] {"5"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("TEST", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_negativeOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset"}, new String[] {"-1"});
- lowerCaseTag.setTagInfo(tagInfo);
-
-
- try {
- lowerCaseTag.doFunction(tagInfo, context, "TEST");
- fail("Excepted JET2TagException");
- } catch (JET2TagException e) {
- String expected = MessageFormat.format(JET2Messages.AnyTag_AttributeMustBeInteger, new Object[] {"offset"});
- assertEquals(expected, e.getMessage());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_negativeLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"length"}, new String[] {"-1"});
- lowerCaseTag.setTagInfo(tagInfo);
-
-
- try {
- lowerCaseTag.doFunction(tagInfo, context, "TEST");
- fail("Excepted JET2TagException");
- } catch (JET2TagException e) {
- String expected = MessageFormat.format(JET2Messages.AnyTag_AttributeMustBeInteger, new Object[] {"length"});
- assertEquals(expected, e.getMessage());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_zeroOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset"}, new String[] {"0"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("test", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"length"}, new String[] {"2"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("teST", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_tooBigLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"length"}, new String[] {"5"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("test", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_zeroLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"length"}, new String[] {"0"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("TEST", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_validLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset", "length"}, new String[] {"1", "2"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("TesT", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_validLength_rearBoundary() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset", "length"}, new String[] {"3", "1"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("TESt", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_validLength_frontBoundary() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset", "length"}, new String[] {"0", "1"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("tEST", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_tooBigLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset", "length"}, new String[] {"1", "4"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("Test", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_tooBigOffset_tooBigLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:lc", 1, 1, new String[] {"offset", "length"}, new String[] {"4", "4"});
- lowerCaseTag.setTagInfo(tagInfo);
-
- final String result = lowerCaseTag.doFunction(tagInfo, context, "TEST");
-
- assertEquals("TEST", result);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UpperCaseTagTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UpperCaseTagTests.java
deleted file mode 100644
index f34c34c..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UpperCaseTagTests.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.eclipse.jet.tests.taglib.format;
-
-import java.text.MessageFormat;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.internal.l10n.JET2Messages;
-import org.eclipse.jet.internal.taglib.format.UpperCaseTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class UpperCaseTagTests extends TestCase {
-
- private BodyContentWriter out;
- private UpperCaseTag upperCaseTag;
- private JET2Context context;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- out = new BodyContentWriter();
- upperCaseTag = new UpperCaseTag();
- upperCaseTag.setParent(null);
- upperCaseTag.setOut(out);
- context = new JET2Context(null);
- upperCaseTag.setContext(context);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_noAttrs() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {}, new String[] {});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("DATA", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset"}, new String[] {"1"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("dATA", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_tooBigOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset"}, new String[] {"5"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("data", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_negativeOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset"}, new String[] {"-1"});
- upperCaseTag.setTagInfo(tagInfo);
-
-
- try {
- upperCaseTag.doFunction(tagInfo, context, "data");
- fail("Excepted JET2TagException");
- } catch (JET2TagException e) {
- String expected = MessageFormat.format(JET2Messages.AnyTag_AttributeMustBeInteger, new Object[] {"offset"});
- assertEquals(expected, e.getMessage());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_negativeLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"length"}, new String[] {"-1"});
- upperCaseTag.setTagInfo(tagInfo);
-
-
- try {
- upperCaseTag.doFunction(tagInfo, context, "data");
- fail("Excepted JET2TagException");
- } catch (JET2TagException e) {
- String expected = MessageFormat.format(JET2Messages.AnyTag_AttributeMustBeInteger, new Object[] {"length"});
- assertEquals(expected, e.getMessage());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_zeroOffset() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset"}, new String[] {"0"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("DATA", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"length"}, new String[] {"2"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("DAta", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_tooBigLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"length"}, new String[] {"5"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("DATA", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_zeroLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"length"}, new String[] {"0"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("data", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_validLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset", "length"}, new String[] {"1", "2"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("dATa", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_validLength_rearBoundary() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset", "length"}, new String[] {"3", "1"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("datA", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_validLength_frontBoundary() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset", "length"}, new String[] {"0", "1"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("Data", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_validOffset_tooBigLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset", "length"}, new String[] {"1", "4"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("dATA", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.LowerCaseTag.doFunction(TagInfo, JET2Context, String)'
- */
- public void testDoFunction_tooBigOffset_tooBigLength() throws JET2TagException {
- final TagInfo tagInfo = new TagInfo("f:uc", 1, 1, new String[] {"offset", "length"}, new String[] {"4", "4"});
- upperCaseTag.setTagInfo(tagInfo);
-
- final String result = upperCaseTag.doFunction(tagInfo, context, "data");
-
- assertEquals("data", result);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UuidTagTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UuidTagTests.java
deleted file mode 100644
index 5c6b7de..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/format/UuidTagTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.eclipse.jet.tests.taglib.format;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.BufferedJET2Writer;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.internal.taglib.format.UuidTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInfo;
-
-public class UuidTagTests extends TestCase {
-
- private BufferedJET2Writer out;
- private UuidTag tag;
- private TagInfo tagInfo;
- private JET2Context context;
-
- protected void setUp() throws Exception {
- super.setUp();
- this.out = new BodyContentWriter();
- this.tag = new UuidTag();
- context = new JET2Context(null);
- tag.setContext(context);
- tag.setOut(out);
- tag.setParent(null);
- tagInfo = new TagInfo("f:uuid", 1, 1, new String[0], new String[0]);
- tag.setTagInfo(tagInfo);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.format.UuidTag.doAction(TagInfo, JET2Context, JET2Writer)'
- */
- public void testDoAction() throws JET2TagException {
- tag.doAction(tagInfo, context, out);
-
- String uuid1 = out.getContent();
-
- assertNotNull(uuid1);
- assertEquals(23, uuid1.length()); // all UUIDs returned by this tag are 23 chars
- out.setContent("");
-
- tag.doAction(tagInfo, context, out);
- String uuid2 = out.getContent();
- assertNotNull(uuid2);
- assertEquals(23, uuid2.length()); // all UUIDs returned by this tag are 23 chars
-
- assertTrue("uuid1 != uuid2", !uuid1.equals(uuid2));
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/AllTests.java
deleted file mode 100644
index 7cf8f7e..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/AllTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jet.tests.taglib.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.taglib.java");
- //$JUnit-BEGIN$
- suite.addTestSuite(TestImportsLocationTag.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java
deleted file mode 100644
index 4304f79..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/JavaActionsUtilTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.taglib.java;
-
-import junit.framework.TestCase;
-
-/**
- * @author pelder
- *
- */
-public class JavaActionsUtilTests extends TestCase {
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#getContainerForPackage(org.eclipse.core.runtime.IPath, java.lang.String)}.
- */
- public void testGetContainerForPackage() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#getImportManager(org.eclipse.jet.JET2Writer)}.
- */
- public void testGetImportManager() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#findContainingJavaPackageTag(org.eclipse.jet.taglib.CustomTag)}.
- */
- public void testFindContainingJavaPackageTag() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.java.JavaActionsUtil#getResourceForJavaResource(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)}.
- */
- public void testGetResourceForJavaResource() {
- fail("Not yet implemented");
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/TestImportsLocationTag.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/TestImportsLocationTag.java
deleted file mode 100644
index 88dd382..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/java/TestImportsLocationTag.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package org.eclipse.jet.tests.taglib.java;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.codegen.util.ImportManager;
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.BufferedJET2Writer;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.internal.taglib.java.ImportsLocationTag;
-import org.eclipse.jet.taglib.JET2TagException;
-import org.eclipse.jet.taglib.TagInfo;
-import org.eclipse.jet.taglib.java.JavaActionsUtil;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-
-public class TestImportsLocationTag extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.java.ImportsLocationTag.doAction(TagInfo, JET2Context, JET2Writer)'
- */
- public void testDoAction() throws JET2TagException, BadPositionCategoryException {
- JET2Context context = new JET2Context(null);
- BufferedJET2Writer writer = new BodyContentWriter();
-
- TagInfo td = new TagInfo("java:importsLocation", 1, 1,
- new String[] {"package"},
- new String[] {"foo.bar.test"});
-
- ImportsLocationTag tag = createImportsLocationTag(context, writer, td);
-
- tag.doAction(td, context, writer);
-
- verifyImportManagerInstalled(writer);
- }
-
- /**
- * @param context
- * @param writer
- * @param td
- * @return
- */
- private ImportsLocationTag createImportsLocationTag(JET2Context context, JET2Writer writer, TagInfo td) {
- ImportsLocationTag tag = new ImportsLocationTag();
-
- tag.setContext(context);
- tag.setParent(null);
- tag.setTagInfo(td);
- tag.setOut(writer);
- return tag;
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.taglib.java.ImportsLocationTag.doAction(TagInfo, JET2Context, JET2Writer)'
- */
- public void testDoAction_multipleTimes() throws JET2TagException, BadPositionCategoryException {
- JET2Context context = new JET2Context(null);
- BufferedJET2Writer writer = new BodyContentWriter();
-
- TagInfo td = new TagInfo("java:importsLocation", 1, 1,
- new String[] {"package"},
- new String[] {"foo.bar.test"});
-
- TagInfo td2 = new TagInfo("java:importsLocation", 2, 1,
- new String[] {"package"},
- new String[] {"foo.bar.test2"});
-
- ImportsLocationTag tag = createImportsLocationTag(context, writer, td);
-
- ImportsLocationTag tag2 = createImportsLocationTag(context, writer, td2);
-
- tag.doAction(td, context, writer);
-
- try {
- tag2.doAction(td2, context, writer);
- fail("Second doAction on same file should have thrown JET2TagException");
- } catch(JET2TagException e) {
- // success
- }
-
- verifyImportManagerInstalled(writer);
- }
-
- /**
- * @param writer
- * @throws BadPositionCategoryException
- */
- private ImportManager verifyImportManagerInstalled(BufferedJET2Writer writer) throws BadPositionCategoryException {
- final IDocument document = (IDocument) writer.getAdapter(IDocument.class);
- final Position[] positions = document.getPositions(ImportsLocationTag.IMPORTS_POSITION_CATEGORY);
- assertTrue("positions.length == 1", positions.length == 1);
- assertTrue("positions[0] instanceof ImportsLocationTag.ImportsPosition", positions[0] instanceof ImportsLocationTag.ImportsPosition);
-
- ImportManager mgr = ((ImportsLocationTag.ImportsPosition)positions[0]).getImportManager();
-
- assertNotNull(mgr);
- return mgr;
- }
-
- public void testJavaImportsUtil() throws JET2TagException, BadPositionCategoryException {
- // setup an imports tag...
- JET2Context context = new JET2Context(null);
- BufferedJET2Writer writer = new BodyContentWriter();
-
- TagInfo td = new TagInfo("java:importsLocation", 1, 1,
- new String[] {"package"},
- new String[] {"foo.bar.test"});
-
- final ImportsLocationTag tag = createImportsLocationTag(context, writer, td);
- tag.doAction(td, context, writer);
- final ImportManager tagInstalledMananger = verifyImportManagerInstalled(writer);
-
- // Test: get the installed imports tag the public way...
- final ImportManager importManager = JavaActionsUtil.getImportManager(writer);
-
- // Verify
- assertEquals(tagInstalledMananger, importManager);
-
-
- }
-
- public void testJavaImportsUtil_NotInstalled() {
- // setup empty writer...
- JET2Writer writer = new BodyContentWriter();
-
- // Test: get the installed imports tag the public way...
- try {
- JavaActionsUtil.getImportManager(writer);
- fail("Expected thrown JET2TagException");
- } catch(JET2TagException e) {
- // success
- }
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java
deleted file mode 100644
index f5553f6..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/ActionsUtilTests.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.taglib.workspace;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.taglib.workspace.ActionsUtil;
-
-/**
- * JUnit tests for {@link ActionsUtil}.
- *
- */
-public class ActionsUtilTests extends TestCase {
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
- * @throws Exception
- */
- public void testReadTextFile_Manifest_MF() throws Exception {
- URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/MANIFEST.MF");
- final String correctText = ActionsUtil.readTextFile(url, "UTF-8");
-
- final String rawText = ActionsUtil.readTextFile(url, null);
-
- assertTrue("raw text", rawText.startsWith("Manifest-Version: 1.0"));
- assertTrue("correct text", correctText.startsWith("Manifest-Version: 1.0"));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
- * @throws Exception
- */
- public void testReadTextFile_utf8_no_bom_xml() throws Exception {
- URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_no_bom.xml");
- final String correctText = ActionsUtil.readTextFile(url, "UTF-8");
-
- final String rawText = ActionsUtil.readTextFile(url, null);
-
- assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
- assertTrue("raw text", rawText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
- * @throws Exception
- */
- public void testReadTextFile_utf8_bom_xml() throws Exception {
- URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf8_bom.xml");
- final String correctText = ActionsUtil.readTextFile(url, "UTF-8");
-
- final String rawText = ActionsUtil.readTextFile(url, null);
-
- assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
- // disable raw format check - fails on Linux for unknown reasons
-// assertTrue("raw text", rawText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
- * @throws Exception
- */
- public void testReadTextFile_utf16_le_xml() throws Exception {
- URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16le.xml");
- final String correctText = ActionsUtil.readTextFile(url, "UTF-16");
-
-
- assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-16\"?>"));
- // XXX: Should verify presence of BOM by reading byte stream directly.
-// final String rawText = ActionsUtil.readTextFile(url, null);
-// assertTrue("raw text", rawText.startsWith("\u00FF\u00FE")); // Little Endian BOM is FF FE
- }
-
- /**
- * Test method for {@link org.eclipse.jet.taglib.workspace.ActionsUtil#readTextFile(java.net.URL, java.lang.String)}.
- * @throws Exception
- */
- public void testReadTextFile_utf16_be_xml() throws Exception {
- URL url = new URL("platform:/plugin/org.eclipse.jet.tests/data/ActionsUtil/sample_utf16be.xml");
- final String correctText = ActionsUtil.readTextFile(url, "UTF-16");
-
- assertTrue("correct text", correctText.startsWith("<?xml version=\"1.0\" encoding=\"UTF-16\"?>"));
- // XXX: Should verify presence of BOM by reading byte stream directly.
-// final String rawText = ActionsUtil.readTextFile(url, null);
-// assertTrue("raw text", rawText.startsWith("\u00FE\u00FF")); // big endian BOM is FE FF
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java
deleted file mode 100644
index 1088325..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/taglib/workspace/AllTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jet.tests.taglib.workspace;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test for org.eclipse.jet.tests.taglib.workspace");
- //$JUnit-BEGIN$
- suite.addTestSuite(ActionsUtilTests.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AbstractExprTest.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AbstractExprTest.java
deleted file mode 100644
index 92a2cd4..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AbstractExprTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.xpath;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import junit.framework.TestCase;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * @author pelder
- *
- */
-public abstract class AbstractExprTest extends TestCase{
-
- protected Document document;
- protected static final String EXPECTED_ATTR_TEXT = "test";
- protected static final String EXPECTED_COMMENT_TEXT = " a comment within root ";
- protected static final String EXPECTED_PI_TEXT = "version=\"3.0\"";
- protected static final String EXPECTED_B_TEXT = "Some foo text.";
- protected static final String EXPECTED_A_TEXT = "\n\t\t" + EXPECTED_B_TEXT + "\n\t";
- protected static final String EXPECTED_OTHER_A_TEXT = "\n\t\t" + "Some bar text." + "\n\t";
- protected static final String EXPECTED_OTHER_B_TEXT = "Some bar text.";
- protected static final String EXPECTED_DOC_TEXT = "\n\t" + "\n\t" + EXPECTED_A_TEXT
- + "\n\t" + EXPECTED_OTHER_A_TEXT + "\n";
-
- private void loadDocument() {
- InputStream inputStream = null;
- try {
- URL dataURL = new URL(
- "platform:/plugin/org.eclipse.jet.tests/data/DOMInspector.xml");
- inputStream = dataURL.openStream();
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
-
- document = builder.parse(inputStream, "UTF-8");
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (ParserConfigurationException e) {
- throw new RuntimeException(e);
- } catch (SAXException e) {
- throw new RuntimeException(e);
- } finally {
- if (inputStream != null) {
- try {
- inputStream.close();
- } catch (IOException e) {
- // do nothing
- }
- }
- }
- }
-
- protected Element rootElement;
- protected Element elementA;
- protected Element elementB;
- protected Attr attr;
- protected Node bText;
- protected Node pi;
- protected Node comment;
-
- /**
- *
- */
- public AbstractExprTest() {
- super();
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- loadDocument();
- rootElement = document.getDocumentElement();
- elementA = (Element) rootElement.getElementsByTagName("a").item(0);
- elementB = (Element) elementA.getElementsByTagName("b").item(0);
- bText = elementB.getFirstChild();
- attr = rootElement.getAttributeNode("rootAttr");
- pi = document.getFirstChild();
- comment = rootElement.getFirstChild().getNextSibling();
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java
deleted file mode 100644
index f41f8d9..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AllTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.jet.tests.xpath");
- //$JUnit-BEGIN$
- suite.addTestSuite(EMFResourceInspectorTests.class);
- suite.addTestSuite(AncestorTests.class);
- suite.addTestSuite(RelOpTests.class);
- suite.addTestSuite(LogicalOpTests.class);
- suite.addTestSuite(XPathTokenScannerTests.class);
- suite.addTestSuite(BooleanFunctionTests.class);
- suite.addTestSuite(XPathOverDOMTests.class);
- suite.addTest(ResourceAttributeInspectorTests.suite());
- suite.addTestSuite(PrecedingTests.class);
- suite.addTestSuite(FollowingSiblingTests.class);
- suite.addTestSuite(XPathParserDefects.class);
- suite.addTestSuite(EObjectInspectorTests.class);
- suite.addTest(ResourceInspectorTests.suite());
- suite.addTestSuite(XPathOverEcoreTests.class);
- suite.addTestSuite(XPathInspectorManagerTests.class);
- suite.addTestSuite(NumberFunctionTests.class);
- suite.addTestSuite(BuiltinStringFunctionsTests.class);
- suite.addTestSuite(EStructuralFeatureSettingTests.class);
- suite.addTestSuite(XPathOverEmfXmlXsdTests.class);
- suite.addTestSuite(AncestorOrSelfTests.class);
- suite.addTestSuite(NumberBinaryOpTests.class);
- suite.addTestSuite(RootTests.class);
- suite.addTestSuite(DOMInspectorTests.class);
- suite.addTestSuite(DescendantTests.class);
- suite.addTestSuite(SelfStepTests.class);
- suite.addTestSuite(DescendantOrSelfTests.class);
- suite.addTestSuite(FollowingTests.class);
- suite.addTestSuite(StringFunctionTests.class);
- suite.addTestSuite(ParentStepTests.class);
- suite.addTestSuite(XPathParserTests.class);
- suite.addTestSuite(ChildStepTests.class);
- suite.addTestSuite(PrecedingSiblingTests.class);
- suite.addTestSuite(VariableTests.class);
- suite.addTestSuite(AttributeStepTests.class);
- suite.addTestSuite(ExpandedNameTests.class);
- //$JUnit-END$
- return suite;
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorOrSelfTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorOrSelfTests.java
deleted file mode 100644
index 86f3786..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorOrSelfTests.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id: AncestorOrSelfTests.java,v 1.1 2008/05/04 23:17:40 pelder Exp $
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-
-/**
- * Test the 'descendant-of-self' axis.
- *
- */
-public class AncestorOrSelfTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_root() {
- Step stepExpr = new Step(
- new ContextNode(),
- Axis.ancestorOrSelf(),
- NodeTest.allNodes());
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertEquals(document, resultSet.iterator().next());
- }
-
- public void testEvalAsNodeSet_rootElement() {
- Step stepExpr = new Step (
- new ContextNode(),
- Axis.ancestorOrSelf(),
- NodeTest.allNodes());
-
- Context context = new Context(rootElement, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(2, resultSet.size());
- Iterator i = resultSet.iterator();
- assertEquals(rootElement, i.next());
- assertEquals(document, i.next());
- }
-
- public void testEvalAsNodeSet_bElement() {
- Step stepExpr = new Step (
- new ContextNode(),
- Axis.ancestorOrSelf(),
- NodeTest.allNodes());
-
- Context context = new Context(this.elementB, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
-// assertEquals(4, resultSet.size());
- Iterator i = resultSet.iterator();
- assertEquals(elementB, i.next());
- assertEquals(elementA, i.next());
- assertEquals(rootElement, i.next());
- assertEquals(document, i.next());
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorTests.java
deleted file mode 100644
index 8d97eac..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AncestorTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id: AncestorTests.java,v 1.1 2008/05/04 23:17:40 pelder Exp $
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-
-/**
- * Test the 'descendant-of-self' axis.
- *
- */
-public class AncestorTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_root() {
- Step stepExpr = new Step(
- new ContextNode(),
- Axis.ancestor(),
- NodeTest.allNodes());
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(0, resultSet.size());
- }
-
- public void testEvalAsNodeSet_rootElement() {
- Step stepExpr = new Step (
- new ContextNode(),
- Axis.ancestor(),
- NodeTest.allNodes());
-
- Context context = new Context(rootElement, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertEquals(document, resultSet.iterator().next());
- }
-
- public void testEvalAsNodeSet_bElement() {
- Step stepExpr = new Step (
- new ContextNode(),
- Axis.ancestor(),
- NodeTest.allNodes());
-
- Context context = new Context(this.elementB, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
-// assertEquals(3, resultSet.size());
- Iterator i = resultSet.iterator();
- assertEquals(elementA, i.next());
- assertEquals(rootElement, i.next());
- assertEquals(document, i.next());
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AttributeStepTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AttributeStepTests.java
deleted file mode 100644
index 1376a2e..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/AttributeStepTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Root;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-public class AttributeStepTests extends AbstractExprTest {
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Context, INodeInspector)'
- */
- public void testEvalAsNodeSet_attribute_all() {
- Step stepExpr = new Step(
- new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.attributeAxis(),
- NodeTest.nameTest(NodeKind.ATTRIBUTE, new ExpandedName("*"))
- );
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(attr));
-
- }
-
- public void testEvalAsNodeSet_attribute_foo() {
- Step stepExpr = new Step(
- new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.attributeAxis(),
- NodeTest.nameTest(NodeKind.ATTRIBUTE, new ExpandedName("foo"))
- );
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(0, resultSet.size());
-
- }
-
- public void testEvalAsNodeSet_attribute_rootAttr() {
- Step stepExpr = new Step(
- new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.attributeAxis(),
- NodeTest.nameTest(NodeKind.ATTRIBUTE, new ExpandedName("rootAttr"))
- );
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(attr));
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BooleanFunctionTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BooleanFunctionTests.java
deleted file mode 100644
index 6d449d1..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BooleanFunctionTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-
-import org.eclipse.jet.internal.xpath.NodeSetImpl;
-import org.eclipse.jet.internal.xpath.functions.BooleanFunction;
-
-public class BooleanFunctionTests extends AbstractExprTest {
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.functions.BooleanFunction.evaluate(Object)'
- */
- public void testEvaluateObject_String_nonempty() {
- boolean result = BooleanFunction.evaluate("hello");
- assertTrue(result);
- }
- public void testEvaluateObject_String_empty() {
- boolean result = BooleanFunction.evaluate("");
- assertFalse(result);
- }
-
- public void testEvaluateObject_Number_false() {
- boolean result1 = BooleanFunction.evaluate(new Double(Double.NaN));
- assertFalse(result1);
-
- boolean result2 = BooleanFunction.evaluate(new Double(0.0));
- assertFalse(result2);
-
- boolean result3 = BooleanFunction.evaluate(new Double(-0.0));
- assertFalse(result3);
- }
-
- public void testEvaluateObject_Number_true() {
- boolean result1 = BooleanFunction.evaluate(new Double(Double.NEGATIVE_INFINITY));
- assertTrue(result1);
-
- boolean result2 = BooleanFunction.evaluate(new Double(Double.POSITIVE_INFINITY));
- assertTrue(result2);
-
- boolean result3 = BooleanFunction.evaluate(new Double(0.001));
- assertTrue(result3);
-
- boolean result4 = BooleanFunction.evaluate(new Double(-0.01));
- assertTrue(result4);
- }
-
- public void testEvaluateObject_Nodeset() {
- NodeSetImpl ns = new NodeSetImpl();
-
- assertFalse(BooleanFunction.evaluate(ns));
-
- ns.add(elementA);
-
- assertTrue(BooleanFunction.evaluate(ns));
-
- ns.add(elementB);
-
- assertTrue(BooleanFunction.evaluate(ns));
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/Bug130552Workaround.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/Bug130552Workaround.java
deleted file mode 100644
index 9e67977..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/Bug130552Workaround.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-
-/**
- * Utility class to work around Bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=130552">130552</a> in EMF.
- *
- */
-public class Bug130552Workaround {
-
- private Bug130552Workaround() {
- // prevent intantiation
- }
-
- public static FeatureMap.Entry getEntry(FeatureMap fm, int index) {
-
- // this should work, but doesn't:
-// return (FeatureMap.Entry)fm.get(index);
-
- int iWithoutCommentsOrText = 0;
- for (int i = 0; i < fm.size(); i++) {
- FeatureMap.Entry entry = (FeatureMap.Entry) fm.get(i);
- if(entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_CDATA()
- || entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Comment()
- || entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text()) {
- continue;
- }
- if( iWithoutCommentsOrText++ == index) {
- return entry;
- }
-
- }
- throw new IndexOutOfBoundsException();
- }
-
- public static Object getValue(FeatureMap fm, int index) {
- return getEntry(fm, index).getValue();
- }
-
- public static EStructuralFeature getEStructuralFeature(FeatureMap fm, int index) {
- return getEntry(fm, index).getEStructuralFeature();
- }
-
- public static int size(FeatureMap fm) {
- int sizeWithoutCommentsOrText = 0;
- for (int i = 0; i < fm.size(); i++) {
- FeatureMap.Entry entry = (FeatureMap.Entry) fm.get(i);
- if(entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_CDATA()
- || entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Comment()
- || entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text()) {
- continue;
- } else {
- ++sizeWithoutCommentsOrText;
- }
-
- }
- return sizeWithoutCommentsOrText;
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BuiltinStringFunctionsTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BuiltinStringFunctionsTests.java
deleted file mode 100644
index 566151a..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/BuiltinStringFunctionsTests.java
+++ /dev/null
@@ -1,214 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jet.internal.xpath.ast.ExprNode;
-import org.eclipse.jet.internal.xpath.ast.Function;
-import org.eclipse.jet.internal.xpath.ast.NumberLiteral;
-import org.eclipse.jet.internal.xpath.ast.StringLiteral;
-import org.eclipse.jet.internal.xpath.functions.BuiltinXPathFunctionResolver;
-import org.eclipse.jet.xpath.Context;
-
-public class BuiltinStringFunctionsTests extends AbstractExprTest {
-
- public void testConcat() {
- List args = new ArrayList();
- args.add(new StringLiteral("one"));
- args.add(new StringLiteral("two"));
- args.add(new StringLiteral("three"));
- String functionName = "concat";
- Object result = runFunction(functionName, args);
-
- assertTrue(result instanceof String);
- assertEquals("onetwothree", (String)result);
-
- }
-
- private Object runFunction(String functionName, List args, Context context) {
- ExprNode expr = new Function(functionName, BuiltinXPathFunctionResolver.getInstance()
- .resolveFunction(functionName, args.size()), args);
- Object result = expr.evalAsObject(context);
- return result;
-
- }
- /**
- * @param functionName
- * @param args
- * @return
- */
- private Object runFunction(String functionName, List args) {
- return runFunction(functionName, args, null);
- }
-
- public void testStartsWith() {
- List args = new ArrayList();
- args.add(new StringLiteral("abcde"));
- args.add(new StringLiteral("abc"));
-
- Object result = runFunction("starts-with", args);
- assertTrue(result instanceof Boolean);
- assertTrue(((Boolean)result).booleanValue());
-
- args.clear();
- args.add(new StringLiteral("abc"));
- args.add(new StringLiteral("abcde"));
-
- result = runFunction("starts-with", args);
- assertTrue(result instanceof Boolean);
- assertFalse(((Boolean)result).booleanValue());
- }
-
- public void testContains() {
- List args = new ArrayList();
- args.add(new StringLiteral("abcde"));
- args.add(new StringLiteral("abc"));
-
- Object result = runFunction("contains", args);
- assertTrue(result instanceof Boolean);
- assertTrue(((Boolean)result).booleanValue());
-
- args.clear();
- args.add(new StringLiteral("abc"));
- args.add(new StringLiteral("abcde"));
-
- result = runFunction("contains", args);
- assertTrue(result instanceof Boolean);
- assertFalse(((Boolean)result).booleanValue());
-
- args.clear();
- args.add(new StringLiteral("abcde"));
- args.add(new StringLiteral("bc"));
-
- result = runFunction("contains", args);
- assertTrue(result instanceof Boolean);
- assertTrue(((Boolean)result).booleanValue());
-
- args.clear();
- args.add(new StringLiteral("abc"));
- args.add(new StringLiteral(""));
-
- result = runFunction("contains", args);
- assertTrue(result instanceof Boolean);
- assertTrue(((Boolean)result).booleanValue());
-
- }
-
- public void testSubstringBefore() {
- List args = new ArrayList();
- args.add(new StringLiteral("1999/04/01"));
- args.add(new StringLiteral("/"));
-
- Object result = runFunction("substring-before", args);
- assertTrue(result instanceof String);
- assertEquals("1999", (String)result);
-
-
- args.clear();
- args.add(new StringLiteral("1999/04/01"));
- args.add(new StringLiteral(";"));
-
- result = runFunction("substring-before", args);
- assertTrue(result instanceof String);
- assertEquals("", (String)result);
-
- }
-
- public void testSubstringAfter() {
- List args = new ArrayList();
- args.add(new StringLiteral("1999/04/01"));
- args.add(new StringLiteral("/"));
-
- Object result = runFunction("substring-after", args);
- assertTrue(result instanceof String);
- assertEquals("04/01", (String)result);
-
- args.clear();
- args.add(new StringLiteral("1999/04/01"));
- args.add(new StringLiteral(";"));
-
- result = runFunction("substring-after", args);
- assertTrue(result instanceof String);
- assertEquals("", (String)result);
- }
-
- public void testSubstring() {
- List args = new ArrayList();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(1.5));
- args.add(new NumberLiteral(2.6));
-
- Object result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("234", (String)result);
-
- args.clear();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(0));
- args.add(new NumberLiteral(3));
-
- result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("12", (String)result);
-
- args.clear();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(0d / 0d));
- args.add(new NumberLiteral(3));
-
- result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("", (String)result);
-
- args.clear();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(1));
- args.add(new NumberLiteral(0d / 0d));
-
- result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("", (String)result);
-
- args.clear();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(-42));
- args.add(new NumberLiteral(1d / 0d));
-
- result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("12345", (String)result);
-
- args.clear();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(-1d / 0d));
- args.add(new NumberLiteral(1d / 0d));
-
- result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("", (String)result);
-
- args.clear();
- args.add(new StringLiteral("12345"));
- args.add(new NumberLiteral(2));
-
- result = runFunction("substring", args);
- assertTrue(result instanceof String);
- assertEquals("2345", (String)result);
- }
-
- public void testStringLength() {
- List args = new ArrayList();
- args.add(new StringLiteral("12345"));
-
- Object result = runFunction("string-length", args);
- assertTrue(result instanceof Number);
- assertEquals(5, ((Number)result).doubleValue(), 0);
-
- args.clear();
- Context c = new Context(elementB, null);
- result = runFunction("string-length", args, c);
- assertTrue(result instanceof Number);
- assertEquals(EXPECTED_B_TEXT.length(), ((Number)result).doubleValue(), 0);
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ChildStepTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ChildStepTests.java
deleted file mode 100644
index e69e589..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ChildStepTests.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Root;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class ChildStepTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_root_element_root() {
- Step stepExpr = new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root")));
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(rootElement));
-
- }
-
- public void testEvalAsNodeSet_root_element_all() {
- Step stepExpr = new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("*")));
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(rootElement));
-
- }
-
- public void testEvalAsNodeSet_root_a_elements() {
- Step stepExpr = new Step(
- new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("a")));
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(2, resultSet.size());
- Node elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
-
- assertTrue(resultSet.contains(elementA));
- assertTrue(resultSet.contains(elementA2));
- }
-
- public void testEvalAsNodeSet_root_a_b_elements() {
- Step stepExpr = new Step(
- new Step(
- new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("a"))),
- Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("b"))
- );
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(2, resultSet.size());
- Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
- Node elementB2 = (Element) elementA2.getElementsByTagName("b").item(0);
-
- assertTrue(resultSet.contains(elementB));
- assertTrue(resultSet.contains(elementB2));
- }
-
- public void testEvalAsNodeSet_root_all() {
- Step stepExpr = new Step(new Root(), Axis.childAxis(),
- NodeTest.allNodes());
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(2, resultSet.size());
- assertTrue(resultSet.contains(rootElement));
- assertTrue(resultSet.contains(pi));
-
- }
-
- public void testEvalAsNodeSet_root_pi_all() {
- Step stepExpr = new Step(new Root(), Axis.childAxis(),
- NodeTest.allProcessingInstructionNodes());
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(pi));
-
- }
-
- public void testEvalAsNodeSet_root_pi_eclipse() {
- Step stepExpr = new Step(new Root(), Axis.childAxis(),
- NodeTest.processingInstructionNodes("eclipse"));
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(pi));
-
- }
-
- public void testEvalAsNodeSet_root_pi_foo() {
- Step stepExpr = new Step(new Root(), Axis.childAxis(),
- NodeTest.processingInstructionNodes("foo"));
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(0, resultSet.size());
-
- }
-
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DOMInspectorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DOMInspectorTests.java
deleted file mode 100644
index a18bf36..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DOMInspectorTests.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import org.eclipse.jet.internal.xpath.inspectors.DOMInspector;
-import org.eclipse.jet.xpath.inspector.CopyElementException;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-public class DOMInspectorTests extends AbstractExprTest {
-
- private DOMInspector inspector;
- protected void setUp() throws Exception {
- super.setUp();
- this.inspector = new DOMInspector();
- }
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.DOMInspector.getNodeKind(Object)'
- */
- public void testGetNodeKind() {
-
- assertEquals(NodeKind.ROOT, inspector.getNodeKind(document));
- assertEquals(NodeKind.ELEMENT, inspector.getNodeKind(rootElement));
- assertEquals(NodeKind.ATTRIBUTE, inspector.getNodeKind(attr));
- assertEquals(NodeKind.PROCESSING_INSTRUCTION, inspector.getNodeKind(pi));
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(bText));
- assertEquals(NodeKind.COMMENT, inspector.getNodeKind(comment));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.DOMInspector.getParent(Object)'
- */
- public void testGetParent() {
- assertNull(inspector.getParent(document));
- assertEquals(document, inspector.getParent(rootElement));
- assertEquals(rootElement, inspector.getParent(attr));
- assertEquals(rootElement, inspector.getParent(elementA));
- assertEquals(elementA, inspector.getParent(elementB));
- assertEquals(elementB, inspector.getParent(bText));
- assertEquals(document, inspector.getParent(pi));
- assertEquals(rootElement, inspector.getParent(comment));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.DOMInspector.stringValueOf(Object)'
- */
- public void testStringValueOf() {
- assertEquals(EXPECTED_ATTR_TEXT, inspector.stringValueOf(attr));
- assertEquals(EXPECTED_A_TEXT, inspector.stringValueOf(elementA));
- assertEquals(EXPECTED_B_TEXT, inspector.stringValueOf(elementB));
- assertEquals(EXPECTED_B_TEXT, inspector.stringValueOf(bText));
- assertEquals(EXPECTED_DOC_TEXT, inspector.stringValueOf(document));
- assertEquals(EXPECTED_DOC_TEXT, inspector.stringValueOf(rootElement));
- assertEquals(EXPECTED_PI_TEXT, inspector.stringValueOf(pi));
- assertEquals(EXPECTED_COMMENT_TEXT, inspector.stringValueOf(comment));
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.DOMInspector.expandedNameOf(Object)'
- */
- public void testExpandedNameOf() {
- assertNull(inspector.expandedNameOf(document));
- assertEquals(new ExpandedName("root"), inspector.expandedNameOf(rootElement));
- assertEquals(new ExpandedName("a"), inspector.expandedNameOf(elementA));
- assertEquals(new ExpandedName("b"), inspector.expandedNameOf(elementB));
- assertNull(inspector.expandedNameOf(bText));
- assertEquals(new ExpandedName("rootAttr"), inspector.expandedNameOf(attr));
- assertEquals(new ExpandedName("eclipse"), inspector.expandedNameOf(pi));
- assertNull(inspector.expandedNameOf(comment));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.DOMInspector.getAttributes(Object)'
- */
- public void testGetAttributes() {
-
- assertEquals(0, inspector.getAttributes(document).length);
- assertEquals(0, inspector.getAttributes(bText).length);
- assertEquals(0, inspector.getAttributes(attr).length);
- assertEquals(0, inspector.getAttributes(pi).length);
- assertEquals(0, inspector.getAttributes(comment).length);
-
- assertEquals(0, inspector.getAttributes(elementB).length);
-
- Object[] aAttributes = inspector.getAttributes(elementA);
- assertNotNull(aAttributes);
- assertEquals(2, aAttributes.length);
- assertEquals("name", inspector.expandedNameOf(aAttributes[0]).toString());
- assertEquals("name-with_hyphen", inspector.expandedNameOf(aAttributes[1]).toString());
- assertEquals("foo", inspector.stringValueOf(aAttributes[0]));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.DOMInspector.getDocumentRoot(Object)'
- */
- public void testGetDocumentRoot() {
- assertEquals(document, inspector.getDocumentRoot(document));
- assertEquals(document, inspector.getDocumentRoot(rootElement));
- assertEquals(document, inspector.getDocumentRoot(elementA));
- assertEquals(document, inspector.getDocumentRoot(elementB));
- assertEquals(document, inspector.getDocumentRoot(bText));
- assertEquals(document, inspector.getDocumentRoot(attr));
- assertEquals(document, inspector.getDocumentRoot(pi));
- assertEquals(document, inspector.getDocumentRoot(comment));
- }
-
- public void testGetChildren() {
- assertEquals(0, inspector.getChildren(bText).length);
- assertEquals(0, inspector.getChildren(attr).length);
- assertEquals(0, inspector.getChildren(pi).length);
- assertEquals(0, inspector.getChildren(comment).length);
-
- Object[] aChildren = inspector.getChildren(elementA);
- assertNotNull(aChildren);
- assertEquals(3, aChildren.length);
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(aChildren[0]));
- assertEquals(NodeKind.ELEMENT, inspector.getNodeKind(aChildren[1]));
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(aChildren[2]));
-
- Object[] bChildren = inspector.getChildren(elementB);
- assertNotNull(bChildren);
- assertEquals(1, bChildren.length);
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(bChildren[0]));
-
- Object[] rootChildren = inspector.getChildren(rootElement);
- assertNotNull(rootChildren);
- assertEquals(7, rootChildren.length);
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(rootChildren[0]));
- assertEquals(NodeKind.COMMENT, inspector.getNodeKind(rootChildren[1]));
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(rootChildren[2]));
- assertEquals(NodeKind.ELEMENT, inspector.getNodeKind(rootChildren[3]));
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(rootChildren[4]));
- assertEquals(NodeKind.ELEMENT, inspector.getNodeKind(rootChildren[5]));
- assertEquals(NodeKind.TEXT, inspector.getNodeKind(rootChildren[6]));
-
- Object[] docChildren = inspector.getChildren(document);
- assertNotNull(docChildren);
- assertEquals(2, docChildren.length);
- assertEquals(NodeKind.PROCESSING_INSTRUCTION, inspector.getNodeKind(docChildren[0]));
- assertEquals(NodeKind.ELEMENT, inspector.getNodeKind(docChildren[1]));
- }
-
- public void testAddElement() {
- Object[] allChildren = inspector.getChildren(rootElement);
-
- int childCount = allChildren.length;
-
- final Object newElement = inspector.addElement(rootElement, new ExpandedName("bob"), null);
-
- assertNotNull(newElement);
- assertTrue("instanceof org.w3c.dom.Element", newElement instanceof org.w3c.dom.Element);
-
- allChildren = inspector.getChildren(rootElement);
- assertEquals(childCount + 1, allChildren.length);
- assertEquals(newElement, allChildren[childCount]);
- }
-
- public void testRemoveElement() {
- final Object[] beforeChildren = inspector.getChildren(rootElement);
-
- inspector.removeElement(elementA);
-
- final Object[] children = inspector.getChildren(rootElement);
- assertEquals(beforeChildren.length - 1, children.length);
-
- for (int i = 0; i < children.length; i++) {
- assertTrue("elementA not in children", elementA !=children[i]);
-
- }
- }
-
- public void testCopyElement() throws CopyElementException {
- final Object[] beforeChildren = inspector.getChildren(rootElement);
-
- final Object newElement = inspector.copyElement(rootElement, elementA, "a", true);
-
- assertEquals(EXPECTED_A_TEXT, inspector.stringValueOf(newElement));
-
- final Object[] afterChildren = inspector.getChildren(rootElement);
- assertEquals(beforeChildren.length + 1, afterChildren.length);
-
- assertEquals(newElement, afterChildren[afterChildren.length - 1]);
-
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java
deleted file mode 100644
index 1b725ea..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantOrSelfTests.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Root;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Test the 'descendant-of-self' axis.
- *
- */
-public class DescendantOrSelfTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_root_slash_slash_b() {
- Step stepExpr = new Step(
- new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.descendantOrSelf(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("b")));
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(2, resultSet.size());
- Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
- Node elementB2 = (Element) elementA2.getElementsByTagName("b").item(0);
-
- assertTrue(resultSet.contains(elementB));
- assertTrue(resultSet.contains(elementB2));
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantTests.java
deleted file mode 100644
index 32d29e7..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/DescendantTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id: DescendantTests.java,v 1.1 2008/05/04 23:17:40 pelder Exp $
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Root;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Test the 'descendant-of-self' axis.
- *
- */
-public class DescendantTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_root_slash_slash_b() {
- // /child::root/descendant::b
- Step stepExpr = new Step(new Step(new Root(), Axis.childAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("root"))),
- Axis.descendant(), NodeTest.nameTest(NodeKind.ELEMENT,
- new ExpandedName("b")));
- assertEquals("<root>/child::root/descendant::b",stepExpr.toString());
-
- Context context = new Context(document, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(2, resultSet.size());
- Element elementA2 = (Element) rootElement.getElementsByTagName("a")
- .item(1);
- Node elementB2 = (Element) elementA2.getElementsByTagName("b").item(0);
-
- assertTrue(resultSet.contains(elementB));
- assertTrue(resultSet.contains(elementB2));
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EMFResourceInspectorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EMFResourceInspectorTests.java
deleted file mode 100644
index 3eb0f90..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EMFResourceInspectorTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory;
-import org.eclipse.jet.internal.xpath.inspectors.EMFResourceInspector;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-public class EMFResourceInspectorTests extends TestCase {
-
- protected Resource resource;
- protected EObject root;
- protected EMFResourceInspector inspector;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- URI fileURI = URI.createURI("platform:/plugin/org.eclipse.jet.tests/data/sample.dataaccess");
- Factory factory = Resource.Factory.Registry.INSTANCE.getFactory(fileURI);
-
- resource = factory.createResource(fileURI);
- resource.load(null);
-
- root = (EObject) resource.getContents().get(0);
-
- inspector = new EMFResourceInspector();
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.getNamedChildren(Object, ExpandedName)'
- */
- public void testGetNamedChildren_contents() {
- Object[] namedChildren = inspector.getNamedChildren(resource, new ExpandedName("contents"));
- assertEquals(1, namedChildren.length);
- assertEquals(root, namedChildren[0]);
- }
-
- public void testGetNamedChildren_eClass() {
- Object[] namedChildren = inspector.getNamedChildren(resource, new ExpandedName("Employee"));
- assertEquals(1, namedChildren.length);
- assertEquals(root, namedChildren[0]);
-
- }
-
- public void testGetNamedChildren_invalid() {
- Object[] namedChildren = inspector.getNamedChildren(resource, new ExpandedName("Customer"));
- assertEquals(0, namedChildren.length);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.getNodeKind(Object)'
- */
- public void testGetNodeKind() {
- NodeKind nodeKind = inspector.getNodeKind(resource);
- assertEquals(NodeKind.ROOT, nodeKind);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.getParent(Object)'
- */
- public void testGetParent() {
- Object result = inspector.getParent(resource);
- assertNull(result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.stringValueOf(Object)'
- */
- public void testStringValueOf() {
- String result = inspector.stringValueOf(resource);
- assertEquals("", result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.expandedNameOf(Object)'
- */
- public void testExpandedNameOf() {
- ExpandedName expandedName = inspector.expandedNameOf(resource);
-
- assertNull(expandedName);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.getDocumentRoot(Object)'
- */
- public void testGetDocumentRoot() {
- Object documentRoot = inspector.getDocumentRoot(resource);
-
- assertEquals(resource, documentRoot);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.getChildren(Object)'
- */
- public void testGetChildren() {
- Object[] children = inspector.getChildren(resource);
-
- assertNotNull(children);
- assertEquals(1, children.length);
- assertEquals(root, children[0]);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ResourceInspector.nameOf(Object)'
- */
- public void testNameOf() {
- String nameOf = inspector.nameOf(resource);
-
- assertNull(nameOf);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java
deleted file mode 100644
index 53b05c3..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EObjectInspectorTests.java
+++ /dev/null
@@ -1,1052 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.xmi.impl.GenericXMLResourceFactoryImpl;
-import org.eclipse.emf.ecore.xml.type.AnyType;
-import org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot;
-import org.eclipse.jet.internal.runtime.model.EMFXMLModelLoader;
-import org.eclipse.jet.internal.xpath.inspectors.AnyAttributeSetting;
-import org.eclipse.jet.internal.xpath.inspectors.EMFEAttrAsElementWrapper;
-import org.eclipse.jet.internal.xpath.inspectors.EObjectInspector;
-import org.eclipse.jet.internal.xpath.inspectors.EStructuralFeatureSettingInspector;
-import org.eclipse.jet.xpath.inspector.AddElementException;
-import org.eclipse.jet.xpath.inspector.CopyElementException;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.InvalidChildException;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-import dataAccess.Customer;
-import dataAccess.Employee;
-
-public class EObjectInspectorTests extends TestCase {
-
- protected Resource xsdResource;
- protected EObject xsdDocumentRoot;
- protected EObject xsdRootElement;
-
- protected void xsdSetUp() throws Exception {
-
- Object load = new EMFXMLModelLoader().load(new URL("platform:/plugin/org.eclipse.jet.tests/data/library.xml"));
-
- assertTrue(load instanceof EObject);
-
- xsdDocumentRoot = (EObject) load;
- xsdResource = xsdDocumentRoot.eResource();
- xsdRootElement = (EObject) xsdDocumentRoot.eContents().get(0);
- }
-
- protected Resource xmlResource;
- protected XMLTypeDocumentRoot xmlDocumentRoot;
- protected Resource emfResource;
- protected EObject emfRoot;
- protected EObjectInspector inspector;
- protected AnyType xmlRootElement;
-
- protected void xmlSetUp() throws Exception {
-
- URI fileURI = URI.createURI("platform:/plugin/org.eclipse.jet.tests/data/DOMInspector.xml");
- Factory factory = new GenericXMLResourceFactoryImpl();
-
- xmlResource = factory.createResource(fileURI);
- xmlResource.load(null);
-
- xmlDocumentRoot = (XMLTypeDocumentRoot) xmlResource.getContents().get(0);
- xmlRootElement = (AnyType) xmlDocumentRoot.getMixed().get(xmlDocumentRoot.eClass().getEStructuralFeature("root"), true);
- }
-
- protected void emfSetUp() throws Exception {
-
- URI fileURI = URI.createURI("platform:/plugin/org.eclipse.jet.tests/data/sample.dataaccess");
- Factory factory = Resource.Factory.Registry.INSTANCE.getFactory(fileURI);
-
- emfResource = factory.createResource(fileURI);
- emfResource.load(null);
-
- emfRoot = (EObject) emfResource.getContents().get(0);
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- xmlSetUp();
- emfSetUp();
- xsdSetUp();
-
- inspector = new EObjectInspector();
- }
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getAttributes(Object)'
- */
- public void testGetAttributes_emf() {
- Object[] attributes = inspector.getAttributes(emfRoot);
-
- assertNotNull(attributes);
- assertEquals(3, attributes.length);
- String[] expectedAttributeNames = new String[] {
- "name", "address", "employeeNumber",
- };
- String[] expectedAttributeValues = new String[] {
- "Bob Smith", "123 Main St", "12345",
- };
- for (int i = 0; i < attributes.length; i++) {
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting) attributes[i];
- assertEquals("name[" + i + "]", expectedAttributeNames[i], setting.getEStructuralFeature().getName());
- assertEquals("value[" + i + "]", expectedAttributeValues[i], setting.get(true).toString());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getAttributes(Object)'
- */
- public void testGetAttributes_xml() {
- Object[] attributes = inspector.getAttributes(xmlRootElement);
-
- assertNotNull(attributes);
- assertEquals(1, attributes.length);
- String[] expectedAttributeNames = new String[] {
- "rootAttr",
- };
- String[] expectedAttributeValues = new String[] {
- "test",
- };
- for (int i = 0; i < attributes.length; i++) {
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting) attributes[i];
- assertEquals("name[" + i + "]", expectedAttributeNames[i], setting.getEStructuralFeature().getName());
- assertEquals("value[" + i + "]", expectedAttributeValues[i], setting.get(true).toString());
- }
-
-
- }
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getAttributes(Object)'
- */
- public void testGetAttributes_hyphens_xml() {
- Object elementA1 = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
- Object[] attributes = inspector.getAttributes(elementA1);
-
- assertNotNull(attributes);
- String[] expectedAttributeNames = new String[] {
- "name",
- "name-with_hyphen",
- };
- String[] expectedAttributeValues = new String[] {
- "foo",
- "hello",
- };
- assertEquals(expectedAttributeNames.length, attributes.length);
- for (int i = 0; i < attributes.length; i++) {
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting) attributes[i];
- assertEquals("name[" + i + "]", expectedAttributeNames[i], setting.getEStructuralFeature().getName());
- assertEquals("value[" + i + "]", expectedAttributeValues[i], setting.get(true).toString());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getAttributes(Object)'
- */
- public void testGetAttributes_xsd() {
- Object[] attributes = inspector.getAttributes(xsdRootElement.eContents().get(0));
-
- assertNotNull(attributes);
- assertEquals(1, attributes.length);
- String[] expectedAttributeNames = new String[] {
- "name",
- };
- String[] expectedAttributeValues = new String[] {
- "test.beans",
- };
- for (int i = 0; i < attributes.length; i++) {
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting) attributes[i];
- assertEquals("name[" + i + "]", expectedAttributeNames[i], setting.getEStructuralFeature().getName());
- assertEquals("value[" + i + "]", expectedAttributeValues[i], setting.get(true).toString());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getAttributes(Object)'
- */
- public void testGetAttributes_xsd_hyphens() {
- EObject projectElement = (EObject) xsdRootElement.eContents().get(0);
- EObject beanModelElement = (EObject) projectElement.eContents().get(0);
- EObject beanElement = (EObject) beanModelElement.eContents().get(0);
- EObject attrElement = (EObject) beanElement.eContents().get(0);
- Object[] attributes = inspector.getAttributes(attrElement);
-
- assertNotNull(attributes);
- String[] expectedAttributeNames = new String[] {
- "kind",
- "name",
- "nameWithHyphen", // EMF has mangled name-with_hypen this to nameWithHyphen. Figure something out
- "type",
-
- };
- String[] expectedAttributeValues = new String[] {
- "FIELD",
- "name",
- "hello",
- "String",
- };
- assertEquals(expectedAttributeNames.length, attributes.length);
- for (int i = 0; i < attributes.length; i++) {
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting) attributes[i];
- assertEquals("name[" + i + "]", expectedAttributeNames[i], setting.getEStructuralFeature().getName());
- assertEquals("value[" + i + "]", expectedAttributeValues[i], setting.get(true).toString());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getAttributes(Object)'
- */
- public void testGetAttributes_xsd_simpleElement() {
- // testing the the <doc> element underneath attributeElement DOES NOT
- // show up
- EObject projectElement = (EObject) xsdRootElement.eContents().get(0);
- EObject beanModelElement = (EObject) projectElement.eContents().get(0);
- EObject thirdBeanElement = (EObject) beanModelElement.eContents().get(2);
- EObject attributeElement = (EObject) thirdBeanElement.eContents().get(0);
- // verify that there is indeed a fifth EAttribute, but that we won't see it.
- assertEquals(5, attributeElement.eClass().getEAttributes().size());
- Object[] attributes = inspector.getAttributes(attributeElement);
-
- assertNotNull(attributes);
- String[] expectedAttributeNames = new String[] {
- "kind", "name", "type",
- };
- String[] expectedAttributeValues = new String[] {
- "FIELD", "name", "String",
- };
- assertEquals(expectedAttributeNames.length, attributes.length);
- for (int i = 0; i < attributes.length; i++) {
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting) attributes[i];
- assertEquals("name[" + i + "]", expectedAttributeNames[i], setting.getEStructuralFeature().getName());
- assertEquals("value[" + i + "]", expectedAttributeValues[i], setting.get(true).toString());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedAttribute(Object, ExpandedName)'
- */
- public void testGetNamedAttribute_emf() {
- Object attribute = inspector.getNamedAttribute(emfRoot, new ExpandedName("name"));
-
- assertNotNull(attribute);
- assertTrue("instanceof EStructuralFeature.Setting", attribute instanceof EStructuralFeature.Setting);
-
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting)attribute;
- assertEquals("name", setting.getEStructuralFeature().getName());
- assertEquals("Bob Smith", setting.get(true));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedAttribute(Object, ExpandedName)'
- */
- public void testGetNamedAttribute_emf_ns() {
- Object attribute = inspector.getNamedAttribute(emfRoot, new ExpandedName("http:///dataAccess.ecore", "name"));
-
- assertNotNull(attribute);
- assertTrue("instanceof EStructuralFeature.Setting", attribute instanceof EStructuralFeature.Setting);
-
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting)attribute;
- assertEquals("name", setting.getEStructuralFeature().getName());
- assertEquals("Bob Smith", setting.get(true));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedAttribute(Object, ExpandedName)'
- */
- public void testGetNamedAttribute_xml() {
- Object rootAttr = inspector.getNamedAttribute(xmlRootElement, new ExpandedName("rootAttr"));
- assertNotNull(rootAttr);
- assertTrue("instanceof EStructuralFeature.Setting", rootAttr instanceof EStructuralFeature.Setting);
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting)rootAttr;
- assertEquals("rootAttr", setting.getEStructuralFeature().getName());
- assertEquals("test", setting.get(true));
-
- Object failAttr = inspector.getNamedAttribute(xmlRootElement, new ExpandedName("fail"));
- assertNull(failAttr);
-
-// Object elementA1 = xmlRootElement.getAny().getValue(0);
- Object elementA1 = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-
- Object a1Name = inspector.getNamedAttribute(elementA1, new ExpandedName("name"));
- assertNotNull(a1Name);
- assertTrue("instanceof EStructuralFeature.Setting", a1Name instanceof EStructuralFeature.Setting);
- setting = (EStructuralFeature.Setting)a1Name;
- assertEquals("name", setting.getEStructuralFeature().getName());
- assertEquals("foo", setting.get(true));
-
- Object a1HyphenedAttr = inspector.getNamedAttribute(elementA1, new ExpandedName("name-with_hyphen"));
- assertNotNull(a1HyphenedAttr);
- assertTrue("instanceof EStructuralFeature.Setting", a1HyphenedAttr instanceof EStructuralFeature.Setting);
- setting = (EStructuralFeature.Setting)a1HyphenedAttr;
- assertEquals("name-with_hyphen", setting.getEStructuralFeature().getName());
- assertEquals("hello", setting.get(true));
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedAttribute(Object, ExpandedName)'
- */
- public void testGetNamedAttribute_xsd() {
- Object projectElement = xsdRootElement.eContents().get(0);
- Object attribute = inspector.getNamedAttribute(projectElement, new ExpandedName("name"));
-
- assertNotNull(attribute);
- assertTrue("instanceof EStructuralFeature.Setting", attribute instanceof EStructuralFeature.Setting);
-
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting)attribute;
- assertEquals("name", setting.getEStructuralFeature().getName());
- assertEquals("test.beans", setting.get(true));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedAttribute(Object, ExpandedName)'
- */
- public void testGetNamedAttribute_xsd_hyphen() {
- EObject projectElement = (EObject) xsdRootElement.eContents().get(0);
- EObject beanModelElement = (EObject) projectElement.eContents().get(0);
- EObject beanElement = (EObject) beanModelElement.eContents().get(0);
- EObject attrElement = (EObject) beanElement.eContents().get(0);
- Object attribute = inspector.getNamedAttribute(attrElement, new ExpandedName("name-with_hyphen"));
-
- assertNotNull(attribute);
- assertTrue("instanceof EStructuralFeature.Setting", attribute instanceof EStructuralFeature.Setting);
-
- EStructuralFeature.Setting setting = (EStructuralFeature.Setting)attribute;
- assertEquals("nameWithHyphen", setting.getEStructuralFeature().getName()); // the mangled EMF name
- assertEquals("name-with_hyphen", new EStructuralFeatureSettingInspector().nameOf(setting));
- assertEquals("hello", setting.get(true));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.createAttribute(Object, String, String)'
- */
- public void testCreateAttribute_emf() {
- assertFalse("createAttribute", inspector.createAttribute(emfRoot, "test", "hello"));
-
- final Object testAttribute = inspector.getNamedAttribute(emfRoot, new ExpandedName("test"));
- assertNull("testAttribute", testAttribute);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.createAttribute(Object, String, String)'
- */
- public void testCreateAttribute_xml() {
- assertTrue(inspector.createAttribute(xmlRootElement, "test", "hello"));
-
- Object testAttribute2 = inspector.getNamedAttribute(xmlRootElement, new ExpandedName("test"));
- assertNotNull(testAttribute2);
- assertTrue("instanceof AnyAttributeSetting", testAttribute2 instanceof AnyAttributeSetting);
- assertEquals("hello", ((AnyAttributeSetting)testAttribute2).get(true));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.createAttribute(Object, String, String)'
- */
- public void testCreateAttribute_xsd() {
- assertFalse("createAttribute", inspector.createAttribute(xsdRootElement, "test", "hello"));
-
- Object testAttribute = inspector.getNamedAttribute(xsdRootElement, new ExpandedName("test"));
- assertNull(testAttribute);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNodeKind(Object)'
- */
- public void testGetNodeKind_emf() {
- NodeKind result = inspector.getNodeKind(emfRoot);
- assertEquals(NodeKind.ELEMENT, result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNodeKind(Object)'
- */
- public void testGetNodeKind_xml() {
- NodeKind result = inspector.getNodeKind(xmlRootElement);
- assertEquals(NodeKind.ELEMENT, result);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getParent(Object)'
- */
- public void testGetParent_emf() {
- Object result = inspector.getParent(emfRoot);
- assertEquals(emfResource, result);
-
- for (Iterator i = emfRoot.eAllContents(); i.hasNext();) {
- EObject obj = (EObject) i.next();
- Object parent = inspector.getParent(obj);
- assertEquals(obj.eContainer(), parent);
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getParent(Object)'
- */
- public void testGetParent_xml() {
- Object result = inspector.getParent(xmlRootElement);
- assertEquals(xmlDocumentRoot, result);
-
- for (Iterator i = xmlRootElement.eAllContents(); i.hasNext();) {
- EObject obj = (EObject) i.next();
- Object parent = inspector.getParent(obj);
- assertEquals(obj.eContainer(), parent);
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.stringValueOf(Object)'
- */
- public void testStringValueOf_emf() {
- assertEquals("", inspector.stringValueOf(emfRoot));
- for (Iterator i = emfRoot.eAllContents(); i.hasNext();) {
- EObject obj = (EObject) i.next();
- assertEquals("", inspector.stringValueOf(obj));
-
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.stringValueOf(Object)'
- */
- public void testStringValueOf_xml() {
- assertEquals("\n\t\n\t\n\t\tSome foo text.\n\t\n\t\n\t\tSome bar text.\n\t\n", inspector.stringValueOf(xmlDocumentRoot));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.stringValueOf(Object)'
- */
- public void testStringValueOf_xsd() {
- assertEquals("doc for Author.name", inspector.stringValueOf(xsdDocumentRoot));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testExpandedNameOf_emf() {
- ExpandedName enEmfRoot = inspector.expandedNameOf(emfRoot);
- assertEquals("contents", enEmfRoot.toString());
-
- ExpandedName enCustomer = inspector.expandedNameOf(((Employee)emfRoot).getCustomers().get(0));
- assertEquals("customers", enCustomer.toString());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testExpandedNameOf_xml() {
- ExpandedName enEmfRoot = inspector.expandedNameOf(xmlRootElement);
- assertEquals("root", enEmfRoot.toString());
-
-// final Object value = xmlRootElement.getAny().getValue(0);
- final Object value = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-
- ExpandedName enCustomer = inspector.expandedNameOf(value);
- assertEquals("a", enCustomer.toString());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testExpandedNameOf_xsd_rootElement() {
- ExpandedName enEmfRoot = inspector.expandedNameOf(xsdRootElement);
- assertEquals("http://www.example.org/beans:root", enEmfRoot.toString());
-
- ExpandedName enProject = inspector.expandedNameOf(xsdRootElement.eContents().get(0));
- assertEquals("project", enProject.toString());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testExpandedNameOf_xsd_childElement() {
- ExpandedName enProject = inspector.expandedNameOf(xsdRootElement.eContents().get(0));
- assertEquals("project", enProject.toString());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testExpandedNameOf_xsd_hyphen() {
- EObject projectElement = (EObject) xsdRootElement.eContents().get(0);
- EObject beanModelElement = (EObject) projectElement.eContents().get(0);
- EObject beanElement = (EObject) beanModelElement.eContents().get(0);
- EObject attrElement = (EObject) beanElement.eContents().get(0);
- Object attribute = inspector.getNamedAttribute(attrElement, new ExpandedName("name-with_hyphen"));
- ExpandedName enProject = new EStructuralFeatureSettingInspector().expandedNameOf(attribute);
- assertEquals("name-with_hyphen", enProject.toString());
- }
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getDocumentRoot(Object)'
- */
- public void testGetDocumentRoot_emf() {
- assertEquals(emfResource, inspector.getDocumentRoot(emfRoot));
-
- assertEquals(emfResource, inspector.getDocumentRoot(((Employee)emfRoot).getCustomers().get(0)));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getDocumentRoot(Object)'
- */
- public void testGetDocumentRoot_xml() {
- assertEquals(xmlDocumentRoot, inspector.getDocumentRoot(xmlRootElement));
-
-// final Object value = xmlRootElement.getAny().getValue(0);
- final Object value = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-
- assertEquals(xmlDocumentRoot, inspector.getDocumentRoot(value));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getDocumentRoot(Object)'
- */
- public void testGetDocumentRoot_xsd() {
- assertEquals(xsdDocumentRoot, inspector.getDocumentRoot(xsdDocumentRoot));
-
- assertEquals(xsdDocumentRoot, inspector.getDocumentRoot(xsdRootElement.eContents().get(0)));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getChildren(Object)'
- */
- public void testGetChildren_emf() {
- Object[] children = inspector.getChildren(emfRoot);
- assertEquals(2, children.length);
- for (int i = 0; i < children.length; i++) {
- EObject child = (EObject) children[i];
- assertEquals("Customer", child.eClass().getName());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getChildren(Object)'
- */
- public void testGetChildren_xml() {
- Object[] rootChildren = inspector.getChildren(xmlRootElement);
- assertNotNull(rootChildren);
-
- String[] expectedClass = new String[] {
- "EMFXMLNodeWrapper",
- "EMFXMLNodeWrapper",
- "EMFXMLNodeWrapper",
- "AnyTypeImpl",
- "EMFXMLNodeWrapper",
- "AnyTypeImpl",
- "EMFXMLNodeWrapper",
-
- };
- assertEquals(expectedClass.length, rootChildren.length);
- for (int i = 0; i < rootChildren.length; i++) {
- String className = rootChildren[i].getClass().getName();
- assertEquals(expectedClass[i], className.substring(className.lastIndexOf('.')+1));
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getChildren(Object)'
- */
- public void testGetChildren_xsd() {
- final Object[] rootChildren = inspector.getChildren(xsdRootElement);
- String expectedNames[] = new String[] { "Project" };
- assertEquals(expectedNames.length, rootChildren.length);
- for (int i = 0; i < expectedNames.length; i++) {
- assertEquals(expectedNames[i], ((EObject)rootChildren[i]).eClass().getName());
- }
- Object beanModel = inspector.getChildren(rootChildren[0])[0];
- assertEquals("BeanModel", ((EObject)beanModel).eClass().getName());
-
- Object thirdBean = inspector.getChildren(beanModel)[2];
- assertEquals("Bean", ((EObject)thirdBean).eClass().getName());
-
- Object[] beanAttributes = inspector.getChildren(thirdBean);
- expectedNames = new String[] { "Attribute", "Attribute", };
- for (int i = 0; i < expectedNames.length; i++) {
- assertEquals(expectedNames[i], ((EObject)beanAttributes[i]).eClass().getName());
- }
-
- Object[] doc = inspector.getChildren(beanAttributes[0]);
- assertEquals(1, doc.length);
- assertTrue("instanceof EMFEAttrAsElementWrapper", doc[0] instanceof EMFEAttrAsElementWrapper);
- EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper) doc[0];
- assertEquals("doc for Author.name", wrapper.getValue());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.nameOf(Object)'
- */
- public void testNameOf_emf() {
- assertEquals("contents", inspector.nameOf(emfRoot));
- for (Iterator i = emfRoot.eAllContents(); i.hasNext();) {
- EObject obj = (EObject) i.next();
- String result = inspector.nameOf(obj);
- assertEquals("dataAccess:" + obj.eContainingFeature().getName(), result);
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.nameOf(Object)'
- */
- public void testNameOf_xml() {
- assertEquals("root", inspector.nameOf(xmlRootElement));
-// for (Iterator i = xmlRootElement.getAny().iterator(); i.hasNext();) {
- for(int i = 0; i < Bug130552Workaround.size(xmlRootElement.getAny()); i++) {
-// FeatureMap.Entry obj = (FeatureMap.Entry) i.next();
- FeatureMap.Entry obj = Bug130552Workaround.getEntry(xmlRootElement.getAny(), i);
- String result = inspector.nameOf(obj.getValue());
- assertEquals(obj.getEStructuralFeature().getName(), result);
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.nameOf(Object)'
- */
- public void testNameOf_xsd() {
- assertEquals("beans:root", inspector.nameOf(xsdRootElement));
- for (Iterator i = xsdRootElement.eAllContents(); i.hasNext();) {
- EObject obj = (EObject) i.next();
- String result = inspector.nameOf(obj);
- assertEquals(obj.eContainingFeature().getName(), result);
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedChildren(Object, ExpandedName)'
- */
- public void testGetNamedChildren_emf() {
- Object[] namedChildren = inspector.getNamedChildren(emfRoot, new ExpandedName("customers"));
- assertEquals(2, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("Customer", child.eClass().getName());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedChildren(Object, ExpandedName)'
- */
- public void testGetNamedChildren_emf_eClassName() {
- Object[] namedChildren = inspector.getNamedChildren(emfRoot, new ExpandedName("Customer"));
- assertEquals(2, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("Customer", child.eClass().getName());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedChildren(Object, ExpandedName)'
- */
- public void testGetNamedChildren_xml() {
- Object[] namedChildren = inspector.getNamedChildren(xmlRootElement, new ExpandedName("a"));
- assertEquals(2, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl", child.getClass().getName());
- }
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.getNamedChildren(Object, ExpandedName)'
- */
- public void testGetNamedChildren_xsd() {
- Object[] rootChildren = inspector.getNamedChildren(xsdDocumentRoot, new ExpandedName("http://www.example.org/beans", "root"));
- assertEquals(1, rootChildren.length);
- assertEquals(xsdRootElement, rootChildren[0]);
-
- Object[] namedChildren = inspector.getNamedChildren(xsdRootElement, new ExpandedName("project"));
- assertEquals(1, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("Project", ((EObject)child).eClass().getName());
- }
- namedChildren = inspector.getNamedChildren(namedChildren[0], new ExpandedName("beanModel"));
- assertEquals(1, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("BeanModel", ((EObject)child).eClass().getName());
- }
- namedChildren = inspector.getNamedChildren(namedChildren[0], new ExpandedName("bean"));
- assertEquals(3, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("Bean", ((EObject)child).eClass().getName());
- }
- namedChildren = inspector.getNamedChildren(namedChildren[2], new ExpandedName("attribute"));
- assertEquals(2, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EObject child = (EObject) namedChildren[i];
- assertEquals("Attribute", ((EObject)child).eClass().getName());
- }
- namedChildren = inspector.getNamedChildren(namedChildren[0], new ExpandedName("doc"));
- assertEquals(1, namedChildren.length);
- for (int i = 0; i < namedChildren.length; i++) {
- EMFEAttrAsElementWrapper child = (EMFEAttrAsElementWrapper) namedChildren[i];
- assertEquals("doc for Author.name", child.getValue());
- }
- }
-
- public void testAddElement_emf() throws Exception {
- Object[] namedChildren = inspector.getNamedChildren(emfRoot, new ExpandedName("customers"));
- int childCount = namedChildren.length;
-
- final Object newElement = inspector.addElement(emfRoot, new ExpandedName("customers"), null);
-
- assertNotNull(newElement);
- assertEquals("dataAccess.impl.CustomerImpl", newElement.getClass().getName());
-
- namedChildren = inspector.getNamedChildren(emfRoot, new ExpandedName("customers"));
- assertEquals(childCount + 1, namedChildren.length);
- assertEquals(newElement, namedChildren[childCount]);
- }
-
- public void testAddElement_emf_before() throws Exception {
- Object[] namedChildren = inspector.getNamedChildren(emfRoot, new ExpandedName("customers"));
- int childCount = namedChildren.length;
-
- final Object newElement = inspector.addElement(emfRoot, new ExpandedName("customers"), namedChildren[0]);
-
- assertNotNull(newElement);
- assertEquals("dataAccess.impl.CustomerImpl", newElement.getClass().getName());
-
- namedChildren = inspector.getNamedChildren(emfRoot, new ExpandedName("customers"));
- assertEquals(childCount + 1, namedChildren.length);
- assertEquals(newElement, namedChildren[0]);
- }
-
- public void testAddElement_xml() throws Exception {
- Object[] allChildren = inspector.getChildren(xmlRootElement);
-
- int childCount = allChildren.length;
-
- final Object newElement = inspector.addElement(xmlRootElement, new ExpandedName("bob"), null);
-
- assertNotNull(newElement);
- assertEquals("org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl", newElement.getClass().getName());
-
- allChildren = inspector.getChildren(xmlRootElement);
- assertEquals(childCount + 1, allChildren.length);
- assertEquals(newElement, allChildren[childCount]);
- }
-
- public void testAddElement_xml_before() throws Exception {
-// Object firstChild = xmlRootElement.getAny().getValue(0);
- Object firstChild = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-// int childCount = xmlRootElement.getAny().size();
- int childCount = Bug130552Workaround.size(xmlRootElement.getAny());
-
- final Object newElement = inspector.addElement(xmlRootElement, new ExpandedName("a"), firstChild);
-
- assertNotNull(newElement);
- assertEquals("org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl", newElement.getClass().getName());
-
-// assertEquals(childCount + 1, xmlRootElement.getAny().size());
- assertEquals(childCount + 1, Bug130552Workaround.size(xmlRootElement.getAny()));
-// assertEquals(newElement, xmlRootElement.getAny().getValue(0));
- assertEquals(newElement, Bug130552Workaround.getValue(xmlRootElement.getAny(), 0));
- }
-
- public void testAddElement_xml_before_fail() throws Exception {
- Object[] allChildren = inspector.getChildren(xmlRootElement);
- try {
- inspector.addElement(xmlRootElement, new ExpandedName("bob"), allChildren[0]);
- fail();
- } catch(InvalidChildException e) {
- // success
- }
-
- }
-
- public void testAddElement_xsd() throws Exception {
- int childCount = xsdRootElement.eContents().size();
- final Object newElement = inspector.addElement(xsdRootElement, new ExpandedName("project"), null);
- assertEquals(childCount + 1, xsdRootElement.eContents().size());
-
- assertEquals(newElement, xsdRootElement.eContents().get(childCount));
- }
-
- public void testAddElement_xsd_before() throws Exception {
- int childCount = xsdRootElement.eContents().size();
- final Object newElement = inspector.addElement(xsdRootElement, new ExpandedName("project"), xsdRootElement.eContents().get(0));
- assertEquals(childCount + 1, xsdRootElement.eContents().size());
-
- assertEquals(newElement, xsdRootElement.eContents().get(0));
- }
-
- public void testRemoveElement_emf() {
- Employee emp = (Employee) emfRoot;
- int beforeListSize = emp.getCustomers().size();
-
- Customer cust = (Customer) emp.getCustomers().get(0);
- inspector.removeElement(cust);
- List afterList = emp.getCustomers();
- assertEquals(beforeListSize - 1, afterList.size());
- assertTrue("cust not in afterList", !afterList.contains(cust));
- }
-
- public void testRemoveElement_emf_root() {
- Employee emp = (Employee) emfRoot;
- int beforeListSize = emfResource.getContents().size();
-
- inspector.removeElement(emp);
- List afterList = emfResource.getContents();
- assertEquals(beforeListSize - 1, afterList.size());
- assertTrue("cust not in afterList", !afterList.contains(emp));
- }
-
- public void testRemoveAttribute_emf() {
- EStructuralFeature nameFeature = emfRoot.eClass().getEStructuralFeature("name");
- assertTrue("setup: name is not set", emfRoot.eIsSet(nameFeature));
-
- inspector.removeAttribute(emfRoot, "name");
-
- assertFalse("name is still set", emfRoot.eIsSet(nameFeature));
- assertNull(inspector.getNamedAttribute(emfRoot, new ExpandedName("name")));
- }
-
- public void testRemoveAttribute_emf_nonexisting() {
- final String attrName = "notAnAttribute";
- EStructuralFeature nameFeature = emfRoot.eClass().getEStructuralFeature(attrName);
- assertNull("setup: " + attrName + " is not set", nameFeature);
-
- inspector.removeAttribute(emfRoot, attrName);
-
- // success if we get here without someone throwing an exception
- }
-
- public void testRemoveAttribute_xml() {
- ExpandedName enRootAttr = new ExpandedName("rootAttr");
- Object originalRootAttr = inspector.getNamedAttribute(xmlRootElement, enRootAttr);
- assertNotNull("setup: originalRootAttr is null", originalRootAttr);
-
- inspector.removeAttribute(xmlRootElement, "rootAttr");
-
- Object rootAttr = inspector.getNamedAttribute(xmlRootElement, enRootAttr);
- assertNull("rootAttr should be null", rootAttr);
- }
-
- public void testRemoveAttribute_xsd() {
- Object projectElement = xsdRootElement.eContents().get(0);
-
- Object originalAttribute = inspector.getNamedAttribute(projectElement, new ExpandedName("name"));
- assertNotNull("setup: originalAttribute is null", originalAttribute);
-
- inspector.removeAttribute(projectElement, "name");
-
- Object attribute = inspector.getNamedAttribute(projectElement, new ExpandedName("name"));
- assertNull("attribute should be null", attribute);
- }
-
- public void testRemoveElement_xml() {
-// EStructuralFeature feature = xmlRootElement.getAny().getEStructuralFeature(0);
- EStructuralFeature feature = Bug130552Workaround.getEStructuralFeature(xmlRootElement.getAny(), 0);
-// Object elementA = xmlRootElement.getAny().getValue(0);
- Object elementA = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-
- int beforeSize = xmlRootElement.getAny().list(feature).size();
-
- inspector.removeElement(elementA);
-
- assertEquals(beforeSize - 1, xmlRootElement.getAny().list(feature).size());
- assertTrue("elementA not in list", !xmlRootElement.getAny().list(feature).contains(elementA));
-
- }
-
- public void testRemoveElement_xsd() {
- final Object[] rootChildren = inspector.getChildren(xsdRootElement);
- Object beanModel = inspector.getChildren(rootChildren[0])[0];
- assertEquals("BeanModel", ((EObject)beanModel).eClass().getName());
-
- Object thirdBean = inspector.getChildren(beanModel)[2];
- assertEquals("Bean", ((EObject)thirdBean).eClass().getName());
-
-// Object[] beanAttributes = inspector.getChildren(thirdBean);
-// final Object beanAttr = beanAttributes[0];
-// Object[] doc = inspector.getChildren(beanAttr);
-// assertEquals(1, doc.length);
-//
-// inspector.removeElement(doc[0]);
-// assertEquals(0, inspector.getChildren(beanAttr).length);
-
- inspector.removeElement(thirdBean);
- assertEquals(2, inspector.getChildren(beanModel).length);
- }
-
- public void testCopyElement_emf() throws CopyElementException {
- Customer source = (Customer) ((Employee)emfRoot).getCustomers().get(0);
- int initialSize = ((Employee)emfRoot).getCustomers().size();
- Customer newCust = (Customer) inspector.copyElement(emfRoot, source, "customers", true);
- assertEquals(initialSize + 1, ((Employee)emfRoot).getCustomers().size() );
- assertTrue("newCust != source", source != newCust);
- assertEquals(newCust, ((Employee)emfRoot).getCustomers().get(initialSize));
- assertEquals(inspector.getChildren(source).length, inspector.getChildren(newCust).length);
- }
-
- public void testCopyElement_emf_shallow() throws CopyElementException {
- Customer source = (Customer) ((Employee)emfRoot).getCustomers().get(0);
- int initialSize = ((Employee)emfRoot).getCustomers().size();
- Customer newCust = (Customer) inspector.copyElement(emfRoot, source, "customers", false);
- assertEquals(initialSize + 1, ((Employee)emfRoot).getCustomers().size() );
- assertTrue("newCust != source", source != newCust);
- assertEquals(newCust, ((Employee)emfRoot).getCustomers().get(initialSize));
- assertEquals(0, inspector.getChildren(newCust).length);
- assertEquals(source.getName(), newCust.getName());
- }
-
- public void testCopyElement_xml() throws CopyElementException {
-// AnyType elementA = (AnyType) xmlRootElement.getAny().getValue(0);
- AnyType elementA = (AnyType) Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-
-// int initialSize = xmlRootElement.getAny().size();
- int initialSize = Bug130552Workaround.size(xmlRootElement.getAny());
-
- final Object elementACopy = inspector.copyElement(xmlRootElement, elementA, "a", true);
- assertNotNull(elementACopy);
- assertTrue("copy != original", elementA != elementACopy);
- assertEquals(inspector.stringValueOf(elementA), inspector.stringValueOf(elementACopy));
-// assertEquals(initialSize + 1, xmlRootElement.getAny().size());
- assertEquals(initialSize + 1, Bug130552Workaround.size(xmlRootElement.getAny()));
-// assertEquals(elementACopy ,xmlRootElement.getAny().getValue(initialSize));
- assertEquals(elementACopy ,Bug130552Workaround.getValue(xmlRootElement.getAny(), initialSize));
-
- }
-
- public void testCopyElement_xml_shallow() throws CopyElementException {
-// AnyType elementA = (AnyType) xmlRootElement.getAny().getValue(0);
- AnyType elementA = (AnyType) Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-// int initialSize = xmlRootElement.getAny().size();
- int initialSize = Bug130552Workaround.size(xmlRootElement.getAny());
-
- final Object elementACopy = inspector.copyElement(xmlRootElement, elementA, "a", false);
- assertNotNull(elementACopy);
- assertTrue("copy != original", elementA != elementACopy);
-// assertEquals(initialSize + 1, xmlRootElement.getAny().size());
- assertEquals(initialSize + 1, Bug130552Workaround.size(xmlRootElement.getAny()));
-// assertEquals(elementACopy ,xmlRootElement.getAny().getValue(initialSize));
- assertEquals(elementACopy ,Bug130552Workaround.getValue(xmlRootElement.getAny(), initialSize));
- assertEquals(0, inspector.getChildren(elementACopy).length);
- assertEquals(elementA.getAnyAttribute().size(), ((AnyType)elementACopy).getAnyAttribute().size());
- }
-
- public void testCopyElement_xsd() throws CopyElementException {
- final Object[] projects = inspector.getNamedChildren(xsdRootElement,new ExpandedName("project"));
- Object projectElement = projects[0];
-
- final Object newProject = inspector.copyElement(xsdRootElement, projectElement, "project", true);
-
- final Object[] newProjects = inspector.getNamedChildren(xsdRootElement,new ExpandedName("project"));
- assertEquals(projects.length + 1, newProjects.length);
- assertEquals(newProject, newProjects[newProjects.length - 1]);
- assertEquals(inspector.stringValueOf(projectElement), inspector.stringValueOf(newProject));
-
- }
-
- public void testCopyElement_xsd_shallow() throws CopyElementException {
- final Object[] projects = inspector.getNamedChildren(xsdRootElement,new ExpandedName("project"));
- Object projectElement = projects[0];
-
- final Object newProject = inspector.copyElement(xsdRootElement, projectElement, "project", false);
-
- final Object[] newProjects = inspector.getNamedChildren(xsdRootElement,new ExpandedName("project"));
- assertEquals(projects.length + 1, newProjects.length);
- assertEquals(newProject, newProjects[newProjects.length - 1]);
- assertEquals(0, inspector.getChildren(newProject).length);
-
- }
-
- public void testAddTextElement_emf() {
- // nothing to test. Basic EMF models have nothing equivalent to "Text Elements".
- }
-
- public void testAddTextElement_xsd() throws Exception {
- final Object[] rootChildren = inspector.getChildren(xsdRootElement);
- Object beanModel = inspector.getChildren(rootChildren[0])[0];
- Object firstBean = inspector.getChildren(beanModel)[0];
- assertEquals("Bean", ((EObject)firstBean).eClass().getName());
-
- Object[] beanAttributes = inspector.getChildren(firstBean);
-
- inspector.addTextElement(beanAttributes[0], "doc", "Hello Attribute 1", false );
-
- Object[] doc = inspector.getChildren(beanAttributes[0]);
- assertEquals(1, doc.length);
- assertTrue("instanceof EMFEAttrAsElementWrapper", doc[0] instanceof EMFEAttrAsElementWrapper);
- EMFEAttrAsElementWrapper wrapper = (EMFEAttrAsElementWrapper) doc[0];
- assertEquals("Hello Attribute 1", wrapper.getValue());
- }
-
- public void testAddTextElement_xml() throws AddElementException {
- inspector.addTextElement(xmlRootElement, "bob", "Hello Bob!", false);
-
- final Object[] namedChildren = inspector.getNamedChildren(xmlRootElement, new ExpandedName("bob"));
- assertEquals(1, namedChildren.length);
- assertEquals("Hello Bob!", inspector.stringValueOf(namedChildren[0]));
- }
-
- public void testAddTextElement_xml_cdata() throws AddElementException {
- inspector.addTextElement(xmlRootElement, "bob", "Hello Bob!", true);
-
- final Object[] namedChildren = inspector.getNamedChildren(xmlRootElement, new ExpandedName("bob"));
- assertEquals(1, namedChildren.length);
- assertEquals("Hello Bob!", inspector.stringValueOf(namedChildren[0]));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testTestExpandedName_emf() {
- ExpandedName enEmfRootContents = new ExpandedName("contents");
- assertTrue("root contents", inspector.testExpandedName(emfRoot, enEmfRootContents));
- ExpandedName enEmfRootEmployee = new ExpandedName("Employee");
- assertTrue("root Employee", inspector.testExpandedName(emfRoot, enEmfRootEmployee));
-
- Object employee = ((Employee)emfRoot).getCustomers().get(0);
- ExpandedName enCustomers = new ExpandedName("customers");
- assertTrue("employee/customers", inspector.testExpandedName(employee, enCustomers));
- ExpandedName enCustomer = new ExpandedName("Customer");
- assertTrue("employee /Customer", inspector.testExpandedName(employee, enCustomer));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testTestExpandedName_xml() {
- ExpandedName enRoot = new ExpandedName("root");
- assertTrue("root /root", inspector.testExpandedName(xmlRootElement, enRoot));
-
- ExpandedName enAny = new ExpandedName("Any");
- assertFalse("root /Any", inspector.testExpandedName(xmlRootElement, enAny));
-
-// final Object value = xmlRootElement.getAny().getValue(0);
- final Object elementA = Bug130552Workaround.getValue(xmlRootElement.getAny(), 0);
-
-
- ExpandedName enA = new ExpandedName("a");
- assertTrue("a /a", inspector.testExpandedName(elementA, enA));
-
- assertFalse("a /Any", inspector.testExpandedName(elementA, enAny));
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.inspectors.EObjectInspector2.expandedNameOf(Object)'
- */
- public void testTestExpandedName_xsd() {
- ExpandedName enRoot = new ExpandedName("http://www.example.org/beans", "root");
- assertTrue("root /root", inspector.testExpandedName(xsdRootElement, enRoot));
-
- final Object elementProject = xsdRootElement.eContents().get(0);
- ExpandedName enProject = new ExpandedName("project");
- assertTrue("project /project", inspector.testExpandedName(elementProject, enProject));
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EStructuralFeatureSettingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EStructuralFeatureSettingTests.java
deleted file mode 100644
index fc94897..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/EStructuralFeatureSettingTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory;
-import org.eclipse.jet.internal.xpath.inspectors.EObjectInspector;
-import org.eclipse.jet.internal.xpath.inspectors.EStructuralFeatureSettingInspector;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-public class EStructuralFeatureSettingTests extends TestCase {
-
- protected Resource resource;
- protected EObject root;
- protected EStructuralFeature.Setting root_name_attr;
- protected EObjectInspector eObjectInspector;
- protected EStructuralFeatureSettingInspector inspector;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- URI fileURI = URI.createURI("platform:/plugin/org.eclipse.jet.tests/data/sample.dataaccess");
- Factory factory = Resource.Factory.Registry.INSTANCE.getFactory(fileURI);
-
- resource = factory.createResource(fileURI);
- resource.load(null);
-
- root = (EObject) resource.getContents().get(0);
-
- inspector = new EStructuralFeatureSettingInspector();
- eObjectInspector = new EObjectInspector();
-
- root_name_attr = (Setting) eObjectInspector.getNamedAttribute(root, new ExpandedName("name"));
-
- }
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.getNodeKind(Object)'
- */
- public void testGetNodeKind() {
- NodeKind nodeKind = inspector.getNodeKind(root_name_attr);
- assertEquals(NodeKind.ATTRIBUTE, nodeKind);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.getParent(Object)'
- */
- public void testGetParent() {
- Object parent = inspector.getParent(root_name_attr);
- assertEquals(root, parent);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.stringValueOf(Object)'
- */
- public void testStringValueOf() {
- String value = inspector.stringValueOf(root_name_attr);
- assertEquals("Bob Smith", value);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.expandedNameOf(Object)'
- */
- public void testExpandedNameOf() {
- ExpandedName expandedName = inspector.expandedNameOf(root_name_attr);
- assertEquals("name", expandedName.toString());
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.getDocumentRoot(Object)'
- */
- public void testGetDocumentRoot() {
- Object documentRoot = inspector.getDocumentRoot(root_name_attr);
- assertEquals(resource, documentRoot);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.getChildren(Object)'
- */
- public void testGetChildren() {
- Object[] children = inspector.getChildren(root_name_attr);
- assertNotNull(children);
- assertEquals(0, children.length);
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.EStructuralFeatureSettingInspector.nameOf(Object)'
- */
- public void testNameOf() {
- String nameOf = inspector.nameOf(root_name_attr);
- assertEquals("name", nameOf);
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ExpandedNameTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ExpandedNameTests.java
deleted file mode 100644
index 497de86..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ExpandedNameTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-
-public class ExpandedNameTests extends TestCase {
-
- /*
- * Test method for 'org.eclipse.jet.xpath.ExpandedName.ExpandedName(String)'
- */
- public void testExpandedNameString() {
- ExpandedName en = new ExpandedName("foo");
-
- assertNull(en.getNamespaceURI());
- assertEquals("foo", en.getLocalPart());
- }
-
- /*
- * Test method for 'org.eclipse.jet.xpath.ExpandedName.ExpandedName(String, String)'
- */
- public void testExpandedNameStringString() {
- ExpandedName en = new ExpandedName("foo", "bar");
-
- assertEquals("foo", en.getNamespaceURI());
- assertEquals("bar", en.getLocalPart());
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.xpath.ExpandedName.equals(Object)'
- */
- public void testEquals_ncname_ncname() {
- ExpandedName enFoo1 = new ExpandedName("foo");
- ExpandedName enFoo2 = new ExpandedName("foo");
- ExpandedName enBar = new ExpandedName("bar");
- ExpandedName enBarFoo = new ExpandedName("bar", "foo");
-
- assertTrue("self equality", enFoo1.equals(enFoo1));
- assertTrue("equality", enFoo1.equals(enFoo2));
- assertTrue("reflexive equality", enFoo2.equals(enFoo1));
- assertFalse("inequality", enFoo1.equals(enBar));
- assertFalse("reflexive inequality", enBar.equals(enFoo1));
- assertFalse("inequality qname", enFoo1.equals(enBarFoo));
- assertFalse("reflexive inequality qname", enBarFoo.equals(enFoo1) );
-
- }
-
- public void testEquals_qname_qname() {
- ExpandedName enFooBar1 = new ExpandedName("foo", "bar");
- ExpandedName enFooBar2 = new ExpandedName("foo", "bar");
- ExpandedName enFooBad = new ExpandedName("foo", "bad");
- ExpandedName enFarBar = new ExpandedName("far", "bar");
-
- assertTrue("self equality", enFooBar1.equals(enFooBar1));
- assertTrue("equality", enFooBar1.equals(enFooBar2));
- assertTrue("reflexive equality", enFooBar2.equals(enFooBar1));
- assertFalse("inequality in localname", enFooBar1.equals(enFooBad));
- assertFalse("inequality in uri", enFooBar1.equals(enFarBar));
- assertFalse("total inequality", enFooBad.equals(enFarBar));
- }
-
- public void testEquals_wild() {
- ExpandedName enWild = new ExpandedName("*");
-
- ExpandedName enFoo = new ExpandedName("foo");
- ExpandedName enFooBar = new ExpandedName("foo", "bar");
-
- assertTrue("equality ncname", enWild.equals(enFoo));
- assertTrue("reflexive equality ncname", enFoo.equals(enWild));
- assertTrue("equality qname", enWild.equals(enFooBar));
- assertTrue("reflexivie equality qname", enFooBar.equals(enWild));
- }
-
- public void testEquals_localpart_wild() {
- ExpandedName enFooWild = new ExpandedName("foo", "*");
-
- ExpandedName enFoo = new ExpandedName("foo");
- ExpandedName enFooBar = new ExpandedName("foo", "bar");
- ExpandedName enFarBar = new ExpandedName("far", "bar");
-
- assertTrue("equality", enFooWild.equals(enFooBar));
- assertTrue("reflexive equality", enFooBar.equals(enFooWild));
- assertFalse("inequality", enFooWild.equals(enFarBar));
- assertFalse("reflexive inequality", enFarBar.equals(enFooWild));
- assertFalse("inequality", enFooWild.equals(enFoo));
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingSiblingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingSiblingTests.java
deleted file mode 100644
index 3aa0742..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingSiblingTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Iterator;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.internal.xpath.ast.NodeTest.NameTest;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.NodeSet;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * Test following-sibling axes
- *
- */
-public class FollowingSiblingTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_ElementA() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.followingSibling(),
- NameTest.nameTest(NodeKind.ELEMENT, new ExpandedName("a")));
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA, null));
-
- assertNotNull(result);
- assertEquals(1, result.size());
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Element);
-
- }
-
- public void testEvalAsNodeSet_ElementA_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.followingSibling(),
- NameTest.allNodes());
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA, null));
-
- assertNotNull(result);
- assertEquals(3, result.size());
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text);
- assertTrue(i.next() instanceof Element);
- assertTrue(i.next() instanceof Text);
-
- }
-
- public void testEvalAsNodeSet_ElementB() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.followingSibling(),
- NameTest.nameTest(NodeKind.ELEMENT, ExpandedName.ALL));
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB, null));
-
- assertNotNull(result);
- assertEquals(0, result.size());
-
- }
- public void testEvalAsNodeSet_ElementB_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.followingSibling(),
- NameTest.allNodes());
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB, null));
-
- assertNotNull(result);
- assertEquals(1, result.size());
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text);
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingTests.java
deleted file mode 100644
index 74aee60..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/FollowingTests.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Iterator;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.internal.xpath.ast.NodeTest.NameTest;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.NodeSet;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-/**
- * Test following-sibling axes
- *
- */
-public class FollowingTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_ElementA() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.following(),
- NameTest.nameTest(NodeKind.ELEMENT, new ExpandedName("a")));
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA, null));
-
- assertNotNull(result);
- assertEquals(1, result.size());
- Iterator i = result.iterator();
- Object next1 = i.next();
- assertTrue(next1 instanceof Element);
- assertEquals("a",((Element)next1).getNodeName());
-
- }
-
- public void testEvalAsNodeSet_ElementA_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.following(),
- NameTest.allNodes());
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA, null));
-
- assertNotNull(result);
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text); //1
- Element a = (Element)i.next(); //2
- assertEquals("a", a.getNodeName());
- assertTrue(i.next() instanceof Text); //3
- Element b = (Element) i.next(); //4
- assertEquals("b", b.getNodeName());
- assertTrue(i.next() instanceof Text); //5
- assertTrue(i.next() instanceof Text); //6
- assertTrue(i.next() instanceof Text); //7
- assertEquals(7, result.size());
-
- }
-
- public void testEvalAsNodeSet_ElementB() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.following(),
- NameTest.nameTest(NodeKind.ELEMENT, ExpandedName.ALL));
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB, null));
-
- assertNotNull(result);
- Iterator i = result.iterator();
- Element a = (Element) i.next();
- assertEquals("a", a.getNodeName());
- Element b = (Element) i.next();
- assertEquals("b", b.getNodeName());
- assertEquals(2, result.size());
-
-
- }
- public void testEvalAsNodeSet_ElementB_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.following(),
- NameTest.allNodes());
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB, null));
-
- assertNotNull(result);
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text); //1
- assertTrue(i.next() instanceof Text); //2
- Element a = (Element)i.next(); //3
- assertEquals("a", a.getNodeName());
- assertTrue(i.next() instanceof Text); //4
- Element b = (Element) i.next(); //5
- assertEquals("b", b.getNodeName());
- assertTrue(i.next() instanceof Text); //6
- assertTrue(i.next() instanceof Text); //7
- assertTrue(i.next() instanceof Text); //8
- assertEquals(8, result.size());
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/LogicalOpTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/LogicalOpTests.java
deleted file mode 100644
index b20c626..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/LogicalOpTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.internal.xpath.ast.BooleanExpr;
-import org.eclipse.jet.internal.xpath.ast.BooleanLiteral;
-import org.eclipse.jet.internal.xpath.ast.LogicalOp;
-
-public class LogicalOpTests extends TestCase {
-
- public void testOr() {
- BooleanExpr expr = new LogicalOp.Or(BooleanLiteral.FALSE, BooleanLiteral.FALSE);
-
- assertFalse(expr.evalAsBoolean(null));
-
- expr = new LogicalOp.Or(BooleanLiteral.TRUE, BooleanLiteral.FALSE);
- assertTrue(expr.evalAsBoolean(null));
-
- expr = new LogicalOp.Or(BooleanLiteral.FALSE, BooleanLiteral.TRUE);
- assertTrue(expr.evalAsBoolean(null));
-
- expr = new LogicalOp.Or(BooleanLiteral.TRUE, BooleanLiteral.TRUE);
- assertTrue(expr.evalAsBoolean(null));
-
- // test that if the first term is true, then the second term is not evaluated.
- expr = new LogicalOp.Or(BooleanLiteral.TRUE, null);
- assertTrue(expr.evalAsBoolean(null));
-
-
- }
-
- public void testAnd() {
- BooleanExpr expr = new LogicalOp.And(BooleanLiteral.FALSE, BooleanLiteral.FALSE);
-
- assertFalse(expr.evalAsBoolean(null));
-
- expr = new LogicalOp.And(BooleanLiteral.TRUE, BooleanLiteral.FALSE);
- assertFalse(expr.evalAsBoolean(null));
-
- expr = new LogicalOp.And(BooleanLiteral.FALSE, BooleanLiteral.TRUE);
- assertFalse(expr.evalAsBoolean(null));
-
- expr = new LogicalOp.And(BooleanLiteral.TRUE, BooleanLiteral.TRUE);
- assertTrue(expr.evalAsBoolean(null));
-
- // test that if the first term is false, then the second term is not evaluated.
- expr = new LogicalOp.And(BooleanLiteral.FALSE, null);
- assertFalse(expr.evalAsBoolean(null));
-
-
- }
-
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberBinaryOpTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberBinaryOpTests.java
deleted file mode 100644
index 675b12b..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberBinaryOpTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jet.internal.xpath.ast.BinaryOp;
-import org.eclipse.jet.internal.xpath.ast.NumberExpr;
-import org.eclipse.jet.internal.xpath.ast.NumberLiteral;
-
-public class NumberBinaryOpTests extends TestCase {
-
- public void testAdd() {
- NumberExpr expr = new BinaryOp.Add(new NumberLiteral(3), new NumberLiteral(5));
- double addResult = expr.evalAsDouble(null);
-
- assertEquals(8, addResult, 0);
-
- }
-
- public void testSubtract() {
- NumberExpr expr = new BinaryOp.Subtract(new NumberLiteral(3), new NumberLiteral(5));
- double subtractResult = expr.evalAsDouble(null);
-
- assertEquals(-2, subtractResult, 0);
- }
-
- public void testMultiply() {
- NumberExpr expr = new BinaryOp.Multiply(new NumberLiteral(3), new NumberLiteral(5));
- double multiplyResult = expr.evalAsDouble(null);
-
- assertEquals(15, multiplyResult, 0);
-
- }
-
- public void testDiv() {
- NumberExpr expr = new BinaryOp.Div(new NumberLiteral(3), new NumberLiteral(5));
- double multiplyResult = expr.evalAsDouble(null);
-
- assertEquals(0.6, multiplyResult, 0);
-
- }
-
- public void testMod() {
- NumberExpr expr1 = new BinaryOp.Mod(new NumberLiteral(5), new NumberLiteral(2));
- double result1 = expr1.evalAsDouble(null);
-
- assertEquals(1, result1, 0);
-
- NumberExpr expr2 = new BinaryOp.Mod(new NumberLiteral(5), new NumberLiteral(-2));
- double result2 = expr2.evalAsDouble(null);
-
- assertEquals(1, result2, 0);
-
- NumberExpr expr3 = new BinaryOp.Mod(new NumberLiteral(-5), new NumberLiteral(2));
- double result3 = expr3.evalAsDouble(null);
-
- assertEquals(-1, result3, 0);
-
- NumberExpr expr4 = new BinaryOp.Mod(new NumberLiteral(-5), new NumberLiteral(-2));
- double result4 = expr4.evalAsDouble(null);
-
- assertEquals(-1, result4, 0);
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberFunctionTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberFunctionTests.java
deleted file mode 100644
index 1457f60..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/NumberFunctionTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import org.eclipse.jet.internal.xpath.functions.NumberFunction;
-
-
-public class NumberFunctionTests extends AbstractExprTest {
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.functions.NumberFunction.evaluate(Object)'
- */
- public void testEvaluateObject_String() {
-
- double result = NumberFunction.evaluate("1.0");
- assertEquals(1d, result, 0d);
- }
-
- public void testEvaluateObject_String_NaN() {
-
- double result = NumberFunction.evaluate("foo");
- assertTrue(Double.isNaN(result));
- }
-
- public void testEvaluateObject_Boolean_true() {
- double result = NumberFunction.evaluate(Boolean.valueOf(true));
- assertEquals(1d, result, 0d);
- }
-
- public void testEvaluateObject_Boolean_false() {
- double result = NumberFunction.evaluate(Boolean.valueOf(false));
- assertEquals(0d, result, 0d);
- }
-
- public void testEvaluateObject_Number() {
- double input = 1 / 3;
-
- double result = NumberFunction.evaluate(new Double(input));
- assertEquals(input, result, 0d);
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ParentStepTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ParentStepTests.java
deleted file mode 100644
index cecaf4f..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ParentStepTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-
-public class ParentStepTests extends AbstractExprTest {
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Context, INodeInspector)'
- */
- public void testEvalAsNodeSet_a() {
- Step stepExpr = new Step(
- new ContextNode(),
- Axis.parentAxis(),
- NodeTest.nameTest(Axis.parentAxis().principalNodeKind(), new ExpandedName("*"))
- );
-
- Context context = new Context(elementA, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(rootElement));
- }
-
- public void testEvalAsNodeSet_b() {
- Step stepExpr = new Step(
- new ContextNode(),
- Axis.parentAxis(),
- NodeTest.nameTest(Axis.parentAxis().principalNodeKind(), new ExpandedName("*"))
- );
-
- Context context = new Context(elementB, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(elementA));
- }
-
- public void testEvalAsNodeSet_root() {
- Step stepExpr = new Step(
- new ContextNode(),
- Axis.parentAxis(),
- NodeTest.nameTest(Axis.parentAxis().principalNodeKind(), new ExpandedName("*"))
- );
-
- Context context = new Context(rootElement, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(0, resultSet.size());
-// assertTrue(resultSet.contains(elementA));
- }
-
- public void testEvalAsNodeSet_a_b() {
- Step stepExpr = new Step(
- new Step(new ContextNode(),
- Axis.childAxis(),
- NodeTest.nameTest(Axis.childAxis().principalNodeKind(), new ExpandedName("b"))
- ),
- Axis.parentAxis(),
- NodeTest.nameTest(Axis.parentAxis().principalNodeKind(), new ExpandedName("*"))
- );
-
- Context context = new Context(elementA, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(elementA));
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingSiblingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingSiblingTests.java
deleted file mode 100644
index 6422847..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingSiblingTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Iterator;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.internal.xpath.ast.NodeTest.NameTest;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.NodeSet;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Text;
-
-/**
- * Test following-sibling axes
- *
- */
-public class PrecedingSiblingTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_ElementA() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.precedingSibling(),
- NameTest.nameTest(NodeKind.ELEMENT, new ExpandedName("a")));
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA, null));
-
- assertNotNull(result);
- assertEquals(0, result.size());
- }
-
- public void testEvalAsNodeSet_ElementA_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.precedingSibling(),
- NameTest.allNodes());
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA, null));
-
- assertNotNull(result);
- assertEquals(3, result.size());
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text);
- assertTrue(i.next() instanceof Comment);
- assertTrue(i.next() instanceof Text);
-
- }
-
- public void testEvalAsNodeSet_ElementB() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.precedingSibling(),
- NameTest.nameTest(NodeKind.ELEMENT, ExpandedName.ALL));
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB, null));
-
- assertNotNull(result);
- assertEquals(0, result.size());
-
- }
- public void testEvalAsNodeSet_ElementB_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.precedingSibling(),
- NameTest.allNodes());
-
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB, null));
-
- assertNotNull(result);
- assertEquals(1, result.size());
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text);
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingTests.java
deleted file mode 100644
index 610761f..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/PrecedingTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Iterator;
-
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.internal.xpath.ast.NodeTest.NameTest;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.NodeSet;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Element;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- * Test following-sibling axes
- *
- */
-public class PrecedingTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_ElementA() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.preceding(),
- NameTest.nameTest(NodeKind.ELEMENT, new ExpandedName("a")));
-
- Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA2, null));
-
- assertNotNull(result);
- assertEquals(1, result.size());
- Iterator i = result.iterator();
- Object next1 = i.next();
- assertTrue(next1 instanceof Element);
- assertEquals("a",((Element)next1).getNodeName());
-
- }
-
- public void testEvalAsNodeSet_ElementA_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.preceding(),
- NameTest.allNodes());
-
- Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementA2, null));
-
- assertNotNull(result);
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text); //1
- assertTrue(i.next() instanceof Text); //2
- assertTrue(i.next() instanceof Text); //3
- Element b = (Element)i.next(); //4
- assertEquals("b", b.getNodeName());
- assertTrue(i.next() instanceof Text); //5
- Element a = (Element)i.next(); //6
- assertEquals("a", a.getNodeName());
- assertTrue(i.next() instanceof Text); //7
- assertTrue(i.next() instanceof Comment); //8
- assertTrue(i.next() instanceof Text); //9
- assertTrue(i.next() instanceof ProcessingInstruction); //10
- assertEquals(10, result.size());
-
- }
-
- public void testEvalAsNodeSet_ElementB() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.preceding(),
- NameTest.nameTest(NodeKind.ELEMENT, ExpandedName.ALL));
-
- Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
- Element elementB2 = (Element) elementA2.getElementsByTagName("b").item(0);
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB2, null));
-
- assertNotNull(result);
- Iterator i = result.iterator();
- Element a = (Element) i.next();
- assertEquals("b", a.getNodeName());
- Element b = (Element) i.next();
- assertEquals("a", b.getNodeName());
- assertEquals(2, result.size());
-
-
- }
- public void testEvalAsNodeSet_ElementB_all() {
- final Step stepExpr = new Step(new ContextNode(),
- Axis.preceding(),
- NameTest.allNodes());
-
- Element elementA2 = (Element) rootElement.getElementsByTagName("a").item(1);
- Element elementB2 = (Element) elementA2.getElementsByTagName("b").item(0);
- final NodeSet result = stepExpr.evalAsNodeSet(new Context(elementB2, null));
-
- assertNotNull(result);
- Iterator i = result.iterator();
- assertTrue(i.next() instanceof Text); //1
- assertTrue(i.next() instanceof Text); //2
- assertTrue(i.next() instanceof Text); //3
- assertTrue(i.next() instanceof Text); //4
- Element b = (Element)i.next(); //5
- assertEquals("b", b.getNodeName());
- assertTrue(i.next() instanceof Text); //6
- Element a = (Element)i.next(); //7
- assertEquals("a", a.getNodeName());
- assertTrue(i.next() instanceof Text); //8
- assertTrue(i.next() instanceof Comment); //9
- assertTrue(i.next() instanceof Text); //10
- assertTrue(i.next() instanceof ProcessingInstruction); //11
- assertEquals(11, result.size());
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RelOpTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RelOpTests.java
deleted file mode 100644
index 4890b36..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RelOpTests.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * Copyright (c) 2006, 2007 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 - Initial API and implementation
- *
- */
-package org.eclipse.jet.tests.xpath;
-
-import org.eclipse.jet.internal.xpath.NodeSetImpl;
-import org.eclipse.jet.internal.xpath.ast.BooleanExpr;
-import org.eclipse.jet.internal.xpath.ast.BooleanLiteral;
-import org.eclipse.jet.internal.xpath.ast.NodeSetLiteral;
-import org.eclipse.jet.internal.xpath.ast.NumberLiteral;
-import org.eclipse.jet.internal.xpath.ast.RelOp;
-import org.eclipse.jet.internal.xpath.ast.StringLiteral;
-import org.eclipse.jet.xpath.NodeSet;
-
-public class RelOpTests extends AbstractExprTest {
-
- public void testEquals_Number_Number() {
- BooleanExpr expr = new RelOp.Eq(new NumberLiteral(3), new NumberLiteral(3));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NumberLiteral(3), new NumberLiteral(3.0001));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NumberLiteral(Double.NaN), new NumberLiteral(Double.NaN));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NumberLiteral(Double.POSITIVE_INFINITY), new NumberLiteral(Double.POSITIVE_INFINITY));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NumberLiteral(Double.NEGATIVE_INFINITY), new NumberLiteral(Double.NEGATIVE_INFINITY));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NumberLiteral(Double.POSITIVE_INFINITY), new NumberLiteral(Double.NEGATIVE_INFINITY));
- assertFalse(expr);
- }
-
- public void testEquals_String_String() {
- BooleanExpr expr = new RelOp.Eq(new StringLiteral("hello"), new StringLiteral("hello"));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new StringLiteral("hello"), new StringLiteral("world"));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new StringLiteral("hello"), new StringLiteral("hello4"));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new StringLiteral(""), new StringLiteral(""));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new StringLiteral("hello"), new StringLiteral(""));
- assertFalse(expr);
- }
-
- public void testEquals_Boolean_Boolean() {
- BooleanExpr expr = new RelOp.Eq(BooleanLiteral.TRUE, BooleanLiteral.TRUE);
- assertTrue(expr);
-
- expr = new RelOp.Eq(BooleanLiteral.FALSE, BooleanLiteral.FALSE);
- assertTrue(expr);
-
- expr = new RelOp.Eq(BooleanLiteral.FALSE, BooleanLiteral.TRUE);
- assertFalse(expr);
-
- expr = new RelOp.Eq(BooleanLiteral.TRUE, BooleanLiteral.FALSE);
- assertFalse(expr);
- }
-
- public void testEquals_Nodeset_Nodeset() {
- NodeSet empty1 = new NodeSetImpl();
- NodeSet empty2 = new NodeSetImpl();
- NodeSet singleA = new NodeSetImpl();
- singleA.add(elementA);
- NodeSet singleA2 = new NodeSetImpl();
- singleA2.add(elementA);
- NodeSet ab = new NodeSetImpl();
- ab.add(elementA);
- ab.add(elementB);
- NodeSet ba = new NodeSetImpl();
- ba.add(elementB);
- ba.add(elementA);
-
-
- // comparing to an empty node set already returns false. See http://www.w3.org/TR/xpath#booleans
- BooleanExpr expr = new RelOp.Eq(new NodeSetLiteral(empty1), new NodeSetLiteral(empty2));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(singleA), new NodeSetLiteral(empty1));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(empty1), new NodeSetLiteral(singleA));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(singleA), new NodeSetLiteral(singleA2));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(ab), new NodeSetLiteral(ba));
- assertTrue(expr);
- }
-
- public void testEquals_Nodeset_String() {
- NodeSet empty1 = new NodeSetImpl();
- NodeSet singleA = new NodeSetImpl();
- singleA.add(elementA);
- NodeSet ab = new NodeSetImpl();
- ab.add(elementA);
- ab.add(elementB);
- NodeSet ba = new NodeSetImpl();
- ba.add(elementB);
- ba.add(elementA);
-
- BooleanExpr expr = new RelOp.Eq(new NodeSetLiteral(empty1), new StringLiteral(""));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(empty1), new StringLiteral("foo"));
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(singleA), new StringLiteral(EXPECTED_A_TEXT));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(ab), new StringLiteral(EXPECTED_A_TEXT));
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(ba), new StringLiteral(EXPECTED_A_TEXT));
- assertTrue(expr);
-
- }
-
- public void testEquals_Nodeset_Boolean() {
- NodeSet empty1 = new NodeSetImpl();
- NodeSet singleA = new NodeSetImpl();
- singleA.add(elementA);
- NodeSet ab = new NodeSetImpl();
- ab.add(elementA);
- ab.add(elementB);
- NodeSet ba = new NodeSetImpl();
- ba.add(elementB);
- ba.add(elementA);
-
- BooleanExpr expr = new RelOp.Eq(new NodeSetLiteral(empty1), BooleanLiteral.TRUE);
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(empty1), BooleanLiteral.FALSE);
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(singleA), BooleanLiteral.TRUE);
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(singleA), BooleanLiteral.FALSE);
- assertFalse(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(ab), BooleanLiteral.TRUE);
- assertTrue(expr);
-
- expr = new RelOp.Eq(new NodeSetLiteral(ba), BooleanLiteral.FALSE);
- assertFalse(expr);
-
- }
-
- public void testGT_Number_Number() {
- final NumberLiteral n_3 = new NumberLiteral(3);
- final NumberLiteral n_3_0001 = new NumberLiteral(3.0001);
- final NumberLiteral n_pos_infinity = new NumberLiteral(Double.POSITIVE_INFINITY);
- final NumberLiteral n_neg_infinity = new NumberLiteral(Double.NEGATIVE_INFINITY);
- final NumberLiteral n_nan = new NumberLiteral(Double.NaN);
-
- assertFalse(new RelOp.Gt(n_3, n_3));
-
- assertFalse(new RelOp.Gt(n_3, n_3_0001));
-
- assertTrue(new RelOp.Gt(n_3_0001, n_3));
-
- assertFalse(new RelOp.Gt(n_nan, n_nan));
-
- assertFalse(new RelOp.Gt(n_3, n_nan));
-
- assertFalse(new RelOp.Gt(n_nan, n_3));
-
- assertFalse(new RelOp.Gt(n_3, n_pos_infinity));
-
- assertTrue(new RelOp.Gt(n_pos_infinity, n_3));
-
- assertFalse(new RelOp.Gt(n_neg_infinity, n_3));
-
- assertTrue(new RelOp.Gt(n_3, n_neg_infinity));
-
- assertFalse(new RelOp.Gt(n_pos_infinity, n_pos_infinity));
-
- assertFalse(new RelOp.Gt(n_neg_infinity, n_neg_infinity));
-
- assertTrue(new RelOp.Gt(n_pos_infinity, n_neg_infinity));
-
- assertFalse(new RelOp.Gt(n_neg_infinity, n_pos_infinity));
-
- }
-
- public void testGTE_Number_Number() {
- final NumberLiteral n_3 = new NumberLiteral(3);
- final NumberLiteral n_3_0001 = new NumberLiteral(3.0001);
- final NumberLiteral n_pos_infinity = new NumberLiteral(Double.POSITIVE_INFINITY);
- final NumberLiteral n_neg_infinity = new NumberLiteral(Double.NEGATIVE_INFINITY);
- final NumberLiteral n_nan = new NumberLiteral(Double.NaN);
-
- assertTrue(new RelOp.Gte(n_3, n_3));
-
- assertFalse(new RelOp.Gte(n_3, n_3_0001));
-
- assertTrue(new RelOp.Gte(n_3_0001, n_3));
-
- assertFalse(new RelOp.Gte(n_nan, n_nan));
-
- assertFalse(new RelOp.Gte(n_3, n_nan));
-
- assertFalse(new RelOp.Gte(n_nan, n_3));
-
- assertFalse(new RelOp.Gte(n_3, n_pos_infinity));
-
- assertTrue(new RelOp.Gte(n_pos_infinity, n_3));
-
- assertFalse(new RelOp.Gte(n_neg_infinity, n_3));
-
- assertTrue(new RelOp.Gte(n_3, n_neg_infinity));
-
- assertTrue(new RelOp.Gte(n_pos_infinity, n_pos_infinity));
-
- assertTrue(new RelOp.Gte(n_neg_infinity, n_neg_infinity));
-
- assertTrue(new RelOp.Gte(n_pos_infinity, n_neg_infinity));
-
- assertFalse(new RelOp.Gte(n_neg_infinity, n_pos_infinity));
-
- }
-
- public void testLT_Number_Number() {
- final NumberLiteral n_3 = new NumberLiteral(3);
- final NumberLiteral n_3_0001 = new NumberLiteral(3.0001);
- final NumberLiteral n_pos_infinity = new NumberLiteral(Double.POSITIVE_INFINITY);
- final NumberLiteral n_neg_infinity = new NumberLiteral(Double.NEGATIVE_INFINITY);
- final NumberLiteral n_nan = new NumberLiteral(Double.NaN);
-
- assertFalse(new RelOp.Lt(n_3, n_3));
-
- assertTrue(new RelOp.Lt(n_3, n_3_0001));
-
- assertFalse(new RelOp.Lt(n_3_0001, n_3));
-
- assertFalse(new RelOp.Lt(n_nan, n_nan));
-
- assertFalse(new RelOp.Lt(n_3, n_nan));
-
- assertFalse(new RelOp.Lt(n_nan, n_3));
-
- assertTrue(new RelOp.Lt(n_3, n_pos_infinity));
-
- assertFalse(new RelOp.Lt(n_pos_infinity, n_3));
-
- assertTrue(new RelOp.Lt(n_neg_infinity, n_3));
-
- assertFalse(new RelOp.Lt(n_3, n_neg_infinity));
-
- assertFalse(new RelOp.Lt(n_pos_infinity, n_pos_infinity));
-
- assertFalse(new RelOp.Lt(n_neg_infinity, n_neg_infinity));
-
- assertFalse(new RelOp.Lt(n_pos_infinity, n_neg_infinity));
-
- assertTrue(new RelOp.Lt(n_neg_infinity, n_pos_infinity));
-
- }
-
- public void testLTE_Number_Number() {
- final NumberLiteral n_3 = new NumberLiteral(3);
- final NumberLiteral n_3_0001 = new NumberLiteral(3.0001);
- final NumberLiteral n_pos_infinity = new NumberLiteral(Double.POSITIVE_INFINITY);
- final NumberLiteral n_neg_infinity = new NumberLiteral(Double.NEGATIVE_INFINITY);
- final NumberLiteral n_nan = new NumberLiteral(Double.NaN);
-
- assertTrue(new RelOp.Lte(n_3, n_3));
-
- assertTrue(new RelOp.Lte(n_3, n_3_0001));
-
- assertFalse(new RelOp.Lte(n_3_0001, n_3));
-
- assertFalse(new RelOp.Lte(n_nan, n_nan));
-
- assertFalse(new RelOp.Lte(n_3, n_nan));
-
- assertFalse(new RelOp.Lte(n_nan, n_3));
-
- assertTrue(new RelOp.Lte(n_3, n_pos_infinity));
-
- assertFalse(new RelOp.Lte(n_pos_infinity, n_3));
-
- assertTrue(new RelOp.Lte(n_neg_infinity, n_3));
-
- assertFalse(new RelOp.Lte(n_3, n_neg_infinity));
-
- assertTrue(new RelOp.Lte(n_pos_infinity, n_pos_infinity));
-
- assertTrue(new RelOp.Lte(n_neg_infinity, n_neg_infinity));
-
- assertFalse(new RelOp.Lte(n_pos_infinity, n_neg_infinity));
-
- assertTrue(new RelOp.Lte(n_neg_infinity, n_pos_infinity));
-
- }
-
- /**
- * @param expr
- */
- private void assertTrue(BooleanExpr expr) {
- assertTrue(expr.evalAsBoolean(null));
- }
-
- /**
- * @param expr
- */
- private void assertFalse(BooleanExpr expr) {
- assertFalse(expr.evalAsBoolean(null));
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceAttributeInspectorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceAttributeInspectorTests.java
deleted file mode 100644
index fba11ee..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceAttributeInspectorTests.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.xpath.inspectors.IWrappedAttribute;
-import org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector;
-import org.eclipse.jet.internal.xpath.inspectors.ResourceInspector;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-/**
- * @author pelder
- *
- */
-public class ResourceAttributeInspectorTests extends TestCase {
-
- private static String TEST_PROJECT_NAME = ResourceAttributeInspectorTests.class.getName();
-
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(ResourceAttributeInspectorTests.class)) {
- protected void setUp() throws Exception {
- JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject",
- "<newProjectModel><project name=\"" + TEST_PROJECT_NAME + "\"/></newProjectModel>",
- new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- ResourcesPlugin.getWorkspace().getRoot().getProject(TEST_PROJECT_NAME).delete(true, true, new NullProgressMonitor());
- }
- };
-
- return setup;
- }
-
- private IWorkspaceRoot workspaceRoot;
- private IProject project;
- private IFolder templatesFolder;
- private IFile mainJETFile;
- private ResourceInspector resourceInspector;
- private WrappedAttributeInspector resourceAttributeInspector;
-
-
- protected void setUp() throws Exception {
- super.setUp();
-
- workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- project = workspaceRoot.getProject(TEST_PROJECT_NAME);
- templatesFolder = project.getFolder("templates");
- mainJETFile = templatesFolder.getFile("main.jet");
-
- resourceInspector = new ResourceInspector();
- resourceAttributeInspector = new WrappedAttributeInspector();
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_root() {
- doExpandedNameTests(workspaceRoot);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_project() {
- doExpandedNameTests(project);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_folder() {
- doExpandedNameTests(templatesFolder);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_file() {
- doExpandedNameTests(mainJETFile);
- }
-
-
- /**
- * @param object
- */
- private void doExpandedNameTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertEquals(new ExpandedName(resAttr.getName()), resourceAttributeInspector.expandedNameOf(resAttr));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getChildren(java.lang.Object)}.
- */
- public void testGetChildren_root() {
- doGetChildrenTests(workspaceRoot);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getChildren(java.lang.Object)}.
- */
- public void testGetChildren_project() {
- doGetChildrenTests(project);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getChildren(java.lang.Object)}.
- */
- public void testGetChildren_folder() {
- doGetChildrenTests(templatesFolder);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getChildren(java.lang.Object)}.
- */
- public void testGetChildren_file() {
- doGetChildrenTests(mainJETFile);
- }
-
-
- /**
- * @param object
- */
- private void doGetChildrenTests(Object object) {
- Object[] children = resourceAttributeInspector.getChildren(object);
- assertNotNull(children);
- assertEquals(0, children.length);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getDocumentRoot(java.lang.Object)}.
- */
- public void testGetDocumentRoot_root() {
- doGetDocumentRootTests(workspaceRoot);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getDocumentRoot(java.lang.Object)}.
- */
- public void testGetDocumentRoot_project() {
- doGetDocumentRootTests(project);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getDocumentRoot(java.lang.Object)}.
- */
- public void testGetDocumentRoot_folder() {
- doGetDocumentRootTests(templatesFolder);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getDocumentRoot(java.lang.Object)}.
- */
- public void testGetDocumentRoot_file() {
- doGetDocumentRootTests(mainJETFile);
- }
-
-
- /**
- * @param object
- */
- private void doGetDocumentRootTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertEquals(workspaceRoot, resourceAttributeInspector.getDocumentRoot(resAttr));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getNodeKind(java.lang.Object)}.
- */
- public void testGetNodeKind_root() {
- doGetNodeKindTests(workspaceRoot);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getNodeKind(java.lang.Object)}.
- */
- public void testGetNodeKind_project() {
- doGetNodeKindTests(project);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getNodeKind(java.lang.Object)}.
- */
- public void testGetNodeKind_folder() {
- doGetNodeKindTests(templatesFolder);
- }
-
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getNodeKind(java.lang.Object)}.
- */
- public void testGetNodeKind_file() {
- doGetNodeKindTests(mainJETFile);
- }
-
-
- /**
- * @param object
- */
- private void doGetNodeKindTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertEquals(NodeKind.ATTRIBUTE, resourceAttributeInspector.getNodeKind(resAttr));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getParent(java.lang.Object)}.
- */
- public void testGetParent_root() {
- doGetParentTests(workspaceRoot);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getParent(java.lang.Object)}.
- */
- public void testGetParent_project() {
- doGetParentTests(project);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getParent(java.lang.Object)}.
- */
- public void testGetParent_folder() {
- doGetParentTests(templatesFolder);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#getParent(java.lang.Object)}.
- */
- public void testGetParent_file() {
- doGetParentTests(mainJETFile);
- }
-
- /**
- * @param object
- */
- private void doGetParentTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertEquals(object, resourceAttributeInspector.getParent(resAttr));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#nameOf(java.lang.Object)}.
- */
- public void testNameOf() {
- doNameOfTests(workspaceRoot);
- doNameOfTests(project);
- doNameOfTests(templatesFolder);
- doNameOfTests(mainJETFile);
- }
-
- /**
- * @param object
- */
- private void doNameOfTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertEquals(resAttr.getName(), resourceAttributeInspector.nameOf(resAttr));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#stringValueOf(java.lang.Object)}.
- */
- public void testStringValueOf_root() {
- doStringValueOfTests(workspaceRoot);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#stringValueOf(java.lang.Object)}.
- */
- public void testStringValueOf_project() {
- doStringValueOfTests(project);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#stringValueOf(java.lang.Object)}.
- */
- public void testStringValueOf_folder() {
- doStringValueOfTests(templatesFolder);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#stringValueOf(java.lang.Object)}.
- */
- public void testStringValueOf_file() {
- doStringValueOfTests(mainJETFile);
- }
-
- /**
- * @param object
- */
- private void doStringValueOfTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertEquals(resAttr.getName(), resAttr.getStringValue(), resourceAttributeInspector.stringValueOf(resAttr));
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#testExpandedName(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testTestExpandedName_root() {
- doTestExpandedNameTests(workspaceRoot);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#testExpandedName(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testTestExpandedName_project() {
- doTestExpandedNameTests(project);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#testExpandedName(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testTestExpandedName_folder() {
- doTestExpandedNameTests(templatesFolder);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.WrappedAttributeInspector#testExpandedName(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testTestExpandedName_file() {
- doTestExpandedNameTests(mainJETFile);
- }
-
- /**
- * @param object
- */
- private void doTestExpandedNameTests(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- for (int i = 0; i < attributes.length; i++) {
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
-
- assertTrue(resAttr.getName(), resourceAttributeInspector.testExpandedName(resAttr, new ExpandedName(resAttr.getName())));
- assertFalse(resAttr.getName(), resourceAttributeInspector.testExpandedName(resAttr, new ExpandedName("X" + resAttr.getName())));
- }
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceInspectorTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceInspectorTests.java
deleted file mode 100644
index 72a2b14..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/ResourceInspectorTests.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-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.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.xpath.inspectors.IWrappedAttribute;
-import org.eclipse.jet.internal.xpath.inspectors.ResourceInspector;
-import org.eclipse.jet.xpath.inspector.AddElementException;
-import org.eclipse.jet.xpath.inspector.CopyElementException;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.IElementInspector;
-import org.eclipse.jet.xpath.inspector.INodeInspector;
-import org.eclipse.jet.xpath.inspector.InspectorManager;
-import org.eclipse.jet.xpath.inspector.InvalidChildException;
-import org.eclipse.jet.xpath.inspector.SimpleElementRequiresValueException;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-/**
- * @author pelder
- *
- */
-public class ResourceInspectorTests extends TestCase {
-
- private static String TEST_PROJECT_NAME = ResourceInspectorTests.class.getName();
-
- public static Test suite() {
- TestSetup setup = new TestSetup(new TestSuite(ResourceInspectorTests.class)) {
- protected void setUp() throws Exception {
- final IStatus status = JET2Platform.runTransformOnString("org.eclipse.jet.transforms.newproject",
- "<newProjectModel><project name=\"" + TEST_PROJECT_NAME + "\"/></newProjectModel>",
- new NullProgressMonitor());
- assertTrue("setup Transform executed successfully", status.isOK());
- }
-
- protected void tearDown() throws Exception {
- ResourcesPlugin.getWorkspace().getRoot().getProject(TEST_PROJECT_NAME).delete(true, true, new NullProgressMonitor());
- }
- };
-
- return setup;
- }
-
- private IWorkspaceRoot workspaceRoot;
- private IProject project;
- private IFolder templatesFolder;
- private IFile mainJETFile;
- private ResourceInspector resourceInspector;
- private List expectedAttributeNames;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- project = (IProject) workspaceRoot.findMember(TEST_PROJECT_NAME);
- templatesFolder = (IFolder) project.findMember("templates");
- mainJETFile = (IFile) templatesFolder.findMember("main.jet");
-
- resourceInspector = new ResourceInspector();
-
- expectedAttributeNames = Arrays.asList(new String[] {
- "fileExtension",
- "fullPath",
- "localTimeStamp",
- "location",
- "locationURI",
- "modificationStamp",
- "name",
- "project",
- "projectRelativePath",
- "rawLocation",
- "rawLocationURI",
- "derived",
- "linked",
- "phantom",
- "readOnly",
- "teamPrivateMember",
- });
- }
-
- public void testGetInspector_root() {
- doGetInspectorTest(workspaceRoot);
- }
-
- public void testGetInspector_project() {
- doGetInspectorTest(project);
- }
-
- public void testGetInspector_folder() {
- doGetInspectorTest(templatesFolder);
- }
-
- public void testGetInspector_file() {
- doGetInspectorTest(mainJETFile);
- }
-
- /**
- * @param object
- */
- private void doGetInspectorTest(Object object) {
- INodeInspector inspector = InspectorManager.getInstance().getInspector(object);
-
- assertTrue("instanceof ResourceInspector", inspector instanceof ResourceInspector);
-
- assertTrue("instanceof IElementInspector", inspector instanceof IElementInspector);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_root() {
- ExpandedName en = resourceInspector.expandedNameOf(workspaceRoot);
- assertEquals(new ExpandedName("root"), en);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_project() {
- ExpandedName en = resourceInspector.expandedNameOf(project);
- assertEquals(new ExpandedName("project"), en);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_folder() {
- ExpandedName en = resourceInspector.expandedNameOf(templatesFolder);
- assertEquals(new ExpandedName("folder"), en);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#expandedNameOf(java.lang.Object)}.
- */
- public void testExpandedNameOf_file() {
- ExpandedName en = resourceInspector.expandedNameOf(mainJETFile);
- assertEquals(new ExpandedName("file"), en);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getChildren(java.lang.Object)}.
- * @throws CoreException
- */
- public void testGetChildren_root() throws CoreException {
- Object[] children = doGetChildrenTests(workspaceRoot);
-
- assertTrue("children.length > 0", children.length > 0);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getChildren(java.lang.Object)}.
- * @throws CoreException
- */
- public void testGetChildren_project() throws CoreException {
- Object[] children = doGetChildrenTests(project);
- assertTrue("children.length > 0", children.length > 0);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getChildren(java.lang.Object)}.
- * @throws CoreException
- */
- public void testGetChildren_folder() throws CoreException {
- Object[] children = doGetChildrenTests(templatesFolder);
- assertTrue("children.length > 0", children.length > 0);
- }
-
- /**
- * @param object
- * @throws CoreException
- */
- private Object[] doGetChildrenTests(IContainer object) throws CoreException {
- Object[] children = resourceInspector.getChildren(object);
- assertNotNull(children);
-
- IResource[] expected = object.members();
-
- assertEquals(expected.length, children.length);
- for (int i = 0; i < expected.length; i++) {
- assertEquals("Child " + i, expected[i], children[i]);
- }
-
- return children;
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getChildren(java.lang.Object)}.
- * @throws CoreException
- */
- public void testGetChildren_file() throws CoreException {
- Object[] children = resourceInspector.getChildren(mainJETFile);
- assertNotNull(children);
- assertEquals(0, children.length);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getDocumentRoot(java.lang.Object)}.
- */
- public void testGetDocumentRoot() {
- assertEquals(workspaceRoot, resourceInspector.getDocumentRoot(workspaceRoot));
- assertEquals(workspaceRoot, resourceInspector.getDocumentRoot(project));
- assertEquals(workspaceRoot, resourceInspector.getDocumentRoot(templatesFolder));
- assertEquals(workspaceRoot, resourceInspector.getDocumentRoot(mainJETFile));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getNodeKind(java.lang.Object)}.
- */
- public void testGetNodeKind() {
- assertEquals(NodeKind.ELEMENT, resourceInspector.getNodeKind(workspaceRoot));
- assertEquals(NodeKind.ELEMENT, resourceInspector.getNodeKind(project));
- assertEquals(NodeKind.ELEMENT, resourceInspector.getNodeKind(templatesFolder));
- assertEquals(NodeKind.ELEMENT, resourceInspector.getNodeKind(mainJETFile));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getParent(java.lang.Object)}.
- */
- public void testGetParent() {
- assertEquals(null, resourceInspector.getParent(workspaceRoot));
- assertEquals(workspaceRoot, resourceInspector.getParent(project));
- assertEquals(project, resourceInspector.getParent(templatesFolder));
- assertEquals(templatesFolder, resourceInspector.getParent(mainJETFile));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#nameOf(java.lang.Object)}.
- */
- public void testNameOf() {
- assertEquals("root", resourceInspector.nameOf(workspaceRoot));
- assertEquals("project", resourceInspector.nameOf(project));
- assertEquals("folder", resourceInspector.nameOf(templatesFolder));
- assertEquals("file", resourceInspector.nameOf(mainJETFile));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#stringValueOf(java.lang.Object)}.
- */
- public void testStringValueOf() {
- assertEquals("", resourceInspector.stringValueOf(workspaceRoot));
- assertEquals("", resourceInspector.stringValueOf(project));
- assertEquals("", resourceInspector.stringValueOf(templatesFolder));
- assertEquals("", resourceInspector.stringValueOf(mainJETFile));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#testExpandedName(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testTestExpandedName() {
- ExpandedName enRoot = new ExpandedName("root");
- ExpandedName enProject = new ExpandedName("project");
- ExpandedName enFolder = new ExpandedName("folder");
- ExpandedName enFile = new ExpandedName("file");
- assertTrue(resourceInspector.testExpandedName(workspaceRoot, enRoot));
- assertFalse(resourceInspector.testExpandedName(workspaceRoot, enProject));
- assertFalse(resourceInspector.testExpandedName(workspaceRoot, enFolder));
- assertFalse(resourceInspector.testExpandedName(workspaceRoot, enFile));
-
- assertFalse(resourceInspector.testExpandedName(project, enRoot));
- assertTrue(resourceInspector.testExpandedName(project, enProject));
- assertFalse(resourceInspector.testExpandedName(project, enFolder));
- assertFalse(resourceInspector.testExpandedName(project, enFile));
-
- assertFalse(resourceInspector.testExpandedName(templatesFolder, enRoot));
- assertFalse(resourceInspector.testExpandedName(templatesFolder, enProject));
- assertTrue(resourceInspector.testExpandedName(templatesFolder, enFolder));
- assertFalse(resourceInspector.testExpandedName(templatesFolder, enFile));
-
- assertFalse(resourceInspector.testExpandedName(mainJETFile, enRoot));
- assertFalse(resourceInspector.testExpandedName(mainJETFile, enProject));
- assertFalse(resourceInspector.testExpandedName(mainJETFile, enFolder));
- assertTrue(resourceInspector.testExpandedName(mainJETFile, enFile));
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#addElement(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName, java.lang.Object)}.
- * @throws InvalidChildException
- * @throws SimpleElementRequiresValueException
- */
- public void testAddElement() throws SimpleElementRequiresValueException, InvalidChildException {
- try {
- resourceInspector.addElement(null, null, null);
- fail("Unexpected success");
- } catch(UnsupportedOperationException e) {
- // success
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#addTextElement(java.lang.Object, java.lang.String, java.lang.String, boolean)}.
- * @throws AddElementException
- */
- public void testAddTextElement() throws AddElementException {
- try {
- resourceInspector.addTextElement(null, null, null, false);
- fail("Unexpected success");
- } catch(UnsupportedOperationException e) {
- // success
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#copyElement(java.lang.Object, java.lang.Object, java.lang.String, boolean)}.
- * @throws CopyElementException
- */
- public void testCopyElement() throws CopyElementException {
- try {
- resourceInspector.copyElement(null, null, null, false);
- fail("Unexpected success");
- } catch(UnsupportedOperationException e) {
- // success
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#createAttribute(java.lang.Object, java.lang.String, java.lang.String)}.
- */
- public void testCreateAttribute() {
- try {
- resourceInspector.createAttribute(null, null, null);
- fail("Unexpected success");
- } catch(UnsupportedOperationException e) {
- // success
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getAttributes(java.lang.Object)}.
- */
- public void testGetAttributes_root() {
- doGetAttributesTest(workspaceRoot);
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getAttributes(java.lang.Object)}.
- */
- public void testGetAttributes_project() {
- doGetAttributesTest(project);
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getAttributes(java.lang.Object)}.
- */
- public void testGetAttributes_folder() {
- doGetAttributesTest(templatesFolder);
-
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getAttributes(java.lang.Object)}.
- */
- public void testGetAttributes_file() {
- doGetAttributesTest(mainJETFile);
-
- }
-
- /**
- * @param object
- */
- private void doGetAttributesTest(Object object) {
- Object[] attributes = resourceInspector.getAttributes(object);
-
- assertNotNull(attributes);
-
- assertEquals(expectedAttributeNames.size(), attributes.length);
-
- Set actualNames = new HashSet(attributes.length);
- for (int i = 0; i < attributes.length; i++) {
- assertTrue("attribute[" + i + "] instanceof IResourceAttribute", attributes[i] instanceof IWrappedAttribute);
- IWrappedAttribute resAttr = (IWrappedAttribute) attributes[i];
- actualNames.add(resAttr.getName());
- }
-
- assertTrue(actualNames.containsAll(expectedAttributeNames));
- actualNames.removeAll(expectedAttributeNames);
- assertEquals(0, actualNames.size());
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getNamedAttribute(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testGetNamedAttribute_root() {
- doGetNamedAttributeTests(workspaceRoot);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getNamedAttribute(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testGetNamedAttribute_project() {
- doGetNamedAttributeTests(project);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getNamedAttribute(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testGetNamedAttribute_folder() {
- doGetNamedAttributeTests(templatesFolder);
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#getNamedAttribute(java.lang.Object, org.eclipse.jet.xpath.inspector.ExpandedName)}.
- */
- public void testGetNamedAttribute_file() {
- doGetNamedAttributeTests(mainJETFile);
- }
-
- /**
- * @param object
- */
- private void doGetNamedAttributeTests(Object object) {
- for (Iterator i = expectedAttributeNames.iterator(); i.hasNext();) {
- String name = (String) i.next();
-
- IWrappedAttribute attr = (IWrappedAttribute) resourceInspector.getNamedAttribute(object, new ExpandedName(name));
- assertNotNull(name, attr);
- assertEquals(name, attr.getName());
-
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#removeAttribute(java.lang.Object, java.lang.String)}.
- */
- public void testRemoveAttribute() {
- try {
- resourceInspector.removeAttribute(null, null);
- fail("Unexpected success");
- } catch(UnsupportedOperationException e) {
- // success
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jet.internal.xpath.inspectors.ResourceInspector#removeElement(java.lang.Object)}.
- */
- public void testRemoveElement() {
- try {
- resourceInspector.removeElement(null);
- fail("Unexpected success");
- } catch(UnsupportedOperationException e) {
- // success
- }
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RootTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RootTests.java
deleted file mode 100644
index 1dd89fa..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/RootTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import org.eclipse.jet.internal.xpath.ast.Root;
-import org.eclipse.jet.xpath.Context;
-
-public class RootTests extends AbstractExprTest {
-
- public void testEvalAsNodeSet_document_context() {
- Root rootExp = new Root();
-
- Context context = new Context(document, null);
-
- Set resultSet = rootExp.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(document));
- }
-
- public void testEvalAsNodeSet_element_context() {
- Root rootExp = new Root();
-
- Context context = new Context(elementA, null);
-
- Set resultSet = rootExp.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(document));
- }
-
- public void testEvalAsNodeSet_attribute_context() {
- Root rootExp = new Root();
-
- Context context = new Context(attr, null);
-
- Set resultSet = rootExp.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(document));
- }
-
- public void testEvalAsNodeSet_text_context() {
- Root rootExp = new Root();
-
- Context context = new Context(bText, null);
-
- Set resultSet = rootExp.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(document));
- }
-
- public void testEvalAsNodeSet_pi_context() {
- Root rootExp = new Root();
-
- Context context = new Context(pi, null);
-
- Set resultSet = rootExp.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(document));
- }
-
- public void testEvalAsNodeSet_comment_context() {
- Root rootExp = new Root();
-
- Context context = new Context(comment, null);
-
- Set resultSet = rootExp.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(document));
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/SelfStepTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/SelfStepTests.java
deleted file mode 100644
index 951bca9..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/SelfStepTests.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory;
-import org.eclipse.jet.internal.xpath.ast.Axis;
-import org.eclipse.jet.internal.xpath.ast.ContextNode;
-import org.eclipse.jet.internal.xpath.ast.NodeTest;
-import org.eclipse.jet.internal.xpath.ast.Step;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.inspector.ExpandedName;
-import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
-
-public class SelfStepTests extends TestCase {
-
- protected Resource emfResource;
- protected EObject emfRoot;
- protected EObject emfCustomer;
-
- protected void emfSetUp() throws Exception {
-
- URI fileURI = URI.createURI("platform:/plugin/org.eclipse.jet.tests/data/sample.dataaccess");
- Factory factory = Resource.Factory.Registry.INSTANCE.getFactory(fileURI);
-
- emfResource = factory.createResource(fileURI);
- emfResource.load(null);
-
- emfRoot = (EObject) emfResource.getContents().get(0);
-
- emfCustomer = (EObject) emfRoot.eContents().get(0);
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- emfSetUp();
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Context)'
- */
- public void testEvalAsNodeSet_root_element_contents() {
- Step stepExpr = new Step(new ContextNode(),
- Axis.selfAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("contents")));
-
- Context context = new Context(emfRoot, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(emfRoot));
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Context)'
- */
- public void testEvalAsNodeSet_root_element_Employee() {
- Step stepExpr = new Step(new ContextNode(),
- Axis.selfAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("Employee")));
-
- Context context = new Context(emfRoot, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(emfRoot));
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Context)'
- */
- public void testEvalAsNodeSet_customer_element_customers() {
- Step stepExpr = new Step(new ContextNode(),
- Axis.selfAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("customers")));
-
- Context context = new Context(emfCustomer, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(emfCustomer));
-
- }
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Context)'
- */
- public void testEvalAsNodeSet_customer_element_Customer() {
- Step stepExpr = new Step(new ContextNode(),
- Axis.selfAxis(),
- NodeTest.nameTest(NodeKind.ELEMENT, new ExpandedName("Customer")));
-
- Context context = new Context(emfCustomer, null);
-
- Set resultSet = stepExpr.evalAsNodeSet(context);
-
- assertNotNull(resultSet);
- assertEquals(1, resultSet.size());
- assertTrue(resultSet.contains(emfCustomer));
-
- }
-
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/StringFunctionTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/StringFunctionTests.java
deleted file mode 100644
index 43bf8b7..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/StringFunctionTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import org.eclipse.jet.internal.xpath.NodeSetImpl;
-import org.eclipse.jet.internal.xpath.functions.StringFunction;
-import org.eclipse.jet.xpath.NodeSet;
-
-public class StringFunctionTests extends AbstractExprTest {
-
- /*
- * Test method for 'org.eclipse.jet.internal.xpath.functions.StringFunction.evaluate(Object)'
- */
- public void testEvaluateObject_boolean_true() {
-
- String result = StringFunction.evaluate(Boolean.TRUE);
- assertEquals("true", result);
-
- }
- public void testEvaluateObject_boolean_false() {
-
- String result = StringFunction.evaluate(Boolean.FALSE);
- assertEquals("false", result);
-
- }
-
- public void testEvaluateObject_Number() {
- String result = StringFunction.evaluate(new Double(3.14159265));
- assertEquals("3.14159265", result);
-
- String resultNaN = StringFunction.evaluate(new Double(Double.NaN));
- assertEquals("NaN", resultNaN);
-
- String resultNegInf = StringFunction.evaluate(new Double(Double.NEGATIVE_INFINITY));
- assertEquals("-Infinity", resultNegInf);
-
- String resultPosInf = StringFunction.evaluate(new Double(Double.POSITIVE_INFINITY));
- assertEquals("Infinity", resultPosInf);
- }
-
- public void testEvaluateObject_String() {
- String result = StringFunction.evaluate("r 3.14159265");
- assertEquals("r 3.14159265", result);
-
- }
-
- public void testEvaluateObject_NodeSet() {
- NodeSet nodeset = new NodeSetImpl();
- nodeset.add(elementA);
- nodeset.add(elementB);
-
- String result = StringFunction.evaluate(nodeset);
- assertEquals(EXPECTED_A_TEXT, result);
-
- nodeset.clear();
- nodeset.add(elementB);
- nodeset.add(elementA);
-
- result = StringFunction.evaluate(nodeset);
- assertEquals(EXPECTED_B_TEXT, result);
-
- }
-}
diff --git a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/VariableTests.java b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/VariableTests.java
deleted file mode 100644
index fc4fcf6..0000000
--- a/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/xpath/VariableTests.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.jet.tests.xpath;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jet.internal.xpath.NodeSetImpl;
-import org.eclipse.jet.internal.xpath.ast.ExprNode;
-import org.eclipse.jet.internal.xpath.ast.Variable;
-import org.eclipse.jet.xpath.Context;
-import org.eclipse.jet.xpath.NodeSet;
-
-public class VariableTests extends AbstractExprTest {
-
- public void testStringVariable() {
- Map vars = new HashMap();
-
- vars.put("x", "something");
-
- ExprNode expr = new Variable("x");
-
- Object result = expr.evalAsObject(new Context(null, vars, null));
-
- assertEquals("something", result);
- }
-
- public void testNumberVariable() {
- Map vars = new HashMap();
- double expected = 3.141592653589d;
- vars.put("x", new Double(expected));
-
- ExprNode expr = new Variable("x");
-
- Object result = expr.evalAsObject(new Context(null, vars, null));
-
- assertTrue(result instanceof Number);
- assertEquals(expected, ((Number)result).doubleValue(), 0);
-
- }
-
- public void testBooleanVariable() {
- Map vars = new HashMap();
- boolean expected = true;
- vars.put("x", Boolean.valueOf(expected));
-
- ExprNode expr = new Variable("x");
-
- Object result = expr.evalAsObject(new Context(null, vars, null));
-
- assertTrue(result instanceof Boolean);
- assertEquals(expected, ((Boolean)result).booleanValue());
-
- }
-
- public void testNodeVariable() {
- Map vars = new HashMap();
- vars.put("x", elementA);
-
- ExprNode expr = new Variable("x");
-
- Object result = expr.evalAsObject(new Context(null, vars, null));
-
- assertTrue(result instanceof NodeSet);
- NodeSet resultSet = (NodeSet)result;
- assertTrue(resultSet.size() == 1);
- assertTrue(resultSet.contains(elementA));
- }
-
- public void testNodeSetVariable() {
- Map vars = new HashMap();
- NodeSet set = new NodeSetImpl();
- set.add(elementA);
- set.add(elementB);
- vars.put("x", set);
-
- ExprNode expr = new Variable("x");
-
- Object result = expr.evalAsObject(new Context(null, vars, null));
-
- assertTrue(result instanceof NodeSet);
- NodeSet resultSet = (NodeSet)result;
- assertTrue(resultSet.size() == 2);