Package org.apache.directmemory.server.commons

Examples of org.apache.directmemory.server.commons.DirectMemoryResponse


        assertEquals( "Bordeaux", wine.getName() );
        assertEquals( "very great wine", wine.getDescription() );

        // START SNIPPET: client-delete

        DirectMemoryResponse deleteResponse = client.delete( new DirectMemoryRequest<Wine>( "bordeaux" ) );
        assertTrue( deleteResponse.isDeleted() );

        // END SNIPPET: client-delete

        response = client.retrieve( new DirectMemoryRequest( "bordeaux", Wine.class ) );
View Full Code Here


    @Test
    public void deleteNotFound()
        throws Exception
    {
        DirectMemoryResponse deleteResponse = client.delete( new DirectMemoryRequest<Wine>( "fofoofofof" ) );
        assertFalse( deleteResponse.isDeleted() );
    }
View Full Code Here

    @Test
    public void putSmallExpiresAndGetNotFound()
        throws Exception
    {

        DirectMemoryResponse deleteResponse = client.delete( new DirectMemoryRequest<Wine>( "bordeaux" ) );
        Wine bordeaux = new Wine( "Bordeaux", "very great wine" );

        DirectMemoryResponse<Wine> response =
            client.put( new DirectMemoryRequest<Wine>( "bordeaux", bordeaux ).setExpiresIn( 1000 ) );
View Full Code Here

        assertEquals( HttpServletResponse.SC_OK, getResponse.getStatus() );

        assertEquals( MediaType.APPLICATION_JSON, getResponse.getContentType() );

        DirectMemoryResponse response =
            parser.buildResponse( new ByteArrayInputStream( getResponse.getContentAsByteArray() ) );

        Wine wineFromCache = serializer.deserialize( response.getCacheContent(), Wine.class );

        assertEquals( bordeaux.getName(), wineFromCache.getName() );
        assertEquals( bordeaux.getDescription(), wineFromCache.getDescription() );

    }
View Full Code Here

        assertEquals( HttpServletResponse.SC_OK, getResponse.getStatus() );

        assertEquals( MediaType.APPLICATION_JSON, getResponse.getContentType() );

        DirectMemoryResponse response =
            parser.buildResponse( new ByteArrayInputStream( getResponse.getContentAsByteArray() ) );

        Wine wineFromCache = serializer.deserialize( response.getCacheContent(), Wine.class );

        assertEquals( bordeaux.getName(), wineFromCache.getName() );
        assertEquals( bordeaux.getDescription(), wineFromCache.getDescription() );

        // now delete the content
View Full Code Here

TOP

Related Classes of org.apache.directmemory.server.commons.DirectMemoryResponse

Copyright © 2018 www.massapicom. 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.