use of ddf.catalog.transformer.xml.adapter.MetacardTypeAdapter in project ddf by codice.
the class TestMetacardTypeAdapter method testUnmarshalWithKnownMetacardType.
@Test
public void testUnmarshalWithKnownMetacardType() throws CatalogTransformerException {
MetacardType knownMetacardType = new MetacardTypeImpl(KNOWN_TYPE_NAME, (Set<AttributeDescriptor>) null);
List<MetacardType> metacardTypes = new ArrayList<MetacardType>(1);
metacardTypes.add(knownMetacardType);
MetacardTypeAdapter metacardTypeAdpater = new MetacardTypeAdapter(metacardTypes);
MetacardType metacardType = metacardTypeAdpater.unmarshal(KNOWN_TYPE_NAME);
assertThat(metacardType.getName(), is(knownMetacardType.getName()));
}
use of ddf.catalog.transformer.xml.adapter.MetacardTypeAdapter in project ddf by codice.
the class TestMetacardTypeAdapter method testUnmarshalWithUnknownTypeName.
@Test
public void testUnmarshalWithUnknownTypeName() throws CatalogTransformerException {
MetacardType unknownMetacardType = new MetacardTypeImpl(KNOWN_TYPE_NAME, (Set<AttributeDescriptor>) null);
List<MetacardType> metacardTypes = new ArrayList<MetacardType>(1);
metacardTypes.add(unknownMetacardType);
MetacardTypeAdapter metacardTypeAdpater = new MetacardTypeAdapter(metacardTypes);
MetacardType metacardType = metacardTypeAdpater.unmarshal(UNKNOWN_TYPE_NAME);
assertThat(metacardType.getName(), is(BasicTypes.BASIC_METACARD.getName()));
}
use of ddf.catalog.transformer.xml.adapter.MetacardTypeAdapter in project ddf by codice.
the class TestMetacardTypeAdapter method testUnmarshalWithNullRegisteredMetacardTypes.
@Test
public void testUnmarshalWithNullRegisteredMetacardTypes() throws CatalogTransformerException {
MetacardTypeAdapter metacardTypeAdpater = new MetacardTypeAdapter(NULL_METACARD_TYPES_LIST);
MetacardType metacardType = metacardTypeAdpater.unmarshal(UNKNOWN_TYPE_NAME);
assertThat(metacardType.getName(), is(BasicTypes.BASIC_METACARD.getName()));
}
use of ddf.catalog.transformer.xml.adapter.MetacardTypeAdapter in project ddf by codice.
the class TestMetacardTypeAdapter method testUnmarshalWithDdfMetacardTypeName.
@Test
public void testUnmarshalWithDdfMetacardTypeName() throws CatalogTransformerException {
MetacardType unknownMetacardType = new MetacardTypeImpl(KNOWN_TYPE_NAME, (Set<AttributeDescriptor>) null);
List<MetacardType> metacardTypes = new ArrayList<MetacardType>(1);
metacardTypes.add(unknownMetacardType);
MetacardTypeAdapter metacardTypeAdpater = new MetacardTypeAdapter(metacardTypes);
MetacardType metacardType = metacardTypeAdpater.unmarshal(DDF_METACARD_TYPE_NAME);
assertThat(metacardType.getName(), is(BasicTypes.BASIC_METACARD.getName()));
}
use of ddf.catalog.transformer.xml.adapter.MetacardTypeAdapter in project ddf by codice.
the class TestMetacardTypeAdapter method testUnmarshalWithEmptyTypeName.
@Test
public void testUnmarshalWithEmptyTypeName() throws CatalogTransformerException {
MetacardTypeAdapter metacardTypeAdpater = new MetacardTypeAdapter();
MetacardType metacardType = metacardTypeAdpater.unmarshal(EMPTY_TYPE_NAME);
assertThat(metacardType.getName(), is(BasicTypes.BASIC_METACARD.getName()));
}
Aggregations