我正在尝试为下面给出的函数编写Junit测试用例:
class A{
int i;
void set()
{
Scanner in=new Scanner(System.in);
i=in.nextInt();
}
}
Run Code Online (Sandbox Code Playgroud)
现在我的问题是当我为它创建一个Junit测试用例时,除了用户的输入之外它没有:
public void testSet() throws FileNotFoundException {
System.out.println("set");
A instance = new A();
int i=1;
instance.set(i);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
Run Code Online (Sandbox Code Playgroud)
请建议我该怎么做才能接受用户的意见.
我从http://libspatialindex.github.com/下载了R tree
自从运行./autogen.sh后,我找不到文件/文件夹,因此我从github存储库下载了文件autogen.sh,如下所示:
现在当我运行./autogen.sh时,我得到"权限被拒绝"如果我运行sh ./autogen.sh我得到:
glibtoolize or libtoolize not found. Giving up!
Run Code Online (Sandbox Code Playgroud)
请建议我现在该怎么做
编辑:我也想在我的C++项目中使用libspatialindex.我正在使用netbeans.我的意思是我想在我的netbeans项目中使用libspatialindex中的函数.我应该如何使用相同的.现在我在一个单独的目录中运行config和make命令.我不知道如何在我的项目中使用它们.
我按照http://xadmin.info/?p=284上的说明安装了postgresql
# pg_ctl -D /var/lib/pgsql/data -l pglog.log start
server starting
postgres@linux-p0pl:~> psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on
Unix domain socket "/tmp/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
我不知道为什么我在服务器启动时出现此错误...有人可以请帮助.
我的pglog.log文件显示以下输出:
2013-02-06 19:43:39 GMT FATAL: lock file "postmaster.pid" already exists
2013-02-06 19:43:39 GMT HINT: Is another postmaster (PID 23971) running in data directory "/var/lib/pgsql/data"?
2013-02-06 19:44:02 GMT FATAL: lock file "postmaster.pid" already exists
2013-02-06 19:44:02 GMT HINT: Is another postmaster (PID …Run Code Online (Sandbox Code Playgroud) 我在postgres中创建了一个名为"databaseName"的postgres数据库.现在我可以通过访问这个data2database
su - postgres
Run Code Online (Sandbox Code Playgroud)
然后输入我的密码
然后我通过以下方式进入数据库:psql databaseName
我通过以下方式创建了此数据库的用户:
createuser -P userName1
Run Code Online (Sandbox Code Playgroud)
现在我不希望数据库的用户以root用户身份访问数据库.现在,当用户尝试登录postgres时
su - postgres -u userName1
or through
psql databaseName -u userName1
Run Code Online (Sandbox Code Playgroud)
我收到错误...有人可以指导我如何在不是root用户的情况下访问postgres和数据库吗?
我是系统管理员.系统的用户使用屏幕在后台运行他们的程序.但是,如果我在用户程序运行时将屏幕模式更改为700或777,则会停止其程序.当用户运行时
screen -r process_id
Run Code Online (Sandbox Code Playgroud)
然后它显示该过程无法恢复.有人可以指导用户应该如何运行他们的程序,即使在777和700的屏幕大小之后,他们的程序也不会停止.