Package org.pentaho.platform.plugin.action.mondrian.mapper

Examples of org.pentaho.platform.plugin.action.mondrian.mapper.MondrianOneToOneUserRoleListMapper


    }
  }

  @Test
  public void testMondrianOneToOneUserRoleListMapper() throws Exception {
    final IConnectionUserRoleMapper mapper = new MondrianOneToOneUserRoleListMapper();
    try {
      String[] roles = SecurityHelper.getInstance().runAsUser( "simplebob", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );

      Assert.assertNotNull( roles );
      Assert.assertEquals( 2, roles.length );
View Full Code Here


    }
  }

  @Test
  public void testNoMatchMondrianOneToOneUserRoleListMapper() throws Exception {
    final MondrianOneToOneUserRoleListMapper mapper = new MondrianOneToOneUserRoleListMapper();
    mapper.setFailOnEmptyRoleList( true );
    try {
      SecurityHelper.getInstance().runAsUser( "admin", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );
      Assert.fail();
    } catch ( PentahoAccessControlException e ) {
      // No op.
    }
    mapper.setFailOnEmptyRoleList( false );
    try {
      String[] roles = SecurityHelper.getInstance().runAsUser( "simplebob", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );
      Assert.assertArrayEquals( new String[] { "Role1", "Role2" }, roles );
    } catch ( PentahoAccessControlException e ) {
      Assert.fail( e.getMessage() );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.plugin.action.mondrian.mapper.MondrianOneToOneUserRoleListMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.