Repository: incubator-reef
Updated Branches:
  refs/heads/master ff336f33f -> fea1fbd3d


[REEF-652]  Fix broken class hierarchy tests

This updates the test files (evaluator.conf) and `TestClassHierarchy` to
no longer use static variables.

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

Pull Request:
  This closes #423


Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/fea1fbd3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/fea1fbd3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/fea1fbd3

Branch: refs/heads/master
Commit: fea1fbd3d90dd965369497d1cc8480aa1ed37dd1
Parents: ff336f3
Author: Julia Wang <juw...@microsoft.com>
Authored: Wed Aug 26 17:54:27 2015 -0700
Committer: Markus Weimer <wei...@apache.org>
Committed: Thu Aug 27 13:31:06 2015 -0700

----------------------------------------------------------------------
 .../EvaluatorConfigurationsTests.cs             |   4 +-
 .../ConfigFiles/evaluator.conf                  | Bin 2997 -> 3189 bytes
 .../ClassHierarchy/TestClassHierarchy.cs        |  19 ++---
 .../TestClassHierarchyRoundTrip.cs              |  69 -------------------
 .../Org.Apache.REEF.Tang.Tests.csproj           |   3 +-
 5 files changed, 9 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/fea1fbd3/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs 
b/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs
index 0f3f2dd..6c9385a 100644
--- a/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs
+++ b/lang/cs/Org.Apache.REEF.Evaluator.Tests/EvaluatorConfigurationsTests.cs
@@ -44,9 +44,9 @@ namespace Org.Apache.REEF.Evaluator.Tests
             Logger.Log(Level.Info, "ApplicationId = " + aId);
             Logger.Log(Level.Info, "ErrorHandlerRID = " + rId);
 
-            Assert.IsTrue(eId.Equals("Node-1-1440108430564"));
+            Assert.IsTrue(eId.Equals("Node-1-1440635067509"));
             Assert.IsTrue(aId.Equals("REEF_LOCAL_RUNTIME"));
-            Assert.IsTrue(rId.Equals("socket://10.130.68.76:9528"));
+            Assert.IsTrue(rId.Equals("socket://10.130.68.76:9316"));
 
             var contextConfigString = 
evaluatorConfigurations.RootContextConfigurationString;
             var serviceConfigString = 
evaluatorConfigurations.RootServiceConfigurationString;

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/fea1fbd3/lang/cs/Org.Apache.REEF.Examples/ConfigFiles/evaluator.conf
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Examples/ConfigFiles/evaluator.conf 
b/lang/cs/Org.Apache.REEF.Examples/ConfigFiles/evaluator.conf
index a3578bd..53a751d 100644
Binary files a/lang/cs/Org.Apache.REEF.Examples/ConfigFiles/evaluator.conf and 
b/lang/cs/Org.Apache.REEF.Examples/ConfigFiles/evaluator.conf differ

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/fea1fbd3/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs 
b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
index af3c4aa..f6e36b5 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs
@@ -35,23 +35,16 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy
     [TestClass]
     public class TestClassHierarchy
     {
-        public static IClassHierarchy ns;
-
-        [ClassInitialize]
-        public static void ClassSetup(TestContext context)
-        {
-            TangImpl.Reset();
-            ns = TangFactory.GetTang().GetClassHierarchy(new string[] { 
FileNames.Examples, FileNames.Common, FileNames.Tasks });
-       }
-
-        [ClassCleanup]
-        public static void ClassCleanup()
-        {
-        }
+        public IClassHierarchy ns = null;
 
         [TestInitialize()]
         public void TestSetup()
         {
+            if (ns == null)
+            {
+                TangImpl.Reset();
+                ns = TangFactory.GetTang().GetClassHierarchy(new string[] 
{FileNames.Examples, FileNames.Common, FileNames.Tasks});
+            }
         }
 
         [TestCleanup()]

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/fea1fbd3/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchyRoundTrip.cs
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchyRoundTrip.cs
 
b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchyRoundTrip.cs
deleted file mode 100644
index bebc739..0000000
--- 
a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchyRoundTrip.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using System.Globalization;
-using System.IO;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Org.Apache.REEF.Tang.Examples;
-using Org.Apache.REEF.Tang.Implementations.Tang;
-using Org.Apache.REEF.Tang.Protobuf;
-
-namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy
-{
-    [TestClass]
-    public class TestClassHierarchyRoundTrip : TestClassHierarchy
-    {
-        private void setup1()
-        {
-            TangImpl.Reset();
-            ns = TangFactory.GetTang().GetClassHierarchy(new string[] { 
FileNames.Examples, FileNames.Common, FileNames.Tasks });
-        }
-
-        private void setup2()
-        {
-            TangImpl.Reset();
-            ns = new 
ProtocolBufferClassHierarchy(ProtocolBufferClassHierarchy.Serialize(ns));
-        }
-
-        private void setup3()
-        {
-            TangImpl.Reset();
-            try
-            {
-                ProtocolBufferClassHierarchy.Serialize("testProto.bin", ns);
-                ns = ProtocolBufferClassHierarchy.DeSerialize("testProto.bin");
-            }
-            catch (IOException e)
-            {
-                Assert.Fail(string.Format(CultureInfo.CurrentCulture, 
"IOException when serialize/deserialize proto buffer file", e));
-            }
-        }
-
-        //[TestMethod]
-        //public new void TestString() 
-        //{
-        //    setup1();
-        //    base.TestSimpleConstructors();
-        //    setup2();
-        //    base.TestSimpleConstructors();
-        //    setup3();
-        //    base.TestSimpleConstructors();
-        //}
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/fea1fbd3/lang/cs/Org.Apache.REEF.Tang.Tests/Org.Apache.REEF.Tang.Tests.csproj
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Tang.Tests/Org.Apache.REEF.Tang.Tests.csproj 
b/lang/cs/Org.Apache.REEF.Tang.Tests/Org.Apache.REEF.Tang.Tests.csproj
index b88cde8..0c74c2d 100644
--- a/lang/cs/Org.Apache.REEF.Tang.Tests/Org.Apache.REEF.Tang.Tests.csproj
+++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Org.Apache.REEF.Tang.Tests.csproj
@@ -36,7 +36,7 @@ under the License.
     <Reference Include="Microsoft.Hadoop.Avro">
       
<HintPath>$(PackagesDir)\Microsoft.Hadoop.Avro.$(AvroVersion)\lib\net40\Microsoft.Hadoop.Avro.dll</HintPath>
     </Reference>
-        <Reference Include="Newtonsoft.Json">
+    <Reference Include="Newtonsoft.Json">
       
<HintPath>$(PackagesDir)\Newtonsoft.Json.$(NewtonsoftJsonVersion)\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, 
Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, 
processorArchitecture=MSIL" />
@@ -50,7 +50,6 @@ under the License.
     <Compile Include="ClassHierarchy\TestAnonymousType.cs" />
     <Compile Include="ClassHierarchy\TestAvroSerialization.cs" />
     <Compile Include="ClassHierarchy\TestClassHierarchy.cs" />
-    <Compile Include="ClassHierarchy\TestClassHierarchyRoundTrip.cs" />
     <Compile Include="ClassHierarchy\TestGeneric.cs" />
     <Compile Include="ClassHierarchy\TestMultipleInterface.cs" />
     <Compile Include="ClassHierarchy\TestParameterParser.cs" />

Reply via email to