Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.Person


  /**
   * @throws Exception
   */
  @Test
  public void testIsAuthorChange() throws Exception {
    IPerson author1 = new Person((Long) null);
    author1.setName("Foo");

    IPerson author2 = new Person((Long) null);
    author2.setName("Bar");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.setAuthor(author1);

View Full Code Here


   * person - That UPDATE event is issued - Getting of person
   */
  @Test
  public void testAddUpdateAndGetPerson() {
    IFeed feed = createFeed();
    final Person initialJohn = (Person) createPersonJohn(feed);
    final Person[] updatedJohn = new Person[1];
    final boolean[] personAddedCalled = new boolean[] { false };
    final boolean[] personUpdatedCalled = new boolean[] { false };
    PersonListener personListener = null;
    try {
      personListener = new PersonAdapter() {
        @Override
        public void entitiesAdded(Set<PersonEvent> events) {
          for (PersonEvent event : events) {
            personAddedCalled[0] = true;
            Person dbPerson = (Person) event.getEntity();
            initialJohn.setId(dbPerson.getId());
            assertTrue(initialJohn.isIdentical(dbPerson));
          }
        }

        @Override
        public void entitiesUpdated(Set<PersonEvent> events) {
          PersonEvent event = events.iterator().next();
          personUpdatedCalled[0] = true;
          Person dbPerson = (Person) event.getEntity();
          assertTrue(updatedJohn[0].isIdentical(dbPerson));
        }
      };
      DynamicDAO.addEntityListener(IPerson.class, personListener);
      long savedJohnId = DynamicDAO.save(initialJohn).getId().longValue();
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.Person

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.