/** * Sets two distinct values for {@code type}. These values can be used for both null pointer * testing and equals testing. * * @since 17.0 */ protected final <T> void setDistinctValues(Class<T> type, T value1, T value2) { tester.setDistinctValues(type, value1, value2); }
public void testSetDistinctValues_equalInstances() { try { tester.setDistinctValues(String.class, "", ""); fail(); } catch (IllegalArgumentException expected) { } }
private static ClassSanityTester.FactoryMethodReturnValueTester sanityTester() { return new ClassSanityTester() .setDefault(byte[].class, new byte[] {1, 2, 3, 4}) .setDistinctValues(byte[].class, new byte[] {1, 2, 3, 4}, new byte[] {5, 6, 7, 8}) .setDistinctValues(String.class, "7f8005ff0e", "7f8005ff0f") .forAllPublicStaticMethods(HashCode.class); }
@GwtIncompatible // reflection public void testEquals() throws Exception { new ClassSanityTester() .setDistinctValues(Class.class, Color.class, Gender.class) .setDistinctValues(Enum.class, Color.BLUE, Color.RED) .forAllPublicStaticMethods(EnumMultisetFactory.class) .testEquals(); }
public void testInstantiate_setDistinctValues() throws Exception { NotInstantiable x = new NotInstantiable(); NotInstantiable y = new NotInstantiable(); tester.setDistinctValues(NotInstantiable.class, x, y); assertNotNull(tester.instantiate(ConstructorParameterNotInstantiable.class)); tester.testEquals(ConstructorParameterMapOfNotInstantiable.class); }
/** * Sets two distinct values for {@code type}. These values can be used for both null pointer * testing and equals testing. * * @since 17.0 */ protected final <T> void setDistinctValues(Class<T> type, T value1, T value2) { tester.setDistinctValues(type, value1, value2); }
/** * Sets two distinct values for {@code type}. These values can be used for both null pointer * testing and equals testing. * * @since 17.0 */ protected final <T> void setDistinctValues(Class<T> type, T value1, T value2) { tester.setDistinctValues(type, value1, value2); }
public void testSetDistinctValues_equalInstances() { try { tester.setDistinctValues(String.class, "", ""); fail(); } catch (IllegalArgumentException expected) { } }
public void testSetDistinctValues_equalInstances() { try { tester.setDistinctValues(String.class, "", ""); fail(); } catch (IllegalArgumentException expected) {} }
private static ClassSanityTester.FactoryMethodReturnValueTester sanityTester() { return new ClassSanityTester() .setDefault(byte[].class, new byte[] {1, 2, 3, 4}) .setDistinctValues(byte[].class, new byte[] {1, 2, 3, 4}, new byte[] {5, 6, 7, 8}) .setDistinctValues(String.class, "7f8005ff0e", "7f8005ff0f") .forAllPublicStaticMethods(HashCode.class); }
@GwtIncompatible // reflection public void testEquals() throws Exception { new ClassSanityTester() .setDistinctValues(Class.class, Color.class, Gender.class) .setDistinctValues(Enum.class, Color.BLUE, Color.RED) .forAllPublicStaticMethods(EnumMultisetFactory.class) .testEquals(); }
public void testInstantiate_setDistinctValues() throws Exception { NotInstantiable x = new NotInstantiable(); NotInstantiable y = new NotInstantiable(); tester.setDistinctValues(NotInstantiable.class, x, y); assertNotNull(tester.instantiate(ConstructorParameterNotInstantiable.class)); }
public void testInstantiate_setDistinctValues() throws Exception { NotInstantiable x = new NotInstantiable(); NotInstantiable y = new NotInstantiable(); tester.setDistinctValues(NotInstantiable.class, x, y); assertNotNull(tester.instantiate(ConstructorParameterNotInstantiable.class)); tester.testEquals(ConstructorParameterMapOfNotInstantiable.class); }