congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RandomUtil.randomChar
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/activemq-artemis

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

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

chrs[i] = RandomUtil.randomChar();
origin: apache/activemq-artemis

@Test
public void testGetStringFromChar() throws Exception {
 char value = RandomUtil.randomChar();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setChar(itemName, value);
 Assert.assertEquals(Character.toString(value), message.getString(itemName));
}
origin: apache/activemq-artemis

@Test
public void testReadStringFromChar() throws Exception {
 char value = RandomUtil.randomChar();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeChar(value);
 message.reset();
 Assert.assertEquals(Character.toString(value), message.readString());
}
origin: apache/activemq-artemis

@Test
public void testGetBytesFromInvalidType() throws Exception {
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setChar(itemName, RandomUtil.randomChar());
 try {
   message.getBytes(itemName);
   Assert.fail("MessageFormatException");
 } catch (MessageFormatException e) {
 }
}
origin: apache/activemq-artemis

@Test
public void testGetCharFromChar() throws Exception {
 char value = RandomUtil.randomChar();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setChar(itemName, value);
 Assert.assertEquals(value, message.getChar(itemName));
}
origin: apache/activemq-artemis

@Test
public void testGetFloatFromInvalidType() throws Exception {
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setChar(itemName, RandomUtil.randomChar());
 try {
   message.getFloat(itemName);
   Assert.fail("MessageFormatException");
 } catch (MessageFormatException e) {
 }
}
origin: apache/activemq-artemis

@Test
public void testGetDoubleFromInvalidType() throws Exception {
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setChar(itemName, RandomUtil.randomChar());
 try {
   message.getDouble(itemName);
   Assert.fail("MessageFormatException");
 } catch (MessageFormatException e) {
 }
}
origin: apache/activemq-artemis

@Test
public void testReadObjectFromChar() throws Exception {
 char value = RandomUtil.randomChar();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeChar(value);
 message.reset();
 Assert.assertEquals(value, message.readObject());
}
origin: apache/activemq-artemis

@Test
public void testReadCharFromChar() throws Exception {
 char value = RandomUtil.randomChar();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeChar(value);
 message.reset();
 Assert.assertEquals(value, message.readChar());
}
origin: apache/activemq-artemis

@Test
public void testCharProperty() throws Exception {
 Character val = RandomUtil.randomChar();
 props.putCharProperty(key, val);
 Assert.assertEquals(val, props.getCharProperty(key));
 Assert.assertEquals(new SimpleString(Character.toString(val)), props.getSimpleStringProperty(key));
 try {
   props.putByteProperty(key, RandomUtil.randomByte());
   props.getCharProperty(key);
   Assert.fail();
 } catch (ActiveMQPropertyConversionException e) {
 }
 try {
   props.getCharProperty(unknownKey);
   Assert.fail();
 } catch (NullPointerException e) {
 }
}
origin: apache/activemq-artemis

@Test
public void testEncodeDecode() throws Exception {
 props.putByteProperty(RandomUtil.randomSimpleString(), RandomUtil.randomByte());
 props.putBytesProperty(RandomUtil.randomSimpleString(), RandomUtil.randomBytes());
 props.putBytesProperty(RandomUtil.randomSimpleString(), null);
 props.putBooleanProperty(RandomUtil.randomSimpleString(), RandomUtil.randomBoolean());
 props.putShortProperty(RandomUtil.randomSimpleString(), RandomUtil.randomShort());
 props.putIntProperty(RandomUtil.randomSimpleString(), RandomUtil.randomInt());
 props.putLongProperty(RandomUtil.randomSimpleString(), RandomUtil.randomLong());
 props.putFloatProperty(RandomUtil.randomSimpleString(), RandomUtil.randomFloat());
 props.putDoubleProperty(RandomUtil.randomSimpleString(), RandomUtil.randomDouble());
 props.putCharProperty(RandomUtil.randomSimpleString(), RandomUtil.randomChar());
 props.putSimpleStringProperty(RandomUtil.randomSimpleString(), RandomUtil.randomSimpleString());
 props.putSimpleStringProperty(RandomUtil.randomSimpleString(), null);
 SimpleString keyToRemove = RandomUtil.randomSimpleString();
 props.putSimpleStringProperty(keyToRemove, RandomUtil.randomSimpleString());
 ActiveMQBuffer buffer = ActiveMQBuffers.dynamicBuffer(1024);
 props.encode(buffer.byteBuf());
 Assert.assertEquals(props.getEncodeSize(), buffer.writerIndex());
 TypedProperties decodedProps = new TypedProperties();
 decodedProps.decode(buffer.byteBuf());
 TypedPropertiesTest.assertEqualsTypeProperties(props, decodedProps);
 buffer.clear();
 // After removing a property, you should still be able to encode the Property
 props.removeProperty(keyToRemove);
 props.encode(buffer.byteBuf());
 Assert.assertEquals(props.getEncodeSize(), buffer.writerIndex());
}
org.apache.activemq.artemis.utilsRandomUtilrandomChar

Popular methods of RandomUtil

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • JCheckBox (javax.swing)
  • JTable (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Option (scala)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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