DataCacheClients error, what might be the cause? - asp.net-mvc

My team is using Moq as the testing framework. Since we need to test some http objects, sessions in particular, we explored some more options, and found a nice library called MVCContrib, which downloaded RhinoMocks while installing. When trying to call a method from MVCContrib, I get this error:
Test method
uBetPro.UI.Web.Tests.AccountController.AccountControllerTests.
.Login_CorrectCredentials_AuthenticationSuccess_ReturnsValidLicense
threw exception: System.Configuration.ConfigurationErrorsException:
Configuration system failed to initialize --->
System.Configuration.ConfigurationErrorsException: Unrecognized
configuration section
dataCacheClients.
(C:\Users\Shogun\AppData\Local\Temp\TestResults\Shogun 2013-06-27
15_23_17\Out\uBetPro.UI.Web.Tests.DLL.config line 27)
What might be causing this? I'd be glad if there's a way I can fix this, but my common sense implies that two different testing frameworks can't function in the same project, does that make sense?

It appears that you have an issue in your uBetPro.UI.Web.Tests.DLL.config at line 27
I would assume that you've got something you haven't mocked out correctly and it's trying to read from the config file
If it was a collision between mocking frameworks I would have expected to see compile time errors before you got as far as running tests

Related

Swift - Getting around build errors in test-driven development?

I'm starting to learn how to do test-driven development, and I'm working with Swift. I'm suppose to have a test which should fail then write the code needed to get it to pass. From my understanding the test should successfully run, just fail. However, in Swift, when I try to write a test that, say, checks the value of a object's specific attribute, if that class doesn't yet have such an attribute (because I'm suppose to write the test first before I create it for that class) I don't get a failing test, but instead a build error when attempting to build and run the test. The error is that the test is trying to access an attribute that doesn't exist for the given object. Am I going about this the wrong way? Or are these test build breaking errors suppose to be what I get when doing TDD in Swift? Thanks!
According to Uncle Bob's 3 Rules of Tdd:
You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
(emphasis mine). So there is actually no need for "the test to successfully run" - compilation error is a fine excuse to write code :)
TDD is a great idea, but don't forget to apply some common sense. In a case like this, treat the build error as if it was a test failure. At some point you have to create the class and the attribute to get the code to build. Then, elaborate on your test to make it do something that fails, write the code that makes it pass, and continue.

ZF2 + APC = fatal errors

I did a simple install of APC (no special configurations) and didn't integrate with code at all (letting it go default and making sure things work). I was super impressed to see my New Relic times drop from 300ms to 50ms right after I enabled it! But then I noticed that actually, the server is crashing immediately. Here's the problem:
After I restart Apache, the first request works. Following the first request, I get a slew of errors in my error logs.
Some of these errors are:
Call to a member function getFieldValue() on a non-object in Zend/Http/PhpEnvironment/Request.php (zf2 lib)
Undefined Property:
Zend\\Http\\Headers::$h\x9b\xecv\xb9\x7f in Zend/Http/Headers.php
Is there some magic I'm missing? These seem like errors out of my control.
It is recommended by the ZF community to use opcache instead of APC cache. This was enabled with the default installation requirements and everything worked.

Quartz.Net, A first chance exception of type 'System.NullReferenceException' occurred in Unity.Mvc3.dll When using Unity for DI

Im using Im using Quartz.Net in a MVC application.
I have gotten it to work with triggering an easy jobb (just print some text to output window), but when trying to do more complex work like maintenance work for the database im getting an error and the maintenance work rolles back.
When using the class that implements the job for maintenance separately, that is outside of Quartz.net it works fine, but when using Quartz im getting following error:
"A first chance exception of type 'System.NullReferenceException' occurred in Unity.Mvc3.dll"
Any ideas?
When I said it worked separately I was using Execute with no parameter from a Controller action.
This answer might help you.
It's a simple implementation using MVC4 and Unity.
At the bottom of the answer you will find a sample project.
Hope it helps.

launchimage module 2.1: Validation failed for module 'launchimage' with error: ipad

trigger.io;
after upgrading to launchimage module 2.1 I just get error 'Validation failed for module 'launchimage' with error: ipad'
any ideas what this error is about?
the old docs were really good, providing a very clear spec:
http://legacy-docs.trigger.io/en/v1.4/modules/launchimage.html
the new docs for version 2.1 are totally opaque:
https://trigger.io/modules/launchimage/current/docs/index.html
n.b. apologies for posting this to SO - its basically a trigger.io support request
I believe this error indicates that you haven't filled out the public lauchimage module in its entirety like this.
If you are packaging the app as universal I think you'll need to have all the fields filled out as Trigger then prepares your ipa for all platforms(iPad and iPhone).
I found its easiest to just ignore the docs, create a demo project and use the trigger.io toolkit app to generate example config - prevents toolkit app from overwriting existing app config.
have to say I'd way prefer to work from the documentation and edit json config files directly rather than spend my time going through tedious point-and-click config..

JSFUnit inconsistently getting JSFServerSession

We are trying to run JSFUnit with Arquillian on a WebLogic 12c container and are running into a few problems.
First, when we try to use the #InitialPage annotation to inject in the JSFServerSession and JSFClientSession, the JSFServerSession is always returned as null.
Second, we have tried working around the problem by going the legacy route of creating a new JSFSession and then getting the JSFServerSession and JSFClientSession from it. Once we run a second test we get "java.lang.IllegalStateException: Can not find HttpSession. Make sure JSFUnitFilter has run and your test extends org.apache.cactus.ServletTestCase."
It seems very arbitrary because there are times where we will run a test and it passes. Sometimes the very next time it fails. Or adding a line that doesn't seem like it should be related, will thrown the "Can not find HttpSession" error.
It seems like it can't handle creating the JSFSession multiple times or there is some timeout on the server that even though the test war is getting undeployed something needs to timeout. Any thoughts?
I am not sure if this applies to your problem as well, but I had similar issue with JBoss 7. Usually the issues can be solved by:
Using Servlet 3.0 protocol which should include relevant filters to web.xml
If that doesn't help (like in my case), use this solution: https://stackoverflow.com/a/17036005/1667977
In any case, try to avoid creating the session yourself

Resources