Package net.stinfoservices.pacifiq.server.model

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


     */
    @Test
    @DatabaseSetup(value = UPDATESPECIFIC_DATASET)
    @DatabaseTearDown(value = UPDATESPECIFIC_DATASET, type = DatabaseOperation.DELETE)
    public void testFindSpecific() throws Exception {
        AbstractTAA taa = taaDAO.find(1L);
        SpecificTAA taac = new SpecificTAA();

        taac.setId(1L);
        taac.setLicenseNumber(UPDATED_LICENSENUMBER);
        taac.setVersion(2);
        assertNotNull(taa);
        assertSame(2, taa.getVersion());
        assertEquals(taac.getLicenseNumber(), taa.getLicenseNumber());
        assertEquals(taac, taa);
        assertNull(taaDAO.find(2L));
        assertNull(taaDAO.find(0L));
    }
View Full Code Here


        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/taa-create1_no-id.xml")
                    .openStream());
            GenericTAA taa = new GenericTAA();
            AbstractTAA ntaa;

            taa.setId(null);
            taa.setLicenseNumber(DEFAULT_LICENSENUMBER);
            taa.setVersion(1);
            ntaa = taaDAO.save(taa);
            assertEquals(ntaa.getLicenseNumber(), taa.getLicenseNumber());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

    public void testSave2() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource(UPDATEGENERIC_DATASET).openStream());
            GenericTAA taa = new GenericTAA();
            AbstractTAA ntaa;

            taa.setId(1L);
            taa.setLicenseNumber(UPDATED_LICENSENUMBER);
            taa.setVersion(1);
            ntaa = taaDAO.save(taa);
            assertEquals(ntaa.getLicenseNumber(), taa.getLicenseNumber());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/taa-create2_no-id.xml")
                    .openStream());
            SpecificTAA taa = new SpecificTAA();
            AbstractTAA ntaa;

            taa.setId(null);
            taa.setLicenseNumber(DEFAULT_LICENSENUMBER);
            taa.setVersion(1);
            ntaa = taaDAO.save(taa);
            assertEquals(ntaa.getLicenseNumber(), taa.getLicenseNumber());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

    public void testSaveSpecific2() throws Exception {
        try {
            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource(UPDATESPECIFIC_DATASET).openStream());
            SpecificTAA taa = new SpecificTAA();
            AbstractTAA ntaa;

            taa.setId(1L);
            taa.setLicenseNumber(UPDATED_LICENSENUMBER);
            taa.setVersion(1);
            ntaa = taaDAO.save(taa);
            assertEquals(ntaa.getLicenseNumber(), taa.getLicenseNumber());
            entityManager.getTransaction().commit();
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
View Full Code Here

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

        try {
            AbstractTAA t = entityManager.merge(taa);

            entityManager.persist(t);
            t = entityManager.find(AbstractTAA.class, t.getId());
            LOGGER.info(MessageFormat.format(ResourceBundle.getBundle("system").getString("OBJECT_WLN_SAVED"), this.getClass().getSimpleName(),
                    t.getLicenseNumber() + "-" + t.getVersionNumber()));

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

        if (taa == null) {
            return;
        }

        try {
            AbstractTAA ntaa = entityManager.merge(taa);

            entityManager.remove(ntaa);
            LOGGER.info(MessageFormat.format(ResourceBundle.getBundle("system").getString("OBJECT_WLN_DELETED"), this.getClass().getSimpleName(),
                    ntaa.getLicenseNumber() + "-" + ntaa.getVersionNumber()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

        HSSFSheet worksheet = workbook.createSheet(getResourceBundle().getString("MAIN_WORKSHEET"));

        if ((objects != null) && !(objects.isEmpty())) {
            int lineNumber = 0;
            for (Object o : objects) {
                AbstractTAA taa = (AbstractTAA) o;

                // index from 0,0... cell A1 is cell(0,0)
                HSSFRow row1 = worksheet.createRow(lineNumber);

                HSSFCell cellA1 = row1.createCell(0);
                cellA1.setCellValue(getResourceBundle().getString("TAA_LICENSE_NUMBER"));
                HSSFCellStyle cellStyle = workbook.createCellStyle();
                cellStyle.setFillForegroundColor(HSSFColor.CORAL.index);
                cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
                cellA1.setCellStyle(cellStyle);

                HSSFCell cellB1 = row1.createCell(1);
                cellB1.setCellValue(getResourceBundle().getString("TAA_VERSION_NUMBER"));
                cellStyle = workbook.createCellStyle();
                cellStyle.setFillForegroundColor(HSSFColor.AQUA.index);
                cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
                cellB1.setCellStyle(cellStyle);

                HSSFRow row2 = worksheet.createRow(++lineNumber);

                HSSFCell cellA2 = row2.createCell(0);
                cellA2.setCellValue(taa.getLicenseNumber());

                HSSFCell cellB2 = row2.createCell(1);
                cellB2.setCellValue(taa.getVersionNumber());

                lineNumber = lineNumber + 2;
            }
        }
    }
View Full Code Here

    @DatabaseSetup(value = DATASET_DOCUMENT_TAA)
    @ExpectedDatabase(value = DATASET_DOCUMENT_TAA, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = DATASET_DOCUMENT_TAA, type = DatabaseOperation.DELETE)
    @Test
    public void testClone() throws Exception {
        AbstractTAA taa = taaDAO.find(1L);
        assertNotNull(taa);
        assertTrue(taa instanceof GenericTAA);
        GenericTAA gTAA = (GenericTAA) taa;

        TAADTO gTaaDocument = new TAADTO(gTAA, DTOPath.TAA_DOC);
View Full Code Here

                    } else if ("DSP5".equals(type)) {
                        DSP5 dsp5 = dsp5DAO.find(Long.parseLong(id));
                        // DSP5 dsp5 = DSP5.findDSP5(Long.parseLong(id));
                        list.add(dsp5);
                    } else if ("TAA".equals(type)) {
                        AbstractTAA taa = taaDAO.find(Long.parseLong(id));
                        list.add(taa);
                    } else if ("Program".equals(type)) {
                        Program program = programDAO.find(Long.parseLong(id));
                        list.add(program);
                    }
View Full Code Here

TOP

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

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.