Package org.jboss.dna.graph.property

Examples of org.jboss.dna.graph.property.Binary


    public void shouldUseSizeWhenComparing() {
        byte[] shorterContent = new byte[validByteArrayContent.length - 2];
        for (int i = 0; i != shorterContent.length; ++i) {
            shorterContent[i] = validByteArrayContent[i];
        }
        Binary another = new InMemoryBinary(shorterContent);
        assertThat(binary.equals(another), is(false));
        assertThat(binary.compareTo(another), is(1));
        assertThat(another.compareTo(binary), is(-1));
        assertThat(another, hasContent(shorterContent));
    }
View Full Code Here


        Property prop2 = createProperty("p2", value);
        Property prop3 = createProperty("p3", "v2");
        Property prop4 = createProperty("p4", new String(value)); // make sure it's a different String object
        Property prop5 = createProperty("p5", valueFactories.getBinaryFactory().create("something"));
        String binaryValueStr = "really really long string that will be converted to a binary value and tested like that";
        Binary binaryValue = valueFactories.getBinaryFactory().create(binaryValueStr);
        Property prop6 = createProperty("p6", binaryValue);
        UUID uuid7 = UUID.randomUUID();
        Reference ref7 = valueFactories.getReferenceFactory().create(uuid7);
        Property prop7 = createProperty("p7", ref7);
        UUID uuid8 = UUID.randomUUID();
        Reference ref8 = valueFactories.getReferenceFactory().create(uuid8);
        Property prop8 = createProperty("p8", ref8);

        Property prop2b = createProperty("p2");
        Property prop3b = createProperty("p3", "v3");
        String binaryValueStr2 = binaryValueStr + " but modified";
        Binary binaryValue2 = valueFactories.getBinaryFactory().create(binaryValueStr2);
        Property prop6b = createProperty("p6", binaryValue2);

        Property[] initial = new Property[] {prop1, prop2, prop3, prop4, prop5, prop6, prop7, prop8};
        Property[] updated = new Property[] {prop2b, prop3b, prop6b};
        Name[] deleted = new Name[] {};
View Full Code Here

        Property prop2 = createProperty("p2", value);
        Property prop3 = createProperty("p3", "v2");
        Property prop4 = createProperty("p4", new String(value)); // make sure it's a different String object
        Property prop5 = createProperty("p5", valueFactories.getBinaryFactory().create("something"));
        String binaryValueStr = "really really long string that will be converted to a binary value and tested like that";
        Binary binaryValue = valueFactories.getBinaryFactory().create(binaryValueStr);
        Property prop6 = createProperty("p6", binaryValue);
        UUID uuid7 = UUID.randomUUID();
        Reference ref7 = valueFactories.getReferenceFactory().create(uuid7);
        Property prop7 = createProperty("p7", ref7);
        UUID uuid8 = UUID.randomUUID();
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.property.Binary

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.