Package java.math

Examples of java.math.BigInteger


       
        assertNotNull(copy.getResults());
        assertEquals(1, copy.getResults().length);
        assertNotNull(copy.getResults()[0]);
        assertEquals(4, copy.getResults()[0].size());
        assertEquals(new BigInteger("100"), copy.getResults()[0].get(0)); //$NON-NLS-1$
        assertEquals(new BigInteger("200"), copy.getResults()[0].get(1)); //$NON-NLS-1$
        assertEquals(new BigInteger("300"), copy.getResults()[0].get(2)); //$NON-NLS-1$
        assertEquals(new BigInteger("400"), copy.getResults()[0].get(3)); //$NON-NLS-1$
       
        assertNotNull(copy.getWarnings());
        assertEquals(2, copy.getWarnings().size());
        assertEquals(Exception.class, copy.getWarnings().get(0).getClass());
        assertEquals("warning1", ((Exception)copy.getWarnings().get(0)).getMessage()); //$NON-NLS-1$
View Full Code Here


    GroupSymbol g = new GroupSymbol("a.g1"); //$NON-NLS-1$
    From from = new From();
    from.addGroup(g);

    Select select = new Select();
    select.addSymbol(new ExpressionSymbol("expr", new Constant(new BigInteger("1000000000000000000000000")))); //$NON-NLS-1$ //$NON-NLS-2$
           
    Query query = new Query();
    query.setSelect(select);
    query.setFrom(from);
   
View Full Code Here

    public void testMostTypes() throws Exception {
        Object[][] results = new Object[][] {
            new Object[] { new Integer(0), "ABCDEFGHIJ", new Float(0), new Long(0), new Double(0), new Byte((byte)0), //$NON-NLS-1$
                LoopbackExecution.SQL_DATE_VAL, LoopbackExecution.TIME_VAL,
                LoopbackExecution.TIMESTAMP_VAL, Boolean.FALSE,
                new BigInteger("0"), new BigDecimal("0"), "ABCDEFGHIJ", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                new Short((short)0), new Character('c')
                 } 
        };
       
        helpTestQuery("SELECT intkey, StringKey, floatnum, longnum, doublenum, bytenum, " + //$NON-NLS-1$
View Full Code Here

    X509V3CertificateGenerator certificateGenerator =
      new X509V3CertificateGenerator();
   
    certificateGenerator.setSignatureAlgorithm( "MD5WithRSAEncryption" );
   
    certificateGenerator.setSerialNumber( new BigInteger( ""+SystemTime.getCurrentTime()));
         
    X509Name  issuer_dn = new X509Name(true,cert_dn);
   
    certificateGenerator.setIssuerDN(issuer_dn);
   
View Full Code Here

    throws AEVerifierException, Exception
  {
    KeyFactory key_factory = KeyFactory.getInstance("RSA");
   
    RSAPublicKeySpec   public_key_spec =
      new RSAPublicKeySpec( new BigInteger(modulus,16), new BigInteger(pub_exp,16));

    RSAPublicKey public_key   = (RSAPublicKey)key_factory.generatePublic( public_key_spec );
   
    Signature  sig = Signature.getInstance("MD5withRSA" );
View Full Code Here

    this.chararray_field = (boolean_field ? new char[] {char_field} : null);
    this.bytearray_field = (boolean_field ? new byte[] {byte_field} : null);
    this.doublearray_field = (boolean_field ? new double[] {double_field} : null);
    this.string_field = (boolean_field ? "str" + longval : null);
    biginteger_field = (boolean_field ? new BigInteger("" + longval) : null);
    bigdecimal_field = (boolean_field ? new BigDecimal(biginteger_field) : null);
  }
View Full Code Here

      Assert.assertEquals("chararray_field bad value", char_field, chararray_field[0]);
      Assert.assertEquals("bytearray_field bad value", 1, bytearray_field.length);
      Assert.assertEquals("bytearray_field bad value", byte_field, bytearray_field[0]);
      Assert.assertEquals("doubleArray_field bad value", 1, doublearray_field.length);
      Assert.assertEquals("string_field bad value", "str" + longval, string_field);
      Assert.assertEquals("biginteger_field bad value", new BigInteger("" + longval), biginteger_field);
      BigDecimal expected = new BigDecimal(biginteger_field);
      BigDecimal found = bigdecimal_field;
      Assert.assertTrue("bigdecimal_field bad value, expected " + expected
        + ", found: " + found,
        expected.compareTo(found)==0);
View Full Code Here

    this.chararray_field = (boolean_field ? new char[] {char_field} : null);
    this.bytearray_field = (boolean_field ? new byte[] {byte_field} : null);
    this.doubleArray_field = (boolean_field ? new double[] {double_field} : null);
    this.string_field = (boolean_field ? "str" + longval : null);
    biginteger_field = (boolean_field ? new BigInteger("" + longval) : null);
    bigdecimal_field = (boolean_field ? new BigDecimal(biginteger_field) : null);
  }
View Full Code Here

      Assert.assertEquals("chararray_field bad value", char_field, chararray_field[0]);
      Assert.assertEquals("bytearray_field bad value", 1, bytearray_field.length);
      Assert.assertEquals("bytearray_field bad value", byte_field, bytearray_field[0]);
      Assert.assertEquals("doubleArray_field bad value", 1, doubleArray_field.length);
      Assert.assertEquals("string_field bad value", "str" + longval, string_field);
      Assert.assertEquals("biginteger_field bad value", new BigInteger("" + longval), biginteger_field);
      BigDecimal expected = new BigDecimal(biginteger_field);
      BigDecimal found = bigdecimal_field;
      Assert.assertTrue("bigdecimal_field bad value, expected " + expected
        + ", found: " + found,
        expected.compareTo(found)==0);
View Full Code Here

        } else if (clazz == Boolean.class) {
            return (T) new Boolean(false);
        } else if (clazz == BigDecimal.class) {
            return (T) new BigDecimal(COUNTER.getAndIncrement());
        } else if (clazz == BigInteger.class) {
            return (T) new BigInteger("" + COUNTER.getAndIncrement());
        } else if (clazz == java.sql.Date.class) {
            return (T) new java.sql.Date(COUNTER.getAndIncrement());
        } else if (clazz == java.sql.Time.class) {
            return (T) new java.sql.Time(COUNTER.getAndIncrement());
        } else if (clazz == java.sql.Timestamp.class) {
View Full Code Here

TOP

Related Classes of java.math.BigInteger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.