UiInterceptors: ability to intercept UI components in tests and emulate user action

Currently only popup chooser is supported
A usage example added for AddExceptionToExistingCatchTest
This commit is contained in:
Tagir Valeev
2019-03-06 13:37:43 +07:00
parent 72fea44b3d
commit 43b636f63f
19 changed files with 338 additions and 24 deletions
@@ -0,0 +1,16 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class A extends Exception {}
class B extends A {}
class C extends A {}
class Test {
public static void main(String[] args) {
try {
throw new A();
} catch (B e) {
} catch (A e) {
}
}
}
@@ -0,0 +1,19 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class X extends RuntimeException {}
class Y extends RuntimeException {}
class Test {
public static void main(String[] args) {
try {
try {
throw new IOException();
}
catch (X | IOException x) {
}
}
catch (Y y) {
}
}
}
@@ -0,0 +1,19 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class X extends RuntimeException {}
class Y extends RuntimeException {}
class Test {
public static void main(String[] args) {
try {
try {
throw new IOException();
}
catch (X x) {
}
}
catch (Y | IOException y) {
}
}
}
@@ -0,0 +1,16 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class A extends Exception {}
class B extends A {}
class C extends A {}
class Test {
public static void main(String[] args) {
try {
throw new A<caret>();
} catch (B e) {
} catch (C e) {
}
}
}
@@ -0,0 +1,19 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class X extends RuntimeException {}
class Y extends RuntimeException {}
class Test {
public static void main(String[] args) {
try {
try {
throw new <caret>IOException();
}
catch (X x) {
}
}
catch (Y y) {
}
}
}
@@ -0,0 +1,19 @@
// "Add exception to existing catch clause" "true"
import java.io.IOException;
class X extends RuntimeException {}
class Y extends RuntimeException {}
class Test {
public static void main(String[] args) {
try {
try {
throw new <caret>IOException();
}
catch (X x) {
}
}
catch (Y y) {
}
}
}