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

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

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

origin: apache/activemq-artemis

private void populate(StringBuilder sb,
           BeanUtilsBean bean,
           ActiveMQConnectionFactory factory) throws IllegalAccessException, InvocationTargetException {
 PropertyDescriptor[] descriptors = bean.getPropertyUtils().getPropertyDescriptors(factory);
 for (PropertyDescriptor descriptor : descriptors) {
   if (descriptor.getWriteMethod() != null && descriptor.getReadMethod() != null) {
    if (descriptor.getPropertyType() == String.class) {
      String value = RandomUtil.randomString();
      bean.setProperty(factory, descriptor.getName(), value);
      sb.append("&").append(descriptor.getName()).append("=").append(value);
    } else if (descriptor.getPropertyType() == int.class) {
      int value = RandomUtil.randomPositiveInt();
      bean.setProperty(factory, descriptor.getName(), value);
      sb.append("&").append(descriptor.getName()).append("=").append(value);
    } else if (descriptor.getPropertyType() == long.class) {
      long value = RandomUtil.randomPositiveLong();
      bean.setProperty(factory, descriptor.getName(), value);
      sb.append("&").append(descriptor.getName()).append("=").append(value);
    } else if (descriptor.getPropertyType() == double.class) {
      double value = RandomUtil.randomDouble();
      bean.setProperty(factory, descriptor.getName(), value);
      sb.append("&").append(descriptor.getName()).append("=").append(value);
    }
   }
 }
}
origin: apache/activemq-artemis

liveParams2.put(TransportConstants.PORT_PROP_NAME, 6665);
ConnectionFactoryConfiguration config = new ConnectionFactoryConfigurationImpl().setName("some-name").setConnectorNames(connectorConfigs).setBindings(str).setCallTimeout(RandomUtil.randomPositiveLong());
List<Pair<String, String>> connectors = new ArrayList<>();
connectors.add(new Pair<String, String>(RandomUtil.randomString(), null));
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

@Override
@Before
public void setUp() throws Exception {
 super.setUp();
 Map<String, Object> acceptorParams = new HashMap<>();
 acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
 TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString());
 TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString());
 CoreQueueConfiguration sourceQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 CoreQueueConfiguration targetQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 List<String> connectors = new ArrayList<>();
 connectors.add(connectorConfig.getName());
 bridgeConfig = new BridgeConfiguration().setName(RandomUtil.randomString()).setQueueName(sourceQueueConfig.getName()).setForwardingAddress(targetQueueConfig.getAddress()).setRetryInterval(RandomUtil.randomPositiveLong()).setRetryIntervalMultiplier(RandomUtil.randomDouble()).setInitialConnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttemptsOnSameNode(RandomUtil.randomPositiveInt()).setUseDuplicateDetection(RandomUtil.randomBoolean()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setStaticConnectors(connectors);
 Configuration conf_1 = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addQueueConfiguration(targetQueueConfig);
 Configuration conf_0 = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY)).addConnectorConfiguration(connectorConfig.getName(), connectorConfig).addQueueConfiguration(sourceQueueConfig).addBridgeConfiguration(bridgeConfig);
 server_1 = addServer(ActiveMQServers.newActiveMQServer(conf_1, MBeanServerFactory.createMBeanServer(), false));
 server_1.start();
 server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
 server_0.start();
}
origin: apache/activemq-artemis

@Override
@Before
public void setUp() throws Exception {
 super.setUp();
 Map<String, Object> acceptorParams = new HashMap<>();
 acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
 TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString());
 TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString());
 CoreQueueConfiguration sourceQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 CoreQueueConfiguration targetQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 List<String> connectors = new ArrayList<>();
 connectors.add(connectorConfig.getName());
 Configuration conf_1 = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addQueueConfiguration(targetQueueConfig);
 bridgeConfig = new BridgeConfiguration().setName(RandomUtil.randomString()).setQueueName(sourceQueueConfig.getName()).setForwardingAddress(targetQueueConfig.getAddress()).setRetryInterval(RandomUtil.randomPositiveLong()).setRetryIntervalMultiplier(RandomUtil.randomDouble()).setInitialConnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttempts(RandomUtil.randomPositiveInt()).setReconnectAttemptsOnSameNode(RandomUtil.randomPositiveInt()).setUseDuplicateDetection(RandomUtil.randomBoolean()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setStaticConnectors(connectors).setPassword(CLUSTER_PASSWORD);
 Configuration conf_0 = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addConnectorConfiguration(connectorConfig.getName(), connectorConfig).addQueueConfiguration(sourceQueueConfig).addBridgeConfiguration(bridgeConfig);
 server_1 = addServer(ActiveMQServers.newActiveMQServer(conf_1, MBeanServerFactory.createMBeanServer(), false));
 addServer(server_1);
 server_1.start();
 server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
 addServer(server_0);
 server_0.start();
}
origin: apache/activemq-artemis

