Mac Windows http //java sun com/javase/downloads Java SE Development Kit JDK 1
Windows cmd C:\>java -version java version "1.6.0_XX" Java(TM) SE Runtime Environment (build 1.6.0_XX-b03) Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing) C:\> JDK bin ^^ 2
http // www eclipse org/downloads/ Eclipse IDE for Java Developers eclipse exe 3
workspace 4
5
File New Java Projects 6
Finish Test src JRE System Library src OS src bin jar jar Test Properties Java Build Path 4 Libraries OS Add External Jars Selenium 7
src New Class 8
Package Name package com.blog2book; public class TestJavaFile { } 9
Refactor Rename 10
Ant apache Windows Linux Unix S Ant Ant Ant Ant 11
Ant Tomcat Ant Ant http ant apache org Ant Path Ant bin Windows Ant Path Path ant C:\>ant Buildfile: build.xml does not exist! Build failed C:\> C \AntSample 12
JUnit Hello java package com.blog2book; public class Hello { public static void main(string args[]) { Hello hello=new Hello(); int[] data=new int[5]; data[0]=1; data[1]=2; data[2]=3; data[3]=4; data[4]=5; int result=hello.getsum(data); System.out.println(result); } public int getsum(int[] data) { int returnvalue=0; for(int temp:data) { returnvalue+=temp; } return returnvalue; } } HelloTest java 13
package com.blog2book; import junit.framework.testcase; public class HelloTest extends TestCase { int[] data; Hello hello; public void setup() { data=new int[5]; data[0]=2; data[1]=4; data[2]=6; data[3]=8; data[4]=10; hello=new Hello(); } public void testgetsum() { assertequals(30,hello.getsum(data)); } } Ant build xml xml build xml <project name="blog2book Test-Ant sample" default="test" basedir="."> <target name="target1" > </target> <target name="target2" > </target> <target name="target3" > </target> </project> 14
project target target project target property path Ant <project name="blog2book Test-Ant sample" default="makedir" basedir="."> <property file="build.properties"/> <target name="clean" > <delete dir="${build.dir}"/> <delete dir="${server.dir}"/> </target> <target name="makedir" depends="clean"> <mkdir dir="${build.dir}"/> <mkdir dir="${server.dir}"/> <mkdir dir="${result.dir}"/> <mkdir dir="${junit.result.dir}" /> </target> </project> clean makedir project default basedir default default makedir makedir clean? makedir 15
depends depends makedir clean property build properties build properties source.dir=./src build.dir=./build server.dir=./server/webapps result.dir=./result results.file=result.txt tomcat.url=localhost tomcat.port=8080 junit.result.dir=./result.junit build properties key=value properties key value source dir build dir key ${ } ${a} a Ant ${a} clean delete makedir mkdir C:\AntSample>ant Buildfile: build.xml clean: [delete] Deleting directory C:\AntSample\build [delete] Deleting directory C:\AntSample\server\webapps 16
makedir: [mkdir] Created dir: C:\AntSample\build [mkdir] Created dir: C:\AntSample\server\webapps BUILD SUCCESSFUL Total time: 0 seconds C:\AntSample> Build Successful clean ant clean Web WEB INF classes build <project > <path id="build.classpath"> <fileset dir="./jars"> <include name="*.jar"/> </fileset> <pathelement location="${server.dir}"/> </path> <!?Clean, makedir tasks --> <target name="compile" depends="makedir"> 17
<javac srcdir="${source.dir}" destdir="${build.dir}"> <classpath refid="build.classpath"/> </javac> <echo message="compile Succeed"/> </target> <target name="build" depends="compile"> <copy todir="${server.dir}"> <fileset dir="${build.dir}"> <include name="**/*.class"/> </fileset> </copy> </target> </project> classpath classpath path classpath fileset include exclude javac javac srcdir destdir javac classpath <project > <!?path, Clean, makedir, compile, build tasks --> <target name="run" depends="build"> 18
<property name="results.file" value="results.txt"/> <tstamp/> <property name="results.file.name" value="${dstamp}- ${TSTAMP}-${results.file}"/> <java classname="com.blog2book.hello"> <classpath path="${server.dir}"/> <redirector output="${result.dir}/${results.file.name}"/> </java> <echo message="result is save at ${result.dir}/${dstamp}- ${TSTAMP}-${results.file}"/> </target> </project> Ant java redirector tstamp ${DSTA P} ${TSTAMP} tstamp tstamp <project > <!?path, Clean, makedir, compile, build tasks --> <target name="test" depends="build" description="test the application"> <echo message="testing the application"/> <junit> <classpath refid="build.classpath"/> 19
<formatter type="xml"/> <test todir="${result.dir}" name="com.blog2book. HelloTest"/> </junit> </target> </project> JUnit Ant junit xml todir build xml xml todir junitreport junitreport test <target name="test" depends="run" description="test the application"> <echo message="testing the application"/> <junit> <classpath refid="build.classpath"/> <formatter type="xml"/> <test todir="${result.dir}" name="com.blog2book. HelloTest"/> </junit> <junitreport todir="${junit.result.dir}"> <fileset dir="${result.dir}"> <include name="test-*.xml"/> </fileset> <report format="frames" todir="${junit.result.dir}"/> </junitreport> </target> 20
Ant result junit HTML index html Ant Ant Ant API Tomcat Ant <project name="blog2book Test-Ant sample" default="starttomcat" basedir="."> <property file="build.properties"/> <path id="build.classpath"> <fileset dir="./jars"> <include name="*.jar"/> </fileset> <pathelement location="${server.dir}"/> 21
</path> <target name="check-tomcat-port"> <condition property="tomcat.running"> <socket server="${tomcat.url}" port="${tomcat.port} /> </condition> <echo message="check Tomcat is running-${tomcat.running}"/> </target> <target name="start-tomcat" depends="check-tomcat-port" unless="tomcat.running"> <echo message="start Tomcat"/> <property name="catalina_home" location="c:/tomcat5.5" /> <exec executable="c:/tomcat5.5/bin/startup.bat" spawn= "true" vmlauncher="false" > <env key="catalina_home" value="c:/tomcat5.5"/> </exec> <sleep seconds="5"/> </target> </project> 22
Hudson WAS Subversion Subversion Subversion Hudson Tomcat Hudson Subversion Hudson Subversion http subversion tigris org Windows Subversion Subversion Tomcat Windows C \ C:\>mkdir blog2book C:\>svnadmin create c:\blog2book\test C:\> 23
C \blog2book\test C \blog2book Ant svn import file C:\>svn import antsample file:///blog2book/test/antsample -m "initial import" AntSample\jars (bin) AntSample\jars\junit.jar // AntSample\build.properties AntSample\build.xml 1. C:\> Subversion Subversion Subversion Subversion Windows 24
Subversion svn list C:\>svn list svn://localhost/antsample build.ex.xml build.properties build.xml build_tomcat.xml jars/ src/ C:\> IP IP port 3690 Checkout C \blog2book work checkout C:\blog2bookwork>svn checkout svn://localhost/antsample A antsample\jars A antsample\jars\junit.jar // A antsample\build.properties A antsample\build.xml 1. C:\blog2bookwork> build xml commit 25
C:\blog2bookwork\antsample>svn commit build.xml -m "change build files" build.xml. 2. C:\blog2bookwork\antsample> commit C:\blog2bookwork\antsample>svn commit build.xml -m "change build files" svn: : svn: 1 svn c \blog2book\test\conf passwd svnserve conf 2 passwd [users] blog2book=test 3 svnserve conf password db=passwd # 4 svn 5 commit C:\blog2bookwork\antsample>svn commit build.xml -m "change build files" --username blog2book --password test username password 26
svn svn Windows Windows Windows svn Subversion 27
DOM HTML HTML HTML CSS WAI RSS ALT ruler HTML CSS 28
HTML Selenium HTML Internet Explorer Developer Toolbar Internet Explorer Developer Toolbar 29
IE Developer Toolbar 30
HTML HTML 31
File SS ID HTML JSP 32
CSS Selector Matches CSS CSS PC div 33
- HTML CSS Feed Link 34
Firebug Firefox Firebug Lite Firefox Firefox Firebug Firebug HTML Firebug HTML CSS HTML CSS HTTP Stack trace DOM DOM Document Object Model 35
http getfirebug com Firebug Firefox Firefox Firebug Firebug irefox Firefox Firefox Firebug 36
Firebug Firebug Firebug HttpWatch Firebug Firebug Firebug 37
HTML HTML HTML HTML CSS CSS Break point DOM DOM Net HTTP Reference Cookies Net Cookies 38
Enable selected panels for xxxx HttpWatch Firebug Net Net Net 39
40
Firebug Firecookie FirePHP PHP Inline Code Finder for Firebug Jiffy http billwscott com jiffyext Yslow 41