Search in sources :

Example 1 with Test

use of org.testng.annotations.Test in project storm by apache.

the class IntermediateRankingsBoltTest method shouldEmitNothingIfNormalTupleIsReceived.

@Test
public void shouldEmitNothingIfNormalTupleIsReceived() {
    // given
    Tuple normalTuple = mockRankableTuple(ANY_OBJECT, ANY_COUNT);
    BasicOutputCollector collector = mock(BasicOutputCollector.class);
    IntermediateRankingsBolt bolt = new IntermediateRankingsBolt();
    // when
    bolt.execute(normalTuple, collector);
    // then
    verifyZeroInteractions(collector);
}
Also used : BasicOutputCollector(org.apache.storm.topology.BasicOutputCollector) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Example 2 with Test

use of org.testng.annotations.Test in project storm by apache.

the class RollingCountBoltTest method shouldEmitNothingIfNoObjectHasBeenCountedYetAndTickTupleIsReceived.

@SuppressWarnings("rawtypes")
@Test
public void shouldEmitNothingIfNoObjectHasBeenCountedYetAndTickTupleIsReceived() {
    // given
    Tuple tickTuple = MockTupleHelpers.mockTickTuple();
    RollingCountBolt bolt = new RollingCountBolt();
    Map conf = mock(Map.class);
    TopologyContext context = mock(TopologyContext.class);
    OutputCollector collector = mock(OutputCollector.class);
    bolt.prepare(conf, context, collector);
    // when
    bolt.execute(tickTuple);
    // then
    verifyZeroInteractions(collector);
}
Also used : OutputCollector(org.apache.storm.task.OutputCollector) TopologyContext(org.apache.storm.task.TopologyContext) Map(java.util.Map) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Example 3 with Test

use of org.testng.annotations.Test in project storm by apache.

the class RollingCountBoltTest method shouldDeclareOutputFields.

@Test
public void shouldDeclareOutputFields() {
    // given
    OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class);
    RollingCountBolt bolt = new RollingCountBolt();
    // when
    bolt.declareOutputFields(declarer);
    // then
    verify(declarer, times(1)).declare(any(Fields.class));
}
Also used : Fields(org.apache.storm.tuple.Fields) OutputFieldsDeclarer(org.apache.storm.topology.OutputFieldsDeclarer) Test(org.testng.annotations.Test)

Example 4 with Test

use of org.testng.annotations.Test in project storm by apache.

the class TotalRankingsBoltTest method shouldEmitNothingIfNormalTupleIsReceived.

@Test
public void shouldEmitNothingIfNormalTupleIsReceived() {
    // given
    Tuple normalTuple = mockRankingsTuple(ANY_OBJECT, ANY_COUNT);
    BasicOutputCollector collector = mock(BasicOutputCollector.class);
    TotalRankingsBolt bolt = new TotalRankingsBolt();
    // when
    bolt.execute(normalTuple, collector);
    // then
    verifyZeroInteractions(collector);
}
Also used : BasicOutputCollector(org.apache.storm.topology.BasicOutputCollector) Tuple(org.apache.storm.tuple.Tuple) Test(org.testng.annotations.Test)

Example 5 with Test

use of org.testng.annotations.Test in project storm by apache.

the class TotalRankingsBoltTest method shouldDeclareOutputFields.

@Test
public void shouldDeclareOutputFields() {
    // given
    OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class);
    TotalRankingsBolt bolt = new TotalRankingsBolt();
    // when
    bolt.declareOutputFields(declarer);
    // then
    verify(declarer, times(1)).declare(any(Fields.class));
}
Also used : Fields(org.apache.storm.tuple.Fields) OutputFieldsDeclarer(org.apache.storm.topology.OutputFieldsDeclarer) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)24007 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2438 Task (com.evolveum.midpoint.task.api.Task)2069 File (java.io.File)1433 ArrayList (java.util.ArrayList)1237 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)1188 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)1078 HashMap (java.util.HashMap)965 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)814 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)692 BeforeTest (org.testng.annotations.BeforeTest)692 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)690 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)651 Parameters (org.testng.annotations.Parameters)610 BaseTest (org.xdi.oxauth.BaseTest)582 BigDecimal (java.math.BigDecimal)574 List (java.util.List)558 LocalDate (org.joda.time.LocalDate)553 HashSet (java.util.HashSet)548 BaseTest (util.BaseTest)537