Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2006

Tip: Looking for answers? Try searching our database.

Advice on how to remove dependency to framework

Thread view: 
mike - 14 Sep 2006 20:52 GMT
Hi,

In our app we use junit as part of it. However in order to make
necessary performance improvements
we need to remove this dependency. I have started to write classes with
the same name as used in junit . I need advice on how to do this. I am
interested in knowing if someone out there has done the same thing and
can give me a bit of advice. All advice is welcome. I use Eclipse 3.2
for this operation.

cheers,

//mikael
AndrewMcDonagh - 14 Sep 2006 21:01 GMT
> Hi,
>
[quoted text clipped - 9 lines]
>
> //mikael

Junit is a testing framework...  unless you are making a testing
application - why on earth would your app be using it anyway?

Or are you saying, that your developers are using JUnit to unit test
their code and its slowing them down.
AndrewMcDonagh - 14 Sep 2006 21:03 GMT
> Hi,
>
[quoted text clipped - 9 lines]
>
> //mikael

Besides my other comment - how do you know its Junit causing the
performance issue - have you used a profiling tool to show you where the
bottle neck is, or are you guessing?

If you are guessing, then I'd strongly suggest you profile your app
before spending time ripping JUnit out
No Name - 15 Sep 2006 00:04 GMT
> In our app we use junit as part of it. However in order to make
> necessary performance improvements
> we need to remove this dependency.

You have apparently absolutely no idea what you are doing.

JUnit is a testing framework. How on earth would anyone depend an
application on a testing framework? How pervert is that? And how on
earth would a programmer worth  two cent not know what is wrong with
that? Where did you learn programming? At some "prestigious
unaccredited higher education institute"?

>I have started to write classes with
> the same name as used in junit .

Stop wasting your time and hand the application over to some
professional.
Petterson Mikael - 15 Sep 2006 12:22 GMT
> Hi,
>
[quoted text clipped - 9 lines]
>
> //mikael

Hi guys,

Thanks for your engouraging advice. However let me first point point out
a couple of things:

- The application is a testing application for xsl.

- People in the team has done profiling and came up with bottlenecks in
junit.

- I asked for advice on how to remove the dependency to the junit
framework and not for personal critics.

cheers guys!

Ps. You don't seem to have the advice that I needed.
M.J. Dance - 15 Sep 2006 13:14 GMT
>> Hi,
>>
[quoted text clipped - 26 lines]
>
> Ps. You don't seem to have the advice that I needed.

It seems you don't understand the purpose of JUnit. JUnit is s testing platform.
Meaning: it tests _your_application_. In other words, JUnit helps you determine
whether your application can "test xsl" (whatever that may be) correctly or not.
 But in order for your application to "test xsl" JUnit should not be needed.

Bottom line: the answer to your problem (how to remove the dependency to the
junit) is simple: stop using it.
Petterson Mikael - 15 Sep 2006 13:51 GMT
>>> Hi,
>>>
[quoted text clipped - 29 lines]
> It seems you don't understand the purpose of JUnit. JUnit is s testing
> platform. Meaning: it tests _your_application_.
Junit is still a framework and not a platform.

 In other words, JUnit
> helps you determine whether your application can "test xsl" (whatever
> that may be) correctly or not.  But in order for your application to
> "test xsl" JUnit should not be needed.
I agree it should not be needed.

> Bottom line: the answer to your problem (how to remove the dependency to
> the junit) is simple: stop using it.

Well our framework to test xsl is depending on junit framework. So It
cannot just stop using it before I have an alternative.

For instance in junit we there is a class called
junit.framework.TestCase I probably need to replace it with
<mypackage>.TestCase or?

cheers,

//mikael
Tor Iver Wilhelmsen - 15 Sep 2006 17:30 GMT
> Well our framework to test xsl is depending on junit framework.

Why did you choose to have such a dependency? Because it had "testing"
in its name it was assumed it was suitable for the task?

As others have said: JUnit is a UNIT testing framework. This means it
is used to test that a method A in class B behaves correctly and
consistently as sotfware evolves.

> So It cannot just stop using it before I have an alternative.

No, you needed to write the XSL testing software without trying to
wrestle an ill-suited framework into it.

> For instance in junit we there is a class called
> junit.framework.TestCase I probably need to replace it with
> <mypackage>.TestCase or?

You are better off writing a custom framework from scratch since
you're not targeting Java method invocations. You couls always try
some of the other frameworks like JTiger or TestNG reviewed here:

http://www.theserverside.com/tt/articles/article.tss?l=TestFrameworkComparison

Or use UTF-X which is exactly what you apparently have written: a
JUnit extension to test XSL stylesheets.

https://utf-x.dev.java.net/
Tor Iver Wilhelmsen - 15 Sep 2006 18:17 GMT
> Or use UTF-X which is exactly what you apparently have written: a
> JUnit extension to test XSL stylesheets.
>
> https://utf-x.dev.java.net/

Another option:

http://juxy.tigris.org/
Thomas Hawtin - 15 Sep 2006 15:13 GMT
> Thanks for your engouraging advice. However let me first point point out
> a couple of things:
>
> - The application is a testing application for xsl.

So at a guess, essentially an "XSLTUnit" using JUnit as a base?

> - People in the team has done profiling and came up with bottlenecks in
> junit.

That surprises me. I guess you'd need to compile a stylesheet and run a
hideous number of tests against it for that to happen. At the risk of
sounding patronising, I'd suggest a more careful look at your profiling.
Could you tell us what parts of JUnit are causing the problem?

> - I asked for advice on how to remove the dependency to the junit
> framework and not for personal critics.

Doesn't sound too difficult. Write some code that does what JUnit does
(if Common Public License is acceptable to your lawyers, just alter the
JUnit code, but take legal advice first - IANAL). Then search and
replace JUnit references with references to your replacement. Of course
if you write a replacement for JUnit doing what JUnit does, it'll
probably be at least as slow.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.