Package net.stinfoservices.pacifiq.server.model

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


            DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
            IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/uzer-update_aftersave.xml")
                    .openStream());
            Uzer uzer = new Uzer();
            Uzer nuzer;
            Program program = new Program();
            Profile profile = new Profile();
            Set<Program> programsWithConsultationRights = new HashSet<Program>();
            Set<Program> programsWithEditionRights = new HashSet<Program>();

            program.setId(1L);
            program.setName(PROGRAM_NAME);
            program.setVersion(1);
            profile.setId(1L);
            profile.setAdministrator(false);
            profile.setLicensesConsultation(false);
            profile.setLicensesEdition(false);
            profile.setProgramsConsultation(false);
            profile.setProgramsEdition(false);
            profile.setName(PROFILE_NAME);
            profile.setVersion(1);
            uzer.setId(1L);
            uzer.setEmail(UPDATED_USER_EMAIL);
            uzer.setName(USER_NAME);
            uzer.setFirstname(USER_FIRSTNAME);
            uzer.setProfile(profile);
            programsWithConsultationRights.add(program);
            uzer.getProgramsWithConsultationRights().addAll(programsWithConsultationRights);
            programsWithEditionRights.add(program);
            uzer.getProgramsWithEditionRights().addAll(programsWithEditionRights);
            uzer.setVersion(1);
            nuzer = uzerDAO.save(uzer);
            assertNotNull(nuzer);
            assertEquals(nuzer.getEmail(), uzer.getEmail());
            entityManager.getTransaction().commit();
            // programsWithConsultationRights and programsWithEditionRights are many-to-many relationships
            // whenever they are set, both users and programs are updated
            program.setVersion(2);
            DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
                    connection.createDataSet(expectedDataSet.getTableNames()));
            connection.close();
        } catch (DatabaseUnitException e) {
            e.printStackTrace();
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 {
        Uzer uzer = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();
        Set<Program> programsWithConsultationRights = new HashSet<Program>();
        Set<Program> programsWithEditionRights = new HashSet<Program>();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
View Full Code Here

    @DatabaseSetup(value = UPDATE_DATASET)
    @ExpectedDatabase(value = EMPTY_DATASET, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = EMPTY_DATASET, type = DatabaseOperation.DELETE)
    public void testRemove2() throws Exception {
        Uzer uzer = new Uzer();
        Program program = new Program();
        Profile profile = new Profile();
        Set<Program> programsWithConsultationRights = new HashSet<Program>();
        Set<Program> programsWithEditionRights = new HashSet<Program>();

        program.setId(1L);
        program.setName(PROGRAM_NAME);
        program.setVersion(1);
        profile.setId(1L);
        profile.setAdministrator(false);
        profile.setLicensesConsultation(false);
        profile.setLicensesEdition(false);
        profile.setProgramsConsultation(false);
View Full Code Here

TOP

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

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.