summaryrefslogtreecommitdiffstats
path: root/authz-cmd/src/test/java/com/att/cmd/role/JU_ListByNS.java
blob: f56c4d5e3547d754fdade12d7d5ac61028a2cafb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
/*******************************************************************************
 * ============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 com.att.cmd.role;

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 com.att.cadi.CadiException;
import com.att.cadi.LocatorException;
import com.att.cmd.AAFcli;
import com.att.cmd.JU_AAFCli;
import com.att.cmd.role.Role;
import com.att.inno.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();
		}
	}
}
an>){this.$element=n,this.$attrs=t,this.$scope=e}function MenuItemDirective(e,n,t){return{controller:"MenuItemController",require:["mdMenuItem","?ngModel"],priority:n.BEFORE_NG_ARIA,compile:function(n,o){function r(e,t,o){o=o||n,o instanceof angular.element&&(o=o[0]),o.hasAttribute(e)||o.setAttribute(e,t)}function i(t){var o=e.prefixer(t);angular.forEach(o,function(e){if(n[0].hasAttribute(e)){var t=n[0].getAttribute(e);s[0].setAttribute(e,t),n[0].removeAttribute(e)}})}var a=o.type,l="md-in-menu-bar";if("checkbox"!=a&&"radio"!=a||!n.hasClass(l))r("role","menuitem",n[0].querySelector("md-button, button, a"));else{var u=n[0].textContent,s=angular.element('<md-button type="button"></md-button>'),c='<md-icon md-svg-src="'+t.mdChecked+'"></md-icon>';s.html(u),s.attr("tabindex","0"),n.html(""),n.append(angular.element(c)),n.append(s),n.addClass("md-indent").removeClass(l),r("role","checkbox"==a?"menuitemcheckbox":"menuitemradio",s),i("ng-disabled")}return function(e,n,t,o){var r=o[0],i=o[1];r.init(i)}}}}goog.provide("ngmaterial.components.menuBar"),goog.require("ngmaterial.components.icon"),goog.require("ngmaterial.components.menu"),goog.require("ngmaterial.core"),angular.module("material.components.menuBar",["material.core","material.components.icon","material.components.menu"]),MenuBarController.$inject=["$scope","$rootScope","$element","$attrs","$mdConstant","$document","$mdUtil","$timeout"],angular.module("material.components.menuBar").controller("MenuBarController",MenuBarController);var BOUND_MENU_METHODS=["handleKeyDown","handleMenuHover","scheduleOpenHoveredMenu","cancelScheduledOpen"];MenuBarController.prototype.init=function(){var e=this.$element,n=this.$mdUtil,t=this.$scope,o=this,r=[];e.on("keydown",this.handleKeyDown),this.parentToolbar=n.getClosest(e,"MD-TOOLBAR"),r.push(this.$rootScope.$on("$mdMenuOpen",function(n,t){o.getMenus().indexOf(t[0])!=-1&&(e[0].classList.add("md-open"),t[0].classList.add("md-open"),o.currentlyOpenMenu=t.controller("mdMenu"),o.currentlyOpenMenu.registerContainerProxy(o.handleKeyDown),o.enableOpenOnHover())})),r.push(this.$rootScope.$on("$mdMenuClose",function(t,r,i){var a=o.getMenus();if(a.indexOf(r[0])!=-1&&(e[0].classList.remove("md-open"),r[0].classList.remove("md-open")),e[0].contains(r[0])){for(var l=r[0];l&&a.indexOf(l)==-1;)l=n.getClosest(l,"MD-MENU",!0);l&&(i.skipFocus||l.querySelector("button:not([disabled])").focus(),o.currentlyOpenMenu=void 0,o.disableOpenOnHover(),o.setKeyboardMode(!0))}})),t.$on("$destroy",function(){for(o.disableOpenOnHover();r.length;)r.shift()()}),this.setKeyboardMode(!0)},MenuBarController.prototype.setKeyboardMode=function(e){e?this.$element[0].classList.add("md-keyboard-mode"):this.$element[0].classList.remove("md-keyboard-mode")},MenuBarController.prototype.enableOpenOnHover=function(){if(!this.openOnHoverEnabled){var e=this;e.openOnHoverEnabled=!0,e.parentToolbar&&(e.parentToolbar.classList.add("md-has-open-menu"),e.$mdUtil.nextTick(function(){angular.element(e.parentToolbar).on("click",e.handleParentClick)},!1)),angular.element(e.getMenus()).on("mouseenter",e.handleMenuHover)}},MenuBarController.prototype.handleMenuHover=function(e){this.setKeyboardMode(!1),this.openOnHoverEnabled&&this.scheduleOpenHoveredMenu(e)},MenuBarController.prototype.disableOpenOnHover=function(){this.openOnHoverEnabled&&(this.openOnHoverEnabled=!1,this.parentToolbar&&(this.parentToolbar.classList.remove("md-has-open-menu"),angular.element(this.parentToolbar).off("click",this.handleParentClick)),angular.element(this.getMenus()).off("mouseenter",this.handleMenuHover))},MenuBarController.prototype.scheduleOpenHoveredMenu=function(e){var n=angular.element(e.currentTarget),t=n.controller("mdMenu");this.setKeyboardMode(!1),this.scheduleOpenMenu(t)},MenuBarController.prototype.scheduleOpenMenu=function(e){var n=this,t=this.$timeout;e!=n.currentlyOpenMenu&&(t.cancel(n.pendingMenuOpen),n.pendingMenuOpen=t(function(){n.pendingMenuOpen=void 0,n.currentlyOpenMenu&&n.currentlyOpenMenu.close(!0,{closeAll:!0}),e.open()},200,!1))},MenuBarController.prototype.handleKeyDown=function(e){var n=this.$mdConstant.KEY_CODE,t=this.currentlyOpenMenu,o=t&&t.isOpen;this.setKeyboardMode(!0);var r,i,a;switch(e.keyCode){case n.DOWN_ARROW:t?t.focusMenuContainer():this.openFocusedMenu(),r=!0;break;case n.UP_ARROW:t&&t.close(),r=!0;break;case n.LEFT_ARROW:i=this.focusMenu(-1),o&&(a=angular.element(i).controller("mdMenu"),this.scheduleOpenMenu(a)),r=!0;break;case n.RIGHT_ARROW:i=this.focusMenu(1),o&&(a=angular.element(i).controller("mdMenu"),this.scheduleOpenMenu(a)),r=!0}r&&(e&&e.preventDefault&&e.preventDefault(),e&&e.stopImmediatePropagation&&e.stopImmediatePropagation())},MenuBarController.prototype.focusMenu=function(e){var n=this.getMenus(),t=this.getFocusedMenuIndex();t==-1&&(t=this.getOpenMenuIndex());var o=!1;if(t==-1?(t=0,o=!0):(e<0&&t>0||e>0&&t<n.length-e)&&(t+=e,o=!0),o)return n[t].querySelector("button").focus(),n[t]},MenuBarController.prototype.openFocusedMenu=function(){var e=this.getFocusedMenu();e&&angular.element(e).controller("mdMenu").open()},MenuBarController.prototype.getMenus=function(){var e=this.$element;return this.$mdUtil.nodesToArray(e[0].children).filter(function(e){return"MD-MENU"==e.nodeName})},MenuBarController.prototype.getFocusedMenu=function(){return this.getMenus()[this.getFocusedMenuIndex()]},MenuBarController.prototype.getFocusedMenuIndex=function(){var e=this.$mdUtil,n=e.getClosest(this.$document[0].activeElement,"MD-MENU");if(!n)return-1;var t=this.getMenus().indexOf(n);return t},MenuBarController.prototype.getOpenMenuIndex=function(){for(var e=this.getMenus(),n=0;n<e.length;++n)if(e[n].classList.contains("md-open"))return n;return-1},MenuBarController.prototype.handleParentClick=function(e){var n=this.querySelector("md-menu.md-open");n&&!n.contains(e.target)&&angular.element(n).controller("mdMenu").close(!0,{closeAll:!0})},MenuBarDirective.$inject=["$mdUtil","$mdTheming"],angular.module("material.components.menuBar").directive("mdMenuBar",MenuBarDirective),angular.module("material.components.menuBar").directive("mdMenuDivider",MenuDividerDirective),MenuItemController.$inject=["$scope","$element","$attrs"],angular.module("material.components.menuBar").controller("MenuItemController",MenuItemController),MenuItemController.prototype.init=function(e){var n=this.$element,t=this.$attrs;this.ngModel=e,"checkbox"!=t.type&&"radio"!=t.type||(this.mode=t.type,this.iconEl=n[0].children[0],this.buttonEl=n[0].children[1],e&&this.initClickListeners())},MenuItemController.prototype.clearNgAria=function(){var e=this.$element[0],n=["role","tabindex","aria-invalid","aria-checked"];angular.forEach(n,function(n){e.removeAttribute(n)})},MenuItemController.prototype.initClickListeners=function(){function e(){if("radio"==a){var e=i.ngValue?r.$eval(i.ngValue):i.value;return o.$modelValue==e}return o.$modelValue}function n(e){e?u.off("click",s):u.on("click",s)}var t=this,o=this.ngModel,r=this.$scope,i=this.$attrs,a=(this.$element,this.mode);this.handleClick=angular.bind(this,this.handleClick);var l=this.iconEl,u=angular.element(this.buttonEl),s=this.handleClick;i.$observe("disabled",n),n(i.disabled),o.$render=function(){t.clearNgAria(),e()?(l.style.display="",u.attr("aria-checked","true")):(l.style.display="none",u.attr("aria-checked","false"))},r.$$postDigest(o.$render)},MenuItemController.prototype.handleClick=function(e){var n,t=this.mode,o=this.ngModel,r=this.$attrs;"checkbox"==t?n=!o.$modelValue:"radio"==t&&(n=r.ngValue?this.$scope.$eval(r.ngValue):r.value),o.$setViewValue(n),o.$render()},MenuItemDirective.$inject=["$mdUtil","$mdConstant","$$mdSvgRegistry"],angular.module("material.components.menuBar").directive("mdMenuItem",MenuItemDirective),ngmaterial.components.menuBar=angular.module("material.components.menuBar");