當前位置: 首頁>>代碼示例>>Java>>正文


Java Assertions.assertNotNull方法代碼示例

本文整理匯總了Java中org.junit.jupiter.api.Assertions.assertNotNull方法的典型用法代碼示例。如果您正苦於以下問題:Java Assertions.assertNotNull方法的具體用法?Java Assertions.assertNotNull怎麽用?Java Assertions.assertNotNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.junit.jupiter.api.Assertions的用法示例。


在下文中一共展示了Assertions.assertNotNull方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getValue

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@ParameterizedTest
@MethodSource("valuesStream")
void getValue(final Value value) {
    for (int i = 0; i < value.size(); i++) {
        Assertions.assertNotNull(value.getValue(i));
    }
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:8,代碼來源:ValueTest.java

示例2: canFindTemplates

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void canFindTemplates() throws Exception {
	TestHTMLReportWriter writer = new TestHTMLReportWriter("");
	try (InputStream template = writer.getTemplate("index.html")) {
		Assertions.assertNotNull(template);
	} catch (IOException e) {
		throw e;
	}
}
 
開發者ID:kncept,項目名稱:junit-reporter,代碼行數:10,代碼來源:TestHTMLReportWriterTest.java

示例3: getSortNullFirst

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void getSortNullFirst() {
    final SortField sortFieldNullFirstAscInt = intSortValue.getSortFieldNullFirst(SortOrder.ASC);
    final SortField sortFieldNullFirstDescInt = intSortValue.getSortFieldNullFirst(SortOrder.DESC);

    final SortField sortFieldNullFirstAscString = stringSortValue.getSortFieldNullFirst(SortOrder.ASC);
    final SortField sortFieldNullFirstDescString = stringSortValue.getSortFieldNullFirst(SortOrder.DESC);

    Assertions.assertNotNull(sortFieldNullFirstAscInt);
    Assertions.assertNotNull(sortFieldNullFirstDescInt);
    Assertions.assertNotNull(sortFieldNullFirstAscString);
    Assertions.assertNotNull(sortFieldNullFirstDescString);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:14,代碼來源:SortValueTest.java

示例4: testClassConstructingWithArgs

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassConstructingWithArgs() throws Exception {
    Class<TestClassTwo> testClass = TestClassTwo.class;
    ClassWrapper<TestClassTwo> cw = Reflect.wrapClass(testClass)
            .construct(of("foo"));
    Assertions.assertNotNull(cw.getClassInstance(), "Class instance shouldn't be null!");
    TestClassTwo inst = cw.getClassInstance();
    Assertions.assertEquals("foo", inst.getA());
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:10,代碼來源:ClassWrapperTester.java

示例5: ofDateTimeIsSingleton

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void ofDateTimeIsSingleton() {
    final FilterParser<LocalDateTime> filterParser1 = FilterParser.ofDateTime();
    final FilterParser<LocalDateTime> filterParser2 = FilterParser.ofDateTime();
    Assertions.assertNotNull(filterParser1);
    Assertions.assertSame(filterParser1, filterParser2);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:8,代碼來源:FilterParserTest.java

示例6: of2KeyParser

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void of2KeyParser() {
    final FilterValue filterValue2 =
        Filter.of(
            KeyParsers.of("key", val1 -> "value", "key2", val2 -> "value"),
            (value1, value2) -> DSL.trueCondition());
    Assertions.assertEquals(2, filterValue2.size());
    Assertions.assertNotNull(filterValue2);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:10,代碼來源:FilterTest.java

示例7: ofIntIsSingleton

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void ofIntIsSingleton() {
    final FilterParser<Integer> filterParser1 = FilterParser.ofInt();
    final FilterParser<Integer> filterParser2 = FilterParser.ofInt();
    Assertions.assertNotNull(filterParser1);
    Assertions.assertSame(filterParser1, filterParser2);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:8,代碼來源:FilterParserTest.java

示例8: testParametersNeedExtraAnnotation

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
@ExtendWith(CustomExtension.class)
public void testParametersNeedExtraAnnotation(@Default Foo foo, Bar bar, @MyQualifier BeanWithQualifier bean) {
    // Bar should be resolved by another extension
    Assertions.assertNotNull(bar);
    Assertions.assertEquals(CustomExtension.class.getSimpleName(), bar.ping());
    // Foo should be resolved as usual
    Assertions.assertNotNull(foo);
    Assertions.assertEquals(Foo.class.getSimpleName(), foo.ping());
    // BeanWithQualifier should be resolved
    Assertions.assertNotNull(bean);
    Assertions.assertEquals(BeanWithQualifier.class.getSimpleName(), bean.ping());
}
 
開發者ID:weld,項目名稱:weld-junit,代碼行數:14,代碼來源:ExplicitParameterInjectionViaClassAnnotationTest.java

示例9: of4KeyParser

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void of4KeyParser() {
    final FilterValue filterValue4 = Filter.of(
        KeyParsers.of("key", val1 -> "value", "key2", val2 -> "value", "key3", val3 -> "value", "key4", val4 -> "value"),
        value -> DSL.trueCondition());
    Assertions.assertEquals(4, filterValue4.size());
    Assertions.assertNotNull(filterValue4);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:9,代碼來源:FilterTest.java

示例10: testClassFinding

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassFinding() throws Exception {
    Class<?> testClass = TestClassOne.class;
    String className = testClass.getName();

    ClassWrapper<?> cw = Reflect.getClass(className).orElse(null);
    Assertions.assertNotNull(cw, "Class wrapper shouldn't be null!");
    Assertions.assertEquals(testClass, cw.getWrappedClass(), "Classes weren't equal!");
    Assertions.assertNull(cw.getClassInstance(), "Class instance shouldn't be set!");
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:11,代碼來源:ClassWrapperTester.java

示例11: getKeyParser5

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void getKeyParser5() {
    final KeyParser5 keyParser = filterValue5.getKeyParser5();
    Assertions.assertNotNull(keyParser);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:6,代碼來源:FilterValueTest.java

示例12: getTestJdbcUrl

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Nonnull
protected static String getTestJdbcUrl() {
    String jdbc = System.getenv(TEST_JDBC_URL_ENV);
    Assertions.assertNotNull(jdbc, String.format("Jdbc test url %s environment variable is null", TEST_JDBC_URL_ENV));
    return jdbc;
}
 
開發者ID:napstr,項目名稱:SqlSauce,代碼行數:7,代碼來源:BaseTest.java

示例13: description

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void description() {
    Assertions.assertNotNull(command.description());
    Assertions.assertTrue(command.description().length() == 0);
}
 
開發者ID:ViniciusArnhold,項目名稱:ProjectAltaria,代碼行數:6,代碼來源:AbstractCommandTest.java

示例14: testLoadJ3o

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void testLoadJ3o() {
    final AssetManager assetManager = getApplication().getAssetManager();
    final Spatial model = assetManager.loadModel("com/ss/editor/extension/testCube.j3o");
    Assertions.assertNotNull(model);
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder-extension,代碼行數:7,代碼來源:LoaderTest.java

示例15: of1

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void of1() {
    final FilterValue filterValue1 = Filter.of("key", val -> "value", value -> DSL.trueCondition());
    Assertions.assertEquals(1, filterValue1.size());
    Assertions.assertNotNull(filterValue1);
}
 
開發者ID:Blackdread,項目名稱:filter-sort-jooq-api,代碼行數:7,代碼來源:FilterTest.java


注:本文中的org.junit.jupiter.api.Assertions.assertNotNull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。