Examples of Reporter


Examples of org.apache.felix.ipojo.manipulator.Reporter

import static org.mockito.Mockito.mock;

public class FileMetadataProviderTestCase extends TestCase {
    public void testGetMetadatasFromFile() throws Exception {
        File metadata = new File(new File("target", "test-classes"), "metadata.xml");
        Reporter reporter = mock(Reporter.class);
        FileMetadataProvider provider = new FileMetadataProvider(metadata, reporter);
        provider.setValidateUsingLocalSchemas(true);

        List<Element> meta = provider.getMetadatas();
        assertEquals(3, meta.size());
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.Reporter

        assertEquals(3, meta.size());
    }

    public void testGetMetadatasFromDirectory() throws Exception {
        File metadata = new File("target", "test-classes");
        Reporter reporter = mock(Reporter.class);
        FileMetadataProvider provider = new FileMetadataProvider(metadata, reporter);
        provider.setValidateUsingLocalSchemas(true);

        List<Element> meta = provider.getMetadatas();
        assertEquals(3, meta.size());
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.Reporter

public class StreamMetadataProviderTestCase extends TestCase {

    public void testGetMetadatas() throws Exception {
        File metadata = new File(new File("target", "test-classes"), "metadata.xml");
        FileInputStream fis = new FileInputStream(metadata);
        Reporter reporter = mock(Reporter.class);

        StreamMetadataProvider provider = new StreamMetadataProvider(fis, reporter);
        provider.setValidateUsingLocalSchemas(true);

        List<Element> meta = provider.getMetadatas();
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.Reporter

    }

    public void testWithEmptyMetadataXml() throws Exception {
        File metadata = new File(new File("target", "test-classes"), "empty-metadata.xml");
        FileInputStream fis = new FileInputStream(metadata);
        Reporter reporter = mock(Reporter.class);

        StreamMetadataProvider provider = new StreamMetadataProvider(fis, reporter);
        provider.setValidateUsingLocalSchemas(true);

        List<Element> meta = provider.getMetadatas();
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.Reporter

import static org.mockito.Mockito.mock;

public class AnnotationMetadataProviderTestCase extends TestCase {
    public void testGetMetadatas() throws Exception {
        MiniStore store = new MiniStore(AnnotatedComponent.class, FakeAnnotation.class);
        Reporter reporter = mock(Reporter.class);
        AnnotationMetadataProvider provider = new AnnotationMetadataProvider(store, reporter);

        List<Element> meta = provider.getMetadatas();
        assertEquals(1, meta.size());
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.Reporter

            }
        }

        File out = new File(m_buildDirectory + File.separator + "_out.jar");

        Reporter reporter = new MavenReporter(getLog());
        Pojoization pojo = new Pojoization(reporter);
        if (m_ignoreAnnotations) {
            pojo.disableAnnotationProcessing();
        }
        if (!m_ignoreEmbeddedXSD) {
            pojo.setUseLocalXSD();
        }

        // Executes the pojoization.
        if (is == null) {
            if (metadata == null) { // No metadata.
                pojo.pojoization(in, out, (File) null, classpath.createClassLoader()); // Only annotations
            } else {
                pojo.pojoization(in, out, metadata, classpath.createClassLoader()); // Metadata set
            }
        } else { // In-Pom metadata.
            pojo.pojoization(in, out, is, classpath.createClassLoader());
        }

        for (int i = 0; i < reporter.getWarnings().size(); i++) {
            getLog().warn((String) reporter.getWarnings().get(i));
        }
        if (reporter.getErrors().size() > 0) {
            throw new MojoExecutionException((String) reporter.getErrors().get(0));
        }

        if (m_classifier != null) {
            // The user want to attach the resulting jar
            // Do not delete in File
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.Reporter


        bind(HandlerDeclaration.class)
                .to(new AnnotationVisitorFactory() {
                    public AnnotationVisitor newAnnotationVisitor(BindingContext context) {
                        Reporter reporter = context.getReporter();
                        return new HandlerDeclarationVisitor(context.getWorkbench(), getFreshDocumentBuilder(reporter), reporter);
                    }
                });

        bind(Instantiate.class)
View Full Code Here

Examples of org.apache.hadoop.mapred.Reporter

        if (progressable == null || progressable == Reporter.NULL) {
            return;
        }

        if (progressable instanceof Reporter) {
            Reporter reporter = (Reporter) progressable;
            for (Counter count : Counter.ALL) {
                oldApiCounter(reporter, count, count.get(stats));
            }
        }
View Full Code Here

Examples of org.apache.hadoop.mapred.Reporter

  @Test
  public final void testMapperValidValues() throws IOException,
      InterruptedException {
    OutputCollector<AvroValue<Pair>, NullWritable> output = mock(OutputCollector.class);
    Reporter reporter = mock(Reporter.class);

    DBInputAvroMapper mapper = new DBInputAvroMapper();

    ColumnInfo intColumn = new ColumnInfo(0, Types.INTEGER, "intColumn");
    ColumnInfo stringColumn = new ColumnInfo(1, Types.VARCHAR,
View Full Code Here

Examples of org.apache.hadoop.mapred.Reporter

    Builder.sortSplits(sorted);

    int numTrees = Builder.getNbTrees(job); // total number of trees

    firstOutput = new PartialOutputCollector(numTrees);
    Reporter reporter = Reporter.NULL;

    firstIds = new int[splits.length];
    sizes = new int[splits.length];
   
    // to compute firstIds, process the splits in file order
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.