-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80ad72f
commit 9cde033
Showing
20 changed files
with
285 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
endtoendtests/src/main/java/com/microsoft/azure/functions/endtoend/CosmosDBTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oendtests/src/main/java/com/microsoft/azure/functions/endtoend/EventGridTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
endtoendtests/src/main/java/com/microsoft/azure/functions/endtoend/EventHubTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
endtoendtests/src/main/java/com/microsoft/azure/functions/endtoend/HttpTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
endtoendtests/src/main/java/com/microsoft/azure/functions/endtoend/QueueTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sts/src/main/java/com/microsoft/azure/functions/endtoend/ServiceBusQueueTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...sts/src/main/java/com/microsoft/azure/functions/endtoend/ServiceBusTopicTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
endtoendtests/src/main/java/com/microsoft/azure/functions/endtoend/TableTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
endtoendtests/src/main/java/com/microsoft/azure/functions/endtoend/TimerTriggerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
.../java/com/microsoft/azure/functions/worker/binding/tests/RpcByteArrayDataSourceTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.microsoft.azure.functions.worker.binding.tests; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.lang.invoke.WrongMethodTypeException; | ||
import java.util.Optional; | ||
|
||
import org.apache.commons.lang3.ArrayUtils; | ||
import org.junit.Test; | ||
|
||
import com.google.protobuf.ByteString; | ||
import com.microsoft.azure.functions.worker.binding.BindingData; | ||
import com.microsoft.azure.functions.worker.binding.RpcByteArrayDataSource; | ||
|
||
public class RpcByteArrayDataSourceTests { | ||
|
||
@Test | ||
public void rpcByteArrayDataSource_To_byteArray() { | ||
String sourceKey = "testByteArray"; | ||
String expectedString = "Example String"; | ||
byte[] inputBytes = expectedString.getBytes(); | ||
ByteString inputByteString = ByteString.copyFrom(inputBytes); | ||
RpcByteArrayDataSource stringData = new RpcByteArrayDataSource(sourceKey, inputByteString); | ||
|
||
|
||
Optional<BindingData> actualBindingData = stringData.computeByName(sourceKey, byte[].class); | ||
BindingData actualArg = actualBindingData.orElseThrow(WrongMethodTypeException::new); | ||
byte[] actualBytes = (byte[])actualArg.getValue(); | ||
String actualString = new String (actualBytes); | ||
assertEquals(actualString, expectedString); | ||
} | ||
|
||
@Test | ||
public void rpcByteArrayDataSource_To_ByteArray() { | ||
String sourceKey = "testByteArray"; | ||
String expectedString = "Example String"; | ||
byte[] inputBytes = expectedString.getBytes(); | ||
ByteString inputByteString = ByteString.copyFrom(inputBytes); | ||
RpcByteArrayDataSource stringData = new RpcByteArrayDataSource(sourceKey, inputByteString); | ||
|
||
|
||
Optional<BindingData> actualBindingData = stringData.computeByName(sourceKey, Byte[].class); | ||
BindingData actualArg = actualBindingData.orElseThrow(WrongMethodTypeException::new); | ||
Byte[] actualBytes = (Byte[])actualArg.getValue(); | ||
String actualString = new String (ArrayUtils.toPrimitive(actualBytes)); | ||
assertEquals(actualString, expectedString); | ||
} | ||
} |
Oops, something went wrong.