Examples of multiple()


Examples of org.apache.curator.test.Timing.multiple()

            Assert.assertTrue(semaphore.availablePermits() == 0);
            Assert.assertFalse(selector.hasLeadership());

            selector.requeue();
            Assert.assertTrue(timing.multiple(4).acquireSemaphore(semaphore));
        }
        finally
        {
            CloseableUtils.closeQuietly(client);
            CloseableUtils.closeQuietly(cluster);
View Full Code Here

Examples of org.apache.curator.test.Timing.multiple()

            ClientAndLatch leader = waitForALeader(clients, timing);
            Assert.assertNotNull(leader);

            cluster.killServer(instances.get(leader.index));

            Thread.sleep(timing.multiple(2).session());

            leader = waitForALeader(clients, timing);
            Assert.assertNotNull(leader);

            Assert.assertEquals(getLeaders(clients).size(), 1);
View Full Code Here

Examples of org.apache.curator.test.Timing.multiple()

                for ( int i = 0; i < itemQty; ++i )
                {
                    TestQueueItem       item = new TestQueueItem(Integer.toString(i));
                    producerQueue.put(item);
                }
                producerQueue.flushPuts(timing.multiple(2).seconds(), TimeUnit.SECONDS);
            }
            finally
            {
                producerQueue.close();
            }
View Full Code Here

Examples of org.apache.curator.test.Timing.multiple()

            Assert.assertTrue(queue.put("1", timing.milliseconds(), TimeUnit.MILLISECONDS));   // should end up in consumer
            Assert.assertTrue(queue.put("2", timing.milliseconds(), TimeUnit.MILLISECONDS));   // should sit blocking in DistributedQueue
            Assert.assertTrue(timing.awaitLatch(latch));
            timing.sleepABit();
            Assert.assertFalse(queue.put("3", timing.multiple(.5).milliseconds(), TimeUnit.MILLISECONDS));

            semaphore.release(100);
            Assert.assertTrue(queue.put("3", timing.milliseconds(), TimeUnit.MILLISECONDS));
            Assert.assertTrue(queue.put("4", timing.milliseconds(), TimeUnit.MILLISECONDS));
            Assert.assertTrue(queue.put("5", timing.milliseconds(), TimeUnit.MILLISECONDS));
View Full Code Here

Examples of org.apache.curator.test.Timing.multiple()

                    }
                }
            );

            KillSession.kill(client.getZookeeperClient().getZooKeeper(), server.getConnectString());
            Thread.sleep(timing.multiple(1.5).session());

            Assert.assertEquals(cache.getCurrentData().getData(), "start".getBytes());

            client.setData().forPath("/test/node", "new data".getBytes());
            Assert.assertTrue(timing.awaitLatch(latch));
View Full Code Here

Examples of org.glassfish.api.Param.multiple()

    // package-private, for testing
    static Object convertListToObject(AnnotatedElement target,
                                    Class type, List<String> paramValList) {
        Param param = target.getAnnotation(Param.class);
        // does this parameter type allow multiple values?
        if (!param.multiple()) {
            if (paramValList.size() == 1)
                return convertStringToObject(target, type, paramValList.get(0));
            throw new UnacceptableValueException(
                localStrings.getLocalString("TooManyValues",
                    "Invalid parameter: {0}.  This parameter may not have " +
View Full Code Here

Examples of org.glassfish.api.Param.multiple()

            if (param != null &&
                    ! parameterNamesToExclude.contains(f.getName())) {
                final Object fieldValue = f.get(target);
                if (fieldValue != null) {
                    final String paramName = param.primary() ? "DEFAULT" :  CommandModel.getParamName(param, f);
                    if (param.multiple()) {
                        paramMap.set(paramName, multipleValue(param, f.get(target)));
                    } else {
                        paramMap.set(paramName, singleValue(param, f.get(target)));
                    }
                }
View Full Code Here

Examples of org.glassfish.api.Param.multiple()

    // package-private, for testing
    static Object convertListToObject(AnnotatedElement target,
                                    Class type, List<String> paramValList) {
        Param param = target.getAnnotation(Param.class);
        // does this parameter type allow multiple values?
        if (!param.multiple()) {
            if (paramValList.size() == 1)
                return convertStringToObject(target, type, paramValList.get(0));
            throw new UnacceptableValueException(
                localStrings.getLocalString("TooManyValues",
                    "Invalid parameter: {0}.  This parameter may not have " +
View Full Code Here

Examples of org.glassfish.api.Param.multiple()

    parameters.set(paramName, value);
                V paramValue = (V) convertListToObject(target, type, value);
                return paramValue;
      }
  }
        if (param.multiple()) {
            List<String> value = parameters.get(paramName);
            if (value != null && value.size() > 0) {
                final List<String> filePaths = getUploadedFileParamValues(
                        paramName,
                        type, optionNameToUploadedFileMap);
View Full Code Here

Examples of org.glassfish.api.Param.multiple()

    // package-private, for testing
    static Object convertListToObject(AnnotatedElement target,
                                    Class type, List<String> paramValList) {
        Param param = target.getAnnotation(Param.class);
        // does this parameter type allow multiple values?
        if (!param.multiple()) {
            if (paramValList.size() == 1)
                return convertStringToObject(target, type, paramValList.get(0));
            throw new UnacceptableValueException(
                localStrings.getLocalString("TooManyValues",
                    "Invalid parameter: {0}.  This parameter may not have " +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.