1*a046d00fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*a046d00fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a046d00fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a046d00fSAndrew Rist  * distributed with this work for additional information
6*a046d00fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a046d00fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a046d00fSAndrew Rist  * "License"); you may not use this file except in compliance
9*a046d00fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*a046d00fSAndrew Rist  *
11*a046d00fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*a046d00fSAndrew Rist  *
13*a046d00fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a046d00fSAndrew Rist  * software distributed under the License is distributed on an
15*a046d00fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a046d00fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*a046d00fSAndrew Rist  * specific language governing permissions and limitations
18*a046d00fSAndrew Rist  * under the License.
19*a046d00fSAndrew Rist  *
20*a046d00fSAndrew Rist  *************************************************************/
21*a046d00fSAndrew Rist 
22*a046d00fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package com.sun.star.uno;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import complexlib.ComplexTestCase;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir public final class Any_Test extends ComplexTestCase {
getTestMethodNames()29cdf0e10cSrcweir     public String[] getTestMethodNames() {
30cdf0e10cSrcweir         return new String[] { "testAnyAny", "testComplete" };
31cdf0e10cSrcweir     }
32cdf0e10cSrcweir 
testAnyAny()33cdf0e10cSrcweir     public void testAnyAny() {
34cdf0e10cSrcweir         boolean caught = false;
35cdf0e10cSrcweir         try {
36cdf0e10cSrcweir             new Any(Type.ANY, null);
37cdf0e10cSrcweir         } catch (IllegalArgumentException e) {
38cdf0e10cSrcweir             caught = true;
39cdf0e10cSrcweir         }
40cdf0e10cSrcweir         assure(caught);
41cdf0e10cSrcweir     }
42cdf0e10cSrcweir 
testComplete()43cdf0e10cSrcweir     public void testComplete() {
44cdf0e10cSrcweir         assure(Any.complete(Any.VOID) == Any.VOID);
45cdf0e10cSrcweir         assure(
46cdf0e10cSrcweir             Any.complete(new Integer(10)).equals(
47cdf0e10cSrcweir                 new Any(Type.LONG, new Integer(10))));
48cdf0e10cSrcweir         assure(
49cdf0e10cSrcweir             Any.complete(null).equals(
50cdf0e10cSrcweir                 new Any(new Type(XInterface.class), null)));
51cdf0e10cSrcweir         XInterface x = new XInterface() {};
52cdf0e10cSrcweir         assure(Any.complete(x).equals(new Any(new Type(XInterface.class), x)));
53cdf0e10cSrcweir     }
54cdf0e10cSrcweir }
55