Skip to content

Enable compilation failures on warnings for tests #1276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void shouldTwoConfigBeEqual() {
}

@Test
@SuppressWarnings("deprecation")
void shouldSerialize() throws Exception {
SessionConfig config = SessionConfig.builder()
.withBookmarks(
Expand Down
28 changes: 9 additions & 19 deletions driver/src/test/java/org/neo4j/driver/integration/BookmarkIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.neo4j.driver.internal.util.BookmarkUtil.assertBookmarkIsEmpty;
import static org.neo4j.driver.internal.util.BookmarkUtil.assertBookmarksContainsSingleUniqueValues;

import java.util.UUID;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down Expand Up @@ -59,6 +58,7 @@ void assumeBookmarkSupport() {

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V4)
@SuppressWarnings("deprecation")
void shouldReceiveBookmarkOnSuccessfulCommit() throws Throwable {
// Given
assertBookmarkIsEmpty(session.lastBookmark());
Expand All @@ -72,6 +72,7 @@ void shouldReceiveBookmarkOnSuccessfulCommit() throws Throwable {

@Test
@EnabledOnNeo4jWith(Neo4jFeature.BOLT_V4)
@SuppressWarnings("deprecation")
void shouldReceiveNewBookmarkOnSuccessfulCommit() throws Throwable {
// Given
Bookmark initialBookmark = session.lastBookmark();
Expand All @@ -96,6 +97,7 @@ void shouldThrowForInvalidBookmark() {
}

@Test
@SuppressWarnings("deprecation")
void bookmarkRemainsAfterRolledBackTx() {
assertBookmarkIsEmpty(session.lastBookmark());

Expand All @@ -113,6 +115,7 @@ void bookmarkRemainsAfterRolledBackTx() {
}

@Test
@SuppressWarnings("deprecation")
void bookmarkRemainsAfterTxFailure() {
assertBookmarkIsEmpty(session.lastBookmark());

Expand All @@ -128,6 +131,7 @@ void bookmarkRemainsAfterTxFailure() {
}

@Test
@SuppressWarnings("deprecation")
void bookmarkRemainsAfterSuccessfulSessionRun() {
assertBookmarkIsEmpty(session.lastBookmark());

Expand All @@ -142,6 +146,7 @@ void bookmarkRemainsAfterSuccessfulSessionRun() {
}

@Test
@SuppressWarnings("deprecation")
void bookmarkRemainsAfterFailedSessionRun() {
assertBookmarkIsEmpty(session.lastBookmark());

Expand All @@ -155,6 +160,7 @@ void bookmarkRemainsAfterFailedSessionRun() {
}

@Test
@SuppressWarnings("deprecation")
void bookmarkIsUpdatedOnEveryCommittedTx() {
assertBookmarkIsEmpty(session.lastBookmark());

Expand All @@ -174,6 +180,7 @@ void bookmarkIsUpdatedOnEveryCommittedTx() {
}

@Test
@SuppressWarnings("deprecation")
void createSessionWithInitialBookmark() {
Bookmark bookmark = parse("TheBookmark");
try (Session session = driver.session(builder().withBookmarks(bookmark).build())) {
Expand All @@ -182,6 +189,7 @@ void createSessionWithInitialBookmark() {
}

@Test
@SuppressWarnings("deprecation")
void createSessionWithAccessModeAndInitialBookmark() {
Bookmark bookmark = parse("TheBookmark");
try (Session session = driver.session(builder().withBookmarks(bookmark).build())) {
Expand All @@ -195,22 +203,4 @@ private static void createNodeInTx(Session session) {
tx.commit();
}
}

private static boolean isUuid(String string) {
try {
UUID.fromString(string);
} catch (IllegalArgumentException | NullPointerException e) {
return false;
}
return true;
}

private static boolean isNumeric(String string) {
try {
Long.parseLong(string);
} catch (NumberFormatException | NullPointerException e) {
return false;
}
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ void connectionUsedForBeginTxReturnedToThePoolWhenSessionClose() {

@Test
@EnabledOnNeo4jWith(BOLT_V4)
@SuppressWarnings("deprecation")
void sessionCloseShouldReleaseConnectionUsedBySessionRun() {
RxSession session = driver.rxSession();
RxResult res = session.run("UNWIND [1,2,3,4] AS a RETURN a");
Expand All @@ -320,6 +321,7 @@ void sessionCloseShouldReleaseConnectionUsedBySessionRun() {

@Test
@EnabledOnNeo4jWith(BOLT_V4)
@SuppressWarnings("deprecation")
void resultRecordsShouldReleaseConnectionUsedBySessionRun() {
RxSession session = driver.rxSession();
RxResult res = session.run("UNWIND [1,2,3,4] AS a RETURN a");
Expand All @@ -339,6 +341,7 @@ void resultRecordsShouldReleaseConnectionUsedBySessionRun() {

@Test
@EnabledOnNeo4jWith(BOLT_V4)
@SuppressWarnings("deprecation")
void resultSummaryShouldReleaseConnectionUsedBySessionRun() {
RxSession session = driver.rxSession();
RxResult res = session.run("UNWIND [1,2,3,4] AS a RETURN a");
Expand All @@ -354,6 +357,7 @@ void resultSummaryShouldReleaseConnectionUsedBySessionRun() {

@Test
@EnabledOnNeo4jWith(BOLT_V4)
@SuppressWarnings("deprecation")
void txCommitShouldReleaseConnectionUsedByBeginTx() {
AtomicReference<Connection> connection1Ref = new AtomicReference<>();

Expand Down Expand Up @@ -386,6 +390,7 @@ void txCommitShouldReleaseConnectionUsedByBeginTx() {

@Test
@EnabledOnNeo4jWith(BOLT_V4)
@SuppressWarnings("deprecation")
void txRollbackShouldReleaseConnectionUsedByBeginTx() {
AtomicReference<Connection> connection1Ref = new AtomicReference<>();

Expand Down Expand Up @@ -418,6 +423,7 @@ void txRollbackShouldReleaseConnectionUsedByBeginTx() {

@Test
@EnabledOnNeo4jWith(BOLT_V4)
@SuppressWarnings("deprecation")
void sessionCloseShouldReleaseConnectionUsedByBeginTx() {
// Given
RxSession session = driver.rxSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class EntityTypeIT {
static final SessionExtension session = new SessionExtension();

@Test
@SuppressWarnings("deprecation")
void shouldReturnIdentitiesOfNodes() {
// When
Result cursor = session.run("CREATE (n) RETURN n");
Expand All @@ -46,6 +47,7 @@ void shouldReturnIdentitiesOfNodes() {
}

@Test
@SuppressWarnings("deprecation")
void shouldReturnIdentitiesOfRelationships() {
// When
Result cursor = session.run("CREATE ()-[r:T]->() RETURN r");
Expand All @@ -58,6 +60,7 @@ void shouldReturnIdentitiesOfRelationships() {
}

@Test
@SuppressWarnings("deprecation")
void shouldReturnIdentitiesOfPaths() {
// When
Result cursor = session.run("CREATE p=()-[r:T]->() RETURN p");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ void shouldFailForIllegalQueries() {
}

@Test
@SuppressWarnings("deprecation")
void shouldBeAbleToLogSemanticWrongExceptions() {
try {
// When I run a query with the old syntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ void shouldSetTransactionMetadataWithWriteTransactionFunction() {
}

@Test
@SuppressWarnings("deprecation")
void shouldUseBookmarksForAutoCommitTransactions() {
Session session = driver.session();
Bookmark initialBookmark = session.lastBookmark();
Expand All @@ -213,6 +214,7 @@ void shouldUseBookmarksForAutoCommitTransactions() {
}

@Test
@SuppressWarnings("deprecation")
void shouldUseBookmarksForAutoCommitAndUnmanagedTransactions() {
Session session = driver.session();
Bookmark initialBookmark = session.lastBookmark();
Expand Down Expand Up @@ -243,6 +245,7 @@ void shouldUseBookmarksForAutoCommitAndUnmanagedTransactions() {
}

@Test
@SuppressWarnings("deprecation")
void shouldUseBookmarksForAutoCommitTransactionsAndTransactionFunctions() {
Session session = driver.session();
Bookmark initialBookmark = session.lastBookmark();
Expand Down Expand Up @@ -307,6 +310,7 @@ void shouldSendGoodbyeWhenClosingDriver() {
}
}

@SuppressWarnings("deprecation")
private static void testTransactionMetadataWithAsyncTransactionFunctions(boolean read) {
AsyncSession asyncSession = driver.asyncSession();
Map<String, Object> metadata = new HashMap<>();
Expand All @@ -329,6 +333,7 @@ private static void testTransactionMetadataWithAsyncTransactionFunctions(boolean
assertEquals(metadata, await(metadataFuture));
}

@SuppressWarnings("deprecation")
private static void testTransactionMetadataWithTransactionFunctions(boolean read) {
Session session = driver.session();
Map<String, Object> metadata = new HashMap<>();
Expand Down
Loading