Skip to content

Commit

Permalink
[issues-1315] - Replacing port 5000 with 5432 for docker/ftest-docker…
Browse files Browse the repository at this point in the history
…-containerobject tests, since 5000 is already in use by GitHub runners that execute CI checks
  • Loading branch information
fabiobrz committed Oct 6, 2024
1 parent ee6d830 commit 49e0377
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class CubeConfigurationTest {
"web:\n" +
" build: .\n" +
" ports:\n" +
" - \"5000:5000\"\n" +
" - \"5432:5000\"\n" +
" volumes:\n" +
" - .:/code\n" +
" links:\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
context: https://github.com/tsongpon/pingpong.git
dockerfile: Dockerfile
ports:
- "5000:8080"
- "5432:8080"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.api.docker.DockerDescriptor;

@Cube(value = "pingpong", portBinding = "5000->8080/tcp")
@Cube(value = "pingpong", portBinding = "5432->8080/tcp")
public class PingPongContainer {

@HostIp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class PingPongIT {
public void shouldReturnOkAsPong() throws IOException {
String pong = ping();
assertThat(pong, is("OK"));
assertThat(pingPongContainer.getConnectionPort(), is(5000));
assertThat(pingPongContainer.getConnectionPort(), is(5432));
}

public String ping() throws IOException {
Expand Down
12 changes: 6 additions & 6 deletions docs/cop.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The Container Object will be a simple POJO with special annotations:
----
package org.superbiz.containerobject;
@Cube(value = "pingpong", portBinding = "5000->8080/tcp") // <1>
@Cube(value = "pingpong", portBinding = "5432->8080/tcp") // <1>
@CubeDockerFile
public class PingPongContainer {
Expand All @@ -71,7 +71,7 @@ public class PingPongContainer {
<3> The Container Object hides how to connect to the PingPong server

The `@Cube` annotation is used to configure a Container Object.
Its `value` property is used to specify how the started container will be named (in this example `pingpong`) while the `portBinding` property can be used to specify the port binding information for the container instance (in this case `5000->8080/tcp`).
Its `value` property is used to specify how the started container will be named (in this example `pingpong`) while the `portBinding` property can be used to specify the port binding information for the container instance (in this case `5432->8080/tcp`).
Notice that `portBinding` can also accept an array, in which case more than one port binding definitions can be specified.

The next annotation is `@CubeDockerFile`, which configures how the container is created.
Expand All @@ -85,7 +85,7 @@ This location must be reachable from the ClassLoader creating the container obje
Any Cube can be enriched with any client side enricher. In the previous example a `@HostIp` enricher is used, but it could be enriched similarly with `@CubeIp` (which works similar to `@HostPort`), or a `DockerClient` instance if the field is annotated with `@ArquillianResource`.

Finally the `@HostPort` is used to translate the exposed port to the bound port.
In this example the port value will be 5000. Later you will learn briefly why this annotation is important.
In this example the port value will be 5432. Later you will learn briefly why this annotation is important.

After creating the container object, you can start using it in your test:

Expand All @@ -102,7 +102,7 @@ public class PingPongTest {
public void shouldReturnOkAsPong() throws IOException {
String pong = ping();
assertThat(pong, containsString("OK"));
assertThat(pingPongContainer.getConnectionPort(), is(5000));
assertThat(pingPongContainer.getConnectionPort(), is(5432));
}
}
----
Expand Down Expand Up @@ -141,7 +141,7 @@ And in similar way you use `@Deployment` in Arquillian test, you can use `@CubeD
[source, java]
.PingPongContainer.java
----
@Cube(value = "pingpong", portBinding = "5000->8080/tcp")
@Cube(value = "pingpong", portBinding = "5432->8080/tcp")
public class PingPongContainer {
@CubeDockerFile // <1>
Expand Down Expand Up @@ -255,7 +255,7 @@ public class PingPongTest {
try {
String pong = ping();
assertThat(pong, containsString("OK"));
assertThat(pingPongContainer.getConnectionPort(), is(5000));
assertThat(pingPongContainer.getConnectionPort(), is(5432));
} finally {
cubeController.stop("pingpong"); // <3>
cubeController.destroy("pingpong");
Expand Down
2 changes: 1 addition & 1 deletion docs/restassured.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ With next docker compose file which starts a ping pong server listening at root
helloworld:
image: tsongpon/pingpong
ports:
- "5000:8080"
- "5432:8080"
----

You only need to do:
Expand Down

0 comments on commit 49e0377

Please sign in to comment.