Esempio n. 1
0
  /** Invoked after the test class is instantiated and before any configuration method is called. */
  public void onStart(ITestContext context) {
    String currentTestClassName = context.getCurrentXmlTest().getClasses().get(0).getName();

    log.info("Before executing the test class :" + currentTestClassName);
    if (currentTestClassName != null) {
      try {
        artifactManager = ArtifactManager.getInstance();
        artifactManager.deployArtifacts(context.getCurrentXmlTest().getClasses().get(0).getName());
      } catch (Exception e) {
        log.error("Artifact Deployment Error ", e);
        CustomTestNgReportSetter reportSetter = new CustomTestNgReportSetter();
        reportSetter.createReport(context, e);
      }
    }
  }
 @NotNull
 @Override
 public List<DeploymentSource> createArtifactDeploymentSources(
     Project project, ArtifactType... artifactTypes) {
   if (project.isDefault()) return Collections.emptyList();
   Artifact[] artifacts = ArtifactManager.getInstance(project).getArtifacts();
   List<Artifact> supportedArtifacts = new ArrayList<>();
   Set<ArtifactType> typeSet = ContainerUtil.set(artifactTypes);
   for (Artifact artifact : artifacts) {
     if (typeSet.contains(artifact.getArtifactType())) {
       supportedArtifacts.add(artifact);
     }
   }
   return createArtifactDeploymentSources(project, supportedArtifacts);
 }