Example usage for java.math BigDecimal TEN

List of usage examples for java.math BigDecimal TEN

Introduction

In this page you can find the example usage for java.math BigDecimal TEN.

Prototype

BigDecimal TEN

To view the source code for java.math BigDecimal TEN.

Click Source Link

Document

The value 10, with a scale of 0.

Usage

From source file:alfio.manager.UploadedResourceIntegrationTest.java

@Before
public void ensureConfiguration() {

    IntegrationTestUtil.ensureMinimalConfiguration(configurationRepository);
    List<TicketCategoryModification> categories = Collections.singletonList(new TicketCategoryModification(null,
            "default", AVAILABLE_SEATS, new DateTimeModification(LocalDate.now().minusDays(1), LocalTime.now()),
            new DateTimeModification(LocalDate.now().plusDays(1), LocalTime.now()), DESCRIPTION, BigDecimal.TEN,
            false, "", false, null, null, null, null, null));
    Pair<Event, String> eventAndUser = initEvent(categories, organizationRepository, userManager, eventManager,
            eventRepository);/*from   w  ww .j  a  v a2  s  .c o  m*/

    event = eventAndUser.getKey();
    user = eventAndUser.getValue() + "_owner";
}

From source file:com.redhat.lightblue.metadata.types.BigDecimalTypeTest.java

@Test
public void testCastGoodString() {
    assertTrue(bigDecimalType.cast(String.valueOf(BigDecimal.TEN)) instanceof BigDecimal);
}

From source file:alfio.manager.AdminReservationManagerIntegrationTest.java

@Test
public void testReserveFromExistingCategory() throws Exception {
    List<TicketCategoryModification> categories = Collections.singletonList(new TicketCategoryModification(null,
            "default", AVAILABLE_SEATS, new DateTimeModification(LocalDate.now(), LocalTime.now()),
            new DateTimeModification(LocalDate.now(), LocalTime.now()), DESCRIPTION, BigDecimal.TEN, false, "",
            false, null, null, null, null, null));
    performExistingCategoryTest(categories, false, Collections.singletonList(1), false, true, 0,
            AVAILABLE_SEATS);/*from   w  w  w.  j a va 2  s . co  m*/
}

From source file:de.hybris.platform.integration.cis.payment.commands.DefaultCisSubscriptionAuthorizationCommandTest.java

@Test
public void shouldAuthorize() throws Exception {
    final RestResponse hpfUrl = this.paymentClient.pspUrl("test");
    final String testClientRef = "JUNIT-TEST-CLIENT";

    //here we create a profile through Cybersource SOP, this profile will be used for the test authorizations
    final List<BasicNameValuePair> validFormData = CisPaymentIntegrationTestHelper.getValidFormDataMap();
    final Map<String, String> profileCreationResponse = CisPaymentIntegrationTestHelper
            .createNewProfile(hpfUrl.getLocation().toASCIIString(), validFormData);

    final CreateSubscriptionResult subscriptionResult = getCreateSubscriptionResult(testClientRef,
            profileCreationResponse);/*from  ww  w  .  j  ava  2 s  . co m*/

    final BillingInfo billingInfo = createBillingInfo();
    final SubscriptionAuthorizationRequest request = new SubscriptionAuthorizationRequest("order1234",
            subscriptionResult.getSubscriptionInfoData().getSubscriptionID(), Currency.getInstance("USD"),
            BigDecimal.TEN, billingInfo, "cisCybersource");

    final CommandFactory commandFactory = commandFactoryRegistry.getFactory("cisCybersource");
    final SubscriptionAuthorizationCommand command = commandFactory
            .createCommand(SubscriptionAuthorizationCommand.class);
    final AuthorizationResult authResult = command.perform(request);
    Assert.assertEquals(TransactionStatus.ACCEPTED, authResult.getTransactionStatus());
}

From source file:cz.muni.fi.pa165.legomanager.dao.LegoKitDaoImplTest.java

@Test(expected = DataAccessException.class)
public void addLegoSetsNullTest() {
    LegoKit legoKit = createLegoKit("StarWars Death Star", BigDecimal.TEN, 0, new HashSet<Category>(),
            new ArrayList<LegoPiece>(), null);
    legoKitDao.addLegoKit(legoKit);//from   w  ww  . j a va2 s .co m
}

From source file:fragment.web.AbstractCampaignPromotionsControllerTest.java

private CampaignPromotion generateCampaignPromotion(int days, boolean trial, boolean fixedAmount,
        boolean percentage) {

    CampaignPromotion campaignProm = new CampaignPromotion();
    if (fixedAmount) {
        campaignProm.setDiscountType(DiscountType.FIXED_AMOUNT);
    }//from  ww  w .ja v  a  2s  . c  o m
    if (percentage) {
        campaignProm.setDiscountType(DiscountType.PERCENTAGE);
        campaignProm.setPercentOff(BigDecimal.TEN);
    }
    campaignProm.setCode("NewCamp");
    campaignProm.setTitle("New");
    campaignProm.setCreateBy(getPortalUser());
    campaignProm.setUpdateBy(getPortalUser());
    campaignProm.setCreateDate(new Date());
    int noOfdays = days;
    Calendar createdAt = Calendar.getInstance();
    createdAt.add(Calendar.DATE, 0 - noOfdays);
    campaignProm.setStartDate(createdAt.getTime());
    campaignProm.setTrial(trial);
    return campaignProm;
}

