use of ddf.catalog.data.impl.QualifiedMetacardTypeImpl in project ddf by codice.
the class MetacardTypeRegistryTest method registerMetacardTypeNullNamespace.
@Test
public void registerMetacardTypeNullNamespace() throws IllegalArgumentException, MetacardTypeUnregistrationException {
QualifiedMetacardType qmt = new QualifiedMetacardTypeImpl(null, QUALIFIED_METACARD_TYPE_NAME_1, qmtAttributes);
mtr.register(qmt);
QualifiedMetacardType metacardTypeFromReg = mtr.lookup(QualifiedMetacardType.DEFAULT_METACARD_TYPE_NAMESPACE, QUALIFIED_METACARD_TYPE_NAME_1);
assertNotNull(metacardTypeFromReg);
assertEquals(QualifiedMetacardType.DEFAULT_METACARD_TYPE_NAMESPACE, metacardTypeFromReg.getNamespace());
assertEquals(QUALIFIED_METACARD_TYPE_NAME_1, metacardTypeFromReg.getName());
mtr.unregister(qmt);
}
use of ddf.catalog.data.impl.QualifiedMetacardTypeImpl in project ddf by codice.
the class MetacardTypeRegistryTest method sampleMetacardTypeB.
private QualifiedMetacardType sampleMetacardTypeB() {
Set<AttributeDescriptor> descriptors = new HashSet<AttributeDescriptor>();
descriptors.add(new AttributeDescriptorImpl(COLUMNS_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
false, /* tokenized */
false, /* multivalued */
BasicTypes.INTEGER_TYPE));
descriptors.add(new AttributeDescriptorImpl(ROWS_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
false, /* tokenized */
false, /* multivalued */
BasicTypes.INTEGER_TYPE));
descriptors.add(new AttributeDescriptorImpl(DESCRIPTION_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
false, /* tokenized */
false, /* multivalued */
BasicTypes.STRING_TYPE));
descriptors.add(new AttributeDescriptorImpl(Metacard.ID, true, /* indexed */
true, /* stored */
false, /* tokenized */
false, /* multivalued */
BasicTypes.STRING_TYPE));
descriptors.add(new AttributeDescriptorImpl(Metacard.TITLE, true, /* indexed */
true, /* stored */
true, /* tokenized */
false, /* multivalued */
BasicTypes.STRING_TYPE));
descriptors.add(new AttributeDescriptorImpl(REVIEWED_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
true, /* tokenized */
false, /* multivalued */
BasicTypes.BOOLEAN_TYPE));
descriptors.add(new AttributeDescriptorImpl(PRECISE_LENGTH_METERS_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
true, /* tokenized */
false, /* multivalued */
BasicTypes.DOUBLE_TYPE));
descriptors.add(new AttributeDescriptorImpl(PRECISE_HEIGHT_METERS_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
true, /* tokenized */
false, /* multivalued */
BasicTypes.FLOAT_TYPE));
descriptors.add(new AttributeDescriptorImpl(NUMBER_REVIEWERS_ATTRIBUTE_KEY, true, /* indexed */
true, /* stored */
true, /* tokenized */
false, /* multivalued */
BasicTypes.SHORT_TYPE));
return new QualifiedMetacardTypeImpl(SAMPLE_B_METACARD_TYPE_NAMESPACE, SAMPLE_B_METACARD_TYPE_NAME, descriptors);
}
use of ddf.catalog.data.impl.QualifiedMetacardTypeImpl in project ddf by codice.
the class MetacardTypeRegistryTest method registerMetacardTypeEmptyNamepsace.
@Test
public void registerMetacardTypeEmptyNamepsace() throws IllegalArgumentException, MetacardTypeUnregistrationException {
QualifiedMetacardType qmt = new QualifiedMetacardTypeImpl("", QUALIFIED_METACARD_TYPE_NAME_1, qmtAttributes);
mtr.register(qmt);
QualifiedMetacardType metacardTypeFromReg = mtr.lookup(QualifiedMetacardType.DEFAULT_METACARD_TYPE_NAMESPACE, QUALIFIED_METACARD_TYPE_NAME_1);
assertNotNull(metacardTypeFromReg);
assertEquals(QualifiedMetacardType.DEFAULT_METACARD_TYPE_NAMESPACE, metacardTypeFromReg.getNamespace());
assertEquals(QUALIFIED_METACARD_TYPE_NAME_1, metacardTypeFromReg.getName());
mtr.unregister(qmt);
}
use of ddf.catalog.data.impl.QualifiedMetacardTypeImpl in project ddf by codice.
the class MetacardTypeRegistryTest method testRegisteredTypes.
@Test
public void testRegisteredTypes() {
Set<QualifiedMetacardType> registeredTypes = mtr.getRegisteredTypes();
assertEquals(4, registeredTypes.size());
QualifiedMetacardTypeImpl test0 = new QualifiedMetacardTypeImpl(QUALIFIED_METACARD_TYPE_NAMESPACE_1, QUALIFIED_METACARD_TYPE_NAME_1, qmtAttributes);
assertTrue(registeredTypes.contains(test0));
QualifiedMetacardTypeImpl test1 = new QualifiedMetacardTypeImpl(QUALIFIED_METACARD_TYPE_NAMESPACE_1, QUALIFIED_METACARD_TYPE_NAME_2, qmtAttributes);
assertTrue(registeredTypes.contains(test1));
QualifiedMetacardTypeImpl test2 = new QualifiedMetacardTypeImpl(QualifiedMetacardType.DEFAULT_METACARD_TYPE_NAMESPACE, QUALIFIED_METACARD_TYPE_NAME_3, qmtAttributes);
assertTrue(registeredTypes.contains(test2));
}
Aggregations