Package net.emaze.dysfunctional.dispatching.delegates

Examples of net.emaze.dysfunctional.dispatching.delegates.Delegate


    }
   

    @Test(expected = ClassCastException.class)
    public void passingWrongTypeToErasureYieldsException() {
        Delegate c = new Reductor<Long, Integer>(new Count<Integer>(), 0l);
        c.perform(new Object());
    }   
View Full Code Here


        Assert.assertEquals(expected, got);
    }

    @Test(expected = ClassCastException.class)
    public void callingErasureWithWrongTypeYieldsException() {
        Delegate d = new Densify<Integer>(RangeMother.sequencer, RangeMother.comparator);
        d.perform(new Object());
    }
View Full Code Here

    }

    @Test(expected = ClassCastException.class)
    public void consumingFromErasureWithWrongTypeYieldsException() {
        final Delegate cons = new ConsumeIntoCollection<ArrayList<Integer>, Integer>(new ArrayListFactory<Integer>());
        cons.perform(new Object());
    }
View Full Code Here

    }
   
    @Test(expected = ClassCastException.class)
    public void consumingFromErasureWithWrongTypeYieldsException() {
        final StringOutputIterator output = new StringOutputIterator();
        Delegate pipe = new ConsumeIntoOutputIterator(output);
        pipe.perform(new Object());
    }   
View Full Code Here

    }

    @Test(expected = ClassCastException.class)
    public void consumingFromErasureWithWrongTypeYieldsException() {
        final Delegate cons = new ConsumeIntoMap<HashMap<O, O>, O, O>(new HashMapFactory<O, O>());
        cons.perform(new Object());
    }
View Full Code Here

    }

    @Test(expected = ClassCastException.class)
    public void passingWrongTypeToErasureYieldsException() {
        final List<O> bucket = new ArrayList<O>();
        Delegate d = new CollectionAllAdder<List<O>, O>(bucket);
        d.perform(new Object());
    }
View Full Code Here

        new PredicateToDelegate<O>(null);
    }
   
    @Test// you probably expect this (expected = ClassCastException.class)
    public void passingWrongTypeToErasureJustForwardsToTheNestedAction() {
        Delegate d = new PredicateToDelegate<O>(new Always<O>());
        d.perform(new Object());
    }
View Full Code Here

        new ActionToDelegate<Object>(null);
    }

    @Test// you probably expect this (expected = ClassCastException.class)
    public void passingWrongTypeToErasureJustForwardsToTheNestedAction() {
        final Delegate d = new ActionToDelegate<O>(new Noop<O>());
        d.perform(new Object());
    }
View Full Code Here

        Assert.assertFalse(got.hasValue());
    }

    @Test(expected = ClassCastException.class)
    public void passingNonStringToErasureYieldsException() {
        Delegate d = new BooleanTryParser();
        d.perform(new Object());
    }       
View Full Code Here

        new ByteTryParser(Character.MIN_RADIX - 1);
    }
   
    @Test(expected = ClassCastException.class)
    public void passingNonStringToErasureYieldsException() {
        Delegate d = new ByteTryParser(10);
        d.perform(new Object());
    }       
View Full Code Here

TOP

Related Classes of net.emaze.dysfunctional.dispatching.delegates.Delegate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.