add a couple more tests

This commit is contained in:
Jami Cogswell
2022-11-30 18:51:05 -05:00
parent 22c4d975ad
commit 94c5d53192
2 changed files with 21 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
| java.net.URL#URL(String) | 2 |
| java.io.File#File(String) | 1 |
| java.io.FileWriter#FileWriter(File) | 1 |
| java.lang.StringBuilder#append(String) | 1 |
| java.lang.StringBuilder#toString() | 1 |
| java.net.URL#openConnection() | 1 |
| java.net.URL#openStream() | 1 |
| java.net.URLConnection#getInputStream() | 1 |
| java.util.Map#put(Object,Object) | 1 |

View File

@@ -1,16 +1,26 @@
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import java.io.InputStream;
import java.net.URL;
import java.io.File;
import java.io.FileWriter;
class SupportedExternalApis {
public static void main(String[] args) throws Exception {
StringBuilder builder = new StringBuilder();
builder.append("foo"); // supported
builder.toString(); // supported
StringBuilder builder = new StringBuilder(); // uninteresting (parameterless constructor)
builder.append("foo"); // supported summary
builder.toString(); // supported summary
Map<String, Object> map = new HashMap<>();
map.put("foo", new Object()); // supported
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
URL github = new URL("https://www.github.com/"); // supported summary
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
}
}