下面是我的产品单元测试的maste pom文件配置文件.我们有junit插件测试.这些pom文件配置没有在任何位置给我jacoco代码覆盖文件(.exec).请帮助我,如果有任何错误的地方.谢谢
<profile>
<id>unit-tests</id>
<modules>
<module>../../../test/com.xxxx.tools.comms.test.utilities</module>
<!-- product related unit tests
<module>../../../test/com.xxxx.comms.product.test</module>
<module>../../../test/com.xxxx.comms.product.mas.test</module>-->
<module>../../../test/com.xxxx.comms.product.iv.test</module>
</modules>
<properties>
<!-- Properties to enable jacoco code coverage analysis -->
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.2.201409121644</version>
<configuration>
<!-- Where to put jacoco coverage report -->
<destFile>C:/Userdata/product/GIT/Team/coverage/product1/jacoco/12.exec</destFile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<build>
<plugins>
<!-- Use of Tycho -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId> …Run Code Online (Sandbox Code Playgroud) 我正在尝试为以下示例csv找到一个语法:
a; test;test ;
;a; test;test ;
<ignore>; <ignore> ;test
a; <ignore> test;test
a; this is test ;test
Run Code Online (Sandbox Code Playgroud)
分号用作分隔符.仅包含文本的单元格<ignore>具有特殊含义,应在EMF模型中由其自己的类型表示.然而,<igonore> test这不是一个特殊的价值.必须忽略分号周围的空格.单元格可以包含除分号之外的任何字符.
到目前为止,我已经提出了这个语法:
grammar com.example.Csv
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate impEx "http://www.example.com/Csv
Model:
valueLine=ValueLine
ValueLine:
';'? WHITE_SPACE values+=Value WHITE_SPACE (';' WHITE_SPACE values+=Value WHITE_SPACE)* ';'*;
Value:
( (=>'<ignore>') {IGNORE_VALUE} IGNORE_VALUE) | text=TEXT_VALUE;
terminal TEXT_VALUE:
(!';')*;
IGNORE_VALUE:
'<ignore>';
WHITE_SPACE:
(' '|'\t')*;
Run Code Online (Sandbox Code Playgroud)
但是使用我的测试用例
@InjectWith(CsvInjectorProvider.class)
@RunWith(XtextRunner.class)
public class ParserTest {
@Inject
private ParseHelper<Model> parser;
@Test
public void parseDomainmodel() throws Exception {
Model …Run Code Online (Sandbox Code Playgroud) 我发现如果我使用注释,程序将不会抛出ClassNotFoundException.
class A {
@Transactional
public void insert() {
//insert something
}
}
Run Code Online (Sandbox Code Playgroud)
Tomcat在没有包含该类的javaee-api-7.0.jar的情况下成功启动javax.transaction.Transactional
它让我非常困惑,JVM ClassNotFoundException在加载类时不应该抛出
它A吗?
我创建了一个运行命令行工具的Docker容器。该容器应该是交互式的。我能以某种方式在Dockerfile中指定容器始终以交互方式启动吗?
作为参考,这是dockerfile:
FROM ubuntu:latest
RUN apt-get update && apt-get -y install curl
RUN mkdir adr-tools && \
cd adr-tools && \
curl -L https://github.com/npryce/adr-tools/archive/2.2.0.tar.gz --output adr-tools.tar.gz && \
tar -xvzf adr-tools.tar.gz && \
cp */src/* /usr/bin && \
rm -rf adr-tools
CMD ["/bin/bash"]
Run Code Online (Sandbox Code Playgroud)
编辑:我知道-it该run命令的选项。我明确要求在docker文件中执行此操作的方法。
EDIT2:这不是Dockerfile中的Interactive命令的重复项,因为我的问题解决了如何docker run避免指定为的参数的问题,而有利于在Dockerfile中指定它们,而假定的重复项解决了图像构建期间的交互式输入问题由码头工人本身。
我正在使用JCommander在命令行上与用户进行交互.
JCommander设置如下所示:
JCommander jCommander = new JCommander();
jCommander.addCommand(new Command1());
jCommander.addCommand(new Command2());
jCommander.addCommand(new Command3());
Scanner scanner = new Scanner(System.in);
jCommander.usage();
jCommander.parse(splitAsArgs(scanner.nextLine())));
Run Code Online (Sandbox Code Playgroud)
现在我可以使用getParsedCommand()来检索正在解析的命令的名称.
我的问题是,将返回的String转换为传递给的实际对象似乎非常困难addCommand.我可以在外部保存一张地图,这样做可以进行这种翻译,但这是多余的,因为jcommander已经知道这一切.
我该如何从解析命令的名称转换回命令对象本身?
通常我传给jcommander的所有命令都是Runnable类似的.因此,如果jcommander允许我访问被解析的对象,它将使我的生活更轻松.
我想从命令行检查本地安装的 jvm 的 java 模块的资源文件的内容。
基于有关jvm 中 mime 类型支持的问题,我想查看本地安装的 jvm/sun/net/www/content-types.properties模块中的内容。java.base
然而,当滚动浏览为 jvm 安装的文件时,我无法找到名为java.base.*. 但是我看到一个文件./lib/modules大小超过 130 MB。我怀疑该文件包含 module 的内容java.base。但 7-zip 无法将此文件作为存档打开。
如何使用命令行查看本地安装的 jvm/sun/net/www/content-types.properties模块中的内容?java.base
我正在研究一些会计逻辑.逻辑是,在一个季度的第一个月发生的会计必须具有上一季度末的价值日期.我知道我可以将月份表示为一个时期.但我不知道如何代表四分之一年的经常性时期.
我能够使用joda-time类进行计算,这将给出上一季度末的价值日期.但是,我想将"每个季度的第一个月"表示为我在计算中使用的单个值.
那么在joda-time中是否有一些API非常适合代表这种反复出现的时期?
一些示例日期是:
date of invoce | value date
2013-01-01 | 2012-12-31
2013-01-31 | 2012-12-31
2013-02-01 | 2013-02-01
2013-03-31 | 2013-03-31
2013-04-01 | 2013-03-31
Run Code Online (Sandbox Code Playgroud)
好的,这里是评论中要求的更具说明性的例子:会计逻辑是关于你必须申请的一种养老基金.您在接下来的一年,即2013年1月1日申请2012年的退休金.它将在2013年4月15日授予您.自4月是本季度的第一个月,授予将具有其价值日期定于3月31日.所有在一个季度内计入的养老金都在该季度结束后的1个月和5天内支付.因此,即使您在4月份获得了养老金,您仍然可以在5月5日获得养老金.否则你将不得不等到9月5日之前付款.
但我真的不知道这个例子应该如何帮助.这个问题实际上是关于使用joda-time类建模"每个季度的每个第一个月",甚至是实现一些joda-time的API.
我有以下代码进行单元测试:
public void foo() {
Entity entity = //...
persistence.save(entity);
entity.setDate(new Date());
persistence.save(entity);
}
Run Code Online (Sandbox Code Playgroud)
我想在第一次调用persistence.save entity.getDate()返回时验证null.
因此,我无法使用,Mockito.verify(/*...*/)因为那时方法foo已经完成entity.setDate(Date)并被调用.
所以我认为我需要在调用发生时对调用进行验证.我如何使用Mockito做到这一点?
我有一种情况,我的方法返回一些对象,方法包含一些参数,我有条件基于返回的响应和一个参数.
Map<String,List<Object>> testMap = new HashMap<>();
Object obj = new Object();
Set<String> test = myService.getModelSearchStrings(testMap, obj);
if(CollectionUtils.isNotEmpty(test){
}
if(MapUtils.isNotEmpty(testMap){
}
Run Code Online (Sandbox Code Playgroud)
测试:
Set<String> result = new HashSet<>();
result.add("123");
Mockito.when(mockedMtnService.getModelSearchStrings(Mockito.anyMap(), Mockito.anyObject())).thenReturn(result);
Run Code Online (Sandbox Code Playgroud)
我想返回Dummy响应,即结果HashSet并想要更新参数值(Map).
我正在 Visual Studio 代码中编辑一段打字稿代码。为此,我收到一条编译器错误消息,内容如下:
Type 'import(\"c:/path/to/project/node_modules/@com.m...' is not assignable to type
'import(\"c:/path/to/project/node_modules/@com.m...'. Two different types with this name
exist, but they are unrelated.
Run Code Online (Sandbox Code Playgroud)
我需要配置什么才能读取编译器错误消息中导入的完整路径?
我已经从https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0签出xerces-j 2.11 。现在,我想构建它,但是在编译过程中出现以下错误:
compile:
[xjavac] Compiling 596 source files to C:\Users\abrieg\workingcopy\xerces-trunk\build\classes
[xjavac] C:\Users\abrieg\workingcopy\xerces-trunk\build\src\org\apache\html\dom\HTMLFrameElementImpl.java:28: error: HTMLFrameElementImpl is not abstract and does not override abstract method getContentDocument() in HTMLFrameElement
[xjavac] public class HTMLFrameElementImpl
[xjavac] ^
[xjavac] C:\Users\abrieg\workingcopy\xerces-trunk\build\src\org\apache\html\dom\HTMLIFrameElementImpl.java:28: error: HTMLIFrameElementImpl is not abstract and does not override abstract method getContentDocument() in HTMLIFrameElement
[xjavac] public class HTMLIFrameElementImpl
[xjavac] ^
[xjavac] C:\Users\abrieg\workingcopy\xerces-trunk\build\src\org\apache\html\dom\HTMLObjectElementImpl.java:28: error: HTMLObjectElementImpl is not abstract and does not override abstract method getContentDocument() in HTMLObjectElement
[xjavac] public class HTMLObjectElementImpl
[xjavac] ^
[xjavac] …Run Code Online (Sandbox Code Playgroud) 我有一个带有后端处理应用程序的容器,该应用程序仅连接到其他服务,但不公开其侦听的任何端口。例如,在我的情况下,它连接到JMS代理并使用其他服务的Rest API。
我想将该容器以及JMS代理和带有Rest API的服务器部署到kubernetes。因此,我目前正在为后端处理应用程序使用这些kubernetes API对象:
---
kind: "Deployment"
apiVersion: "extensions/v1beta1"
metadata:
name: "foo-processing-module"
namespace: "foo-4"
labels:
foo.version: "0.0.1-SNAPSHOT"
k8s-app: "foo-processing-module"
annotations:
deployment.kubernetes.io/revision: "1"
description: "Processing Modules App for foo"
spec:
replicas: 1
selector:
matchLabels:
foo.version: "0.0.1-SNAPSHOT"
k8s-app: "foo-processing-module"
template:
metadata:
name: "foo-processing-module"
labels:
foo.version: "0.0.1-SNAPSHOT"
k8s-app: "foo-processing-module"
annotations:
description: "Processing Modules App for foo"
spec:
containers:
-
name: "foo-processing-module"
image: "foo/foo-processing-module-docker:0.0.1-SNAPSHOT"
resources: {}
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: "File"
imagePullPolicy: "IfNotPresent"
securityContext:
privileged: false
restartPolicy: "Always"
terminationGracePeriodSeconds: 30
dnsPolicy: "ClusterFirst"
securityContext: {} …Run Code Online (Sandbox Code Playgroud) java ×8
jvm ×2
mockito ×2
annotations ×1
ant ×1
build ×1
classloader ×1
command-line ×1
csv ×1
deployment ×1
docker ×1
dockerfile ×1
eclipse ×1
grammar ×1
interactive ×1
jacoco ×1
java-module ×1
jcommander ×1
jodatime ×1
kubernetes ×1
maven ×1
service ×1
typescript ×1
unit-testing ×1
xerces ×1
xtext ×1