有没有办法提供一些命令行参数,以跳过所有测试,但在某些模块上有一个?所以每次我需要运行另一个测试时我都不需要更改pom.xml吗?
例如,我想在TeamCity上创建构建配置,并提供命令行参数以在某个模块中仅运行单个测试.下次我需要更改它并运行另一个测试,依此类推.
也许不是如何使用CI,但仍然如此.
我有使用Maven构建的多模块项目.我从该项目中仅导入了单个子模块(不是父模块)作为IDEA项目,看起来IDE无法识别.git文件夹(因为它是我用于导入的项目根目录的一级,我猜)
是否还有可能以某种方式为smartJ添加Git支持?
给定一些源文件(或更通用的 - 输入流),我需要找出答案
我查看了API,但目前尚不清楚如何获取图像类型或Exif数据.
我创建了followind application.conf:
akka {
actor {
prio-dispatcher {
type = "Dispatcher"
mailbox-type = "my.package.PrioritizedMailbox"
}
}
}
Run Code Online (Sandbox Code Playgroud)
转储配置时
actorSystem = ActorSystem.create()
println(actorSystem.settings)
Run Code Online (Sandbox Code Playgroud)
我得到了输出:
# application.conf: 5
"prio-dispatcher" : {
# application.conf: 7
"mailbox-type" : "my.package.PrioritizedMailbox",
# application.conf: 6
"type" : "Dispatcher"
},
Run Code Online (Sandbox Code Playgroud)
后来
[WARN] [08/30/2012 22:44:54.362] [default-akka.actor.default-dispatcher-3] [Dispatchers] Dispatcher [prio-dispatcher] not configured, using default-dispatcher
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?
UPD在这里找到解决方案,不得不使用名称"akka.actor.prio-dispatcher"
可能重复:
Scala:转发引用 - 为什么这段代码会编译?
object Omg {
class A
class B(val a: A)
private val b = new B(a)
private val a = new A
def main(args: Array[String]) {
println(b.a)
}
}
Run Code Online (Sandbox Code Playgroud)
以下代码打印"null".在java中.由于前向引用无效,类似的构造无法编译.问题是 - 为什么它在Scala中编译得很好?这是设计,在SLS中描述还是仅仅是2.9.1中的错误?
使用GHC版本7.4.2和-O3之类的标志,我仍然可以获得巨大的可执行文件.我理解GHC做静态链接,二进制的依赖关系如下:
linux-vdso.so.1 (0x00007fff49bff000)
libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007fe658d6c000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007fe658b64000)
libutil.so.1 => /usr/lib/libutil.so.1 (0x00007fe658961000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fe65875d000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fe658541000)
libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007fe6582e3000)
libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007fe658074000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007fe657d7a000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fe657b65000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007fe6577be000)
/lib/ld-linux-x86-64.so.2 (0x00007fe658fca000)
libssh2.so.1 => /usr/lib/libssh2.so.1 (0x00007fe657595000)
libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007fe65732b000)
libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007fe656f22000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007fe656d0c000
Run Code Online (Sandbox Code Playgroud)
到目前为止它看起来相当不错,但是在二进制文件中我可以看到这些行:
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
* Specifying the same object file …Run Code Online (Sandbox Code Playgroud) 我需要在我的application.conf文件中引用java.io.tmpdir
我打印了我的配置内容
val c = ConfigFactory.load()
System.err.println(c.root().render())
Run Code Online (Sandbox Code Playgroud)
它呈现出来的样子
# dev/application.conf: 1
"myapp" : {
# dev/application.conf: 47
"db" : {
# dev/application.conf: 49
"driver" : "org.h2.Driver",
# dev/application.conf: 48
"url" : "jdbc:h2:file:${java.io.tmpdir}/db;DB_CLOSE_DELAY=-1"
}
...
}
# system properties
"java" : {
# system properties
"io" : {
# system properties
"tmpdir" : "/tmp"
},
....
Run Code Online (Sandbox Code Playgroud)
所以我想前向引用不起作用.有没有办法在系统属性后加载我的选项,所以config解析器会正确替换值?
为了在monad上下文中创建任何可操作的东西,如果使用Haskell - 我只是在任何地方添加给定类型的Monad类的实现.所以我根本没有触及数据类型定义的来源.喜欢(人为的东西)
data Z a = MyZLeft a | MyZRight a
swap (MyZLeft x) = MyZRight x
swap (MyZRight x) = MyZLeft x
instance Monad Z where
return a = MyZRight a
(>>=) x f = case x of
MyZLeft s -> swap (f s)
MyZRight s -> swap (f s)
Run Code Online (Sandbox Code Playgroud)
所以我没有触及Z的定义,而是将其作为monad
我如何在Scala中执行此操作?似乎除了混合一些特征和定义方法map/flatMap/filter/withFilter之外别无他法?
看看比较矩阵,看起来IDEA CE根本不支持代码覆盖.有很多可用的代码覆盖工具,所以也许可以在IDEA CE中加入一些东西?
是否可以将集成测试与同一模块内的单元测试隔离开来?
我创建了简单的pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>prj</artifactId>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/integration/**/*.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/integration/**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Run Code Online (Sandbox Code Playgroud)
但是使用mvn -Pintegration测试它不会调用任何东西.如果我注释掉排除在主构建部分-然后它开始执行测试,但没有配置文件也是如此.
maven ×3
scala ×3
java ×2
akka ×1
compilation ×1
config ×1
dispatcher ×1
executable ×1
ghc ×1
git ×1
haskell ×1
monads ×1
profile ×1
reference ×1
typesafe ×1
unit-testing ×1