Examples of accept()


Examples of org.jbehave.core.steps.ParameterConverters.ExamplesTableParametersConverter.accept()

    @Test
    public void shouldConvertMultilineTableToParameters() throws ParseException, IntrospectionException {
        ParameterConverter converter = new ExamplesTableParametersConverter();
        Type type = SomeSteps.methodFor("aMethodWithExamplesTableParameters").getGenericParameterTypes()[0];
        assertThat(converter.accept(type), is(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        String value = "|col1|col2|\n|row11|row12|\n|row21|row22|\n";
        @SuppressWarnings("unchecked")
        List<MyParameters> parameters = (List<MyParameters>) converter.convertValue(value, type);
View Full Code Here

Examples of org.jbehave.core.steps.ParameterConverters.MethodReturningConverter.accept()

    @Test
    public void shouldConvertParameterFromMethodReturningValue() throws ParseException, IntrospectionException {
        Method method = SomeSteps.methodFor("aMethodReturningExamplesTable");
        ParameterConverter converter = new MethodReturningConverter(method, new SomeSteps());
        assertThat(converter.accept(method.getReturnType()), is(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        String value = "|col1|col2|\n|row11|row12|\n|row21|row22|\n";
        ExamplesTable table = (ExamplesTable) converter.convertValue(value, ExamplesTable.class);
        assertThat(table.getRowCount(), equalTo(2));
View Full Code Here

Examples of org.jbehave.core.steps.ParameterConverters.NumberListConverter.accept()

    @Test
    public void shouldConvertCommaSeparatedValuesToListOfNumbersWithDefaultFormat() throws ParseException, IntrospectionException {
        ParameterConverter converter = new NumberListConverter();
        Type listOfNumbers = SomeSteps.methodFor("aMethodWithListOfNumbers").getGenericParameterTypes()[0];
        Type setOfNumbers = SomeSteps.methodFor("aMethodWithSetOfNumbers").getGenericParameterTypes()[0];
        assertThat(converter.accept(listOfNumbers), is(true));
        assertThat(converter.accept(setOfNumbers), is(false));
        List<Number> list = (List<Number>) converter.convertValue("3, 0.5, 6.1f, 8.00", listOfNumbers);
        NumberFormat numberFormat = NumberFormat.getInstance(ParameterConverters.DEFAULT_NUMBER_FORMAT_LOCAL);
        assertThat(list.get(0), equalTo(numberFormat.parse("3")));
        assertThat(list.get(1), equalTo(numberFormat.parse("0.5")));
View Full Code Here

Examples of org.jbehave.core.steps.ParameterConverters.ParameterConverter.accept()

    @Test
    public void shouldConvertMultilineTableToParameters() throws ParseException, IntrospectionException {
        ParameterConverter converter = new ExamplesTableParametersConverter();
        Type type = SomeSteps.methodFor("aMethodWithExamplesTableParameters").getGenericParameterTypes()[0];
        assertThat(converter.accept(type), is(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        String value = "|col1|col2|\n|row11|row12|\n|row21|row22|\n";
        @SuppressWarnings("unchecked")
        List<MyParameters> parameters = (List<MyParameters>) converter.convertValue(value, type);
View Full Code Here

Examples of org.jbehave.core.steps.ParameterConverters.StringListConverter.accept()

    public void shouldConvertCommaSeparatedValuesToListOfStrings() throws IntrospectionException {
        ParameterConverter converter = new StringListConverter();
        Type listOfStrings = SomeSteps.methodFor("aMethodWithListOfStrings").getGenericParameterTypes()[0];
        Type listOfNumbers = SomeSteps.methodFor("aMethodWithListOfNumbers").getGenericParameterTypes()[0];
        Type setOfNumbers = SomeSteps.methodFor("aMethodWithSetOfNumbers").getGenericParameterTypes()[0];
        assertThat(converter.accept(listOfStrings), is(true));
        assertThat(converter.accept(listOfNumbers), is(false));
        assertThat(converter.accept(setOfNumbers), is(false));
        ensureValueIsConvertedToList(converter, listOfStrings, "a, string ", Arrays.asList("a", "string"));
        ensureValueIsConvertedToList(converter, listOfStrings, " ", Arrays.asList(new String[] {}));
    }
View Full Code Here

Examples of org.jboss.messaging.core.contract.Filter.accept()

                
                 //When we route from the cluster we never route to reliable queues
                
                 Filter filter = queue.getFilter();
                
                 if (filter == null || filter.accept(ref.getMessage()))
                 {                   
                   if (trace) { log.trace(this + " Added queue " + queue + " to list of targets"); }
                  
                  targets.add(queue);
                 
View Full Code Here

Examples of org.jboss.modules.filter.PathFilter.accept()

        final Map<String, List<ResourceLoader>> allPaths = new HashMap<String, List<ResourceLoader>>();
        for (ResourceLoaderSpec loaderSpec : resourceLoaders) {
            final ResourceLoader loader = loaderSpec.getResourceLoader();
            final PathFilter filter = loaderSpec.getPathFilter();
            for (String path : loader.getPaths()) {
                if (filter.accept(path)) {
                    final List<ResourceLoader> allLoaders = allPaths.get(path);
                    if (allLoaders == null) {
                        ArrayList<ResourceLoader> newList = new ArrayList<ResourceLoader>(16);
                        newList.add(loader);
                        allPaths.put(path, newList);
View Full Code Here

Examples of org.jboss.remoting.transport.multiplex.MasterServerSocket.accept()

               try
               {
                  mss = new MasterServerSocket(clientServerSocketPort + 101);
                  log.info(mss.toString() + ": MasterServerSocket accepting");
                  os.write(3);
                  Socket s = mss.accept();
                  log.info(mss.toString() + ": accepted");
                  s.close();
                  mss.close();
               }
               catch (IOException e)
View Full Code Here

Examples of org.jboss.remoting.transport.multiplex.VirtualServerSocket.accept()

         serverSocket1.connect(address1);
         serverSocket1.setSoTimeout(2000);

         try
         {
            virtualSocket1 = serverSocket1.accept();
            fail();
         }
         catch (SocketTimeoutException e)
         {
            if (e.getMessage().equals("Accept timed out"))
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.accept()

   public void testAcceptsProduces() throws Exception
   {
      // test that media type is chosen from resource method and accepts
      {
         ClientRequest request = new ClientRequest(generateURL("/mapper/accepts-produces"));
         request.accept("application/json");
         ClientResponse response = request.get();
         Assert.assertEquals(412, response.getStatus());
         Assert.assertEquals("application/json", response.getHeaders().getFirst("Content-Type"));
         String error = (String) response.getEntity(String.class);
         Assert.assertNotNull(error);
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.