本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例6: equality
import com.google.common.testing.EqualsTester; //导入方法依赖的package包/类
@Test
public void equality() {
EqualsTester tester = new EqualsTester();
tester.addEqualityGroup(makeRequest(), makeRequest());
tester.testEquals();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例13: equality
import com.google.common.testing.EqualsTester; //导入方法依赖的package包/类
@Test
public void equality() {
EqualsTester tester = new EqualsTester();
tester.addEqualityGroup(registeredAgent(), registeredAgent());
tester.testEquals();
}
示例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();
}
示例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();
}