001 package org.hackystat.sensor.xmldata; 002 003 import org.hackystat.sensor.xmldata.option.Options; 004 import org.junit.Assert; 005 import org.junit.Test; 006 007 /** 008 * Tests if XmlDataController operates as intended. 009 * @author aito 010 * 011 */ 012 public class TestXmlDataController { 013 /** 014 * Tests if the option map containing option value parameters stores and 015 * retrieves the correct values. 016 */ 017 @Test 018 public void testAddAndGetOptionObject() { 019 // Tests normal retrieval. 020 XmlDataController controller = new XmlDataController(); 021 controller.addOptionObject(Options.UNIQUE_TSTAMP, Boolean.TRUE); 022 Assert.assertEquals("The tstamp option returned an incorrect value.", Boolean.TRUE, 023 controller.getOptionObject(Options.UNIQUE_TSTAMP)); 024 025 // Tests a null retrieval. 026 Assert.assertEquals("The null option returned an incorrect value.", null, controller 027 .getOptionObject(null)); 028 } 029 }