-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainclass.java
57 lines (46 loc) · 2.05 KB
/
mainclass.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
52
53
54
55
56
57
import chat.Chat;
import publications.*;
import java.io.IOException;
import java.util.TreeSet;
import LoaderDeloader.FileProcessing;
import javax.imageio.IIOException;
import java.io.IOException;
public class mainclass {
public static void main(String[] args) throws IOException {
FileProcessing.loadingData();
User user1 = new User("mostafa", "male","[email protected]", "pass",20,1,22,"12");
User user2 = new User("gamal", "male","[email protected]", "pass",20,1,22,"12");
User[] users = User.exportUsers();
user1.addPost("this is the first post by user 1", true); //0
user2.addPost("this is first post by user 2", true); //1
user1.addPost("this is second post by user 1", true); //2
Post[] user1Posts = user1.getPosts();
Post user1TestPost = user1Posts[0];
user1TestPost.addComment(user2.getId(), "thats a nice post");
user1TestPost.addComment(user2.getId(), "meshtashaaaaaat");
user1.sendFriendRequest(user2.getUserName());
user2.acceptFriendRequest(user1.getUserName());
TreeSet<Integer> treeSet = new TreeSet<>();
treeSet.add(0);
treeSet.add(1);
user1.startChat("test",treeSet);
Chat[]chat =User.exportChats();
Chat x= chat[chat.length-1];
x.addMessage(user1.getId(), "test test");
// FileProcessing.loadingData();
userinterface.logorregmenu();
// FileProcessing.exportData();
Comment[] user1TestPostComments = user1TestPost.getComments();
for(Comment comment : user1TestPostComments){
System.out.println(comment.getContent() + " publisher ID:" + comment.getPublisherId());
}
user1TestPostComments[0].addLike(user1.getId());
// user1TestPostComments[0].removeLike(user1.getId());
User[] likers = user1TestPostComments[0].getLikes();
for (User liker : likers){
System.out.println(liker.getUserName());
}
User user10 = new User("ali","m","@","23213",1,11,1111,"4523523525");
FileProcessing.exportData();
}
}