我正在尝试使用jenkins中的电子邮件发送.我保留默认值,单击"测试配置"按钮并得到错误:
无法发送电子邮件
javax.mail.MessagingException:无法连接到SMTP主机:localhost,port:25; 嵌套异常是:java.net.SocketException:权限被拒绝:连接
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
我错过了什么?它默认不起作用?
在Jenkins配置页面的"Jenkins URL"部分,我将此选项设置为" http://name_of_my_machine.jenkins:8080 / "通常我打开jenkins:" http:// localhost:8080 / "但这个新选项没有不适合我 - 詹金斯不开放.那是什么意思呢?
我需要一个只匹配10,11和12个数字的正则表达式.我试过这个:
\b[10|11|12]{1}\b
Run Code Online (Sandbox Code Playgroud)
但这里找不到匹配项.你能救我吗?
我正在尝试为以下 AspNetCore 控制器方法编写单元测试:
[HttpGet]
public async Task<IActionResult> GetFile(string id)
{
FileContent file = await fileRepository.GetFile(id);
if (file == null)
return NotFound();
Response.Headers.Add("Content-Disposition", file.FileName);
return File(file.File, file.ContentType);
}
Run Code Online (Sandbox Code Playgroud)
文件内容类:
public class FileContent
{
public FileContent(string fileName, string contentType, byte[] file)
{
FileName = fileName;
ContentType = contentType;
File = file;
}
public string FileName { get; }
public string ContentType { get; }
public byte[] File { get; }
}
Run Code Online (Sandbox Code Playgroud)
这是测试初始化:
[TestInitialize]
public void TestInitialize()
{
repositoryMock = new Mock<IFileRepository>(); …Run Code Online (Sandbox Code Playgroud) 我想更深入地了解promises如何在JavaScript中工作并尝试下一个代码:
function delay(timeout) {
return new Promise(function(resolve, reject){
setTimeout(resolve,timeout);
});
}
var promise = delay(10000);
promise.then(alert('after delay'));
Run Code Online (Sandbox Code Playgroud)
我想为JS setTimeout()函数编写一个包装器,我假设警报在执行此代码后10秒后出现,但它立即显示,有人可以解释这里有什么问题吗?