http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/sidebar.html
----------------------------------------------------------------------
diff --git a/griffin-ui/sidebar.html b/griffin-ui/sidebar.html
new file mode 100644
index 0000000..1a9fdd9
--- /dev/null
+++ b/griffin-ui/sidebar.html
@@ -0,0 +1,84 @@
+<!--
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ -->
+
+<div id="rightbar" ng-controller="SideBarCtrl" class="" 
style="background-color:#262626;">
+
+  <div id="side-bar-stats" class="row" style="border-bottom:5px solid 
#060606;margin-left:0;margin-right:0">
+
+    <!--<div class="row-container">-->
+      <div class="col-xs-12 col-md-12 col-lg-6 " id="sidebar-option">
+
+        <div >
+
+          <div class="sidebar-stat-center">
+              <img src="/img/sidebar1.png" >
+              <span><a class="bark-link" 
href="#/dataassets">{{datasets}}&nbsp;Data Assets</a></span>
+          </div>
+
+          <div class="sidebar-stat-center">
+              <img src="/img/sidebar2.png">
+              <span><a class="bark-link" href="#/metrics">{{metrics}}&nbsp;DQ 
Metrics</a></span>
+          </div>
+
+        </div>
+
+      </div>
+      <div class="col-xs-12 col-md-12 col-lg-6">
+        <div id="data-asset-pie"></div>
+      </div>
+    <!--</div>-->
+  </div>
+
+
+  <div id="side-bar-metrics" class="row" 
style="margin-top:20px;overflow-y:auto;overflow-x:hidden;margin-left:0;margin-right:0;height:1px;">
+      <div ng-repeat="outerItems in briefmetrics">
+          <div class="well" 
style="padding:0px;background:transparent;border:0px;position:relative; ">
+            <!-- <img class="bullseye" src="/img/bullseye.png" title="image1" 
> -->
+            <div class="col-sm-4 col-lg-4 col-md-4 "><h4 ><a 
href="#/metrics/{{outerItems.name}}"> {{outerItems.name}}</a></h4></div>
+            <div class="col-sm-3 col-lg-3 col-md-3 " style="display: 
flex;justify-content: center;height:46px;"><div ng-class="outerItems.dq >=90 ? 
'led-green':'led-yellow'" style="align-self: center;"></div></div>
+            <div class="col-sm-5 col-lg-5 col-md-5 " style="display: 
flex;justify-content: center;height:46px;"><a style="align-self: center;" 
class="btn btn-primary" href="https://github.com/eBay/DQSolution/issues"; 
target="_blank">Report&nbsp;issue</a></div>
+          </div>
+          <br/>
+          <div class="well side-bar-scroll">
+            <div class="panel-group" ng-repeat="items in outerItems.metrics" 
style="margin-bottom:0px;background:transparent;">
+              <div class="panel panel-default" 
style="position:relative;background:transparent;">
+                <div class="panel-heading" style="background:transparent;">
+                  <h4 class="panel-title side-metrics">
+                      <a data-toggle="collapse" 
href={{"#"+outerItems.name+$index}} ng-init="items.tag=true" 
ng-click="items.tag=!items.tag;draw(items, $parent.$index, $index);" >
+                        <i class="faChevron" ng-class="items.tag ? 'fa 
fa-caret-right':'fa fa-caret-down'" style="width:10px"></i>
+
+                        <i class="fa fa-line-chart faArrows"></i>
+                        <span class="side-date">{{items.timestamp | 
date:'MM/dd HH:mm':'-0700'}}</span>
+                        &nbsp;&nbsp;
+                        <span class="side-name" 
title="{{items.name}}">{{items.name |strShorten}}</span>
+                        <span ng-if="items.dq <= 100" class="pull-right" 
ng-class="items.dqfail?'side-percent-red':'side-percent'">{{items.dq | 
number:2}}%</span>
+                        <span ng-if="items.dq > 100" class="pull-right" 
ng-class="items.dqfail?'side-percent-red':''">{{items.dq/1000 | 
number:0}}K</span>
+                      </a>
+                    </h4>
+                  </div>
+                  <div id={{outerItems.name+$index}} class="panel-collapse 
collapse">
+                    <!-- <div class="panel-body">
+                      <highchart config="items.chartId">
+                    </div> -->
+                    <div class="panel-body" style="cursor:pointer;padding:0px 
15px;">
+                      <div id={{'chart'+$parent.$index+'-'+$index}} 
class="side-chart"></div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+        </div>
+    </div>
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/karma.conf.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/karma.conf.js 
b/griffin-ui/tests/ut/karma.conf.js
new file mode 100644
index 0000000..4f8a5e1
--- /dev/null
+++ b/griffin-ui/tests/ut/karma.conf.js
@@ -0,0 +1,102 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+// Karma configuration
+// Generated on Thu Apr 07 2016 15:02:00 GMT+0800 (China Standard Time)
+//http://monicalent.com/blog/2015/02/11/karma-tests-angular-js-require-j/
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '../../',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['jasmine', 'requirejs'],
+
+
+    files: [
+      'tests/ut/test-main.js',
+      {pattern:'bower_components/**/*.js', included:false},
+      {pattern:'node_modules/angular-mocks/angular-mocks.js', included:false},
+      {pattern: 'js/**/*.js', included: false},
+      {pattern: 'tests/**/*spec.js', included: false}
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'js/main.js',
+      'js/bs.js',
+      'js/routes.js',
+      'bower_components/**/*test*/**/*.js',
+      'bower_components/**/*spec.js',
+      // 'node_modules/**/*spec.js',
+      // 'node_modules/**/*spec*/**/*.js',
+      // 'node_modules/**/*test.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: 
https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+      'js/**/*.js':['coverage']
+    },
+
+    coverageReporter: {
+        type:'lcov',
+        dir: 'tests/ut/test-coverage'
+    },
+
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    // reporters: ['progress'],
+    reporters: ['mocha', 'coverage', 'progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || 
config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_DEBUG,
+
+
+    // enable / disable watching file and executing tests whenever any file 
changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: 
https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['Chrome'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/createrule-ac-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/createrule-ac-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/createrule-ac-ctrl.spec.js
new file mode 100644
index 0000000..bf34dcb
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/createrule-ac-ctrl.spec.js
@@ -0,0 +1,129 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/createrule-ac-ctrl'],
+  function(angular, mocks, CreateRuleACCtrl) {
+    describe('Test /js/controllers/createrule-ac-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $httpBackend, $config, $location, 
toaster, $timeout, $route;
+           beforeEach(inject(function(_$rootScope_ , _$controller_, 
_$httpBackend_, _$config_, _$location_, _$timeout_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               $route = {};
+               toaster = {};
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('CreateRuleACCtrl', {$scope: $scope, 
$route: $route, toaster: toaster });
+        });
+
+        describe("if the controller of CreateRuleACCtrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("check if parameters are available",function(){
+
+               it('if the controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+
+               it('$scope.value and $config.value should be right', function(){
+                       expect($scope.currentStep).toBe(1);
+                       expect(typeof $scope.selection).toEqual("object");
+                       expect($config.uri.dbtree).toBeTruthy();
+                       expect($config.uri.schemadefinition).toBeTruthy();
+               });
+
+               it('$scope.ruleTypes should be right', function(){
+                       expect($scope.ruleTypes).toEqual(['Accuracy', 
'Validity', 'Anomaly Detection', 'Publish Metrics']);
+               });
+
+       })
+
+       describe("check if function are work",function(){
+
+               it('$scope.selectNodeLabelTarget  works well', function(){
+                 expect($scope.selectNodeLabelTarget ).toBeDefined();
+               });
+
+               it('$scope.toggleSelection works well', function(){
+                 expect($scope.toggleSelection).toBeDefined();
+               });
+
+               it('$scope.toggleAll works well', function(){
+                 expect($scope.toggleAll).toBeDefined();
+               });
+
+               it('$scope.form is a object', function(){
+                 expect(typeof $scope.form).toBe("object");
+               });
+
+       })
+
+       describe("$scope.form test",function(){
+
+               it('the type of $scope.form', function(){
+                       expect(typeof $scope.form).toBe("object");
+               });
+
+               it('the type of $scope.form.submit', function(){
+                       expect(typeof $scope.form.submit).toBe('function');
+               });
+
+               it('the type of $scope.form.save', function(){
+                       expect(typeof $scope.form.save).toBe('function');
+               });
+
+        })
+
+        describe("httpGet $config.uri.dbtree test",function(){
+               beforeEach(function(){
+                   $httpBackend.when('GET', 
$config.uri.dbtree).respond({"age": 16,"name": "li"});
+                   $httpBackend.when('GET', 
$config.uri.schemadefinition).respond({"age": 16,"name": "li"});
+               });
+
+               it('http response', function(){
+                 $httpBackend.flush();
+                 expect($scope.dbListTarget).toBeTruthy();
+               });
+
+                       it('test watch and http request', function(){
+                               $scope.currentNode = {"name":"ha"};
+                       $scope.$digest();
+
+                       $httpBackend.flush();
+                       expect($scope.selection.length).toBe(0);
+                       expect($scope.selectedAll).toBe(false);
+
+                       expect($scope.schemaCollection.age).toBe(16);
+                       });
+
+               afterEach(function() {
+                       $httpBackend.verifyNoOutstandingExpectation();
+                       $httpBackend.verifyNoOutstandingRequest();
+               });
+           })
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/createrule-pu-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/createrule-pu-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/createrule-pu-ctrl.spec.js
new file mode 100644
index 0000000..9bf9af2
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/createrule-pu-ctrl.spec.js
@@ -0,0 +1,105 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/createrule-pu-ctrl'],
+  function(angular, mocks, CreateRulePUCtrl) {
+    describe('Test /js/controllers/createrule-pu-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $httpBackend, $config, $location, 
toaster, $timeout, $route;
+           beforeEach(inject(function(_$rootScope_ , _$controller_, 
_$httpBackend_, _$config_, _$location_, _$timeout_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               $route = {};
+               toaster = ['error', 'Error', "hello", "lisan"];/*test data*/
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('CreateRulePUCtrl', {$scope: $scope, 
$route: $route, toaster: toaster });
+        });
+
+        describe("if the controller of CreateRulePUCtrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("$scope.value",function(){
+
+               it('$scope.currentStep == 1', function(){
+                       expect($scope.currentStep).toBe(1);
+               });
+
+               it('$scope.scheduleTypes', function(){
+                       expect($scope.scheduleTypes).toEqual(['Daily', 
'Weekly', 'Monthly', 'Hourly']);
+               });
+
+        })
+
+        describe("$scope.form test",function(){
+
+               it('the type of $scope.form', function(){
+                       expect(typeof $scope.form).toBe("object");
+               });
+
+               it('the type of $scope.form.submit', function(){
+                       expect(typeof $scope.form.submit).toBe('function');
+               });
+
+               it('the type of $scope.form.save', function(){
+                       expect(typeof $scope.form.save).toBe('function');
+               });
+
+        })
+
+        /*describe("function errorMessage() test",function(){
+               // test function
+               it('errorMessage', function(){
+                       var message = ["hello"];
+                       var i = 2;
+                       var msg = true;
+                       $scope.errorMessage(i,msg);
+                       expect(toaster).toEqual(['error', 'Error',"hello"]);
+               });
+
+        })*/
+
+        describe('Testing $watch expressions', function() {
+                   it('test using $digest', function() {
+                       var form = {};
+                       form.basic = {"name": "li"};
+                       form.publishUrl = "publishUrl";
+                       $scope.form = form;
+                       form.basic.name = "ha";
+                       $scope.$digest();
+                       form.basic.name = "la";
+                       $scope.$digest();
+
+                       
expect($scope.form.publishUrl).toEqual('http://dq.vip.ebay.com/api/v1/publishmetric/la');
+
+                   });
+               });
+
+
+
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/createrule-va-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/createrule-va-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/createrule-va-ctrl.spec.js
new file mode 100644
index 0000000..990ef4e
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/createrule-va-ctrl.spec.js
@@ -0,0 +1,110 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/createrule-va-ctrl'],
+  function(angular, mocks, CreateRuleVACtrl) {
+    describe('Test /js/controllers/createrule-va-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $httpBackend, $config, $location, 
toaster, $timeout, $route;
+           beforeEach(inject(function(_$rootScope_ , _$controller_, 
_$httpBackend_, _$config_, _$location_, _$timeout_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               $route = {};
+               toaster = {};
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('CreateRuleVACtrl', {$scope: $scope, 
$route: $route, toaster: toaster });
+        });
+
+        describe("if the controller of CreateRuleVACtrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("check if parameters are available",function(){
+
+               it('$scope.value and $config.value should be right', function(){
+                       expect($scope.currentStep).toBe(1);
+                       expect($config.uri.dbtree).toBeTruthy();
+                       expect($config.uri.schemadefinition).toBeTruthy();
+               });
+
+               it('$scope.ruleTypes should be right', function(){
+                       expect($scope.ruleTypes).toEqual(['Accuracy', 
'Validity', 'Anomaly Detection', 'Publish Metrics']);
+               });
+
+       })
+
+       describe("check if form function are work",function(){
+
+               it('$scope.form is a object', function(){
+                 expect(typeof $scope.form).toBe("object");
+               });
+
+       })
+
+       describe("$scope.form test",function(){
+
+               it('the type of $scope.form', function(){
+                       expect(typeof $scope.form).toBe("object");
+               });
+
+               it('the type of $scope.form.submit', function(){
+                       expect(typeof $scope.form.submit).toBe('function');
+               });
+
+               it('the type of $scope.form.save', function(){
+                       expect(typeof $scope.form.save).toBe('function');
+               });
+
+        })
+
+       describe("httpGet $config.uri.dbtree test",function(){
+               beforeEach(function(){
+                   $httpBackend.when('GET', 
$config.uri.dbtree).respond({"age": 16,"name": "li"});
+                   $httpBackend.when('GET', 
$config.uri.schemadefinition).respond({"age": 15,"name": "wei"});
+               });
+
+               it('http response', function(){
+                       $httpBackend.flush();
+                       expect($scope.dbList).toBeTruthy();
+               });
+
+               it('test watch and http request', function(){
+                               $scope.currentNode = {"name":"ha"};
+                       $scope.$digest();
+
+                       $httpBackend.flush();
+                       expect($scope.schemaCollection.age).toBe(15);
+                       });
+
+               afterEach(function() {
+                       $httpBackend.verifyNoOutstandingExpectation();
+                       $httpBackend.verifyNoOutstandingRequest();
+               });
+           })
+
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/createrule0-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/createrule0-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/createrule0-ctrl.spec.js
new file mode 100644
index 0000000..8df4af1
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/createrule0-ctrl.spec.js
@@ -0,0 +1,62 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/createrule0-ctrl'],
+  function(angular, mocks, CreateRule0Ctrl) {
+    describe('Test /js/controllers/createrule0-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $httpBackend, $config, $location, 
toaster, $timeout;
+
+           beforeEach(inject(function(_$rootScope_ , _$controller_, 
_$httpBackend_, _$config_, _$location_, _$timeout_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               toaster = {};
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('CreateRule0Ctrl', {$scope: $scope, 
toaster: toaster });
+        });
+
+        describe("if the controller of CreateRule0Ctrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("if the $scope.click exists",function(){
+
+               it('$scope.click', function(){
+                       expect($scope.click).toBeDefined();
+               });
+
+               it('should change location when setting it via click function', 
inject(function() {
+                       var url = '/index';
+                       $scope.click(url);
+                       spyOn($location, 'path').and.returnValue(url);
+                   }));
+
+        })
+
+
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/health-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/health-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/health-ctrl.spec.js
new file mode 100644
index 0000000..b35e40a
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/health-ctrl.spec.js
@@ -0,0 +1,73 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['require', 'angular', 'angularMocks', 'js/controllers/health-ctrl', 
'echarts'],
+  function(require, angular, mocks, HealthCtrl) {
+    describe('Test /js/controllers/health-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $httpBackend, $config, $location, 
toaster, $timeout, $route;
+
+           beforeEach(inject(function(_$rootScope_ , _$controller_, 
_$httpBackend_, _$config_, _$location_, _$timeout_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               toaster = {};
+               $route = {};
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('HealthCtrl', {$scope: $scope, $route: 
$route, toaster: toaster });
+        });
+
+        describe("if the controller of HealthCtrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("check if parameters are available",function(){
+
+               it('$scope.value and $config.value should be right', function(){
+                       expect($config.uri.heatmap).toBeTruthy();
+               });
+
+       })
+
+       describe("httpGet $config.uri.dbtree test",function(){
+               beforeEach(function(){
+                   $httpBackend.when('GET', 
$config.uri.heatmap).respond([{"name":"unknown","dq":0.0,"metrics":[{"name":"mean","dq":4835.3,"dqfail":0,"timestamp":1470387389994,"metricType":"","assetName":null,"details":[]},{"name":"test1001","dq":1638.6,"dqfail":0,"timestamp":1470387312289,"metricType":"","assetName":null,"details":[]},{"name":"test_publish","dq":99.8,"dqfail":0,"timestamp":1463994766925,"metricType":"","assetName":null,"details":[]},{"name":"v","dq":99.8,"dqfail":0,"timestamp":1463994766925,"metricType":"","assetName":null,"details":[]}]},{"name":"Hadoop","dq":0.0,"metrics":[{"name":"movie_acc","dq":97.0,"dqfail":0,"timestamp":1470009600000,"metricType":"","assetName":null,"details":[]},{"name":"movie_acc_test2","dq":97.0,"dqfail":0,"timestamp":1470009600000,"metricType":"","assetName":null,"details":[]},{"name":"hadoop_accuracy_1","dq":99.053,"dqfail":0,"timestamp":1467356400000,"metricType":"","assetName":null,"details":[]}]},{"name":"Bullseye","dq":0.0,"metrics":[{"na
 
me":"test_accuracy_1","dq":98.952,"dqfail":1,"timestamp":1467439200000,"metricType":"","assetName":null,"details":[]},{"name":"test_accuracy_2","dq":99.103,"dqfail":0,"timestamp":1467439200000,"metricType":"","assetName":null,"details":[]},{"name":"TotalCount_asset1","dq":5056215.0,"dqfail":0,"timestamp":1467439200000,"metricType":"","assetName":null,"details":[]},{"name":"TotalCount_asset2","dq":1.229703E7,"dqfail":0,"timestamp":1467356400000,"metricType":"","assetName":null,"details":[]},{"name":"aw","dq":5056215.0,"dqfail":0,"timestamp":1467439200000,"metricType":"Bollinger","assetName":null,"details":[]}]}]);
+                   $httpBackend.flush();
+               });
+
+               it('http response', function(){
+                 // expect($scope.dbList).toBeTruthy();
+               });
+
+               afterEach(function() {
+                       $httpBackend.verifyNoOutstandingExpectation();
+                       $httpBackend.verifyNoOutstandingRequest();
+               });
+           })
+
+
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/metrics-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/metrics-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/metrics-ctrl.spec.js
new file mode 100644
index 0000000..0036101
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/metrics-ctrl.spec.js
@@ -0,0 +1,76 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/metrics-ctrl'],
+  function(angular, mocks, MetricsCtrl) {
+    describe('Test /js/controllers/metrics-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $rootScope, $controller, $httpBackend, $config, $filter, 
$routeParams, $timeout, $compile, $route;
+           beforeEach(inject(function(_$rootScope_, _$controller_, 
_$httpBackend_, _$config_, _$filter_, _$timeout_, _$compile_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $filter = _$filter_;
+               $routeParams = {};
+               // $routeParams.siteId = 'abc';
+               $timeout = _$timeout_;
+               $compile = _$compile_;
+               $route = {};
+           }));
+
+       describe("function test",function(){
+               var $scope;
+
+               beforeEach(function(){
+                       $scope =  $rootScope.$new();
+                       controller = $controller('MetricsCtrl', {$scope: 
$scope, $route: $route, $routeParams: $routeParams});
+               });
+
+               it('controller exists', function(){
+                       // var controller = $controller('MetricsCtrl', {$scope: 
$scope, $routeParams: $routeParams});
+                       expect(controller).toBeDefined();
+               });
+
+               it('$config.uri.dashboard', function(){
+                       expect($config.uri.dashboard).toBeTruthy();
+               });
+
+               it('$scope.showBig works well', function(){
+                 expect($scope.showBig).toBeDefined();
+               });
+
+               describe("http test",function(){
+                       beforeEach(function(){
+                       $httpBackend.when('GET', 
$config.uri.dashboard).respond({"age": 16,"name": "li"});
+                           $httpBackend.flush();
+                       });
+
+                       it('http response', function(){
+                         expect($scope.dashboard.age).toBe(16);
+                       });
+
+                       afterEach(function() {
+                       $httpBackend.verifyNoOutstandingExpectation();
+                       $httpBackend.verifyNoOutstandingRequest();
+                       });
+               })
+
+       })
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/nav-ctrl_spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/nav-ctrl_spec.js 
b/griffin-ui/tests/ut/specs/controllers/nav-ctrl_spec.js
new file mode 100644
index 0000000..b4549fb
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/nav-ctrl_spec.js
@@ -0,0 +1,47 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/nav-ctrl'],
+  function(angular, mocks, navCtrl) {
+    describe('Test /js/controllers/nav-ctrl.js', function(){
+      beforeEach(function(){
+        module('app.controllers');
+        module('app.services');
+      });
+       var $controller, $config, $httpBackend, $location;
+
+       beforeEach(inject(function(_$controller_, _$config_, _$httpBackend_, 
_$location_){
+           $controller = _$controller_;
+           $config = _$config_;
+           $httpBackend = _$httpBackend_;
+          $location = _$location_;
+       }));
+
+      describe('$scope functions are set properly', function(){
+        var $scope;
+
+        beforeEach(function(){
+          $scope = {};
+          $controller('NavCtrl', {$scope:$scope});
+        })
+
+        it('$scope.isActive is defined correctly', function(){
+          $location.path('/home');
+          expect($scope.isActive('/home')).toBeTruthy();
+        });
+
+      });
+    });
+  }
+);

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/rule-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/rule-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/rule-ctrl.spec.js
new file mode 100644
index 0000000..c5b0df8
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/rule-ctrl.spec.js
@@ -0,0 +1,57 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/rule-ctrl'],
+  function(angular, mocks, RuleCtrl) {
+    describe('Test /js/controllers/rule-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $httpBackend, $config, $location, 
toaster, $timeout, $route;
+
+           beforeEach(inject(function(_$rootScope_ , _$controller_, 
_$httpBackend_, _$config_, _$location_, _$timeout_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               toaster = {};
+               $route = {};
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('RuleCtrl', {$scope: $scope, $route: 
$route, toaster: toaster });
+        });
+
+        describe("if the controller of RuleCtrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("check if createRowCollection",function(){
+
+               it('createRowCollection', function(){
+                       expect($scope.rowCollection).not.toEqual([]);
+               });
+
+       })
+
+
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/sidebar-ctrl_spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/sidebar-ctrl_spec.js 
b/griffin-ui/tests/ut/specs/controllers/sidebar-ctrl_spec.js
new file mode 100644
index 0000000..5b5a949
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/sidebar-ctrl_spec.js
@@ -0,0 +1,89 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/sidebar-ctrl'],
+  function(angular, mocks, sidebarCtrl) {
+    describe('Test /js/controllers/sidebar-ctrl.js', function(){
+      beforeEach(function(){
+        module('app.controllers');
+        module('app.services');
+      });
+       var $controller, $httpBackend, $config, $filter, $timeout, $compile;
+      beforeEach(inject(function(_$controller_, _$httpBackend_, _$config_, 
_$filter_, _$timeout_, _$compile_){
+          $controller = _$controller_;
+          $httpBackend = _$httpBackend_;
+          $config = _$config_;
+          $filter = _$filter_;
+          $timeout = _$timeout_;
+          $compile = _$compile_;
+      }));
+
+       describe("http unit test",function(){
+        var $scope;
+        beforeEach(function(){
+          $scope = {};
+          $controller('SideBarCtrl', {$scope:$scope});
+        })
+        it('$scope.str works well', function(){
+          // expect($scope.str).toEqual("hello");
+        });
+        it('url works well', function(){
+          expect($config.uri.statistics).toBeTruthy();
+        });
+        it('function resizeSidebar() works well', function(){
+          // expect($scope.resizeSidebar).toBeDefined();
+        });
+        describe("http get test",function(){
+          beforeEach(function(){
+                $httpBackend.when('GET', $config.uri.statistics).respond(
+                    {
+                      "assets": 16,
+                      "metrics": 20,
+                      "status":{
+                        "health": 16,
+                        "warn": 3,
+                        "invalid": 1
+                      }
+                    }
+                );
+
+                $httpBackend.when('GET', $config.uri.briefmetrics).respond(
+                    {
+                      "assets": 16,
+                      "metrics": 20,
+                      "status":{
+                        "health": 16,
+                        "warn": 3,
+                        "invalid": 1
+                      }
+                    }
+                );
+                $httpBackend.flush();
+          });
+
+          it("$scope.chartConfig is defined", function(){
+              expect($scope.chartConfig).toBeDefined();
+          });
+
+          afterEach(function() {
+            $httpBackend.verifyNoOutstandingExpectation();
+            $httpBackend.verifyNoOutstandingRequest();
+          });
+        })
+
+
+      })
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/controllers/viewrule-ctrl.spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/controllers/viewrule-ctrl.spec.js 
b/griffin-ui/tests/ut/specs/controllers/viewrule-ctrl.spec.js
new file mode 100644
index 0000000..1aa3c61
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/controllers/viewrule-ctrl.spec.js
@@ -0,0 +1,72 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/controllers/viewrule-ctrl'],
+  function(angular, mocks, ViewRuleCtrl) {
+    describe('Test /js/controllers/viewrule-ctrl.js', function(){
+       beforeEach(function(){
+               module('app.controllers');
+               module('app.services');
+       });
+       var $scope, $rootScope, $controller, $filter, $httpBackend, $config, 
$location, toaster, $timeout, $compile;
+
+           beforeEach(inject(function(_$rootScope_ , _$controller_, _$filter_, 
_$httpBackend_, _$config_, _$location_, _$timeout_, _$compile_){
+               $rootScope = _$rootScope_;
+               $controller = _$controller_;
+               $filter = _$filter_;
+               $httpBackend = _$httpBackend_;
+               $config = _$config_;
+               $location = _$location_;
+               $timeout = _$timeout_;
+               toaster = {};
+               $compile = _$compile_;
+           }));
+
+        beforeEach(function(){
+               $scope =  $rootScope.$new();
+               controller = $controller('ViewRuleCtrl', {$scope: $scope, 
toaster: toaster});
+        });
+
+        describe("if the controller of ViewRuleCtrl exists",function(){
+               it('controller exists', function(){
+                       expect(controller).toBeDefined();
+               });
+        })
+
+        describe("check if parameters are available",function(){
+               it('$scope.value and $config.value should be right', function(){
+                       expect($config.uri.rulemetric).toBeTruthy();
+               });
+       })
+
+       describe("httpGet $config.uri.rulemetric test",function(){
+               beforeEach(function(){
+                   $httpBackend.when('GET', 
$config.uri.rulemetric).respond({"age": 16,"name": "li"});
+                   $httpBackend.flush();
+               });
+
+               it('http response', function(){
+                 // expect($scope.dbList).toBeTruthy();
+               });
+
+               afterEach(function() {
+                       $httpBackend.verifyNoOutstandingExpectation();
+                       $httpBackend.verifyNoOutstandingRequest();
+               });
+           })
+
+
+    });
+  }
+)

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/filters/strmap_spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/filters/strmap_spec.js 
b/griffin-ui/tests/ut/specs/filters/strmap_spec.js
new file mode 100644
index 0000000..a2bbee0
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/filters/strmap_spec.js
@@ -0,0 +1,33 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/filters/strmap'],
+  function(angular, mocks, filter) {
+
+    describe('Test /js/filters/strmap.js', function() {
+      beforeEach(module('app.filters'));
+
+      // Our first test!!!!
+      it('map correctly for index', mocks.inject(function($filter) {
+        // console.log($filter('strShorten')('1234567890123444444'));
+        var arr = ['Apple', 'Orange', 'Pale'];
+        expect($filter('strmap')(0, arr)).toEqual(arr[0]);
+        expect($filter('strmap')(3, arr)).toEqual(3);
+
+      }));
+
+
+    });
+  }
+);

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/filters/strshorten_spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/filters/strshorten_spec.js 
b/griffin-ui/tests/ut/specs/filters/strshorten_spec.js
new file mode 100644
index 0000000..e6ffa7d
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/filters/strshorten_spec.js
@@ -0,0 +1,38 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/filters/strshorten'],
+  function(angular, mocks, filter) {
+
+    describe('Test /js/filters/strshorten.js', function() {
+      beforeEach(module('app.filters'));
+      // Here we register the function returned by the myFilter AMD module
+      // beforeEach(mocks.module(function($filterProvider) {
+      //   $filterprovider.register('stringsFilter', filter);
+      // }));
+
+      // Our first test!!!!
+      it('string should be shorten', mocks.inject(function($filter) {
+        // console.log($filter('strShorten')('1234567890123444444'));
+        expect($filter('strShorten')('abcde')).toEqual('abcde');
+        
expect($filter('strShorten')('1234567890123444444')).toEqual('123456789012...');
+      }));
+
+      // it('should be true', function(){
+      //   expect(1).not.toBeNull();
+      // });
+
+    });
+  }
+);

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/specs/services/services_spec.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/specs/services/services_spec.js 
b/griffin-ui/tests/ut/specs/services/services_spec.js
new file mode 100644
index 0000000..8709dc1
--- /dev/null
+++ b/griffin-ui/tests/ut/specs/services/services_spec.js
@@ -0,0 +1,37 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+define(['angular', 'angularMocks', 'js/services/services'],
+  function(angular, mocks, filter) {
+
+    describe('Test /js/services/services.js', function() {
+      beforeEach(module('app.services'));
+      // Here we register the function returned by the myFilter AMD module
+      // beforeEach(mocks.module(function($filterProvider) {
+      //   $filterprovider.register('stringsFilter', filter);
+      // }));
+
+      // Our first test!!!!
+      it('$config uri is set', mocks.inject(function($config) {
+        // expect($config).not.toBeNull();
+        
expect(Object.getOwnPropertyNames($config.uri).length).toBeGreaterThan(0);
+      }));
+
+      // it('should be true', function(){
+      //   expect(1).not.toBeNull();
+      // });
+
+    });
+  }
+);

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/griffin-ui/tests/ut/test-main.js
----------------------------------------------------------------------
diff --git a/griffin-ui/tests/ut/test-main.js b/griffin-ui/tests/ut/test-main.js
new file mode 100644
index 0000000..ef3c9bb
--- /dev/null
+++ b/griffin-ui/tests/ut/test-main.js
@@ -0,0 +1,97 @@
+/*
+       Copyright (c) 2016 eBay Software Foundation.
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+ */
+//for demo purpose
+var allTestFiles = [];
+var TEST_REGEXP = /(spec|test)\.js$/i;
+
+// Get a list of all the test files to include
+Object.keys(window.__karma__.files).forEach(function(file) {
+  if (TEST_REGEXP.test(file)) {
+    // Normalize paths to RequireJS module names.
+    // If you require sub-dependencies of test files to be loaded as-is 
(requiring file extension)
+    // then do not normalize the paths
+    var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '');
+    // var normalizedTestModule = file.replace(/^\/base\//, 
'').replace(/\.js$/, '');
+    // console.log(normalizedTestModule);
+    allTestFiles.push(normalizedTestModule);
+  }
+});
+
+require.config({
+  // Karma serves files under /base, which is the basePath from your config 
file
+  baseUrl: '/base',
+
+  waitSeconds: 200,
+  // dynamically load all test files
+  deps: allTestFiles,
+  // dpes: ['C:/temp/Bark_UI/tests/ut/specs/my_first_spec'],
+
+
+  // we have to kickoff jasmine, as it is asynchronous
+  callback: window.__karma__.start,
+  paths: {
+    // 'domReady': '../bower_components/domReady/domReady',
+    'angular': '/base/bower_components/angular/angular',
+    'angularMocks': '/base/node_modules/angular-mocks/angular-mocks',
+    'angularRoute': '/base/bower_components/angular-route/angular-route',
+
+    'ngAnimate': '/base/bower_components/angular-animate/angular-animate',
+    'ngToaster': '/base/bower_components/AngularJS-Toaster/toaster',
+
+    'jquery': '/base/bower_components/jquery/dist/jquery',
+    'bootstrap': '/base/bower_components/bootstrap/dist/js/bootstrap',
+
+    
+               'echarts': '/base/bower_components/echarts/dist/echarts',
+  },
+  shim: {
+    'angular': {
+      deps: ['jquery'],
+      exports: 'angular'
+    },
+    // 'angularMocks': {
+    //   exports: 'angularMocks',
+    //   deps: ['angular']
+    // },
+    'angularMocks': {deps: ['angular'], 'exports': 'angular.mock'},
+    'angularRoute': {
+        deps: ['angular'],
+        exports: 'angularRoute'
+    },
+    'ngSmartTable': {
+      deps: ['angular'],
+      exports: 'ngSmartTable'
+    },
+    'ngAnimate': {
+        deps: ['angular'],
+        exports: 'ngAnimate'
+    },
+    'ngToaster': {
+      deps: ['angular', 'ngAnimate'],
+      exports: 'ngToaster'
+    },
+
+    'jquery': {
+      exports: 'jquery'
+    },
+    'bootstrap': {
+      exports: 'bootstrap',
+      deps: ['jquery']
+    },
+    'echarts': {
+      exports: 'echarts'
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/measure/pom.xml
----------------------------------------------------------------------
diff --git a/measure/pom.xml b/measure/pom.xml
deleted file mode 100644
index 493f0b6..0000000
--- a/measure/pom.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-  <modelVersion>4.0.0</modelVersion>
-
-  <groupId>org.apache.griffin</groupId>
-  <artifactId>measure</artifactId>
-  <version>0.1.0-SNAPSHOT</version>
-  <packaging>jar</packaging>
-
-  <name>Apache Griffin :: Measures</name>
-  <url>http://maven.apache.org</url>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/measure/src/main/java/jar/App.java
----------------------------------------------------------------------
diff --git a/measure/src/main/java/jar/App.java 
b/measure/src/main/java/jar/App.java
deleted file mode 100644
index 9772ca4..0000000
--- a/measure/src/main/java/jar/App.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package jar;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/a8ba6ba9/measure/src/test/java/jar/AppTest.java
----------------------------------------------------------------------
diff --git a/measure/src/test/java/jar/AppTest.java 
b/measure/src/test/java/jar/AppTest.java
deleted file mode 100644
index 4f2fe94..0000000
--- a/measure/src/test/java/jar/AppTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package jar;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}

Reply via email to