From 88aa97558f5a5035cbdb3c8300ad5b5661d0f0f0 Mon Sep 17 00:00:00 2001 From: kvv Date: Tue, 5 Dec 2017 15:50:31 +0300 Subject: [PATCH] IAction & Action deleted, some tests added --- .../java/org/scm4j/deployer/api/Action.java | 40 ------------------- .../org/scm4j/deployer/api/Component.java | 4 +- .../java/org/scm4j/deployer/api/IAction.java | 8 ---- .../java/org/scm4j/deployer/api/ApiTest.java | 2 + 4 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 src/main/java/org/scm4j/deployer/api/Action.java delete mode 100644 src/main/java/org/scm4j/deployer/api/IAction.java diff --git a/src/main/java/org/scm4j/deployer/api/Action.java b/src/main/java/org/scm4j/deployer/api/Action.java deleted file mode 100644 index ae47365..0000000 --- a/src/main/java/org/scm4j/deployer/api/Action.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.scm4j.deployer.api; - -import lombok.Getter; - -import java.util.HashMap; -import java.util.Map; - -public class Action implements IAction { - - @Getter - private final Class installerClass; - @Getter private Map params; - private final Component comp; - - public Action(Class installerClass, Component comp) { - this.installerClass = installerClass; - this.comp = comp; - } - - public Action addParam(String key, Object value) { - if(this.params == null) { - params = new HashMap<>(); - params.put(key, value); - } else { - params.put(key, value); - } - return this; - } - - public Component parent() { - return comp; - } - - @Override - public String toString() { - return "Action{" + - "installerClass=" + installerClass.getName() + - '}'; - } -} diff --git a/src/main/java/org/scm4j/deployer/api/Component.java b/src/main/java/org/scm4j/deployer/api/Component.java index 4be65c2..7a8fe52 100644 --- a/src/main/java/org/scm4j/deployer/api/Component.java +++ b/src/main/java/org/scm4j/deployer/api/Component.java @@ -32,9 +32,7 @@ public ProductStructure parent() { @Override public String toString() { - return "Component{" + - "artifactCoords=" + artifactCoords + - '}'; + return "Component{artifactCoords=" + artifactCoords + '}'; } @Override diff --git a/src/main/java/org/scm4j/deployer/api/IAction.java b/src/main/java/org/scm4j/deployer/api/IAction.java deleted file mode 100644 index 378721e..0000000 --- a/src/main/java/org/scm4j/deployer/api/IAction.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.scm4j.deployer.api; - -import java.util.Map; - -public interface IAction { - Class getInstallerClass(); - Map getParams(); -} diff --git a/src/test/java/org/scm4j/deployer/api/ApiTest.java b/src/test/java/org/scm4j/deployer/api/ApiTest.java index 10b188f..dbbe828 100644 --- a/src/test/java/org/scm4j/deployer/api/ApiTest.java +++ b/src/test/java/org/scm4j/deployer/api/ApiTest.java @@ -49,5 +49,7 @@ public void init(IDeploymentContext depCtx) { ps = ProductStructure.createEmptyStructure(); assertEquals(ps.getDefaultDeploymentPath(), ""); assertEquals(ps.getComponents(), Collections.emptyList()); + assertEquals(new Component("123:123:123", ps), new Component("123:123:123", ps)); + assertEquals(new Component("123:123:123", ps).toString(), "Component{artifactCoords=123:123:jar:123}"); } }