src/test/java/org/embulk/parser/jsonpath/cast/TestStringCast.java in embulk-parser-jsonpath-0.2.0 vs src/test/java/org/embulk/parser/jsonpath/cast/TestStringCast.java in embulk-parser-jsonpath-0.3.0
- old
+ new
@@ -3,12 +3,10 @@
import org.embulk.EmbulkTestRuntime;
import org.embulk.spi.DataException;
import org.embulk.spi.time.Timestamp;
import org.embulk.spi.time.TimestampParser;
import org.joda.time.DateTimeZone;
-import org.jruby.embed.ScriptingContainer;
-import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -16,18 +14,11 @@
public class TestStringCast
{
@Rule
public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
- public ScriptingContainer jruby;
- @Before
- public void createResource()
- {
- jruby = new ScriptingContainer();
- }
-
@Test
public void asBoolean()
{
for (String str : StringCast.TRUE_STRINGS) {
assertEquals(true, StringCast.asBoolean(str));
@@ -87,10 +78,10 @@
@Test
public void asTimestamp()
{
Timestamp expected = Timestamp.ofEpochSecond(1463084053, 123456000);
- TimestampParser parser = new TimestampParser(jruby, "%Y-%m-%d %H:%M:%S.%N", DateTimeZone.UTC);
+ TimestampParser parser = TimestampParser.of("%Y-%m-%d %H:%M:%S.%N", DateTimeZone.UTC.toString());
assertEquals(expected, StringCast.asTimestamp("2016-05-12 20:14:13.123456", parser));
try {
StringCast.asTimestamp("foo", parser);
fail();