diff --git a/libraries/stdlib/src/kotlin/template/Templates.kt b/libraries/kotlin-jdbc/src/main/kotlin/kotlin/template/Templates.kt similarity index 97% rename from libraries/stdlib/src/kotlin/template/Templates.kt rename to libraries/kotlin-jdbc/src/main/kotlin/kotlin/template/Templates.kt index 7505d956b19..4565e2a524b 100644 --- a/libraries/stdlib/src/kotlin/template/Templates.kt +++ b/libraries/kotlin-jdbc/src/main/kotlin/kotlin/template/Templates.kt @@ -2,14 +2,11 @@ package kotlin.template import kotlin.dom. * import org.w3c.dom.Node -import com.sun.org.apache.xalan.internal.xsltc.dom.UnionIterator import java.util.Locale import java.text.NumberFormat import java.text.DateFormat import java.util.Date -// TODO this class should move into the runtime -// in kotlin.StringTemplate deprecated("This class is part of an experimental implementation of string templates and is going to be removed") public class StringTemplate(private val values: Array) { diff --git a/libraries/stdlib/test/template/HtmlTemplateTest.kt b/libraries/stdlib/test/template/HtmlTemplateTest.kt deleted file mode 100644 index c5c3a383401..00000000000 --- a/libraries/stdlib/test/template/HtmlTemplateTest.kt +++ /dev/null @@ -1,23 +0,0 @@ -package test.template - -import kotlin.template.* -import kotlin.test.assertEquals - -import junit.framework.TestCase - -class HtmlTemplateTest : TestCase() { - fun testTemplate(): Unit { - val foo = "James" - val bar = "x > 1" - - // Code generated by the following template expression: - // - // val actual = "

$foo

hey $bar

".toHtml() - - // TODO will use a tuple soon - //val actual = StringTemplate(Tuple3("

", foo, "

hey ", bar, "

")).toHtml() - val actual = StringTemplate(arrayOf("

", foo, "

hey ", bar, "

")).toHtml() - - assertEquals("

James

hey x > 1

", actual) - } -} \ No newline at end of file diff --git a/libraries/stdlib/test/template/LocaleTemplateTest.kt b/libraries/stdlib/test/template/LocaleTemplateTest.kt deleted file mode 100644 index 817df4a4064..00000000000 --- a/libraries/stdlib/test/template/LocaleTemplateTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -package template - -import kotlin.template.* -import kotlin.test.assertEquals - -import junit.framework.TestCase -import java.util.Date -import java.util.Locale - -class LocaleTemplateTest : TestCase() { - fun testDefaultLocale() : Unit { - format(LocaleFormatter()) - } - - fun testFrance() : Unit { - format(LocaleFormatter(Locale.FRANCE)) - } - - fun testGermany() : Unit { - format(LocaleFormatter(Locale.GERMANY)) - } - - fun format(formatter: LocaleFormatter): Unit { - val name = "James" - val price: Double = 1.99 - val now = Date() - - - // Code generated by the following template expression: - // - // val actual = format.toLocale("hello $name!") - - // TODO will use a tuple soon - //val actual = formatter.format(StringTemplate(Tuple2("hello ", name)) - val actual = StringTemplate(arrayOf("hello ", name, - " price ", price, - " data ", now)).toString(formatter) - - println("Got text: $actual") - } -} \ No newline at end of file diff --git a/libraries/stdlib/test/template/StringTemplateTest.kt b/libraries/stdlib/test/template/StringTemplateTest.kt deleted file mode 100644 index 33c7d12a09f..00000000000 --- a/libraries/stdlib/test/template/StringTemplateTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -package test.template - -import kotlin.template.* -import kotlin.test.assertEquals - -import junit.framework.TestCase - -class StringTemplateTest : TestCase() { - fun testTemplate(): Unit { - val name = "James" - - // Code generated by the following template expression: - // - // val actual = "hello $name!".toString() - - // TODO will use a tuple soon - //val actual = StringTemplate(Tuple3("hello ", name, "!"))).toString() - val actual = StringTemplate(arrayOf("hello ", name, "!")).toString() - - assertEquals("hello James!", actual) - } -} \ No newline at end of file