@Test public void testGetSupervisorGroups_0args() throws Exception { Group[] found = si.getSupervisorGroups(); assertThat("testGetSupervisorGroups_0args 0", found, notNullValue()); assertTrue("testGetSupervisorGroups_0args 1", found.length == 1); boolean added = false; for(Group g: found) { if(g.equals(gr)) { added = true; } } assertTrue("testGetSupervisorGroups_0args 2",added); }
public Group[] getSupervisorGroups(Context c, int wi) throws SQLException { List<Group> groupList = new ArrayList<Group>(); String query = "SELECT epersongroup.* " + "FROM epersongroup, epersongroup2workspaceitem " + "WHERE epersongroup2workspaceitem.workspace_item_id" + " = ? " + " AND epersongroup2workspaceitem.eperson_group_id =" + " epersongroup.eperson_group_id " + "ORDER BY epersongroup.name"; TableRowIterator tri = DatabaseManager.queryTable(c,"epersongroup",query, wi); try { while (tri.hasNext()) { TableRow row = tri.next(); Group group = Group.find(c,row.getIntColumn("eperson_group_id")); groupList.add(group); } } finally { if (tri != null) { tri.close(); } } return groupList.toArray(new Group[groupList.size()]); }
SupervisedItem extends WorkspaceItem { public Group[] getSupervisorGroups(Context c, int wi) throws SQLException { List<Group> groupList = new ArrayList<Group>(); String query = "SELECT epersongroup.* " + "FROM epersongroup, epersongroup2workspaceitem " + "WHERE epersongroup2workspaceitem.workspace_item_id" + " = ? " + " AND epersongroup2workspaceitem.eperson_group_id =" + " epersongroup.eperson_group_id " + "ORDER BY epersongroup.name"; TableRowIterator tri = DatabaseManager.queryTable(c,"epersongroup",query, wi); try { while (tri.hasNext()) { TableRow row = tri.next(); Group group = Group.find(c,row.getIntColumn("eperson_group_id")); groupList.add(group); } } finally { if (tri != null) { tri.close(); } } return groupList.toArray(new Group[groupList.size()]); } }
SupervisedItem extends WorkspaceItem { public Group[] getSupervisorGroups(Context c, int wi) throws SQLException { List<Group> groupList = new ArrayList<Group>(); String query = "SELECT epersongroup.* " + "FROM epersongroup, epersongroup2workspaceitem " + "WHERE epersongroup2workspaceitem.workspace_item_id" + " = ? " + " AND epersongroup2workspaceitem.eperson_group_id =" + " epersongroup.eperson_group_id " + "ORDER BY epersongroup.name"; TableRowIterator tri = DatabaseManager.queryTable(c,"epersongroup",query, wi); try { while (tri.hasNext()) { TableRow row = tri.next(); Group group = Group.find(c,row.getIntColumn("eperson_group_id")); groupList.add(group); } } finally { if (tri != null) { tri.close(); } } return groupList.toArray(new Group[groupList.size()]); } SupervisedItem(Context context, TableRow row); }
SupervisedItem extends WorkspaceItem { public Group[] getSupervisorGroups(Context c, int wi) throws SQLException { List<Group> groupList = new ArrayList<Group>(); String query = "SELECT epersongroup.* " + "FROM epersongroup, epersongroup2workspaceitem " + "WHERE epersongroup2workspaceitem.workspace_item_id" + " = ? " + " AND epersongroup2workspaceitem.eperson_group_id =" + " epersongroup.eperson_group_id " + "ORDER BY epersongroup.name"; TableRowIterator tri = DatabaseManager.queryTable(c,"epersongroup",query, wi); try { while (tri.hasNext()) { TableRow row = tri.next(); Group group = Group.find(c,row.getIntColumn("eperson_group_id")); groupList.add(group); } } finally { if (tri != null) { tri.close(); } } return groupList.toArray(new Group[groupList.size()]); } SupervisedItem(Context context, TableRow row); static SupervisedItem[] getAll(Context context); Group[] getSupervisorGroups(Context c, int wi); Group[] getSupervisorGroups(); static SupervisedItem[] findbyEPerson(Context context, EPerson ep); }
SupervisedItem extends WorkspaceItem { public Group[] getSupervisorGroups(Context c, int wi) throws SQLException { List<Group> groupList = new ArrayList<Group>(); String query = "SELECT epersongroup.* " + "FROM epersongroup, epersongroup2workspaceitem " + "WHERE epersongroup2workspaceitem.workspace_item_id" + " = ? " + " AND epersongroup2workspaceitem.eperson_group_id =" + " epersongroup.eperson_group_id " + "ORDER BY epersongroup.name"; TableRowIterator tri = DatabaseManager.queryTable(c,"epersongroup",query, wi); try { while (tri.hasNext()) { TableRow row = tri.next(); Group group = Group.find(c,row.getIntColumn("eperson_group_id")); groupList.add(group); } } finally { if (tri != null) { tri.close(); } } return groupList.toArray(new Group[groupList.size()]); } SupervisedItem(Context context, TableRow row); static SupervisedItem[] getAll(Context context); Group[] getSupervisorGroups(Context c, int wi); Group[] getSupervisorGroups(); static SupervisedItem[] findbyEPerson(Context context, EPerson ep);  }