Package com.denimgroup.threadfix.framework.engine

Examples of com.denimgroup.threadfix.framework.engine.ProjectDirectory


  public JSPMappings(@Nonnull File rootFile) {
    if (rootFile.exists()) {

      this.projectRoot = rootFile;

            projectDirectory = new ProjectDirectory(rootFile);
     
      String jspRootString = CommonPathFinder.findOrParseProjectRootFromDirectory(rootFile, "jsp");

            LOG.info("Calculated JSP root to be: " + jspRootString);
     
View Full Code Here


    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;
View Full Code Here

    ///////////////////////////// Tests ////////////////////////////
    ////////////////////////////////////////////////////////////////

    @Test
    public void testWebXmlParserForContextClass() {
        ProjectDirectory directory = new ProjectDirectory(new File(TestConstants.getFolderName("spring-mvc-ajax")));
        ServletMappings mappings = WebXMLParser.getServletMappings(directory.findWebXML(), directory);
        for (ClassMapping classMapping : mappings.getClassMappings()) {
            if (classMapping.getClassWithPackage().equals(SpringServletConfigurationChecker.DISPATCHER_SERVLET)) {
                assertTrue("missing context class", "org.springframework.web.context.support.AnnotationConfigWebApplicationContext".equals(classMapping.getContextClass()));
                assertTrue("missing context location", "com.codetutr.springconfig".equals(classMapping.getContextConfigLocation()));
            }
View Full Code Here

    ////////////////////////////////////////////////////////////////
    ///////////////////////////// Utils ////////////////////////////
    ////////////////////////////////////////////////////////////////

    private ServletMappings getTestMappings() throws IOException {
        return new ServletMappings(sampleServletMappings, sampleServlets, new ProjectDirectory(File.createTempFile("test", "test")), null);
    }
View Full Code Here

     
      for (int i = 0; i < sourceLocations.length; i++) {
        File projectDirectory = new File(sourceLocations[i]);
        assertTrue(projectDirectory.exists());
       
        File file = new ProjectDirectory(projectDirectory).findWebXML();
            assertTrue("File was null, check that " + projectDirectory + " is a valid directory.", file != null);
        assertTrue(file.getName().equals("web.xml"));
       
        assertTrue(file.getAbsolutePath() + " wasn't " + webXMLLocations[i],
                    file.getAbsolutePath().equals(webXMLLocations[i]));
View Full Code Here

      assertTrue(bodgeIt.guessApplicationType() == FrameworkType.JSP);
    }

    @Test(expected=NullPointerException.class)
    public void testNullInput() {
        new ProjectDirectory(null).findWebXML();
    }
View Full Code Here

    @Test
    public void testBadInput() {
      File doesntExist = new File("This/path/doesnt/exist");

      assertTrue(new ProjectDirectory(doesntExist).findWebXML() == null);
     
     
    }
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.framework.engine.ProjectDirectory

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.