本文整理汇总了Java中junit.framework.Assert.assertNotSame方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.assertNotSame方法的具体用法?Java Assert.assertNotSame怎么用?Java Assert.assertNotSame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类junit.framework.Assert
的用法示例。
在下文中一共展示了Assert.assertNotSame方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMergeWithUpdateKeyOfUU
import junit.framework.Assert; //导入方法依赖的package包/类
/**
* 测试在主键发生变化后的merge操作,Update/Update
*/
@Test
public void testMergeWithUpdateKeyOfUU() {
Map<RowKey, EventData> mergeMap = new MapMaker().makeMap();
DbLoadMerger.merge(makeUpdateEventData(KEY_VALUE, KEY_VALUE_NEW1), mergeMap);
DbLoadMerger.merge(makeUpdateEventData(KEY_VALUE_NEW1, KEY_VALUE_NEW2), mergeMap);
for (Entry<RowKey, EventData> entry : mergeMap.entrySet()) {
RowKey key = entry.getKey();
EventColumn keyColumn = key.getKeys().get(0);
Assert.assertEquals(KEY_VALUE_NEW2, keyColumn.getColumnValue());
Assert.assertEquals(KEY_NAME, keyColumn.getColumnName());
EventData eventData = entry.getValue();
Assert.assertEquals(SCHEMA_NAME, eventData.getSchemaName());
Assert.assertEquals(TABLE_NAME, eventData.getTableName());
Assert.assertEquals(TABLE_ID, eventData.getTableId());
Assert.assertEquals(EventType.UPDATE, eventData.getEventType());
List<EventColumn> oldKeys = eventData.getOldKeys();
List<EventColumn> keys = eventData.getKeys();
Assert.assertNotSame(oldKeys, keys);
}
}
示例2: testMergeWithUpdateKeyOfUI
import junit.framework.Assert; //导入方法依赖的package包/类
/**
* 测试在主键发生变化后的merge操作,Update/Update/Insert
*/
@Test
public void testMergeWithUpdateKeyOfUI() {
Map<RowKey, EventData> mergeMap = new MapMaker().makeMap();
DbLoadMerger.merge(makeUpdateEventData(KEY_VALUE_NEW1, KEY_VALUE_NEW2), mergeMap);
DbLoadMerger.merge(makeUpdateEventData(KEY_VALUE_NEW2, KEY_VALUE), mergeMap);
DbLoadMerger.merge(makeInsertEventData(), mergeMap);
for (Entry<RowKey, EventData> entry : mergeMap.entrySet()) {
RowKey key = entry.getKey();
EventColumn keyColumn = key.getKeys().get(0);
Assert.assertEquals(KEY_VALUE, keyColumn.getColumnValue());
Assert.assertEquals(KEY_NAME, keyColumn.getColumnName());
EventData eventData = entry.getValue();
Assert.assertEquals(SCHEMA_NAME, eventData.getSchemaName());
Assert.assertEquals(TABLE_NAME, eventData.getTableName());
Assert.assertEquals(TABLE_ID, eventData.getTableId());
Assert.assertEquals(EventType.INSERT, eventData.getEventType());
List<EventColumn> oldKeys = eventData.getOldKeys();
List<EventColumn> keys = eventData.getKeys();
Assert.assertNotSame(oldKeys, keys);
}
}
示例3: testMergeWithUpdateKeyOfII
import junit.framework.Assert; //导入方法依赖的package包/类
/**
* 测试在主键发生变化后的merge操作,Insert/Insert
*/
@Test
public void testMergeWithUpdateKeyOfII() {
Map<RowKey, EventData> mergeMap = new MapMaker().makeMap();
DbLoadMerger.merge(makeInsertEventData(), mergeMap);
DbLoadMerger.merge(makeInsertEventData(), mergeMap);
for (Entry<RowKey, EventData> entry : mergeMap.entrySet()) {
RowKey key = entry.getKey();
EventColumn keyColumn = key.getKeys().get(0);
Assert.assertEquals(KEY_VALUE, keyColumn.getColumnValue());
Assert.assertEquals(KEY_NAME, keyColumn.getColumnName());
EventData eventData = entry.getValue();
Assert.assertEquals(SCHEMA_NAME, eventData.getSchemaName());
Assert.assertEquals(TABLE_NAME, eventData.getTableName());
Assert.assertEquals(TABLE_ID, eventData.getTableId());
Assert.assertEquals(EventType.INSERT, eventData.getEventType());
List<EventColumn> oldKeys = eventData.getOldKeys();
List<EventColumn> keys = eventData.getKeys();
Assert.assertNotSame(oldKeys, keys);
}
}
示例4: startSyncTest
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void startSyncTest() {
Class<?> reflected = showDoc.getClass();
try {
Field bufferSyncDataField = reflected.getDeclaredField("bufferSyncData");
bufferSyncDataField.setAccessible(true);
bufferSyncDataField.set(showDoc,null);
showDoc.startSync();
Field currentSyncDataField = reflected.getDeclaredField("currentSyncData");
currentSyncDataField.setAccessible(true);
currentSyncDataField.set(showDoc,currentSyncData);
currentSyncData.add(10);
LinkedList<ArrayList<Integer>> bufferSyncData = new LinkedList<>();
LinkedList<ArrayList<Integer>> bufferSyncDataCorrect = new LinkedList<>();
bufferSyncData.add(currentSyncData);
bufferSyncDataCorrect.add(currentSyncData);
bufferSyncDataField.set(showDoc,bufferSyncData);
showDoc.startSync();
Assert.assertNotSame(bufferSyncDataCorrect.toString(),bufferSyncDataField.get(showDoc).toString());
} catch(Exception e) {
assertFalse(true);
}
}
示例5: testTitleString
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testTitleString() {
//Strings
alert.setTitle(HELLO);
Assert.assertTrue(alert.getTitle().getVisibility() == View.VISIBLE);
Assert.assertNotNull(alert.getTitle().getText());
Assert.assertEquals(HELLO, alert.getTitle().getText());
Assert.assertNotSame(HI, alert.getTitle().getText());
}
示例6: testTitleStringRes
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testTitleStringRes() {
//String Resources
alert.setTitle(R.string.lib_name);
Assert.assertTrue(alert.getTitle().getVisibility() == View.VISIBLE);
Assert.assertNotNull(alert.getTitle().getText());
Assert.assertEquals(ALERTER, alert.getTitle().getText());
Assert.assertNotSame(HI, alert.getTitle().getText());
}
示例7: testTextString
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testTextString() {
//Strings
alert.setText(HELLO);
Assert.assertTrue(alert.getText().getVisibility() == View.VISIBLE);
Assert.assertNotNull(alert.getText().getText());
Assert.assertEquals(HELLO, alert.getText().getText());
Assert.assertNotSame(HI, alert.getText().getText());
}
示例8: testConfigUpdate
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testConfigUpdate() {
this.service.setValueFor("tst.key.a", "tst.key.a.newValue");
Assert.assertNotSame(testKeyA, "tst.key.a.newValue");
ConfigurationValue value = this.service.getValue("tst.key.a");
Assert.assertSame(value.getValue(), "tst.key.a.newValue");
}
示例9: testParseAllExamplesWithoutException
import junit.framework.Assert; //导入方法依赖的package包/类
public void testParseAllExamplesWithoutException() {
final ExampleLoader exampleLoader = new ExampleLoader(getInstrumentation().getTargetContext());
final List<String> xmlPaths = exampleLoader.discoverAllXmlFiles();
Assert.assertNotSame(xmlPaths.size(), 0);
for (String xmlPath : xmlPaths) {
final ExampleKey key = exampleLoader.parseKey(xmlPath);
Assert.assertNotNull(key);
final ExampleDefinition definition = exampleLoader.parseDefinition(xmlPath);
Assert.assertNotNull(definition);
}
}
示例10: testDispoableChannel
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testDispoableChannel() throws Exception {
String agentName = "agent1";
Map<String, String> properties = getPropertiesForChannel(agentName,
DisposableChannel.class.getName());
MemoryConfigurationProvider provider =
new MemoryConfigurationProvider(agentName, properties);
MaterializedConfiguration config1 = provider.getConfiguration();
Channel channel1 = config1.getChannels().values().iterator().next();
Assert.assertTrue(channel1 instanceof DisposableChannel);
MaterializedConfiguration config2 = provider.getConfiguration();
Channel channel2 = config2.getChannels().values().iterator().next();
Assert.assertTrue(channel2 instanceof DisposableChannel);
Assert.assertNotSame(channel1, channel2);
}
示例11: testReusableChannelNotReusedLater
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testReusableChannelNotReusedLater() throws Exception {
String agentName = "agent1";
Map<String, String> propertiesReusable = getPropertiesForChannel(agentName,
RecyclableChannel.class
.getName());
Map<String, String> propertiesDispoable = getPropertiesForChannel(agentName,
DisposableChannel.class
.getName());
MemoryConfigurationProvider provider =
new MemoryConfigurationProvider(agentName, propertiesReusable);
MaterializedConfiguration config1 = provider.getConfiguration();
Channel channel1 = config1.getChannels().values().iterator().next();
Assert.assertTrue(channel1 instanceof RecyclableChannel);
provider.setProperties(propertiesDispoable);
MaterializedConfiguration config2 = provider.getConfiguration();
Channel channel2 = config2.getChannels().values().iterator().next();
Assert.assertTrue(channel2 instanceof DisposableChannel);
provider.setProperties(propertiesReusable);
MaterializedConfiguration config3 = provider.getConfiguration();
Channel channel3 = config3.getChannels().values().iterator().next();
Assert.assertTrue(channel3 instanceof RecyclableChannel);
Assert.assertNotSame(channel1, channel3);
}
示例12: testRegistryFactoryGroupCache
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testRegistryFactoryGroupCache() throws Exception {
Registry registry1 = registryFactory.getRegistry(URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":2233?group=aaa"));
Registry registry2 = registryFactory.getRegistry(URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":2233?group=bbb"));
Assert.assertNotSame(registry1, registry2);
}
示例13: testMonitorFactoryGroupCache
import junit.framework.Assert; //导入方法依赖的package包/类
@Test
public void testMonitorFactoryGroupCache() throws Exception {
Monitor monitor1 = monitorFactory.getMonitor(URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":2233?group=aaa"));
Monitor monitor2 = monitorFactory.getMonitor(URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":2233?group=bbb"));
Assert.assertNotSame(monitor1, monitor2);
}