| EasyMock, JUnit, Java5 and generics... |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Overriding interface methods on objects you don't instantiate yourselfAssume I have a class inherited from JTextComponent. I don't know what type
of Document will be used as its model, however I want to add functionnality
in the insertString() method of this Document instance.
How do I do this?
If that's not clear, I'd like to do something like this:
public class MyTextComponent extends JTextComponent {
...
protected Document createDefaultModel() {
return super.createDefaultModel() { // doesn't work, ofc
public void insertString(int offset, String str, AttributeSet a)
{
doSomething();
super.insertString(offset, str, a);
}
};
}
}
- 2
- Cannot run OpenJMS in SuSE 9.2I downloaded the latest OpenJMS (0.7.6.1) but when I try "./openjms.sh
start", the following exception is thrown (note the IP address
192.168.0.88, though my IP is 192.168.0.60):
OpenJMS 0.7.6.1
The OpenJMS Group. (C) 1999-2004. All rights reserved.
http://openjms.sourceforge.net
org.exolab.jms.server.ServerException: java.rmi.ConnectIOException:
Exception creating connection to: 192.168.0.88; nested exception is:
java.net.NoRouteToHostException: No route to host
at
sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:587)
at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at
org.exolab.jms.server.rmi.RmiJmsServer.init(RmiJmsServer.java:121)
at
org.exolab.jms.server.JmsServer.initConnector(JmsServer.java:367)
at
org.exolab.jms.server.JmsServer.initConnectors(JmsServer.java:321)
at org.exolab.jms.server.JmsServer.init(JmsServer.java:197)
at org.exolab.jms.server.JmsServer.main(JmsServer.java:229)
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at
sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
... 10 more
Any suggestions?
// Ake
- 3
- I am using tomcat foe springHi
I am using tomcat apache-tomcat-6.0.10 but when i write the
following URL
http://localhost:8080/springapp/index.jsp
and I get the following error.
does any body know the solution of this problem
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/
el/ELResolver
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NoClassDefFoundError: javax/el/ELResolver
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
java.lang.ClassLoader.loadClass(ClassLoader.java:299)
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:
201)
org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:
157)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
320)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803
- 4
- File SelectorHi,
How can I open the Swing-FileSelector in a special subdir?
I tried it with the pathname as String, but the FileSelector starts
always in the default dir.
Thank you.
Greetings,
Michael Pock
- 4
- Computer.Its easy to earn money.. www.superslim3.blogspot.com.. www.superslim3.blogspot.com
- 5
- 9
- append string into FileHi,
I am having a big trouble while saving information into a file. I would
like append some information into file. However, each time that I try to
do this, the information of the file is replaced by the new information.
What is wrong with my routine?
File simFile = new File("simulations.txt");
//System.out.println("simulations: "+simFile.getAbsolutePath());
try{
if(simFile == null)
throw new IOException();
BufferedWriter output = new BufferedWriter(new FileWriter(simFile));
String text = simObj.getInfo();
output.append(text);
//output.newLine();
closeFile(output);
}catch(IOException e){
System.err.println("Cannot save Simulation into file");
}
thanks very much,
Marcelo
- 9
- ResultSet and getArray()Then I have a result set named rs. I need that one column of ResultSet
rs will be in an array.
I've read about method getArray(), so i've thinked that my code will
be something like that:
================================
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
ResultSet rs=mdbc.inviaQuery("select * from ... where ...");
try {
rs.next();
txtNome.setText(rs.getString("DB_COLUMN_NAME_1"));
rs.getArray("DB_COLUMN_NAME_2");
} catch {
// EXCEPTION
}
================================
Alas there's something that's go wrong and I get this error
(paziente.java552 is the line containing
rs.getArray("DB_COLUMN_NAME_2");) where's my mistake:
Exception in thread "AWT-EventQueue-0"
java.lang.UnsupportedOperationException
at
sun.jdbc.odbc.JdbcOdbcResultSet.getArray(JdbcOdbcResultSet.java:4425)
at cc.Paziente.formWindowOpened(Paziente.java:552)
at cc.Paziente.access$000(Paziente.java:15)
at cc.Paziente$1.windowOpened(Paziente.java:94)
at java.awt.Window.processWindowEvent(Window.java:1187)
at javax.swing.JFrame.processWindowEvent(JFrame.java:266)
at java.awt.Window.processEvent(Window.java:1148)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:
242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
163)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:
110)
B
- 10
- ResultSet is closedI was testing my program and the above appeared in the output. I have
searched all classes in this particular folder and I do not even have any of
that coded. Does Java issue messages like that? Is it an error? My code ran
ok, just the message appeared.
--
Mike B
- 11
- rmi classnotfoundexcptionI have a question when I write RMI program .
file direction as follow:
D:\project\
D:\project\build\
D:\project\build\classes\
D:\project\build\classes\report\
D:\project\build\classes\report\ReportAssist.class
D:\project\build\classes\report\ReportAssistImpl.class
D:\project\build\classes\report\ReportAssistServer.class
D:\project\build\classes\report\ReportAssistClient.class
D:\project\build\classes\report\ReportAssistImpl_Stub.class
D:\project\lib\
D:\project\lib\jdom.jar
D:\project\lib\sqljdbc.jar
D:\project\config.xml
#rmiregistry 2001
cd D:\project\
set CLASSPATH=./lib/;./build/classes/
rmiregistry 2001 --has success
#start server
cd D:\project\
java -Djava.rmi.server.codebase=file:D:\project\lib\ -classpath .
/build/classes/ report.ReportAssistServer --has success
#start client
cd D:\project\
java -Djava.rmi.server.codebase=file:D:\project\lib\ -classpath .
/build/classes/ report.ReportAssistClient
--exception
java.lang.NoClassDefFoundError: org/jdom/JDOMException
The server side has printed information when start client .
How do I set the classpath ?
--
Message posted via http://www.javakb.com
- 13
- Transactions QuestionsI have been reading about transactions in java and have some questions:
*) Which is mostly used: Container-managed transactions (CMT) or
Bean-managed transactions (BMT)? I dont have Entity Bean in my application.
*) Is this statement true: Use JTA only when the transaction involves more
than 1 database else use JDBC? If yes then how would you deal with this?
It would be nice if somebody points to a detailed tutorial about
transactions.
Thanks
- 15
- creating an internalFrameI'm trying to create an instance of the JInternalFrame class, which
works fine.
I defined a JDesktopPane named desktop and I am able to add an internal
Frame to this JDesktopPane.
Inside this JInternalFrame (lets call ist Frame1) I got a button which
"should" open another JInternalFrame called Frame2 inside the same
desktop. But it doesn't work. The compiler says it doesn't recognize the
variable "desktop".
How do I get him to refer to the current instance of the JDesktopPane
I'm using? I have just one JDesktopPane as my workspace.
thx in advance,
Daniel
- 15
- CHRIST: THE ARRIVALOn Mon, 26 Dec 2005 01:34:53 +0100, "Antoll MA" <> wrote, quoted or
indirectly quoted someone who said :
>www.antollma.org
You mean Christ the spammer.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 15
- To create crossed circles in JavaHello
I need to create 3 crossed circles in Java, i like doing the circles in
the window, but i don't know to cross, they must appear in the window
like a chain.
Thanks for your collaboration.
- 15
- Java v/s ImageMagickHi all,
I have to write a application to concatenate couple of gif images to
generate a animation. The basic problem is that the file size of final
animation is very huge.It's uncompressed.
Can some body point 2 good library which generate proper compressed,
small size gif images.
-- PRADEEP SHARMA
|
| Author |
Message |
Darryl L. Pierce

