brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #411: Test change to coercion of default config...
Date Mon, 07 Nov 2016 12:22:22 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/411#discussion_r86764801
  
    --- Diff: camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigTypeCoercionYamlTest.java
---
    @@ -0,0 +1,77 @@
    +/*
    + * 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.
    + */
    +package org.apache.brooklyn.camp.brooklyn;
    +
    +import java.util.Map;
    +
    +import org.apache.brooklyn.api.entity.Entity;
    +import org.apache.brooklyn.test.Asserts;
    +import org.apache.brooklyn.util.core.internal.ssh.RecordingSshTool;
    +import org.apache.brooklyn.util.text.StringPredicates;
    +import org.apache.brooklyn.util.text.Strings;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +import org.testng.Assert;
    +import org.testng.annotations.BeforeMethod;
    +import org.testng.annotations.Test;
    +
    +public class ConfigTypeCoercionYamlTest extends AbstractYamlTest {
    +    private static final Logger log = LoggerFactory.getLogger(ConfigTypeCoercionYamlTest.class);
    +
    +    @BeforeMethod(alwaysRun=true)
    +    @Override
    +    public void setUp() throws Exception {
    +        super.setUp();
    +        RecordingSshTool.clear();
    +    }
    +    
    +    @Test
    +    public void testSshConfigFromDefault() throws Exception {
    +        RecordingSshTool.setCustomResponse(".*myCommand.*", new RecordingSshTool.CustomResponse(0,
"myResponse", null));
    +        
    +        String bp = loadYaml("config-type-coercion-test.yaml",
    +            "location:",
    +            "  localhost:",
    +            "    sshToolClass: "+RecordingSshTool.class.getName());
    +        // remove all lines referring to "exact" -- that's useful for expository and
running in UI
    +        // but it will fail (timeout) if the port isn't available so not good in tests
    +        bp = Strings.removeLines(bp, StringPredicates.containsLiteralIgnoreCase("exact"));
    --- End diff --
    
    agree


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message