summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-09-06 22:31:25 -0400
committerPaul Duncan <pabs@pablotron.org>2018-09-06 22:31:25 -0400
commit70f09fcfc5e3ebc8cbcb15803fdac50d1c53f16b (patch)
treea510b53186ff15b07890484f0efba67fafd6042e /java
parent09c675eaa9af98f7848a89384bf80e5a141fa047 (diff)
downloadluigi-template-70f09fcfc5e3ebc8cbcb15803fdac50d1c53f16b.tar.bz2
luigi-template-70f09fcfc5e3ebc8cbcb15803fdac50d1c53f16b.zip
remove legacy Test
Diffstat (limited to 'java')
-rw-r--r--java/src/main/java/org/pablotron/luigi/Test.java57
1 files changed, 0 insertions, 57 deletions
diff --git a/java/src/main/java/org/pablotron/luigi/Test.java b/java/src/main/java/org/pablotron/luigi/Test.java
deleted file mode 100644
index 3d25c13..0000000
--- a/java/src/main/java/org/pablotron/luigi/Test.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.pablotron.luigi;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import org.pablotron.luigi.errors.LuigiError;
-import org.pablotron.luigi.Filter;
-import org.pablotron.luigi.Template;
-import org.pablotron.luigi.Cache;
-
-public final class Test {
- // test template
- private static final String TEMPLATE =
- "test basic: hello %{name}\n" +
- "test filter: hello %{name | uc}\n" +
- "test custom: %{name | custom | uc | lc}\n" +
- "test custom_with_arg: %{name | custom_with_arg hello}\n";
-
- // test template cache
- private static final Cache cache = new Cache(new HashMap<String, String>() {{
- put("test-template", TEMPLATE);
- }});
-
- // test arguments
- private static final Map<String, String> args = new HashMap<String, String>() {{
- put("name", "paul");
- }};
-
- // custom filters
- private static final Map<String, Filter.Handler> filters = new HashMap<String, Filter.Handler>() {{
- // add custom filter
- put("custom", new Filter.Handler() {
- public String filter(String val, String args[], Map<String, String> row) {
- return "custom";
- }
- });
-
- // add custom filter with argument
- put("custom_with_arg", new Filter.Handler() {
- public String filter(String val, String args[], Map<String, String> row) {
- return (args.length > 0) ? args[0] : "custom";
- }
- });
- }};
-
- public static void main(String params[]) throws Exception {
- // add custom filters
- Filter.FILTERS.putAll(filters);
-
- // create and run template
- final Template t = new Template(TEMPLATE);
- System.out.print(t.run(args));
-
- // run cache
- System.out.print(cache.run("test-template", args));
- }
-};