|
Posted: 2006-1-3 22:56:00 |
Top |
java-programmer, EasyMock, JUnit, Java5 and generics...
I'm trying to create a unit test. In the unit test I need to create a
mock java.util.List object. The List is going to be a collection of
WebForm objects, so the way it's declared using generics as
List<WebForm>. For my unit test I want to mock this List, but cannot
find a way to declare the mock object in my code. The declaration is as
follows:
private MockControl<List<WebForm>> controlWebforms;
private List<WebForm> webforms;
When I try to create the mock object, the following code is invalid:
controlWebforms = MockControl.createControl(List.class);
webforms = controlWebforms.getMock();
I get the error message "Type mismatch: cannot convert from
MockControl<List> to MockControl<List<WebForm>>" However, the following
declaration:
controlWebforms = MockControl.createControl(List<WebForm>.class);
webforms = controlWebforms.getMock();
is invalid. How do I reference the class for List<WebForm> to create my
mock object? Any ideas?
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
Andrew McDonagh

|
Posted: 2006-1-4 2:56:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Darryl L. Pierce wrote:
> I'm trying to create a unit test. In the unit test I need to create a
> mock java.util.List object. The List is going to be a collection of
> WebForm objects, so the way it's declared using generics as
> List<WebForm>. For my unit test I want to mock this List, but cannot
> find a way to declare the mock object in my code. The declaration is as
> follows:
>
> private MockControl<List<WebForm>> controlWebforms;
> private List<WebForm> webforms;
>
> When I try to create the mock object, the following code is invalid:
>
> controlWebforms = MockControl.createControl(List.class);
> webforms = controlWebforms.getMock();
>
> I get the error message "Type mismatch: cannot convert from
> MockControl<List> to MockControl<List<WebForm>>" However, the following
> declaration:
>
> controlWebforms = MockControl.createControl(List<WebForm>.class);
> webforms = controlWebforms.getMock();
>
> is invalid. How do I reference the class for List<WebForm> to create my
> mock object? Any ideas?
>
Never mock the list, mock the list contents.
Also, unless you need to use a mock object framework, its usually easier
not to. Rolling your own fake and mock versions of your interfaces and
classes is very easy with Eclipse & IntelliJ, so Mocking frameworks
really come into themselves when you want to mock third party code.
YMMV
What is MockControl? Is this your own MVC/P class?
Andrew
|
| |
|
| |
 |
Darryl L. Pierce

|
Posted: 2006-1-4 23:46:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Andrew McDonagh wrote:
> Never mock the list, mock the list contents.
No, I don't care about the contents. I only care about mocking the List
itself. Why do you say the above about not mocking the list?
At any rate, I found the solution. It was to create the mock control as
follows:
private MockControl<? extends List> controlWebforms;
> Also, unless you need to use a mock object framework, its usually easier
> not to. Rolling your own fake and mock versions of your interfaces and
> classes is very easy with Eclipse & IntelliJ, so Mocking frameworks
> really come into themselves when you want to mock third party code.
>
> YMMV
>
> What is MockControl? Is this your own MVC/P class?
It's a part of the EasyMock framework.
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
Andrew McDonagh

|
Posted: 2006-1-5 0:08:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Darryl L. Pierce wrote:
> Andrew McDonagh wrote:
>
>> Never mock the list, mock the list contents.
>
>
> No, I don't care about the contents. I only care about mocking the List
> itself. Why do you say the above about not mocking the list?
I take it the list is the standard Java one?
And you are attempting to create a mock version of it?
Why?
We don't need to mock things that work or are easy to use.
I'd guess for your test, its the contents you don't care about but you
do care that a valid list object is used. So use a list, but fill it
with mock contents.
Can you post your test case code? ( I don't need to see the code its
testing)
>
> At any rate, I found the solution. It was to create the mock control as
> follows:
>
> private MockControl<? extends List> controlWebforms;
>
>> Also, unless you need to use a mock object framework, its usually
>> easier not to. Rolling your own fake and mock versions of your
>> interfaces and classes is very easy with Eclipse & IntelliJ, so
>> Mocking frameworks really come into themselves when you want to mock
>> third party code.
>>
>> YMMV
>>
>> What is MockControl? Is this your own MVC/P class?
>
>
> It's a part of the EasyMock framework.
>
right o..
|
| |
|
| |
 |
