testing

How to use R.id in robotium if I have only the apk file

跟風遠走 提交于 2020-01-15 01:55:05
问题 I want to test an app from play market. I have a problem when I`m trying to use solo.clickOnView(solo.getView(cn.wps.moffice_eng.R.id.writer_edittoolbar_saveBtn)); cn - cn cannot be resolved to a variable How can i solve this poblem? As I understand, robotium can't use R.id because I don't have R.id file from my tested app? my code package com.example.android.apis.test; import android.test.ActivityInstrumentationTestCase2; import android.util.Log; import android.view.KeyEvent; import android

How to assert that a method call was not made, without any_instance?

ε祈祈猫儿з 提交于 2020-01-15 01:22:25
问题 I have a class, that in one situation should call :my_method , but in another situation must not call method :my_method . I would like to test both cases. Also, I would like the test to document the cases when :my_method should not be called. Using any_instance is generally discouraged, so I would be happy to learn a nice way to replace it. This code snippet is a reduced example on what I kind of test I would like to write. class TestSubject def call call_me end def call_me; end def never

How to auto-load data in the test database before to test my application?

删除回忆录丶 提交于 2020-01-14 22:48:51
问题 I am using Ruby on Rails 3.0.9 and RSpec 2. I would like to auto-load seed data in the test database before I tesst my application. That is, at the testing start up time (when I run tests) I would like to "auto-populate"\"auto-boot" the test database . How can I populate the database with seed data? P.S. : As I read around, (maybe) I should populate the test database by adding some code to the /spec/spec_helper.rb file... but what code and how? In my task/custom.rake file I have: namespace

OutOfMemoryError in JMeter

纵饮孤独 提交于 2020-01-14 12:24:12
问题 In JMeter I am getting this error. jmeter.JMeter: Uncaught exception: java.lang.OutOfMemoryError: Java heap space Please let me know how to resolve. 回答1: Increase the JMeter heap memory Within your explorer find where you installed JMeter Open up the bin directory. Find the JMeter.bat file and open it with a text editor Find the following set HEAP You can set this HEAP value to whatever you like, in this example I've said allocate 2 GB of memory from the start and throughout the test run: set

OutOfMemoryError in JMeter

*爱你&永不变心* 提交于 2020-01-14 12:24:10
问题 In JMeter I am getting this error. jmeter.JMeter: Uncaught exception: java.lang.OutOfMemoryError: Java heap space Please let me know how to resolve. 回答1: Increase the JMeter heap memory Within your explorer find where you installed JMeter Open up the bin directory. Find the JMeter.bat file and open it with a text editor Find the following set HEAP You can set this HEAP value to whatever you like, in this example I've said allocate 2 GB of memory from the start and throughout the test run: set

Does Maven Surefire execute test cases sequentially by default?

蹲街弑〆低调 提交于 2020-01-14 09:09:07
问题 This is a follow up to this question which I realized when I dug deeper into my research: Is it reasonable to suppose that the Maven Surefire plugin executes test cases sequentially by default: a test case ends befores the next one starts (I'm not interested in order). I found that you can configure Surefire to run in parallel, does that mean the sequential execution is the default behavior and will likely be in the future? NB : In case you were asking why would I want to force tests to run

Does Maven Surefire execute test cases sequentially by default?

痞子三分冷 提交于 2020-01-14 09:08:12
问题 This is a follow up to this question which I realized when I dug deeper into my research: Is it reasonable to suppose that the Maven Surefire plugin executes test cases sequentially by default: a test case ends befores the next one starts (I'm not interested in order). I found that you can configure Surefire to run in parallel, does that mean the sequential execution is the default behavior and will likely be in the future? NB : In case you were asking why would I want to force tests to run

phpunit - Help needed about risky tests

南楼画角 提交于 2020-01-14 08:35:31
问题 i'm implementing some tests for a site. In a particular test, this result occurred: { "event": "test", "suite": "Example_V_test", "test": "Example_V_test::test_3", "status": "error", "time": 13.469105958939, "trace": [ { "file": "\/opt\/lampp\/htdocs\/buy\/application\/tests\/phpunit.phar", "line": 569, "function": "main", "class": "PHPUnit_TextUI_Command", "type": "::" } ], "message": "Risky Test: Test code or tested code did not (only) close its own output buffers", "output": "" }R 3 / 3

How can I be sure that the compiler doesn't optimize away my performance test?

南楼画角 提交于 2020-01-14 07:33:15
问题 I have a class that does some time-consuming calculations. I'm trying to performance test it: int numValues = 1000000; Random random = new Random(); startMeasuringTime(); double result; for (int i = 0; i < numValues; i++) { result = calculatorInstance.doSomeTimeConsumingCalculationsOn(random.nextDouble()); } stopMeasuringTime(); I'm using random values so the compiler won't optimize the calculations for being a million times the same. But what about the results? Does the compiler see it isn't

define is not defined when trying to run my intern dojo tests

孤街浪徒 提交于 2020-01-14 05:40:29
问题 I've been trying to get intern to run with the intern-cucumber plugin for ages now. I am super confused about how to get my intern test even running. This is my file structure: project features ar.feature addition.feature models calculator.js tests addition.js ar.js intern.json package.json I want to create unit tests that run in the browser . The main issues arise with my arizona.js file, because it depends on several dojo libraries. Currently, my intern.json configuration file looks like: {