Examples of AtomEntryParser


Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertEquals(ATOM_ENTRY_BASE64_CONTENT, new String(content));
    }

    @Test
    public void testAtomTitle() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(ATOM_ENTRY_NAME.getBytes()), null, THRESHOLD);

        assertNotNull(aep);
        assertNotNull(aep.getObject());
        assertNotNull(aep.getObject().getProperties());
        assertNotNull(aep.getObject().getProperties().getProperties());
        assertNotNull(aep.getObject().getProperties().getProperties().get(PropertyIds.NAME) instanceof PropertyString);

        PropertyString nameProperty = (PropertyString) aep.getObject().getProperties().getProperties()
                .get(PropertyIds.NAME);

        assertEquals("atom.title", nameProperty.getFirstValue());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertEquals("atom.title", nameProperty.getFirstValue());
    }

    @Test
    public void testNullStream() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(null, null, THRESHOLD);

        assertNotNull(aep);
        assertNull(aep.getId());
        assertNull(aep.getObject());
        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertNull(aep.getProperties());
    }

    @Test
    public void testEmptyStream() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(new byte[0]), null, THRESHOLD);

        assertNotNull(aep);
        assertNull(aep.getId());
        assertNull(aep.getObject());
        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }

    private static byte[] parse(byte[] entry) throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(entry), null, THRESHOLD);
        ContentStream contentStream = aep.getContentStream();

        assertNotNull(contentStream);
        assertNotNull(contentStream.getStream());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertEquals(ATOM_ENTRY_BASE64_CONTENT, new String(content));
    }

    @Test
    public void testAtomTitle() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(ATOM_ENTRY_NAME.getBytes()));

        assertNotNull(aep);
        assertNotNull(aep.getObject());
        assertNotNull(aep.getObject().getProperties());
        assertNotNull(aep.getObject().getProperties().getProperties());
        assertNotNull(aep.getObject().getProperties().getProperties().get(PropertyIds.NAME) instanceof PropertyString);

        PropertyString nameProperty = (PropertyString) aep.getObject().getProperties().getProperties().get(
                PropertyIds.NAME);

        assertEquals("atom.title", nameProperty.getFirstValue());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertEquals("atom.title", nameProperty.getFirstValue());
    }

    @Test
    public void testNullStream() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(null);

        assertNotNull(aep);
        assertNull(aep.getId());
        assertNull(aep.getObject());
        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertNull(aep.getProperties());
    }

    @Test
    public void testEmptyStream() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(new byte[0]));

        assertNotNull(aep);
        assertNull(aep.getId());
        assertNull(aep.getObject());
        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }

    private byte[] parse(byte[] entry) throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(entry));
        ContentStream contentStream = aep.getContentStream();

        assertNotNull(contentStream);
        assertNotNull(contentStream.getStream());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertEquals(ATOM_ENTRY_BASE64_CONTENT, new String(content));
    }

    @Test
    public void testAtomTitle() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(ATOM_ENTRY_NAME.getBytes()));

        assertNotNull(aep);
        assertNotNull(aep.getObject());
        assertNotNull(aep.getObject().getProperties());
        assertNotNull(aep.getObject().getProperties().getProperties());
        assertNotNull(aep.getObject().getProperties().getProperties().get(PropertyIds.NAME) instanceof PropertyString);

        PropertyString nameProperty = (PropertyString) aep.getObject().getProperties().getProperties().get(
                PropertyIds.NAME);

        assertEquals("atom.title", nameProperty.getFirstValue());
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser

        assertEquals("atom.title", nameProperty.getFirstValue());
    }

    @Test
    public void testNullStream() throws Exception {
        AtomEntryParser aep = new AtomEntryParser(null);

        assertNotNull(aep);
        assertNull(aep.getId());
        assertNull(aep.getObject());
        assertNull(aep.getContentStream());
        assertNull(aep.getProperties());
    }
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.