[REEF-1228] Fix TestDriverConfigGenerator failure on the first test run

This change modifies TestDriverConfigGenerator to extract
reef-bridge-java-<version>-shaded.jar from O.A.R.Client assembly resources
before running tests.

JIRA:
  [REEF-1228](https://issues.apache.org/jira/browse/REEF-1228)

Pull request:
  This closes #
diff --git a/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs b/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs
index 7c63498..f579ee1 100644
--- a/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs
+++ b/lang/cs/Org.Apache.REEF.Client/Common/DriverFolderPreparationHelper.cs
@@ -21,6 +21,7 @@
 using Org.Apache.REEF.Client.API;
 using Org.Apache.REEF.Common;
 using Org.Apache.REEF.Common.Files;
+using Org.Apache.REEF.Common.Jar;
 using Org.Apache.REEF.Tang.Annotations;
 using Org.Apache.REEF.Tang.Formats;
 using Org.Apache.REEF.Tang.Implementations.Configuration;
@@ -35,8 +36,6 @@
     {
         private const string DLLFileNameExtension = ".dll";
         private const string EXEFileNameExtension = ".exe";
-        private const string BridgeExe = "Org.Apache.REEF.Bridge.exe";
-        private const string ClrDriverFullName = "ClrDriverFullName";
         private const string DefaultDriverConfigurationFileContents =
         @"<configuration>" +
         @"  <runtime>" +
@@ -46,21 +45,6 @@
         @"  </runtime>" +
         @"</configuration>";
 
-        // We embed certain binaries in client dll.
-        // Following items in tuples refer to resource names in Org.Apache.REEF.Client.dll
-        // The first resource item contains the name of the file 
-        // such as "reef-bridge-java-0.13.0-SNAPSHOT-shaded.jar". The second resource
-        // item contains the byte contents for said file.
-        // Please note that the identifiers below need to be in sync with 2 other files
-        // 1. $(SolutionDir)\Org.Apache.REEF.Client\Properties\Resources.xml
-        // 2. $(SolutionDir)\Org.Apache.REEF.Client\Org.Apache.REEF.Client.csproj
-        private readonly static Tuple<string, string>[] clientFileResources = new Tuple<string, string>[]
-        {
-            new Tuple<string, string>("ClientJarFullName", "reef_bridge_client"),
-            new Tuple<string, string>("DriverJarFullName", "reef_bridge_driver"),
-            new Tuple<string, string>(ClrDriverFullName,    "reef_clrdriver"),
-        };
-
         private static readonly Logger Logger = Logger.GetLogger(typeof(DriverFolderPreparationHelper));
         private readonly AvroConfigurationSerializer _configurationSerializer;
         private readonly REEFFileNames _fileNames;
@@ -135,14 +119,14 @@
             Directory.CreateDirectory(Path.Combine(driverFolderPath, _fileNames.GetGlobalFolderPath()));
 
             var resourceHelper = new ResourceHelper(typeof(DriverFolderPreparationHelper).Assembly);
-            foreach (var fileResources in clientFileResources)
+            foreach (var fileResources in ResourceHelper.FileResources)
             {
-                var fileName = resourceHelper.GetString(fileResources.Item1);
-                if (ClrDriverFullName == fileResources.Item1)
+                var fileName = resourceHelper.GetString(fileResources.Key);
+                if (ResourceHelper.ClrDriverFullName == fileResources.Key)
                 {
                     fileName = Path.Combine(driverFolderPath, _fileNames.GetBridgeExePath());
                 }
-                File.WriteAllBytes(fileName, resourceHelper.GetBytes(fileResources.Item2));
+                File.WriteAllBytes(fileName, resourceHelper.GetBytes(fileResources.Value));
             }
             
             var config = DefaultDriverConfigurationFileContents;
diff --git a/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj b/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
index aefc5fe..6996ff5 100644
--- a/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
+++ b/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
@@ -92,7 +92,6 @@
     <Compile Include="Common\JobSubmissionResult.cs" />
     <Compile Include="Common\JavaClientLauncher.cs" />
     <Compile Include="Common\ResourceArchiveFileGenerator.cs" />
-    <Compile Include="Common\ResourceHelper.cs" />
     <Compile Include="Local\LocalClient.cs" />
     <Compile Include="Local\LocalJobSubmissionResult.cs" />
     <Compile Include="Local\LocalRuntimeClientConfiguration.cs" />
diff --git a/lang/cs/Org.Apache.REEF.Client/Common/ResourceHelper.cs b/lang/cs/Org.Apache.REEF.Common/Jar/ResourceHelper.cs
similarity index 68%
rename from lang/cs/Org.Apache.REEF.Client/Common/ResourceHelper.cs
rename to lang/cs/Org.Apache.REEF.Common/Jar/ResourceHelper.cs
index 84920fa..e6aafec 100644
--- a/lang/cs/Org.Apache.REEF.Client/Common/ResourceHelper.cs
+++ b/lang/cs/Org.Apache.REEF.Common/Jar/ResourceHelper.cs
@@ -16,17 +16,39 @@
 // under the License.
 
 using System;
+using System.Collections.Generic;
 using System.Reflection;
 using System.Resources;
+using Org.Apache.REEF.Utilities.Attributes;
 
-namespace Org.Apache.REEF.Client.Common
+namespace Org.Apache.REEF.Common.Jar
 {
     /// <summary>
     /// Helps with retrieval of embedded resources.
     /// See Org.Apache.REEF.Client.csproj for embedding resources and use this class to retrieve them.
     /// </summary>
-    internal class ResourceHelper
+    [Private]
+    public class ResourceHelper
     {
+        public const string ClientJarFullName = "ClientJarFullName";
+        public const string DriverJarFullName = "DriverJarFullName";
+        public const string ClrDriverFullName = "ClrDriverFullName";
+
+        // We embed certain binaries in client dll.
+        // Following items in tuples refer to resource names in Org.Apache.REEF.Client.dll
+        // The first resource item contains the name of the file 
+        // such as "reef-bridge-java-<version>-shaded.jar". The second resource
+        // item contains the byte contents for said file.
+        // Please note that the identifiers below need to be in sync with 2 other files
+        // 1. $(SolutionDir)\Org.Apache.REEF.Client\Properties\Resources.xml
+        // 2. $(SolutionDir)\Org.Apache.REEF.Client\Org.Apache.REEF.Client.csproj
+        public readonly static Dictionary<string, string> FileResources = new Dictionary<string, string>
+        {
+            { ClientJarFullName, "reef_bridge_client" },
+            { DriverJarFullName, "reef_bridge_driver" },
+            { ClrDriverFullName, "reef_clrdriver" },
+        };
+
         private const string CouldNotRetrieveResource = "Could not retrieve resource '{0}'";
         private readonly ResourceSet _resourceSet;
 
@@ -35,7 +57,7 @@
         /// </summary>
         /// <param name="assembly"></param>
         /// <returns>ResourceSet</returns>
-        internal ResourceHelper(Assembly assembly)
+        public ResourceHelper(Assembly assembly)
         {
             var names = assembly.GetManifestResourceNames();
             if (null == names[0])
@@ -71,7 +93,7 @@
         /// </summary>
         /// <param name="resourceName"></param>
         /// <returns>T</returns>
-        internal string GetString(string resourceName)
+        public string GetString(string resourceName)
         {
             return GetResource<string>(resourceName);
         }
@@ -81,7 +103,7 @@
         /// </summary>
         /// <param name="resourceName"></param>
         /// <returns>T</returns>
-        internal byte[] GetBytes(string resourceName)
+        public byte[] GetBytes(string resourceName)
         {
             return GetResource<byte[]>(resourceName);
         }
diff --git a/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj b/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
index 22f5408..c2d2e79 100644
--- a/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
+++ b/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
@@ -107,6 +107,7 @@
     <Compile Include="Io\NamingConfiguration.cs" />
     <Compile Include="Io\NamingConfigurationOptions.cs" />
     <Compile Include="Io\TcpPortConfigurationProvider.cs" />
+    <Compile Include="Jar\ResourceHelper.cs" />
     <Compile Include="ITaskSubmittable.cs" />
     <Compile Include="Client\Parameters\DriverConfigurationProviders.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/lang/cs/Org.Apache.REEF.Tests/Utility/TestDriverConfigGenerator.cs b/lang/cs/Org.Apache.REEF.Tests/Utility/TestDriverConfigGenerator.cs
index 6b89232..7d55f41 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Utility/TestDriverConfigGenerator.cs
+++ b/lang/cs/Org.Apache.REEF.Tests/Utility/TestDriverConfigGenerator.cs
@@ -16,13 +16,27 @@
 // under the License.
 
 using System;
+using System.IO;
 using Org.Apache.REEF.Driver;
+using Org.Apache.REEF.Client.Common;
+using Org.Apache.REEF.Common.Jar;
 using Xunit;
 
 namespace Org.Apache.REEF.Tests.Utility
 {
     public class TestDriverConfigGenerator
     {
+        public TestDriverConfigGenerator()
+        {
+            var resourceHelper = new ResourceHelper(typeof(IJobSubmissionResult).Assembly);
+            var fileName = resourceHelper.GetString(ResourceHelper.DriverJarFullName);
+            if (!File.Exists(fileName))
+            {
+                File.WriteAllBytes(fileName, 
+                    resourceHelper.GetBytes(ResourceHelper.FileResources[ResourceHelper.DriverJarFullName]));
+            }
+        }
+
         [Fact]
         public void TestGeneratingFullDriverConfigFile()
         {