Skip to content

Commit

Permalink
update annotations such as BeforeClass, Rule, TemporaryFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
llama90 committed Jun 9, 2024
1 parent b8b61d7 commit efbb585
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.nio.charset.StandardCharsets;
import java.util.List;


import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.FieldVector;
import org.apache.arrow.vector.IntVector;
Expand All @@ -40,29 +39,27 @@
import org.apache.orc.OrcFile;
import org.apache.orc.TypeDescription;
import org.apache.orc.Writer;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

public class OrcReaderTest {

@Rule
public TemporaryFolder testFolder = new TemporaryFolder();
@TempDir
File testFolder;

private static final int MAX_ALLOCATION = 8 * 1024;
private static RootAllocator allocator;

@BeforeClass
@BeforeAll
public static void beforeClass() {
allocator = new RootAllocator(MAX_ALLOCATION);
}

@Test
public void testOrcJniReader() throws Exception {
TypeDescription schema = TypeDescription.fromString("struct<x:int,y:string>");
File testFile = new File(testFolder.getRoot(), "test-orc");
File testFile = new File(testFolder, "test-orc");

Writer writer = OrcFile.createWriter(new Path(testFile.getAbsolutePath()),
OrcFile.writerOptions(new Configuration()).setSchema(schema));
Expand Down

0 comments on commit efbb585

Please sign in to comment.