Package org.apache.cxf.message

Examples of org.apache.cxf.message.Message


public class SearchContextImplTest extends Assert {

    @Test
    public void testPlainQuery1() {
        Message m = new MessageImpl();
        m.put("search.use.plain.queries", true);
        m.put(Message.QUERY_STRING, "a=b");
        String exp = new SearchContextImpl(m).getSearchExpression();
        assertEquals("a==b", exp);
    }
View Full Code Here


        Conduit conduit = conduitInit.getConduit(ei);

        TestMessageObserver obs = new TestMessageObserver();
        conduit.setMessageObserver(obs);

        Message m = new MessageImpl();
        conduit.prepare(m);

        OutputStream os = m.getContent(OutputStream.class);
        os.write(message);

        // TODO: shouldn't have to do this. IO caching needs cleaning
        // up or possibly removal...
        os.flush();
View Full Code Here

        assertEquals("a==b", exp);
    }
   
    @Test
    public void testWrongQueryNoException() {
        Message m = new MessageImpl();
        m.put(Message.QUERY_STRING, "_s=ab");
        assertNull(new SearchContextImpl(m).getCondition(Book.class));
    }
View Full Code Here

        assertNull(new SearchContextImpl(m).getCondition(Book.class));
    }
   
    @Test(expected = SearchParseException.class)
    public void testWrongQueryException() {
        Message m = new MessageImpl();
        m.put("search.block.search.exception", false);
        m.put(Message.QUERY_STRING, "_s=ab");
        new SearchContextImpl(m).getCondition(Book.class);
    }
View Full Code Here

        new SearchContextImpl(m).getCondition(Book.class);
    }
   
    @Test
    public void testPlainQuery2() {
        Message m = new MessageImpl();
        m.put("search.use.plain.queries", true);
        m.put(Message.QUERY_STRING, "a=b&a=b1");
        String exp = new SearchContextImpl(m).getSearchExpression();
        assertEquals("(a==b,a==b1)", exp);
    }
View Full Code Here

        assertEquals("(a==b,a==b1)", exp);
    }
   
    @Test
    public void testPlainQuery3() {
        Message m = new MessageImpl();
        m.put("search.use.plain.queries", true);
        m.put(Message.QUERY_STRING, "a=b&c=d");
        String exp = new SearchContextImpl(m).getSearchExpression();
        assertEquals("(a==b;c==d)", exp);
    }
View Full Code Here

        assertEquals("(a==b;c==d)", exp);
    }
   
    @Test
    public void testPlainQuery4() {
        Message m = new MessageImpl();
        m.put("search.use.plain.queries", true);
        m.put(Message.QUERY_STRING, "a=b&a=b2&c=d&f=g");
        String exp = new SearchContextImpl(m).getSearchExpression();
        assertEquals("((a==b,a==b2);c==d;f==g)", exp);
    }
View Full Code Here

        assertEquals("((a==b,a==b2);c==d;f==g)", exp);
    }
   
    @Test
    public void testPlainQuery5() {
        Message m = new MessageImpl();
        m.put("search.use.plain.queries", true);
        m.put(Message.QUERY_STRING, "aFrom=1&aTill=3");
        String exp = new SearchContextImpl(m).getSearchExpression();
        assertEquals("(a=ge=1;a=le=3)", exp);
    }
View Full Code Here

            SearchContextImpl.SEARCH_QUERY + "=" + "name==CXF%20Rocks;id=gt=123");
    }
   
    @Test
    public void testFiqlSearchConditionCustomQueryName() {
        Message m = new MessageImpl();
        m.put(SearchContextImpl.CUSTOM_SEARCH_QUERY_PARAM_NAME, "thequery");
        doTestFiqlSearchCondition(m,
            "thequery" + "=" + "name==CXF%20Rocks;id=gt=123");
    }
View Full Code Here

        assertEquals(1, found.size());
        assertEquals(new Book("CXF Rocks", 125L), found.get(0));
    }
   
    private void doTestFiqlSearchBean(String queryString) {
        Message m = new MessageImpl();
        m.put(Message.QUERY_STRING, queryString);
        SearchContext context = new SearchContextImpl(m);
        SearchCondition<SearchBean> sc = context.getCondition(SearchBean.class);
        assertNotNull(sc);
       
        List<SearchBean> beans = new ArrayList<SearchBean>();
View Full Code Here

TOP

Related Classes of org.apache.cxf.message.Message

Copyright © 2018 www.massapicom. 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.