當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。