当前位置: 首页>>代码示例>>Java>>正文


Java Assert.assertNotSame方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:27,代码来源:DbLoadMergerTest.java

示例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);
    }
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:29,代码来源:DbLoadMergerTest.java

示例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);
    }
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:28,代码来源:DbLoadMergerTest.java

示例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);
    }
}
 
开发者ID:Visions-Team,项目名称:eBread,代码行数:29,代码来源:ShowDocumentFragmentTest.java

示例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());
}
 
开发者ID:Tapadoo,项目名称:Alerter,代码行数:11,代码来源:AlertTest.java

示例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());
}
 
开发者ID:Tapadoo,项目名称:Alerter,代码行数:11,代码来源:AlertTest.java

示例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());
}
 
开发者ID:Tapadoo,项目名称:Alerter,代码行数:11,代码来源:AlertTest.java

示例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");
}
 
开发者ID:namics,项目名称:spring-configuration-support,代码行数:8,代码来源:ConfigurationValueServiceDEVTest.java

示例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);
    }
}
 
开发者ID:ABTSoftware,项目名称:SciChart.Android.Examples,代码行数:12,代码来源:ExampleLoaderTests.java

示例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);
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:16,代码来源:TestAbstractConfigurationProvider.java

示例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);
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:28,代码来源:TestAbstractConfigurationProvider.java

示例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);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:7,代码来源:AbstractRegistryFactoryTest.java

示例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);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:7,代码来源:AbstractMonitorFactoryTest.java


注:本文中的junit.framework.Assert.assertNotSame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。