Skip to content

Commit

Permalink
Mark link-related APIs as deprecated pending future removal (#487)
Browse files Browse the repository at this point in the history
* Mark link-related APIs as deprecated pending future removal
See #465

* Update changelog re deprecated links features
  • Loading branch information
rnorth authored Nov 12, 2017
1 parent b4d3c99 commit 74eecd4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Make Network instances reusable (i.e. work with `@ClassRule`) ([\#469](https://github.com/testcontainers/testcontainers-java/issues/469))
- Added support for explicitly setting file mode when copying file into container ([\#446](https://github.com/testcontainers/testcontainers-java/issues/446), [\#467](https://github.com/testcontainers/testcontainers-java/issues/467))
- Mark all links functionality as deprecated. This is pending removal in a later release. Please see [\#465](https://github.com/testcontainers/testcontainers-java/issues/465). {@link Network} features should be used instead.

## [1.4.3] - 2017-10-14
### Fixed
Expand Down
10 changes: 10 additions & 0 deletions core/src/main/java/org/testcontainers/containers/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ default void addFileSystemBind(final String hostPath, final String containerPath
*
* @param otherContainer the other container object to link to
* @param alias the alias (for the other container) that this container should be able to use
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
*/
@Deprecated
void addLink(LinkableContainer otherContainer, String alias);

/**
Expand Down Expand Up @@ -420,6 +422,10 @@ ExecResult execInContainer(Charset outputCharset, String... command)

List<Bind> getBinds();

/**
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
*/
@Deprecated
Map<String, LinkableContainer> getLinkedContainers();

DockerClient getDockerClient();
Expand All @@ -446,6 +452,10 @@ ExecResult execInContainer(Charset outputCharset, String... command)

void setBinds(List<Bind> binds);

/**
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
*/
@Deprecated
void setLinkedContainers(Map<String, LinkableContainer> linkedContainers);

void setWaitStrategy(WaitStrategy waitStrategy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ public class GenericContainer<SELF extends GenericContainer<SELF>>
@NonNull
private List<VolumesFrom> volumesFroms = new ArrayList<>();

/**
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
*/
@NonNull
@Deprecated
private Map<String, LinkableContainer> linkedContainers = new HashMap<>();

private StartupCheckStrategy startupCheckStrategy = new IsRunningStartupCheckStrategy();
Expand Down Expand Up @@ -522,6 +526,10 @@ private void addVolumesFrom(Container container, BindMode mode) {
volumesFroms.add(new VolumesFrom(container.getContainerName(), mode.accessMode));
}

/**
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
*/
@Deprecated
@Override
public void addLink(LinkableContainer otherContainer, String alias) {
this.linkedContainers.put(alias, otherContainer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

/**
* A container which can be linked to by other containers.
*
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link org.testcontainers.containers.Network} features instead.
*/
@Deprecated
public interface LinkableContainer {

String getContainerName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ private void stopAndRetainRecording(Description description) {
* @param otherContainer the container rule to link to
* @param alias the alias (hostname) that this other container should be referred to by
* @return this
*
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
*/
@Deprecated
public SELF withLinkToContainer(LinkableContainer otherContainer, String alias) {
addLink(otherContainer, alias);
return self();
Expand Down

0 comments on commit 74eecd4

Please sign in to comment.