/** * tests for a globalInfo method */ public void testGlobalInfo() { if (!m_GOETester.checkGlobalInfo()) { fail("No globalInfo method"); } }
/** * Called by JUnit before each test method. This implementation creates the * default stopwords algorithm to test and loads a test set of Instances. * * @exception Exception if an error occurs reading the example instances. */ @SuppressWarnings("unchecked") @Override protected void setUp() throws Exception { m_Stopwords = getStopwords(); m_OptionTester = getOptionTester(); m_GOETester = getGOETester(); m_Data = getData(); }
/** * Returns the location in the tmp directory for given resource. * * @param resource the resource (path in project) to get the tmp location for * @return the tmp location * @see #getTmpDirectory() */ public String getTmpLocationFromResource(String resource) { String result; File file; file = new File(resource); result = getTmpDirectory() + File.separator + file.getName(); return result; }
tokens = tokenize(m_Data[i]); results = useStopwords(tokens); succeeded = true; reg.println(predictionsToString(tokens, results)); } catch (Exception e) { results = new Boolean[0]; fail("Problem during regression testing: no successful results generated for any string"); System.err.println("Warning: No reference available, creating."); } else if (!diff.equals("")) { fail("Regression test failed. Difference:\n" + diff); fail("Problem during regression testing.\n" + ex);
resource = getDataDirectory() + "/" + resource; output = new BufferedOutputStream(new FileOutputStream(getTmpLocationFromResource(resource))); buffer = new byte[1024]; while ((read = input.read(buffer)) != -1) {
/** * Called by JUnit before each test method. * * @exception Exception if an error occurs reading the example instances. */ @Override protected void setUp() throws Exception { super.setUp(); copyResourceToTmp("WordsFromFile.txt"); }
/** * Configures the CheckGOE used for testing GOE stuff. Sets the Stopwords * returned from the getStopwords() method. * * @return the fully configured CheckGOE * @see #getStopwords() */ protected CheckGOE getGOETester() { CheckGOE result; result = new CheckGOE(); result.setObject(getStopwords()); result.setSilent(true); return result; }
tokens = tokenize(m_Data[i]); results = useStopwords(tokens); succeeded = true; reg.println(predictionsToString(tokens, results)); } catch (Exception e) { results = new Boolean[0]; fail("Problem during regression testing: no successful results generated for any string"); System.err.println("Warning: No reference available, creating."); } else if (!diff.equals("")) { fail("Regression test failed. Difference:\n" + diff); fail("Problem during regression testing.\n" + ex);
resource = getDataDirectory() + "/" + resource; output = new BufferedOutputStream(new FileOutputStream(getTmpLocationFromResource(resource))); buffer = new byte[1024]; while ((read = input.read(buffer)) != -1) {
/** * Called by JUnit before each test method. * * @exception Exception if an error occurs reading the example instances. */ @Override protected void setUp() throws Exception { super.setUp(); copyResourceToTmp("WordsFromFile.txt"); }
/** * Configures the CheckGOE used for testing GOE stuff. Sets the Stopwords * returned from the getStopwords() method. * * @return the fully configured CheckGOE * @see #getStopwords() */ protected CheckGOE getGOETester() { CheckGOE result; result = new CheckGOE(); result.setObject(getStopwords()); result.setSilent(true); return result; }
/** * Called by JUnit before each test method. This implementation creates the * default stopwords algorithm to test and loads a test set of Instances. * * @exception Exception if an error occurs reading the example instances. */ @SuppressWarnings("unchecked") @Override protected void setUp() throws Exception { m_Stopwords = getStopwords(); m_OptionTester = getOptionTester(); m_GOETester = getGOETester(); m_Data = getData(); }
/** * tests the tool tips */ public void testToolTips() { if (!m_GOETester.checkToolTips()) { fail("Tool tips inconsistent"); } } }
/** * Called by JUnit before each test method. * * @exception Exception if an error occurs reading the example instances. */ @Override protected void setUp() throws Exception { super.setUp(); copyResourceToTmp("RegExpFromFile.txt"); }
/** * Configures the CheckOptionHandler uses for testing the option handling. * Sets the stopwords algorithm returned from the getStopwords() method if that can * handle options. * * @return the fully configured CheckOptionHandler * @see #getStopwords() */ protected CheckOptionHandler getOptionTester() { CheckOptionHandler result; result = new CheckOptionHandler(); if (getStopwords() instanceof OptionHandler) { result.setOptionHandler((OptionHandler) getStopwords()); } else { result.setOptionHandler(null); } result.setUserOptions(new String[0]); result.setSilent(true); return result; }
/** * Returns the location in the tmp directory for given resource. * * @param resource the resource (path in project) to get the tmp location for * @return the tmp location * @see #getTmpDirectory() */ public String getTmpLocationFromResource(String resource) { String result; File file; file = new File(resource); result = getTmpDirectory() + File.separator + file.getName(); return result; }
/** * tests for a globalInfo method */ public void testGlobalInfo() { if (!m_GOETester.checkGlobalInfo()) { fail("No globalInfo method"); } }
/** * Called by JUnit before each test method. * * @exception Exception if an error occurs reading the example instances. */ @Override protected void setUp() throws Exception { super.setUp(); copyResourceToTmp("RegExpFromFile.txt"); }