当前位置: 首页>>代码示例>>Java>>正文


Java ScopedSettingKey类代码示例

本文整理汇总了Java中org.oscm.app.domain.ConfigurationSetting.ScopedSettingKey的典型用法代码示例。如果您正苦于以下问题:Java ScopedSettingKey类的具体用法?Java ScopedSettingKey怎么用?Java ScopedSettingKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScopedSettingKey类属于org.oscm.app.domain.ConfigurationSetting包,在下文中一共展示了ScopedSettingKey类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testEqualsSettings

import org.oscm.app.domain.ConfigurationSetting.ScopedSettingKey; //导入依赖的package包/类
@Test
public void testEqualsSettings() throws Exception {
    ScopedSettingKey key = new ConfigurationSetting.ScopedSettingKey();
    ScopedSettingKey key_a = new ConfigurationSetting.ScopedSettingKey();
    assertFalse(key == null);
    assertTrue(key.equals(key));
    assertTrue(key.equals(key_a));
    assertFalse(key.equals("Hello"));
    assertTrue(key.hashCode() == key.hashCode());

    ScopedSettingKey key_ab1 = new ConfigurationSetting.ScopedSettingKey(
            "a", "b");
    ScopedSettingKey key_ab2 = new ConfigurationSetting.ScopedSettingKey(
            "a", "b");
    ScopedSettingKey key_ba1 = new ConfigurationSetting.ScopedSettingKey(
            "b", "a");
    assertTrue(key_ab1.equals(key_ab2));
    assertTrue(key_ab1.hashCode() == key_ab2.hashCode());

    assertFalse(key_ab1.equals(key_ba1));
    assertFalse(key_ab1.hashCode() == key_ba1.hashCode());

    ScopedSettingKey key_an1 = new ConfigurationSetting.ScopedSettingKey(
            "a", null);
    ScopedSettingKey key_an2 = new ConfigurationSetting.ScopedSettingKey(
            "a", null);
    ScopedSettingKey key_na1 = new ConfigurationSetting.ScopedSettingKey(
            null, "a");
    ScopedSettingKey key_na2 = new ConfigurationSetting.ScopedSettingKey(
            null, "a");
    ScopedSettingKey key_bn1 = new ConfigurationSetting.ScopedSettingKey(
            "b", null);
    ScopedSettingKey key_nb1 = new ConfigurationSetting.ScopedSettingKey(
            null, "b");
    assertEquals(key_an1, key_an2);
    assertEquals(key_na1, key_na2);
    assertFalse(key_an1.equals(key_bn1));
    assertFalse(key_na1.equals(key_nb1));
    assertFalse(key_an1.equals(key_ab1));
    assertFalse(key_nb1.equals(key_ab1));
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:42,代码来源:ScopedSettingKeyTest.java

示例2: testEqualsAttributes

import org.oscm.app.domain.ConfigurationSetting.ScopedSettingKey; //导入依赖的package包/类
@Test
public void testEqualsAttributes() throws Exception {
    CustomAttribute.ScopedSettingKey key = new CustomAttribute.ScopedSettingKey();
    CustomAttribute.ScopedSettingKey key_a = new CustomAttribute.ScopedSettingKey();
    assertFalse(key == null);
    assertTrue(key.equals(key));
    assertTrue(key.equals(key_a));
    assertFalse(key.equals("Hello"));
    assertTrue(key.hashCode() == key.hashCode());

    CustomAttribute.ScopedSettingKey key_ab1 = new CustomAttribute.ScopedSettingKey(
            "a", "b");
    CustomAttribute.ScopedSettingKey key_ab2 = new CustomAttribute.ScopedSettingKey(
            "a", "b");
    CustomAttribute.ScopedSettingKey key_ba1 = new CustomAttribute.ScopedSettingKey(
            "b", "a");
    assertTrue(key_ab1.equals(key_ab2));
    assertTrue(key_ab1.hashCode() == key_ab2.hashCode());

    assertFalse(key_ab1.equals(key_ba1));
    assertFalse(key_ab1.hashCode() == key_ba1.hashCode());

    CustomAttribute.ScopedSettingKey key_an1 = new CustomAttribute.ScopedSettingKey(
            "a", null);
    CustomAttribute.ScopedSettingKey key_an2 = new CustomAttribute.ScopedSettingKey(
            "a", null);
    CustomAttribute.ScopedSettingKey key_na1 = new CustomAttribute.ScopedSettingKey(
            null, "a");
    CustomAttribute.ScopedSettingKey key_na2 = new CustomAttribute.ScopedSettingKey(
            null, "a");
    CustomAttribute.ScopedSettingKey key_bn1 = new CustomAttribute.ScopedSettingKey(
            "b", null);
    CustomAttribute.ScopedSettingKey key_nb1 = new CustomAttribute.ScopedSettingKey(
            null, "b");
    assertEquals(key_an1, key_an2);
    assertEquals(key_na1, key_na2);
    assertFalse(key_an1.equals(key_bn1));
    assertFalse(key_na1.equals(key_nb1));
    assertFalse(key_an1.equals(key_ab1));
    assertFalse(key_nb1.equals(key_ab1));
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:42,代码来源:ScopedSettingKeyTest.java


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