Examples of Bus


Examples of org.apache.cxf.Bus

    Dispatch<T> dispatch = null;
    if (HTTPBinding.HTTP_BINDING.equals(binding) && type == DataSource.class) {
      dispatch = (Dispatch<T>) new BinaryDispatch(endpoint);
    } else {
      //TODO: cache service/port/dispatch instances?
      Bus bus = BusFactory.getThreadDefaultBus();
      BusFactory.setThreadDefaultBus(mcf.getBus());
      Service svc;
      try {
        svc = Service.create(svcQname);
      } finally {
View Full Code Here

Examples of org.codehaus.enunciate.examples.c.schema.vehicles.Bus

    if (this.skipCTests) {
      System.out.println("C tests have been disabled.");
      return;
    }

    Bus bus = new Bus();
    bus.setId("some bus");
    Label cityBus = new Label();
    cityBus.setValue("city");
    Label countryBus = new Label();
    countryBus.setValue("country");
    Label longDistanceBus = new Label();
    longDistanceBus.setValue("long-distance");
    bus.setId("bus id");
    bus.setLabels(Arrays.asList(cityBus, countryBus, longDistanceBus));
    Rectangle door = new Rectangle();
    door.setColor(Color.BLUE);
    door.setWidth(2);
    door.setHeight(4);
    door.setLineStyle(LineStyle.solid);
    bus.setDoor(door);
    Rectangle frame = new Rectangle();
    frame.setHeight(10);
    frame.setWidth(50);
    frame.setColor(Color.YELLOW);
    frame.setLineStyle(LineStyle.solid);
    bus.setFrame(frame);
    Circle front = new Circle();
    front.setColor(Color.BLUE);
    front.setLineStyle(LineStyle.dotted);
    front.setRadius(6);
    Circle back = new Circle();
    back.setColor(Color.BLUE);
    back.setLineStyle(LineStyle.dotted);
    back.setRadius(7);
    bus.setWheels(new Circle[] {front, back});
    Rectangle window1 = new Rectangle();
    window1.setColor(Color.BLUE);
    window1.setWidth(2);
    window1.setHeight(2);
    window1.setLineStyle(LineStyle.solid);
    Rectangle window2 = new Rectangle();
    window2.setColor(Color.BLUE);
    window2.setWidth(2);
    window2.setHeight(2);
    window2.setLineStyle(LineStyle.solid);
    Rectangle window3 = new Rectangle();
    window3.setColor(Color.BLUE);
    window3.setWidth(2);
    window3.setHeight(2);
    window3.setLineStyle(LineStyle.solid);
    bus.setWindows(Arrays.asList(window1, window2, window3));
    bus.setType(XmlQNameEnumUtil.toQName(BusType.charter));
    bus = processThroughXml(bus);
    assertEquals("bus id", bus.getId());
    door = bus.getDoor();
    assertSame(Color.BLUE, door.getColor());
    assertEquals(2, door.getWidth());
    assertEquals(4, door.getHeight());
    assertSame(LineStyle.solid, door.getLineStyle());
    frame = bus.getFrame();
    assertEquals(10, frame.getHeight());
    assertEquals(50, frame.getWidth());
    assertSame(Color.YELLOW, frame.getColor());
    assertSame(LineStyle.solid, frame.getLineStyle());
    Circle[] wheels = bus.getWheels();
    assertEquals(2, wheels.length);
    assertEquals(6, wheels[0].getRadius());
    assertSame(Color.BLUE, wheels[0].getColor());
    assertSame(LineStyle.dotted, wheels[0].getLineStyle());
    assertEquals(7, wheels[1].getRadius());
    assertSame(Color.BLUE, wheels[1].getColor());
    assertSame(LineStyle.dotted, wheels[1].getLineStyle());
    Rectangle[] windows = bus.getWindows().toArray(new Rectangle[3]);
    assertEquals(2, windows[0].getWidth());
    assertEquals(2, windows[0].getHeight());
    assertEquals(Color.BLUE, windows[0].getColor());
    assertEquals(LineStyle.solid, windows[0].getLineStyle());
    assertEquals(2, windows[1].getWidth());
    assertEquals(2, windows[1].getHeight());
    assertEquals(Color.BLUE, windows[1].getColor());
    assertEquals(LineStyle.solid, windows[1].getLineStyle());
    assertEquals(2, windows[2].getWidth());
    assertEquals(2, windows[2].getHeight());
    assertEquals(Color.BLUE, windows[2].getColor());
    assertEquals(LineStyle.solid, windows[2].getLineStyle());
    assertEquals(BusType.charter, XmlQNameEnumUtil.fromQName(bus.getType(), BusType.class));
  }
View Full Code Here

Examples of org.codehaus.enunciate.examples.csharp.schema.vehicles.Bus

    if (this.skipCSharpTests) {
      System.out.println("CSharp tests have been disabled.");
      return;
    }

    Bus bus = new Bus();
    bus.setId("some bus");
    Label cityBus = new Label();
    cityBus.setValue("city");
    Label countryBus = new Label();
    countryBus.setValue("country");
    Label longDistanceBus = new Label();
    longDistanceBus.setValue("long-distance");
    bus.setId("bus id");
    bus.setLabels(Arrays.asList(cityBus, countryBus, longDistanceBus));
    Rectangle door = new Rectangle();
    door.setColor(Color.BLUE);
    door.setWidth(2);
    door.setHeight(4);
    door.setLineStyle(LineStyle.solid);
    bus.setDoor(door);
    Rectangle frame = new Rectangle();
    frame.setHeight(10);
    frame.setWidth(50);
    frame.setColor(Color.YELLOW);
    frame.setLineStyle(LineStyle.solid);
    bus.setFrame(frame);
    Circle front = new Circle();
    front.setColor(Color.BLUE);
    front.setLineStyle(LineStyle.dotted);
    front.setRadius(6);
    Circle back = new Circle();
    back.setColor(Color.BLUE);
    back.setLineStyle(LineStyle.dotted);
    back.setRadius(7);
    bus.setWheels(new Circle[] {front, back});
    Rectangle window1 = new Rectangle();
    window1.setColor(Color.BLUE);
    window1.setWidth(2);
    window1.setHeight(2);
    window1.setLineStyle(LineStyle.solid);
    Rectangle window2 = new Rectangle();
    window2.setColor(Color.BLUE);
    window2.setWidth(2);
    window2.setHeight(2);
    window2.setLineStyle(LineStyle.solid);
    Rectangle window3 = new Rectangle();
    window3.setColor(Color.BLUE);
    window3.setWidth(2);
    window3.setHeight(2);
    window3.setLineStyle(LineStyle.solid);
    bus.setWindows(Arrays.asList(window1, window2, window3));
    bus.setType(XmlQNameEnumUtil.toQName(BusType.charter));

    bus = processThroughXml(bus);
    assertEquals("bus id", bus.getId());
    door = bus.getDoor();
    assertSame(Color.BLUE, door.getColor());
    assertEquals(2, door.getWidth());
    assertEquals(4, door.getHeight());
    assertSame(LineStyle.solid, door.getLineStyle());
    frame = bus.getFrame();
    assertEquals(10, frame.getHeight());
    assertEquals(50, frame.getWidth());
    assertSame(Color.YELLOW, frame.getColor());
    assertSame(LineStyle.solid, frame.getLineStyle());
    Circle[] wheels = bus.getWheels();
    assertEquals(2, wheels.length);
    assertEquals(6, wheels[0].getRadius());
    assertSame(Color.BLUE, wheels[0].getColor());
    assertSame(LineStyle.dotted, wheels[0].getLineStyle());
    assertEquals(7, wheels[1].getRadius());
    assertSame(Color.BLUE, wheels[1].getColor());
    assertSame(LineStyle.dotted, wheels[1].getLineStyle());
    Rectangle[] windows = bus.getWindows().toArray(new Rectangle[3]);
    assertEquals(2, windows[0].getWidth());
    assertEquals(2, windows[0].getHeight());
    assertEquals(Color.BLUE, windows[0].getColor());
    assertEquals(LineStyle.solid, windows[0].getLineStyle());
    assertEquals(2, windows[1].getWidth());
    assertEquals(2, windows[1].getHeight());
    assertEquals(Color.BLUE, windows[1].getColor());
    assertEquals(LineStyle.solid, windows[1].getLineStyle());
    assertEquals(2, windows[2].getWidth());
    assertEquals(2, windows[2].getHeight());
    assertEquals(Color.BLUE, windows[2].getColor());
    assertEquals(LineStyle.solid, windows[2].getLineStyle());
    assertEquals(BusType.charter, XmlQNameEnumUtil.fromQName(bus.getType(), BusType.class));
  }
