Skip to content

Commit

Permalink
Merge pull request #85 from Azure/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
xinchen10 authored Dec 9, 2017
2 parents bcf6438 + 09bc166 commit 11ed647
Show file tree
Hide file tree
Showing 17 changed files with 6,385 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Azure.Amqp.Amqp</RootNamespace>
<RootNamespace>Microsoft.Azure.Amqp</RootNamespace>
<AssemblyName>Microsoft.Azure.Amqp</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
Expand Down
4 changes: 2 additions & 2 deletions Microsoft.Azure.Amqp.Android/Resources/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Microsoft.Azure.Amqp/Amqp/FaultTolerantAmqpObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public bool TryGetOpenedObject(out T openedAmqpObject)

protected override async Task<T> OnCreateAsync(TimeSpan timeout)
{
T amqpObject = await this.createObjectAsync(timeout);
T amqpObject = await this.createObjectAsync(timeout).ConfigureAwait(false);
amqpObject.SafeAddClosed(OnObjectClosed);
return amqpObject;
}
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Amqp/Properties/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyInformationalVersion("2.1.2")]
[assembly: AssemblyInformationalVersion("2.1.3")]
4 changes: 2 additions & 2 deletions Microsoft.Azure.Amqp/Singleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public async Task<TValue> GetOrCreateAsync(TimeSpan timeout)

if (this.TryGet(out tcs))
{
return await tcs.Task;
return await tcs.Task.ConfigureAwait(false);
}

tcs = new TaskCompletionSource<TValue>();
Expand Down Expand Up @@ -175,7 +175,7 @@ async Task CreateValue(TaskCompletionSource<TValue> tcs, TimeSpan timeout)
{
try
{
TValue value = await OnCreateAsync(timeout);
TValue value = await OnCreateAsync(timeout).ConfigureAwait(false);
tcs.SetResult(value);

if (this.disposed)
Expand Down
43 changes: 41 additions & 2 deletions Microsoft_Azure_Amqp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Microsoft.Amqp.Core",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Microsoft.Amqp.Uwp", "test\Test.Microsoft.Amqp.Uwp\Test.Microsoft.Amqp.Uwp.csproj", "{F2A0CB73-B9DB-4898-A103-40213F83366D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Microsoft.Amqp.Android", "test\Test.Microsoft.Amqp.Android\Test.Microsoft.Amqp.Android.csproj", "{1E57D852-93CF-464F-B3A4-B660C8B23FA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -270,6 +272,42 @@ Global
{F2A0CB73-B9DB-4898-A103-40213F83366D}.Signed|x86.ActiveCfg = Release|x86
{F2A0CB73-B9DB-4898-A103-40213F83366D}.Signed|x86.Build.0 = Release|x86
{F2A0CB73-B9DB-4898-A103-40213F83366D}.Signed|x86.Deploy.0 = Release|x86
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|ARM.ActiveCfg = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|ARM.Build.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|ARM.Deploy.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|x64.ActiveCfg = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|x64.Build.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|x64.Deploy.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|x86.ActiveCfg = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|x86.Build.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Debug|x86.Deploy.0 = Debug|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|Any CPU.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|Any CPU.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|ARM.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|ARM.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|ARM.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|x64.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|x64.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|x64.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|x86.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|x86.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Release|x86.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|Any CPU.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|Any CPU.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|Any CPU.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|ARM.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|ARM.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|ARM.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|x64.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|x64.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|x64.Deploy.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|x86.ActiveCfg = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|x86.Build.0 = Release|Any CPU
{1E57D852-93CF-464F-B3A4-B660C8B23FA3}.Signed|x86.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -280,10 +318,11 @@ Global
{A08B02A1-4BCE-4DF5-A1E9-1809E9515D87} = {07A72A72-7CE5-46AE-B383-F4EA6408AE3C}
{EE065F14-D61A-4FF4-ACB3-362CC36B7449} = {07A72A72-7CE5-46AE-B383-F4EA6408AE3C}
{F2A0CB73-B9DB-4898-A103-40213F83366D} = {07A72A72-7CE5-46AE-B383-F4EA6408AE3C}
{1E57D852-93CF-464F-B3A4-B660C8B23FA3} = {07A72A72-7CE5-46AE-B383-F4EA6408AE3C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5982C678-B29E-487B-9B3E-7F547EC1222D}
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8;packages\EnterpriseLibrary.TransientFaultHandling.WindowsAzure.Storage.6.0.1304.1\lib\NET45;packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
SolutionGuid = {5982C678-B29E-487B-9B3E-7F547EC1222D}
EndGlobalSection
EndGlobal
19 changes: 19 additions & 0 deletions test/Test.Microsoft.Amqp.Android/Assets/AboutAssets.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".

These files will be deployed with you package and will be accessible using Android's
AssetManager, like this:

public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

InputStream input = Assets.Open ("my_asset.txt");
}
}

Additionally, some Android functions will automatically load asset files:

Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
4 changes: 4 additions & 0 deletions test/Test.Microsoft.Amqp.Android/GettingStarted.Xamarin
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<GettingStarted>
<LocalContent>GS\Android\CS\AndroidApp\GettingStarted.html</LocalContent>
<EmbeddedNavigation>false</EmbeddedNavigation>
</GettingStarted>
43 changes: 43 additions & 0 deletions test/Test.Microsoft.Amqp.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Reflection;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

using Xunit.Sdk;
using Xunit.Runners.UI;

namespace Test.Microsoft.Amqp.Android
{
[Activity(Label = "xUnit Android Runner", MainLauncher = true, Theme= "@android:style/Theme.Material.Light")]
public class MainActivity : RunnerActivity
{

protected override void OnCreate(Bundle bundle)
{
// tests can be inside the main assembly
AddTestAssembly(Assembly.GetExecutingAssembly());

AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);
// or in any reference assemblies

//AddTestAssembly(typeof(PortableTests).Assembly);
// or in any assembly that you load (since JIT is available)

#if false
// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
Writer = new TcpTextWriter ("10.0.1.2", 16384);
// start running the test suites as soon as the application is loaded
AutoStart = true;
// crash the application (to ensure it's ended) and return to springboard
TerminateAfterExecution = true;
#endif
// you cannot add more assemblies once calling base
base.OnCreate(bundle);
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Test.Microsoft.Amqp.Android.Test.Microsoft.Amqp.Android"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="21" />
<application android:allowBackup="true" android:label="@string/app_name">
</application>
</manifest>
30 changes: 30 additions & 0 deletions test/Test.Microsoft.Amqp.Android/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Test.Microsoft.Amqp.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test.Microsoft.Amqp.Android")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
44 changes: 44 additions & 0 deletions test/Test.Microsoft.Amqp.Android/Resources/AboutResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
drawable/
icon.png

layout/
main.axml

values/
strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:

public class R {
public class drawable {
public const int icon = 0x123;
}

public class layout {
public const int main = 0x456;
}

public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}

You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
Loading

0 comments on commit 11ed647

Please sign in to comment.