@Override
@Before
public void setUp() throws Exception {
 super.setUp();
 Map<String, Object> acceptorParams = new HashMap<>();
 acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
 TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString());
 TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString());
 CoreQueueConfiguration queueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 List<String> connectors = new ArrayList<>();
 connectors.add(connectorConfig.getName());
 String discoveryGroupName = RandomUtil.randomString();
 DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration().setName(discoveryGroupName).setRefreshTimeout(500).setDiscoveryInitialWaitTimeout(0).setBroadcastEndpointFactory(new UDPBroadcastEndpointFactory().setGroupAddress(getUDPDiscoveryAddress()).setGroupPort(getUDPDiscoveryPort()));
 Configuration conf_1 = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addQueueConfiguration(queueConfig);
 clusterConnectionConfig1 = new ClusterConnectionConfiguration().setName(RandomUtil.randomString()).setAddress(queueConfig.getAddress()).setConnectorName(connectorConfig.getName()).setRetryInterval(RandomUtil.randomPositiveLong()).setDuplicateDetection(RandomUtil.randomBoolean()).setMessageLoadBalancingType(MessageLoadBalancingType.STRICT).setMaxHops(RandomUtil.randomPositiveInt()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(connectors);
 clusterConnectionConfig2 = new ClusterConnectionConfiguration().setName(RandomUtil.randomString()).setAddress(queueConfig.getAddress()).setConnectorName(connectorConfig.getName()).setRetryInterval(RandomUtil.randomPositiveLong()).setDuplicateDetection(RandomUtil.randomBoolean()).setMessageLoadBalancingType(MessageLoadBalancingType.OFF).setMaxHops(RandomUtil.randomPositiveInt()).setConfirmationWindowSize(RandomUtil.randomPositiveInt()).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setDiscoveryGroupName(discoveryGroupName);
 Configuration conf_0 = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addConnectorConfiguration(connectorConfig.getName(), connectorConfig).addClusterConfiguration(clusterConnectionConfig1).addClusterConfiguration(clusterConnectionConfig2).addDiscoveryGroupConfiguration(discoveryGroupName, discoveryGroupConfig);
 mbeanServer_1 = MBeanServerFactory.createMBeanServer();
 server_1 = addServer(ActiveMQServers.newActiveMQServer(conf_1, mbeanServer_1, false));
 server_1.start();
 server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
 server_0.start();
}
origin: apache/activemq-artemis

@Test
public void testGettersAndSetters() throws Exception {
 long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
 long connectionTTL = RandomUtil.randomPositiveLong();
 long callTimeout = RandomUtil.randomPositiveLong();
 int minLargeMessageSize = RandomUtil.randomPositiveInt();
 int consumerWindowSize = RandomUtil.randomPositiveInt();
 int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt();
 int threadPoolMaxSize = RandomUtil.randomPositiveInt();
 long retryInterval = RandomUtil.randomPositiveLong();
 double retryIntervalMultiplier = RandomUtil.randomDouble();
 int reconnectAttempts = RandomUtil.randomPositiveInt();
origin: apache/activemq-artemis

ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, liveTC);
long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
long connectionTTL = RandomUtil.randomPositiveLong();
long callTimeout = RandomUtil.randomPositiveLong();
int minLargeMessageSize = RandomUtil.randomPositiveInt();
int consumerWindowSize = RandomUtil.randomPositiveInt();
int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt();
int threadPoolMaxSize = RandomUtil.randomPositiveInt();
long retryInterval = RandomUtil.randomPositiveLong();
double retryIntervalMultiplier = RandomUtil.randomDouble();
int reconnectAttempts = RandomUtil.randomPositiveInt();
origin: apache/activemq-artemis

