com.alibaba.citrus.util.Assert.fail()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(171)

本文整理了Java中com.alibaba.citrus.util.Assert.fail()方法的一些代码示例,展示了Assert.fail()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.fail()方法的具体详情如下:
包路径:com.alibaba.citrus.util.Assert
类名称:Assert
方法名:fail

Assert.fail介绍

[英]未预料的失败。
[中]未预料的失败。

代码示例

代码示例来源:origin: webx/citrus

/** 未预料的失败。 */
public static <T> T fail() {
  fail(null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

/** 未预料的失败。 */
public static <T> T fail() {
  fail(null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

/** 未预料的失败。 */
public static <T> T fail() {
  fail(null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

public static Element theOnlySubElement(Element element, ElementSelector selector) {
  List<Element> subElements = subElements(element, selector);
  switch (subElements.size()) {
    case 1:
      return subElements.get(0);
    case 0:
      return null;
    default:
      fail("too more sub-elements of %s", element.getNodeName());
      return null;
  }
}

代码示例来源:origin: webx/citrus

public static Element theOnlySubElement(Element element, ElementSelector selector) {
  List<Element> subElements = subElements(element, selector);
  switch (subElements.size()) {
    case 1:
      return subElements.get(0);
    case 0:
      return null;
    default:
      fail("too more sub-elements of %s", element.getNodeName());
      return null;
  }
}

代码示例来源:origin: webx/citrus

/** 检查spring版本是否为3.1.x。从这个版本起,和以前的版本在api上有不兼容。 */
  public static void assertSpring3_1_x() {
    ClassLoader cl = SpringVersion.class.getClassLoader();

    try {
      cl.loadClass("org.springframework.core.env.Environment");
    } catch (ClassNotFoundException e) {
      fail("Unsupported Spring version: %s, requires Spring 3.1.x or later", SpringVersion.getVersion());
    }
  }
}

代码示例来源:origin: webx/citrus

public static Element theOnlySubElement(Element element, ElementSelector selector) {
  List<Element> subElements = subElements(element, selector);
  switch (subElements.size()) {
    case 1:
      return subElements.get(0);
    case 0:
      return null;
    default:
      fail("too more sub-elements of %s", element.getNodeName());
      return null;
  }
}

代码示例来源:origin: webx/citrus

/** 检查spring版本是否为3.1.x。从这个版本起,和以前的版本在api上有不兼容。 */
  public static void assertSpring3_1_x() {
    ClassLoader cl = SpringVersion.class.getClassLoader();

    try {
      cl.loadClass("org.springframework.core.env.Environment");
    } catch (ClassNotFoundException e) {
      fail("Unsupported Spring version: %s, requires Spring 3.1.x or later", SpringVersion.getVersion());
    }
  }
}

代码示例来源:origin: webx/citrus

/** 检查spring版本是否为3.1.x。从这个版本起,和以前的版本在api上有不兼容。 */
  public static void assertSpring3_1_x() {
    ClassLoader cl = SpringVersion.class.getClassLoader();

    try {
      cl.loadClass("org.springframework.core.env.Environment");
    } catch (ClassNotFoundException e) {
      fail("Unsupported Spring version: %s, requires Spring 3.1.x or later", SpringVersion.getVersion());
    }
  }
}

代码示例来源:origin: webx/citrus

public final InputStream getInputStream() {
  serialize();
  if (transformedData != null) {
    return new ByteArrayInputStream(transformedData);
  }
  if (originalSource != null) {
    return getOriginalInputStream();
  } else {
    fail("Found a BUG: OriginalSource can't be null here");
    return null;
  }
}

代码示例来源:origin: webx/citrus

public final InputStream getInputStream() {
  serialize();
  if (transformedData != null) {
    return new ByteArrayInputStream(transformedData);
  }
  if (originalSource != null) {
    return getOriginalInputStream();
  } else {
    fail("Found a BUG: OriginalSource can't be null here");
    return null;
  }
}

代码示例来源:origin: webx/citrus

public final InputStream getInputStream() {
  serialize();
  if (transformedData != null) {
    return new ByteArrayInputStream(transformedData);
  }
  if (originalSource != null) {
    return getOriginalInputStream();
  } else {
    fail("Found a BUG: OriginalSource can't be null here");
    return null;
  }
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

/** 未预料的失败。 */
public static <T> T fail() {
  fail(null, (Object[]) null);
  return null;
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

/** 检查spring版本是否为3.1.x。从这个版本起,和以前的版本在api上有不兼容。 */
  public static void assertSpring3_1_x() {
    ClassLoader cl = SpringVersion.class.getClassLoader();

    try {
      cl.loadClass("org.springframework.core.env.Environment");
    } catch (ClassNotFoundException e) {
      fail("Unsupported Spring version: %s, requires Spring 3.1.x or later", SpringVersion.getVersion());
    }
  }
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

public static Element theOnlySubElement(Element element, ElementSelector selector) {
  List<Element> subElements = subElements(element, selector);
  switch (subElements.size()) {
    case 1:
      return subElements.get(0);
    case 0:
      return null;
    default:
      fail("too more sub-elements of %s", element.getNodeName());
      return null;
  }
}

代码示例来源:origin: com.alibaba.citrus/citrus-webx-all

public final InputStream getInputStream() {
  serialize();
  if (transformedData != null) {
    return new ByteArrayInputStream(transformedData);
  }
  if (originalSource != null) {
    return getOriginalInputStream();
  } else {
    fail("Found a BUG: OriginalSource can't be null here");
    return null;
  }
}

相关文章