@Test public void readXML() throws Exception { File jdbcCollectionConfig = new File(ClassLoader.getSystemResource("jdbc-datacollection-config.xml").getFile()); assertTrue("jdbc-datacollection-config.xml is readable", jdbcCollectionConfig.canRead()); JdbcDataCollectionConfig exampleJdcc = JaxbUtils.unmarshal(JdbcDataCollectionConfig.class, jdbcCollectionConfig); assertTrue("Compare JDBC Data Collection Config objects.", jdcc.equals(exampleJdcc)); }
@Override public boolean equals(Object obj) { if (obj instanceof JdbcDataCollectionConfig) { JdbcDataCollectionConfig other = (JdbcDataCollectionConfig) obj; return new EqualsBuilder() .append(getRrdRepository(), other.getRrdRepository()) .append(getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS), other.getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS)) .isEquals(); } return false; }
JdbcDataCollectionConfig implements Serializable, Comparable<JdbcDataCollectionConfig> { @Override public boolean equals(Object obj) { if (obj instanceof JdbcDataCollectionConfig) { JdbcDataCollectionConfig other = (JdbcDataCollectionConfig) obj; return new EqualsBuilder() .append(getRrdRepository(), other.getRrdRepository()) .append(getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS), other.getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS)) .isEquals(); } return false; } }
JdbcDataCollectionConfig implements Serializable, Comparable<JdbcDataCollectionConfig> { @Override public boolean equals(Object obj) { if (obj instanceof JdbcDataCollectionConfig) { JdbcDataCollectionConfig other = (JdbcDataCollectionConfig) obj; return new EqualsBuilder() .append(getRrdRepository(), other.getRrdRepository()) .append(getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS), other.getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS)) .isEquals(); } return false; } JdbcDataCollectionConfig(); }
JdbcDataCollectionConfig implements Serializable, Comparable<JdbcDataCollectionConfig> { @Override public boolean equals(Object obj) { if (obj instanceof JdbcDataCollectionConfig) { JdbcDataCollectionConfig other = (JdbcDataCollectionConfig) obj; return new EqualsBuilder() .append(getRrdRepository(), other.getRrdRepository()) .append(getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS), other.getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS)) .isEquals(); } return false; } JdbcDataCollectionConfig(); @XmlTransient List<JdbcDataCollection> getJdbcDataCollections(); void setJdbcDataCollections(List<JdbcDataCollection> jdbcDataCollections); @XmlTransient String getRrdRepository(); void setRrdRepository(String rrdRepository); void addDataCollection(JdbcDataCollection dataCollection); void removeDataCollection(JdbcDataCollection dataCollection); void removeDataCollectionByName(String name); JdbcDataCollection getDataCollectionByName(String name); RrdRepository buildRrdRepository(String collectionName); int compareTo(JdbcDataCollectionConfig obj); @Override boolean equals(Object obj); }
JdbcDataCollectionConfig implements Serializable, Comparable<JdbcDataCollectionConfig> { @Override public boolean equals(Object obj) { if (obj instanceof JdbcDataCollectionConfig) { JdbcDataCollectionConfig other = (JdbcDataCollectionConfig) obj; return new EqualsBuilder() .append(getRrdRepository(), other.getRrdRepository()) .append(getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS), other.getJdbcDataCollections().toArray(OF_DATA_COLLECTIONS)) .isEquals(); } return false; } JdbcDataCollectionConfig(); @XmlTransient List<JdbcDataCollection> getJdbcDataCollections(); void setJdbcDataCollections(List<JdbcDataCollection> jdbcDataCollections); @XmlTransient String getRrdRepository(); void setRrdRepository(String rrdRepository); void addDataCollection(JdbcDataCollection dataCollection); void removeDataCollection(JdbcDataCollection dataCollection); void removeDataCollectionByName(String name); JdbcDataCollection getDataCollectionByName(String name); RrdRepository buildRrdRepository(String collectionName); int compareTo(JdbcDataCollectionConfig obj); @Override boolean equals(Object obj);  }