hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: How to create a new directory for tests
Date Thu, 08 Apr 2010 15:28:08 GMT
André Oriani wrote:
> Hi all,
> 
> I am working in a patch for HDFS-1031, which will add a new page fo the
> WebUI. I talked to Todd Lipcon at freenode an he said there is no UT for
> the web ui. Actually there is one --
> src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java -- but it
> is kind of a mixed test rather than just a test for the web ui.
> 

I don't see why you should need a separate tree for Junit Tests that 
test the web ui; they should just be stuff that runs against a local 
filesystem. Most of the test cases test the live (in VM) service and the 
http ports, looking for JSP stuff is just one more.

Why not just leave it under src/test/hdfs?

Where is the test? Can you stick it up as a patch?

> So I decided to create a new directory, src/test/webapps, and place my
> tests under that folder. So far I got my test class built but not run. I
> thought that src/test/all-test being just "**/Test*.java" would run my
> test from granted.
> 
> Here's what I did:
> 
> created src/test/webapps
> 
> diff --git a/.eclipse.templates/.classpath b/.eclipse.templates/.classpath
> index f8ba74b..50f7d44 100644
> --- a/.eclipse.templates/.classpath
> +++ b/.eclipse.templates/.classpath
> @@ -3,6 +3,7 @@
>         <classpathentry kind="src" path="src/java"/>
>         <classpathentry kind="src" path="src/test/unit"/>
>         <classpathentry kind="src" path="src/test/hdfs"/>
> +       <classpathentry kind="src" path="src/test/webapps"/>
>         <classpathentry kind="src" path="src/ant"/>
>         <classpathentry kind="src" path="src/contrib/hdfsproxy/src/java"/>
>         <classpathentry kind="src" path="src/contrib/hdfsproxy/src/test"/>
> diff --git a/build.xml b/build.xml
> index e23296b..48d3573 100644
> --- a/build.xml
> +++ b/build.xml
> @@ -365,7 +365,7 @@
>      <mkdir dir="${test.hdfs.build.classes}"/>
>      <javac
>        encoding="${build.encoding}"
> -      srcdir="${test.src.dir}/hdfs;${test.src.dir}/unit"
> +     
> srcdir="${test.src.dir}/hdfs;${test.src.dir}/unit;${test.src.dir}/webapps"
>        includes="org/apache/hadoop/**/*.java"
>        destdir="${test.hdfs.build.classes}"
>        debug="${javac.debug}"
> 
> 
> and finally added
> src/test/webapps/org/apache/hadoop/hdfs/server/namenode/TestCorruptFilesJsp.java
> 
> Any help would be very much appreciated.
> 
> 
> Tks,
> Andre Oriani
> 
> 


Mime
View raw message