001 package org.hackystat.sensorbase.resource.users.jaxb; 002 003 import static org.junit.Assert.assertEquals; 004 import static org.junit.Assert.assertNull; 005 006 import org.junit.Test; 007 008 /** 009 * Test hand-coded extensions to JAXB-generated classes to ensure that they exist 010 * and function properly in the event that the JAXB classes are re-generated. 011 * @author Philip Johnson 012 * 013 */ 014 public class TestJAXBExtensions { 015 016 /** 017 * Test the property manipulation extensions to SensorData. 018 */ 019 @Test 020 public void testUserExtensions() { 021 User user = new User(); 022 user.addProperty("foo", "bar"); 023 Property property = user.findProperty("foo"); 024 assertEquals("Testing foo", "foo", property.getKey()); 025 assertEquals("Testing bar", "bar", property.getValue()); 026 assertNull("Testing unknown find", user.findProperty("bar")); 027 } 028 }