@Test void initBlockingQueue(@XWikiTempDir File tmpDir) { when(this.environment.getPermanentDirectory()).thenReturn(tmpDir); BlockingQueue<MentionsData> actual = this.provider.initBlockingQueue(); assertTrue(actual instanceof MapBasedLinkedBlockingQueue); }
@Override public BlockingQueue<MentionsData> initBlockingQueue() { File parentDir = new File(this.environment.getPermanentDirectory(), "mentions"); File queueFile = new File(parentDir, "mvqueue"); if (!parentDir.exists()) { try { Files.createDirectory(parentDir.toPath()); } catch (IOException e) { throw new RuntimeException("Error when initializing directory", e); } } this.mvStore = MVStore.open(queueFile.getAbsolutePath()); return new MapBasedLinkedBlockingQueue<>(this.mvStore.openMap("mentionsData")); }
DefaultMentionsBlockingQueueProvider implements MentionsBlockingQueueProvider { @Override public BlockingQueue<MentionsData> initBlockingQueue() { File parentDir = new File(this.environment.getPermanentDirectory(), "mentions"); File queueFile = new File(parentDir, "mvqueue"); if (!parentDir.exists()) { try { Files.createDirectory(parentDir.toPath()); } catch (IOException e) { throw new RuntimeException("Error when initializing directory", e); } } this.mvStore = MVStore.open(queueFile.getAbsolutePath()); return new MapBasedLinkedBlockingQueue<>(this.mvStore.openMap("mentionsData")); } }
DefaultMentionsBlockingQueueProvider implements MentionsBlockingQueueProvider { @Override public BlockingQueue<MentionsData> initBlockingQueue() { File parentDir = new File(this.environment.getPermanentDirectory(), "mentions"); File queueFile = new File(parentDir, "mvqueue"); if (!parentDir.exists()) { try { Files.createDirectory(parentDir.toPath()); } catch (IOException e) { throw new RuntimeException("Error when initializing directory", e); } } this.mvStore = MVStore.open(queueFile.getAbsolutePath()); return new MapBasedLinkedBlockingQueue<>(this.mvStore.openMap("mentionsData")); }  }
DefaultMentionsBlockingQueueProvider implements MentionsBlockingQueueProvider { @Override public BlockingQueue<MentionsData> initBlockingQueue() { File parentDir = new File(this.environment.getPermanentDirectory(), "mentions"); File queueFile = new File(parentDir, "mvqueue"); if (!parentDir.exists()) { try { Files.createDirectory(parentDir.toPath()); } catch (IOException e) { throw new RuntimeException("Error when initializing directory", e); } } this.mvStore = MVStore.open(queueFile.getAbsolutePath()); return new MapBasedLinkedBlockingQueue<>(this.mvStore.openMap("mentionsData")); }  @Override BlockingQueue<MentionsData> initBlockingQueue(); @Override void closeQueue(); }
DefaultMentionsBlockingQueueProvider implements MentionsBlockingQueueProvider { @Override public BlockingQueue<MentionsData> initBlockingQueue() { File parentDir = new File(this.environment.getPermanentDirectory(), "mentions"); File queueFile = new File(parentDir, "mvqueue"); if (!parentDir.exists()) { try { Files.createDirectory(parentDir.toPath()); } catch (IOException e) { throw new RuntimeException("Error when initializing directory", e); } } this.mvStore = MVStore.open(queueFile.getAbsolutePath()); return new MapBasedLinkedBlockingQueue<>(this.mvStore.openMap("mentionsData")); }  @Override BlockingQueue<MentionsData> initBlockingQueue(); @Override void closeQueue();  }