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

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

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

origin: apache/activemq-artemis

@Test
public void testReadBytesFromInvalidType() throws Exception {
 doReadTypeFromInvalidType(RandomUtil.randomBoolean(), new TypeReader() {
   @Override
   public Object readType(final ActiveMQStreamMessage message) throws Exception {
    return message.readByte();
   }
 });
}
origin: apache/activemq-artemis

@Test
public void testReadDoubleFromInvalidType() throws Exception {
 doReadTypeFromInvalidType(RandomUtil.randomBoolean(), new TypeReader() {
   @Override
   public Object readType(final ActiveMQStreamMessage message) throws Exception {
    return message.readDouble();
   }
 });
}
origin: apache/activemq-artemis

@Test
public void testReadFloatFromInvalidType() throws Exception {
 doReadTypeFromInvalidType(RandomUtil.randomBoolean(), new TypeReader() {
   @Override
   public Object readType(final ActiveMQStreamMessage message) throws Exception {
    return message.readFloat();
   }
 });
}
origin: apache/activemq-artemis

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

  @Override
  public void run() throws ActiveMQException {
   session.createQueue(RandomUtil.randomSimpleString(), RandomUtil.randomSimpleString(), RandomUtil.randomBoolean());
  }
});
origin: apache/activemq-artemis

@Test
public void testGetStringFromBoolean() throws Exception {
 boolean value = RandomUtil.randomBoolean();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setBoolean(itemName, value);
 Assert.assertEquals(Boolean.toString(value), message.getString(itemName));
}
origin: apache/activemq-artemis

@Test
public void testReadBooleanFromString() throws Exception {
 boolean value = RandomUtil.randomBoolean();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeString(Boolean.toString(value));
 message.reset();
 Assert.assertEquals(value, message.readBoolean());
}
origin: apache/activemq-artemis

@Test
public void testReadStringFromBoolean() throws Exception {
 boolean value = RandomUtil.randomBoolean();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeBoolean(value);
 message.reset();
 Assert.assertEquals(Boolean.toString(value), message.readString());
}
origin: apache/activemq-artemis

@Test
public void testSetObjectFromBoolean() throws Exception {
 boolean value = RandomUtil.randomBoolean();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setObject(itemName, value);
 Assert.assertEquals(value, message.getObject(itemName));
}
origin: apache/activemq-artemis

@Test
public void testReadBooleanFromBoolean() throws Exception {
 boolean value = RandomUtil.randomBoolean();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeBoolean(value);
 message.reset();
 Assert.assertEquals(value, message.readBoolean());
}
origin: apache/activemq-artemis

@Test
public void testReadObjectFromBoolean() throws Exception {
 boolean value = RandomUtil.randomBoolean();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeBoolean(value);
 message.reset();
 Assert.assertEquals(value, message.readObject());
}
origin: apache/activemq-artemis

@Test
public void testClearInternalPropertiesIfAny() {
 TypedProperties properties = new TypedProperties(PROP_NAME::equals);
 properties.putBooleanProperty(PROP_NAME, RandomUtil.randomBoolean());
 Assert.assertTrue(properties.clearInternalProperties());
 Assert.assertFalse(properties.containsProperty(PROP_NAME));
}
origin: apache/activemq-artemis

@Test
public void testCannotClearInternalPropertiesTwiceIfAny() {
 TypedProperties properties = new TypedProperties(PROP_NAME::equals);
 properties.putBooleanProperty(PROP_NAME, RandomUtil.randomBoolean());
 Assert.assertTrue(properties.clearInternalProperties());
 Assert.assertFalse(properties.clearInternalProperties());
}
origin: apache/activemq-artemis

@Test
public void testBINDING_ADDED() throws Exception {
 SimpleString queue = RandomUtil.randomSimpleString();
 SimpleString address = RandomUtil.randomSimpleString();
 boolean durable = RandomUtil.randomBoolean();
 NotificationTest.flush(notifConsumer);
 session.createQueue(address, queue, durable);
 //the first message received will be for the address creation
 ClientMessage[] notifications = NotificationTest.consumeMessages(2, notifConsumer);
 Assert.assertEquals(BINDING_ADDED.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
 Assert.assertEquals(queue.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ROUTING_NAME).toString());
 Assert.assertEquals(address.toString(), notifications[1].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
 session.deleteQueue(queue);
}
origin: apache/activemq-artemis

@Test
public void testBINDING_REMOVED() throws Exception {
 SimpleString queue = RandomUtil.randomSimpleString();
 SimpleString address = RandomUtil.randomSimpleString();
 boolean durable = RandomUtil.randomBoolean();
 session.createQueue(address, queue, durable);
 NotificationTest.flush(notifConsumer);
 session.deleteQueue(queue);
 //There will be 2 notifications, first is for binding removal, second is for address removal
 ClientMessage[] notifications = NotificationTest.consumeMessages(2, notifConsumer);
 Assert.assertEquals(BINDING_REMOVED.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TYPE).toString());
 Assert.assertEquals(queue.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_ROUTING_NAME).toString());
 Assert.assertEquals(address.toString(), notifications[0].getObjectProperty(ManagementHelper.HDR_ADDRESS).toString());
}
origin: apache/activemq-artemis

