diff --git a/src/main/java/tests/TestBeans.java b/src/main/java/tests/TestBeans.java new file mode 100644 index 0000000000000000000000000000000000000000..dbc59ef2d7e411be04481f1d20bbcd3f4ac44fea --- /dev/null +++ b/src/main/java/tests/TestBeans.java @@ -0,0 +1,58 @@ +package tests; + +import beans.Comment; +import beans.Post; +import beans.Web_user; +import java.util.Date; + +/** + * + * @author Axel L. + */ +public class TestBeans { + + public static void main(String[] args) { + System.out.println("-- TESTS BEANS --"); + + // USERS + Web_user bob = new Web_user(2, "bob@test.fr", "azerty", null, "bob31"); + Web_user stacy = new Web_user(3, "stacy@skate.fr", "azerty", null, "stacy12"); + + // POST + Post ollie = new Post(); + ollie.setId(2); + ollie.setTitle("Mon premier Ollie"); + ollie.setDescription("ollie ollie ollie energie"); + ollie.setDatePost(new Date()); + ollie.setVideoUrl("ollie.avi"); + ollie.setScore(67); + ollie.setAuthor(bob); + + // COMMENT + Comment comment = new Comment(); + comment.setId(1); + comment.setContent("Trop cool le Ollie"); + comment.setDatePublish(new Date()); + comment.setStatutComment(1); + comment.setAuthor(stacy); + comment.setPost(ollie); + + // AFFICHAGE + System.out.println("-- USERS --"); + System.out.println(bob); + System.out.println(stacy); + + System.out.println("-- POST --"); + System.out.println(ollie); + + System.out.println("-- COMMENT --"); + System.out.println(comment); + + // ASSOCIATIONS + System.out.println("-- TEST ASSOCIATION -- "); + System.out.println("Auteur du commentaire : " + comment.getAuthor().getUsername()); + System.out.println("Commentaire posté sur la vidéo : " + comment.getPost().getTitle()); + System.out.println("Auteur de la vidéo : " + comment.getPost().getAuthor().getUsername()); + + } +}