Examples of PlainText


Examples of org.mojavemvc.views.PlainText

    }

    @Action("plain-text")
    public PlainText getText() {
       
        return new PlainText("hello");
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

       
        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());
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

        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());
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

        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());
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

        ErrorHandler errorHandler = new DefaultErrorHandler();
        View view = errorHandler.handleError(null, properties);

        assertTrue(view instanceof PlainText);
        PlainText stackTrace = (PlainText) view;
        assertEquals("", stackTrace.toString());
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

       
        ErrorHandler errorHandler = new DefaultErrorHandler();
        View view = errorHandler.handleError(e, properties);

        assertTrue(view instanceof PlainText);
        PlainText stackTrace = (PlainText) view;
        assertTrue(stackTrace.toString().startsWith("java.lang.Exception: testing"));
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

*/
public class TestPlainText {
   
    @Test
    public void returnsCorrectContentType() {
        PlainText pt = new PlainText("");
        assertEquals("text/plain", pt.getContentType());
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

        assertEquals("text/plain", pt.getContentType());
    }
   
    @Test
    public void toStringAfterObjectConstructorReturnsPlainText() {
        PlainText pt = new PlainText(new SimplePojo("test"));
        assertEquals("test", pt.toString());
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

                }
            }
            message = out.toString();
        }
       
        return new PlainText(message);
    }
View Full Code Here

Examples of org.mojavemvc.views.PlainText

    private final EntityResolver entityResolver = new EntityResolver();
   
    @Override
    public View marshall(Object entity) {
        entity = entityResolver.resolve(entity);
        return new PlainText(entity);
    }
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.