Package org.dddlib.organisation.utils

Examples of org.dddlib.organisation.utils.OrganisationUtils


public class EmploymentTest extends AbstractIntegrationTest {

    @Test
    public final void testGetEmployer() {
        OrganisationUtils organisationUtils = new OrganisationUtils();
        Date date = DateUtils.date(2012, 1, 3);
        Company company = organisationUtils.createCompany("总公司", date);
        Person zhang = organisationUtils.createPerson("三", "张");
        Employee zhangsan = organisationUtils.createEmployee(zhang, date);
        Person li = organisationUtils.createPerson("四", "李");
        Employee lisi = organisationUtils.createEmployee(li, date);
        new Employment(company, zhangsan, date).save();
        assertThat("张三的雇主应该是company",
                Employment.getEmployer(zhangsan, DateUtils.date(2012, 1, 3)),
                is(company));
        assertThat("李四的雇主不是company",
View Full Code Here


public class LineMgmtTest extends AbstractIntegrationTest {

  @Test
  public final void testFindResponsiblesOfOrganization() {
    OrganisationUtils organisationUtils = new OrganisationUtils();
    Date date = DateUtils.date(2012, 1, 3);
    Company company = organisationUtils.createCompany("总公司", date);
    Department financial = organisationUtils.createDepartment("财务部", date);
    OrgLineMgmt lineMgmt = new OrgLineMgmt(company, financial, date);
    lineMgmt.save();
    System.out.println(OrgLineMgmt.findAll().size());
    assertTrue(OrgLineMgmt.findAll().contains(lineMgmt));
    assertTrue(OrgLineMgmt.findChildrenOfOrganization(company, date).contains(financial));
View Full Code Here

public class AccountabilityTest extends AbstractIntegrationTest {

    @SuppressWarnings("rawtypes")
    @Test
    public final void testFindAccountabilities() {
        OrganisationUtils organisationUtils = new OrganisationUtils();
        Date date = DateUtils.date(2012, 1, 3);
        Company company = organisationUtils.createCompany("总公司", date);
        Department financial = organisationUtils.createDepartment("财务部", company, date);
        Person person = organisationUtils.createPerson("Martin", "Fowler");
        Employee employee = organisationUtils.createEmployee(person, date);
        Employment employment = new Employment(company, employee, date);
        employment.save();
        List<Accountability> results = Accountability.findAccountabilities(Accountability.class, date);
        // 断言找到所有的子类实例。
        OrgLineMgmt lineMgmt = OrgLineMgmt.getByResponsible(financial, date);
View Full Code Here

TOP

Related Classes of org.dddlib.organisation.utils.OrganisationUtils

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.