Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
choplin committed Dec 18, 2015
1 parent a81e008 commit 4141d1d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repositories {
}
configurations {
provided
runtime.exclude group: "org.slf4j", module: "slf4j-log4j12"
}

version = "0.2.1"
Expand All @@ -27,6 +28,8 @@ dependencies {
compile "org.apache.hadoop:hadoop-aws:2.6.0"

testCompile "junit:junit:4.+"
testCompile "org.embulk:embulk-core:0.7.7:tests"
testCompile "org.embulk:embulk-standards:0.7.7"
}

task classpath(type: Copy, dependsOn: ["jar"]) {
Expand Down
37 changes: 37 additions & 0 deletions src/test/java/org/embulk/output/ParquetOutputPluginTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.embulk.output;

import org.embulk.EmbulkTestRuntime;
import org.embulk.config.ConfigException;
import org.embulk.config.ConfigSource;
import org.embulk.spi.Exec;
import org.junit.Rule;
import org.junit.Test;

import static org.junit.Assert.*;

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

@Test
public void checkDefaultValues() {
ConfigSource config = Exec.newConfigSource()
.set("path_prefix", "test");

ParquetOutputPlugin.PluginTask task = config.loadConfig(ParquetOutputPlugin.PluginTask.class);
assertEquals(".parquet", task.getFileNameExtension());
assertEquals(".%03d", task.getSequenceFormat());
assertEquals(134217728, task.getBlockSize());
assertEquals(1048576, task.getPageSize());
assertEquals("UNCOMPRESSED", task.getCompressionCodec());
}

@Test(expected = ConfigException.class)
public void checkColumnsRequired() {
ConfigSource config = Exec.newConfigSource();

config.loadConfig(ParquetOutputPlugin.PluginTask.class);
}


}
5 changes: 0 additions & 5 deletions src/test/java/org/embulk/output/TestParquetOutputPlugin.java

This file was deleted.

0 comments on commit 4141d1d

Please sign in to comment.