Skip to content

Commit f880766

Browse files
author
Chris Lewis
committed
All tests passing
1 parent a2e06e4 commit f880766

File tree

10 files changed

+132
-115
lines changed

10 files changed

+132
-115
lines changed

fixcache.xml

+9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535
<actions id="18" type="M" file_id="5" commit_id="9" branch_id="1"/>
3636
<actions id="19" type="V" file_id="8" commit_id="10" branch_id="1"/>
3737
<actions id="20" type="M" file_id="5" commit_id="10" branch_id="1"/>
38+
<file_paths id="1" commit_id="1" file_id="1" file_path="/foo/bar/a.java"/>
39+
<file_paths id="2" commit_id="1" file_id="2" file_path="/foo/bar/b"/>
40+
<file_paths id="3" commit_id="1" file_id="3" file_path="/foo/bar/c.java"/>
41+
<file_paths id="4" commit_id="1" file_id="4" file_path="/foo/bar/d.java"/>
42+
<file_paths id="5" commit_id="3" file_id="5" file_path="/foo/bar/e.java"/>
43+
<file_paths id="6" commit_id="6" file_id="6" file_path="/foo/bar/f.java"/>
44+
<file_paths id="7" commit_id="6" file_id="7" file_path="/foo/bar/g.java"/>
45+
<file_paths id="8" commit_id="8" file_id="8" file_path="/foo/bar/h.java"/>
46+
<file_paths id="9" commit_id="10" file_id="8" file_path="/bar/foo/h.java"/>
3847
<file_types id="1" file_id="1" type="code"/>
3948
<file_types id="2" file_id="2" type="unknown"/>
4049
<file_types id="3" file_id="3" type="code"/>

