Skip to content

Commit

Permalink
Merge pull request #3143 from beiwei30:prefix, fix prefix, use hypher…
Browse files Browse the repository at this point in the history
… case instead of camel case.
  • Loading branch information
beiwei30 authored and chickenlj committed Jan 6, 2019
1 parent de76413 commit 5c971c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private static String getTagName(Class<?> cls) {
break;
}
}
return tag.substring(0, 1).toLowerCase() + tag.substring(1);
return StringUtils.camelToSplitName(tag, "-");
}

protected static void appendParameters(Map<String, String> parameters, Object config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ private void checkProtocol() {
}
protocolConfig.refresh();
if (StringUtils.isNotEmpty(protocolConfig.getId())) {
protocolConfig.setPrefix("dubbo.protocols.");
protocolConfig.setPrefix(Constants.PROTOCOLS_SUFFIX);
protocolConfig.refresh();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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.dubbo.config;

import junit.framework.TestCase;
import org.junit.Test;

public class ConfigCenterConfigTest {
@Test
public void testPrefix() {
ConfigCenterConfig config = new ConfigCenterConfig();
TestCase.assertEquals("dubbo.config-center", config.getPrefix());
}
}

0 comments on commit 5c971c1

Please sign in to comment.