@Test public void readXML() throws Exception { File apmConfig = new File(ClassLoader.getSystemResource("access-point-monitor-configuration.xml").getFile()); assertTrue("access-point-monitor-configuration.xml is readable", apmConfig.canRead()); AccessPointMonitorConfig exampleApmc = JaxbUtils.unmarshal(AccessPointMonitorConfig.class, apmConfig); assertTrue("Compare Access Point Monitor Config objects.", apmc.equals(exampleApmc)); }
@Override public boolean equals(Object obj) { if (obj instanceof AccessPointMonitorConfig) { AccessPointMonitorConfig other = (AccessPointMonitorConfig) obj; return new EqualsBuilder() .append(getThreads(), other.getThreads()) .append(getServiceTemplates().toArray(OF_TEMPLATES), other.getServiceTemplates().toArray(OF_TEMPLATES)) .append(getPackages().toArray(OF_PACKAGES), other.getPackages().toArray(OF_PACKAGES)) .append(getMonitors().toArray(OF_MONITORS), other.getMonitors().toArray(OF_MONITORS)) .isEquals(); } return false; }
AccessPointMonitorConfig implements Serializable, Comparable<AccessPointMonitorConfig> { @Override public boolean equals(Object obj) { if (obj instanceof AccessPointMonitorConfig) { AccessPointMonitorConfig other = (AccessPointMonitorConfig) obj; return new EqualsBuilder() .append(getThreads(), other.getThreads()) .append(getServiceTemplates().toArray(OF_TEMPLATES), other.getServiceTemplates().toArray(OF_TEMPLATES)) .append(getPackages().toArray(OF_PACKAGES), other.getPackages().toArray(OF_PACKAGES)) .append(getMonitors().toArray(OF_MONITORS), other.getMonitors().toArray(OF_MONITORS)) .isEquals(); } return false; } }
AccessPointMonitorConfig implements Serializable, Comparable<AccessPointMonitorConfig> { @Override public boolean equals(Object obj) { if (obj instanceof AccessPointMonitorConfig) { AccessPointMonitorConfig other = (AccessPointMonitorConfig) obj; return new EqualsBuilder() .append(getThreads(), other.getThreads()) .append(getServiceTemplates().toArray(OF_TEMPLATES), other.getServiceTemplates().toArray(OF_TEMPLATES)) .append(getPackages().toArray(OF_PACKAGES), other.getPackages().toArray(OF_PACKAGES)) .append(getMonitors().toArray(OF_MONITORS), other.getMonitors().toArray(OF_MONITORS)) .isEquals(); } return false; } AccessPointMonitorConfig(); }
AccessPointMonitorConfig implements Serializable, Comparable<AccessPointMonitorConfig> { @Override public boolean equals(Object obj) { if (obj instanceof AccessPointMonitorConfig) { AccessPointMonitorConfig other = (AccessPointMonitorConfig) obj; return new EqualsBuilder() .append(getThreads(), other.getThreads()) .append(getServiceTemplates().toArray(OF_TEMPLATES), other.getServiceTemplates().toArray(OF_TEMPLATES)) .append(getPackages().toArray(OF_PACKAGES), other.getPackages().toArray(OF_PACKAGES)) .append(getMonitors().toArray(OF_MONITORS), other.getMonitors().toArray(OF_MONITORS)) .isEquals(); } return false; } AccessPointMonitorConfig(); @XmlTransient int getThreads(); void setThreads(int threads); @XmlTransient long getPackageScanInterval(); void setPackageScanInterval(long packageScanInterval); @XmlTransient List<ServiceTemplate> getServiceTemplates(); void setServiceTemplates(List<ServiceTemplate> serviceTemplates); void addServiceTemplate(ServiceTemplate svcTemplate); @XmlTransient List<Package> getPackages(); void setPackages(List<Package> packages); void addPackage(Package pkg); @XmlTransient List<Monitor> getMonitors(); void setMonitors(List<Monitor> monitors); void addMonitor(Monitor monitor); int compareTo(AccessPointMonitorConfig obj); @Override int hashCode(); @Override boolean equals(Object obj); void afterUnmarshal(Unmarshaller u, Object parent); void updateServiceTemplates(); }
AccessPointMonitorConfig implements Serializable, Comparable<AccessPointMonitorConfig> { @Override public boolean equals(Object obj) { if (obj instanceof AccessPointMonitorConfig) { AccessPointMonitorConfig other = (AccessPointMonitorConfig) obj; return new EqualsBuilder() .append(getThreads(), other.getThreads()) .append(getServiceTemplates().toArray(OF_TEMPLATES), other.getServiceTemplates().toArray(OF_TEMPLATES)) .append(getPackages().toArray(OF_PACKAGES), other.getPackages().toArray(OF_PACKAGES)) .append(getMonitors().toArray(OF_MONITORS), other.getMonitors().toArray(OF_MONITORS)) .isEquals(); } return false; } AccessPointMonitorConfig(); @XmlTransient int getThreads(); void setThreads(int threads); @XmlTransient long getPackageScanInterval(); void setPackageScanInterval(long packageScanInterval); @XmlTransient List<ServiceTemplate> getServiceTemplates(); void setServiceTemplates(List<ServiceTemplate> serviceTemplates); void addServiceTemplate(ServiceTemplate svcTemplate); @XmlTransient List<Package> getPackages(); void setPackages(List<Package> packages); void addPackage(Package pkg); @XmlTransient List<Monitor> getMonitors(); void setMonitors(List<Monitor> monitors); void addMonitor(Monitor monitor); int compareTo(AccessPointMonitorConfig obj); @Override int hashCode(); @Override boolean equals(Object obj); void afterUnmarshal(Unmarshaller u, Object parent); void updateServiceTemplates();  }