Skip to content

Commit

Permalink
[GR-15506] Removed non needed setup methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzezula committed May 10, 2019
1 parent f58b6fc commit 1f7a6ba
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.graalvm.polyglot.Engine;
import org.graalvm.polyglot.tck.Snippet;
import org.graalvm.polyglot.tck.TypeDescriptor;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;

@RunWith(Parameterized.class)
public class ErrorTypeTest {
Expand Down Expand Up @@ -94,14 +92,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

private static void computeSnippets(
final String snippetLanguage,
final Collection<? extends Snippet> snippets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.graalvm.polyglot.Engine;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.tck.Snippet;
import org.junit.AfterClass;
import org.junit.Before;

@RunWith(Parameterized.class)
public class ExpressionTest {
Expand Down Expand Up @@ -90,14 +88,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

public ExpressionTest(final TestRun testRun) {
Objects.requireNonNull(testRun);
this.testRun = testRun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import java.util.Objects;
import java.util.function.Function;

import org.graalvm.polyglot.Engine;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.Value;
import org.graalvm.polyglot.tck.LanguageProvider;
Expand All @@ -65,7 +64,6 @@
import org.graalvm.polyglot.tck.TypeDescriptor;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand Down Expand Up @@ -134,14 +132,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

public IdentityFunctionTest(final TestRun testRun) {
Objects.requireNonNull(testRun);
this.testRun = testRun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@

import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import org.graalvm.polyglot.Engine;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.Value;
import org.graalvm.polyglot.tck.InlineSnippet;
Expand Down Expand Up @@ -83,14 +81,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

public InlineExecutionTest(final InlineTestRun testRun) {
Objects.requireNonNull(testRun);
this.testRun = testRun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.graalvm.polyglot.Engine;
import org.junit.Assume;
import org.junit.Before;

@RunWith(Parameterized.class)
public class InvalidSyntaxTest {
Expand Down Expand Up @@ -82,14 +80,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

public InvalidSyntaxTest(final String testName, final Source source) {
Objects.requireNonNull(testName);
Objects.requireNonNull(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@
import org.graalvm.polyglot.Value;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.graalvm.polyglot.Engine;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.tck.Snippet;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

@RunWith(Parameterized.class)
Expand All @@ -81,14 +79,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

public ScriptTest(final TestRun testRun) {
Objects.requireNonNull(testRun);
this.testRun = testRun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@
import org.graalvm.polyglot.Value;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.graalvm.polyglot.Engine;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.tck.Snippet;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

@RunWith(Parameterized.class)
Expand Down Expand Up @@ -90,14 +88,6 @@ public static void afterClass() throws IOException {
context = null;
}

@Before
public void setUp() {
// JUnit mixes test executions from different classes. There are still tests using the
// deprecated PolyglotEngine. For tests executed by Parametrized runner
// creating Context as a test parameter we need to ensure that correct SPI is used.
Engine.create().close();
}

public StatementTest(final TestRun testRun) {
Objects.requireNonNull(testRun);
this.testRun = testRun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import java.util.List;
import java.util.function.Function;
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.HostAccess;
import org.graalvm.polyglot.Value;
import org.graalvm.polyglot.proxy.ProxyArray;
import org.graalvm.polyglot.proxy.ProxyObject;
Expand Down Expand Up @@ -615,7 +614,7 @@ public void testInstantiablesWithExecutables() {

@Test
public void testForValue() {
try (Context ctx = Context.newBuilder().allowHostAccess(HostAccess.ALL).build()) {
try (Context ctx = Context.newBuilder().allowAllAccess(true).build()) {
Value v = ctx.asValue(1);
Assert.assertTrue(TypeDescriptor.NUMBER.isAssignable(TypeDescriptor.forValue(v)));
v = ctx.asValue(true);
Expand Down

0 comments on commit 1f7a6ba

Please sign in to comment.