嗨我有空闲实例的问题
当我尝试:
sqlplus / as sysdba
Run Code Online (Sandbox Code Playgroud)
我得到结果: Connected to an idle instance.
当我尝试启动时,我得到:
ORA-01078: failure in processing system parameters ORA-01565 error in identifying file 'C:\oraclexe\app\oracle\product\11.2.0\server\dbs/spfileXE.ora ORA-27041: unable to open file ORA-04002: unable to open file O/S-Error: (OS 2) File not found;
我的系统是Windows 8.你知道如何解决它吗?
解决方案:我必须使用命令启动:
startup pfile='<path to file>/init.ora'
Run Code Online (Sandbox Code Playgroud)
并在init.ora中更改所有路径
<ORACLE_BASE>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助
我是spock框架测试的新手,我没有找到任何可以找到所需信息的例子.因此,我认为最好的方法是展示一个我需要的例子.
例如spock中的测试类:
def "getData" (){ // this is test of getData method from ExternalService
when:
Result result = externalService.getData()
then:
result.msg = 'SUCCESS'
}
Run Code Online (Sandbox Code Playgroud)服务类别:
public class ExternalService(){
private ServiceConnector serviceConnector;
public Result getData(){
Result result = serviceConnector.callAndGet();
prepareInformation(data);
updateStatuses(data);
return result;
}
}
Run Code Online (Sandbox Code Playgroud)类数据作为域类:
public class Data {
private String msg
private int Id
// +getters/setters
}
Run Code Online (Sandbox Code Playgroud)现在我有getData测试,并想嘲笑唯一的方法callAndGet().这意味着每次调用时callAndGet我都需要使用带有msg SUCCESS的对象数据,但是getData应该正常调用方法中的所有其他方法.
这是可以理解的吗?问题是我们如何将服务类注入/模拟ExternalService到spock测试类中?