14 Topics

Member Avatar for
Member Avatar for dimitrilc

## Introduction ## In Android development, Espresso can be combined with Junit to create powerful UI automation tests. In this tutorial, we will learn how to create Espresso tests. ## Goals ## At the end of the tutorial, you would have learned: 1. How to create Espresso tests. ## Tools …

Member Avatar for John_165
2
365
Member Avatar for dimitrilc

## Introduction ## Junit is a popular framework to create tests for Java applications. Although individual unit tests are mostly straightforward, integration and functional tests are a little bit more involved because they usually require multiple components working together. For that reason, understanding the life cycle of Junit tests can …

2
200
Member Avatar for Violet_82

Hi guys, I was trying to test a method which takes a user input, does something and then returns that input but I'm having some issues with it. I've attempted a few solutions, mostly described in SE, I will leaave them out of this post and discuss instead the one …

Member Avatar for Violet_82
0
3K
Member Avatar for coder91

Hi I have a method that accepts a List<String> param as a parameter. I'm writing a JUnit test which needs to be able to accept the parameters as a String and then it needs converted to a List<String> The JUnit code is: public void testMethodName(String params, String expectedResult){ final String …

Member Avatar for coder91
0
316
Member Avatar for pattmorter

Hey everyone. I was doing a simple test program today that my professor is asking us to do just to test to see if his Ant script works correctly and I came across a problem that is confusing me. My prof wants us (after created all of our homework class …

Member Avatar for pattmorter
0
200
Member Avatar for germainelol1

I am creating a method to multiply 2 polynomial expressions together such that: `3x^5 * 2x^3 = 6x^8` -> Where the coefficients are multiplied and the exponents are added together. My test case for this would look something like the following @Test public void times01() throws TError { assertEquals(Term.Zero, Term.Zero.times(Term.Zero)); …

Member Avatar for NormR1
0
329
Member Avatar for germainelol1

I have a Java class called Term holding polynomials like below public Term(int c, int e) throws NegativeExponent { if (e < 0) throw new NegativeExponent(); coef = c; expo = (coef == 0) ? 1 : e; } I also have an equals method in the same class like …

Member Avatar for JamesCherrill
0
494
Member Avatar for Lavanya1312

Hi, I'm new to junit. I want to create test cases for if condition,loops. do we have any guidelines to write test cases for if conditions.Can any1 explain with an example. Thanks in advance. Lavanya

Member Avatar for JamesCherrill
0
328
Member Avatar for m1n1m3

Hey! **Im here to ask for Your advice.** For a school project we choosed to create a android application that uses a database. As we are thrid year studens we have some experiance. But it is not as notable. We have **seen some**: **Access SQL** only on acess. How to …

Member Avatar for peter_budo
0
224
Member Avatar for Traps

I'm trying to create a jUnit test for my EJB's and if my app just contains a few beans everything's all good but as soon as I incorporate JPA and entity-classes my jUnit test blows up. My test fails at ejbContainer = javax.ejb.embeddable.EJBContainer.createEJBContainer(); and the stack trace says the following: …

Member Avatar for Traps
0
476
Member Avatar for giri.pankaj

Is as way test out swing components without having to rely on Thread.sleep() to make sure that the components have realized completely. This problem with this approach is that it becomes difficult to guess how long it would take for components to realize under different environments of execution like vnc …

Member Avatar for peter_budo
0
271
Member Avatar for CodeJava1

hi could someone help me in giving a tutorial in learning how to write testcases in java. would preffer in netbeans if eclipse dosen't matter, thanks in advance

Member Avatar for krishnisilva
0
333
Member Avatar for boris90

I have this code: [CODE] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package se211.dz14; import java.util.Scanner; /** * * @author Boris */ public class Month { /** * @param args the command line arguments */ public static void …

Member Avatar for boris90
0
222
Member Avatar for SeanC

Hi all, ive got a bit of an annoying problem regarding JUnit 4.5. I've created a bunch of unit tests which work properly when I right click the class and press 'Test' (in Netbeans). However, when I right click the whole project and press 'Test', i get a ClassNotFoundException. I …

0
113

The End.