KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > ext > logging > LogQueryResultImplTest


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.management.ext.logging;
24
25 import java.util.Map JavaDoc;
26 import java.util.Date JavaDoc;
27 import java.util.logging.Level JavaDoc;
28
29 import javax.management.openmbean.CompositeData JavaDoc;
30 import javax.management.openmbean.OpenDataException JavaDoc;
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 /**
40  */

41 public final class LogQueryResultImplTest extends junit.framework.TestCase
42 {
43         public
44     LogQueryResultImplTest( )
45     {
46     }
47     
48     private static final String JavaDoc[] FIELD_NAMES = new String JavaDoc[]
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(); // non-null check
75

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 JavaDoc
97     {
98         final LogQueryResultImpl d = createDummy();
99         
100         d.getFieldNames();
101         d.getEntries();
102        // d.getCompositeType();
103
//d.asCompositeData();
104
}
105     
106     /*
107         public void
108     testCompositeData()
109         throws OpenDataException
110     {
111         final LogQueryResultImpl d = createDummy();
112         
113         final CompositeData data = d.asCompositeData();
114         final LogQueryResultImpl copy = new LogQueryResultImpl( data );
115         
116         assertEquals( d, copy );
117     }
118     */

119     
120 }
121
122
123
124
125
126
127
128
129
130
Popular Tags