Package com.semagia.atomico.server.dm

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


        // Reject request iff the media type is null.
        if (mediaType == null) {
            // 415 == Unsupported Media Type
            return Response.status(415).build();
        }
        final ISnapshotInfo info = storage.addSnapshot(_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 URI link = URI.create(linkAdr);
        final String id = "http://www.semagia.com/test";
        final String title = "title";
        final long updated = now();
        final MediaType mt = MediaType.ATOM_XML;
        final ISnapshotInfo snapInfo = new SnapshotInfo(id, title, updated, mt, "snapId");
        feed.addEntry(snapInfo, link);
        assertEquals(1, feed.getEntries().size());
        final ISnapshotEntry entry = feed.getEntries().iterator().next();
        assertNotNull(entry);
        assertEquals(id, entry.getId());
View Full Code Here

        }
        final String id = "http://www.semagia.com/test";
        final String title = "title";
        final long updated = now();
        final MediaType mt = MediaType.ATOM_XML;
        final ISnapshotInfo snapInfo = new SnapshotInfo(id, title, updated, mt, "snapId");
        try {
            feed.addEntry(snapInfo, null);
            fail("feed.addEntry(info, null) is illegal");
        }
        catch (IllegalArgumentException ex) {
View Full Code Here

        assertEquals(_UPDATED, info.getUpdated());
        assertEquals(_SNAPSHOT_ID, info.getSnapshotId());
    }
   
    public void testProperties() {
        ISnapshotInfo info = new SnapshotInfo(_ID, _TITLE, _UPDATED, _MEDIA_TYPE, _SNAPSHOT_ID);
        _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(_MEDIA_TYPE, MediaType.valueOf("application/x-tm+snello"));
        ISnapshotInfo info = new SnapshotInfo(_ID, _TITLE, _UPDATED, mediaTypes, _SNAPSHOT_ID);
        _testDefaultProperties(info);
        assertEquals(2, info.getMediaTypes().size());
        assertEquals(mediaTypes, info.getMediaTypes());
    }
View Full Code Here

TOP

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

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.