KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > compliance > server > support > Test


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package test.compliance.server.support;
9
10 /**
11  * <description>
12  *
13  * @see <related>
14  *
15  * @author <a HREF="mailto:juha@jboss.org">Juha Lindfors</a>.
16  * @version $Revision: 1.7 $
17  *
18  */

19 public class Test
20          implements TestMBean
21 {
22
23    public String getThisWillScream() throws MyScreamingException
24    {
25       throw new MyScreamingException();
26    }
27
28    public void setThisWillScream(String str) throws MyScreamingException
29    {
30       throw new MyScreamingException();
31    }
32    
33    public String getThrowUncheckedException()
34    {
35       throw new ExceptionOnTheRun();
36    }
37    
38    public void setThrowUncheckedException(String str)
39    {
40       throw new ExceptionOnTheRun();
41    }
42    
43    public String getError()
44    {
45       throw new BabarError();
46    }
47    
48    public void setError(String str)
49    {
50       throw new BabarError();
51    }
52    
53    public void setAStringAttribute(String str)
54    {
55       
56    }
57    
58    public void operationWithException() throws MyScreamingException
59    {
60       throw new MyScreamingException();
61    }
62    
63    /**
64     * returns true
65     */

66    public boolean opWithPrimBooleanReturn()
67    {
68       return true;
69    }
70    
71    /**
72     * Returns value 1234567890123
73     */

74    public long opWithPrimLongReturn()
75    {
76       return 1234567890123l;
77    }
78    
79    /**
80     * Returns array [1,2,3]
81     */

82    public long[] opWithPrimLongArrayReturn()
83    {
84       return new long[] { 1L, 2L, 3L};
85    }
86    
87    /**
88     * Returns array [1, 2, 3]
89     */

90    public Long[] opWithLongArrayReturn()
91    {
92       return new Long[] { new Long(1L), new Long(2L), new Long(3L) };
93    }
94    
95    /**
96     * Returns 0.1234567890123
97     */

98    public double opWithPrimDoubleReturn()
99    {
100       return 0.1234567890123d;
101    }
102    
103    public void opWithLongSignature(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10,
104                                    int i11, int i12, int i13, int i14, int i15, int i16, int i17, int i18, int i19, int i20)
105    {
106       
107    }
108    
109    public void opWithMixedSignature(int i1, double i2, long i3, boolean i4, byte i5,
110                                     short i6, long[] i7, Long[] i8, Short i9, Byte i10,
111                                     Long i11, Double i12, int i13, int i14, int i15,
112                                     int i16, int i17, int i18, int i19, int i20)
113    {
114       
115    }
116    
117    private int counter = 0;
118    
119    public void counterWithException()
120    {
121       counter++;
122       throw new IllegalArgumentException();
123    }
124    
125    public int getCounter()
126    {
127       return counter;
128    }
129    
130 }
131
132
133
134
135
Popular Tags