Skip to content

Commit 2f8a275

Browse files
committed
HHH-17404 add test claeanup phase
1 parent fca71fa commit 2f8a275

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

hibernate-core/src/main/java/org/hibernate/type/format/StringJsonDocumentReader.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,12 @@ private void moveStateMachine(StringJsonDocumentMarker marker) {
114114
assert this.processingStates.getCurrent() == JsonProcessingState.OBJECT;
115115
break;
116116
case QUOTE:
117-
switch ( currentState ) {
118-
case STARTING_ARRAY:
119-
this.processingStates.push( JsonProcessingState.ARRAY );
120-
break;
121-
case STARTING_OBJECT:
122-
this.processingStates.push( JsonProcessingState.OBJECT );
123-
this.processingStates.push( JsonProcessingState.OBJECT_KEY_NAME );
124-
break;
117+
if (currentState == JsonProcessingState.STARTING_ARRAY) {
118+
this.processingStates.push( JsonProcessingState.ARRAY );
119+
}
120+
if (currentState == JsonProcessingState.STARTING_OBJECT) {
121+
this.processingStates.push( JsonProcessingState.OBJECT );
122+
this.processingStates.push( JsonProcessingState.OBJECT_KEY_NAME );
125123
}
126124
break;
127125
case OTHER:

hibernate-core/src/test/java/org/hibernate/orm/test/mapping/hhh17404/OracleOsonCompatibilityTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.hibernate.testing.orm.junit.SessionFactoryScope;
1919
import org.hibernate.testing.orm.junit.Setting;
2020
import org.hibernate.type.SqlTypes;
21+
import org.junit.jupiter.api.AfterEach;
2122
import org.junit.jupiter.api.BeforeEach;
2223
import org.junit.jupiter.api.Test;
2324

@@ -110,6 +111,15 @@ public void setup(SessionFactoryScope scope) {
110111
);
111112
}
112113

114+
@AfterEach
115+
public void tearDown(SessionFactoryScope scope) {
116+
scope.inTransaction(
117+
(session) -> {
118+
session.createNativeQuery( session.getDialect().getDropTableString( "TEST_OSON_COMPAT" ) ).executeUpdate();
119+
}
120+
);
121+
}
122+
113123
@Test
114124
public void verifyReadWorks(SessionFactoryScope scope) {
115125
scope.inTransaction(

0 commit comments

Comments
 (0)