My Junit test should check that the number being returned is the same as the list size
if my test was as follows would this be coded properly, i feel it isnt because i the last 2 lines are always going to be true?
public void testGetTotalPilots() {
ArrayList<Pilot> list = new ArrayList<Pilot>();
int size = list.size();
as...
I want to store an image in a MySQL database. I have created a table with a BLOB datatype, but now how do I store the image in this table?
...
In performance tests of our web service we found out that the traffic generated by the response exceeded our expectations a lot. We are querying the database and loading lists consisting of rows and columns.
The type of the column is AnyType so the in the response there needs to be a type information. Therefor the web service engine (A...
I want to run background process in parallel with my spring-mvc web-application. I need a way to start in automatically on context loading. Background process is a class that implements Runnable.
Is spring-mvc has some facilities for that?
...
We need some easy way to manage web sites at our company, and we are evaluating some CMS tools for this purpose.
We do not yet know what features the sites will need to have (but it will definitely be something with lots of functionalities), so we are looking for something with lots of features and more importantly to be easily extensi...
i want to put the prerequisites using the script in innosetup how can i do it and when i have developed the setup using innosetup the desktop icon created is not going to launch the application.
what to do plz help me ?
thanks in advance.
...
Hi
I'm trying to get my java client to communicate with a C server using SSL.
The problem is - I don't have any server sources and I'm getting a handshake failure error:
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException...
In netbeans how can i find out where methods are being called - i have one particular method in a big project ad cant find where its being called
thanks
...
I'm trying to work with java data access, so this with what I came up with:
Tell me what do you think about this
(It's a little bit like SqlConnection from C#)
import java.sql.*;
public class SqlConnection {
Connection connection;
public Connection GetConnection() {return connection;}
public void Connect(String cs, Strin...
I'm trying to integrate hibernate search in my project. My models are indexed, but for some reason my search queries do not return any results. I've been trying to solve this issue for a few hours now, but nothing I do seems to work.
Domain object:
@Entity
@Table(name = "roles")
@Indexed
public class Role implements GrantedAuthority {
...
I am using rich faces panel bar control in my application. There some problem with the control.
The code is some thing like this
<rich:panelBar contentClass="some-class">
<rich:panelBarItem label="Panel 1" headerClass="some-css-class">
Contents 1
</rich:panelBarItem>
<rich:panelBarItem label="Panel 2" headerClass="some...
I have a string variable
static String[] genrename;
I am assigning values to it in one of my method and then displaying its content.
It does store the value fine. But when I am accessing the String variables directly or from a getter method(). It shows a null value in the string.
Any ideas?
public class GenreParsing {
static int...
Hi,
I've a java package (package A) and I would retrieve a file contained into another package (package B)? How could I do this?
Thanks in advance. Best regards.
...
C:\Program Files (x86)\Java\jdk1.6.0_17\bin>javac VendingMachine.java
VendingMachine.java:27: error while writing VendingMachine: VendingMachine.class
(Access is denied)
public class VendingMachine
^
1 error
Here is the code from my editior from line 27 to 39:
public class VendingMachine /*This is line 27*/
{
private int it...
Okay given this:
javac is the java compiler. It
compiles the file, but has no output
if there are no warnings or errors.
What can I use to view the file from a user's perspective-
user is suppose to see a vending machine that allows them to buy certain stuff from vending machine.java, apparently just running javac somevendmachi...
Why isn't a Map<String,List<SomeBean>> castable to Map<String,List<?>>?
What I'm doing now is this:
Map<String, List<SomeBean>> fromMap = new LinkedHashMap<String, List<SomeBean>>();
/* filling in data to fromMap here */
Map<String,List<?>> toMap = new LinkedHashMap<String, List<?>>();
for (String key : fromMap.keySet()) {
toMap....
Given the allowed operators of +, /, -, *, and given a user inputted list of single digit numbers (any length allowed), how can I output all possible combinations of mathematical expressions (and the resulting values) that can be formed with the numbers and the given constant set of operators? Also to allow for scalability, for example,...
Hi all,
If I would like to process payments directly without going through Google / Amazon / Paypal, how would I go about that? Is there a Java API or some reference implementation that shows how to do such a thing or is it really that large and complicated that I need to choose a provider such as Google or Amazon?
I currently use Goo...
Hello, I have a question regarding inheritance in Java. If I have this base class
class Parent {
private String lastName;
public Parent() {
lastName = "Unassigned";
}
public String getLastName( ) {
return lastName;
}
public void setLastName(String name) {
lastName = name;
}
}
And...