org.nakedobjects.metamodel.commons.ensure.Assert类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(162)

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

Assert介绍

暂无

代码示例

代码示例来源:origin: org.nakedobjects.core/runtime

public AggregateAdapters(NakedObject rootAdapter) {
  Assert.assertNotNull(rootAdapter);
  this.rootAdapter = rootAdapter;
}
public NakedObject getRootAdapter() {

代码示例来源:origin: org.nakedobjects/metamodel

public static void assertSame(final String message, final Object expected, final Object actual) {
  assertTrue(message + ": expected " + expected + " but was " + actual, expected == actual);
}

代码示例来源:origin: org.nakedobjects/metamodel

public static void assertFalse(final boolean flag) {
  assertFalse("expected false", flag);
}

代码示例来源:origin: org.nakedobjects.plugins/htmlviewer-viewer

public void addTaskCrumb(final Task task) {
  while (crumbs.size() > 1 && !(crumbs.lastElement() instanceof ObjectCrumb)) {
    crumbs.pop();
  }
  Assert.assertNotNull(task);
  Assert.assertTrue(!isTask());
  task.init(this);
  crumbs.push(new TaskCrumb(task));
}

代码示例来源:origin: org.nakedobjects.core/runtime

private NakedObject mapAndInjectServices(final NakedObject adapter) {
  Assert.assertNotNull(adapter);
  final Object pojo = adapter.getObject();
  Assert.assertFalse("POJO Map already contains object", pojo, getPojoAdapterMap().containsPojo(pojo));

代码示例来源:origin: org.nakedobjects.core/runtime

public void resolveImmediately(final NakedObject adapter) {
  // synchronize on the current session because getting race
  // conditions, I think between different UI threads when running
  // with DnD viewer + in-memory object store +
  // cglib bytecode enhancement
  synchronized (getAuthenticationSession()) {
    final ResolveState resolveState = adapter.getResolveState();
    if (!resolveState.canChangeTo(ResolveState.RESOLVING)) {
      return;
    }
    Assert.assertFalse("only resolve object that is not yet resolved",
        adapter, resolveState.isResolved());
    Assert.assertTrue("only resolve object that is persistent",
        adapter, adapter.isPersistent());
    if (LOG.isInfoEnabled()) {
      // don't log object - its toString() may use the
      // unresolved field, or unresolved collection
      LOG.info("resolve immediately: "
          + adapter.getSpecification().getShortName() + " "
          + resolveState.code() + " " + adapter.getOid());
    }
    resolveImmediatelyFromPersistenceLayer(adapter);
  }
}

代码示例来源:origin: org.nakedobjects.core/metamodel

public static void assertEquals(final Object expected, final Object actual) {
  assertEquals("", expected, actual);
}

代码示例来源:origin: org.nakedobjects.core/metamodel

public static void assertSame(final Object expected, final Object actual) {
  assertSame("", expected, actual);
}

代码示例来源:origin: org.nakedobjects.plugins/html-viewer

public void addTaskCrumb(final Task task) {
  while (crumbs.size() > 1 && !(crumbs.lastElement() instanceof ObjectCrumb)) {
    crumbs.pop();
  }
  Assert.assertNotNull(task);
  Assert.assertTrue(!isTask());
  task.init(this);
  crumbs.push(new TaskCrumb(task));
}

代码示例来源:origin: org.nakedobjects/metamodel

public static void assertEquals(final Object expected, final Object actual) {
  assertEquals("", expected, actual);
}

代码示例来源:origin: org.nakedobjects/metamodel

public static void assertSame(final Object expected, final Object actual) {
  assertSame("", expected, actual);
}

代码示例来源:origin: org.nakedobjects/xmlpersistence

public ServiceElement(final SerialOid oid, final String id) {
    Assert.assertNotNull("oid", oid);
    Assert.assertNotNull("id", id);
    this.oid = oid;
    this.id = id;
  }
}

代码示例来源:origin: org.nakedobjects/metamodel

public static void assertTrue(final String message, final boolean flag) {
  assertTrue(message, null, flag);
}

代码示例来源:origin: org.nakedobjects.core/metamodel

public static void assertFalse(final boolean flag) {
  assertFalse("expected false", flag);
}

代码示例来源:origin: org.nakedobjects.plugins/dndviewer

@Override
public void build(final View view) {
  Assert.assertEquals(view.getView(), view);
  final ActionContent actionContent = ((ActionContent) view.getContent());
  if (view.getSubviews().length == 0) {
    newBuild(view, actionContent);
  } else {
    updateBuild(view, actionContent);
  }
}

代码示例来源:origin: org.nakedobjects.plugins/dndviewer

public AbstractFocusManager(final View container, final View initalFocus) {
  Assert.assertNotNull(container);
  this.container = container;
  this.initialFocus = initalFocus;
  focus = initalFocus;
}

代码示例来源:origin: org.nakedobjects.core/metamodel

public static void assertFalse(final String message, final boolean flag) {
  assertTrue(message, !flag);
}

代码示例来源:origin: org.nakedobjects.plugins/htmlviewer-viewer

public PersistentObjectMapping(final NakedObject adapter) {
  oid = adapter.getOid();
  Assert.assertFalse("OID is for transient", oid.isTransient());
  Assert.assertFalse("adapter is for transient", adapter.isTransient());
  specification = adapter.getSpecification();
  version = adapter.getVersion();
}

代码示例来源:origin: org.nakedobjects.plugins/dndviewer

@Override
public void build(final View view) {
  Assert.assertEquals("ensure the view is complete decorated view", view.getView(), view);
  final Content content = view.getContent();
  final NakedObject object = ((ObjectContent) content).getObject();
  final TableAxis viewAxis = (TableAxis) view.getViewAxis();
  if (view.getSubviews().length == 0) {
    buildNew(object, view, viewAxis);
  } else {
    buildUpdate(object, view, viewAxis);
  }
}

代码示例来源:origin: org.nakedobjects/metamodel

private static <T> T ensureNotNull(final T oid, String message) {
  Assert.assertNotNull(message, oid);
  return oid;
}

相关文章