Package com.denimgroup.threadfix.framework.engine.full

Examples of com.denimgroup.threadfix.framework.engine.full.EndpointQuery


        checkParameters(database, endpointUrl, params);
    }

    // having this separate enables us to reuse a database between test calls to save parsing time
    private void checkParameters(EndpointDatabase database, String endpointUrl, String... params) {
        EndpointQuery query =
                EndpointQueryBuilder
                        .start()
                        .setDynamicPath(endpointUrl)
                        .generateQuery();
View Full Code Here


      { "/petclinic/owners/36/pets/new", "/src/main/java/org/springframework/samples/petclinic/web/PetController.java" },
  };
 
  @Nonnull
    private String getStaticPath(@Nonnull EndpointDatabase db, String dynamicPath) {
    EndpointQuery query = EndpointQueryBuilder.start()
        .setInformationSourceType(InformationSourceType.DYNAMIC)
        .setDynamicPath(dynamicPath)
        .generateQuery();
   
    return db.findBestMatch(query).getFilePath();
View Full Code Here

  @Test
  public void testHttpMethodRecognition() {
    EndpointDatabase db = getSpringEndpointDatabaseStatic();
   
    for (String[] httpMethodTest : httpMethodTests) {
      EndpointQuery query =
          EndpointQueryBuilder.start()
            .setDynamicPath(httpMethodTest[0])
            .setHttpMethod(httpMethodTest[1])
            .generateQuery();
     
View Full Code Here

    @Test
    public void testParameterRecognition() {
        EndpointDatabase db = getSpringEndpointDatabaseStatic();

        for (String[] httpMethodTest : parameterTests) {
            EndpointQuery query =
                    EndpointQueryBuilder.start()
                            .setDynamicPath(httpMethodTest[0])
                            .setParameter(httpMethodTest[1])
                            .generateQuery();
View Full Code Here

    // TODO add parameter stuff
    @Test
    public void testCodePoints() {
        EndpointDatabase db = getSpringEndpointDatabaseStatic();

        EndpointQuery query = EndpointQueryBuilder.start()
                .setCodePoints(basicModelElements)
                .setStaticPath("java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java")
                .generateQuery();

        Endpoint result = db.findBestMatch(query);
View Full Code Here

            "return ownerRepository.findByLastName(lastName);"),
        new DefaultCodePoint("java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java", 84,
            "\"SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like '\" + lastName + \"%'\",")
        );
     
      EndpointQuery finding = EndpointQueryBuilder.start()
          .setCodePoints(basicModelElements)
          .generateQuery();
     
      String result = parser.parse(finding);
      assertTrue("Parameter was " + result + " instead of lastName", "lastName".equals(result));
View Full Code Here

          "return ownerRepository.findByLastName(lastName);"),
        new DefaultCodePoint("java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java", 84,
          "\"SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like '\" + lastName + \"%'\",")
        );
     
      EndpointQuery finding = EndpointQueryBuilder.start()
          .setCodePoints(chainedRequestParamElements1)
          .generateQuery();
     
      String result = parser.parse(finding);
      assertTrue("Parameter was " + result + " instead of testParam", "testParam".equals(result));
View Full Code Here

          "return ownerRepository.findByLastName(lastName);"),
        new DefaultCodePoint("java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java", 84,
          "\"SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like '\" + lastName + \"%'\",")
        );
     
      EndpointQuery finding = EndpointQueryBuilder.start()
          .setCodePoints(chainedRequestParamElements2)
          .generateQuery();
     
      String result = parser.parse(finding);
      assertTrue("Parameter was " + result + " instead of lastName", "lastName".equals(result));
View Full Code Here

          "return ownerRepository.findByLastName(lastName);"),
        new DefaultCodePoint("java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java", 84,
          "\"SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like '\" + lastName + \"%'\",")
        );
     
      EndpointQuery finding = EndpointQueryBuilder.start()
          .setCodePoints(chainedPathVariableElements1)
          .generateQuery();
     
      String result = parser.parse(finding);
      assertTrue("Parameter was " + result + " instead of testParam", "testParam".equals(result));
View Full Code Here

          "return ownerRepository.findByLastName(lastName);"),
        new DefaultCodePoint("java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java", 84,
          "\"SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE last_name like '\" + lastName + \"%'\",")
        );
     
      EndpointQuery finding = EndpointQueryBuilder.start()
          .setCodePoints(pathVariableElements2)
          .generateQuery();
     
      String result = parser.parse(finding);
      assertTrue("Parameter was " + result + " instead of lastName", "lastName".equals(result));
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.framework.engine.full.EndpointQuery

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.