Skip to content

Commit

Permalink
Updated Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cgivre committed Aug 25, 2024
1 parent 0517feb commit e21b197
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
*/
package org.apache.drill.exec.store.easy.json.loader;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import org.apache.drill.categories.JsonTest;
import org.apache.drill.common.exceptions.UserException;
import org.apache.drill.common.types.TypeProtos.MinorType;
Expand All @@ -35,6 +29,12 @@
import org.junit.Test;
import org.junit.experimental.categories.Category;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

@Category(JsonTest.class)
public class TestBasics extends BaseJsonLoaderTest {

Expand Down Expand Up @@ -176,12 +176,22 @@ public void testMissingEndOuterArray() {

@Test
public void testEmptyKey() {
expectError("{\"\": 10}", "does not allow empty keys");
JsonLoaderFixture loader = new JsonLoaderFixture();
loader.jsonOptions.skipMalformedRecords = true;
loader.open("{\"\": 10}");
RowSet results = loader.next();
assertNotNull(results);
assertEquals(1, results.rowCount());
}

@Test
public void testBlankKey() {
expectError("{\" \": 10}", "does not allow empty keys");
JsonLoaderFixture loader = new JsonLoaderFixture();
loader.jsonOptions.skipMalformedRecords = true;
loader.open("{\" \": 10}");
RowSet results = loader.next();
assertNotNull(results);
assertEquals(1, results.rowCount());
}

@Test
Expand Down

0 comments on commit e21b197

Please sign in to comment.