當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript builder.ApplicationModelBuilder.createApplication方法代碼示例

本文整理匯總了TypeScript中core/application/applicationModel.builder.ApplicationModelBuilder.createApplication方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript builder.ApplicationModelBuilder.createApplication方法的具體用法?TypeScript builder.ApplicationModelBuilder.createApplication怎麽用?TypeScript builder.ApplicationModelBuilder.createApplication使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core/application/applicationModel.builder.ApplicationModelBuilder的用法示例。


在下文中一共展示了builder.ApplicationModelBuilder.createApplication方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

  beforeEach(mock.inject(($httpBackend: IHttpBackendService, _API_: Api, _clusterFilterModel_: ClusterFilterModel,
                          _clusterService_: ClusterService, applicationModelBuilder: ApplicationModelBuilder) => {
    $http = $httpBackend;
    API = _API_;
    clusterService = _clusterService_;
    clusterFilterModel = _clusterFilterModel_;

    application = applicationModelBuilder.createApplication(
      'app',
      {key: 'serverGroups'},
      {key: 'runningExecutions'},
      {key: 'runningTasks'}
    );
    application.getDataSource('serverGroups').data = [
        {name: 'the-target', account: 'not-the-target', region: 'us-east-1'},
        {name: 'the-target', account: 'test', region: 'not-the-target'},
        {name: 'the-target', account: 'test', region: 'us-east-1'},
        {name: 'not-the-target', account: 'test', region: 'us-east-1'},
        {name: 'the-source', account: 'test', region: 'us-east-1'}
      ];
  }));
開發者ID:jcwest,項目名稱:deck,代碼行數:21,代碼來源:cluster.service.spec.ts

示例2: beforeEach

  beforeEach(function() {
    app = modelBuilder.createApplication('app', { key: 'loadBalancers', lazy: true });
    app.getDataSource('loadBalancers').data = [
      {
        name: 'elb-1',
        region: 'us-east-1',
        account: 'test',
        vpcName: '',
        serverGroups: [],
        instanceCounts: { down: 0, starting: 0, outOfService: 0 },
        usages: {},
      },
      {
        name: 'elb-1',
        region: 'us-west-1',
        account: 'test',
        vpcName: 'main',
        serverGroups: [],
        instanceCounts: { down: 0, starting: 0, outOfService: 0 },
        usages: {},
      },
      {
        name: 'elb-2',
        region: 'us-east-1',
        account: 'prod',
        vpcName: '',
        serverGroups: [],
        instanceCounts: { down: 0, starting: 0, outOfService: 0 },
        usages: {},
      },
    ];

    resultJson = [
      { heading: 'us-east-1', loadBalancer: app.loadBalancers.data[0], serverGroups: [] },
      { heading: 'us-west-1', loadBalancer: app.loadBalancers.data[1], serverGroups: [] },
      { heading: 'us-east-1', loadBalancer: app.loadBalancers.data[2], serverGroups: [] },
    ];
    LoadBalancerState.filterModel.asFilterModel.clearFilters();
  });
開發者ID:mizzy,項目名稱:deck,代碼行數:39,代碼來源:LoadBalancerFilterService.spec.ts

示例3:

      (
        $httpBackend: IHttpBackendService,
        _clusterService_: ClusterService,
        applicationModelBuilder: ApplicationModelBuilder,
      ) => {
        $http = $httpBackend;
        clusterService = _clusterService_;

        application = applicationModelBuilder.createApplication(
          'app',
          { key: 'serverGroups' },
          { key: 'runningExecutions' },
          { key: 'runningTasks' },
        );
        application.getDataSource('serverGroups').data = [
          { name: 'the-target', account: 'not-the-target', region: 'us-east-1' },
          { name: 'the-target', account: 'test', region: 'not-the-target' },
          { name: 'the-target', account: 'test', region: 'us-east-1' },
          { name: 'not-the-target', account: 'test', region: 'us-east-1' },
          { name: 'the-source', account: 'test', region: 'us-east-1' },
        ];
      },
開發者ID:mizzy,項目名稱:deck,代碼行數:22,代碼來源:cluster.service.spec.ts

示例4: postTask

    function postTask(serverGroupCommand: IServerGroupCommand): ITaskCommand {
      let submitted: ITaskCommand = {};
      $httpBackend
        .expectPOST(`${API.baseUrl}/applications/app/tasks`, (body: string) => {
          submitted = JSON.parse(body) as ITaskCommand;
          return true;
        })
        .respond(200, { ref: '/1' });

      const application: TestApplication = applicationModelBuilder.createApplication(
        'app',
        ApplicationDataSourceRegistry.getDataSources(),
      ) as TestApplication;
      application.tasks = {
        refresh: noop,
      };

      $httpBackend.expectGET(API.baseUrl + '/tasks/1').respond({});
      serverGroupWriter.cloneServerGroup(serverGroupCommand, application);
      $httpBackend.flush();

      return submitted;
    }
開發者ID:mizzy,項目名稱:deck,代碼行數:23,代碼來源:serverGroupWriter.service.spec.ts

示例5: beforeEach

 beforeEach(mock.inject((serverGroupWarningMessageService: ServerGroupWarningMessageService,
                         _applicationModelBuilder_: ApplicationModelBuilder) => {
   service = serverGroupWarningMessageService;
   applicationModelBuilder = _applicationModelBuilder_;
   app = applicationModelBuilder.createApplication('app');
 }));
開發者ID:robfletcher,項目名稱:deck,代碼行數:6,代碼來源:serverGroupWarningMessage.service.spec.ts

示例6: configureApplication

 function configureApplication() {
   applicationDataSourceRegistry.registerDataSource({key: 'serverGroups'});
   application = applicationModelBuilder.createApplication(applicationDataSourceRegistry.getDataSources());
   application.refresh();
   $scope.$digest();
 }
開發者ID:brujoand,項目名稱:deck,代碼行數:6,代碼來源:delivery.dataSource.spec.ts

示例7:

 mock.inject((_applicationModelBuilder_: ApplicationModelBuilder) => {
   applicationModelBuilder = _applicationModelBuilder_;
   app = applicationModelBuilder.createApplication('app');
 }),
開發者ID:mizzy,項目名稱:deck,代碼行數:4,代碼來源:serverGroupWarningMessage.service.spec.ts


注:本文中的core/application/applicationModel.builder.ApplicationModelBuilder.createApplication方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。