public void testOnDeleted() throws Exception{
AbstractProject project = j.createFreeStyleProject();
j.buildAndAssertSuccess(project);
j.buildAndAssertSuccess(project);
j.buildAndAssertSuccess(project);
DiskUsageProperty property = (DiskUsageProperty) project.getProperty(DiskUsageProperty.class);
project.getBuildByNumber(2).delete();
assertNull("Build 2 was not removed from caches informations.", property.getDiskUsageBuildInformation(2));
assertNotNull("Disk usage property whoud contains cashed information about build 1.", property.getDiskUsageOfBuild(1));
assertNotNull("Disk usage property whoud contains cashed information about build 3.", property.getDiskUsageOfBuild(3));
}