/*
* 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 NotCompliantCauseTest.java
* @bug 6374290
* @summary Test that NotCompliantMBeanException has a cause in case of
* type mapping problems.
* @author Daniel Fuchs, Alexander Shusherov
* @run clean NotCompliantCauseTest
* @run build NotCompliantCauseTest
* @run main NotCompliantCauseTest
*/
/*
*
* Created on January 20, 2006, 2:56 PM / dfuchs
*
*/
/**
*
* @author Sun Microsystems, 2005 - All rights reserved.
*/
public class NotCompliantCauseTest {
/**
* A logger for this class.
**/
/**
* Creates a new instance of NotCompliantCauseTest
*/
public NotCompliantCauseTest() {
}
/**
* Test that NotCompliantMBeanException has a cause in case of
* type mapping problems.
**/
}
super(msg);
}
}
super(cause);
}
}
/**
* Test that NotCompliantMBeanException has a cause in case of
* type mapping problems.
**/
void test1() {
try {
"NotCompliantMBeanException not thrown");
throw new RuntimeTestException("NotCompliantMBeanException not thrown");
} catch (RuntimeTestException e) {
throw e;
} catch (NotCompliantMBeanException e) {
throw new RuntimeTestException("NotCompliantMBeanException " +
"doesn't have any cause.", e);
if (cause instanceof OpenDataException) break;
}
if (! (cause instanceof OpenDataException))
throw new RuntimeTestException("NotCompliantMBeanException " +
"doesn't have expected cause ("+
} catch (Exception e) {
throw new RuntimeException("Unexpected exception: " + e,e);
}
}
public interface NotCompliantMXBean {
}
return new Random();
}
}
}