summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-09-19 13:53:25 (EDT)
committerpelder2006-09-19 13:53:25 (EDT)
commita88cf48f1cdc85b0b286690e69d9325c222d115b (patch)
tree2b1df3ef7d06c536ad18d477db57a6bc81237262
parent08a5f0a2f41f33e210451ec472266cd166190257 (diff)
downloadorg.eclipse.jet-a88cf48f1cdc85b0b286690e69d9325c222d115b.zip
org.eclipse.jet-a88cf48f1cdc85b0b286690e69d9325c222d115b.tar.gz
org.eclipse.jet-a88cf48f1cdc85b0b286690e69d9325c222d115b.tar.bz2
[157811] Update tag doc generator to leave examples in a user region.
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jarbin36226 -> 34061 bytes
-rw-r--r--tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java83
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet6
3 files changed, 86 insertions, 3 deletions
diff --git a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
index 5a88c28..1a1dbb0 100644
--- a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
+++ b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar
Binary files differ
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
new file mode 100644
index 0000000..d532460
--- /dev/null
+++ b/tests/org.eclipse.jet.tests/src/org/eclipse/jet/tests/runtime/TestDirectoryBundleProvider.java
@@ -0,0 +1,83 @@
+/**
+ * <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/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
index b158526..95dba5a 100644
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
+++ b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
@@ -128,8 +128,8 @@
<TR>
<TD width="10%"></TD>
<TD><SPAN style="font-family: monospace">
-<%--roundtrip--%><!-- Begin <c:get select="$tag/@name" /> example -->
-<%--initialCode--%>
+<c:userRegion><!-- Begin <c:get select="$tag/@name" /> example -->
+<c:initialCode>
<c:choose>
<c:when test="local-name($tag) = 'iteratingTag'">
&lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
@@ -156,7 +156,7 @@
&lt;/<c:get select="$tag/@tagQName" />&gt;
</c:when>
</c:choose>
-<%--/initialCode--%><!-- End <c:get select="$tag/@name" /> example --><%--/roundtrip--%>
+</c:initialCode><!-- End <c:get select="$tag/@name" /> example --></c:userRegion>
</SPAN></TD>
</TR>
</TBODY>