@Test public void test() throws Exception { BaleenCollectionReader bcr = getCollectionReader( ACTIVEMQ, erd, KEY_CONTENT_EXTRACTOR, cerd, ActiveMQReader.PARAM_ENDPOINT, ENDPOINT); final SharedActiveMQResource samr = (SharedActiveMQResource) bcr.getUimaContext().getResourceObject(ACTIVEMQ); createContent(samr); assertTrue(bcr.doHasNext()); bcr.getNext(jCas); assertEquals("Hello, World", jCas.getDocumentText().trim()); assertEquals(1, JCasUtil.select(jCas, Metadata.class).size()); jCas.reset(); assertTrue(bcr.doHasNext()); bcr.getNext(jCas); assertEquals("Hello, Test", jCas.getDocumentText().trim()); assertEquals(1, JCasUtil.select(jCas, Metadata.class).size()); jCas.reset(); assertFalse(bcr.doHasNext()); bcr.close(); }
@Override public boolean doHasNext() throws IOException, CollectionException { try { return activeMQ .createQueueBrowser(endpoint, messageSelector) .getEnumeration() .hasMoreElements(); } catch (final JMSException e) { throw new CollectionException(e); } }
ActiveMQReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { try { return activeMQ .createQueueBrowser(endpoint, messageSelector) .getEnumeration() .hasMoreElements(); } catch (final JMSException e) { throw new CollectionException(e); } } }
ActiveMQReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { try { return activeMQ .createQueueBrowser(endpoint, messageSelector) .getEnumeration() .hasMoreElements(); } catch (final JMSException e) { throw new CollectionException(e); } }  }
ActiveMQReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { try { return activeMQ .createQueueBrowser(endpoint, messageSelector) .getEnumeration() .hasMoreElements(); } catch (final JMSException e) { throw new CollectionException(e); } }  @Override boolean doHasNext(); }
ActiveMQReader extends BaleenCollectionReader { @Override public boolean doHasNext() throws IOException, CollectionException { try { return activeMQ .createQueueBrowser(endpoint, messageSelector) .getEnumeration() .hasMoreElements(); } catch (final JMSException e) { throw new CollectionException(e); } }  @Override boolean doHasNext(); static final String KEY_ACTIVEMQ; static final String PARAM_ENDPOINT; static final String PARAM_MESSAGE_SELECTOR; }