userRoleDao.createUser( tenantAcme, USERNAME_SUZY, PASSWORD, "", null );
login( USERNAME_SUZY, tenantAcme, new String[] { tenantAuthenticatedRoleName } );
final String rootFolderID = String.valueOf( repo.getFile( ClientRepositoryPaths.getRootFolderPath() ).getId() );
List<RepositoryFile> children = repo.getChildren( new RepositoryRequest( rootFolderID, true, -1, null ) );
assertEquals( 3, children.size() );
ArrayList<String> checkFolders = new ArrayList<String>( Arrays.asList( new String[] { "public", "etc", "home" } ) );
for ( RepositoryFile f0 : children ) {
if ( checkFolders.contains( f0.getName() ) ) {
checkFolders.remove( f0.getName() );
} else {
fail( "Unknown file present" );
}
}
if ( checkFolders.size() != 0 ) {
fail( "All root folders not present" );
}
children = repo.getChildren( new RepositoryRequest( rootFolderID, true, -1, null ) );
assertEquals( 3, children.size() );
children = repo.getChildren( new RepositoryRequest( rootFolderID, true, -1, "*" ) );
assertEquals( 3, children.size() );
children = repo.getChildren( new RepositoryRequest( rootFolderID, true, -1, "*me" ) );
assertEquals( 1, children.size() );
children = repo.getChildren( new RepositoryRequest( rootFolderID, true, -1, "*Z*" ) );
assertEquals( 0, children.size() );
}