当前位置: 首页>>代码示例>>Java>>正文


Java BigDecimal.TEN属性代码示例

本文整理汇总了Java中java.math.BigDecimal.TEN属性的典型用法代码示例。如果您正苦于以下问题:Java BigDecimal.TEN属性的具体用法?Java BigDecimal.TEN怎么用?Java BigDecimal.TEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.math.BigDecimal的用法示例。


在下文中一共展示了BigDecimal.TEN属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: equals_different

@Test
public void equals_different() {

    final DataSourceFieldCompositeValue<BigDecimal> candidateMatchPair
            = new DefaultDataSourceFieldCompositeValue<>(
            new DefaultDataSourceFieldValue<>(rate, BigDecimal.ONE),
            new DefaultDataSourceFieldValue<>(rate, BigDecimal.TEN)
    );
    candidateMatchPair.match(equalsMatchingStrategy);
    assertThat(candidateMatchPair.getMatched(), is(false));
}
 
开发者ID:mattvickery,项目名称:dsMatch,代码行数:11,代码来源:DecimalMatchingStrategyTest.java

示例2: testDeserialize_Primitive

@Test
public void testDeserialize_Primitive() throws Exception {
    JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_PRIMITIVE);
    descriptor.setPrimitiveProperty(Long.MAX_VALUE);
    Assert.assertEquals(Long.MAX_VALUE, JavaBeanSerializeUtil.deserialize(descriptor));

    BigDecimal decimal = BigDecimal.TEN;
    Assert.assertEquals(Long.MAX_VALUE, descriptor.setPrimitiveProperty(decimal));
    Assert.assertEquals(decimal, JavaBeanSerializeUtil.deserialize(descriptor));

    String string = UUID.randomUUID().toString();
    Assert.assertEquals(decimal, descriptor.setPrimitiveProperty(string));
    Assert.assertEquals(string, JavaBeanSerializeUtil.deserialize(descriptor));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:14,代码来源:JavaBeanSerializeUtilTest.java

示例3: testBigDecimal

