Tabnine Logo
RandomUtil.randomLong
Code IndexAdd Tabnine to your IDE (free)

How to use
randomLong
method
in
org.apache.activemq.artemis.utils.RandomUtil

Best Java code snippets using org.apache.activemq.artemis.utils.RandomUtil.randomLong (Showing top 20 results out of 315)

origin: wildfly/wildfly

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: apache/activemq-artemis

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: apache/activemq-artemis

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: org.apache.activemq/artemis-commons

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: org.apache.activemq/artemis-jms-client-all

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: apache/activemq-artemis

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: org.jboss.eap/wildfly-client-all

public static long randomPositiveLong() {
 return Math.abs(RandomUtil.randomLong());
}
origin: apache/activemq-artemis

@Test
public void testWriteObjectWithLong() throws Exception {
 doWriteObjectWithType(RandomUtil.randomLong(), new TypeReader() {
   @Override
   public Object readType(final ActiveMQStreamMessage message) throws Exception {
    return message.readLong();
   }
 });
}
origin: apache/activemq-artemis

@Test
public void testSetObjectFromLong() throws Exception {
 doTestSetObject(RandomUtil.randomLong());
}
origin: apache/activemq-artemis

@Test
public void testGetLongFromString() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setString(itemName, Long.toString(value));
 Assert.assertEquals(value, message.getLong(itemName));
}
origin: apache/activemq-artemis

@Test
public void testGetStringFromLong() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setLong(itemName, value);
 Assert.assertEquals(Long.toString(value), message.getString(itemName));
}
origin: apache/activemq-artemis

@Test
public void testLong() throws Exception {
 long l = RandomUtil.randomLong();
 wrapper.writeLong(l);
 Assert.assertEquals(l, wrapper.readLong());
}
origin: apache/activemq-artemis

@Test
public void testReadLongFromString() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeString(Long.toString(value));
 message.reset();
 Assert.assertEquals(value, message.readLong());
}
origin: apache/activemq-artemis

@Test
public void testReadStringFromLong() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeLong(value);
 message.reset();
 Assert.assertEquals(Long.toString(value), message.readString());
}
origin: apache/activemq-artemis

@Test
public void testGetLongFromLong() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setLong(itemName, value);
 Assert.assertEquals(value, message.getLong(itemName));
}
origin: apache/activemq-artemis

@Test
public void testReadObjectFromLong() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeLong(value);
 message.reset();
 Assert.assertEquals(value, message.readObject());
}
origin: apache/activemq-artemis

@Test
public void testReadLongFromLong() throws Exception {
 long value = RandomUtil.randomLong();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeLong(value);
 message.reset();
 Assert.assertEquals(value, message.readLong());
}
origin: apache/activemq-artemis

  @Test
  public void testAddRemoveConsumer() throws Exception {

   final long id = RandomUtil.randomLong();
   final SimpleString address = RandomUtil.randomSimpleString();
   final SimpleString uniqueName = RandomUtil.randomSimpleString();
   final SimpleString routingName = RandomUtil.randomSimpleString();
   final Long remoteQueueID = RandomUtil.randomLong();
   final SimpleString filterString = new SimpleString("A>B");
   final Queue storeAndForwardQueue = new FakeQueue(null);
   final SimpleString bridgeName = RandomUtil.randomSimpleString();
   final int distance = 0;
   RemoteQueueBindingImpl binding = new RemoteQueueBindingImpl(id, address, uniqueName, routingName, remoteQueueID, filterString, storeAndForwardQueue, bridgeName, distance, MessageLoadBalancingType.ON_DEMAND);

   for (int i = 0; i < 100; i++) {
     binding.addConsumer(new SimpleString("B" + i + "<A"));
   }

   assertEquals(100, binding.getFilters().size());

   for (int i = 0; i < 100; i++) {
     binding.removeConsumer(new SimpleString("B" + i + "<A"));
   }

   assertEquals(0, binding.getFilters().size());

  }
}
origin: apache/activemq-artemis

@Test
public void testAddAndRemoveMessages() {
 long id1 = RandomUtil.randomLong();
 long id2 = RandomUtil.randomLong();
 PageTransactionInfo trans = new PageTransactionInfoImpl(id2);
 trans.setRecordID(id1);
 // anything between 2 and 100
 int nr1 = RandomUtil.randomPositiveInt() % 98 + 2;
 for (int i = 0; i < nr1; i++) {
   trans.increment(1, 0);
 }
 Assert.assertEquals(nr1, trans.getNumberOfMessages());
 ActiveMQBuffer buffer = ActiveMQBuffers.fixedBuffer(trans.getEncodeSize());
 trans.encode(buffer);
 PageTransactionInfo trans2 = new PageTransactionInfoImpl(id1);
 trans2.decode(buffer);
 Assert.assertEquals(id2, trans2.getTransactionID());
 Assert.assertEquals(nr1, trans2.getNumberOfMessages());
}
origin: apache/activemq-artemis

@Test
public void testTypedProperties() throws Exception {
 SimpleString longKey = RandomUtil.randomSimpleString();
 long longValue = RandomUtil.randomLong();
 SimpleString simpleStringKey = RandomUtil.randomSimpleString();
 SimpleString simpleStringValue = RandomUtil.randomSimpleString();
 TypedProperties otherProps = new TypedProperties();
 otherProps.putLongProperty(longKey, longValue);
 otherProps.putSimpleStringProperty(simpleStringKey, simpleStringValue);
 props.putTypedProperties(otherProps);
 long ll = props.getLongProperty(longKey);
 Assert.assertEquals(longValue, ll);
 SimpleString ss = props.getSimpleStringProperty(simpleStringKey);
 Assert.assertEquals(simpleStringValue, ss);
}
org.apache.activemq.artemis.utilsRandomUtilrandomLong

Popular methods of RandomUtil

  • randomInt
  • randomString
  • randomByte
  • randomBytes
  • randomPositiveInt
  • randomInterval
  • randomBoolean
  • randomDouble
  • randomSimpleString
  • randomChar
  • randomPositiveLong
  • randomFloat
  • randomPositiveLong,
  • randomFloat,
  • randomShort,
  • getRandom,
  • randomBuffer

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JComboBox (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now