Change By: Tobias Mattsson (21/May/13 8:27 PM)
Description: The following test case fails:

A property of type Integer with value 123 is to be changed to a String with value 'newValue'

{code}
    @Test
    public void testUpdatePropertyValueAndType() throws Exception {

        // GIVEN
        Node node = session.getRootNode();
        node.setProperty(propertyName, 123);
        JcrPropertyAdapter adapter = new JcrPropertyAdapter(node.getProperty(propertyName));

        // WHEN
        adapter.getItemProperty(JcrPropertyAdapter.TYPE_PROPERTY).setValue("String");
        adapter.getItemProperty(JcrPropertyAdapter.VALUE_PROPERTY).setValue("newValue");
        adapter.applyChanges();

        // THEN
        assertTrue(node.hasProperty(propertyName));
        assertEquals(PropertyType.STRING, node.getProperty(propertyName).getType());
        assertEquals("newValue", node.getProperty(propertyName).getString());
    }
{code}

The failure is a ClassCastException in DefaultProperty that was added in MGNLUI-565

{code}
com.vaadin.data.util.converter.Converter$ConversionException: Cannot convert class java.lang.String to class java.lang.Long
at info.magnolia.ui.vaadin.integration.jcr.DefaultProperty.setValue(DefaultProperty.java:69)
at info.magnolia.ui.vaadin.integration.jcr.JcrPropertyAdapterTest.testUpdatePropertyValueAndType(JcrPropertyAdapterTest.java:360)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{code}



This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to