From source file:org.apache.sling.jcr.resource.internal.JcrPropertyMapTest.java

public void testTypeByDefaultValue() throws Exception {
    this.rootNode.getSession().refresh(false);
    testValue(rootNode, "A String Value", "default");

    testValue(rootNode, 1l, (byte) 10);
    testValue(rootNode, 1l, (short) 10);
    testValue(rootNode, 1l, 10);//from   ww w.  j av a 2s  .c  o  m
    testValue(rootNode, 1l, 10l);

    testValue(rootNode, 1.0d, 10.0f);
    testValue(rootNode, 1.0d, 10.0d);
    testValue(rootNode, 1.0d, new BigDecimal("1.0"));

    testValue(rootNode, BigDecimal.TEN, 10.0f);
    testValue(rootNode, BigDecimal.TEN, 10.0d);
    testValue(rootNode, BigDecimal.TEN, BigDecimal.TEN);

    long refTime = 1000l;
    Date refDate = new Date(refTime);
    Calendar refCal = Calendar.getInstance();
    refCal.setTimeInMillis(refTime);

    Calendar cal = Calendar.getInstance();
    testValue(rootNode, cal, refCal);
    testValue(rootNode, cal, refDate);
    testValue(rootNode, cal, refTime);

    testValue(rootNode, BigDecimal.TEN, BigDecimal.ONE);
}

From source file:io.coala.time.TimeSpan.java

/**
 * {@link TimeSpan} static factory method
 * /*w w  w . jav  a 2  s.  co m*/
 * @param temporal a JSR-310 {@link TemporalAmount}
 */
public static TimeSpan of(final TemporalAmount temporal) {
    return new TimeSpan(
            BigDecimal.valueOf(temporal.get(ChronoUnit.NANOS))
                    .add(BigDecimal.valueOf(temporal.get(ChronoUnit.MILLIS)).multiply(BigDecimal.TEN.pow(6))),
            Units.NANOS);
}

From source file:com.ning.billing.analytics.dao.TestAnalyticsDao.java

private void setupBusinessAccount() {
    final List<String> tags = new ArrayList<String>();
    tags.add("batch1");
    tags.add("great,guy");
    account = new BusinessAccount(ACCOUNT_KEY, BigDecimal.ONE, tags, new DateTime(DateTimeZone.UTC),
            BigDecimal.TEN, "ERROR_NOT_ENOUGH_FUNDS", "CreditCard", "Visa", "FRANCE");

    final IDBI dbi = helper.getDBI();
    businessAccountDao = dbi.onDemand(BusinessAccountDao.class);

    // Healthcheck test to make sure MySQL is setup properly
    try {//www  . j a  v a  2s.  co  m
        businessAccountDao.test();
    } catch (Throwable t) {
        Assert.fail(t.toString());
    }
}

From source file:org.jrecruiter.service.system.impl.SystemSetupServiceImpl.java

/** {@inheritDoc} */
@Override//w ww  .  jav  a 2  s. c om
public void createDemoJobs(final User user, final Integer numberOfJobsToCreate) {
    final LoremIpsum loremIpsum = new LoremIpsum();

    Random random = new Random();

    final Industry demoIndustry = industryDao.get(1L);

    if (demoIndustry == null) {
        throw new IllegalStateException(String.format("No industry found for Id %s", 1L));
    }

    final Region demoRegion = regionDao.get(1L);

    if (demoRegion == null) {
        throw new IllegalStateException(String.format("No regions found for Id %s", 2L));
    }

    for (int i = 0; i <= numberOfJobsToCreate; i++) {

        final Job job = new Job();
        job.setBusinessAddress1(loremIpsum.getWords(2));
        job.setBusinessAddress2(loremIpsum.getWords(3));
        job.setBusinessCity(loremIpsum.getWords(2));
        job.setBusinessEmail(loremIpsum.getWords(1) + "@" + loremIpsum.getWords(1) + ".com");
        job.setBusinessName(loremIpsum.getWords(2));
        job.setBusinessPhone("111-111-1111");
        job.setBusinessPhoneExtension("111-111-1111");
        job.setBusinessState(loremIpsum.getWords(1));
        job.setBusinessZip(loremIpsum.getWords(1));
        job.setDescription(loremIpsum.getParagraphs(2));
        job.setIndustry(demoIndustry);
        job.setJobRestrictions(loremIpsum.getWords(30));
        job.setJobTitle(loremIpsum.getWords(2));
        job.setLatitude(BigDecimal.TEN);
        job.setLongitude(BigDecimal.TEN);
        job.setOfferedBy(OfferedBy.RECRUITER);

        if (i % 2 == 0) {
            job.setRegion(demoRegion);
        } else {
            job.setRegionOther("Some Other Region");
        }

        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_YEAR, random.nextInt(200));

        job.setRegistrationDate(cal.getTime());
        job.setUpdateDate(cal.getTime());
        job.setSalary("100000.50");
        job.setStatus(JobStatus.ACTIVE);

        job.setUser(user);
        job.setUsesMap(Boolean.TRUE);
        job.setWebsite("http://www.google.com/");

        this.jobDao.save(job);
    }
}