Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/impl/NameUtilTest.java')
-rw-r--r--tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/impl/NameUtilTest.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/impl/NameUtilTest.java b/tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/impl/NameUtilTest.java
new file mode 100644
index 00000000..063904f2
--- /dev/null
+++ b/tests/org.eclipse.xpand.tests/src/org/eclipse/xpand/internal/tests/impl/NameUtilTest.java
@@ -0,0 +1,43 @@
+/*
+ * <copyright>
+ *
+ * Copyright (c) 2005-2006 Sven Efftinge (http://www.efftinge.de) 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:
+ * Sven Efftinge (http://www.efftinge.de) - Initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.xpand.internal.tests.impl;
+
+import junit.framework.TestCase;
+
+import org.eclipse.internal.xtend.expression.parser.SyntaxConstants;
+import org.eclipse.xpand2.XpandUtil;
+
+/**
+ * *
+ *
+ * @author Sven Efftinge (http://www.efftinge.de) *
+ */
+public class NameUtilTest extends TestCase {
+
+ public final void testGetResourceName() {
+ assertEquals("org/test/File.xpt", XpandUtil.getJavaResourceName("org" + SyntaxConstants.NS_DELIM + "test"
+ + SyntaxConstants.NS_DELIM + "File"));
+ }
+
+ public final void testGetLastSegment() {
+ assertEquals("File", XpandUtil.getLastSegment("org" + SyntaxConstants.NS_DELIM + "test"
+ + SyntaxConstants.NS_DELIM + "File"));
+ }
+
+ public final void testGetNamespace() {
+ assertEquals("org" + SyntaxConstants.NS_DELIM + "test", XpandUtil.withoutLastSegment("org"
+ + SyntaxConstants.NS_DELIM + "test" + SyntaxConstants.NS_DELIM + "File"));
+ }
+}

Back to the top