Example usage for java.lang Long MAX_VALUE

List of usage examples for java.lang Long MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Long MAX_VALUE.

Prototype

long MAX_VALUE

To view the source code for java.lang Long MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a long can have, 263-1.

Usage

From source file:com.thoughtworks.xstream.io.json.JsonWriterModeTest.java

public JsonWriterModeTest(String name, int xstreamMode, int writerMode, JsonWriter.Format format) {
    super(name);/*from   ww  w  .j a v a2  s. c  o  m*/
    this.mode = writerMode;
    this.format = format;

    X x = new X(42);
    x.aStr = "Codehaus";
    x.innerObj = new Y();
    x.innerObj.yField = "Y";

    target = new ArrayList(Arrays.asList(new Object[] { new Object[][] { new Object[0] }, null, new Integer(42),
            new Long(Long.MAX_VALUE), new Y(), x.innerObj, new ArrayList(),
            new CharSequence[] { "JUnit", "XStream", new StringBuffer("JSON"), new StringBuffer("JScript") },
            x, }));

    xstream = new XStream();
    xstream.setMode(xstreamMode);
    xstream.alias("X", X.class);
    xstream.alias("Y", Y.class);
    xstream.alias("CharSequence", CharSequence.class);
}

From source file:dk.netarkivet.harvester.harvesting.metadata.MetadataFileWriterArc.java

/**
 * Create a <code>MetadataFileWriter</code> for ARC output.
 *
 * @param metadataARCFile The metadata ARC <code>File</code>
 * @return <code>MetadataFileWriter</code> for writing metadata files in ARC
 *//*from  ww  w.j  a  va  2 s  . co m*/
public static MetadataFileWriter createWriter(File metadataARCFile) {
    MetadataFileWriterArc mtfw = new MetadataFileWriterArc();
    ArcFileNaming naming = new ArcFileNamingSingleFile(metadataARCFile);
    ArcFileWriterConfig config = new ArcFileWriterConfig(metadataARCFile.getParentFile(), false, Long.MAX_VALUE,
            true);
    mtfw.writer = ArcFileWriter.getArcWriterInstance(naming, config);
    mtfw.open();
    return mtfw;
}

From source file:com.mobius.software.mqtt.performance.controller.Worker.java

@Override
public void run() {
    while (running) {
        TimedTask timer = null;// ww w. j a  v a2s .c  om
        try {
            timer = queue.take();
            if (timer != null && timer.getRealTimestamp() != Long.MAX_VALUE && timer.execute())
                scheduler.store(timer.getRealTimestamp(), timer);
        } catch (Exception ex) {
            logger.error("An error occured in worker thread while processing task:" + ex.getMessage());
        }
    }
}

From source file:com.joyent.manta.client.crypto.AesCbcCipherDetails.java

@Override
public long ciphertextSize(final long plaintextSize) {
    Validate.inclusiveBetween(0L, Long.MAX_VALUE, plaintextSize);
    int blockBytes = getBlockSizeInBytes();
    int tagOrHmacBytes = getAuthenticationTagOrHmacLengthInBytes();
    byte[] iv = this.getCipher().getIV();
    boolean hasIV = (iv != null && iv.length > 0);

    return calculateContentLength(plaintextSize, blockBytes, tagOrHmacBytes, hasIV);
}

From source file:edu.umass.cs.reconfiguration.reconfigurationpackets.DemandReport.java

/**
 * @param initiator//  ww w  . ja  va2s.co  m
 * @param name
 * @param epochNumber
 * @param stats
 */
public DemandReport(NodeIDType initiator, String name, int epochNumber, JSONObject stats) {
    super(initiator, ReconfigurationPacket.PacketType.DEMAND_REPORT, name, epochNumber);
    this.stats = stats;
    this.requestID = (long) (Math.random() * Long.MAX_VALUE);
}

From source file:com.joyent.manta.client.crypto.AesCtrCipherDetails.java

@Override
public long ciphertextSize(final long plaintextSize) {
    Validate.inclusiveBetween(0L, Long.MAX_VALUE, plaintextSize);
    return plaintextSize + getAuthenticationTagOrHmacLengthInBytes();
}

From source file:com.devicehive.rpcclient.RpcClientActionTest.java

@Test
public void testNotificationSearchAction() throws Exception {
    NotificationSearchRequest searchRequest = new NotificationSearchRequest();
    searchRequest.setId(Long.MAX_VALUE); // nonexistent id
    searchRequest.setGuid(UUID.randomUUID().toString()); // random guid

    Request request = Request.newBuilder().withPartitionKey(searchRequest.getGuid()).withBody(searchRequest)
            .build();// w  w w .j  ava 2 s. co m
    CompletableFuture<Response> future = new CompletableFuture<>();
    client.call(request, future::complete);

    Response response = future.get(10, TimeUnit.SECONDS);
    NotificationSearchResponse responseBody = (NotificationSearchResponse) response.getBody();
    assertTrue(responseBody.getNotifications().isEmpty());
}

From source file:de.dal33t.powerfolder.test.transfer.BandwidthLimitText.java

public void testUnlimited() {
    BandwidthLimiter bl = BandwidthLimiter.LAN_INPUT_BANDWIDTH_LIMITER;
    try {/*from  www.  j a v a  2  s .com*/
        assertEquals(bl.requestBandwidth(Long.MAX_VALUE), Long.MAX_VALUE);
    } catch (InterruptedException e) {
        fail(e.toString());
    }
    provider.setLimitBPS(bl, 0);
    long amount = 70000000;
    while (amount > 0) {
        long rem = 0;
        try {
            rem = bl.requestBandwidth(amount);
        } catch (InterruptedException e) {
            fail(e.toString());
        }
        amount -= rem;
        assertTrue("Short on amount", rem > 0);
    }
    assertTrue("Exceeded amount", amount == 0);
}

From source file:cn.edu.zjnu.acm.judge.service.LoginlogServiceTest.java

@After
public void tearDown() throws InterruptedException {
    executorService.shutdown();//from www.  j ava 2s  . c om
    executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
    loginlogService.destory();
    loginlogService.getExecutor().awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
}

From source file:com.smartitengineering.event.hub.spi.hbase.persistents.ChannelAdapterHelper.java

@Override
protected void mergeFromF2T(Channel fromBean, PersistentChannel toBean) {
    if (fromBean.getPosition() > 0) {
        toBean.setId(Long.MAX_VALUE - fromBean.getPosition());
    }//from www. ja  v a2  s  .c  o m
    toBean.setDescription(fromBean.getDescription());
    toBean.setAuthToken(fromBean.getAuthToken());
    toBean.setAutoExpiryDateTime(fromBean.getAutoExpiryDateTime());
    if (StringUtils.isNotBlank(fromBean.getName())) {
        toBean.setName(fromBean.getName().toLowerCase());
    }
    if (fromBean.getFilter() != null) {
        toBean.setFilterType(fromBean.getFilter().getMimeType().name());
        toBean.setScript(fromBean.getFilter().getFilterScript());
    }
}