Example usage for java.util Locale FRENCH

List of usage examples for java.util Locale FRENCH

Introduction

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

Prototype

Locale FRENCH

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

Click Source Link

Document

Useful constant for language.

Usage

From source file:org.openmrs.module.sync.SyncConceptTest.java

License:asdf

@Test
@NotTransactional//from   w w w .j ava 2s. co  m
public void shouldAddNameToConcept() throws Exception {
    runSyncTest(new SyncTestHelper() {

        ConceptService cs = Context.getConceptService();

        int numNamesBefore;

        public void runOnChild() {
            Concept wt = cs.getConceptByName("WEIGHT");
            numNamesBefore = wt.getNames().size();
            wt.addName(new ConceptName("POIDS", Locale.FRENCH));
            cs.saveConcept(wt);
        }

        public void runOnParent() {
            Concept wt = cs.getConceptByName("WEIGHT");
            assertNotNull(wt);
            assertEquals("Should be one more name than before", numNamesBefore + 1, wt.getNames().size());
            assertEquals("Incorrect french name", "POIDS", wt.getName(Locale.FRENCH, true).getName());
        }
    });
}

From source file:org.squale.welcom.taglib.dropdownpanel.DropDownPanelTag.java

/**
 * @see javax.servlet.jsp.tagext.BodyTagSupport#release()
 *//*  w  ww.j  av a  2 s  .co  m*/
public void release() {
    super.release();
    titleKey = "";
    expanded = false;
    width = null;
    headerClass = null;
    name = "";
    headerStyle = "";
    contentClass = null;
    contentStyle = "";
    iconColor = BLUE;
    filter = null;
    resources = null;
    localeRequest = Locale.FRENCH;
    lazyLoading = true;
    onExpand = "";
    onCollapse = "";
    topMode = false;
}

From source file:org.apache.sling.i18n.it.ResourceBundleProviderIT.java

private void assertMessages(final String key, final String deMessage, final String deDeMessage,
        final String frMessage) {
    new Retry(RETRY_TIMEOUT_MSEC) {
        @Override//w w w  . j a v  a  2 s  .  c  o  m
        protected void exec() {
            {
                final ResourceBundle deDE = resourceBundleProvider.getResourceBundle(Locale.GERMANY); // this is the resource bundle for de_DE
                assertNotNull(deDE);
                assertEquals(deDeMessage, deDE.getString(key));
            }
            {
                final ResourceBundle de = resourceBundleProvider.getResourceBundle(Locale.GERMAN);
                assertNotNull(de);
                assertEquals(deMessage, de.getString(key));
            }
            {
                final ResourceBundle fr = resourceBundleProvider.getResourceBundle(Locale.FRENCH);
                assertNotNull(fr);
                assertEquals(frMessage, fr.getString(key));
            }
        }
    };
}

From source file:org.squale.squaleweb.util.SqualeWebActionUtils.java

/**
 * @param pRequest la requete http//ww w. ja  va2s. c om
 * @return le formatter de nombre correspondant  la locale
 */
public static NumberFormat getNumberFormat(HttpServletRequest pRequest) {
    NumberFormat formatter = null;
    try {
        // En anglais par dfaut
        formatter = (DecimalFormat) DecimalFormat.getInstance();
        // Si c'est en francais , on n'affiche pas les "," pour sparer les chiffres
        if (pRequest.getLocale().getLanguage().equals(Locale.FRENCH.toString())) {
            ((DecimalFormat) formatter).setGroupingUsed(false);
        }
    } catch (NumberFormatException nfe) {
        // en cas de problme rencontr, on renvoie le formatter par dfaut
        formatter = NumberFormat.getInstance();
    }
    return formatter;
}

From source file:org.geoserver.wms.web.data.StyleEditPageTest.java

@Test
public void testCopyStyleFrenchLocale() throws Exception {
    final Session session = tester.getSession();
    try {/*from   ww  w . java2s  .  c  om*/
        session.clear();
        session.setLocale(Locale.FRENCH);

        StyleEditPage edit = new StyleEditPage(buildingsStyle);
        tester.startPage(edit);
        // print(tester.getLastRenderedPage(), true, true);

        // test the copy style link
        tester.newFormTester("styleForm").select("context:panel:existingStyles", 1);
        tester.executeAjaxEvent("styleForm:context:panel:existingStyles", "onchange");
        Component copyLink = tester.getComponentFromLastRenderedPage("styleForm:context:panel:copy");
        tester.executeAjaxEvent(copyLink, "onClick");
        // check single quote in the message has been escaped
        assertTrue(tester.getLastResponseAsString().contains("l\\'diteur"));
    } finally {
        session.clear();
        session.setLocale(Locale.getDefault());
    }
}

