Skip to content

Commit

Permalink
Force jvm to load class in desired package (#1095)
Browse files Browse the repository at this point in the history
Fixes DBLanguageParser test failures when run in isolation.
  • Loading branch information
nbauernfeind authored Aug 21, 2021
1 parent 7fe69b9 commit 2074ed2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package io.deephaven.db.tables.lang;

import io.deephaven.base.Pair;
import io.deephaven.base.verify.Assert;
import io.deephaven.base.verify.Require;
import io.deephaven.base.testing.BaseArrayTestCase;
import io.deephaven.db.tables.Table;
Expand Down Expand Up @@ -40,7 +41,11 @@ public class TestDBLanguageParser extends BaseArrayTestCase {
public void setUp() throws Exception {
packageImports = new HashSet<>();
packageImports.add(Package.getPackage("java.lang"));
packageImports.add(Package.getPackage("io.deephaven.db.tables"));

// Package.getPackage returns null if the class loader has yet to see a class from that package; force a load
Package tablePackage = Table.class.getPackage();
Assert.equals(tablePackage.getName(), "tablePackage.getName()", "io.deephaven.db.tables");
packageImports.add(tablePackage);

classImports = new HashSet<>();
classImports.add(Color.class);
Expand Down

0 comments on commit 2074ed2

Please sign in to comment.