1 5 package com.opensymphony.oscache.base.events; 6 7 import junit.framework.Test; 8 import junit.framework.TestCase; 9 import junit.framework.TestSuite; 10 11 import java.util.Date ; 12 13 21 public final class TestScopeEvent extends TestCase { 22 private final int SCOPE = 3; 23 24 29 public TestScopeEvent(String str) { 30 super(str); 31 } 32 33 38 public static Test suite() { 39 return new TestSuite(TestScopeEvent.class); 40 } 41 42 45 public void testScopeEvent() { 46 Date date = new Date (); 47 48 ScopeEvent event = new ScopeEvent(ScopeEventType.ALL_SCOPES_FLUSHED, SCOPE, date, null); 50 assertEquals(event.getEventType(), ScopeEventType.ALL_SCOPES_FLUSHED); 51 assertEquals(event.getScope(), SCOPE); 52 assertTrue(event.getDate().equals(date)); 53 54 event = new ScopeEvent(ScopeEventType.SCOPE_FLUSHED, SCOPE, date, null); 55 assertEquals(event.getEventType(), ScopeEventType.SCOPE_FLUSHED); 56 assertEquals(event.getScope(), SCOPE); 57 assertTrue(event.getDate().equals(date)); 58 } 59 } 60 | Popular Tags |