View Full Code Here

Examples of org.codehaus.enunciate.examples.jaxws_client.schema.vehicles.Bus

  /**
   * tests bus.  This one has an element wrapper.
   */
  public void testBus() throws Exception {
    Bus bus = new Bus();
    bus.setId("some bus");
    Label cityBus = new Label();
    cityBus.setValue("city");
    Label countryBus = new Label();
    countryBus.setValue("country");
    Label longDistanceBus = new Label();
    longDistanceBus.setValue("long-distance");

    bus.setId("bus id");
    bus.setLabels(Arrays.asList(cityBus, countryBus, longDistanceBus));
    Rectangle door = new Rectangle();
    door.setColor(Color.BLUE);
    door.setWidth(2);
    door.setHeight(4);
    door.setLineStyle(LineStyle.solid);
    bus.setDoor(door);
    Rectangle frame = new Rectangle();
    frame.setHeight(10);
    frame.setWidth(50);
    frame.setColor(Color.YELLOW);
    frame.setLineStyle(LineStyle.solid);
    bus.setFrame(frame);
    Circle front = new Circle();
    front.setColor(Color.BLUE);
    front.setLineStyle(LineStyle.dotted);
    front.setRadius(6);
    Circle back = new Circle();
    back.setColor(Color.BLUE);
    back.setLineStyle(LineStyle.dotted);
    back.setRadius(7);
    bus.setWheels(new Circle[] {front, back});
    Rectangle window1 = new Rectangle();
    window1.setColor(Color.BLUE);
    window1.setWidth(2);
    window1.setHeight(2);
    window1.setLineStyle(LineStyle.solid);
    Rectangle window2 = new Rectangle();
    window2.setColor(Color.BLUE);
    window2.setWidth(2);
    window2.setHeight(2);
    window2.setLineStyle(LineStyle.solid);
    Rectangle window3 = new Rectangle();
    window3.setColor(Color.BLUE);
    window3.setWidth(2);
    window3.setHeight(2);
    window3.setLineStyle(LineStyle.solid);
    bus.setWindows(Arrays.asList(window1, window2, window3));
    Map<Integer, Circle> riders = new HashMap<Integer, Circle>();
    Circle rider3 = new Circle();
    rider3.setRadius(3);
    riders.put(3, rider3);
    Circle rider4 = new Circle();
    rider4.setRadius(4);
    riders.put(4, rider4);
    bus.setType(XmlQNameEnumUtil.toQName(BusType.charter));

    JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();
    ObjectMapper busMapper = provider.locateMapper(Bus.class, MediaType.APPLICATION_JSON_TYPE);
    ObjectMapper clientMapper = new ObjectMapper();

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    busMapper.writeValue(out, bus);
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    shapes.json.vehicles.Bus clientBus = clientMapper.readValue(in, shapes.json.vehicles.Bus.class);
    assertEquals("bus id", clientBus.getId());
    ArrayList<String> labels = new ArrayList<String>(Arrays.asList("city", "country", "long-distance"));
    for (Object l : clientBus.getLabels()) {
      shapes.json.Label label = (shapes.json.Label) l;
      assertTrue(labels.remove(label.getValue()));
    }
    shapes.json.Rectangle clientDoor = clientBus.getDoor();
    assertSame(shapes.json.Color.BLUE, clientDoor.getColor());
    assertEquals(2, clientDoor.getWidth());
    assertEquals(4, clientDoor.getHeight());
    assertSame(shapes.json.LineStyle.solid, clientDoor.getLineStyle());
    shapes.json.Rectangle clientFrame = clientBus.getFrame();
    assertEquals(10, clientFrame.getHeight());
    assertEquals(50, clientFrame.getWidth());
    assertSame(shapes.json.Color.YELLOW, clientFrame.getColor());
    assertSame(shapes.json.LineStyle.solid, clientFrame.getLineStyle());
    shapes.json.Circle[] clientWheels = clientBus.getWheels();
    assertEquals(2, clientWheels.length);
    assertEquals(6, clientWheels[0].getRadius());
    assertSame(shapes.json.Color.BLUE, clientWheels[0].getColor());
    assertSame(shapes.json.LineStyle.dotted, clientWheels[0].getLineStyle());
    assertEquals(7, clientWheels[1].getRadius());
    assertSame(shapes.json.Color.BLUE, clientWheels[1].getColor());
    assertSame(shapes.json.LineStyle.dotted, clientWheels[1].getLineStyle());
    shapes.json.Rectangle[] clientWindows = (shapes.json.Rectangle[]) clientBus.getWindows().toArray(new shapes.json.Rectangle[3]);
    assertEquals(2, clientWindows[0].getWidth());
    assertEquals(2, clientWindows[0].getHeight());
    assertEquals(shapes.json.Color.BLUE, clientWindows[0].getColor());
    assertEquals(shapes.json.LineStyle.solid, clientWindows[0].getLineStyle());
    assertEquals(2, clientWindows[1].getWidth());
    assertEquals(2, clientWindows[1].getHeight());
    assertEquals(shapes.json.Color.BLUE, clientWindows[1].getColor());
    assertEquals(shapes.json.LineStyle.solid, clientWindows[1].getLineStyle());
    assertEquals(2, clientWindows[2].getWidth());
    assertEquals(2, clientWindows[2].getHeight());
    assertEquals(shapes.json.Color.BLUE, clientWindows[2].getColor());
    assertEquals(shapes.json.LineStyle.solid, clientWindows[2].getLineStyle());

    out = new ByteArrayOutputStream();
    clientMapper.writeValue(out, clientBus);
    bus = busMapper.readValue(new ByteArrayInputStream(out.toByteArray()), Bus.class);
    door = bus.getDoor();
    assertSame(Color.BLUE, door.getColor());
    assertEquals(2, door.getWidth());
    assertEquals(4, door.getHeight());
    assertSame(LineStyle.solid, door.getLineStyle());
    frame = bus.getFrame();
    assertEquals(10, frame.getHeight());
    assertEquals(50, frame.getWidth());
    assertSame(Color.YELLOW, frame.getColor());
    assertSame(LineStyle.solid, frame.getLineStyle());
    Circle[] wheels = bus.getWheels();
    assertEquals(2, wheels.length);
    assertEquals(6, wheels[0].getRadius());
    assertSame(Color.BLUE, wheels[0].getColor());
    assertSame(LineStyle.dotted, wheels[0].getLineStyle());
    assertEquals(7, wheels[1].getRadius());
    assertSame(Color.BLUE, wheels[1].getColor());
    assertSame(LineStyle.dotted, wheels[1].getLineStyle());
    Rectangle[] windows = bus.getWindows().toArray(new Rectangle[3]);
    assertEquals(2, windows[0].getWidth());
    assertEquals(2, windows[0].getHeight());
    assertEquals(Color.BLUE, windows[0].getColor());
    assertEquals(LineStyle.solid, windows[0].getLineStyle());
    assertEquals(2, windows[1].getWidth());
    assertEquals(2, windows[1].getHeight());
    assertEquals(Color.BLUE, windows[1].getColor());
    assertEquals(LineStyle.solid, windows[1].getLineStyle());
    assertEquals(2, windows[2].getWidth());
    assertEquals(2, windows[2].getHeight());
    assertEquals(Color.BLUE, windows[2].getColor());
    assertEquals(LineStyle.solid, windows[2].getLineStyle());
    assertEquals(BusType.charter, XmlQNameEnumUtil.fromQName(bus.getType(), BusType.class));

    //todo: test an element wrapper around elementRefs
  }
