com.tc.util.Assert.assertEquals()方法的使用及代码示例

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

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

Assert.assertEquals介绍

[英]Assert expected and actual values are equal
[中]断言预期值和实际值相等

代码示例

代码示例来源:origin: org.terracotta/terracotta-ee

/**
 * Assert expected and actual values are equal or both null
 *
 * @param expected Expected value
 * @param actual Actual value
 */
public static void assertEquals(Object expected, Object actual) {
 assertEquals(null, expected, actual);
}

代码示例来源:origin: org.terracotta/terracotta-ee

public GroupObjectIDProviderImpl(ObjectCreationStrategy creationStrategy, Sequence[] sequences, GroupID[] grpIds) {
 Assert.assertEquals(sequences.length, grpIds.length);
 this.creationStrategy = creationStrategy;
 for (int i = 0; i < grpIds.length; i++) {
  this.gidToSequence.put(grpIds[i], sequences[i]);
  this.cachedObjectIds.put(grpIds[i], new TreeSet<Long>());
 }
}

代码示例来源:origin: org.terracotta/terracotta-l1

private synchronized void changeToRunning(final NodeID node) {
 Object old = this.groupStates.put(node, State.RUNNING);
 Assert.assertEquals(old, State.STARTING);
 this.disconnected--;
 if (this.disconnected < 0) { throw new AssertionError("disconnected count is less than zero, disconnected = "
                            + this.disconnected); }
 notifyAll();
}

代码示例来源:origin: org.terracotta/terracotta-ee

