示例#1
0
  public static void test(String string, String delim) {
    StringTokenizer tokenizer = new StringTokenizer(string, delim);

    int i = 0;
    while (tokenizer.hasMoreTokens()) {
      String nextToken = tokenizer.nextToken();
      int length = nextToken.length();
      if (i == 0) {
        Assertions.checkEquals("Togliere".length(), length);
      } else if (i == 1) {
        Assertions.checkEquals("sta".length(), length);
      } else if (i == 2) {
        Assertions.checkEquals("roba".length(), length);
      }
      i++;
    }
  }
示例#2
0
  public static void test(int int0, int int1)
      throws SecurityException, NoSuchMethodException, IllegalArgumentException,
          IllegalAccessException, InvocationTargetException {

    TestCase88 instance0 = new TestCase88();
    Method method = TestCase88.class.getMethod("callbackMethodToIgnore", int.class, int.class);

    Object ret = method.invoke(instance0, int0, int1);
    int int2 = (Integer) ret;
    int int3 = 210;

    Assertions.checkEquals(int2, int3);
  }
示例#3
0
  /**
   * @param string0 .equals("135")
   * @param string1 .equals("20")
   * @param catchCount ==0
   */
  public static void test(String string0, String string1, int catchCount) {

    try {
      new BigInteger("Togliere sta roba");
    } catch (NumberFormatException ex) {
      catchCount++;
    }

    try {
      new BigInteger((String) null);
    } catch (NullPointerException ex) {
      catchCount++;
    }

    Assertions.checkEquals(2, catchCount);

    BigInteger bigInteger0 = new BigInteger(string0);
    BigInteger bigInteger1 = new BigInteger(string1);

    int int0 = bigInteger0.intValue();
    int int1 = bigInteger1.intValue();

    Assertions.checkEquals(135, int0);
    Assertions.checkEquals(20, int1);

    BigInteger[] bigIntegerArray0 = bigInteger0.divideAndRemainder(bigInteger1);

    BigInteger quotient = bigIntegerArray0[0];
    BigInteger remainder = bigIntegerArray0[1];

    int quotientInteger = quotient.intValue();
    int remainderInteger = remainder.intValue();

    Assertions.checkEquals(6, quotientInteger);
    Assertions.checkEquals(15, remainderInteger);

    BigInteger min = quotient.min(remainder);
    Assertions.checkEquals(min.intValue(), quotient.intValue());
  }