serialArray[i++] = str.toString(); attribute.setValue(serialArray); } else if (Integer.class.getName().equals(attributeType)) { Integer[] serialArray = new Integer[valueList.size()]; serialArray[i++] = (Integer) str; attribute.setValue(serialArray); } else if (Long.class.getName().equals(attributeType)) { Long[] serialArray = new Long[valueList.size()]; serialArray[i++] = (Long) str; attribute.setValue(serialArray); } else if (Double.class.getName().equals(attributeType)) { Double[] serialArray = new Double[valueList.size()]; attribute.setValue(serialArray); } else if (Float.class.getName().equals(attributeType)) { Float[] serialArray = new Float[valueList.size()]; attribute.setValue(serialArray); } else if (Short.class.getName().equals(attributeType)) { Short[] serialArray = new Short[valueList.size()]; attribute.setValue(serialArray);
serialArray[i++] = str.toString(); attribute.setValue(serialArray); } else if (Integer.class.getName().equals(attributeType)) { Integer[] serialArray = new Integer[valueList.size()]; serialArray[i++] = (Integer) str; attribute.setValue(serialArray); } else if (Long.class.getName().equals(attributeType)) { Long[] serialArray = new Long[valueList.size()]; serialArray[i++] = (Long) str; attribute.setValue(serialArray); } else if (Double.class.getName().equals(attributeType)) { Double[] serialArray = new Double[valueList.size()]; attribute.setValue(serialArray); } else if (Float.class.getName().equals(attributeType)) { Float[] serialArray = new Float[valueList.size()]; attribute.setValue(serialArray); } else if (Short.class.getName().equals(attributeType)) { Short[] serialArray = new Short[valueList.size()]; attribute.setValue(serialArray);
attribute.setValue(newValues);
serialArray[i++] = attributeValue; attribute.setValue(serialArray);
attribute.setValue(newValues);
serialArray[i++] = attributeValue; attribute.setValue(serialArray);
identityTypeAttribute.setValue(newValues);
/** * <p> * Updates an attribute. * </p> * * @throws Exception */ @Test public void testUpdateAttribute() throws Exception { T storedIdentityTypeInstance = getIdentityType(true); storedIdentityTypeInstance.setAttribute(new Attribute<String[]>("multi-valued", new String[] { "1", "2", "3" })); updateIdentityType(storedIdentityTypeInstance); T updatedIdentityTypeInstance = getIdentityType(false); Attribute<String[]> multiValuedAttribute = updatedIdentityTypeInstance.getAttribute("multi-valued"); assertNotNull(multiValuedAttribute); multiValuedAttribute.setValue(new String[] { "3", "4", "5" }); updatedIdentityTypeInstance.setAttribute(multiValuedAttribute); updateIdentityType(updatedIdentityTypeInstance); updatedIdentityTypeInstance = getIdentityType(false); multiValuedAttribute = updatedIdentityTypeInstance.getAttribute("multi-valued"); assertNotNull(multiValuedAttribute); assertEquals(3, multiValuedAttribute.getValue().length); String[] values = multiValuedAttribute.getValue(); Arrays.sort(values); assertTrue(Arrays.equals(values, new String[] { "3", "4", "5" })); }