Search Results

Search found 10010 results on 401 pages for 'a b testing'.

Page 91/401 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • How to build an android test app with a dependency on another app using ant?

    - by Mike
    I have a module called MyApp, and another module called MyAppTests which has a dependency on MyApp. Both modules produce APKs, one named MyApp.apk and the other MyAppTests.apk. I normally build these in IntelliJ or Eclipse, but I'd like to create an ant buildfile for them for the purpose of continuous integration. I used "android update" to create a buildfile for MyApp, and thanks to commonsware's answer to my previous question I've been able to build it successfully using ant. I'd now like to build MyAppTests.apk using ant. I constructed the buildfile as before using "android update", but when I run it I get an error indicating that it's not finding any of the classes in MyApp. Taking a que from my previous question, I tried putting MyApp.apk into my MyAppTests/libs, but unfortunately that didn't miraculously solve the problem. What's the best way to build a test app APK using ant when it depends on classes in another APK? $ ant debug Buildfile: build.xml [setup] Project Target: Google APIs [setup] Vendor: Google Inc. [setup] Platform Version: 1.5 [setup] API level: 3 [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions. dirs: [echo] Creating output directories if needed... resource-src: [echo] Generating R.java / Manifest.java from the resources... aidl: [echo] Compiling aidl files into Java classes... compile: [javac] Compiling 5 source files to /Users/mike/Projects/myapp/android/MyAppTests/bin/classes [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:3: cannot find symbol [javac] symbol : class MyApplication [javac] location: package com.myapp [javac] import com.myapp.MyApplication; [javac] ^

    Read the article

  • Unit test class inherited from ContextBoundObject and decorated with ContextAttribute

    - by Joel Cunningham
    I am trying to retrofit unit tests on to some existing code base. Both the class and method I want to unit test is decorated with custom attributes that are inherited from ContextBoundObject and ContextAttribute. I dont want them to run as part of the unit test. The only solution I have come up with is to compile the attribute out when I want to unit test. I dont really like this solution and would prefer to either replace it with a mocked attribute at runtime or prevent the attribute from running in a more elegant way. How do you unit test code that has class and method attributes that inherit from ContextBoundObject and ContextAttribute that you dont want to run as part of a unit test? Thanks in advance.

    Read the article

  • Test Application Guide for Winforms

    - by Jonathan
    I'm a c# developer in a medium/small company. I use to do quick test of the apps that my workmates made and they use to test my applications. We test each form based in our experience. (yes, I know this is not a very formal method) Now a new guy without experience are going to join our team. We think now is the momento to make a little list of things that all we should test in each form. Divided by categories. For example usability: Test that the taborder of each control are properly setted, or Valitacion: Test that the max lenght of each textbox match with the max lenght of a field in the DB...etc We don't one to Reinvent the Wheels, so I want to know if such kind of document already exists. Thanks

    Read the article

  • Why `#import("dart:unittest")` can't run?

    - by Freewind
    I write some dart test code: #import("dart:unittest"); main() { test('this is a test', () { int x = 2+3; expect(x).equals(5); }); } It doesn't display any error in dart editor, but when I press the "run" button, it reports: Do not know how to load 'dart:unittest''file:///home/freewind/dev/dart/editor /samples/shuzu.org/test/model_test.dart': Error: line 1 pos 1: library handler failed #import("dart:unittest"); ^ I see there is a "dart:unittest" library in my dart-sdk. Why it can't be run?

    Read the article

  • From a Perl test file, how do I check the contents of a file?

    - by justintime
    I want to test a script I have written in Perl and specifically check what output it writes to file. I wrote it some time ago and don't want to modify it to the extent of turning it into a module but would like to regression test it before adding some small functional changes. So far I have use Test::Command tests => 10; exit_is_num($cmd, 0); .... But the command produces some files and I want to check those files are the same as I expect (either equal or match some regexp). Any suggestions

    Read the article

  • How do you mock the session object collection using Moq

    - by rayray2030
    I am using shanselmann's MvcMockHelper class to mock up some HttpContext stuff using Moq but the issue I am having is being able to assign something to my mocked session object in my MVC controller and then being able to read that same value in my unit test for verification purposes. My question is how do you assign a storage collection to the mocked session object to allow code such as session["UserName"] = "foo" to retain the "foo" value and have it be available in the unit test.

    Read the article

  • Regression tests for T-SQL stored procedures

    - by Achim
    Hi, I would like to regression test t-sql stored procedures. My idea is to specify for each SP multiple input parameter sets. The SP should be executed with these parameters, results should be written to disc. Next time the new results should be compared with results stored before. Does anybody know a good tool for something like that? Should not be that hard to implement, but in practice you will need functionality like "ignore that column" or something like that. And I would assume that such a tool should already exist!? cheers, Achim

    Read the article

  • Process spawned by exec-maven-plugin blocks the maven process

    - by Arnab Biswas
    I am trying to execute the following scenario using maven : pre-integration-phase : Start a java based application using a main class (using exec-maven-plugin) integration-phase : Run the integration test cases (using maven-failsafe-plugin) post-integration-phase: Stop the application gracefully (using exec-maven-plugin) Here is pom.xml snip: <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <id>launch-myApp</id> <phase>pre-integration-test</phase> <goals> <goal>exec</goal> </goals> </execution> </executions> <configuration> <executable>java</executable> <arguments> <argument>-DMY_APP_HOME=/usr/home/target/local</argument> <argument>-Djava.library.path=/usr/home/other/lib</argument> <argument>-classpath</argument> <classpath/> <argument>com.foo.MyApp</argument> </arguments> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.12</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> <configuration> <forkMode>always</forkMode> </configuration> </plugin> </plugins> If I execute mvn post-integration-test, my application is getting started as a child process of the maven process, but the application process is blocking the maven process from executing the integration tests which comes in the next phase. Later I found that there is a bug (or missing functionality?) in maven exec plugin, because of which the application process blocks the maven process. To address this issue, I have encapsulated the invocation of MyApp.java in a shell script and then appended “/dev/null 2&1 &” to spawn a separate background process. Here is the snip (this is just a snip and not the actual one) from runTest.sh: java - DMY_APP_HOME =$2 com.foo.MyApp > /dev/null 2>&1 & Although this solves my issue, is there any other way to do it? Am I missing any argument for exec-maven-plugin?

    Read the article

  • Help create a unit test for test response header, specifically Cache-Control, in determining if cach

    - by VajNyiaj
    Scenario: I have a base controller which disables caching within the OnActionExecuting override. protected override void OnActionExecuting(ActionExecutingContext filterContext) { filterContext.HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); filterContext.HttpContext.Response.Cache.SetValidUntilExpires(false); filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); //IE filterContext.HttpContext.Response.Cache.SetNoStore(); //FireFox } How can I create a Unit Test to test this behavior?

    Read the article

  • Unittesting Url.Action (using Rhino Mocks?)

    - by Kristoffer Ahl
    I'm trying to write a test for an UrlHelper extensionmethod that is used like this: Url.Action<TestController>(x => x.TestAction()); However, I can't seem set it up correctly so that I can create a new UrlHelper and then assert that the returned url was the expected one. This is what I've got but I'm open to anything that does not involve mocking as well. ;O) [Test] public void Should_return_Test_slash_TestAction() { // Arrange RouteTable.Routes.Add("TestRoute", new Route("{controller}/{action}", new MvcRouteHandler())); var mocks = new MockRepository(); var context = mocks.FakeHttpContext(); // the extension from hanselman var helper = new UrlHelper(new RequestContext(context, new RouteData()), RouteTable.Routes); // Act var result = helper.Action<TestController>(x => x.TestAction()); // Assert Assert.That(result, Is.EqualTo("Test/TestAction")); } I tried changing it to urlHelper.Action("Test", "TestAction") but it will fail anyway so I know it is not my extensionmethod that is not working. NUnit returns: NUnit.Framework.AssertionException: Expected string length 15 but was 0. Strings differ at index 0. Expected: "Test/TestAction" But was: <string.Empty> I have verified that the route is registered and working and I am using Hanselmans extension for creating a fake HttpContext. Here's what my UrlHelper extentionmethod look like: public static string Action<TController>(this UrlHelper urlHelper, Expression<Func<TController, object>> actionExpression) where TController : Controller { var controllerName = typeof(TController).GetControllerName(); var actionName = actionExpression.GetActionName(); return urlHelper.Action(actionName, controllerName); } public static string GetControllerName(this Type controllerType) { return controllerType.Name.Replace("Controller", string.Empty); } public static string GetActionName(this LambdaExpression actionExpression) { return ((MethodCallExpression)actionExpression.Body).Method.Name; } Any ideas on what I am missing to get it working??? / Kristoffer

    Read the article

  • Integration Test Example With Rhino Mocks

    - by guazz
    I have two classes. I would like to verify that the properties are called on one of the classes. public classA { public IBInterface Foo {get;set;} public LoadData() { Foo.Save(1.23456, 1.23456); } } public classB : IBInterface { public decimal ApplePrice {get; set;} public decimal OrangePrice {get; set;} public void Save(decimal param1, decimal param2) { this.ApplePrice = param1; this.OrangePrice = param2; } } I would like to use Rhino Mocks(AAA syntax) to verify that ApplePrice and OrangePrice were set correctly. I assume I should begin like so but how do I verify that ApplePrice and OrangePrice have been set? var mockInterfaceB = mockery.DynamicMock(); ClassA a = new ClassA(); a.Foo = mockInterfaceB; a.LoadData();

    Read the article

  • How to pass variables using Unittest suite

    - by chrissygormley
    Hello I have test's using unittest. I have a test suite and I am trying to pass variables through into each of the tests. The below code shows the test suite used. class suite(): def suite(self): #Function stores all the modules to be tested modules_to_test = ('testmodule1', 'testmodule2') alltests = unittest.TestSuite() for module in map(__import__, modules_to_test): alltests.addTest(unittest.findTestCases(module)) return alltests It calls tests, I would like to know how to pass variables into the tests from this class. An example test script is below: class TestThis(unittest.TestCase): def runTest(self): assertEqual('1', '1') class TestThisTestSuite(unittest.TestSuite): # Tests to be tested by test suite def makeTestThisTestSuite(): suite = unittest.TestSuite() suite.addTest("TestThis") return suite def suite(): return unittest.makeSuite(TestThis) if __name__ == '__main__': unittest.main() So from the class suite() I would like to enter in a value to change the value that is in assert value. Eg. assertEqual(self.value, '1'). I have tried sys.argv for unittest and it doesn't seem to work. Thanks for any help.

    Read the article

  • Stress Test tool for Password Protected Website

    - by Jason
    We need to run a stress test on a password protection section of a website we host. What tool (paid or free) would be best for us to use for this? We'd like to be able to create several 'scripts' and then have the stress test simulate X number of users. Each script will have us login as a specific user and then click on some links and submit forms to simulate an actual user. Ideally the software would also create some nice data exports/charts. Server is a linux web server, but we could run this on linux or Windows so software that will run on either is fine.

    Read the article

  • Junit vs TestNG

    - by Sam Merrell
    At work we are currently still using Junit3 to run our tests. We have been considering switching over to Junit4 for new tests being written but I have been keeping an eye on TestNG for a while now. What experiences have you all had with either Junit4 or TestNG and which seems to work better for very large numbers of tests. Having flexibility in writing tests is also important to us since our functional tests cover a wide aspect and need to be written in a variety of ways to get results. Old tests will not be re-written as they do their job just fine. What I would like to see in new tests though is flexibility in the way the test can be written, natural assertions, grouping, and easily distributed test executions.

    Read the article

  • Retrieving specific fixtures in Rails

    - by Bilal Aslam
    I have a YML file containing fixtures for a Rails model (Comment) which looks like this (pardon the formatting): comment_a: id: 1 text: 'foo' visible: false comment_b: id: 2 text: 'bar' visible: true comment_c: id: 3 text: 'baz' visible: true I know that I can select an individual Comment fixture like so: comments(:comment_a) In one of my acceptance tests, I want to find all the Comments which have visible = true. How do I select a set of Comments that meet certain criteria so I can iterate over them afterwards?

    Read the article

  • No test coverage files generated for Unit Test bundle in Xcode

    - by John Gallagher
    The Problem I've got a Cocoa project on the desktop and I'm using Xcode 3.2.1 on Snow Leopard 10.6.2. I want to generate code coverage files for my Unit Test Target in Xcode. What I've Tried As articles like this one suggest, I've adjusted the build settings to: “Generate Test Coverage Files” checked “Instrument Program Flow” checked “-lgcov” added to “Other Linker Flags” I've also set the Run Script section of the test target to have the following: # Run the unit tests in this test bundle. "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" # Run gcov on the framework getting tested if [ "${CONFIGURATION}" = 'Coverage' ]; then FRAMEWORK_NAME=LapsusInterpretationEngine FRAMEWORK_OBJ_DIR=${OBJROOT}/${FRAMEWORK_NAME}.build/${CONFIGURATION}/EngineTests.build/Objects-normal/${NATIVE_ARCH} mkdir -p coverage pushd coverage find ${OBJROOT} -name *.gcda -exec gcov -o ${FRAMEWORK_OBJ_DIR} {} \; popd fi Since my Framework name is LapsusInterpretationEngine but my target is named EngineTests, I put this directly into the FRAMEWORK_OBJ_DIR but this didn't seem to help. I've tried cleaning before building. I've made sure all the above build settings apply to both the Unit Test Target and the Application Target. What I Get No .gcda or .gcno files anywhere in the build directory I'm using. I point CoverStory to the Objects-normal directory in my builds folder and it complains that there's nothing there for it to read. I must be doing something really obvious wrong. Anyone any ideas? I have tried the "EngineTests.build" directory being ${FRAMEWORK_NAME} and this gives the same results.

    Read the article

  • How to make Visual Studio Pause after executing a console app in debug mode?

    - by Jason Dagit
    I have a collection of boost unit tests I want to run as a console application. When I'm working on the project and I run the tests I would like to be able to debug the tests and I would like to have the console stay open after the tests run. I see that if I run in release mode the console window stays up after the program exits, but in debug mode this is not the case. I do not want to add 'system("pause");' or any other hacks like reading a character to my program. I just want to make Visual Studio pause after running the tests with debugging like it would if I were running in release mode. I would also like it if the output of tests were captured in one of Visual Studio's output windows but that also seems to be harder than it should be. How can I do this? Thanks!

    Read the article

  • Watir issue. cant move forward in irb

    - by user1033392
    Hello i'am using windows 7 and i wish to use watir-webdriver with ruby 1.9.2. Please tell me why i get this: C:\>irb irb(main):001:0> require "watir-webdriver" => true irb(main):002:0> browser = Watir::Browser.new :ff Errno::EADDRNOTAVAIL: ??dany adres jest nieprawid?owy w tym kontek?cie. - bind(2 ) from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/socket_lock.rb:45:in `initialize' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/socket_lock.rb:45:in `new' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/socket_lock.rb:45:in `can_lock?' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/socket_lock.rb:31:in `lock' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/socket_lock.rb:17:in `locked' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/launcher.rb:32:in `launch' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/firefox/bridge.rb:19:in `initialize' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/common/driver.rb:31:in `new' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver/common/driver.rb:31:in `for' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s elenium/webdriver.rb:65:in `for' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.1/lib/watir -webdriver/browser.rb:35:in `initialize' from (irb):2:in `new' from (irb):2 from C:/Ruby193/bin/irb:12:in `<main>' irb(main):003:0> Thanks a lot for help!

    Read the article

  • Can you recommend an alternative for NCover?

    - by Keith
    I'm looking for a good .Net code coverage alternative to NCover (insufficient .Net 3.5 coverage and now pay-for) or VSTS (way too expensive). We currently test with NUnit, but could switch to something with a similar 'layout' for its text fixtures if it were better integrated.

    Read the article

  • starting and stopping hsqldb from unit tests

    - by Casey
    I'm trying to create integration tests using hsqldb in an in memory mode. At the moment, I have to start the hsqldb server from the command line before running the unit tests. I would like to be able to be able to control the hsqldb server from my integration tests. I can't seem to get this to all work out though from code. Thanks, Casey Update: This appears to work along with having a hibernate.cfg.xml file in the classpath: org.hsqldb.Server.main(new String[]{}); and in my hibernate.cfg.xml file: <property name="connection.driver_class">org.hsqldb.jdbcDriver</property> <property name="connection.url">jdbc:hsqldb:mem:ww</property> <property name="connection.username">sa</property> <property name="connection.password"></property> <property name="connection.pool_size">1</property> <property name="dialect">org.hibernate.dialect.HSQLDialect</property> <property name="current_session_context_class">thread</property> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="hbm2ddl.auto">update</property>

    Read the article

  • Best practices for file system dependencies in unit/integration tests

    - by Olvagor
    I just started writing tests for a lot of code. There's a bunch of classes with dependencies to the file system, that is they read CSV files, read/write configuration files and so on. Currently the test files are stored in the test directory of the project (it's a Maven2 project) but for several reasons this directory doesn't always exist, so the tests fail. Do you know best practices for coping with file system dependencies in unit/integration tests? Edit: I'm not searching an answer for that specific problem I described above. That was just an example. I'd prefer general recommendations how to handle dependencies to the file system/databases etc.

    Read the article

  • Stubbing ActiveRecord result arrays

    - by Matthias
    Using Ruby 1.8.6, stubbing a finder method to return an Array does not work when the code under test calls the 'count' method on the result: User.any_instance.stubs(:friends).returns([user1, user2]) That's because Array.count has only been added in Ruby 1.8.7. Rails also adds a count method dynamically, I believe through the ActiveRecord::Calculations module. Is there any way to turn this result array into something that behaves exactly as the special Array kind returned by a Rails finder method? When paginating results, it's easy: I can simply call [].paginate. But that doesn't work with normal finder results. I tried [].extend(ActiveRecord::Calculations) but that doesn't work either.

    Read the article

  • Career as a Software Tester

    - by mgj
    Respected all, I am a fresher who is interested in a job as a software tester. I had few general queries regarding the prospects of this kind of a job in a software company. What are the kind of challenges that a tester faces in real life situations that make his/her job more interesting and self-motivating? What are the growth opportunities for an individual in a software company who wants to pursue a career as a software tester? Are software developers and software testers treated alike in terms of growth opportunities or otherwise? If not so why? How does one(software tester or any one else) deal with such situation such that its a win win situation for both the company and the software tester? I am really looking forward to the answers that you can give from your personal experiences and insights. Thank you..:)

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >