Skip to content

Commit e8745c6

Browse files
committed
[java] Deleting tests referencing deprecated methods in Require.java
1 parent 257104e commit e8745c6

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

java/test/org/openqa/selenium/RequireTest.java

-40
Original file line numberDiff line numberDiff line change
@@ -261,46 +261,6 @@ void canCheckStateClass() {
261261
assertThat(Require.state("That", arg2).instanceOf(String.class)).isSameAs(arg2);
262262
}
263263

264-
@Test
265-
void canCheckFileState() throws IOException {
266-
assertThatExceptionOfType(IllegalStateException.class)
267-
.isThrownBy(() -> Require.state("Target", (Path) null).isFile())
268-
.withMessage("Target must be set");
269-
File tempFile = File.createTempFile("example", "tmp");
270-
tempFile.deleteOnExit();
271-
assertThat(Require.state("Target", tempFile.toPath()).isFile()).isSameAs(tempFile.toPath());
272-
File dir = tempFile.getParentFile();
273-
assertThatExceptionOfType(IllegalStateException.class)
274-
.isThrownBy(() -> Require.state("Target", dir.toPath()).isFile())
275-
.withMessage("Target must be a regular file: %s", dir);
276-
if (!tempFile.delete()) {
277-
fail("Unable to delete temp file");
278-
}
279-
assertThatExceptionOfType(IllegalStateException.class)
280-
.isThrownBy(() -> Require.state("Target", tempFile.toPath()).isFile())
281-
.withMessage("Target must exist: %s", tempFile);
282-
}
283-
284-
@Test
285-
void canCheckDirectoryState() throws IOException {
286-
assertThatExceptionOfType(IllegalStateException.class)
287-
.isThrownBy(() -> Require.state("Target", (Path) null).isDirectory())
288-
.withMessage("Target must be set");
289-
File tempFile = File.createTempFile("example", "tmp");
290-
tempFile.deleteOnExit();
291-
assertThatExceptionOfType(IllegalStateException.class)
292-
.isThrownBy(() -> Require.state("Target", tempFile.toPath()).isDirectory())
293-
.withMessage("Target must be a directory: %s", tempFile);
294-
File dir = tempFile.getParentFile();
295-
assertThat(Require.state("Target", dir.toPath()).isDirectory()).isSameAs(dir.toPath());
296-
if (!tempFile.delete()) {
297-
fail("Unable to delete temp file");
298-
}
299-
assertThatExceptionOfType(IllegalStateException.class)
300-
.isThrownBy(() -> Require.state("Target", tempFile.toPath()).isDirectory())
301-
.withMessage("Target must exist: %s", tempFile);
302-
}
303-
304264
@Test
305265
void canCheckFilePathState() throws IOException {
306266
assertThatExceptionOfType(IllegalStateException.class)

0 commit comments

Comments
 (0)