Update of /cvsroot/sblim/jsr48-client/utst/org/sblim/cimclient/unittest/wbem
In directory vz-cvs-3.sog:/tmp/cvs-serv31944/utst/org/sblim/cimclient/unittest/wbem
Modified Files:
Tag: Experimental
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.7.2.14
retrieving revision 1.7.2.15
diff -u -d -r1.7.2.14 -r1.7.2.15
--- CIMBuilder.java 1 Jun 2009 17:01:07 -0000 1.7.2.14
+++ CIMBuilder.java 20 Sep 2011 15:53:14 -0000 1.7.2.15
@@ -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;
|