func JScan(js interface{}, path string) interface{} {
	var v interface{}
	if err := scan.ScanTree(js, path, &v); err != nil {
		return nil
	}
	return v
}
JScan traverses a json object tree.
package testutil
import (
	"bytes"
	"github.com/mattn/go-scan"
	"gopkg.in/pfnet/jasco.v1"
	"gopkg.in/sensorbee/sensorbee.v0/data"
	"gopkg.in/sensorbee/sensorbee.v0/server"
	"gopkg.in/sensorbee/sensorbee.v0/server/config"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
)
var (
	TestAPIWithRealHTTPServer = false
)
type Server struct {
	server struct {
		realServer *httptest.Server
		router     http.Handler
		url        string
	}
}
func (s *Server) Close() {
	if s.server.realServer != nil {
		s.server.realServer.Close()
	}
}
func (s *Server) URL() string {
	return s.server.url
}
func (s *Server) HTTPClient() *http.Client {
	if s.server.realServer != nil {
		return http.DefaultClient
	}
	return &http.Client{
		Transport: &testTransport{s},
	}
}
type testTransport struct {
	s *Server
}
func (t *testTransport) RoundTrip(req *http.Request) (*http.Response, error) {
	if req.Body == nil {
		req.Body = ioutil.NopCloser(bytes.NewReader([]byte{}))
	}
	rc := httptest.NewRecorder()
	t.s.server.router.ServeHTTP(rc, req)
	return &http.Response{
		Status:        http.StatusText(rc.Code),
		StatusCode:    rc.Code,
		Proto:         "HTTP/1.0",
		ProtoMajor:    1,
		ProtoMinor:    0,
		Header:        rc.HeaderMap,
		Body:          ioutil.NopCloser(rc.Body),
		ContentLength: int64(rc.Body.Len()),
	}, nil
}
func NewServer() *Server {
	s := &Server{}
	c, err := config.New(data.Map{})
	if err != nil {
		panic(err)
	}
	gvars, err := server.SetUpContextGlobalVariables(c)
	if err != nil {
		panic(err)
	}
	jascoRoot := jasco.New("/", nil)
	root, err := server.SetUpContextAndRouter("/", jascoRoot, gvars)
	if err != nil {
		panic(err)
	}
	server.SetUpAPIRouter("/", root, nil)
	if TestAPIWithRealHTTPServer {
		s.server.realServer = httptest.NewServer(jascoRoot)
		s.server.url = s.server.realServer.URL
	} else {
		s.server.router = jascoRoot
		s.server.url = "http://172.0.0.1:0602"
	}
	return s
}