HHH-18560: added unittest
This commit is contained in:
parent
944ff41a65
commit
9cf4bd8251
|
@ -0,0 +1,69 @@
|
|||
package org.hibernate.dialect;
|
||||
|
||||
import org.hibernate.testing.orm.junit.JiraKey;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
class DB2iDialectTest {
|
||||
|
||||
private static final String EXPECTED_FOR_UPDATE = " for update with rs";
|
||||
private static final String EXPECTED_FOR_UPDATE_SKIP_LOCK = " for update with rs skip locked data";
|
||||
|
||||
private DB2iDialect dialect;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
dialect = new DB2iDialect();
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void getForUpdateString() {
|
||||
String actual = dialect.getForUpdateString();
|
||||
assertEquals(EXPECTED_FOR_UPDATE, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void getForUpdateSkipLockedString() {
|
||||
String actual = dialect.getForUpdateSkipLockedString();
|
||||
assertEquals(EXPECTED_FOR_UPDATE_SKIP_LOCK, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void testGetForUpdateSkipLockedString() {
|
||||
String actual = dialect.getForUpdateSkipLockedString("alias");
|
||||
assertEquals(EXPECTED_FOR_UPDATE_SKIP_LOCK, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void getWriteLockString_skiplocked() {
|
||||
String actual = dialect.getWriteLockString(-2);
|
||||
assertEquals(EXPECTED_FOR_UPDATE_SKIP_LOCK, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void getWriteLockString() {
|
||||
String actual = dialect.getWriteLockString(0);
|
||||
assertEquals(EXPECTED_FOR_UPDATE, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void getReadLockString() {
|
||||
String actual = dialect.getReadLockString(0);
|
||||
assertEquals(EXPECTED_FOR_UPDATE, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@JiraKey("HHH-18560")
|
||||
void getReadLockString_skipLocked() {
|
||||
String actual = dialect.getReadLockString(-2);
|
||||
assertEquals(EXPECTED_FOR_UPDATE_SKIP_LOCK, actual);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue