diff options
author | Instrumental <jcgmisc@stl.gathman.org> | 2018-03-26 13:51:48 -0700 |
---|---|---|
committer | Instrumental <jcgmisc@stl.gathman.org> | 2018-03-26 13:52:07 -0700 |
commit | 71037c39a37d3549dcfe31926832a657744fbe05 (patch) | |
tree | 78911b2b5e86e4e44228f7a27b3a8cd954b7f3e2 /auth/auth-cmd/src/test | |
parent | a20accc73189d8e5454cd26049c0e6fae75da16f (diff) |
AT&T 2.0.19 Code drop, stage 3
Issue-ID: AAF-197
Change-Id: I8b02cb073ccba318ccaf6ea0276446bdce88fb82
Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-cmd/src/test')
49 files changed, 3914 insertions, 0 deletions
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_AAFCli.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_AAFCli.java new file mode 100644 index 00000000..d0013fef --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_AAFCli.java @@ -0,0 +1,198 @@ +/******************************************************************************* + * ============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; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; + +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.net.HttpURLConnection; +import java.security.GeneralSecurityException; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.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.config.Config; +import org.onap.aaf.cadi.config.SecurityInfo; +import org.onap.aaf.cadi.http.HBasicAuthSS; +import org.onap.aaf.cadi.http.HMangr; +import org.onap.aaf.cadi.locator.PropertyLocator; +import org.onap.aaf.misc.env.APIException; +@RunWith(MockitoJUnitRunner.class) +public class JU_AAFCli { + + private static AAFcli cli; + private static int TIMEOUT = Integer.parseInt(Config.AAF_CONN_TIMEOUT_DEF); + +// @BeforeClass +// public static void setUp() throws Exception, Exception { +// cli = getAAfCli(); +// } +// +// @Test +// public void eval() throws Exception { +// assertTrue(cli.eval("#startswith")); +// } +// +// @Test +// public void eval_empty() throws Exception { +// assertTrue(cli.eval("")); +// } +// +// @Test +// public void eval1() throws Exception { +// assertTrue(cli.eval("@[123")); +// } +// +// @Test +// public void eval2() throws Exception { +// assertFalse(cli.eval("as @[ 123")); +// } +// +// @Test +// public void eval3() throws Exception { +// try { +// cli.eval("expect @[ 123"); +// } catch (Exception e) { +// // TODO Auto-generated catch block +// assertTrue(e instanceof CadiException); +// } +// } +// +// public void eval31() throws Exception { +// try { +// cli.eval("expect 1 @[ 123"); +// } catch (Exception e) { +// // TODO Auto-generated catch block +// assertTrue(e instanceof CadiException); +// } +// } +// +// @Test +// public void eval4() throws Exception { +// try { +// cli.eval("sleep @[ 123"); +// } catch (Exception e) { +// assertTrue(e instanceof NumberFormatException); +// } +// } +// +// @Test +// public void eval41() throws Exception { +// assertTrue(cli.eval("sleep 1 @[ 123")); +// } +// +// @Test +// public void eval5() throws Exception { +// try { +// cli.eval("delay @[ 123"); +// } catch (Exception e) { +// assertTrue(e instanceof NumberFormatException); +// } +// } +// +// @Test +// public void eval51() throws Exception { +// assertTrue(cli.eval("delay 1 @[ 123")); +// } +// +// @Test +// public void eval7() throws Exception { +// assertFalse(cli.eval("exit @[ 123")); +// } +// +// @Test +// public void eval8() throws Exception { +// assertTrue(cli.eval("REQUEST @[ 123")); +// } +// +// @Test +// public void eval9() throws Exception { +// assertTrue(cli.eval("FORCE @[ 123")); +// } +// +// @Test +// public void eval10() throws Exception { +// assertTrue(cli.eval("set @[ 123")); +// } +// +// @Test +// public void keyboardHelp() throws Exception { +// boolean noError=true; +// try { +// cli.keyboardHelp(); +// } catch (Exception e) { +// noError=false; +// } +// assertTrue(noError); +// } +// +// +// +// @Test +// public void setProp() throws Exception { +// boolean noError=true; +// try { +// cli.keyboardHelp(); +// } catch (Exception e) { +// noError=false; +// } +// assertTrue(noError); +// } +// +// @Test +// public void eval_randomString() throws Exception { +// assertTrue(cli.eval("Some random string @#&*& to check complete 100 coverage")); +// } + +// public static AAFcli getAAfCli() throws APIException, LocatorException, GeneralSecurityException, IOException { +// final AuthzEnv env = new AuthzEnv(System.getProperties()); +// String aafUrl = "https://DME2RESOLVE"; +// SecurityInfo si = new SecurityInfo(env); +// env.loadToSystemPropsStartsWith("AAF", "DME2"); +// Locator loc; +// loc = new PropertyLocator(aafUrl); +// TIMEOUT = Integer.parseInt(env.getProperty(Config.AAF_CONN_TIMEOUT, Config.AAF_CONN_TIMEOUT_DEF)); +// HMangr hman = new HMangr(env, loc).readTimeout(TIMEOUT).apiVersion("2.0"); +// +// // TODO: Consider requiring a default in properties +// env.setProperty(Config.AAF_DEFAULT_REALM, +// System.getProperty(Config.AAF_DEFAULT_REALM, Config.getDefaultRealm())); +// HBasicAuthSS ss = mock(HBasicAuthSS.class); +// //TODO: Gabe[JUnit] constructor issue +// return new AAFcli(env, new OutputStreamWriter(System.out), hman, si, ss); +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BaseCmd.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BaseCmd.java new file mode 100644 index 00000000..75ae8160 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BaseCmd.java @@ -0,0 +1,243 @@ +/******************************************************************************* + * ============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; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.Date; +import java.util.GregorianCalendar; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.BaseCmd; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.cadi.client.Future; +import org.onap.aaf.misc.env.APIException; + +import aaf.v2_0.History; + +@RunWith(MockitoJUnitRunner.class) +public class JU_BaseCmd { + + private static AAFcli cli; + private static BaseCmd bCmd; + +// @BeforeClass +// public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException { +// cli = JU_AAFCli.getAAfCli(); +// bCmd = new BaseCmd<>(cli, "testString"); +// } + +// @Test +// public void exec() throws CadiException, APIException, LocatorException { +// assertEquals(bCmd._exec(4, "add", "del", "reset", "extend"), 0); +// +// } +// +// @Test +// public void exec1() throws CadiException, APIException, LocatorException { +// assertEquals(bCmd._exec(0, "add", "del", "reset", "extend"), 0); +// +// } + +// @Test +// public void error() throws CadiException, APIException, LocatorException { +// boolean noError = true; +// Future<String> future = new Future<String>() { +// +// @Override +// public boolean get(int timeout) throws CadiException { +// // TODO Auto-generated method stub +// return false; +// } +// +// @Override +// public int code() { +// // TODO Auto-generated method stub +// return 0; +// } +// +// @Override +// public String body() { +// // TODO Auto-generated method stub +// return "{%}"; +// } +// +// @Override +// public String header(String tag) { +// // TODO Auto-generated method stub +// return null; +// } +// }; +// try { +// //TODO: Gabe [JUnit] Not visible for junit +// bCmd.error(future); +// } catch (Exception e) { +// noError = false; +// } +// assertEquals(noError, true); +// +// } +// +// +// +// @Test +// public void activity() throws DatatypeConfigurationException { +// boolean noError = true; +// History history = new History(); +// History.Item item = new History.Item(); +// item.setTarget("target"); +// item.setUser("user"); +// item.setMemo("memo"); +// +// GregorianCalendar c = new GregorianCalendar(); +// c.setTime(new Date()); +// XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(c); +// item.setTimestamp(date); +// history.getItem().add(item); +// try { +// bCmd.activity(history, "history"); +// } catch (Exception e) { +// noError = false; +// } +// assertEquals(noError, true); +// +// } +// +// @Test +// public void activity1() throws DatatypeConfigurationException { +// boolean noError = true; +// History history = new History(); +// History.Item item = new History.Item(); +// item.setTarget("target"); +// item.setUser("user"); +// item.setMemo("memo"); +// +// GregorianCalendar c = new GregorianCalendar(); +// c.setTime(new Date()); +// XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(c); +// item.setTimestamp(date); +// history.getItem().add(item); +// try { +// bCmd.activity(history, "1[]"); +// } catch (Exception e) { +// noError = false; +// } +// assertEquals(noError, true); +// +// } +// +// +// +// @Test +// public void error1() { +// boolean noError = true; +// Future<String> future = new Future<String>() { +// +// @Override +// public boolean get(int timeout) throws CadiException { +// // TODO Auto-generated method stub +// return false; +// } +// +// @Override +// public int code() { +// // TODO Auto-generated method stub +// return 0; +// } +// +// @Override +// public String body() { +// // TODO Auto-generated method stub +// return "{<html><code>1</code></html>"; +// } +// +// @Override +// public String header(String tag) { +// // TODO Auto-generated method stub +// return null; +// } +// }; +// try { +// bCmd.error(future); +// } catch (Exception e) { +// noError = false; +// } +// assertEquals(noError, true); +// +// } + +// @Test +// public void error2() { +// boolean noError = true; +// Future<String> future = new Future<String>() { +// +// @Override +// public boolean get(int timeout) throws CadiException { +// // TODO Auto-generated method stub +// return false; +// } +// +// @Override +// public int code() { +// // TODO Auto-generated method stub +// return 0; +// } +// +// @Override +// public String body() { +// // TODO Auto-generated method stub +// return "other"; +// } +// +// @Override +// public String header(String tag) { +// // TODO Auto-generated method stub +// return null; +// } +// }; +// try { +// bCmd.error(future); +// } catch (Exception e) { +// noError = false; +// } +// assertEquals(noError, true); +// +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } + +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BasicAuth.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BasicAuth.java new file mode 100644 index 00000000..6e79f816 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_BasicAuth.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * ============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; + +import static org.junit.Assert.*; + +import java.io.IOException; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +//import org.onap.aaf.auth.cmd.BasicAuth; +//TODO: Gabe [JUnit] Import missing +@RunWith(MockitoJUnitRunner.class) +public class JU_BasicAuth { + +// @Test +// public void getID () { +// try { +// BasicAuth bAuth = new BasicAuth("testUser", "nopass"); +// assertEquals(bAuth.getID(), "testUser"); +// System.out.println(bAuth.getID()); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// +// } + + @Test + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Help.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Help.java new file mode 100644 index 00000000..a44804d9 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Help.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * ============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; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.ArrayList; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.Cmd; +import org.onap.aaf.auth.cmd.Help; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +//import com.att.aft.dme2.internal.jetty.http.HttpStatus; +//TODO: Gabe [JUnit] Import missing +@RunWith(MockitoJUnitRunner.class) +public class JU_Help { + +// private static AAFcli cli; +// private static Help help; +// +// @Mock +// private static List<Cmd> cmds; +// +// @BeforeClass +// public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException { +// cli = JU_AAFCli.getAAfCli(); +// cmds = new ArrayList<>(); +// help = new Help(cli, cmds); +// } +// +// @Test +// public void exec_HTTP_200() { +// try { +// assertEquals(help._exec(1, "helps"), HttpStatus.OK_200); +// } catch (CadiException | APIException | LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } +// +// @Test +// public void exec_HTTP_200_1() { +// try { +// assertEquals(help._exec(1, "helps","help"), HttpStatus.OK_200); +// } catch (CadiException | APIException | LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } +// +// @Test +// public void detailhelp() { +// boolean hasError=false; +// try { +// help.detailedHelp(2, new StringBuilder("detail help test")); +// } catch (Exception e) { +// hasError=true; +// } +// assertEquals(hasError,false); +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Version.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Version.java new file mode 100644 index 00000000..dddd4944 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_Version.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * ============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; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.security.GeneralSecurityException; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.Version; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +//import com.att.aft.dme2.internal.jetty.http.HttpStatus; +//TODO: Gabe [JUnit] Import missing +@RunWith(MockitoJUnitRunner.class) +public class JU_Version { + +// private static AAFcli cli; +// private static Version version; +// +// @BeforeClass +// public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException { +// cli = JU_AAFCli.getAAfCli(); +// version = new Version(cli); +// } +// +// @Test +// public void exec_HTTP_200() throws CadiException, APIException, LocatorException { +// assertEquals(version._exec(0, "Version"), HttpStatus.OK_200); +// +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Clear.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Clear.java new file mode 100644 index 00000000..078d84e8 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Clear.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * ============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.mgmt; + +import static org.mockito.Mockito.mock; +import static org.junit.Assert.assertEquals; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.mgmt.Clear; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Clear { + + private static Clear clr; + + @BeforeClass + public static void setUp() { + clr = mock(Clear.class); + } + + @Test + public void exec() { + try { + assertEquals(clr._exec(0, "clear"), 0); + } catch (CadiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java new file mode 100644 index 00000000..6a8a2848 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * ============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.mgmt; + +import static org.mockito.Mockito.mock; +import static org.junit.Assert.assertEquals; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.mgmt.Log; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Log { + + private static Log log; + + @BeforeClass + public static void setUp() { + log = mock(Log.class); + } + + @Test + public void exec() { + try { + assertEquals(log._exec(0, "session clear"), 0); + } catch (CadiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_SessClear.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_SessClear.java new file mode 100644 index 00000000..ca2cba61 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/mgmt/JU_SessClear.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * ============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.mgmt; + +import static org.mockito.Mockito.mock; +import static org.junit.Assert.assertEquals; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.mgmt.SessClear; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_SessClear { + + private static SessClear sessclr; + + @BeforeClass + public static void setUp() { + sessclr = mock(SessClear.class); + } + + @Test + public void exec() { + try { + assertEquals(sessclr._exec(0, "session clear"), 0); + } catch (CadiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} 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 new file mode 100644 index 00000000..c8b85fd3 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Admin.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +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.NS; + +@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"); +// } +// } +// +// @Test +// public void detailedHelp() { +// boolean hasNoError = true; +// try { +// admin.detailedHelp(1, new StringBuilder("test")); +// } catch (Exception e) { +// hasNoError = false; +// } +// assertEquals(hasNoError, true); +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..ff6a8f84 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +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; + +@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"); +// } +// } +// +// @Test +// public void detailedHelp() { +// boolean hasNoError = true; +// try { +// attrib.detailedHelp(1, new StringBuilder("test")); +// } catch (Exception e) { +// hasNoError = false; +// } +// assertEquals(hasNoError, true); +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..b0822cd1 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +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.test.JU_AAFCli; + +@RunWith(MockitoJUnitRunner.class) +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() { + fail("Tests not yet implemented"); + } + + @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 detailedHelp() { + boolean hasNoError = true; + try { + create.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_Delete.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java new file mode 100644 index 00000000..fecca0b0 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.security.GeneralSecurityException; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.Delete; +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; + +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); +// +// } +// +// @Test +// public void exec() { +// try { +// delete._exec(0, "del", "del", "del"); +// } catch (Exception e) { +// 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 //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } + +} 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 new file mode 100644 index 00000000..4d4deb1b --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.CALLS_REAL_METHODS; +import static org.mockito.Mockito.mock; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.Describe; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(desc._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} + 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 new file mode 100644 index 00000000..64328887 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListActivity.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.List; +import org.onap.aaf.auth.cmd.ns.ListActivity; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsActivity._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} + 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 new file mode 100644 index 00000000..064bade2 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListAdminResponsible.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.List; +import org.onap.aaf.auth.cmd.ns.ListAdminResponsible; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// //TODO: Gabe [JUnit] Not visible for junit +// assertEquals(lsAdminRes._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} + 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 new file mode 100644 index 00000000..69e081ab --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListByName.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.List; +import org.onap.aaf.auth.cmd.ns.ListByName; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByName._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} + 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 new file mode 100644 index 00000000..c13a52f8 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListChildren.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.List; +import org.onap.aaf.auth.cmd.ns.ListChildren; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsChildren._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} + 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 new file mode 100644 index 00000000..ac00c256 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListNsKeysByAttrib.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.ns.List; +import org.onap.aaf.auth.cmd.ns.ListNsKeysByAttrib; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsNsKeys._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} + 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 new file mode 100644 index 00000000..704f6e4d --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersInRole.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +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.ListUsersInRole; +import org.onap.aaf.auth.cmd.ns.NS; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsUserinRole._exec(0, "add", "del", "reset", "extend"), 500); +// } catch (Exception e) { +// 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() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..06e9cf01 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +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.ListUsersWithPerm; +import org.onap.aaf.auth.cmd.ns.NS; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListUsersWithPerm { + +// private static ListUsersWithPerm lsUserWithPerm; +// +// @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 option +// ListUsers lsU = new ListUsers(ls); +// lsUserWithPerm = new ListUsersWithPerm(lsU); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsUserWithPerm._exec(0, "add", "del", "reset", "extend"), 500); +// } catch (Exception e) { +// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE"); +// } +// } +// +// @Test +// public void detailedHelp() { +// boolean hasNoError = true; +// try { +// lsUserWithPerm.detailedHelp(1, new StringBuilder("test")); +// } catch (Exception e) { +// hasNoError = false; +// } +// assertEquals(hasNoError, true); +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Responsible.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Responsible.java new file mode 100644 index 00000000..ccb4b025 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Responsible.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.assertEquals; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.security.GeneralSecurityException; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +public class JU_Responsible { + +// private static Responsible responsible;//TODO: Gabe[JUnit] check with Jonathan +// +// @BeforeClass +// public static void setUp() throws APIException, LocatorException, GeneralSecurityException, IOException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// NS ns = new NS(cli); +// responsible = new Responsible(ns); +// +// } +// +// @Test +// public void exec1() { +// try { +// responsible._exec(0, "del", "del", "del"); +// } catch (Exception e) { +// assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE"); +// } +// } +// +// @Test +// public void detailedHelp() { +// boolean hasNoError = true; +// try { +// responsible.detailedHelp(1, new StringBuilder("test")); +// } catch (Exception e) { +// hasNoError = false; +// } +// assertEquals(hasNoError, true); +// } + + @Test + public void netYetTested() { + fail("Tests not yet implemented"); + } + +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java new file mode 100644 index 00000000..4ae99bed --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.Create; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Create { + +// private static Create create; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// Role role = new Role(cli); +// Perm perm = new Perm(role); +// create = new Create(perm); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(create._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java new file mode 100644 index 00000000..ed59013c --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.Delete; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Delete { + +// private static Delete del; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// Role role = new Role(cli); +// Perm perm = new Perm(role); +// del = new Delete(perm); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(del._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java new file mode 100644 index 00000000..8861e6f1 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.Describe; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// Perm perm = new Perm(role); +// desc = new Describe(perm); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(desc._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java new file mode 100644 index 00000000..9bfa3f4a --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.Grant; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Grant { + +// private static Grant grant; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// Role role = new Role(cli); +// Perm perm = new Perm(role); +// grant = new Grant(perm); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(grant._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListActivity.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListActivity.java new file mode 100644 index 00000000..fd4e08b7 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListActivity.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.List; +import org.onap.aaf.auth.cmd.perm.ListActivity; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// Perm perm = new Perm(role); +// List ls = new List(perm); +// lsActivity = new ListActivity(ls); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsActivity._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByNS.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByNS.java new file mode 100644 index 00000000..fc4b6913 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByNS.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.List; +import org.onap.aaf.auth.cmd.perm.ListByNS; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// Perm perm = new Perm(role); +// List ls = new List(perm); +// lsByNS = new ListByNS(ls); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByNS._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByName.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByName.java new file mode 100644 index 00000000..7e65dfc0 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByName.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.List; +import org.onap.aaf.auth.cmd.perm.ListByName; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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(); +// Role role = new Role(cli); +// Perm perm = new Perm(role); +// List ls = new List(perm); +// lsByName = new ListByName(ls); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByName._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByRole.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByRole.java new file mode 100644 index 00000000..d2d89783 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByRole.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.List; +import org.onap.aaf.auth.cmd.perm.ListByRole; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// Perm perm = new Perm(role); +// List ls = new List(perm); +// lsByRole = new ListByRole(ls); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByRole._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByUser.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByUser.java new file mode 100644 index 00000000..675a02aa --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_ListByUser.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.List; +import org.onap.aaf.auth.cmd.perm.ListByUser; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListByUser { + +// private static ListByUser lsByName; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// Role role = new Role(cli); +// Perm perm = new Perm(role); +// List ls = new List(perm); +// lsByName = new ListByUser(ls); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByName._exec(0, "add","del","reset","extend"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Rename.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Rename.java new file mode 100644 index 00000000..39263f1b --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Rename.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.perm; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.perm.Rename; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Rename { + +// private static Rename rename; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// Role role = new Role(cli); +// Perm perm = new Perm(role); +// rename = new Rename(perm); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(rename._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..c19bd5c2 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_CreateDelete.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.CreateDelete; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(createDel._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..8dd9558e --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.Describe; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(desc._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..79f8d681 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListActivity.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.List; +import org.onap.aaf.auth.cmd.role.ListActivity; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsActivity._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..5eb188d3 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNS.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.List; +import org.onap.aaf.auth.cmd.role.ListByNS; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByNS._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..a87101d0 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByNameOnly.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.List; +import org.onap.aaf.auth.cmd.role.ListByNameOnly; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByName._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..6be99ab0 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByPerm.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.List; +import org.onap.aaf.auth.cmd.role.ListByPerm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByPerm._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..5739208a --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByRole.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.List; +import org.onap.aaf.auth.cmd.role.ListByRole; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByRole._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..be11e1f7 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_ListByUser.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.role.List; +import org.onap.aaf.auth.cmd.role.ListByUser; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsByUser._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} 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 new file mode 100644 index 00000000..37cfb304 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_User.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * ============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.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.perm.Perm; +import org.onap.aaf.auth.cmd.role.Role; +import org.onap.aaf.auth.cmd.role.User; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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); +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(user._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (APIException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (LocatorException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Cred.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Cred.java new file mode 100644 index 00000000..f191ef65 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Cred.java @@ -0,0 +1,124 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.FileNotFoundException; +import java.io.PrintWriter; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.Cmd; +import org.onap.aaf.auth.cmd.user.Cred; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.auth.env.AuthzEnv; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Cred { + + private static Cred testCred; + private static User testUser; + private static AuthzEnv env; + + + @BeforeClass + public static void setUp() throws FileNotFoundException, APIException { + + testCred = mock(Cred.class); + testUser = mock(User.class); + env = mock(AuthzEnv.class); + Mockito.when(env.getProperty(Cmd.STARTDATE,null)).thenReturn(null); + Mockito.when(env.getProperty(Cmd.ENDDATE,null)).thenReturn(null); + + } + + @Test + public void exec() throws CadiException, APIException, LocatorException, FileNotFoundException { + boolean isNullpointer=false; + AAFcli aaFcli= new AAFcli(env, new PrintWriter("temp"), null, null, null); + User user= new User(aaFcli); + Cred testCred= new Cred(user); + try { + testCred._exec(0, "add", "del", "reset", "extend"); + } catch (Exception e) { + isNullpointer=true; + } + assertEquals(isNullpointer, true); + } + + + @Test + public void exec_add() { + try { + assertNotNull(testCred._exec(0, "zeroed","add","del","reset","extend")); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + @Test + public void exec_del() { + try { + assertNotNull(testCred._exec(1, "zeroed","add","del","reset","extend")); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + @Test + public void exec_reset() { + try { + assertNotNull(testCred._exec(2, "zeroed","add","del","reset","extend")); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + @Test + public void exec_extend() { + try { + assertNotNull(testCred._exec(3, "zeroed","add","del","reset","extend")); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Delg.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Delg.java new file mode 100644 index 00000000..f129149d --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Delg.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * ============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.user; + +import static org.mockito.Mockito.mock; +import static org.junit.Assert.*; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.user.Delg; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Delg { + + private static User testUser; + private static Delg delg; + + @BeforeClass + public static void setUp() throws APIException { + testUser = mock(User.class); + delg = mock(Delg.class); + } + + @Test + public void exec_add() { + try { + assertEquals(delg._exec(0, "zero","add","upd","del"), 0); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Test + public void exec_upd() { + try { + assertEquals(delg._exec(1, "zero","add","upd","del"), 0); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Test + public void exec_del() { + try { + assertEquals(delg._exec(2, "zero","add","upd","del"), 0); + } catch (CadiException | APIException | LocatorException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListActivity.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListActivity.java new file mode 100644 index 00000000..5f1cfb3b --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListActivity.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.List; +import org.onap.aaf.auth.cmd.user.ListActivity; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +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(); +// User usr = new User(cli); +// List parent = new List(usr); +// lsActivity = new ListActivity(parent); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsActivity._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListApprovals.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListApprovals.java new file mode 100644 index 00000000..196cd028 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListApprovals.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.List; +import org.onap.aaf.auth.cmd.user.ListApprovals; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListApprovals { + +// private static ListApprovals lsApprovals; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// User usr = new User(cli); +// List parent = new List(usr); +// lsApprovals = new ListApprovals(parent); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsApprovals._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListDelegates.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListDelegates.java new file mode 100644 index 00000000..3e11357f --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListDelegates.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.List; +import org.onap.aaf.auth.cmd.user.ListDelegates; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListDelegates { + +// private static ListDelegates lsDelegates; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// User usr = new User(cli); +// List parent = new List(usr); +// lsDelegates = new ListDelegates(parent); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsDelegates._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForCreds.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForCreds.java new file mode 100644 index 00000000..cdd8fe87 --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForCreds.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.List; +import org.onap.aaf.auth.cmd.user.ListForCreds; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListForCreds { +// +// private static ListForCreds lsForCreds; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// User usr = new User(cli); +// List parent = new List(usr); +// lsForCreds = new ListForCreds(parent); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsForCreds._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForPermission.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForPermission.java new file mode 100644 index 00000000..7d6af44b --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForPermission.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.List; +import org.onap.aaf.auth.cmd.user.ListForPermission; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListForPermission { +// +// private static ListForPermission lsForPermission; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// User usr = new User(cli); +// List parent = new List(usr); +// lsForPermission = new ListForPermission(parent); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsForPermission._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForRoles.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForRoles.java new file mode 100644 index 00000000..74f57cfc --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_ListForRoles.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.List; +import org.onap.aaf.auth.cmd.user.ListForRoles; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_ListForRoles { + +// private static ListForRoles lsForRoles; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// User usr = new User(cli); +// List parent = new List(usr); +// lsForRoles = new ListForRoles(parent); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(lsForRoles._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Role.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Role.java new file mode 100644 index 00000000..230be45e --- /dev/null +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/user/JU_Role.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * ============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.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.onap.aaf.auth.cmd.AAFcli; +import org.onap.aaf.auth.cmd.test.JU_AAFCli; +import org.onap.aaf.auth.cmd.user.Role; +import org.onap.aaf.auth.cmd.user.User; +import org.onap.aaf.cadi.CadiException; +import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.misc.env.APIException; + +@RunWith(MockitoJUnitRunner.class) +public class JU_Role { + +// private static Role role; +// +// @BeforeClass +// public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { +// AAFcli cli = JU_AAFCli.getAAfCli(); +// User usr = new User(cli); +// role = new Role(usr); +// +// } +// +// @Test +// public void exec() { +// try { +// assertEquals(role._exec(0, "add","del","reset","extend","clear", "rename", "create"),500); +// } catch (CadiException e) { +// +// e.printStackTrace(); +// } catch (APIException e) { +// +// e.printStackTrace(); +// } catch (LocatorException e) { +// +// e.printStackTrace(); +// } +// } + + @Test //TODO: Temporary fix AAF-111 + public void netYetTested() { + fail("Tests not yet implemented"); + } +} |