コード例 #1
0
 /**
  * Clean data of test
  *
  * @throws SQLException
  * @throws ClassNotFoundException
  */
 @After
 public void cleanData() throws SQLException, ClassNotFoundException, UnavailableDataException {
   IndexDAO indexDAO = new IndexDAO();
   List<Index> indexes = indexDAO.getIndexes();
   for (Index index : indexes) {
     indexDAO.eraseIndex(index);
   }
   indexDAO.closeConnection();
   File dirDB = new File("data" + File.separator + "db");
   for (File file : dirDB.listFiles()) {
     file.delete();
   }
   dirDB.delete();
   File dirJSON = new File("data" + File.separator + "anime");
   if (dirJSON.exists()) {
     for (File file : dirJSON.listFiles()) {
       file.delete();
     }
   }
   dirJSON.delete();
 } // end of the method cleanData
コード例 #2
0
 /**
  * Assert "Then I shouldn't see the anime "Bleach""
  *
  * @param arg1
  * @throws Throwable
  */
 @Then("^I shouldn't see the anime \"(.*?)\"$")
 public void i_shouldn_t_see_the_anime(String arg1) throws Throwable {
   IndexDAO indexDAO = new IndexDAO();
   assertThat(indexDAO.getIndexes().size(), is(0));
 } // end of the method i_shouldn_t_see_the_anime