Search in sources :

Example 16 with Preferences

use of org.orcid.jaxb.model.record_rc3.Preferences in project ORCID-Source by ORCID.

the class ValidateV2RC3SamplesTest method testUnmarshallPreferences.

@Test
public void testUnmarshallPreferences() throws SAXException, URISyntaxException {
    Preferences preferences = (Preferences) unmarshallFromPath("/record_2.0_rc3/samples/preferences-2.0_rc3.xml", Preferences.class, "/record_2.0_rc3/preferences-2.0_rc3.xsd");
    assertNotNull(preferences);
    assertNotNull(preferences.getLocale());
    assertEquals(Locale.EN, preferences.getLocale());
}
Also used : Preferences(org.orcid.jaxb.model.record_rc3.Preferences) Test(org.junit.Test)

Example 17 with Preferences

use of org.orcid.jaxb.model.record_rc3.Preferences in project ORCID-Source by ORCID.

the class ValidateV2RC3SamplesTest method unmarshallFromPath.

private Object unmarshallFromPath(String path, Class<?> type, String schemaPath) throws SAXException, URISyntaxException {
    try (Reader reader = new InputStreamReader(getClass().getResourceAsStream(path))) {
        Object obj = unmarshall(reader, type, schemaPath);
        Object result = null;
        if (ResearcherUrls.class.equals(type)) {
            result = (ResearcherUrls) obj;
        } else if (ResearcherUrl.class.equals(type)) {
            result = (ResearcherUrl) obj;
        } else if (PersonalDetails.class.equals(type)) {
            result = (PersonalDetails) obj;
        } else if (PersonExternalIdentifier.class.equals(type)) {
            result = (PersonExternalIdentifier) obj;
        } else if (PersonExternalIdentifiers.class.equals(type)) {
            result = (PersonExternalIdentifiers) obj;
        } else if (Biography.class.equals(type)) {
            result = (Biography) obj;
        } else if (Name.class.equals(type)) {
            result = (Name) obj;
        } else if (CreditName.class.equals(type)) {
            result = (CreditName) obj;
        } else if (OtherName.class.equals(type)) {
            result = (OtherName) obj;
        } else if (OtherNames.class.equals(type)) {
            result = (OtherNames) obj;
        } else if (Keywords.class.equals(type)) {
            result = (Keywords) obj;
        } else if (Keyword.class.equals(type)) {
            result = (Keyword) obj;
        } else if (Addresses.class.equals(type)) {
            result = (Addresses) obj;
        } else if (Address.class.equals(type)) {
            result = (Address) obj;
        } else if (Emails.class.equals(type)) {
            result = (Emails) obj;
        } else if (Email.class.equals(type)) {
            result = (Email) obj;
        } else if (Person.class.equals(type)) {
            result = (Person) obj;
        } else if (Deprecated.class.equals(type)) {
            result = (Deprecated) obj;
        } else if (Preferences.class.equals(type)) {
            result = (Preferences) obj;
        } else if (History.class.equals(type)) {
            result = (History) obj;
        } else if (Record.class.equals(type)) {
            result = (Record) obj;
        } else if (ActivitiesSummary.class.equals(type)) {
            result = (ActivitiesSummary) obj;
        }
        return result;
    } catch (IOException e) {
        throw new RuntimeException("Error reading notification from classpath", e);
    }
}
Also used : Email(org.orcid.jaxb.model.record_rc3.Email) InputStreamReader(java.io.InputStreamReader) Keyword(org.orcid.jaxb.model.record_rc3.Keyword) Address(org.orcid.jaxb.model.record_rc3.Address) OtherNames(org.orcid.jaxb.model.record_rc3.OtherNames) CreditName(org.orcid.jaxb.model.record_rc3.CreditName) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) IOException(java.io.IOException) PersonExternalIdentifier(org.orcid.jaxb.model.record_rc3.PersonExternalIdentifier) History(org.orcid.jaxb.model.record_rc3.History) ActivitiesSummary(org.orcid.jaxb.model.record.summary_rc3.ActivitiesSummary) Deprecated(org.orcid.jaxb.model.record_rc3.Deprecated) Biography(org.orcid.jaxb.model.record_rc3.Biography) ResearcherUrl(org.orcid.jaxb.model.record_rc3.ResearcherUrl)

Example 18 with Preferences

use of org.orcid.jaxb.model.record_rc3.Preferences in project ORCID-Source by ORCID.

the class ValidateV2RC3SamplesTest method testMarshallPreferences.

@Test
public void testMarshallPreferences() throws JAXBException, SAXException, URISyntaxException {
    Preferences object = (Preferences) unmarshallFromPath("/record_2.0_rc3/samples/preferences-2.0_rc3.xml", Preferences.class);
    marshall(object, "/record_2.0_rc3/preferences-2.0_rc3.xsd");
}
Also used : Preferences(org.orcid.jaxb.model.record_rc3.Preferences) Test(org.junit.Test)

Example 19 with Preferences

use of org.orcid.jaxb.model.record_rc3.Preferences in project ORCID-Source by ORCID.

the class ValidateV2RC2SamplesTest method testMarshallPreferences.

@Test
public void testMarshallPreferences() throws JAXBException, SAXException, URISyntaxException {
    Preferences object = (Preferences) unmarshallFromPath("/record_2.0_rc2/samples/preferences-2.0_rc2.xml", Preferences.class);
    marshall(object, "/record_2.0_rc2/preferences-2.0_rc2.xsd");
}
Also used : Preferences(org.orcid.jaxb.model.record_rc2.Preferences) Test(org.junit.Test)

Example 20 with Preferences

use of org.orcid.jaxb.model.record_rc3.Preferences in project ORCID-Source by ORCID.

the class ValidateV2RC2SamplesTest method testUnmarshallPreferences.

@Test
public void testUnmarshallPreferences() throws SAXException, URISyntaxException {
    Preferences preferences = (Preferences) unmarshallFromPath("/record_2.0_rc2/samples/preferences-2.0_rc2.xml", Preferences.class, "/record_2.0_rc2/preferences-2.0_rc2.xsd");
    assertNotNull(preferences);
    assertNotNull(preferences.getLocale());
    assertEquals(Locale.EN, preferences.getLocale());
}
Also used : Preferences(org.orcid.jaxb.model.record_rc2.Preferences) Test(org.junit.Test)

Aggregations

Preferences (com.fsck.k9.Preferences)17 Account (com.fsck.k9.Account)13 Test (org.junit.Test)12 Preferences (org.apereo.portal.soffit.model.v1_0.Preferences)5 Preferences (org.orcid.jaxb.model.record_v2.Preferences)5 StorageEditor (com.fsck.k9.preferences.StorageEditor)4 SearchAccount (com.fsck.k9.search.SearchAccount)4 IOException (java.io.IOException)4 HashMap (java.util.HashMap)4 InvalidSettingValueException (com.fsck.k9.preferences.Settings.InvalidSettingValueException)3 Storage (com.fsck.k9.preferences.Storage)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 Bearer (org.apereo.portal.soffit.model.v1_0.Bearer)3 Intent (android.content.Intent)2 SharedPreferences (android.content.SharedPreferences)2 Uri (android.net.Uri)2 UnavailableStorageException (com.fsck.k9.mailstore.UnavailableStorageException)2 LocalSearch (com.fsck.k9.search.LocalSearch)2 Method (java.lang.reflect.Method)2