/*
* 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 6229396
* @author Luis-Miguel Alventosa
* @run clean NullEmptyKeyValueTest
* @run build NullEmptyKeyValueTest
* @run main NullEmptyKeyValueTest
*/
import javax.management.*;
public class NullEmptyKeyValueTest {
private static int createObjectName(int i,
Class c,
String s,
String d,
String k,
String v,
throws Exception {
switch (i) {
case 1:
break;
case 2:
break;
case 3:
break;
default:
throw new Exception("Test incorrect: case: " + i);
}
int error = 0;
try {
switch (i) {
case 1:
on = new ObjectName(s);
break;
case 2:
on = new ObjectName(d, k, v);
break;
case 3:
on = new ObjectName(d, t);
break;
default:
throw new Exception("Test incorrect: case: " + i);
}
if (c != null) {
error++;
} else {
}
} catch (Exception e) {
if (c == null || !c.isInstance(e)) {
error++;
e.toString());
} else {
e.toString());
}
}
return error;
}
String s)
throws Exception {
}
String d,
String k,
String v)
throws Exception {
}
String d,
throws Exception {
}
int error = 0;
if (error > 0) {
throw new IllegalArgumentException(msg);
} else {
}
}
}