Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.QValue


     * @param resolver The name/path resolver used to build a <code>QValue</code>.
     * @return
     * @throws RepositoryException
     */
    private QValue buildQValue(TextValue tv, int targetType, NamePathResolver resolver) throws RepositoryException {
        QValue iv;
        try {
            switch (targetType) {
                case PropertyType.BINARY:
                    // base64 encoded BINARY type
                    if (tv.length() < 0x10000) {
View Full Code Here


            QValue[] values;
            int type = JcrValueType.typeFromContentType(ct);

            NamePathResolver resolver = getNamePathResolver(sessionInfo);
            if (type != PropertyType.UNDEFINED) {
                QValue v;
                if (type == PropertyType.BINARY) {
                    v = getQValueFactory().create(method.getResponseBodyAsStream());
                } else {
                    Reader reader = new InputStreamReader(method.getResponseBodyAsStream(), method.getResponseCharSet());
                    StringBuffer sb = new StringBuffer();
View Full Code Here

        }
    }

    public void testGetDoubleOnBooleanValue() throws RepositoryException {
        try {
            QValue v = factory.create(true);
            v.getDouble();
            fail("'true' cannot be converted to a valid double value.");
        } catch (ValueFormatException e) {
            // ok
        }
    }
View Full Code Here

        }
    }

    public void testGetLongOnBooleanValue() throws RepositoryException {
        try {
            QValue v = factory.create(true);
            v.getLong();
            fail("'true' cannot be converted to a valid long value.");
        } catch (ValueFormatException e) {
            // ok
        }
    }
View Full Code Here

        }
    }

    public void testGetDecimalOnBooleanValue() throws RepositoryException {
        try {
            QValue v = factory.create(true);
            v.getDecimal();
            fail("'true' cannot be converted to a valid decimal value.");
        } catch (ValueFormatException e) {
            // ok
        }
    }
View Full Code Here

     * type return equal objects.
     *
     * @throws RepositoryException
     */
    public void testCreateBooleanValueFromString() throws RepositoryException {
        QValue v = factory.create(Boolean.TRUE.toString(), PropertyType.BOOLEAN);
        assertEquals("Creating boolean type QValue from boolean or String must be equal.",
                factory.create(true), v);

        v = factory.create(Boolean.FALSE.toString(), PropertyType.BOOLEAN);
        assertEquals("Creating boolean type QValue from boolean or String must be equal.",
View Full Code Here

        assertEquals("Creating boolean type QValue from boolean or String must be equal.",
                factory.create(false), v);
    }

    public void testCreateTrueBooleanValue() throws RepositoryException {
        QValue v = factory.create(true);
        assertEquals("Boolean value must be true", Boolean.TRUE.toString(), v.getString());
        assertEquals("Boolean value must be true", true, v.getBoolean());
    }
View Full Code Here

        assertEquals("Boolean value must be true", Boolean.TRUE.toString(), v.getString());
        assertEquals("Boolean value must be true", true, v.getBoolean());
    }

    public void testCreateFalseBooleanValue() throws RepositoryException {
        QValue v = factory.create(false);
        assertEquals("Boolean value must be false", Boolean.FALSE.toString(), v.getString());
        assertEquals("Boolean value must be false", false, v.getBoolean());
    }
View Full Code Here

        assertEquals("Boolean value must be false", Boolean.FALSE.toString(), v.getString());
        assertEquals("Boolean value must be false", false, v.getBoolean());
    }

    public void testCreateTrueFromString() throws ValueFormatException, RepositoryException {
        QValue v = factory.create(Boolean.TRUE.toString(), PropertyType.STRING);
        assertEquals("Boolean value must be true", true, v.getBoolean());
    }
View Full Code Here

        QValue v = factory.create(Boolean.TRUE.toString(), PropertyType.STRING);
        assertEquals("Boolean value must be true", true, v.getBoolean());
    }

    public void testCreateFalseFromString() throws ValueFormatException, RepositoryException {
        QValue v = factory.create("any", PropertyType.STRING);
        assertEquals("Boolean value must be false", false, v.getBoolean());
    }
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.