@Test public void testRunClient() throws Exception { File clientConfigFile = new File(rootDirectory + "src/test/resources/conf/ClientConfig.groovy"); File readerConfigFile = new File(rootDirectory + "src/test/resources/conf/readers/RandomStringCollectionReader.groovy"); File listenerConfigFile = new File(rootDirectory + "src/test/resources/conf/listeners/DoNothingListenerConfig.groovy"); MockCommandLineClient mockCLClient = new MockCommandLineClient( clientConfigFile, readerConfigFile, new File[] { listenerConfigFile } ); assertNotNull(mockCLClient); assertEquals(clientConfigFile.getAbsolutePath(), mockCLClient.clientConfigFile[0].getAbsolutePath()); assertEquals(readerConfigFile.getAbsolutePath(), mockCLClient.readerConfigFile[0].getAbsolutePath()); assertEquals(listenerConfigFile.getAbsolutePath(), mockCLClient.listenerConfigFileList[0].getAbsolutePath()); mockCLClient.runClient(); mockCLClient = new MockCommandLineClient(new String[] {}); assertNotNull(mockCLClient); mockCLClient.clientConfigFile = new File[] {clientConfigFile}; mockCLClient.readerConfigFile = new File[] {readerConfigFile}; mockCLClient.listenerConfigFileList = new File[] { listenerConfigFile }; mockCLClient.runClient(); }
public void runClient() { try { if (readerConfigFile.length > 1 || clientConfigFile.length > 1) { printUsage(); return; } List<UimaAsBaseCallbackListener> listeners = getListeners(listenerConfigFileList); LeoCollectionReaderInterface reader = getReader(readerConfigFile[0]); setClientProperties(myClient); System.out.println("Broker URL: " + myClient.getBrokerURL() + " Endpoint name: " + myClient.getEndpoint()); StopWatch stopWatch = new StopWatch(); stopWatch.start(); for (UimaAsBaseCallbackListener listener: listeners) { myClient.addUABListener(listener); } myClient.run(reader); System.out.println("Client finished in: " + stopWatch.getTime() + "ms."); } catch (Exception e) { e.printStackTrace(); } }
CommandLineClient { public void runClient() { try { if (readerConfigFile.length > 1 || clientConfigFile.length > 1) { printUsage(); return; } List<UimaAsBaseCallbackListener> listeners = getListeners(listenerConfigFileList); LeoCollectionReaderInterface reader = getReader(readerConfigFile[0]); setClientProperties(myClient); System.out.println("Broker URL: " + myClient.getBrokerURL() + " Endpoint name: " + myClient.getEndpoint()); StopWatch stopWatch = new StopWatch(); stopWatch.start(); for (UimaAsBaseCallbackListener listener: listeners) { myClient.addUABListener(listener); } myClient.run(reader); System.out.println("Client finished in: " + stopWatch.getTime() + "ms."); } catch (Exception e) { e.printStackTrace(); } } }
CommandLineClient { public void runClient() { try { if (readerConfigFile.length > 1 || clientConfigFile.length > 1) { printUsage(); return; } List<UimaAsBaseCallbackListener> listeners = getListeners(listenerConfigFileList); LeoCollectionReaderInterface reader = getReader(readerConfigFile[0]); setClientProperties(myClient); System.out.println("Broker URL: " + myClient.getBrokerURL() + " Endpoint name: " + myClient.getEndpoint()); StopWatch stopWatch = new StopWatch(); stopWatch.start(); for (UimaAsBaseCallbackListener listener: listeners) { myClient.addUABListener(listener); } myClient.run(reader); System.out.println("Client finished in: " + stopWatch.getTime() + "ms."); } catch (Exception e) { e.printStackTrace(); } } CommandLineClient(String[] args);  CommandLineClient(File clientConfigFile, File readerConfig, File[] listenerConfigFiles); }
CommandLineClient { public void runClient() { try { if (readerConfigFile.length > 1 || clientConfigFile.length > 1) { printUsage(); return; } List<UimaAsBaseCallbackListener> listeners = getListeners(listenerConfigFileList); LeoCollectionReaderInterface reader = getReader(readerConfigFile[0]); setClientProperties(myClient); System.out.println("Broker URL: " + myClient.getBrokerURL() + " Endpoint name: " + myClient.getEndpoint()); StopWatch stopWatch = new StopWatch(); stopWatch.start(); for (UimaAsBaseCallbackListener listener: listeners) { myClient.addUABListener(listener); } myClient.run(reader); System.out.println("Client finished in: " + stopWatch.getTime() + "ms."); } catch (Exception e) { e.printStackTrace(); } } CommandLineClient(String[] args);  CommandLineClient(File clientConfigFile, File readerConfig, File[] listenerConfigFiles); String defaultClientConfig(); String defaultCollectionReaderConfig(); String[] defaultListenerConfig(); static List<UimaAsBaseCallbackListener> getListeners(File...configs); static LeoCollectionReaderInterface getReader(File config); void runClient(); static void main(String[] args); static void printUsage(); }
CommandLineClient { public void runClient() { try { if (readerConfigFile.length > 1 || clientConfigFile.length > 1) { printUsage(); return; } List<UimaAsBaseCallbackListener> listeners = getListeners(listenerConfigFileList); LeoCollectionReaderInterface reader = getReader(readerConfigFile[0]); setClientProperties(myClient); System.out.println("Broker URL: " + myClient.getBrokerURL() + " Endpoint name: " + myClient.getEndpoint()); StopWatch stopWatch = new StopWatch(); stopWatch.start(); for (UimaAsBaseCallbackListener listener: listeners) { myClient.addUABListener(listener); } myClient.run(reader); System.out.println("Client finished in: " + stopWatch.getTime() + "ms."); } catch (Exception e) { e.printStackTrace(); } } CommandLineClient(String[] args);  CommandLineClient(File clientConfigFile, File readerConfig, File[] listenerConfigFiles); String defaultClientConfig(); String defaultCollectionReaderConfig(); String[] defaultListenerConfig(); static List<UimaAsBaseCallbackListener> getListeners(File...configs); static LeoCollectionReaderInterface getReader(File config); void runClient(); static void main(String[] args); static void printUsage();  }