Examples of IEmployee


Examples of employee.IEmployee

    }

    @Test
    public void getSatisfaction_shouldReturnLowWhenSalaryIsBelowAverage() {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.ONE);
        //when
        final Answer satisfaction = instance.getSatisfaction(employee);
        //then
        assertThat(satisfaction).isEqualTo(Answer.BAD);
    }
View Full Code Here

Examples of employee.IEmployee

    }

    @Test
    public void getSatisfaction_shouldReturnHighWhenSalaryIsEqualOrOverAverage() {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.valueOf(10000));
        //when
        final Answer satisfaction = instance.getSatisfaction(employee);
        //then
        assertThat(satisfaction).isEqualTo(Answer.FINE);
    }
View Full Code Here

Examples of org.apache.jdo.tck.pc.company.IEmployee

     * do not refer to each other.
     */
    public void testA2BbutNotB2AMapped() {
        testMethod = "testA2BbutNotB2AMapped";
        if (isTestToBePerformed) {
            IEmployee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams",
                new Date(0L), new Date(10000L), 125000);
            pm.makePersistent(empNew);
            emp1.setMedicalInsurance(medIns2);
            medIns2.setEmployee(empNew);
            doFlush(testMethod);
View Full Code Here

Examples of org.apache.jdo.tck.pc.company.IEmployee

    public void testReplaceFromMappedSide() {
        testMethod = "testReplaceFromMappedSide";
        if (isTestToBePerformed) {
           
            // Set relationship
            IEmployee empNew = new FullTimeEmployee(100, "Jerry", "Valentine",
                    "Brown", new Date(500L), new Date(10000L), 125000);
            pm.makePersistent(empNew);
            Set members = new HashSet();
            members.add(empNew);
            proj1.setMembers(members);
            Object empNewOid = pm.getObjectId((Object)empNew);
            pm.flush();

            // Postcondition

            deferredAssertTrue(empNew.getProjects().contains(proj1),
                    ASSERTION_FAILED + testMethod,
                    "Postcondition is false; "
                    + "other side of relationship not set on flush");
            pm.currentTransaction().commit();
            cleanupPM();
            getPM();
           
            pm.currentTransaction().begin();
            empNew = (IEmployee)pm.getObjectById(empNewOid);
            emp1 = (Employee)pm.getObjectById(emp1Oid);
            proj1 = (Project)pm.getObjectById(proj1Oid);
            deferredAssertTrue(empNew.getProjects().contains(proj1),
                    ASSERTION_FAILED + testMethod,
                    "Postcondition is false; "
                    + "other side of relationship not set in new pm");
            pm.currentTransaction().commit();
           
View Full Code Here

Examples of org.apache.jdo.tck.pc.company.IEmployee

    public void testSetToNewFromMappedSide() {
        testMethod = "testSetToNewFromMappedSide";
        if (isTestToBePerformed) {
           
            // Set relationship
            IEmployee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams",
                new Date(0L), new Date(10000L), 125000);
            pm.makePersistent(empNew);
            medIns1.setEmployee(empNew);
            Object empNewOid = pm.getObjectId((Object)empNew);
            pm.flush();
           
            assertFalse(testMethod + ": Test aborted, precondition is false; " +
                "expected empNewOid to be non-null", empNewOid == null);
           
            // Postcondition
            deferredAssertTrue(empNew.getMedicalInsurance() == medIns1,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "other side of relationship not set on flush");
            deferredAssertTrue(emp1.getMedicalInsurance() == null,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "previous relationship (emp1) not nulled on flush");
           
            pm.currentTransaction().commit();
            cleanupPM();
            getPM();
           
            pm.currentTransaction().begin();
            emp1 = (IEmployee)pm.getObjectById(emp1Oid);
            empNew = (IEmployee)pm.getObjectById(empNewOid);
            medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid);
            deferredAssertTrue(empNew.getMedicalInsurance() == medIns1,
                ASSERTION_FAILED + testMethod,
                "Postcondition is false; "
                + "other side of relationship not set in new pm");
            deferredAssertTrue(emp1.getMedicalInsurance() == null,
                ASSERTION_FAILED + testMethod,
View Full Code Here

Examples of org.apache.jdo.tck.pc.company.IEmployee

    public void testReplaceFromMappedSide() {
        testMethod = "testReplaceFromMappedSide";
        if (isTestToBePerformed) {
           
            // Set relationship
            IEmployee empNew = new FullTimeEmployee(100, "Jerry", "Valentine",
                    "Brown", new Date(500L), new Date(10000L), 125000);
            pm.makePersistent(empNew);
            Set<IEmployee> members = new HashSet<IEmployee>();
            members.add(empNew);
            proj1.setMembers(members);
            Object empNewOid = pm.getObjectId((Object)empNew);
            pm.flush();

            // Postcondition

            deferredAssertTrue(empNew.getProjects().contains(proj1),
                    ASSERTION_FAILED + testMethod,
                    "Postcondition is false; "
                    + "other side of relationship not set on flush");
            pm.currentTransaction().commit();
            cleanupPM();
            getPM();
           
            pm.currentTransaction().begin();
            empNew = (IEmployee)pm.getObjectById(empNewOid);
            emp1 = (Employee)pm.getObjectById(emp1Oid);
            proj1 = (Project)pm.getObjectById(proj1Oid);
            deferredAssertTrue(empNew.getProjects().contains(proj1),
                    ASSERTION_FAILED + testMethod,
                    "Postcondition is false; "
                    + "other side of relationship not set in new pm");
            pm.currentTransaction().commit();
           
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.delayed.IEmployee

    public void testPostDetach() {
        EntityManager em = emf.createEntityManager();
       
        // Create a new department and an employee
        IDepartment d = createDepartment();
        IEmployee e = createEmployee();
        e.setDept(d);
        e.setEmpName("John");
        Collection<IEmployee> emps = createEmployees();
        emps.add(e);
        d.setEmployees(emps);
       
        em.getTransaction().begin();
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.delayed.IEmployee

    public void testPostDetach() {
        EntityManager em = emf.createEntityManager();
       
        // Create a new department and an employee
        IDepartment d = createDepartment();
        IEmployee e = createEmployee();
        e.setDept(d);
        e.setEmpName("John");
        Collection<IEmployee> emps = createEmployees();
        emps.add(e);
        d.setEmployees(emps);
       
        em.getTransaction().begin();
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.delayed.IEmployee

    public void testPostDetach() {
        EntityManager em = emf.createEntityManager();
       
        // Create a new department and an employee
        IDepartment d = createDepartment();
        IEmployee e = createEmployee();
        e.setDept(d);
        e.setEmpName("John");
        Collection<IEmployee> emps = createEmployees();
        emps.add(e);
        d.setEmployees(emps);
       
        em.getTransaction().begin();
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.delayed.IEmployee

    public void testPostDetach() {
        EntityManager em = emf.createEntityManager();
       
        // Create a new department and an employee
        IDepartment d = createDepartment();
        IEmployee e = createEmployee();
        e.setDept(d);
        e.setEmpName("John");
        Collection<IEmployee> emps = createEmployees();
        emps.add(e);
        d.setEmployees(emps);
       
        em.getTransaction().begin();
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.