Package com.semagia.atomico.server.dm

Examples of com.semagia.atomico.server.dm.IFragmentInfo


        // Reject request iff the media type is null.
        if (mediaType == null) {
            // 415 == Unsupported Media Type
            return Response.status(415).build();
        }
        final IFragmentInfo info = storage.addFragment(_collInfo.getCollectionId(), null);
        if (info == null) {
            throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
        }
        return Response.created(LinkUtils.linkTo(getBaseURI(), _collInfo, info))
                        .lastModified(new Date(info.getUpdated()))
                        .build();
    }
View Full Code Here


        final String title = "title";
        final long updated = now();
        final MediaType mt = MediaType.ATOM_XML;
        final String sid = "http://psi.semagia.com/subject-identifier";
        final IResource res = new Resource(sid);
        final IFragmentInfo fragInfo = new FragmentInfo(id, title, updated, mt, "fragId", res);
        feed.addEntry(fragInfo, link);
        assertEquals(1, feed.getEntries().size());
        final IFragmentEntry entry = feed.getEntries().iterator().next();
        assertNotNull(entry);
        assertEquals(id, entry.getId());
View Full Code Here

        final String title = "title";
        final long updated = now();
        final MediaType mt = MediaType.ATOM_XML;
        final String sid = "http://psi.semagia.com/subject-identifier";
        final IResource res = new Resource(sid);
        final IFragmentInfo fragInfo = new FragmentInfo(id, title, updated, mt, "fragId", res);
        try {
            feed.addEntry(fragInfo, null);
            fail("feed.addEntry(info, null) is illegal");
        }
        catch (IllegalArgumentException ex) {
View Full Code Here

        assertEquals(IResource.UNKNOWN, res.getKind());
        assertEquals(_RES, res);
    }

    public void testProperties() {
        IFragmentInfo info = new FragmentInfo(_ID, _TITLE, _UPDATED, _MEDIA_TYPE, _FRAGMENT_ID, _RES);
        _testDefaultProperties(info);
        assertEquals(1, info.getMediaTypes().size());
        assertEquals(_MEDIA_TYPE, info.getMediaTypes().iterator().next());
    }
View Full Code Here

        assertEquals(_MEDIA_TYPE, info.getMediaTypes().iterator().next());
    }

    public void testProperties2() {
        final List<MediaType> mediaTypes = Arrays.asList(new MediaType[] {_MEDIA_TYPE, MediaType.valueOf("application/x-tm+snello")});
        IFragmentInfo info = new FragmentInfo(_ID, _TITLE, _UPDATED, mediaTypes, _FRAGMENT_ID, _RES);
        assertEquals(2, info.getMediaTypes().size());
        assertEquals(mediaTypes, info.getMediaTypes());
    }
View Full Code Here

TOP

Related Classes of com.semagia.atomico.server.dm.IFragmentInfo

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.