Package com.magento.api

Examples of com.magento.api.Filters


     *
     * @return a new {@link Filters} object
     */
    public Filters build()
    {
        return new Filters(null, complexFilters.toArray(new ComplexFilter[complexFilters.size()]));
    }
View Full Code Here


    }

    @Test
    public void testSalesOrdersListNoFilters() throws Exception
    {
        when(port.salesOrderList(anyString(), eq(new Filters()))).thenReturn(
            new SalesOrderListEntity[]{new SalesOrderListEntity()});
        assertEquals(1, connector.listOrders(null).size());
    }
View Full Code Here

    @Test
    public void testSalesOrdersList() throws Exception
    {
        when(port.salesOrderList(anyString(), //
            eq(new Filters(null, new ComplexFilter[]{//
                new ComplexFilter("customer_id", new AssociativeEntity("eq", "500"))})))) //
        .thenReturn(new SalesOrderListEntity[]{new SalesOrderListEntity()});
        assertEquals(1, connector.listOrders("eq(customer_id, 500)").size());
    }
View Full Code Here

    @Test
    public void testSalesOrderShipmentsList() throws RemoteException
    {
        SalesOrderShipmentEntity shipment = new SalesOrderShipmentEntity();
        shipment.setIs_active("1");
        when(port.salesOrderShipmentList(anyString(), eq(new Filters()))).thenReturn(
            new SalesOrderShipmentEntity[]{shipment});
        assertEquals(1, connector.listOrdersShipments("").size());
    }
View Full Code Here

    }

    @Test
    public void testSalesOrderInvoicesList() throws RemoteException
    {
        when(port.salesOrderInvoiceList(anyString(), eq(new Filters()))).thenReturn(new SalesOrderInvoiceEntity[]{});
        connector.listOrdersInvoices("");
        verify(port).salesOrderInvoiceList(anyString(), eq(new Filters()));
    }
View Full Code Here

     * Tests that expressions once parsed can be interpreted
     */
    @Test
    public void testFilterCreationWithBinary() throws Exception
    {
        assertEquals(parse("eq(customer_name, 900)"), new Filters(null,
            new ComplexFilter[]{new ComplexFilter("customer_name", new AssociativeEntity("eq", "900"))}));
    }
View Full Code Here

     * Tests that expressions once parsed can be interpreted
     */
    @Test
    public void testFilterCreationWithUnary() throws Exception
    {
        assertEquals(parse("notnull(customer_name)"), new Filters(null,
            new ComplexFilter[]{new ComplexFilter("customer_name", new AssociativeEntity("notnull", ""))}));
    }
View Full Code Here

     */
    @Test
    public void testFilterCreationWithAnd() throws Exception
    {
        assertEquals(parse("notnull(customer_name), lt(customer_city_code, 56)"), //
            new Filters(null, new ComplexFilter[]{
                new ComplexFilter("customer_name", new AssociativeEntity("notnull", "")),
                new ComplexFilter("customer_city_code", new AssociativeEntity("lt", "56"))}));
    }
View Full Code Here

     * Tests that the apos of a string argument are not added to the filtering value
     */
    @Test
    public void testParseStringArgument() throws Exception
    {
        assertEquals(new Filters(null, new ComplexFilter[]{new ComplexFilter("name", new AssociativeEntity(
            "eq", "Hardware"))}), parse("eq(name, 'Hardware')"));
        assertEquals(new Filters(null, new ComplexFilter[]{new ComplexFilter("name", new AssociativeEntity(
            "eq", ""))}), parse("eq(name, '')"));
    }
View Full Code Here

TOP

Related Classes of com.magento.api.Filters

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.