Package com.mockey.model

Examples of com.mockey.model.ConflictInfo$Conflict


   * @param tagFilter
   * @param store
   * @return
   */
  public ConflictInfo getConflictInfo(List<Service> serviceList) {
    ConflictInfo conflictInfo = new ConflictInfo();

    for (Service serviceA : serviceList) {

      // Check for conflicts with other services
      for (Service serviceB : serviceList) {

        // Don't compare Service to itself!
        if (!serviceA.getId().equals(serviceB.getId())) {

          // NAME
          if (MockeyXmlFileManager.getSafeForFileSystemName(serviceA.getServiceName()).equals(
              MockeyXmlFileManager.getSafeForFileSystemName(serviceB.getServiceName()))) {
            conflictInfo.addConflict(serviceA, serviceB, "Service with name'" + serviceA.getServiceName()
                + "' compared to service with name: '" + serviceB.getServiceName() + "'. Info: " + MATCH_NAME);
          }

          // REAL URLs
          for (Url urlA : serviceA.getRealServiceUrls()) {
            for (Url urlB : serviceB.getRealServiceUrls()) {
              if (urlA.equals(urlB)) {
                conflictInfo.addConflict(serviceA, serviceB, MATCH_REAL_URL);
              }
            }
          }

          // SAME MOCK URL
          if (serviceA.getUrl() != null && serviceA.getUrl().equals(serviceB.getUrl())) {
            conflictInfo.addConflict(serviceA, serviceB, MATCH_MOCK_URL);
          }

        }
      }

      // Check for conflicts with
      for (Scenario scenarioA : serviceA.getScenarios()) {
        for (Scenario scenarioB : serviceA.getScenarios()) {

          if (scenarioA.hasSameNameAndResponse(scenarioB) && !scenarioA.getId().equals(scenarioB.getId())) {
            conflictInfo.addConflict(serviceA, serviceA, MATCH_SCENARIO);
          }
        }
      }

    }
View Full Code Here


    String filterTagArg = store.getGlobalStateSystemFilterTag();
    FilterHelper filterHelper = new FilterHelper();
    List<Service> filteredServiceList = filterHelper.getFilteredServices(filterTagArg, store);

    ConflictHelper conflictHelper = new ConflictHelper();
    ConflictInfo conflictInfo = conflictHelper.getConflictInfo(filteredServiceList);
    req.setAttribute("services", filteredServiceList);
    req.setAttribute("conflictInfo", conflictInfo);
    req.setAttribute("plans", filterHelper.getFilteredServicePlans(filterTagArg, store));
    req.setAttribute("filterTag", filterTagArg);
    if (store.getDefaultServicePlanIdAsLong() != null) {
View Full Code Here

TOP

Related Classes of com.mockey.model.ConflictInfo$Conflict

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.