package cache.tests;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import cache.CacheSim;
import cache.DataBlockInfo;
public class TestCacheSim {
private CacheSim cs;
private DataBlockInfo a;
private DataBlockInfo b;
private DataBlockInfo c;
private DataBlockInfo d;
@Before public void setup() {
a = new DataBlockInfo("1", 1, 1);
b = new DataBlockInfo("2", 1, 1);
c = new DataBlockInfo("3", 1, 1);
d = new DataBlockInfo("4", 1, 1);
a.setScore(2);
b.setScore(3);
c.setScore(4);
d.setScore(5);
cs = new CacheSim(5, 5);
cs.addToFetch(a);
cs.addToFetch(b);
cs.addToFetch(c);
cs.addToFetch(d);
cs.updateQueue();
}
@Test public void addToCache() {
assertTrue(cs.isCached(a));
assertTrue(cs.isCached(b));
assertTrue(cs.isCached(c));
assertTrue(cs.isCached(d));
}
@Test public void failTest() {
fail();
}
}