@Test
public void testBigDecimal() throws Exception {
    BigDecimal v1 = BigDecimal.valueOf(Double.MIN_VALUE);
    BigDecimal v2 = BigDecimal.valueOf(Double.MAX_VALUE).multiply(BigDecimal.valueOf(2));
    BigDecimal v3 = BigDecimal.ZERO;
    BigDecimal v4 = BigDecimal.ONE;
    BigDecimal v5 = BigDecimal.TEN;
    BigDecimal v6 = new BigDecimal(100);
    BigDecimal v7 = new BigDecimal(BigInteger.valueOf(Long.MAX_VALUE).multiply(BigInteger.valueOf(2)));

    check(input(v1, v2, v3, v4, v5, v6, v7), (v, out) -> out.writeBigDecimal(v), DataReader::readBigDecimal);
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:12,代码来源:NettyMessageReadWritTest.java

示例4: testSubscriptionFromPreviousMonthWithDiscount2

/**
 * Test for discount 1%.
 */
@Test
public void testSubscriptionFromPreviousMonthWithDiscount2()
        throws Exception {
    BigDecimal percent = new BigDecimal("1.00");
    BigDecimal amount = BigDecimal.TEN;

    testSubscriptionFromPreviousMonthWithDiscountBase(percent, amount);
    xmlValidator.validateBillingResultXML();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:BillingServiceBeanIT.java

示例5: WithSteppedPricesForPriceModel_FreePeriodBefore

/**
 * Billing test for price model with stepped price. The free periods ends
 * before billing period. Parameter are modified before billing period
 * 
 * @throws Exception
 */
@Test
public void WithSteppedPricesForPriceModel_FreePeriodBefore()
        throws Exception {
    int numUser = 4;
    final int testYear = 2010;
    final long billingTime = getTimeInMillisForBilling(testYear,
            Calendar.APRIL, 1);

    long subscriptionCreationTime = getTimeInMillisForBilling(testYear,
            Calendar.FEBRUARY, 1);
    long subscriptionActivationTime = subscriptionCreationTime;

    int freePeriod = getDaysOfMonth(testYear, Calendar.FEBRUARY) - 1;
    BigDecimal expectedPrice = new BigDecimal("1701.00");
    final Long[] limitArrayForDifferentAssignmentTime = new Long[] {
            Long.valueOf(2), Long.valueOf(3), null };

    BigDecimal[] priceArray = { BD500, BD400, BD300 };
    BigDecimal[] stepAmountArray = { BD1000, BD400, BD300 };

    BigDecimal pricePerUserassigment = BigDecimal.ZERO;
    BigDecimal oneTimeFee = BigDecimal.TEN;
    testBillingWithSteppedPricesForPriceModel(freePeriod, numUser,
            expectedPrice, true, limitArrayForDifferentAssignmentTime,
            priceArray, subscriptionCreationTime,
            subscriptionActivationTime, billingTime, pricePerUserassigment,
            oneTimeFee, stepAmountArray);
    xmlValidator.validateBillingResultXML();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:35,代码来源:BillingServiceBeanSteppedPriceIT.java

示例6: PriceModel_FreePeriodEnd_Equal_BillingStartTime

/**
 * Billing test for price model with stepped price. The free periods ends
 * with the first day of the billing period. Parameter are modified before
 * billing period
 * 
 * @throws Exception
 */
@Test
public void PriceModel_FreePeriodEnd_Equal_BillingStartTime()
        throws Exception {
    int numUser = 4;
    final int testYear = 2010;
    final long billingTime = getTimeInMillisForBilling(testYear,
            Calendar.APRIL, 1);

    long subscriptionCreationTime = getTimeInMillisForBilling(testYear,
            Calendar.FEBRUARY, 1);
    long subscriptionActivationTime = subscriptionCreationTime;

    int freePeriod = getDaysOfMonth(testYear, Calendar.FEBRUARY);
    BigDecimal expectedPrice = new BigDecimal("1711.00");
    final Long[] limitArrayForDifferentAssignmentTime = new Long[] {
            Long.valueOf(2), Long.valueOf(3), null };

    BigDecimal[] priceArray = { BD500, BD400, BD300 };
    BigDecimal[] stepAmountArray = { BD1000, BD400, BD300 };

    BigDecimal pricePerUserassigment = BigDecimal.ZERO;
    BigDecimal oneTimeFee = BigDecimal.TEN;
    testBillingWithSteppedPricesForPriceModel(freePeriod, numUser,
            expectedPrice, true, limitArrayForDifferentAssignmentTime,
            priceArray, subscriptionCreationTime,
            subscriptionActivationTime, billingTime, pricePerUserassigment,
            oneTimeFee, stepAmountArray);
    xmlValidator.validateBillingResultXML();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:36,代码来源:BillingServiceBeanSteppedPriceIT.java

示例7: PriceModel_FreePeriodEnd_After_BillingStartTime

/**
 * Billing test for price model with stepped price. The free periods ends
 * after the first day of the billing period. Parameter are modified before
 * billing period
 * 
 * @throws Exception
 */
@Test
public void PriceModel_FreePeriodEnd_After_BillingStartTime()
        throws Exception {
    int numUser = 4;
    final int testYear = 2010;
    final long billingTime = getTimeInMillisForBilling(testYear,
            Calendar.APRIL, 1);

    long subscriptionCreationTime = getTimeInMillisForBilling(testYear,
            Calendar.FEBRUARY, 1);
    long subscriptionActivationTime = subscriptionCreationTime;

    int freePeriod = getDaysOfMonth(testYear, Calendar.FEBRUARY) + 10;
    BigDecimal expectedPrice = new BigDecimal("1293.86");
    final Long[] limitArrayForDifferentAssignmentTime = new Long[] {
            Long.valueOf(2), Long.valueOf(3), null };

    BigDecimal[] priceArray = { BD500, BD400, BD300 };
    BigDecimal[] stepAmountArray = { BD1000, new BigDecimal("283.18") };

    BigDecimal pricePerUserassigment = BigDecimal.ZERO;
    BigDecimal oneTimeFee = BigDecimal.TEN;
    testBillingWithSteppedPricesForPriceModel(freePeriod, numUser,
            expectedPrice, true, limitArrayForDifferentAssignmentTime,
            priceArray, subscriptionCreationTime,
            subscriptionActivationTime, billingTime, pricePerUserassigment,
            oneTimeFee, stepAmountArray);
    xmlValidator.validateBillingResultXML();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:36,代码来源:BillingServiceBeanSteppedPriceIT.java

示例8: PriceModel_FreePeriodEnd2Month_Equal_BillingStartTime

/**
 * Billing test for price model with stepped price. The free periods ends
 * with the first day of the billing period. Parameter are modified before
 * billing period. Activation date is 2 month before
 * 
 * @throws Exception
 */
@Test
public void PriceModel_FreePeriodEnd2Month_Equal_BillingStartTime()
        throws Exception {
    int numUser = 4;
    final int testYear = 2010;
    final long billingTime = getTimeInMillisForBilling(testYear,
            Calendar.MAY, 1);

    long subscriptionCreationTime = getTimeInMillisForBilling(testYear,
            Calendar.FEBRUARY, 1);
    long subscriptionActivationTime = subscriptionCreationTime;

    int freePeriod = getDaysOfMonth(testYear, Calendar.FEBRUARY)
            + getDaysOfMonth(testYear, Calendar.MARCH);
    BigDecimal expectedPrice = new BigDecimal("1711.00");
    final Long[] limitArrayForDifferentAssignmentTime = new Long[] {
            Long.valueOf(2), Long.valueOf(3), null };

    BigDecimal[] priceArray = { BD500, BD400, BD300 };
    BigDecimal[] stepAmountArray = { BD1000, BD400, BD300 };

    BigDecimal pricePerUserassigment = BigDecimal.TEN;
    BigDecimal oneTimeFee = BigDecimal.TEN;
    testBillingWithSteppedPricesForPriceModel(freePeriod, numUser,
            expectedPrice, true, limitArrayForDifferentAssignmentTime,
            priceArray, subscriptionCreationTime,
            subscriptionActivationTime, billingTime, pricePerUserassigment,
            oneTimeFee, stepAmountArray);
    xmlValidator.validateBillingResultXML();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:37,代码来源:BillingServiceBeanSteppedPriceIT.java

示例9: PriceModel_FreePeriodEnd_Equal_BillingStartTime_Bug8149

/**
 * Billing test for price model with stepped price. The free periods ends
 * with the first day of the billing period. Parameter are modified before
 * billing period
 * 
 * @throws Exception
 */
@Test
public void PriceModel_FreePeriodEnd_Equal_BillingStartTime_Bug8149()
        throws Exception {
    int numUser = 1;
    final int testYear = 2010;
    final long billingTime = getTimeInMillisForBilling(testYear,
            Calendar.APRIL, 1);

    long subscriptionCreationTime = getTimeInMillisForBilling(testYear,
            Calendar.FEBRUARY, 1);
    long subscriptionActivationTime = subscriptionCreationTime;

    int freePeriod = getDaysOfMonth(testYear, Calendar.FEBRUARY);
    BigDecimal expectedPrice = new BigDecimal("11.00");
    final Long[] limitArrayForDifferentAssignmentTime = new Long[] {
            Long.valueOf(2), Long.valueOf(3), null };

    BigDecimal[] priceArray = { BigDecimal.ZERO, BigDecimal.ZERO,
            BigDecimal.ZERO };
    BigDecimal[] stepAmountArray = { BigDecimal.ZERO, BigDecimal.ZERO,
            BigDecimal.ZERO };

    BigDecimal pricePerUserassigment = BigDecimal.ZERO;
    BigDecimal oneTimeFee = BigDecimal.TEN;
    testBillingWithSteppedPricesForPriceModel(freePeriod, numUser,
            expectedPrice, true, limitArrayForDifferentAssignmentTime,
            priceArray, subscriptionCreationTime,
            subscriptionActivationTime, billingTime, pricePerUserassigment,
            oneTimeFee, stepAmountArray);
    xmlValidator.validateBillingResultXML();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:38,代码来源:BillingServiceBeanSteppedPriceIT.java

示例10: bigDecimalSet

@Test
public void bigDecimalSet() {
    Set<?> from = new FluentHashSet<BigDecimal>(BigDecimal.ZERO, BigDecimal.TEN);
    Set<?> to = (Set<?>) new ItemValueConformer().transform(from);
    assertTrue(to.size() == 2);
    assertTrue(to.contains(BigDecimal.ZERO));
    assertTrue(to.contains(BigDecimal.TEN));
}
 
开发者ID:aws,项目名称:aws-sdk-java-v2,代码行数:8,代码来源:ItemValueConformerTest.java


注:本文中的java.math.BigDecimal.TEN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。