예제 #1
0
  @Test
  public void invalidStateID() throws Exception {
    State state = com.ajr.rhrn.database.Util.getState(connection, "California");
    City city = com.ajr.rhrn.database.Util.getCity(connection, "sacramento");

    Member member =
        rhrn.createMember(
            com.ajr.rhrn.Properties.testingBypass,
            com.ajr.rhrn.Properties.testingBypass,
            getValidUsername(),
            getValidPassword());

    rhrn.createListing(
        member.getID(),
        member.getUsername(),
        member.getPassword(),
        state.getID(),
        state.getName(),
        city.getID(),
        city.getName(),
        getValidTitle(),
        getValidActivity(),
        getValidLocation(),
        getValidIdentifier(),
        com.ajr.rhrn.Properties.minDuration,
        com.ajr.rhrn.Properties.minDelay);
    Thread.sleep(1500);

    List<Listing> listings = rhrn.getListings(-44, 0);

    assertTrue(listings.size() == 0);
  }
예제 #2
0
  @Before
  public void runBeforeEveryTest() throws Exception {
    HessianProxyFactory factory = new HessianProxyFactory();
    rhrn = (RHRN) factory.create(RHRN.class, Properties.hessianTestURL);

    Class.forName(Properties.dbDriver);
    connection =
        DriverManager.getConnection(
            Properties.dbTestURL, Properties.dbUsername, Properties.dbPassword);

    cache =
        new MemcachedClient(
            new InetSocketAddress(Properties.memcachedServer, Properties.memcachedPort));

    Util.deleteAllMembers(connection);
    Util.deleteAllListings(connection);

    com.ajr.rhrn.database.Util.flushMemcached(cache);
  }