Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-02-24 19:19:03 +0000
committerpelder2006-02-24 19:19:03 +0000
commitcf44b010c9f9e75f08f52dca3fe9e34e7ff57205 (patch)
tree1436f903691e7a5e230cea2b1549f52326e09639 /tests/org.eclipse.jet.tests/data
parent79d9bb81ecd0f91b46087d61dac630f0d1bd6ddb (diff)
downloadorg.eclipse.jet-cf44b010c9f9e75f08f52dca3fe9e34e7ff57205.tar.gz
org.eclipse.jet-cf44b010c9f9e75f08f52dca3fe9e34e7ff57205.tar.xz
org.eclipse.jet-cf44b010c9f9e75f08f52dca3fe9e34e7ff57205.zip
Initial commit
Diffstat (limited to 'tests/org.eclipse.jet.tests/data')
-rw-r--r--tests/org.eclipse.jet.tests/data/DOMInspector.xml11
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet34
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet.expected93
-rw-r--r--tests/org.eclipse.jet.tests/data/bean.model.sample.xml22
-rw-r--r--tests/org.eclipse.jet.tests/data/beans.xsd42
-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/sample.dataaccess10
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet10
-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.java94
-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
23 files changed, 721 insertions, 0 deletions
diff --git a/tests/org.eclipse.jet.tests/data/DOMInspector.xml b/tests/org.eclipse.jet.tests/data/DOMInspector.xml
new file mode 100644
index 0000000..9095579
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/DOMInspector.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<root rootAttr="test">
+ <!-- a comment within root -->
+ <a name="foo">
+ <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
new file mode 100644
index 0000000..241c44d
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/alljet2.jet
@@ -0,0 +1,34 @@
+<%@jet class="Foo" package="org.eclipse.emf.examples"%>
+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
new file mode 100644
index 0000000..c86b856
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/alljet2.jet.expected
@@ -0,0 +1,93 @@
+<directive name="jet" start="(0,0)" stop="(0,55)">
+ <attribute name="class">Foo</attribute>
+ <attribute name="package">org.eclipse.emf.examples</attribute>
+</directive>
+<data>
+Some top level text.
+</data>
+<expression start="(2,3)" stop="(2,20)"> "An expression" </expression>
+<data>
+</data>
+<declaration start="(3,3)" stop="(7,0)">
+int foo() {
+ return 3;
+}
+</declaration>
+<data>
+</data>
+<scriptlet start="(8,2)" stop="(12,0)">
+if(foo() > 0) {
+ foo();
+}
+</scriptlet>
+<data>
+</data>
+<comment start="(13,4)" stop="(13,15)"> a comment </comment>
+<data>
+</data>
+<tag name="test:container" start="(14,0)" stop="(14,46)">
+ <attribute name="one">test one</attribute>
+ <attribute name="two">test two</attribute>
+ <content>
+ <data>
+ </data>
+ <tag name="test:empty" start="(15,4)" stop="(15,17)">
+ </tag>
+ <data>
+ </data>
+ <tag name="test:container" start="(16,4)" stop="(16,20)">
+ <content>
+ <data>
+ some text <nontest:text attributes="foo"/>
+ </data>
+ </content>
+ </tag>
+ <data>
+</data>
+ </content>
+</tag>
+<data>
+</data>
+<comment start="(20,4)" stop="(20,26)"> tags containing Java </comment>
+<data>
+</data>
+<tag name="test:container" start="(21,0)" stop="(21,16)">
+ <content>
+ <data>
+ </data>
+ <expression start="(22,7)" stop="(22,15)"> foo(); </expression>
+ <data>
+ </data>
+ <scriptlet start="(23,6)" stop="(23,23)"> if(foo() > 0) { </scriptlet>
+ <data>
+ some text
+ </data>
+ <scriptlet start="(25,6)" stop="(25,9)"> } </scriptlet>
+ <data>
+</data>
+ </content>
+</tag>
+<data>
+</data>
+<comment start="(27,4)" stop="(27,25)"> Java container tags </comment>
+<data>
+</data>
+<scriptlet start="(28,2)" stop="(28,19)"> if(foo() > 0) { </scriptlet>
+<data>
+ some text
+ </data>
+<tag name="test:empty" start="(30,8)" stop="(30,21)">
+</tag>
+<data>
+ </data>
+<tag name="test:container" start="(31,8)" stop="(31,24)">
+ <content>
+ <data>
+ </data>
+ </content>
+</tag>
+<data>
+</data>
+<scriptlet start="(33,2)" stop="(33,5)"> } </scriptlet>
+<data>
+</data>
diff --git a/tests/org.eclipse.jet.tests/data/bean.model.sample.xml b/tests/org.eclipse.jet.tests/data/bean.model.sample.xml
new file mode 100644
index 0000000..c2367f2
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/bean.model.sample.xml
@@ -0,0 +1,22 @@
+<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/beans.xsd b/tests/org.eclipse.jet.tests/data/beans.xsd
new file mode 100644
index 0000000..8635462
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/beans.xsd
@@ -0,0 +1,42 @@
+<?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:complexType>
+
+ <xsd:element name="root" type="root"/>
+
+</xsd:schema>
diff --git a/tests/org.eclipse.jet.tests/data/dm-example.xml b/tests/org.eclipse.jet.tests/data/dm-example.xml
new file mode 100644
index 0000000..f03f715
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/dm-example.xml
@@ -0,0 +1,37 @@
+<?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
new file mode 100644
index 0000000..0231cf3
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/dm-example.xsd
@@ -0,0 +1,145 @@
+<?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
new file mode 100644
index 0000000..7003325
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/jetast.ecore
@@ -0,0 +1,97 @@
+<?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
new file mode 100644
index 0000000..51ba39c
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/library.xml
@@ -0,0 +1,25 @@
+<?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/library.xml.indisguise b/tests/org.eclipse.jet.tests/data/library.xml.indisguise
new file mode 100644
index 0000000..bd34f57
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/library.xml.indisguise
@@ -0,0 +1,25 @@
+<?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/sample.dataaccess b/tests/org.eclipse.jet.tests/data/sample.dataaccess
new file mode 100644
index 0000000..1a7865b
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/sample.dataaccess
@@ -0,0 +1,10 @@
+<?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/taglibs.jet b/tests/org.eclipse.jet.tests/data/taglibs.jet
new file mode 100644
index 0000000..2bc9dfc
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/taglibs.jet
@@ -0,0 +1,10 @@
+<%@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.astdump.expected b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
new file mode 100644
index 0000000..f1e0329
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
@@ -0,0 +1,46 @@
+<directive name="taglib" start="0" stop="70">
+ <attribute name="prefix">test</attribute>
+ <attribute name="id">org.eclipse.jet.tests.TestLibrary</attribute>
+</directive>
+<data>
+"isAllUpper", "nl", "other", "tokenize", "upper"
+
+</data>
+<tag name="test:tokenize" start="123" stop="181">
+ <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" start="183" stop="195">
+ <content>
+ <data>some text</data>
+ </content>
+ </tag>
+ <data>
+</data>
+ <tag name="test:isAllUpper" start="219" stop="248">
+ <attribute name="var">token</attribute>
+ <content>
+ <data>
+</data>
+ </content>
+ </tag>
+ <data>
+</data>
+ <tag name="test:upper" start="270" stop="282">
+ <content>
+ <data>foo</data>
+ </content>
+ </tag>
+ <tag name="test:nl" start="298" stop="308">
+ </tag>
+ <data>
+</data>
+ <tag name="test:other" start="310" stop="323">
+ </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
new file mode 100644
index 0000000..2cfe073
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/taglibs.jet.expected.java
@@ -0,0 +1,94 @@
+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(JET2Context context, JET2Writer out) {
+
+ final TagInfo _jettd_test_tokenize_4_123_181 = new TagInfo( "test:tokenize", 4, 123, 181, new String[] {"sep", "var", "string", }, new String[] {",", "token", "a,b,c,d,e,f,g", });
+final TagInfo _jettd_test_other_5_183_195 = new TagInfo( "test:other", 5, 183, 195, new String[] {}, new String[] {});
+final TagInfo _jettd_test_isAllUpper_6_219_248 = new TagInfo( "test:isAllUpper", 6, 219, 248, new String[] {"var", }, new String[] {"token", });
+final TagInfo _jettd_test_upper_8_270_282 = new TagInfo( "test:upper", 8, 270, 282, new String[] {}, new String[] {});
+final TagInfo _jettd_test_nl_8_298_308 = new TagInfo( "test:nl", 8, 298, 308, new String[] {}, new String[] {});
+final TagInfo _jettd_test_other_9_310_323 = new TagInfo( "test:other", 9, 310, 323, new String[] {}, new String[] {});
+
+
+ out.write("\r\n\"isAllUpper\", \"nl\", \"other\", \"tokenize\", \"upper\"\r\n\r\n");
+ RuntimeTagElement _jettag_test_tokenize_4_123_181 = context.getTagFactory().createRuntimeTag(_jetns_test, "tokenize", "test:tokenize", _jettd_test_tokenize_4_123_181);
+ _jettag_test_tokenize_4_123_181.setRuntimeParent(null);
+ _jettag_test_tokenize_4_123_181.setTagInfo(_jettd_test_tokenize_4_123_181);
+ _jettag_test_tokenize_4_123_181.doStart(context, out);
+ while (_jettag_test_tokenize_4_123_181.okToProcessBody()) {
+
+out.write("\r\n");
+ RuntimeTagElement _jettag_test_other_5_183_195 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_5_183_195);
+ _jettag_test_other_5_183_195.setRuntimeParent(_jettag_test_tokenize_4_123_181);
+ _jettag_test_other_5_183_195.setTagInfo(_jettd_test_other_5_183_195);
+ _jettag_test_other_5_183_195.doStart(context, out);
+ while (_jettag_test_other_5_183_195.okToProcessBody()) {
+
+out.write("some text");
+ _jettag_test_other_5_183_195.handleBodyContent(out);
+ }
+ _jettag_test_other_5_183_195.doEnd();
+out.write("\r\n");
+ RuntimeTagElement _jettag_test_isAllUpper_6_219_248 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _jettd_test_isAllUpper_6_219_248);
+ _jettag_test_isAllUpper_6_219_248.setRuntimeParent(_jettag_test_tokenize_4_123_181);
+ _jettag_test_isAllUpper_6_219_248.setTagInfo(_jettd_test_isAllUpper_6_219_248);
+ _jettag_test_isAllUpper_6_219_248.doStart(context, out);
+ while (_jettag_test_isAllUpper_6_219_248.okToProcessBody()) {
+
+out.write("\r\n");
+ _jettag_test_isAllUpper_6_219_248.handleBodyContent(out);
+ }
+ _jettag_test_isAllUpper_6_219_248.doEnd();
+out.write("\r\n");
+ RuntimeTagElement _jettag_test_upper_8_270_282 = context.getTagFactory().createRuntimeTag(_jetns_test, "upper", "test:upper", _jettd_test_upper_8_270_282);
+ _jettag_test_upper_8_270_282.setRuntimeParent(_jettag_test_tokenize_4_123_181);
+ _jettag_test_upper_8_270_282.setTagInfo(_jettd_test_upper_8_270_282);
+ _jettag_test_upper_8_270_282.doStart(context, out);
+ JET2Writer _jettag_test_upper_8_270_282_saved_out = out;
+ while (_jettag_test_upper_8_270_282.okToProcessBody()) {
+ out = out.newNestedContentWriter();
+
+out.write("foo");
+ _jettag_test_upper_8_270_282.handleBodyContent(out);
+ }
+ out = _jettag_test_upper_8_270_282_saved_out;
+ _jettag_test_upper_8_270_282.doEnd();
+ RuntimeTagElement _jettag_test_nl_8_298_308 = context.getTagFactory().createRuntimeTag(_jetns_test, "nl", "test:nl", _jettd_test_nl_8_298_308);
+ _jettag_test_nl_8_298_308.setRuntimeParent(_jettag_test_tokenize_4_123_181);
+ _jettag_test_nl_8_298_308.setTagInfo(_jettd_test_nl_8_298_308);
+ _jettag_test_nl_8_298_308.doStart(context, out);
+
+ _jettag_test_nl_8_298_308.doEnd();
+out.write("\r\n");
+ RuntimeTagElement _jettag_test_other_9_310_323 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _jettd_test_other_9_310_323);
+ _jettag_test_other_9_310_323.setRuntimeParent(_jettag_test_tokenize_4_123_181);
+ _jettag_test_other_9_310_323.setTagInfo(_jettd_test_other_9_310_323);
+ _jettag_test_other_9_310_323.doStart(context, out);
+
+ _jettag_test_other_9_310_323.doEnd();
+out.write("\r\n");
+ _jettag_test_tokenize_4_123_181.handleBodyContent(out);
+ }
+ _jettag_test_tokenize_4_123_181.doEnd();
+
+ }
+
+}
+ \ No newline at end of file
diff --git a/tests/org.eclipse.jet.tests/data/unclosedComment.jet b/tests/org.eclipse.jet.tests/data/unclosedComment.jet
new file mode 100644
index 0000000..ba01d6f
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedComment.jet
@@ -0,0 +1,3 @@
+<%@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
new file mode 100644
index 0000000..a12518f
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedDeclaration.jet
@@ -0,0 +1,3 @@
+<%@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
new file mode 100644
index 0000000..c822dec
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedDirective.jet
@@ -0,0 +1 @@
+<%@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
new file mode 100644
index 0000000..b67abe9
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedExpression.jet
@@ -0,0 +1,3 @@
+<%@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
new file mode 100644
index 0000000..dd654a9
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedScriplet.jet
@@ -0,0 +1,3 @@
+<%@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
new file mode 100644
index 0000000..188636c
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedXMLEnd.jet
@@ -0,0 +1,3 @@
+<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
+
+</test:start
diff --git a/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet b/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
new file mode 100644
index 0000000..d3e55e0
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/unclosedXMLStart.jet
@@ -0,0 +1,3 @@
+<%@jet package="org.eclipse.emf.examples.test" class="Foo" %>
+
+<test:start attr="foo"
diff --git a/tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet b/tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet
new file mode 100644
index 0000000..a614208
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/xmlEndWithAttributes.jet
@@ -0,0 +1,3 @@
+<%@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
new file mode 100644
index 0000000..54760f5
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/data/xmlStartWithoutEnd.jet
@@ -0,0 +1,8 @@
+<%@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

Back to the top