Darryl L. Pierce

|
Posted: 2006-1-5 1:11:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Andrew McDonagh wrote:
>>> Never mock the list, mock the list contents.
>>
>> No, I don't care about the contents. I only care about mocking the
>> List itself. Why do you say the above about not mocking the list?
>
> I take it the list is the standard Java one?
Yes.
> And you are attempting to create a mock version of it?
Yes. I'm mocking the response an instance of List would return to the
isEmpty() API.
> Why?
Because I don't want to create an actual instance and have to populate
it with actual instances of my WebForm object. Hence the reason I'm
using EasyMock. :)
> We don't need to mock things that work or are easy to use.
We need to mock those things which we do not want to have to actually
create. I don't want to create an instance of List<WebForm> because to
do so means I would then have to create actual instances of WebForm and
add them to the List when I want to have the isEmpty() method return false.
> I'd guess for your test, its the contents you don't care about but you
> do care that a valid list object is used. So use a list, but fill it
> with mock contents.
Sorry, but you should really learn more about my requirements first
before saying whether I should or shouldn't mock a List or its
contents.. I don't care about the contents and, since I'm not writing
unit tests for java.util.List, dont' care about the concrete
implementations available for List. I only need to have a mock control
(in this case) either return true or false when the isEmpty() method is
invoked.
> Can you post your test case code? ( I don't need to see the code its
> testing)
Sure. Here ya go:
---8<[snip]---
package com.redhat.www.webforms.web;
import java.util.List;
import org.easymock.MockControl;
import org.springframework.validation.Errors;
import com.redhat.www.webforms.domain.WebForm;
import com.redhat.www.webforms.domain.WebFormListCommand;
import junit.framework.TestCase;
/**
* <code>TestWebFormListValidator</code> performs unit tests on the
* {@link WebFormListValidator} class.
*
* @author Darryl L. Pierce
*/
public class TestWebFormListValidator extends TestCase
{
private WebFormListValidator validator;
private WebFormListCommand command;
private MockControl<Errors> controlErrors;
private Errors errors;
private MockControl<? extends List> controlWebforms;
private List<WebForm> webforms;
private MockControl<? extends List> controlSelectedWebForms;
private List<WebForm> selectedWebForms;
protected void setUp() throws Exception
{
validator = new WebFormListValidator();
command = new WebFormListCommand();
controlErrors = MockControl.createControl(Errors.class);
errors = controlErrors.getMock();
controlWebforms = MockControl.createControl(List.class);
webforms = controlWebforms.getMock();
command.setWebforms(webforms);
controlSelectedWebForms =
MockControl.createControl(List.class);
selectedWebForms = controlSelectedWebForms.getMock();
command.setSelectedWebforms(selectedWebForms);
}
protected void tearDown() throws Exception
{
controlErrors.verify();
controlWebforms.verify();
controlSelectedWebForms.verify();
}
private void replayControls()
{
controlErrors.replay();
controlWebforms.replay();
controlSelectedWebForms.replay();
}
/**
* Tests the validator's response to a delete request without any forms
* present.
*/
public void testDeleteWithNoFormsPresent()
{
webforms.isEmpty();
controlWebforms.setReturnValue(true);
errors.reject("webform.error.delete-no-forms-present");
controlErrors.setVoidCallable();
replayControls();
validator.validate(command, errors);
}
/**
* Tests the validator's response to a delete request without any forms
* selected.
*/
public void testDeleteWithoutSelectedForms()
{
webforms.isEmpty();
controlWebforms.setReturnValue(false);
selectedWebForms.isEmpty();
controlSelectedWebForms.setReturnValue(true);
errors.reject("webform.required.delete-requires-selection");
controlErrors.setVoidCallable();
replayControls();
validator.validate(command, errors);
}
/**
* Test the validator's response to a delete request with at least
one form
* selected.
*/
public void testDeleteWithFormsSelected()
{
webforms.isEmpty();
controlWebforms.setReturnValue(false);
selectedWebForms.isEmpty();
controlSelectedWebForms.setReturnValue(false);
replayControls();
validator.validate(command, errors);
}
}
---8<[snip]---
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
Andrew McDonagh

|
Posted: 2006-1-5 1:16:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Darryl L. Pierce wrote:
> Andrew McDonagh wrote:
>
>>>> Never mock the list, mock the list contents.
>>>
>>>
>>> No, I don't care about the contents. I only care about mocking the
>>> List itself. Why do you say the above about not mocking the list?
>>
>>
>> I take it the list is the standard Java one?
>
>
> Yes.
>
>> And you are attempting to create a mock version of it?
>
>
> Yes. I'm mocking the response an instance of List would return to the
> isEmpty() API.
>
>> Why?
>
>
> Because I don't want to create an actual instance and have to populate
> it with actual instances of my WebForm object. Hence the reason I'm
> using EasyMock. :)
>
>> We don't need to mock things that work or are easy to use.
>
>
> We need to mock those things which we do not want to have to actually
> create. I don't want to create an instance of List<WebForm> because to
> do so means I would then have to create actual instances of WebForm and
> add them to the List when I want to have the isEmpty() method return false.
>
>> I'd guess for your test, its the contents you don't care about but you
>> do care that a valid list object is used. So use a list, but fill it
>> with mock contents.
>
>
> Sorry, but you should really learn more about my requirements first
> before saying whether I should or shouldn't mock a List or its
> contents.. I don't care about the contents and, since I'm not writing
> unit tests for java.util.List, dont' care about the concrete
> implementations available for List. I only need to have a mock control
> (in this case) either return true or false when the isEmpty() method is
> invoked.
so why not just instantiate the list and leave it empty?
Is the list the webforms one in setup that we are talking about, or some
other one?
|
| |
|
| |
 |
