Package net.emaze.dysfunctional.dispatching.delegates

Examples of net.emaze.dysfunctional.dispatching.delegates.Delegate.perform()


   

    @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


    }

    @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

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

    }

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

    @Test
    public void callingAdapterCallsAdapted() {
        final Box<Object> box = new Box<Object>();
View Full Code Here

    }

    @Test(expected = ClassCastException.class)
    public void passingNonStringToErasureYieldsException() {
        Delegate d = new BooleanTryParser();
        d.perform(new Object());
    }       
   
    @Test
    public void parsingValidTrueStringYieldsTrue() {
        final Maybe<Boolean> got = new BooleanTryParser().perform("true");
View Full Code Here

    }
   
    @Test(expected = ClassCastException.class)
    public void passingNonStringToErasureYieldsException() {
        Delegate d = new ByteTryParser(10);
        d.perform(new Object());
    }       

    @Test
    public void parsingNullStringYieldsNothing() {
        final Maybe<Byte> got = new ByteTryParser(10).perform(null);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.