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();
}
}
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();
}
}
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);
}
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();
}
}
Aggregations