[Design the new POJO MicroContainer] - Imposed ordering of elements
by kabir.khan@jboss.com
"alesj" wrote :
| We need to update MC-AOP-int's xmls:
| - http://hudson.qa.jboss.com/hudson/job/AOP%20MC%20Integration%20-%20No%20W...
| to follow the new strict order rules Alexey impounded.
The error for one of my tests is:
| Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {urn:jboss:aop-beans:1.0}class cannot appear in this posi
| tion. Expected content of {urn:jboss:aop-beans:1.0}mixin is sequence: {urn:jboss:aop-beans:1.0}class? {urn:jboss:a
| op-beans:1.0}construction? {urn:jboss:aop-beans:1.0}interfaces?
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:4
| 94)
|
My schema is:
| <xsd:complexType name="mixinType">
| <xsd:annotation>
| <xsd:documentation>
| <![CDATA[
| A mixin within an interface introduction
| ]]>
| </xsd:documentation>
| </xsd:annotation>
| <xsd:all minOccurs="1" maxOccurs="1">
| <xsd:element name="interfaces" type="xsd:string" minOccurs="1" maxOccurs="1" />
| <xsd:element name="class" type="xsd:string" minOccurs="1" maxOccurs="1" />
| <xsd:element name="construction" type="xsd:string" minOccurs="0" maxOccurs="1" />
| </xsd:all>
| <xsd:attribute name="transient" type="xsd:boolean" use="optional"/>
| </xsd:complexType>
|
So I can only conclude that the order imposed is from the order of the setters in the associated parser class, which truly sucks:
| public class MixinData
| {
| String mixin;
| boolean isTransient = true;
| String construction;
| String interfaces;
|
| public boolean getTransient()
| {
| return isTransient;
| }
|
| @XmlAttribute
| public void setTransient(boolean isTransient)
| {
| this.isTransient = isTransient;
| }
|
| public String getMixin()
| {
| return mixin;
| }
|
| @XmlElement(name="class")
| public void setMixin(String mixin)
| {
| this.mixin = mixin;
| }
|
| public String getConstruction()
| {
| return construction;
| }
|
| public void setConstruction(String construction)
| {
| this.construction = construction;
| }
|
| public String getInterfaces()
| {
| return interfaces;
| }
|
| public void setInterfaces(String interfaces)
| {
| this.interfaces = interfaces;
| }
| }
|
Is there some annotation that can be used on the class to get rid of this imposed ordering?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225096#4225096
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225096
16 years, 12 months
[Design the new POJO MicroContainer] - File last modified diff behavior
by alesj
I have this piece of test code
| // update some file
| File updateFile = new File(rootFile, "test.jsp");
| assertTrue(updateFile.exists());
| assertTrue(updateFile.setLastModified(System.currentTimeMillis()));
| @SuppressWarnings("deprecation")
| VirtualFile testJsp = tempRoot.findChild("test.jsp");
| long tempTimestamp = testJsp.getLastModified();
| // this should override tempJsp, hence new timestamp
| assertFalse(checker.hasStructureBeenModified(originalRoot));
| long lastModified = testJsp.getLastModified();
| long diff = lastModified - tempTimestamp;
| assertTrue("Last modified diff is not bigger then 0, diff: " + diff, diff > 0);
|
While this work for me locally (winz machine), it fails for me remotely (linux machine).
This test mocks the behavior for JBAS-6722,
where the user updates his original file (updateFile),
and then the checker updates (overrides) the temp copy (tempJsp).
Any idea why this would diff based on OS?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225090#4225090
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225090
16 years, 12 months