@Test @Named("null if spec description is empty") @Order(1) public void _nullIfSpecDescriptionIsEmpty() throws Exception { StringConcatenation _builder = new StringConcatenation(); _builder.append("package test"); _builder.newLine(); _builder.append("describe \"\"{}"); this._modelStore.parseSpec(_builder); String _qualifiedName = this.qualifiedName(); Matcher<String> _nullValue = CoreMatchers.<String>nullValue(); boolean _should_be = Should.<String>should_be(_qualifiedName, _nullValue); Assert.assertTrue( "\nExpected qualifiedName should be null but" + "\n qualifiedName is " + new StringDescription().appendValue(_qualifiedName).toString() + "\n", _should_be); StringConcatenation _builder_1 = new StringConcatenation(); _builder_1.append("describe \"\"{}"); this._modelStore.parseSpec(_builder_1); String _qualifiedName_1 = this.qualifiedName(); Matcher<String> _nullValue_1 = CoreMatchers.<String>nullValue(); boolean _should_be_1 = Should.<String>should_be(_qualifiedName_1, _nullValue_1); Assert.assertTrue( "\nExpected qualifiedName should be null but" + "\n qualifiedName is " + new StringDescription().appendValue(_qualifiedName_1).toString() + "\n", _should_be_1); }
@Test public void testSchemasLocal() throws Exception { final Connection connection = DriverManager.getConnection("jdbc:avatica:remote:factory=" + LJS); assertThat(connection.isClosed(), is(false)); final ResultSet resultSet = connection.getMetaData().getSchemas(); final ResultSetMetaData metaData = resultSet.getMetaData(); assertThat(metaData.getColumnCount(), is(2)); assertThat(metaData.getColumnName(1), is("TABLE_SCHEM")); assertThat(metaData.getColumnName(2), is("TABLE_CATALOG")); assertThat(resultSet.next(), is(true)); assertThat(resultSet.getString(1), equalTo("POST")); assertThat(resultSet.getString(2), CoreMatchers.nullValue()); assertThat(resultSet.next(), is(true)); assertThat(resultSet.getString(1), equalTo("foodmart")); assertThat(resultSet.getString(2), CoreMatchers.nullValue()); assertThat(resultSet.next(), is(true)); assertThat(resultSet.next(), is(true)); assertThat(resultSet.next(), is(false)); resultSet.close(); connection.close(); assertThat(connection.isClosed(), is(true)); }
@Test public void shouldGetAntonymFromOtherSide() { wordRepository.save(happy); wordRepository.save(sad); wordRepository.save(earth); assertThat("sad's antonym count", sad.getAntonymsCount(), is(0)); // as earth and sky both are under controll of springdata graph, no need to further call // earth.save() happy.antonymWith(sad, "feel good vs feel bad'"); assertThat("sad's antonym count", sad.getAntonymsCount(), is(equalTo(1))); assertThat("sad's antonym contains happy", sad.getAntonyms(), hasItem(happy)); Relationship relationship = happy.getSynonymRelationshipTo(sad); assertThat( "relationship should work properly", relationship, is(CoreMatchers.<Object>nullValue())); Set<Relationship> relationships = happy.getRelationshipsTo(earth); assertThat(relationships.size(), is(0)); }
@Test public void testAllNoGo_yieldNull() { Cook p1 = createPerson("a", newHashSet(FRIDAY), newHashSet(MONDAY)); Cook p2 = createPerson("b", newHashSet(THURSDAY), newHashSet(MONDAY)); Cook p3 = createPerson("c", newHashSet(WEDNESDAY), newHashSet(MONDAY)); CookingDay c1 = new CookingDay(p1, LocalDate.of(2015, 8, 10)); CookingDay c2 = new CookingDay(p1, LocalDate.of(2015, 8, 11)); CookingDay c3 = new CookingDay(p2, LocalDate.of(2015, 8, 12)); CookingDay c4 = new CookingDay(p2, LocalDate.of(2015, 8, 13)); CookingDay c5 = new CookingDay(p3, LocalDate.of(2015, 8, 7)); kl = new CookingListImpl(Arrays.asList(p1, p2, p3), Arrays.asList(c1, c2, c3, c4, c5)); // Monday CookingDay day = kl.determineCookFor(LocalDate.of(2015, 8, 24)); assertThat(day, Is.is(CoreMatchers.nullValue())); }
@Test public void testLookupNotFound() throws Exception { artifactVersion = new ArtifactVersion(ARTIFACT, "1.2-SNAPSHOT"); assertThat(repository.lookup(artifactVersion), CoreMatchers.<Object>nullValue()); }