Examples of Person


Examples of org.apache.openjpa.persistence.simple.Person

            //
            // Create some entities
            //
            em.getTransaction().begin();
            for (int i = 0; i < nPeople; i++) {
                Person p = new Person();
                p.setId(i);
                em.persist(p);
            }
            em.flush();
            em.getTransaction().commit();
            em.close();

            Thread[] newThreads = new Thread[nThreads];
            FindPeople[] customer = new FindPeople[nThreads];
            for (int i=0; i < nThreads; i++) {
                customer[i] = new FindPeople(emfac, 0, nPeople, nIterations, i);
                newThreads[i] = new Thread(customer[i]);
                newThreads[i].start();
            }

            //
            // Wait for the worker threads to complete
            //
            for (int i = 0; i < nThreads; i++) {
                try {
                    newThreads[i].join();
                }
                catch (InterruptedException e) {
                    this.fail("Caught Interrupted Exception: " + e);
                }
            }  

            //
            // Run through the state of all runnables to assert if any of them failed.
            //
            for (int i = 0; i < nThreads; i++) {
                assertFalse(customer[i].hadFailures());
            }

            //
            // Clean up the entities used in this test
            //
            em = emfac.createEntityManager();           
            em.getTransaction().begin();
            for (int i = 0; i < nPeople; i++) {
                Person p = em.find(Person.class, i);
                em.remove(p);
            }
            em.flush();
            em.getTransaction().commit();
            em.close();
View Full Code Here

Examples of org.apache.rave.model.Person

    public void proxyAdd() {
        List<ModelConverter> converters = new ArrayList<ModelConverter>();
        ModelConverter converterMock = createMock(ModelConverter.class);
        expect(converterMock.getSourceType()).andReturn(Person.class).anyTimes();
        converters.add(converterMock);
        Person personImpl1 = new PersonImpl();
        PersonImpl personImpl2 = new PersonImpl();
        expect(converterMock.convert(personImpl1)).andReturn(personImpl2);
        replay(converterMock);
        List<PersonImpl> underlying = createMock(List.class);
        expect(underlying.add(personImpl2)).andReturn(true);
View Full Code Here

Examples of org.apache.rave.opensocial.model.Person

    @Autowired
    private PersonRepository repository;

    @Test
    public void findByUsername_valid() {
        Person person = repository.findByUsername(VALID_USER);
        assertThat(person, is(not(nullValue())));
        assertThat(person.getUsername(), is(equalTo(VALID_USER)));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.Person

        assertThat(p.getUsername(), is(VALID_USER));
    }

    @Test
    public void findByUsername_valid() {
        Person person = repository.findByUsername(VALID_USER);
        assertThat(person, is(not(nullValue())));
        assertThat(person.getUsername(), is(equalTo(VALID_USER)));
    }
View Full Code Here

Examples of org.apache.rave.rest.model.Person

    @Override
    public Response getPerson(String id) {
        org.apache.rave.model.Person person = userService.getUserById(id);
        if (person != null) {
            return Response.ok(new Person(person)).build();
        } else {
            return Response.status(Response.Status.NOT_FOUND).build();
        }
    }
View Full Code Here

Examples of org.apache.servicemix.examples.camel.rest.model.Person


    public static void main(String[] args) {
        Client client = new Client();
        try {
            client.postPerson(new Person(1,"John Smith",21));
            client.getPerson(1);
            client.deletePerson(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of org.apache.servicemix.examples.camel.soap.model.Person


    public static void main(String[] args) throws MalformedURLException {
        Client client = new Client();
        try {
            client.postPerson(new Person(1,"John Smith",21));
            client.getPerson(1);
            client.deletePerson(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of org.apache.servicemix.samples.wsdl_first.Person

        QName serviceName = new QName("http://servicemix.apache.org/samples/wsdl-first",
                "PersonService");
        URL wsdlUrl = CxfBcFaultTest.class.getClassLoader().getResource(
                "org/apache/servicemix/cxfbc/fault/person.wsdl");
        PersonService service = new PersonService(wsdlUrl, serviceName);
        Person person = service.getSoap();
        Holder<String> personId = new Holder<String>();
        Holder<String> ssn = new Holder<String>();
        Holder<String> name = new Holder<String>();
        personId.value = "";
        try {
            person.getPerson(personId, ssn, name);
            fail();
        } catch (UnknownPersonFault e) {
            //should catch this Fault
        }
    }
View Full Code Here

Examples of org.apache.shindig.social.opensocial.model.Person

        }
    }

    private void populatePerson(Map<String, Person> peopleById, ActivityStreamsObject actor) {
        String id = actor.getId();
        Person person = peopleById.containsKey(id) ? peopleById.get(id) : getPerson(id);
        if(person != null) {
            peopleById.put(id, person);
            actor.setUrl(person.getProfileUrl());
            actor.setDisplayName(person.getDisplayName());
            ActivityStreamsMediaLinkImpl image = new ActivityStreamsMediaLinkImpl();
            image.setUrl(person.getThumbnailUrl());
            actor.setImage(image);
        }
    }
View Full Code Here

Examples of org.apache.sirona.jpa.entity.Person

                final EntityManager em = emf.createEntityManager();
                try {
                    final EntityTransaction transaction = em.getTransaction();
                    transaction.begin();
                    try {
                        final Person p = new Person();
                        p.setName("sirona");

                        em.persist(p);
                        transaction.commit();
                    } catch (final Exception e) {
                        transaction.rollback();
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.