public ObjectSyncServerTransaction(final ServerTransactionID serverTransactionID, final ObjectIDSet oids,
                  final int dnaCount, final List changes, final Map rootsMap, final NodeID serverID) {
 this.oids = oids;
 this.changes = changes;
 this.rootsMap = rootsMap;
 this.serverID = serverID;
 this.serverTxnID = serverTransactionID;
 this.txnID = serverTransactionID.getClientTransactionID();
 Assert.assertEquals(serverID, serverTransactionID.getSourceID());
 Assert.assertEquals(dnaCount, oids.size());
 Assert.assertEquals(dnaCount, changes.size());
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

@Override
void park() {
 Assert.assertEquals(getJavaThread(), Thread.currentThread());
 try {
  permit.acquire();
 } catch (InterruptedException e) {
  Thread.currentThread().interrupt();
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

@FindbugsSuppressWarnings("RV_RETURN_VALUE_IGNORED")
@Override
void park(long timeout) {
 Assert.assertEquals(getJavaThread(), Thread.currentThread());
 try {
  permit.tryAcquire(timeout, TimeUnit.MILLISECONDS);
 } catch (InterruptedException e) {
  Thread.currentThread().interrupt();
 }
}

代码示例来源:origin: org.terracotta/terracotta-l1

@FindbugsSuppressWarnings("RV_RETURN_VALUE_IGNORED")
@Override
void park(long timeout) {
 Assert.assertEquals(getJavaThread(), Thread.currentThread());
 try {
  permit.tryAcquire(timeout, TimeUnit.MILLISECONDS);
 } catch (InterruptedException e) {
  Thread.currentThread().interrupt();
 }
}

代码示例来源:origin: org.terracotta/terracotta-l1

@Override
public synchronized void closeAllChannels() {
 MessageChannelInternal[] channelsCopy = getChannels();
 for (MessageChannelInternal element : channelsCopy) {
  element.close();
 }
 Assert.assertEquals(0, channels.size());
}

代码示例来源:origin: org.terracotta.toolkit/terracotta-toolkit-1.3-impl

private static void verifyEventLevel() {
 OperatorEventLevel operatorEventLevels[] = OperatorEventLevel.values();
 Assert.assertEquals(coreEventLevelMap.size(), operatorEventLevels.length);
 for (OperatorEventLevel operatorEventLevel : operatorEventLevels) {
  Assert.assertTrue(coreEventLevelMap.keySet().contains(operatorEventLevel.name()));
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
protected void basicSerializeTo(TCByteBufferOutput out) {
 Assert.assertEquals(INDEX_SYNC_ACK_TYPE, getType());
 out.writeInt(amount);
}

代码示例来源:origin: org.terracotta/terracotta-ee

protected DSOServerBuilder createServerBuilder(final HaConfig config, final TCLogger tcLogger, final TCServer server,
                        L2DSOConfig l2dsoConfig) {
 Assert.assertEquals(config.isActiveActive(), false);
 return new StandardDSOServerBuilder(config, tcLogger, tcSecurityManager);
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
protected void basicDeserializeFrom(TCByteBufferInput in) throws IOException {
 Assert.assertEquals(OBJECT_SYNC_COMPLETE, getType());
 this.sequence = in.readLong();
}

代码示例来源:origin: org.terracotta/terracotta-l1

@Override
 public ServerEventListenerManager createServerEventListenerManager(final DSOClientMessageChannel dsoChannel,
                                   final TaskRunner runner) {
  final GroupID[] defaultGroups = dsoChannel.getGroupIDs();
  Assert.assertNotNull(defaultGroups);
  Assert.assertEquals(1, defaultGroups.length);
  return new ServerEventListenerManagerImpl(runner);
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
protected void basicSerializeTo(TCByteBufferOutput out) {
 Assert.assertEquals(GC_RESULT, getType());
 this.gcInfo.serializeTo(out);
 this.gcedOids.serializeTo(out);
}

代码示例来源:origin: org.terracotta/terracotta-ee

private void checkVariableHeaderEmpty() {
 Assert.assertEquals(0, actionCount);
 Assert.assertFalse(Conversion.getFlag(flags, DNA.HAS_PARENT_ID));
 Assert.assertFalse(Conversion.getFlag(flags, DNA.HAS_ARRAY_LENGTH));
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
protected void basicSerializeTo(TCByteBufferOutput out) {
 Assert.assertEquals(ZAP_NODE_REQUEST, getType());
 out.writeInt(zapNodeType);
 out.writeString(reason);
 out.writeInt(weights.length);
 for (long weight : weights) {
  out.writeLong(weight);
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public RemoteSearchRequestManager createRemoteSearchRequestManager(final TCLogger logger,
                                  final DSOClientMessageChannel dsoChannel,
                                  final SessionManager sessionManager,
                                  final AbortableOperationManager abortableOperationManager) {
 final GroupID defaultGroups[] = dsoChannel.getGroupIDs();
 Assert.assertNotNull(defaultGroups);
 Assert.assertEquals(1, defaultGroups.length);
 return new RemoteSearchRequestManagerGroupImpl(new OrderedGroupIDs(defaultGroups), logger,
                         dsoChannel.getSearchRequestMessageFactory(),
                      sessionManager, abortableOperationManager);
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
protected void basicSerializeTo(TCByteBufferOutput out) {
 Assert.assertEquals(STRIPEID_MESSAGE, getType());
 new NodeIDSerializer(groupID).serializeTo(out);
 new NodeIDSerializer(stripeID).serializeTo(out);
 out.writeBoolean(isActive);
 out.writeBoolean(remap);
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
protected void basicDeserializeFrom(TCByteBufferInput in) throws IOException {
 Assert.assertEquals(STRIPEID_MESSAGE, getType());
 NodeIDSerializer nodeIDSerializer = new NodeIDSerializer();
 nodeIDSerializer.deserializeFrom(in);
 groupID = (GroupID) nodeIDSerializer.getNodeID();
 nodeIDSerializer = new NodeIDSerializer();
 nodeIDSerializer.deserializeFrom(in);
 stripeID = (StripeID) nodeIDSerializer.getNodeID();
 isActive = in.readBoolean();
 remap = in.readBoolean();
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

@Override
protected void basicDeserializeFrom(TCByteBufferInput in) throws IOException {
 Assert.assertEquals(STRIPEID_MESSAGE, getType());
 NodeIDSerializer nodeIDSerializer = new NodeIDSerializer();
 nodeIDSerializer.deserializeFrom(in);
 groupID = (GroupID) nodeIDSerializer.getNodeID();
 nodeIDSerializer = new NodeIDSerializer();
 nodeIDSerializer.deserializeFrom(in);
 stripeID = (StripeID) nodeIDSerializer.getNodeID();
 isActive = in.readBoolean();
 remap = in.readBoolean();
}

相关文章