• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript applicationModel.builder.ApplicationModelBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中core/application/applicationModel.builder.ApplicationModelBuilder的典型用法代码示例。如果您正苦于以下问题:TypeScript builder.ApplicationModelBuilder类的具体用法?TypeScript builder.ApplicationModelBuilder怎么用?TypeScript builder.ApplicationModelBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了builder.ApplicationModelBuilder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('gets all accounts, then adds wildcard and regions per account to vm', () => {
      const accounts: any = [
        { name: 'prod', regions: [{ name: 'us-east-1' }, { name: 'us-west-1' }] },
        { name: 'test', regions: [{ name: 'us-west-2' }, { name: 'eu-west-1' }] },
      ];

      spyOn(AccountService, 'listAllAccounts').and.returnValue($q.when(accounts));

      initializeController(null);
      $ctrl.application = ApplicationModelBuilder.createApplicationForTests('app', {
        key: 'serverGroups',
        loader: () => $q.resolve([]),
        onLoad: (_app, data) => $q.resolve(data),
      });
      $ctrl.application.serverGroups.refresh();
      $scope.$digest();

      $ctrl.config = new ChaosMonkeyConfig($ctrl.application.attributes.chaosMonkey || {});

      $ctrl.$onInit();
      $scope.$digest();

      expect($ctrl.accounts).toEqual([accounts[0], accounts[1]]);
      expect($ctrl.regionsByAccount).toEqual({
        prod: ['*', 'us-east-1', 'us-west-1'],
        test: ['*', 'us-west-2', 'eu-west-1'],
      });
    });
开发者ID:emjburns,项目名称:deck,代码行数:28,代码来源:chaosMonkeyExceptions.component.spec.ts


示例2:

 (
   $controller: ng.IControllerService,
   $rootScope: ng.IRootScopeService,
   _$q_: IQService,
   applicationModelBuilder: ApplicationModelBuilder,
 ) => {
   application = applicationModelBuilder.createStandaloneApplication('app');
   $scope = $rootScope.$new();
   $q = _$q_;
   ctrl = $controller('ConfigurePipelineTemplateModalCtrl', {
     $scope,
     application,
     $uibModalInstance: { close: $q.resolve(null) },
     pipelineTemplateConfig: {
       config: {
         pipeline: {
           name: 'My Managed Pipeline',
           template: {
             source: 'spinnaker://myPipelineId',
           },
         },
       },
     },
     pipelineId: '1234',
     executionId: null,
     isNew: true,
   }) as ConfigurePipelineTemplateModalController;
 },
开发者ID:mizzy,项目名称:deck,代码行数:28,代码来源:configurePipelineTemplateModal.controller.spec.ts


示例3: configureApplication

 function configureApplication() {
   ApplicationDataSourceRegistry.registerDataSource({ key: 'serverGroups' });
   application = ApplicationModelBuilder.createApplicationForTests(
     'app',
     ...ApplicationDataSourceRegistry.getDataSources(),
   );
   application.refresh();
   $scope.$digest();
 }
开发者ID:emjburns,项目名称:deck,代码行数:9,代码来源:pipeline.dataSource.spec.ts


示例4: it

  it('adds security group names across accounts, falling back to the ID if none found', function () {
    let details: ISecurityGroupDetail = null;
    const application: Application = applicationModelBuilder.createApplication('app');
    application['securityGroupsIndex'] = {
      test: {'us-east-1': {'sg-2': {name: 'matched'}}},
      prod: {'us-east-1': {'sg-2': {name: 'matched-prod'}}}
    };

    $http.expectGET(`${API.baseUrl}/securityGroups/test/us-east-1/sg-123?provider=aws&vpcId=vpc-1`).respond(200, {
      inboundRules: [
        {securityGroup: {accountName: 'test', id: 'sg-345'}},
        {securityGroup: {accountName: 'test', id: 'sg-2'}},
        {securityGroup: {accountName: 'prod', id: 'sg-2'}},
      ],
      region: 'us-east-1',
    });

    reader.getSecurityGroupDetails(application, 'test', 'aws', 'us-east-1', 'vpc-1', 'sg-123').then(
      (result) => details = result);
    $http.flush();

    expect(details.securityGroupRules.length).toBe(3);
    expect(details.securityGroupRules[0].securityGroup.name).toBe('sg-345');
    expect(details.securityGroupRules[0].securityGroup.inferredName).toBe(true);
    expect(details.securityGroupRules[1].securityGroup.name).toBe('matched');
    expect(details.securityGroupRules[1].securityGroup.inferredName).toBeFalsy();
    expect(details.securityGroupRules[2].securityGroup.name).toBe('matched-prod');
    expect(details.securityGroupRules[2].securityGroup.inferredName).toBeFalsy();
  });
开发者ID:jcwest,项目名称:deck,代码行数:29,代码来源:securityGroupReader.service.spec.ts


