use of com.beanit.asn1bean.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.
the class ValidateV2SamplesTest method testMarshallName.
@Test
public void testMarshallName() throws JAXBException, SAXException, URISyntaxException {
Name object = (Name) unmarshallFromPath("/record_2.0/samples/read_samples/name-2.0.xml", Name.class);
marshall(object, "/record_2.0/personal-details-2.0.xsd");
}
use of com.beanit.asn1bean.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.
the class ValidateV2RC4SamplesTest method testMarshallName.
@Test
public void testMarshallName() throws JAXBException, SAXException, URISyntaxException {
Name object = (Name) unmarshallFromPath("/record_2.0_rc4/samples/name-2.0_rc4.xml", Name.class);
marshall(object, "/record_2.0_rc4/personal-details-2.0_rc4.xsd");
}
use of com.beanit.asn1bean.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method getPersonElement.
private Person getPersonElement() {
Visibility[] vs = { Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC };
Person p = new Person();
p.setAddresses(getAddressesElement(vs));
p.setEmails(getEmailsElement(vs));
p.setExternalIdentifiers(getPersonExternalIdentifiersElement(vs));
p.setKeywords(getKeywordsElement(vs));
p.setOtherNames(getOtherNamesElement(vs));
p.setResearcherUrls(getResearcherUrlsElement(vs));
Name name = new Name();
name.setVisibility(Visibility.PUBLIC);
p.setName(name);
Biography b = new Biography();
b.setVisibility(Visibility.PUBLIC);
b.setContent("Biography test");
p.setBiography(b);
return p;
}
use of com.beanit.asn1bean.compiler.pkix1explicit88.Name in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method getPersonalDetailsElement.
private PersonalDetails getPersonalDetailsElement(Visibility nameVisibility, Visibility bioVisiblity, Visibility otherNamesVisibility) {
PersonalDetails p = new PersonalDetails();
Name name = new Name();
name.setVisibility(nameVisibility);
p.setName(name);
Biography bio = new Biography();
bio.setVisibility(bioVisiblity);
bio.setContent("Bio test");
p.setBiography(bio);
p.setOtherNames(getOtherNamesElement(otherNamesVisibility));
return p;
}
use of com.beanit.asn1bean.compiler.pkix1explicit88.Name in project jasn1 by openmuc.
the class ModulesTest method encodingDecoding.
@Test
public void encodingDecoding() throws IOException {
ReverseByteArrayOutputStream berOS = new ReverseByteArrayOutputStream(1000);
MyDate1 dateOfHire = new MyDate1();
// MyDate1 dateOfHire = new MyDate1("19710917");
dateOfHire.value = new String("19710917").getBytes();
dateOfHire.encode(berOS, true);
MyInt2 myInt2Encode = new MyInt2(2);
berOS.reset();
myInt2Encode.encode(berOS, true);
MyInt2 myInt2Decode = new MyInt2();
byte[] code = HexConverter.fromShortHexString("a303020102");
InputStream is = new ByteArrayInputStream(code);
myInt2Decode.decode(is, true);
Assert.assertEquals(myInt2Decode.value.intValue(), 2);
PersonnelRecord pr = new PersonnelRecord();
Name name = new Name();
name.setGivenName(new BerVisibleString("givenName".getBytes()));
name.setFamilyName(new BerVisibleString("familyName".getBytes()));
name.setInitial(new BerVisibleString("initial".getBytes()));
pr.setName(name);
pr.setTitle(new BerVisibleString("title".getBytes()));
pr.setNumber(new EmployeeNumberZ(1));
pr.setDateOfHire(new Date("23121981".getBytes()));
pr.setNameOfSpouse(name);
ChildInformation child = new ChildInformation();
child.setName(new Name("child name".getBytes()));
child.setDateOfBirth(new Date("12121912".getBytes()));
PersonnelRecord.Children children = new PersonnelRecord.Children();
List<ChildInformation> childInformation = children.getChildInformation();
childInformation.add(child);
childInformation.add(child);
pr.setTestBitString(new MyBitString(new byte[] { (byte) 0x80, (byte) 0xff }, 10));
pr.setTest(new MyInt(3));
TestChoice testChoice = new TestChoice();
testChoice.setChoiceElement1(child);
pr.setTest2(testChoice);
pr.setTest3(testChoice);
pr.setTest4(testChoice);
pr.setTest5(testChoice);
pr.setTest6(testChoice);
TestSequenceOf testSequenceOf = new TestSequenceOf();
List<BerInteger> berIntegers = testSequenceOf.getBerInteger();
for (int i = 0; i < 10; i++) {
berIntegers.add(new BerInteger(i));
}
pr.setTestSequenceOf(testSequenceOf);
TestSequenceOf2 testSequenceOf2 = new TestSequenceOf2();
List<SEQUENCE> sequences = testSequenceOf2.getSEQUENCE();
for (int i = 0; i < 10; i++) {
SEQUENCE sequence = new SEQUENCE();
sequence.setTest1(new BerInteger(i++));
sequence.setTest2(new BerInteger(i));
sequences.add(sequence);
}
pr.setTestSequenceOf2(testSequenceOf2);
BerEmbeddedPdv berEmbeddedPdv = new BerEmbeddedPdv();
pr.setEmbeddedPdv(berEmbeddedPdv);
System.out.println("PersonnelRecord.toString():\n" + pr);
}
Aggregations