Package com.denimgroup.threadfix.framework.engine.partial

Examples of com.denimgroup.threadfix.framework.engine.partial.PartialMapping


    test.addMappings(TestUtils.getMappings(petClinicFortifyData));
   
    for (String[] stringArray : springMvcQueries) {
     
      String testDescription = "Path = " + stringArray[0] + ", expected " + stringArray[1];
      PartialMapping result = test.findBestMatch(new DefaultPartialMapping(null, stringArray[0]));
     
      if (result == null) {
        assertTrue("Got null for test " + testDescription, stringArray[1] == null);
      } else {
        assertTrue("Static path was null for " + testDescription, result.getStaticPath() != null);
        assertTrue("Got " + result + " for test " + testDescription, result.getStaticPath().equals(stringArray[1]));
      }
    }
   
  }
View Full Code Here


    public static CodePoint toCodePoint(DataFlowElement e) {
        return new DefaultCodePoint(e.getSourceFileName(), e.getLineNumber(), e.getLineText());
    }

    public static PartialMapping toPartialMapping(final Finding finding) {
        return new PartialMapping() {

            @Override
            public String getStaticPath() {
                return finding.getSourceFileLocation();
            }
View Full Code Here

        }
    }

    @Override
    public void process(@Nonnull Finding finding) {
        PartialMapping query = ThreadFixInterface.toPartialMapping(finding);

        PartialMapping endpoint = null;

        if (database != null) {
            endpoint = database.findBestMatch(query);
        }

        if (parameterParser != null && finding.getSurfaceLocation() != null) {
            String parameter = parameterParser.parse(ThreadFixInterface.toEndpointQuery(finding));
            finding.getSurfaceLocation().setParameter(parameter);
        }

        if (endpoint != null) {
            finding.setCalculatedFilePath(endpoint.getStaticPath());
            finding.setCalculatedUrlPath(endpoint.getDynamicPath());
        } else {
            noSourceProcessor.process(finding);
        }
    }
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.framework.engine.partial.PartialMapping

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.