[zb4osgi-changeset] [scm] ZigBee 4 OSGi repository change: r607 - /projects/zb4osgi/trunk/zigbee.zcl.library/src/test/java/it/cnr/isti/zigbee/zcl/library/impl/global/write/WriteAttributeCommandTest.java

scm-notify at zb4osgi.aaloa.org scm-notify at zb4osgi.aaloa.org
Sat Jan 26 15:20:05 CET 2013


Author: stefano.lenzi
Date: Sat Jan 26 15:20:04 2013
New Revision: 607

Log:
Verified that issue #173 is resolved ( refs #173 )


Modified:
    projects/zb4osgi/trunk/zigbee.zcl.library/src/test/java/it/cnr/isti/zigbee/zcl/library/impl/global/write/WriteAttributeCommandTest.java

Modified: projects/zb4osgi/trunk/zigbee.zcl.library/src/test/java/it/cnr/isti/zigbee/zcl/library/impl/global/write/WriteAttributeCommandTest.java
==============================================================================
--- projects/zb4osgi/trunk/zigbee.zcl.library/src/test/java/it/cnr/isti/zigbee/zcl/library/impl/global/write/WriteAttributeCommandTest.java (original)
+++ projects/zb4osgi/trunk/zigbee.zcl.library/src/test/java/it/cnr/isti/zigbee/zcl/library/impl/global/write/WriteAttributeCommandTest.java Sat Jan 26 15:20:04 2013
@@ -39,7 +39,7 @@
 public class WriteAttributeCommandTest {
 
 	@Test
-	public void testGetPayload() {
+	public void testGetPayloadWithString() {
 		AttributeImpl attribute = new AttributeImpl(null, null, Attributes.LOCATION_DESCRIPTION);
 		WriteAttributeRecord[] values = new WriteAttributeRecord[]{
 				new WriteAttributeRecordImpl( attribute, "garage" )
@@ -51,4 +51,17 @@
 		);
 	}
 
+	@Test
+	public void testGetPayloadWithInteger() {
+		AttributeImpl attribute = new AttributeImpl(null, null, Attributes.IDENTIFY_TIME);
+		WriteAttributeRecord[] values = new WriteAttributeRecord[]{
+				new WriteAttributeRecordImpl( attribute, new Integer(10) )
+		};
+		WriteAttributeCommand command = new WriteAttributeCommand(values);
+		assertArrayEquals(new byte[]{
+				0x00, 0x00, 0x21, 0x0a, 0x00
+		}, command.getPayload()
+		);
+	}
+
 }




More information about the Commit mailing list