From c8800d7d736f2faf375f198ad1d92e9c925519c2 Mon Sep 17 00:00:00 2001
From: Dale Sikkema <dsikkema@ebay.com>
Date: Wed, 21 Oct 2015 18:23:09 -0500
Subject: [PATCH] MAGETWO-44154: Random PAT build failures due to 400/503 HTTP
 response errors being thrown  - rename makeGeneratedClassFileName

---
 .../testsuite/Magento/Framework/Code/GeneratorTest.php      | 6 +++---
 .../Test/Unit/Code/Generator/EntityChildTestAbstract.php    | 2 +-
 .../Api/Test/Unit/Code/Generator/GenerateMapperTest.php     | 2 +-
 .../Test/Unit/Code/Generator/GenerateSearchResultsTest.php  | 2 +-
 lib/internal/Magento/Framework/Code/Generator.php           | 2 +-
 .../Magento/Framework/Code/Generator/EntityAbstract.php     | 2 +-
 lib/internal/Magento/Framework/Code/Generator/Io.php        | 4 ++--
 .../Code/Test/Unit/Generator/EntityAbstractTest.php         | 2 +-
 .../Magento/Framework/Code/Test/Unit/Generator/IoTest.php   | 2 +-
 .../Magento/Framework/Code/Test/Unit/GeneratorTest.php      | 2 +-
 .../Test/Unit/Code/Generator/InterceptorTest.php            | 2 +-
 .../Test/Unit/Code/Generator/ConverterTest.php              | 2 +-
 .../ObjectManager/Test/Unit/Code/Generator/FactoryTest.php  | 2 +-
 .../Test/Unit/Code/Generator/GenerateRepositoryTest.php     | 2 +-
 .../ObjectManager/Test/Unit/Code/Generator/ProxyTest.php    | 2 +-
 .../Unit/Autoloader/ExtensionGeneratorAutoloader.php        | 2 +-
 16 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php
