Examples of PersonServiceImpl


Examples of au.com.motodetail.base.junk.PersonServiceImpl

    {
        log.warn("ItemBean::PrepareViewAction params: " + "immediateAction: " + immediateAction + " immediateUrl: " + immediateUrl + " returnAction: " + returnAction + " returnUrl: " + returnUrl);
        this.returnUrl = returnUrl;
        this.returnAction = returnAction;
        List<PersonEntity> personFetchList = new ArrayList<PersonEntity>();
        IPersonService personService = new PersonServiceImpl();

        switch(EntityAction.valueOf(immediateAction))
        {
            case CREATE:
                PostViewAction(immediateAction, null);
                break;

            case READ_ALL:
                try
                {
                    //TODO: fetch 20 then next 20 ...etc Customize retrieveQuickAll by adding range
                    this.setItemList(itemService.retrieveQuickAll());
                }
                catch (Exception ex)
                {
                    java.util.logging.Logger.getLogger(PersonBean.class.getName()).log(Level.SEVERE, null, ex);
                    //TODO: generate JSF Error ...
                }
                break;

            case UPDATE_ROLE:
                //clear selected lists
                this.selectedAvailableSavedRoles.clear();
                this.selectedSavedRoles.clear();

                //1. obtain all roles in the system
                //1.1. person role
               
                try
                {
                    //TODO: fetch 20 then next 20 ...etc Customize retrieveQuickAll by adding range
                    personFetchList = personService.getAll();
                }
                catch (Exception ex)
                {
                    java.util.logging.Logger.getLogger(PersonBean.class.getName()).log(Level.SEVERE, null, ex);
                    //TODO: generate JSF Error ...
View Full Code Here

Examples of net.lr.tutorial.karaf.cxf.personrest.impl.PersonServiceImpl

    private static final String PERSONSERVICE_TESTURL = "http://localhost:8282/person";
    private static Server server;

    @BeforeClass
    public static void startServer() {
        PersonService personService = new PersonServiceImpl();;
        JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
        factory.setAddress(PERSONSERVICE_TESTURL);
        factory.setServiceBean(personService);
        server = factory.create();
        server.start();
View Full Code Here

Examples of net.lr.tutorial.karaf.db.examplejpa.impl.PersonServiceImpl

        InitialContext ic = new InitialContext();
        EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("target/test");
        ds.setCreateDatabase("create");
        ic.bind("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/derbyds)", ds);
        PersonServiceImpl personService = new PersonServiceImpl();
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
        EntityManager em = emf.createEntityManager();
        personService.setEntityManager(em);
        em.getTransaction().begin();
        personService.deleteAll();
        personService.add(new Person("Christian Schneider", "@schneider_chris"));
        em.getTransaction().commit();
        List<Person> persons = personService.getAll();
        Assert.assertEquals(1, persons.size());
        Assert.assertEquals("Christian Schneider", persons.get(0).getName());
        Assert.assertEquals("@schneider_chris", persons.get(0).getTwitterName());
    }
View Full Code Here

Examples of net.lr.tutorial.karaf.db.examplejpa.impl.PersonServiceImpl

        InitialContext ic = new InitialContext();
        EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("target/test");
        ds.setCreateDatabase("create");
        ic.bind("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/derbyds)", ds);
        PersonServiceImpl personService = new PersonServiceImpl();
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
        EntityManager em = emf.createEntityManager();
        personService.setEntityManager(em);
        em.getTransaction().begin();
        personService.deleteAll();
        personService.add(new Person("Christian Schneider", "@schneider_chris"));
        em.getTransaction().commit();
        List<Person> persons = personService.getAll();
        Assert.assertEquals(1, persons.size());
        Assert.assertEquals("Christian Schneider", persons.get(0).getName());
        Assert.assertEquals("@schneider_chris", persons.get(0).getTwitterName());
    }
View Full Code Here

Examples of org.codehaus.enunciate.samples.genealogy.jaxws_client.services.impl.PersonServiceImpl

    catch (ServiceException e) {
      Assert.assertEquals("unknown source id", e.getMessage());
      Assert.assertEquals("anyhow", e.getAnotherMessage());
    }

    PersonService personService = new PersonServiceImpl("http://localhost:" + port + "/" + context + "/soap-services/PersonServiceService", new MTOMFeature());
    ArrayList<String> ids = new ArrayList<String>(Arrays.asList("id1", "id2", "id3", "id4"));
    Collection persons = personService.readPersons(ids);
    for (Object o : persons) {
      Person person = (Person) o;
      assertTrue(ids.remove(person.getId()));
      Assert.assertEquals(new Date(1L), ((Event) person.getEvents().iterator().next()).getDate());
    }

    Collection<Person> empty = personService.readPersons(null);
    assertTrue(empty == null || empty.isEmpty());

    personService.deletePerson("somebody");
    try {
      personService.deletePerson(null);
      fail("Should have thrown the exception.");
    }
    catch (ServiceException e) {
      Assert.assertEquals("a person id must be supplied", e.getMessage());
      Assert.assertEquals("no person id.", e.getAnotherMessage());
    }

    Person person = new Person();
    person.setId("new-person");
    Assert.assertEquals("new-person", personService.storePerson(person).getId());

    byte[] pixBytes = "this is a bunch of bytes that I would like to make sure are serialized correctly so that I can prove out that attachments are working properly".getBytes();
    person.setPicture(new DataHandler(new ByteArrayDataSource(pixBytes, "image/jpeg")));

    DataHandler returnedPix = personService.storePerson(person).getPicture();
    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    InputStream inputStream = returnedPix.getInputStream();
    int byteIn = inputStream.read();
    while (byteIn > -1) {
      bytesOut.write(byteIn);
View Full Code Here

Examples of org.codehaus.enunciate.samples.genealogy.jaxws_client.services.impl.PersonServiceImpl

    catch (ServiceException e) {
      Assert.assertEquals("unknown source id", e.getMessage());
      Assert.assertEquals("anyhow", e.getAnotherMessage());
    }

    PersonService personService = new PersonServiceImpl("http://localhost:" + port + "/" + context + "/soap-services/PersonServiceService", new MTOMFeature());
    ArrayList<String> ids = new ArrayList<String>(Arrays.asList("id1", "id2", "id3", "id4"));
    Collection persons = personService.readPersons(ids);
    for (Object o : persons) {
      Person person = (Person) o;
      assertTrue(ids.remove(person.getId()));
      Assert.assertEquals(new Date(1L), ((Event) person.getEvents().iterator().next()).getDate());
    }

    Collection<Person> empty = personService.readPersons(null);
    assertTrue(empty == null || empty.isEmpty());

    personService.deletePerson("somebody");
    try {
      personService.deletePerson(null);
      fail("Should have thrown the exception.");
    }
    catch (ServiceException e) {
      Assert.assertEquals("a person id must be supplied", e.getMessage());
      Assert.assertEquals("no person id.", e.getAnotherMessage());
View Full Code Here

Examples of org.codehaus.enunciate.samples.genealogy.jaxws_client.services.impl.PersonServiceImpl

    catch (ServiceException e) {
      assertEquals("unknown source id", e.getMessage());
      assertEquals("anyhow", e.getAnotherMessage());
    }

    PersonService personService = new PersonServiceImpl("http://localhost:" + port + "/" + context + "/soap-services/PersonServiceService");
    ArrayList<String> ids = new ArrayList<String>(Arrays.asList("id1", "id2", "id3", "id4"));
    Collection persons = personService.readPersons(ids);
    for (Object o : persons) {
      Person person = (Person) o;
      assertTrue(ids.remove(person.getId()));
      assertEquals(new Date(1L), ((Event) person.getEvents().iterator().next()).getDate());
    }

    Collection<Person> empty = personService.readPersons(null);
    assertTrue(empty == null || empty.isEmpty());

    personService.deletePerson("somebody", "my message");
    try {
      personService.deletePerson(null, null);
      fail("Should have thrown the exception.");
    }
    catch (ServiceException e) {
      assertEquals("a person id must be supplied", e.getMessage());
      assertEquals("no person id.", e.getAnotherMessage());
    }

    Person person = new Person();
    person.setId("new-person");
    assertEquals("new-person", personService.storePerson(person).getId());

    byte[] pixBytes = "this is a bunch of bytes that I would like to make sure are serialized correctly so that I can prove out that attachments are working properly".getBytes();
    person.setPicture(new DataHandler(new ByteArrayDataSource(pixBytes, "image/jpeg")));

    DataHandler returnedPix = personService.storePerson(person).getPicture();
    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    InputStream inputStream = returnedPix.getInputStream();
    int byteIn = inputStream.read();
    while (byteIn > -1) {
      bytesOut.write(byteIn);
      byteIn = inputStream.read();
    }

    RootElementMapAdapted map = new RootElementMapAdapted();
    ArrayList<RootElementMapAdaptedEntry> entries = new ArrayList<RootElementMapAdaptedEntry>();
    RootElementMapAdaptedEntry entry1 = new RootElementMapAdaptedEntry();
    entry1.setKey("person1");
    RootElementMapAdaptedValue value1 = new RootElementMapAdaptedValue();
    Person person1 = new Person();
    person1.setId("person1id");
    value1.setValue(Arrays.asList((Object) person1));
    entry1.setValue(value1);
    entries.add(entry1);

    RootElementMapAdaptedEntry entry2 = new RootElementMapAdaptedEntry();
    entry2.setKey("person2");
    RootElementMapAdaptedValue value2 = new RootElementMapAdaptedValue();
    Person person2 = new Person();
    person2.setId("person2id");
    value2.setValue(Arrays.asList((Object) person2));
    entry2.setValue(value2);
    entries.add(entry2);

    RootElementMapAdaptedEntry entry3 = new RootElementMapAdaptedEntry();
    entry3.setKey("source1");
    RootElementMapAdaptedValue value3 = new RootElementMapAdaptedValue();
    Source source1 = new Source();
    source1.setId("source1id");
    value3.setValue(Arrays.asList((Object) source1));
    entry3.setValue(value3);
    entries.add(entry3);

    RootElementMapAdaptedEntry entry4 = new RootElementMapAdaptedEntry();
    entry4.setKey("source2");
    RootElementMapAdaptedValue value4 = new RootElementMapAdaptedValue();
    Source source2 = new Source();
    source2.setId("source2id");
    value4.setValue(Arrays.asList((Object) source2));
    entry4.setValue(value4);
    entries.add(entry4);
    map.setEntry(entries);
    RootElementMapWrapper wrapper = new RootElementMapWrapper();
    wrapper.setMap(map);
    wrapper = personService.storeGenericProperties(wrapper);
    RootElementMapAdapted retVal = wrapper.getMap();
    assertNotNull(retVal.getEntry());
    assertEquals(4, retVal.getEntry().size());
//    assertTrue(retVal.getEntry().get(0).getValue().getValue() instanceof Person);
//    assertTrue(retVal.getEntry().get(1).getValue().getValue() instanceof Person);
View Full Code Here

Examples of org.codehaus.enunciate.samples.genealogy.jaxws_client.services.impl.PersonServiceImpl

    catch (ServiceException e) {
      assertEquals("unknown source id", e.getMessage());
      assertEquals("anyhow", e.getAnotherMessage());
    }

    PersonService personService = new PersonServiceImpl("http://localhost:" + port + "/" + context + "/soap-services/PersonServiceService");
    ArrayList<String> ids = new ArrayList<String>(Arrays.asList("id1", "id2", "id3", "id4"));
    Collection persons = personService.readPersons(ids);
    for (Object o : persons) {
      Person person = (Person) o;
      assertTrue(ids.remove(person.getId()));
      assertEquals(new Date(1L), ((Event) person.getEvents().iterator().next()).getDate());
    }

    Collection<Person> empty = personService.readPersons(null);
    assertTrue(empty == null || empty.isEmpty());

    personService.deletePerson("somebody");
    try {
      personService.deletePerson(null);
      fail("Should have thrown the exception.");
    }
    catch (ServiceException e) {
      assertEquals("a person id must be supplied", e.getMessage());
      assertEquals("no person id.", e.getAnotherMessage());
    }
    try {
      personService.deletePerson("SPECIAL");
      fail("should have thrown an exception.");
    }
    catch (Exception e) {
      assertTrue(e.getMessage().contains("SPECIAL"));
    }

    Person person = new Person();
    person.setId("new-person");
    assertEquals("new-person", personService.storePerson(person).getId());

    byte[] pixBytes = "this is a bunch of bytes that I would like to make sure are serialized correctly so that I can prove out that attachments are working properly".getBytes();
    person.setPicture(new DataHandler(new ByteArrayDataSource(pixBytes, "image/jpeg")));

    DataHandler returnedPix = personService.storePerson(person).getPicture();
    ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
    InputStream inputStream = returnedPix.getInputStream();
    int byteIn = inputStream.read();
    while (byteIn > -1) {
      bytesOut.write(byteIn);
View Full Code Here

Examples of org.zkybase.service.impl.PersonServiceImpl

  /**
   * @throws Exception
   */
  @Before
  public void setUp() throws Exception {
    this.personService = new PersonServiceImpl();
   
    MockitoAnnotations.initMocks(this);
   
    when(personRepo.findOne(anyLong())).thenReturn(person);
    when(personRepo.findAll()).thenReturn(people);
View Full Code Here

Examples of service.advanced.PersonServiceImpl

        } catch (Throwable ex) {
          throw new RuntimeException(ex);
        }
       
       
        PersonServiceImpl personService = new PersonServiceImpl();
        personService.setStorage(storage);
        classes.add(personService);

        SearchService searchService = new SearchService();
        searchService.setStorage(storage);
        classes.add(searchService);
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.