@@ -0,0 +1,3191 @@
+package nl.fontys.sofa.limo.orientdb.dao;%0A%0Aimport java.util.List;%0Aimport static junit.framework.Assert.assertEquals;%0Aimport static junit.framework.Assert.assertFalse;%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static junit.framework.Assert.assertNull;%0Aimport static junit.framework.Assert.assertTrue;%0Aimport nl.fontys.sofa.limo.api.dao.EventDAO;%0Aimport nl.fontys.sofa.limo.domain.component.Event;%0Aimport nl.fontys.sofa.limo.orientdb.database.OrientDBDAOFactory;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.netbeans.junit.NbTestCase;%0A%0Apublic class OrientDBEventDAOTest extends NbTestCase %7B%0A%0A    private EventDAO eventDAO;%0A%0A    public OrientDBEventDAOTest(String testCase) %7B%0A        super(testCase);%0A    %7D%0A%0A    @Before%0A    @Override%0A    public void setUp() %7B%0A        OrientDBDAOFactory orientDBDAOFactory = new OrientDBDAOFactory();%0A        eventDAO = orientDBDAOFactory.getEventDAO();%0A    %7D%0A%0A    @After%0A    @Override%0A    public void tearDown() %7B%0A        eventDAO = null;%0A    %7D%0A%0A    /**%0A     * Test of findAll method, of class OrientDBEventDAO.%0A     */%0A    @Test%0A    public void testFindAll() %7B%0A        List%3CEvent%3E events = eventDAO.findAll();%0A        assertTrue(events.isEmpty());%0A    %7D%0A%0A    /**%0A     * Test of findById method, of class OrientDBEventDAO.%0A     */%0A    @Test%0A    public void testFindById() %7B%0A        Event event = eventDAO.findById(%22%22);%0A        assertNull(event);%0A        event = eventDAO.findById(%2238129803980%22);%0A        assertNull(event);%0A    %7D%0A%0A    /**%0A     * Test of insert method, of class OrientDBEventDAO.%0A     */%0A    @Test%0A    public void testInsert() %7B%0A        Event event = new Event(%22pirates%22);%0A        eventDAO.insert(event);%0A        List%3CEvent%3E events = eventDAO.findAll();%0A        assertEquals(1, events.size());%0A        Event foundEvent = eventDAO.findById(%221%22);%0A        assertEquals(event, foundEvent);%0A    %7D%0A%0A    /**%0A     * Test of update method, of class OrientDBEventDAO.%0A     */%0A    @Test%0A    public void testUpdate() %7B%0A        String newEventName = %22pirate attack%22;%0A        Event event = new Event(%22pirates%22);%0A        boolean updateSuccess = eventDAO.update(event);%0A        assertFalse(updateSuccess);%0A        eventDAO.insert(event);%0A        event = eventDAO.findById(%221%22);%0A        event.setIdentifier(newEventName);%0A        updateSuccess = eventDAO.update(event);%0A        assertTrue(updateSuccess);%0A        event = eventDAO.findById(%221%22);%0A        assertEquals(newEventName, event.getIdentifier());%0A    %7D%0A%0A    /**%0A     * Test of delete method, of class OrientDBEventDAO.%0A     */%0A    @Test%0A    public void testDelete() %7B%0A        boolean deleteSuccess = eventDAO.delete(%22%22);%0A        assertFalse(deleteSuccess);%0A        deleteSuccess = eventDAO.delete(%22798319203%22);%0A        assertFalse(deleteSuccess);%0A        Event event = new Event(%22pirates%22);%0A        eventDAO.insert(event);%0A        deleteSuccess = eventDAO.delete(%221%22);%0A        assertTrue(deleteSuccess);%0A    %7D%0A%0A    /**%0A     * Test of getTableName method, of class OrientDBEventDAO.%0A     */%0A    @Test%0A    public void testGetTableName() %7B%0A        assertNotNull(eventDAO.getTableName());%0A        assertFalse(eventDAO.getTableName().isEmpty());%0A    %7D%0A%0A%7D%0A

add orientdbevent test