public void testDate() { final long date = new Date().getTime(); final IGraphInfo info = new DefaultGraphInfo(_DEFAULT_URI, MediaType.XTM, date); assertEquals(_DEFAULT_URI, info.getURI()); assertEquals(date, info.getLastModification()); assertEquals(1, info.getSupportedMediaTypes().size()); assertNull(info.getTitle()); assertNull(info.getDescription()); }
public void testMediaTypeSingleton() { final IGraphInfo info = new DefaultGraphInfo(_DEFAULT_URI, MediaType.XTM); assertEquals(_DEFAULT_URI, info.getURI()); assertEquals(-1, info.getLastModification()); assertEquals(1, info.getSupportedMediaTypes().size()); assertEquals(MediaType.XTM, info.getSupportedMediaTypes().get(0)); assertNull(info.getTitle()); assertNull(info.getDescription()); }
public void testMediaTypeSingletonTitleAndDescription() { final String title = "Graph"; final String descr = "Hi I'm a graph"; final IGraphInfo info = new DefaultGraphInfo(_DEFAULT_URI, MediaType.XTM, -1, title, descr); assertEquals(_DEFAULT_URI, info.getURI()); assertEquals(-1, info.getLastModification()); assertEquals(1, info.getSupportedMediaTypes().size()); assertEquals(MediaType.XTM, info.getSupportedMediaTypes().get(0)); assertEquals(title, info.getTitle()); assertEquals(descr, info.getDescription()); }
public void testMediaTypeList() { final List<MediaType> mediaTypes = new ArrayList<MediaType>(); mediaTypes.add(MediaType.XTM); mediaTypes.add(MediaType.RDF_XML); final IGraphInfo info = new DefaultGraphInfo(_DEFAULT_URI, mediaTypes); assertEquals(_DEFAULT_URI, info.getURI()); assertEquals(-1, info.getLastModification()); assertEquals(2, info.getSupportedMediaTypes().size()); assertTrue(info.getSupportedMediaTypes().contains(MediaType.XTM)); assertTrue(info.getSupportedMediaTypes().contains(MediaType.RDF_XML)); assertNull(info.getTitle()); assertNull(info.getDescription()); }
public void testMediaTypeListTitleAndDescription() { final String title = "Graph"; final String descr = "Hi I'm a graph"; final List<MediaType> mediaTypes = new ArrayList<MediaType>(); mediaTypes.add(MediaType.XTM); mediaTypes.add(MediaType.RDF_XML); final IGraphInfo info = new DefaultGraphInfo(_DEFAULT_URI, mediaTypes, -1, title, descr); assertEquals(_DEFAULT_URI, info.getURI()); assertEquals(-1, info.getLastModification()); assertEquals(2, info.getSupportedMediaTypes().size()); assertTrue(info.getSupportedMediaTypes().contains(MediaType.XTM)); assertTrue(info.getSupportedMediaTypes().contains(MediaType.RDF_XML)); assertEquals(title, info.getTitle()); assertEquals(descr, info.getDescription()); }