eed3si9n/scalaxb — Issue #109: test case for other 2 bugs..
Author: deanhiller
Created: 2011-11-04 21:15:55+00:00
State: open

This test seems to demonstrate both of the other bugs(once you fix one bug, I think it will still fail on the next bug)

QUESTION: Do elements under the ghx:EventSeqRequest inherit the ghx namespace or do they automatically use the default namespace.....I always got confused by this. Either way, the below xml should be valid correct as default namespace and ghx namespace are the same.....getting rid of the default namespace in the below test will show you the 2nd bug ;)

@Test def testDefaultNamespace() {
val context = ContextParmsListType(Some(new URI("asdf")), Some(new URI("eere")))
val epcs :List[EPC] = Nil
val pedCheck = PedigreeCheckRequestType(context, epcs)

val xml = toXML[PedigreeCheckRequestType](pedCheck, Some("http://ghx.com/v1/tnt/pedigreeCheckRequest"), Some("EventSequenceRequest"), NewTntAPIFactory.defaultScope)
val stringXml = xml.toString

//val requestXml2 = XML.loadString(stringXml)
val requestXml =

MyBizStep
MyBizLoc

val xmlObj = fromXML[PedigreeCheckRequestType](requestXml)

val bizStepOption = xmlObj.ContextParms.ContextBizStep
Assert.assertTrue(bizStepOption.isDefined)
Assert.assertEquals("MyBizStep", bizStepOption.get+"")

info("our obj="+xmlObj)
}

Schema...(I think you had the other schemas? or should I attach them?)

Context Parameters List