Package net.stinfoservices.pacifiq.server.model

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


    @DatabaseSetup(value = UPDATE_DATASET)
    @ExpectedDatabase(value = EMPTY_DATASET, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    public void testRemove2() throws Exception {
        DSP5 dsp5 = new DSP5();
        ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();
        BusinessPartner bp = new BusinessPartner();
        Set<ConcreteBusinessPartner> consignees = new HashSet<ConcreteBusinessPartner>();

        bp.setId(1L);
        bp.setName(BUSINESSPARTNER_NAME);
        bp.setVersion(1);
        cbp.setId(1L);
        cbp.setCountry(CONCRETEBUSINESSPARTNER_COUNTRY);
        cbp.setBusinessPartner(bp);
        cbp.setVersion(1);
        consignees.add(cbp);
        dsp5.setId(1L);
        dsp5.setLicenseNumber(UPDATED_LICENSE_NUMBER);
        dsp5.setApplicant(cbp);
        dsp5.setEndUser(cbp);
View Full Code Here


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

        try {
            ConcreteBusinessPartner p = entityManager.merge(cbp);

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

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

        if (cbp == null) {
            return;
        }

        try {
            ConcreteBusinessPartner ncbp = entityManager.merge(cbp);

            entityManager.remove(ncbp);
            // ConcreteBusinessPartner are lazy written
            // so this function is never used, so no log4j-database is needed here
        } catch (Exception ex) {
View Full Code Here

    @Test
    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFind() throws Exception {
        ConcreteBusinessPartner cbp = cbpDAO.find(1L);
        BusinessPartner bp = new BusinessPartner();
        ConcreteBusinessPartner cbpc = new ConcreteBusinessPartner();

        cbpc.setId(1L);
        cbpc.setAddress(UPDATED_ADDRESS);
        cbpc.setCountry(COUNTRY);
        cbpc.setVersion(2);
        bp.setId(1L);
        bp.setName(BUSINESSPARTNER_NAME);
        bp.setVersion(1);
        cbpc.setBusinessPartner(bp);
        assertNotNull(cbp);
        assertEquals(UPDATED_ADDRESS, cbp.getAddress());
        assertEquals(COUNTRY, cbp.getCountry());
        assertEquals(cbpc, cbp);
        assertSame(2, cbp.getVersion());
View Full Code Here

    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFindAll() throws Exception {
        List<ConcreteBusinessPartner> cbps = cbpDAO.findAll();
        BusinessPartner bp = new BusinessPartner();
        ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();

        cbp.setId(1L);
        cbp.setAddress(UPDATED_ADDRESS);
        cbp.setCountry(COUNTRY);
        cbp.setVersion(2);
        bp.setId(1L);
        bp.setName(BUSINESSPARTNER_NAME);
        bp.setVersion(1);
        cbp.setBusinessPartner(bp);
        assertSame(1, cbps.size());
        assertNotNull(cbps.get(0));
        assertEquals(cbps.get(0), cbp);
    }
View Full Code Here

    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testFindEntries() throws Exception {
        List<ConcreteBusinessPartner> cbps = cbpDAO.findEntries(0, 1);
        BusinessPartner bp = new BusinessPartner();
        ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();

        assertSame(1, cbps.size());
        assertNotNull(cbps.get(0));
        cbp.setId(1L);
        cbp.setAddress(UPDATED_ADDRESS);
        cbp.setCountry(COUNTRY);
        cbp.setVersion(2);
        bp.setId(1L);
        bp.setName(BUSINESSPARTNER_NAME);
        bp.setVersion(1);
        cbp.setBusinessPartner(bp);
        assertEquals(cbps.get(0), cbp);
        cbps = cbpDAO.findEntries(0, 0);
        assertSame(0, cbps.size());
    }
View Full Code Here

    @Test
    @DatabaseSetup(value = UPDATE_DATASET)
    @DatabaseTearDown(value = UPDATE_DATASET, type = DatabaseOperation.DELETE)
    public void testFindBusinessPartner() throws Exception {
        BusinessPartner bp = new BusinessPartner();
        ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();

        cbp.setId(1L);
        cbp.setAddress(UPDATED_ADDRESS);
        cbp.setCountry(COUNTRY);
        cbp.setVersion(2);
        bp.setId(1L);
        bp.setName(BUSINESSPARTNER_NAME);
        bp.setVersion(1);
        cbp.setBusinessPartner(bp);
        assertEquals(bp, cbpDAO.findBusinessPartner(cbp.getId()));
    }
View Full Code Here

    public void testSave() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass()
                    .getResource("/dbunit/dao/admin/concretebusinesspartner-create_no-id.xml").openStream());
            ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();
            ConcreteBusinessPartner ncbp;
            BusinessPartner bp = new BusinessPartner();

            cbp.setId(null);
            cbp.setAddress("");
            cbp.setCountry(COUNTRY);
            bp.setId(1L);
            bp.setName(BUSINESSPARTNER_NAME);
            bp.setVersion(1);
            cbp.setBusinessPartner(bp);
            cbp.setVersion(1);
            ncbp = cbpDAO.save(cbp);
            assertEquals(ncbp.getAddress(), cbp.getAddress());
            assertEquals(ncbp.getCountry(), cbp.getCountry());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

    @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());
            ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();
            ConcreteBusinessPartner ncbp;
            BusinessPartner bp = new BusinessPartner();

            cbp.setId(1L);
            cbp.setAddress(UPDATED_ADDRESS);
            cbp.setCountry(COUNTRY);
            bp.setId(1L);
            bp.setName(BUSINESSPARTNER_NAME);
            bp.setVersion(1);
            cbp.setBusinessPartner(bp);
            cbp.setVersion(1);
            ncbp = cbpDAO.save(cbp);
            assertEquals(cbp.getAddress(), ncbp.getAddress());
            assertEquals(cbp.getCountry(), ncbp.getCountry());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

    @ExpectedDatabase(value = EMPTY_DATASET, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    @Override
    public void testRemove() throws Exception {
        BusinessPartner bp = new BusinessPartner();
        ConcreteBusinessPartner cbp = new ConcreteBusinessPartner();

        cbp.setId(1L);
        cbp.setAddress(UPDATED_ADDRESS);
        cbp.setCountry(COUNTRY);
        cbp.setVersion(1);
        bp.setId(1L);
        bp.setName(BUSINESSPARTNER_NAME);
        bp.setVersion(1);
        cbp.setBusinessPartner(bp);
        cbpDAO.remove(cbp);
    }
View Full Code Here

TOP

Related Classes of net.stinfoservices.pacifiq.server.model.ConcreteBusinessPartner

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.