Package de.justi.yagw2api.analyzer.impl

Examples of de.justi.yagw2api.analyzer.impl.WorldEntityDAO


    assertFalse(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test4").isPresent());
  }

  @Test
  public void testRetrieveAllWorldEntities() {
    final WorldEntityDAO dao = new WorldEntityDAO();

    assertTrue(dao.retrieveAllWorldEntities().size() == 0);
    assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 3);
    assertTrue(dao.newWorldEntityOf(this.world4).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 4);
  }
View Full Code Here


  }

  @Test
  public void testSearchWorldEntityByNamePart() {

    final WorldEntityDAO dao = new WorldEntityDAO();

    assertTrue(dao.retrieveAllWorldEntities().size() == 0);
    assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world4).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 4);
    final int resultCount = dao.searchWorldEntityByNamePart("est").size();
    assertEquals(3, resultCount);
  }
View Full Code Here

    assertEquals(3, resultCount);
  }

  @Test
  public void testFindWorldEntityByOriginId() {
    final WorldEntityDAO dao = new WorldEntityDAO();
    assertTrue(dao.retrieveAllWorldEntities().size() == 0);
    assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world4).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 4);
    assertTrue(dao.findWorldEntityByOriginId(2000).isPresent());
    assertEquals(dao.findWorldEntityById(4).get(), dao.findWorldEntityByOriginId(2000).get());
    assertFalse(dao.findWorldEntityByOriginId(3000).isPresent());
  }
View Full Code Here

    assertFalse(dao.findWorldEntityByOriginId(3000).isPresent());
  }

  @Test
  public void testFindWorldEntityOf() {
    final WorldEntityDAO dao = new WorldEntityDAO();
    assertTrue(dao.retrieveAllWorldEntities().size() == 0);
    assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 3);
    assertTrue(dao.findWorldEntityOf(this.world1).isPresent());
    assertEquals(dao.findWorldEntityById(1).get(), dao.findWorldEntityOf(this.world1).get());
    assertTrue(dao.findWorldEntityOf(this.world2).isPresent());
    assertEquals(dao.findWorldEntityById(2).get(), dao.findWorldEntityOf(this.world2).get());
    assertTrue(dao.findWorldEntityOf(this.world3).isPresent());
    assertEquals(dao.findWorldEntityById(3).get(), dao.findWorldEntityOf(this.world3).get());
    assertFalse(dao.findWorldEntityOf(this.world4).isPresent());
  }
View Full Code Here

    assertFalse(dao.findWorldEntityOf(this.world4).isPresent());
  }

  @Test
  public void testFindOrCreateWorldEntityOf() {
    final WorldEntityDAO dao = new WorldEntityDAO();
    assertTrue(dao.retrieveAllWorldEntities().size() == 0);
    assertNotNull(dao.findOrCreateWorldEntityOf(this.world1));
    assertTrue(dao.retrieveAllWorldEntities().size() == 1);
    assertNotNull(dao.findOrCreateWorldEntityOf(this.world1));
    assertTrue(dao.retrieveAllWorldEntities().size() == 1);
    assertEquals(dao.findOrCreateWorldEntityOf(this.world1), dao.findOrCreateWorldEntityOf(this.world1));
    assertTrue(dao.retrieveAllWorldEntities().size() == 1);
  }
View Full Code Here

    this.world4 = this.modelFactory.newWorldBuilder().id(2000).name("abc").worldLocation(WorldLocationType.NORTH_AMERICA).build();
  }

  @Test
  public void testNewWorldEntityAndFindWorldEntityById() {
    final WorldEntityDAO dao = new WorldEntityDAO();

    assertTrue(dao.retrieveAllWorldEntities().size() == 0);
    assertFalse(dao.findWorldEntityById(1).isPresent());
    assertFalse(dao.findWorldEntityById(2).isPresent());
    assertFalse(dao.findWorldEntityById(3).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 1);
    assertTrue(dao.findWorldEntityById(1).isPresent());
    assertFalse(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.findWorldEntityById(1).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 1);
    assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 2);
    assertTrue(dao.findWorldEntityById(3).isPresent());
    assertFalse(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.findWorldEntityById(3).isPresent());
    assertTrue(dao.retrieveAllWorldEntities().size() == 2);
    assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.findWorldEntityById(5).isPresent());
    assertFalse(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.findWorldEntityById(5).isPresent());

  }
View Full Code Here

  }

  @Test
  public void testFindWorldEntityByName() {
    final WorldEntityDAO dao = new WorldEntityDAO();

    assertFalse(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test").isPresent());
    assertFalse(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test2").isPresent());
    assertFalse(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test3").isPresent());
    assertFalse(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test4").isPresent());
    assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
    assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
    assertTrue(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test").isPresent());
    assertTrue(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test2").isPresent());
    assertTrue(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test3").isPresent());
    assertFalse(dao.findWorldEntityByName(YAGW2APIArenanet.INSTANCE.getCurrentLocale(), "test4").isPresent());
  }
View Full Code Here

TOP

Related Classes of de.justi.yagw2api.analyzer.impl.WorldEntityDAO

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.