问题描述
我要在春季靴子休息时接触柑橘黄瓜。在日食中运行时一切都很好。因此,通过使用“ mvn clean install”命令,我提取了一个jar文件,并在从浏览器中访问其余服务后,使用此命令执行jar“ java -jar
public class FeatureController {
@RequestMapping(value="/MQEndtoEnd",produces = MediaType.TEXT_HTML_VALUE)
public String executeFeature(@RequestParam(name = "FeatureFileName") String featureFileName) throws
Throwable {
String content="";
String path="D:\\citrus\\Report_Directory\\citrus-test-
results.html";//inputs/Report_Directory/citrus-test-results.html
**/*running junit inside rest controller*/
Class jtest=TodoFeatureTest.class;
JUnitCore.runclasses(jtest);**
try {
/*reading html content and returning to bowser*/
content = FileUtils.readFiletoString(new File(path),StandardCharsets.UTF_8);
} catch (IOException e) {
e.printstacktrace();
}
return content;
}
}
}
这是控制器类。使用junit运行黄瓜类并返回html报告文件作为字符串内容
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features={"D:/citrus_works/citrus"},//inputs
strict = true,glue = { "D:/citrus_works/citrus" },//inputs
plugin = { "com.consol.citrus.cucumber.CitrusReporter" } )
public class TodoFeatureTest {
}
控制器类运行此junit类
logging.level.org.springframework=DEBUG
logging.level.com.howtodoinjava=DEBUG
#output to a temp_folder/file
logging.file=${java.io.tmpdir}/application.log
# Logging pattern for the console
logging.pattern.console= %d{yyyy-MM-dd HH:mm:ss} - %msg%n
# Logging pattern for file
logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%
enter code here
{{1}}
当我在eclipse中运行spring boot应用程序时能够看到与柑橘相关的日志,但是当我在命令提示符下执行可执行的java jar文件并从浏览器中命中该服务时,无法在命令提示符下看到与柑橘相关的日志。我需要解决这个问题。这是放置在Eclipse 中的控制台。人们可以在Eclipse控制台上查看与柑橘,黄瓜相关的日志。这些日志在命令提示符下丢失。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)