[Design of JBossXB] - Re: Using generics info in CollectionPropertyHandler
by alesj
I'm having problems creating Map test case,
where it would fail when key or value are not instance of.
I have this 'metadata' class:
| @XmlRootElement
| @JBossXmlSchema(namespace="ns", elementFormDefault=XmlNsForm.QUALIFIED)
| public class RootWrongKey
| {
| private Map<KeyIface, ValueIface> tester;
|
| public Map<KeyIface, ValueIface> getTester()
| {
| return tester;
| }
|
| @JBossXmlMapKeyElement(name = "key")
| @JBossXmlMapValueElement(name = "value")
| public void setTester(Map<KeyIface, ValueIface> tester)
| {
| this.tester = tester;
| }
| }
|
where KeyIface and ValueIface are empty interfaces.
I'm trying to find where I can assign actual (but wrong) type, but w/o success.
I'm then getting this exception:
| java.lang.IllegalArgumentException: No such property for bean org.jboss.test.xb.builder.object.type.map.support.KeyIface available []
| at org.jboss.beans.info.plugins.AbstractBeanInfo.getProperty(AbstractBeanInfo.java:147)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:1127)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:731)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:719)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateTypeBinding(JBossXBNoSchemaBuilder.java:475)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.resolveTypeBinding(JBossXBNoSchemaBuilder.java:434)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.bindMapProperty(JBossXBNoSchemaBuilder.java:2182)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.bindProperty(JBossXBNoSchemaBuilder.java:1778)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:1128)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:731)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:719)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateTypeBinding(JBossXBNoSchemaBuilder.java:475)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.resolveTypeBinding(JBossXBNoSchemaBuilder.java:434)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createElementBinding(JBossXBNoSchemaBuilder.java:313)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createRootElementBinding(JBossXBNoSchemaBuilder.java:293)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createRootElements(JBossXBNoSchemaBuilder.java:273)
| at org.jboss.xb.builder.JBossXBNoSchemaBuilder.build(JBossXBNoSchemaBuilder.java:197)
| at org.jboss.xb.builder.JBossXBBuilder.build(JBossXBBuilder.java:118)
| at org.jboss.test.xb.builder.AbstractBuilderTest.unmarshalObject(AbstractBuilderTest.java:125)
| at org.jboss.test.xb.builder.AbstractBuilderTest.unmarshalObject(AbstractBuilderTest.java:172)
| at org.jboss.test.xb.builder.object.type.map.test.KeyValueTypeUnitTestCase.testFailure(KeyValueTypeUnitTestCase.java:68)
| at org.jboss.test.xb.builder.object.type.map.test.KeyValueTypeUnitTestCase.testWrongKey(KeyValueTypeUnitTestCase.java:50)
|
Any hint on how to produce such failing test? ;-)
ps: I managed to do it for Collection. :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192814#4192814
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192814
16 years, 1 month
[Design of JCA on JBoss] - TxConnectionManagerStressCase
by adrian@jboss.org
This test keeps failing randomly.
I'm not entirely sure what this is actually trying to test,
it appears to be only failing if the tx timeout doesn't occur?
| // Only code that sets failed = true
|
| Transaction tx = tm.getTransaction();
| if (tx != null && TxUtils.isActive(tx))
| failed = true;
|
| // Other places that trap an error but don't set failed
|
| catch (ResourceException re)
| {
| error = re;
| log.info(re.getMessage(), re);
| }
|
| // Test only fails if failed is set (which isn't thread safe anyway!)
| assertTrue("Error in timeout test: " + error, !failed);
|
Anyway the reason why it is failing randomly is because giving only 500ms
for 100 threads to have their transactions timed out isn't going to work
if the server where the test is running is busy doing something else with its cpu.
I'm going to fix this test so that instead of using a Thread.wait()
it registers a transaction synchronization to do a more predicatble handoff
between the transaction timeout and whatever the test is trying to do.
While I'm there I'm going to fix the test so that it tidies up the thread transaction
association. The only reason that isn't an issue currently is because
each thread only goes through one iteration.
I'll leave it to you Jesper to figure out whether this test is actually testing what
it is supposed to be testing. ;-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192811#4192811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192811
16 years, 1 month
[Design of JBossXB] - Re: Using generics info in CollectionPropertyHandler
by alesj
I'm getting this exception:
| testRepeatedElements(org.jboss.test.xml.RepeatedElementsUnitTestCase) Time elapsed: 0.546 sec <<< ERROR!
| org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/projects/jbossxb/target/test-classes/org/jboss/test/xml/RepeatedElementsUnitTestCase_testRepeatedElements.xml@5,11
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:177)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:119)
| at org.jboss.test.xml.JBossXBTestDelegate.unmarshal(JBossXBTestDelegate.java:146)
| at org.jboss.test.xml.AbstractJBossXBTest.unmarshal(AbstractJBossXBTest.java:227)
| at org.jboss.test.xml.AbstractJBossXBTest.unmarshal(AbstractJBossXBTest.java:193)
| at org.jboss.test.xml.RepeatedElementsUnitTestCase.testRepeatedElements(RepeatedElementsUnitTestCase.java:46)
| 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:168)
| at junit.framework.TestCase.runBare(TestCase.java:134)
| at junit.framework.TestResult$1.protect(TestResult.java:110)
| at junit.framework.TestResult.runProtected(TestResult.java:128)
| at junit.framework.TestResult.run(TestResult.java:113)
| at junit.framework.TestCase.run(TestCase.java:124)
| at junit.framework.TestSuite.runTest(TestSuite.java:232)
| at junit.framework.TestSuite.run(TestSuite.java:227)
| at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
| at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
| 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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
| Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to start {http://www.jboss.org/test/xml/repeatedElements}child: the element is not repeatable, repeatable parent expected to be a model group but got element {http://www.jboss.org/test/xml/repeatedElements}top
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endRepeatableParent(SundayContentHandler.java:703)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:341)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:173)
| ... 28 more
|
|
After reverting my changes it's still there.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192790#4192790
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192790
16 years, 1 month