target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testAddMessageReTrigger() throws Exception { addNumberOfMessages(2 * MESSAGE_THRESHOLD); verify(collector, times(2)).onDrain(anyListOf(ClientMessage.class)); } | private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : consumers) { drain.onD... | MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con... | MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con... | MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con... | MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con... |
@Test public void testMetricPendingMessagesTrack() throws Exception { ClientMessage message = messageFactory.trackPath(Paths.get(TEST_PATH), UUID); cut.onMessage(message); assertThat(metrics.getCounters().get(TaskMessageHandler.METRIC_NAME_PENDING_MESSAGES).getCount(), is(1L)); } | @Override public void onMessage(ClientMessage msg) { try { if (isTaskType(msg, TaskType.track)) { String path = msg.getStringProperty(MessageProperty.path.toString()); long most = msg.getBodyBuffer().readLong(); long least = msg.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Tracking new path ... | TaskMessageHandler implements MessageHandler { @Override public void onMessage(ClientMessage msg) { try { if (isTaskType(msg, TaskType.track)) { String path = msg.getStringProperty(MessageProperty.path.toString()); long most = msg.getBodyBuffer().readLong(); long least = msg.getBodyBuffer().readLong(); if (LOGGER.isTra... | TaskMessageHandler implements MessageHandler { @Override public void onMessage(ClientMessage msg) { try { if (isTaskType(msg, TaskType.track)) { String path = msg.getStringProperty(MessageProperty.path.toString()); long most = msg.getBodyBuffer().readLong(); long least = msg.getBodyBuffer().readLong(); if (LOGGER.isTra... | TaskMessageHandler implements MessageHandler { @Override public void onMessage(ClientMessage msg) { try { if (isTaskType(msg, TaskType.track)) { String path = msg.getStringProperty(MessageProperty.path.toString()); long most = msg.getBodyBuffer().readLong(); long least = msg.getBodyBuffer().readLong(); if (LOGGER.isTra... | TaskMessageHandler implements MessageHandler { @Override public void onMessage(ClientMessage msg) { try { if (isTaskType(msg, TaskType.track)) { String path = msg.getStringProperty(MessageProperty.path.toString()); long most = msg.getBodyBuffer().readLong(); long least = msg.getBodyBuffer().readLong(); if (LOGGER.isTra... |
@Test public void testStop() throws Exception { cut.stop(); verify(collector, timeout(VERIFY_TIMEOUT)).drain(); verify(consumer).close(); } | @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQException e) { LOGGER.warn("Failed to close... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... |
@Test(timeout = TEST_TIMEOUT) public void testDrainOnNoMessage() throws Exception { cut.stop(); Mockito.reset(collector); when(consumer.receive(anyLong())).thenReturn(null); cut = new ResultMessageSink(session, collector); verify(collector, timeout(VERIFY_TIMEOUT).atLeastOnce()).drain(); verify(collector, never()).addM... | @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQException e) { LOGGER.warn("Failed to close... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... |
@Test public void testMessageReadFailure() throws Exception { cut.stop(); Mockito.reset(collector); when(consumer.receive(anyLong())).thenThrow(new ActiveMQException("test")); cut = new ResultMessageSink(session, collector); verify(collector, atMost(1)).drain(); verify(collector, never()).addMessage(any(ClientMessage.c... | @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQException e) { LOGGER.warn("Failed to close... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... | ResultMessageSink implements Node { @Override public void stop() { LOGGER.info("Stopping {}", WORKER_THREAD_NAME); sink.interrupt(); try { sink.join(); } catch (InterruptedException ie) { LOGGER.warn("Interrupted while wating for sink to terminate: {}", ie.toString()); } try { consumer.close(); } catch (ActiveMQExcepti... |
@Test public void testBufferResize() throws Exception { hashRequestMessage = messageFactory.hashRequestMessage(new byte[LARGE_DATA_SIZE], TEST_UUID); cut.onMessage(hashRequestMessage); assertThat(metrics.getMeters().get(HasherNode.METRIC_NAME_BUFFER_RESIZE).getCount(), is(1L)); } | @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Got hash request with UUID {}, size {}", new UU... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... |
@Test public void testReadAllData() throws Exception { byte[] read = new byte[TEST_DATA.length]; input.read(read); assertThat(read, is(TEST_DATA)); } | @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } |
@Test public void testHashDuration() throws Exception { cut.onMessage(hashRequestMessage); assertThat(metrics.getTimers().get(HasherNode.METRIC_NAME_HASH_DURATION).getSnapshot().getMean(), is(not(0.0))); } | @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Got hash request with UUID {}, size {}", new UU... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... |
@Test public void testHashDurationOnFailure() throws Exception { Mockito.reset(hasher); when(hasher.getLongHash(nullable(BufferedImage.class))).thenThrow(new IOException("Testing")); cut.onMessage(hashRequestMessage); assertThat(metrics.getTimers().get(HasherNode.METRIC_NAME_HASH_DURATION).getSnapshot().getMean(), is(0... | @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Got hash request with UUID {}, size {}", new UU... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... | HasherNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { hashRequests.mark(); Context hashTimeContext = hashDuration.time(); try { long most = message.getBodyBuffer().readLong(); long least = message.getBodyBuffer().readLong(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Go... |
@Test public void testToStringStart() throws Exception { assertThat(cut.toString(), startsWith("HasherNode {")); } | @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } } | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, ... | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, ... | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, ... |
@Test public void testToStringEnd() throws Exception { assertThat(cut.toString(), endsWith("}")); } | @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } } | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, ... | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, ... | HasherNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(HasherNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, ... |
@Test public void testStop() throws Exception { cut.stop(); assertThat(session.isClosed(), is(true)); } | @Override public void stop() { LOGGER.info("Stopping {}...", this.toString()); MessagingUtil.silentClose(consumer); MessagingUtil.silentClose(producer); MessagingUtil.silentClose(session); } | HasherNode implements MessageHandler, Node { @Override public void stop() { LOGGER.info("Stopping {}...", this.toString()); MessagingUtil.silentClose(consumer); MessagingUtil.silentClose(producer); MessagingUtil.silentClose(session); } } | HasherNode implements MessageHandler, Node { @Override public void stop() { LOGGER.info("Stopping {}...", this.toString()); MessagingUtil.silentClose(consumer); MessagingUtil.silentClose(producer); MessagingUtil.silentClose(session); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, String r... | HasherNode implements MessageHandler, Node { @Override public void stop() { LOGGER.info("Stopping {}...", this.toString()); MessagingUtil.silentClose(consumer); MessagingUtil.silentClose(producer); MessagingUtil.silentClose(session); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, String r... | HasherNode implements MessageHandler, Node { @Override public void stop() { LOGGER.info("Stopping {}...", this.toString()); MessagingUtil.silentClose(consumer); MessagingUtil.silentClose(producer); MessagingUtil.silentClose(session); } HasherNode(ClientSession session, ImagePHash hasher, String requestAddress, String r... |
@Test public void testQueryPending() throws Exception { List<String> pending = queryMessage.pendingImagePaths(); assertThat(pending, hasItem(PATH.toString())); } | @Override public String toString() { return RepositoryNode.class.getSimpleName(); } | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } } | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } RepositoryNode(ClientSession session, String queryAddress, String taskAddress,
PendingHashImageRepository pendingRepository, ImageRepository imageRepository,
TaskMessageHandler task... | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } RepositoryNode(ClientSession session, String queryAddress, String taskAddress,
PendingHashImageRepository pendingRepository, ImageRepository imageRepository,
TaskMessageHandler task... | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } RepositoryNode(ClientSession session, String queryAddress, String taskAddress,
PendingHashImageRepository pendingRepository, ImageRepository imageRepository,
TaskMessageHandler task... |
@Test public void testToString() throws Exception { assertThat(cut.toString(), is("RepositoryNode")); } | @Override public String toString() { return RepositoryNode.class.getSimpleName(); } | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } } | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } RepositoryNode(ClientSession session, String queryAddress, String taskAddress,
PendingHashImageRepository pendingRepository, ImageRepository imageRepository,
TaskMessageHandler task... | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } RepositoryNode(ClientSession session, String queryAddress, String taskAddress,
PendingHashImageRepository pendingRepository, ImageRepository imageRepository,
TaskMessageHandler task... | RepositoryNode implements MessageHandler, Node { @Override public String toString() { return RepositoryNode.class.getSimpleName(); } RepositoryNode(ClientSession session, String queryAddress, String taskAddress,
PendingHashImageRepository pendingRepository, ImageRepository imageRepository,
TaskMessageHandler task... |
@Test public void testProcessFile() throws Exception { cut.processFile(testFile); await().until(messages::size, is(1)); ClientMessage message = messages.get(0); assertThat(message.getStringProperty(MessageProperty.path.toString()), is(testFile.toString())); } | public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessage request = messageFactory.resizeRequest(path... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... |
@Test public void testProcessFileSkipDuplicateCached() throws Exception { cut.processFile(cachedFile); await().pollDelay(1, TimeUnit.SECONDS).until(messages::size, is(0)); } | public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessage request = messageFactory.resizeRequest(path... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... | StorageNode implements MessageHandler, Node { public boolean processFile(Path path) { LOGGER.trace("Processing {}", path); if (isAlreadySent(path)) { LOGGER.trace("File {} has already been sent, ignoring...", path); return true; } try (InputStream bis = new BufferedInputStream(Files.newInputStream(path))) { ClientMessa... |
@Test public void testToString() throws Exception { assertThat(cut.toString(), is("StorageNode")); } | @Override public String toString() { return StorageNode.class.getSimpleName(); } | StorageNode implements MessageHandler, Node { @Override public String toString() { return StorageNode.class.getSimpleName(); } } | StorageNode implements MessageHandler, Node { @Override public String toString() { return StorageNode.class.getSimpleName(); } StorageNode(ClientSession session, ExtendedAttributeQuery eaQuery, HashAttribute hashAttribute, List<Path> pendingPaths,
String resizeAddress, String eaUpdateAddress); @Inject StorageNode(@... | StorageNode implements MessageHandler, Node { @Override public String toString() { return StorageNode.class.getSimpleName(); } StorageNode(ClientSession session, ExtendedAttributeQuery eaQuery, HashAttribute hashAttribute, List<Path> pendingPaths,
String resizeAddress, String eaUpdateAddress); @Inject StorageNode(@... | StorageNode implements MessageHandler, Node { @Override public String toString() { return StorageNode.class.getSimpleName(); } StorageNode(ClientSession session, ExtendedAttributeQuery eaQuery, HashAttribute hashAttribute, List<Path> pendingPaths,
String resizeAddress, String eaUpdateAddress); @Inject StorageNode(@... |
@Test public void testReadAllDataByteRead() throws Exception { byte[] read = new byte[BUFFER_CAPACITY *2]; int actualRead = input.read(read); assertThat(actualRead, is(TEST_DATA.length)); } | @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } |
@Test public void testAvailable() throws Exception { assertThat(input.available(), is(TEST_DATA.length)); } | @Override public int available() throws IOException { return buffer.remaining(); } | ByteBufferInputstream extends InputStream { @Override public int available() throws IOException { return buffer.remaining(); } } | ByteBufferInputstream extends InputStream { @Override public int available() throws IOException { return buffer.remaining(); } ByteBufferInputstream(ByteBuffer buffer); } | ByteBufferInputstream extends InputStream { @Override public int available() throws IOException { return buffer.remaining(); } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } | ByteBufferInputstream extends InputStream { @Override public int available() throws IOException { return buffer.remaining(); } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } |
@Test public void testReadAllDataBuffered() throws Exception { byte[] read = new byte[TEST_DATA.length]; BufferedInputStream bis = new BufferedInputStream(input); bis.read(read); assertThat(read, is(TEST_DATA)); } | @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } | ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); } |
@Test public void testJpg() throws Exception { assertThat(cut.accept(createFile("foo.jpg")), is(true)); } | @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } |
@Test public void testJpeg() throws Exception { assertThat(cut.accept(createFile("foo.jpeg")), is(true)); } | @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } |
@Test public void testPng() throws Exception { assertThat(cut.accept(createFile("foo.png")), is(true)); } | @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } |
@Test public void testLoadImageJpg() throws Exception { BufferedImage image = ImageUtil.loadImage(jpgPath); assertThat(image.getHeight(), is(IMAGE_SIZE)); assertThat(image.getWidth(), is(IMAGE_SIZE)); } | public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } } | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } } | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } static Buffer... | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } static Buffer... |
@Test public void testGif() throws Exception { assertThat(cut.accept(createFile("foo.gif")), is(true)); } | @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } |
@Test public void testNonLowerCase() throws Exception { assertThat(cut.accept(createFile("foo.Jpg")), is(true)); } | @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } |
@Test public void testNonImageExtension() throws Exception { assertThat(cut.accept(createFile("foo.txt")), is(false)); } | @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } | ImageFileFilter implements Filter<Path> { @Override public boolean accept(Path entry) throws IOException { return extFilter.accept(entry); } ImageFileFilter(); @Override boolean accept(Path entry); } |
@Test public void testIncrementFailedFilesEvent() throws Exception { cut.incrementFailedFiles(); verify(listener).statisticsChangedEvent(eq(StatisticsEvent.FAILED_FILES), eq(1)); } | public void incrementFailedFiles() { dispatchEvent(StatisticsEvent.FAILED_FILES, failedFiles.incrementAndGet()); } | Statistics { public void incrementFailedFiles() { dispatchEvent(StatisticsEvent.FAILED_FILES, failedFiles.incrementAndGet()); } } | Statistics { public void incrementFailedFiles() { dispatchEvent(StatisticsEvent.FAILED_FILES, failedFiles.incrementAndGet()); } } | Statistics { public void incrementFailedFiles() { dispatchEvent(StatisticsEvent.FAILED_FILES, failedFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void increm... | Statistics { public void incrementFailedFiles() { dispatchEvent(StatisticsEvent.FAILED_FILES, failedFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void increm... |
@Test public void testIncrementFoundFilesEvent() throws Exception { cut.incrementFoundFiles(); verify(listener).statisticsChangedEvent(eq(StatisticsEvent.FOUND_FILES), eq(1)); } | public void incrementFoundFiles() { dispatchEvent(StatisticsEvent.FOUND_FILES, foundFiles.incrementAndGet()); } | Statistics { public void incrementFoundFiles() { dispatchEvent(StatisticsEvent.FOUND_FILES, foundFiles.incrementAndGet()); } } | Statistics { public void incrementFoundFiles() { dispatchEvent(StatisticsEvent.FOUND_FILES, foundFiles.incrementAndGet()); } } | Statistics { public void incrementFoundFiles() { dispatchEvent(StatisticsEvent.FOUND_FILES, foundFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void increment... | Statistics { public void incrementFoundFiles() { dispatchEvent(StatisticsEvent.FOUND_FILES, foundFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void increment... |
@Test public void testIncrementProcessedFilesFiles() throws Exception { cut.incrementProcessedFiles(); verify(listener).statisticsChangedEvent(eq(StatisticsEvent.PROCESSED_FILES), eq(1)); } | public void incrementProcessedFiles() { dispatchEvent(StatisticsEvent.PROCESSED_FILES, processedFiles.incrementAndGet()); } | Statistics { public void incrementProcessedFiles() { dispatchEvent(StatisticsEvent.PROCESSED_FILES, processedFiles.incrementAndGet()); } } | Statistics { public void incrementProcessedFiles() { dispatchEvent(StatisticsEvent.PROCESSED_FILES, processedFiles.incrementAndGet()); } } | Statistics { public void incrementProcessedFiles() { dispatchEvent(StatisticsEvent.PROCESSED_FILES, processedFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); vo... | Statistics { public void incrementProcessedFiles() { dispatchEvent(StatisticsEvent.PROCESSED_FILES, processedFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); vo... |
@Test public void testIncrementSkippedFilesEvent() throws Exception { cut.incrementSkippedFiles(); verify(listener).statisticsChangedEvent(eq(StatisticsEvent.SKIPPED_FILES), eq(1)); } | public void incrementSkippedFiles() { dispatchEvent(StatisticsEvent.SKIPPED_FILES, skippedFiles.incrementAndGet()); } | Statistics { public void incrementSkippedFiles() { dispatchEvent(StatisticsEvent.SKIPPED_FILES, skippedFiles.incrementAndGet()); } } | Statistics { public void incrementSkippedFiles() { dispatchEvent(StatisticsEvent.SKIPPED_FILES, skippedFiles.incrementAndGet()); } } | Statistics { public void incrementSkippedFiles() { dispatchEvent(StatisticsEvent.SKIPPED_FILES, skippedFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void inc... | Statistics { public void incrementSkippedFiles() { dispatchEvent(StatisticsEvent.SKIPPED_FILES, skippedFiles.incrementAndGet()); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void inc... |
@Test public void testRemoveStatisticsListener() throws Exception { cut.removeStatisticsListener(listener); cut.incrementFailedFiles(); cut.incrementFoundFiles(); cut.incrementProcessedFiles(); cut.incrementSkippedFiles(); verifyZeroInteractions(listener); } | public void removeStatisticsListener(StatisticsChangedListener listener) { statisticsChangedListners.remove(listener); } | Statistics { public void removeStatisticsListener(StatisticsChangedListener listener) { statisticsChangedListners.remove(listener); } } | Statistics { public void removeStatisticsListener(StatisticsChangedListener listener) { statisticsChangedListners.remove(listener); } } | Statistics { public void removeStatisticsListener(StatisticsChangedListener listener) { statisticsChangedListners.remove(listener); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void ... | Statistics { public void removeStatisticsListener(StatisticsChangedListener listener) { statisticsChangedListners.remove(listener); } int getFoundFiles(); void incrementFoundFiles(); int getProcessedFiles(); void incrementProcessedFiles(); int getFailedFiles(); void incrementFailedFiles(); int getSkippedFiles(); void ... |
@Test public void testRemoveViaGroup() throws Exception { Result result = new Result(groupB, recordC); assertThat(groupB.getResults(), hasItem(result)); groupA.remove(result); assertThat(groupB.getResults(), not(hasItem(result))); } | public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } } | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } GroupList... | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } GroupList... | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } GroupList... |
@Test public void testGroupCount() throws Exception { assertThat(cut.groupCount(), is(2)); } | public int groupCount() { return groups.size(); } | GroupList { public int groupCount() { return groups.size(); } } | GroupList { public int groupCount() { return groups.size(); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public int groupCount() { return groups.size(); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount(); void remove(Result result); ResultGroup getGroup(long hash); List<ResultGroup> getAllGroups(); void setMappedLis... | GroupList { public int groupCount() { return groups.size(); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount(); void remove(Result result); ResultGroup getGroup(long hash); List<ResultGroup> getAllGroups(); void setMappedLis... |
@Test public void testLoadImageGif() throws Exception { BufferedImage image = ImageUtil.loadImage(gifPath); assertThat(image.getHeight(), is(IMAGE_SIZE)); assertThat(image.getWidth(), is(IMAGE_SIZE)); } | public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } } | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } } | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } static Buffer... | ImageUtil { public static BufferedImage loadImage(Path path) throws IOException { try (InputStream is = new BufferedInputStream(Files.newInputStream(path))) { BufferedImage bi; try { bi = ImageIO.read(is); } catch (ArrayIndexOutOfBoundsException e) { bi = GifDecoder.read(is).getFrame(0); } return bi; } } static Buffer... |
@Test public void testGetGroup() throws Exception { assertThat(cut.getGroup(HASH_A), is(groupA)); } | public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } } | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(C... | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(C... |
@Test(expected = IllegalArgumentException.class) public void testGetInvalidHash() throws Exception { cut.getGroup(-1); } | public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } } | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(C... | GroupList { public ResultGroup getGroup(long hash) throws IllegalArgumentException { ResultGroup group = hashToGroup.get(hash); if (group == null) { throw new IllegalArgumentException("Query for unknown hash"); } return group; } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(C... |
@Test public void testEmptyGroupRemovedFromGui() throws Exception { cut = new GroupList(dlm); initGroupList(); groupA.remove(new Result(groupA, recordC)); groupA.remove(new Result(groupA, recordA)); assertThat(dlm.contains(groupA), is(false)); } | public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } } | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } GroupList... | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } GroupList... | GroupList { public void remove(Result result) { Collection<ResultGroup> groupsToRemoveFrom = resultsToGroups.removeAll(result); LOGGER.debug("Removing {} from {} group(s).", result, groupsToRemoveFrom.size()); for (ResultGroup g : groupsToRemoveFrom) { g.remove(result, false); checkAndremoveEmptyGroup(g); } } GroupList... |
@Test public void testPreviousGroup() throws Exception { assertThat(cut.previousGroup(groupB), is(groupA)); } | public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCou... | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCou... |
@Test public void testPreviousGroupWithFirstGroup() throws Exception { assertThat(cut.previousGroup(groupA), is(groupA)); } | public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCou... | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCou... |
@Test public void testPreviousGroupWithUnknownGroup() throws Exception { assertThat(cut.previousGroup(groupUnknown), is(groupA)); } | public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCou... | GroupList { public ResultGroup previousGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(--index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCou... |
@Test public void testNextGroup() throws Exception { assertThat(cut.nextGroup(groupA), is(groupB)); } | public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount()... | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount()... |
@Test public void testNextGroupWithLastGroup() throws Exception { assertThat(cut.nextGroup(groupB), is(groupB)); } | public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount()... | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount()... |
@Test public void testNextGroupWithUnknownGroup() throws Exception { assertThat(cut.nextGroup(groupUnknown), is(groupA)); } | public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); } | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount()... | GroupList { public ResultGroup nextGroup(ResultGroup currentGroup) { int index = groups.indexOf(currentGroup); index = boundsCheckedIndex(++index); return groups.get(index); } GroupList(); GroupList(DefaultListModel<ResultGroup> mappedListModel); void populateList(Collection<ResultGroup> groupsToAdd); int groupCount()... |
@Test public void testGetImageRecord() throws Exception { assertThat(cut.getImageRecord(), is(imageRecord)); } | public ImageRecord getImageRecord() { return imageRecord; } | Result { public ImageRecord getImageRecord() { return imageRecord; } } | Result { public ImageRecord getImageRecord() { return imageRecord; } Result(ResultGroup parentGroup, ImageRecord imageRecord); } | Result { public ImageRecord getImageRecord() { return imageRecord; } Result(ResultGroup parentGroup, ImageRecord imageRecord); ImageRecord getImageRecord(); void remove(); @Override String toString(); @Override final int hashCode(); @Override final boolean equals(Object obj); } | Result { public ImageRecord getImageRecord() { return imageRecord; } Result(ResultGroup parentGroup, ImageRecord imageRecord); ImageRecord getImageRecord(); void remove(); @Override String toString(); @Override final int hashCode(); @Override final boolean equals(Object obj); } |
@Test public void testSanitizeTag() throws Exception { assertThat(StringUtil.sanitizeTag(TEST_TAG), is(TEST_TAG)); } | public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); static String sanitizeTag(String tagFromGui); } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); static String sanitizeTag(String tagFromGui); static final String MATCH_ALL_TAGS; } |
@Test public void testRemoveResult() throws Exception { cut.remove(); verify(parentGroup).remove(cut); } | public void remove() { LOGGER.debug("Removing result {}", this); parentGroup.remove(this); } | Result { public void remove() { LOGGER.debug("Removing result {}", this); parentGroup.remove(this); } } | Result { public void remove() { LOGGER.debug("Removing result {}", this); parentGroup.remove(this); } Result(ResultGroup parentGroup, ImageRecord imageRecord); } | Result { public void remove() { LOGGER.debug("Removing result {}", this); parentGroup.remove(this); } Result(ResultGroup parentGroup, ImageRecord imageRecord); ImageRecord getImageRecord(); void remove(); @Override String toString(); @Override final int hashCode(); @Override final boolean equals(Object obj); } | Result { public void remove() { LOGGER.debug("Removing result {}", this); parentGroup.remove(this); } Result(ResultGroup parentGroup, ImageRecord imageRecord); ImageRecord getImageRecord(); void remove(); @Override String toString(); @Override final int hashCode(); @Override final boolean equals(Object obj); } |
@Test public void testGetHash() throws Exception { assertThat(cut.getHash(), is(HASH)); } | public long getHash() { return hash; } | ResultGroup { public long getHash() { return hash; } } | ResultGroup { public long getHash() { return hash; } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public long getHash() { return hash; } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boolean hasResults(); @Override fina... | ResultGroup { public long getHash() { return hash; } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boolean hasResults(); @Override fina... |
@Test public void testGetResults() throws Exception { assertThat(cut.getResults(), hasItems(resultA, new Result(cut, recordB))); } | public List<Result> getResults() { return results; } | ResultGroup { public List<Result> getResults() { return results; } } | ResultGroup { public List<Result> getResults() { return results; } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public List<Result> getResults() { return results; } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boolean hasResults(); ... | ResultGroup { public List<Result> getResults() { return results; } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boolean hasResults(); ... |
@Test public void testRemove() throws Exception { assertThat(cut.remove(resultA), is(true)); } | public boolean remove(Result result) { return remove(result, true); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... |
@Test public void testRemoveNonExistingResult() throws Exception { cut.remove(resultA); assertThat(cut.remove(resultA), is(false)); } | public boolean remove(Result result) { return remove(result, true); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... |
@Test public void testNotifyParentOnResultRemoval() throws Exception { cut.remove(resultA); verify(parent).remove(resultA); } | public boolean remove(Result result) { return remove(result, true); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... |
@Test public void testRemoveWithoutNotification() throws Exception { cut.remove(resultA, false); verify(parent, never()).remove(resultA); } | public boolean remove(Result result) { return remove(result, true); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... | ResultGroup { public boolean remove(Result result) { return remove(result, true); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boole... |
@Test public void testHasResults() throws Exception { assertThat(cut.hasResults(), is(true)); } | public boolean hasResults() { return !results.isEmpty(); } | ResultGroup { public boolean hasResults() { return !results.isEmpty(); } } | ResultGroup { public boolean hasResults() { return !results.isEmpty(); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { public boolean hasResults() { return !results.isEmpty(); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boolean hasResul... | ResultGroup { public boolean hasResults() { return !results.isEmpty(); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Override String toString(); boolean hasResul... |
@Test public void testToString() throws Exception { assertThat(cut.toString(), is("42 (2)")); } | @Override public String toString() { return String.format("%d (%d)", this.hash, results.size()); } | ResultGroup { @Override public String toString() { return String.format("%d (%d)", this.hash, results.size()); } } | ResultGroup { @Override public String toString() { return String.format("%d (%d)", this.hash, results.size()); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); } | ResultGroup { @Override public String toString() { return String.format("%d (%d)", this.hash, results.size()); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Over... | ResultGroup { @Override public String toString() { return String.format("%d (%d)", this.hash, results.size()); } ResultGroup(GroupList parent, long hash, Collection<ImageRecord> records); long getHash(); List<Result> getResults(); boolean remove(Result result); boolean remove(Result result, boolean notifyParent); @Over... |
@Test public void testGetPath() throws Exception { assertThat(imageRecord.getPath(), is("foo")); } | public String getPath() { return path; } | ImageRecord implements Comparable<ImageRecord> { public String getPath() { return path; } } | ImageRecord implements Comparable<ImageRecord> { public String getPath() { return path; } @Deprecated ImageRecord(); ImageRecord(String path, long pHash); } | ImageRecord implements Comparable<ImageRecord> { public String getPath() { return path; } @Deprecated ImageRecord(); ImageRecord(String path, long pHash); String getPath(); long getpHash(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ImageRecord o); @Override String toStrin... | ImageRecord implements Comparable<ImageRecord> { public String getPath() { return path; } @Deprecated ImageRecord(); ImageRecord(String path, long pHash); String getPath(); long getpHash(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ImageRecord o); @Override String toStrin... |
@Test public void testSanitizeTagNull() throws Exception { assertThat(StringUtil.sanitizeTag(null), is(StringUtil.MATCH_ALL_TAGS)); } | public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); static String sanitizeTag(String tagFromGui); } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); static String sanitizeTag(String tagFromGui); static final String MATCH_ALL_TAGS; } |
@Test public void testGetpHash() throws Exception { assertThat(imageRecord.getpHash(), is(42L)); } | public long getpHash() { return pHash; } | ImageRecord implements Comparable<ImageRecord> { public long getpHash() { return pHash; } } | ImageRecord implements Comparable<ImageRecord> { public long getpHash() { return pHash; } @Deprecated ImageRecord(); ImageRecord(String path, long pHash); } | ImageRecord implements Comparable<ImageRecord> { public long getpHash() { return pHash; } @Deprecated ImageRecord(); ImageRecord(String path, long pHash); String getPath(); long getpHash(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ImageRecord o); @Override String toStrin... | ImageRecord implements Comparable<ImageRecord> { public long getpHash() { return pHash; } @Deprecated ImageRecord(); ImageRecord(String path, long pHash); String getPath(); long getpHash(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ImageRecord o); @Override String toStrin... |
@Test public void testCompareToSelf() throws Exception { assertThat(imageRecord.compareTo(imageRecord), is(0)); } | @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... |
@Test(expected = NullPointerException.class) public void testCompareToNull() throws Exception { imageRecord.compareTo(null); } | @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... |
@Test public void testCompareToBigger() throws Exception { assertThat(imageRecord.compareTo(new ImageRecord("bar", 55)), is(-1)); } | @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... |
@Test public void testCompareToSmaller() throws Exception { assertThat(imageRecord.compareTo(new ImageRecord("bar", 7)), is(1)); } | @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... |
@Test public void testCompareToEqual() throws Exception { assertThat(imageRecord.compareTo(new ImageRecord("bar", 42)), is(0)); } | @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } } | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... | ImageRecord implements Comparable<ImageRecord> { @Override public int compareTo(ImageRecord o) { if (o == null) { throw new NullPointerException(); } if (this.pHash == o.getpHash()) { return 0; } else if (this.getpHash() > o.pHash) { return 1; } else { return -1; } } @Deprecated ImageRecord(); ImageRecord(String path... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(ImageRecord.class).suppress(Warning.NONFINAL_FIELDS).verify(); } | @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImageRecord other = (ImageRecord) obj; if (pHash != other.pHash) return false; if (path == null) { if (other.path != null) return false; } else if (!path.equals(othe... | ImageRecord implements Comparable<ImageRecord> { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImageRecord other = (ImageRecord) obj; if (pHash != other.pHash) return false; if (path == null) { if (other.path !=... | ImageRecord implements Comparable<ImageRecord> { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImageRecord other = (ImageRecord) obj; if (pHash != other.pHash) return false; if (path == null) { if (other.path !=... | ImageRecord implements Comparable<ImageRecord> { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImageRecord other = (ImageRecord) obj; if (pHash != other.pHash) return false; if (path == null) { if (other.path !=... | ImageRecord implements Comparable<ImageRecord> { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImageRecord other = (ImageRecord) obj; if (pHash != other.pHash) return false; if (path == null) { if (other.path !=... |
@Test public void testToString() throws Exception { assertThat(imageRecord.toString(), is(EXPECTED_TO_STRING)); } | @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ImageRecord"); sb.append("{"); sb.append("path:"); sb.append(path); sb.append(","); sb.append("hash:"); sb.append(pHash); sb.append("}"); return sb.toString(); } | ImageRecord implements Comparable<ImageRecord> { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ImageRecord"); sb.append("{"); sb.append("path:"); sb.append(path); sb.append(","); sb.append("hash:"); sb.append(pHash); sb.append("}"); return sb.toString(); } } | ImageRecord implements Comparable<ImageRecord> { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ImageRecord"); sb.append("{"); sb.append("path:"); sb.append(path); sb.append(","); sb.append("hash:"); sb.append(pHash); sb.append("}"); return sb.toString(); } @Deprecated ImageRec... | ImageRecord implements Comparable<ImageRecord> { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ImageRecord"); sb.append("{"); sb.append("path:"); sb.append(path); sb.append(","); sb.append("hash:"); sb.append(pHash); sb.append("}"); return sb.toString(); } @Deprecated ImageRec... | ImageRecord implements Comparable<ImageRecord> { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ImageRecord"); sb.append("{"); sb.append("path:"); sb.append(path); sb.append(","); sb.append("hash:"); sb.append(pHash); sb.append("}"); return sb.toString(); } @Deprecated ImageRec... |
@Test public void testGetPath() throws Exception { assertThat(badFileRecord.getPath(), is("bad")); } | public String getPath() { return path; } | BadFileRecord { public String getPath() { return path; } } | BadFileRecord { public String getPath() { return path; } @Deprecated BadFileRecord(); BadFileRecord(Path path); } | BadFileRecord { public String getPath() { return path; } @Deprecated BadFileRecord(); BadFileRecord(Path path); String getPath(); } | BadFileRecord { public String getPath() { return path; } @Deprecated BadFileRecord(); BadFileRecord(Path path); String getPath(); } |
@Test public void testRepositoryExceptionStringThrowableMessage() throws Exception { cut = new RepositoryException(TEST_MESSAGE, testException); assertThat(cut.getMessage(), is(TEST_MESSAGE)); } | public final String getMessage() { return message; } | RepositoryException extends Exception { public final String getMessage() { return message; } } | RepositoryException extends Exception { public final String getMessage() { return message; } RepositoryException(String message, Throwable cause); RepositoryException(String message); } | RepositoryException extends Exception { public final String getMessage() { return message; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } | RepositoryException extends Exception { public final String getMessage() { return message; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } |
@Test public void testSanitizeTagEmpty() throws Exception { assertThat(StringUtil.sanitizeTag(""), is(StringUtil.MATCH_ALL_TAGS)); } | public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); static String sanitizeTag(String tagFromGui); } | StringUtil { public static String sanitizeTag(String tagFromGui) { if (tagFromGui == null || "".equals(tagFromGui)) { return MATCH_ALL_TAGS; } return tagFromGui; } private StringUtil(); static String sanitizeTag(String tagFromGui); static final String MATCH_ALL_TAGS; } |
@Test public void testRepositoryExceptionStringThrowableCause() throws Exception { cut = new RepositoryException(TEST_MESSAGE, testException); assertThat(cut.getCause(), is(testException)); } | public final Throwable getCause() { return cause; } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } RepositoryException(String message, Throwable cause); RepositoryException(String message); } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } |
@Test public void testRepositoryExceptionStringMessage() throws Exception { cut = new RepositoryException(TEST_MESSAGE); assertThat(cut.getMessage(), is(TEST_MESSAGE)); } | public final String getMessage() { return message; } | RepositoryException extends Exception { public final String getMessage() { return message; } } | RepositoryException extends Exception { public final String getMessage() { return message; } RepositoryException(String message, Throwable cause); RepositoryException(String message); } | RepositoryException extends Exception { public final String getMessage() { return message; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } | RepositoryException extends Exception { public final String getMessage() { return message; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } |
@Test public void testRepositoryExceptionStringCause() throws Exception { cut = new RepositoryException(TEST_MESSAGE); assertThat(cut.getCause(), nullValue()); } | public final Throwable getCause() { return cause; } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } RepositoryException(String message, Throwable cause); RepositoryException(String message); } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } | RepositoryException extends Exception { public final Throwable getCause() { return cause; } RepositoryException(String message, Throwable cause); RepositoryException(String message); final String getMessage(); final Throwable getCause(); } |
@Test public void testBuildFilterRepository() throws Exception { FilterRepository fr = cut.buildFilterRepository(); fr.store(new FilterRecord(0, new Tag(TEST_STRING))); } | @Override public FilterRepository buildFilterRepository() throws RepositoryException { return new OrmliteFilterRepository(filterRecordDao, thumbnailDao); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public FilterRepository buildFilterRepository() throws RepositoryException { return new OrmliteFilterRepository(filterRecordDao, thumbnailDao); } } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public FilterRepository buildFilterRepository() throws RepositoryException { return new OrmliteFilterRepository(filterRecordDao, thumbnailDao); } @Inject OrmliteRepositoryFactory(Database database); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public FilterRepository buildFilterRepository() throws RepositoryException { return new OrmliteFilterRepository(filterRecordDao, thumbnailDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @O... | OrmliteRepositoryFactory implements RepositoryFactory { @Override public FilterRepository buildFilterRepository() throws RepositoryException { return new OrmliteFilterRepository(filterRecordDao, thumbnailDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @O... |
@Test public void testBuildImageRepository() throws Exception { ImageRepository ir = cut.buildImageRepository(); ir.store(new ImageRecord(TEST_STRING, 0)); } | @Override public ImageRepository buildImageRepository() throws RepositoryException { return new OrmliteImageRepository(imageRecordDao, ignoreDao); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public ImageRepository buildImageRepository() throws RepositoryException { return new OrmliteImageRepository(imageRecordDao, ignoreDao); } } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public ImageRepository buildImageRepository() throws RepositoryException { return new OrmliteImageRepository(imageRecordDao, ignoreDao); } @Inject OrmliteRepositoryFactory(Database database); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public ImageRepository buildImageRepository() throws RepositoryException { return new OrmliteImageRepository(imageRecordDao, ignoreDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @Override... | OrmliteRepositoryFactory implements RepositoryFactory { @Override public ImageRepository buildImageRepository() throws RepositoryException { return new OrmliteImageRepository(imageRecordDao, ignoreDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @Override... |
@Test public void testBuildTagRepository() throws Exception { TagRepository tr = cut.buildTagRepository(); tr.store(new Tag(TEST_STRING)); } | @Override public TagRepository buildTagRepository() throws RepositoryException { return new OrmliteTagRepository(tagDao); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public TagRepository buildTagRepository() throws RepositoryException { return new OrmliteTagRepository(tagDao); } } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public TagRepository buildTagRepository() throws RepositoryException { return new OrmliteTagRepository(tagDao); } @Inject OrmliteRepositoryFactory(Database database); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public TagRepository buildTagRepository() throws RepositoryException { return new OrmliteTagRepository(tagDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @Override ImageRepository buildIma... | OrmliteRepositoryFactory implements RepositoryFactory { @Override public TagRepository buildTagRepository() throws RepositoryException { return new OrmliteTagRepository(tagDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @Override ImageRepository buildIma... |
@Test public void testBuildPendingImageRepository() throws Exception { PendingHashImageRepository phir = cut.buildPendingHashImageRepository(); phir.store(new PendingHashImage(TEST_STRING, 0, 0)); } | @Override public PendingHashImageRepository buildPendingHashImageRepository() throws RepositoryException { return new OrmlitePendingHashImage(pendingDao); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public PendingHashImageRepository buildPendingHashImageRepository() throws RepositoryException { return new OrmlitePendingHashImage(pendingDao); } } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public PendingHashImageRepository buildPendingHashImageRepository() throws RepositoryException { return new OrmlitePendingHashImage(pendingDao); } @Inject OrmliteRepositoryFactory(Database database); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public PendingHashImageRepository buildPendingHashImageRepository() throws RepositoryException { return new OrmlitePendingHashImage(pendingDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @... | OrmliteRepositoryFactory implements RepositoryFactory { @Override public PendingHashImageRepository buildPendingHashImageRepository() throws RepositoryException { return new OrmlitePendingHashImage(pendingDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @... |
@Test public void testBuildIgnoreRepository() throws Exception { IgnoreRepository ir = cut.buildIgnoreRepository(); ir.store(new IgnoreRecord(new ImageRecord(TEST_STRING, 0))); } | @Override public IgnoreRepository buildIgnoreRepository() throws RepositoryException { return new OrmliteIgnoreRepository(ignoreDao); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public IgnoreRepository buildIgnoreRepository() throws RepositoryException { return new OrmliteIgnoreRepository(ignoreDao); } } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public IgnoreRepository buildIgnoreRepository() throws RepositoryException { return new OrmliteIgnoreRepository(ignoreDao); } @Inject OrmliteRepositoryFactory(Database database); } | OrmliteRepositoryFactory implements RepositoryFactory { @Override public IgnoreRepository buildIgnoreRepository() throws RepositoryException { return new OrmliteIgnoreRepository(ignoreDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @Override ImageReposit... | OrmliteRepositoryFactory implements RepositoryFactory { @Override public IgnoreRepository buildIgnoreRepository() throws RepositoryException { return new OrmliteIgnoreRepository(ignoreDao); } @Inject OrmliteRepositoryFactory(Database database); @Override FilterRepository buildFilterRepository(); @Override ImageReposit... |
@Test public void testStoreQueryDatabase() throws Exception { cut.store(newEntry); assertThat(dao.queryForMatchingArgs(newEntry), hasSize(1)); } | @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw new RepositoryException("Failed to store entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... |
@Test public void testStoreReturnValue() throws Exception { assertThat(cut.store(newEntry), is(true)); } | @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw new RepositoryException("Failed to store entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... |
@Test public void testSupportsExtendedAttributes() throws Exception { assertThat(ExtendedAttribute.supportsExtendedAttributes(tempFile), is(true)); } | public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, falling back to write test...", e.toString(), path); r... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... |
@Test public void testStoreDuplicate() throws Exception { assertThat(cut.store(existingEntry), is(false)); } | @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw new RepositoryException("Failed to store entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public synchronized boolean store(PendingHashImage image) throws RepositoryException { try { if (pendingDao.queryForMatchingArgs(image).isEmpty()) { pendingDao.create(image); return true; } else { return false; } } catch (SQLException e) { throw ... |
@Test public void testExistsById() throws Exception { assertThat(cut.exists(existingEntry), is(true)); } | @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryException("Failed to lookup entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... |
@Test public void testExistsByPath() throws Exception { assertThat(cut.exists(new PendingHashImage(EXISTING_PATH, UUID_EXISTING)), is(true)); } | @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryException("Failed to lookup entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... |
@Test public void testExistsNotFound() throws Exception { assertThat(cut.exists(newEntry), is(false)); } | @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryException("Failed to lookup entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public boolean exists(PendingHashImage image) throws RepositoryException { try { if (pendingDao.refresh(image) == 0) { return !pendingDao.queryForMatching(image).isEmpty(); } else { return true; } } catch (SQLException e) { throw new RepositoryEx... |
@Test public void testGetAll() throws Exception { dao.create(newEntry); assertThat(cut.getAll(), containsInAnyOrder(newEntry, existingEntry)); } | @Override public List<PendingHashImage> getAll() throws RepositoryException { try { return pendingDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all entries", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public List<PendingHashImage> getAll() throws RepositoryException { try { return pendingDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all entries", e); } } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public List<PendingHashImage> getAll() throws RepositoryException { try { return pendingDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all entries", e); } } OrmlitePendingHashImage(Dao<PendingHash... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public List<PendingHashImage> getAll() throws RepositoryException { try { return pendingDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all entries", e); } } OrmlitePendingHashImage(Dao<PendingHash... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public List<PendingHashImage> getAll() throws RepositoryException { try { return pendingDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all entries", e); } } OrmlitePendingHashImage(Dao<PendingHash... |
@Test public void testGetByUuidNonExisting() throws Exception { assertThat(cut.getByUUID(UUID_NEW.getMostSignificantBits(), UUID_NEW.getLeastSignificantBits()), is(nullValue())); } | @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { throw new RepositoryException("Failed to get entry by id", e); }... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... |
@Test public void testGetByUuidExisting() throws Exception { assertThat(cut.getByUUID(UUID_EXISTING.getMostSignificantBits(), UUID_EXISTING.getLeastSignificantBits()), is(existingEntry)); } | @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { throw new RepositoryException("Failed to get entry by id", e); }... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public PendingHashImage getByUUID(long most, long least) throws RepositoryException { try { synchronized (uuidQuery) { mostParam.setValue(most); leastParam.setValue(least); return pendingDao.queryForFirst(uuidQuery); } } catch (SQLException e) { ... |
@Test public void testRemove() throws Exception { assertThat(dao.queryForSameId(existingEntry), is(notNullValue())); cut.remove(existingEntry); assertThat(dao.queryForSameId(existingEntry), is(nullValue())); } | @Override public void remove(PendingHashImage image) throws RepositoryException { try { pendingDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove entry", e); } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public void remove(PendingHashImage image) throws RepositoryException { try { pendingDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove entry", e); } } } | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public void remove(PendingHashImage image) throws RepositoryException { try { pendingDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove entry", e); } } OrmlitePendingHashImage(Dao<PendingHashImage, Integ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public void remove(PendingHashImage image) throws RepositoryException { try { pendingDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove entry", e); } } OrmlitePendingHashImage(Dao<PendingHashImage, Integ... | OrmlitePendingHashImage implements PendingHashImageRepository { @Override public void remove(PendingHashImage image) throws RepositoryException { try { pendingDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove entry", e); } } OrmlitePendingHashImage(Dao<PendingHashImage, Integ... |
@Test public void testStore() throws Exception { cut.store(imageNew); assertThat(imageDao.queryForId(pathNew), is(imageNew)); } | @Override public void store(ImageRecord image) throws RepositoryException { try { imageDao.createOrUpdate(image); } catch (SQLException e) { throw new RepositoryException("Failed to store image", e); } } | OrmliteImageRepository implements ImageRepository { @Override public void store(ImageRecord image) throws RepositoryException { try { imageDao.createOrUpdate(image); } catch (SQLException e) { throw new RepositoryException("Failed to store image", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public void store(ImageRecord image) throws RepositoryException { try { imageDao.createOrUpdate(image); } catch (SQLException e) { throw new RepositoryException("Failed to store image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<Ig... | OrmliteImageRepository implements ImageRepository { @Override public void store(ImageRecord image) throws RepositoryException { try { imageDao.createOrUpdate(image); } catch (SQLException e) { throw new RepositoryException("Failed to store image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<Ig... | OrmliteImageRepository implements ImageRepository { @Override public void store(ImageRecord image) throws RepositoryException { try { imageDao.createOrUpdate(image); } catch (SQLException e) { throw new RepositoryException("Failed to store image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<Ig... |
@Test public void testGetByHashExists() throws Exception { assertThat(cut.getByHash(HASH_EXISTING_RECORD), containsInAnyOrder(imageExisting)); } | @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteImageRepository... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteImageRepository... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteImageRepository... |
@Test public void testSupportsExtendedAttributesNoFile() throws Exception { assertThat(ExtendedAttribute.supportsExtendedAttributes(Jimfs.newFileSystem().getPath("noEAsupport")), is(false)); } | public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, falling back to write test...", e.toString(), path); r... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean supportsExtendedAttributes(Path path) { try { return Files.getFileStore(path).supportsFileAttributeView(UserDefinedFileAttributeView.class); } catch (IOException e) { LOGGER.debug("Failed to check extended attributes via FileStore ({}) for {}, ... |
@Test public void getPeer_one() throws Exception{ SeedPeers seedPeers = new SeedPeers(NetworkParameters.prodNet()); assertThat(seedPeers.getPeer(), notNullValue()); } | public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } | SeedPeers implements PeerDiscovery { public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } } | SeedPeers implements PeerDiscovery { public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); } | SeedPeers implements PeerDiscovery { public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); InetSocketAddress getPeer(); InetSocketAddress[] getPeers(long timeoutValue, T... | SeedPeers implements PeerDiscovery { public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); InetSocketAddress getPeer(); InetSocketAddress[] getPeers(long timeoutValue, T... |
@Test public void testBad_Amount() throws LitecoinURIParseException { try { testObject = new LitecoinURI(NetworkParameters.prodNet(), LitecoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?amount="); fail("Expecting LitecoinURIParseException"); } catch (LitecoinURIParseException e) { assertTrue(e.getMessage().con... | public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... |
@Test public void testBad_Label() throws LitecoinURIParseException { try { testObject = new LitecoinURI(NetworkParameters.prodNet(), LitecoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?label="); fail("Expecting LitecoinURIParseException"); } catch (LitecoinURIParseException e) { assertTrue(e.getMessage().conta... | public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... |
@Test public void testBad_Message() throws LitecoinURIParseException { try { testObject = new LitecoinURI(NetworkParameters.prodNet(), LitecoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?message="); fail("Expecting LitecoinURIParseException"); } catch (LitecoinURIParseException e) { assertTrue(e.getMessage().c... | public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... |
@Test public void testBad_Duplicated() throws LitecoinURIParseException { try { testObject = new LitecoinURI(NetworkParameters.prodNet(), LitecoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?address=aardvark"); fail("Expecting LitecoinURIParseException"); } catch (LitecoinURIParseException e) { assertTrue(e.get... | public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... |
@Test public void testBad_TooManyEquals() throws LitecoinURIParseException { try { testObject = new LitecoinURI(NetworkParameters.prodNet(), LitecoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?label=aardvark=zebra"); fail("Expecting LitecoinURIParseException"); } catch (LitecoinURIParseException e) { assertTru... | public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... |
@Test public void testBad_TooManyQuestionMarks() throws LitecoinURIParseException { try { testObject = new LitecoinURI(NetworkParameters.prodNet(), LitecoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?label=aardvark?message=zebra"); fail("Expecting LitecoinURIParseException"); } catch (LitecoinURIParseException... | public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); } | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... | LitecoinURI { public String getMessage() { return (String) parameterMap.get(FIELD_MESSAGE); } LitecoinURI(String uri); LitecoinURI(NetworkParameters params, String input); Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); Object getParameterByName(String name); @Override String toSt... |
@Test public void oneTx() throws Exception { BigInteger v1 = Utils.toNanoCoins(1, 0); Transaction t1 = createFakeTx(params, v1, myAddress); t1.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("1.2.3.4"))); t1.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("5.6.7.8"))); t1.get... | public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for (WalletTransaction wtx : wa... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... |
@Test public void testLastBlockSeenHash() throws Exception { Wallet wallet = new Wallet(params); Protos.Wallet walletProto = new WalletProtobufSerializer().walletToProto(wallet); ByteString lastSeenBlockHash = walletProto.getLastSeenBlockHash(); assertTrue(lastSeenBlockHash.isEmpty()); Block block = new Block(params, B... | public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for (WalletTransaction wtx : wa... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... | WalletProtobufSerializer { public Protos.Wallet walletToProto(Wallet wallet) { Protos.Wallet.Builder walletBuilder = Protos.Wallet.newBuilder(); walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); } for ... |
@Test public void balances() throws Exception { BigInteger nanos = Utils.toNanoCoins(1, 0); Transaction tx1 = sendMoneyToWallet(nanos, AbstractBlockChain.NewBlockType.BEST_CHAIN); assertEquals(nanos, tx1.getValueSentToMe(wallet, true)); Transaction send1 = wallet.createSend(new ECKey().toAddress(params), toNanoCoins(0,... | public Transaction createSend(Address address, BigInteger nanocoins) { SendRequest req = SendRequest.to(address, nanocoins); if (completeTx(req)) { return req.tx; } else { return null; } } | Wallet implements Serializable, BlockChainListener { public Transaction createSend(Address address, BigInteger nanocoins) { SendRequest req = SendRequest.to(address, nanocoins); if (completeTx(req)) { return req.tx; } else { return null; } } } | Wallet implements Serializable, BlockChainListener { public Transaction createSend(Address address, BigInteger nanocoins) { SendRequest req = SendRequest.to(address, nanocoins); if (completeTx(req)) { return req.tx; } else { return null; } } Wallet(NetworkParameters params); Wallet(NetworkParameters params, KeyCrypter... | Wallet implements Serializable, BlockChainListener { public Transaction createSend(Address address, BigInteger nanocoins) { SendRequest req = SendRequest.to(address, nanocoins); if (completeTx(req)) { return req.tx; } else { return null; } } Wallet(NetworkParameters params); Wallet(NetworkParameters params, KeyCrypter... | Wallet implements Serializable, BlockChainListener { public Transaction createSend(Address address, BigInteger nanocoins) { SendRequest req = SendRequest.to(address, nanocoins); if (completeTx(req)) { return req.tx; } else { return null; } } Wallet(NetworkParameters params); Wallet(NetworkParameters params, KeyCrypter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.