Package com.mockey.storage

Examples of com.mockey.storage.InMemoryMockeyStorage


   * appears 2 times, in type Scenario and Service
   */
  @Test
  public void validateSearchResultByName() {

    IMockeyStorage store = new InMemoryMockeyStorage();
    Service a = new Service();
    a.setServiceName("Service A");
    Scenario aScenario = new Scenario();
    aScenario.setScenarioName("Service Scenario A");
    a.saveOrUpdateScenario(aScenario);
    store.saveOrUpdateService(a);

    String term = "scenario";
    SearchResultBuilder resultBuilder = new SearchResultBuilder();
    List<SearchResult> resultList = resultBuilder.buildSearchResults(term,
        store);
View Full Code Here


   * appears 2 times, in type Scenario and Service
   */
  @Test
  public void validateSearchResultScenarioContent() {

    IMockeyStorage store = new InMemoryMockeyStorage();
    Service a = new Service();
    a.setServiceName("Service A");
    Scenario aScenario = new Scenario();
    aScenario.setScenarioName("Scenario A");
    aScenario.setResponseMessage("lorem ipsum");
    a.saveOrUpdateScenario(aScenario);
    store.saveOrUpdateService(a);

    String term = "cats";
    SearchResultBuilder resultBuilder = new SearchResultBuilder();
    List<SearchResult> resultList = resultBuilder.buildSearchResults(term,
        store);

    assert (resultList.size() == 0) : "Length should be 0 but was "
        + resultList.size();

    term = "  lorem   ";
    resultBuilder = new SearchResultBuilder();
    resultList = resultBuilder.buildSearchResults(term, store);
    assert (resultList.size() == 1) : "Length should be: 1 " + " but was '"
        + resultList.size() + "'";
    assert (resultList.get(0).getType() == SearchResultType.SERVICE_SCENARIO) : "Search type result should be 'scenario' but was '"
        + resultList.get(0).getType().toString() + "'";

    aScenario = new Scenario();
    aScenario.setScenarioName("Scenario B");
    aScenario.setResponseMessage("lorem ipsula");
    a.saveOrUpdateScenario(aScenario);
    store.saveOrUpdateService(a);

    term = "  lorem   ";
    resultBuilder = new SearchResultBuilder();
    resultList = resultBuilder.buildSearchResults(term, store);
    // We should have TWO scenarios with 'lorem' in content/
View Full Code Here

   * appears 2 times, in type Scenario and Service
   */
  @Test
  public void validateSearchResultByServiceTag() {

    IMockeyStorage store = new InMemoryMockeyStorage();
    Service a = new Service();
    a.setServiceName("Service A");
    a.setTag("   tagCC");
    store.saveOrUpdateService(a);

    String term = "cats";
    SearchResultBuilder resultBuilder = new SearchResultBuilder();
    List<SearchResult> resultList = resultBuilder.buildSearchResults(term,
        store);
View Full Code Here

   * appears 2 times, in type Scenario and Service
   */
  @Test
  public void validateSearchResultByServicePlanTag() {

    IMockeyStorage store = new InMemoryMockeyStorage();
    Service a = new Service();
    a.setServiceName("Service A");
    a.setTag("   tagCC");
    store.saveOrUpdateService(a);
   
    ServicePlan servicePlan = new ServicePlan();
    servicePlan.setName("ServicePlan A");
    servicePlan.setTag("service_plan_tag_123");
    store.saveOrUpdateServicePlan(servicePlan);
   
    String term = "cats";
    SearchResultBuilder resultBuilder = new SearchResultBuilder();
    List<SearchResult> resultList = resultBuilder.buildSearchResults(term,
        store);
View Full Code Here

TOP

Related Classes of com.mockey.storage.InMemoryMockeyStorage

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.