@Override public Iterable<SchemaEntry> allEntries() { return delegate.allEntries(); }
@Override public Iterable<SchemaEntry> allEntries() { return delegate.allEntries(); }
/** * Returns all schemas in the given subject, serialized with * {@link org.schemarepo.RepositoryUtil#schemasToString(Iterable)} * * @param subject * The name of the subject * @return all schemas in the subject. Return a 404 Not Found if there is no such subject */ @GET @Path("{subject}/all") public Response allSchemaEntries(@HeaderParam("Accept") String mediaType, @PathParam("subject") String subject) { Subject s = repo.lookup(subject); if (null == s) { throw new NotFoundException(MessageStrings.SUBJECT_DOES_NOT_EXIST_ERROR); } Renderer renderer = getRenderer(mediaType); return Response.ok(renderer.renderSchemas(s.allEntries()), renderer.getMediaType()).build(); }
/** * Returns all schemas in the given subject, serialized with * {@link org.schemarepo.RepositoryUtil#schemasToString(Iterable)} * * @param subject * The name of the subject * @return all schemas in the subject. Return a 404 Not Found if there is no such subject */ @GET @Path("{subject}/all") public Response allSchemaEntries(@HeaderParam("Accept") String mediaType, @PathParam("subject") String subject) { Subject s = repo.lookup(subject); if (null == s) { throw new NotFoundException(MessageStrings.SUBJECT_DOES_NOT_EXIST_ERROR); } Renderer renderer = getRenderer(mediaType); return Response.ok(renderer.renderSchemas(s.allEntries()), renderer.getMediaType()).build(); }
@Test public void testAllEntriesMultiLineSchema() throws Exception { String endOfLine = System.getProperty("line.separator"); String multiLineSchema1 = "first line" + endOfLine + "second line"; String multiLineSchema2 = "first line" + endOfLine + "second line" + endOfLine; repo.register("sub1", null).register(multiLineSchema1); repo.register("sub1", null).register(multiLineSchema2); Subject s1 = repo.lookup("sub1"); Assert.assertNotNull(s1); Iterable<SchemaEntry> allEntries = s1.allEntries(); boolean foundSub1 = false, foundSub2 = false; for (SchemaEntry entry: allEntries) { if (entry.getSchema().equals(multiLineSchema1)) { foundSub1 = true; } else if (entry.getSchema().equals(multiLineSchema2)) { foundSub2 = true; } } Assert.assertTrue("Check that allEntries() returns proper multi-line schemas", foundSub1 && foundSub2); }
for (SchemaEntry s : readOnlySubject.allEntries()) { if (s.equals(foo)) { foundfoo = true;
subject.latest()); boolean foundfoo = false, foundbar = false; for (SchemaEntry s : sub3.allEntries()) { if (s.equals(foo)) { foundfoo = true; Iterator<SchemaEntry> allEntries = sub3.allEntries().iterator();