isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1031609 - in /incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit: AbstractTest.java SaveObjectsTest.java ViewObjectTest.java
Date Fri, 05 Nov 2010 14:58:59 GMT
Author: danhaywood
Date: Fri Nov  5 14:58:59 2010
New Revision: 1031609

URL: http://svn.apache.org/viewvc?rev=1031609&view=rev
Log:
fixes for junit viewer

Modified:
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ViewObjectTest.java

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java?rev=1031609&r1=1031608&r2=1031609&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java
(original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java
Fri Nov  5 14:58:59 2010
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
+package org.apache.isis.viewer.junit;
 
-package org.apache.isis.viewer.junit;
-
 import org.apache.isis.applib.DomainObjectContainer;
 import org.apache.isis.progmodel.wrapper.applib.WrapperFactory;
-import org.apache.isis.progmodel.wrapper.applib.listeners.InteractionListener;
 import org.apache.isis.viewer.junit.sample.domain.Country;
 import org.apache.isis.viewer.junit.sample.domain.Customer;
 import org.apache.isis.viewer.junit.sample.domain.Product;
@@ -37,118 +35,98 @@ import org.apache.isis.viewer.junit.samp
 import org.junit.After;
 import org.junit.Before;
 import org.junit.runner.RunWith;
-
-
-@RunWith(IsisTestRunner.class)
-@Fixtures({
-	@Fixture(CountriesFixture.class),
-	@Fixture(ProductsFixture.class),
-	@Fixture(CustomersFixture.class),
-	@Fixture(CustomerOrdersFixture.class)
-})
-@Services({
-	@Service(CountryRepository.class),
-	@Service(ProductRepository.class),
-	@Service(CustomerRepository.class),
-	@Service(OrderRepository.class)
-})
-public abstract class AbstractTest {
-
-    protected Customer custJsDO;
-    protected Customer custJsVO;
-
-    protected Product product355DO;
-    protected Product product355VO;
-
-    protected Product product850DO;
-
-    protected Country countryGbrDO;
-    protected Country countryGbrVO;
-
-    protected Country countryUsaDO;
-    protected Country countryAusDO;
-
-    private ProductRepository productRepository;
-    private CustomerRepository customerRepository;
-    private CountryRepository countryRepository;
-
-    private DomainObjectContainer domainObjectContainer;
-    private WrapperFactory wrapperFactory;
-
-    private InteractionListener interactionListener;
-
-    @Before
-    public void setUp() {
-
-        product355DO = productRepository.findByCode("355-40311");
-        product355VO = wrapperFactory.wrap(product355DO);
-        product850DO = productRepository.findByCode("850-18003");
-
-        countryGbrDO = countryRepository.findByCode("GBR");
-        countryGbrVO = wrapperFactory.wrap(countryGbrDO);
-
-        countryUsaDO = countryRepository.findByCode("USA");
-        countryAusDO = countryRepository.findByCode("AUS");
-
-        custJsDO = customerRepository.findByName("Pawson");
-        custJsVO = wrapperFactory.wrap(custJsDO);
-    }
-
-    @After
-    public void tearDown() {
-    }
-
-    protected InteractionListener getInteractionListener() {
-        return interactionListener;
-    }
-
-
-    ////////////////////////////////////////////////////////
-    // Injected.
-    ////////////////////////////////////////////////////////
-
-    protected WrapperFactory getWrapperFactory() {
-        return wrapperFactory;
-    }
-    public void setWrapperFactory(WrapperFactory headlessViewer) {
-    	this.wrapperFactory = headlessViewer;
-    }
-
-    protected DomainObjectContainer getDomainObjectContainer() {
-        return domainObjectContainer;
-    }
-
-    public void setDomainObjectContainer(final DomainObjectContainer domainObjectContainer)
{
-        this.domainObjectContainer = domainObjectContainer;
-    }
-
-
-    protected ProductRepository getProductRepository() {
-        return productRepository;
-    }
-
-    public void setProductRepository(final ProductRepository productRepository) {
-        this.productRepository = productRepository;
-    }
-
-    protected CustomerRepository getCustomerRepository() {
-        return customerRepository;
-    }
-
-    public void setCustomerRepository(final CustomerRepository customerRepository) {
-        this.customerRepository = customerRepository;
-    }
-
-    protected CountryRepository getCountryRepository() {
-        return countryRepository;
-    }
-
-    public void setCountryRepository(final CountryRepository countryRepository) {
-        this.countryRepository = countryRepository;
-    }
-
-
-
-
-
-}
+
+@RunWith(IsisTestRunner.class)
+@Fixtures({ @Fixture(CountriesFixture.class), @Fixture(ProductsFixture.class), @Fixture(CustomersFixture.class),
+    @Fixture(CustomerOrdersFixture.class) })
+@Services({ @Service(CountryRepository.class), @Service(ProductRepository.class), @Service(CustomerRepository.class),
+    @Service(OrderRepository.class) })
+public abstract class AbstractTest {
+
+    protected Customer custJsDO;
+    protected Customer custJsVO;
+
+    protected Product product355DO;
+    protected Product product355VO;
+
+    protected Product product850DO;
+
+    protected Country countryGbrDO;
+    protected Country countryGbrVO;
+
+    protected Country countryUsaDO;
+    protected Country countryAusDO;
+
+    private ProductRepository productRepository;
+    private CustomerRepository customerRepository;
+    private CountryRepository countryRepository;
+
+    private DomainObjectContainer domainObjectContainer;
+    private WrapperFactory wrapperFactory;
+
+    @Before
+    public void setUp() {
+
+        product355DO = productRepository.findByCode("355-40311");
+        product355VO = wrapperFactory.wrap(product355DO);
+        product850DO = productRepository.findByCode("850-18003");
+
+        countryGbrDO = countryRepository.findByCode("GBR");
+        countryGbrVO = wrapperFactory.wrap(countryGbrDO);
+
+        countryUsaDO = countryRepository.findByCode("USA");
+        countryAusDO = countryRepository.findByCode("AUS");
+
+        custJsDO = customerRepository.findByName("Pawson");
+        custJsVO = wrapperFactory.wrap(custJsDO);
+    }
+
+    @After
+    public void tearDown() {
+    }
+
+    // //////////////////////////////////////////////////////
+    // Injected.
+    // //////////////////////////////////////////////////////
+
+    protected WrapperFactory getWrapperFactory() {
+        return wrapperFactory;
+    }
+
+    public void setWrapperFactory(WrapperFactory headlessViewer) {
+        this.wrapperFactory = headlessViewer;
+    }
+
+    protected DomainObjectContainer getDomainObjectContainer() {
+        return domainObjectContainer;
+    }
+
+    public void setDomainObjectContainer(final DomainObjectContainer domainObjectContainer)
{
+        this.domainObjectContainer = domainObjectContainer;
+    }
+
+    protected ProductRepository getProductRepository() {
+        return productRepository;
+    }
+
+    public void setProductRepository(final ProductRepository productRepository) {
+        this.productRepository = productRepository;
+    }
+
+    protected CustomerRepository getCustomerRepository() {
+        return customerRepository;
+    }
+
+    public void setCustomerRepository(final CustomerRepository customerRepository) {
+        this.customerRepository = customerRepository;
+    }
+
+    protected CountryRepository getCountryRepository() {
+        return countryRepository;
+    }
+
+    public void setCountryRepository(final CountryRepository countryRepository) {
+        this.countryRepository = countryRepository;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java?rev=1031609&r1=1031608&r2=1031609&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java
(original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java
Fri Nov  5 14:58:59 2010
@@ -28,15 +28,15 @@ import static org.junit.Assert.fail;
 
 import org.apache.isis.metamodel.facets.object.validate.ValidateObjectFacetViaValidateMethod;
 import org.apache.isis.progmodel.wrapper.applib.InvalidException;
-import org.apache.isis.progmodel.wrapper.applib.WrappedObject;
+import org.apache.isis.progmodel.wrapper.applib.WrapperObject;
 import org.apache.isis.viewer.junit.sample.domain.Customer;
 import org.junit.Test;
 
 public class SaveObjectsTest extends AbstractTest {
 
 	@SuppressWarnings("unchecked")
-	private WrappedObject<Customer> asViewObject(final Customer proxiedNewCustomer) {
-		return (WrappedObject<Customer>) proxiedNewCustomer;
+	private WrapperObject<Customer> asViewObject(final Customer proxiedNewCustomer) {
+		return (WrapperObject<Customer>) proxiedNewCustomer;
 	}
 
 	@Test
@@ -51,7 +51,7 @@ public class SaveObjectsTest extends Abs
 		newCustomerViewObject.setMaxLengthField("abc");
 		newCustomerViewObject.setRegExCaseInsensitiveField("ABCd");
 		newCustomerViewObject.setRegExCaseSensitiveField("abcd");
-		final WrappedObject<Customer> proxyNewCustomer = asViewObject(newCustomerViewObject);
+		final WrapperObject<Customer> proxyNewCustomer = asViewObject(newCustomerViewObject);
 		proxyNewCustomer.save();
 		assertThat(getDomainObjectContainer().isPersistent(newCustomer),
 				is(true));
@@ -70,7 +70,7 @@ public class SaveObjectsTest extends Abs
 
 		assertThat(getDomainObjectContainer().isPersistent(custJsDO), is(true));
 
-		final WrappedObject<Customer> proxyNewCustomer = asViewObject(custJsVO);
+		final WrapperObject<Customer> proxyNewCustomer = asViewObject(custJsVO);
 		proxyNewCustomer.save();
 
 		assertThat(getDomainObjectContainer().isPersistent(custJsDO), is(true));
@@ -92,7 +92,7 @@ public class SaveObjectsTest extends Abs
 		final Customer newCustomerViewObject = getWrapperFactory().wrap(newCustomer);
 		newCustomer.validate = "No shakes";
 
-		final WrappedObject<Customer> proxyNewCustomer = asViewObject(newCustomerViewObject);
+		final WrapperObject<Customer> proxyNewCustomer = asViewObject(newCustomerViewObject);
 		try {
 			assertThat(getDomainObjectContainer().isPersistent(newCustomer),
 					is(false));

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ViewObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ViewObjectTest.java?rev=1031609&r1=1031608&r2=1031609&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ViewObjectTest.java
(original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ViewObjectTest.java
Fri Nov  5 14:58:59 2010
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertTha
 
 import java.util.List;
 
-import org.apache.isis.progmodel.wrapper.applib.WrappedObject;
+import org.apache.isis.progmodel.wrapper.applib.WrapperObject;
 import org.apache.isis.viewer.junit.sample.domain.Country;
 import org.apache.isis.viewer.junit.sample.domain.Customer;
 import org.junit.Test;
@@ -36,14 +36,14 @@ import org.junit.Test;
 public class ViewObjectTest extends AbstractTest {
 
     @SuppressWarnings("unchecked")
-    private WrappedObject<Customer> asViewObject() {
-        return (WrappedObject<Customer>) custJsVO;
+    private WrapperObject<Customer> asViewObject() {
+        return (WrapperObject<Customer>) custJsVO;
     }
 
 	@Test
     public void canCastViewsToViewObject() {
         @SuppressWarnings("unused")
-        final WrappedObject<Customer> custRpVOAsViewObject = asViewObject();
+        final WrapperObject<Customer> custRpVOAsViewObject = asViewObject();
     }
 
     @Test
@@ -79,7 +79,7 @@ public class ViewObjectTest extends Abst
         custJsDO.addToVisitedCountries(countryGbrDO);
         custJsDO.addToVisitedCountries(countryUsaDO);
         final List<Country> visitedCountries = custJsVO.getVisitedCountries();
-        assertThat(visitedCountries instanceof WrappedObject, is(true));
+        assertThat(visitedCountries instanceof WrapperObject, is(true));
     }
 
     @Test



Mime
View raw message