Search in sources :

Example 1 with IUserRoleListWebService

use of org.pentaho.platform.security.userrole.ws.IUserRoleListWebService in project pentaho-platform by pentaho.

the class UserDetailsRoleListWebServiceBase method testGetAllRoles.

@Test
public void testGetAllRoles() throws Exception {
    IUserRoleListWebService service = getUserRoleListWebService();
    try {
        List<String> allRoles = service.getAllRoles();
        assertNotNull(allRoles);
        // Should have exactly 7 roles
        assertEquals(allRoles.size(), 7);
        // $NON-NLS-1$
        assertEquals(allRoles.get(0), "dev");
        // $NON-NLS-1$
        assertEquals(allRoles.get(6), "is");
    } catch (Exception e) {
        Assert.fail();
    }
}
Also used : IUserRoleListWebService(org.pentaho.platform.security.userrole.ws.IUserRoleListWebService) Test(org.junit.Test)

Example 2 with IUserRoleListWebService

use of org.pentaho.platform.security.userrole.ws.IUserRoleListWebService in project pentaho-platform by pentaho.

the class UserDetailsRoleListWebServiceBase method testGetAllUsers.

@Test
public void testGetAllUsers() throws Exception {
    IUserRoleListWebService service = getUserRoleListWebService();
    try {
        List<String> allUsers = service.getAllUsers();
        assertNotNull(allUsers);
        assertEquals(allUsers.size(), 4);
        // $NON-NLS-1$
        assertEquals(allUsers.get(0), "pat");
        // $NON-NLS-1$
        assertEquals(allUsers.get(3), "suzy");
    } catch (Exception e) {
        Assert.fail();
    }
}
Also used : IUserRoleListWebService(org.pentaho.platform.security.userrole.ws.IUserRoleListWebService) Test(org.junit.Test)

Example 3 with IUserRoleListWebService

use of org.pentaho.platform.security.userrole.ws.IUserRoleListWebService in project pentaho-platform by pentaho.

the class UserDetailsRoleListEndpointIT method main.

public static void main(String[] args) throws Exception {
    // test against a live server, dev use only
    System.setProperty("com.sun.xml.ws.monitoring.endpoint", "true");
    System.setProperty("com.sun.xml.ws.monitoring.client", "true");
    System.setProperty("com.sun.xml.ws.monitoring.registrationDebug", "FINE");
    System.setProperty("com.sun.xml.ws.monitoring.runtimeDebug", "true");
    Service service = Service.create(new URL("http://localhost:8080/pentaho/webservices/userRoleListService?wsdl"), new QName("http://www.pentaho.org/ws/1.0", "userRoleListService"));
    IUserRoleListWebService userDetailsRoleListWebService = service.getPort(IUserRoleListWebService.class);
    ((BindingProvider) userDetailsRoleListWebService).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "admin");
    ((BindingProvider) userDetailsRoleListWebService).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
    // accept cookies to maintain session on server
    ((BindingProvider) userDetailsRoleListWebService).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
}
Also used : QName(javax.xml.namespace.QName) IUserRoleListWebService(org.pentaho.platform.security.userrole.ws.IUserRoleListWebService) IUserRoleListWebService(org.pentaho.platform.security.userrole.ws.IUserRoleListWebService) Service(javax.xml.ws.Service) DefaultUserRoleListWebService(org.pentaho.platform.security.userrole.ws.DefaultUserRoleListWebService) URL(java.net.URL)

Example 4 with IUserRoleListWebService

use of org.pentaho.platform.security.userrole.ws.IUserRoleListWebService in project pentaho-platform by pentaho.

the class UserDetailsRoleListWebServiceBase method testGetUserRoleInfo.

@Test
public void testGetUserRoleInfo() throws Exception {
    IUserRoleListWebService service = getUserRoleListWebService();
    try {
        // $NON-NLS-1$
        UserRoleInfo userRoleInfo = service.getUserRoleInfo();
        assertNotNull(userRoleInfo);
        assertEquals(userRoleInfo.getRoles().size(), 7);
        assertEquals(userRoleInfo.getUsers().size(), 4);
    } catch (Exception e) {
        Assert.fail();
    }
}
Also used : UserRoleInfo(org.pentaho.platform.api.engine.security.userroledao.UserRoleInfo) IUserRoleListWebService(org.pentaho.platform.security.userrole.ws.IUserRoleListWebService) Test(org.junit.Test)

Aggregations

IUserRoleListWebService (org.pentaho.platform.security.userrole.ws.IUserRoleListWebService)4 Test (org.junit.Test)3 URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 Service (javax.xml.ws.Service)1 UserRoleInfo (org.pentaho.platform.api.engine.security.userroledao.UserRoleInfo)1 DefaultUserRoleListWebService (org.pentaho.platform.security.userrole.ws.DefaultUserRoleListWebService)1