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.39 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.39-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.38 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.38-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.37 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.37-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.36 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.36-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.35 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.35-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.34 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.34-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.33 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.33-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.32 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.32-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.31 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.31-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.30 embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java
embulk-0.8.30-java embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java