String user = RandomUtil.randomString();
String password = RandomUtil.randomString();
long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
long connectionTTL = RandomUtil.randomPositiveLong();
long callTimeout = RandomUtil.randomPositiveLong();
int minLargeMessageSize = RandomUtil.randomPositiveInt();
int consumerWindowSize = RandomUtil.randomPositiveInt();
int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt();
int threadPoolMaxSize = RandomUtil.randomPositiveInt();
long retryInterval = RandomUtil.randomPositiveLong();
double retryIntervalMultiplier = RandomUtil.randomDouble();
int reconnectAttempts = RandomUtil.randomPositiveInt();
origin: apache/activemq-artemis

@Test
public void testCountDeliveringMessageCountWithFilter() throws Exception {
 SimpleString key = new SimpleString("key");
 long matchingValue = RandomUtil.randomPositiveLong();
 long unmatchingValue = matchingValue + 1;
 SimpleString address = RandomUtil.randomSimpleString();
 SimpleString queue = RandomUtil.randomSimpleString();
 session.createQueue(address, queue, null, false);
 ClientProducer producer = session.createProducer(address);
 ClientMessage matchingMessage = session.createMessage(false);
 matchingMessage.putLongProperty(key, matchingValue);
 ClientMessage unmatchingMessage = session.createMessage(false);
 unmatchingMessage.putLongProperty(key, unmatchingValue);
 producer.send(matchingMessage);
 producer.send(unmatchingMessage);
 producer.send(matchingMessage);
 QueueControl queueControl = createManagementControl(address, queue);
 Assert.assertEquals(0, queueControl.countDeliveringMessages(null));
 Assert.assertEquals(0, queueControl.countDeliveringMessages(key + " =" + matchingValue));
 Assert.assertEquals(0, queueControl.countDeliveringMessages(key + " =" + unmatchingValue));
 ClientConsumer consumer = session.createConsumer(queue, null, 1024 * 1024, 1, false);
 ClientMessage message = consumer.receive(500);
 Assert.assertNotNull(message);
 Assert.assertEquals(3, queueControl.countDeliveringMessages(null));
 Assert.assertEquals(2, queueControl.countDeliveringMessages(key + " =" + matchingValue));
 Assert.assertEquals(1, queueControl.countDeliveringMessages(key + " =" + unmatchingValue));
 consumer.close();
 session.deleteQueue(queue);
}
origin: apache/activemq-artemis

private void testSettersThrowException(final ActiveMQConnectionFactory cf) {
 long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
 long connectionTTL = RandomUtil.randomPositiveLong();
 long callTimeout = RandomUtil.randomPositiveLong();
 int minLargeMessageSize = RandomUtil.randomPositiveInt();
 int consumerWindowSize = RandomUtil.randomPositiveInt();
 int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt();
 int threadPoolMaxSize = RandomUtil.randomPositiveInt();
 long retryInterval = RandomUtil.randomPositiveLong();
 double retryIntervalMultiplier = RandomUtil.randomDouble();
 int reconnectAttempts = RandomUtil.randomPositiveInt();
origin: apache/activemq-artemis

private void testSettersThrowException(final ClientSessionFactory cf) {
 long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
 long connectionTTL = RandomUtil.randomPositiveLong();
 long callTimeout = RandomUtil.randomPositiveLong();
 int minLargeMessageSize = RandomUtil.randomPositiveInt();
 int consumerWindowSize = RandomUtil.randomPositiveInt();
 int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt();
 int threadPoolMaxSize = RandomUtil.randomPositiveInt();
 long retryInterval = RandomUtil.randomPositiveLong();
 double retryIntervalMultiplier = RandomUtil.randomDouble();
 int reconnectAttempts = RandomUtil.randomPositiveInt();
origin: apache/activemq-artemis

Assert.assertEquals(b, conf.isMessageCounterEnabled());
l = RandomUtil.randomPositiveLong();
conf.setMessageCounterSamplePeriod(l);
Assert.assertEquals(l, conf.getMessageCounterSamplePeriod());
origin: apache/activemq-artemis

Assert.assertEquals(b, conf.isMessageCounterEnabled());
l = RandomUtil.randomPositiveLong();
conf.setMessageCounterSamplePeriod(l);
Assert.assertEquals(l, conf.getMessageCounterSamplePeriod());
org.apache.activemq.artemis.utilsRandomUtilrandomPositiveLong

Popular methods of RandomUtil

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

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • PhpStorm for WordPress
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