Examples of TypeDataVo


Examples of org.sete.vo.admin.TypeDataVo

        }
    }

    @Test
    public void testCorrectTypeIsLoaded() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.ScienceProjectCategoryType");
        input.setKey("chemistry");

        TypeDataVo output = service.loadTypeData(input);

        ScienceProjectCategoryType spct =
            (ScienceProjectCategoryType)TypeUtil.forKey(Class.forName(input.getClassName()),
                                                        input.getKey());

        assertEquals("Classnames should match.", output.getClassName(),
                     spct.getClass().getName());

        assertEquals("Keys should mtach.", output.getKey(), spct.getKey());
        assertEquals("Labels should match.", output.getLabel(), spct.getLabel());
        assertEquals("Descriptions should match.", output.getDescription(), spct.getDescription());
        assertEquals("Long Descriptions should match.", output.getLongDescription(), spct.getLongDescription());
    }
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        assertEquals("Long Descriptions should match.", output.getLongDescription(), spct.getLongDescription());
    }

    @Test
    public void testOnlyNonSignificantTypesCanBeCreated() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.UserRoleType");

        try {
            service.createType(input);
            fail("Should only be allowed to create Non-Significant Types.");
        }
        catch(IllegalStateException expected) {}

        input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.ScienceProjectCategoryType");
        input.setLabel("Chemistry2");
        input.setKey("chemistry2");

        try {
            service.createType(input);
        }
        catch(IllegalStateException notExpected) {
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        }
    }

    @Test
    public void testDuplicateTypesNotAllowedToBeCreated() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.ScienceProjectCategoryType");
        input.setLabel("Chemistry");

        try {
            service.createType(input);
            fail("Cannot create duplicate Types.");
        }
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        catch(BusinessRuleException expected) {}
    }

    @Test
    public void testCannotDeleteSignificantTypes() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.UserRoleType");
        input.setKey(UserRoleType.Key.ADMIN_KEY.getKey());

        try {
            service.deleteType(input);
            fail("Cannot delete Significant Types.");
        }
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        catch(IllegalStateException expected) {}
    }

    @Test
    public void testCanDeleteNonSignificantTypes() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.ScienceProjectCategoryType");
        input.setKey("chemistry");

        try {
            service.deleteType(input);
        }
        catch(IllegalStateException notExpected) {
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        }
    }

    @Test
    public void testCannotUpdateLabelForSignificantTypes() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.UserRoleType");
        input.setKey(UserRoleType.Key.ADMIN_KEY.getKey());
        input.setLabel("somethingDifferent");

        try {
            service.updateType(input);
            fail("Cannot update the Label of a Significant Type since it generates a new Key.");
        }
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        catch(BusinessRuleException expected) {}
    }

    @Test
    public void testCanUpdateSignificantTypesIfLabelNotChanged() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.UserRoleType");
        input.setKey(UserRoleType.Key.ADMIN_KEY.getKey());
        input.setLabel("ADMIN Label");
        input.setDescription("somethingDifferent");
        input.setLongDescription("somethingDifferent");

        try {
            service.updateType(input);
        }
        catch(BusinessRuleException notExpected) {
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        }
    }

    @Test
    public void testCannotUpdateNonSignificantTypesIfLabelDuplicate() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.ScienceProjectCategoryType");
        input.setKey("chemistry");
        input.setLabel("Biology");

        try {
            service.updateType(input);
            fail("You should be not able to update a Non-Significant Type if the " +
                 "Label already exists.");
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

        catch(BusinessRuleException expected) {}
    }

    @Test
    public void testCanUpdateNonSignificantTypesIfLabelNotDuplicate() throws Exception {
        TypeDataVo input = new TypeDataVo();
        input.setClassName("org.sete.domain.type.ScienceProjectCategoryType");
        input.setKey("chemistry");
        input.setLabel("NothingSpecial");

        try {
            service.updateType(input);
        }
        catch(BusinessRuleException notExpected) {
View Full Code Here

Examples of org.sete.vo.admin.TypeDataVo

                                      HttpServletResponse response) throws Exception {

        checkAuthorization(doAuthorization(request));

        SystemTypesService svc = getService(SystemTypesService.class);
        TypeDataVo typeVo = svc.loadTypeData(populateTypeDateVo(form));
        BeanUtils.copyProperties(form, typeVo);

        return mapping.findForward(WebConstants.FORWARD_VIEW);
    }
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.