use of org.apache.sis.metadata.iso.citation.DefaultTelephone in project sis by apache.
the class MetadataWriterTest method readWriteDeprecated.
/**
* Read and write a metadata object containing deprecated properties.
* The metadata tested by this method is:
*
* {@preformat text
* Telephone
* ├─Number………………… 01.02.03.04
* └─Number type…… Voice
* }
*
* The metadata should be stored in columns named {@code "number"} and {@code "numberType"} even if we
* constructed the metadata using the deprecated {@code "voice"} property. Conversely, at reading time
* the deprecated {@code "voice"} property should be converted in reading of non-deprecated properties.
*/
@SuppressWarnings("deprecation")
private void readWriteDeprecated() throws MetadataStoreException {
final DefaultTelephone tel = new DefaultTelephone();
tel.setVoices(Collections.singleton("01.02.03.04"));
assertEquals("01.02.03.04", source.add(tel));
final Telephone check = source.lookup(Telephone.class, "01.02.03.04");
assertEquals("01.02.03.04", TestUtilities.getSingleton(check.getVoices()));
}
Aggregations