我正在尝试使用触摸和滑动来模拟使用adb的自动视频通话.场景:
Device1音频呼叫Device2,Device2应答,Device1请求视频呼叫(双向),Device2尝试应答并失败.有线的事情是有时它可以工作,但当设备2试图通过adb刷卡回答时,大部分都失败了.
这是代码:
@Test(timeout = 60000000)
/**
*
*/
@TestProperties(name = "Video call / Normal video call")
public void VT111_0011() throws InterruptedException, IOException, AWTException {
initTestVariable("Normal_Video_Call_Test_VT111_0011");
sleep(idleBeforeTest);
System.out.println("Starting normal video test");
Android.adbCommand(secondDevice.getDevice1(), "adb -s " + secondDevice.getDeviceID() + " shell input touchscreen swipe 355 858 590 858");
for(int i=0; i<Iteration; i++) {
moveMouse();
Jsystem.broadCastMessage("\nIteration " + i, globalVar.nameForLogFile);
cleanLogs();
firstDevice.call(secondDevice);
Thread.sleep(2000);
if(secondDevice.isRinging())
secondDevice.answerCall(1000);
else{
ringingFail();
}
// Start video by gui
Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input …Run Code Online (Sandbox Code Playgroud) 我有两个不同的组件,它们使用两个不同的数据库,但实体位于两个数据库上,并且我希望它始终具有相同的 ID。
所以基本上当 ID 为空时我希望它自动生成,如果它不为空则使用 ID。
我正在使用休眠。
@Id
@Column(name = COLUMN_ID, unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
}
Run Code Online (Sandbox Code Playgroud)
有什么建议么?
我创建了一个扩展 InputStream 的新类,并且必须 @Override read()。我正在尝试使用方法 read(int b),但是当我使用它时,它转到方法 read() 并且我无法使用该参数,我就过去了。
这是我的代码:
public class Run {
public static void main(String[] args) {
DFSMaze3dGenerator mg = new DFSMaze3dGenerator();
try {
Maze3d maze3d = mg.generate(1, 5, 5);
maze3d.print3DMaze();
OutputStream out = new MyCompressorOutputStream(
new FileOutputStream("1.maz"));
out.write(maze3d.toByteArray());
byte[] arr = maze3d.toByteArray();
System.out.println("");
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i] + ",");
}
out.close();
InputStream in = new MyDecompressorInputStream(new FileInputStream(
"1.maz"));
byte b[] = new byte[maze3d.toByteArray().length];
in.read(b);
in.close();
Maze3d loaded = new …Run Code Online (Sandbox Code Playgroud) 当我同时按下CTRL +滚动鼠标滚轮时,它可以正常工作但是当我释放CTRL键并继续滚动它仍然有效.我希望它只在CTRL和鼠标滚轮同时滚动时才能工作.
addKeyListener(new KeyListener() {
@Override
public void keyPressed(KeyEvent e) {
addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(MouseEvent g) {
if(e.keyCode == SWT.CTRL){
if(g.count > 0){
System.out.println("up");
int width = getSize().x;
int height = getSize().y;
setSize((int)(width * 1.05), (int)(height * 1.05));
}
else {
System.out.println("down");
int width = getSize().x;
int height = getSize().y;
setSize((int)(width * 0.95), (int)(height * 0.95));
}
}
}
});
}
}
Run Code Online (Sandbox Code Playgroud) 我想知道是否有一种方法可以读取包含已知和未知列的 csv 文件。
例如,第一个 csv 文件中的列是: id、名字、姓氏、城市、国家/地区未知列是城市和国家/地区
第二个 csv 文件是:
id、名字、姓氏、电话号码未知列是电话号码
我想要解析的对象是:
public class Person {
Long id;
String firstname;
String lastname;
Map<String,String> additionalInfo;
}
Run Code Online (Sandbox Code Playgroud)
extraInfo 映射将包含“未知”列作为键,值将是该列中的行值。
有任何想法吗?
谢谢。