From: Dave B. <bla...@us...> - 2011-11-07 11:54:57
|
Update of /cvsroot/sblim/jsr48-client/utst/org/sblim/cimclient/unittest/wbem In directory vz-cvs-3.sog:/tmp/cvs-serv16078/utst/org/sblim/cimclient/unittest/wbem Modified Files: CIMBuilder.java Log Message: 3411879 - TCK: CIM element value must match type Index: CIMBuilder.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/utst/org/sblim/cimclient/unittest/wbem/CIMBuilder.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- CIMBuilder.java 12 Jun 2009 02:33:23 -0000 1.18 +++ CIMBuilder.java 7 Nov 2011 11:54:55 -0000 1.19 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2009 + * (C) Copyright IBM Corp. 2006, 2011 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -25,6 +25,7 @@ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics + * 3411879 2011-09-20 blaschke-oss TCK: CIM element value must match type */ package org.sblim.cimclient.unittest.wbem; @@ -467,6 +468,21 @@ return cInstA; } + /* + * According to DSP0201, the following CIM data types cannot have null + * values (i.e. uint32 MUST contain at least one digit) + */ + private static int cInvalidNullTypes[] = { CIMDataType.BOOLEAN, CIMDataType.CHAR16, + CIMDataType.DATETIME, CIMDataType.REAL32, CIMDataType.REAL64, CIMDataType.SINT16, + CIMDataType.SINT32, CIMDataType.SINT64, CIMDataType.SINT8, CIMDataType.UINT16, + CIMDataType.UINT32, CIMDataType.UINT64, CIMDataType.UINT8 }; + + private static boolean isInvalidNullType(int pType) { + for (int i = cInvalidNullTypes.length - 1; i >= 0; i--) + if (cInvalidNullTypes[i] == pType) return true; + return false; + } + private static CIMProperty<?>[] cKeyPropA; private static CIMProperty<?>[] cAllPropA; @@ -503,7 +519,8 @@ CIMProperty<Object> prop = new CIMProperty<Object>("KeyProp" + i, pair.getType(), pair .getValue(), true, bit(i, 0), bit(i, 1) ? "KeyPropOrigin" + i : null); cKeyPropA[i] = cAllPropA[i] = prop; - if (i >= cKeyPropA.length / 2 && pair.getType().getType() != CIMDataType.REFERENCE) { + if (i >= cKeyPropA.length / 2 && pair.getType().getType() != CIMDataType.REFERENCE + && !isInvalidNullType(pair.getType().getType())) { CIMProperty<Object> propNull = new CIMProperty<Object>("KeyProp" + i, pair .getType(), null, true, bit(i, 0), bit(i, 1) ? "KeyPropOrigin" + i : null); cKeyPropNullA[i] = cAllPropNullA[i] = propNull; |