Skip to content

Commit 54fdbe8

Browse files
authored
Implemented #53 (#54)
* Implemented #53
1 parent 134032a commit 54fdbe8

File tree

10 files changed

+69
-30
lines changed

10 files changed

+69
-30
lines changed

.github/workflows/broken_links_checker.yml

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/ci-build-next-java.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dependencies.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/changes/changelog.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/changes/changes_0.6.8.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Udf Debugging Java 0.6.8, released 2023-02-07
2+
3+
Code name: Improved LocalServiceExposer
4+
5+
## Summary
6+
7+
Enhanced interface `LocalServiceExposer` and simplified usage.
8+
9+
## Features
10+
11+
* #53: Enhanced interface `LocalServiceExposer` and simplified usage.
12+
13+
## Dependency Updates
14+
15+
### Compile Dependency Updates
16+
17+
* Updated `com.exasol:bucketfs-java:2.6.0` to `3.0.0`
18+
19+
### Test Dependency Updates
20+
21+
* Updated `com.exasol:exasol-testcontainers:6.5.0` to `6.5.1`
22+
* Updated `org.mockito:mockito-junit-jupiter:5.0.0` to `5.1.1`
23+
24+
### Plugin Dependency Updates
25+
26+
* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.1` to `1.2.2`
27+
* Updated `com.exasol:project-keeper-maven-plugin:2.9.1` to `2.9.3`
28+
* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M7` to `3.0.0-M8`
29+
* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7` to `3.0.0-M8`
30+
* Updated `org.codehaus.mojo:versions-maven-plugin:2.13.0` to `2.14.2`

pk_generated_parent.pom

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64
<artifactId>udf-debugging-java</artifactId>
7-
<version>0.6.7</version>
5+
<version>0.6.8</version>
86
<name>udf-debugging-java</name>
97
<description>Utilities for debugging, profiling and code coverage measure for UDFs.</description>
108
<url>https://github.com/exasol/udf-debugging-java/</url>
@@ -55,7 +53,7 @@
5553
<dependency>
5654
<groupId>com.exasol</groupId>
5755
<artifactId>bucketfs-java</artifactId>
58-
<version>2.6.0</version>
56+
<version>3.0.0</version>
5957
</dependency>
6058
<dependency>
6159
<groupId>com.exasol</groupId>
@@ -95,7 +93,7 @@
9593
<dependency>
9694
<groupId>org.mockito</groupId>
9795
<artifactId>mockito-junit-jupiter</artifactId>
98-
<version>5.0.0</version>
96+
<version>5.1.1</version>
9997
<scope>test</scope>
10098
</dependency>
10199
<dependency>
@@ -108,7 +106,7 @@
108106
<dependency>
109107
<groupId>com.exasol</groupId>
110108
<artifactId>exasol-testcontainers</artifactId>
111-
<version>6.5.0</version>
109+
<version>6.5.1</version>
112110
<scope>test</scope>
113111
</dependency>
114112
<dependency>
@@ -153,7 +151,7 @@
153151
<plugin>
154152
<groupId>com.exasol</groupId>
155153
<artifactId>project-keeper-maven-plugin</artifactId>
156-
<version>2.9.1</version>
154+
<version>2.9.3</version>
157155
<executions>
158156
<execution>
159157
<goals>
@@ -187,7 +185,7 @@
187185
<parent>
188186
<artifactId>udf-debugging-java-generated-parent</artifactId>
189187
<groupId>com.exasol</groupId>
190-
<version>0.6.7</version>
188+
<version>0.6.8</version>
191189
<relativePath>pk_generated_parent.pom</relativePath>
192190
</parent>
193191
</project>

src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@
88
@FunctionalInterface
99
public interface LocalServiceExposer {
1010

11+
/**
12+
* Create an instance of {@code LocalServiceExposer} for a host that does not require port mapping.
13+
*
14+
* @param host host name or IP address of host (but without port) providing the service to expose
15+
* @return new instance of {@code LocalServiceExposer}
16+
*/
17+
public static LocalServiceExposer forHost(final String host) {
18+
return port -> new InetSocketAddress(host, port);
19+
}
20+
1121
/**
1222
* Get the address for the network scope inside of the Exasol database for a given local service.
13-
*
23+
*
1424
* @param port port number
1525
* @return proxy
1626
*/

src/main/java/com/exasol/udfdebugging/UdfTestSetup.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.exasol.udfdebugging;
22

3-
import java.net.InetSocketAddress;
43
import java.sql.Connection;
54
import java.util.List;
65
import java.util.stream.Collectors;
@@ -32,12 +31,12 @@ public class UdfTestSetup implements AutoCloseable {
3231
* @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection
3332
*/
3433
public UdfTestSetup(final String testHostIpAddress, final Bucket bucket, final Connection exasolConnection) {
35-
this(port -> new InetSocketAddress(testHostIpAddress, port), bucket, exasolConnection);
34+
this(LocalServiceExposer.forHost(testHostIpAddress), bucket, exasolConnection);
3635
}
3736

3837
/**
3938
* Create a new instance of {@link UdfTestSetup}.
40-
*
39+
*
4140
* @param localServiceExposer Proxy factory that makes ports of the test host available in the container
4241
* @param bucket BucketFS bucket to upload resource to
4342
* @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection
@@ -52,20 +51,17 @@ private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket
5251

5352
/**
5453
* Create a new instance of {@link UdfTestSetup}.
55-
*
54+
*
5655
* @param testSetup Exasol test setup
5756
* @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection
5857
*/
5958
public UdfTestSetup(final ExasolTestSetup testSetup, final Connection exasolConnection) {
60-
this(port -> {
61-
final InetSocketAddress serviceAddress = testSetup.makeLocalTcpServiceAccessibleFromDatabase(port);
62-
return new InetSocketAddress(serviceAddress.getHostName(), serviceAddress.getPort());
63-
}, testSetup.getDefaultBucket(), exasolConnection);
59+
this(testSetup::makeLocalTcpServiceAccessibleFromDatabase, testSetup.getDefaultBucket(), exasolConnection);
6460
}
6561

6662
/**
6763
* Get JVM options required for this setup.
68-
*
64+
*
6965
* @return array of JVM options
7066
*/
7167
public String[] getJvmOptions() {

src/test/java/com/exasol/udfdebugging/modules/TestSetup.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.exasol.udfdebugging.modules;
22

33
import java.io.Closeable;
4-
import java.net.InetSocketAddress;
54
import java.sql.*;
65
import java.util.stream.Stream;
76

@@ -27,7 +26,7 @@ public TestSetup() throws SQLException {
2726
}
2827

2928
public LocalServiceExposer getHostPortProxy() {
30-
return port -> new InetSocketAddress(this.exasol.getHostIp(), port);
29+
return LocalServiceExposer.forHost(this.exasol.getHostIp());
3130
}
3231

3332
public Bucket getDefaultBucket() {

0 commit comments

Comments
 (0)