List of usage examples for com.google.common.collect.testing SampleElements asList
public List<E> asList()
From source file:net.openhft.koloboke.collect.testing.set.HyperCharSetTestSuiteBuilder.java
public TestSuite create() { TestSuite suite = new TestSuite(subSuiteName(factories, samples, "")); for (CharSetFactory/*ps*/ factory : factories) { for (SampleElements<? extends Character> elems : samples) { for (Mutability mutability : Mutability.values()) { FeatureSpecificTestSuiteBuilder b = forEachTestSuiteBuilder( new GuavaCharSetTestSuiteBuilder/*<>*/() .usingGenerator(new TestCharSetGenerator(mutability, factory, elems))) .named(subSuiteName(factory, elems.asList(), mutability.toString())) .withFeatures(mutability.collectionFeatures); if (mutability == Mutability.UPDATABLE) { try { b.suppressing(CollectionClearTester.class.getDeclaredMethod("testClear_unsupported")); } catch (NoSuchMethodException e) { throw new AssertionError(e); }/*from w w w. ja v a2s.c o m*/ } Test mutableTests = b.createTestSuite(); suite.addTest(mutableTests); } } } return suite; }
From source file:net.openhft.koloboke.collect.testing.map.HyperCharShortMapTestSuiteBuilder.java
public TestSuite create() { TestSuite suite = new TestSuite(subSuiteName(factories, keySamples, valueSamples, "")); for (CharShortMapFactory</*ps*/?> factory : factories) { TestCharShortMapGenerator.Builder builder = new TestCharShortMapGenerator.Builder().setFactory(factory); for (SampleElements<? extends Character> keys : keySamples) { for (SampleElements<? extends Short> values : valueSamples) { builder.setKeys(keys).setValues(values); for (Mutability mutability : Mutability.values()) { FeatureSpecificTestSuiteBuilder b = forEachTestSuiteBuilder( new GuavaCharShortMapTestSuiteBuilder/*<>*/() .usingGenerator(builder.withMutability(mutability))) .named(subSuiteName(factory, keys.asList(), values.asList(), mutability.toString())) .withFeatures(mutability.mapFeatures) .withFeatures(mutability.mapViewFeatures); if (mutability == Mutability.UPDATABLE) { try { b.suppressing(MapClearTester.class.getDeclaredMethod("testClear_unsupported"), CollectionClearTester.class.getDeclaredMethod("testClear_unsupported")); } catch (NoSuchMethodException e) { throw new AssertionError(e); }/*from w w w.j a v a 2s . c o m*/ } Test mutableTests = b.createTestSuite(); suite.addTest(mutableTests); } } } } return suite; }
From source file:com.koloboke.collect.testing.map.HyperCharShortMapTestSuiteBuilder.java
public TestSuite create() { TestSuite suite = new TestSuite(subSuiteName(factories, keySamples, valueSamples, "")); for (CharShortMapFactory</*ps*/?> factory : factories) { TestCharShortMapGenerator.Builder builder = new TestCharShortMapGenerator.Builder().setFactory(factory); for (SampleElements<? extends Character> keys : keySamples) { for (SampleElements<? extends Short> values : valueSamples) { builder.setKeys(keys).setValues(values); for (Mutability mutability : Mutability.values()) { FeatureSpecificTestSuiteBuilder b = forEachTestSuiteBuilder( new GuavaCharShortMapTestSuiteBuilder/*<>*/() .usingGenerator(builder.withMutability(mutability))) .named(subSuiteName(factory, keys.asList(), values.asList(), mutability.toString())) .withFeatures(mutability.mapFeatures) .withFeatures(mutability.mapViewFeatures); if (mutability == Mutability.UPDATABLE) { try { b.suppressing(MapClearTester.class.getDeclaredMethod("testClear_unsupported"), CollectionClearTester.class.getDeclaredMethod("testClear_unsupported")); } catch (NoSuchMethodException e) { throw new AssertionError(e); }/*ww w .j a v a 2s . co m*/ } /* if obj value */ if (values instanceof SampleElements.Unhashables) { b.suppressing(MapHashCodeTester.class.getDeclaredMethods()); } /* endif */ Test mutableTests = b.createTestSuite(); suite.addTest(mutableTests); } } } } return suite; }