MetaStb implements Comparable<MetaStb>, DawgDevice, StbProperties, IrMeta, VideoMeta, SerialMeta, AudioMeta { public MetaStb() { this(new HashMap<String, Object>()); } MetaStb();  MetaStb(DawgDevice device);  MetaStb(Map<String, Object> data); Map<String, Object> getData(); void setData(Map<String, Object> data); String getId(); void setId(String id); @Override String getName(); @Override void setName(String name); @Override String getMake(); @Override void setMake(String make); @Override Model getModel(); @Override void setModel(Model model); @Override Family getFamily(); @Override void setFamily(Family family); @Override @SuppressWarnings("unchecked") Collection<Capability> getCapabilities(); @Override void setCapabilities(Collection<Capability> capabilities); String getPlant(); void setPlant(String plant); String getContent(); void setContent(String content); @Override InetAddress getIpAddress(); @Override void setIpAddress(InetAddress ipAddress); @Override String getMacAddress(); @Override void setMacAddress(String macAddress); @Override String getSlotName(); @Override void setSlotName(String slotName); Set<String> getTags(); void setTags(Set<String> tags); String getIrServiceUrl(); void setIrServiceUrl(String irServiceUrl); @Override String getVideoSourceUrl(); void setVideoSourceUrl(String videoSourceUrl); @Override String getAudioUrl(); void setAudioUrl(String audioSourceUrl); @Override String getVideoCamera(); void setVideoCamera(String videoCamera); String getHdVideoUrl(); void setHdVideoUrl(String hdVideoUrl); String getPowerServiceUrl(); void setPowerServiceUrl(String powerServiceUrl); String getSerialHost(); void setSerialHost(String serialHost); String getCatsServerHost(); void setCatsServerHost(String catsServerHost); String getIrServicePort(); void setIrServicePort(String irServicePort); String getRemoteType(); void setRemoteType(String remoteType); void setCatsKeySetMapping(String catsKeySetMapping); String getCatsKeySetMapping(); @Override String getBlasterType(); void setBlasterType(String blasterType); String getPowerOutlet(); void setPowerOutlet(String powerOutlet); String getPowerType(); void setPowerType(String powerType); @Override Program getProgram(); @Override void setProgram(Program program); String getChannelMapId(); void setChannelMapId(String channelMapId); Set<String> getModifiedProps(); void setModifiedProps(Set<String> modifiedProps); @Override String getControllerId(); @Override void setControllerId(String controllerId); @Override String getControllerName(); @Override void setControllerName(String controllerName); @Override String getControllerIpAddress(); @Override void setControllerIpAddress(String controllerIpAddress); @Override String getEnvironmentId(); @Override void setEnvironmentId(String environmentId); @Override String getHardwareRevision(); @Override void setHardwareRevision(String hardwareRevision); String getRackName(); void setRackName(String rackName); String getRackProxyUrl(); void setRackProxyUrl(String rackProxyUrl); Boolean getRackProxyEnabled(); void setRackProxyEnabled(Boolean rackProxyEnabled); @Override boolean hasCapability(Capability cap); @Override int compareTo(MetaStb o); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override Object getPropertyValue(String propKey); @Override void setPropertyValue(String propKey, Object val); static final String ID; static final String TAGS; static final String NAME; static final String MAKE; static final String MODEL; static final String PLANT; static final String PROGRAM; static final String CONTENT; static final String IPADDRESS; static final String SLOT_NAME; static final String MACADDRESS; static final String IRSERVICEURL; static final String IRBLASTERTYPE; static final String IRSERVICEPORT; static final String VIDEOSOURCEURL; static final String VIDEOCAMERA; static final String HD_VIDEO_URL; static final String POWERSERVICEURL; static final String POWEROUTLET; static final String POWERTYPE; static final String SERIAL_HOST; static final String CATSSERVERHOST; static final String REMOTETYPE; static final String CAPABILITIES; static final String FAMILY; static final String CHANNEL_MAP_ID; static final String CONTROLLER_NAME; static final String CONTROLLER_ID; static final String CONTROLLER_IP_ADDRESS; static final String MODIFIED_PROPS; static final String RACK_NAME; static final String ENVIRONMENT_ID; static final String HARDWARE_REVISION; static final String AUDIOSOURCEURL; static final String CATSKEYSETMAPPING; static final String RACK_PROXY_URL; static final String RACK_PROXY_ENABLED; }
@Test public void MetaStbtest() { EasyMock.expect(ipAddress.getHostName()).andReturn(null).anyTimes(); EasyMock.replay(ipAddress); populateMetaStb(this.metaStb); Assert.assertEquals( metaStb.getId(),id); Assert.assertTrue( metaStb.getIpAddress().toString().contains("localhost")); Assert.assertEquals( metaStb.getIrServicePort() , irServicePort); Assert.assertEquals( metaStb.getIrServiceUrl(), irServiceUrl); Assert.assertEquals( metaStb.getMacAddress(), macAddress); Assert.assertEquals( metaStb.getMake() , make); Assert.assertEquals( metaStb.getModel(), model); Assert.assertEquals( metaStb.getName(), name); Assert.assertEquals( metaStb.getPlant(), plant); Assert.assertEquals( metaStb.getPowerOutlet(), powerOutlet); Assert.assertEquals( metaStb.getPowerServiceUrl(), powerServiceUrl); Assert.assertEquals( metaStb.getPowerType(), powerType); Assert.assertEquals( metaStb.getRemoteType(), remoteType); Assert.assertEquals( metaStb.getTags(), tags); Assert.assertEquals( metaStb.getSerialHost(), traceServiceUrl); Assert.assertEquals( metaStb.getVideoCamera(), videoCamera); Assert.assertEquals( metaStb.getVideoSourceUrl(), videoSourceUrl); Assert.assertEquals( metaStb.getCatsServerHost(), catsServerHost); Assert.assertEquals( metaStb.getContent(), content); Assert.assertEquals(metaStb.getControllerId(), "18235"); Assert.assertEquals(metaStb.getControllerName(), "dncs.dtdncs"); MetaStb obj = new MetaStb(); populateMetaStb(obj); Assert.assertTrue(metaStb.compareTo(obj) == 0); Assert.assertTrue(metaStb.compareTo(null) < 0); obj.setId(null); metaStb.setId(null); Assert.assertTrue(metaStb.compareTo(obj) == 0); obj.setId(""); Assert.assertTrue(metaStb.compareTo(obj) < 0); metaStb.setId(""); obj.setId(null); Assert.assertTrue(metaStb.compareTo(obj) == 1); Assert.assertTrue(metaStb.hashCode() > 0); obj.setId(""); Assert.assertTrue(metaStb.equals(obj)); Assert.assertNotNull(metaStb.toString()); Map<String, Object> data = new HashMap<String,Object>(); MetaStb stb = new MetaStb(data); Assert.assertEquals(stb.getData(), new HashMap<String,Object>()); }