View Full Code Here

Examples of org.codehaus.enunciate.examples.objc.schema.vehicles.Bus

        if (this.skipObjCTests) {
            System.out.println("C tests have been disabled.");
            return;
        }
       
        Bus bus = new Bus();
        SeatRow rowA = new SeatRow();
        rowA.setRowName("A");
        Seat seatA1 = new Seat();
        seatA1.setNumber(1);
        Seat seatA2 = new Seat(); //empty element
        Seat seatA3 = new Seat();
        seatA3.setNumber(3);
        rowA.setSeats(Arrays.asList(seatA1, seatA2, seatA3));
        bus.setSeatRows(Arrays.asList(rowA));
        bus = processThroughXml(bus);
        assertNotNull(bus.getSeatRows());
        assertEquals(1, bus.getSeatRows().size());
        List<Seat> seats =bus.getSeatRows().get(0).getSeats();
        assertNotNull(seats);
        assertEquals(3, seats.size());
        assertEquals(new Integer(1), seats.get(0).getNumber());
        assertEquals(null, seats.get(1).getNumber());
        assertEquals(new Integer(3), seats.get(2).getNumber());
View Full Code Here

Examples of org.codehaus.enunciate.examples.php.schema.vehicles.Bus

    if (this.skipPHPTests) {
      System.out.println("PHP tests have been disabled.");
      return;
    }

    Bus bus = new Bus();
    bus.setId("some bus");
    Label cityBus = new Label();
    cityBus.setValue("city");
    Label countryBus = new Label();
    countryBus.setValue("country");
    Label longDistanceBus = new Label();
    longDistanceBus.setValue("long-distance");
    bus.setId("bus id");
    bus.setLabels(Arrays.asList(cityBus, countryBus, longDistanceBus));
    Rectangle door = new Rectangle();
    door.setColor(Color.BLUE);
    door.setWidth(2);
    door.setHeight(4);
    door.setLineStyle(LineStyle.solid);
    bus.setDoor(door);
    Rectangle frame = new Rectangle();
    frame.setHeight(10);
    frame.setWidth(50);
    frame.setColor(Color.YELLOW);
    frame.setLineStyle(LineStyle.solid);
    bus.setFrame(frame);
    Circle front = new Circle();
    front.setColor(Color.BLUE);
    front.setLineStyle(LineStyle.dotted);
    front.setRadius(6);
    Circle back = new Circle();
    back.setColor(Color.BLUE);
    back.setLineStyle(LineStyle.dotted);
    back.setRadius(7);
    bus.setWheels(new Circle[]{front, back});
    Rectangle window1 = new Rectangle();
    window1.setColor(Color.BLUE);
    window1.setWidth(2);
    window1.setHeight(2);
    window1.setLineStyle(LineStyle.solid);
    Rectangle window2 = new Rectangle();
    window2.setColor(Color.BLUE);
    window2.setWidth(2);
    window2.setHeight(2);
    window2.setLineStyle(LineStyle.solid);
    Rectangle window3 = new Rectangle();
    window3.setColor(Color.BLUE);
    window3.setWidth(2);
    window3.setHeight(2);
    window3.setLineStyle(LineStyle.solid);
    bus.setWindows(Arrays.asList(window1, window2, window3));
    bus = processThroughXml(bus);
    assertEquals("bus id", bus.getId());
    door = bus.getDoor();
    assertSame(Color.BLUE, door.getColor());
    assertEquals(2, door.getWidth());
    assertEquals(4, door.getHeight());
    assertSame(LineStyle.solid, door.getLineStyle());
    frame = bus.getFrame();
    assertEquals(10, frame.getHeight());
    assertEquals(50, frame.getWidth());
    assertSame(Color.YELLOW, frame.getColor());
    assertSame(LineStyle.solid, frame.getLineStyle());
    Circle[] wheels = bus.getWheels();
    assertEquals(2, wheels.length);
    assertEquals(6, wheels[0].getRadius());
    assertSame(Color.BLUE, wheels[0].getColor());
    assertSame(LineStyle.dotted, wheels[0].getLineStyle());
    assertEquals(7, wheels[1].getRadius());
    assertSame(Color.BLUE, wheels[1].getColor());
    assertSame(LineStyle.dotted, wheels[1].getLineStyle());
    Rectangle[] windows = bus.getWindows().toArray(new Rectangle[3]);
    assertEquals(2, windows[0].getWidth());
    assertEquals(2, windows[0].getHeight());
    assertEquals(Color.BLUE, windows[0].getColor());
    assertEquals(LineStyle.solid, windows[0].getLineStyle());
    assertEquals(2, windows[1].getWidth());
