请问下,JUnit单元测试有什么用??
我的编程习惯是写一段代码就测试一下,请问JUnit单元测试对我来说有用吗??或者说它有什么作用,什么情况下有什么效果??
更新时间:2022-03-22 18:03
最满意答案
常见的情况下,Linux下nginx一般的ssl配置文件是这样的: server { listen 443; server_name example.com; root /apps/www; index index.html index.htm index.php; ssl on; ssl_certificate ../SSL/ittest.pem; ssl_certificate_key ../SSL/itt.
其他回答
下载apr依赖: apr 1.2+ development headers (libapr1-dev package) 下载openssl依赖:openssl 0.9.7+ development headers (libssl-dev package) 准备依赖包 解压缩tomcat_home/bin/tomcat-native.tar.gz 进入目录:tomcat-native-1.1.20-src/jni/native 详细安装见此目录下的building文件 执行 export java_home=/prog/java/jdk 设置jdk 执行:./configure --with-apr=/usr/bin --with-ssl=/usr/bin 执行:make 执行:sudo make install -->安装到/usr/local/apr/lib 执行:ln -s /usr/local/apr/lib/libtcnative-1.so $java_home/jre/lib/amd64/ 重新启动tomcat看到: sep 3, 2010 9:56:17 pm org.apache.catalina.core.aprlifecyclelistener init info: loaded apr based apache tomcat native library 1.1.20. sep 3, 2010 9:56:18 pm org.apache.catalina.core.aprlifecyclelistener init info: apr capabilities: ipv6 [true], sendfile [true], accept filters [false], random [true]. sep 3, 2010 9:56:18 pm org.apache.catalina.core.aprlifecyclelistener lifecycleevent info: failed to initialize the sslengine. sep 3, 2010 9:56:18 pm org.apache.coyote.http11.http11aprprotocol init info: initializing coyote http/1.1 on http-8782 sep 3, 2010 9:56:18 pm org.apache.coyote.ajp.ajpaprprotocol init info: initializing coyote ajp/1.3 on ajp-8711 sep 3, 2010 9:56:18 pm org.apache.catalina.startup.catalina load info: initialization processed in 840 ms 配置ssl 非apr的ssl配置步骤 创建keystore: jdk/bin/keytool -genkey -keystore tomcat.keystore -alias tomcat -keyalg rsa 把tomcat.keystore放入${user.home}目录中,就是你的用户目录,当然你可以放入其他目录中 修改tomcat的server.xml,增加connector: xml代码 apr环境的ssl配置(ssl不使用apr):如果还是按照上面的#非apr的ssl配置步骤进行ssl配置,那么需要这么做: 在connector中配置protocol=org.apache.coyote.http11.http11nioprotocol 但启动时会提示错误:failed to initialize the sslengine. sep 3, 2010 10:49:42 pm org.apache.catalina.core.aprlifecyclelistener init info: loaded apr based apache tomcat native library 1.1.20. sep 3, 2010 10:49:43 pm org.apache.catalina.core.aprlifecyclelistener init info: apr capabilities: ipv6 [true], sendfile [true], accept filters [false], random [true]. sep 3, 2010 10:49:43 pm org.apache.catalina.core.aprlifecyclelistener lifecycleevent info: failed to initialize the sslengine. sep 3, 2010 10:49:43 pm org.apache.coyote.http11.http11aprprotocol init info: initializing coyote http/1.1 on http-8782 sep 3, 2010 10:49:43 pm org.apache.tomcat.util.net.nioselectorpool getsharedselector info: using a shared selector for servlet write/read sep 3, 2010 10:49:43 pm org.apache.coyote.http11.http11nioprotocol init info: initializing coyote http/1.1 on http-9145 sep 3, 2010 10:49:43 pm org.apache.coyote.ajp.ajpaprprotocol init info: initializing coyote ajp/1.3 on ajp-8711 sep 3, 2010 10:49:43 pm org.apache.catalina.startup.catalina load info: initialization processed in 1162 ms 虽然提示信息:failed to initialize the sslengine.但ssl依然可以正常运行,要抑制此信息只要修改server.xml配置apr的sslengine=off即可,如 启动信息 sep 3, 2010 10:51:53 pm org.apache.catalina.core.aprlifecyclelistener init info: loaded apr based apache tomcat native library 1.1.20. sep 3, 2010 10:51:53 pm org.apache.catalina.core.aprlifecyclelistener init info: apr capabilities: ipv6 [true], sendfile [true], accept filters [false], random [true]. sep 3, 2010 10:51:54 pm org.apache.coyote.http11.http11aprprotocol init info: initializing coyote http/1.1 on http-8782 sep 3, 2010 10:51:54 pm org.apache.tomcat.util.net.nioselectorpool getsharedselector info: using a shared selector for servlet write/read sep 3, 2010 10:51:54 pm org.apache.coyote.http11.http11nioprotocol init info: initializing coyote http/1.1 on http-9145 sep 3, 2010 10:51:54 pm org.apache.coyote.ajp.ajpaprprotocol init info: initializing coyote ajp/1.3 on ajp-8711 sep 3, 2010 10:51:54 pm org.apache.catalina.startup.catalina load info: initialization processed in 1081 ms
相关问答
更多-
ssl配置流程请大神解答[2024-01-28]
配置之前您需要获得:Nginx格式证书,他是2个文件组成。 Nginx安装SSL证书:网页链接 Nginx 自动跳转到HTTPS:网页链接 注意:安装防火墙需要设置允许443端口或关闭防火墙,如果本地服务器安装安全狗的,请允许443端口。如果无法根据教程完成SSL证书配置工作,建议您请求技术支持:网页链接 -
nginx ssl 是 key 和pem 怎么配置[2024-02-27]
常见的情况下,Linux下nginx一般的ssl配置文件是这样的: server { listen 443; server_name example.com; root /apps/www; index index.html index.htm index.php; ssl on; ssl_certificate ../SSL/ittest.pem; ssl_certificate_key ../SSL/itt. -
tomcat ssl 怎么配置pem 和key文件[2022-01-01]
下载APR依赖: APR 1.2+ development headers (libapr1-dev package) 下载OpenSSL依赖:OpenSSL 0.9.7+ development headers (libssl-dev package) 准备依赖包 解压缩tomcat_home/bin/tomcat-native.tar.gz 进入目录:tomcat-native-1.1.20-src/jni/native 详细安装见此目录下的BUILDING文件 执行 export JAVA_HOME= ... -
您的SSL证书可能是针对给定域提供的,而不是针对IP地址提供的,并且您使用的是IP而不是域连接: io.connect('https://52.29.55.217') 除非您的证书在其涵盖的主机列表中包含该IP地址(极不可能),否则这将无效。 尝试使用Let's Encrypt创建证书时使用的确切域名(不是子域,不是IP,确切的域名)。 Your SSL certificate is likely provided for a given domain, not for the IP address an ...
-
nginx - 奇怪的ssl问题(nginx - weird ssl issue)[2022-03-29]
看起来像site2服务器声明缺少ssl on; 配置。 在site1中,您可以直接listen它。 Looks like site2 server declaration is missing the ssl on; config. In site1, you have it directly under listen. -
在我的情况下,用LibreSSL替换OpenSSL解决了这个问题。 In my case, replacing OpenSSL with LibreSSL solved the problem.
-
使用Nginx在Ghost博客上进行SSL重定向和身份验证(SSL redirection and authentication on Ghost blog with Nginx)[2023-02-18]
我正在周末的一个很好的部分研究这个不便的解决方案,并设法找到解决方案。 Let's Encrypt和Nginx中都没有错误,所有这些都指的是我的错误配置; 但是,我不能不再认为这是一件奇怪的事情,即使不多说,我的解决方案也可以改进,这是我的Nginx配置文件: server { listen 80; server_name example.com www.example.com; return 301 https://example.com$request_uri; } serve ... -
好吧所以这个问题比我想象的要简单。 我正在使用不支持ssl的免费cloudflare dns指向。 我切换到使用namescheap dns,它开始工作。 okay so the problem was simpler than I thought. I was using the free cloudflare dns pointing which didn't support ssl. I switched to using the namescheap dns and it started worki ...
-
server_name _; 是无关紧要的(并且在现代版本的nginx不是必需的)。 如果找不到具有匹配的listen和server_name , nginx将使用默认服务器 。 如果没有listen指令的default_server后缀, nginx将使用匹配listen的第一个server块。 如果您的配置分布在多个文件中,则评估顺序将不明确,因此您需要明确标记默认服务器。 试试这个jelastic服务器块: server { listen 443 ssl default_server; ...
-
你混淆了你的端口: 这个http://104.236.228.111:1337/parse/files/IpFrZ8h4ZFjv9fKhUq3p7C2ca2WOBuAkbbzmtrxe/50c99849-9e31-4414-9552-f640fb43eb53_iphone_6.png绕过nginx直接进入后端,后端正在1337端口侦听此服务器。 此https://cobbet.com:1337/parse/files/IpFrZ8h4ZFjv9fKhUq3p7C2ca2WOBuAkbbzmtrxe/50c9 ...