Example usage for java.util Locale ITALY

List of usage examples for java.util Locale ITALY

Introduction

In this page you can find the example usage for java.util Locale ITALY.

Prototype

Locale ITALY

To view the source code for java.util Locale ITALY.

Click Source Link

Document

Useful constant for country.

Usage

From source file:org.pdfsam.support.LocaleKeyValueItemTest.java

@Test
public void validValue() {
    LocaleKeyValueItem victim = new LocaleKeyValueItem(Locale.ITALY);
    assertEquals(StringUtils.capitalize(Locale.ITALY.getDisplayName()), victim.getValue());
    assertEquals(Locale.ITALY.toLanguageTag(), victim.getKey());
}

From source file:org.openhie.openempi.util.DateConverterTest.java

public void testInternationalization() throws Exception {
    List<Locale> locales = new ArrayList<Locale>() {
        private static final long serialVersionUID = 1L;
        {//from w ww.  j  av  a2s .c  o  m
            add(Locale.US);
            add(Locale.GERMANY);
            add(Locale.FRANCE);
            add(Locale.CHINA);
            add(Locale.ITALY);
        }
    };

    for (Locale locale : locales) {
        LocaleContextHolder.setLocale(locale);
        testConvertStringToDate();
        testConvertDateToString();
        testConvertStringToTimestamp();
        testConvertTimestampToString();
    }
}

From source file:org.openmrs.contrib.metadatarepository.util.DateConverterTest.java

public void testInternationalization() throws Exception {
    final List<Locale> locales = new ArrayList<Locale>() {

        private static final long serialVersionUID = 1L;
        {/* w ww . j  a  v  a 2 s .c o  m*/
            add(Locale.US);
            add(Locale.GERMANY);
            add(Locale.FRANCE);
            add(Locale.CHINA);
            add(Locale.ITALY);
        }
    };

    for (final Locale locale : locales) {
        LocaleContextHolder.setLocale(locale);
        testConvertStringToDate();
        testConvertDateToString();
        testConvertStringToTimestamp();
        testConvertTimestampToString();
    }
}

From source file:org.constretto.spring.configuration.AutowiredConstrettoConfigurationAnnotationTest.java

@Test
public void useDefaultValueFactoryWhenPresent() {
    assertEquals(Locale.ITALY, validBeanWithComplexDefault.getLocale());
}

From source file:eu.cloud4soa.frontend.commons.client.datamodel.frontend.UserManagementTest.java

@Test
@Ignore//w w  w  .j a  va  2 s  .  co  m
public void createUserTest() throws SOAException {
    DeveloperInstance developerInstance = new DeveloperInstance();
    developerInstance.setFirstName("Yosu");
    developerInstance.setFamilyname("Gorroogoitia");
    developerInstance.setAccountname("yosu");
    developerInstance.setGeekcode("yosu");
    developerInstance.setSurname("Gorroogoitia");
    Calendar calendar = Calendar.getInstance(Locale.ITALY);
    calendar.set(1967, 3, 11);
    developerInstance.setBirthday(Calendar.getInstance().getTime());
    developerInstance.setCloud4SoaAccountUriId("yosu");
    developerInstance.setAccountname("yosu");
    //developerInstance.setUriId("http://www.cloud4soa.eu/yosu#");

    Response resp = userManagementAndSecurityModule.createNewAccount(developerInstance, "username", "password");

    String userId = (String) resp.getEntity();
    System.out.println("UserID: " + userId);

}

From source file:org.neo4art.importer.wikipedia.core.listener.WikipediaAbstractImporterListener.java

@Override
public void process(WikiArticle article, Siteinfo siteinfo) throws SAXException {

    long pages = pageCount.incrementAndGet();

    if (logger.isInfoEnabled()) {
        if (pages % 500_000 == 0) {
            logger.info(NumberFormat.getInstance(Locale.ITALY).format(pages)
                    + " wikipedia pages parsed from dump so far...");
        }/*from www  .  j a  va  2s.c o  m*/
    }

    if (StringUtils.isNotBlank(article.getTitle())) {

        WikipediaElement wikipediaElement = WikipediaElementTransformer.toWikipediaElement(article);

        if (wikipediaElement != null) {
            this.wikipediaElementBuffer.add(wikipediaElement);
        }

        if (this.wikipediaElementBuffer.size() == this.batchSize) {
            if (this.batchSize != WikipediaImporterListener.NO_BUFFER_LIMITS_FOR_FULL_IN_MEMORY_MANAGEMENT) {
                flush();
            }
        }
    }
}

From source file:org.lockss.extractor.TestArticleMetadata.java

public void testSetLocale() {
    assertSame(MetadataUtil.getDefaultLocale(), am.getLocale());
    am.setLocale(Locale.ITALY);
    assertSame(Locale.ITALY, am.getLocale());
}

From source file:org.neo4art.importer.wikipedia.core.WikipediaBufferedBatchImporter.java

