yusuf Kaplan

Ranch Hand
+ Follow
since Mar 11, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by yusuf Kaplan

Hey,

do you remember that if the question says at the end something like "Choose one correct answer" or "Choose two correct answers".
So does the exam told you how many answers you should choose from the multiple choice?

Regards,
Yusuf
4 years ago
Ok, I need to create an instance of T.
But how to do that? Isnt there any other then refeflection ?
How would the code look like?
Hi all,

I have following three classes:






When I run Main I get
Exception in thread "main" java.lang.ClassCastException: SuperClass cannot be cast to SubClass
at Main.start(Main.java:28)
at Main.<init>(Main.java:22)
at Main.main(Main.java:18)


I expect that in addSomething the variable t can be cast succesfully to T, so during runtime t should be of type Subclass, but the type is Superclass.
Why? And how to circumvent this?

Cheers,
Y
Got it.
Partial Mocking solved the problem.
Thanks for everybody
6 years ago
Hi Sresh,

thanks for the answer.
ServiceImpl.count calls CustomerDAOImpl.count calls CustomerDAOImpl.findAll.
When my test runs into CustomerDAOImpl.findAll it should return the list with 50 entries.
I explicitly dont want to mock count(). I just want a method to be mocked which is deeper in the call hierarchy.

Sresh Rangi wrote:The service method is calling count, which is mocked to return 0 by default. In your test, you should mock the count method instead of the findAll method.

6 years ago
Hi all,

following code:


returns 0 in Console. But I expect it to return 50.
ServiceImpl looks like:


and CustomerDAOImpl


Any suggestions?
6 years ago
Hi all,

Im just trying to setup a basic project structure in Eclipse with Wicket and Spring. I think its pretty smart to separate both Wicket and Spring into two different Eclipse projects, isnt it? Thus, I created an Eclipse project for the Web part and one for the Spring (and later Hibernate as well) part.
Now when I start Tomcat with Eclipse I get "...Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ConfigurableApplicationContext"
Thats not rocket science. After adding the corresponding Spring lib to the WEB-INF/lib folder another error message appears after server startup telling me that another class is missing from a different jar. Probably I will end up adding all Spring jars into my WEB-INF/lib folder. But thats not what I what. I dont want to add any Spring Core jar in my Web project (Reasons should be clear). I already added all Spring related jars into my different Spring Eclipse project.
Any suggestions.

Cheers,
Y

Tim Holloway wrote:You're expecting a 2006 solution to still apply 6 years later?

Bauke hasn't been heard from for about 3 years now.



Maybe someone else then Bauke can answer my question...
6 years ago
JSF
Im using JSF 2.x
and copy and pasted Baukes solutions. But still there is a Javascript error when I click "get selected row".
Any ideas?
6 years ago
JSF
Thanks for the answer which solved my problem.
7 years ago
Hi all,

I configured a servlet with load-on-startup 1, but the Servlet is still load when it is requested. I expected it to load when the container is started.
I verified it by debugging my example app using Eclipse and Tomcat.
I tried without "load-on-startup 1" and started my form.html with "Debug on Server." The debugger went into doPost after I clicked Submit on my form. Thats fine.
But with "load-on-startup 1" I expect the debugger to go into doPost right after I "Debug on Server" the form.html.
Is my expectation correct here?

Cheers,
Y
7 years ago

Mark Spritzler wrote:The hibernate.cfg.xml is if you are not using JPA with Hibernate, if you are, then you will use the persistence.xml file instead of the hibernate.cfg.xml. Of course, this is all for Hibernate version 3.x anyone using a version before will only use the hibernate.cfg.xml.

Mark



So is it true, when you decide to use persistence.xml, then you can remove hibernate.cfg.xml ???
Thanks for the hint Anurag,

I solved by renaming all properties from "buildDir" to "buildDirName".
But now I get the following error when running the build.


Anyone knows what to do?

Cheers,
Y
Hi all,

from the "hibernate-release-4.1.2.Final" I want to build the sources.
When I run "gradle" within "/hibernate-release-4.1.2.Final/project" I get the following:


Anyone has a solution?

Cheers,
Yusuf
Hi all,

passed today OCPJP with 80%.
Thanks everybody for support.

Regardz from cold Hamburg, Germany.
7 years ago