add comments

This commit is contained in:
wing328 2016-01-19 19:50:27 +08:00
parent 8927c1dc0f
commit 61c717b6de
5 changed files with 11 additions and 24 deletions

View File

@ -284,7 +284,7 @@ public class DefaultCodegen {
} }
/** /**
* Return the file name of the Api * Return the file name of the Api Test
* *
* @param name the file name of the Api * @param name the file name of the Api
* @return the file name of the Api * @return the file name of the Api
@ -314,7 +314,7 @@ public class DefaultCodegen {
} }
/** /**
* Return the capitalized file name of the model * Return the capitalized file name of the model test
* *
* @param name the model name * @param name the model name
* @return the file name of the model * @return the file name of the model
@ -2071,6 +2071,14 @@ public class DefaultCodegen {
return apiFileFolder() + '/' + toApiFilename(tag) + suffix; return apiFileFolder() + '/' + toApiFilename(tag) + suffix;
} }
/**
* Return the full path and API test file
*
* @param templateName template name
* @param tag tag
*
* @return the API test file name with full path
*/
public String apiTestFilename(String templateName, String tag) { public String apiTestFilename(String templateName, String tag) {
String suffix = apiTestTemplateFiles().get(templateName); String suffix = apiTestTemplateFiles().get(templateName);
return apiTestFileFolder() + '/' + toApiTestFilename(tag) + suffix; return apiTestFileFolder() + '/' + toApiTestFilename(tag) + suffix;

View File

@ -311,6 +311,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
files.add(new File(filename)); files.add(new File(filename));
} }
// to generate api test files
for (String templateName : config.apiTestTemplateFiles().keySet()) { for (String templateName : config.apiTestTemplateFiles().keySet()) {
String filename = config.apiTestFilename(templateName, tag); String filename = config.apiTestFilename(templateName, tag);
if (!config.shouldOverwrite(filename) && new File(filename).exists()) { if (!config.shouldOverwrite(filename) && new File(filename).exists()) {

View File

@ -72,7 +72,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_updatePet() { public function test_updatePet() {
//$body = null
} }
@ -83,7 +82,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_addPet() { public function test_addPet() {
//$body = null
} }
@ -94,7 +92,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_findPetsByStatus() { public function test_findPetsByStatus() {
//$status = null
} }
@ -105,7 +102,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_findPetsByTags() { public function test_findPetsByTags() {
//$tags = null
} }
@ -116,7 +112,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_getPetById() { public function test_getPetById() {
//$pet_id
} }
@ -127,7 +122,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_updatePetWithForm() { public function test_updatePetWithForm() {
//$pet_id, $name = null, $status = null
} }
@ -138,7 +132,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_deletePet() { public function test_deletePet() {
//$pet_id, $api_key = null
} }
@ -149,7 +142,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_uploadFile() { public function test_uploadFile() {
//$pet_id, $additional_metadata = null, $file = null
} }
@ -160,7 +152,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_getPetByIdWithByteArray() { public function test_getPetByIdWithByteArray() {
//$pet_id
} }
@ -171,7 +162,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_addPetUsingByteArray() { public function test_addPetUsingByteArray() {
//$body = null
} }

View File

@ -72,7 +72,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_getInventory() { public function test_getInventory() {
//
} }
@ -83,7 +82,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_placeOrder() { public function test_placeOrder() {
//$body = null
} }
@ -94,7 +92,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_getOrderById() { public function test_getOrderById() {
//$order_id
} }
@ -105,7 +102,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_deleteOrder() { public function test_deleteOrder() {
//$order_id
} }

View File

@ -72,7 +72,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_createUser() { public function test_createUser() {
//$body = null
} }
@ -83,7 +82,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_createUsersWithArrayInput() { public function test_createUsersWithArrayInput() {
//$body = null
} }
@ -94,7 +92,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_createUsersWithListInput() { public function test_createUsersWithListInput() {
//$body = null
} }
@ -105,7 +102,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_loginUser() { public function test_loginUser() {
//$username = null, $password = null
} }
@ -116,7 +112,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_logoutUser() { public function test_logoutUser() {
//
} }
@ -127,7 +122,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_getUserByName() { public function test_getUserByName() {
//$username
} }
@ -138,7 +132,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_updateUser() { public function test_updateUser() {
//$username, $body = null
} }
@ -149,7 +142,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
* *
*/ */
public function test_deleteUser() { public function test_deleteUser() {
//$username
} }