9
9
import org .junit .Test ;
10
10
11
11
public class CharacterTypesExtendedCodecTest extends ExtendedQueryDataTypeCodecTestBase {
12
+
12
13
@ Test
13
14
public void testDecodeName (TestContext ctx ) {
14
- testGeneric (ctx , "SELECT $1 ::NAME \" Name \" " , new String []{ "What is my name ?" }, Tuple :: getString );
15
+ testDecode (ctx , "SELECT 'What is my name ?' ::NAME" , Tuple :: getString , "What is my name ?" );
15
16
}
16
17
17
18
@ Test
@@ -37,10 +38,9 @@ public void testEncodeName(TestContext ctx) {
37
38
}));
38
39
}
39
40
40
-
41
41
@ Test
42
42
public void testDecodeChar (TestContext ctx ) {
43
- testGeneric (ctx , "SELECT $1 ::CHAR \" SingleChar \" " , new String []{ "A" }, Tuple ::getString );
43
+ testDecode (ctx , "SELECT 'A' ::CHAR" , Tuple ::getString , "A" );
44
44
}
45
45
46
46
@ Test
@@ -68,7 +68,7 @@ public void testEncodeChar(TestContext ctx) {
68
68
69
69
@ Test
70
70
public void testDecodeFixedChar (TestContext ctx ) {
71
- testGeneric (ctx , "SELECT $1 ::CHAR(3) \" FixedChar \" " , new String []{ "YES" }, Tuple ::getString );
71
+ testDecode (ctx , "SELECT 'YES' ::CHAR(3)" , Tuple ::getString , "YES" );
72
72
}
73
73
74
74
@ Test
@@ -96,7 +96,7 @@ public void testEncodeFixedChar(TestContext ctx) {
96
96
97
97
@ Test
98
98
public void testDecodeText (TestContext ctx ) {
99
- testGeneric (ctx , "SELECT $1 ::TEXT \" Text \" " , new String []{ "Hello World" }, Tuple :: getString );
99
+ testDecode (ctx , "SELECT 'Hello World' ::TEXT" , Tuple :: getString , "Hello World" );
100
100
}
101
101
102
102
@ Test
@@ -123,8 +123,8 @@ public void testEncodeText(TestContext ctx) {
123
123
}
124
124
125
125
@ Test
126
- public void testDecodeVarCharacter (TestContext ctx ) {
127
- testGeneric (ctx , "SELECT $1 ::VARCHAR \" VarCharacter \" " , new String []{ "Great!" }, Tuple :: getString );
126
+ public void testDecodeVarchar (TestContext ctx ) {
127
+ testDecode (ctx , "SELECT 'Great!' ::VARCHAR" , Tuple :: getString , "Great!" );
128
128
}
129
129
130
130
@ Test
@@ -171,8 +171,8 @@ public void testEncodeLargeVarchar(TestContext ctx) {
171
171
}
172
172
173
173
@ Test
174
- public void testDecodeStringArray (TestContext ctx ) {
175
- testGeneric (ctx , "SELECT $1 ::TEXT[]\" Text \" " , new String [][]{ new String []{"Knock, knock.Who’s there?very long pause…. Java." }}, Tuple :: getArrayOfStrings );
174
+ public void testDecodeTextArray (TestContext ctx ) {
175
+ testDecode (ctx , "SELECT '{ \" Knock, knock.Who’s there?very long pause... Java. \" }' ::TEXT[]" , Tuple :: getArrayOfStrings , ( Object ) new String [] {"Knock, knock.Who’s there?very long pause... Java." });
176
176
}
177
177
178
178
@ Test
0 commit comments