Some DataProvider public java.lang.Object[][] com.qa.tests.RegisterTest.getHXTestData(java.lang.String) parameters unresolved - data-driven-tests

I am getting following issue while getting data from excel for my Register test class. i am following a data driven approach with POM .
Console error:
Code i have written:

Related

Requiring superagent results in error in Jest

I'm getting the following error when running Jest tests:
/Users/hugo/src/feedback/www/assets/app/node_modules/superagent/lib/node/index.js: /Users/hugo/src/feedback/www/assets/app/node_modules/superagent/node_modules/debug/node.js: Cannot read property 'buffer' of undefined
If Jest automatically mocks out dependencies, shouldn't any file that requires superagent just get the mock of superagent? All the functions I have that even make an http request using it have been mocked out to just return test data without making the request. I don't understand why I'm getting the error.
UPDATE
I tried the manual mock found here. It still gives me the same error.

MapReduce Java Program Error: java.lang.RuntimeException

I have run a MapReduce java program and run in Hadoop. I have not set some configuration right and I don't get my error. I tried with various workarounds but I get similar errors repeatedly.
You must make your mapper and reducer public:
public static class AnnualTaxCalculaterMapper
public static class AnnualTaxCalculaterReducer
The Hadoop API cannot access package-private class.

Symfony2 with LiipFunctionalTestBundle error when i load fixture

i've installed LiipFunctionalTestBundle and try to use it since yesterday but i've got an error and i don't know how to solve it.
I use the basic configuration as describe in the documentation(config_test) :
framework:
test: ~
session:
storage_id: session.storage.filesystem
liip_functional_test: ~
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_sqlite
path: %kernel.cache_dir%/test.sql
I create a simple test file in my bundle, just to know if my db is loaded:
class AdControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$this->loadFixtures(array());
$this->assertTrue(true);
}
}
When i use $this->loadFixtures(array()); it's works fine, so i can start off with an empty database (initialized with my schema)
But When i replace it and try to use a fixture i have an error like this :
$this->loadFixtures(array('\Blabla\MyBunble\DataFixtures\ORM\LoadUserData'));
Now i have this error :
Doctrine\DBAL\DBALException: An exception occurred while executing 'PRAGMA table_info(transaction)':
SQLSTATE[HY000]: General error: 1 near "transaction": syntax error
I'm pretty new in testing, if someone use this bundle and as a tips, i'll be grateful :)
Thanks
I have the same error and it has driven me nuts for two hours, the only info related with symfony and testing was this question but my namespaces and routes where OK... so whats the problem? It's silly easy... TRANSACTION is a SQLite keyword: https://www.sqlite.org/lang_keywords.html If I remove the cache the test where working but when it cames to retrieve the table info it crashes because of the table name.
I hope it results helpful for anybody else that could have the same problem.
Ok it was a stupid mistake.
When i cleaned the cache i saw the real error : loadFixtures was unable to find my fixture because of a wrong namespace.

unit/integration testing of controllers and views using MvcContrib throws error when run

Am fairly new to the world of testing MVC 4 Web Applications and have been attempting to unit test views and controllers to see whether for a given controller that an action renders a particular view, I have been using MvcContrib TestHelper to try to simply the process of testing the application but so far have been unable to get the test to pass.
When the test is run I receive the error Expected view name was 'index' actual was ''
Currently I am running this test method:
[TestMethod]
public void AMAC_Controller_Renders_Index_View()
{
var builder = new TestControllerBuilder();
var controller = new AMACController();
builder.InitializeController(controller);
var result = controller.Index();
result.AssertViewRendered().ForView("index").WithViewData<AMACEnquiryModel>();
}
the controller and model are both currently in use by the application, was wondering if you could give any advice on how get this test working, I have modified previously when I have done this I get another error that the route name already exists in the collection.
After getting some advice from one of the contributors of the MvcContrib project the reason the test wasn't passing was because I was passing the wrong data into the .ForView(), before I had .ForView("index") where the controller was actually passing View(model) so the value for .ForView() was actually an empty string so the assert now looks like this:
result.AssertViewRendered().ForView("").WithViewData<AMACEnquiryModel>();

Unit Tests with read-only custom Datasource in Cakephp

I am currently in the process of writing some Unit Tests for my CakePHP application. I have a custom datasource for a few of my models. This is a read only datasource. I want to run some unit tests using this datasource but can't seem to get it working.
I have created a fixture with the following at the top:
public $useDbConfig = 'test_datafeeds';
But I get a load of errors thrown back at me. If I delete all my fixtures from the DataTest it works, however it uses all the actual data in the actual database too - for my tests I would prefer to use the dummy data I have sent up for the data in my database.
I have managed to create static fixtures using dummy data to mock the datasource, but i'd also prefer the option to use the actual datasource in tests.
Some of the errors I am getting:
Notice: Undefined index: prefix in lib/Cake/TestSuite/Fixture/CakeFixtureManager.php on line 169
Warning: in_array() expects parameter 2 to be array, null given in lib/Cake/TestSuite/Fixture/CakeFixtureManager.php on line 171
Warning: in_array() expects parameter 2 to be array, null given in lib/Cake/TestSuite/Fixture/CakeFixtureManager.php on line 174
Fatal error: Call to undefined method DataFeedSource::execute() in lib/Cake/Test/Suite/Fixture/CakeTestFixture.php on line 194
I am not sure if this is the best way to do it, but it works for me. I have removed
public $useDbConfig = 'test_datafeeds';
from the fixture and it works. It seems that just by having the test_datafeed configuration in my config file it works.
Quite handy as I can keep my static fixture as its and then toggle the test_datafeed on and off by commenting it out.