index 2b82c10311b..9bd4cb649bb 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php
@@ -95,7 +95,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase
         // This test is only valid if the factory created the object if Autoloader did not pick it up automatically
         if (\Magento\Framework\Code\Generator::GENERATION_SUCCESS == $generatorResult) {
             $content = $this->_clearDocBlock(
-                file_get_contents($this->_ioObject->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . 'Factory'))
+                file_get_contents($this->_ioObject->generateResultFileName(self::CLASS_NAME_WITH_NAMESPACE . 'Factory'))
             );
             $expectedContent = $this->_clearDocBlock(
                 file_get_contents(__DIR__ . '/_expected/SourceClassWithNamespaceFactory.php.sample')
@@ -120,7 +120,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase
         // This test is only valid if the factory created the object if Autoloader did not pick it up automatically
         if (\Magento\Framework\Code\Generator::GENERATION_SUCCESS == $generatorResult) {
             $content = $this->_clearDocBlock(
-                file_get_contents($this->_ioObject->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Proxy'))
+                file_get_contents($this->_ioObject->generateResultFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Proxy'))
             );
             $expectedContent = $this->_clearDocBlock(
                 file_get_contents(__DIR__ . '/_expected/SourceClassWithNamespaceProxy.php.sample')
@@ -142,7 +142,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase
         if (\Magento\Framework\Code\Generator::GENERATION_SUCCESS == $generatorResult) {
             $content = $this->_clearDocBlock(
                 file_get_contents(
-                    $this->_ioObject->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Interceptor')
+                    $this->_ioObject->generateResultFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Interceptor')
                 )
             );
             $expectedContent = $this->_clearDocBlock(
diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php
index 8f53d379a51..5ea51a6d560 100644
--- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php
+++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php
@@ -109,7 +109,7 @@ abstract class EntityChildTestAbstract extends \PHPUnit_Framework_TestCase
 
         //Mocking generation
         $this->ioObjectMock->expects($this->any())
-            ->method('makeGeneratedClassFileName')
+            ->method('generateResultFileName')
             ->with($this->getResultClassName())
             ->willReturn($resultFileName);
         $this->ioObjectMock->expects($this->once())
diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php
index fec3d96f8b5..bdc11e49ddd 100644
--- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php
+++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php
@@ -51,7 +51,7 @@ class GenerateMapperTest extends \PHPUnit_Framework_TestCase
         );
         $sampleMapperCode = file_get_contents(__DIR__ . '/_files/SampleMapper.txt');
         $this->ioObjectMock->expects($this->once())
-            ->method('makeGeneratedClassFileName')
+            ->method('generateResultFileName')
             ->with('\Magento\Framework\Api\Code\Generator\SampleMapper')
             ->will($this->returnValue('SampleMapper.php'));
         $this->ioObjectMock->expects($this->once())
diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php
index 5d54d23f55f..1f7609b0e92 100644
--- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php
+++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php
@@ -52,7 +52,7 @@ class GenerateSearchResultsTest extends \PHPUnit_Framework_TestCase
         );
         $sampleSearchResultBuilderCode = file_get_contents(__DIR__ . '/_files/SampleSearchResults.txt');
         $this->ioObjectMock->expects($this->once())
-            ->method('makeGeneratedClassFileName')
+            ->method('generateResultFileName')
             ->with('\Magento\Framework\Api\Code\Generator\SampleSearchResults')
             ->will($this->returnValue('SampleSearchResults.php'));
         $this->ioObjectMock->expects($this->once())
diff --git a/lib/internal/Magento/Framework/Code/Generator.php b/lib/internal/Magento/Framework/Code/Generator.php
index 39c8ae07219..2a572346e6a 100644
--- a/lib/internal/Magento/Framework/Code/Generator.php
+++ b/lib/internal/Magento/Framework/Code/Generator.php
@@ -191,7 +191,7 @@ class Generator
         if (!$resultEntityType || !$sourceClassName) {
             return self::GENERATION_ERROR;
         } else if ($this->definedClasses->isClassLoadableFromDisc($resultClass)) {
-            $generatedFileName = $this->_ioObject->makeGeneratedClassFileName($resultClass);
+            $generatedFileName = $this->_ioObject->generateResultFileName($resultClass);
             /**
              * Must handle two edge cases: a competing process has generated the class and written it to disc already,
              * or the class exists in committed code, despite matching pattern to be generated.
diff --git a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php
index d3ef4a0b54d..aed8424282e 100644
--- a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php
+++ b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php
@@ -97,7 +97,7 @@ abstract class EntityAbstract
             if ($this->_validateData()) {
                 $sourceCode = $this->_generateCode();
                 if ($sourceCode) {
-                    $fileName = $this->_ioObject->makeGeneratedClassFileName($this->_getResultClassName());
+                    $fileName = $this->_ioObject->generateResultFileName($this->_getResultClassName());
                     $this->_ioObject->writeResultFile($fileName, $sourceCode);
                     return $fileName;
                 } else {
diff --git a/lib/internal/Magento/Framework/Code/Generator/Io.php b/lib/internal/Magento/Framework/Code/Generator/Io.php
index d50b7fc8ae2..365482c797c 100644
--- a/lib/internal/Magento/Framework/Code/Generator/Io.php
+++ b/lib/internal/Magento/Framework/Code/Generator/Io.php
@@ -61,7 +61,7 @@ class Io
      */
     public function getResultFileDirectory($className)
     {
-        $fileName = $this->makeGeneratedClassFileName($className);
+        $fileName = $this->generateResultFileName($className);
         $pathParts = explode('/', $fileName);
         unset($pathParts[count($pathParts) - 1]);
 
@@ -72,7 +72,7 @@ class Io
      * @param string $className
      * @return string
      */
-    public function makeGeneratedClassFileName($className)
+    public function generateResultFileName($className)
     {
         return $this->_generationDirectory . ltrim(str_replace(['\\', '_'], '/', $className), '/') . '.php';
     }
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php
index 677685ce016..c10467f7cdf 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php
@@ -286,7 +286,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase
         if ($willWriteCode) {
             $ioObject->expects($this->once())->method('writeResultFile')->with(self::RESULT_FILE, self::RESULT_CODE);
         }
-        $ioObject->expects($this->any())->method('makeGeneratedClassFileName')->willReturn(self::RESULT_FILE);
+        $ioObject->expects($this->any())->method('generateResultFileName')->willReturn(self::RESULT_FILE);
 
         return [
             'source_class' => $mocks['source_class'],
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php
index e70255333e5..33b12746656 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php
@@ -72,7 +72,7 @@ class IoTest extends \PHPUnit_Framework_TestCase
     public function testGetResultFileName()
     {
         $expectedFileName = self::GENERATION_DIRECTORY . '/class/name.php';
-        $this->assertEquals($expectedFileName, $this->_object->makeGeneratedClassFileName(self::CLASS_NAME));
+        $this->assertEquals($expectedFileName, $this->_object->generateResultFileName(self::CLASS_NAME));
     }
 
     /**
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
index 54d46d6aee5..c289ba47967 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
@@ -120,7 +120,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase
             ->willReturn(true);
 
         $resultClassFileName = '/Magento/Path/To/Class.php';
-        $this->ioObjectMock->expects($this->once())->method('makeGeneratedClassFileName')->willReturn($resultClassFileName);
+        $this->ioObjectMock->expects($this->once())->method('generateResultFileName')->willReturn($resultClassFileName);
         $this->ioObjectMock->expects($this->once())->method('fileExists')->willReturn($fileExists);
         $includeFileInvokeCount = $fileExists ? 1 : 0;
         $this->ioObjectMock->expects($this->exactly($includeFileInvokeCount))->method('includeFile');
diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php
index 7902303e0dc..97f1ff1b368 100644
--- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php
+++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php
@@ -56,7 +56,7 @@ class InterceptorTest extends \PHPUnit_Framework_TestCase
         $this->classGeneratorMock->expects($this->once())->method('generate')
             ->will($this->returnValue('source code example'));
         $model->expects($this->once())->method('_validateData')->will($this->returnValue(true));
-        $this->ioObjectMock->expects($this->any())->method('makeGeneratedClassFileName')->with('Exception_Interceptor');
+        $this->ioObjectMock->expects($this->any())->method('generateResultFileName')->with('Exception_Interceptor');
         $this->assertEquals('', $model->generate());
     }
 }
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php
index 3a160365280..8578107b4cf 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php
@@ -105,7 +105,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase
 
         //Mocking generation
         $this->ioObjectMock->expects($this->any())
-            ->method('makeGeneratedClassFileName')
+            ->method('generateResultFileName')
             ->with(self::RESULT_CLASS_NAME)
             ->will($this->returnValue($resultFileName));
         $this->ioObjectMock->expects($this->once())
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php
index bc3c490c985..3a477ec43a5 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php
@@ -34,7 +34,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase
             ]
         );
 
-        $this->ioObjectMock->expects($this->once())->method('makeGeneratedClassFileName')
+        $this->ioObjectMock->expects($this->once())->method('generateResultFileName')
             ->with('\Magento\Framework\ObjectManager\Code\Generator\SampleFactory')
             ->will($this->returnValue('sample_file.php'));
         $factoryCode = file_get_contents(__DIR__ . '/_files/SampleFactory.txt');
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php
index 02dce376ffe..27cea41af83 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php
@@ -54,7 +54,7 @@ class GenerateRepositoryTest extends \PHPUnit_Framework_TestCase
         );
 
         $this->ioObjectMock->expects($this->once())
-            ->method('makeGeneratedClassFileName')
+            ->method('generateResultFileName')
             ->with('\Magento\Framework\ObjectManager\Code\Generator\SampleRepository')
             ->willReturn('SampleRepository.php');
 
diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php
index 3d4bf69304c..7eb9795742d 100644
--- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php
+++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php
@@ -34,7 +34,7 @@ class ProxyTest extends \PHPUnit_Framework_TestCase
         );
         $sampleProxyCode = file_get_contents(__DIR__ . '/_files/SampleProxy.txt');
 
-        $this->ioObjectMock->expects($this->once())->method('makeGeneratedClassFileName')
+        $this->ioObjectMock->expects($this->once())->method('generateResultFileName')
             ->with('\Magento\Framework\ObjectManager\Code\Generator\Sample_Proxy')
             ->will($this->returnValue('sample_file.php'));
         $this->ioObjectMock->expects($this->once())->method('writeResultFile')
diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php
index 900d24897ae..4382d23df89 100644
--- a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php
+++ b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php
@@ -41,7 +41,7 @@ class ExtensionGeneratorAutoloader
                 return false;
             }
 
-            $resultFileName = $this->generatorIo->makeGeneratedClassFileName($className);
+            $resultFileName = $this->generatorIo->generateResultFileName($className);
 
             if (!$this->generatorIo->fileExists($resultFileName)) {
                 $this->generatorIo->makeResultFileDirectory($className);
-- 
GitLab