Beispiel #1
0
 private void CreateBeanPathOnErrorMessages(XmlToModelResult result, object messageBean)
 {
     // would be nice to push this entire method into XmlToModelResult, but BeanUtil not visible from XmlToModelResult
     // (and moving classes or adding a dependency causes all sorts of problems)
     foreach (Hl7Error hl7Error in result.GetHl7Errors())
     {
         string beanPath = BeanUtil.DescribeBeanPath(messageBean, hl7Error.GetPath());
         hl7Error.SetBeanPath(beanPath);
     }
 }
Beispiel #2
0
 public virtual XmlToModelResult MapToTeal(Hl7MessageSource hl7MessageSource)
 {
     if (hl7MessageSource.GetInteraction() != null)
     {
         Type        messageBeanType = MessageBeanRegistry.GetInstance().GetInteractionBeanType(hl7MessageSource.GetMessageTypeKey());
         object      messageBean     = BeanUtil.Instantiate <object>(messageBeanType);
         BeanWrapper wrapper         = new BeanWrapper(messageBean);
         MapToTeal(hl7MessageSource, wrapper, null);
         hl7MessageSource.GetResult().SetMessageObject(messageBean);
         CreateBeanPathOnErrorMessages(hl7MessageSource.GetResult(), messageBean);
     }
     return(hl7MessageSource.GetResult());
 }
Beispiel #3
0
        public virtual void ShouldHandleComplexPathEndingInNullProperty()
        {
            string result = BeanUtil.DescribeBeanPath(this.testBean, "/MOCK_IN123456CA/theType/component/subject3/name");

            Assert.AreEqual(PropertyPath.ToPath("MockMessageBean.type.name"), result);
        }
Beispiel #4
0
        public virtual void ShouldHandleComplexPathWithoutMessageBean()
        {
            string result = BeanUtil.DescribeBeanPath(this.testBean, "theType/component/subject3/name");

            Assert.AreEqual(PropertyPath.ToPath("MockMessageBean.type.name"), result);
        }
Beispiel #5
0
        public virtual void ShouldHandleSimplePath()
        {
            string result = BeanUtil.DescribeBeanPath(this.testBean, "/MOCK_IN123456CA/theType");

            Assert.AreEqual(PropertyPath.ToPath("MockMessageBean.type"), result);
        }
Beispiel #6
0
 public virtual void ShouldHandlePathNotFound()
 {
     Assert.AreEqual(PropertyPath.ToPath("MockMessageBean"), BeanUtil.DescribeBeanPath(this.testBean, "/aNotFound/b/c"));
 }
Beispiel #7
0
 public virtual void ShouldHandleEmptyPath()
 {
     Assert.AreEqual(string.Empty, BeanUtil.DescribeBeanPath(new object(), " "));
 }
Beispiel #8
0
 public virtual void ShouldHandleNullBean()
 {
     Assert.AreEqual(string.Empty, BeanUtil.DescribeBeanPath(null, "/a/b/c"));
 }