KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > mx4j > tools > remote > soap > SOAPConnectorTest


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package test.mx4j.tools.remote.soap;
10
11 import java.io.IOException JavaDoc;
12 import java.net.MalformedURLException JavaDoc;
13 import java.util.HashMap JavaDoc;
14 import java.util.Map JavaDoc;
15
16 import javax.management.remote.JMXServiceURL JavaDoc;
17
18 import org.apache.axis.AxisFault;
19 import test.javax.management.remote.JMXConnectorTestCase;
20
21 /**
22  * @version $Revision: 1.15 $
23  */

24 public class SOAPConnectorTest extends JMXConnectorTestCase
25 {
26    public SOAPConnectorTest(String JavaDoc name)
27    {
28       super(name);
29    }
30
31    public JMXServiceURL JavaDoc createJMXConnectorServerAddress() throws MalformedURLException JavaDoc
32    {
33       return new JMXServiceURL JavaDoc("soap", null, 8080, "/soap");
34    }
35
36    public Map JavaDoc getEnvironment()
37    {
38       return new HashMap JavaDoc();
39    }
40
41    /**
42     * The SOAPConnector does not handle gracefully the case of a SecurityException thrown by a
43     * JMXAuthenticator. This is more an Axis problem, but for now we fix the test.
44     */

45    protected void testJMXAuthenticatorConnect(JMXServiceURL JavaDoc url, Map JavaDoc environment) throws SecurityException JavaDoc, IOException JavaDoc
46    {
47       try
48       {
49          super.testJMXAuthenticatorConnect(url, environment);
50       }
51       catch (AxisFault x)
52       {
53          String JavaDoc name = x.getFaultString();
54          if (name.startsWith(SecurityException JavaDoc.class.getName())) throw new SecurityException JavaDoc();
55          throw x;
56       }
57    }
58
59    /**
60     * No default classloader for the SOAPConnector (at least not now).
61     * It may be added later, but for now we fix the test.
62     */

63    public void testDefaultClassLoader() throws Exception JavaDoc
64    {
65       // Do nothing
66
}
67
68    public void testConnectWithProviderClassLoader() throws Exception JavaDoc
69    {
70       // Do nothing since messing with the context classloader causes the connector server to fail its start
71
}
72 }
73
Popular Tags