DirectoryBrowseResult { public BrowseResult buildBrowseResult(final DIDLParser didlParser) throws ContentDirectoryException { try { return new BrowseResult(didlParser.generate(didl), itemCount, totalCount); } catch (Exception e) { throw new ContentDirectoryException(CANNOT_PROCESS.getCode(), e.getMessage(), e); } } DirectoryBrowseResult(final long firstResult, final long maxResults); long getItemCount(); long getTotalCount(); long getFirstResult(); DIDLContent getDidl(); long getResultCount(); BrowseResult buildBrowseResult(final DIDLParser didlParser); void addItem(final String parentNodeId, final ContentNode contentNode, final String url); void addContainer(final String parentNodeId, final MediaNode node, final int childCount); boolean acceptNode();  }
@Test(expected = ContentDirectoryException.class) public void testBuildResultWithNoParser() throws ContentDirectoryException { new DirectoryBrowseResult(0, 0).buildBrowseResult(null); }