-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainTestArrayStorage.java
More file actions
47 lines (37 loc) · 1.26 KB
/
MainTestArrayStorage.java
File metadata and controls
47 lines (37 loc) · 1.26 KB
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
package com.urise.webapp;
import com.urise.webapp.model.Resume;
import com.urise.webapp.storage.ArrayStorage;
/**
* Test for your com.urise.webapp.storage.ArrayStorage implementation
*/
public class MainTestArrayStorage {
static final ArrayStorage ARRAY_STORAGE = new ArrayStorage();
public static void main(String[] args) {
Resume r1 = new Resume();
// r1.setUuid("uuid1");
Resume r2 = new Resume();
// r2.setUuid("uuid2");
Resume r3 = new Resume();
// r3.setUuid("uuid3");
ARRAY_STORAGE.save(r1);
ARRAY_STORAGE.save(r2);
ARRAY_STORAGE.save(r3);
System.out.println("Get r1: " + ARRAY_STORAGE.get(r1.getUuid()));
System.out.println("Size: " + ARRAY_STORAGE.size());
Resume r4 = new Resume();
// r4.setUuid("dummy");
System.out.println("Get dummy: " + ARRAY_STORAGE.get(r4.getUuid()));
printAll();
ARRAY_STORAGE.delete(r1.getUuid());
printAll();
ARRAY_STORAGE.clear();
printAll();
System.out.println("Size: " + ARRAY_STORAGE.size());
}
static void printAll() {
System.out.println("\nGet All");
for (Resume r : ARRAY_STORAGE.getAllSorted()) {
System.out.println(r);
}
}
}