/*
* 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
* @bug 4871761
* @summary Tests that JMXServiceErrorException is correctly emitted.
* @author Daniel Fuchs
* @run clean JMXServerErrorTest
* @run build JMXServerErrorTest
* @run main JMXServerErrorTest
*/
public class JMXServerErrorTest {
"service:jmx:rmi://", "service:jmx:iiop://","service:jmx:jmxmp://"
};
}
}
/**
* generates an error...
**/
public static class MBeanServerKaeffer
extends MBeanServerAccessController {
super();
}
/**
* Check if the caller can do read operations. This method does
* nothing if so, otherwise throws SecurityException.
*/
protected void checkRead() {
// do nothing
}
/**
* Check if the caller can do write operations. This method does
* nothing if so, otherwise throws SecurityException.
*/
protected void checkWrite() {
// generate error
}
}
public interface KaefferMBean {
}
}
}
final JMXConnectorServer cs;
try {
} catch (MalformedURLException m) {
// OK, we may not have this in the classpath...
return;
}
throw m;
}
final ObjectName cname =
new ObjectName(":type=JMXConnectorServer");
JMXConnector c = null;
try {
throw new Exception("Unexpected string returned by " +
try {
throw new Exception("Expected JMXServerErrorException"+
" not thrown"+
" for setAttribute \"This\" ");
} catch (JMXServerErrorException jsee) {
final Exception e =
new Exception("Expected JMXServerErrorException"+
" is not an instance of " +
KaefferError.class.getName()+
throw e;
}
}
try {
throw new Exception("Expected JMXServerErrorException" +
" not thrown"+
" for invoke \"doThis\" ");
} catch (JMXServerErrorException jsee) {
final Exception e =
new Exception("Expected JMXServerErrorException"+
" is not an instance of " +
KaefferError.class.getName()+
throw e;
}
}
} finally {
catch (Exception x) {
throw x;
}
catch (Exception x) {
throw x;
}
}
}
int errCount=0;
try {
} catch (Exception x) {
errCount++;
": " + x);
x.printStackTrace();
}
}
}
}