Questions tagged as 'junit'

1
answer

Error accessing dao class by a test class

I have the following error, when accessing a class dao of a test class: java.lang.NullPointerException This is the controller method: @Post("/consultar_lancamento/{codLancamento}") public int consultarLancamento(int codLancamento) {...
asked by 05.07.2016 / 19:36
2
answers

How can I test method with void return using JUnit?

Is it possible to perform automated test, in Java , of a method that has void return using JUnit ? If yes, how is it possible?     
asked by 24.03.2016 / 20:09
2
answers

Unit test with JUnit for system default routines

I have a Java code that checks if there are any default categories registered in the database, if it returns true , otherwise it returns false . public boolean validaEntradaDeDadosPadrao() { System.out.println("Entrei aqui"...
asked by 01.07.2016 / 21:57
1
answer

How does JUnit work?

How does the open-source JUnit framework work? Does it guarantee the quality of the software? Is it advisable to write unit tests on a daily basis?     
asked by 28.03.2017 / 13:00
1
answer

Create web application that runs JUnit test cases in java files that will be submitted by a page?

I'm trying to create an application similar to an online judge, but all I want is that after submitting a java file through an html page or jsp, the application runs a certain JUnit test case in that java file and shows the results in a new page...
asked by 22.02.2016 / 17:02
1
answer

Error deleting data in Mysql by Java

In the database I have three tables, where one of them holds the foreign keys. Error Displayed: Error: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can not delete or update parent row: a foreign key constraint fail...
asked by 13.05.2018 / 21:32
1
answer

Test with junit

I developed a simple banking system, now I want to know how I can use Junit only in the withdraw and deposit methods. package CaixaEletronico; import java.util.Random; import java.util.Scanner; public class Caixa { public static voi...
asked by 14.12.2017 / 02:46
1
answer

Where to store binary files in JUnit unit tests with Maven?

I have the following directory structure for the resource folder of unit tests: src/test/resources/*.files In order for me to read binary files (such as a PDF for example) to complete a unit test, I am putting these files in the test / reso...
asked by 04.04.2018 / 21:47
1
answer

EAD: Configuration error while running the tests

I downloaded the videos of the site for studies, in the video of Modulo3_Video3, about Configuration, I got an error when running the test after using the Configuration feature. 1 - I added the file src \ main \ resources \ inscription.proper...
asked by 02.03.2015 / 20:38
1
answer

Android Test - Call Method

I would like to know if in the android Unit test would have the possibility to call isolated methods of the code, or if just calling activitys, buttons ... I researched in several places and I did not find anything talking about     
asked by 11.07.2014 / 13:37