Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.QValue


        QValue v = factory.create(NameConstants.JCR_DATA);
        assertTrue(v.getString().equals(NameConstants.JCR_DATA.toString()));
    }

    public void testNameValueGetName() throws RepositoryException {
        QValue v = factory.create(NameConstants.JCR_DATA);
        assertTrue(v.getName().equals(NameConstants.JCR_DATA));
    }
View Full Code Here


            // ok
        }
    }

    public void testPathValueType() throws IOException, RepositoryException {
        QValue v = factory.create(ROOT_PATH);
        assertTrue(v.getType() == PropertyType.PATH);
        v = factory.create(ROOT_PATH.toString(), PropertyType.PATH);
        assertTrue(v.getType() == PropertyType.PATH);
    }
View Full Code Here

        assertTrue(v.getType() == PropertyType.PATH);
    }


    public void testPathValueEquality() throws IOException, RepositoryException {
        QValue v = factory.create(ROOT_PATH);
        QValue v2 = factory.create(ROOT_PATH.toString(), PropertyType.PATH);
        assertTrue(v.equals(v2));
    }
View Full Code Here

        QValue v2 = factory.create(ROOT_PATH.toString(), PropertyType.PATH);
        assertTrue(v.equals(v2));
    }

    public void testPathValueGetString() throws IOException, RepositoryException {
        QValue v = factory.create(ROOT_PATH);
        assertTrue(v.getString().equals(ROOT_PATH.toString()));
    }
View Full Code Here

        QValue v = factory.create(ROOT_PATH);
        assertTrue(v.getString().equals(ROOT_PATH.toString()));
    }

    public void testPathValueGetPath() throws RepositoryException {
        QValue v = factory.create(ROOT_PATH);
        assertTrue(v.getPath().equals(ROOT_PATH));
    }
View Full Code Here

            // ok
        }
    }

    public void testBinaryValueType() throws IOException, RepositoryException {
        QValue v = factory.create(new byte[] {'a', 'b', 'c'});
        assertTrue(v.getType() == PropertyType.BINARY);
    }
View Full Code Here

        assertTrue(v.getType() == PropertyType.BINARY);
    }


    public void testBinaryFromByteArray() throws RepositoryException, IOException {
        QValue v = factory.create(new byte[] {'a', 'b', 'c'});

        assertEquals(PropertyType.BINARY, v.getType());
        assertEquals(3, v.getLength());

        assertEquals("abc", v.getString());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        spool(out, v.getStream());
        assertEquals("abc", new String(out.toByteArray()));
    }
View Full Code Here

        spool(out, v.getStream());
        assertEquals("abc", new String(out.toByteArray()));
    }

    public void testEmptyBinaryFromByteArray() throws RepositoryException, IOException {
        QValue v = factory.create(new byte[0]);

        assertEquals(PropertyType.BINARY, v.getType());
        assertEquals(0, v.getLength());

        assertEquals("", v.getString());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        spool(out, v.getStream());
        assertEquals("", new String(out.toByteArray()));
    }
View Full Code Here

    }

    public void testBinaryFromInputStream() throws RepositoryException, IOException {
        InputStream in = new ByteArrayInputStream(new byte[] {'a', 'b', 'c'});

        QValue v = factory.create(in);

        assertEquals(PropertyType.BINARY, v.getType());
        assertEquals(3, v.getLength());

        assertEquals("abc", v.getString());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        spool(out, v.getStream());
        assertEquals("abc", new String(out.toByteArray()));
    }
View Full Code Here

    }

    public void testEmptyBinaryFromInputStream() throws RepositoryException, IOException {
        InputStream in = new ByteArrayInputStream(new byte[0]);

        QValue v = factory.create(in);

        assertEquals(PropertyType.BINARY, v.getType());
        assertEquals(0, v.getLength());

        assertEquals("", v.getString());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        spool(out, v.getStream());
        assertEquals("", new String(out.toByteArray()));
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.QValue

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.