Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.ShortBlob


            new PostalAddress(null);
            fail();
        } catch (NullPointerException e) {
        }
        try {
            new ShortBlob(null);
            fail();
        } catch (NullPointerException e) {
        }
        Assert.assertNull(new Text(null).getValue());
        try {
View Full Code Here


     * @throws Exception
     */
    @Test
    public void shortBlobToBytes() throws Exception {
        byte[] bytes = new byte[] { 1 };
        assertThat(meta.shortBlobToBytes(new ShortBlob(bytes)), is(bytes));
        assertThat(meta.shortBlobToBytes(null), is(nullValue()));
    }
View Full Code Here

    /**
     * @throws Exception
     */
    @Test
    public void shortBlobToSerializable() throws Exception {
        assertThat((String) meta.shortBlobToSerializable(new ShortBlob(ByteUtil
            .toByteArray("aaa"))), is("aaa"));
        assertThat(meta.shortBlobToSerializable(null), is(nullValue()));
    }
View Full Code Here

        assertThat(model, is(notNullValue()));
    }

    @Test
    public void spike() throws Exception {
        model.setBytes2(new ShortBlob(new byte[] { '1' }));
        Datastore.put(model);
        // assertThat(model, is(notNullValue()));
    }
View Full Code Here

     * @param value
     *            the array of bytes
     * @return a short blob
     */
    protected ShortBlob bytesToShortBlob(byte[] value) {
        return value != null ? new ShortBlob(value) : null;
    }
View Full Code Here

     *            the serializable object
     * @return a short blob
     */
    protected ShortBlob serializableToShortBlob(Object value) {
        return value != null
            ? new ShortBlob(ByteUtil.toByteArray(value))
            : null;
    }
View Full Code Here

   
    public ShortBlob decode(JsonReader reader, ShortBlob defaultValue) {
        String text = reader.read();
        if(text != null){
            try{
                return new ShortBlob(Base64.decode(text));
            } catch(Base64DecoderException e){
            }
        }
        return defaultValue;
    }
View Full Code Here

    @Override
    public ShortBlob decode(JsonReader reader, ShortBlob defaultValue) {
        String text = reader.read();
        if(text != null){
            try{
                return new ShortBlob(Base64.decode(text));
            } catch(Base64DecoderException e){
            }
        }
        return defaultValue;
    }
View Full Code Here

    @Override
    public ShortBlob decode(JsonReader reader, ShortBlob defaultValue) {
        String text = reader.read();
        if(text != null){
            try{
                return new ShortBlob(Base64.decode(text));
            } catch(Base64DecoderException e){
            }
        }
        return defaultValue;
    }
View Full Code Here

     * @param value
     *            the array of bytes
     * @return a short blob
     */
    protected ShortBlob bytesToShortBlob(byte[] value) {
        return value != null ? new ShortBlob(value) : null;
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.ShortBlob

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.