當前位置: 首頁>>代碼示例>>Java>>正文


Java EqualsTester.testEquals方法代碼示例

本文整理匯總了Java中com.google.common.testing.EqualsTester.testEquals方法的典型用法代碼示例。如果您正苦於以下問題:Java EqualsTester.testEquals方法的具體用法?Java EqualsTester.testEquals怎麽用?Java EqualsTester.testEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.testing.EqualsTester的用法示例。


在下文中一共展示了EqualsTester.testEquals方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testEquality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
/**
 * Tests the {@link Server#equals(Object)} and {@link Server#hashCode()} methods.
 */
@Test
public void testEquality() {
  EqualsTester tester = new EqualsTester();
  tester.addEqualityGroup(INSTANCE, INSTANCE, new Server(URL, TOKEN, SSL_VERIFY, SSL_CERTIFICATE, PATHS));
  tester.addEqualityGroup(new Server(UUID.randomUUID().toString(), TOKEN, SSL_VERIFY, SSL_CERTIFICATE, PATHS));
  tester.addEqualityGroup(new Server(URL, UUID.randomUUID().toString(), SSL_VERIFY, SSL_CERTIFICATE, PATHS));
  tester.addEqualityGroup(new Server(URL, TOKEN, !SSL_VERIFY, SSL_CERTIFICATE, PATHS));
  tester.addEqualityGroup(new Server(URL, TOKEN, SSL_VERIFY, new File("/dev/random"), PATHS));
  tester.addEqualityGroup(new Server(URL, TOKEN, SSL_VERIFY, SSL_CERTIFICATE, randomPaths(10, 10)));
  tester.testEquals();
}
 
開發者ID:DecipherNow,項目名稱:vault-maven-plugin,代碼行數:15,代碼來源:TestServer.java

示例2: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(metric(), createMetric());
    tester.addEqualityGroup(metric().hashCode(), metric().hashCode());
    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:8,代碼來源:MetricTest.java

示例3: testEquals

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
public void testEquals() {
  EqualsTester tester = new EqualsTester();
  for (Method method : ParameterTest.class.getDeclaredMethods()) {
    for (Parameter param : Invokable.from(method).getParameters()) {
      tester.addEqualityGroup(param);
    }
  }
  tester.testEquals();
}
 
開發者ID:paul-hammant,項目名稱:googles-monorepo-demo,代碼行數:10,代碼來源:ParameterTest.java

示例4: testEquality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
/**
 * Tests the {@link Path#equals(Object)} and {@link Path#hashCode()} methods.
 */
@Test
public void testEquality() {
  EqualsTester tester = new EqualsTester();
  tester.addEqualityGroup(INSTANCE, INSTANCE, new Path(NAME, MAPPINGS));
  tester.addEqualityGroup(new Path(NAME, ImmutableList.of()));
  tester.addEqualityGroup(new Path(UUID.randomUUID().toString(), MAPPINGS));
  tester.testEquals();
}
 
開發者ID:DecipherNow,項目名稱:vault-maven-plugin,代碼行數:12,代碼來源:TestPath.java

示例5: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(createEndpoint(), createEndpoint());
    tester.addEqualityGroup(createEndpoint().hashCode(), createEndpoint().hashCode());
    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:8,代碼來源:JMSEndpointTest.java

示例6: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(makeRequest(), makeRequest());

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:8,代碼來源:ActorCreationRequestTest.java

示例7: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester equalsTester = new EqualsTester();
    equalsTester.addEqualityGroup(DUMMY_CONFIG, configForActor(TestActor.class));
    equalsTester.addEqualityGroup(DUMMY_CONFIG.getDeployConfig(),
                                  configForActor(TestActor.class).getDeployConfig());
    equalsTester.addEqualityGroup(DUMMY_CONFIG.hashCode(), configForActor(TestActor.class).hashCode());
    equalsTester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:10,代碼來源:ActorConfigTest.java

示例8: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(ActorInputMessage.close(), ActorInputMessage.close());
    tester.addEqualityGroup(ActorInputMessage.bootstrap(), ActorInputMessage.bootstrap());
    tester.addEqualityGroup(ActorInputMessage.dumpMetrics(), ActorInputMessage.dumpMetrics());
    tester.addEqualityGroup(message(), message());

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:11,代碼來源:ActorInputMessageTest.java

示例9: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(createDeployConfig(), createDeployConfig());
    tester.addEqualityGroup(createDeployConfig().hashCode(), createDeployConfig().hashCode());
    tester.addEqualityGroup(new DeployConfig(false, Collections.emptyList(), Collections.emptyList()),
                            new DeployConfig(false, Collections.emptyList(), Collections.emptyList()));

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:11,代碼來源:DeployConfigTest.java

示例10: testEquality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
/**
 * Tests the {@link Mapping#equals(Object)} and {@link Mapping#hashCode()} methods.
 */
@Test
public void testEquality() {
  EqualsTester tester = new EqualsTester();
  tester.addEqualityGroup(INSTANCE, INSTANCE, new Mapping(KEY, PROPERTY));
  tester.addEqualityGroup(new Mapping(KEY, UUID.randomUUID().toString()));
  tester.addEqualityGroup(new Mapping(UUID.randomUUID().toString(), PROPERTY));
  tester.testEquals();
}
 
開發者ID:DecipherNow,項目名稱:vault-maven-plugin,代碼行數:12,代碼來源:TestMapping.java

示例11: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(deployInfo(), deployInfo());
    tester.addEqualityGroup(deployInfo().hashCode(), deployInfo().hashCode());
    tester.addEqualityGroup(deployInfo().getCommand(), command());

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:10,代碼來源:ActorDeployInfoTest.java

示例12: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(metricValues(3), metricValues(3));

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:8,代碼來源:MetricValuesMessageTest.java

示例13: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(registeredAgent(), registeredAgent());

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:8,代碼來源:RegisteredAgentTest.java

示例14: testEquals

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@GwtIncompatible // too slow
public void testEquals() {
  EqualsTester equalsTester = new EqualsTester();
  for (long a : TEST_LONGS) {
    BigInteger big =
        (a >= 0) ? BigInteger.valueOf(a) : BigInteger.valueOf(a).add(BigInteger.ZERO.setBit(64));
    equalsTester.addEqualityGroup(UnsignedLong.fromLongBits(a), UnsignedLong.valueOf(big),
        UnsignedLong.valueOf(big.toString()), UnsignedLong.valueOf(big.toString(16), 16));
  }
  equalsTester.testEquals();
}
 
開發者ID:paul-hammant,項目名稱:googles-monorepo-demo,代碼行數:12,代碼來源:UnsignedLongTest.java

示例15: equality

import com.google.common.testing.EqualsTester; //導入方法依賴的package包/類
@Test
public void equality() throws Exception {
    EqualsTester tester = new EqualsTester();
    tester.addEqualityGroup(jgroupsEndpoint(), jgroupsEndpoint());
    tester.addEqualityGroup(jgroupsEndpoint().hashCode(), jgroupsEndpoint().hashCode());

    tester.testEquals();
}
 
開發者ID:florentw,項目名稱:bench,代碼行數:9,代碼來源:JgroupsEndpointTest.java


注:本文中的com.google.common.testing.EqualsTester.testEquals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。