Package com.denimgroup.threadfix.data.enums

Examples of com.denimgroup.threadfix.data.enums.FrameworkType


    @Test
    public void testSetParameters() {
        String appName = TestPropertiesManager.getName(), teamName = TestPropertiesManager.getName(),
                url = "http://www.test.com";

        FrameworkType type = FrameworkType.SPRING_MVC;

        RestResponse<Application> appRet = getClient().setParameters(
                getApplicationId(teamName, appName, url).toString(),
                type.toString(),
                "http://repositoryUrl.com");

        Application app = appRet.object;

        assertTrue("Test was a failure.", appRet.success);
        assertNotNull("Returned Application was null.", app);
        assertTrue("Application frameworkType was " + app.getFrameworkType() + " instead of " +
                type.getDisplayName(), app.getFrameworkTypeEnum() == type);
    }
View Full Code Here


public class FrameworkCalculatorTests {
 
  @Test
  public void bodgeitTest() {
    FrameworkType type = FrameworkCalculator.getType(new File(TestConstants.BODGEIT_SOURCE_LOCATION));
    assertTrue("Didn't find JSP, found " + type + ".", type == FrameworkType.JSP);
  }
View Full Code Here

    assertTrue("Didn't find JSP, found " + type + ".", type == FrameworkType.JSP);
  }
 
  @Test
  public void wavsepTest() {
    FrameworkType type = FrameworkCalculator.getType(new File(TestConstants.WAVSEP_SOURCE_LOCATION));
    assertTrue("Didn't find JSP, found " + type + ".", type == FrameworkType.JSP);
  }
View Full Code Here

    assertTrue("Didn't find JSP, found " + type + ".", type == FrameworkType.JSP);
  }

  @Test
  public void basicDotNetTest() {
    FrameworkType type = FrameworkCalculator.getType(new File(TestConstants.DOT_NET_SAMPLE));
    assertTrue("Didn't find DOT_NET_MVC, found " + type + ".", type == FrameworkType.DOT_NET_MVC);
  }
View Full Code Here

    assertTrue("Didn't find DOT_NET_MVC, found " + type + ".", type == FrameworkType.DOT_NET_MVC);
  }

  @Test
  public void basicWebFormsTest() {
    FrameworkType type = FrameworkCalculator.getType(new File(TestConstants.WEB_FORMS_SAMPLE));
    assertTrue("Didn't find DOT_NET_WEB_FORMS, found " + type + ".", type == FrameworkType.DOT_NET_WEB_FORMS);
  }
View Full Code Here

  @Nonnull
    public static FrameworkType getType(@Nonnull File rootFile) {
    log.info("Attempting to guess Framework Type from source tree.");
    log.info("File: " + rootFile);
   
    FrameworkType frameworkType = FrameworkType.NONE;
   
    if (rootFile.exists() && rootFile.isDirectory()) {
            ProjectDirectory projectDirectory = new ProjectDirectory(rootFile);

            for (FrameworkChecker checker : INSTANCE.frameworkCheckers) {
                frameworkType = checker.check(projectDirectory);
                if (frameworkType != FrameworkType.NONE) {
                    break;
                }
            }
    } else {
            log.warn("Invalid directory passed to FrameworkCalculator.getType(File): " + rootFile);
        }
   
    log.info("Source tree framework type detection returned: " + frameworkType.getDisplayName());
   
    return frameworkType;
  }
View Full Code Here

   
    boolean result = false;
   
    if (scanParametersBean != null && application != null) {
     
      FrameworkType frameworkType =
          FrameworkType.getFrameworkType(scanParametersBean.getApplicationType());
      SourceCodeAccessLevel accessLevel =
          SourceCodeAccessLevel.getSourceCodeAccessLevel(scanParametersBean.getSourceCodeAccessLevel());
     
      application.setFrameworkType(frameworkType.toString());
      application.setSourceCodeAccessLevel(accessLevel.toString());
     
      if (scanParametersBean.getSourceCodeUrl() != null &&
          scanParametersBean.getSourceCodeUrl().length() < Application.URL_LENGTH) {
        application.setRepositoryUrl(scanParametersBean.getSourceCodeUrl());
View Full Code Here

    @Nonnull
    @Override
    @SuppressWarnings("unchecked")
    public FrameworkType check(@Nonnull ProjectDirectory directory) {

        FrameworkType frameworkType = FrameworkType.NONE;

        File webXML = directory.findWebXML();
        if (webXML != null && webXML.exists()) {
            ServletMappings mappings = WebXMLParser.getServletMappings(webXML, directory);
View Full Code Here

    public void testDotNetProjects() {
        for (String project : projects) {

            System.out.println(project);

            FrameworkType type = FrameworkCalculator.getType(TestConstants.DOT_NET_ROOT + "/" + project);

            assert type == FrameworkType.DOT_NET_MVC
                    : "Got " + type + " instead of DOT_NET for " + project;
        }
    }
View Full Code Here

 
  @Nonnull
    public FrameworkType guessApplicationType() {
    // Since we're only looking at two types of applications, this logic is pretty simple
    // In a full-blown implementation, this method would be able to return lots of other types too.
    FrameworkType frameworkType = FrameworkType.JSP;
   
        log.info("About to guess application type from web.xml.");

        for (ClassMapping mapping : servlets) {
            if (SpringServletConfigurationChecker.checkServletConfig(projectDirectory, mapping, contextParams)) {
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.enums.FrameworkType

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.