From source file:org.openmrs.module.sync.SyncConceptTest.java

License:asdf

@Test
@NotTransactional/*w w  w . j a  v a2 s .c  om*/
public void shouldAddDescriptionToConcept() throws Exception {
    runSyncTest(new SyncTestHelper() {

        ConceptService cs = Context.getConceptService();

        int numDescriptionsBefore;

        public void runOnChild() {
            Concept wt = cs.getConceptByName("WEIGHT");
            numDescriptionsBefore = wt.getDescriptions().size();
            wt.addDescription(new ConceptDescription("Everyone tries to lose this", Locale.FRENCH));
            cs.saveConcept(wt);
        }

        public void runOnParent() {
            Concept wt = cs.getConceptByName("WEIGHT");
            assertNotNull(wt);
            assertEquals("Should be one more description than before", numDescriptionsBefore + 1,
                    wt.getDescriptions().size());
            assertEquals("Incorrect french description", wt.getDescription(Locale.FRENCH).getDescription(),
                    "Everyone tries to lose this");
        }
    });
}

From source file:org.nuxeo.ecm.directory.TestDirectoryEntryResolver.java

private void checkMessage(DirectoryEntryResolver derr) {
    for (Locale locale : Arrays.asList(Locale.FRENCH, Locale.ENGLISH)) {
        String message = derr.getConstraintErrorMessage("abc123", locale);
        assertNotNull(message);//from   w w  w  . j ava2s  . c  o m
        assertFalse(message.trim().isEmpty());
        System.out.println(message);
    }
}

From source file:org.yccheok.jstock.gui.JStock.java

/**
 * Initialize language menu items so that correct item is being selected
 * according to current default locale./*from w  w w. jav a 2 s.  c  o m*/
 */
private void initLanguageMenuItemsSelection() {
    // Please revise Statement's construct code, when adding in new language.
    // So that its language guessing algorithm will work as it is.

    final Locale defaultLocale = Locale.getDefault();
    if (Utils.isTraditionalChinese(defaultLocale)) {
        this.jRadioButtonMenuItem4.setSelected(true);
    } else if (Utils.isSimplifiedChinese(defaultLocale)) {
        this.jRadioButtonMenuItem2.setSelected(true);
    } else if (defaultLocale.getLanguage().equals(Locale.GERMAN.getLanguage())) {
        this.jRadioButtonMenuItem3.setSelected(true);
    } else if (defaultLocale.getLanguage().equals(Locale.ITALIAN.getLanguage())) {
        this.jRadioButtonMenuItem5.setSelected(true);
    } else if (defaultLocale.getLanguage().equals(Locale.FRENCH.getLanguage())) {
        this.jRadioButtonMenuItem6.setSelected(true);
    } else {
        this.jRadioButtonMenuItem1.setSelected(true);
    }
}

From source file:org.nightlabs.jfire.accounting.AccountingManagerBean.java

