Added back in Bazel tests for gui2-fw-lib and gui2-topo-lib

Also used a named path in typescript for gui2-fw-lib

Change-Id: I7233565e53b9b86e1766228ecc96b21ea6f7499d
diff --git a/web/gui2-topo-lib/.gitignore b/web/gui2-topo-lib/.gitignore
deleted file mode 100644
index 03327b3..0000000
--- a/web/gui2-topo-lib/.gitignore
+++ /dev/null
@@ -1,48 +0,0 @@
-# See http://help.github.com/ignore-files/ for more about ignoring files.
-
-# compiled output
-/dist
-/tmp
-/out-tsc
-/gui2-topo-lib*.tgz
-
-# dependencies
-/node_modules
-
-# IDEs and editors
-/.idea
-.project
-.classpath
-.c9/
-*.launch
-.settings/
-*.sublime-workspace
-
-# IDE - VSCode
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-
-# misc
-/.sass-cache
-/connect.lock
-/coverage
-/libpeerconnection.log
-npm-debug.log
-yarn-error.log
-testem.log
-/typings
-
-# System Files
-.DS_Store
-Thumbs.db
-
-# Development only files
-/projects/gui2-topo-lib/fw
-/projects/gui2-topo-tester/src/data
-
-.cache/
-.npm/
-.pki/
diff --git a/web/gui2-topo-lib/BUILD.bazel b/web/gui2-topo-lib/BUILD.bazel
index 46ecb74..4e3275b 100644
--- a/web/gui2-topo-lib/BUILD.bazel
+++ b/web/gui2-topo-lib/BUILD.bazel
@@ -1,4 +1,6 @@
 load("@npm_angular_bazel//:index.bzl", "ng_module")
+load("@npm_bazel_typescript//:index.bzl", "ts_library")
+load("@npm_bazel_karma//:index.bzl", "karma_web_test_suite")
 
 package(default_visibility = ["//:__subpackages__"])
 
@@ -14,13 +16,13 @@
         include = ["**/*.ts"],
         exclude = [
             "**/*.spec.ts",
-            "test.ts",
         ],
     ),
     assets = glob([
         "**/*.css",
         "**/*.html",
     ]),
+    tsconfig = "//web/gui2:tsconfig.json",
     deps = NG_FACTORY_ADDED_IMPORTS + [
         "//web/gui2-fw-lib",
         "@npm//@angular/core",
@@ -31,3 +33,144 @@
         "@npm//topojson-client",
     ],
 )
