KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > bugs > bug351 > TestCase


1 package org.jacorb.test.bugs.bug351;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2003 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import junit.framework.*;
24
25 import org.jacorb.test.common.*;
26
27 /**
28  * Test for bug 351, marshaling of a complex valuetype.
29  *
30  * @author <a HREF="mailto:spiegel@gnu.org">Andre Spiegel</a>
31  * @version $Id: TestCase.java,v 1.3 2003/10/27 12:13:30 andre.spiegel Exp $
32  */

33 public class TestCase extends ClientServerTestCase
34 {
35     private ValueServer server = null;
36     
37     public TestCase (String JavaDoc name, ClientServerSetup setup)
38     {
39         super (name, setup);
40     }
41     
42     public void setUp()
43     {
44         server = (ValueServer)ValueServerHelper.narrow(setup.getServerObject());
45     }
46     
47     public static Test suite()
48     {
49         TestSuite suite = new TestSuite( "bug 351 complex valuetype" );
50         ClientServerSetup setup =
51             new ClientServerSetup( suite,
52                                    "org.jacorb.test.bugs.bug351.ValueServerImpl" );
53
54         suite.addTest( new TestCase( "testBug", setup ));
55         
56         return setup;
57     }
58     
59     public void testBug()
60     {
61         RetrievalResult result = server.search();
62         assertTrue (result != null);
63         float[] scores = result.getScores();
64         assertEquals (1.2f, scores[0], 0.0f);
65         assertEquals (3.4f, scores[1], 0.0f);
66         assertEquals (5.6f, scores[2], 0.0f);
67     }
68 }
69
Popular Tags