Java: update test cases affected by Duration.ofMillis and AtomicReference.set models

This commit is contained in:
Jami Cogswell
2023-01-23 21:33:07 -05:00
parent bdd7f18e35
commit 882237e13e
4 changed files with 8 additions and 7 deletions

View File

@@ -6,5 +6,6 @@
| java.net.URL#openConnection() | 1 |
| java.net.URL#openStream() | 1 |
| java.net.URLConnection#getInputStream() | 1 |
| java.time.Duration#ofMillis(long) | 1 |
| java.util.Map#put(Object,Object) | 1 |
| org.apache.commons.io.FileUtils#deleteDirectory(File) | 1 |

View File

@@ -16,7 +16,7 @@ class SupportedExternalApis {
Map<String, Object> map = new HashMap<>(); // uninteresting (parameterless constructor)
map.put("foo", new Object()); // supported summary
Duration d = java.time.Duration.ofMillis(1000); // not supported
Duration d = java.time.Duration.ofMillis(1000); // supported neutral
URL github = new URL("https://www.github.com/"); // supported summary
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
@@ -24,6 +24,6 @@ class SupportedExternalApis {
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
FileUtils.deleteDirectory(new File("foo")); // supported negative summary (deleteDirectory), supported summary (File)
FileUtils.deleteDirectory(new File("foo")); // supported neutral (deleteDirectory), supported summary (File)
}
}

View File

@@ -11,12 +11,13 @@ class ExternalApiUsage {
Map<String, Object> map = new HashMap<>();
map.put("foo", new Object());
Duration d = java.time.Duration.ofMillis(1000); // not supported
Duration d = java.time.Duration.ofMillis(1000); // supported as a neutral model
long l = "foo".length(); // supported as a neutral model
AtomicReference<String> ref = new AtomicReference<>(); // not supported
ref.set("foo");
AtomicReference<String> ref = new AtomicReference<>(); // uninteresting (parameterless constructor)
ref.set("foo"); // supported as a summary model
ref.toString(); // not supported
String.class.isAssignableFrom(Object.class); // parameter with generic type, supported as a neutral model

View File

@@ -1,2 +1 @@
| java.time.Duration#ofMillis(long) | 1 |
| java.util.concurrent.atomic.AtomicReference#set(Object) | 1 |
| java.util.concurrent.atomic.AtomicReference#toString() | 1 |