Skip to content

Commit

Permalink
fixed build error (.isBlank)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuniteru committed Nov 25, 2021
1 parent f61e544 commit cb91d49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion plugins/protocol/storagequeue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>jp.co.pnop</groupId>
<artifactId>jmeter-plugins-azure-storage-queue</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>

<name>Azure Storage Queue Sampler</name>
<description>Sample to Azure Storage Queue</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.apache.jmeter.testelement.AbstractTestElement;
import org.apache.jmeter.testelement.property.StringProperty;
import org.apache.jorphan.util.JOrphanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -156,7 +157,7 @@ public String getMaskedParams() throws Exception {
.replaceAll("(SharedAccessSignature=)[^;]*([;$])", "$1********$2")
.replaceAll("(AccountKey=)[^;]*([;$])", "$1********$2");
params = params.concat("Connection string: ").concat(maskedConnectionString).concat("\n");
if (!getQueueName().isBlank()) {
if (!JOrphanUtils.isBlank(getQueueName())) {
params = params.concat("Queue name: ").concat(getQueueName()).concat("\n");
}
} else { // AUTHTYPE_SAS or AUTHTYPE_AAD
Expand All @@ -171,11 +172,11 @@ public String getMaskedParams() throws Exception {
.replaceAll("([\\?&]si=)[^\\?&]*", "$1****")
.replaceAll("([\\?&]sig=)[^\\?&]*", "$1********");
params = params.concat("Endpoint Url: ").concat(maskedEndpointUrl).concat("\n");
if (!getQueueName().isBlank()) {
if (!JOrphanUtils.isBlank(getQueueName())) {
params = params.concat("Queue name: ").concat(getQueueName()).concat("\n");
}
if (authType.equals(AUTHTYPE_SAS)) {
if (!getSasToken().isBlank()) {
if (!JOrphanUtils.isBlank(getSasToken())) {
params = params.concat("SAS token: ********\n");
}
} else if (authType.equals(AUTHTYPE_AAD)) {
Expand All @@ -194,20 +195,20 @@ public QueueClient getConnection() throws Exception {

if (authType.equals(AUTHTYPE_CONNECTION_STRING) || authType.equals(AUTHTYPE_KEY)) {
queueClientBuilder = queueClientBuilder.connectionString(getConnectionString());
if (!getQueueName().isBlank()) {
if (!JOrphanUtils.isBlank(getQueueName())) {
queueClientBuilder = queueClientBuilder.queueName(getQueueName());
}
} else if (authType.equals(AUTHTYPE_SAS)) {
queueClientBuilder = queueClientBuilder.endpoint(getEndpointUrl());
if (!getQueueName().isBlank()) {
if (!JOrphanUtils.isBlank(getQueueName())) {
queueClientBuilder = queueClientBuilder.queueName(getQueueName());
}
if (!getSasToken().isBlank()) {
if (!JOrphanUtils.isBlank(getSasToken())) {
queueClientBuilder = queueClientBuilder.sasToken(getSasToken());
}
} else if (authType.equals(AUTHTYPE_AAD)) {
queueClientBuilder = queueClientBuilder.endpoint(getEndpointUrl());
if (!getQueueName().isBlank()) {
if (!JOrphanUtils.isBlank(getQueueName())) {
queueClientBuilder = queueClientBuilder.queueName(getQueueName());
}
AzAdCredentialComponentImpl credential = AzAdCredential.getCredential(getAadCredential());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.jmeter.testelement.TestStateListener;
import org.apache.jmeter.testelement.property.StringProperty;
import org.apache.jmeter.testelement.property.TestElementProperty;
import org.apache.jorphan.util.JOrphanUtils;

import com.azure.core.http.rest.Response;
import com.azure.storage.queue.*;
Expand Down Expand Up @@ -159,21 +160,21 @@ public SampleResult sample(Entry e) {
Duration visibilityTimeout = null;
Duration timeToLive = null;
Duration timeout = null;
if (!getVisibilityTimeout().isBlank()) {
if (!JOrphanUtils.isBlank(getVisibilityTimeout())) {
try {
visibilityTimeout = Duration.ofSeconds(Long.parseLong(getVisibilityTimeout()));
} catch (NumberFormatException exc) {
throw new NumberFormatException(exc.getMessage().concat(" [Visibility timeout]"));
}
}
if (!getTimeToLive().isBlank()) {
if (!JOrphanUtils.isBlank(getTimeToLive())) {
try {
timeToLive = Duration.ofSeconds(Long.parseLong(getTimeToLive()));
} catch (NumberFormatException exc) {
throw new NumberFormatException(exc.getMessage().concat(" [Time to live]"));
}
}
if (!getTimeout().isBlank()) {
if (!JOrphanUtils.isBlank(getTimeout())) {
try {
timeout = Duration.ofSeconds(Long.parseLong(getTimeout()));
} catch (NumberFormatException exc) {
Expand Down

0 comments on commit cb91d49

Please sign in to comment.