本文整理汇总了Java中org.junit.Assert.assertNotEquals方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.assertNotEquals方法的具体用法?Java Assert.assertNotEquals怎么用?Java Assert.assertNotEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.Assert
的用法示例。
在下文中一共展示了Assert.assertNotEquals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUpdateByPrimaryKey
import org.junit.Assert; //导入方法依赖的package包/类
/**
* 根据主键全更新
*/
@Test
public void testUpdateByPrimaryKey() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
UserInfoAbleMapper mapper = sqlSession.getMapper(UserInfoAbleMapper.class);
UserInfoAble userInfo = mapper.selectByPrimaryKey(2);
Assert.assertNotNull(userInfo);
userInfo.setUsertype(null);
userInfo.setEmail("[email protected]");
userInfo.setAddress("这个地址不会更新进去");//update=false
//不会更新username
Assert.assertEquals(1, mapper.updateByPrimaryKey(userInfo));
userInfo = mapper.selectByPrimaryKey(userInfo);
Assert.assertNull(userInfo.getUsertype());
Assert.assertNotEquals("这个地址不会更新进去", userInfo.getAddress());
Assert.assertEquals("[email protected]", userInfo.getEmail());
} finally {
sqlSession.rollback();
sqlSession.close();
}
}
示例2: testEqualsAndHashCode
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testEqualsAndHashCode() {
Person person = new Person();
person.setName("张三");
person.setAge(20);
person.setSex("男");
Person person2 = new Person();
person2.setName("张三");
person2.setAge(18);
person2.setSex("男");
Person person3 = new Person();
person3.setName("李四");
person3.setAge(20);
person3.setSex("男");
Assert.assertEquals(person, person2);
Assert.assertNotEquals(person, person3);
}
示例3: testScopeBean
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testScopeBean() {
ExampleScopeBean singletonBean1 = context.getBean("singletonBean", ExampleScopeBean.class);
ExampleScopeBean singletonBean2 = context.getBean("singletonBean", ExampleScopeBean.class);
ExampleScopeBean prototypeBean1 = context.getBean("prototypeBean", ExampleScopeBean.class);
ExampleScopeBean prototypeBean2 = context.getBean("prototypeBean", ExampleScopeBean.class);
Assert.assertEquals(singletonBean1, singletonBean2);
Assert.assertNotEquals(prototypeBean1, prototypeBean2);
//test singleton
// check message
Assert.assertEquals(singletonBean1.getMessage(), singletonBean2.getMessage());
// update message
singletonBean1.setMessage("new hello");
// recheck message
Assert.assertEquals(singletonBean1.getMessage(), singletonBean2.getMessage());
//test prototype
// check message
Assert.assertEquals(prototypeBean1.getMessage(), prototypeBean2.getMessage());
// update message
prototypeBean1.setMessage("new hello");
// recheck message
Assert.assertNotEquals(prototypeBean1.getMessage(), prototypeBean2.getMessage());
}
示例4: testCreateDynamicConfigNoConfigCenterSPI
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testCreateDynamicConfigNoConfigCenterSPI() {
new Expectations(SPIServiceUtils.class) {
{
SPIServiceUtils.getTargetService(ConfigCenterConfigurationSource.class);
result = null;
}
};
AbstractConfiguration dynamicConfig = ConfigUtil.createDynamicConfig();
MicroserviceConfigLoader loader = ConfigUtil.getMicroserviceConfigLoader(dynamicConfig);
List<ConfigModel> list = loader.getConfigModels();
Assert.assertEquals(loader, ConfigUtil.getMicroserviceConfigLoader(dynamicConfig));
Assert.assertEquals(1, list.size());
Assert.assertNotEquals(DynamicWatchedConfiguration.class,
((ConcurrentCompositeConfiguration) dynamicConfig).getConfiguration(0).getClass());
}
示例5: testCreateCheckoutToken
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testCreateCheckoutToken() {
TokenService service = AfricasTalking.getService(TokenService.class);
try {
final CheckoutTokenResponse response = service.createCheckoutToken("0718769882");
Assert.assertNotEquals("None", response.token);
} catch (IOException e) {
Assert.fail(e.getMessage());
}
}
示例6: testPullRemoteChangesOnlyResultsInModifiedLocalDecisions
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testPullRemoteChangesOnlyResultsInModifiedLocalDecisions() throws Exception {
seRepoTestServer.createCommit(TestDataProvider.createChangedTestSeItemsWithContentModified(),
CommitMode.ADD_UPDATE);
PULL_COMMAND.pull();
Assert.assertNotEquals(commitId, COMMIT_COMMAND.readCommitId());
}
示例7: testString
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testString() {
Json s1 = Json.make("");
Assert.assertEquals("", s1.getValue());
Json s1dup = s1.dup();
Assert.assertFalse(s1dup == s1);
Assert.assertEquals(s1, s1dup);
Json s2 = Json.make("string1");
Json s2again = Json.factory().string("string1");
Assert.assertEquals(s2, s2again);
Json s3 = Json.make("Case Sensitive");
Json s3_lower = Json.make("Case Sensitive".toLowerCase());
Assert.assertNotEquals(s3, s3_lower);
}
示例8: updateResource
import org.junit.Assert; //导入方法依赖的package包/类
@Override
public SearchService updateResource(SearchService resource) throws Exception {
resource.createQueryKey("testKey1");
resource = resource.update()
.withTag("tag2", "value2")
.withTag("tag3", "value3")
.withoutTag("tag1")
.withReplicaCount(1)
.withPartitionCount(1)
.apply();
Assert.assertTrue(resource.tags().containsKey("tag2"));
Assert.assertTrue(!resource.tags().containsKey("tag1"));
Assert.assertEquals(1, resource.replicaCount());
Assert.assertEquals(1, resource.partitionCount());
Assert.assertEquals(2, resource.listQueryKeys().size());
String adminKeyPrimary = resource.getAdminKeys().primaryKey();
String adminKeySecondary = resource.getAdminKeys().secondaryKey();
resource.deleteQueryKey(resource.listQueryKeys().get(1).key());
resource.regenerateAdminKeys(AdminKeyKind.PRIMARY);
resource.regenerateAdminKeys(AdminKeyKind.SECONDARY);
Assert.assertEquals(1, resource.listQueryKeys().size());
Assert.assertNotEquals(adminKeyPrimary, resource.getAdminKeys().primaryKey());
Assert.assertNotEquals(adminKeySecondary, resource.getAdminKeys().secondaryKey());
return resource;
}
示例9: testClear
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testClear() throws SQLException, NoSuchFieldException, SecurityException, IllegalArgumentException,
IllegalAccessException
{
for (int i = 0; i < 2; i++)
{
MetaDataStore subject = new MetaDataStore(CloudSpannerTestObjects.createConnection());
TableKeyMetaData fooUpperCase = subject.getTable("FOO");
TableKeyMetaData fooLowerCase = subject.getTable("foo");
TableKeyMetaData bar = subject.getTable("Bar");
assertNotNull(fooLowerCase);
assertNotNull(fooUpperCase);
assertNotNull(bar);
assertEquals(fooLowerCase, fooUpperCase);
Assert.assertNotEquals(fooLowerCase, bar);
Field field = MetaDataStore.class.getDeclaredField("tables");
field.setAccessible(true);
@SuppressWarnings("unchecked")
Map<String, TableKeyMetaData> map = (Map<String, TableKeyMetaData>) field.get(subject);
assertEquals(map.size(), 2);
subject.clearTable("Foo");
assertEquals(map.size(), 1);
subject.clear();
assertEquals(map.size(), 0);
}
}
示例10: testSetInputBufferSize
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void testSetInputBufferSize() throws IOException {
Assert.assertNotEquals(17, uncompressor.getInputBufferSize()); // Ensure test is valid
uncompressor.setInputBufferSize(17); // Arbitrary non-default value
Assert.assertEquals(17, uncompressor.getInputBufferSize());
uncompressor.uncompress(compressedContentIn, uncompressedContentOut);
Assert.assertArrayEquals(CONTENT, uncompressedContentOut.toByteArray());
}
示例11: TestGetTemplateByUserIdEquals
import org.junit.Assert; //导入方法依赖的package包/类
/**
* 验证按照算法计算出来的ID属于同一个数据库;
*/
@Test
public void TestGetTemplateByUserIdEquals() {
Assert.assertEquals(sharder.getTemplateByUserId(1081l),sharder.getTemplateByUserId(1063l));
Assert.assertEquals(sharder.getTemplateByUserId(1081l),sharder.getTemplateByUserId(1049l));
Assert.assertNotEquals(sharder.getTemplateByUserId(1081l),sharder.getTemplateByUserId(1079l));
}
示例12: testGetProxyByAnnotation4
import org.junit.Assert; //导入方法依赖的package包/类
@Test
//with super interface
public void testGetProxyByAnnotation4() {
I4_1 c1 = new C4();
I4_1 c2 = ProxyUtil.getProxyByAnnotation(c1, globalCacheConfig);
Assert.assertNotEquals(c1.count(), c1.count());
Assert.assertNotEquals(c1.countWithoutCache(), c1.countWithoutCache());
Assert.assertEquals(c2.count(), c2.count());
Assert.assertNotEquals(c2.countWithoutCache(), c2.countWithoutCache());
}
示例13: findByCategoryTypeIn
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void findByCategoryTypeIn() {
List<Integer> list = Arrays.asList(2, 3, 4);
List<ProductCategory> productCategoryList = productCategoryRepository.findByCategoryTypeIn(list);
Assert.assertNotEquals(0, productCategoryList.size());
}
示例14: before
import org.junit.Assert; //导入方法依赖的package包/类
@Before
public void before() throws IOException, InterruptedException, ExecutionException {
web3j = Web3j.build(new HttpService());
EthAccounts accounts = web3j.ethAccounts().send();
Assert.assertNotEquals(0, accounts.getAccounts().size());
// use the first account as the main account for the tests
mainAccountAddress = accounts.getAccounts().get(0);
// deploy the contract
txManager = new ClientTransactionManager(web3j, mainAccountAddress);
bankAccountContract = BankAccount.deploy(web3j, txManager, GAS_PRICE, GAS_LIMIT, BigInteger.valueOf(0))
.get();
}
开发者ID:SenthuranSivananthan,项目名称:devops-blockchain-jenkins,代码行数:16,代码来源:BankAccountSmartContractTests.java
示例15: runEmpty
import org.junit.Assert; //导入方法依赖的package包/类
@Test
public void runEmpty() throws Exception {
Application application = new TestApplication();
Assert.assertNotEquals(RUN_STATUS_OK, application.run(new String[]{}));
}