use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getAuthorAuthStringTest.
@Test
public void getAuthorAuthStringTest() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("100 $aEliska");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getAuthorString(), "Eliska");
data.clear();
data.add("700 $aEliska");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getAuthorString(), "Eliska");
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatArticle.
@Test
public void getCitationFormatArticle() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("000 0000000a");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.ARTICLE);
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getISBNsTest.
@Test
public void getISBNsTest() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
List<Isbn> isbnlist = new ArrayList<>();
// no isbn test
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getISBNs(), Collections.EMPTY_LIST);
// create isbns
data.add("020 $a9788086026923 (váz)");
isbnlist.add(Isbn.create(9788086026923L, 1L, "váz"));
data.add("020 $a978-80-7250-482-4$q(váz)$q(q1)$qq2");
isbnlist.add(Isbn.create(9788072504824L, 2L, "váz q1 q2"));
data.add("020 $a80-200-0980-9");
isbnlist.add(Isbn.create(9788020009807L, 3L, ""));
// invalid isbn
data.add("020 $a456");
isbnlist.add(Isbn.create(9782011668554L, 4L, ""));
data.add("020 $a2-01-16-6855-7");
isbnlist.add(Isbn.create(9782980406003L, 5L, ""));
data.add("020 $a2-9804060-07");
isbnlist.add(Isbn.create(9783925967214L, 6L, ""));
data.add("020 $a3-925 967-21-4");
isbnlist.add(Isbn.create(9783925967214L, 7L, ""));
data.add("020 $a 3-925 967-21-4");
isbnlist.add(Isbn.create(9780521376679L, 8L, ""));
data.add("020 $a052137667x");
isbnlist.add(Isbn.create(9783596263936L, 9L, ""));
data.add("020 $a3-596-26393-x");
isbnlist.add(Isbn.create(9785268012866L, 10L, ""));
data.add("020 $a5-268-01286-x");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
List<Isbn> results = metadataRecord.getISBNs();
Assert.assertEquals(results.size(), isbnlist.size());
for (int i = 0; i < isbnlist.size(); i++) {
Assert.assertEquals(results.get(i), isbnlist.get(i), String.format("ISBN on position %d differs.", i));
}
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatAcademicWork.
@Test
public void getCitationFormatAcademicWork() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("502 $atest");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.ACADEMIC_WORK);
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatElectronicBook.
@Test
public void getCitationFormatElectronicBook() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("000 000000td");
data.add("856 41$atest");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.ELECTRONIC_BOOK);
data.clear();
}
Aggregations