Search in sources :

Example 6 with QualifiedMetacardType

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

the class MetacardTypeRegistryTest method registerMetacardTypeEmptyName.

@Test(expected = IllegalArgumentException.class)
public void registerMetacardTypeEmptyName() {
    QualifiedMetacardType qmt = new QualifiedMetacardTypeImpl(QUALIFIED_METACARD_TYPE_NAMESPACE_1, "", qmtAttributes);
    mtr.register(qmt);
}
Also used : QualifiedMetacardTypeImpl(ddf.catalog.data.impl.QualifiedMetacardTypeImpl) QualifiedMetacardType(ddf.catalog.data.QualifiedMetacardType) Test(org.junit.Test)

Example 7 with QualifiedMetacardType

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

the class MetacardTypeRegistryTest method testNoNamespaceLookupMatchingNameMismatchingNamespace.

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

Example 8 with QualifiedMetacardType

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

the class MetacardTypeRegistryTest method testLookupMetacardType.

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

Example 9 with QualifiedMetacardType

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

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

the class MetacardTypeRegistryTest method testNoNamespaceLookupCantFindName.

@Test
public void testNoNamespaceLookupCantFindName() {
    QualifiedMetacardType qmt = mtr.lookup(QUALIFIED_METACARD_TYPE_NAME_BAD);
    assertNull(qmt);
}
Also used : 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