Search in sources :

Example 11 with QualifiedMetacardType

use of ddf.catalog.data.QualifiedMetacardType in project ddf by codice.

the class MetacardTypeRegistryTest method testLookupMetacardTypeCantFindName.

@Test
public void testLookupMetacardTypeCantFindName() {
    QualifiedMetacardType qmt = mtr.lookup(QUALIFIED_METACARD_TYPE_NAMESPACE_1, QUALIFIED_METACARD_TYPE_NAME_BAD);
    assertNull(qmt);
}
Also used : QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Example 12 with QualifiedMetacardType

use of ddf.catalog.data.QualifiedMetacardType in project ddf by codice.

the class MetacardTypeRegistryTest method testLookupMetacardTypeEmptyNamespace.

@Test
public void testLookupMetacardTypeEmptyNamespace() {
    QualifiedMetacardType qmtResult = mtr.lookup("", QUALIFIED_METACARD_TYPE_NAME_3);
    assertNotNull(qmtResult);
    assertEquals(QUALIFIED_METACARD_TYPE_NAME_3, qmtResult.getName());
    assertEquals("", qmtResult.getNamespace());
    assertOnExpectedMetacardTypeFields(qmtResult);
}
Also used : QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Example 13 with QualifiedMetacardType

use of ddf.catalog.data.QualifiedMetacardType 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 14 with QualifiedMetacardType

use of ddf.catalog.data.QualifiedMetacardType in project ddf by codice.

the class MetacardTypeRegistryTest method testNoNamespaceLookup.

@Test
public void testNoNamespaceLookup() {
    QualifiedMetacardType qmt = mtr.lookup(QUALIFIED_METACARD_TYPE_NAME_3);
    assertNotNull(qmt);
    assertEquals(QUALIFIED_METACARD_TYPE_NAME_3, qmt.getName());
    assertEquals(QualifiedMetacardType.DEFAULT_METACARD_TYPE_NAMESPACE, qmt.getNamespace());
    assertOnExpectedMetacardTypeFields(qmt);
}
Also used : QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Example 15 with QualifiedMetacardType

use of ddf.catalog.data.QualifiedMetacardType 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

QualifiedMetacardType (ddf.catalog.data.QualifiedMetacardType)15 Test (org.junit.Test)14 QualifiedMetacardTypeImpl (ddf.catalog.data.impl.QualifiedMetacardTypeImpl)6