+
+ts_library(
+    name = "test_lib",
+    testonly = 1,
+    srcs = glob(
+        include = ["**/*.spec.ts"],
+        # TODO re-enable this test
+        exclude = [
+            "lib/layer/backgroundsvg/backgroundsvg.component.spec.ts",
+            "lib/layer/forcesvg/forcesvg.component.spec.ts",
+        ],
+    ),
+    tsconfig = "//web/gui2:tsconfig-test",
+    deps = [
+        ":gui2-topo-lib",
+        "//web/gui2-fw-lib",
+        "@npm//@angular/common",
+        "@npm//@angular/core",
+        "@npm//@angular/forms",
+        "@npm//@angular/http",
+        "@npm//@angular/platform-browser",
+        "@npm//@angular/router",
+        "@npm//@types/jasmine",
+        "@npm//rxjs",
+    ],
+)
+
+# Convert topojson-client to an AMD module so it can be loaded in the RequireJS test environment.
+genrule(
+    name = "topojson-client_requirejs",
+    srcs = [
+        "@npm//:node_modules/topojson-client/dist/topojson-client.js",
+    ],
+    outs = [
+        "topojson-client.js",
+    ],
+    cmd = """echo "define('topojson-client', function(require, exports, module) {" > $@ \
+             && cat $< >> $@ \
+             && echo '});' >> $@""",
+)
+
+# Convert d3-force to an AMD module so it can be loaded in the RequireJS test environment.
+genrule(
+    name = "d3-force_requirejs",
+    srcs = [
+        "@npm//:node_modules/d3-force/dist/d3-force.js",
+    ],
+    outs = [
+        "d3-force.js",
+    ],
+    cmd = """echo "define('d3-force', function(require, exports, module) {" > $@ \
+             && cat $< >> $@ \
+             && echo '});' >> $@""",
+)
+
+# Convert d3-quadtree to an AMD module so it can be loaded in the RequireJS test environment.
+genrule(
+    name = "d3-quadtree_requirejs",
+    srcs = [
+        "@npm//:node_modules/d3-quadtree/dist/d3-quadtree.js",
+    ],
+    outs = [
+        "d3-quadtree.js",
+    ],
+    cmd = """echo "define('d3-quadtree', function(require, exports, module) {" > $@ \
+             && cat $< >> $@ \
+             && echo '});' >> $@""",
+)
+
+# Convert d3-collection to an AMD module so it can be loaded in the RequireJS test environment.
+genrule(
+    name = "d3-collection_requirejs",
+    srcs = [
+        "@npm//:node_modules/d3-collection/dist/d3-collection.js",
+    ],
+    outs = [
+        "d3-collection.js",
+    ],
+    cmd = """echo "define('d3-collection', function(require, exports, module) {" > $@ \
+             && cat $< >> $@ \
+             && echo '});' >> $@""",
+)
+
+# Convert d3-dispatch to an AMD module so it can be loaded in the RequireJS test environment.
+genrule(
+    name = "d3-dispatch_requirejs",
+    srcs = [
+        "@npm//:node_modules/d3-dispatch/dist/d3-dispatch.js",
+    ],
+    outs = [
+        "d3-dispatch.js",
+    ],
+    cmd = """echo "define('d3-dispatch', function(require, exports, module) {" > $@ \
+             && cat $< >> $@ \
+             && echo '});' >> $@""",
+)
+
+# Convert d3-timer to an AMD module so it can be loaded in the RequireJS test environment.
+genrule(
+    name = "d3-timer_requirejs",
+    srcs = [
+        "@npm//:node_modules/d3-timer/dist/d3-timer.js",
+    ],
+    outs = [
+        "d3-timer.js",
+    ],
+    cmd = """echo "define('d3-timer', function(require, exports, module) {" > $@ \
+             && cat $< >> $@ \
+             && echo '});' >> $@""",
+)
+
+karma_web_test_suite(
+    name = "test",
+    srcs = [
+    ],
+    # do not sort
+    bootstrap = [
+        "@npm//:node_modules/zone.js/dist/zone-testing-bundle.js",
+        "@npm//:node_modules/reflect-metadata/Reflect.js",
+    ],
+    browsers = [
+        #        "@io_bazel_rules_webtesting//browsers:chromium-local",
+        "@io_bazel_rules_webtesting//browsers:firefox-local",
+    ],
+    tags = ["native"],
+    runtime_deps = [
+        "//web/gui2/src/main/webapp:initialize_testbed",
+    ],
+    deps = [
+        ":d3-collection_requirejs",
+        ":d3-dispatch_requirejs",
+        ":d3-force_requirejs",
+        ":d3-quadtree_requirejs",
+        ":d3-timer_requirejs",
+        ":test_lib",
+        ":topojson-client_requirejs",
+        "//web/gui:src/main/webapp/data",
+        "//web/gui2/src/main/webapp:d3_requirejs",
+        "//web/gui2/src/main/webapp:rxjs_umd_modules",
+    ],
+)
diff --git a/web/gui2-topo-lib/lib/gui2-topo-lib.module.ts b/web/gui2-topo-lib/lib/gui2-topo-lib.module.ts
index 26afcc3..70e2628 100644
--- a/web/gui2-topo-lib/lib/gui2-topo-lib.module.ts
+++ b/web/gui2-topo-lib/lib/gui2-topo-lib.module.ts
@@ -22,7 +22,7 @@
 import { SummaryComponent } from './panel/summary/summary.component';
 import { ToolbarComponent } from './panel/toolbar/toolbar.component';
 import { DetailsComponent } from './panel/details/details.component';
-import { Gui2FwLibModule } from '../../gui2-fw-lib/public_api';
+import { Gui2FwLibModule } from 'gui2-fw-lib/public_api';
 import { BackgroundSvgComponent } from './layer/backgroundsvg/backgroundsvg.component';
 import { ForceSvgComponent } from './layer/forcesvg/forcesvg.component';
 import { MapSvgComponent } from './layer/mapsvg/mapsvg.component';
diff --git a/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.spec.ts
index 1063017..1902505 100644
--- a/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.spec.ts
@@ -19,7 +19,7 @@
 import {MapSvgComponent, TopoData} from '../mapsvg/mapsvg.component';
 import {from} from 'rxjs';
 import {HttpClient} from '@angular/common/http';
