Examples of AddressBook


Examples of addressbook.wsifservice.AddressBook

          null,                                           // serviceNS
          null,                                           // serviceName
          "http://wsifservice.addressbook/", // portTypeNS
          "AddressBook");                                 // portTypeName

        AddressBook stub=(AddressBook)service.getStub(server+"Port", AddressBook.class);

        stub.addEntry(name1, addr1);
        Address resp1 = stub.getAddressFromName (name1);
        assertTrue(new AddressUtility(addr1).equals(resp1));
        assertTrue(expectedException==null);
       
      }
      catch (Exception e)
View Full Code Here

Examples of addressbook.wsifservice.AddressBook

            WSIFService service = factory.getService(wsdlLocation, null, // serviceNS
               null, // serviceName
               "http://wsifservice.addressbook/", // portTypeNS
               "AddressBook" ); // portTypeName

            AddressBook abStub = (AddressBook) service.getStub(portName, AddressBook.class);

            abStub.addEntry(name1, addr1);
            abStub.addEntry(firstName2, lastName2, addr2);

            Address resp1 = abStub.getAddressFromName(name1);
            assertTrue(new AddressUtility(addr1).equals(resp1));

            Address resp2 = abStub.getAddressFromName(firstName2 + " " + lastName2);
            assertTrue(new AddressUtility(addr2).equals(resp2));
           
            if (TestUtilities.areWeTesting("async")) {
              testAsyncOPs( service, portName, name1, addr1 );
              testAsyncOPs( service, portName, firstName2 + " " + lastName2, addr2 );
View Full Code Here

Examples of addressbook.wsifservice.AddressBook

                                "- not configured to use " + server + " port ");
                            continue;
                        }
                       
                        System.out.println(" - I like this port, I think I'll use it!");
                        AddressBook abStub = (AddressBook) service.getStub(p, AddressBook.class);

                        abStub.addEntry(name1, addr1);
                        abStub.addEntry(firstName2, lastName2, addr2);

                        Address resp1 = abStub.getAddressFromName(name1);
                        assertTrue(new AddressUtility(addr1).equals(resp1));

                        Address resp2 = abStub.getAddressFromName(firstName2 + " " + lastName2);
                        assertTrue(new AddressUtility(addr2).equals(resp2));
                    }
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of addressbook.wsifservice.AddressBook

        if (!TestUtilities.areWeTesting("jndi"))
            return;
        try {
            InitialContext ic = new InitialContext();

            AddressBook abStub =
                (AddressBook) ic.lookup("comp/env/wsif/addressservicestub");

            abStub.addEntry(name1, addr1);
            abStub.addEntry(firstName2, lastName2, addr2);

            Address resp1 = abStub.getAddressFromName(name1);
            assertTrue(new AddressUtility(addr1).equals(resp1));

            Address resp2 = abStub.getAddressFromName(firstName2 + " " + lastName2);
            assertTrue(new AddressUtility(addr2).equals(resp2));
        } catch (Exception e) {
            System.err.println(
                "JNDIAddressBookTest(" + portName + ") caught exception " + e);
            e.printStackTrace();
View Full Code Here

Examples of com.example.tutorial.AddressBookProtos.AddressBook

      System.err.println("Usage:  ListPeople ADDRESS_BOOK_FILE");
      System.exit(-1);
    }

    // Read the existing address book.
    AddressBook addressBook =
      AddressBook.parseFrom(new FileInputStream(args[0]));

    Print(addressBook);
  }
View Full Code Here

Examples of com.twitter.data.proto.tutorial.AddressBookProtos.AddressBook

  }

  @Test
  public final void testDeserializer() throws SerDeException {
    BytesWritable serialized = new BytesWritable(test_ab.toByteArray());
    AddressBook ab2 = (AddressBook) deserializer.deserialize(serialized);
    assertTrue(test_ab.equals(ab2));
  }
View Full Code Here

Examples of com.twitter.data.proto.tutorial.AddressBookProtos.AddressBook

    DataInputStream dis = new DataInputStream(new FileInputStream("test.txt"));
    TypedProtobufWritable<AddressBook> after = new TypedProtobufWritable<AddressBook>();
    after.readFields(dis);
    dis.close();

    AddressBook ab2 = after.get();
    assertEquals(referenceAb, ab2);
    assertEquals(referenceAbWritable.hashCode(), after.hashCode());
  }
View Full Code Here

Examples of com.twitter.data.proto.tutorial.AddressBookProtos.AddressBook

    DataInputStream dis = new DataInputStream(new FileInputStream("test2.txt"));
    TypedProtobufWritable<Message> after = new TypedProtobufWritable<Message>();
    after.readFields(dis);
    dis.close();

    AddressBook ab2 = (AddressBook) after.get();
    assertEquals(referenceAb, ab2);
    assertEquals(referenceAbWritable.hashCode(), after.hashCode());
  }
View Full Code Here

Examples of com.twitter.data.proto.tutorial.AddressBookProtos.AddressBook

    DataInputStream dis = new DataInputStream(new FileInputStream("test3.txt"));
    TypedProtobufWritable<Message> after = new TypedProtobufWritable<Message>();
    after.readFields(dis);
    dis.close();

    AddressBook ab2 = (AddressBook) after.get();
    assertNull(ab2);
  }
View Full Code Here

Examples of com.twitter.data.proto.tutorial.AddressBookProtos.AddressBook

    DataInputStream dis = new DataInputStream(new FileInputStream("test.txt"));
    ProtobufWritable<AddressBook> after = new ProtobufWritable<AddressBook>(new TypeRef<AddressBook>(){});
    after.readFields(dis);
    dis.close();

    AddressBook ab2 = after.get();
    assertEquals(referenceAb, ab2);
    assertEquals(referenceAbWritable.hashCode(), after.hashCode());
  }
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.