コード例 #1
0
 public void ASP_NET()
 {
     using (var appPath = new PathWithFileNamed("Web.config"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("aspdotnet", df.Framework);
         Assert.Equal("aspdotnet40", df.Runtime);
     }
 }
コード例 #2
0
 public void Sinatra()
 {
     using (var appPath = new PathWithFileNamed("app.rb", null, "require 'sinatra'"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("sinatra", df.Framework);
         Assert.Equal("ruby19", df.Runtime);
     }
 }
コード例 #3
0
 public void Rails()
 {
     using (var appPath = new PathWithFileNamed("environment.rb", "config"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("rails3", df.Framework);
         Assert.Equal("ruby19", df.Runtime);
     }
 }
コード例 #4
0
 public void PHP()
 {
     using (var appPath = new PathWithFileNamed("index.php"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("php", df.Framework);
         Assert.Equal("php", df.Runtime);
     }
 }
コード例 #5
0
 public void Node()
 {
     using (var appPath = new PathWithFileNamed("app.js"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("node", df.Framework);
         Assert.Equal("node", df.Runtime);
     }
 }
コード例 #6
0
 public void Rack()
 {
     using (var appPath = new PathWithFileNamed("config.ru"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("rack", df.Framework);
         Assert.Equal("ruby19", df.Runtime);
     }
 }
コード例 #7
0
 public void Erlang()
 {
     using (var appPath = new PathWithFileNamed("foo.rel", "releases"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("otp_rebar", df.Framework);
         Assert.Equal("erlangR14B02", df.Runtime);
     }
 }
コード例 #8
0
 public void WSGI()
 {
     using (var appPath = new PathWithFileNamed("wsgi.py"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("wsgi", df.Framework);
         Assert.Equal("python2", df.Runtime);
     }
 }
コード例 #9
0
 public void Django()
 {
     using (var appPath = new PathWithFileNamed("manage.py"))
     {
         DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);
         Assert.Equal("django", df.Framework);
         Assert.Equal("python2", df.Runtime);
     }
 }
コード例 #10
0
        public void WarFile()
        {
            // testapp.war
            string currentDir = Environment.CurrentDirectory;

            Assert.True(File.Exists(Path.Combine(currentDir, "testapp.war")));
            DetetectedFramework df = FrameworkDetetctor.Detect(new DirectoryInfo(currentDir));

            Assert.Equal("java_web", df.Framework);
            Assert.Equal("java", df.Runtime);
        }
コード例 #11
0
        public void Grails()
        {
            using (var appPath = new PathWithFileNamed("web.xml", "WEB-INF"))
            {
                DirectoryInfo appDir = appPath.DirectoryPath;

                string webInfLibDir = Path.Combine(appDir.FullName, "WEB-INF", "lib");

                Directory.CreateDirectory(webInfLibDir);

                File.WriteAllText(Path.Combine(webInfLibDir, "grails-web.foofoo1234.jar"), "CONTENTS");

                DetetectedFramework df = FrameworkDetetctor.Detect(appPath.DirectoryPath);

                Assert.Equal("grails", df.Framework);
                Assert.Equal("java", df.Runtime);
            }
        }