Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live test fix #13207

Merged
merged 15 commits into from
Jul 20, 2020
Prev Previous commit
Next Next commit
Added slf4j
  • Loading branch information
rickle-msft committed Jul 15, 2020
commit 8117125404c3a184ba3f5cceb98ec2a6ecbd1f02
6 changes: 6 additions & 0 deletions sdk/storage/azure-storage-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class APISpec extends Specification {

static final String garbageLeaseID = UUID.randomUUID().toString()

public static final String defaultEndpointTemplate = "https://%s.blob.core.windows.net/"
public static final String defaultEndpointTemplate = "http://%s.blob.core.windows.net/"

static def AZURE_TEST_MODE = "AZURE_TEST_MODE"
static def PRIMARY_STORAGE = "PRIMARY_STORAGE_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,12 @@ class BlobAPITest extends APISpec {

def "Undelete"() {
setup:
String SLF4J_LOG_FILE_PROPERTY = "org.slf4j.simpleLogger.logFile";
String SLF4J_CACHED_STREAM_PROPERTY = "org.slf4j.simpleLogger.cacheOutputStream";
String SLF4J_TEST_LOG_FILE = "System.out";
String SLF4J_TEST_CACHED_STREAM = "false";
System.setProperty(SLF4J_LOG_FILE_PROPERTY, SLF4J_TEST_LOG_FILE);
System.setProperty(SLF4J_CACHED_STREAM_PROPERTY, SLF4J_TEST_CACHED_STREAM)
enableSoftDelete()
System.out.println("Soft delete successfully enabled: " +
primaryBlobServiceClient.getProperties().getDeleteRetentionPolicy().isEnabled())
Expand All @@ -2274,6 +2280,7 @@ class BlobAPITest extends APISpec {

System.out.println("Getting properties")
bc.getProperties()
System.out.println("Got properties")

then:
notThrown(BlobStorageException)
Expand All @@ -2282,6 +2289,10 @@ class BlobAPITest extends APISpec {
undeleteHeaders.getValue("Date") != null

disableSoftDelete() == null

cleanup:
System.clearProperty(SLF4J_LOG_FILE_PROPERTY);
System.clearProperty(SLF4J_CACHED_STREAM_PROPERTY);
}

def "Undelete min"() {
Expand Down