Package org.apache.isis.core.integtestsupport.legacy.sample.domain

Examples of org.apache.isis.core.integtestsupport.legacy.sample.domain.Customer


        return (WrapperObject) proxiedNewCustomer;
    }

    @Test
    public void invokingSaveThroughProxyMakesTransientObjectPersistent() {
        final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));
        final Customer newCustomerVO = getWrapperFactory().wrap(newCustomer);
        newCustomerVO.setCustomerNumber(123);
        newCustomerVO.setFirstNameMandatory("Joe");
        newCustomerVO.setLastName("Smith");
        newCustomerVO.setMandatoryAssociation(countryGbrDO);
        newCustomerVO.setCountryOfBirthMandatory(countryGbrDO);
        newCustomerVO.setMandatoryValue("foo");
        newCustomerVO.setMaxLengthField("abc");
        newCustomerVO.setRegExCaseInsensitiveField("ABCd");
        newCustomerVO.setRegExCaseSensitiveField("abcd");
        final WrapperObject proxyNewCustomer = asWrapperObject(newCustomerVO);
        proxyNewCustomer.save();
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(true));
    }
View Full Code Here


        assertThat(getDomainObjectContainer().isPersistent(custJsDO), is(true));
    }

    @Test
    public void whenValidateMethodThenCanVetoSave() {
        final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);

        // just to get into valid state
        newCustomer.setCustomerNumber(123);
        newCustomer.setFirstNameMandatory("Joe");
        newCustomer.setLastName("Smith");
        newCustomer.setCountryOfBirthMandatory(countryGbrDO);
        newCustomer.setMandatoryAssociation(countryGbrDO);
        newCustomer.setMandatoryValue("foo");
        newCustomer.setMaxLengthField("abc");
        newCustomer.setRegExCaseInsensitiveField("ABCd");
        newCustomer.setRegExCaseSensitiveField("abcd");

        final Customer newCustomerWO = getWrapperFactory().wrap(newCustomer);
        newCustomer.validate = "No shakes";

        final WrapperObject newCustomerWrapper = asWrapperObject(newCustomerWO);
        try {
            assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));
View Full Code Here

        return (WrapperObject) proxiedNewCustomer;
    }

    @Test
    public void invokingSaveThroughProxyMakesTransientObjectPersistent() {
        final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));
        final Customer newCustomerVO = getWrapperFactory().wrap(newCustomer);
        newCustomerVO.setCustomerNumber(123);
        newCustomerVO.setLastName("Smith");
        newCustomerVO.setMandatoryAssociation(countryGbrDO);
        newCustomerVO.setMandatoryValue("foo");
        newCustomerVO.setMaxLengthField("abc");
        newCustomerVO.setRegExCaseInsensitiveField("ABCd");
        newCustomerVO.setRegExCaseSensitiveField("abcd");
        final WrapperObject proxyNewCustomer = asWrapperObject(newCustomerVO);
        proxyNewCustomer.save();
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(true));
    }
View Full Code Here

        assertThat(getDomainObjectContainer().isPersistent(custJsDO), is(true));
    }

    @Test
    public void whenValidateMethodThenCanVetoSave() {
        final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);

        // just to get into valid state
        newCustomer.setCustomerNumber(123);
        newCustomer.setLastName("Smith");
        newCustomer.setMandatoryAssociation(countryGbrDO);
        newCustomer.setMandatoryValue("foo");
        newCustomer.setMaxLengthField("abc");
        newCustomer.setRegExCaseInsensitiveField("ABCd");
        newCustomer.setRegExCaseSensitiveField("abcd");

        final Customer newCustomerWO = getWrapperFactory().wrap(newCustomer);
        newCustomer.validate = "No shakes";

        final WrapperObject newCustomerWrapper = asWrapperObject(newCustomerWO);
        try {
            assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));
View Full Code Here

TOP

Related Classes of org.apache.isis.core.integtestsupport.legacy.sample.domain.Customer

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.