summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsefftinge2008-02-27 08:20:17 (EST)
committersefftinge2008-02-27 08:20:17 (EST)
commit3d19cb96a636f0b35b90b90147416ff99c6890e0 (patch)
tree065ed6466946dfa500933c8215e60a497646a56f
parent9622e096ebabc49d922797ecb0dbe06c87f922ab (diff)
downloadorg.eclipse.xpand-3d19cb96a636f0b35b90b90147416ff99c6890e0.zip
org.eclipse.xpand-3d19cb96a636f0b35b90b90147416ff99c6890e0.tar.gz
org.eclipse.xpand-3d19cb96a636f0b35b90b90147416ff99c6890e0.tar.bz2
initial
-rw-r--r--tests/org.eclipse.xpand3.tests/.classpath7
-rw-r--r--tests/org.eclipse.xpand3.tests/.project28
-rw-r--r--tests/org.eclipse.xpand3.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.xpand3.tests/META-INF/MANIFEST.MF10
-rw-r--r--tests/org.eclipse.xpand3.tests/build.properties4
-rw-r--r--tests/org.eclipse.xpand3.tests/src/org/eclipse/xpand3/parser/Xpand3NodeParserTest.java25
6 files changed, 81 insertions, 0 deletions
diff --git a/tests/org.eclipse.xpand3.tests/.classpath b/tests/org.eclipse.xpand3.tests/.classpath
new file mode 100644
index 0000000..304e861
--- /dev/null
+++ b/tests/org.eclipse.xpand3.tests/.classpath
@@ -0,0 +1,7 @@
+<?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.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.xpand3.tests/.project b/tests/org.eclipse.xpand3.tests/.project
new file mode 100644
index 0000000..567e749
--- /dev/null
+++ b/tests/org.eclipse.xpand3.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.xpand3.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.xpand3.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.xpand3.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..09210a1
--- /dev/null
+++ b/tests/org.eclipse.xpand3.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue Feb 26 15:07:34 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.xpand3.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.xpand3.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..b5846d5
--- /dev/null
+++ b/tests/org.eclipse.xpand3.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Xpand3 Tests Plug-in
+Bundle-SymbolicName: org.eclipse.xpand3.tests
+Bundle-Version: 0.9
+Bundle-Vendor: www.eclipse.org
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.antlr;bundle-version="3.0.0",
+ org.junit,
+ org.eclipse.xpand3;bundle-version="0.9"
diff --git a/tests/org.eclipse.xpand3.tests/build.properties b/tests/org.eclipse.xpand3.tests/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/tests/org.eclipse.xpand3.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/org.eclipse.xpand3.tests/src/org/eclipse/xpand3/parser/Xpand3NodeParserTest.java b/tests/org.eclipse.xpand3.tests/src/org/eclipse/xpand3/parser/Xpand3NodeParserTest.java
new file mode 100644
index 0000000..8b680e7
--- /dev/null
+++ b/tests/org.eclipse.xpand3.tests/src/org/eclipse/xpand3/parser/Xpand3NodeParserTest.java
@@ -0,0 +1,25 @@
+package org.eclipse.xpand3.parser;
+
+import junit.framework.TestCase;
+
+import org.antlr.runtime.ANTLRStringStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.eclipse.xpand3.node.Node;
+import org.eclipse.xpand3.node.NodeUtil;
+
+public class Xpand3NodeParserTest extends TestCase {
+ private Node parse(String s) throws Exception {
+ ANTLRStringStream stream = new ANTLRStringStream(s);
+ Xpand3Lexer lexer = new Xpand3Lexer(stream);
+ CommonTokenStream tokenStream = new CommonTokenStream(lexer);
+ AbstractXpand3NodeParser xpand3NodeParser = new Xpand3NodeParser(tokenStream);
+ xpand3NodeParser.r_file();
+ return xpand3NodeParser.getRootNode();
+ }
+
+ public void testFoo() throws Exception {
+ Node node = parse("import foo; myFunction(String this) : doStuff('holla');");
+ System.out.println(NodeUtil.toString(node));
+ System.out.println(NodeUtil.serialize(node));
+ }
+}