use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getSourceInfoTest.
@Test
public void getSourceInfoTest() throws Exception {
MarcRecordImpl mri;
List<String> metadataList = new ArrayList<>();
MetadataRecord metadataRecord;
metadataList.add("773 $gg$tt$xx");
mri = MarcRecordFactory.recordFactory(metadataList);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getSourceInfoG(), "g");
Assert.assertEquals(metadataRecord.getSourceInfoT(), "t");
Assert.assertEquals(metadataRecord.getSourceInfoX(), "x");
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatElectronicContribution.
@Test
public void getCitationFormatElectronicContribution() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("000 000000000");
data.add("773 $aproceedings");
data.add("856 41$atest");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.ELECTRONIC_CONTRIBUTION_PROCEEDINGS);
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getTitleTest.
@Test
public void getTitleTest() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("245 $nn$aa$pp$bb");
data.add("240 $aa$nn$bb$pp");
data.add("240 $aDeutsche Bibliographie.$pWöchentliches Verzeichnis." + "$nReihe B,$pBeilage, Erscheinungen ausserhalb des Verlags" + "buchhandels :$bAmtsblatt der Deutschen Bibliothek.$kadasd");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Title expectedTitle1 = new Title();
expectedTitle1.setTitleStr("napb");
expectedTitle1.setOrderInRecord(1L);
Title expectedTitle2 = new Title();
expectedTitle2.setTitleStr("anbp");
expectedTitle2.setOrderInRecord(2L);
Title expectedTitle3 = new Title();
expectedTitle3.setTitleStr("Deutsche Bibliographie.Wöchentliches Verzeichnis." + "Reihe B, Beilage, Erscheinungen ausserhalb des Verlags" + "buchhandels : Amtsblatt der Deutschen Bibliothek.");
expectedTitle3.setOrderInRecord(3L);
List<Title> titles = metadataRecord.getTitle();
Assert.assertEquals(3, titles.size());
Assert.assertEquals(titles.get(0), expectedTitle1);
Assert.assertEquals(titles.get(1), expectedTitle2);
Assert.assertEquals(titles.get(2), expectedTitle3);
data.clear();
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(0, metadataRecord.getTitle().size());
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatPeriodical.
@Test
public void getCitationFormatPeriodical() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("000 0000000i");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.PERIODICAL);
data.clear();
}
use of cz.mzk.recordmanager.server.metadata.MetadataRecord in project RecordManager2 by moravianlibrary.
the class MarcRecordImplTest method getCitationFormatOthers.
@Test
public void getCitationFormatOthers() throws Exception {
MarcRecordImpl mri;
MetadataRecord metadataRecord;
List<String> data = new ArrayList<>();
data.add("000 000000c");
mri = MarcRecordFactory.recordFactory(data);
metadataRecord = metadataFactory.getMetadataRecord(mri);
Assert.assertEquals(metadataRecord.getCitationFormat(), CitationRecordType.OTHERS);
data.clear();
}
Aggregations