Search Results

Search found 10206 results on 409 pages for 'tooling and testing'.

Page 108/409 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • using spring, hibernate and scala, is there a better way to load test data than dbunit?

    - by egervari
    Here are some things I really dislike about dbunit: 1) You cannot specify the exact ordering the inserts because dbunit likes to group your inserts by table name, and not by the order you define them in the XML file. This is a problem when you have records depending on other records in other tables, so you have to disable foreign key constraints during your tests... which actually sucks because these foreign key constraints will get fired in production while your tests won't be aware of them! 2) They seem hellbent on forcing you to use an xml namespace to define your xml... and I honestly can't be bothered to do this. I like the data.xml without any namespace. It works. But they are so hellbent on deprecating it. 3) Creating different xml files is hard on a per test basis, so it actually encourages creating data for your entire app. Unfortunately, this process is a little bloated too once the data grows in size and things get inter tangled. There has got to be a better way to split up your test data into chunks without having to copy/paste a lot of the test data across all of your tests. 4) Keeping track of id references in a big xml file is just impossible. If you have 130 domain classes, it just gets bewildering. This model simply does not scale. Is there something less bloated and better in the Spring/Hibernate space? db unit has worn out its welcome and I'm really looking for something better.

    Read the article

  • Using tarantula to test a Rails app

    - by Benjamin Oakes
    I'm using Tarantula to test a Rails app I'm developing. It works pretty well, but I'm getting some strange 404s. After looking into it, Tarantula is following DELETE requests (destroy actions on controllers) throughout my app when it tests. Since Tarantula gets the index action first (and seems to keep a list of unvisited URLs), it eventually tries to follow a link to a resource which it had deleted... and gets a 404. Tarantula is right that the URL doesn't exist anymore (because it deleted the resource itself). However, it's flagging it as an error -- that's hardly the behavior I would expect. I'm basically just using the Rails scaffolding and this problem is happening. How do I prevent Tarantula doing this? (Or, is there a better way of specifying the links?) Updates: Still searching, but I found a relevant thread here: http://github.com/relevance/tarantula/issues#issue/3 Seems to be coming from relying on JS too much, in a way (see also http://thelucid.com/2010/03/15/rails-can-we-please-have-a-delete-action-by-default/)

    Read the article

  • How do I test how customers use my Cocoa application?

    - by John Gallagher
    I'm interested in finding out how customers use features in my Cocoa application. I want to build up statistics on which features people use and how they use them, so that I can measure the value of features I'm implementing. This feedback of course will be off by default and anonymous. Does anyone know of any frameworks that have been developed that can achieve this without me having to write stuff from scratch?

    Read the article

  • How to disable translations during unit tests in django?

    - by Denilson Sá
    I'm using Django Internationalization tools to translate some strings from my application. The code looks like this: from django.utils.translation import ugettext as _ def my_view(request): output = _("Welcome to my site.") return HttpResponse(output) Then, I'm writing unit tests using the Django test client. These tests make a request to the view and compare the returned contents. How can I disable the translations while running the unit tests? I'm aiming to do this: class FoobarTestCase(unittest.TestCase): def setUp(self): # Do something here to disable the string translation. But what? # I've already tried this, but it didn't work: django.utils.translation.deactivate_all() def testFoobar(self): c = Client() response = c.get("/foobar") # I want to compare to the original string without translations. self.assertEquals(response.content.strip(), "Welcome to my site.")

    Read the article

  • How do I set up a test duplicate of a Django and Postgresql based web application?

    - by cojadate
    Not sure if this is an excessively broad and newbie-ish question for Stack Overflow but here goes: I paid someone else to build a web application for me and now I want to tweak certain aspects of it myself. I learn best by trial and error – changing stuff and seeing what happens. Obviously that's not a great way to treat a live site, so I need to duplicate the site on some kind of test server which I can play with without fear of the consequences. Unfortunately the closest I've come to programming has been creating ActionScript-based websites. I've never touched a database. So I really don't know where to start with setting up a test server. I would really appreciate any advice about where to start. I am completely ignorant and lost here. The web application is built in python/django using a Postgresql database. I use Mac OS X 10.6 if that makes any difference.

    Read the article

  • Detecting use after free() on windows.

    - by The Rook
    I'm trying to detect "Use after free()" bugs, otherwise known as "Dangling pointers". I know Valgrind can be used to detect "Use after free" bugs on the *nix platform, but what about windows? What if I don't have the source? Is there a better program than Valgrind for detecting all dangling pointers in a program? A free and open source would be preferred , but I'll use a commercial solution if it will get the job done.

    Read the article

  • mocking static method call to c# library class

    - by Joe
    This seems like an easy enough issue but I can't seem to find the keywords to effect my searches. I'm trying to unit test by mocking out all objects within this method call. I am able to do so to all of my own creations except for this one: public void MyFunc(MyVarClass myVar) { Image picture; ... picture = Image.FromStream(new MemoryStream(myVar.ImageStream)); ... } FromStream is a static call from the Image class (part of c#). So how can I refactor my code to mock this out because I really don't want to provide a image stream to the unit test.

    Read the article

  • How can I unit test an Android Activity that acts on Accelerometer?

    - by Corey Sunwold
    I am starting with an Activity based off of this ShakeActivity and I want to write some unit tests for it. I have written some small unit tests for Android activities before but I'm not sure where to start here. I want to feed the accelerometer some different values and test how the activity responds to it. For now I'm keeping it simple and just updating a private int counter variable and a TextView when a "shake" event happens. So my question largely boils down to this: How can I send fake data to the accelerometer from a unit test?

    Read the article

  • xUnit false positive when comparing null terminated strings

    - by mr.b
    I've come across odd behavior when comparing strings. First assert passes, but I don't think it should.. Second assert fails, as expected... [Fact] public void StringTest() { string testString_1 = "My name is Erl. I am a program\0"; string testString_2 = "My name is Erl. I am a program"; Assert.Equal<string>(testString_1, testString_2); Assert.True(testString_1.Equals(testString_2)); } Any ideas?

    Read the article

  • Automatic profiling visual studio 2008

    - by phil
    Is there a way to do automatic profiling in visual studio 2008? I know how the profiling works both from the command line and using the GUI in VS08. What I want to accomplish: After my nightly build I want to complete some profiling (instrumental) to see if some functions (will most likely always be the same) have changed in some negative way (or positive of course).

    Read the article

  • where to put the unittest for library in rails

    - by lidaobing
    Hello, I am a ruby and rails newbie. And I am working on a rails application with RadRails. RadRails has a "Switch to Test" function for my controller, model, etc. but not for my library. if I have class Foo::Bar in /lib/foo/bar.rb, where should I put the unittest for it? or should I separate the foo library in a separated project? Thanks.

    Read the article

  • Attribute to skip over statement in unit test c#

    - by Eli Perpinyal
    I am looking to skip a certain statement in my unit tests eg: if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes) is there an attribute i can place above the statement to avoid the unit test executing it?

    Read the article

  • How to unit test generic classes

    - by Rowland Shaw
    I'm trying to set up some unit tests for an existing compact framework class library. However, I've fallen at the first hurdle, where it appears that the test framework is unable to load the types involved (even though they're both in the class library being tested) Test method MyLibrary.Tests.MyGenericClassTest.MyMethodTest threw exception: System.MissingMethodException: Could not load type 'MyLibrary.MyType' from assembly 'MyLibrary, Version=1.0.3778.36113, Culture=neutral, PublicKeyToken=null'.. My code is loosely: public class MyGenericClass<T> : List<T> where T : MyType, new() { public bool MyMethod(T foo) { throw new NotImplementedException(); } } With test methods: public void MyMethodTestHelper<T>() where T : MyType, new() { MyGenericClass<T> target = new MyGenericClass<T>(); foo = new T(); expected = true; actual = target.MyMethod(foo); Assert.AreEqual(expected, actual); } [TestMethod()] public void MyMethodTest() { MyMethodTestHelper<MyType>(); } I'm a bit stumped though, as I can't even get it to break in the debugger to get to the inner exception, so what else do I check? EDIT this does seem to be something specific to the Compact Framework - recompiling the class libraries and the unit tests for the full framework, gives the expected output (i.e. the debugger stops when I'm going to throw a NotImplementedException).

    Read the article

  • HTTP Proxy with monitor UI for local install

    - by zedoo
    Hi, I'm looking for an HTTP Proxy/GUI combination that should be installed locally on my Windows PC. The UI should display something similar to Firebugs "Network" tab, showing request/response headers and content as plaintext. It would be cool if I could attach requests to a sort of node for later comparison, similar to what you can do when using the Proxy that comes with JMeter.

    Read the article

  • Wrong code coverage on of unit test

    - by KamilPyc
    I'm using code coverage for unit tests in Xcode. Everything is working except some special cases, for example protocol declaration shows wrong values. If I have : @protocol SomeProtocole <NSObject> @property (nonatomic, readonly) NSObject *example; @end I will get 0% code coverage for this file. But I have unit test that is using class that conforms to that protocol. Only solution I found so far is to filter code coverage raport to not include protocols. But I would like to see real values for protocols. Any one have some solution to fix it?

    Read the article

  • Unit test helper methods?

    - by Aly
    Hi, I have classes which prviously had massive methods so i subdivided the work of this method into 'helper' methods. These helper methods are declared private to enforce encapsulation - however I want to unit test the big public methods, is it good to unit test the helper methods too as if one of them fail the public method that calls it will also fail - but this way we can identify why it failed. Also in order to test these using a mock object I would need to change their visibility from private to protected, is this desirable?

    Read the article

  • What block is not being tested in my test method? (VS08 Test Framework)

    - by daft
    I have the following code: private void SetControlNumbers() { string controlString = ""; int numberLength = PersonNummer.Length; switch (numberLength) { case (10) : controlString = PersonNummer.Substring(6, 4); break; case (11) : controlString = PersonNummer.Substring(7, 4); break; case (12) : controlString = PersonNummer.Substring(8, 4); break; case (13) : controlString = PersonNummer.Substring(9, 4); break; } ControlNumbers = Convert.ToInt32(controlString); } Which is tested using the following test methods: [TestMethod()] public void SetControlNumbers_Length10() { string pNummer = "9999999999"; Personnummer target = new Personnummer(pNummer); Assert.AreEqual(9999, target.ControlNumbers); } [TestMethod()] public void SetControlNumbers_Length11() { string pNummer = "999999-9999"; Personnummer target = new Personnummer(pNummer); Assert.AreEqual(9999, target.ControlNumbers); } [TestMethod()] public void SetControlNumbers_Length12() { string pNummer = "199999999999"; Personnummer target = new Personnummer(pNummer); Assert.AreEqual(9999, target.ControlNumbers); } [TestMethod()] public void SetControlNumbers_Length13() { string pNummer = "1999999-9999"; Personnummer target = new Personnummer(pNummer); Assert.AreEqual(9999, target.ControlNumbers); } For some reason Visual Studio says that I have 1 block that is not tested despite showing all code in the method under test in blue (ie. the code is covered in my unit tests). Is this because of the fact that I don't have a default value defined in the switch? When the SetControlNumbers() method is called, the string on which it operates have already been validated and checked to see that it conforms to the specification and that the various Substring calls in the switch will generate a string containing 4 chars. I'm just curious as to why it says there is 1 untested block. I'm no unit test guru at all, so I'd love some feedback on this. Also, how can I improve on the conversion after the switch to make it safer other than adding a try-catch block and check for FormatExceptions and OverflowExceptions?

    Read the article

  • Getting notification / listener when action is performed (chimpChat / monkeyrunner tool)

    - by Dr. AtZe
    I want to get a notification if someone has performed an action in an android app from outside of the app. I don't want to make any (android) code changes. To do the actions I use the Chimpchat.jar, the .jar that the monkeyrunner tool uses. To be clear: Can I get a notification or register listeners on components from outside of the app? e.g. Run my android app My java application links into the device with chimpChat via the adb The user touches a button My java application gets a notification what was performed = am I able to get that information? If not, am I able to get the information on which position the tab was? Hopefully it's clear what I want to do. Thanks, soeren

    Read the article

  • How can I include utility functions from another file into a Sproutcore unit test file?

    - by Lauri
    Lets say I have a few utility functions in file tests/utils/functions.js. I would like to use these functions from several unit test files. However, I'm not able to use them as the Sproutcore build system does not include any external files into the html page used to run the unit tests. Only application code and the code from the unit tests to be run are included. So is it possible to somehow include Javascript files to be used in unit test files in Sproutcore? I could add the functions.js file into some other directory inside my application to be able to use them. However, this is not what I want to do as the utility functions are useless in final production build and would only make my application larger.

    Read the article

  • Embedded MongoDB when running integration tests

    - by seanhodges
    My question is a variation of this one. Since my Java Web-app project requires a lot of read filters/queries and interfaces with tools like GridFS, I'm struggling to think of a sensible way to simulate MongoDB in the way the above solution suggests. Therefore, I'm considering running an embedded instance of MongoDB alongside my integration tests. I'd like it to start up automatically (either for each test or the whole suite), flush the database for every test, and shut down at the end. These tests might be run on development machines as well as the CI server, so my solution will also need to be portable. Can anyone with more knowledge on MongoDB help me get idea of the feasibility of this approach, and/or perhaps suggest any reading material that might help me get started? I'm also open to other suggestions people might have on how I could approach this problem...

    Read the article

  • android: test app on a real device

    - by Yang
    My client wants to dogfood my android app. They don't have eclipse and don't want to install it. It there a more convenient way to send my apk to them? Can I send it via email and let them open the attachment in mobile device? Will it start installing itself automatically?

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >