congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ContentConflictsException.getConflicts
Code IndexAdd Tabnine to your IDE (free)

How to use
getConflicts
method
in
org.jboss.as.patching.ContentConflictsException

Best Java code snippets using org.jboss.as.patching.ContentConflictsException.getConflicts (Showing top 4 results out of 315)

origin: org.wildfly.core/wildfly-patching

public static void formatFailedResponse(final PatchingException e, final ModelNode failureDescription) {
  if(e instanceof ContentConflictsException) {
    failureDescription.get(Constants.MESSAGE).set(PatchLogger.ROOT_LOGGER.detectedConflicts());
    final ModelNode conflicts = failureDescription.get(Constants.CONFLICTS);
    for(final ContentItem item : ((ContentConflictsException)e).getConflicts()) {
      final ContentType type = item.getContentType();
      switch (type) {
        case BUNDLE:
          conflicts.get(Constants.BUNDLES).add(item.getRelativePath());
          break;
        case MODULE:
          conflicts.get(Constants.MODULES).add(item.getRelativePath());
          break;
        case MISC:
          conflicts.get(Constants.MISC).add(item.getRelativePath());
          break;
      }
    }
  } else {
    failureDescription.set(e.getLocalizedMessage());
  }
}
origin: wildfly/wildfly-core

public static void formatFailedResponse(final PatchingException e, final ModelNode failureDescription) {
  if(e instanceof ContentConflictsException) {
    failureDescription.get(Constants.MESSAGE).set(PatchLogger.ROOT_LOGGER.detectedConflicts());
    final ModelNode conflicts = failureDescription.get(Constants.CONFLICTS);
    for(final ContentItem item : ((ContentConflictsException)e).getConflicts()) {
      final ContentType type = item.getContentType();
      switch (type) {
        case BUNDLE:
          conflicts.get(Constants.BUNDLES).add(item.getRelativePath());
          break;
        case MODULE:
          conflicts.get(Constants.MODULES).add(item.getRelativePath());
          break;
        case MISC:
          conflicts.get(Constants.MISC).add(item.getRelativePath());
          break;
      }
    }
  } else {
    failureDescription.set(e.getLocalizedMessage());
  }
}
origin: wildfly/wildfly-core

static void assertPatchHasNotBeenApplied(ContentConflictsException result, Patch patch, ContentItem problematicItem, DirectoryStructure structure) {
  assertFalse("patch should have failed", result.getConflicts().isEmpty());
  assertTrue(problematicItem + " is not reported in the problems " + result.getConflicts(), result.getConflicts().contains(problematicItem));
  assertDirDoesNotExist(structure.getInstalledImage().getPatchHistoryDir(patch.getPatchId()));
}
origin: wildfly/wildfly-core

protected PatchingTestStepBuilder testModuleConflicts(final ContentVerificationPolicy resolvePolicy) throws Exception {
  final PatchingTestBuilder builder = createDefaultBuilder();
  final byte[] moduleHash = new byte[20];
  // Create a conflict
  final File base = builder.getFile("modules", "system", "layers", "base");
  createModule0(base, "org.jboss.test", randomString());
  final PatchingTestStepBuilder oneOff1 = builder.createStepBuilder();
  oneOff1.setPatchId("one-off-1")
      .oneOffPatchIdentity(PRODUCT_VERSION)
      .oneOffPatchElement("base-oo1", BASE, false)
      .updateModuleWithRandomContent("org.jboss.test", NO_CONTENT, moduleHash)
  ;
  try {
    apply(oneOff1);
    Assert.fail("should have detected conflicts");
  } catch (ContentConflictsException expected) {
    final ModuleItem item = new ModuleItem("org.jboss.test", "main", moduleHash);
    Assert.assertTrue(expected.getConflicts().contains(item));
  }
  // Apply patch and override all
  apply(oneOff1, resolvePolicy);
  return oneOff1;
}
org.jboss.as.patchingContentConflictsExceptiongetConflicts

Popular methods of ContentConflictsException

  • <init>
  • getStackTrace
  • setStackTrace

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • setContentView (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now