小编sno*_*ery的帖子

如何在开发过程中制作Hapi自动重装应用程序

我是*Hapi*框架的新手.在开发过程中,每当我对代码进行任何更改时,我都必须重新启动hapi服务器.

对于视图部分,我可以添加一个选项{isCached: false},使视图每次都读取最新的html文件.但是,是否有一个简单的设置,使其在更改时自动重新加载代码?

更新:

感谢dylants的建议,Nodemon非常棒.

但是,在我的应用程序中有一个selenium-standalone子进程,每当nodemon重新启动时,它都会生成一个错误日志....Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again...

我试过https://github.com/remy/nodemon#controlling-shutdown-of-your-script,它没有帮助.

node.js hapijs

12
推荐指数
2
解决办法
4695
查看次数

无法在Spring启动项目中使用SpringJUnit4ClassRunner运行powermockrule

我有一个spring boot项目,需要使用spring test runner进行测试(以便我可以获得真正的应用程序上下文)并模拟静态方法.

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes= MyApplication.class)
@PrepareForTest(StaticClass.class)
public class StaticClassTest {

    @Rule
    public PowerMockRule rule = new PowerMockRule();

    @Autowired
    HelloCmd hello;

    @Test
    public void testGetOne() {
        mockStatic(StaticClass.class);
        when(StaticClass.getNumber()).thenReturn(2);
        System.out.println(hello.getNumber());
    }
}
Run Code Online (Sandbox Code Playgroud)

运行测试时出现以下错误消息:

com.thoughtworks.xstream.converters.ConversionException: hello.hystrix.commands.HelloCmd$$EnhancerBySpringCGLIB$$a27be1be : hello.hystrix.commands.HelloCmd$$EnhancerBySpringCGLIB$$a27be1be
---- Debugging information ----
message             : hello.hystrix.commands.HelloCmd$$EnhancerBySpringCGLIB$$a27be1be
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : hello.hystrix.commands.HelloCmd$$EnhancerBySpringCGLIB$$a27be1be
class               : hello.hystrix.commands.StaticClassTest
required-type       : hello.hystrix.commands.StaticClassTest
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /org.powermock.modules.junit4.rule.PowerMockStatement$1/outer-class/fNext/next/next/target/hello
line number         : 15
class[1]            : org.junit.internal.runners.statements.InvokeMethod
class[2]            : org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
class[3]            : org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
class[4]            : org.powermock.modules.junit4.rule.PowerMockStatement
class[5]            : …
Run Code Online (Sandbox Code Playgroud)

powermock spring-boot springjunit4classrunner

4
推荐指数
1
解决办法
8090
查看次数