mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
TestInstance cleanup -> Base test remains PER_CLASS (as needed), child classes remove redundant annotations
This commit is contained in:
parent
7a29264da5
commit
0ec62b8b2c
@ -28,7 +28,6 @@ import java.sql.SQLException;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
/*
|
||||
* @test
|
||||
@ -38,7 +37,6 @@ import org.junit.jupiter.api.TestInstance;
|
||||
* @summary Tests that a JDBC Driver that is a module can be loaded
|
||||
* via the service-provider loading mechanism.
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class DriverManagerModuleTests {
|
||||
|
||||
private final String LUCKYDOGDRIVER_URL = "jdbc:tennis:myDB";
|
||||
|
||||
@ -39,18 +39,13 @@ import java.util.Collections;
|
||||
import java.util.Properties;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
import util.StubDriver;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class DriverManagerTests {
|
||||
|
||||
private final String StubDriverURL = "jdbc:tennis:boy";
|
||||
@ -62,23 +57,11 @@ public class DriverManagerTests {
|
||||
public DriverManagerTests() {
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
public static void setUpClass() throws Exception {
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
public void setUpMethod() throws Exception {
|
||||
removeAllDrivers();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDownMethod() throws Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to remove all registered drivers
|
||||
*/
|
||||
|
||||
@ -49,7 +49,6 @@ import javax.sql.rowset.serial.SerialRef;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
@ -61,7 +60,6 @@ import util.StubClob;
|
||||
import util.StubRef;
|
||||
import util.TestRowSetListener;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class BaseRowSetTests extends CommonRowSetTests {
|
||||
|
||||
private StubBaseRowSet brs;
|
||||
|
||||
@ -54,7 +54,6 @@ import javax.sql.rowset.RowSetProvider;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
@ -65,7 +64,6 @@ import util.StubClob;
|
||||
import util.StubNClob;
|
||||
import util.StubSQLXML;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public abstract class CommonRowSetTests extends BaseTest {
|
||||
|
||||
protected final String stubProvider = "util.StubSyncProvider";
|
||||
|
||||
@ -28,14 +28,12 @@ import javax.sql.rowset.RowSetFactory;
|
||||
import javax.sql.rowset.RowSetProvider;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import util.BaseTest;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class RowSetFactoryTests extends BaseTest {
|
||||
|
||||
// RowSet implementations that we are testing for
|
||||
|
||||
@ -34,7 +34,6 @@ import org.junit.jupiter.api.Assertions;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
@ -42,7 +41,6 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import util.BaseTest;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class RowSetMetaDataTests extends BaseTest {
|
||||
|
||||
// Max columns used in the tests
|
||||
|
||||
@ -37,7 +37,6 @@ import org.junit.jupiter.api.Assertions;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
@ -45,7 +44,6 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
import util.BaseTest;
|
||||
import util.StubRowSetFactory;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class RowSetProviderTests extends BaseTest {
|
||||
|
||||
// Default RowSetFactory Implementation
|
||||
|
||||
@ -29,7 +29,6 @@ import javax.sql.rowset.RowSetProvider;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
/**
|
||||
* @test
|
||||
@ -38,7 +37,6 @@ import org.junit.jupiter.api.TestInstance;
|
||||
* @throws SQLException if an unexpected error occurs
|
||||
* @run junit/othervm
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class ValidateResourceBundleAccess{
|
||||
// Expected JDBCResourceBundle message, jdbcrowsetimpl.invalstate
|
||||
private static final String INVALIDSTATE = "Invalid state";
|
||||
@ -47,7 +45,7 @@ public class ValidateResourceBundleAccess{
|
||||
|
||||
// Checking against English messages, set to US Locale
|
||||
@BeforeAll
|
||||
public void setEnglishEnvironment() {
|
||||
public static void setEnglishEnvironment() {
|
||||
Locale.setDefault(Locale.US);
|
||||
}
|
||||
|
||||
|
||||
@ -25,9 +25,6 @@ package test.rowset.cachedrowset;
|
||||
import java.sql.SQLException;
|
||||
import javax.sql.rowset.CachedRowSet;
|
||||
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class CachedRowSetTests extends CommonCachedRowSetTests {
|
||||
|
||||
@Override
|
||||
|
||||
@ -52,7 +52,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
@ -63,7 +62,6 @@ import util.StubRef;
|
||||
import util.StubSyncProvider;
|
||||
import util.TestRowSetListener;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public abstract class CommonCachedRowSetTests extends CommonRowSetTests {
|
||||
|
||||
/*
|
||||
|
||||
@ -29,19 +29,16 @@ import javax.sql.rowset.Predicate;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import test.rowset.webrowset.CommonWebRowSetTests;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class FilteredRowSetTests extends CommonWebRowSetTests {
|
||||
|
||||
private FilteredRowSet frs;
|
||||
|
||||
@ -34,16 +34,13 @@ import javax.sql.rowset.RowSetMetaDataImpl;
|
||||
import javax.sql.rowset.WebRowSet;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import test.rowset.webrowset.CommonWebRowSetTests;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class JoinRowSetTests extends CommonWebRowSetTests {
|
||||
|
||||
private final String SUPPLIERS_TABLE = "SUPPLIERS";
|
||||
|
||||
@ -32,12 +32,10 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
import util.BaseTest;
|
||||
import util.StubSyncResolver;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class SyncProviderExceptionTests extends BaseTest {
|
||||
|
||||
// Used by SyncProviderException::getSyncResolver tests
|
||||
|
||||
@ -41,13 +41,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import test.rowset.cachedrowset.CommonCachedRowSetTests;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public abstract class CommonWebRowSetTests extends CommonCachedRowSetTests {
|
||||
|
||||
protected final String XMLFILEPATH = System.getProperty("test.src", ".")
|
||||
|
||||
@ -25,9 +25,6 @@ package test.rowset.webrowset;
|
||||
import java.sql.SQLException;
|
||||
import javax.sql.rowset.WebRowSet;
|
||||
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class WebRowSetTests extends CommonWebRowSetTests {
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user