Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "#junit"
-
When CS professors are lazy to grade so they think they can just give you any grade without you questioning them...
Me: Hi Professor, I see I got a 94 out of 100 on my 2nd project. Your comments said, some of my functions didn't pass your junit test cases.
Prof: Yes!
Me: How come? I tested it several times before submitting and they all passed the test cases. You gave us the test cases to write the code for.
Prof: Yeah, but some of your functions aren't passing on mine.
Me: Since I'm in your office, can you please run it again so I can see?
Prof: Are you doubting me? I gave you the project and I'm telling you they're not passing my test cases.
Me: I just want to make sure because I did work really hard on this project to pass all the test cases. *Runs the code to show him on my laptop and they all pass*
Prof: Fine, let's run it together on mine again. *He runs it and they all pass on his laptop*..hmm, that's weird. They didn't pass when I ran them. Maybe, because of the IDE I used earlier.
Well, looks like you get your 100.
Me: Thank you but which IDE did you ran it in that failed? Just wondering..🤔
Prof: Doesn't matter now...they're passing. Just be ready for your next project...you guys will be writing the test cases yourself this time..9 -
My first complete pipeline with Jenkins:
- push on gitlab
- build with maven
- test with junit
- deploy with Ansible
- integration test with Selenium
I love devops!6 -
Lets create a library.
Lets use that library in a project.
Lets wrap the library call in a wrapper functione to remove duplicate code.
Lets add an overloaded wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
Lets add another overloaded wrapper call that wraps the wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
How I love it. Not.
Sometimes redundancy makes sense, especially when it are two lines which make it obvious whats going on vs a single line that leads to a fuckton of overloaded wrapper functions.
Sheeesh.
Today in "code monkeys deserve divine punishment".
Another funny thing is creating a Helper class for Junit 5 tests, making it instantiable and adding to it all kinds of shit like testcontainer creation, applications instantiation, mocks, ....
... Then " crying " why the tests are so slow.
Yeah. Logic. Isolation of concerns, each test should be a stand alone complex.
But that would lead to redundancy... Oh no.
Better to create a global state god object.
Some devs... Really amaze me, especially when they argument in ways that makes one really wonder whether they are serious or just brain dead.14 -
!rant
Hey guys! We have started working on the cross platform desktop app for devRant for a while.
Here's the Collab link: https://devrant.io/collabs/420025/
Here's the GitHub link: https://github.com/tahnik/devRantFX
Here's more information about what we are using for developing the project:
1. Java 8
2. JavaFX
3. IntelliJ IDEA
4. Gradle
5. JUnit
6. Travis CI
7. JavaRant API (created by LucaScorpion)
8. Slack
Right now we have 4 collaborators: allanx2000, sirwindfield, LucaScorpion and me.
If you are interested in the project, you can always let me know and I will do something about it.5 -
I asked an intern to write JUnits to increase test coverage and he mocked the method itself which was being Unit tested.2
-
Let's call this a !rant haha
Yesterday and today are my last days at this company, and for some unexplainable reason, every bug that I've been assigned is been easy to fix, every junit that I've written has passed at the first time!
Damn, best last days ever XD -
Fuck me. Upgraded a java project from java 11 to java 17 and now the shitload of power mockito tests are all failing because they locked down reflection. Now I have to upgrade to junit 5 and waste my life looking at these stupid unit tests. I sense a large purge approaching.12
-
When you open a previous employees production JUnit tests and see the below:
@Test
public void test1(){
...
}3 -
After finnishing all functionality defined in koncept our boss said that we should write some unit tests.
Wrote first one and already found 2 bugs.
I guess we should start with tests earlier 😅😷3 -
More rants coming up.
1st
Working with a guy who I am not sure has the necessary experience to begin with.
The person who hired him told me to teach the guy for him to catch up to our project and its pace. He has some experience with Java. Which our project is being developed in java in a linux dev environment in a full stack way. So we handle front to infrastructure.
First day working with him and I saw this guy is trouble.
1st - doesn’t know effing git commands. Who doesn’t know git nowadays. Ok i can forgive him for that. But damn this guy’s learning curve is so slow. After s month of joining, he still has to look up the commands in his photo cheatsheet.
2nd - doesn’t know linux basic cli commands like cd, ls, rm. not an ounce of knowledge. He told me he is used to developing in Windows. Now this. I can’t forgive him for not knowing this shit. cd (change dir) even exists in windows command line. He even has guts to say to everyone he wants to try working in our servers. The HORROR!
3rd - not sure if knowing junit and matchers of hamcrest, if you are working with Java is a must. But this guy doesn’t understand Matchers of Junit. How the fuck did he ensure effing quality in his prev work.
All in all, seems like this guy doesn’t understand the basics of current development tools.9 -
Just had a class where we had to write a heap adding algorithm in Java to reduce rounding error for x amount of floats being added together
After an hour of writing code with no testing anything I finished. Ran the JUnit tests provided by the teacher and it passed all the tests!
Who says it can't work the first time?2 -
Every. Single. Time. I've tried to learn and implement proper Unit/Instrumentation testing, the main Android devs decide to go for something else or introduce some feature or Gradle plugin that breaks every tutorial out there. I find it way easier to just test everything manually than learning the new yearly trend. Am I the only one?1
-
Junior Software Developer Job( $37k-$42k USD)
-1 year experience
- J2EE, Javascript, HTML, XML, SQL
- object oriented design and implementation
- management of relational and non-relational such as Oracle, PostGreSQL and Cassandra
- Lifecycle and Agile methods
- Familiarity with the Eclipse development environment and with tools such as Hibernate, JMS, ,TomCat/Gemini/Jetty, OSGi.
• UNIX skills, including Bash or other scripting language
• Experience installing and configuring software packages
• ActiveMQ troubleshooting/knowledge
• Experience in scientific data processing and analytical science in general
• Automated testing tools and procedures, including JUnit testing, Selenium, etc.
• Experience in interfacing with scientific instrumentation, potentially over IP networks
• Familiarity with modern web development, user interface and other ever-evolving front-end
technologies, such as React, TypeScript, Material, Jest, etc.
I am betting they don't get many people applying.8 -
We had a project where we had to code in c# and setup a continuous integration server and create some tests for our application.
Our teacher asked:"Are you guys using junit?
He was serious. -
FML having to take on and support a python test framework that looks like it was written by a junior C embedded dev without a mentor.
- Imports everywhere in the code
- No abstraction or OOP
- sys.path.append fest (broken imports of course)
- Global variables fest
- No docstrings
- No readme
- Somehow mixed with a jUnit test framework as well
- Uses Windows environment variables profusely
- Pycharm has a stroke when I open files from this project5 -
JUnit 5 and Mockito are so cool! Writing tests is so much fun! Having tests is a blessing! 👉 WRITE TESTS 👈
-
When someone writes a JUnit test that passes, when the code is completely wrong. I hate group work.1
-
When you remember 15 minutes before class that you were supposed to do Junit tests for your assignment also. Wooopsie.
-
I am in jvm hell. I have been given a task to add mockito tests. All the existing documentation concerning junit 4 is out of date. Need to use junit 5. All mockito tutorials are out of date. I thought mockito was stupid before junit 5. Now it is “really” stupid. The tutorials I am reading are shit. We have wandered into bleeding edge fucktardness. Kill me now.17
-
Haven't done much work on my game since December. Ok so I havent done anything on my game since December. Learned Mockito and JUnit formally (finally) because that's what we'll be using at work.
Never really learnt unit testing prior, just knew it's power. I just need to find the right unit testing and mocking frameworks that work well with .net, C# and Unity3D and I'll be great.
I'll finally attempt to properly test that (those) annoying part(s) of my game. So many vectors to work out and often the object is moved to or along the wrong vector.
I'd always only imagined having to use stubs which is why I've never understood how unit testing would really help in such a dynamic environment as video game development. Especially as a one man team. Mocking is about to be my lifesaver.
Anyone able to suggest a good testing and/or mocking framework for C#, .Net, Unity3D? -
Theacher said "write 100 times :"I'll not write bad code and also I'll use TDD "... but she specify how "7
-
After 30 minutes of fixing the code I finally noticed that someone switched the position of "actual" and "expected" when writing unit tests.
-
In my Java project, I added a wiremock rule to a few tests. Now my Jacoco code coverage in sonar dropped to 0%. 😩 Maven is running the goals, bit not creating the jacoco.exec file.
That's one of the worst things in Java. Once you understood the concept of immutables, the build tools start to annoy you.2 -
!rant
Using Java is there a framework for building functional tests?
For unit testing we use JUnit but when I'm writing my code, often I need to debug against an actual db, for example, to be able check it actually will work and return the results I expected (and mocked in the unit test).1 -
Question I ask myself : does jUnit is tested with jUnit? What if there is a bug? How to know if the bug is from the framework or the tests cases :o10
-
That kind of devs that creat unit test for a method never used in code instead of deleting it. #CoverageGoals
-
When a good day turns bad for no reason.
java.lang.AssertionError: expected [1] but found [1]
Expected :1
Actual :12 -
I think maybe I am doing something wrong.
I have this node.js application I am building with typescript and I wrote tests in mocha. Now I need to make some changes which break quite a few tests.
When I run mocha on the command line the errors whizz past. When I worked in java and .net (with junit and nunit) you could just click a test in the ide to run it. So you could 'fix' one test at a time. Also you could just double click on a fail and it would jump you to the code for that test or the exception that failed.
I found this extension for visual studio code that adds a sidebar to visual studio code. It looked good but now I spent the last hour trying to get it to run typescript tests - looks like it doesn't support the compilers argument.
Surely other developers must do this sort of stuff. I am not using an obscure technology stack right? Do you write automated tests for your codebase? What tools do you use? Should I switch ide? switch testing frameworks? -
Fuck you, BouncyCastle. I really like you but the way you have documentation. It's annoying. Nice name. Cool project.
Here, I'm write Java Docs for JUnit tests! For every damn test case!
So damn less documentation even SO said mind your own business! It's been more than 15 hrs. Not a single reply! I died a little today. They have examples but they are not really "examples". No passion at all for documentation!
You should watch and learn from AssertJ docs. OMFG @joel-costoglia sets standards for code style and docs before pull requests. The examples are LOTR themed for god's sake. I'm not asking for fluent API. I just want docs. What class does what. A simple program structure required.
Dyn4j, deeplearning4J have wonderful docs. Why not BouncyCastle?!!!!! -
What's a good way to learn proper testing? I'll be starting in a position before long that uses JUnit, karma, mocha, etc.1
-
Guidewire is the work of satan. It is the worst framework I have ever worked with. OOTB code is full of antipatterns, creating gui is a pain, and it has its own language that is a pure joke. Every task I had had to have some sort of workarounds. You cant junit test it. Entity builders are a mess and you cant mock gosu classes. I hate it so much.
-
I started studying JUnit and Mockito and I really don't understand. All the docs and the tutorials around are like "if call this method, then return this object. If the object returned is the one that I expected then test passed". But isn't it obvious that the returned object is the one that I expected? I fucking told it to return that object4
-
How would you java spring guys write a JUnit test for a login controller? My controller works as followin: It checks the username and password values from the model and then either redirects to the home page or redirects to the login page with an error code. How am I supposed to test that behavior, when MvcMock can't capture the redirects?1