Examples of marshall()


Examples of org.kie.api.marshalling.Marshaller.marshall()

       
        // Serialize and Deserialize
        try {
          Marshaller marshaller = MarshallerFactory.newMarshaller(kbase);
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          marshaller.marshall(baos, ksession);
          marshaller = MarshallerFactory.newMarshaller(kbase);
          ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
          baos.close();
          ksession = (StatefulKnowledgeSession)marshaller.unmarshall(bais);
          bais.close();
View Full Code Here

Examples of org.kie.marshalling.Marshaller.marshall()

        StatefulKnowledgeSession ksession = (StatefulKnowledgeSession) getKnowledgeRuntime();
       
        Marshaller marshaller = MarshallerFactory.newMarshaller( ksession.getKieBase(), new ObjectMarshallingStrategy[] { MarshallerFactory.newSerializeMarshallingStrategy() }   );
       
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        marshaller.marshall( stream, (StatefulKnowledgeSession) getKnowledgeRuntime() );
        stream.close();
       
        byte[] bytes = stream.toByteArray();
        out.writeInt( bytes.length );
        out.write( bytes );
View Full Code Here

Examples of org.mojavemvc.core.ActionSignature.marshall()

        } else {
            when(sig.getInterceptorClasses(db, cntrl.getClass(), action)).thenReturn(
                    db.getInterceptorsForAction(cntrl.getClass(), action));
        }
       
        when(sig.marshall(anyObject())).thenAnswer(new Answer<View>() {
            @Override
            public View answer(InvocationOnMock invocation) throws Throwable {
                return (View)invocation.getArguments()[0];
            }
        });
View Full Code Here

Examples of org.mojavemvc.marshalling.DefaultEntityMarshaller.marshall()

    @Test
    public void defaultEntityMarshallerReturnsView() {
       
        DefaultEntityMarshaller m = new DefaultEntityMarshaller();
        View v = new EmptyView();
        assertEquals(v, m.marshall(v));
    }
   
    @Test
    public void defaultEntityMarshallerReturnsNullAfterUnmarshall() {
       
View Full Code Here

Examples of org.mojavemvc.marshalling.JSONEntityMarshaller.marshall()

    @Test
    public void jsonEntityMarshallerReturnsView() {
       
        JSONEntityMarshaller m = new JSONEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        View v = m.marshall(entity);
        assertTrue(v instanceof JSON);
        assertEquals(new JSON(entity).toString(), ((JSON)v).toString());
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.JSONEntityMarshaller.marshall()

       
        JSONEntityMarshaller m = new JSONEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        MarshallablePojo<SimplePojo> marshallable =
                new MarshallablePojo<SimplePojo>(entity);
        View v = m.marshall(marshallable);
        assertTrue(v instanceof JSON);
        assertEquals(new JSON(entity).toString(), ((JSON)v).toString());
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.JSONEntityMarshaller.marshall()

    public void jsonEntityMarshallerHandlesMarshallAnnotation() {
       
        JSONEntityMarshaller m = new JSONEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        AnnotatedPojo marshallable = new AnnotatedPojo(entity);
        View v = m.marshall(marshallable);
        assertTrue(v instanceof JSON);
        assertEquals(new JSON(entity).toString(), ((JSON)v).toString());
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.PlainTextEntityMarshaller.marshall()

    @Test
    public void plainTextEntityMarshallerReturnsView() {
       
        PlainTextEntityMarshaller m = new PlainTextEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        View v = m.marshall(entity);
        assertTrue(v instanceof PlainText);
        assertEquals(new PlainText(entity).toString(), ((PlainText)v).toString());
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.PlainTextEntityMarshaller.marshall()

       
        PlainTextEntityMarshaller m = new PlainTextEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        MarshallablePojo<SimplePojo> marshallable =
                new MarshallablePojo<SimplePojo>(entity);
        View v = m.marshall(marshallable);
        assertTrue(v instanceof PlainText);
        assertEquals(new PlainText(entity).toString(), ((PlainText)v).toString());
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.PlainTextEntityMarshaller.marshall()

    public void plainTextEntityMarshallerHandlesMarshallAnnotation() {
       
        PlainTextEntityMarshaller m = new PlainTextEntityMarshaller();
        SimplePojo entity = new SimplePojo("test");
        AnnotatedPojo marshallable = new AnnotatedPojo(entity);
        View v = m.marshall(marshallable);
        assertTrue(v instanceof PlainText);
        assertEquals(new PlainText(entity).toString(), ((PlainText)v).toString());
    }
   
    @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.