本文整理汇总了Java中net.sf.memoranda.ProjectManager.getAllProjects方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectManager.getAllProjects方法的具体用法?Java ProjectManager.getAllProjects怎么用?Java ProjectManager.getAllProjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.ProjectManager
的用法示例。
在下文中一共展示了ProjectManager.getAllProjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static void init() {
tags = new HashSet<String>();
try {
Vector<Project> projects = ProjectManager.getAllProjects();
for (int i = 0; i < projects.size(); i++) {
Elements tagElements = projects.get(i).getTags();
for (int j = 0; j < tagElements.size(); j++) {
tags.add(tagElements.get(j).getAttributeValue("name").toLowerCase());
}
}
tags.add(" ");
} catch (Exception e) {
Util.error(e);
}
}
示例2: upgradeTaskList
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
public static boolean upgradeTaskList(String publicId) {
int vid = getIndexOfVersion(publicId);
if (vid == (VERSIONS.length - 1)) {
Util.debug("Version " + publicId + " is the latest version, skipping upgrade");
return false;
}
else {
// get all projects
Vector projects = ProjectManager.getAllProjects();
String[] projectIds = new String[projects.size()];
int c = 0;
for (Iterator iter = projects.iterator(); iter.hasNext();) {
Project prj = (Project) iter.next();
projectIds[c++] = prj.getID();
}
// keep upgrading until it's the current version
while (vid < (VERSIONS.length - 1)) {
if(vid == 0) {
upgrade1_1d1(projectIds);
}
vid++;
}
return true;
}
}
示例3: testGetAll
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@Test
public void testGetAll() {
assertEquals(ProjectManager.getAllProjectsNumber(),projBeforeTest+5);
Vector allProj = ProjectManager.getAllProjects();
int countProj = 0;
for(Object o: allProj){
if(((Project)o).getTitle().equals("testProj1") || ((Project)o).getTitle().equals("testProj2") ||
((Project)o).getTitle().equals("testProj3") || ((Project)o).getTitle().equals("testProj4") ||
((Project)o).getTitle().equals("testProj5")) countProj++;
}
assertEquals(countProj,5);
}
示例4: testRemove
import net.sf.memoranda.ProjectManager; //导入方法依赖的package包/类
@Test
public void testRemove(){
int totalBefore = ProjectManager.getAllProjectsNumber();
ProjectManager.removeProject(tp1.getID());
ProjectManager.removeProject(tp4.getID());
assertEquals(totalBefore-2,ProjectManager.getAllProjectsNumber());
Vector allProj = ProjectManager.getAllProjects();
boolean correctProj = true;
for(Object o: allProj){
correctProj &= !((Project)o).getTitle().equals("testProj1") && !((Project)o).getTitle().equals("testProj4");
}
assertTrue(correctProj);
}