"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "genericsresolver-guava/src/test/java/org/apache/tapestry5/internal/genericsresolverguava/AbstractBeanModelSourceImplTest.java" between
apache-tapestry-5.7.1-sources.zip and apache-tapestry-5.7.2-sources.zip

About: Apache Tapestry is a framework for creating dynamic, robust, highly scalable web applications in Java. Source code.

AbstractBeanModelSourceImplTest.java  (apache-tapestry-5.7.1-sources):AbstractBeanModelSourceImplTest.java  (apache-tapestry-5.7.2-sources)
package org.apache.tapestry5.internal.genericsresolverguava; package org.apache.tapestry5.genericsresolverguava.internal;
//Copyright 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation //Copyright 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation
// //
//Licensed under the Apache License, Version 2.0 (the "License"); //Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License. //you may not use this file except in compliance with the License.
//You may obtain a copy of the License at //You may obtain a copy of the License at
// //
//http://www.apache.org/licenses/LICENSE-2.0 //http://www.apache.org/licenses/LICENSE-2.0
// //
//Unless required by applicable law or agreed to in writing, software //Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS, //distributed under the License is distributed on an "AS IS" BASIS,
skipping to change at line 70 skipping to change at line 70
BeanModel model = source.create(SimpleBean.class, true, messages); BeanModel model = source.create(SimpleBean.class, true, messages);
assertSame(model.getBeanType(), SimpleBean.class); assertSame(model.getBeanType(), SimpleBean.class);
// Based on order of the getter methods (no longer alphabetical) // Based on order of the getter methods (no longer alphabetical)
assertEquals(model.getPropertyNames(), Arrays.asList("firstName", "lastName ", "age")); assertEquals(model.getPropertyNames(), Arrays.asList("firstName", "lastName ", "age"));
assertEquals(model.toString(), assertEquals(model.toString(),
"BeanModel[org.apache.tapestry5.internal.genericsresolverguava.Simp leBean properties:firstName, lastName, age]"); "BeanModel[org.apache.tapestry5.genericsresolverguava.internal.Simp leBean properties:firstName, lastName, age]");
PropertyModel age = model.get("age"); PropertyModel age = model.get("age");
assertEquals(age.getLabel(), "Age"); assertEquals(age.getLabel(), "Age");
assertSame(age.getPropertyType(), int.class); assertSame(age.getPropertyType(), int.class);
assertEquals(age.getDataType(), "number"); assertEquals(age.getDataType(), "number");
PropertyModel firstName = model.get("firstName"); PropertyModel firstName = model.get("firstName");
assertEquals(firstName.getLabel(), "First Name"); assertEquals(firstName.getLabel(), "First Name");
skipping to change at line 302 skipping to change at line 302
BeanModel model = source.create(SimpleBean.class, true, messages); BeanModel model = source.create(SimpleBean.class, true, messages);
try try
{ {
model.add("age"); model.add("age");
unreachable(); unreachable();
} catch (RuntimeException ex) } catch (RuntimeException ex)
{ {
assertEquals( assertEquals(
ex.getMessage(), ex.getMessage(),
"Bean editor model for org.apache.tapestry5.internal.genericsre solverguava.SimpleBean already contains a property model for property \'age\'.") ; "Bean editor model for org.apache.tapestry5.genericsresolvergua va.internal.SimpleBean already contains a property model for property \'age\'.") ;
} }
verify(); verify();
} }
@Test @Test
public void unknown_property_name() public void unknown_property_name()
{ {
Messages messages = mockMessages(); Messages messages = mockMessages();
skipping to change at line 327 skipping to change at line 327
BeanModel model = source.create(SimpleBean.class, true, messages); BeanModel model = source.create(SimpleBean.class, true, messages);
try try
{ {
model.get("frobozz"); model.get("frobozz");
unreachable(); unreachable();
} catch (UnknownValueException ex) } catch (UnknownValueException ex)
{ {
assertEquals( assertEquals(
ex.getMessage(), ex.getMessage(),
"Bean editor model for org.apache.tapestry5.internal.genericsre solverguava.SimpleBean does not contain a property named \'frobozz\'."); "Bean editor model for org.apache.tapestry5.genericsresolvergua va.internal.SimpleBean does not contain a property named \'frobozz\'.");
assertListsEquals(ex.getAvailableValues().getValues(), "age", "firstNam e", "lastName"); assertListsEquals(ex.getAvailableValues().getValues(), "age", "firstNam e", "lastName");
} }
verify(); verify();
} }
@Test @Test
public void unknown_property_id() public void unknown_property_id()
{ {
skipping to change at line 356 skipping to change at line 356
model.addEmpty("shrub.foo()"); model.addEmpty("shrub.foo()");
try try
{ {
model.getById("frobozz"); model.getById("frobozz");
unreachable(); unreachable();
} catch (UnknownValueException ex) } catch (UnknownValueException ex)
{ {
assertEquals( assertEquals(
ex.getMessage(), ex.getMessage(),
"Bean editor model for org.apache.tapestry5.internal.genericsre solverguava.SimpleBean does not contain a property with id \'frobozz\'."); "Bean editor model for org.apache.tapestry5.genericsresolvergua va.internal.SimpleBean does not contain a property with id \'frobozz\'.");
assertListsEquals(ex.getAvailableValues().getValues(), "age", "firstNam e", "lastName", "shrubfoo"); assertListsEquals(ex.getAvailableValues().getValues(), "age", "firstNam e", "lastName", "shrubfoo");
} }
verify(); verify();
} }
@Test @Test
public void get_added_property_by_name() public void get_added_property_by_name()
{ {
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)