File tree Expand file tree Collapse file tree
java/latte/latte_umbrella Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ package latte ;
3+ import java .io .BufferedReader ;
4+ import java .io .InputStream ;
5+ import java .io .InputStreamReader ;
6+ import java .util .ArrayList ;
7+
8+ import specification .Borrowed ;
9+ import specification .Free ;
10+ import specification .Shared ;
11+ import specification .Unique ;
12+
13+ import java .io .UnsupportedEncodingException ;
14+
15+ public class HttpEntityNoAnnotations {
16+
17+ public static void test (HttpResponse r ) throws UnsupportedEncodingException {
18+ HttpResponse response = r ;
19+ InputStream in = response .getEntity ().getContent ();
20+ BufferedReader reader = new BufferedReader (
21+ new InputStreamReader (
22+ response .getEntity ().getContent (), "UTF-8" )); // Second call to getEntity()
23+
24+ //Cannot call getContent twice if the entity is not repeatable. There is a method isRepeatable() to check
25+ }
26+ }
27+
28+ class HttpResponse {
29+ // TODO: STUB METHOD
30+ public HttpEntity getEntity () {
31+ return new HttpEntity ();
32+ }
33+ }
34+
35+ class HttpEntity {
36+ // TODO: STUB METHOD
37+ public InputStream getContent () {
38+ return (InputStream ) new Object ();
39+ }
40+ }
Original file line number Diff line number Diff line change @@ -79,6 +79,17 @@ public void testBox1(){
7979
8080 }
8181
82+
83+ @ Test
84+ public void testHttpEntityNoAnnotations (){
85+ try {
86+ App .launcher ("src/test/examples/HttpEntityNoAnnotations.java" );
87+ } catch (Exception e ) {
88+ e .printStackTrace ();
89+ assert (false );
90+ }
91+ }
92+
8293 /*
8394 * Incorrect Examples
8495 */
You can’t perform that action at this time.
0 commit comments