[ https://issues.apache.org/jira/browse/TUSCANY-1393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kelvin Goodson resolved TUSCANY-1393. ------------------------------------- Resolution: Fixed Thanks for the fix Ron. > ClassCastException saving codegen-based DataGraph with ChangeSummary > containing an xsd:int > ------------------------------------------------------------------------------------------ > > Key: TUSCANY-1393 > URL: https://issues.apache.org/jira/browse/TUSCANY-1393 > Project: Tuscany > Issue Type: Bug > Components: Java SDO Implementation > Affects Versions: Java-SDO-Next > Reporter: Ron Gavlin > Priority: Critical > Attachments: sdo-TUSCANY-1393.patch > > > Please add the following test case to > sdo\tools\src\test\java\org\apache\tuscany\sdo\test\ChangeSummaryGenTestCase.java. > The new test method currently generates a ClassCastException when an Integer > is expected and a Double is provided. I have listed the stacktrace below: > > public void testChangeSummaryOnDataGraphWithInt() throws Exception { > > HelperContext hc = HelperProvider.getDefaultContext(); > CustomerFactory factory = CustomerFactory.INSTANCE; > factory.register(hc); > Customer customer = factory.createCustomer(); > Account account = factory.createAccount(); > customer.setAccount(account); > DataObject customerDO = (DataObject) customer; > DataGraph dg = SDOUtil.createDataGraph(); > SDOUtil.setRootObject(dg, customerDO); > dg.getChangeSummary().beginLogging(); > dg.getRootObject().getDataObject(0).delete(); > ByteArrayOutputStream baos = new ByteArrayOutputStream(); > SDOUtil.saveDataGraph(dg, baos, null); > } > > testChangeSummaryOnDataGraphWithInt(org.apache.tuscany.sdo.test.ChangeSummaryGenTestCase) > java.lang.ClassCastException: java.lang.Double > at > org.apache.tuscany.sdo.model.impl.ModelFactoryImpl.convertIntToString(ModelFactoryImpl.java:2079) > at > org.apache.tuscany.sdo.model.impl.ModelFactoryImpl.convertToString(ModelFactoryImpl.java:321) > at > org.apache.tuscany.sdo.impl.FactoryBase$SDOEFactoryImpl.convertToString(FactoryBase.java:284) > at > org.eclipse.emf.ecore.util.EcoreUtil.convertToString(EcoreUtil.java:2994) > at > org.eclipse.emf.ecore.change.impl.FeatureChangeImpl.getDataValue(FeatureChangeImpl.java:228) > at > org.eclipse.emf.ecore.change.impl.FeatureChangeImpl.eIsSet(FeatureChangeImpl.java:771) > at > org.eclipse.emf.ecore.impl.BasicEObjectImpl.eIsSet(BasicEObjectImpl.java:818) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1107) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2462) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1036) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:922) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2182) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1390) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2462) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1036) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:922) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2182) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1390) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2462) > at > org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:620) > at > org.apache.tuscany.sdo.util.DataGraphResourceFactoryImpl$DataGraphResourceImpl$SaveImpl.traverse(DataGraphResourceFactoryImpl.java:382) > at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:233) > at > org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:203) > at > org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:993) > at > org.apache.tuscany.sdo.helper.SDOHelperImpl.saveDataGraph(SDOHelperImpl.java:201) > at org.apache.tuscany.sdo.api.SDOUtil.saveDataGraph(SDOUtil.java:158) > at > org.apache.tuscany.sdo.test.ChangeSummaryGenTestCase.testChangeSummaryOnDataGraphWithInt(ChangeSummaryGenTestCase.java:128) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]