Search in sources :

Example 6 with QualifiedMetacardTypeImpl

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);
}
Also used : QualifiedMetacardTypeImpl(ddf.catalog.data.impl.QualifiedMetacardTypeImpl) QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Example 7 with QualifiedMetacardTypeImpl

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);
}
Also used : QualifiedMetacardTypeImpl(ddf.catalog.data.impl.QualifiedMetacardTypeImpl) AttributeDescriptor(ddf.catalog.data.AttributeDescriptor) AttributeDescriptorImpl(ddf.catalog.data.impl.AttributeDescriptorImpl) HashSet(java.util.HashSet)

Example 8 with QualifiedMetacardTypeImpl

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);
}
Also used : QualifiedMetacardTypeImpl(ddf.catalog.data.impl.QualifiedMetacardTypeImpl) QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Example 9 with QualifiedMetacardTypeImpl

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));
}
Also used : QualifiedMetacardTypeImpl(ddf.catalog.data.impl.QualifiedMetacardTypeImpl) QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Aggregations

QualifiedMetacardTypeImpl (ddf.catalog.data.impl.QualifiedMetacardTypeImpl)9 QualifiedMetacardType (ddf.catalog.data.QualifiedMetacardType)6 Test (org.junit.Test)6 AttributeDescriptor (ddf.catalog.data.AttributeDescriptor)3 AttributeDescriptorImpl (ddf.catalog.data.impl.AttributeDescriptorImpl)3 HashSet (java.util.HashSet)2 BeforeClass (org.junit.BeforeClass)1