當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。