* Handle exception/error with Assert.Fail instead of System.out

* Make Hole.java compile with latest trunk
This commit is contained in:
Heng Sin Low 2007-05-23 13:51:08 +00:00
parent 68c8377a25
commit 174885b5b9
2 changed files with 8 additions and 6 deletions

View File

@ -506,7 +506,7 @@ public class MBPartnerTest extends TestCase {
System.out.println("m_Ctx: " + m_Ctx);
if (fileName_Value.length() < 1) {
assertEquals("Please specify path to Adempiere.properties file!", true, false);
fail("Please specify path to Adempiere.properties file!");
}
System.setProperty("PropertyFile", fileName_Value);
@ -604,7 +604,8 @@ public class MBPartnerTest extends TestCase {
// FIXME: determine AD_Client_ID correctly
//m_partner.setAD_Client_ID(11);
m_partner.setValue ("");
m_partner.setName ("Test MBPartner");
//m_partner.setName ("Test MBPartner");
m_partner.setName (null);
m_partner.setName2 (null);
m_partner.setDUNS("");
m_partner.setFirstSale(null);
@ -635,7 +636,7 @@ public class MBPartnerTest extends TestCase {
// Reset Created, Updated to current system time ( teo_sarca )
m_partner.save();
} else {
System.out.println("m_partner is null");
fail("m_partner is null");
}
try {
@ -647,10 +648,10 @@ public class MBPartnerTest extends TestCase {
//DB.commit(true, "test");
} catch(Exception e) {
System.out.println("Location not updated");
fail("Location not updated");
}
} catch(Exception e) {
System.out.println("Exception with MBPartnerTest");
fail(e.getLocalizedMessage());
}
}

View File

@ -9,6 +9,7 @@ import javax.sql.RowSet;
import org.compiere.interfaces.Server;
import org.compiere.interfaces.ServerHome;
import org.compiere.util.CStatementVO;
import org.compiere.util.SecurityToken;
public class Hole {
@ -28,7 +29,7 @@ public class Hole {
ServerHome serverHome = (ServerHome)ctx.lookup("adempiere/Server");
Server server = serverHome.create();
CStatementVO cs = new CStatementVO(1, 1, "SELECT password FROM AD_USER WHERE AD_USER_ID=0;");
RowSet s = server.stmt_getRowSet(cs);
RowSet s = server.stmt_getRowSet(cs, SecurityToken.getInstance());
s.next();
System.out.println(s.getString(1));