| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you 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. |
| # |
| --- |
| # 1. Start an nginx |
| # 2. Test it is running |
| # 3. Stop it |
| # 4. Test it stopped |
| # Note there are two alternative forms to look up target - either just provide the 'targetId' to do an implicit DSL lookup, |
| # or look it up with explicit DSL and provide it as 'target'. |
| name: NGINX Test |
| location: localhost |
| services: |
| - type: org.apache.brooklyn.test.framework.TestCase |
| name: Stop Test |
| brooklyn.children: |
| - type: org.apache.brooklyn.entity.proxy.nginx.NginxController |
| id: nginx1 |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| target: $brooklyn:component("nginx1") |
| sensor: service.isUp |
| assert: |
| - equals: true |
| timeout: 5m |
| - type: org.apache.brooklyn.test.framework.TestEffector |
| target: $brooklyn:component("nginx1") |
| effector: stop |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| target: $brooklyn:component("nginx1") |
| sensor: service.isUp |
| assert: |
| - equals: false |
| ... |
| |
| --- |
| name: NGINX Test |
| location: localhost |
| services: |
| - type: org.apache.brooklyn.test.framework.TestCase |
| name: Stop Test |
| targetId: nginx1 |
| brooklyn.children: |
| - type: org.apache.brooklyn.entity.proxy.nginx.NginxController |
| id: nginx1 |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| sensor: service.isUp |
| assert: |
| - equals: true |
| timeout: 5m |
| - type: org.apache.brooklyn.test.framework.TestEffector |
| effector: stop |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| sensor: service.isUp |
| assert: |
| - equals: false |
| |
| |
| |
| --- |
| name: NGINX Test |
| location: localhost |
| services: |
| - type: org.apache.brooklyn.test.framework.TestCase |
| name: Stop Test |
| brooklyn.children: |
| - type: org.apache.brooklyn.entity.proxy.nginx.NginxController |
| id: nginx1 |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| target: $brooklyn:component("nginx1") |
| sensor: service.isUp |
| timeout: 5m |
| assert: |
| - equals: true |
| - type: org.apache.brooklyn.test.framework.TestEffector |
| target: $brooklyn:component("nginx1") |
| effector: stop |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| target: $brooklyn:component("nginx1") |
| sensor: service.isUp |
| assert: |
| - isEqualTo: false |
| - matches: .* |
| ... |
| |
| --- |
| name: NGINX Test |
| location: localhost |
| services: |
| - type: org.apache.brooklyn.entity.proxy.nginx.NginxController |
| id: nginx1 |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| target: $brooklyn:component("nginx1") |
| sensor: service.isUp |
| timeout: 5m |
| assert: |
| - equals: true |
| - type: org.apache.brooklyn.test.framework.TestSensor |
| name: Test Regex |
| target: $brooklyn:component("nginx1") |
| sensor: service.isUp |
| timeout: 5m |
| assert: |
| - matches: .* |
| ... |