Refine search
void assertDoesNotHaveAnyDeletions() { assertThat( "Should not have any deletions registered", deletedFiles, Matchers.empty() ); } }
@Test public void createApproximateCollectionFromEmptyEnumSet() { Collection<Color> colors = createApproximateCollection(EnumSet.noneOf(Color.class), 2); assertThat(colors, is(empty())); }
@Test public void createApproximateCollectionFromNonEmptyHashSet() { HashSet<String> hashSet = new HashSet<>(); hashSet.add("foo"); Collection<String> set = createApproximateCollection(hashSet, 2); assertThat(set, is(empty())); }
public File getJarForClass(Class<?> cls) throws IOException { String path = cls.getPackage().getName().replace('.', '/'); List<File> list; if (!withDebugInfo) { list = compileClass(cls); } else { list = getClassFilesWithInners(cls); if (list.isEmpty()) { list = compileClass(cls); } } assertThat("File list is empty", list, not(empty())); File temp = createTempFile(".jar"); try (JarOutputStream jo = new JarOutputStream(new FileOutputStream(temp))) { for (File file : list) { addFileToJar(jo, file, path + "/" + file.getName()); } } return temp; }
@Test public void createApproximateCollectionFromNonEmptyEnumSet() { Collection<Color> colors = createApproximateCollection(EnumSet.of(Color.BLUE), 2); assertThat(colors, is(empty())); }
@Test public void shouldNotMatchIfNodeIsMissingProperty() { // when List<IndexDescriptor> matched = new ArrayList<>(); NodeSchemaMatcher.onMatchingSchema( iterator( indexWithMissingProperty ), node, new StubPropertyCursor(), unIndexedPropId, ( schema, props ) -> matched.add( schema ) ); // then assertThat( matched, empty() ); }
public void activateConnectionAndAssert(ConnectionSubscriber subscriber) throws Exception { handler.userEventTriggered(ctx, EmitConnectionEvent.INSTANCE); subscriber.assertTerminalEvent(); subscriber.assertNoErrors(); assertThat("No connections received.", subscriber.getOnNextEvents(), is(not(empty()))); assertThat("Unexpected channel in new connection.", subscriber.getOnNextEvents().get(0), is(channel)); }
@Test public void createApproximateCollectionFromEmptyHashSet() { Collection<String> set = createApproximateCollection(new HashSet<String>(), 2); assertThat(set, is(empty())); }
@Test public void shouldNotMatchIfNodeIsMissingLabel() { // when List<IndexDescriptor> matched = new ArrayList<>(); NodeSchemaMatcher.onMatchingSchema( iterator( indexWithMissingLabel ), node, new StubPropertyCursor(), unIndexedPropId, ( schema, props ) -> matched.add( schema ) ); // then assertThat( matched, empty() ); }
void shouldNotNotifyInStream( String version, String query ) { // when Result result = db().execute( version + query ); // then assertThat( Iterables.asList( result.getNotifications() ), empty() ); Map<String,Object> arguments = result.getExecutionPlanDescription().getArguments(); assertThat( arguments.get( "version" ), equalTo( version ) ); result.close(); }
@Test public void shouldNotFailForNullClassLoader() { assertThat( fullClasspathFor( null ), not( empty() ) ); }
@Test public void trackPopulationJobs() { assertThat( jobController.getPopulationJobs(), is( empty() ) ); IndexPopulationJob populationJob = mock( IndexPopulationJob.class ); jobController.startIndexPopulation( populationJob ); assertThat( jobController.getPopulationJobs(), hasSize( 1 ) ); IndexPopulationJob populationJob2 = mock( IndexPopulationJob.class ); jobController.startIndexPopulation( populationJob2 ); assertThat( jobController.getPopulationJobs(), hasSize( 2 ) ); }
@Theory public void theoryUndefinedHaveEmptyListOfChildren(String path) throws Exception { Resource res = getResource(path); assumeThat(res, is(undefined())); Collection<Resource> result = res.list(); assertThat(result, empty()); }
@Test public void noLocksTakenForQueryWithoutAnyIndexesUsage() throws Exception { String query = "MATCH (n) return count(n)"; List<LockOperationRecord> lockOperationRecords = traceQueryLocks( query ); assertThat( "Observed list of lock operations is: " + lockOperationRecords, lockOperationRecords, is( empty() ) ); }
@Theory public void theoryChildrenKnowTheirParents(String path) throws Exception { Resource res = getResource(path); assumeThat(res, is(directory())); Collection<Resource> children = res.list(); assumeThat(children, not(empty())); // Make sure this resource has children for (Resource child : children) { Resource parent = child.parent(); assertThat(parent, equalTo(res)); } }
@Test public void nextNumberValue() { HashSet<Class<? extends NumberValue>> seen = new HashSet<>( NUMBER_TYPES ); for ( int i = 0; i < ITERATIONS; i++ ) { NumberValue numberValue = randomValues.nextNumberValue(); assertThat( NUMBER_TYPES, hasItem( numberValue.getClass() ) ); seen.remove( numberValue.getClass() ); } assertThat( seen, empty() ); }