@TransactionAttribute(TransactionAttributeType.REQUIRED)
@RolesAllowed("_System_")
@Override//from ww w.j  av a  2  s . c  om
public void initialise() throws IOException {
    final PersistenceManager pm = createPersistenceManager();
    try {
        //         SecurityChangeListenerTariffUserSet.register(pm);
        pm.getExtent(PFMoneyFlowMapping.class);
        pm.getExtent(OwnerDimension.class);
        pm.getExtent(PriceFragmentDimension.class);

        MoneyFlowDimension priceFragmentDimension = MoneyFlowDimension.getMoneyFlowDimension(pm,
                PriceFragmentDimension.MONEY_FLOW_DIMENSION_ID);
        if (priceFragmentDimension == null) {
            priceFragmentDimension = new PriceFragmentDimension();
            priceFragmentDimension = pm.makePersistent(priceFragmentDimension);
        }

        MoneyFlowDimension ownerDimension = MoneyFlowDimension.getMoneyFlowDimension(pm,
                OwnerDimension.MONEY_FLOW_DIMENSION_ID);
        if (ownerDimension == null) {
            ownerDimension = new OwnerDimension();
            ownerDimension = pm.makePersistent(ownerDimension);
        }

        MoneyFlowDimension sourceOrgDimension = MoneyFlowDimension.getMoneyFlowDimension(pm,
                SourceOrganisationDimension.MONEY_FLOW_DIMENSION_ID);
        if (sourceOrgDimension == null) {
            sourceOrgDimension = new SourceOrganisationDimension();
            sourceOrgDimension = pm.makePersistent(sourceOrgDimension);
        }

        PayableObjectMoneyTransferFactory invoiceTransferFactory = PayableObjectMoneyTransferFactoryJDO
                .getFactory(pm, null, PartnerPayPayableObjectAccountantDelegate.PAYABLE_OBJECT_FACTORY_SCOPE,
                        Invoice.class);
        if (invoiceTransferFactory == null) {
            invoiceTransferFactory = new InvoiceMoneyTransferFactoryJDO(
                    PartnerPayPayableObjectAccountantDelegate.PAYABLE_OBJECT_FACTORY_SCOPE);
            pm.makePersistent(invoiceTransferFactory);
        }

        pm.getExtent(AccountType.class);
        try {
            pm.getObjectById(AccountType.ACCOUNT_TYPE_ID_UNCOLLECTABLE);
        } catch (final JDOObjectNotFoundException x) {
            final AccountType accountType = pm
                    .makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_UNCOLLECTABLE, false));
            accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Uncollectable");
            accountType.getName().setText(Locale.GERMAN.getLanguage(), "Uneinbringlich");
        }

        pm.getFetchPlan().addGroup(FetchPlan.DEFAULT);
        Price.setDefaultTotalPriceFragmentType(pm.detachCopy(PriceFragmentType.getTotalPriceFragmentType(pm)));

        initRegisterConfigModules(pm);

        BugfixWrongOutstandingFlag.fix(pm);

        UpdateTo12AccountantStructure.update(pm);

        // check, whether the datastore is already initialized
        try {
            pm.getObjectById(AccountType.ACCOUNT_TYPE_ID_OUTSIDE);
            return; // already initialized
        } catch (final JDOObjectNotFoundException x) {
            // datastore not yet initialized
        }

        // Initalise standard property set structures for articleContainers
        InvoiceStruct.getInvoiceStructLocal(pm);

        pm.makePersistent(new ResellerTariffUserSetFactory(Organisation.DEV_ORGANISATION_ID,
                ResellerTariffUserSetFactory.class.getName(), Tariff.class));
        pm.makePersistent(new EntityUserSetNotificationFilterEntry(Organisation.DEV_ORGANISATION_ID,
                Tariff.class.getName(), Tariff.class));

        // create and persist the AccountTypes
        AccountType accountType;
        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_OUTSIDE, true));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Outside");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Auerhalb");

        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_LOCAL_EXPENSE, false));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Expense");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Aufwand");

        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_LOCAL_REVENUE, false));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Revenue");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Einnahme");

        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_PARTNER_CUSTOMER, false));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Customer");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Kunde");

        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_PARTNER_NEUTRAL, false));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Business partner");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Geschftspartner");

        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_PARTNER_VENDOR, false));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Vendor");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Lieferant");

        accountType = pm.makePersistent(new AccountType(AccountType.ACCOUNT_TYPE_ID_SUMMARY, false));
        accountType.getName().setText(Locale.ENGLISH.getLanguage(), "Summary");
        accountType.getName().setText(Locale.GERMAN.getLanguage(), "Summenkonto");

        final Accounting accounting = Accounting.getAccounting(pm);
        final Trader trader = Trader.getTrader(pm);

        final LegalEntity anonymousCustomer = LegalEntity.getAnonymousLegalEntity(pm);
        final CustomerGroup anonymousCustomerGroup = anonymousCustomer.getDefaultCustomerGroup();

        //       create some ModeOfPayments
        // Cash
        ModeOfPayment modeOfPayment = new ModeOfPayment(ModeOfPaymentConst.MODE_OF_PAYMENT_ID_CASH);
        modeOfPayment.getName().setText(Locale.ENGLISH.getLanguage(), "Cash");
        modeOfPayment.getName().setText(Locale.GERMAN.getLanguage(), "Bargeld");
        modeOfPayment.getName().setText(Locale.FRENCH.getLanguage(), "Argent Liquide");
        ModeOfPaymentFlavour modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_CASH);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "Cash");
        modeOfPaymentFlavour.getName().setText(Locale.GERMAN.getLanguage(), "Bargeld");
        modeOfPaymentFlavour.getName().setText(Locale.FRENCH.getLanguage(), "Argent Liquide");
        modeOfPaymentFlavour.loadIconFromResource();
        pm.makePersistent(modeOfPayment);
        trader.getDefaultCustomerGroupForKnownCustomer().addModeOfPayment(modeOfPayment);
        anonymousCustomerGroup.addModeOfPayment(modeOfPayment);

        // we need this later for payment processor registration
        final ModeOfPayment modeOfPaymentCash = modeOfPayment;

        // No payment - this is a dummy MOP which means, the payment is postponed without
        //   specifying a certain real MOP
        modeOfPayment = new ModeOfPayment(ModeOfPaymentConst.MODE_OF_PAYMENT_ID_NON_PAYMENT);
        modeOfPayment.getName().setText(Locale.ENGLISH.getLanguage(), "Non-Payment");
        modeOfPayment.getName().setText(Locale.GERMAN.getLanguage(), "Nichtzahlung");
        modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_NON_PAYMENT);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "Non-Payment");
        modeOfPaymentFlavour.getName().setText(Locale.GERMAN.getLanguage(), "Nichtzahlung");
        modeOfPaymentFlavour.loadIconFromResource();
        pm.makePersistent(modeOfPayment);
        trader.getDefaultCustomerGroupForKnownCustomer().addModeOfPayment(modeOfPayment);

        // we need this later for payment processor registration
        final ModeOfPayment modeOfPaymentNonPayment = modeOfPayment;

        // Credit Card - VISA, Master, AmEx, Diners
        modeOfPayment = new ModeOfPayment(ModeOfPaymentConst.MODE_OF_PAYMENT_ID_CREDIT_CARD);
        modeOfPayment.getName().setText(Locale.ENGLISH.getLanguage(), "Credit Card");
        modeOfPayment.getName().setText(Locale.GERMAN.getLanguage(), "Kreditkarte");
        modeOfPayment.getName().setText(Locale.FRENCH.getLanguage(), "Carte de Crdit");
        modeOfPaymentFlavour = modeOfPayment.createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_VISA);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "VISA");
        modeOfPaymentFlavour.loadIconFromResource();
        modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_MASTER_CARD);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "MasterCard");
        modeOfPaymentFlavour.loadIconFromResource();
        modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_AMERICAN_EXPRESS);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "American Express");
        modeOfPaymentFlavour.loadIconFromResource();
        modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_DINERS_CLUB);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "Diners Club");
        modeOfPaymentFlavour.loadIconFromResource();
        pm.makePersistent(modeOfPayment);
        trader.getDefaultCustomerGroupForKnownCustomer().addModeOfPayment(modeOfPayment);
        anonymousCustomerGroup.addModeOfPayment(modeOfPayment);

        // we need this later for payment processor registration
        final ModeOfPayment modeOfPaymentCreditCard = modeOfPayment;

        // Bank Transfer
        modeOfPayment = new ModeOfPayment(ModeOfPaymentConst.MODE_OF_PAYMENT_ID_BANK_TRANSFER);
        modeOfPayment.getName().setText(Locale.ENGLISH.getLanguage(), "Bank Transfer");
        modeOfPayment.getName().setText(Locale.GERMAN.getLanguage(), "berweisung");
        modeOfPayment.getName().setText(Locale.FRENCH.getLanguage(), "Virement");
        modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_BANK_TRANSFER);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "Bank Transfer");
        modeOfPaymentFlavour.getName().setText(Locale.GERMAN.getLanguage(), "berweisung");
        modeOfPaymentFlavour.getName().setText(Locale.FRENCH.getLanguage(), "Virement");
        modeOfPaymentFlavour.loadIconFromResource();
        pm.makePersistent(modeOfPayment);
        trader.getDefaultCustomerGroupForKnownCustomer().addModeOfPayment(modeOfPayment);

        // we need this later for payment processor registration
        final ModeOfPayment modeOfPaymentBankTransfer = modeOfPayment;

        // Debit Note
        modeOfPayment = new ModeOfPayment(ModeOfPaymentConst.MODE_OF_PAYMENT_ID_DEBIT_NOTE);
        modeOfPayment.getName().setText(Locale.ENGLISH.getLanguage(), "Debit Note");
        modeOfPayment.getName().setText(Locale.GERMAN.getLanguage(), "Lastschrift");
        modeOfPayment.getName().setText(Locale.FRENCH.getLanguage(), "Note de Dbit");
        modeOfPaymentFlavour = modeOfPayment
                .createFlavour(ModeOfPaymentConst.MODE_OF_PAYMENT_FLAVOUR_ID_DEBIT_NOTE);
        modeOfPaymentFlavour.getName().setText(Locale.ENGLISH.getLanguage(), "Debit Note");
        modeOfPaymentFlavour.getName().setText(Locale.GERMAN.getLanguage(), "Lastschrift");
        modeOfPaymentFlavour.getName().setText(Locale.FRENCH.getLanguage(), "Note de Dbit");
        modeOfPaymentFlavour.loadIconFromResource();
        pm.makePersistent(modeOfPayment);
        trader.getDefaultCustomerGroupForKnownCustomer().addModeOfPayment(modeOfPayment);

        // we need this later for payment processor registration
        final ModeOfPayment modeOfPaymentDebitNote = modeOfPayment;

        // create some ServerPaymentProcessors
        final ServerPaymentProcessorCash serverPaymentProcessorCash = ServerPaymentProcessorCash
                .getServerPaymentProcessorCash(pm);
        serverPaymentProcessorCash.getName().setText(Locale.ENGLISH.getLanguage(), "Cash Payment");
        serverPaymentProcessorCash.getName().setText(Locale.GERMAN.getLanguage(), "Barzahlung");
        serverPaymentProcessorCash.getName().setText(Locale.FRENCH.getLanguage(), "Paiement Argent Liquide");
        serverPaymentProcessorCash.addModeOfPayment(modeOfPaymentCash);

        final ServerPaymentProcessorNonPayment serverPaymentProcessorNonPayment = ServerPaymentProcessorNonPayment
                .getServerPaymentProcessorNonPayment(pm);
        serverPaymentProcessorNonPayment.getName().setText(Locale.ENGLISH.getLanguage(),
                "Non-Payment (payment will be postponed)");
        serverPaymentProcessorNonPayment.getName().setText(Locale.GERMAN.getLanguage(),
                "Nichtzahlung (Zahlung wird verschoben)");
        serverPaymentProcessorNonPayment.addModeOfPayment(modeOfPaymentNonPayment);

        final ServerPaymentProcessorCreditCardDummyForClientPayment serverPaymentProcessorCreditCardDummyForClientPayment = ServerPaymentProcessorCreditCardDummyForClientPayment
                .getServerPaymentProcessorCreditCardDummyForClientPayment(pm);
        serverPaymentProcessorCreditCardDummyForClientPayment.getName().setText(Locale.ENGLISH.getLanguage(),
                "Dummy for client-sided Credit Card Payment");
        serverPaymentProcessorCreditCardDummyForClientPayment.getName().setText(Locale.GERMAN.getLanguage(),
                "Pseudo-Modul fr client-seitige Kreditkarten-Zahlungen");
        serverPaymentProcessorCreditCardDummyForClientPayment.addModeOfPayment(modeOfPaymentCreditCard);

        final ServerPaymentProcessorBankTransferGermany serverPaymentProcessorBankTransferGermany = ServerPaymentProcessorBankTransferGermany
                .getServerPaymentProcessorBankTransferGermany(pm);
        serverPaymentProcessorBankTransferGermany.getName().setText(Locale.ENGLISH.getLanguage(),
                "Bank transfer within Germany");
        serverPaymentProcessorBankTransferGermany.getName().setText(Locale.GERMAN.getLanguage(),
                "berweisung innerhalb Deutschlands");
        serverPaymentProcessorBankTransferGermany.addModeOfPayment(modeOfPaymentBankTransfer);

        final ServerPaymentProcessorDebitNoteGermany serverPaymentProcessorDebitNoteGermany = ServerPaymentProcessorDebitNoteGermany
                .getServerPaymentProcessorDebitNoteGermany(pm);
        serverPaymentProcessorDebitNoteGermany.getName().setText(Locale.ENGLISH.getLanguage(),
                "Debit Note within Germany");
        serverPaymentProcessorDebitNoteGermany.getName().setText(Locale.GERMAN.getLanguage(),
                "Lastschrift innerhalb Deutschlands");
        serverPaymentProcessorDebitNoteGermany.addModeOfPayment(modeOfPaymentDebitNote);

        // persist process definitions
        ProcessDefinition processDefinitionInvoiceCustomerLocal;
        processDefinitionInvoiceCustomerLocal = accounting.storeProcessDefinitionInvoice(
                TradeSide.customerLocal,
                ProcessDefinitionAssignment.class.getResource("invoice/customer/local/"));
        pm.makePersistent(new ProcessDefinitionAssignment(Invoice.class, TradeSide.customerLocal,
                processDefinitionInvoiceCustomerLocal));

        ProcessDefinition processDefinitionInvoiceCustomerCrossOrg;
        processDefinitionInvoiceCustomerCrossOrg = accounting.storeProcessDefinitionInvoice(
                TradeSide.customerCrossOrganisation,
                ProcessDefinitionAssignment.class.getResource("invoice/customer/crossorganisation/"));
        pm.makePersistent(new ProcessDefinitionAssignment(Invoice.class, TradeSide.customerCrossOrganisation,
                processDefinitionInvoiceCustomerCrossOrg));

        ProcessDefinition processDefinitionInvoiceVendor;
        processDefinitionInvoiceVendor = accounting.storeProcessDefinitionInvoice(TradeSide.vendor,
                ProcessDefinitionAssignment.class.getResource("invoice/vendor/"));
        pm.makePersistent(new ProcessDefinitionAssignment(Invoice.class, TradeSide.vendor,
                processDefinitionInvoiceVendor));

        // deactive IDGenerator's cache for invoice
        final IDNamespaceDefault idNamespaceDefault = IDNamespaceDefault.createIDNamespaceDefault(pm,
                getOrganisationID(), Invoice.class);
        idNamespaceDefault.setCacheSizeServer(0);
        idNamespaceDefault.setCacheSizeClient(0);

        pm.makePersistent(new EditLockTypeInvoice(EditLockTypeInvoice.EDIT_LOCK_TYPE_ID));

    } finally {
        pm.close();
    }
}

