-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tests.java
51 lines (41 loc) · 1.26 KB
/
Tests.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.rmi.RemoteException;
public class Tests
{
public static void main(String[] args) { new Tests(); }
public Tests()
{
try {
testStubCache();
testBasicCache();
} catch (RemoteException e) {
e.printStackTrace();
}
}
private void testStubCache() throws RemoteException
{
System.out.println("creating new StubCache");
StubCache cache = new StubCache();
System.out.println("setting 1:A");
cache.set("1", "A");
System.out.println("getting 1, result: " + cache.get("1"));
System.out.println();
}
private void testBasicCache() throws RemoteException
{
System.out.println("creating new BasicCache, size 2");
BasicCache cache = new BasicCache(2);
System.out.println("setting 1:A");
cache.set("1", "A");
System.out.println("getting 1, result: " + cache.get("1"));
System.out.println("setting 2:B");
cache.set("2", "B");
System.out.println("getting 1, result: " + cache.get("1"));
System.out.println("getting 2, result: " + cache.get("2"));
System.out.println("setting 3:C");
cache.set("3", "C");
System.out.println("getting 1, result: " + cache.get("1"));
System.out.println("getting 2, result: " + cache.get("2"));
System.out.println("getting 3, result: " + cache.get("3"));
System.out.println();
}
}