summaryrefslogtreecommitdiffstats
path: root/auth
diff options
context:
space:
mode:
Diffstat (limited to 'auth')
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Cmd.java3
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Admin.java97
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java98
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java35
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java42
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java23
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java4
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListActivity.java28
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListAdminResponsible.java27
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListByName.java27
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListChildren.java29
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListNsKeysByAttrib.java27
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsers.java79
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersContact.java105
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersInRole.java48
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java18
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Owner.java63
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_CreateDelete.java30
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java30
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java90
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListActivity.java34
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNS.java32
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNameOnly.java34
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByPerm.java32
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByRole.java33
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByUser.java35
-rw-r--r--auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_User.java30
27 files changed, 800 insertions, 333 deletions
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Cmd.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Cmd.java
index e87df80b..bbc84ecb 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Cmd.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Cmd.java
@@ -28,6 +28,7 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
+import static org.mockito.Mockito.*;
import org.onap.aaf.auth.cmd.AAFcli;
import org.onap.aaf.auth.cmd.Cmd;
import org.onap.aaf.auth.cmd.Param;
@@ -49,8 +50,6 @@ import org.onap.aaf.misc.env.impl.BasicEnv;
import aaf.v2_0.History;
import aaf.v2_0.History.Item;
-import static org.mockito.Mockito.*;
-
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Admin.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Admin.java
index 4da21e82..a3f3f42a 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Admin.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Admin.java
@@ -22,8 +22,17 @@
package org.onap.aaf.auth.cmd.test.ns;
import org.junit.Assert;
+import org.junit.Before;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -31,42 +40,70 @@ import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aaf.auth.cmd.AAFcli;
import org.onap.aaf.auth.cmd.ns.Admin;
+import org.onap.aaf.auth.cmd.ns.ListUsersContact;
import org.onap.aaf.auth.cmd.ns.NS;
+import org.onap.aaf.auth.env.AuthzEnv;
+import org.onap.aaf.cadi.CadiException;
+import org.onap.aaf.cadi.Locator;
+import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.cadi.PropAccess;
+import org.onap.aaf.cadi.SecuritySetter;
+import org.onap.aaf.cadi.Locator.Item;
+import org.onap.aaf.cadi.http.HMangr;
+import org.onap.aaf.cadi.http.HRcli;
+import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_Admin {
-// private static Admin admin;
-//
-// @BeforeClass
-// public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = org.onap.aaf.auth.cmd.test.JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// admin = new Admin(ns);
-// }
-//
-// @Test
-// public void exec() {
-// try {
-// assertEquals(admin._exec(0, "add", "del", "reset", "extend"), 500);
-// } catch (Exception e) {
-// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
-// }
-// }
-//
+ private static Admin admin;
+
+ PropAccess prop;
+ AuthzEnv aEnv;
+ Writer wtr;
+ Locator<URI> loc;
+ HMangr hman;
+ AAFcli aafcli;
+
+
+ @Before
+ public void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ prop = new PropAccess();
+ aEnv = new AuthzEnv();
+ wtr = mock(Writer.class);
+ loc = mock(Locator.class);
+ SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
+ hman = new HMangr(aEnv, loc);
+ aafcli = new AAFcli(prop, aEnv, wtr, hman, null, secSet);
+ NS ns = new NS(aafcli);
+ admin = new Admin(ns);
+
+ }
+
// @Test
-// public void detailedHelp() {
-// boolean hasNoError = true;
-// try {
-// admin.detailedHelp(1, new StringBuilder("test"));
-// } catch (Exception e) {
-// hasNoError = false;
-// }
-// assertEquals(hasNoError, true);
+// public void testExec() throws APIException, LocatorException, CadiException, URISyntaxException {
+// Item value = mock(Item.class);
+// Locator.Item item = new Locator.Item() {
+// };
+// when(loc.best()).thenReturn(value);
+// URI uri = new URI("http://java.sun.com/j2se/1.3/");
+// when(loc.get(value)).thenReturn(uri);
+// SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
+// HRcli hcli = new HRcli(hman, uri, item, secSet);
+// String[] strArr = {"add", "del","add","add"};
+// admin._exec(0, strArr);
+//
// }
-
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ admin.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java
index 4ef49cbc..3dd338fe 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java
@@ -22,9 +22,23 @@
package org.onap.aaf.auth.cmd.test.ns;
import org.junit.Assert;
+import org.junit.Before;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import static org.mockito.Mockito.*;
+import org.mockito.Mockito;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,41 +47,65 @@ import org.onap.aaf.auth.cmd.AAFcli;
import org.onap.aaf.auth.cmd.ns.Attrib;
import org.onap.aaf.auth.cmd.ns.NS;
import org.onap.aaf.auth.cmd.test.JU_AAFCli;
+import org.onap.aaf.auth.env.AuthzEnv;
+import org.onap.aaf.cadi.CadiException;
+import org.onap.aaf.cadi.Locator;
+import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.cadi.PropAccess;
+import org.onap.aaf.cadi.SecuritySetter;
+import org.onap.aaf.cadi.Locator.Item;
+import org.onap.aaf.cadi.http.HMangr;
+import org.onap.aaf.cadi.http.HRcli;
+import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_Attrib {
-// private static Attrib attrib;
-//
-// @BeforeClass
-// public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// attrib = new Attrib(ns);
-// }
-//
-// @Test
-// public void exec() {
-// try {
-// attrib._exec(0, "add", "del", "reset", "extend");
-// } catch (Exception e) {
-// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
-// }
-// }
-//
+ private static Attrib attrib;
+ PropAccess prop;
+ AuthzEnv aEnv;
+ Writer wtr;
+ Locator<URI> loc;
+ HMangr hman;
+ AAFcli aafcli;
+
+ @Before
+ public void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ prop = new PropAccess();
+ aEnv = new AuthzEnv();
+ wtr = mock(Writer.class);
+ loc = mock(Locator.class);
+ SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
+ hman = new HMangr(aEnv, loc);
+ aafcli = new AAFcli(prop, aEnv, wtr, hman, null, secSet);
+ NS ns = new NS(aafcli);
+ attrib = new Attrib(ns);
+ }
+
// @Test
-// public void detailedHelp() {
-// boolean hasNoError = true;
-// try {
-// attrib.detailedHelp(1, new StringBuilder("test"));
-// } catch (Exception e) {
-// hasNoError = false;
-// }
-// assertEquals(hasNoError, true);
+// public void testExec() throws APIException, LocatorException, CadiException, URISyntaxException {
+// Item value = mock(Item.class);
+// Locator.Item item = new Locator.Item() {
+// };
+// when(loc.best()).thenReturn(value);
+// URI uri = new URI("http://java.sun.com/j2se/1.3/");
+// when(loc.get(value)).thenReturn(uri);
+// SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
+// HRcli hcli = new HRcli(hman, uri, item, secSet);
+// String[] strArr = {"add","upd","del","add","upd","del"};
+// attrib._exec(0, strArr);
+//
// }
-
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ attrib.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java
index 86e05539..592f6274 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java
@@ -39,28 +39,25 @@ public class JU_Create {
private static Create create;//might need to replace import with org.onap.aaf.auth.cmd.perm
-// @BeforeClass
-// public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// create = new Create(ns);
-// }
-
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @BeforeClass
+ public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ create = new Create(ns);
}
+
+
- //@Test
- public void exec() {
- try {
- assertEquals(create._exec(0, "add", "del", "reset", "extend"), 500);
- } catch (Exception e) {
- assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
- }
- }
+// @Test
+// public void exec() {
+// try {
+// assertEquals(create._exec(0, "add", "del", "reset", "extend"), 500);
+// } catch (Exception e) {
+// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
+// }
+// }
- //@Test
+ @Test
public void detailedHelp() {
boolean hasNoError = true;
try {
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java
index 0623b095..c4086818 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java
@@ -39,16 +39,16 @@ import org.onap.aaf.misc.env.APIException;
public class JU_Delete {
-// private static Delete delete;//import may be org.onap.aaf.auth.cmd.perm
-//
-// @BeforeClass
-// public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// delete = new Delete(ns);
-//
-// }
-//
+ private static Delete delete;//import may be org.onap.aaf.auth.cmd.perm
+
+ @BeforeClass
+ public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ delete = new Delete(ns);
+
+ }
+
// @Test
// public void exec() {
// try {
@@ -57,17 +57,17 @@ public class JU_Delete {
// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
// }
// }
-//
-// @Test
-// public void detailedHelp() {
-// boolean hasNoError = true;
-// try {
-// delete.detailedHelp(1, new StringBuilder("test"));
-// } catch (Exception e) {
-// hasNoError = false;
-// }
-// assertEquals(hasNoError, true);
-// }
+
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ delete.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
+ }
@Test //TODO: Temporary fix AAF-111
public void netYetTested() {
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java
index 7c65939b..7bec934f 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java
@@ -45,14 +45,14 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_Describe {
-// private static Describe desc;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// desc = new Describe(ns);
-// }
+ private static Describe desc;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ desc = new Describe(ns);
+ }
//
// @Test
// public void exec() {
@@ -70,9 +70,10 @@ public class JU_Describe {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ StringBuilder sb = new StringBuilder();
+ desc.detailedHelp(0, sb );
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java
index 99ad284b..f62a8182 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java
@@ -14,10 +14,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
* ============LICENSE_END====================================================
*
*/
+
package org.onap.aaf.auth.cmd.test.ns;
import static org.junit.Assert.*;
@@ -78,5 +78,5 @@ public class JU_List {
list.report(null, "test");
list.report(fu, "test");
}
-
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListActivity.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListActivity.java
index 9ff82d13..c36088f3 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListActivity.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListActivity.java
@@ -42,16 +42,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListActivity {
-// private static ListActivity lsActivity;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// List ls = new List(ns);
-// lsActivity = new ListActivity(ls);
-// }
-//
+ private static ListActivity lsActivity;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ List ls = new List(ns);
+ lsActivity = new ListActivity(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -68,9 +68,11 @@ public class JU_ListActivity {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ StringBuilder sb = new StringBuilder();
+ lsActivity.detailedHelp(0, sb );
}
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListAdminResponsible.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListAdminResponsible.java
index aacf842e..40136f2e 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListAdminResponsible.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListAdminResponsible.java
@@ -41,16 +41,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListAdminResponsible {
-// private static ListAdminResponsible lsAdminRes;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// List ls = new List(ns);
-// lsAdminRes = new ListAdminResponsible(ls);
-// }
-//
+ private static ListAdminResponsible lsAdminRes;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ List ls = new List(ns);
+ lsAdminRes = new ListAdminResponsible(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -68,9 +68,10 @@ public class JU_ListAdminResponsible {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ StringBuilder sb = new StringBuilder();
+ lsAdminRes.detailedHelp(0, sb );
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListByName.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListByName.java
index 19000109..cba37108 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListByName.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListByName.java
@@ -41,16 +41,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListByName {
-// private static ListByName lsByName;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// List ls = new List(ns);
-// lsByName = new ListByName(ls);
-// }
-//
+ private static ListByName lsByName;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ List ls = new List(ns);
+ lsByName = new ListByName(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,9 +67,10 @@ public class JU_ListByName {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ StringBuilder sb = new StringBuilder();
+ lsByName.detailedHelp(0, sb );
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListChildren.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListChildren.java
index 5695c624..5723f19f 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListChildren.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListChildren.java
@@ -41,17 +41,17 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListChildren {
-//
-// private static ListChildren lsChildren;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// List ls = new List(ns);
-// lsChildren = new ListChildren(ls);
-// }
-//
+
+ private static ListChildren lsChildren;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ List ls = new List(ns);
+ lsChildren = new ListChildren(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -68,9 +68,10 @@ public class JU_ListChildren {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ StringBuilder sb = new StringBuilder();
+ lsChildren.detailedHelp(0, sb );
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListNsKeysByAttrib.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListNsKeysByAttrib.java
index ad36151a..a1b0da19 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListNsKeysByAttrib.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListNsKeysByAttrib.java
@@ -41,16 +41,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListNsKeysByAttrib {
-// private static ListNsKeysByAttrib lsNsKeys;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// List ls = new List(ns);
-// lsNsKeys = new ListNsKeysByAttrib(ls);
-// }
-//
+ private static ListNsKeysByAttrib lsNsKeys;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ List ls = new List(ns);
+ lsNsKeys = new ListNsKeysByAttrib(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,9 +67,10 @@ public class JU_ListNsKeysByAttrib {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ StringBuilder sb = new StringBuilder();
+ lsNsKeys.detailedHelp(0, sb );
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsers.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsers.java
new file mode 100644
index 00000000..e44a8219
--- /dev/null
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsers.java
@@ -0,0 +1,79 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.auth.cmd.test.ns;
+
+import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aaf.auth.cmd.AAFcli;
+import org.onap.aaf.auth.cmd.ns.List;
+import org.onap.aaf.auth.cmd.ns.ListUsers;
+import org.onap.aaf.auth.cmd.ns.NS;
+import org.onap.aaf.auth.cmd.test.JU_AAFCli;
+import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.misc.env.APIException;
+
+import aaf.v2_0.Users;
+
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.GregorianCalendar;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.junit.Test;
+
+public class JU_ListUsers {
+
+ AAFcli cli;
+ NS ns;
+ List list;
+ ListUsers lUsers;
+
+ @Before
+ public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException {
+ cli = JU_AAFCli.getAAfCli();
+ ns = new NS(cli);
+ list = new List(ns);
+ lUsers = new ListUsers(list);
+ }
+
+ @Test
+ public void testReports() throws DatatypeConfigurationException {
+ Users.User user = new Users.User();
+ GregorianCalendar gcal = new GregorianCalendar();
+ XMLGregorianCalendar xgcal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal);
+ user.setExpires(xgcal);
+
+ lUsers.report("header", "ns");
+ lUsers.report("subHead");
+ lUsers.report("prefix", user);
+ }
+
+}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersContact.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersContact.java
new file mode 100644
index 00000000..20a5f2c0
--- /dev/null
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersContact.java
@@ -0,0 +1,105 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.auth.cmd.test.ns;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aaf.auth.cmd.AAFcli;
+import org.onap.aaf.auth.cmd.ns.List;
+import org.onap.aaf.auth.cmd.ns.ListUsers;
+import org.onap.aaf.auth.cmd.ns.ListUsersContact;
+import org.onap.aaf.auth.cmd.ns.NS;
+import org.onap.aaf.auth.env.AuthzEnv;
+import org.onap.aaf.cadi.CadiException;
+import org.onap.aaf.cadi.Locator;
+import org.onap.aaf.cadi.Locator.Item;
+import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.cadi.PropAccess;
+import org.onap.aaf.cadi.SecuritySetter;
+import org.onap.aaf.cadi.http.HMangr;
+import org.onap.aaf.cadi.http.HRcli;
+import org.onap.aaf.misc.env.APIException;
+
+import static org.mockito.Mockito.*;
+
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.junit.Test;
+
+public class JU_ListUsersContact {
+
+ PropAccess prop;
+ AuthzEnv aEnv;
+ Writer wtr;
+ Locator<URI> loc;
+ HMangr hman;
+ AAFcli aafcli;
+ NS ns;
+ List list;
+ ListUsers lUsers;
+ ListUsersContact lUContact;
+
+ @Before
+ public void setUp() throws LocatorException, APIException {
+ prop = new PropAccess();
+ aEnv = new AuthzEnv();
+ wtr = mock(Writer.class);
+ loc = mock(Locator.class);
+ SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
+ hman = new HMangr(aEnv, loc);
+ aafcli = new AAFcli(prop, aEnv, wtr, hman, null, secSet);
+ ns = new NS(aafcli);
+ list = new List(ns);
+ lUsers = new ListUsers(list);
+ }
+
+// @Test
+// public void testExec() throws APIException, LocatorException, CadiException, URISyntaxException {
+// lUContact = new ListUsersContact(lUsers);
+// Item value = mock(Item.class);
+// Locator.Item item = new Locator.Item() {
+// };
+// when(loc.best()).thenReturn(value);
+// URI uri = new URI("http://java.sun.com/j2se/1.3/");
+// when(loc.get(value)).thenReturn(uri);
+// SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
+// HRcli hcli = new HRcli(hman, uri, item, secSet);
+// lUContact._exec(0, "test");
+//
+// }
+
+ @Test
+ public void testDetailedHelp() {
+ lUContact = new ListUsersContact(lUsers);
+ StringBuilder sb = new StringBuilder();
+ lUContact.detailedHelp(0, sb);
+ }
+
+}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersInRole.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersInRole.java
index ae136064..9f61b009 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersInRole.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersInRole.java
@@ -39,17 +39,17 @@ import org.onap.aaf.auth.cmd.test.JU_AAFCli;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListUsersInRole {
-// private static ListUsersInRole lsUserinRole;
-//
-// @BeforeClass
-// public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// NS ns = new NS(cli);
-// List ls = new List(ns);//possible wrong import, remove import org.onap.aaf.auth.cmd.ns to see other options
-// ListUsers lsU = new ListUsers(ls);
-// lsUserinRole = new ListUsersInRole(lsU);
-// }
-//
+ private static ListUsersInRole lsUserinRole;
+
+ @BeforeClass
+ public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ List ls = new List(ns);//possible wrong import, remove import org.onap.aaf.auth.cmd.ns to see other options
+ ListUsers lsU = new ListUsers(ls);
+ lsUserinRole = new ListUsersInRole(lsU);
+ }
+
// @Test
// public void exec() {
// try {
@@ -58,20 +58,16 @@ public class JU_ListUsersInRole {
// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
// }
// }
-//
-// @Test
-// public void detailedHelp() {
-// boolean hasNoError = true;
-// try {
-// lsUserinRole.detailedHelp(1, new StringBuilder("test"));
-// } catch (Exception e) {
-// hasNoError = false;
-// }
-// assertEquals(hasNoError, true);
-// }
-
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsUserinRole.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java
index b8e83e6c..62984d63 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java
@@ -50,15 +50,15 @@ public class JU_ListUsersWithPerm {
lsUserWithPerm = new ListUsersWithPerm(lsU);
}
- @Test
- public void exec() {
- try {
- assertEquals(lsUserWithPerm._exec(0, "add", "del", "reset", "extend"), 500);
- } catch (Exception e) {
- assertEquals(e.getMessage(), "No Services Found for https://DME2RESOLVE [ ]");
-
- }
- }
+// @Test
+// public void exec() {
+// try {
+// assertEquals(lsUserWithPerm._exec(0, "add", "del", "reset", "extend"), 500);
+// } catch (Exception e) {
+// assertEquals(e.getMessage(), "No Services Found for https://DME2RESOLVE [ ]");
+//
+// }
+// }
@Test
public void detailedHelp() {
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Owner.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Owner.java
new file mode 100644
index 00000000..39698c39
--- /dev/null
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Owner.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * ============LICENSE_START====================================================
+ * * org.onap.aaf
+ * * ===========================================================================
+ * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * * ===========================================================================
+ * * Licensed under the Apache License, Version 2.0 (the "License");
+ * * you may not use this file except in compliance with the License.
+ * * You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License.
+ * * ============LICENSE_END====================================================
+ * *
+ * *
+ ******************************************************************************/
+
+package org.onap.aaf.auth.cmd.test.ns;
+
+import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aaf.auth.cmd.AAFcli;
+import org.onap.aaf.auth.cmd.ns.Create;
+import org.onap.aaf.auth.cmd.ns.NS;
+import org.onap.aaf.auth.cmd.ns.Owner;
+import org.onap.aaf.auth.cmd.test.JU_AAFCli;
+
+import static org.mockito.Mockito.*;
+import org.junit.Test;
+
+public class JU_Owner {
+
+ private static Owner owner;
+
+ @BeforeClass
+ public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ NS ns = new NS(cli);
+ owner = new Owner(ns);
+ }
+
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ owner.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
+ }
+
+}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_CreateDelete.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_CreateDelete.java
index 08fb7d4e..8b9a8f23 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_CreateDelete.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_CreateDelete.java
@@ -40,15 +40,15 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_CreateDelete {
-// private static CreateDelete createDel;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// createDel = new CreateDelete(role);
-// }
-//
+ private static CreateDelete createDel;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ createDel = new CreateDelete(role);
+ }
+
// @Test
// public void exec() {
// try {
@@ -65,8 +65,14 @@ public class JU_CreateDelete {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void testDetailedHelp() {
+ boolean hasNoError = true;
+ try {
+ createDel.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java
index ee62f53e..e7ac12a0 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java
@@ -40,15 +40,15 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_Describe {
-// private static Describe desc;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// desc = new Describe(role);
-// }
-//
+ private static Describe desc;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ desc = new Describe(role);
+ }
+
// @Test
// public void exec() {
// try {
@@ -65,8 +65,14 @@ public class JU_Describe {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ desc.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java
new file mode 100644
index 00000000..2334e1b8
--- /dev/null
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java
@@ -0,0 +1,90 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.auth.cmd.test.role;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aaf.auth.cmd.AAFcli;
+import org.onap.aaf.auth.cmd.role.List;
+import org.onap.aaf.auth.cmd.role.Role;
+import org.onap.aaf.auth.cmd.test.JU_AAFCli;
+import org.onap.aaf.auth.cmd.Cmd;
+import org.onap.aaf.auth.cmd.Param;
+import org.onap.aaf.auth.env.AuthzTrans;
+import org.onap.aaf.cadi.CadiException;
+import org.onap.aaf.cadi.LocatorException;
+import org.onap.aaf.cadi.client.Future;
+import org.onap.aaf.cadi.client.Rcli;
+import org.onap.aaf.misc.env.APIException;
+
+import static org.mockito.Mockito.*;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.GeneralSecurityException;
+import java.security.Principal;
+
+import org.junit.Test;
+
+public class JU_List {
+
+ AAFcli cli;
+
+ private class ListRolesStub extends List {
+
+ public ListRolesStub(Role parent) {
+ super(parent);
+ // TODO Auto-generated constructor stub
+ }
+
+
+ }
+
+ @Before
+ public void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException{
+ cli = JU_AAFCli.getAAfCli();
+ }
+
+ @Test
+ public void testRoles() throws APIException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+ Role role = new Role(cli);
+ ListRolesStub listStub = new ListRolesStub(role);
+ Future future = mock(Future.class);
+ Rcli rcli = mock(Rcli.class);
+
+ Class c = listStub.getClass();
+ Class[] cArg = new Class[3];
+ cArg[0] = Future.class;
+ cArg[1] = Rcli.class;
+ cArg[2] = String.class;//Steps to test a protected method
+ //Method listMethod = c.getDeclaredMethod("list", cArg);
+ //listMethod.setAccessible(true);
+ //listMethod.invoke(listStub, future, rcli, "test");
+
+ }
+
+}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListActivity.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListActivity.java
index 87530f6c..e09035ca 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListActivity.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListActivity.java
@@ -40,17 +40,17 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListActivity {
-//
-// private static ListActivity lsActivity;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// List ls = new List(role);
-// lsActivity = new ListActivity(ls);
-// }
-//
+
+ private static ListActivity lsActivity;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ List ls = new List(role);
+ lsActivity = new ListActivity(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,8 +67,14 @@ public class JU_ListActivity {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsActivity.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNS.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNS.java
index 9d6baf9e..6017905c 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNS.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNS.java
@@ -41,16 +41,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListByNS {
-// private static ListByNS lsByNS;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// List ls = new List(role);
-// lsByNS = new ListByNS(ls);
-// }
-//
+ private static ListByNS lsByNS;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ List ls = new List(role);
+ lsByNS = new ListByNS(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,8 +67,14 @@ public class JU_ListByNS {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsByNS.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNameOnly.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNameOnly.java
index f2106c4c..6c2f1b44 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNameOnly.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNameOnly.java
@@ -40,17 +40,17 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListByNameOnly {
-//
-// private static ListByNameOnly lsByName;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// List ls = new List(role);
-// lsByName = new ListByNameOnly(ls);
-// }
-//
+
+ private static ListByNameOnly lsByName;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ List ls = new List(role);
+ lsByName = new ListByNameOnly(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,8 +67,14 @@ public class JU_ListByNameOnly {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsByName.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByPerm.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByPerm.java
index cfa068b0..65f2c6f0 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByPerm.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByPerm.java
@@ -41,16 +41,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListByPerm {
-// private static ListByPerm lsByPerm;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// List ls = new List(role);
-// lsByPerm = new ListByPerm(ls);
-// }
-//
+ private static ListByPerm lsByPerm;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ List ls = new List(role);
+ lsByPerm = new ListByPerm(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,8 +67,14 @@ public class JU_ListByPerm {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsByPerm.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByRole.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByRole.java
index 66c118cb..37accbbc 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByRole.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByRole.java
@@ -41,16 +41,16 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListByRole {
-// private static ListByRole lsByRole;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// List ls = new List(role);
-// lsByRole = new ListByRole(ls);
-// }
-//
+ private static ListByRole lsByRole;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ List ls = new List(role);
+ lsByRole = new ListByRole(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,8 +67,15 @@ public class JU_ListByRole {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsByRole.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByUser.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByUser.java
index 140998d6..d03511b4 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByUser.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByUser.java
@@ -40,17 +40,17 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListByUser {
-//
-// private static ListByUser lsByUser;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// List ls = new List(role);
-// lsByUser = new ListByUser(ls);
-// }
-//
+
+ private static ListByUser lsByUser;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ List ls = new List(role);
+ lsByUser = new ListByUser(ls);
+ }
+
// @Test
// public void exec() {
// try {
@@ -67,8 +67,15 @@ public class JU_ListByUser {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsByUser.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
+
}
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_User.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_User.java
index 25acfff6..fa835961 100644
--- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_User.java
+++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_User.java
@@ -41,15 +41,15 @@ import org.onap.aaf.misc.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_User {
-// private static User user;
-//
-// @BeforeClass
-// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
-// AAFcli cli = JU_AAFCli.getAAfCli();
-// Role role = new Role(cli);
-// user = new User(role);
-// }
-//
+ private static User user;
+
+ @BeforeClass
+ public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ AAFcli cli = JU_AAFCli.getAAfCli();
+ Role role = new Role(cli);
+ user = new User(role);
+ }
+
// @Test
// public void exec() {
// try {
@@ -66,8 +66,14 @@ public class JU_User {
// }
// }
- @Test //TODO: Temporary fix AAF-111
- public void netYetTested() {
- Assert.assertTrue(true);
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ user.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
+ }
+ assertEquals(hasNoError, true);
}
}