Exemplo n.º 1
0
    @Test
    public void testUnmarshallerFoo() throws Exception {
      assertEquals(
          "foo",
          target()
              .request()
              .post(Entity.entity(new JaxbBean("foo"), "text/foo+xml"), JaxbBean.class)
              .value);
      assertEquals(0, cr.invoked());
      assertEquals(0, mr.invoked());
      assertEquals(0, umr.invoked());
      assertEquals(1, mrFoo.invoked());
      assertEquals(1, umrFoo.invoked());

      assertEquals(
          "foo",
          target()
              .request()
              .post(
                  Entity.entity(new JaxbBean("foo"), "text/foo+xml;charset=UTF-8"), JaxbBean.class)
              .value);
      assertEquals(0, cr.invoked());
      assertEquals(0, mr.invoked());
      assertEquals(0, umr.invoked());
      assertEquals(2, mrFoo.invoked());
      assertEquals(2, umrFoo.invoked());
    }
Exemplo n.º 2
0
    @Test
    public void testUnmarshallerAll() throws Exception {
      assertEquals(
          "foo",
          target()
              .request()
              .post(Entity.entity(new JaxbBean("foo"), "application/foo+xml"), JaxbBean.class)
              .value);
      assertEquals(0, cr.invoked());
      assertEquals(0, crApp.invoked());
      assertEquals(0, crText.invoked());
      assertEquals(1, mr.invoked());
      assertEquals(1, umr.invoked());
      assertEquals(0, mrApp.invoked());
      assertEquals(0, umrApp.invoked());
      assertEquals(0, mrText.invoked());
      assertEquals(0, umrText.invoked());

      assertEquals(
          "foo",
          target()
              .request()
              .post(Entity.entity(new JaxbBean("foo"), "application/xml"), JaxbBean.class)
              .value);
      assertEquals(0, cr.invoked());
      assertEquals(0, crApp.invoked());
      assertEquals(0, crText.invoked());
      assertEquals(1, mr.invoked());
      assertEquals(1, umr.invoked());
      assertEquals(1, mrApp.invoked());
      assertEquals(1, umrApp.invoked());
      assertEquals(0, mrText.invoked());
      assertEquals(0, umrText.invoked());

      assertEquals(
          "foo",
          target()
              .request()
              .post(Entity.entity(new JaxbBean("foo"), "text/xml"), JaxbBean.class)
              .value);
      assertEquals(0, cr.invoked());
      assertEquals(0, crApp.invoked());
      assertEquals(0, crText.invoked());
      assertEquals(1, mr.invoked());
      assertEquals(1, umr.invoked());
      assertEquals(1, mrApp.invoked());
      assertEquals(1, umrApp.invoked());
      assertEquals(1, mrText.invoked());
      assertEquals(1, umrText.invoked());
    }