示例5: it

    it('limits executions per pipeline', function () {
      const application: Application = modelBuilder.createApplication({key: 'executions', lazy: true}, {key: 'pipelineConfigs', lazy: true});
      application.getDataSource('executions').data = [
        { pipelineConfigId: '1', name: 'pipeline 1', endTime: 1, stages: [] },
        { pipelineConfigId: '1', name: 'pipeline 1', endTime: 2, stages: [] },
        { pipelineConfigId: '1', name: 'pipeline 1', endTime: 3, stages: [] },
        { pipelineConfigId: '2', name: 'pipeline 2', endTime: 1, stages: [] },
      ];
      application.getDataSource('pipelineConfigs').data = [
        { name: 'pipeline 1', pipelineConfigId: '1' },
        { name: 'pipeline 2', pipelineConfigId: '2' },
      ];

      model.sortFilter.count = 2;
      model.sortFilter.groupBy = 'none';

      service.updateExecutionGroups(application);
      $timeout.flush();

      expect(model.groups.length).toBe(1);
      expect(model.groups[0].executions.length).toBe(3);
      expect(model.groups[0].executions.filter((ex: IExecution) => ex.pipelineConfigId === '1').length).toBe(2);
      expect(model.groups[0].executions.filter((ex: IExecution) => ex.pipelineConfigId === '2').length).toBe(1);

      model.sortFilter.groupBy = 'name';
      service.updateExecutionGroups(application);
      $timeout.flush();

      expect(model.groups.length).toBe(2);
      expect(model.groups[0].executions.length).toBe(2);
      expect(model.groups[1].executions.length).toBe(1);

    });
开发者ID:brujoand,项目名称:deck,代码行数:33,代码来源:executionFilter.service.spec.ts


示例6: it

    it('sets error when task fails while polling', () => {
      let completeCalled = false;
      const task = { id: 'a', status: 'RUNNING' } as ITask;
      OrchestratedItemTransformer.defineProperties(task);

      const operation = () => $q.when(task);
      const monitor = new TaskMonitor({
        application: applicationModelBuilder.createApplication('app', { key: 'runningTasks', lazy: true }),
        title: 'a task',
        modalInstance: { result: $q.defer().promise } as IModalServiceInstance,
        onTaskComplete: () => (completeCalled = true),
      });

      monitor.submit(operation);

      expect(monitor.submitting).toBe(true);
      expect(monitor.error).toBe(false);

      $timeout.flush(); // still running first time

      $http.expectGET([API.baseUrl, 'tasks', 'a'].join('/')).respond(200, { status: 'RUNNING' });
      $timeout.flush();
      $http.flush();
      expect(monitor.task.isCompleted).toBe(false);

      $http.expectGET([API.baseUrl, 'tasks', 'a'].join('/')).respond(200, { status: 'TERMINAL' });
      $timeout.flush(); // complete second time
      $http.flush();

      expect(monitor.submitting).toBe(false);
      expect(monitor.error).toBe(true);
      expect(monitor.errorMessage).toBe('There was an unknown server error.');
      expect(completeCalled).toBe(false);
    });
开发者ID:mizzy,项目名称:deck,代码行数:34,代码来源:taskMonitor.spec.ts


示例7: beforeEach

 beforeEach(() => {
   application = applicationModelBuilder.createApplication(
     'app',
     {
       key: 'optionalSource',
       optional: true,
       visible: true,
     },
     {
       key: 'invisibleSource',
       visible: false,
     },
     {
       key: 'requiredSource',
       visible: true,
     },
     {
       key: 'optInSource',
       optional: true,
       visible: true,
       optIn: true,
       disabled: true,
     },
   );
   application.attributes = { accounts: ['test'] };
 });
开发者ID:mizzy,项目名称:deck,代码行数:26,代码来源:applicationDataSourceEditor.component.spec.ts


示例8:

 this.buildApplication = (json: any) => {
   const app = applicationModelBuilder.createApplication('app', { key: 'serverGroups', lazy: true });
   if (json.serverGroups) {
     app.getDataSource('serverGroups').data = _.cloneDeep(json.serverGroups.data);
   }
   if (json.clusters) {
     app.clusters = json.clusters;
   }
   return app;
 };
开发者ID:mizzy,项目名称:deck,代码行数:10,代码来源:ClusterFilterService.spec.ts


示例9: beforeEach

 beforeEach(() => {
   const application: Application = applicationModelBuilder.createApplication(
     'app',
     ApplicationDataSourceRegistry.getDataSources(),
   );
   command = {
     viewState: {
       mode: 'create',
     },
     application: application.name,
   } as IServerGroupCommand;
 });
开发者ID:mizzy,项目名称:deck,代码行数:12,代码来源:serverGroupWriter.service.spec.ts



注:本文中的core/application/applicationModel.builder.ApplicationModelBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap