/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test ProviderTest.java
* @summary Tests jar services provider are called
* @run clean ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl
* @run build ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl
* @run main ProviderTest
*/
/*
* Tests jar services provider are called
*/
import provider.JMXConnectorProviderImpl;
public class ProviderTest {
//First do the test with a protocol handled by Service providers
new JMXServiceURL("service:jmx:rmi://");
if (!ok) {
if (!clientCalled)
if (!serverCalled)
}
//The Service Provider doesn't handle IIOP. Default providers MUST
//be called.
url =
new JMXServiceURL("service:jmx:iiop://");
// Unsupported protocol.
url =
new JMXServiceURL("service:jmx:unknown-protocol://");
try {
server =
null,
mbs);
}catch(MalformedURLException e) {
}
catch(Exception e) {
e.printStackTrace();
}
try {
client =
null);
}catch(MalformedURLException e) {
}
catch(Exception e) {
e.printStackTrace();
}
//JMXConnectorProviderException
url =
new JMXServiceURL("service:jmx:throw-provider-exception://");
try {
server =
null,
mbs);
}catch(JMXProviderException e) {
}
catch(Exception e) {
e.printStackTrace();
}
try {
client =
null);
}catch(JMXProviderException e) {
}
catch(Exception e) {
e.printStackTrace();
}
return;
}
throws Exception {
try {
server =
null,
mbs);
}catch(IllegalArgumentException e) {
e.printStackTrace();
}
try {
client =
}catch(IllegalArgumentException e) {
e.printStackTrace();
}
}
}