2009年10月16日 星期五

T-Mobile: WAP Setting

Services => WAP => Settings => Edit Profile => SIM1 => Pick any profile => Edit Profile
1:Rename Profile => T-MOBILE WAP
2:Home Page =>http://wap.myvoicestream.com
3:Data account :T-Mobile GPRS
4:Connection type:WAP
5:User Name:(none)
6:Password:(none)

Services => Data Account => GPRS => (chose an unused company name) =>
1:Change Account Name => T-Mobile GPRS
2:APN => wap.voicestream.com
3:User Name: (none)
4:Password:(none)
5:Auth.type: Normal


Primary DNS: 216.155.165.50

Secondary DNS: 216.155.165.51

2009年10月15日 星期四

Junit 4: Add Junit test on Ant

<target name="mytest" description="mytest">

<junit printsummary="yes" haltonerror="yes" haltonfailure="yes" fork="yes"> <formatter type="plain" usefile="false" />

<test name="gov.hud.mfh.business.service.contracts.ContractFinderTest"/> <classpath>
<pathelement path="test"/> <!-- source code place -->
<fileset dir="test"> <!-- source lib place -->
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset>
<fileset dir="./lib/junit"> <!-- junit lib place -->
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset> </classpath>
</junit>
</target>

You must Exclude ant*.jar otherwise you will get Error:
No tests found in gov.hud.mfh.business.service.contracts
And USE ANT 1.7.0 TO RUN JUNIT 4.
ANT 1.7.1 might has problem.

Batch Junit Example

<target name="batchtest" description="batchtest">
<junit printsummary="yes" haltonerror="no" haltonfailure="yes" fork="yes">
<formatter type="xml" usefile="true" />
<classpath>
<pathelement path="test"/>
<fileset dir="test">
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset>
<fileset dir="./lib/junit">
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset>
</classpath>
<batchtest fork="yes" todir="${reports.junit.dir}" haltonfailure="yes" >
<fileset dir="junit">
<include name="**/*Test*.java"/>
</fileset>
<formatter type="xml"/>
</batchtest>
</junit>
</target>

Junit 4: Error on JUnit4TestAdapter signer information

class "junit.framework.JUnit4TestAdapter"'s signer information does not match signer information of other classes in the same package

Solution: more than one junit.jar appear in the classpath. Please delete the redundant one.