XMLManagerHomeMetadata implements ManagerHomeMetadata { @Override public boolean isUsageStatisticsEnabled() { return usageStatisticsEnabled != null ? usageStatisticsEnabled : true; }  static boolean exists(Path managerHome); static XMLManagerHomeMetadata read(Path managerHome); static XMLManagerHomeMetadata read(InputStream in); static XMLManagerHomeMetadata create(Path managerHome); @Override String getServerID(); @Override void setServerID(String id); int getHomeSchemaVersion(); void setHomeSchemaVersion(int homeSchemaVersion); void setUsageStatisticsEnabled(boolean usageStatisticsEnabled); @Override boolean isUsageStatisticsEnabled(); int getAcknowledgedPrivacyNoticeVersion(); void setAcknowledgedPrivacyNoticeVersion(int version); @Override synchronized void save(); static final String FILENAME; static final String ELEMENT_USAGE_STATISTICS_ENABLED; static final String NAMESPACE; }
@Test public void testReadHomeWithoutStatisticsBooleanAndExpectCorrectDefault() throws Exception { final Document document = readClasspathHomeMetadataDocument("metadata-test-01.xml"); assertXpathEmpty(" final XMLManagerHomeMetadata metadata = readClasspathHomeMetadata("metadata-test-01.xml"); assertTrue("default value has to be true", metadata.isUsageStatisticsEnabled()); }
@Test public void testReadHomeStatisticsBooleanSetToFalse() throws Exception { final Document document = readClasspathHomeMetadataDocument("metadata-test-02.xml"); assertXpathEquals("false", " final XMLManagerHomeMetadata metadata = readClasspathHomeMetadata("metadata-test-02.xml"); assertFalse(metadata.isUsageStatisticsEnabled()); }