开始今天的测试。
var express = require('express'); var app = express(); app.get('/',function(req,res){ res.type('text'); res.send('hello.'); }); app.get('/users',function(req,res){ console.log('get /users called.') res.type('json'); res.send('[{user:"cyper",age:30},{user:"green",age:28}]'); }); app.listen(3000,function(){console.log('listening 3000.');});
简单的restful service就搭建好了。接下来进行jsonp测试。
bower install jquery#1.11.1<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script type="text/javascript"src="bower_components/jquery/dist/jquery.min.js"></script> <script> $(document).ready(function(){ var url = "http://192.168.1.100:3000/users?callback=?"; $.getJSON(url, function(data){ $('#test').html(data[0].user); }); $.ajax({ url: url, dataType: 'jsonp', complete:function(xhr,status){ console.log("complete:",status); }, success: function(data){ $('#test').html(data[0].user); }, error: function(xhr, status, err){ console.log("error:",err); } }); }); </script> </head> <body> <div id="test"></div> </body> </html>以上使用jquery调用jsonp服务的两种方式,当然第一种最简单。,注意json的key最好用“号括起来。
http://stackoverflow.com/questions/5359224/parsererror-after-jquery-ajax-request-with-jsonp-content-type
http://stackoverflow.com/questions/5943630/basic-example-of-using-ajax-with-jsonp
需要修改服务端, 修改如下:
var express = require('express'); var app = express(); app.get('/',function(req,res){ res.type('text'); res.send('hello.'); }); app.get('/users',function(req,res){ res.type('json'); var callback = req.param('callback'); console.log('callback:',callback); res.send(callback + '([{"user":"cyper","age":30}])'); }); app.listen(3000,function(){console.log('listening 3000.');});
测试成功。接下来work & CDR...切换到J2EE模式。启动DB
su db2inst1
db2start.
启动文件服务(我的目录太乱了。唉东西到处都是)
cd /home/cyper/workspaces/jee/ibm_w3_server
sudo ./ibm_w3_server内容如下
#!/bin/bash
apachectl stop
node ibm_w3_server.js &
192.168.1.101 1.w3.s81c.com #w3.s81c 192.168.1.101 w3.ibm.com #w3 192.168.1.101 tmscdn.coremetrics.com #rubbish 192.168.1.101 data.coremetrics.com #rubbish 192.168.1.101 libs.coremetrics.com #rubbish 192.168.1.101 faces.tap.ibm.com #faces 192.168.1.101 pt200204.unica.com #pt200204 192.168.1.101 service.maxymiser.net #rubbish
1)checkout latest code
2)modify code
3)commit code, merge to other branch as needed
4)update CDR and upload and leave comments.
5)test and update UT, make screenshots as needed.
6)package and upload and raise tracker and send email notification for approve tracker.
由此可见,改一个简单的defect要经历这么多步骤。上传文档或代码包需要耗费不少的时间。这些都要算在sizing里边.