-import {LocMeta, LogService, ZoomUtils} from '../../../gui2-fw-lib/public_api';
+import {LocMeta, LogService, ZoomUtils} from 'gui2-fw-lib/public_api';
 import {MapObject} from '../maputils';
 import {ForceSvgComponent} from '../forcesvg/forcesvg.component';
 
diff --git a/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.ts b/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.ts
index 1af98d6..f985cad 100644
--- a/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/backgroundsvg/backgroundsvg.component.ts
@@ -15,7 +15,7 @@
  */
 import {Component, EventEmitter, Input, Output} from '@angular/core';
 import {MapObject} from '../maputils';
-import {MapBounds, TopoZoomPrefs, LogService, ZoomUtils} from '../../../../gui2-fw-lib/public_api';
+import {MapBounds, TopoZoomPrefs, LogService, ZoomUtils} from 'gui2-fw-lib/public_api';
 
 /**
  * model of the topo2CurrentLayout attrs from BgZoom below
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.spec.ts
index bb7dfbf..a2015ef 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.spec.ts
@@ -16,7 +16,7 @@
 import { DraggableDirective } from './draggable.directive';
 import {inject, TestBed} from '@angular/core/testing';
 import {ElementRef} from '@angular/core';
-import {LogService} from '../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 
 export class MockElementRef extends ElementRef {
     nativeElement = {};
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.ts b/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.ts
index f476e46..c8c4643 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/draggable/draggable.directive.ts
@@ -22,7 +22,7 @@
 } from '@angular/core';
 import {ForceDirectedGraph, Node} from '../models';
 import * as d3 from 'd3';
-import {LogService, MetaUi, ZoomUtils} from '../../../../../gui2-fw-lib/public_api';
+import {LogService, MetaUi, ZoomUtils} from 'gui2-fw-lib/public_api';
 import {BackgroundSvgComponent} from '../../backgroundsvg/backgroundsvg.component';
 
 @Directive({
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.spec.ts
index 6ee354a..ce827e7 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.spec.ts
@@ -22,7 +22,7 @@
     LogService, SvgUtilService,
     UrlFnService,
     WebSocketService
-} from '../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {DraggableDirective} from './draggable/draggable.directive';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts b/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts
index ec3e57d..486bb86 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts
@@ -28,7 +28,7 @@
     SimpleChanges,
     ViewChildren
 } from '@angular/core';
-import {LocMeta, LogService, MetaUi, WebSocketService, ZoomUtils} from '../../../../gui2-fw-lib/public_api';
+import {LocMeta, LogService, MetaUi, WebSocketService, ZoomUtils} from 'gui2-fw-lib/public_api';
 import {
     Badge,
     Device, DeviceHighlight,
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.spec.ts
index 2fb9155..876cab5 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.spec.ts
@@ -16,7 +16,7 @@
 import {ForceDirectedGraph, Options} from './force-directed-graph';
 import {Node} from './node';
 import {Link} from './link';
-import {LogService} from '../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 import {TestBed} from '@angular/core/testing';
 
 export class TestNode extends Node {
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.ts b/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.ts
index 7bf44af..2f316cb 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/models/force-directed-graph.ts
@@ -17,7 +17,7 @@
 import { Link } from './link';
 import { Node } from './node';
 import * as d3 from 'd3-force';
-import {LogService} from '../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 
 const FORCES = {
     COLLISION: 1,
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/models/node.ts b/web/gui2-topo-lib/lib/layer/forcesvg/models/node.ts
index 5bcba8c..6a47ce3 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/models/node.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/models/node.ts
@@ -16,7 +16,7 @@
 import * as d3 from 'd3';
 import {LocationType} from '../../backgroundsvg/backgroundsvg.component';
 import {LayerType, Location, NodeType, RegionProps} from './regions';
-import {LocMeta, MetaUi, ZoomUtils} from '../../../../../gui2-fw-lib/public_api';
+import {LocMeta, MetaUi, ZoomUtils} from 'gui2-fw-lib/public_api';
 
 export interface UiElement {
     index?: number;
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.spec.ts
index deb175e..cd53c5f 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.spec.ts
@@ -16,7 +16,7 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { DeviceNodeSvgComponent } from './devicenodesvg.component';
-import {FnService, IconService, LogService, SvgUtilService} from '../../../../../../gui2-fw-lib/public_api';
+import {FnService, IconService, LogService, SvgUtilService} from 'gui2-fw-lib/public_api';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
 import {ChangeDetectorRef} from '@angular/core';
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.ts
index 2243e20..47791dd 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/devicenodesvg/devicenodesvg.component.ts
@@ -27,7 +27,7 @@
     Device,
     LabelToggle,
 } from '../../models';
-import {IconService, LogService, SvgUtilService} from '../../../../../../gui2-fw-lib/public_api';
+import {IconService, LogService, SvgUtilService} from 'gui2-fw-lib/public_api';
 import {NodeVisual, SelectedEvent} from '../nodevisual';
 import {animate, state, style, transition, trigger} from '@angular/animations';
 import {TopologyService} from '../../../../topology.service';
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts
index cf697bb..1929204 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts
@@ -18,7 +18,7 @@
 import { HostNodeSvgComponent } from './hostnodesvg.component';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
-import {LogService} from '../../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 import {Host} from '../../models';
 import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
 import {ChangeDetectorRef} from '@angular/core';
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.ts
index decd099..e6febb6 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.ts
@@ -22,7 +22,7 @@
     SimpleChanges
 } from '@angular/core';
 import {Badge, Host, HostLabelToggle, Node} from '../../models';
-import {LogService} from '../../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 import {NodeVisual, SelectedEvent} from '../nodevisual';
 
 /**
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.spec.ts
index 6418fb4..11bc464 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.spec.ts
@@ -16,7 +16,7 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { LinkSvgComponent } from './linksvg.component';
-import {LogService} from '../../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
 import {Device, Link, RegionLink, LinkType} from '../../models';
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.ts
index 9997897..b691417 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/linksvg/linksvg.component.ts
@@ -19,7 +19,7 @@
     Input, OnChanges, Output, SimpleChanges,
 } from '@angular/core';
 import {Link, LinkHighlight, UiElement} from '../../models';
-import {LogService} from '../../../../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 import {NodeVisual, SelectedEvent} from '../nodevisual';
 import {animate, state, style, transition, trigger} from '@angular/animations';
 
diff --git a/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.spec.ts
index 454aad0..b2cca6f 100644
--- a/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.spec.ts
@@ -18,7 +18,7 @@
 import { MapSvgComponent } from './mapsvg.component';
 import {HttpClient} from '@angular/common/http';
 import {from} from 'rxjs';
-import {LogService} from '../../../gui2-fw-lib/public_api';
+import {LogService} from 'gui2-fw-lib/public_api';
 
 class MockHttpClient {
     get() {
diff --git a/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.ts b/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.ts
index 993aebf..28ece5e 100644
--- a/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/mapsvg/mapsvg.component.ts
@@ -20,7 +20,7 @@
     SimpleChanges
 } from '@angular/core';
 import { MapObject } from '../maputils';
-import {LogService, MapBounds} from '../../../../gui2-fw-lib/public_api';
+import {LogService, MapBounds} from 'gui2-fw-lib/public_api';
 import {HttpClient} from '@angular/common/http';
 import * as d3 from 'd3';
 import * as topojson from 'topojson-client';
diff --git a/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.spec.ts
index 218f063..494bed5 100644
--- a/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.spec.ts
@@ -27,7 +27,7 @@
     TableFilterPipe,
     IconComponent,
     WebSocketService, SvgUtilService, PrefsService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import { of } from 'rxjs';
 
 class MockActivatedRoute extends ActivatedRoute {
diff --git a/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.ts b/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.ts
index 84965fa..24e3af1 100644
--- a/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/nodeviceconnectedsvg/nodeviceconnectedsvg.component.ts
@@ -27,7 +27,7 @@
     LogService,
     PrefsService,
     SvgUtilService, LionService, ZoomUtils, TopoZoomPrefs
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 /**
  * ONOS GUI -- Topology No Connected Devices View.
diff --git a/web/gui2-topo-lib/lib/layer/viewcontroller.ts b/web/gui2-topo-lib/lib/layer/viewcontroller.ts
index e6568ed..8f4bac6 100644
--- a/web/gui2-topo-lib/lib/layer/viewcontroller.ts
+++ b/web/gui2-topo-lib/lib/layer/viewcontroller.ts
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { FnService, LogService, PrefsService } from '../../../gui2-fw-lib/public_api';
+import { FnService, LogService, PrefsService } from 'gui2-fw-lib/public_api';
 
 export interface ViewControllerPrefs {
     visible: string;
diff --git a/web/gui2-topo-lib/lib/layout.service.spec.ts b/web/gui2-topo-lib/lib/layout.service.spec.ts
index 2f8483f..943404e 100644
--- a/web/gui2-topo-lib/lib/layout.service.spec.ts
+++ b/web/gui2-topo-lib/lib/layout.service.spec.ts
@@ -18,7 +18,7 @@
 import { LayoutService } from './layout.service';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
-import {FnService, LogService} from '../../gui2-fw-lib/public_api';
+import {FnService, LogService} from 'gui2-fw-lib/public_api';
 
 class MockActivatedRoute extends ActivatedRoute {
     constructor(params: Params) {
diff --git a/web/gui2-topo-lib/lib/layout.service.ts b/web/gui2-topo-lib/lib/layout.service.ts
index 39844c54..f3d5c52e 100644
--- a/web/gui2-topo-lib/lib/layout.service.ts
+++ b/web/gui2-topo-lib/lib/layout.service.ts
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 import { Injectable } from '@angular/core';
-import {LogService, WebSocketService} from '../../gui2-fw-lib/public_api';
+import {LogService, WebSocketService} from 'gui2-fw-lib/public_api';
 
 export enum LayoutType {
     LAYOUT_DEFAULT = 'default',
diff --git a/web/gui2-topo-lib/lib/panel/details/details.component.spec.ts b/web/gui2-topo-lib/lib/panel/details/details.component.spec.ts
index 0648c46..e1db5fd 100644
--- a/web/gui2-topo-lib/lib/panel/details/details.component.spec.ts
+++ b/web/gui2-topo-lib/lib/panel/details/details.component.spec.ts
@@ -22,7 +22,7 @@
 import {
     FnService, LionService,
     LogService, IconComponent
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {RouterTestingModule} from '@angular/router/testing';
 
 class MockActivatedRoute extends ActivatedRoute {
diff --git a/web/gui2-topo-lib/lib/panel/details/details.component.ts b/web/gui2-topo-lib/lib/panel/details/details.component.ts
index a0a2837..ce2116b 100644
--- a/web/gui2-topo-lib/lib/panel/details/details.component.ts
+++ b/web/gui2-topo-lib/lib/panel/details/details.component.ts
@@ -15,7 +15,7 @@
  */
 import {Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';
 import {animate, state, style, transition, trigger} from '@angular/animations';
-import {DetailsPanelBaseImpl, FnService, LionService, LogService, WebSocketService} from '../../../../gui2-fw-lib/public_api';
+import {DetailsPanelBaseImpl, FnService, LionService, LogService, WebSocketService} from 'gui2-fw-lib/public_api';
 import {Host, Link, LinkType, NodeType, UiElement} from '../../layer/forcesvg/models';
 import {Params, Router} from '@angular/router';
 
diff --git a/web/gui2-topo-lib/lib/panel/instance/instance.component.spec.ts b/web/gui2-topo-lib/lib/panel/instance/instance.component.spec.ts
index 6b06753..b53adfe 100644
--- a/web/gui2-topo-lib/lib/panel/instance/instance.component.spec.ts
+++ b/web/gui2-topo-lib/lib/panel/instance/instance.component.spec.ts
@@ -22,7 +22,7 @@
 import {
     FnService,
     LogService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 class MockActivatedRoute extends ActivatedRoute {
     constructor(params: Params) {
diff --git a/web/gui2-topo-lib/lib/panel/instance/instance.component.ts b/web/gui2-topo-lib/lib/panel/instance/instance.component.ts
index 53ecf12..4fe97ba 100644
--- a/web/gui2-topo-lib/lib/panel/instance/instance.component.ts
+++ b/web/gui2-topo-lib/lib/panel/instance/instance.component.ts
@@ -26,7 +26,7 @@
     PanelBaseImpl,
     IconService,
     SvgUtilService, LionService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 /**
  * A model of instance information that drives each panel
diff --git a/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.spec.ts b/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.spec.ts
index 3a30421..72caea7 100644
--- a/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.spec.ts
+++ b/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.spec.ts
@@ -19,7 +19,7 @@
 import {FormsModule, ReactiveFormsModule} from '@angular/forms';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
-import {FnService, LogService} from '../../../../gui2-fw-lib/public_api';
+import {FnService, LogService} from 'gui2-fw-lib/public_api';
 
 class MockActivatedRoute extends ActivatedRoute {
     constructor(params: Params) {
diff --git a/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.ts b/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.ts
index e9cb56a..1b1b938 100644
--- a/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.ts
+++ b/web/gui2-topo-lib/lib/panel/mapselector/mapselector.component.ts
@@ -10,7 +10,7 @@
     LionService,
     LogService,
     WebSocketService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {FormControl, FormGroup} from '@angular/forms';
 import { MapObject } from '../../layer/maputils';
 
diff --git a/web/gui2-topo-lib/lib/panel/summary/summary.component.spec.ts b/web/gui2-topo-lib/lib/panel/summary/summary.component.spec.ts
index 0a07d2e..e26ea2a 100644
--- a/web/gui2-topo-lib/lib/panel/summary/summary.component.spec.ts
+++ b/web/gui2-topo-lib/lib/panel/summary/summary.component.spec.ts
@@ -22,7 +22,7 @@
 import {
     FnService,
     LogService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 class MockActivatedRoute extends ActivatedRoute {
     constructor(params: Params) {
diff --git a/web/gui2-topo-lib/lib/panel/summary/summary.component.ts b/web/gui2-topo-lib/lib/panel/summary/summary.component.ts
index 0191cd9..0eede5b 100644
--- a/web/gui2-topo-lib/lib/panel/summary/summary.component.ts
+++ b/web/gui2-topo-lib/lib/panel/summary/summary.component.ts
@@ -28,7 +28,7 @@
     FnService,
     WebSocketService,
     GlyphService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 export interface SummaryResponse {
     title: string;
diff --git a/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.spec.ts b/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.spec.ts
index b1dff0b..79a4c6d 100644
--- a/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.spec.ts
+++ b/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.spec.ts
@@ -21,7 +21,7 @@
 import {
     FnService, LionService,
     LogService, IconComponent
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
 
 class MockActivatedRoute extends ActivatedRoute {
diff --git a/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.ts b/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.ts
index 725cbb1..d53720e 100644
--- a/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.ts
+++ b/web/gui2-topo-lib/lib/panel/toolbar/toolbar.component.ts
@@ -18,7 +18,7 @@
     LogService,
     FnService,
     PanelBaseImpl, LionService
-} from '../../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 import {animate, state, style, transition, trigger} from '@angular/animations';
 
diff --git a/web/gui2-topo-lib/lib/panel/topopanel.base.ts b/web/gui2-topo-lib/lib/panel/topopanel.base.ts
index bea8f58..3915c24 100644
--- a/web/gui2-topo-lib/lib/panel/topopanel.base.ts
+++ b/web/gui2-topo-lib/lib/panel/topopanel.base.ts
@@ -17,7 +17,7 @@
     FnService,
     LogService,
     PanelBaseImpl
-} from '../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 /**
  * Base model of panel view - implemented by Topology Panel components
diff --git a/web/gui2-topo-lib/lib/topology.service.spec.ts b/web/gui2-topo-lib/lib/topology.service.spec.ts
index a7c8463..72832de 100644
--- a/web/gui2-topo-lib/lib/topology.service.spec.ts
+++ b/web/gui2-topo-lib/lib/topology.service.spec.ts
@@ -21,7 +21,7 @@
 import {
     LogService,
     FnService
-} from '../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 
 class MockActivatedRoute extends ActivatedRoute {
     constructor(params: Params) {
diff --git a/web/gui2-topo-lib/lib/topology.service.ts b/web/gui2-topo-lib/lib/topology.service.ts
index 693a29a..c2beae7 100644
--- a/web/gui2-topo-lib/lib/topology.service.ts
+++ b/web/gui2-topo-lib/lib/topology.service.ts
@@ -16,7 +16,7 @@
 import {Injectable, SimpleChange} from '@angular/core';
 import {
     LogService, WebSocketService,
-} from '../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {Instance, InstanceComponent} from './panel/instance/instance.component';
 import { BackgroundSvgComponent } from './layer/backgroundsvg/backgroundsvg.component';
 import { ForceSvgComponent } from './layer/forcesvg/forcesvg.component';
diff --git a/web/gui2-topo-lib/lib/topology/topology.component.spec.ts b/web/gui2-topo-lib/lib/topology/topology.component.spec.ts
index 0ef9c5b..af96483 100644
--- a/web/gui2-topo-lib/lib/topology/topology.component.spec.ts
+++ b/web/gui2-topo-lib/lib/topology/topology.component.spec.ts
@@ -35,7 +35,7 @@
     FnService,
     LogService,
     IconService, IconComponent, PrefsService, KeysService, LionService, ZoomableDirective
-} from '../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {RouterTestingModule} from '@angular/router/testing';
 import {TrafficService} from '../traffic.service';
 import {ForceSvgComponent} from '../layer/forcesvg/forcesvg.component';
diff --git a/web/gui2-topo-lib/lib/topology/topology.component.ts b/web/gui2-topo-lib/lib/topology/topology.component.ts
index 601cfb1..0a3ae5a 100644
--- a/web/gui2-topo-lib/lib/topology/topology.component.ts
+++ b/web/gui2-topo-lib/lib/topology/topology.component.ts
@@ -33,7 +33,7 @@
     TopoZoomPrefs,
     WebSocketService,
     ZoomUtils
-} from '../../../gui2-fw-lib/public_api';
+} from 'gui2-fw-lib/public_api';
 import {InstanceComponent} from '../panel/instance/instance.component';
 import {DetailsComponent} from '../panel/details/details.component';
 import {BackgroundSvgComponent} from '../layer/backgroundsvg/backgroundsvg.component';
@@ -67,7 +67,7 @@
     ALARMS_TOGGLE
 } from '../panel/toolbar/toolbar.component';
 import {TrafficService, TrafficType} from '../traffic.service';
-import {ZoomableDirective} from '../../../gui2-fw-lib/public_api';
+import {ZoomableDirective} from 'gui2-fw-lib/public_api';
 import {MapObject} from '../layer/maputils';
 import {LayoutService, LayoutType} from '../layout.service';
 import {SelectedEvent} from '../layer/forcesvg/visuals/nodevisual';
diff --git a/web/gui2-topo-lib/lib/traffic.service.spec.ts b/web/gui2-topo-lib/lib/traffic.service.spec.ts
index 49ff94a..e15f8a5 100644
--- a/web/gui2-topo-lib/lib/traffic.service.spec.ts
+++ b/web/gui2-topo-lib/lib/traffic.service.spec.ts
@@ -16,7 +16,7 @@
 import { TestBed } from '@angular/core/testing';
 
 import { TrafficService } from './traffic.service';
-import {FnService, LogService} from '../../gui2-fw-lib/public_api';
+import {FnService, LogService} from 'gui2-fw-lib/public_api';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
 
diff --git a/web/gui2-topo-lib/lib/traffic.service.ts b/web/gui2-topo-lib/lib/traffic.service.ts
index cd23209..8cc6070 100644
--- a/web/gui2-topo-lib/lib/traffic.service.ts
+++ b/web/gui2-topo-lib/lib/traffic.service.ts
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 import { Injectable } from '@angular/core';
-import {LogService, WebSocketService} from '../../gui2-fw-lib/public_api';
+import {LogService, WebSocketService} from 'gui2-fw-lib/public_api';
 import {ForceSvgComponent} from './layer/forcesvg/forcesvg.component';
 
 export namespace TrafficType {
diff --git a/web/gui2-topo-lib/test.ts b/web/gui2-topo-lib/test.ts
deleted file mode 100644
index f626203..0000000
--- a/web/gui2-topo-lib/test.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2019-present Open Networking 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.
- */
-
-// This file is required by karma.conf.js and loads recursively all the .spec and framework files
-
-import 'core-js/es7/reflect';
-import 'zone.js/dist/zone';
-import 'zone.js/dist/zone-testing';
-import { getTestBed } from '@angular/core/testing';
-import {
-  BrowserDynamicTestingModule,
-  platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
-
-declare const require: any;
-
-// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(
-  BrowserDynamicTestingModule,
-  platformBrowserDynamicTesting()
-);
-// Then we find all the tests.
-const context = require.context('./', true, /\.spec\.ts$/);
-// And load the modules.
-context.keys().map(context);