Examples of TCN


Examples of net.stinfoservices.pacifiq.server.model.TCN

        taa.getTcn().clear();
        if (dto.getTcns() != null) {
            for (TCNDTO tcnDTO : dto.getTcns()) {
                // cannot determinate here a versionNumber change...tcnDAO.find(tcnDTO.getId());
                TCN tcn = new TCN();
                applyDiffTCN(tcn, tcnDTO);
                taa.getTcn().add(tcn);
            }
        }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    @Test
    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFind() throws Exception {
        TCN tcn = tcnDAO.find(1L);
        TCN tcnc = new TCN();

        tcnc.setId(1L);
        tcnc.setFreeText(UPDATED_FREETEXT);
        tcnc.setVersion(2);
        assertNotNull(tcn);
        assertEquals(tcnc.getFreeText(), tcn.getFreeText());
        assertSame(2, tcn.getVersion());
        assertEquals(tcnc, tcn);
        assertNull(tcnDAO.find(2L));
        assertNull(tcnDAO.find(0L));
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFindAll() throws Exception {
        List<TCN> tcns = tcnDAO.findAll();
        TCN tcn = new TCN();

        tcn.setId(1L);
        tcn.setFreeText(UPDATED_FREETEXT);
        tcn.setVersion(2);
        assertSame(1, tcns.size());
        assertNotNull(tcns.get(0));
        assertEquals(tcns.get(0), tcn);
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFindEntries() throws Exception {
        List<TCN> tcns = tcnDAO.findEntries(0, 1);
        TCN tcn = new TCN();

        tcn.setId(1L);
        tcn.setFreeText(UPDATED_FREETEXT);
        tcn.setVersion(2);
        assertSame(1, tcns.size());
        assertNotNull(tcns.get(0));
        assertEquals(tcns.get(0), tcn);
        tcns = tcnDAO.findEntries(0, 0);
        assertSame(0, tcns.size());
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    public void testSave() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/tcn-create_no-id.xml")
                    .openStream());
            TCN tcn = new TCN();
            TCN ntcn;

            tcn.setId(null);
            tcn.setFreeText(DEFAULT_FREETEXT);
            tcn.setVersion(1);
            ntcn = tcnDAO.save(tcn);
            assertEquals(ntcn.getFreeText(), tcn.getFreeText());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE_ALL)
    public void testSave2() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource(UPDATE_DATASET).openStream());
            TCN tcn = new TCN();
            TCN ntcn;

            tcn.setId(1L);
            tcn.setFreeText(UPDATED_FREETEXT);
            tcn.setVersion(1);
            ntcn = tcnDAO.save(tcn);
            assertEquals(ntcn.getFreeText(), tcn.getFreeText());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    @DatabaseSetup(value = CREATE_DATASET)
    @ExpectedDatabase(value = EMPTY_DATASET, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testRemove() throws Exception {
        TCN tcn = new TCN();

        tcn.setId(1L);
        tcn.setFreeText(DEFAULT_FREETEXT);
        tcn.setVersion(1);
        tcnDAO.remove(tcn);
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

    @Test
    @DatabaseSetup(value = UPDATE_DATASET)
    @ExpectedDatabase(value = EMPTY_DATASET, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    public void testRemove2() throws Exception {
        TCN tcn = new TCN();

        tcn.setId(1L);
        tcn.setFreeText(UPDATED_FREETEXT);
        tcn.setVersion(2);
        tcnDAO.remove(tcn);
    }
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

        if (tcn == null) {
            return (null);
        }

        try {
            TCN t = entityManager.merge(tcn);

            entityManager.persist(t);
            t = entityManager.find(TCN.class, t.getId());
            // TCN are lazy written (program.tcns)
            // so this function is never used, so no log4j-database is needed here

            return (t);
        } catch (Exception ex) {
View Full Code Here

Examples of net.stinfoservices.pacifiq.server.model.TCN

        if (tcn == null) {
            return;
        }

        try {
            TCN ntcn = entityManager.merge(tcn);

            entityManager.remove(ntcn);
            // TCN are lazy written (program.tcns)
            // so this function is never used, so no log4j-database is needed here
        } catch (Exception ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.