~ubuntu-branches/ubuntu/raring/zeroc-icee-java/raring

« back to all changes in this revision

Viewing changes to test/IceE/facets/AllTests.java

  • Committer: Bazaar Package Importer
  • Author(s): Francisco Moya
  • Date: 2008-08-07 23:05:39 UTC
  • mfrom: (3.1.2 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080807230539-iiuezo41bclg5yxy
Tags: 1.2.0-3
* Upgraded packaging standards.
* Removed unsatisfiable build dependency (Closes: #487027).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// **********************************************************************
2
2
//
3
 
// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved.
 
3
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
4
4
//
5
5
// This copy of Ice-E is licensed to you under the terms described in the
6
6
// ICEE_LICENSE file included in this distribution.
26
26
        out.print("testing facet registration exceptions... ");
27
27
        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("FacetExceptionTestAdapter");
28
28
        Ice.Object obj = new EmptyI();
29
 
        adapter.add(obj, Ice.Util.stringToIdentity("d"));
30
 
        adapter.addFacet(obj, Ice.Util.stringToIdentity("d"), "facetABCD");
 
29
        adapter.add(obj, communicator.stringToIdentity("d"));
 
30
        adapter.addFacet(obj, communicator.stringToIdentity("d"), "facetABCD");
31
31
        try
32
32
        {
33
 
            adapter.addFacet(obj, Ice.Util.stringToIdentity("d"), "facetABCD");
 
33
            adapter.addFacet(obj, communicator.stringToIdentity("d"), "facetABCD");
34
34
            test(false);
35
35
        }
36
36
        catch(Ice.AlreadyRegisteredException ex)
37
37
        {
38
38
        }
39
 
        adapter.removeFacet(Ice.Util.stringToIdentity("d"), "facetABCD");
 
39
        adapter.removeFacet(communicator.stringToIdentity("d"), "facetABCD");
40
40
        try
41
41
        {
42
 
            adapter.removeFacet(Ice.Util.stringToIdentity("d"), "facetABCD");
 
42
            adapter.removeFacet(communicator.stringToIdentity("d"), "facetABCD");
43
43
            test(false);
44
44
        }
45
45
        catch(Ice.NotRegisteredException ex)
50
50
        out.print("testing removeAllFacets... ");
51
51
        Ice.Object obj1 = new EmptyI();
52
52
        Ice.Object obj2 = new EmptyI();
53
 
        adapter.addFacet(obj1, Ice.Util.stringToIdentity("id1"), "f1");
54
 
        adapter.addFacet(obj2, Ice.Util.stringToIdentity("id1"), "f2");
 
53
        adapter.addFacet(obj1, communicator.stringToIdentity("id1"), "f1");
 
54
        adapter.addFacet(obj2, communicator.stringToIdentity("id1"), "f2");
55
55
        Ice.Object obj3 = new EmptyI();
56
 
        adapter.addFacet(obj1, Ice.Util.stringToIdentity("id2"), "f1");
57
 
        adapter.addFacet(obj2, Ice.Util.stringToIdentity("id2"), "f2");
58
 
        adapter.addFacet(obj3, Ice.Util.stringToIdentity("id2"), "");
59
 
        java.util.Hashtable fm = adapter.removeAllFacets(Ice.Util.stringToIdentity("id1"));
 
56
        adapter.addFacet(obj1, communicator.stringToIdentity("id2"), "f1");
 
57
        adapter.addFacet(obj2, communicator.stringToIdentity("id2"), "f2");
 
58
        adapter.addFacet(obj3, communicator.stringToIdentity("id2"), "");
 
59
        java.util.Hashtable fm = adapter.removeAllFacets(communicator.stringToIdentity("id1"));
60
60
        test(fm.size() == 2);
61
61
        test(fm.get("f1") == obj1);
62
62
        test(fm.get("f2") == obj2);
63
63
        try
64
64
        {
65
 
            adapter.removeAllFacets(Ice.Util.stringToIdentity("id1"));
 
65
            adapter.removeAllFacets(communicator.stringToIdentity("id1"));
66
66
            test(false);
67
67
        }
68
68
        catch(Ice.NotRegisteredException ex)
69
69
        {
70
70
        }
71
 
        fm = adapter.removeAllFacets(Ice.Util.stringToIdentity("id2"));
 
71
        fm = adapter.removeAllFacets(communicator.stringToIdentity("id2"));
72
72
        test(fm.size() == 3);
73
73
        test(fm.get("f1") == obj1);
74
74
        test(fm.get("f2") == obj2);