Package net.sf.pmr.messageBoards.domain

Examples of net.sf.pmr.messageBoards.domain.Message


        super.tearDown();
    }

    public final void testFindByIdWithMessageFound() throws Exception {

        Message message = (Message) messageMapper.findById(1);

        // to test Date
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy hh:mm");
        Date date = dateFormat.parse("01/01/2001 13:24");

        assertEquals("id", 1, message.getId());
        assertEquals(
                "content",
                "les cl�s de bagnole est vraiement un excellent film malgr�s une ou deux longueurs. Il est unique !",
                message.getContent());
        assertEquals("topic title", "les cl�s de bagnole", message.getTopic()
                .getTitle());
        assertTrue("postedBy", message.getPostedBy() instanceof User);
        assertEquals("postedDate", date, message.getPostedDate());
        assertEquals("version", 1, message.getPersistanceVersion());

    }
View Full Code Here


    }

    public final void testFindByIdWithoutMessageFound() {

        Message message = (Message) messageMapper.findById(999);

        assertEquals("message", null, message);
    }
View Full Code Here

        // topic
        Topic topic = new TopicImpl();
        topic.setTitle("my title");

        // create a message idem to the one in the database
        Message message = new MessageImpl();
        message.setBoard(board);
        message.setTopic(topic);
        message.setPostedBy(user);

        // to test Date
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy hh:mm");
        Date date = dateFormat.parse("01/01/2001 13:24");

        message.setPostedDate(date);
        message.setContent("super movie! great work");
        message.setPersistanceVersion(1);

        messageMapper.addOrUpdate(message);

        // check
        String query = "select * from MESSAGE where CONTENT='super movie! great work'";
View Full Code Here

TOP

Related Classes of net.sf.pmr.messageBoards.domain.Message

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.