test-suite

How to run Junit TestSuites from gradle?

南笙酒味 提交于 2019-12-03 10:36:18
I am trying to migrate from Ant build to Gradle in my project. There are a bunch of test cases (subclasses of junit.framework.TestCase) and few test suites (subclasses of junit.framework.TestSuite). Gradle automatically picked up all test cases(subclasses of junit.framework.TestCase) to be run, but not the suites (subclasses of junit.framework.TestSuite). I probably could work around by calling ant.junit to run it. But, I feel there should be a native easy way to force gradle to pick them and run. I couldn't find anything in the document . Am I missing something? This was hard for me to figure

Test suite for GIF containing images using rarely used features

半世苍凉 提交于 2019-12-03 09:18:58
问题 The specifications (plural, since there are versions 87a and 89a) of the GIF graphics format are easy to find in the internet (for those who don't want to google: http://www.w3.org/Graphics/GIF/spec-gif87.txt http://www.w3.org/Graphics/GIF/spec-gif89a.txt) As you can see in the specification GIF has support for some features that I have never seen used; I only want to give two examples (for simplicity from GIF 89a): - Plaintext extension: on http://www.vias.org/pngguide/chapter11_15.html

Does new JUnit 4.8.1 @Category render test suites almost obsolete?

空扰寡人 提交于 2019-12-03 09:17:11
问题 Given question 'How to run all tests belonging to a certain Category?' and the answer would the following approach be better for test organization? define master test suite that contains all tests (e.g. using ClasspathSuite) design sufficient set of JUnit categories (sufficient means that every desirable collection of tests is identifiable by one or more categories) qualify each test with relevant category(ies) define targeted test suites based on master test suite and set of categories

Does new JUnit 4.8.1 @Category render test suites almost obsolete?

守給你的承諾、 提交于 2019-12-02 23:30:16
Given question 'How to run all tests belonging to a certain Category?' and the answer would the following approach be better for test organization? define master test suite that contains all tests (e.g. using ClasspathSuite ) design sufficient set of JUnit categories (sufficient means that every desirable collection of tests is identifiable by one or more categories) qualify each test with relevant category(ies) define targeted test suites based on master test suite and set of categories Example: identify categories for speed (slow, fast), dependencies (mock, database, integration, etc.),

Show Test result Form test suites using TFS api

醉酒当歌 提交于 2019-12-01 06:23:33
I am working with a school project where I am going to analyse a companies defect database. They are using Microsoft Foundation Server (TFS). I am all new to TFS and the TFS api. I have some problem in getting the right data from TFS using the TFS Client Object Model . I can retrieve all Test Plans, their respective test suites and every test case that a specific test suite uses, but the problem comes when I want to see in which test suite I have a specific test result from a test case. Since more than one the suite can use the same test cases, I cant see in which suite the result came from. I

Stop testsuite if a testcase find an error

邮差的信 提交于 2019-12-01 03:51:08
I have a testSuite in Python with several testCases . If a testCase fails, testSuite continues with the next testCase . I would like to be able to stop testSuite when a testCase fails or be able to decide if the testSuite should continue or stop. Since Python 2.7, unittest support failfast option. It can be either specified by commandline: python -m unittest -f test_module Or when using a script: >>> from unittest import main >>> main(module='test_module', failfast=True) Unfortunately I haven't yet found out how to specify this option when you are using setuptools and setup.py . Are you

Stop testsuite if a testcase find an error

时光怂恿深爱的人放手 提交于 2019-12-01 01:03:22
问题 I have a testSuite in Python with several testCases . If a testCase fails, testSuite continues with the next testCase . I would like to be able to stop testSuite when a testCase fails or be able to decide if the testSuite should continue or stop. 回答1: Since Python 2.7, unittest support failfast option. It can be either specified by commandline: python -m unittest -f test_module Or when using a script: >>> from unittest import main >>> main(module='test_module', failfast=True) Unfortunately I

Page Object Pattern Implementation with CasperJS

▼魔方 西西 提交于 2019-11-30 18:17:34
问题 Is there anyone who have already implemented the famous "Page Object Pattern" with casperjs, it's very useful for test maintenability in the long term ? It's very very cool to use that when you have to separe the mechanics and the purpose of your tests. it become more pleasurable to write your tests this way. There are some examples with ruby and selenium: http://blog.josephwilk.net/cucumber/page-object-pattern.html https://code.google.com/p/selenium/wiki/PageObjects 回答1: Here is an exemple

How to programmatically execute a test suite using JUnit4?

假装没事ソ 提交于 2019-11-30 12:51:52
I am trying to invoke a JUnit Test suite using the API. I know that you can suite up test classes using the following: @RunWith(Suite.class) @Suite.SuiteClasses({ Test1.class, Test2.class, ... }) But, is there a way to trigger the entire suite using the Java API, using JUnitCore for example? For example, you can trigger a test by using the following code: Runner r = try { r = new BlockJUnit4ClassRunner(Class.forName(testClass)); } catch (ClassNotFoundException | InitializationError e) { // handle } JUnitCore c = new JUnitCore(); c.run(Request.runner(r)); Update: From the API, it seems that the

JUnit4 run all tests in a specific package using a testsuite

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 11:02:32
Is this possible in JUnit4? In JUnit3, I would do the following: public class MyTestSuite { public static Test suite() throws Exception { doBeforeActions(); try { TestSuite testSuite = new TestSuite(); for(Class clazz : getAllClassesInPackage("com.mypackage")){ testSuite.addTestSuite(clazz); } return testSuite; } finally { doAfterActions } } ... } The takari-cpsuite (originally developed by Johannes Link ) offers a classpath-suite which should fit your needs. It allows filtering of classes in the Classpath by regular expressions like: import org.junit.extensions.cpsuite.ClasspathSuite.*; ...