Skip to content

Commit

Permalink
Review cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Nov 23, 2021
1 parent 55c65bd commit 95154b8
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import io.deephaven.db.tables.select.QueryScope;
import io.deephaven.db.tables.utils.TableTools;
import io.deephaven.db.v2.select.IncrementalReleaseFilter;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.ParallelTest;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -80,5 +80,5 @@ private <R> R incrementalBenchmark(Table inputTable, Function<Table, R> function
}

@Rule
public final DbCleanup rule = new DbCleanup();
public final EngineCleanup rule = new EngineCleanup();
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package io.deephaven.db.v2.utils;

import io.deephaven.datastructures.util.CollectionUtil;
import io.deephaven.db.tables.Table;
import io.deephaven.db.tables.TableDefinition;
import io.deephaven.db.tables.utils.TableTools;
import io.deephaven.db.util.config.InputTableStatusListener;
import io.deephaven.db.v2.QueryTable;
import io.deephaven.db.v2.sources.ArrayBackedColumnSource;
import io.deephaven.db.v2.sources.ColumnSource;
import io.deephaven.db.v2.sources.NullValueColumnSource;
import io.deephaven.db.v2.sources.WritableChunkSink;
import io.deephaven.db.v2.sources.chunk.*;
import io.deephaven.db.v2.sources.chunk.Attributes;
import io.deephaven.db.v2.sources.chunk.Chunk;
import io.deephaven.db.v2.sources.chunk.ChunkSource;
import io.deephaven.db.v2.sources.chunk.SharedContext;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
Expand Down Expand Up @@ -88,7 +89,7 @@ private AppendOnlyArrayBackedMutableTable(@NotNull TableDefinition definition,
@Override
protected void processPendingTable(Table table, boolean allowEdits, IndexChangeRecorder indexChangeRecorder,
Consumer<String> errorNotifier) {
try (Index addIndex = table.getIndex().clone()) {
try (final Index addIndex = table.getIndex().clone()) {
final long firstRow = nextRow;
final long lastRow = firstRow + addIndex.intSize() - 1;
try (OrderedKeys destinations = OrderedKeys.forRange(firstRow, lastRow)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.deephaven.db.v2.utils.Index;
import io.deephaven.db.v2.utils.TimeProvider;
import io.deephaven.db.v2.utils.UpdatePerformanceTracker;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.OutOfBandTest;
import junit.framework.TestCase;

Expand All @@ -26,7 +26,7 @@
@Category(OutOfBandTest.class)
public class TestWindowCheck {
@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

/**
* Run a window check over the course of a simulated day.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.deephaven.db.tables.live.LiveTableMonitor;
import io.deephaven.db.tables.utils.TableTools;
import io.deephaven.db.v2.*;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.util.QueryConstants;
import junit.framework.TestCase;
import org.junit.Rule;
Expand All @@ -19,7 +19,7 @@

public class TestTableAssertions {
@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Test
public void testStatic() {
Expand Down
4 changes: 2 additions & 2 deletions DB/src/test/java/io/deephaven/db/v2/FuzzerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import io.deephaven.db.util.liveness.LivenessScopeStack;
import io.deephaven.db.v2.utils.RuntimeMemory;
import io.deephaven.db.v2.utils.TimeProvider;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.SerialTest;
import io.deephaven.util.SafeCloseable;
import org.apache.commons.lang3.mutable.MutableLong;
Expand All @@ -40,7 +40,7 @@ public class FuzzerTest {
Configuration.getInstance().getBooleanWithDefault("FuzzerTest.realTime", false);

@Rule
public final DbCleanup framework = new DbCleanup();
public final EngineCleanup framework = new EngineCleanup();

private static class FuzzDescriptor {
final long querySeed;
Expand Down
12 changes: 6 additions & 6 deletions DB/src/test/java/io/deephaven/db/v2/LiveTableTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ abstract public class LiveTableTestCase extends BaseArrayTestCase implements Upd
private boolean oldMemoize;
private UpdateErrorReporter oldReporter;
private boolean expectError = false;
private SafeCloseable scopeCloseable;
private QueryScope originalScope;
private SafeCloseable livenessScopeCloseable;
private QueryScope originalQueryScope;
private boolean oldLogEnabled;
private boolean oldCheckLtm;

Expand All @@ -55,8 +55,8 @@ protected void setUp() throws Exception {
oldMemoize = QueryTable.setMemoizeResults(false);
oldReporter = AsyncClientErrorNotifier.setReporter(this);
errors = null;
scopeCloseable = LivenessScopeStack.open(new LivenessScope(true), true);
originalScope = QueryScope.getScope();
livenessScopeCloseable = LivenessScopeStack.open(new LivenessScope(true), true);
originalQueryScope = QueryScope.getScope();

oldLogEnabled = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING);
oldCheckLtm = LiveTableMonitor.DEFAULT.setCheckTableOperations(false);
Expand All @@ -70,8 +70,8 @@ protected void tearDown() throws Exception {
LiveTableMonitor.DEFAULT.setCheckTableOperations(oldCheckLtm);
CompilerTools.setLogEnabled(oldLogEnabled);

QueryScope.setScope(originalScope);
scopeCloseable.close();
QueryScope.setScope(originalQueryScope);
livenessScopeCloseable.close();
AsyncClientErrorNotifier.setReporter(oldReporter);
QueryTable.setMemoizeResults(oldMemoize);
LiveTableMonitor.DEFAULT.resetForUnitTests(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import io.deephaven.db.v2.utils.Index;
import io.deephaven.db.v2.utils.IndexShiftData;
import io.deephaven.db.v2.utils.UpdatePerformanceTracker;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.OutOfBandTest;
import io.deephaven.util.QueryConstants;
import io.deephaven.util.SafeCloseable;
Expand Down Expand Up @@ -57,7 +57,7 @@
@Category(OutOfBandTest.class)
public class QueryTableAggregationTest {
@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Before
public void setUp() throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions DB/src/test/java/io/deephaven/db/v2/QueryTableAjTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import io.deephaven.db.v2.QueryTableTestBase.JoinIncrement;
import io.deephaven.db.v2.sources.chunk.util.pools.ChunkPoolReleaseTracking;
import io.deephaven.db.v2.utils.ColumnHolder;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.OutOfBandTest;
import io.deephaven.util.SafeCloseable;
import gnu.trove.list.array.TIntArrayList;
Expand Down Expand Up @@ -48,7 +48,7 @@
public class QueryTableAjTest {

@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Before
public void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.deephaven.db.tables.utils.TableTools;
import io.deephaven.db.v2.sources.AbstractColumnSource;
import io.deephaven.db.v2.utils.Index;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.OutOfBandTest;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -107,5 +107,5 @@ public void testHugeGroupedSort() {
}

@Rule
public final DbCleanup rule = new DbCleanup();
public final EngineCleanup rule = new EngineCleanup();
}
4 changes: 2 additions & 2 deletions DB/src/test/java/io/deephaven/db/v2/QueryTableJoinTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.deephaven.db.tables.live.LiveTableMonitor;
import io.deephaven.db.tables.select.QueryScope;
import io.deephaven.db.tables.utils.ArrayUtils;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.OutOfBandTest;
import io.deephaven.util.QueryConstants;
import io.deephaven.db.tables.utils.TableTools;
Expand All @@ -30,7 +30,7 @@
@Category(OutOfBandTest.class)
public class QueryTableJoinTest {
@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

public void testAjIncremental() throws ParseException {
final int maxSteps = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import io.deephaven.db.v2.utils.Index;
import io.deephaven.db.v2.utils.RuntimeMemory;
import io.deephaven.db.v2.utils.UpdatePerformanceTracker;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.util.SafeCloseable;
import junit.framework.TestCase;
import org.apache.commons.lang3.mutable.MutableInt;
Expand All @@ -40,7 +40,7 @@
public class QueryTableSelectUpdateTest {

@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Test
public void testSelectAndUpdate() {
Expand Down
4 changes: 2 additions & 2 deletions DB/src/test/java/io/deephaven/db/v2/QueryTableWhereTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.deephaven.db.v2.sources.chunk.*;
import io.deephaven.db.v2.utils.Index;
import io.deephaven.db.v2.utils.IndexShiftData;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.test.types.OutOfBandTest;
import io.deephaven.util.QueryConstants;
import io.deephaven.util.annotations.ReflexiveUse;
Expand Down Expand Up @@ -54,7 +54,7 @@
@Category(OutOfBandTest.class)
public class QueryTableWhereTest {
@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Test
public void testWhere() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import io.deephaven.db.v2.utils.RedirectionIndex;
import io.deephaven.db.v2.utils.WrappedIndexRedirectionIndexImpl;
import io.deephaven.qst.table.EmptyTable;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import junit.framework.ComparisonFailure;
import junit.framework.TestCase;
import org.jetbrains.annotations.NotNull;
Expand All @@ -38,7 +38,7 @@ public class StreamTableAggregationTest {
private static final long MAX_RANDOM_ITERATION_SIZE = 10_000;

@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

private final Table source = Table.of(EmptyTable.of(INPUT_SIZE)
.update("Sym = Long.toString(ii % 1000) + `_Sym`")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.deephaven.db.v2.utils.RedirectionIndex;
import io.deephaven.db.v2.utils.WrappedIndexRedirectionIndexImpl;
import io.deephaven.qst.table.EmptyTable;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import junit.framework.ComparisonFailure;
import junit.framework.TestCase;
import org.jetbrains.annotations.NotNull;
Expand All @@ -32,7 +32,7 @@
public class StreamTableOperationsTest {

@Rule
public DbCleanup base = new DbCleanup();
public EngineCleanup base = new EngineCleanup();

private static final long INPUT_SIZE = 100_000L;
private static final long MAX_RANDOM_ITERATION_SIZE = 10_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import io.deephaven.db.tables.libs.QueryLibrary;
import io.deephaven.db.tables.select.QueryScope;
import io.deephaven.db.tables.utils.*;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.db.v2.utils.codegen.TypeAnalyzer;
import io.deephaven.test.types.OutOfBandTest;
import io.deephaven.util.QueryConstants;
Expand Down Expand Up @@ -68,21 +68,18 @@ public TestFormulaColumn(boolean useKernelFormulas) {
}

@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Before
public void setUp() throws Exception {
kernelFormulasSavedValue = DhFormulaColumn.useKernelFormulasProperty;
DhFormulaColumn.useKernelFormulasProperty = useKernelFormulas;
compilerToolsLogEnabledInitial = CompilerTools.setLogEnabled(ENABLE_COMPILER_TOOLS_LOGGING);

setUpQueryLibrary();
}

@After
public void tearDown() throws Exception {
CompilerTools.setLogEnabled(compilerToolsLogEnabledInitial);

QueryLibrary.resetLibrary();
DhFormulaColumn.useKernelFormulasProperty = kernelFormulasSavedValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.deephaven.db.tables.libs.QueryLibrary;
import io.deephaven.db.tables.select.QueryScope;
import io.deephaven.db.tables.utils.TableTools;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.db.v2.utils.ModelFileGenerator;
import org.jetbrains.annotations.NotNull;
import org.junit.After;
Expand Down Expand Up @@ -35,7 +35,7 @@ public void generateFiles() throws FileNotFoundException {
}

@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();

@Before
public void setUp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.deephaven.db.v2.DynamicTable;
import io.deephaven.db.v2.LiveQueryTable;
import io.deephaven.db.v2.TstUtils;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.util.QueryConstants;
import io.deephaven.tablelogger.Row;
import org.junit.Rule;
Expand All @@ -21,7 +21,7 @@

public class TestDynamicTableWriter {
@Rule
public final DbCleanup ltc = new DbCleanup();
public final EngineCleanup ltc = new EngineCleanup();

@Test
public void testTypes() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.deephaven.db.v2.DynamicTable;
import io.deephaven.db.v2.FailureListener;
import io.deephaven.db.v2.TableUpdateValidator;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import io.deephaven.util.FunctionalInterfaces;
import junit.framework.TestCase;
import org.jetbrains.annotations.NotNull;
Expand All @@ -29,7 +29,7 @@
public class TestKeyedArrayBackedMutableTable {

@Rule
public final DbCleanup liveTableTestCase = new DbCleanup();
public final EngineCleanup liveTableTestCase = new EngineCleanup();

@Test
public void testSimple() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import gnu.trove.list.TByteList;
import gnu.trove.list.array.TByteArrayList;
import io.deephaven.test.junit4.DbCleanup;
import io.deephaven.test.junit4.EngineCleanup;
import org.apache.commons.lang3.mutable.MutableInt;
import org.apache.commons.lang3.mutable.MutableLong;
import org.junit.Rule;
Expand All @@ -37,7 +37,7 @@
public class TestReadOnlyRedirectedColumnSource {

@Rule
public final DbCleanup base = new DbCleanup();
public final EngineCleanup base = new EngineCleanup();


private Table makeTable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
/**
* When you want to extend LiveTableTestCase/QueryTableTestBase but you need to use JUnit 4 annotations, like @Category
* or @RunWith(Suite.class), then instead of extending LiveTableTestCase, you should instead create a `@Rule public
* final DbCleanup field = new DbCleanup();`.
* final EngineCleanup field = new EngineCleanup();`.
*/
public class DbCleanup extends QueryTableTestBase implements TestRule {
public class EngineCleanup extends QueryTableTestBase implements TestRule {
@Override
public void setUp() throws Exception {
super.setUp();
Expand Down
Loading

0 comments on commit 95154b8

Please sign in to comment.