From 74f2667fafe4c9cf2567b8764204f32ebb10f173 Mon Sep 17 00:00:00 2001 From: sg481n Date: Sun, 1 Oct 2017 13:37:12 +0000 Subject: Improve code coverage for aaf cadi modules Issue-ID: AAF-79 Change-Id: Iddb91a7d72b7ef8a246b81b0111feda59d82d56d Signed-off-by: sg481n --- aaf/pom.xml | 5 +- cass/pom.xml | 5 +- .../aaf/cass/test/AAFAuthenticatedUserTest.java | 247 ------------- .../cadi/aaf/cass/test/AAFAuthenticatorTest.java | 292 --------------- .../aaf/cadi/aaf/cass/test/AAFAuthorizerTest.java | 378 ------------------- .../onap/aaf/cadi/aaf/cass/test/AAFBaseTest.java | 399 --------------------- .../org/onap/aaf/cadi/aaf/cass/test/JU_CASS.java | 106 ------ .../onap/aaf/cass/AAFAuthenticatedUserTest.java | 247 +++++++++++++ .../org/onap/aaf/cass/AAFAuthenticatorTest.java | 292 +++++++++++++++ .../java/org/onap/aaf/cass/AAFAuthorizerTest.java | 378 +++++++++++++++++++ .../test/java/org/onap/aaf/cass/AAFBaseTest.java | 399 +++++++++++++++++++++ cass/src/test/java/org/onap/aaf/cass/JU_CASS.java | 2 +- client/pom.xml | 5 +- core/pom.xml | 3 - core/tempkey | 27 ++ pom.xml | 8 +- 16 files changed, 1350 insertions(+), 1443 deletions(-) delete mode 100644 cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatedUserTest.java delete mode 100644 cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatorTest.java delete mode 100644 cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthorizerTest.java delete mode 100644 cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFBaseTest.java delete mode 100644 cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/JU_CASS.java create mode 100644 cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatedUserTest.java create mode 100644 cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatorTest.java create mode 100644 cass/src/test/java/org/onap/aaf/cass/AAFAuthorizerTest.java create mode 100644 cass/src/test/java/org/onap/aaf/cass/AAFBaseTest.java create mode 100644 core/tempkey diff --git a/aaf/pom.xml b/aaf/pom.xml index 0a96679..dcbf36a 100644 --- a/aaf/pom.xml +++ b/aaf/pom.xml @@ -42,7 +42,7 @@ ${project.build.directory}/surefire-reports ${project.build.directory}/coverage-reports/jacoco.exec ${project.build.directory}/coverage-reports/jacoco-it.exec - true + false ${project.version} https://nexus.onap.org /content/repositories/snapshots/ @@ -208,9 +208,6 @@ 0.7.7.201606060606 true - - org.onap.aaf.* - diff --git a/cass/pom.xml b/cass/pom.xml index 6e07ded..df97868 100644 --- a/cass/pom.xml +++ b/cass/pom.xml @@ -42,7 +42,7 @@ ${project.build.directory}/surefire-reports ${project.build.directory}/coverage-reports/jacoco.exec ${project.build.directory}/coverage-reports/jacoco-it.exec - true + false ${project.version} https://nexus.onap.org /content/repositories/snapshots/ @@ -129,9 +129,6 @@ 0.7.7.201606060606 true - - org.onap.aaf.* - diff --git a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatedUserTest.java b/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatedUserTest.java deleted file mode 100644 index f52c5e4..0000000 --- a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatedUserTest.java +++ /dev/null @@ -1,247 +0,0 @@ -/******************************************************************************* - * ============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==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package org.onap.aaf.cadi.aaf.cass.test; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.onap.aaf.cadi.aaf.cass.AAFAuthenticatedUser; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import static org.junit.Assert.*; - -public class AAFAuthenticatedUserTest -{ - - - @Before - public void setUp() - { - - } - - @After - public void tearDown() - { - - } - - /* - * Testing Conditon(s): if: (endIndex >= 0) - */ - @Test - public void test_method_AAFAuthenticatedUser_0_branch_0() - { - System.out.println("Now Testing Method:AAFAuthenticatedUser Branch:0"); - - //Constructor - - - - } - - /* - * Testing Conditon(s): else: Not (endIndex >= 0) - */ - @Test - public void test_method_AAFAuthenticatedUser_0_branch_1() - { - System.out.println("Now Testing Method:AAFAuthenticatedUser Branch:1"); - - //Constructor - - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getFullName_1_branch_0() - { - System.out.println("Now Testing Method:getFullName Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_2_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_isAnonymous_3_branch_0() - { - System.out.println("Now Testing Method:isAnonymous Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_setAnonymous_4_branch_0() - { - System.out.println("Now Testing Method:setAnonymous Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getAnonymous_5_branch_0() - { - System.out.println("Now Testing Method:getAnonymous Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_isSuper_6_branch_0() - { - System.out.println("Now Testing Method:isSuper Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_setSuper_7_branch_0() - { - System.out.println("Now Testing Method:setSuper Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getSuper_8_branch_0() - { - System.out.println("Now Testing Method:getSuper Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_isLocal_9_branch_0() - { - System.out.println("Now Testing Method:isLocal Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_setLocal_10_branch_0() - { - System.out.println("Now Testing Method:setLocal Branch:0"); - - - - } - - /* - * Testing Conditon(s): if: (this == o) - */ - @Test - public void test_method_equals_11_branch_0() - { - System.out.println("Now Testing Method:equals Branch:0"); - - - } - - /* - * Testing Conditon(s): else: Not (this == o) - */ - @Test - public void test_method_equals_11_branch_1() - { - System.out.println("Now Testing Method:equals Branch:1"); - - } - - /* - * Testing Conditon(s): if: (!(o instanceof AAFAuthenticatedUser)) - */ - @Test - public void test_method_equals_11_branch_2() - { - System.out.println("Now Testing Method:equals Branch:2"); - - } - - /* - * Testing Conditon(s): else: Not (!(o instanceof AAFAuthenticatedUser)) - */ - @Test - public void test_method_equals_11_branch_3() - { - System.out.println("Now Testing Method:equals Branch:3"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_hashCode_12_branch_0() - { - System.out.println("Now Testing Method:hashCode Branch:0"); - - - - } - -} diff --git a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatorTest.java b/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatorTest.java deleted file mode 100644 index 2ade2dc..0000000 --- a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthenticatorTest.java +++ /dev/null @@ -1,292 +0,0 @@ -/******************************************************************************* - * ============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==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package org.onap.aaf.cadi.aaf.cass.test; - -import static org.junit.Assert.*; - -import org.apache.cassandra.exceptions.AuthenticationException; -import org.junit.Test; -import org.onap.aaf.cadi.aaf.cass.AAFAuthenticator; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import static org.junit.Assert.*; - -public class AAFAuthenticatorTest -{ - - - @Before - public void setUp() - { - - } - - @After - public void tearDown() - { - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_requireAuthentication_0_branch_0() - { - System.out.println("Now Testing Method:requireAuthentication Branch:0"); - - //Constructor - AAFAuthenticator instance = new AAFAuthenticator(); - - //Get expected result and result - Object expResult = null; - Object result = instance.requireAuthentication(); - - //Check Return value - assertEquals(expResult, result); - - //Check Test Verification Points - assertEquals(null, instance.requireAuthentication()); - - } - - /* - * Testing Conditon(s): if: (username == null) - */ - @Test - public void test_method_authenticate_1_branch_0() - { - System.out.println("Now Testing Method:authenticate Branch:0"); - - - - } - - /* - * Testing Conditon(s): else: Not (username == null) - */ - @Test - public void test_method_authenticate_1_branch_1() throws AuthenticationException - { - System.out.println("Now Testing Method:authenticate Branch:1"); - - //Constructor - AAFAuthenticator instance = new AAFAuthenticator(); - - //Get expected result and result - Object expResult = null; - Object result = instance.authenticate(null); - - //Check Return value - assertEquals(expResult, result); - - - - } - - /* - * Testing Conditon(s): if: (password == null) - */ - @Test - public void test_method_authenticate_1_branch_2() - { - System.out.println("Now Testing Method:authenticate Branch:2"); - - - - } - - /* - * Testing Conditon(s): else: Not (password == null), if: (password.startsWith("bsf:")) - */ - @Test - public void test_method_authenticate_1_branch_3() - { - System.out.println("Now Testing Method:authenticate Branch:3"); - - - - } - - /* - * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), if: (password.startsWith("enc:???")) - */ - @Test - public void test_method_authenticate_1_branch_4() - { - System.out.println("Now Testing Method:authenticate Branch:4"); - - } - - /* - * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), else: Not (password.startsWith("enc:???")) - */ - @Test - public void test_method_authenticate_1_branch_5() - { - System.out.println("Now Testing Method:authenticate Branch:5"); - - - - } - - /* - * Testing Conditon(s): if: (localLur!=null), if: (localLur.validate(fullName, Type.PASSWORD, password.getBytes())) - */ - @Test - public void test_method_authenticate_1_branch_6() - { - System.out.println("Now Testing Method:authenticate Branch:6"); - - - - } - - /* - * Testing Conditon(s): if: (localLur!=null), else: Not (localLur.validate(fullName, Type.PASSWORD, password.getBytes())) - */ - @Test - public void test_method_authenticate_1_branch_7() - { - System.out.println("Now Testing Method:authenticate Branch:7"); - - - } - - /* - * Testing Conditon(s): else: Not (localLur!=null) - */ - @Test - public void test_method_authenticate_1_branch_8() - { - System.out.println("Now Testing Method:authenticate Branch:8"); - - - - } - - /* - * Testing Conditon(s): if: (aafResponse != null) - */ - @Test - public void test_method_authenticate_1_branch_9() - { - System.out.println("Now Testing Method:authenticate Branch:9"); - - - } - - /* - * Testing Conditon(s): else: Not (aafResponse != null) - */ - @Test - public void test_method_authenticate_1_branch_10() - { - System.out.println("Now Testing Method:authenticate Branch:10"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_create_2_branch_0() - { - System.out.println("Now Testing Method:create Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_alter_3_branch_0() - { - System.out.println("Now Testing Method:alter Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_drop_4_branch_0() - { - System.out.println("Now Testing Method:drop Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_evaluateResponse_5_branch_0() - { - System.out.println("Now Testing Method:evaluateResponse Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_isComplete_6_branch_0() - { - System.out.println("Now Testing Method:isComplete Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getAuthenticatedUser_7_branch_0() - { - System.out.println("Now Testing Method:getAuthenticatedUser Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_newAuthenticator_8_branch_0() - { - System.out.println("Now Testing Method:newAuthenticator Branch:0"); - - - - } - -} diff --git a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthorizerTest.java b/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthorizerTest.java deleted file mode 100644 index 42673ef..0000000 --- a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFAuthorizerTest.java +++ /dev/null @@ -1,378 +0,0 @@ -/******************************************************************************* - * ============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==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package org.onap.aaf.cadi.aaf.cass.test; - -import static org.junit.Assert.*; - -import org.junit.Test; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import static org.junit.Assert.*; - -public class AAFAuthorizerTest -{ - - - @Before - public void setUp() - { - - } - - @After - public void tearDown() - { - - } - - /* - * Testing Conditon(s): if: (user instanceof AAFAuthenticatedUser), if: (aafUser.isLocal()) - */ - @Test - public void test_method_authorize_0_branch_0() - { - System.out.println("Now Testing Method:authorize Branch:0"); - - - - } - - /* - * Testing Conditon(s): if: (user instanceof AAFAuthenticatedUser), else: Not (aafUser.isLocal()) - */ - @Test - public void test_method_authorize_0_branch_1() - { - System.out.println("Now Testing Method:authorize Branch:1"); - - - } - - /* - * Testing Conditon(s): else: Not (user instanceof AAFAuthenticatedUser) - */ - @Test - public void test_method_authorize_0_branch_2() - { - System.out.println("Now Testing Method:authorize Branch:2"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_PermHolder_1_branch_0() - { - System.out.println("Now Testing Method:PermHolder Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_PermHolder_2_branch_0() - { - System.out.println("Now Testing Method:PermHolder Branch:0"); - - - - } - - /* - * Testing Conditon(s): if: (permissions==Permission.NONE) - */ - @Test - public void test_method_mutable_3_branch_0() - { - System.out.println("Now Testing Method:mutable Branch:0"); - - - - } - - /* - * Testing Conditon(s): else: Not (permissions==Permission.NONE) - */ - @Test - public void test_method_mutable_3_branch_1() - { - System.out.println("Now Testing Method:mutable Branch:1"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_mutable_4_branch_0() - { - System.out.println("Now Testing Method:mutable Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_mutable_5_branch_0() - { - System.out.println("Now Testing Method:mutable Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_6_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_7_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_8_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_9_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_10_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_11_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_12_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_13_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_14_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_15_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_16_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_17_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_getName_18_branch_0() - { - System.out.println("Now Testing Method:getName Branch:0"); - - //Constructor - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_exec_19_branch_0() - { - System.out.println("Now Testing Method:exec Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_grant_20_branch_0() - { - System.out.println("Now Testing Method:grant Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_revoke_21_branch_0() - { - System.out.println("Now Testing Method:revoke Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_list_22_branch_0() - { - System.out.println("Now Testing Method:list Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_revokeAll_23_branch_0() - { - System.out.println("Now Testing Method:revokeAll Branch:0"); - - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_revokeAll_24_branch_0() - { - System.out.println("Now Testing Method:revokeAll Branch:0"); - - - - } - -} diff --git a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFBaseTest.java b/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFBaseTest.java deleted file mode 100644 index db9f256..0000000 --- a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/AAFBaseTest.java +++ /dev/null @@ -1,399 +0,0 @@ -/******************************************************************************* - * ============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==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package org.onap.aaf.cadi.aaf.cass.test; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.aaf.cadi.aaf.cass.AAFBase; - -import static org.junit.Assert.*; - -public class AAFBaseTest -{ - - - @Before - public void setUp() - { - - } - - @After - public void tearDown() - { - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_setAccess_0_branch_0() - { - System.out.println("Now Testing Method:setAccess Branch:0"); - - //Call Method - AAFBase.setAccess(null); - - } - - /* - * Testing Conditon(s): if: (!props_ok) - */ - @Test - public void test_method_validateConfiguration_1_branch_0() - { - System.out.println("Now Testing Method:validateConfiguration Branch:0"); - - - - } - - /* - * Testing Conditon(s): else: Not (!props_ok) - */ - @Test - public void test_method_validateConfiguration_1_branch_1() - { - System.out.println("Now Testing Method:validateConfiguration Branch:1"); - - - - //Call Method - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (access==null), if: (cadi_props == null), if: (cp.exists()) - */ - @Test - public void test_method_setup_2_branch_0() - { - System.out.println("Now Testing Method:setup Branch:0"); - - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (access==null), if: (cadi_props == null), else: Not (cp.exists()) - */ - @Test - public void test_method_setup_2_branch_1() - { - System.out.println("Now Testing Method:setup Branch:1"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (access==null), else: Not (cadi_props == null) - */ - @Test - public void test_method_setup_2_branch_2() - { - System.out.println("Now Testing Method:setup Branch:2"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not (access==null) - */ - @Test - public void test_method_setup_2_branch_3() - { - System.out.println("Now Testing Method:setup Branch:3"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: ((perm_type = Config.logProp(access, "cass_group_name",null))==null) - */ - @Test - public void test_method_setup_2_branch_4() - { - System.out.println("Now Testing Method:setup Branch:4"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not ((perm_type = Config.logProp(access, "cass_group_name",null))==null) - */ - @Test - public void test_method_setup_2_branch_5() - { - System.out.println("Now Testing Method:setup Branch:5"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: ((cluster_name = Config.logProp(access,"cass_cluster_name",null))==null), if: ((cluster_name = DatabaseDescriptor.getClusterName())==null) - */ - @Test - public void test_method_setup_2_branch_6() - { - System.out.println("Now Testing Method:setup Branch:6"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: ((cluster_name = Config.logProp(access,"cass_cluster_name",null))==null), else: Not ((cluster_name = DatabaseDescriptor.getClusterName())==null) - */ - @Test - public void test_method_setup_2_branch_7() - { - System.out.println("Now Testing Method:setup Branch:7"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not ((cluster_name = Config.logProp(access,"cass_cluster_name",null))==null) - */ - @Test - public void test_method_setup_2_branch_8() - { - System.out.println("Now Testing Method:setup Branch:8"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: ((default_realm = Config.logProp(access, Config.AAF_DEFAULT_REALM, null))==null) - */ - @Test - public void test_method_setup_2_branch_9() - { - System.out.println("Now Testing Method:setup Branch:9"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not ((default_realm = Config.logProp(access, Config.AAF_DEFAULT_REALM, null))==null) - */ - @Test - public void test_method_setup_2_branch_10() - { - System.out.println("Now Testing Method:setup Branch:10"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (props_ok==false) - */ - @Test - public void test_method_setup_2_branch_11() - { - System.out.println("Now Testing Method:setup Branch:11"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not (props_ok==false) - */ - @Test - public void test_method_setup_2_branch_12() - { - System.out.println("Now Testing Method:setup Branch:12"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: (int i=0; (lur = elur.get(i))!=null;++i), if: (lur instanceof AbsAAFLur) - */ - @Test - public void test_method_setup_2_branch_13() - { - System.out.println("Now Testing Method:setup Branch:13"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: (int i=0; (lur = elur.get(i))!=null;++i), else: Not (lur instanceof AbsAAFLur), if: (lur instanceof LocalLur) - */ - @Test - public void test_method_setup_2_branch_14() - { - System.out.println("Now Testing Method:setup Branch:14"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: (int i=0; (lur = elur.get(i))!=null;++i), else: Not (lur instanceof AbsAAFLur), else: Not (lur instanceof LocalLur) - */ - @Test - public void test_method_setup_2_branch_15() - { - System.out.println("Now Testing Method:setup Branch:15"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: Not (int i=0; (lur = elur.get(i))!=null;++i) - */ - @Test - public void test_method_setup_2_branch_16() - { - System.out.println("Now Testing Method:setup Branch:16"); - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not (lur instanceof EpiLur), if: (lur instanceof AbsAAFLur) - */ - @Test - public void test_method_setup_2_branch_17() - { - System.out.println("Now Testing Method:setup Branch:17"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not (lur instanceof EpiLur), else: Not (lur instanceof AbsAAFLur) - */ - @Test - public void test_method_setup_2_branch_18() - { - System.out.println("Now Testing Method:setup Branch:18"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (aafAuthn==null) - */ - @Test - public void test_method_setup_2_branch_19() - { - System.out.println("Now Testing Method:setup Branch:19"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not (aafAuthn==null) - */ - @Test - public void test_method_setup_2_branch_20() - { - System.out.println("Now Testing Method:setup Branch:20"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), if: (access!=null) - */ - @Test - public void test_method_setup_2_branch_21() - { - System.out.println("Now Testing Method:setup Branch:21"); - - - - } - - /* - * Testing Conditon(s): if: (aafAuthn == null), else: Not (access!=null) - */ - @Test - public void test_method_setup_2_branch_22() - { - System.out.println("Now Testing Method:setup Branch:22"); - - - } - - /* - * Testing Conditon(s): else: Not (aafAuthn == null) - */ - @Test - public void test_method_setup_2_branch_23() - { - System.out.println("Now Testing Method:setup Branch:23"); - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_protectedResources_3_branch_0() - { - System.out.println("Now Testing Method:protectedResources Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_supportedOptions_4_branch_0() - { - System.out.println("Now Testing Method:supportedOptions Branch:0"); - - - } - - /* - * Testing Conditon(s): Default - */ - @Test - public void test_method_alterableOptions_5_branch_0() - { - System.out.println("Now Testing Method:alterableOptions Branch:0"); - - - - } - -} diff --git a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/JU_CASS.java b/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/JU_CASS.java deleted file mode 100644 index bedfa25..0000000 --- a/cass/src/test/java/org/onap/aaf/cadi/aaf/cass/test/JU_CASS.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * ============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==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package org.onap.aaf.cadi.aaf.cass.test; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.cassandra.auth.AuthenticatedUser; -import org.apache.cassandra.auth.IResource; -import org.apache.cassandra.auth.Permission; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.aaf.cadi.aaf.cass.AAFAuthenticator; -import org.onap.aaf.cadi.aaf.cass.AAFAuthorizer; - -public class JU_CASS { - - private static AAFAuthenticator aa; - private static AAFAuthorizer an; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - System.setProperty("cadi_prop_files", "etc/cadi.properties"); - - aa = new AAFAuthenticator(); - an = new AAFAuthorizer(); - - aa.setup(); - an.setup(); // does nothing after aa. - - aa.validateConfiguration(); - - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - @Test - public void test() throws Exception { - Map creds = new HashMap(); - creds.put("username", "XXX@NS"); - creds.put("password", "enc:???"); - AuthenticatedUser aaf = aa.authenticate(creds); - - // Test out "aaf_default_domain - creds.put("username", "XX"); - aaf = aa.authenticate(creds); - - IResource resource = new IResource() { - public String getName() { - return "data/authz"; - } - - public IResource getParent() { - return null; - } - - public boolean hasParent() { - return false; - } - - public boolean exists() { - return true; - } - - }; - - Set perms = an.authorize(aaf, resource); - - // Test out "AAF" access - creds.put("username", "XXX@NS"); - creds.put("password", "enc:???"); - aaf = aa.authenticate(creds); - perms = an.authorize(aaf, resource); - Assert.assertFalse(perms.isEmpty()); - - perms = an.authorize(aaf, resource); - Assert.assertFalse(perms.isEmpty()); - - } - -} diff --git a/cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatedUserTest.java b/cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatedUserTest.java new file mode 100644 index 0000000..f52c5e4 --- /dev/null +++ b/cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatedUserTest.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * * + ******************************************************************************/ +package org.onap.aaf.cadi.aaf.cass.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.onap.aaf.cadi.aaf.cass.AAFAuthenticatedUser; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +public class AAFAuthenticatedUserTest +{ + + + @Before + public void setUp() + { + + } + + @After + public void tearDown() + { + + } + + /* + * Testing Conditon(s): if: (endIndex >= 0) + */ + @Test + public void test_method_AAFAuthenticatedUser_0_branch_0() + { + System.out.println("Now Testing Method:AAFAuthenticatedUser Branch:0"); + + //Constructor + + + + } + + /* + * Testing Conditon(s): else: Not (endIndex >= 0) + */ + @Test + public void test_method_AAFAuthenticatedUser_0_branch_1() + { + System.out.println("Now Testing Method:AAFAuthenticatedUser Branch:1"); + + //Constructor + + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getFullName_1_branch_0() + { + System.out.println("Now Testing Method:getFullName Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_2_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_isAnonymous_3_branch_0() + { + System.out.println("Now Testing Method:isAnonymous Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_setAnonymous_4_branch_0() + { + System.out.println("Now Testing Method:setAnonymous Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getAnonymous_5_branch_0() + { + System.out.println("Now Testing Method:getAnonymous Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_isSuper_6_branch_0() + { + System.out.println("Now Testing Method:isSuper Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_setSuper_7_branch_0() + { + System.out.println("Now Testing Method:setSuper Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getSuper_8_branch_0() + { + System.out.println("Now Testing Method:getSuper Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_isLocal_9_branch_0() + { + System.out.println("Now Testing Method:isLocal Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_setLocal_10_branch_0() + { + System.out.println("Now Testing Method:setLocal Branch:0"); + + + + } + + /* + * Testing Conditon(s): if: (this == o) + */ + @Test + public void test_method_equals_11_branch_0() + { + System.out.println("Now Testing Method:equals Branch:0"); + + + } + + /* + * Testing Conditon(s): else: Not (this == o) + */ + @Test + public void test_method_equals_11_branch_1() + { + System.out.println("Now Testing Method:equals Branch:1"); + + } + + /* + * Testing Conditon(s): if: (!(o instanceof AAFAuthenticatedUser)) + */ + @Test + public void test_method_equals_11_branch_2() + { + System.out.println("Now Testing Method:equals Branch:2"); + + } + + /* + * Testing Conditon(s): else: Not (!(o instanceof AAFAuthenticatedUser)) + */ + @Test + public void test_method_equals_11_branch_3() + { + System.out.println("Now Testing Method:equals Branch:3"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_hashCode_12_branch_0() + { + System.out.println("Now Testing Method:hashCode Branch:0"); + + + + } + +} diff --git a/cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatorTest.java b/cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatorTest.java new file mode 100644 index 0000000..2ade2dc --- /dev/null +++ b/cass/src/test/java/org/onap/aaf/cass/AAFAuthenticatorTest.java @@ -0,0 +1,292 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * * + ******************************************************************************/ +package org.onap.aaf.cadi.aaf.cass.test; + +import static org.junit.Assert.*; + +import org.apache.cassandra.exceptions.AuthenticationException; +import org.junit.Test; +import org.onap.aaf.cadi.aaf.cass.AAFAuthenticator; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +public class AAFAuthenticatorTest +{ + + + @Before + public void setUp() + { + + } + + @After + public void tearDown() + { + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_requireAuthentication_0_branch_0() + { + System.out.println("Now Testing Method:requireAuthentication Branch:0"); + + //Constructor + AAFAuthenticator instance = new AAFAuthenticator(); + + //Get expected result and result + Object expResult = null; + Object result = instance.requireAuthentication(); + + //Check Return value + assertEquals(expResult, result); + + //Check Test Verification Points + assertEquals(null, instance.requireAuthentication()); + + } + + /* + * Testing Conditon(s): if: (username == null) + */ + @Test + public void test_method_authenticate_1_branch_0() + { + System.out.println("Now Testing Method:authenticate Branch:0"); + + + + } + + /* + * Testing Conditon(s): else: Not (username == null) + */ + @Test + public void test_method_authenticate_1_branch_1() throws AuthenticationException + { + System.out.println("Now Testing Method:authenticate Branch:1"); + + //Constructor + AAFAuthenticator instance = new AAFAuthenticator(); + + //Get expected result and result + Object expResult = null; + Object result = instance.authenticate(null); + + //Check Return value + assertEquals(expResult, result); + + + + } + + /* + * Testing Conditon(s): if: (password == null) + */ + @Test + public void test_method_authenticate_1_branch_2() + { + System.out.println("Now Testing Method:authenticate Branch:2"); + + + + } + + /* + * Testing Conditon(s): else: Not (password == null), if: (password.startsWith("bsf:")) + */ + @Test + public void test_method_authenticate_1_branch_3() + { + System.out.println("Now Testing Method:authenticate Branch:3"); + + + + } + + /* + * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), if: (password.startsWith("enc:???")) + */ + @Test + public void test_method_authenticate_1_branch_4() + { + System.out.println("Now Testing Method:authenticate Branch:4"); + + } + + /* + * Testing Conditon(s): else: Not (password == null), else: Not (password.startsWith("bsf:")), else: Not (password.startsWith("enc:???")) + */ + @Test + public void test_method_authenticate_1_branch_5() + { + System.out.println("Now Testing Method:authenticate Branch:5"); + + + + } + + /* + * Testing Conditon(s): if: (localLur!=null), if: (localLur.validate(fullName, Type.PASSWORD, password.getBytes())) + */ + @Test + public void test_method_authenticate_1_branch_6() + { + System.out.println("Now Testing Method:authenticate Branch:6"); + + + + } + + /* + * Testing Conditon(s): if: (localLur!=null), else: Not (localLur.validate(fullName, Type.PASSWORD, password.getBytes())) + */ + @Test + public void test_method_authenticate_1_branch_7() + { + System.out.println("Now Testing Method:authenticate Branch:7"); + + + } + + /* + * Testing Conditon(s): else: Not (localLur!=null) + */ + @Test + public void test_method_authenticate_1_branch_8() + { + System.out.println("Now Testing Method:authenticate Branch:8"); + + + + } + + /* + * Testing Conditon(s): if: (aafResponse != null) + */ + @Test + public void test_method_authenticate_1_branch_9() + { + System.out.println("Now Testing Method:authenticate Branch:9"); + + + } + + /* + * Testing Conditon(s): else: Not (aafResponse != null) + */ + @Test + public void test_method_authenticate_1_branch_10() + { + System.out.println("Now Testing Method:authenticate Branch:10"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_create_2_branch_0() + { + System.out.println("Now Testing Method:create Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_alter_3_branch_0() + { + System.out.println("Now Testing Method:alter Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_drop_4_branch_0() + { + System.out.println("Now Testing Method:drop Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_evaluateResponse_5_branch_0() + { + System.out.println("Now Testing Method:evaluateResponse Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_isComplete_6_branch_0() + { + System.out.println("Now Testing Method:isComplete Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getAuthenticatedUser_7_branch_0() + { + System.out.println("Now Testing Method:getAuthenticatedUser Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_newAuthenticator_8_branch_0() + { + System.out.println("Now Testing Method:newAuthenticator Branch:0"); + + + + } + +} diff --git a/cass/src/test/java/org/onap/aaf/cass/AAFAuthorizerTest.java b/cass/src/test/java/org/onap/aaf/cass/AAFAuthorizerTest.java new file mode 100644 index 0000000..42673ef --- /dev/null +++ b/cass/src/test/java/org/onap/aaf/cass/AAFAuthorizerTest.java @@ -0,0 +1,378 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * * + ******************************************************************************/ +package org.onap.aaf.cadi.aaf.cass.test; + +import static org.junit.Assert.*; + +import org.junit.Test; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +public class AAFAuthorizerTest +{ + + + @Before + public void setUp() + { + + } + + @After + public void tearDown() + { + + } + + /* + * Testing Conditon(s): if: (user instanceof AAFAuthenticatedUser), if: (aafUser.isLocal()) + */ + @Test + public void test_method_authorize_0_branch_0() + { + System.out.println("Now Testing Method:authorize Branch:0"); + + + + } + + /* + * Testing Conditon(s): if: (user instanceof AAFAuthenticatedUser), else: Not (aafUser.isLocal()) + */ + @Test + public void test_method_authorize_0_branch_1() + { + System.out.println("Now Testing Method:authorize Branch:1"); + + + } + + /* + * Testing Conditon(s): else: Not (user instanceof AAFAuthenticatedUser) + */ + @Test + public void test_method_authorize_0_branch_2() + { + System.out.println("Now Testing Method:authorize Branch:2"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_PermHolder_1_branch_0() + { + System.out.println("Now Testing Method:PermHolder Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_PermHolder_2_branch_0() + { + System.out.println("Now Testing Method:PermHolder Branch:0"); + + + + } + + /* + * Testing Conditon(s): if: (permissions==Permission.NONE) + */ + @Test + public void test_method_mutable_3_branch_0() + { + System.out.println("Now Testing Method:mutable Branch:0"); + + + + } + + /* + * Testing Conditon(s): else: Not (permissions==Permission.NONE) + */ + @Test + public void test_method_mutable_3_branch_1() + { + System.out.println("Now Testing Method:mutable Branch:1"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_mutable_4_branch_0() + { + System.out.println("Now Testing Method:mutable Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_mutable_5_branch_0() + { + System.out.println("Now Testing Method:mutable Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_6_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_7_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_8_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_9_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_10_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_11_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_12_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_13_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_14_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_15_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_16_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_17_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_getName_18_branch_0() + { + System.out.println("Now Testing Method:getName Branch:0"); + + //Constructor + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_exec_19_branch_0() + { + System.out.println("Now Testing Method:exec Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_grant_20_branch_0() + { + System.out.println("Now Testing Method:grant Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_revoke_21_branch_0() + { + System.out.println("Now Testing Method:revoke Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_list_22_branch_0() + { + System.out.println("Now Testing Method:list Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_revokeAll_23_branch_0() + { + System.out.println("Now Testing Method:revokeAll Branch:0"); + + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_revokeAll_24_branch_0() + { + System.out.println("Now Testing Method:revokeAll Branch:0"); + + + + } + +} diff --git a/cass/src/test/java/org/onap/aaf/cass/AAFBaseTest.java b/cass/src/test/java/org/onap/aaf/cass/AAFBaseTest.java new file mode 100644 index 0000000..db9f256 --- /dev/null +++ b/cass/src/test/java/org/onap/aaf/cass/AAFBaseTest.java @@ -0,0 +1,399 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * * + ******************************************************************************/ +package org.onap.aaf.cadi.aaf.cass.test; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.aaf.cadi.aaf.cass.AAFBase; + +import static org.junit.Assert.*; + +public class AAFBaseTest +{ + + + @Before + public void setUp() + { + + } + + @After + public void tearDown() + { + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_setAccess_0_branch_0() + { + System.out.println("Now Testing Method:setAccess Branch:0"); + + //Call Method + AAFBase.setAccess(null); + + } + + /* + * Testing Conditon(s): if: (!props_ok) + */ + @Test + public void test_method_validateConfiguration_1_branch_0() + { + System.out.println("Now Testing Method:validateConfiguration Branch:0"); + + + + } + + /* + * Testing Conditon(s): else: Not (!props_ok) + */ + @Test + public void test_method_validateConfiguration_1_branch_1() + { + System.out.println("Now Testing Method:validateConfiguration Branch:1"); + + + + //Call Method + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (access==null), if: (cadi_props == null), if: (cp.exists()) + */ + @Test + public void test_method_setup_2_branch_0() + { + System.out.println("Now Testing Method:setup Branch:0"); + + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (access==null), if: (cadi_props == null), else: Not (cp.exists()) + */ + @Test + public void test_method_setup_2_branch_1() + { + System.out.println("Now Testing Method:setup Branch:1"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (access==null), else: Not (cadi_props == null) + */ + @Test + public void test_method_setup_2_branch_2() + { + System.out.println("Now Testing Method:setup Branch:2"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not (access==null) + */ + @Test + public void test_method_setup_2_branch_3() + { + System.out.println("Now Testing Method:setup Branch:3"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: ((perm_type = Config.logProp(access, "cass_group_name",null))==null) + */ + @Test + public void test_method_setup_2_branch_4() + { + System.out.println("Now Testing Method:setup Branch:4"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not ((perm_type = Config.logProp(access, "cass_group_name",null))==null) + */ + @Test + public void test_method_setup_2_branch_5() + { + System.out.println("Now Testing Method:setup Branch:5"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: ((cluster_name = Config.logProp(access,"cass_cluster_name",null))==null), if: ((cluster_name = DatabaseDescriptor.getClusterName())==null) + */ + @Test + public void test_method_setup_2_branch_6() + { + System.out.println("Now Testing Method:setup Branch:6"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: ((cluster_name = Config.logProp(access,"cass_cluster_name",null))==null), else: Not ((cluster_name = DatabaseDescriptor.getClusterName())==null) + */ + @Test + public void test_method_setup_2_branch_7() + { + System.out.println("Now Testing Method:setup Branch:7"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not ((cluster_name = Config.logProp(access,"cass_cluster_name",null))==null) + */ + @Test + public void test_method_setup_2_branch_8() + { + System.out.println("Now Testing Method:setup Branch:8"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: ((default_realm = Config.logProp(access, Config.AAF_DEFAULT_REALM, null))==null) + */ + @Test + public void test_method_setup_2_branch_9() + { + System.out.println("Now Testing Method:setup Branch:9"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not ((default_realm = Config.logProp(access, Config.AAF_DEFAULT_REALM, null))==null) + */ + @Test + public void test_method_setup_2_branch_10() + { + System.out.println("Now Testing Method:setup Branch:10"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (props_ok==false) + */ + @Test + public void test_method_setup_2_branch_11() + { + System.out.println("Now Testing Method:setup Branch:11"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not (props_ok==false) + */ + @Test + public void test_method_setup_2_branch_12() + { + System.out.println("Now Testing Method:setup Branch:12"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: (int i=0; (lur = elur.get(i))!=null;++i), if: (lur instanceof AbsAAFLur) + */ + @Test + public void test_method_setup_2_branch_13() + { + System.out.println("Now Testing Method:setup Branch:13"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: (int i=0; (lur = elur.get(i))!=null;++i), else: Not (lur instanceof AbsAAFLur), if: (lur instanceof LocalLur) + */ + @Test + public void test_method_setup_2_branch_14() + { + System.out.println("Now Testing Method:setup Branch:14"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: (int i=0; (lur = elur.get(i))!=null;++i), else: Not (lur instanceof AbsAAFLur), else: Not (lur instanceof LocalLur) + */ + @Test + public void test_method_setup_2_branch_15() + { + System.out.println("Now Testing Method:setup Branch:15"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (lur instanceof EpiLur), for: Not (int i=0; (lur = elur.get(i))!=null;++i) + */ + @Test + public void test_method_setup_2_branch_16() + { + System.out.println("Now Testing Method:setup Branch:16"); + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not (lur instanceof EpiLur), if: (lur instanceof AbsAAFLur) + */ + @Test + public void test_method_setup_2_branch_17() + { + System.out.println("Now Testing Method:setup Branch:17"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not (lur instanceof EpiLur), else: Not (lur instanceof AbsAAFLur) + */ + @Test + public void test_method_setup_2_branch_18() + { + System.out.println("Now Testing Method:setup Branch:18"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (aafAuthn==null) + */ + @Test + public void test_method_setup_2_branch_19() + { + System.out.println("Now Testing Method:setup Branch:19"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not (aafAuthn==null) + */ + @Test + public void test_method_setup_2_branch_20() + { + System.out.println("Now Testing Method:setup Branch:20"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), if: (access!=null) + */ + @Test + public void test_method_setup_2_branch_21() + { + System.out.println("Now Testing Method:setup Branch:21"); + + + + } + + /* + * Testing Conditon(s): if: (aafAuthn == null), else: Not (access!=null) + */ + @Test + public void test_method_setup_2_branch_22() + { + System.out.println("Now Testing Method:setup Branch:22"); + + + } + + /* + * Testing Conditon(s): else: Not (aafAuthn == null) + */ + @Test + public void test_method_setup_2_branch_23() + { + System.out.println("Now Testing Method:setup Branch:23"); + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_protectedResources_3_branch_0() + { + System.out.println("Now Testing Method:protectedResources Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_supportedOptions_4_branch_0() + { + System.out.println("Now Testing Method:supportedOptions Branch:0"); + + + } + + /* + * Testing Conditon(s): Default + */ + @Test + public void test_method_alterableOptions_5_branch_0() + { + System.out.println("Now Testing Method:alterableOptions Branch:0"); + + + + } + +} diff --git a/cass/src/test/java/org/onap/aaf/cass/JU_CASS.java b/cass/src/test/java/org/onap/aaf/cass/JU_CASS.java index f5ee310..bedfa25 100644 --- a/cass/src/test/java/org/onap/aaf/cass/JU_CASS.java +++ b/cass/src/test/java/org/onap/aaf/cass/JU_CASS.java @@ -20,7 +20,7 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. * * ******************************************************************************/ -package org.onap.aaf.cass; +package org.onap.aaf.cadi.aaf.cass.test; import java.util.HashMap; import java.util.Map; diff --git a/client/pom.xml b/client/pom.xml index 219b936..23294d9 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -42,7 +42,7 @@ ${project.build.directory}/surefire-reports ${project.build.directory}/coverage-reports/jacoco.exec ${project.build.directory}/coverage-reports/jacoco-it.exec - true + false ${project.version} https://nexus.onap.org /content/repositories/snapshots/ @@ -123,9 +123,6 @@ 0.7.7.201606060606 true - - org.onap.aaf.* - diff --git a/core/pom.xml b/core/pom.xml index dd3415f..a838ece 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -146,9 +146,6 @@ 0.7.7.201606060606 true - - org.onap.aaf.* - diff --git a/core/tempkey b/core/tempkey new file mode 100644 index 0000000..a686c8a --- /dev/null +++ b/core/tempkey @@ -0,0 +1,27 @@ +z62PENkCdZGxxm-O3gcrvqsdHC7J_KzIcaLF22zPG8U4Ci2J8WqsHLDzVWEnPaZ17XMrtDWL1MoO +x5o6_mkP2K1DEfAELZgQ6XwUTlhHOyCpIcu-1Bsb4_Sud7iZJC5GMKOIBDMy_j9toF4qYICya_Zx +f_tA46FFuFmDo3prN_Uprw2CLUKGsSC0o2CRoU0YSxjQmHBa6TlUKaD3h7ebJs5-eDB3rXU_JMb_ +zO3ORX01U0i0kAiS8kSCpoYQkl6oG4_iQJhTTwFUlbNHSVn6nwbg03UpT6uQSnJQ8gT_zmmPW-NV +Iy_8s7vjQ0JVQxH4vbRfCzlgBMAdvBlEXy2_2_2XRm8uxC5Cl6dih07txN3l8b6ONaKsqjVkclfO +F-u6T6py_aStHia8yKxq4-X4GRrOufJnasEC2vk_2Y2ldOOfaeGFYTf1WXk1l62G0eKz1kwfl0YV +oo7FhcIeK10kx4zb-PWJZwROODeg-uKXZzuQy4vlIqu84r5vIbHLkR2qsBNs1j1GcvZ8KKDEjMd6 +0uelwn-9KZbnk6ZKXAZAL76Wsx7iDhDMBFZkpJPa4wse-9_0typMTgGmqoF8vHn6MhTRm0Yk-nbv +m2Kg7XPFpFoi5dKisaMfE4hDAX_4XUAyOKEDnn-DC1svCTmeP0KSoPq5oKN_qLNeQhDOB_NTcik7 +XeUz_z6Uft5dzejSTsR1Q9mRW4qwaz88EdAX9F6HJNR_nGeHPOR9qwxuwyimUdQlTc_GTXirnwVx +2HkSklnobMhUPb_xrTTPmDsOwW1uGiGDmUhD_hNU9TeGlB1I9igUH5xbqVpZHl2V3Qp5JaV5E56k +QLg7tf4m1VNFttWr4GyfDKMKTp4oT88uVSr1VaWegnQwun7hibD-Ii4cl5dHRFyLDE82QbLakN6g +N28O5CTBiUQIVKGGfJH_JOV5_qDOXRHk-V3HFO7rckpMOQIzZ_bM1iv7UVVIKp1v6tHf0Px3TOPU +xlq1aXEzVeghrltl6-SI0Of495mL5NPy8y1JddBVfvqWXHPT4dn41ckIr56AZLnkEhAxvBgI0CO0 +YTYGi-UxZrNIbJTRMAGuzIdjbeUaHLt68pr6JWtM5L2qoiWutbM-RJ_-xUIRrm8XflVRTlCiZlip +Gk7YR3GEcScA3z-IZ_O5uAjvXpKb4cdLDpybHhmySVLiuReMAnbBRIyqYhU3Ptagxg8vKLmEGOWz +2MMXdrJ16gFDnb2Nx47TrIfEBi3KW_Z4FD7WxFP6YwaoM3PkGesGJm_fLrjo5o1LSS3e0tBvV_C- +UsUftpnX5ViQ9ub8cETEcBlNm1YZ_Gywb9fMkwWY1MAA52y7pDORbVHhLHvEOYU7Yzow0icx2Ct2 +ZqOo10JJwCQWrdWC_fEsTLipxWPcVMbSkLmAzfJdpV9ej_SiYXpqYYMZizNbJRckJKR0U1scPYl3 +FksFM78gF2-DzLcV3yqpc8cB9KAwcWqylD4m5RObLyi9bqrMz63H-27SduPX4iJHs1dmzG9GXAxt +D9bPWQOxojd3n4R4ujfHOji0put5YCD1I_Nw3fevRPUu-HaA3W-5qxBVFculIGtoSZs_TeAZnnmo +e19rK847MKiUBNAKGpN4kGXBg79VX7QiIAYknjcm0UybGgtg_3tswpXKSQS1FloIngLPFku5f08c +t16cDy5yvt4gCSk4Gmj1W9QcbGaZJYUrkl-K6ehzS4XwO5Zi3zWZqCeN9TitTlWi9GJ2FHeBpdyD +JeaMhU9OHw5uwgGlbv0DxcHQ-M9lIU1vCedsphPO_eO_SV02gQWGVTEvniZl1df1RRuWcroWQDw1 +kLpx6DSSmu1S9Yw9MMao65nkDcxtA1bxo_-9Bn_OPocFOe2SQXs9EmZp_P6pSPI2mWr8P8eIxDh6 +AS68e6ktbuPtriZdyiniILwjQe2v_HTnbmBfwyIeT6VJ1o6tOp6R3Jd4p3Y5-ezteagyNbFY65u9 +ZIwcn5S9vHFLrqVn0Oc-QDupax7ZuRNg9jK3sPoGLxP5uneyNhly2STcaEQ3lJECLdViLmuL \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3d9bcca..cbbb8e9 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ ${project.build.directory}/surefire-reports ${project.build.directory}/coverage-reports/jacoco.exec ${project.build.directory}/coverage-reports/jacoco-it.exec - true + false ${project.version} https://nexus.onap.org /content/repositories/snapshots/ @@ -294,7 +294,7 @@ **/JU_PermEval.java **/JU_JMeter.java **/JU_Lur2_0Call.java - + @@ -460,9 +460,7 @@ 0.7.7.201606060606 true - - org.onap.aaf.* - + -- cgit 1.2.3-korg