src/main/java/edu/ucsc/sil/fixcache/cache/Cache.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ int getLoc(int fileId){
233233
* Returns either the CacheItem associated with entityId, if in the cache
234234
* or null if it is not in the cache.
235235
*/
236-
public CacheItem getCacheItem(String entityId) {
236+
public CacheItem getCacheItem(int entityId) {
237237
CacheItem ci = cacheTable.get(entityId);
238238
if (ci == null)
239239
return null;
@@ -252,8 +252,8 @@ public int getNumber(String fileid) {
252252
return ci.getNumber();
253253
}
254254

255-
public int getLoadCount(String fileName){
256-
CacheItem ci = cacheTable.get(fileName);
255+
public int getLoadCount(int fileId){
256+
CacheItem ci = cacheTable.get(fileId);
257257
return ci.getLoadCount();
258258
}
259259

src/main/java/edu/ucsc/sil/fixcache/cache/CoChange.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class CoChange {
2424
+ "where actions.file_id=? and actions.commit_id=scmlog.id and "
2525
+ "date between ? and ? and scmlog.repository_id=?";
2626
// XXX: don't add deleted files to map
27-
static final String findCochangeFileId = "select file_id from files, actions, file_types "
27+
static final String findCochangeFileId = "select files.id from files, actions, file_types "
2828
+ "where files.id=actions.file_id and commit_id =? and "
2929
+ "files.id=file_types.file_id and file_types.type='code'"; // XXX
3030
// and

src/main/java/edu/ucsc/sil/fixcache/cache/Simulator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class Simulator {
3434
"and ft.type = 'code' " +
3535
"order by c.loc desc";
3636
static final String findHunkId = "select hunks.id from hunks, files "
37-
+ "where hunks.file_id=? and files.file_id = hunks.file_id and commit_id =?";
37+
+ "where hunks.file_id=? and files.id = hunks.file_id and commit_id =?";
3838
static final String findBugIntroCdate = "select date from hunk_blames, scmlog "
3939
+ "where hunk_id =? and hunk_blames.bug_commit_id=scmlog.id";
4040
private PreparedStatement findCommitQuery;
@@ -262,7 +262,7 @@ public void initialPreLoad() {
262262
// select files that are present at the start time
263263
// in descending order of LOC
264264

265-
final String findInitialPreload = "select files.file_id, content.commit_id "
265+
final String findInitialPreload = "select files.id, content.commit_id "
266266
+ "from content, scmlog, actions, file_types, files "
267267
+ "where files.repository_id=? and content.commit_id = scmlog.id and date <=? "
268268
+ "and content.file_id=actions.file_id and files.id=actions.file_id "

src/test/java/edu/ucsc/sil/fixcache/test/CacheItemTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ public void setUp() throws Exception {
3939
public void testCacheItemGet() {
4040
Cache cache = new Cache(5, new CacheReplacement(
4141
CacheReplacement.Policy.AUTHORS), "2009-10-20 01:32:19","2010-01-01 01:01:01", 1);
42-
CacheItem ci1 = new CacheItem("e.java", 10, "2009-10-24 14:30:54",
42+
CacheItem ci1 = new CacheItem(5, 10, "2009-10-24 14:30:54",
4343
CacheReason.BugEntity, cache);
4444
assertEquals(2, ci1.getNumberOfAuthors());
4545

4646
cache = new Cache(5,
4747
new CacheReplacement(CacheReplacement.Policy.BUGS),
4848
"2009-10-20 01:32:19", "2010-01-01 01:01:01",1);
49-
ci1 = new CacheItem("e.java", 10, "2009-10-24 14:30:54",
49+
ci1 = new CacheItem(5, 10, "2009-10-24 14:30:54",
5050
CacheReason.BugEntity, cache);
5151
assertEquals(3, ci1.getNumberOfBugs());
5252

5353
cache = new Cache(5, new CacheReplacement(
5454
CacheReplacement.Policy.CHANGES), "2009-10-20 01:32:19", "2010-01-01 01:01:01",1);
55-
ci1 = new CacheItem("e.java", 10, "2009-10-24 14:30:54",
55+
ci1 = new CacheItem(5, 10, "2009-10-24 14:30:54",
5656
CacheReason.BugEntity, cache);
5757
// CacheItem ci11 = new CacheItem(1, 1, "2009-10-20 01:32:19.0", CacheReason.BugEntity, cache);
5858
// assertEquals(3, ci1.getNumberOfChanges());
@@ -64,18 +64,18 @@ public void testCacheItemGet() {
6464

6565
cache = new Cache(5, new CacheReplacement(
6666
CacheReplacement.Policy.AUTHORS), "2009-10-20 01:32:19", "2010-01-01 01:01:01",1);
67-
CacheItem ci2 = new CacheItem("a.java", 8, "2009-10-24 07:51:22",
67+
CacheItem ci2 = new CacheItem(1, 8, "2009-10-24 07:51:22",
6868
CacheReason.BugEntity, cache);
6969
assertEquals(4, ci2.getNumberOfAuthors());
7070

7171
cache = new Cache(5,new CacheReplacement(CacheReplacement.Policy.BUGS),
7272
"2009-10-20 01:32:19","2010-01-01 01:01:01", 1);
73-
ci2 = new CacheItem("a.java", 8, "2009-10-24 07:51:22",
73+
ci2 = new CacheItem(1, 8, "2009-10-24 07:51:22",
7474
CacheReason.BugEntity, cache);
7575
assertEquals(2, ci2.getNumberOfBugs());
7676
cache = new Cache(5, new CacheReplacement(
7777
CacheReplacement.Policy.CHANGES), "2009-10-20 01:32:19","2010-01-01 01:01:01",1);
78-
ci2 = new CacheItem("a.java", 8, "2009-10-24 07:51:22",
78+
ci2 = new CacheItem(1, 8, "2009-10-24 07:51:22",
7979
CacheReason.BugEntity, cache);
8080
assertEquals(5, ci2.getNumberOfChanges());
8181

src/test/java/edu/ucsc/sil/fixcache/test/CacheReplacementTest.java

+75-75
Original file line numberDiff line numberDiff line change
@@ -36,110 +36,110 @@ public void setUp() throws Exception {
3636
public void testCacheReplacementAuthors() {
3737
Cache cache = new Cache(5, new CacheReplacement(
3838
CacheReplacement.Policy.AUTHORS), "2009-10-20 01:32:19", "2010-01-01 01:01:01",1);
39-
cache.add("d.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
40-
cache.add("c.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
41-
cache.add("a.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
42-
cache.add("d.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
43-
cache.add("a.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
44-
cache.add("a.java", 3, "2009-10-20 14:37:47", CacheReason.NewEntity);
45-
cache.add("e.java", 3, "2009-10-20 14:37:47", CacheReason.BugEntity);
46-
cache.remove("d.java", "2009-10-20 14:37:47");
47-
cache.add("a.java", 5, "2009-10-23 14:10:37", CacheReason.BugEntity);
48-
cache.add("f.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
49-
cache.add("g.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
50-
cache.add("c.java", 7, "2009-10-23 20:01:52", CacheReason.BugEntity);
51-
cache.add("h.java", 8, "2009-10-24 07:51:22", CacheReason.NewEntity);
52-
assertNull(cache.getCacheItem("e.java") );
53-
cache.add("a.java", 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity);
54-
cache.add("e.java", 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
55-
assertNull(cache.getCacheItem("f.java") );
39+
cache.add(4, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
40+
cache.add(3, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
41+
cache.add(1, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
42+
cache.add(4, 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
43+
cache.add(1, 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
44+
cache.add(1, 3, "2009-10-20 14:37:47", CacheReason.NewEntity);
45+
cache.add(5, 3, "2009-10-20 14:37:47", CacheReason.BugEntity);
46+
cache.remove(4, "2009-10-20 14:37:47");
47+
cache.add(1, 5, "2009-10-23 14:10:37", CacheReason.BugEntity);
48+
cache.add(6, 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
49+
cache.add(7, 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
50+
cache.add(3, 7, "2009-10-23 20:01:52", CacheReason.BugEntity);
51+
cache.add(8, 8, "2009-10-24 07:51:22", CacheReason.NewEntity);
52+
assertNull(cache.getCacheItem(5) );
53+
cache.add(1, 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity);
54+
cache.add(5, 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
55+
assertNull(cache.getCacheItem(6) );
5656
}
5757

5858
@Test
5959
public void testCacheReplacementLRU() {
6060
// add stuff to the cache, without bumping out anything
6161
Cache cache = new Cache(5, new CacheReplacement(
6262
CacheReplacement.Policy.LRU), "2009-10-20 01:32:19", "2010-01-01 01:01:01",1);
63-
cache.add("a.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
64-
cache.add("c.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
65-
cache.add("d.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
66-
cache.add("a.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity); // LRU
67-
cache.add("d.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity); // LRU
63+
cache.add(1, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
64+
cache.add(3, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
65+
cache.add(4, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
66+
cache.add(1, 2, "2009-10-20 14:37:38", CacheReason.BugEntity); // LRU
67+
cache.add(4, 2, "2009-10-20 14:37:38", CacheReason.BugEntity); // LRU
6868
assertEquals(3, cache.getCacheSize());
69-
cache.add("e.java", 3, "2009-10-20 14:37:47", CacheReason.NewEntity); // LRU 3, 5, 2, 4, 1, 3
70-
cache.add("a.java", 3, "2009-10-20 14:37:47", CacheReason.BugEntity); // 1,
69+
cache.add(5, 3, "2009-10-20 14:37:47", CacheReason.NewEntity); // LRU 3, 5, 2, 4, 1, 3
70+
cache.add(1, 3, "2009-10-20 14:37:47", CacheReason.BugEntity); // 1,
7171
assertEquals(4, cache.getCacheSize());
72-
cache.remove("d.java", "2009-10-20 14:37:47"); // 1, 5, 2, 3
72+
cache.remove(4, "2009-10-20 14:37:47"); // 1, 5, 2, 3
7373
assertEquals(3, cache.getCacheSize());
74-
cache.add("a.java", 5, "2009-10-23 14:10:37", CacheReason.BugEntity); // 1,
74+
cache.add(1, 5, "2009-10-23 14:10:37", CacheReason.BugEntity); // 1,
7575
assertEquals(3, cache.getCacheSize());
76-
cache.add("f.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity); // 6,
76+
cache.add(6, 6, "2009-10-23 14:29:05", CacheReason.NewEntity); // 6,
7777
assertEquals(4, cache.getCacheSize());
78-
assertEquals(1, cache.getLoadCount("c.java"));
78+
assertEquals(1, cache.getLoadCount(3));
7979

80-
assertEquals("c.java", cache.getMinimum());
81-
cache.add("g.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity); // 7,
80+
assertEquals(3, cache.getMinimum());
81+
cache.add(7, 6, "2009-10-23 14:29:05", CacheReason.NewEntity); // 7,
8282
assertEquals(5, cache.getCacheSize());
83-
cache.add("d.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
83+
cache.add(4, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
8484
assertEquals(5, cache.getCacheSize());
85-
assertNull(cache.getCacheItem("c.java") );
85+
assertNull(cache.getCacheItem(3) );
8686

87-
cache.add("c.java", 7, "2009-10-23 20:01:52", CacheReason.BugEntity); // 3,
88-
assertEquals(2, cache.getLoadCount("c.java"));
89-
assertNull(cache.getCacheItem("e.java") );
90-
cache.add("h.java", 8, "2009-10-24 07:51:22", CacheReason.NewEntity); // 8,
91-
assertNull(cache.getCacheItem("a.java") );
92-
cache.add("a.java", 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity); // 1,
93-
assertNull(cache.getCacheItem("b") );
94-
cache.add("e.java", 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
95-
assertNull(cache.getCacheItem("f.java") );
87+
cache.add(3, 7, "2009-10-23 20:01:52", CacheReason.BugEntity); // 3,
88+
assertEquals(2, cache.getLoadCount(3));
89+
assertNull(cache.getCacheItem(5) );
90+
cache.add(8, 8, "2009-10-24 07:51:22", CacheReason.NewEntity); // 8,
91+
assertNull(cache.getCacheItem(1) );
92+
cache.add(1, 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity); // 1,
93+
assertNull(cache.getCacheItem(2) );
94+
cache.add(5, 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
95+
assertNull(cache.getCacheItem(6) );
9696
}
9797

9898
@Test
9999
public void testCacheReplacementChanges() {
100100
Cache cache = new Cache(5, new CacheReplacement(
101101
CacheReplacement.Policy.CHANGES), "2009-10-20 01:32:19.0", "2010-01-01 01:01:01.0",1);
102-
cache.add("d.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
103-
cache.add("c.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
104-
cache.add("a.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
105-
cache.add("d.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
106-
cache.add("a.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
107-
cache.add("a.java", 3, "2009-10-20 14:37:47", CacheReason.NewEntity);
108-
cache.add("e.java", 3, "2009-10-20 14:37:47", CacheReason.BugEntity);
109-
cache.remove("d.java", "2009-10-20 14:37:47");
110-
cache.add("a.java", 5, "2009-10-23 14:10:37", CacheReason.BugEntity);
111-
cache.add("f.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
112-
cache.add("g.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
113-
cache.add("c.java", 7, "2009-10-23 20:01:52", CacheReason.BugEntity);
114-
cache.add("h.java", 8, "2009-10-24 07:51:22", CacheReason.NewEntity);
115-
assertNull(cache.getCacheItem("e.java") );
116-
cache.add("a.java", 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity);
117-
cache.add("e.java", 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
118-
assertNull(cache.getCacheItem("f.java") );
102+
cache.add(4, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
103+
cache.add(3, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
104+
cache.add(1, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
105+
cache.add(4, 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
106+
cache.add(1, 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
107+
cache.add(1, 3, "2009-10-20 14:37:47", CacheReason.NewEntity);
108+
cache.add(5, 3, "2009-10-20 14:37:47", CacheReason.BugEntity);
109+
cache.remove(4, "2009-10-20 14:37:47");
110+
cache.add(1, 5, "2009-10-23 14:10:37", CacheReason.BugEntity);
111+
cache.add(6, 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
112+
cache.add(7, 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
113+
cache.add(3, 7, "2009-10-23 20:01:52", CacheReason.BugEntity);
114+
cache.add(8, 8, "2009-10-24 07:51:22", CacheReason.NewEntity);
115+
assertNull(cache.getCacheItem(5) );
116+
cache.add(1, 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity);
117+
cache.add(5, 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
118+
assertNull(cache.getCacheItem(6) );
119119
}
120120

121121
@Test
122122
public void testCacheReplacementBugs() {
123123
Cache cache = new Cache(5, new CacheReplacement(
124124
CacheReplacement.Policy.BUGS), "2009-10-20 01:32:19.0", "2010-01-01 01:01:01.0",1);
125125

126-
cache.add("d.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
127-
cache.add("c.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
128-
cache.add("a.java", 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
129-
cache.add("d.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
130-
cache.add("a.java", 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
131-
cache.add("a.java", 3, "2009-10-20 14:37:47", CacheReason.NewEntity);
132-
cache.add("e.java", 3, "2009-10-20 14:37:47", CacheReason.BugEntity);
133-
cache.remove("d.java", "2009-10-20 14:37:47");
134-
cache.add("a.java", 5, "2009-10-23 14:10:37", CacheReason.BugEntity);
135-
cache.add("f.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
136-
cache.add("g.java", 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
137-
cache.add("c.java", 7, "2009-10-23 20:01:52", CacheReason.BugEntity);
138-
cache.add("h.java", 8, "2009-10-24 07:51:22", CacheReason.NewEntity);
139-
assertNull(cache.getCacheItem("e.java") );
140-
cache.add("a.java", 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity);
141-
cache.add("e.java", 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
142-
assertNull(cache.getCacheItem("h.java") );
126+
cache.add(4, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
127+
cache.add(3, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
128+
cache.add(1, 1, "2009-10-20 01:32:19", CacheReason.NewEntity);
129+
cache.add(4, 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
130+
cache.add(1, 2, "2009-10-20 14:37:38", CacheReason.BugEntity);
131+
cache.add(1, 3, "2009-10-20 14:37:47", CacheReason.NewEntity);
132+
cache.add(5, 3, "2009-10-20 14:37:47", CacheReason.BugEntity);
133+
cache.remove(4, "2009-10-20 14:37:47");
134+
cache.add(1, 5, "2009-10-23 14:10:37", CacheReason.BugEntity);
135+
cache.add(6, 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
136+
cache.add(7, 6, "2009-10-23 14:29:05", CacheReason.NewEntity);
137+
cache.add(3, 7, "2009-10-23 20:01:52", CacheReason.BugEntity);
138+
cache.add(8, 8, "2009-10-24 07:51:22", CacheReason.NewEntity);
139+
assertNull(cache.getCacheItem(5) );
140+
cache.add(1, 8, "2009-10-24 07:51:22", CacheReason.ModifiedEntity);
141+
cache.add(5, 9, "2009-10-24 09:50:26", CacheReason.ModifiedEntity);
142+
assertNull(cache.getCacheItem(8) );
143143
}
144144

145145
}

src/test/java/edu/ucsc/sil/fixcache/test/CacheTest.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ public void setUp() throws Exception {
3838
public void testCacheAdd() {
3939
Cache cache = new Cache(5, new CacheReplacement(
4040
CacheReplacement.Policy.AUTHORS), "2009-10-20 01:32:19.0", "2010-01-01 01:01:01.0",1);
41-
cache.add("a.java", 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
41+
cache.add(1, 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
4242
assertEquals(cache.getCacheSize(), 1);
43-
cache.add("g.java", 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
43+
cache.add(7, 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
4444
assertEquals(cache.getCacheSize(), 2);
45-
cache.add("c.java", 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
45+
cache.add(3, 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
4646
assertEquals(cache.getCacheSize(), 3);
47-
cache.add("d.java", 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
47+
cache.add(4, 1, "2009-10-20 01:32:19.0", CacheReason.NewEntity);
4848
assertEquals(cache.getCacheSize(), 4);
49-
cache.add("a.java", 2, "2009-10-20 14:37:38.0", CacheReason.ModifiedEntity);
49+
cache.add(1, 2, "2009-10-20 14:37:38.0", CacheReason.ModifiedEntity);
5050
assertEquals(cache.getCacheSize(), 4);
51-
cache.add("d.java", 2, "2009-10-20 14:37:38.0", CacheReason.ModifiedEntity);
51+
cache.add(4, 2, "2009-10-20 14:37:38.0", CacheReason.ModifiedEntity);
5252
assertEquals(cache.getCacheSize(), 4);
53-
cache.add("g.java", 3, "2009-10-20 14:37:47.0", CacheReason.BugEntity);
53+
cache.add(7, 3, "2009-10-20 14:37:47.0", CacheReason.BugEntity);
5454
assertEquals(cache.getCacheSize(), 4);
55-
cache.add("e.java", 3, "2009-10-20 14:37:47.0", CacheReason.BugEntity);
55+
cache.add(5, 3, "2009-10-20 14:37:47.0", CacheReason.BugEntity);
5656
assertTrue(cache.isFull());
57-
assertEquals(1, cache.getLoadCount("a.java"));
57+
assertEquals(1, cache.getLoadCount(1));
5858
}
5959

6060
}

0 commit comments

Comments
 (0)