use of ch.acanda.eclipse.pmd.domain.ProjectModel in project eclipse-pmd by acanda.
the class RuleSetsCacheTest method secondGetLoadsWhenProjectWasREmovedAndAddedAfterFirstGet.
/**
* Verifies that the second cache access loads the rule sets if the project model has been removed and added after
* the first access.
*/
@Test
public void secondGetLoadsWhenProjectWasREmovedAndAddedAfterFirstGet() throws Exception {
final WorkspaceModel workspaceModel = getWorkspaceModel();
final RuleSetsCache cache = new RuleSetsCache(getCacheLoaderMock(), workspaceModel);
cache.getRuleSets(PROJECT_NAME_1);
workspaceModel.remove(PROJECT_NAME_1);
workspaceModel.add(new ProjectModel(PROJECT_NAME_1));
final RuleSets actualRuleSets = cache.getRuleSets(PROJECT_NAME_1);
assertSame("Second cache access should reload rule sets", RULE_SETS_FOO_2, actualRuleSets);
}
use of ch.acanda.eclipse.pmd.domain.ProjectModel in project eclipse-pmd by acanda.
the class RuleSetsCacheTest method getWorkspaceModel.
private WorkspaceModel getWorkspaceModel() {
final WorkspaceModel workspaceModel = new WorkspaceModel();
workspaceModel.add(new ProjectModel(PROJECT_NAME_1));
return workspaceModel;
}
Aggregations