Example usage for java.math BigInteger TEN

List of usage examples for java.math BigInteger TEN

Introduction

In this page you can find the example usage for java.math BigInteger TEN.

Prototype

BigInteger TEN

To view the source code for java.math BigInteger TEN.

Click Source Link

Document

The BigInteger constant ten.

Usage

From source file:io.instacount.client.InstacountClientTest.java

@Test
public void testDecrement_Async() throws InstacountClientException {
    final String counterName = UUID.randomUUID().toString();
    final DecrementShardedCounterResponse response = client.decrementShardedCounter(counterName,
            new DecrementShardedCounterInput(BigInteger.TEN, ASYNC));

    assertThat(response.getHttpResponseCode(), is(202));
    assertThat(response.getOptCounterOperation().isPresent(), is(false));

    // Get the counter and assert its value!
    assertThat(client.getShardedCounter(counterName).getHttpResponseCode(), anyOf(is(200), is(404)));
}

From source file:com.magnet.android.mms.controller.RequestPrimitiveTest.java

@SmallTest
public void testSingleListBigIntegerPostParam() throws JSONException {
    ControllerHandler handler = new ControllerHandler();
    String methodName = "postBigDecimals";
    JMethod method = new JMethod();
    JMeta metaInfo = new JMeta(methodName, API_METHOD_POST + methodName, POST);
    method.setMetaInfo(metaInfo);// w  w w . jav  a2  s .  c o m

    // int
    method.addParam("param0", PLAIN, List.class, BigInteger.class, "", false);

    List<BigInteger> values = new ArrayList<BigInteger>();
    values.add(BigInteger.TEN);
    values.add(BigInteger.probablePrime(5, new Random()));

    String uriString = handler.buildUri(method, new Object[] { values });
    String bodyString = handler.buildRequestBodyString(method, new Object[] { values });

    String expected = API_METHOD_POST + methodName;
    logger.log(Level.INFO, "uriString=" + uriString);
    logger.log(Level.INFO, "bodyString=" + bodyString);
    assertEquals(expected, uriString);

    JSONArray jarray = new JSONArray(bodyString);
    int idx = 0;
    for (BigInteger value : values) {
        assertEquals(jarray.getString(idx), value.toString());
        idx++;
    }
}

From source file:org.codice.ddf.spatial.ogc.csw.catalog.common.source.AbstractCswSource.java

private GetRecordsType createSubscriptionGetRecordsRequest() {
    GetRecordsType getRecordsType = new GetRecordsType();
    getRecordsType.setVersion(cswVersion);
    getRecordsType.setService(CswConstants.CSW);
    getRecordsType.setResultType(ResultType.RESULTS);
    getRecordsType.setStartPosition(BigInteger.ONE);
    getRecordsType.setMaxRecords(BigInteger.TEN);
    getRecordsType.setOutputFormat(MediaType.APPLICATION_XML);
    getRecordsType.setOutputSchema("urn:catalog:metacard");
    getRecordsType.getResponseHandler().add(SystemBaseUrl.constructUrl("csw/subscription/event", true));
    QueryType queryType = new QueryType();
    queryType.setElementSetName(createElementSetName(ElementSetType.FULL));
    ObjectFactory objectFactory = new ObjectFactory();
    getRecordsType.setAbstractQuery(objectFactory.createQuery(queryType));
    return getRecordsType;
}

From source file:org.alfresco.opencmis.CMISTest.java

/**
 * ACE-33//from  w w w . ja  v  a 2  s  . co  m
 * 
 * Cmis Item support
 */
@Test
public void testItems() {

    withCmisService(new CmisServiceCallback<String>() {
        @Override
        public String execute(CmisService cmisService) {
            List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null);
            assertTrue(repositories.size() > 0);
            RepositoryInfo repo = repositories.get(0);
            String repositoryId = repo.getId();

            TypeDefinition def = cmisService.getTypeDefinition(repositoryId, "cmis:item", null);
            assertNotNull("the cmis:item type is not defined", def);

            @SuppressWarnings("unused")
            TypeDefinition p = cmisService.getTypeDefinition(repositoryId, "I:cm:person", null);
            assertNotNull("the I:cm:person type is not defined", def);

            ObjectList result = cmisService.query(repositoryId, "select * from cm:person", Boolean.FALSE,
                    Boolean.TRUE, IncludeRelationships.NONE, "", BigInteger.TEN, BigInteger.ZERO, null);
            assertTrue("", result.getNumItems().intValue() > 0);
            return "";

        };
    }, CmisVersion.CMIS_1_1);

}