Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpelder2008-05-22 11:07:12 -0400
committerpelder2008-05-22 11:07:12 -0400
commit6b47d8b5efddb46a24fd061c71f05fc335d062fe (patch)
tree4d293c7d751becae6ba051b58728d6087008960a /tests
parent3e99a8f723c17ca6b094c09613ee293f66b29425 (diff)
downloadorg.eclipse.jet-6b47d8b5efddb46a24fd061c71f05fc335d062fe.tar.gz
org.eclipse.jet-6b47d8b5efddb46a24fd061c71f05fc335d062fe.tar.xz
org.eclipse.jet-6b47d8b5efddb46a24fd061c71f05fc335d062fe.zip
[205811] Define a mechanism for including copyright notices in all JET generated Java classes
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet7
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet.expected45
-rw-r--r--tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java11
3 files changed, 46 insertions, 17 deletions
diff --git a/tests/org.eclipse.jet.tests/data/alljet2.jet b/tests/org.eclipse.jet.tests/data/alljet2.jet
index 241c44d..f38e90f 100644
--- a/tests/org.eclipse.jet.tests/data/alljet2.jet
+++ b/tests/org.eclipse.jet.tests/data/alljet2.jet
@@ -1,4 +1,11 @@
<%@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" %>
<%!
diff --git a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected b/tests/org.eclipse.jet.tests/data/alljet2.jet.expected
index 43b65a2..1208675 100644
--- a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected
+++ b/tests/org.eclipse.jet.tests/data/alljet2.jet.expected
@@ -3,39 +3,50 @@
<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="(3,4)" stop="(3,21)"> "An expression" </expression>
+<expression start="(10,4)" stop="(10,21)"> "An expression" </expression>
<data>
</data>
-<declaration start="(4,4)" stop="(8,1)">
+<declaration start="(11,4)" stop="(15,1)">
int foo() {
return 3;
}
</declaration>
<data>
</data>
-<scriptlet start="(9,3)" stop="(13,1)">
+<scriptlet start="(16,3)" stop="(20,1)">
if(foo() > 0) {
foo();
}
</scriptlet>
<data>
</data>
-<comment start="(14,5)" stop="(14,16)"> a comment </comment>
+<comment start="(21,5)" stop="(21,16)"> a comment </comment>
<data>
</data>
-<tag name="test:container" start="(15,1)" stop="(15,47)">
+<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="(16,5)" stop="(16,18)">
+ <tag name="test:empty" start="(23,5)" stop="(23,18)">
</tag>
<data>
</data>
- <tag name="test:container" start="(17,5)" stop="(17,21)">
+ <tag name="test:container" start="(24,5)" stop="(24,21)">
<content>
<data>
some text <nontest:text attributes="foo"/>
@@ -48,39 +59,39 @@ if(foo() > 0) {
</tag>
<data>
</data>
-<comment start="(21,5)" stop="(21,27)"> tags containing Java </comment>
+<comment start="(28,5)" stop="(28,27)"> tags containing Java </comment>
<data>
</data>
-<tag name="test:container" start="(22,1)" stop="(22,17)">
+<tag name="test:container" start="(29,1)" stop="(29,17)">
<content>
<data>
</data>
- <expression start="(23,8)" stop="(23,16)"> foo(); </expression>
+ <expression start="(30,8)" stop="(30,16)"> foo(); </expression>
<data>
</data>
- <scriptlet start="(24,7)" stop="(24,24)"> if(foo() > 0) { </scriptlet>
+ <scriptlet start="(31,7)" stop="(31,24)"> if(foo() > 0) { </scriptlet>
<data>
some text
</data>
- <scriptlet start="(26,7)" stop="(26,10)"> } </scriptlet>
+ <scriptlet start="(33,7)" stop="(33,10)"> } </scriptlet>
<data>
</data>
</content>
</tag>
<data>
</data>
-<comment start="(28,5)" stop="(28,26)"> Java container tags </comment>
+<comment start="(35,5)" stop="(35,26)"> Java container tags </comment>
<data>
</data>
-<scriptlet start="(29,3)" stop="(29,20)"> if(foo() > 0) { </scriptlet>
+<scriptlet start="(36,3)" stop="(36,20)"> if(foo() > 0) { </scriptlet>
<data>
some text
</data>
-<tag name="test:empty" start="(31,9)" stop="(31,22)">
+<tag name="test:empty" start="(38,9)" stop="(38,22)">
</tag>
<data>
</data>
-<tag name="test:container" start="(32,9)" stop="(32,25)">
+<tag name="test:container" start="(39,9)" stop="(39,25)">
<content>
<data>
</data>
@@ -88,6 +99,6 @@ if(foo() > 0) {
</tag>
<data>
</data>
-<scriptlet start="(34,3)" stop="(34,6)"> } </scriptlet>
+<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
index 4d19cf8..80cdc4c 100644
--- a/tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java
+++ b/tests/org.eclipse.jet.tests/data/alljet2.jet.expected.java
@@ -1,9 +1,17 @@
+/*
+ * 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 {
@@ -28,6 +36,7 @@ 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$
@@ -40,6 +49,7 @@ if(foo() > 0) {
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$
@@ -51,6 +61,7 @@ if(foo() > 0) {
}
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);

Back to the top