@@ -71,6 +71,23 @@ public void testReadAllowedLocalUser() throws Exception
71
71
getWebserviceClient ().read (Binary .class , created .getIdElement ().getIdPart ());
72
72
}
73
73
74
+ @ Test
75
+ public void testReadHeadAllowedLocalUser () throws Exception
76
+ {
77
+ final String contentType = MediaType .TEXT_PLAIN ;
78
+ final byte [] data = "Hello World" .getBytes (StandardCharsets .UTF_8 );
79
+
80
+ Binary binary = new Binary ();
81
+ binary .setContentType (contentType );
82
+ binary .setData (data );
83
+ getReadAccessHelper ().addLocal (binary );
84
+
85
+ BinaryDao binDao = getSpringWebApplicationContext ().getBean (BinaryDao .class );
86
+ Binary created = binDao .create (binary );
87
+
88
+ assertTrue (getWebserviceClient ().exists (Binary .class , created .getIdElement ().getIdPart ()));
89
+ }
90
+
74
91
@ Test
75
92
public void testReadAllowedLocalUserViaSecurityContext () throws Exception
76
93
{
@@ -2915,7 +2932,7 @@ public void testCreate8MiB() throws Exception
2915
2932
}
2916
2933
2917
2934
@ Test
2918
- public void testCreate4GiB () throws Exception
2935
+ public void testCreateReadDelete4GiB () throws Exception
2919
2936
{
2920
2937
long payloadSize = RandomInputStream .ONE_GIBIBYTE * 4 ;
2921
2938
@@ -2933,6 +2950,15 @@ public void testCreate4GiB() throws Exception
2933
2950
MediaType .APPLICATION_OCTET_STREAM_TYPE , securityContext );
2934
2951
assertNotNull (created );
2935
2952
2953
+ long t0h = System .currentTimeMillis ();
2954
+ assertTrue (getWebserviceClient ().exists (Binary .class , created .getIdPart (), created .getVersionIdPart ()));
2955
+ long t1h = System .currentTimeMillis ();
2956
+
2957
+ long headExecTime = t1h - t0h ;
2958
+ logger .info ("HTTP HEAD call finished in {} ms" , headExecTime );
2959
+ assertTrue ("HTTP HEAD call took longer then 200 ms, (" + headExecTime + ")" , headExecTime < 200 );
2960
+
2961
+ long t0g = System .currentTimeMillis ();
2936
2962
InputStream in = getWebserviceClient ().readBinary (created .getIdPart (), created .getVersionIdPart (),
2937
2963
MediaType .APPLICATION_OCTET_STREAM_TYPE );
2938
2964
@@ -2948,6 +2974,23 @@ public void testCreate4GiB() throws Exception
2948
2974
2949
2975
assertEquals (payloadSize , readSize );
2950
2976
}
2977
+ long t1g = System .currentTimeMillis ();
2978
+
2979
+ logger .info ("HTTP GET call finished in {} ms" , (t1g - t0g ));
2980
+
2981
+ long t0d = System .currentTimeMillis ();
2982
+ getWebserviceClient ().delete (Binary .class , created .getIdPart ());
2983
+ long t1d = System .currentTimeMillis ();
2984
+
2985
+ long deleteExecTime = t1d - t0d ;
2986
+ logger .info ("HTTP DELETE call finished in {} ms" , deleteExecTime );
2987
+ assertTrue ("HTTP DELETE call took longer then 200 ms, (" + deleteExecTime + ")" , deleteExecTime < 200 );
2988
+
2989
+ long t0pd = System .currentTimeMillis ();
2990
+ getWebserviceClient ().deletePermanently (Binary .class , created .getIdPart ());
2991
+ long t1pd = System .currentTimeMillis ();
2992
+
2993
+ logger .info ("Permanent delete call finished in {} ms" , (t1pd - t0pd ));
2951
2994
}
2952
2995
2953
2996
@ Test
0 commit comments