コード例 #1
0
 /** Cleans up the class when done testing */
 @After
 public void cleanUp() {
   Database.getInstance()
       .createQuery("DELETE FROM papers WHERE ID = :paperID")
       .addParameter("paperID", paperID)
       .executeUpdate();
   Database.getInstance()
       .createQuery("DELETE FROM reviews WHERE ID = :paperID")
       .addParameter("paperID", reviewID)
       .executeUpdate();
 }
コード例 #2
0
 /** Sets up the class for testing */
 @Before
 public void setUp() {
   paperID =
       Database.getInstance()
           .createQuery(
               "INSERT INTO papers (ConferenceID, AuthorID, Title, Description, SubmissionDate, RevisionDate, File, FileExtension) VALUES (:conferenceID, :authorID, :title, :description, NOW(), NOW(), :file, :fileExtension)")
           .addParameter("conferenceID", 15000)
           .addParameter("authorID", 25000)
           .addParameter("title", "The title")
           .addParameter("description", "the description")
           .addParameter("file", new File("tests/paper.txt"))
           .addParameter("fileExtension", "/path.txt")
           .executeUpdate()
           .getKey(Integer.class);
   ReviewManager temp = new ReviewManager();
   temp.hashCode();
 }