Tabnine Logo
BaseBlobSignerLiveTest
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseBlobSignerLiveTest
in
org.jclouds.blobstore.integration.internal

Best Java code snippets using org.jclouds.blobstore.integration.internal.BaseBlobSignerLiveTest (Showing top 20 results out of 315)

origin: apache/jclouds

@Test
public void testSignPutUrlWithTimeExpired() throws Exception {
  testSignPutUrlWithTime(-getSignedUrlTimeout());
}
origin: apache/jclouds

@Test
public void testSignGetUrlWithTimeExpired() throws InterruptedException, IOException {
  testSignGetUrlWithTime(-getSignedUrlTimeout());
}
origin: jclouds/legacy-jclouds

@Override
protected Properties setupProperties() {
 Properties props = super.setupProperties();
 setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
 return props;
}
origin: jclouds/legacy-jclouds

@Test
public void testSignPutUrl() throws Exception {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   HttpRequest request = view.getSigner().signPutBlob(container, blob);
   assertEquals(request.getFilters().size(), 0);
   Strings2.toString(view.utils().http().invoke(request).getPayload());
   assertConsistencyAwareContainerSize(container, 1);
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

@Test
public void testSignGetUrlWithTime() throws InterruptedException, IOException {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   view.getBlobStore().putBlob(container, blob);
   assertConsistencyAwareContainerSize(container, 1);
   HttpRequest request = view.getSigner().signGetBlob(container, name, getSignedUrlTimeout());
   assertEquals(request.getFilters().size(), 0);
   assertEquals(Strings2.toStringAndClose(view.utils().http().invoke(request).getPayload().openStream()), text);
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

  @Test
  public void testSignPutUrlWithTimeExpired() throws Exception {
   // Intentionally try with a timeout of 0. AWS signature v4 throws an error if
   // the timeout is negative.
   super.testSignPutUrlWithTime(/*timeout=*/ 0);
  }
}
origin: apache/jclouds

@Test
public void testSignPutUrl() throws Exception {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("image/png").build();
 String container = getContainerName();
 try {
   HttpRequest request = view.getSigner().signPutBlob(container, blob);
   assertEquals(request.getFilters().size(), 0);
   Strings2.toStringAndClose(view.utils().http().invoke(request).getPayload().openStream());
   blob = view.getBlobStore().getBlob(container, name);
   assertThat(blob.getMetadata().getContentMetadata().getContentType()).isEqualTo("image/png");
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

@Test
public void testSignPutUrlWithTime() throws Exception {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   HttpRequest request = view.getSigner().signPutBlob(container, blob, getSignedUrlTimeout());
   assertEquals(request.getFilters().size(), 0);
   // Strip Expect: 100-continue to make actual responses visible, since
   // Java 7+ will throw a ProtocolException instead of setting the response code:
   // http://www.docjar.com/html/api/sun/net/www/protocol/http/HttpURLConnection.java.html#1021
   request = request.toBuilder().removeHeader(EXPECT).build();
   Strings2.toStringAndClose(view.utils().http().invoke(request).getPayload().openStream());
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

@Test
public void testSignGetUrlWithTimeExpired() throws InterruptedException, IOException {
 // Intentionally try with a timeout of 0. AWS signature v4 throws an error if
 // the timeout is negative.
 super.testSignGetUrlWithTime(/*timeout=*/ 0);
}
origin: apache/jclouds

  @Test
  public void testSignPutUrlWithTimeExpired() throws Exception {
   try {
     super.testSignPutUrlWithTimeExpired();
     fail();
   } catch (UnsupportedOperationException uoe) {
     throw new SkipException("not supported in Atmos", uoe);
   }
  }
}
origin: jclouds/legacy-jclouds

@Test
public void testSignGetUrl() throws Exception {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   view.getBlobStore().putBlob(container, blob);
   assertConsistencyAwareContainerSize(container, 1);
   HttpRequest request = view.getSigner().signGetBlob(container, name);
   assertEquals(request.getFilters().size(), 0);
   assertEquals(Strings2.toString(view.utils().http().invoke(request).getPayload()), text);
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

@Test
public void testSignPutUrlWithTime() throws Exception {
 try {
   super.testSignPutUrlWithTime();
   fail();
 } catch (UnsupportedOperationException uoe) {
   throw new SkipException("not supported in Atmos", uoe);
 }
}
origin: apache/jclouds

public void testSignPutUrlWithTime(final long timeout) throws InterruptedException, IOException {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   HttpRequest request = view.getSigner().signPutBlob(container, blob, 0);
   assertEquals(request.getFilters().size(), 0);
   // Strip Expect: 100-continue to make actual responses visible, since
   // Java 7+ will throw a ProtocolException instead of setting the response code:
   // http://www.docjar.com/html/api/sun/net/www/protocol/http/HttpURLConnection.java.html#1021
   request = request.toBuilder().removeHeader(EXPECT).build();
   try {
    Strings2.toStringAndClose(view.utils().http().invoke(request).getPayload().openStream());
    fail("Temporary URL did not expire as expected");
   } catch (AuthorizationException expected) {
   }
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

@Test
public void testSignGetUrlWithTime() throws InterruptedException, IOException {
 try {
   super.testSignGetUrlWithTime();
   failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
 } catch (UnsupportedOperationException uoe) {
   throw new SkipException("unsupported by B2", uoe);
 }
}
origin: apache/jclouds

  @Test
  public void testSignPutUrlWithTimeExpired() throws Exception {
   try {
     super.testSignPutUrlWithTimeExpired();
     failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
   } catch (UnsupportedOperationException uoe) {
     throw new SkipException("unsupported by B2", uoe);
   }
  }
}
origin: jclouds/legacy-jclouds

@Test
public void testSignGetUrlOptions() throws Exception {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   view.getBlobStore().putBlob(container, blob);
   assertConsistencyAwareContainerSize(container, 1);
   HttpRequest request = view.getSigner().signGetBlob(container, name, range(0, 1));
   assertEquals(request.getFilters().size(), 0);
   assertEquals(Strings2.toString(view.utils().http().invoke(request).getPayload()), "fo");
 } finally {
   returnContainer(container);
 }
}
origin: apache/jclouds

@Test
public void testSignPutUrlWithTime() throws Exception {
 try {
   super.testSignPutUrlWithTime();
   failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
 } catch (UnsupportedOperationException uoe) {
   throw new SkipException("unsupported by B2", uoe);
 }
}
origin: apache/jclouds

  @Override
  protected Properties setupProperties() {
   Properties props = super.setupProperties();
   setIfTestSystemPropertyPresent(props, CREDENTIAL_TYPE);
   return props;
  }
}
origin: apache/jclouds

@Test
public void testSignGetUrl() throws Exception {
 String name = "hello";
 String text = "fooooooooooooooooooooooo";
 Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
 String container = getContainerName();
 try {
   view.getBlobStore().putBlob(container, blob);
   assertConsistencyAwareContainerSize(container, 1);
   HttpRequest request = view.getSigner().signGetBlob(container, name);
   assertEquals(request.getFilters().size(), 0);
   assertEquals(Strings2.toStringAndClose(view.utils().http().invoke(request).getPayload().openStream()), text);
 } finally {
   returnContainer(container);
 }
}
origin: jclouds/legacy-jclouds

  @Test
  public void testSignRemoveUrl() throws Exception {
   String name = "hello";
   String text = "fooooooooooooooooooooooo";

   Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
   String container = getContainerName();
   try {
     view.getBlobStore().putBlob(container, blob);
     assertConsistencyAwareContainerSize(container, 1);
     HttpRequest request = view.getSigner().signRemoveBlob(container, name);
     assertEquals(request.getFilters().size(), 0);
     view.utils().http().invoke(request);
     assert !view.getBlobStore().blobExists(container, name);
   } finally {
     returnContainer(container);
   }
  }
}
org.jclouds.blobstore.integration.internalBaseBlobSignerLiveTest

Javadoc

Tests integrated functionality of all signature commands.

Each test uses a different container name, so it should be perfectly fine to run in parallel.

Most used methods

  • testSignPutUrlWithTime
  • testSignGetUrlWithTime
  • assertConsistencyAwareContainerSize
  • getContainerName
  • returnContainer
  • setupProperties
  • testSignPutUrlWithTimeExpired
  • getSignedUrlTimeout
  • testSignGetUrl
  • testSignGetUrlOptions
  • testSignGetUrlWithTimeExpired
  • testSignPutUrl
  • testSignGetUrlWithTimeExpired,
  • testSignPutUrl

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now