Darryl L. Pierce

|
Posted: 2006-1-5 2:53:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Andrew McDonagh wrote:
> so why not just instantiate the list and leave it empty?
Why do that when I can mock the object and control exactly how the
mocked object responds to method invokations? The point of mocking
objects is to create a phantom object that does exactly what you want so
that you can explicitly test another object. I don't need an actual
List: I just need something that has the same type as List and which
returns false in one case and true in other cases when the isEmpty()
method is invoked on it.
If I create an actual List I then have to create actual objects (whether
they're dumby objects or not is irrelevant) to populate it in order to
have isEmpty() return false. I don't want to do that, it's outside of
the scope of my unit test. My unit test doesn't _care_ about that level
of detail, so doing it is extra work that doesn't give any added benefit.
> Is the list the webforms one in setup that we are talking about, or some
> other one?
That's the one.
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
Andrew McDonagh

|
Posted: 2006-1-5 3:18:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Darryl L. Pierce wrote:
> Andrew McDonagh wrote:
>
>> so why not just instantiate the list and leave it empty?
>
>
> Why do that when I can mock the object and control exactly how the
> mocked object responds to method invokations? The point of mocking
> objects is to create a phantom object that does exactly what you want so
> that you can explicitly test another object. I don't need an actual
> List: I just need something that has the same type as List and which
> returns false in one case and true in other cases when the isEmpty()
> method is invoked on it.
>
> If I create an actual List I then have to create actual objects (whether
> they're dumby objects or not is irrelevant) to populate it in order to
> have isEmpty() return false. I don't want to do that, it's outside of
> the scope of my unit test. My unit test doesn't _care_ about that level
> of detail, so doing it is extra work that doesn't give any added benefit.
>
>> Is the list the webforms one in setup that we are talking about, or
>> some other one?
>
>
> That's the one.
>
Do you mock String, Integer, Boolean, Map, etc, too?
List webforms = new List();
assertTrue(webforms.isEmpty());
whats the difference you see between that List and your mock list - you
still have to create an instance of your mock list.
I understand the benefit of mocks, we can prime them for expected
behavior calls and values. Though I'm at a loss to understand why you
need to mock a list....
Mocking any Java class is rare (though not non-existent) in the junit
community.
Just curious you see...
I'm going to know up your tests and the command & validator classes
without mocks, just to see what the difference is like...but give me a
few hours as I'm about to go cook the dinner :)
Andrew
|
| |
|
| |
 |
Darryl L. Pierce

|
Posted: 2006-1-5 4:04:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Andrew McDonagh wrote:
> Do you mock String, Integer, Boolean, Map, etc, too?
No, no, no, yes, depends. You can only mock an interface, not a class.
> List webforms = new List();
>
> assertTrue(webforms.isEmpty());
I'm not testing that. That's why I said previously that you ought to
understand my requirements before suggesting that what I'm doing is
incorrect. I'm testing a class that checks a List for whether it
contains any elements and branches based on that. I have no need for
creating/populating an instance of a class that implements List when I
can achieve *the same results* using a mock object alone. And I can do
it in *fewer lines of code* with mock objects.
> whats the difference you see between that List and your mock list - you
> still have to create an instance of your mock list.
And I can script the responses that the mock object returns without
having to create any *more* objects. One mock and I'm done. With what
you're suggesting, I have to create *more* objects if I want isEmpty()
to return false. With mock objects, I don't.
> I understand the benefit of mocks, we can prime them for expected
> behavior calls and values. Though I'm at a loss to understand why you
> need to mock a list....
That's because you don't seem to understand my requirements, which is
understandable.
> Mocking any Java class is rare (though not non-existent) in the junit
> community.
Rare based on what metric or study?
> Just curious you see...
>
> I'm going to know up your tests and the command & validator classes
> without mocks, just to see what the difference is like...but give me a
> few hours as I'm about to go cook the dinner :)
Nah, save yourself the effort. What you're suggesting provides no
benefit and involves creating more objects than is necessary. The one
example I provided is hardly a good example anyway. HttpServletRequest
is a better example and is also a Java class.
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
Andrew McDonagh

|
Posted: 2006-1-5 7:10:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Darryl L. Pierce wrote:
> Andrew McDonagh wrote:
>
>> Do you mock String, Integer, Boolean, Map, etc, too?
>
>
> No, no, no, yes, depends. You can only mock an interface, not a class.
With certain mocking frameworks anyway...
Its sometimes beneficial to derive from a class and over ride its
methods to serve like a Fake or Mock.
>
>> List webforms = new List();
>>
>> assertTrue(webforms.isEmpty());
>
>
> I'm not testing that. That's why I said previously that you ought to
> understand my requirements before suggesting that what I'm doing is
> incorrect.
Yes, sorry, thats not what I was trying to show. I was merely trying to
show that a (actually ArrayList - missed that above) list can be created
without any elements, and its current implementation would satisfy the
isEmpty(). But then I could be missing some point about your usage of
the list - you haven't made it clear...
> I'm testing a class that checks a List for whether it
> contains any elements and branches based on that. I have no need for
> creating/populating an instance of a class that implements List when I
> can achieve *the same results* using a mock object alone. And I can do
> it in *fewer lines of code* with mock objects.
>
>> whats the difference you see between that List and your mock list -
>> you still have to create an instance of your mock list.
>
>
> And I can script the responses that the mock object returns without
> having to create any *more* objects. One mock and I'm done. With what
> you're suggesting, I have to create *more* objects if I want isEmpty()
> to return false. With mock objects, I don't.
What more objects? its one ArrayList object containing nothing.
Thats the same as one MockList containing nothing.
>
>> I understand the benefit of mocks, we can prime them for expected
>> behavior calls and values. Though I'm at a loss to understand why you
>> need to mock a list....
>
>
> That's because you don't seem to understand my requirements, which is
> understandable.
>
>> Mocking any Java class is rare (though not non-existent) in the junit
>> community.
>
>
> Rare based on what metric or study?
Based upon neither...just personal long standing usage of JUnit,
coaching of TDD using JUnit and discussing it on various JUnit forums.
If you haven't come across it, I can recommend the JUnit Yahoo group.
You'll find many good people there willing to help, including the JUnit
authors (Beck et al) and various book authors...
>
>> Just curious you see...
>>
>> I'm going to know up your tests and the command & validator classes
>> without mocks, just to see what the difference is like...but give me a
>> few hours as I'm about to go cook the dinner :)
>
>
> Nah, save yourself the effort. What you're suggesting provides no
> benefit and involves creating more objects than is necessary.
right - o
> The one example I provided is hardly a good example anyway. HttpServletRequest
> is a better example and is also a Java class.
>
What about HttpServletRequest?
Mocking it?
|
| |
|
| |
 |
Darryl L. Pierce

|
Posted: 2006-1-5 7:36:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Andrew McDonagh wrote:
>>> Do you mock String, Integer, Boolean, Map, etc, too?
>>
>>
>> No, no, no, yes, depends. You can only mock an interface, not a class.
>
>
> With certain mocking frameworks anyway...
But not with what I'm using.
> Its sometimes beneficial to derive from a class and over ride its
methods to serve like a Fake or Mock.
Except when that other class is also one that's tested in your project,
in which case you can't be assured that a failure is a result of the
class you're testing or the one you're using to do the testing. Also
your method does not give me any guarantee that any particular method
(such as isEmpty() in this case) was even called in the first place.
EasyMock reports the test as a failure if the methods you expected to be
called weren't called. Stub objects do not do that for you unless you
first write *even more code* to track that. And now you've created even
*more* work just to accomplish a unit test.
>>> List webforms = new List();
>>>
>>> assertTrue(webforms.isEmpty());
>>
>>
>> I'm not testing that. That's why I said previously that you ought to
understand my requirements before suggesting that what I'm doing is
incorrect.
>
>
> Yes, sorry, thats not what I was trying to show. I was merely trying
to show that a (actually ArrayList - missed that above) list can be
created without any elements, and its current implementation would
satisfy the isEmpty(). But then I could be missing some point about
your usage of the list - you haven't made it clear...
I've made it abundantly clear: the class I'm testing will call the
isEmpty() method on the List it has and branch based on whether it gets
a true or a false back.
>>> whats the difference you see between that List and your mock list -
you still have to create an instance of your mock list.
>>
>>
>> And I can script the responses that the mock object returns without
having to create any *more* objects. One mock and I'm done. With what
you're suggesting, I have to create *more* objects if I want isEmpty()
to return false. With mock objects, I don't.
>
>
> What more objects? its one ArrayList object containing nothing.
I don't just need a List that contains nothing. I also need to test when
isEmpty() returns *false*. In order to do it your way I need to create
*more* objects and put them into the List, objects which themselves will
never be used in my unit tests. Creating objects that will never be used
is a waste.
> Thats the same as one MockList containing nothing.
Mate, I've said a few times that that's not the *only* List I'm using.
>>> Mocking any Java class is rare (though not non-existent) in the
junit community.
>>
>>
>> Rare based on what metric or study?
>
>
> Based upon neither...just personal long standing usage of JUnit,
coaching of TDD using JUnit and discussing it on various JUnit forums.
So you mean *you* don't do it? Okay, then say so. My experience is
different from yours: all I've ever seen have mocked anything that was
not directly being tested.
> If you haven't come across it, I can recommend the JUnit Yahoo group.
Already a member.
> You'll find many good people there willing to help, including the
JUnit authors (Beck et al) and various book authors...
I have _JUnit In Action_. I'm not ignorant of JUnit, thank you.
>> The one example I provided is hardly a good example anyway.
HttpServletRequest is a better example and is also a Java class.
>
>
> What about HttpServletRequest?
>
> Mocking it?
Yes. It's a Java class. Simply creating a stubbed version of it is a
whole extra programming effort. If you're testing a servlet is it really
more practical to create a scaffold version of HttpServletRequest? What
do you do about the contained HttpSession? If your unit test touches it
then you now have to stub that as well. With Easy Mock you can mock the
whole lot of those objects and pass back and control the whole situation.
Again, the whole point I'm making now is that dismissing mocking
Collection interfaces or anything else that's "a Java class" or saying
that "we don't need to mock things that work" is short sighted. Mocking
objects is a means to an end and not the end itself, and creating a real
instance of the type rather than using a mocked version just because
it's part of the Java API is not necessarily the right/better way, nor
is mocking them automatically the wrong/worse way. As long as the
desired outcome's achieved, then it's that's what matters. And if it's
done in the fewest lines of code or in the simplest, least complicated
way then you have a better assurance that your test isn't being
influenced by possibly buggy testing code, something which is more
likely to happen if you're writing extra classes *just* for the tests to
consume.
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
Andrew McDonagh

|
Posted: 2006-1-5 7:42:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Darryl L. Pierce wrote:
>
> I have _JUnit In Action_. I'm not ignorant of JUnit, thank you.
>
wasn't trying to imply you were..., I'm curious as to why you wanted to
do it that way... thats all. Call it a learning exercise for me if
you'd like.
|
| |
|
| |
 |
Darryl L. Pierce

|
Posted: 2006-1-5 8:19:00 |
Top |
java-programmer >> EasyMock, JUnit, Java5 and generics...
Andrew McDonagh wrote:
>> I have _JUnit In Action_. I'm not ignorant of JUnit, thank you.
>
> wasn't trying to imply you were..., I'm curious as to why you wanted to
> do it that way... thats all. Call it a learning exercise for me if
> you'd like.
K, no prob. :)
--
Darryl L. Pierce <email***@***.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Call for Papers: World Congress on Engineering and Computer Science WCECS 2008CFP: World Congress on Engineering and Computer Science WCECS 2008
From: International Association of Engineers (IAENG)
WCECS 2008: San Francisco, USA, 22-24 October, 2008
http://www.iaeng.org/WCECS2008
The WCECS 2008 is organized by the International Association of
Engineers (IAENG), a non-profit international association for the
engineers and the computer scientists. The congress has the focus on
the frontier topics in the theoretical and applied engineering and
computer science subjects. The WCECS conferences serve as good
platforms for our members and the entire engineering community to meet
with each other and to exchange ideas. Our last IAENG conference has
attracted more than one thousand participants from over 30 countries,
and our conference committees have been formed with over two hundred
and sixty committee members who are mainly research center heads,
faculty deans, department heads, professors, and research scientists
from over 20 countries.
All submitted papers will be under peer review and accepted papers
will be published in the conference proceeding (ISBN:
978-988-98671-0-2). The abstracts will be indexed and available at
major academic databases. The accepted papers will also be considered
for publication in the special issues of the journal Engineering
Letters, in IAENG journals and in edited books. Revised and expanded
version of the selected papers may also be included as book chapters
in the standalone edited books under the framework of cooperation
between IAENG and Springer, and between IAENG and America Institute of
Physics. For reference, the following post conference edited books of
our recent IAENG 2007 conferences have been scheduled to be published
by Springer in early 2008: Trends in Intelligent Systems and Computer
Engineering, Advances in Communication Systems and Electrical
Engineering, Advances in Industrial Engineering and Operations
Research, and Advances in Computational Algorithms and Data Analysis.
WCECS Congress Co-chairs
Prof. Craig Douglas (WCECS Keynote Speaker & Co-chair)
Professor of Computer Science & Professor of Mechanical Engineering,
University of Kentucky
Senior Research Scientist (corresponding to nonteaching full
professor)
Computer Science Department, Yale University, USA
Prof. Warren S. Grundfest, Fellow, AIMBE, SPIE (WCECS co-chair)
Co-Chair, Biomedical Engineering IDP
Professor of Electrical Engineering and Professor of Surgery
The Henry Samueli School of Engineering & Applied Science
University of California, Los Angeles, USA
Former Chair, SPIE Health Care Engineering & Technology Policy
Former Vice Chair, Health Care Engineering Policy Committee, IEEE
Prof. Lee Schruben, Ph.D. Yale (WCECS & ICMSC co-chair)
Professor and Former Department Chairman
Department of Industrial Engineering and Operations Research
University of California, Berkeley, USA
Prof. Jon Burgstone (ICIMT honorary co-chair)
Faculty Chair
Center for Entrepreneurship & Technology
College of Engineering
University of California, Berkeley, USA
Board Member of the Rock Center for Entrepreneurship at Harvard
Business School, Harvard University
Prof. Su-Shing Chen, Fellow, SPIE (ICCB honorary co-chair)
Emeritus Professor, Department of Computer Information Science &
Engineering, University of Florida, USA;
Principal Investigator of Systems Biology Laboratory,
CAS-MPG Partner Institute for Computational Biology (PICB);
Shanghai Institutes for Biological Sciences; Chinese Academy of
Sciences
Prof. Benjamin Friedlander, FIEEE (ICCST honorary co-chair)
Professor of Electrical Engineering
Department of Electrical Engineering, Jack Baskin School of
Engineering,
University of California, Santa Cruz, USA
The IEEE Third Millennium Medal (2000)
Former Vice Chairman of the Bay Area Chapter of the Acoustics, Speech
and Signal Processing Society
Former Associate Editor of the IEEE Transaction on Automatic Control
Prof. Burghard B. Rieger (ICMLDA honorary co-chair)
Professor of Computational Linguistics
Former Dean (1999-2001) of Faculty of Languages and Literature
Former Head of Department of Linguistic Computing, University of
Trier, Germany
President (1989-93) of the German Society for Linguistic Computing
(GLDV)
Vice-President (1990-94) of the International Society for Terminoly
and Knowledge Engineering (GTW)
Prof. Lei Xu (ICSCA honorary co-chair)
IEEE Fellow and IAPR Fellow,
Member of European Academy of Sciences,
Chair Professor, Department of Computer Science and Engineering,
The Chinese University of Hong Kong, Hong Kong
The WCECS 2008 is composed of the following 15 conferences (all will
be held at the same location and date):
ICCB'08
International Conference on Computational Biology 2008
ICCE'08
International Conference on Chemical Engineering 2008
ICCS'08
International Conference on Circuits and Systems 2008
ICCSA'08
International Conference on Computer Science and Applications 2008
ICCST'08
International Conference on Communications Systems and Technologies
2008
ICEEA'08
International Conference on Electrical Engineering and Applications
2008
ICEIT'08
International Conference on Education and Information Technology 2008
ICIAR'08
International Conference on Intelligent Automation and Robotics 2008
ICIMT'08
International Conference on Internet and Multimedia Technologies 2008
ICMHA'08
International Conference in Modeling Health Advances 2008
ICMLDA'08
International Conference on Machine Learning and Data Analysis 2008
ICMSC'08
International Conference on Modeling, Simulation and Control 2008
ICSCA'08
International Conference on Soft Computing and Applications 2008
ICSEEM'08
International Conference on Systems Engineering and Engineering
Management 2008
ICSPIE'08
International Conference on Signal Processing and Imaging Engineering
2008
=============
Important Dates:
Draft Paper Submission Deadline: 2 July, 2008
Camera-Ready Papers Due & Registration Deadline: 30 July, 2008
WCECS 2008: 22-24 October, 2008
=========
Submission:
WCECS 2008 is now accepting manuscript submissions. Prospective
authors are invited to submit their draft paper in full paper (any
appropriate style) to WCECS{at}iaeng.org by 2 July, 2008. The
submitted file can be in MS Word format, PS format, or PDF formats.
The first page of the draft paper should include:
(1) Title of the paper;
(2) Name, affiliation and e-mail address for each author;
(3) A maximum of 5 keywords of the paper.
Also, the name of the conference that the paper is being submitted to
should be stated in the email.
It is our target that the reviewing process and the result
notification for each submitted manuscript can be completed within one
month from its submission. The reviewing process is to ensure the
quality of the accepted papers in the WCE congress. The conferences
have enjoyed high reputation among many research colleagues (for
example, see the http://cs.conference-ranking.net/ or
http://www.conference-ranking.com/).
More details about the WCECS 2008 can be found at:
http://www.iaeng.org/WCECS2008/index.html
More details about the International Association of Engineers, and the
IAENG International Journal of Computer Science, and the IAENG
International Journal of Applied Mathematics can be found at:
http://www.iaeng.org/about_IAENG.html
http://www.iaeng.org/IJCS/index.html
http://www.iaeng.org/IJAM/index.html
The official journal web site of Engineering Letters at:
http://www.engineeringletters.com
Other Engineering Letters web sites at:
http://www.engineeringletters.net
http://www.engineeringletter.com
********
It will be highly appreciated if you can circulate these calls for
papers to your colleagues.
- 2
- How to re-asign a value to a variable in XSLTSorry Dudes,
I couldn't find an appropriate group to post about XML/XSLT issues.
I can only post to these close groups.
In most of programming languages are VERY easy to do:
int i = 0;
i = 3;
i = i + 1;
i += 2;
i++;
But how can I do these in XSLT?
I got error when I do
<xsl:variable name="i" select='0' />
<xsl:variable name="i" select="$i + '1' />
Can dudes (American West Coast's Term) out there can help?
Thank Q!
- 3
- draw on JPanel from other classHI,
I need to draw string to subclass of JPanel from subclass of JFrame.
But I don't know how. Here is a sample. Another problem is the
Thread tt does not run.
Thank you for help.
import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
public class TryFont1 extends JFrame {
RectPanel r = new RectPanel();
public TryFont1() {
super("Rectangles");
setSize(410, 430);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = getContentPane();
content.add(r);
setContentPane(content);
setVisible(true);
}
public void run() {
for ( int i = 0; i < 10; i++ ) {
System.out.println("New thread");
}
}
public static void main(String[] arguments) {
TryFont1 rect = new TryFont1();
Thread tt = new Thread();
tt.start();
tt.run();
rect.r.comp2D.setColor(Color.blue);
for ( int i = 0; i < 10; i++ ) {
rect.r.comp2D.drawString("Main thread",250,150 + i*10);
//rect.r.repaint();
System.out.println("1 thread");
}
}
}
class RectPanel extends JPanel {
public Graphics2D comp2D;
public void paintComponent(Graphics comp) {
super.paintComponent(comp);
comp2D = (Graphics2D) comp;
setBackground(Color.white);
comp2D.rotate(-.4,200,200);
Font f = new Font("Garbage",Font.BOLD,40);
Font f1 = new Font("Times New Roman",Font.BOLD,40);
comp2D.setColor(Color.green);
comp2D.setFont(f);
comp2D.drawString("Happy", 50,150);
comp2D.setColor(Color.red);
comp2D.setFont(f1);
comp2D.drawString("Birthday!", 50,200);
}}
- 4
- Corrupt String or bytearray transport over RMIHello,
I have a strange problem when transporting a String and it's byteArray
between 2 JVM's on the same machine. The JVMs are seperately started
instances of IBM's 1.3.1 JVM which also comes with Websphere 4.5.
On JVM1, I have something along the lines of:
String jvm1String = "Some nice String";
byte[] jvm1bytes = jvm1String.getBytes("ISO-8859-1");
Now, I transport the string and the array through RMI toto JVM2. In
JVM2 I do the following:
jvm2bytes = jvm1String.getBytes("ISO-8859-1");
for (int i = 0; i < jvm2bytes.length; i++) {
if (jvm2bytes[i] != jvm1bytes[i]) return false;
}
This allways returns false. Manually checking the arrays shows that the
two byte arrays only differ somewhere in the middle, and only for about
2 bytes, regardless the content of the String. I have no idea what
would cause java to behave differently between the two jvm's.
My question is: Is this likely to be a bug in:
a) the transportation of Strings over RMI
b) the transportation of byte arrays over RMI
c) the way String.getBytes("ISO-8859-1") is implemented
d) the way I am using rmi or the getBytes() method
Due to requirements, I can not change the JVM, so I need to find a way
around this. I am using the bytearrays to verify data integrity.
Thanks in advance,
Rolf
- 5
- About Sun Developer Network SubscriptionHello,
I have downloaded the Sun Java Studio Creator from sun.com.
Now I am having a trial subscription of Sun Developer Network for 30
days.
But what are the advantages of it?
It seems that I can post queries about Sun Java Creator or Java Server
Faces technology only.
Can I have access to other technology documentation or it is meant for
some restricted technologies only?
PLease guide.
-Sameer
- 6
- Get the real type of columns from MS Access databases(OLEObject, text, memo, numeric)Hello,
I made one application that opens MS Access databases.And I have one
problem.How can I find the real data type of columns(text, memo,
OLEObject, numeric) like it is into Access.I tried with
resultSetMetaData.getColumnType(columnIndex) but I receive
java.sql.Types.I have two columns that contains OLEObjects(images).But
I receive two different types for columns : VARCHAR once, and for
second column SMALLINT.I only want to see the types like in
Access(OLEObjects, Text, Numeric, Memo...).Thanks in advance!
Best regards,
Calin Pop
- 7
- JavaMail: MimeMessage customer headersHow to add custom headers to a MimeMessage object?
The problem I'am having is reading from POP3 account and getting the
MimeMessage object. Before I want to save the message content to disk,
I want to add a few headers.
The error I'am getting is
POP3 messages are read-only
I've open the inbox folder as READ_WRITE but still no luck.
Anyone know how to add customer headers to the MimeMessage object when
reading from a POP3 account?
Thanks
- 8
- Maven / Torque Generator ClasspathHello,
I try to make an XML dump of a oracle database schema with the Torque
Generator jakarta api.
But, I cannot find how use Torque Generator without Maven and I connot find
how to put the "classes12.jar" oracle JDBC Driver in the Maven classpath.
So, I get the following exception :
C:\JavaLib\jakarta\torque-gen\torque-gen-3.1.1\projectTest>maven
torque:datadump
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.1
build:start:
torque:init:
torque:datadump:
[torque-data-dump] Using classpath
[torque-data-dump] Generating to file
C:\JavaLib\jakarta\torque-gen\torque-gen-3.1.1\projectTest\target\report.bug.datadump.generation
[torque-data-dump] Torque - TorqueDataDump starting
[torque-data-dump] Your DB settings are:
[torque-data-dump] driver: oracle.jdbc.driver.OracleDriver
[torque-data-dump] URL: jdbc:oracle:thin:@192.168.0.101:1521:ORCL
[torque-data-dump] user: BUG
cannot load driver:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1075)
at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1036)
at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:925)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
org.apache.torque.task.TorqueDataDumpTask.initControlContext(TorqueDataDumpTask.java:197)
at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at
org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
at
org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:671)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
at org.apache.maven.cli.App.doMain(App.java:488)
at org.apache.maven.cli.App.main(App.java:1239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
BUILD SUCCESSFUL
Total time: 6 seconds
Finished at: Mon Nov 22 12:20:01 CET 2004
Could someone help ?
Thank you.
- 9
- Anyone have any experience with WebLogic 8?Hello, I have just installed WebLogic 814 for Solaris 8. The machine
is in a remote location, so I did all the installation remotely. My
question is, how do I create a data source? I am used to WL 5 with the
weblogic.properties file, but WL 8 seems different.
Any help is greatly apprciated, - Dave
- 10
- Masters project suggession> all suggestions appreciated. if you are a company, it is possible for
> me to work for you (for no salary if necessary) in relation to the
> project that u suggest.
Doing a Computer Science MSc-project for a company for free? How bad is
the economical situation around there?
- 11
- Jar file exploringHi,
I want to read files and direcotories under a specific directory in a jar
file. In this way I can explore
the jar file interactively. The jar file contains thousands of files and has
no index.
So it is impractical to enumerate entries then filter them.
How can I do this? Thanks.
- 12
- Figure out DST start and end date/timeIs their a mechanism to determine what the start date / time and
end date / time of Daylight Savings Time is for a given TimeZone
if the time zone supports Daylights Savings ?
Thanks
Jeff
- 13
- How to get address of a Java object?Hi
Is there a way to get address of a Java object?
I believe hashCode function in Object class do gives the object
reference, but this is specific to JVM implementation.
thanks,
Naresh Agarwal
- 14
- Shootout: the benchmarks game ... continues.On Wed, 30 Apr 2008 08:00:38 -0700 (PDT), Isaac Gouy
<email***@***.com> wrote:
>You've spent 10 days making untrue claims:
No, you are wrong. There is no -Xms when you click on show tab from
the main page. You know that very well. Why waste time on quibbling?
>Why don't you go through all...
Let's continue. The only thing changed is my OS (Vista) and computer
which is now 3 core phenom. Also, instead of > /dev/null on cygwin, I
will use > \Null (since that seems to be 200 times faster on windows).
benchmark: fasta
java version:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=java&id=2
C++ version
http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=gpp&id=4
As a great example of c++ portability, this doesn't even compile with
my version of g++ (mingw), so I will use cygwin to compile. gcc
version 3.4.4 (cygming special)
g++ -pipe -O3 -fomit-frame-pointer -mfpmath=sse -msse2 fasta.cpp -o
fasta.exe
jc -inline+ fasta (jet)
N 250,000 2,500,000 25,000,000
g++ 0.166s 0.954s 8.884s
java 0.297s 1.347s 11.699s (-Xms64m -server)
jet 0.420s 1.701s 14.602s
(note this guy uses -Xbatch flag everywhere. I have to see how that
helps anywhere. It's just slightly slower with -Xbatch flag if
anything).
HotSpot VM is faster than native Jet compiler once again? That's three
in a row. g++ is only slightly faster, not 50 or 100 times as some
think.
- 15
- ANN: VRMLmagic - New Interactive 3D VRML Web/World Authoring ToolHi All,
We at Scintillating Graphics would like to announce the release of
VRMLmagic, our Interactive 3D Web Development Tool.
VRMLmagic is an easy to use tool for creating interactive 3D (Virtual
Reality) web pages in the VRML/X3D format(s). With its interactive 3D
development environment and a range of powerful tools, you'll find
yourself building interactive 3D worlds in no time. Take a look at our
web site for more info:
http://www.scintillatinggraphics.com.au/VRMLmagic/
Initially developed as part of a research project with the aim of
making a rapid development environment for the construction of 3D user
interfaces. It was clear that VRMLmagic's features (which enabled us
to quickly build interactive 3D interfaces) had enormous potential for
the mainstream web development industry, and in particular its ability
to bring 3D content to the web. We now hope this tool will enable you
to begin developing the potential of interactive 3D content for the
web.
The initial release is for the Windows (98 and above) platforms.
However we will soon be releasing versions for Mac OS X and other Unix
variants.
If you have any questions or would like additional information, email
us at email***@***.com
|
|
|