Factory { public static CmdStartTestResultListener createCmdStartTestResultListener(OnResultListener listener) { initialize(); return new CmdStartTestResultListener(listener); }  static String getEnv(String key); static String getEnv(String key, String deflt); static void readVersion(); static void initialize(); static MessageProducer createTopicProducer(String topic); static String readWholeFile(final String filename); static String replaceMacro(String inString); static void sendToJms(final String userCommand); static CmdListSuT createCmdListSut(); static CmdListBadges createCmdListBadges(); static CmdListTestSuites createCmdListTestSuites(); static CmdStartTc createCmdStartTc(String sut, String testSuiteName, String tc, String settingsDesignator, String federationName, String sutFederateName); static CmdAbortTc createCmdAbortTc(String sut, String tc); static CmdSetLogLevel createCmdSetLogLevel(LogLevel level); static CmdQuit createCmdQuit(); static CmdQuitListener createCmdQuitListener(OnQuitListener listener); static CmdStartTestResultListener createCmdStartTestResultListener(OnResultListener listener); static CmdTcStatusListener createCmdTcStatusListener(OnTcStatusListener listener); static CmdLogMsgListener createCmdLogMsgListener(OnLogMsgListener listener); static CmdSendTcStatus createCmdSendTcStatus(); static CmdSendTcVerdict createCmdSendTcVerdict(String sutName, String sutDir, String testScheduleName, String testcase, String verdict, String verdictText); static CmdUpdateSUT createCmdUpdateSUT(final SutDescription sutDescription); static SutPathsFiles getSutPathsFiles(); static CmdListSuT createCmdListSuT(); static CmdOperatorRequestListener createCmdStartOperatorRequestListener(OnOperatorRequestListener listener); static CmdOperatorRequest createCmdOperatorRequest(String sutName, String testSuiteId, String tc, String text); static CmdOperatorConfirmation createCmdOperatorConfirmation(String sutName, String testSuiteId, String tc, boolean confirmationBool, String text); static int getCmdCounter(); static int newCmdCount(); static String getVersion(); static String getBuild(); static Properties props; static final String IVCT_CONF; static final String IVCT_CONF_DEFLT; static final String IVCT_TS_DIST_HOME_ID; static final String IVCT_TS_DIST_HOME_ID_DEFLT; static final String IVCT_TS_DEF_HOME_ID; static final String IVCT_TS_DEF_HOME_ID_DEFLT; static final String IVCT_SUT_HOME_ID; static final String IVCT_SUT_HOME_ID_DEFLT; static final String IVCT_BADGE_HOME_ID; static final String IVCT_BADGE_HOME_ID_DEFLT; static final String IVCT_BADGE_ICONS_ID; static final String IVCT_BADGE_ICONS_ID_DEFLT; static final String RTI_ID; static final String RTI_ID_DEFLT; static final String PROPERTY_IVCTCOMMANDER_QUEUE; static final String MESSAGING_USER_ID; static final String MESSAGING_USER_DEFLT; static final String MESSAGING_PASSWORD_ID; static final String MESSAGING_PASSWORD_DEFLT; static final String MESSAGING_HOST_ID; static final String MESSAGING_HOST_DEFLT; static final String MESSAGING_PORT_ID; static final String MESSAGING_PORT_DEFLT; static final String JMS_QUEUE_ID; static final String JMS_QUEUE_DEFLT; static final String JAVA_NAMING_FACTORY_ID; static final String JAVA_NAMING_FACTORY_DEFLT; static final String JAVA_NAMING_PROVIDER_ID; static final String JAVA_NAMING_PROVIDER_DEFLT; static final String LOGSINK_TCF_BINDINGNAME_ID; static final String LOGSINK_TCF_BINDINGNAME_DEFLT; static final String LOGSINK_TOPIC_BINDINGNAME_ID; static final String LOGSINK_TOPIC_BINDINGNAME_DEFLT; static final String LOGSINK_USER_ID; static final String LOGSINK_USER_DEFLT; static final String LOGSINK_PASSWORD_ID; static final String LOGSINK_PASSWORD_DEFLT; static final String SETTINGS_DESIGNATOR; static final String SETTINGS_DESIGNATOR_DEFLT; static final String FEDERATION_NAME; static final String FEDERATION_NAME_DEFLT; static final String FEDERATE_NAME_DEFLT; static final org.slf4j.Logger LOGGER; static public PropertyBasedClientSetup jmsHelper; }
@Test public void testCreateCmdStartTestResultListenerMethod() { Semaphore semaphore = new Semaphore(0); class OnResultListenerTest implements OnResultListener { @Override public void onResult(TcResult result) { assertTrue(result.sutName != null); assertTrue(result.sutDir != null); assertTrue(result.testScheduleName != null); assertTrue(result.testcase != null); assertTrue(result.verdict != null); assertTrue(result.verdictText != null); semaphore.release(); } } OnResultListener testListener = new OnResultListenerTest(); CmdStartTestResultListener resultListener = Factory.createCmdStartTestResultListener(testListener); assertTrue("Factory Test createCmdStartTestResultListener should return CmdStartTestResultListener", resultListener != null); resultListener.execute(); CmdSendTcVerdict stc = new CmdSendTcVerdict("hw_iosb", "tcDir", "HelloWorld-2019", "some.test.case", "verdict", "verdictText"); assertTrue("Factory Test CmdSendTcVerdict should return some value", stc != null); stc.execute(); try { semaphore.acquire(); } catch (InterruptedException e) { e.printStackTrace(); } }