Package org.apache.directmemory.serialization

Examples of org.apache.directmemory.serialization.Serializer.deserialize()


        assertEquals( "101", dmRq.getKey() );
        assertTrue( dmRq.isUpdate() );
        assertEquals( 123, dmRq.getExpiresIn() );

        wine = serializer.deserialize( dmRq.getCacheContent(), Wine.class );
        assertEquals( "Bordeaux", wine.getName() );

    }

    @Test
View Full Code Here


            if ( serializer == null )
            {
                serializer = clientConfiguration.getSerializer();
            }
            response.setResponse(
                serializer.deserialize( response.getCacheContent(), directMemoryRequest.getObjectClass() ) );
        }
        return response;
    }

    @Override
View Full Code Here

    {

        try
        {
            Serializer serializer = getSerializer( req );
            String res = serializer.deserialize( cacheResponseContent, String.class );
            resp.setContentType( MediaType.TEXT_PLAIN );
            return res.getBytes();
        }
        catch ( SerializerNotFoundException e )
        {
View Full Code Here

        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( 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

        Serializer serializer = SerializerFactory.createNewSerializer( getSerializerClassName() );

        byte[] bytes = serializer.serialize( wine );

        Wine newWine = serializer.deserialize( bytes, Wine.class );

        assertEquals( wine.getName(), newWine.getName() );
        assertEquals( wine.getDescription(), newWine.getDescription() );

    }
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.