Examples of Department


Examples of org.crank.crud.test.model.Department

  @Test (groups="reads", dependsOnGroups="createsObjectInDB")
  public void testLazy() {
    List<Department> departments = departmentDao.find();
    assert departments.size() > 0;
    Department department = departments.get(0);
    assert department != null;
    List<Employee> employees = department.getEmployees();
    assert employees.size() > 0;
  }
View Full Code Here

Examples of org.crank.crud.test.model.Department

        string);

    Employee employee = new Employee();
    employee.setFirstName("Ric");
    employee.setAge(0);
    Department department = new Department();
    department.setName("Eng");
    employee.setDepartment(department);
    group = like(employee).excludeProperty("employees").excludeProperty(
        "numberOfPromotions");
    string = CriteriaUtils.constructWhereClauseString(group, false);
    AssertJUnit
View Full Code Here

Examples of org.crank.crud.test.model.Department

    employee.setFirstName("Ric%");
    employee.setLastName("High%");
    employee.setAge(40);
    employee.setActive(true);
    employee.setNumberOfPromotions(1);
    Department department = new Department();
    department.setName("Eng%");
    employee.setDepartment(department);
    employeeDao.find(like(employee)
        .excludeProperty("employees").excludeProperty("tasks"));
//    AssertJUnit.assertTrue(employees.size() > 0);
View Full Code Here

Examples of org.crank.crud.test.model.Department

  public void testReadFully() {
   
    Employee employee = employeeDao.readPopulated(testEmployees.get(0).getId());
    AssertJUnit.assertNotNull(employee);

    Department dept = (Department) departmentDao.readPopulated(1L);
    AssertJUnit.assertNotNull(dept);
  }
View Full Code Here

Examples of org.crank.crud.test.model.Department

  }

  @Test (groups="reads", dependsOnGroups="createsObjectInDB")
    public void testEntityEquals () {
        Department department = departmentDao.merge(new Department("r&d"));
        department = departmentDao.read(department.getId());
        Employee employee = new Employee("Rick", "Hightower");
        employee.setDepartment(department);
        department.getEmployees().add(employee);
        departmentDao.merge(department);
        List<Employee> find = employeeDao.find(eq("department", department));
        String firstname = find.get(0).getFirstName();
        AssertJUnit.assertEquals("Rick", firstname);
    }
View Full Code Here

Examples of org.dddlib.organisation.domain.Department

     * Test of createOrganization method, of class OrganisationApplication.
     */
    @Test
    public void testCreateOrganization() {
        System.out.println("createOrganization");
        Organization orgToCreate = new Department("dept");
        Organization parent = new Company("headquarter");
        Date date = DateUtils.date(2012, 1, 1);
        instance.createOrganization(orgToCreate, parent, date);
        assertThat(orgToCreate.getCreateDate(), is(date));
        verify(repository).save(orgToCreate);
        verify(repository).save(new OrgLineMgmt(parent, orgToCreate, date));
    }
View Full Code Here

Examples of org.drools.planner.examples.pas.domain.Department

            for (int i = 0; i < departmentListSize; i++) {
                String line = bufferedReader.readLine();
                String[] lineTokens = splitByPipeline(line, 2);

                String[] departmentTokens = splitBySpace(lineTokens[0], 4);
                Department department = new Department();
                department.setId(Long.parseLong(departmentTokens[0]));
                department.setName(departmentTokens[1]);
                int minimumAge = Integer.parseInt(departmentTokens[2]);
                if (minimumAge != 0) {
                    department.setMinimumAge(Integer.valueOf(minimumAge));
                }
                int maximumAge = Integer.parseInt(departmentTokens[3]);
                if (maximumAge != 0) {
                    department.setMaximumAge(Integer.valueOf(maximumAge));
                }
                departmentList.add(department);
                idToDepartmentMap.put(department.getId(), department);

                String[] departmentSpecialismTokens = splitBySpace(lineTokens[1]);
                if (departmentSpecialismTokens.length % 2 != 0) {
                    throw new IllegalArgumentException("Read line (" + line
                            + ") is expected to contain even number of tokens (" + departmentSpecialismTokens.length
View Full Code Here

Examples of org.fenixedu.academic.domain.Department

    public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws FenixActionException, FenixServiceException {
        final String departmentString = request.getParameter("departmentID");
        final String degreeString = request.getParameter("degreeID");
        final Department department = FenixFramework.getDomainObject(departmentString);
        final Degree degree = FenixFramework.getDomainObject(degreeString);
        RemoveDegreeFromDepartment.run(department, degree);
        final DepartmentDegreeBean departmentDegreeBean = new DepartmentDegreeBean();
        departmentDegreeBean.setDepartment(department);
        return forwardToPage(mapping, request, departmentDegreeBean);
View Full Code Here

Examples of org.hibernate.test.annotations.id.entities.Department

  }

  public void testMethodLevelGenerator() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();
    Department b = new Department();
    s.persist(b);
    tx.commit();
    s.close();
    assertNotNull(b.getId());

    s = openSession();
    tx = s.beginTransaction();
    s.delete(s.get(Department.class, b.getId()));
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.hibernate.test.annotations.id.sequences.entities.Department

  }

  public void testMethodLevelGenerator() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();
    Department b = new Department();
    s.persist( b );
    tx.commit();
    s.close();
    assertNotNull( b.getId() );

    s = openSession();
    tx = s.beginTransaction();
    s.delete( s.get( Department.class, b.getId() ) );
    tx.commit();
    s.close();
  }
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.