Package org.apache.type_substitution

Examples of org.apache.type_substitution.CarDealer


        assertTrue("server did not launch correctly", launchServer(Server.class));
    }

    @Test
    public void testBasicConnection() throws Exception {
        CarDealer dealer = getCardealer();

        /**
         * CarDealer.getSedans() returns List<Car>
         * Car is abstract class. The code below shows
         * that the client is expecting a Porsche which extends
         * Car.
         *
         * It shows a doc wrapper style operation.
        */

        List<Car> cars = dealer.getSedans("porsche");
        assertEquals(2, cars.size());
        Porsche car = (Porsche) cars.get(0);
        assertNotNull(car);
        if (car != null && "Porsche".equals(car.getMake())
            && "Boxster".equals(car.getModel())
            && "1998".equals(car.getYear())
            && "white".equals(car.getColor())) {
            // get the right car
        } else {
            fail("Get the wrong car!");
        }
       
        /**
         * CarDealer.tradeIn(Car) takes an abstract class Car and returns the same.
         * We will send a sub-class instead and expect to get the same.
         *
         */
        Porsche oldCar = new Porsche();
        oldCar.setMake("Porsche");
        oldCar.setColor("white");
        oldCar.setModel("GT2000");
        oldCar.setYear("2000");
        Porsche newCar = (Porsche)dealer.tradeIn(oldCar);
        assertNotNull(newCar);

        if (newCar != null && "Porsche".equals(newCar.getMake())
            && "911GT3".equals(newCar.getModel())
            && "2007".equals(newCar.getYear())
View Full Code Here


        assertNotNull("WSDL is null", wsdl);

        CarDealerService service = new CarDealerService(wsdl, serviceName);
        assertNotNull("Service is null ", service);
       
        CarDealer dealer = service.getCarDealerPort();
        updateAddressPort(dealer, PORT);
        return dealer;
    }
View Full Code Here

        assertTrue("server did not launch correctly", launchServer(Server.class, true));
    }

    @Test
    public void testBasicConnection() throws Exception {
        CarDealer dealer = getCardealer();

        /**
         * CarDealer.getSedans() returns List<Car>
         * Car is abstract class. The code below shows
         * that the client is expecting a Porsche which extends
         * Car.
         *
         * It shows a doc wrapper style operation.
        */

        List<Car> cars = dealer.getSedans("porsche");
        assertEquals(2, cars.size());
        Porsche car = (Porsche) cars.get(0);
        assertNotNull(car);
        if (car != null && "Porsche".equals(car.getMake())
            && "Boxster".equals(car.getModel())
            && "1998".equals(car.getYear())
            && "white".equals(car.getColor())) {
            // get the right car
        } else {
            fail("Get the wrong car!");
        }
       
        /**
         * CarDealer.tradeIn(Car) takes an abstract class Car and returns the same.
         * We will send a sub-class instead and expect to get the same.
         *
         */
        Porsche oldCar = new Porsche();
        oldCar.setMake("Porsche");
        oldCar.setColor("white");
        oldCar.setModel("GT2000");
        oldCar.setYear("2000");
        Porsche newCar = (Porsche)dealer.tradeIn(oldCar);
        assertNotNull(newCar);

        if (newCar != null && "Porsche".equals(newCar.getMake())
            && "911GT3".equals(newCar.getModel())
            && "2007".equals(newCar.getYear())
View Full Code Here

        assertNotNull("WSDL is null", wsdl);

        CarDealerService service = new CarDealerService(wsdl, serviceName);
        assertNotNull("Service is null ", service);
       
        CarDealer dealer = service.getCarDealerPort();
        updateAddressPort(dealer, PORT);
        return dealer;
    }
View Full Code Here

        assertTrue("server did not launch correctly", launchServer(Server.class));
    }

    @Test
    public void testBasicConnection() throws Exception {
        CarDealer dealer = getCardealer();

        /**
         * CarDealer.getSedans() returns List<Car>
         * Car is abstract class. The code below shows
         * that the client is expecting a Porsche which extends
         * Car.
         *
         * It shows a doc wrapper style operation.
        */

        List<Car> cars = dealer.getSedans("porsche");
        assertEquals(2, cars.size());
        Porsche car = (Porsche) cars.get(0);
        assertNotNull(car);
        if (car != null && "Porsche".equals(car.getMake())
            && "Boxster".equals(car.getModel())
            && "1998".equals(car.getYear())
            && "white".equals(car.getColor())) {
            // get the right car
        } else {
            fail("Get the wrong car!");
        }
       
        /**
         * CarDealer.tradeIn(Car) takes an abstract class Car and returns the same.
         * We will send a sub-class instead and expect to get the same.
         *
         */
        Porsche oldCar = new Porsche();
        oldCar.setMake("Porsche");
        oldCar.setColor("white");
        oldCar.setModel("GT2000");
        oldCar.setYear("2000");
        Porsche newCar = (Porsche)dealer.tradeIn(oldCar);
        assertNotNull(newCar);

        if (newCar != null && "Porsche".equals(newCar.getMake())
            && "911GT3".equals(newCar.getModel())
            && "2007".equals(newCar.getYear())
View Full Code Here

TOP

Related Classes of org.apache.type_substitution.CarDealer

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.