コード例 #1
0
  @Test
  public void testRunWindupTiny() throws Exception {
    try (GraphContext context = createGraphContext()) {
      super.runTest(
          context, "../test-files/jee-example-app-1.0.0.ear", false, Arrays.asList("com.acme"));

      Path graphDirectory = context.getGraphDirectory();
      Path reportsDirectory = graphDirectory.resolve("reports");
      Path indexPath = graphDirectory.resolve(Paths.get("index.html"));

      Path appReportPath =
          resolveChildPath(
              reportsDirectory,
              "ApplicationDetails_JEE_Example_App__org_windup_example_jee_example_app_1_0_0_\\.html");
      Path appNonClassifiedReportPath =
          resolveChildPath(
              reportsDirectory,
              "compatiblefiles_JEE_Example_App__org_windup_example_jee_example_app_1_0_0_\\.html");
      Path productCatalogBeanPath =
          resolveChildPath(reportsDirectory, "ProductCatalogBean_java\\.html");

      Assert.assertTrue(indexPath.toFile().exists());
      Assert.assertTrue(appReportPath.toFile().exists());
      Assert.assertTrue(appNonClassifiedReportPath.toFile().exists());
      Assert.assertTrue(productCatalogBeanPath.toFile().exists());

      String appReportContent = new String(Files.readAllBytes(appReportPath));

      Assert.assertTrue(appReportContent.contains("Used only to support migration activities."));
      allDecompiledFilesAreLinked(context);
    }
  }
コード例 #2
0
  @Test
  public void testRunWindupMedium() throws Exception {
    final String path = "../test-files/Windup1x-javaee-example.war";

    try (GraphContext context = createGraphContext()) {
      super.runTest(context, path, false);
      validateManifestEntries(context);
      validateReports(context);
    }
  }
コード例 #3
0
  @Test
  public void testRunWindupJsp() throws Exception {
    final String path = "../test-files/catchalltest";

    try (GraphContext context = createGraphContext()) {
      super.runTest(context, path, true);

      validateReports(context);
    }
  }
コード例 #4
0
  @Test
  public void testRunWindupSourceMode() throws Exception {
    Path userPath =
        FileUtils.getTempDirectory()
            .toPath()
            .resolve("Windup")
            .resolve("windupuserscriptsdir_" + RandomStringUtils.randomAlphanumeric(6));
    try {
      Files.createDirectories(userPath);
      try (InputStream is = getClass().getResourceAsStream(EXAMPLE_USERSCRIPT_INPUT);
          OutputStream os =
              new FileOutputStream(userPath.resolve(EXAMPLE_USERSCRIPT_OUTPUT).toFile())) {
        IOUtils.copy(is, os);
      }
      try (InputStream is = getClass().getResourceAsStream("/exampleconversion.xsl");
          OutputStream os = new FileOutputStream(userPath.resolve(XSLT_OUTPUT_NAME).toFile())) {
        IOUtils.copy(is, os);
      }

      try (GraphContext context = createGraphContext()) {
        // The test-files folder in the project root dir.
        List<String> includeList = Collections.emptyList();
        List<String> excludeList = Collections.emptyList();
        super.runTest(
            context,
            "../test-files/src_example",
            userPath.toFile(),
            true,
            includeList,
            excludeList);

        validateWebXmlReferences(context);
        validatePropertiesModels(context);
        validateReports(context);
        validateCompatibleReport(context);
      }
    } finally {
      FileUtils.deleteDirectory(userPath.toFile());
    }
  }