下面列出了java.time.Period#multipliedBy ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expected=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expected=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
@Test(expectedExceptions=ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
test.multipliedBy(2);
}
/**
* Supports the multiply operator; equivalent to calling the {@link java.time.Period#multipliedBy(int)} method.
*
* @param self a Period
* @param scalar a scalar to multiply each unit by
* @return a Period
* @since 2.5.0
*/
public static Period multiply(final Period self, int scalar) {
return self.multipliedBy(scalar);
}