mrunit-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gortiz <gor...@pragsis.com>
Subject Re: Trying to use MRUnit with MultipleOutput
Date Tue, 14 Oct 2014 08:04:01 GMT
I already got that the test work, I was using in the mapper a bad 
mop.write(K,V,baseOutput) instance of mop.write(name, K, V).

What I don't get it's to get a result with List<Pair<NullWritable, 
Text>> outputs = mapTextDriver.run();

I have been debugging the code of MRUnit until

AbstractMockContextWrapper.java
public List<Pair<KEYOUT, VALUEOUT>> getOutputs() throws IOException {
     if(outputCollectable == null) {
       return new ArrayList<Pair<KEYOUT, VALUEOUT>>();
     }
     return outputCollectable.getOutputs();
}

And the reason it's because the outputCollectable it's always null, but, 
I don't know why.

I checked that in the method:

//MockOutputCollector
  @Override
   public void collect(final K key, final V value) throws IOException {
     collectedOutputs.add(new Pair<K, V>(serialization.copy(key), 
serialization
         .copy(value)));
   }

Things seems to work fine. I don't know if I need to set some parameter 
in my configuration or something like that for MRUnit.


El 13/10/14 a las #4, gortiz escribió:
> I'm trying to test some MapReduces with MRUnit 1.1.0, but I got this 
> error:
>
>     14/10/13 14:19:49 ERROR mrunit.TestDriver: Missing expected 
> outputs for namedOutput 'a'
>     14/10/13 14:19:49 ERROR mrunit.TestDriver: Missing expected output 
> (b, a) for namedOutput 'a' at position 0.
>     14/10/13 14:19:49 ERROR mrunit.TestDriver: Expected no 
> pathOutputs; got 1 pathOutputs.
>     14/10/13 14:19:49 ERROR mrunit.TestDriver: Received unexpected 
> output (b, a) for unexpected PathOutput 'a'
>
>   The code that I execute is:
>
>     mapTextDriver.withInput(new LongWritable(1), new Text(content));
>     mapTextDriver.withMultiOutput("a", "b", "a");
>     mapTextDriver.runTest();
>
> I was reading the JIRA https://issues.apache.org/jira/browse/MRUNIT-13 
> where they add the new feature to MRUnit but I don't know what I'm 
> missing..
>
> I included as well the annotations:
>
>     @RunWith(..)
>     @PrepareForTest(..)
>
> I tried as well to execute the test like:
>     List<Pair<NullWritable, Text>> outputs = mapTextDriver.run();
>
> But, I never got an output,  the  list has always size of 0.
>
> AVISO CONFIDENCIAL\nEste correo y la información contenida o adjunta 
> al mismo es privada y confidencial y va dirigida exclusivamente a su 
> destinatario. Pragsis informa a quien pueda haber recibido este correo 
> por error que contiene información confidencial cuyo uso, copia, 
> reproducción o distribución está expresamente prohibida. Si no es Vd. 
> el destinatario del mismo y recibe este correo por error, le rogamos 
> lo ponga en conocimiento del emisor y proceda a su eliminación sin 
> copiarlo, imprimirlo o utilizarlo de ningún modo.\nCONFIDENTIALITY 
> WARNING.\nThis message and the information contained in or attached to 
> it are private and confidential and intended exclusively for the 
> addressee. Pragsis informs to whom it may receive it in error that it 
> contains privileged information and its use, copy, reproduction or 
> distribution is prohibited. If you are not an intended recipient of 
> this E-mail, please notify the sender, delete it and do not read, act 
> upon, print, disclose, copy, reta
> in or redistribute any portion of this E-mail.

AVISO CONFIDENCIAL\nEste correo y la información contenida o adjunta al mismo es privada
y confidencial y va dirigida exclusivamente a su destinatario. Pragsis informa a quien pueda
haber recibido este correo por error que contiene información confidencial cuyo uso, copia,
reproducción o distribución está expresamente prohibida. Si no es Vd. el destinatario del
mismo y recibe este correo por error, le rogamos lo ponga en conocimiento del emisor y proceda
a su eliminación sin copiarlo, imprimirlo o utilizarlo de ningún modo.\nCONFIDENTIALITY
WARNING.\nThis message and the information contained in or attached to it are private and
confidential and intended exclusively for the addressee. Pragsis informs to whom it may receive
it in error that it contains privileged information and its use, copy, reproduction or distribution
is prohibited. If you are not an intended recipient of this E-mail, please notify the sender,
delete it and do not read, act upon, print, disclose, copy, reta
 in or redistribute any portion of this E-mail.

Mime
View raw message