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

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

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

origin: wildfly/wildfly

public static byte[] randomBytes() {
 return RandomUtil.randomString().getBytes();
}
origin: wildfly/wildfly

public static char randomChar() {
 return RandomUtil.randomString().charAt(0);
}
origin: wildfly/wildfly

public static SimpleString randomSimpleString() {
 return new SimpleString(RandomUtil.randomString());
}
origin: apache/activemq-artemis

protected ClientSession createTransactionalSession(final ClientSessionFactory sf) throws Exception {
 ClientSession session = sf.createSession(false, false, false);
 session.addMetaData("someData", RandomUtil.randomString());
 session.addMetaData("someData2", RandomUtil.randomString());
 return session;
}
origin: apache/activemq-artemis

private static void failure(final Validators.Validator validator, final Object value) {
 try {
   validator.validate(RandomUtil.randomString(), value);
   Assert.fail(validator + " must not validate " + value);
 } catch (IllegalArgumentException e) {
 }
}
origin: apache/activemq-artemis

@Test
public void testFromAddressWithInvalidPrefix() throws Exception {
 String invalidPrefix = "junk";
 String destinationName = RandomUtil.randomString();
 String address = invalidPrefix + destinationName;
 ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address);
 Assert.assertTrue(destination instanceof Destination);
}
origin: apache/activemq-artemis

protected void doTestL(final ClientSessionFactory sf) throws Exception {
 final int numSessions = 100;
 for (int i = 0; i < numSessions; i++) {
   ClientSession session = sf.createSession(false, false, false);
   session.addMetaData("data", RandomUtil.randomString());
   session.close();
 }
}
origin: apache/activemq-artemis

@Test
public void testNOT_NULL_OR_EMPTY() throws Exception {
 ValidatorsTest.failure(Validators.NOT_NULL_OR_EMPTY, null);
 ValidatorsTest.failure(Validators.NOT_NULL_OR_EMPTY, "");
 ValidatorsTest.success(Validators.NOT_NULL_OR_EMPTY, RandomUtil.randomString());
}
origin: apache/activemq-artemis

@Test
public void testUTF() throws Exception {
 String str = RandomUtil.randomString();
 wrapper.writeUTF(str);
 Assert.assertEquals(str, wrapper.readUTF());
}
origin: apache/activemq-artemis

@Test
public void testFromAddressWithQueueAddressPrefix() throws Exception {
 String destinationName = RandomUtil.randomString();
 String address = QUEUE_QUALIFIED_PREFIX + destinationName;
 ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address);
 Assert.assertTrue(destination instanceof Queue);
 Assert.assertEquals(destinationName, ((Queue) destination).getQueueName());
}
origin: apache/activemq-artemis

@Test
public void testFromAddressWithTopicAddressPrefix() throws Exception {
 String destinationName = RandomUtil.randomString();
 String address = TOPIC_QUALIFIED_PREFIX + destinationName;
 ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address);
 Assert.assertTrue(destination instanceof Topic);
 Assert.assertEquals(destinationName, ((Topic) destination).getTopicName());
}
origin: apache/activemq-artemis

@Test
public void testGetStringFromString() throws Exception {
 String value = RandomUtil.randomString();
 ActiveMQMapMessage message = new ActiveMQMapMessage();
 message.setString(itemName, value);
 Assert.assertEquals(value, message.getString(itemName));
}
origin: apache/activemq-artemis

@Test
public void testReadObjectFromString() throws Exception {
 String value = RandomUtil.randomString();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeString(value);
 message.reset();
 Assert.assertEquals(value, message.readObject());
}
origin: apache/activemq-artemis

@Test
public void testEquals() throws Exception {
 String destinationName = RandomUtil.randomString();
 String address = QUEUE_QUALIFIED_PREFIX + destinationName;
 ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address);
 ActiveMQDestination sameDestination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address);
 ActiveMQDestination differentDestination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(address + RandomUtil.randomString());
 Assert.assertFalse(destination.equals(null));
 Assert.assertTrue(destination.equals(destination));
 Assert.assertTrue(destination.equals(sameDestination));
 Assert.assertFalse(destination.equals(differentDestination));
}
origin: apache/activemq-artemis

@Test
public void testReadStringFromString() throws Exception {
 String value = RandomUtil.randomString();
 ActiveMQStreamMessage message = new ActiveMQStreamMessage();
 message.writeString(value);
 message.reset();
 Assert.assertEquals(value, message.readString());
}
origin: apache/activemq-artemis

@Test
public void testJOURNAL_TYPE() throws Exception {
 for (JournalType type : JournalType.values()) {
   ValidatorsTest.success(Validators.JOURNAL_TYPE, type.toString());
 }
 ValidatorsTest.failure(Validators.JOURNAL_TYPE, null);
 ValidatorsTest.failure(Validators.JOURNAL_TYPE, "");
 ValidatorsTest.failure(Validators.JOURNAL_TYPE, RandomUtil.randomString());
}
origin: apache/activemq-artemis

@Test
public void testSendMessageToNonExistentTopicUsingExplicitDefaultRouting() throws Exception {
 String nonExistentTopic = RandomUtil.randomString();
 server.getAddressSettingsRepository().addMatch(nonExistentTopic, new AddressSettings().setDefaultAddressRoutingType(RoutingType.MULTICAST).setDefaultQueueRoutingType(RoutingType.MULTICAST));
 sendMessageToNonExistentTopic(getTopicPrefix(), nonExistentTopic, null);
}
origin: apache/activemq-artemis

@Test
public void testSendMessageToNonExistentQueueUsingExplicitDefaultRouting() throws Exception {
 String nonExistentQueue = RandomUtil.randomString();
 server.getAddressSettingsRepository().addMatch(nonExistentQueue, new AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST).setDefaultQueueRoutingType(RoutingType.ANYCAST));
 sendMessageToNonExistentQueue(getQueuePrefix(), nonExistentQueue, null);
}
origin: apache/activemq-artemis

@Test
public void testSizeofNullableString() throws Exception {
 Assert.assertEquals(1, SimpleString.sizeofNullableString(null));
 Assert.assertEquals(1 + DataConstants.SIZE_INT, SimpleString.sizeofNullableString(new SimpleString("")));
 SimpleString str = new SimpleString(RandomUtil.randomString());
 Assert.assertEquals(1 + DataConstants.SIZE_INT + str.getData().length, SimpleString.sizeofNullableString(str));
}
origin: apache/activemq-artemis

@Test
public void testSetDeadLetterAddress() throws Exception {
 SimpleString address = RandomUtil.randomSimpleString();
 SimpleString queue = RandomUtil.randomSimpleString();
 String deadLetterAddress = RandomUtil.randomString();
 session.createQueue(address, RoutingType.MULTICAST, queue, null, durable);
 QueueControl queueControl = createManagementControl(address, queue);
 AddressSettings addressSettings = new AddressSettings().setDeadLetterAddress(new SimpleString(deadLetterAddress));
 server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
 Assert.assertEquals(deadLetterAddress, queueControl.getDeadLetterAddress());
 session.deleteQueue(queue);
}
org.apache.activemq.artemis.utilsRandomUtilrandomString

Popular methods of RandomUtil

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

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • From CI to AI: The AI layer in your organization
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