Project

General

Profile

« Previous | Next » 

Revision 8897

Added by Jing Tao about 10 years ago

Add a test method to test the method determining if there is a delete event for the given id.

View differences:

test/edu/ucsb/nceas/metacattest/EventLogTest.java
89 89
                        null, startDate, endDate, false);
90 90
        System.out.println(report);
91 91
    }
92
    
93
    /**
94
     * Test if the isDeleted method
95
     */
96
    public void testIsDeleted() throws Exception{
97
        long time = System.nanoTime();
98
        String id = "test-1934-weme123-3.1"+time;
99
        EventLog.getInstance().log("192.168.1.103", "Mozilla", "public", id, "read");
100
        Thread.sleep(2000);
101
        boolean deleted = EventLog.getInstance().isDeleted(id);
102
        assertTrue(deleted == false);
103
        Thread.sleep(2000);
104
        EventLog.getInstance().log("192.168.1.103", "Mozilla", "public", id, EventLog.DELETE);
105
        deleted = EventLog.getInstance().isDeleted(id);
106
        assertTrue(deleted == true);
107
    }
92 108
}

Also available in: Unified diff