Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.input.jet.expected.java43
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.loader.expected.java103
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.nopredefs.expected.java20
-rw-r--r--tests/org.eclipse.jet.tests/data/simplifiedCompiler/templates/simple.v2.usePredefTagLibs.jet.predefs.expected.java24
4 files changed, 93 insertions, 97 deletions
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
index 92b9eeb..10083d8 100644
--- 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
@@ -9,22 +9,14 @@ 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.getProperties().getProperty("line.separator");
-
- private static final class _TEXT {
- private static final String TEXT_1 = "\"isAllUpper\", \"nl\", \"other\", \"tokenize\", \"upper\"" + NL + NL; //$NON-NLS-1$
- private static final String TEXT_2 = "some text"; //$NON-NLS-1$
- private static final String TEXT_3 = NL;
- private static final String TEXT_4 = "foo"; //$NON-NLS-1$
- private static final String TEXT_5 = NL;
+ public _jet_simplev2input() {
+ super();
}
+ private static final String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$
+
private static final class _TAGS {
- private static final TagInfo test_tokenize_4_1 = new TagInfo("test:tokenize", //$NON-NLS-1$
+ static final TagInfo test_tokenize_4_1 = new TagInfo("test:tokenize", //$NON-NLS-1$
4, 1,
new String[] {
"sep", //$NON-NLS-1$
@@ -36,13 +28,13 @@ public class _jet_simplev2input implements JET2Template {
"token", //$NON-NLS-1$
"a,b,c,d,e,f,g", //$NON-NLS-1$
} );
- private static final TagInfo test_other_5_1 = new TagInfo("test:other", //$NON-NLS-1$
+ static final TagInfo test_other_5_1 = new TagInfo("test:other", //$NON-NLS-1$
5, 1,
new String[] {
},
new String[] {
} );
- private static final TagInfo test_isAllUpper_6_1 = new TagInfo("test:isAllUpper", //$NON-NLS-1$
+ static final TagInfo test_isAllUpper_6_1 = new TagInfo("test:isAllUpper", //$NON-NLS-1$
6, 1,
new String[] {
"var", //$NON-NLS-1$
@@ -50,19 +42,19 @@ public class _jet_simplev2input implements JET2Template {
new String[] {
"token", //$NON-NLS-1$
} );
- private static final TagInfo test_upper_8_1 = new TagInfo("test:upper", //$NON-NLS-1$
+ static final TagInfo test_upper_8_1 = new TagInfo("test:upper", //$NON-NLS-1$
8, 1,
new String[] {
},
new String[] {
} );
- private static final TagInfo test_nl_8_29 = new TagInfo("test:nl", //$NON-NLS-1$
+ static final TagInfo test_nl_8_29 = new TagInfo("test:nl", //$NON-NLS-1$
8, 29,
new String[] {
},
new String[] {
} );
- private static final TagInfo test_other_9_1 = new TagInfo("test:other", //$NON-NLS-1$
+ static final TagInfo test_other_9_1 = new TagInfo("test:other", //$NON-NLS-1$
9, 1,
new String[] {
},
@@ -70,8 +62,11 @@ public class _jet_simplev2input implements JET2Template {
} );
}
- public void generate(final JET2Context context, JET2Writer out) {
- out.write(_TEXT.TEXT_1);
+ 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", _TAGS.test_tokenize_4_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_test_tokenize_4_1.setRuntimeParent(null);
_jettag_test_tokenize_4_1.setTagInfo(_TAGS.test_tokenize_4_1);
@@ -82,11 +77,11 @@ public class _jet_simplev2input implements JET2Template {
_jettag_test_other_5_1.setTagInfo(_TAGS.test_other_5_1);
_jettag_test_other_5_1.doStart(context, out);
while (_jettag_test_other_5_1.okToProcessBody()) {
- out.write(_TEXT.TEXT_2);
+ out.write("some text"); //$NON-NLS-1$
_jettag_test_other_5_1.handleBodyContent(out);
}
_jettag_test_other_5_1.doEnd();
- out.write(_TEXT.TEXT_3);
+ out.write(NL);
RuntimeTagElement _jettag_test_isAllUpper_6_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "isAllUpper", "test:isAllUpper", _TAGS.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(_TAGS.test_isAllUpper_6_1);
@@ -102,7 +97,7 @@ public class _jet_simplev2input implements JET2Template {
JET2Writer _jettag_test_upper_8_1_saved_out = out;
while (_jettag_test_upper_8_1.okToProcessBody()) {
out = out.newNestedContentWriter();
- out.write(_TEXT.TEXT_4);
+ out.write("foo"); //$NON-NLS-1$
_jettag_test_upper_8_1.handleBodyContent(out);
}
out = _jettag_test_upper_8_1_saved_out;
@@ -112,7 +107,7 @@ public class _jet_simplev2input implements JET2Template {
_jettag_test_nl_8_29.setTagInfo(_TAGS.test_nl_8_29);
_jettag_test_nl_8_29.doStart(context, out);
_jettag_test_nl_8_29.doEnd();
- out.write(_TEXT.TEXT_5);
+ out.write(NL);
RuntimeTagElement _jettag_test_other_9_1 = context.getTagFactory().createRuntimeTag(_jetns_test, "other", "test:other", _TAGS.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(_TAGS.test_other_9_1);
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
index c73aeff..7cb9a2a 100644
--- 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
@@ -9,72 +9,75 @@ import org.eclipse.jet.JET2Template;
public class TemplateLoaderClass implements JET2TemplateLoader, JET2TemplateLoaderExtension {
- private static final class TemplateFactoryMethod {
+ private static final class TemplateFactoryMethod {
- private final String templatePath;
- private final String templateClass;
+ private final String templatePath;
+ private final String templateClass;
- public TemplateFactoryMethod(String templatePath, String templateClass) {
- this.templatePath = templatePath;
- this.templateClass = templateClass;
-
- }
-
- public String getTemplateClass() {
- return templateClass;
- }
+ public TemplateFactoryMethod(String templatePath, String templateClass) {
+ this.templatePath = templatePath;
+ this.templateClass = templateClass;
+
+ }
+
+ public String getTemplateClass() {
+ return this.templateClass;
+ }
- public String getTemplatePath() {
- return templatePath;
- }
+ public String getTemplatePath() {
+ return this.templatePath;
+ }
- public JET2Template newTemplate() {
- JET2Template template = null;
- try {
- template = (JET2Template) Class.forName(templateClass).newInstance();
- } catch (InstantiationException e) {
- } catch (IllegalAccessException e) {
- } catch (ClassNotFoundException e) {
- }
- return template;
- }
-
-
- }
+ 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;
+ private Map pathToFactoryMap = null;
+
+ private JET2TemplateLoader delegate = null;
- public TemplateLoaderClass() {
- super();
- }
+ public TemplateLoaderClass() {
+ super();
+ }
- public JET2Template getTemplate(String templatePath) {
- if(pathToFactoryMap == null) {
- initPathToFactoryMap();
+ public JET2Template getTemplate(String templatePath) {
+ if(this.pathToFactoryMap == null) {
+ initPathToFactoryMap();
}
- TemplateFactoryMethod factory = (TemplateFactoryMethod)pathToFactoryMap.get(templatePath);
- return factory == null ? delegate == null ? null : delegate.getTemplate(templatePath) : factory.newTemplate();
- }
+ 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) {
- pathToFactoryMap.put(templatePath, //$NON-NLS-1$
- new TemplateFactoryMethod(templatePath, templateClass));
- }
-
+ private void addTemplate(String templatePath, String templateClass) {
+ this.pathToFactoryMap.put(templatePath,
+ new TemplateFactoryMethod(templatePath, templateClass));
+ }
+
private void initPathToFactoryMap() {
- 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$
- }
+ 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 delegate;
+ return this.delegate;
}
}
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
index 578bafa..3baccfb 100644
--- 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
@@ -6,18 +6,18 @@ import org.eclipse.jet.JET2Writer;
public class _jet_simplev2usePredefTagLibs implements JET2Template {
- public _jet_simplev2usePredefTagLibs() {
- super();
- }
-
- private static final String NL = System.getProperties().getProperty("line.separator");
-
- private static final class _TEXT {
- private static final String TEXT_1 = "This template uses a predefined tag library:" + NL + NL + "<c:get select=\"$useMe/@attr\"/>" + NL; //$NON-NLS-1$ //$NON-NLS-2$
+ public _jet_simplev2usePredefTagLibs() {
+ super();
}
+ private static final String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$
- public void generate(final JET2Context context, JET2Writer out) {
- out.write(_TEXT.TEXT_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
index 2eeaaed..e57c391 100644
--- 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
@@ -9,19 +9,14 @@ 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.getProperties().getProperty("line.separator");
-
- private static final class _TEXT {
- private static final String TEXT_1 = "This template uses a predefined tag library:" + NL + NL; //$NON-NLS-1$
- private static final String TEXT_2 = NL;
+ public _jet_simplev2usePredefTagLibs() {
+ super();
}
+ private static final String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$
+
private static final class _TAGS {
- private static final TagInfo c_get_3_1 = new TagInfo("c:get", //$NON-NLS-1$
+ static final TagInfo c_get_3_1 = new TagInfo("c:get", //$NON-NLS-1$
3, 1,
new String[] {
"select", //$NON-NLS-1$
@@ -31,13 +26,16 @@ public class _jet_simplev2usePredefTagLibs implements JET2Template {
} );
}
- public void generate(final JET2Context context, JET2Writer out) {
- out.write(_TEXT.TEXT_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", _TAGS.c_get_3_1); //$NON-NLS-1$ //$NON-NLS-2$
_jettag_c_get_3_1.setRuntimeParent(null);
_jettag_c_get_3_1.setTagInfo(_TAGS.c_get_3_1);
_jettag_c_get_3_1.doStart(context, out);
_jettag_c_get_3_1.doEnd();
- out.write(_TEXT.TEXT_2);
+ out.write(NL);
}
}

Back to the top