-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtreetester.java
More file actions
75 lines (58 loc) · 3.32 KB
/
treetester.java
File metadata and controls
75 lines (58 loc) · 3.32 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import Utilities.FileUtils;
public class treetester {
protected static String fileName = "andrew.txt";
protected static String folderName = "andrewfolder";
protected static String content = "Hello World!";
public static void main (String[] args) throws Exception {
//Blob test = new Blob("example.txt");
/*
Tree test1 = new Tree();
test1.initialize();
String input1 = "blob : 732d12f7e4f2e629e2954acbb720c32c0be985d1 : file1";
String input2 = "tree : bd1ccec139dead5ee0d8c3a0499b42a7d43ac44b";
String input3 = "blob : 81e0268c84067377a0a1fdfb5cc996c93f6dcf9f : file2.txt";
String input4 = "blob : 01d82591292494afd1602d175e165f94992f6f5f : file2";
String input5 = "tree : e7d79898d3342fd15daf6ec36f4cb095b52fd976";
System.out.println("\nADDED? " + test1.addTree(input1));
System.out.println("\nADDED? " + test1.addTree(input2));
System.out.println("\nADDED? " + test1.addTree(input2));
System.out.println("\nADDED? " + test1.addTree(input3));
System.out.println("\nADDED? " + test1.addTree(input4));
System.out.println("\nADDED? " + test1.addTree(input5));
//System.out.println("\nREMOVED? " + test1.deleteTree("file2.txt"));
System.out.println("\nREMOVED? " + test1.deleteTree("file1"));
//System.out.println("\nREMOVED? " + test1.deleteTree("bd1ccec139dead5ee0d8c3a0499b42a7d43ac44b"));//RIGHT, it removed the tree
//System.out.println("\nREMOVED? " + test1.deleteTree("tree : e7d79898d3342fd15d"));
*/
oldTree2 test1 = new oldTree2();
test1.initialize();
String input1 = "blob : 732d12f7e4f2e629e2954acbb720c32c0be985d1 : file1";
String input2 = "tree : bd1ccec139dead5ee0d8c3a0499b42a7d43ac44b";
String input3 = "blob : 81e0268c84067377a0a1fdfb5cc996c93f6dcf9f : file2.txt";
String input4 = "blob : 01d82591292494afd1602d175e165f94992f6f5f : file2";
String input5 = "tree : e7d79898d3342fd15daf6ec36f4cb095b52fd976";
System.out.println("\nADDED? " + test1.addTree(input1));
System.out.println("\nADDED? " + test1.addTree(input2));
System.out.println("\nADDED? " + test1.addTree(input2));
System.out.println("\nADDED? " + test1.addTree(input3));
System.out.println("\nADDED? " + test1.addTree(input4));
System.out.println("\nADDED? " + test1.addTree(input5));
//System.out.println("\nREMOVED? " + test1.deleteTree("file2.txt"));
//System.out.println("\nREMOVED? " + test1.deleteTree("file1"));
//System.out.println("\nREMOVED? " + test1.deleteTree("bd1ccec139dead5ee0d8c3a0499b42a7d43ac44b"));//RIGHT, it removed the tree
System.out.println("\nREMOVED? " + test1.deleteTree("tree : e7d79898d3342fd15d"));
test1.saveToObjects();
System.out.println("hi");
FileUtils.createFile(fileName);
FileUtils.createDirectory(folderName);
/*FileUtils.writeFile(fileName, content);
String content = FileUtils.readFile(fileName);
String sha = FileUtils.sha1(content);
FileUtils.deleteFile(fileName);
FileUtils.deleteDirectory(folderName);
FileUtils.fileExists(fileName);*/
System.out.println("hHIHIHHIHIHIHI");
}
}