Anytype emf 2.3 versus emf 2.4M6 [message #418227] |
Mon, 07 April 2008 08:24  |
Eclipse User |
|
|
|
Hi Ed,
I get an exception when running one of my testcases against emf 2.4M6, this worked fine for the
emf2.4M5 release and also works for emf2.3. It is related to anytype and checking which efeatures
are allowed for an anytype. Here is a snippet of the xsd:
<!-- base type -->
<xs:complexType name="testAny">
<xs:sequence>
<xs:any maxOccurs="unbounded" namespace="##other"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="B">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
When I then do this:
testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(), "my b");
Then I get the exception below. I debugged and its seems to check if the namespace of the B.name
feature corresponds to the namespace of the any feature, however the namespace of the B.name feature
is null.
java.lang.RuntimeException: Invalid entry feature 'B.name'
at org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
at org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
at org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
at org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
at org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
at org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
at org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
at junit.framework.TestCase.runBare(TestCase.java:130)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
|
Re: Anytype emf 2.3 versus emf 2.4M6 [message #418231 is a reply to message #418229] |
Mon, 07 April 2008 09:01   |
Eclipse User |
|
|
|
Hi Ed,
For my curiosity, why does the B.name feature not get the default namespace (why is it null)?
The top of the xsd is this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype">
gr. Martin
Ed Merks wrote:
> Martin,
>
> This is because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=224877
> which is related to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224874. It was brought to
> my attention that ##other doesn't allow the null namespace...
>
>
> Martin Taal wrote:
>> Hi Ed,
>> I get an exception when running one of my testcases against emf 2.4M6,
>> this worked fine for the emf2.4M5 release and also works for emf2.3.
>> It is related to anytype and checking which efeatures are allowed for
>> an anytype. Here is a snippet of the xsd:
>>
>> <!-- base type -->
>> <xs:complexType name="testAny">
>> <xs:sequence>
>> <xs:any maxOccurs="unbounded" namespace="##other"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> <xs:complexType name="B">
>> <xs:sequence>
>> <xs:element name="name" type="xs:string"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> When I then do this:
>> testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(),
>> "my b");
>>
>> Then I get the exception below. I debugged and its seems to check if
>> the namespace of the B.name feature corresponds to the namespace of
>> the any feature, however the namespace of the B.name feature is null.
>>
>> java.lang.RuntimeException: Invalid entry feature 'B.name'
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
>>
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
>>
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
>>
>> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
>>
>> at
>> org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
>> at
>> org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
>>
>> at
>> org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at junit.framework.TestCase.runTest(TestCase.java:164)
>> at
>> org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
>> at junit.framework.TestCase.runBare(TestCase.java:130)
>> 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:120)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at
>> org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
>>
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at
>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Anytype emf 2.3 versus emf 2.4M6 [message #418232 is a reply to message #418231] |
Mon, 07 April 2008 10:18  |
Eclipse User |
|
|
|
Martin,
You really ought to only be using global element declarations in
wildcards; those would be features of the document root and would
definitely have the namespace of the containing schema. By default,
elementFormDefault/form are "unqualified" so local element declarations
have null namespace.
Martin Taal wrote:
> Hi Ed,
> For my curiosity, why does the B.name feature not get the default
> namespace (why is it null)?
> The top of the xsd is this:
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
> targetNamespace=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype"
>
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>
> xmlns=" http://www.eclipse.org/emf/teneo/samples/emf/schemaconstruct s/anytype">
>
>
> gr. Martin
>
> Ed Merks wrote:
>> Martin,
>>
>> This is because of
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224877 which is related
>> to https://bugs.eclipse.org/bugs/show_bug.cgi?id=224874. It was
>> brought to my attention that ##other doesn't allow the null namespace...
>>
>>
>> Martin Taal wrote:
>>> Hi Ed,
>>> I get an exception when running one of my testcases against emf
>>> 2.4M6, this worked fine for the emf2.4M5 release and also works for
>>> emf2.3. It is related to anytype and checking which efeatures are
>>> allowed for an anytype. Here is a snippet of the xsd:
>>>
>>> <!-- base type -->
>>> <xs:complexType name="testAny">
>>> <xs:sequence>
>>> <xs:any maxOccurs="unbounded" namespace="##other"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> <xs:complexType name="B">
>>> <xs:sequence>
>>> <xs:element name="name" type="xs:string"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> When I then do this:
>>>
>>> testAny.getAny().add(AnytypePackage.eINSTANCE.getB_Name(), "my b");
>>>
>>> Then I get the exception below. I debugged and its seems to check if
>>> the namespace of the B.name feature corresponds to the namespace of
>>> the any feature, however the namespace of the B.name feature is null.
>>>
>>> java.lang.RuntimeException: Invalid entry feature 'B.name'
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFea tureMap.java:93)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1523)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFe atureMap.java:1)
>>>
>>> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 26)
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatur eMap.java:522)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureM ap.java:1264)
>>>
>>> at
>>> org.eclipse.emf.teneo.test.emf.schemaconstructs.AnyTypeActio n.doAction(AnyTypeAction.java:91)
>>>
>>> at
>>> org.eclipse.emf.teneo.test.AbstractActionTest.testAction(Abs tractActionTest.java:71)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at junit.framework.TestCase.runTest(TestCase.java:164)
>>> at
>>> org.eclipse.emf.teneo.test.AbstractTest.runTest(AbstractTest .java:88)
>>> at junit.framework.TestCase.runBare(TestCase.java:130)
>>> 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:120)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>>> at junit.framework.TestSuite.run(TestSuite.java:225)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>>> at
>>> org.eclipse.emf.teneo.test.conf.ConfigurableTestSuite.runTes t(ConfigurableTestSuite.java:64)
>>>
>>> at junit.framework.TestSuite.run(TestSuite.java:225)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>>> at junit.framework.TestSuite.run(TestSuite.java:225)
>>> at
>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07050 seconds