@Test
public void testBINDING_ADDEDWithNonMatchingFilter() throws Exception {
 SimpleString queue = RandomUtil.randomSimpleString();
 SimpleString address = RandomUtil.randomSimpleString();
 boolean durable = RandomUtil.randomBoolean();
 System.out.println(queue);
 notifConsumer.close();
 notifConsumer = session.createConsumer(notifQueue.toString(), ManagementHelper.HDR_ROUTING_NAME + " <> '" +
   queue + "' AND " + ManagementHelper.HDR_ADDRESS + " <> '" + address + "'");
 NotificationTest.flush(notifConsumer);
 session.createQueue(address, queue, durable);
 NotificationTest.consumeMessages(0, notifConsumer);
 session.deleteQueue(queue);
}
origin: apache/activemq-artemis

@Test
public void testScheduleRandom() throws Exception {
 ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0));
 long nextMessage = 0;
 long NUMBER_OF_SEQUENCES = 100000;
 for (int i = 0; i < NUMBER_OF_SEQUENCES; i++) {
   int numberOfMessages = RandomUtil.randomInt() % 10;
   if (numberOfMessages == 0)
    numberOfMessages = 1;
   long nextScheduledTime = RandomUtil.randomPositiveLong();
   for (int j = 0; j < numberOfMessages; j++) {
    boolean tail = RandomUtil.randomBoolean();
    addMessage(handler, nextMessage++, nextScheduledTime, tail);
   }
 }
 debugList(true, handler, nextMessage);
}
origin: apache/activemq-artemis

@Test
public void testBytesProperty() throws Exception {
 byte[] val = RandomUtil.randomBytes();
 props.putBytesProperty(key, val);
 Assert.assertArrayEquals(val, props.getBytesProperty(key));
 try {
   props.putBooleanProperty(key, RandomUtil.randomBoolean());
   props.getBytesProperty(key);
   Assert.fail();
 } catch (ActiveMQPropertyConversionException e) {
 }
 Assert.assertNull(props.getBytesProperty(unknownKey));
}
origin: apache/activemq-artemis

@Test
public void testBooleanProperty() throws Exception {
 Boolean val = RandomUtil.randomBoolean();
 props.putBooleanProperty(key, val);
 Assert.assertEquals(val, props.getBooleanProperty(key));
 Assert.assertEquals(new SimpleString(Boolean.toString(val)), props.getSimpleStringProperty(key));
 props.putSimpleStringProperty(key, new SimpleString(Boolean.toString(val)));
 Assert.assertEquals(val, props.getBooleanProperty(key));
 try {
   props.putByteProperty(key, RandomUtil.randomByte());
   props.getBooleanProperty(key);
   Assert.fail();
 } catch (ActiveMQPropertyConversionException e) {
 }
 Assert.assertFalse(props.getBooleanProperty(unknownKey));
}
origin: apache/activemq-artemis

@Override
@Before
public void setUp() throws Exception {
 super.setUp();
 CoreQueueConfiguration queueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 CoreQueueConfiguration forwardQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 divertConfig = new DivertConfiguration().setName(RandomUtil.randomString()).setRoutingName(RandomUtil.randomString()).setAddress(queueConfig.getAddress()).setForwardingAddress(forwardQueueConfig.getAddress()).setExclusive(RandomUtil.randomBoolean()).
   setTransformerConfiguration(new TransformerConfiguration(AddHeadersTransformer.class.getName()));
 TransportConfiguration connectorConfig = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
 Configuration config = createDefaultInVMConfig().setJMXManagementEnabled(true).addQueueConfiguration(queueConfig).addQueueConfiguration(forwardQueueConfig).addDivertConfiguration(divertConfig).addConnectorConfiguration(connectorConfig.getName(), connectorConfig);
 server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, false));
 server.start();
}
org.apache.activemq.artemis.utilsRandomUtilrandomBoolean

Popular methods of RandomUtil

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Reference (javax.naming)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best IntelliJ plugins
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