File tree 17 files changed +23
-46
lines changed
hive-server2-jdbc-driver-thin/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/thin
hive-server2-jdbc-driver-uber/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/uber
17 files changed +23
-46
lines changed Original file line number Diff line number Diff line change @@ -90,3 +90,6 @@ echo "test" | gpg --clearsign
90
90
```
91
91
92
92
Log in to https://central.sonatype.com/ and manually approve the publication.
93
+
94
+ Then, set a new git tag for the specific git commit,
95
+ and write the new version information at https://github.com/linghengqian/hive-server2-jdbc-driver/releases with the git tag.
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class AcidTableTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 21
21
import org .testcontainers .containers .GenericContainer ;
22
22
import org .testcontainers .junit .jupiter .Container ;
23
23
import org .testcontainers .junit .jupiter .Testcontainers ;
24
- import org .testcontainers .utility .DockerImageName ;
25
24
26
25
import java .io .IOException ;
27
26
import java .sql .*;
41
40
@ Testcontainers
42
41
public class InformationSchemaTest {
43
42
@ Container
44
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
43
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
45
44
.withEnv ("SERVICE_NAME" , "hiveserver2" )
46
45
.withExposedPorts (10000 );
47
46
Original file line number Diff line number Diff line change 24
24
import org .testcontainers .containers .Network ;
25
25
import org .testcontainers .junit .jupiter .Container ;
26
26
import org .testcontainers .junit .jupiter .Testcontainers ;
27
- import org .testcontainers .utility .DockerImageName ;
28
27
29
28
import java .sql .Connection ;
30
29
import java .sql .ResultSet ;
@@ -44,14 +43,14 @@ public class StandaloneMetastoreTest {
44
43
private static final Network NETWORK = Network .newNetwork ();
45
44
46
45
@ Container
47
- public static final GenericContainer <?> HMS_CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
46
+ public static final GenericContainer <?> HMS_CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
48
47
.withEnv ("SERVICE_NAME" , "metastore" )
49
48
.withNetwork (NETWORK )
50
49
.withNetworkAliases ("metastore" )
51
50
.withExposedPorts (9083 );
52
51
53
52
@ Container
54
- public static final GenericContainer <?> HS2_CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
53
+ public static final GenericContainer <?> HS2_CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
55
54
.withEnv ("SERVICE_NAME" , "hiveserver2" )
56
55
.withEnv ("SERVICE_OPTS" , "-Dhive.metastore.uris=thrift://metastore:9083" )
57
56
.withNetwork (NETWORK )
Original file line number Diff line number Diff line change 22
22
import org .testcontainers .containers .GenericContainer ;
23
23
import org .testcontainers .junit .jupiter .Container ;
24
24
import org .testcontainers .junit .jupiter .Testcontainers ;
25
- import org .testcontainers .utility .DockerImageName ;
26
25
27
26
import java .sql .Connection ;
28
27
import java .sql .ResultSet ;
40
39
public class ThinTest {
41
40
42
41
@ Container
43
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
42
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
44
43
.withEnv ("SERVICE_NAME" , "hiveserver2" )
45
44
.withExposedPorts (10000 );
46
45
Original file line number Diff line number Diff line change 35
35
import java .sql .*;
36
36
import java .time .Duration ;
37
37
import java .util .List ;
38
- import java .util .Properties ;
39
38
40
39
import static org .awaitility .Awaitility .await ;
41
40
import static org .hamcrest .MatcherAssert .assertThat ;
@@ -115,11 +114,6 @@ private static void extracted(DataSource dataSource) throws SQLException {
115
114
}
116
115
}
117
116
118
- private Connection openConnection () throws SQLException {
119
- Properties props = new Properties ();
120
- return DriverManager .getConnection (jdbcUrlPrefix + jdbcUrlSuffix , props );
121
- }
122
-
123
117
private DataSource createDataSource () {
124
118
extracted (HIVE_SERVER2_1_CONTAINER .getMappedPort (RANDOM_PORT_FIRST ));
125
119
HikariConfig config = new HikariConfig ();
@@ -136,11 +130,11 @@ private void extracted(final int hiveServer2Port) {
136
130
client .start ();
137
131
List <String > children = client .getChildren ().forPath ("/hiveserver2" );
138
132
assertThat (children .size (), is (1 ));
139
- return children .get (0 ).contains ( " :" + hiveServer2Port + ";version=" );
133
+ return children .get (0 ).startsWith ( "serverUri=0.0.0.0 :" + hiveServer2Port + ";version=4.0.1;sequence =" );
140
134
}
141
135
});
142
136
await ().atMost (Duration .ofMinutes (1L )).ignoreExceptions ().until (() -> {
143
- openConnection ( ).close ();
137
+ DriverManager . getConnection ( jdbcUrlPrefix + jdbcUrlSuffix ).close ();
144
138
return true ;
145
139
});
146
140
}
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class AvroTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class OrcTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class ParquetTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class AcidTableTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 21
21
import org .testcontainers .containers .GenericContainer ;
22
22
import org .testcontainers .junit .jupiter .Container ;
23
23
import org .testcontainers .junit .jupiter .Testcontainers ;
24
- import org .testcontainers .utility .DockerImageName ;
25
24
26
25
import java .io .IOException ;
27
26
import java .sql .*;
41
40
@ Testcontainers
42
41
public class InformationSchemaTest {
43
42
@ Container
44
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
43
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
45
44
.withEnv ("SERVICE_NAME" , "hiveserver2" )
46
45
.withExposedPorts (10000 );
47
46
Original file line number Diff line number Diff line change 24
24
import org .testcontainers .containers .Network ;
25
25
import org .testcontainers .junit .jupiter .Container ;
26
26
import org .testcontainers .junit .jupiter .Testcontainers ;
27
- import org .testcontainers .utility .DockerImageName ;
28
27
29
28
import java .sql .Connection ;
30
29
import java .sql .ResultSet ;
@@ -44,14 +43,14 @@ public class StandaloneMetastoreTest {
44
43
private static final Network NETWORK = Network .newNetwork ();
45
44
46
45
@ Container
47
- public static final GenericContainer <?> HMS_CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
46
+ public static final GenericContainer <?> HMS_CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
48
47
.withEnv ("SERVICE_NAME" , "metastore" )
49
48
.withNetwork (NETWORK )
50
49
.withNetworkAliases ("metastore" )
51
50
.withExposedPorts (9083 );
52
51
53
52
@ Container
54
- public static final GenericContainer <?> HS2_CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
53
+ public static final GenericContainer <?> HS2_CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
55
54
.withEnv ("SERVICE_NAME" , "hiveserver2" )
56
55
.withEnv ("SERVICE_OPTS" , "-Dhive.metastore.uris=thrift://metastore:9083" )
57
56
.withNetwork (NETWORK )
Original file line number Diff line number Diff line change 22
22
import org .testcontainers .containers .GenericContainer ;
23
23
import org .testcontainers .junit .jupiter .Container ;
24
24
import org .testcontainers .junit .jupiter .Testcontainers ;
25
- import org .testcontainers .utility .DockerImageName ;
26
25
27
26
import java .sql .Connection ;
28
27
import java .sql .ResultSet ;
40
39
public class UberTest {
41
40
42
41
@ Container
43
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
42
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
44
43
.withEnv ("SERVICE_NAME" , "hiveserver2" )
45
44
.withExposedPorts (10000 );
46
45
Original file line number Diff line number Diff line change 35
35
import java .sql .*;
36
36
import java .time .Duration ;
37
37
import java .util .List ;
38
- import java .util .Properties ;
39
38
40
39
import static org .awaitility .Awaitility .await ;
41
40
import static org .hamcrest .MatcherAssert .assertThat ;
@@ -115,11 +114,6 @@ private static void extracted(DataSource dataSource) throws SQLException {
115
114
}
116
115
}
117
116
118
- private Connection openConnection () throws SQLException {
119
- Properties props = new Properties ();
120
- return DriverManager .getConnection (jdbcUrlPrefix + jdbcUrlSuffix , props );
121
- }
122
-
123
117
private DataSource createDataSource () {
124
118
extracted (HIVE_SERVER2_1_CONTAINER .getMappedPort (RANDOM_PORT_FIRST ));
125
119
HikariConfig config = new HikariConfig ();
@@ -136,11 +130,11 @@ private void extracted(final int hiveServer2Port) {
136
130
client .start ();
137
131
List <String > children = client .getChildren ().forPath ("/hiveserver2" );
138
132
assertThat (children .size (), is (1 ));
139
- return children .get (0 ).contains ( " :" + hiveServer2Port + ";version=" );
133
+ return children .get (0 ).startsWith ( "serverUri=0.0.0.0 :" + hiveServer2Port + ";version=4.0.1;sequence =" );
140
134
}
141
135
});
142
136
await ().atMost (Duration .ofMinutes (1L )).ignoreExceptions ().until (() -> {
143
- openConnection ( ).close ();
137
+ DriverManager . getConnection ( jdbcUrlPrefix + jdbcUrlSuffix ).close ();
144
138
return true ;
145
139
});
146
140
}
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class AvroTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class OrcTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
Original file line number Diff line number Diff line change 20
20
import org .testcontainers .containers .GenericContainer ;
21
21
import org .testcontainers .junit .jupiter .Container ;
22
22
import org .testcontainers .junit .jupiter .Testcontainers ;
23
- import org .testcontainers .utility .DockerImageName ;
24
23
25
24
import java .sql .*;
26
25
import java .time .Duration ;
34
33
@ Testcontainers
35
34
public class ParquetTest {
36
35
@ Container
37
- public static final GenericContainer <?> CONTAINER = new GenericContainer <>(DockerImageName . parse ( "apache/hive:4.0.1" ) )
36
+ public static final GenericContainer <?> CONTAINER = new GenericContainer <>("apache/hive:4.0.1" )
38
37
.withEnv ("SERVICE_NAME" , "hiveserver2" )
39
38
.withExposedPorts (10000 );
40
39
You can’t perform that action at this time.
0 commit comments