View Full Code Here

Examples of org.dozer.vo.Bus

    Car carDest = mapper.map(van, Car.class);
    assertEquals("defaultValueSetByCustomConverter", carDest.getName());

    // test that we get customconverter even though it wasn't defined in the mapping file
    Moped moped = newInstance(Moped.class);
    Bus bus = mapper.map(moped, Bus.class);
    assertEquals("defaultValueSetByCustomConverter", bus.getName());

    // map back
    Moped mopedDest = mapper.map(bus, Moped.class);
    assertEquals("defaultValueSetByCustomConverter", mopedDest.getName());
  }
View Full Code Here

Examples of org.dozer.vo.Bus

    Car carDest = cleanMapper.map(van, Car.class);
    assertEquals("injectedName", carDest.getName());

    // test that we get customconverter even though it wasn't defined in the mapping file
    Moped moped = new Moped();
    Bus bus = cleanMapper.map(moped, Bus.class);
    assertEquals("injectedName", bus.getName());

    // map back
    Moped mopedDest = cleanMapper.map(bus, Moped.class);
    assertEquals("injectedName", mopedDest.getName());
  }
View Full Code Here

Examples of org.gstreamer.Bus

        for (String s : args) {
            System.out.println("Leftover arg=" + s);
        }
        player = new PlayBin2("Example Player");
        player.setInputFile(new File(args[0]));
        Bus bus = player.getBus();
        tags = new TagList();
        bus.connect(new Bus.TAG() {
            public void tagsFound(GstObject source, TagList tagList) {
                System.out.println("Got TAG event");
                for (String tag : tagList.getTagNames()) {
                    System.out.println("Tag " + tag + " = " + tagList.getValue(tag, 0));
                }
                tags = tags.merge(tagList, TagMergeMode.APPEND);
            }
        });
        bus.connect(new Bus.ERROR() {
            public void errorMessage(GstObject source, int code, String message) {
                System.out.println("Error: code=" + code + " message=" + message);
            }
        });
       
View Full Code Here

Examples of org.javatari.atari.board.BUS

  protected void mainComponentsCreate() {
    cpu = new M6502();
    tia = new TIA();
    pia = new PIA();
    ram = new RAM();
    bus = new BUS(cpu, tia, pia, ram);
  }
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.