1 23 package com.sun.enterprise.management.ext.logging; 24 25 import java.util.Map ; 26 import java.util.Date ; 27 import java.util.logging.Level ; 28 29 import javax.management.openmbean.CompositeData ; 30 import javax.management.openmbean.OpenDataException ; 31 32 import com.sun.appserv.management.ext.logging.LogQueryResult; 33 import com.sun.appserv.management.ext.logging.LogQueryResultImpl; 34 import com.sun.appserv.management.ext.logging.LogQueryEntryImpl; 35 36 37 import com.sun.enterprise.management.Capabilities; 38 39 41 public final class LogQueryResultImplTest extends junit.framework.TestCase 42 { 43 public 44 LogQueryResultImplTest( ) 45 { 46 } 47 48 private static final String [] FIELD_NAMES = new String [] 49 { 50 "#", 51 "DATE", 52 "LEVEL", 53 "PRODUCT NAME", 54 "MODULE", 55 "MESSAGE", 56 "MESSAGE ID", 57 "NAME VALUE PAIRS", 58 }; 59 60 public LogQueryResultImpl 61 createDummy() 62 { 63 final LogQueryEntryImpl entry = LogQueryEntryImplTest.createDummy(); 64 65 final LogQueryResultImpl impl = 66 new LogQueryResultImpl( FIELD_NAMES, new LogQueryEntryImpl[] { entry } ); 67 68 return impl; 69 } 70 71 public void 72 testCreate() 73 { 74 createDummy().toString().hashCode(); 76 assertEquals( createDummy(), createDummy() ); 77 } 78 79 80 public void 81 testEquals() 82 { 83 final LogQueryResult d = createDummy(); 84 85 assertEquals( d, d ); 86 87 final LogQueryResult dCopy = 88 new LogQueryResultImpl( d.getFieldNames(), d.getEntries() ); 89 90 assertEquals( d, dCopy ); 91 assertEquals( dCopy, d ); 92 } 93 94 public void 95 testGetters() 96 throws OpenDataException 97 { 98 final LogQueryResultImpl d = createDummy(); 99 100 d.getFieldNames(); 101 d.getEntries(); 102 } 105 106 119 120 } 121 122 123 124 125 126 127 128 129 130 | Popular Tags |