Package com.linkedin.pegasus.generator

Examples of com.linkedin.pegasus.generator.GeneratorResult


    docsProvider.registerSourceFiles(classFileNames.values());

    log.info("Exporting IDL files...");

    final GeneratorResult result = generateIDLFiles(apiName, outdir, rootResourceMap, docsProvider);

    log.info("Done!");

    return result;
  }
View Full Code Here


  public void testSimpleModel() throws Exception
  {
    RestLiResourceModelExporter exporter = new RestLiResourceModelExporter();

    assertEquals(outdir.list().length, 0);
    GeneratorResult result = exporter.export("twitter",
                                             null,
                                             new String[] {moduleDir + FS + TEST_DIR},
                                             new String[] {"com.linkedin.restli.tools.twitter"},
                                             null,
                                             outdir.getAbsolutePath());

    String[] expectedFiles = {STATUSES_FILE, FOLLOWS_FILE, ACCOUNTS_FILE, STATUSES_PARAMS_FILE, TRENDING_FILE};

    assertEquals(outdir.list().length, expectedFiles.length);
    assertEquals(result.getModifiedFiles().size(), expectedFiles.length);
    assertEquals(result.getTargetFiles().size(), expectedFiles.length);

    for (String file : expectedFiles)
    {
      String actualFile = outdir + FS + file;
      String expectedFile = moduleDir + FS + IDLS_DIR + FS + file;

      compareFiles(actualFile, expectedFile);
      assertTrue(result.getModifiedFiles().contains(new File(actualFile)));
      assertTrue(result.getTargetFiles().contains(new File(actualFile)));
    }
  }
View Full Code Here

  {
    RestLiSnapshotExporter exporter = new RestLiSnapshotExporter();
    exporter.setResolverPath(resolverPath);

    assertEquals(outdir.list().length, 0);
    GeneratorResult result = exporter.export("twitter",
                                             null,
                                             new String[] {moduleDir + FS + TEST_DIR},
                                             new String[] {"com.linkedin.restli.tools.twitter"},
                                             null,
                                             outdir.getAbsolutePath());

    String[] expectedFiles = {STATUSES_FILE, FOLLOWS_FILE, ACCOUNTS_FILE, STATUSES_PARAMS_FILE, TRENDING_FILE};

    assertEquals(outdir.list().length, expectedFiles.length);
    assertEquals(result.getModifiedFiles().size(), expectedFiles.length);
    assertEquals(result.getTargetFiles().size(), expectedFiles.length);

    for (String file : expectedFiles)
    {
      String actualFile = outdir + FS + file;
      String expectedFile = SNAPSHOTS_DIR + FS + file;

      compareFiles(actualFile, expectedFile);
      assertTrue(result.getModifiedFiles().contains(new File(actualFile)));
      assertTrue(result.getTargetFiles().contains(new File(actualFile)));
    }
  }
View Full Code Here

  {
    RestLiSnapshotExporter exporter = new RestLiSnapshotExporter();
    exporter.setResolverPath(resolverPath);

    assertEquals(outdir.list().length, 0);
    GeneratorResult result = exporter.export("circular",
                                             null,
                                             new String[] {moduleDir + FS + TEST_DIR + FS + "snapshot"},
                                             new String[] {"com.linkedin.restli.tools.snapshot.circular"},
                                             null,
                                             outdir.getAbsolutePath());

    String[] expectedFiles = {CIRCULAR_FILE};

    assertEquals(outdir.list().length, expectedFiles.length);
    assertEquals(result.getModifiedFiles().size(), expectedFiles.length);
    assertEquals(result.getTargetFiles().size(), expectedFiles.length);

    for (String file : expectedFiles)
    {
      String actualFile = outdir + FS + file;
      String expectedFile = SNAPSHOTS_DIR + FS + file;

      compareFiles(actualFile, expectedFile);
      assertTrue(result.getModifiedFiles().contains(new File(actualFile)));
      assertTrue(result.getTargetFiles().contains(new File(actualFile)));
    }

  }
View Full Code Here

    docsProvider.registerSourceFiles(classFileNames.values());

    log.info("Exporting snapshot files...");

    final GeneratorResult result = generateSnapshotFiles(apiName, outdir, rootResourceMap, docsProvider);

    log.info("Done!");

    return result;
  }
View Full Code Here

TOP

Related Classes of com.linkedin.pegasus.generator.GeneratorResult

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.