From source file:org.talend.dataquality.standardization.phone.PhoneNumberHandlerBaseTest.java

@Test
public void testGetCarrierNameForNumber() {

    assertEquals(StringUtils.EMPTY,/*from   ww  w  . jav a2 s .co  m*/
            phoneNumberHandlerBase.getCarrierNameForNumber(CN_NUM_1, REGCODE_CN, Locale.SIMPLIFIED_CHINESE));
    assertEquals("China Unicom", //$NON-NLS-1$
            phoneNumberHandlerBase.getCarrierNameForNumber(CN_NUM_1, REGCODE_CN, Locale.UK));
    assertEquals("China Mobile", //$NON-NLS-1$
            phoneNumberHandlerBase.getCarrierNameForNumber(CN_NUM_2, REGCODE_CN, Locale.UK));

    assertEquals(StringUtils.EMPTY,
            phoneNumberHandlerBase.getCarrierNameForNumber(FR_NUM_3, REGCODE_FR, Locale.UK));
    assertEquals("Bouygues", phoneNumberHandlerBase.getCarrierNameForNumber(FR_NUM_5, REGCODE_FR, Locale.UK)); //$NON-NLS-1$
    assertEquals("Bouygues", //$NON-NLS-1$
            phoneNumberHandlerBase.getCarrierNameForNumber(FR_NUM_5, REGCODE_FR, Locale.FRENCH));

    assertEquals(StringUtils.EMPTY,
            phoneNumberHandlerBase.getCarrierNameForNumber(US_NUM_1, REGCODE_US, Locale.UK));

    assertEquals(StringUtils.EMPTY,
            phoneNumberHandlerBase.getCarrierNameForNumber(DE_NUM_1, REGCODE_DE, Locale.UK));
    assertEquals(StringUtils.EMPTY,
            phoneNumberHandlerBase.getCarrierNameForNumber(DE_NUM_1, REGCODE_DE, Locale.GERMANY));

}