Search Results

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

Page 116/409 | < Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >

  • Ensure that all getter methods were called in a JUnit test

    - by Freiheit
    I have a class that uses XStream and is used as a transfer format for my application. I am writing tests for other classes that map this transfer format to and from a different messaging standard. I would like to ensure that all getters on my class are called within a test to ensure that if a new field is added, my test properly checks for it. A rough outline of the XStream class @XStreamAlias("thing") public class Thing implements Serializable { private int id; private int someField; public int getId(){ ... } public int someField() { ... } } So now if I update that class to be: @XStreamAlias("thing") public class Thing implements Serializable { private int id; private int someField; private String newField; public int getId(){ ... } public int getSomeField() { ... } public String getNewField(){ ... } } I would want my test to fail because the old tests are not calling getNewField(). The goal is to ensure that if new getters are added, that we have some way of ensuring that the tests check them. Ideally, this would be contained entirely in the test and not require modifying the underlying Thing class. Any ideas? Thanks for looking!

    Read the article

  • how to test rails js and ajax without a browser

    - by user1679052
    when i use rspec with capybara to test my rails js page , I got the following error: "Selenium::WebDriver::Error::WebDriverError: Could not find Firefox binary (os=linux). " Actually my rails script are all written on the linux server, where there is on brower installed, and any desktop software is not supported on the server (since no X11 is installed). How can I test js in this situation. Or is there and brower that works without X11 installed like wget? Thanks.

    Read the article

  • How to check restricted access pages for broken links?

    - by kumarsfriends
    Hi All, I was googling for tools for checking broken links in a remote web page. The w3c validator seemed a good one. But I am still unsure as how to check for pages which are restricted, i.e. the pages which I can only access by logging in to the site. Can we do that using the w3c validator? If not than is there any other tool for the same?

    Read the article

  • C# Attributes Aren't Supposed to Inherit

    - by Adam
    Since attributes don't inherit in C# (at least I didn't think they did) - how does the following code still display the Hello popup when the MyTestMethod test is run: [TestClass] public class BaseTestClass { [TestInitialize] public void Foo() { System.Windows.Forms.MessageBox.Show("Hello"); } } [TestClass] public class TestClass : BaseTestClass { [TestMethod] public void MyTestMethod() { Assert.IsTrue(true); } }

    Read the article

  • Python : How do you find the CPU consumption for a piece of code?

    - by Yugal Jindle
    Background: I have a django application, it works and responds pretty well on low load, but on high load like 100 users/sec, it consumes 100% CPU and then due to lack of CPU slows down. Problem : Profiling the application gives me time taken by functions. This time increases on high load. Time consumed may be due to complex calculation or for waiting for CPU. so, how to find the CPU cycles consumed by a piece of code ? Since, reducing the CPU consumption will increase the response time. I might have written extremely efficient code and need to add more CPU power OR I might have some stupid code taking the CPU and causing the slow down ? Any help is appreciated ! Update: I am using Jmeter to profile my webapp, it gives me a throughput of 2 requests/sec. [ 100 users] I get a average time of 36 seconds on 100 request vs 1.25 sec time on 1 request. More Info Configuration Nginx + Uwsgi with 4 workers No database used, using a responses from a REST API On 1st hit the response of REST API gets cached, therefore doesn't makes a difference. Using ujson for json parsing. Curious to Know: Python-Django is used by so many orgs for so many big sites, then there must be some high end Debug / Memory-CPU analysis tools. All those I found were casual snippets of code that perform profiling.

    Read the article

  • Managing test data for Junit tests.

    - by nobody
    Hi, We are facing one problem in managing test data(xmls which is used to create mock objects). The data which we have currently has been evolved over a long period of time. Each time we add a new functionality or test case we add new data to test that functionality. Now, the problem is when the business requirement changes the format( like length or format of a variable) or any change which the test data doesn't support , we need to change the entire test data which is 100s of MBs in size. Could anyone suggest a better method or process to overcome this problem? Any suggestion would be appreciated.

    Read the article

  • How to test that action uses argument?

    - by Caster Troy
    I am supposed to be using test-driven development but in this particular case, as I am having trouble, I implemented the action method first. It looks like this: public ViewResult Index(int pageNumber = 1) { var posts = repository.All(); var model = new PagedList<Post>(posts, pageNumber, PageSize); return View(model); } Both the repository and the PagedList<> have been tested already. Now I want to verify that when the action is given a page number that the page number is actually considered. private Mock<IPostsRepository> repository; private HomeController controller; [Test] public void Index_Doohickey() { var actual = controller.Index(2); // .. How do I test that the controller actually uses the page number here? }

    Read the article

  • Issues with installing PHPUnit

    - by user1045696
    So I've installed PHP Unit via PEAR (all the files are there, I've checked). However, when I try to run a test I get: Warning: require_once(PHPUnit/Framework.php) [function.require-once]: failed to open stream: No such file or directory in C:\WAMP\www\ExampleTests\arraytest.php on line 2 I'm guessing this has something to do with my PHPUnit installation not updating the include_path properly, but I'm not too sure what to update it to? I'm on Windows (7), using WAMP. Cheers! EDIT: The bottom of PHP.ini contains: ;***** Added by go-pear include_path=".;C:\WAMP\bin\php\php5.3.10\pear" ;***** I also get the error: Fatal error: require_once() [function.require]: Failed opening required 'PHPUnit/Framework.php' (include_path='.;C:\php\pear') However, after looking in PHP.ini, there's no include path that points to C:\php\pear?

    Read the article

  • How can I pass in specific parameters to mstest in Visual Studio

    - by Eric Langland
    I'm trying to modify my test projuect to allow for remote invocation of an api we're building. Right now the tests are hard coded to run locally(against localhost), but I would like to be able to point the tests at any endpoint (even remote ones in production). Ideally there would be a place in the .testsettings for config values to be stored. Sadly this isn't the case. Or, being able to pass parameters to MSTest that the test would read...? Any ideas? Thanks in advance.

    Read the article

  • How to check font-size in IE6+

    - by kumarsfriends
    Hi All, I am wondering is there any way we can test the font size/color of a webpage in IE6+. I think it is not possible by checking the css class, as some other style may overwrite the styles of the class which has been assinged to that text. Actually I want to know the browser assigned font-size to the text of the page, as we can do it in firebug on firefox. Any help would be appreciated.

    Read the article

  • Hyperlinks in VS2008 Test Result Details

    - by Red XIII
    In case when resulting string in "Test Result Details" (TRD) is very long, the Visual Studio 2008 crashes. I fixed this by sending the result data into a file. There is a problem, however, because there isn't a simple way to open such file. Of course, I can manually open folder and then the file, but it isn't very efficient. Now, to the questions part. Is there a possibility to include in the "Error Message" part of TRD a hyperlink to a file? (something similar to what we can already find in the stack trace part) If not, is there any way to add such functionality (easy opening of a file) to TRD? If not, are there any ways to expand the default reporting of VS? Thanks for any help.

    Read the article

  • Test a database conection without codeigniter throwing a fit, can it be done?

    - by RobertWHurst
    I'm just about finished my first release of automailer, a program I've been working on for a while now. I've just got to finish writing the installer. Its job is to rewrite the codigniter configs from templates. I've got the read/write stuff working, but I'd like to be able to test the server credentials given by the user without codingiter throwing a system error if they're wrong. Is there a function other than mysql_connect that I can use to test a connection that will return true or false and won't make codeigniter have a fit? This is what I have function _test_connection(){ if(mysql_connect($_POST['host'], $_POST['username'], $_POST['password'], TRUE)) return TRUE; else return FALSE; } Codigniter doesn't like this and throws a system error. <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Unknown MySQL server host 'x' (1)</p> <p>Filename: controllers/install.php</p> <p>Line Number: 57</p> </div> I'd rather not turn off error reporting.

    Read the article

  • Writing an installer using codigniter

    - by RobertWHurst
    I'm just about finished my first release of automailer, a program I've been working on for a while now. I've just got to finish writing the installer. Its job is to rewrite the codigniter configs from templates. I've got the read/write stuff working, but I'd like to be able to test the server credentials given by the user without codingiter throwing a system error if they're wrong. Is there a function other than mysql_connect that I can use to test a connection that will return true or false and won't make codeigniter have a fit?

    Read the article

  • JUnit Theories: Why can't I use Lists (instead of arrays) as DataPoints?

    - by MatrixFrog
    I've started using the new(ish) JUnit Theories feature for parameterizing tests. If your Theory is set up to take, for example, an Integer argument, the Theories test runner picks up any Integers marked with @DataPoint: @DataPoint public static Integer number = 0; as well as any Integers in arrays: @DataPoints public static Integer[] numbers = {1, 2, 3}; or even methods that return arrays like: @DataPoints public static Integer[] moreNumbers() { return new Integer[] {4, 5, 6};}; but not in Lists. The following does not work: @DataPoints public static List<Integer> numberList = Arrays.asList(7, 8, 9); Am I doing something wrong, or do Lists really not work? Was it a conscious design choice not to allow the use Lists as data points, or is that just a feature that hasn't been implemented yet? Are there plans to implement it in a future version of JUnit?

    Read the article

  • How to test Language DLLs?

    - by EKI
    Our application offer the user to display different languages if they have the approppriate Language DLL (say German.DLL, French.DLL, even Chinese.DLL). We have functional test to verify that those DLLs enable the right options in a Combobox and that choosing them will actually translate strings in the UI. I would like to know options to test this translation dll's more in depth, maybe ensuring that all the characters in the selected langauge (and in the file) can be correctly displayed, or that the internal structure of the DLL is consistent, there are no strings exceeding the limits that are expected of them, etc... Any suggestions on what to test and how to test it? Does anyone know specific problems that may arise and we should check? Thanks in advance.

    Read the article

  • How can I tell the number of replacements in a formatter string?

    - by sdanna
    Given the following method: (real method has a few more parameters, but the important ones are below...) public string DoSomething(string formatter, params string[] values) { // Do something eventually involving a call to String.Format(formatter, values); } Is there a way to tell if my values array has enough objects in it to cover the formatter, so that I can throw an exception if there aren't (short of doing the string.Format; that isn't an option until the end due to some lambda conversions)?

    Read the article

  • Profiling With Visual Studio Team System

    - by Rotem
    Hi, I'm using Visual Studio Team System 2008 to run Load Tests. I have a test that executes a web service request and I would like to know how much time was spent in each layer of my application e.g. Time spent in IIS, Time spent in my Server application Time spent in SQL Server Can I get this sort of information by setting the performance counters in my load test properly? Thanks

    Read the article

  • Unittest in Django. Static variable feeded into the test case

    - by ziang
    I want to generate some dynamic data and feed these data in to test cases. But I found that Django will initial the test class every time to do the test. So the data will get generated every time django test framework calls the function. Is there anyway to use something like the singleton or static variable to solve the problem? What should be the solution? Thanks!

    Read the article

< Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >