use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatElectronicPeriodical.
@Test
public void getCitationFormatElectronicPeriodical() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("000 0000000s");
data.add("856 41$atest");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.ELECTRONIC_PERIODICAL);
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class DublinCoreRecordImplTest method getPublicationTitleTest.
@Test
public void getPublicationTitleTest() throws Exception {
DublinCoreRecord dcr = new DublinCoreRecordImpl();
MetadataRecord metadataRecord;
String titleStr = "DesIgnatIo IConographICa OberLeVtensDorfenses PannarIas OffICInas" + " VVLgo FabrICas PenICILLI arbItrIo Representans";
dcr.addTitle(titleStr);
metadataRecord = metadataFactory.getMetadataRecord(dcr);
Assert.assertTrue(metadataRecord.getTitle().contains(Title.create(titleStr, 1L, false)));
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class DublinCoreRecordImplTest method getEANsTest.
/**
* no Ean in DublinCore
*/
@Test
public void getEANsTest() {
DublinCoreRecord dcr = new DublinCoreRecordImpl();
MetadataRecord metadataRecord;
metadataRecord = metadataFactory.getMetadataRecord(dcr);
List<Ean> eans = metadataRecord.getEANs();
Assert.assertTrue(eans.size() == 0);
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class DublinCoreRecordImplTest method getCNBsTest.
@Test
public void getCNBsTest() throws Exception {
DublinCoreRecord dcr = new DublinCoreRecordImpl();
MetadataRecord metadataRecord;
// from K4 NDK NK - uuid:2bc5f0f0-987e-11e2-9a08-005056827e52
String cnb1str = "ccnb:cnb000121063";
// from Kram MZK - uuid:b602bb03-da24-4724-893d-23f9f3344498
String cnb2str = "ccnb: cnb000790921";
String notCnbStr = "uuid:not:cnb:identifier";
dcr.addIdentifier(cnb1str);
dcr.addIdentifier(notCnbStr);
dcr.addIdentifier(cnb2str);
metadataRecord = metadataFactory.getMetadataRecord(dcr);
List<Cnb> cnbs = metadataRecord.getCNBs();
Cnb cnb1 = Cnb.create("cnb000121063");
Assert.assertTrue(cnbs.contains(cnb1));
Cnb cnbN = Cnb.create(notCnbStr);
Assert.assertFalse(cnbs.contains(cnbN));
Cnb cnb2 = Cnb.create("cnb000790921");
Assert.assertTrue(cnbs.contains(cnb2));
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class DublinCoreRecordImplTest method getISBNsTest.
@Test
public void getISBNsTest() throws Exception {
DublinCoreRecord dcr = new DublinCoreRecordImpl();
MetadataRecord metadataRecord;
String isbnstr = "isbn:80-214-1182-1";
String isbn2str = "0-582-53020-2";
String notIsbnStr = "uuid:not:cnb:identifier";
String noValidIsbnStr = "0-582-53020-255555";
dcr.addIdentifier(isbnstr);
dcr.addIdentifier(notIsbnStr);
dcr.addIdentifier(isbn2str);
dcr.addIdentifier(noValidIsbnStr);
metadataRecord = metadataFactory.getMetadataRecord(dcr);
List<Isbn> isbns = metadataRecord.getISBNs();
Isbn isbn1 = Isbn.create(9788021411821L, 1L, "");
Assert.assertTrue(isbns.contains(isbn1));
Isbn isbn2 = Isbn.create(9780582530201L, 2L, "");
Assert.assertTrue(isbns.contains(isbn2));
Assert.assertTrue(isbns.size() == 2);
}
Aggregations