Sha256: 563dc4257f4fc518de845e565be9f62d789bef3a0d845ce213028a8ccc319350

Contents?: true

Size: 1.12 KB

Versions: 155

Compression:

Stored size: 1.12 KB

Contents

package org.embulk.spi.type;

import org.junit.Rule;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import com.google.inject.Inject;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.embulk.EmbulkTestRuntime;

public class TestTypeSerDe
{
    @Rule
    public EmbulkTestRuntime runtime = new EmbulkTestRuntime();

    private static class HasType
    {
        private Type type;
        // TODO test TimestampType

        @JsonCreator
        public HasType(
                @JsonProperty("type") Type type)
        {
            this.type = type;
        }

        @JsonProperty("type")
        public Type getType()
        {
            return type;
        }
    }

    @Test
    public void testGetType()
    {
        HasType type = new HasType(StringType.STRING);
        String json = runtime.getModelManager().writeObject(type);
        HasType decoded = runtime.getModelManager().readObject(HasType.class, json);
        assertTrue(StringType.STRING == decoded.getType());
    }
}

Version data entries

155 entries across 155 versions & 1 rubygems

Version Path
embulk-0.8.9 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.9-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.8 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.8-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.7 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.7-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.6 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.6-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.5 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.5-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.4 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.4-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.3 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.3-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.7.11 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.7.11-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.2 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.2-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.1 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.1-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java