@Test public void testIdentifyFormatMock() throws Exception { final FormatIdentifierMock mock = new FormatIdentifierMock(); final List<FormatIdentifierResponse> responses = mock.analysePath(Paths.get("pathToFile")); assertNotNull(responses); assertEquals(responses.size(), 1); final FormatIdentifierResponse response = responses.get(0); assertEquals("Plain Text File", response.getFormatLiteral()); assertEquals("text/plain", response.getMimetype()); assertEquals("x-fmt/111", response.getPuid()); assertEquals("pronom", response.getMatchedNamespace()); }
@Override public List<FormatIdentifierResponse> analysePath(Path pathToFile) { try { if (isProbableZip(pathToFile) && isProbableSipFile(pathToFile)) { String formatLitteral = "Zip File"; String mimeType = "application/zip"; String formatId = "x-fmt/263"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); } } catch (IOException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } String formatLitteral = "Plain Text File"; String mimeType = "text/plain"; String formatId = "x-fmt/111"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); }
FormatIdentifierMock implements FormatIdentifier { @Override public List<FormatIdentifierResponse> analysePath(Path pathToFile) { try { if (isProbableZip(pathToFile) && isProbableSipFile(pathToFile)) { String formatLitteral = "Zip File"; String mimeType = "application/zip"; String formatId = "x-fmt/263"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); } } catch (IOException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } String formatLitteral = "Plain Text File"; String mimeType = "text/plain"; String formatId = "x-fmt/111"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); } }
FormatIdentifierMock implements FormatIdentifier { @Override public List<FormatIdentifierResponse> analysePath(Path pathToFile) { try { if (isProbableZip(pathToFile) && isProbableSipFile(pathToFile)) { String formatLitteral = "Zip File"; String mimeType = "application/zip"; String formatId = "x-fmt/263"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); } } catch (IOException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } String formatLitteral = "Plain Text File"; String mimeType = "text/plain"; String formatId = "x-fmt/111"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); }  }
FormatIdentifierMock implements FormatIdentifier { @Override public List<FormatIdentifierResponse> analysePath(Path pathToFile) { try { if (isProbableZip(pathToFile) && isProbableSipFile(pathToFile)) { String formatLitteral = "Zip File"; String mimeType = "application/zip"; String formatId = "x-fmt/263"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); } } catch (IOException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } String formatLitteral = "Plain Text File"; String mimeType = "text/plain"; String formatId = "x-fmt/111"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); }  @Override List<FormatIdentifierResponse> analysePath(Path pathToFile); @Override FormatIdentifierInfo status(); }
FormatIdentifierMock implements FormatIdentifier { @Override public List<FormatIdentifierResponse> analysePath(Path pathToFile) { try { if (isProbableZip(pathToFile) && isProbableSipFile(pathToFile)) { String formatLitteral = "Zip File"; String mimeType = "application/zip"; String formatId = "x-fmt/263"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); } } catch (IOException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); } String formatLitteral = "Plain Text File"; String mimeType = "text/plain"; String formatId = "x-fmt/111"; String ns = "pronom"; return Collections.singletonList(new FormatIdentifierResponse(formatLitteral, mimeType, formatId, ns)); }  @Override List<FormatIdentifierResponse> analysePath(Path pathToFile); @Override FormatIdentifierInfo status(); static final String ZIP; }