@Override
public long importDump(File dumpFile) throws IOException, SAXException, ParserConfigurationException {
    logger.info("Wikipedia dump file import started...");

    long dumpImportStartDate = Calendar.getInstance().getTimeInMillis();

    long newNodes = 0;
    long newRelationships = 0;

    GraphDatabaseConnectionManager graphDatabaseConnectionManager = GraphDatabaseConnectionManagerFactory
            .getInstance(GraphDatabaseConnectionType.BATCH_INSERTER);

    logger.info("Configuration: ");
    logger.info("------------------------------------------------");
    logger.info("Batch size " + NumberFormat.getInstance(Locale.ITALY).format(BATCH_SIZE));
    logger.info("Store directory is " + graphDatabaseConnectionManager.getStoreDir());
    logger.info("");

    {//from  w  w w  . java2s.  co  m
        logger.info("Creation of Wikipedia nodes started...");
        WikipediaImporterListener wikipediaNodesImporterListener = new WikipediaNodesBatchImporterListener();
        wikipediaNodesImporterListener.setBatchSize(BATCH_SIZE);
        long parserForNodesStartDate = Calendar.getInstance().getTimeInMillis();
        WikiXMLParser parserForNodes = new WikiXMLParser(dumpFile, wikipediaNodesImporterListener);
        parserForNodes.parse();
        long parserForNodesEndDate = Calendar.getInstance().getTimeInMillis();
        wikipediaNodesImporterListener.flush();
        newNodes = wikipediaNodesImporterListener.getGraphCount();
        logger.info("Done! " + NumberFormat.getInstance(Locale.ITALY).format(newNodes) + " nodes created in "
                + (parserForNodesEndDate - parserForNodesStartDate) + " ms.");
    }

    {
        logger.info("Creation of Wikipedia relationships started...");
        WikipediaImporterListener wikipediaRelsImporterListener = new WikipediaRelsBatchImporterListener();
        wikipediaRelsImporterListener.setBatchSize(BATCH_SIZE);
        long parserForRelsStartDate = Calendar.getInstance().getTimeInMillis();
        WikiXMLParser parserForRels = new WikiXMLParser(dumpFile, wikipediaRelsImporterListener);
        parserForRels.parse();
        long parserForRelsEndDate = Calendar.getInstance().getTimeInMillis();
        wikipediaRelsImporterListener.flush();
        newRelationships = wikipediaRelsImporterListener.getGraphCount();
        logger.info("Done! " + NumberFormat.getInstance(Locale.ITALY).format(newRelationships)
                + " relationships created in " + (parserForRelsEndDate - parserForRelsStartDate) + " ms.");
    }

    {
        logger.info("Creation of Wikipedia indexes started...");
        long indexCreationStartDate = Calendar.getInstance().getTimeInMillis();
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.Wikipedia, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaArtistPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaArtMovementPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaArtworkPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaBookPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaColourPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaCountryPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaDocumentPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaMonumentPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaMuseumPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaReligiousBuildingPage,
                "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaSettlementPage, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaFile, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaCategory, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaProject, "title");
        graphDatabaseConnectionManager.createSchemaIndex(WikipediaLabel.WikipediaTemplate, "title");
        long indexCreationEndDate = Calendar.getInstance().getTimeInMillis();
        logger.info("Done! Indexes created in " + (indexCreationEndDate - indexCreationStartDate) + " ms.");
    }

    {
        long shutdownStartDate = Calendar.getInstance().getTimeInMillis();
        graphDatabaseConnectionManager.close();
        long shutdownEndDate = Calendar.getInstance().getTimeInMillis();
        logger.info("Done! Shutdown completed in " + (shutdownEndDate - shutdownStartDate) + " ms.");
    }

    long dumpImportEndDate = Calendar.getInstance().getTimeInMillis();
    logger.info(
            "Wikipedia dump file import completed in " + (dumpImportEndDate - dumpImportStartDate) + " ms.");

    return newNodes + newRelationships;
}

From source file:org.lockss.extractor.TestArticleMetadata.java

public void testIllSetLocale() {
    assertSame(MetadataUtil.getDefaultLocale(), am.getLocale());
    assertTrue(am.put(FIELD_JOURNAL_TITLE, "val1"));
    try {/*from w  w w  .  j  a va 2  s .  c o m*/
        am.setLocale(Locale.ITALY);
        fail("Attempt to set Locale should throw IllegalStateException");
    } catch (IllegalStateException e) {
    }
    assertSame(MetadataUtil.getDefaultLocale(), am.getLocale());
}

From source file:it.larusba.integration.neo4j.jsonloader.transformer.DomainDrivenJsonTransformer.java

/**
 * The method transforms the JSON map.//from w w w .  j  a v a  2 s. com
 * 
 * @param documentId
 *          the document ID
 * @param documentType
 *          the type of the document
 * @param documentMap
 *          the document's map
 * @param objectDescriptorHelper
 *          the descriptor helper
 * @param index the index
 * @return the node
 */
private DocumentNode transform(String documentId, String documentType, Map<String, Object> documentMap,
        JsonObjectDescriptorHelper objectDescriptorHelper, int index) {
    String nodeLabel = buildNodeLabel(documentType, documentMap, objectDescriptorHelper);
    String nodeName = nodeLabel.toLowerCase(Locale.ITALY);
    DocumentNode node = new DocumentNode(documentId, documentType, nodeName, nodeLabel);
    node.setDepth(index);
    index++;
    for (String attributeName : documentMap.keySet()) {
        Object attributeValue = documentMap.get(attributeName);
        if (attributeValue instanceof Map) {
            handleMap(documentId, objectDescriptorHelper, node, attributeName, attributeValue, index);
        } else if (attributeValue instanceof List) {
            handleList(documentId, objectDescriptorHelper, node, attributeName, attributeValue, index);
        } else {
            handleSimpleAttribute(objectDescriptorHelper, node, attributeName, attributeValue);
        }
    }
    node.setName(node.getQualifiedName());
    return node;
}