From 23ac5d67efda6c02ff773d09b3dbd65c42d6b6e2 Mon Sep 17 00:00:00 2001 From: Tommy Wang Date: Sat, 2 Oct 2010 00:03:56 +0800 Subject: [PATCH] =?utf8?q?war=20deploy=E7=9A=84=E9=9B=86=E6=88=90=E6=B5=8B?= =?utf8?q?=E8=AF=95=E4=B8=8D=E5=81=9A=E4=B8=9A=E5=8A=A1=E6=B5=8B=E8=AF=95?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/org/gaixie/jibu/itest/DeployWarIT.java | 34 ++++++++-------------- .../webapp/js/system/administration/monitor.js | 6 ++-- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/itest/war-itest-suite/src/test/java/org/gaixie/jibu/itest/DeployWarIT.java b/itest/war-itest-suite/src/test/java/org/gaixie/jibu/itest/DeployWarIT.java index 395e1f5..9631094 100644 --- a/itest/war-itest-suite/src/test/java/org/gaixie/jibu/itest/DeployWarIT.java +++ b/itest/war-itest-suite/src/test/java/org/gaixie/jibu/itest/DeployWarIT.java @@ -23,34 +23,33 @@ import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.WebResponse; import com.meterware.httpunit.WebRequest; +import org.junit.Assert; import org.junit.Test; import org.junit.AfterClass; import org.junit.BeforeClass; import org.gaixie.jibu.itest.JettyService; -import org.gaixie.jibu.json.JSONArray; import org.gaixie.jibu.json.JSONObject; public class DeployWarIT { private static JettyService server; @BeforeClass public static void beforeClass() throws Exception { - server = new JettyService(System.getProperty("warPath")); server.start(); boolean started = server.isStarted(); while (!started) { - try { - Thread.sleep( 1000 ); // simple polling for now - started = server.isStarted(); - } - catch( InterruptedException e ) { + try { + Thread.sleep( 1000 ); // simple polling for now + started = server.isStarted(); + } + catch( InterruptedException e ) { } } } - + // 由于效率原因,这里只做简单的登录测试,确保 war 正常deploy。 @Test - public void test1() throws Exception { + public void testLogin() throws Exception { // 不要在加载 ajax 文件时报错,这里不对js文件做测试,也不会调用。 HttpUnitOptions.setExceptionsThrownOnScriptError(false); WebConversation wc = new WebConversation(); @@ -68,21 +67,12 @@ public class DeployWarIT { req.setParameter("User.emailaddress","x@x.x"); req.setParameter("User.enabled","true"); wr = wc.getResponse(req); - - String email = null; - req = new PostMethodWebRequest( "http://localhost:8080/User.z" ); - req.setParameter("ci","userFind"); - req.setParameter("User.username",""); - req.setParameter("User.password",""); - req.setParameter("User.fullname",""); - req.setParameter("User.emailaddress",email); - req.setParameter("User.enabled","true"); - wr = wc.getResponse(req); JSONObject obj = new JSONObject(wr.getText()); - JSONArray array = obj.getJSONArray("data"); - JSONObject jo = array.getJSONObject(1); - //System.out.println(jo.getInt("id")); + Assert.assertTrue(obj.getBoolean("success")); + req = new PostMethodWebRequest( "http://localhost:8080/Login.x" ); + req.setParameter("ci","logout"); + wr = wc.getResponse(req); } @AfterClass diff --git a/jibu-web/jibu-core-extjs/src/main/webapp/js/system/administration/monitor.js b/jibu-web/jibu-core-extjs/src/main/webapp/js/system/administration/monitor.js index 6dfd44d..ae51ade 100644 --- a/jibu-web/jibu-core-extjs/src/main/webapp/js/system/administration/monitor.js +++ b/jibu-web/jibu-core-extjs/src/main/webapp/js/system/administration/monitor.js @@ -267,9 +267,9 @@ jibu.security.monitor.Panel = ctx.lineWidth = 2; ctx.beginPath(); ctx.strokeStyle ='red'; - ctx.moveTo(280, 175-10); - ctx.lineTo(300, 175-10 ); - ctx.fillText('Used Memory (MB)',305,175-5); + ctx.moveTo(240, 175-10); + ctx.lineTo(260, 175-10 ); + ctx.fillText('Used Memory (MB)',265,175-5); ctx.stroke(); draw(canvas,0,usedMemory); } -- 2.11.4.GIT