input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testLimitLogs ( ) { java . util . Date start = getDate ( 2007 , 0 , 1 ) ; java . util . Date end = getDate ( 2007 , 0 , 10 ) ; com . ewcms . common . query . jpa . EntityQueryTemplate joinTemplate = new com . ewcms . common . query . jpa . EntityQueryTemplate ( entityManagerFactory . createEntityManager ( ) , com . ewcms . common . query . model . LimitLog . class ) ; joinTemplate . eq ( "certificate.name" , "" ) ; joinTemplate . between ( "date" , start , end ) ; java . util . List < java . lang . Object > list = joinTemplate . getResultList ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . size ; }
|
org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 3 ) )
|
test_contactdb_recipients_search_get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "contactdb/recipients/search" ) ; request . addQueryParam ( "{field_name}" , "test_string" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) )
|
shouldLimitAndDeduplicateEntries ( ) { final uk . gov . gchq . gaffer . commonutil . iterable . LimitedInMemorySortedIterable < java . lang . Integer > list = new uk . gov . gchq . gaffer . commonutil . iterable . LimitedInMemorySortedIterable < java . lang . Integer > ( java . util . Comparator . naturalOrder ( ) , 2 , true ) ; list . add ( 1 ) ; list . add ( 1 ) ; list . add ( 2 ) ; list . add ( 1 ) ; list . add ( 2 ) ; list . add ( 10 ) ; "<AssertPlaceHolder>" ; } add ( uk . gov . gchq . gaffer . data . element . Element ) { if ( null == element ) { return ; } if ( null == ( queue ) ) { queue = new uk . gov . gchq . gaffer . commonutil . iterable . ConsumableBlockingQueue ( maxQueueSize ) ; restart = true ; } try { queue . put ( element ) ; } catch ( final java . lang . InterruptedException e ) { throw new java . lang . RuntimeException ( "Interrupted<sp>while<sp>waiting<sp>to<sp>add<sp>an<sp>element<sp>to<sp>the<sp>queue" , e ) ; } if ( ( restart ) && ( ! ( queue . isEmpty ( ) ) ) ) { restart = false ; store . runAsync ( ( ) -> { try { store . execute ( new uk . gov . gchq . gaffer . operation . impl . add . AddElements . Builder ( ) . input ( queue ) . validate ( validate ) . skipInvalidElements ( skipInvalid ) . build ( ) , new uk . gov . gchq . gaffer . store . Context ( new uk . gov . gchq . gaffer . user . User ( ) ) ) ; restart = true ; } catch ( final e ) { throw new < uk . gov . gchq . gaffer . flink . operation . handler . e > java . lang . RuntimeException ( uk . gov . gchq . gaffer . flink . operation . handler . e . getMessage ( ) ) ; } } ) ; } }
|
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( 1 , 2 ) , com . google . common . collect . Lists . newArrayList ( list ) )
|
testNDArrayWritablesZeroIndex ( ) { org . nd4j . linalg . api . ndarray . INDArray arr2 = org . nd4j . linalg . factory . Nd4j . zeros ( 2 ) ; arr2 . putScalar ( 0 , 11 ) ; arr2 . putScalar ( 1 , 12 ) ; org . nd4j . linalg . api . ndarray . INDArray arr3 = org . nd4j . linalg . factory . Nd4j . zeros ( 3 ) ; arr3 . putScalar ( 0 , 0 ) ; arr3 . putScalar ( 1 , 1 ) ; arr3 . putScalar ( 2 , 0 ) ; java . util . List < org . datavec . api . records . writer . impl . Writable > record = java . util . Arrays . asList ( ( ( org . datavec . api . records . writer . impl . Writable ) ( new org . datavec . api . records . writer . impl . DoubleWritable ( 1 ) ) ) , new org . datavec . api . writable . NDArrayWritable ( arr2 ) , new org . datavec . api . records . writer . impl . IntWritable ( 2 ) , new org . datavec . api . records . writer . impl . DoubleWritable ( 3 ) , new org . datavec . api . writable . NDArrayWritable ( arr3 ) , new org . datavec . api . records . writer . impl . DoubleWritable ( 1 ) ) ; java . io . File tempFile = java . io . File . createTempFile ( "SVMLightRecordWriter" , ".txt" ) ; tempFile . setWritable ( true ) ; tempFile . deleteOnExit ( ) ; if ( tempFile . exists ( ) ) tempFile . delete ( ) ; java . lang . String lineOriginal = "1,3<sp>0:1.0<sp>1:11.0<sp>2:12.0<sp>3:2.0<sp>4:3.0" ; try ( org . datavec . api . records . writer . impl . misc . SVMLightRecordWriter writer = new org . datavec . api . records . writer . impl . misc . SVMLightRecordWriter ( ) ) { org . datavec . api . conf . Configuration configWriter = new org . datavec . api . conf . Configuration ( ) ; configWriter . setBoolean ( SVMLightRecordWriter . ZERO_BASED_INDEXING , true ) ; configWriter . setBoolean ( SVMLightRecordWriter . ZERO_BASED_LABEL_INDEXING , true ) ; configWriter . setBoolean ( SVMLightRecordWriter . MULTILABEL , true ) ; configWriter . setInt ( SVMLightRecordWriter . FEATURE_FIRST_COLUMN , 0 ) ; configWriter . setInt ( SVMLightRecordWriter . FEATURE_LAST_COLUMN , 3 ) ; org . datavec . api . split . FileSplit outputSplit = new org . datavec . api . split . FileSplit ( tempFile ) ; writer . initialize ( configWriter , outputSplit , new org . datavec . api . split . partition . NumberOfRecordsPartitioner ( ) ) ; writer . write ( record ) ; } java . lang . String lineNew = org . apache . commons . io . FileUtils . readFileToString ( tempFile ) . trim ( ) ; "<AssertPlaceHolder>" ; } write ( java . util . List ) { java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; int count = 0 ; for ( org . datavec . api . writable . Writable w : record ) { if ( count > 0 ) { boolean tabs = false ; result . append ( ( tabs ? "\t" : "<sp>" ) ) ; } result . append ( w . toString ( ) ) ; count ++ ; } out . write ( result . toString ( ) . getBytes ( ) ) ; out . write ( org . datavec . api . records . writer . impl . misc . NEW_LINE . getBytes ( ) ) ; return org . datavec . api . split . partition . PartitionMetaData . builder ( ) . numRecordsUpdated ( 1 ) . build ( ) ; }
|
org . junit . Assert . assertEquals ( lineOriginal , lineNew )
|
testPerspectiveShortcut ( ) { java . lang . String [ ] perspectiveShortcutIds = org . eclipse . ui . PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) . getPerspectiveShortcuts ( ) ; java . lang . String [ ] expectedIds = new java . lang . String [ ] { "org.eclipse.debug.ui.DebugPerspective" , "org.eclipse.ui.resourcePerspective" , "org.eclipse.team.ui.TeamSynchronizingPerspective" } ; "<AssertPlaceHolder>" ; } getWorkbench ( ) { return org . eclipse . ui . PlatformUI . getWorkbench ( ) ; }
|
org . junit . Assert . assertArrayEquals ( expectedIds , perspectiveShortcutIds )
|
testUnmarshal_WrappedStringId ( ) { com . jmethods . catatumbo . entities . WrappedStringIdEntity entity = com . jmethods . catatumbo . entities . WrappedStringIdEntity . getSample4 ( ) ; com . google . cloud . datastore . Entity nativeEntity = ( ( com . google . cloud . datastore . Entity ) ( com . jmethods . catatumbo . impl . Marshaller . marshal ( com . jmethods . catatumbo . impl . UnmarshallerTest . em , entity , Intent . UPDATE ) ) ) ; com . jmethods . catatumbo . entities . WrappedStringIdEntity entity2 = com . jmethods . catatumbo . impl . Unmarshaller . unmarshal ( nativeEntity , com . jmethods . catatumbo . entities . WrappedStringIdEntity . class ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ! ( obj instanceof com . jmethods . catatumbo . GeoLocation ) ) { return false ; } com . jmethods . catatumbo . GeoLocation that = ( ( com . jmethods . catatumbo . GeoLocation ) ( obj ) ) ; return ( ( this . latitude ) == ( that . latitude ) ) && ( ( this . longitude ) == ( that . longitude ) ) ; }
|
org . junit . Assert . assertTrue ( entity . equals ( entity2 ) )
|
buildDownstream_derived_makeUpstream ( ) { java . lang . System . setProperty ( Property . buildDownstream . fullName ( ) , "derived" ) ; when ( mavenExecutionRequestMock . getMakeBehavior ( ) ) . thenReturn ( MavenExecutionRequest . REACTOR_MAKE_UPSTREAM ) ; com . vackosar . gitflowincrementalbuild . boundary . Configuration configuration = new com . vackosar . gitflowincrementalbuild . boundary . Configuration . Provider ( mavenSessionMock ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( ( configuration ) == null ) { configuration = new com . vackosar . gitflowincrementalbuild . boundary . Configuration ( mavenSession ) ; } return configuration ; }
|
org . junit . Assert . assertFalse ( configuration . buildDownstream )
|
whenReadLargeFileJava7_thenCorrect ( ) { final java . lang . String expected_value = "Hello<sp>world" ; final java . nio . file . Path path = java . nio . file . Paths . get ( "src/test/resources/test_read.in" ) ; final org . baeldung . java . io . BufferedReader reader = java . nio . file . Files . newBufferedReader ( path , java . nio . charset . Charset . defaultCharset ( ) ) ; final java . lang . String line = reader . readLine ( ) ; "<AssertPlaceHolder>" ; } readLine ( ) { try { if ( ( CSVReader ) == null ) initReader ( ) ; java . lang . String [ ] line = CSVReader . readNext ( ) ; if ( line == null ) return null ; return new org . baeldung . taskletsvschunks . model . Line ( line [ 0 ] , java . time . LocalDate . parse ( line [ 1 ] , java . time . format . DateTimeFormatter . ofPattern ( "MM/dd/yyyy" ) ) ) ; } catch ( java . lang . Exception e ) { logger . error ( ( "Error<sp>while<sp>reading<sp>line<sp>in<sp>file:<sp>" + ( this . fileName ) ) ) ; return null ; } }
|
org . junit . Assert . assertEquals ( expected_value , line )
|
testi386Arch ( ) { java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( "os.name" , "dummy" ) ; props . setProperty ( "os.arch" , "i386" ) ; java . lang . Process process = new java . lang . Process ( props ) ; "<AssertPlaceHolder>" ; } arch ( ) { if ( isX64 ( ) ) { return "x64" ; } else if ( isIa32 ( ) ) { return "ia32" ; } else if ( isArm ( ) ) { return "arm" ; } return null ; }
|
org . junit . Assert . assertEquals ( "ia32" , process . arch ( ) )
|
getAll_shouldGellVisitAttributeTypesIfIncludeAllIsSetToTrue ( ) { org . openmrs . module . webservices . rest . SimpleObject result = deserialize ( handle ( newGetRequest ( getURI ( ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_9 . Parameter ( org . openmrs . module . webservices . rest . web . RestConstants . REQUEST_PROPERTY_FOR_INCLUDE_ALL , "true" ) ) ) ) ; "<AssertPlaceHolder>" ; } getResultsSize ( org . openmrs . module . webservices . rest . SimpleObject ) { return org . openmrs . module . webservices . rest . test . Util . getResultsList ( result ) . size ( ) ; }
|
org . junit . Assert . assertEquals ( 5 , org . openmrs . module . webservices . rest . test . Util . getResultsSize ( result ) )
|
runTest ( ) { boolean result = checkNoError ( "Social_Search_Blog_Constraint" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
|
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
|
chainedFunctionCallExpression ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = Sequence ( Property ( "foo" ) , FunctionCall ( "to_string" , java . util . Arrays . asList ( Current ( ) ) ) ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "foo.to_string(@)" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) )
|
testGetLocationHeader ( ) { System . out . println ( "Testing<sp>JsonResponseTest.getLocationHeader" ) ; "<AssertPlaceHolder>" ; } getLocationHeader ( ) { return locationHeader ; }
|
org . junit . Assert . assertEquals ( null , response . getLocationHeader ( ) )
|
testConstructor ( ) { new org . openhealthtools . mdht . uml . cda . operations . EntryOperations ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testRoundTripWithPlainTextMediaType ( ) { org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter converter = new org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter ( ) ; converter . write ( project , MediaType . TEXT_PLAIN , mockOutMessage ) ; java . io . ByteArrayInputStream in = new java . io . ByteArrayInputStream ( outStream . toByteArray ( ) ) ; org . mockito . Mockito . when ( mockInMessage . getBody ( ) ) . thenReturn ( in ) ; org . sagebionetworks . schema . adapter . JSONEntity results = converter . read ( org . sagebionetworks . repo . model . Project . class , mockInMessage ) ; "<AssertPlaceHolder>" ; } read ( java . lang . Class , org . springframework . http . HttpInputMessage ) { java . nio . charset . Charset charsetForDeSerializingBody = inputMessage . getHeaders ( ) . getContentType ( ) . getCharset ( ) ; if ( charsetForDeSerializingBody == null ) { charsetForDeSerializingBody = org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter . HTTP_1_1_DEFAULT_CHARSET ; } java . lang . String jsonString = org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter . readToString ( inputMessage . getBody ( ) , charsetForDeSerializingBody ) ; try { return org . sagebionetworks . schema . adapter . org . json . EntityFactory . createEntityFromJSONString ( jsonString , clazz ) ; } catch ( org . sagebionetworks . schema . adapter . JSONObjectAdapterException e ) { try { org . json . JSONObject jsonObject = new org . json . JSONObject ( jsonString ) ; if ( jsonObject . has ( org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter . ENTITY_TYPE ) ) { java . lang . String type = jsonObject . getString ( org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter . ENTITY_TYPE ) ; jsonObject . remove ( org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter . ENTITY_TYPE ) ; jsonObject . put ( org . sagebionetworks . repo . web . controller . JSONEntityHttpMessageConverter . CONCRETE_TYPE , type ) ; jsonString = jsonObject . toString ( ) ; return org . sagebionetworks . schema . adapter . org . json . EntityFactory . createEntityFromJSONString ( jsonString , clazz ) ; } else { throw new org . springframework . http . converter . HttpMessageNotReadableException ( e . getMessage ( ) , e ) ; } } catch ( org . json . JSONException e1 ) { throw new org . springframework . http . converter . HttpMessageNotReadableException ( e1 . getMessage ( ) , e ) ; } catch ( org . sagebionetworks . schema . adapter . JSONObjectAdapterException e2 ) { throw new org . springframework . http . converter . HttpMessageNotReadableException ( e2 . getMessage ( ) , e ) ; } } }
|
org . junit . Assert . assertEquals ( project , results )
|
testSerialization1 ( ) { org . nd4j . linalg . api . ndarray . INDArray array = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 5 , 10 ) ; java . io . File tempFile = java . io . File . createTempFile ( "alpha" , "11" ) ; tempFile . deleteOnExit ( ) ; try ( java . io . DataOutputStream dos = new java . io . DataOutputStream ( java . nio . file . Files . newOutputStream ( java . nio . file . Paths . get ( tempFile . getAbsolutePath ( ) ) ) ) ) { org . nd4j . linalg . factory . Nd4j . write ( array , dos ) ; } java . io . DataInputStream dis = new java . io . DataInputStream ( new java . io . FileInputStream ( tempFile . getAbsoluteFile ( ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray restored = org . nd4j . linalg . factory . Nd4j . read ( dis ) ; "<AssertPlaceHolder>" ; } read ( org . nd4j . linalg . factory . InputStream ) { return org . nd4j . linalg . factory . Nd4j . read ( new org . nd4j . linalg . factory . DataInputStream ( reader ) ) ; }
|
org . junit . Assert . assertEquals ( array , restored )
|
testReflectInnerClass ( ) { org . apache . hadoop . io . serializer . avro . TestAvroSerialization . InnerRecord before = new org . apache . hadoop . io . serializer . avro . TestAvroSerialization . InnerRecord ( ) ; before . x = 10 ; org . apache . hadoop . io . serializer . avro . TestAvroSerialization . conf . set ( AvroReflectSerialization . AVRO_REFLECT_PACKAGES , before . getClass ( ) . getPackage ( ) . getName ( ) ) ; org . apache . hadoop . io . serializer . avro . TestAvroSerialization . InnerRecord after = org . apache . hadoop . io . serializer . SerializationTestUtil . testSerialization ( org . apache . hadoop . io . serializer . avro . TestAvroSerialization . conf , before ) ; "<AssertPlaceHolder>" ; } testSerialization ( org . apache . hadoop . conf . Configuration , K ) { org . apache . hadoop . io . serializer . SerializationFactory factory = new org . apache . hadoop . io . serializer . SerializationFactory ( conf ) ; org . apache . hadoop . io . serializer . Serializer < K > serializer = factory . getSerializer ( org . apache . hadoop . util . GenericsUtil . getClass ( before ) ) ; org . apache . hadoop . io . serializer . Deserializer < K > deserializer = factory . getDeserializer ( org . apache . hadoop . util . GenericsUtil . getClass ( before ) ) ; org . apache . hadoop . io . DataOutputBuffer out = new org . apache . hadoop . io . DataOutputBuffer ( ) ; serializer . open ( out ) ; serializer . serialize ( before ) ; serializer . close ( ) ; org . apache . hadoop . io . DataInputBuffer in = new org . apache . hadoop . io . DataInputBuffer ( ) ; in . reset ( out . getData ( ) , out . getLength ( ) ) ; deserializer . open ( in ) ; K after = deserializer . deserialize ( null ) ; deserializer . close ( ) ; return after ; }
|
org . junit . Assert . assertEquals ( before , after )
|
validateTimeUnit_TimeUnitChanged ( ) { org . oscm . internal . vo . VOPriceModel inputPriceModel = givenVOPriceModel ( CURRENCYISOCODE_USD , Period_DAY ) ; java . lang . String errorMessage = "ex.PriceModelException.UNMODIFIABLE_TIMEUNIT" ; try { bean . validateTimeUnit ( existingPriceModel , inputPriceModel ) ; } catch ( org . oscm . internal . types . exception . PriceModelException e ) { "<AssertPlaceHolder>" ; throw e ; } } getMessageKey ( ) { return messageKey ; }
|
org . junit . Assert . assertEquals ( errorMessage , e . getMessageKey ( ) )
|
testReplaceAuthorityWithVariable ( ) { java . lang . String input = "content://androi.authority/test/${field0}/${field1}" ; java . lang . String expected = "content://androi.authority/test/#/*" ; log ( input ) ; com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriChecker checker = com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriChecker . getInstance ( ) ; checker . verify ( input ) ; { java . lang . String actual = checker . replace ( input , new com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriChecker . UriPlaceHolderReplacerListener ( ) { @ sqlite . feat . grammars . contenturi . Override public java . lang . String onParameterName ( int pathSegmentIndex , java . lang . String name ) { log ( ( "segment<sp>:" + pathSegmentIndex ) ) ; if ( name . endsWith ( "0" ) ) { return "#" ; } return "*" ; } } ) ; "<AssertPlaceHolder>" ; { java . util . List < com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriPlaceHolder > aspectedHolders = new java . util . ArrayList ( ) ; aspectedHolders . add ( new com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriPlaceHolder ( 1 , "field0" ) ) ; aspectedHolders . add ( new com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriPlaceHolder ( 2 , "field1" ) ) ; java . util . List < com . abubusoft . kripton . processor . sqlite . grammars . uri . ContentUriPlaceHolder > actualHolders = checker . extract ( input ) ; checkCollectionExactly ( aspectedHolders , actualHolders ) ; } } } log ( boolean ) { this . logEnabled = value ; return this ; }
|
org . junit . Assert . assertEquals ( actual , expected )
|
testGetUrl ( ) { final java . lang . String uuid = "29942295-8683-4e65-917b-f7e7f98e4ad5" ; final java . lang . String serverName = "default" ; final java . lang . String propertyPath = "default" ; final java . lang . String expectedUrl = ( ( ( ( ( "restAPI/preview/" + serverName ) + "/" ) + uuid ) + "/" ) + propertyPath ) + "/" ; org . nuxeo . ecm . core . api . DocumentLocation docLoc = new org . nuxeo . ecm . core . api . impl . DocumentLocationImpl ( serverName , new org . nuxeo . ecm . core . api . IdRef ( uuid ) ) ; java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( "PROPERTY_PATH_KEY" , propertyPath ) ; org . nuxeo . ecm . platform . url . api . DocumentView docView = new org . nuxeo . ecm . platform . url . DocumentViewImpl ( docLoc , null , params ) ; java . lang . String url = documentPreviewCodec . getUrlFromDocumentView ( docView ) ; "<AssertPlaceHolder>" ; } getUrlFromDocumentView ( org . nuxeo . ecm . platform . url . api . DocumentView ) { org . nuxeo . ecm . core . api . DocumentLocation docLoc = docView . getDocumentLocation ( ) ; if ( docLoc != null ) { java . util . List < java . lang . String > items = new java . util . ArrayList < java . lang . String > ( ) ; items . add ( getPrefix ( ) ) ; org . nuxeo . ecm . core . api . IdRef docRef = docLoc . getIdRef ( ) ; if ( docRef == null ) { return null ; } items . add ( docRef . toString ( ) ) ; java . lang . String uri = com . google . common . base . Joiner . on ( "/" ) . join ( items ) ; return org . nuxeo . common . utils . URIUtils . addParametersToURIQuery ( uri , docView . getParameters ( ) ) ; } return null ; }
|
org . junit . Assert . assertEquals ( expectedUrl , url )
|
getAddedValue ( ) { subject . set ( key , value ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { return getChunk ( ) . getBlockComponentOwner ( x , y , z , true ) . get ( type ) ; }
|
org . junit . Assert . assertThat ( subject . get ( key ) , org . hamcrest . CoreMatchers . is ( value ) )
|
sa07_ResponseHeader_onPojo_nocode ( ) { org . apache . juneau . rest . annotation . HeaderInfo x = org . apache . juneau . rest . annotation . ResponseHeaderAnnotationTest . sa . getResponseInfo ( "/sa07" , "get" , 200 ) . getHeader ( "H" ) ; "<AssertPlaceHolder>" ; } getDescription ( ) { return mb . getString ( "description" ) ; }
|
org . junit . Assert . assertEquals ( "a" , x . getDescription ( ) )
|
testGetSecurityRoleTrimParameters ( ) { securityRoleDaoTestHelper . createSecurityRoleEntity ( org . finra . herd . service . SECURITY_ROLE , org . finra . herd . service . DESCRIPTION ) ; org . finra . herd . model . api . xml . SecurityRole securityRole = securityRoleService . getSecurityRole ( new org . finra . herd . model . api . xml . SecurityRoleKey ( addWhitespace ( org . finra . herd . service . SECURITY_ROLE ) ) ) ; "<AssertPlaceHolder>" ; } addWhitespace ( java . lang . String ) { return java . lang . String . format ( "<sp>%s<sp>" , string ) ; }
|
org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . SecurityRole ( SECURITY_ROLE , DESCRIPTION ) , securityRole )
|
getFileRevisions_shouldReturnTheCommitsWhereTheSpecifiedFileIsChanged ( ) { writeSomethingToCache ( ) ; commitToBranch ( "test_branch" ) ; writeToCache ( "/test_file.txt" ) ; org . eclipse . jgit . revwalk . RevCommit commit2 = commitToBranch ( "test_branch" ) ; updateFile ( "/test_file.txt" , "some<sp>new<sp>text<sp>data" ) ; org . eclipse . jgit . revwalk . RevCommit commit3 = commitToBranch ( "test_branch" ) ; writeSomethingToCache ( ) ; commitToBranch ( "test_branch" ) ; java . util . List < org . eclipse . jgit . revwalk . RevCommit > expected = java . util . Arrays . asList ( commit3 , commit2 ) ; java . util . List < org . eclipse . jgit . revwalk . RevCommit > actual = com . beijunyi . parallelgit . utils . CommitUtils . getFileRevisions ( "/test_file.txt" , "test_branch" , repo ) ; "<AssertPlaceHolder>" ; } getFileRevisions ( java . lang . String , com . beijunyi . parallelgit . utils . AnyObjectId , com . beijunyi . parallelgit . utils . ObjectReader ) { return com . beijunyi . parallelgit . utils . CommitUtils . getFileRevisions ( path , start , 0 , Integer . MAX_VALUE , reader ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
or_tag_predicate_matches_pickle_with_one_of_the_tags ( ) { gherkin . events . PickleEvent pickleEvent = createPickleWithTags ( asList ( cucumber . runtime . filter . TagPredicateTest . FOO_TAG ) ) ; cucumber . runtime . filter . TagPredicate predicate = new cucumber . runtime . filter . TagPredicate ( asList ( cucumber . runtime . filter . TagPredicateTest . FOO_OR_BAR_TAG_VALUE ) ) ; "<AssertPlaceHolder>" ; } apply ( gherkin . events . PickleEvent ) { java . net . URI picklePath = java . net . URI . create ( pickleEvent . uri ) ; if ( ! ( lineFilters . containsKey ( picklePath ) ) ) { return true ; } for ( java . lang . Integer line : lineFilters . get ( picklePath ) ) { for ( gherkin . pickles . PickleLocation location : pickleEvent . pickle . getLocations ( ) ) { if ( line == ( location . getLine ( ) ) ) { return true ; } } } return false ; }
|
org . junit . Assert . assertTrue ( predicate . apply ( pickleEvent ) )
|
fetchFirstItems ( ) { itemProvider . addItems ( book . twju . chapter_3 . Listing_4_Mock_TimelineTest . FIRST_ITEM , book . twju . chapter_3 . Listing_4_Mock_TimelineTest . SECOND_ITEM ) ; timeline . setFetchCount ( 1 ) ; sessionStorage . setExpectedTopItem ( book . twju . chapter_3 . Listing_4_Mock_TimelineTest . SECOND_ITEM ) ; timeline . fetchItems ( ) ; java . util . List < book . twju . chapter_3 . Item > actual = timeline . getItems ( ) ; sessionStorage . verify ( ) ; "<AssertPlaceHolder>" ; } verify ( ) { org . junit . Assert . assertTrue ( storeTopDone ) ; }
|
org . junit . Assert . assertArrayEquals ( new book . twju . chapter_3 . Item [ ] { book . twju . chapter_3 . Listing_4_Mock_TimelineTest . SECOND_ITEM } , actual . toArray ( new book . twju . chapter_3 . Item [ 1 ] ) )
|
testParseSimpleWithDecimalsTrunc ( ) { java . lang . String source = ( ( ( ( ( "{{1" + ( getDecimalCharacter ( ) ) ) + "2323,1" ) + ( getDecimalCharacter ( ) ) ) + "4343,1" ) + ( getDecimalCharacter ( ) ) ) + "6333}}" ; org . apache . commons . math3 . linear . RealMatrix expected = org . apache . commons . math3 . linear . MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { 1.2323 , 1.4343 , 1.6333 } } ) ; org . apache . commons . math3 . linear . RealMatrix actual = realMatrixFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( com . google . javascript . jscomp . AbstractCompiler ) { try { com . google . javascript . jscomp . JsAst . logger_ . fine ( ( "Parsing:<sp>" + ( sourceFile . getName ( ) ) ) ) ; com . google . javascript . jscomp . parsing . ParserRunner . ParseResult result = com . google . javascript . jscomp . parsing . ParserRunner . parse ( sourceFile , sourceFile . getCode ( ) , compiler . getParserConfig ( ) , compiler . getDefaultErrorReporter ( ) , com . google . javascript . jscomp . JsAst . logger_ ) ; root = result . ast ; compiler . setOldParseTree ( sourceFile . getName ( ) , result . oldAst ) ; } catch ( java . io . IOException e ) { compiler . report ( com . google . javascript . jscomp . JSError . make ( AbstractCompiler . READ_ERROR , sourceFile . getName ( ) ) ) ; } if ( ( ( root ) == null ) || ( compiler . hasHaltingErrors ( ) ) ) { root = com . google . javascript . rhino . IR . script ( ) ; } else { compiler . prepareAst ( root ) ; } root . setStaticSourceFile ( sourceFile ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
cutMenuItemShouldHaveCorrectKeyAsAccelerator ( ) { final javax . swing . KeyStroke ctrlX = javax . swing . KeyStroke . getKeyStroke ( KeyEvent . VK_X , getMenuKey ( ) ) ; final javax . swing . KeyStroke accelerator = cutMenuItem . getAccelerator ( ) ; "<AssertPlaceHolder>" ; } getMenuKey ( ) { if ( net . usikkert . kouchat . util . TestUtils . isMac ( ) ) { return java . awt . event . KeyEvent . META_MASK ; } return java . awt . event . KeyEvent . CTRL_MASK ; }
|
org . junit . Assert . assertSame ( ctrlX , accelerator )
|
testImportTechnicalService_OneSubscriptionNotSet ( ) { svcProv . importTechnicalServices ( org . oscm . serviceprovisioningservice . bean . TECHNICAL_SERVICES_XML . getBytes ( "UTF-8" ) ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . serviceprovisioningservice . bean . Override public org . oscm . serviceprovisioningservice . bean . Void call ( ) throws org . oscm . serviceprovisioningservice . bean . Exception { org . oscm . domobjects . Organization org = org . oscm . test . data . Organizations . findOrganization ( mgr , providerOrganizationId ) ; org . oscm . domobjects . TechnicalProduct techPrd = org . getTechnicalProducts ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; return null ; } } ) ; } isOnlyOneSubscriptionAllowed ( ) { return dataContainer . isOnlyOneSubscriptionAllowed ( ) ; }
|
org . junit . Assert . assertEquals ( false , techPrd . isOnlyOneSubscriptionAllowed ( ) )
|
renderConfluencePage_asciiDocWithAllPossibleSectionLevels_returnsConfluencePageContentWithAllSectionHavingCorrectMarkup ( ) { java . lang . String adocContent = "=<sp>Title<sp>level<sp>0\n\n" + ( ( ( ( "==<sp>Title<sp>level<sp>1\n" + "===<sp>Title<sp>level<sp>2\n" ) + "====<sp>Title<sp>level<sp>3\n" ) + "=====<sp>Title<sp>level<sp>4\n" ) + "======<sp>Title<sp>level<sp>5" ) ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage asciidocConfluencePage = org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage . newAsciidocConfluencePage ( asciidocPage ( org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . prependTitle ( adocContent ) ) , org . sahli . asciidoc . confluence . publisher . converter . UTF_8 , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . TEMPLATES_FOLDER , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . dummyAssetsTargetPath ( ) ) ; java . lang . String expectedContent = "<h1>Title<sp>level<sp>1</h1>" + ( ( ( "<h1>Title<sp>level<sp>1</h1>" 0 + "<h3>Title<sp>level<sp>3</h3>" ) + "<h4>Title<sp>level<sp>4</h4>" ) + "<h5>Title<sp>level<sp>5</h5>" ) ; "<AssertPlaceHolder>" ; } content ( ) { return this . htmlContent ; }
|
org . junit . Assert . assertThat ( asciidocConfluencePage . content ( ) , org . hamcrest . Matchers . is ( expectedContent ) )
|
testInEmpty ( ) { instance . in ( "id" , Collections . EMPTY_LIST ) ; org . dayatang . persistence . jpa . List < org . dayatang . persistence . test . domain . Dictionary > results = repository . find ( instance ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return true ; }
|
org . junit . Assert . assertTrue ( results . isEmpty ( ) )
|
canWriteOffsetPieceInSingleFileMode ( ) { java . lang . String baseDir = ( this . getClass ( ) . getResource ( "/" ) . getFile ( ) ) + "/files" ; baseDir = java . net . URLDecoder . decode ( baseDir , "utf-8" ) ; baseDir = new java . io . File ( baseDir ) . getPath ( ) ; files . TorrentFile torrent = mock ( files . TorrentFile . class ) ; when ( torrent . getName ( ) ) . thenReturn ( "test.txt" ) ; when ( torrent . getLength ( ) ) . thenReturn ( ( ( long ) ( 8 ) ) ) ; when ( torrent . getPieceLength ( ) ) . thenReturn ( 4 ) ; when ( torrent . isSingleFile ( ) ) . thenReturn ( true ) ; files . Piece p = mock ( files . Piece . class ) ; when ( p . getIndex ( ) ) . thenReturn ( 1 ) ; when ( p . getBytes ( ) ) . thenReturn ( "test" . getBytes ( ) ) ; files . PieceWriter writer = new files . PieceWriter ( baseDir , torrent ) ; writer . reserve ( ) ; writer . writePiece ( p ) ; java . io . File file = new java . io . File ( ( baseDir + "/test.txt" ) ) ; byte [ ] entireFile = java . nio . file . Files . readAllBytes ( file . toPath ( ) ) ; java . lang . String s = new java . lang . String ( java . util . Arrays . copyOfRange ( entireFile , 4 , 8 ) ) ; "<AssertPlaceHolder>" ; writer . close ( ) ; } writePiece ( files . Piece ) { long startIndex = ( torrent . getPieceLength ( ) ) * ( p . getIndex ( ) ) ; java . io . RandomAccessFile raf ; if ( torrent . isSingleFile ( ) ) { raf = files . get ( 0 ) . getFile ( ) ; raf . seek ( startIndex ) ; raf . write ( p . getBytes ( ) ) ; } else { writeMultiple ( p ) ; } }
|
org . junit . Assert . assertEquals ( "test" , s )
|
getKafkaProperties ( ) { org . apache . hadoop . conf . Configuration config = new org . apache . hadoop . conf . Configuration ( false ) ; java . lang . String propertyKey = "fake.kafka.property" ; java . lang . String propertyValue = testName . getMethodName ( ) ; config . set ( propertyKey , propertyValue ) ; java . util . Properties props = org . apache . crunch . kafka . KafkaUtils . getKafkaConnectionProperties ( config ) ; "<AssertPlaceHolder>" ; } get ( int ) { switch ( index ) { case 0 : return first ; case 1 : return second ; case 2 : return third ; default : throw new java . lang . ArrayIndexOutOfBoundsException ( ) ; } }
|
org . junit . Assert . assertThat ( props . get ( propertyKey ) , org . hamcrest . core . Is . is ( ( ( java . lang . Object ) ( propertyValue ) ) ) )
|
testGetPlatformIDs ( ) { int [ ] numPlatforms = new int [ ] { 0 } ; org . jocl . CL . clGetPlatformIDs ( 0 , null , numPlatforms ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ( ( numPlatforms [ 0 ] ) > 0 ) )
|
test40_algext ( ) { cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > minimalPoly = cc . redberry . rings . poly . univar . UnivariatePolynomial . create ( ( - 2 ) , 0 , 0 , 0 , 0 , 0 , 1 ) . mapCoefficients ( cc . redberry . rings . poly . univar . Q , Q :: valueOfBigInteger ) ; cc . redberry . rings . poly . AlgebraicNumberField < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > field = AlgebraicNumberField ( minimalPoly ) ; cc . redberry . rings . io . Coder < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > , ? , ? > cfCoder = cc . redberry . rings . io . Coder . mkUnivariateCoder ( field , "s" ) ; cc . redberry . rings . poly . UnivariateRing < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > > uRing = UnivariateRing ( field ) ; cc . redberry . rings . io . Coder < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > , ? , ? > coder = cc . redberry . rings . io . Coder . mkUnivariateCoder ( uRing , cfCoder , "x" ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > a = coder . parse ( "(1<sp>-<sp>s<sp>+<sp>(12133<sp>-<sp>3*s^5)<sp>*<sp>x^5)<sp>*<sp>(<sp>143<sp>+<sp>s*x^2<sp>+<sp>12*s^6*x^5)" ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > b = coder . parse ( "(1<sp>-<sp>s<sp>+<sp>(12133-<sp>3*s^5)<sp>*<sp>x^5)<sp>*<sp>(<sp>14<sp>-<sp>s*x<sp>+<sp>2213*s*x^17)^2" ) ; for ( int i = 0 ; i < 1 ; ++ i ) { long start ; start = java . lang . System . nanoTime ( ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > mod = cc . redberry . rings . poly . univar . UnivariateGCD . UnivariateGCD . PolynomialGCDInNumberField ( a , b ) ; System . out . println ( ( "Modular:<sp>" + ( nanosecondsToString ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ) ) ) ; start = java . lang . System . nanoTime ( ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . Rational < cc . redberry . rings . bigint . BigInteger > > > half = cc . redberry . rings . poly . univar . UnivariateGCD . UnivariateGCD . HalfGCD ( a , b ) ; System . out . println ( ( "Half<sp>GCD:<sp>" + ( nanosecondsToString ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ) ) ) ; "<AssertPlaceHolder>" ; System . out . println ( ) ; } } nanosecondsToString ( long ) { java . lang . String pf = "ns" ; if ( ( nano / 1000 ) > 1 ) { pf = "us" ; nano /= 1000 ; } if ( ( nano / 1000 ) > 1 ) { pf = "ms" ; nano /= 1000 ; } if ( ( nano / 1000 ) > 1 ) { pf = "s" ; nano /= 1000 ; } return nano + pf ; }
|
org . junit . Assert . assertEquals ( mod , half )
|
testSetNotificationNewProfile ( ) { eu . dime . commons . dto . Request < eu . dime . commons . dto . ExternalNotificationDTO > mockRequest = buildMockNotification ( ) ; this . buildMockResponsesNewProfile ( ) ; eu . dime . ps . communications . requestbroker . controllers . servicegateway . PSServicesController servicesControllerSpied = org . powermock . api . mockito . PowerMockito . spy ( servicesController ) ; eu . dime . commons . dto . Response response = servicesControllerSpied . setNotification ( mockRequest , eu . dime . ps . communications . requestbroker . servicegateway . PSServicesControllerTest . RECEIVER ) ; "<AssertPlaceHolder>" ; org . powermock . api . mockito . PowerMockito . verifyPrivate ( servicesControllerSpied ) . invoke ( "obtainSharedObjecte" , org . mockito . Mockito . anyObject ( ) ) ; org . powermock . api . mockito . PowerMockito . verifyPrivate ( servicesControllerSpied ) . invoke ( "getAndSaveSharedObject" , org . mockito . Mockito . anyObject ( ) , org . mockito . Mockito . anyString ( ) , org . mockito . Mockito . anyString ( ) ) ; org . powermock . api . mockito . PowerMockito . verifyPrivate ( servicesControllerSpied ) . invoke ( "requestCredentialsAndProfile" , eu . dime . ps . communications . requestbroker . servicegateway . PSServicesControllerTest . SENDER , eu . dime . ps . communications . requestbroker . servicegateway . PSServicesControllerTest . RECEIVER , eu . dime . ps . communications . requestbroker . servicegateway . PSServicesControllerTest . RECEIVER_URI ) ; org . powermock . api . mockito . PowerMockito . verifyPrivate ( servicesControllerSpied ) . invoke ( "requestProfile" , org . mockito . Mockito . anyString ( ) , org . mockito . Mockito . anyString ( ) , org . mockito . Mockito . anyString ( ) ) ; } setNotification ( eu . dime . commons . dto . Request , java . lang . String ) { eu . dime . commons . dto . ExternalNotificationDTO jsonNotification = null ; try { jsonNotification = json . getMessage ( ) . getData ( ) . getEntries ( ) . iterator ( ) . next ( ) ; java . lang . String saidNameReceiver = jsonNotification . getSaidReciever ( ) ; if ( ! ( saidNameReceiver . equals ( said ) ) ) { return eu . dime . commons . dto . Response . badRequest ( ) ; } else { eu . dime . ps . controllers . TenantContextHolder . setTenant ( this . tenantManager . getByAccountName ( saidNameReceiver ) . getId ( ) ) ; } if ( ExternalNotificationDTO . OPERATION_SHARE . equals ( jsonNotification . getOperation ( ) ) ) { return this . requestSharedObject ( jsonNotification ) ; } } catch ( java . lang . Exception e ) { return eu . dime . commons . dto . Response . serverError ( ( "Unknown<sp>Error!<sp>Details:<sp>" + ( e . getMessage ( ) ) ) , e ) ; } finally { eu . dime . ps . controllers . TenantContextHolder . clear ( ) ; } return eu . dime . commons . dto . Response . okEmpty ( ) ; }
|
org . junit . Assert . assertNotNull ( response )
|
shouldDeserialiseEdgeId ( ) { final uk . gov . gchq . gaffer . data . element . id . EdgeId expectedElementId = new uk . gov . gchq . gaffer . operation . data . EdgeSeed ( "source1" , "dest1" , true ) ; final uk . gov . gchq . gaffer . data . element . Edge edge = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . source ( "source1" ) . dest ( "dest1" ) . directed ( true ) . group ( TestGroups . ENTITY ) . property ( TestPropertyNames . PROP_1 , new uk . gov . gchq . gaffer . types . FreqMap ( ) ) . property ( TestPropertyNames . PROP_2 , new uk . gov . gchq . gaffer . types . FreqMap ( ) ) . build ( ) ; final org . apache . accumulo . core . data . Key key = converter . getKeysFromEdge ( edge ) . getFirst ( ) ; final uk . gov . gchq . gaffer . data . element . id . ElementId elementId = converter . getElementId ( key , false ) ; "<AssertPlaceHolder>" ; } getElementId ( org . apache . accumulo . core . data . Key , boolean ) { final byte [ ] row = key . getRowData ( ) . getBackingArray ( ) ; if ( doesKeyRepresentEntity ( row ) ) { return getEntityId ( row ) ; } return getEdgeId ( row , includeMatchedVertex ) ; }
|
org . junit . Assert . assertEquals ( expectedElementId , elementId )
|
testNan ( ) { org . apache . commons . math4 . linear . RealMatrix m = org . apache . commons . math4 . linear . MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { Double . NaN , Double . NaN , Double . NaN } } ) ; java . lang . String expected = "{{(NaN),(NaN),(NaN)}}" ; java . lang . String actual = realMatrixFormat . format ( m ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testServerAll ( ) { append ( "[groups]" , globalPolicyFile ) ; append ( "group<sp>=<sp>malicious_role" , globalPolicyFile ) ; append ( "[roles]" , globalPolicyFile ) ; append ( "malicious_role<sp>=<sp>server=*" , globalPolicyFile ) ; org . apache . sentry . policy . common . PolicyEngine policy = org . apache . sentry . policy . hive . DBPolicyTestUtil . createPolicyEngineForTest ( "server1" , globalPolicyFile . getPath ( ) ) ; com . google . common . collect . ImmutableSet < java . lang . String > permissions = policy . getAllPrivileges ( com . google . common . collect . Sets . newHashSet ( "group" ) , ActiveRoleSet . ALL ) ; "<AssertPlaceHolder>" ; } toString ( ) { return SentryConstants . AUTHORIZABLE_JOINER . join ( parts ) ; }
|
org . junit . Assert . assertTrue ( permissions . toString ( ) , permissions . isEmpty ( ) )
|
testRollover ( ) { try ( org . apache . drill . exec . vector . UInt4Vector vector = allocVector ( 1000 ) ) { org . apache . drill . test . rowSet . test . TestFixedWidthWriter . TestIndex index = new org . apache . drill . test . rowSet . test . TestFixedWidthWriter . TestIndex ( ) ; org . apache . drill . exec . vector . accessor . writer . OffsetVectorWriterImpl writer = makeWriter ( vector , index ) ; writer . startWrite ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { index . index = i ; writer . startRow ( ) ; writer . setNextOffset ( ( ( i + 1 ) * 10 ) ) ; writer . saveRow ( ) ; } index . index = 10 ; writer . startRow ( ) ; writer . setNextOffset ( 110 ) ; writer . preRollover ( ) ; for ( int i = 0 ; i < 15 ; i ++ ) { vector . getMutator ( ) . set ( i , - 559038737 ) ; } vector . getMutator ( ) . set ( 1 , 10 ) ; writer . postRollover ( ) ; index . index = 0 ; writer . saveRow ( ) ; for ( int i = 1 ; i < 5 ; i ++ ) { index . index = i ; writer . startRow ( ) ; writer . setNextOffset ( ( ( i + 1 ) * 10 ) ) ; writer . saveRow ( ) ; } writer . endWrite ( ) ; for ( int i = 0 ; i < 6 ; i ++ ) { "<AssertPlaceHolder>" ; } } } getAccessor ( ) { return accessor ; }
|
org . junit . Assert . assertEquals ( ( i * 10 ) , vector . getAccessor ( ) . get ( i ) )
|
testSocket ( ) { System . out . println ( "socket" ) ; kg . apc . io . SocketChannelWithTimeoutsTest . SocketChannelWithTimeoutsEmul instance = new kg . apc . io . SocketChannelWithTimeoutsTest . SocketChannelWithTimeoutsEmul ( ) ; java . net . Socket result = instance . socket ( ) ; "<AssertPlaceHolder>" ; } socket ( ) { return channel . socket ( ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testInvalidNodeId ( ) { de . javagl . jgltf . impl . v1 . GlTF gltf = new de . javagl . jgltf . impl . v1 . GlTF ( ) ; de . javagl . jgltf . impl . v1 . Scene scene = new de . javagl . jgltf . impl . v1 . Scene ( ) ; scene . addNodes ( "INVALID_ID" ) ; gltf . addScenes ( "scene0" , scene ) ; de . javagl . jgltf . validator . Validator validator = new de . javagl . jgltf . validator . Validator ( gltf ) ; de . javagl . jgltf . validator . ValidatorResult validatorResult = validator . validate ( ) ; "<AssertPlaceHolder>" ; } getErrors ( ) { return java . util . Collections . unmodifiableList ( errors ) ; }
|
org . junit . Assert . assertEquals ( 1 , validatorResult . getErrors ( ) . size ( ) )
|
testGetAllWhitelists ( ) { whitelistService . create ( testwlv , "test" ) ; java . util . List < gov . gtas . vo . WhitelistVo > wlvs = whitelistService . getAllWhitelists ( ) ; "<AssertPlaceHolder>" ; } getAllWhitelists ( ) { java . util . List < gov . gtas . model . Whitelist > whitelists = whitelistRepository . findBydeleted ( YesNoEnum . N ) ; java . util . List < gov . gtas . vo . WhitelistVo > wlvList = new java . util . ArrayList ( ) ; if ( whitelists != null ) { whitelists . forEach ( ( wl ) -> { gov . gtas . vo . WhitelistVo wlv = mapWhitelistVoFromWhitelist ( wl ) ; wlvList . add ( wlv ) ; } ) ; } return wlvList ; }
|
org . junit . Assert . assertNotNull ( wlvs )
|
testReplication ( ) { try ( java . sql . Connection connection = getNewConnection ( false ) ) { java . sql . Statement stmt = connection . createStatement ( ) ; stmt . execute ( ( "drop<sp>table<sp>if<sp>exists<sp>auroraReadSlave" + ( jobId ) ) ) ; stmt . execute ( ( ( "create<sp>table<sp>auroraReadSlave" + ( jobId ) ) + "<sp>(id<sp>int<sp>not<sp>null<sp>primary<sp>key<sp>auto_increment,<sp>test<sp>VARCHAR(10))" ) ) ; java . lang . Thread . sleep ( 1500 ) ; connection . setReadOnly ( true ) ; java . sql . ResultSet rs = stmt . executeQuery ( ( "Select<sp>count(*)<sp>from<sp>auroraReadSlave" + ( jobId ) ) ) ; "<AssertPlaceHolder>" ; connection . setReadOnly ( false ) ; stmt . execute ( ( "drop<sp>table<sp>if<sp>exists<sp>auroraReadSlave" + ( jobId ) ) ) ; } } next ( ) { if ( isClosed ) { throw new java . sql . SQLException ( "Operation<sp>not<sp>permit<sp>on<sp>a<sp>closed<sp>resultSet" , "HY000" ) ; } if ( ( rowPointer ) < ( ( dataSize ) - 1 ) ) { ( rowPointer ) ++ ; return true ; } else { if ( ( streaming ) && ( ! ( isEof ) ) ) { lock . lock ( ) ; try { if ( ! ( isEof ) ) { nextStreamingValue ( ) ; } } catch ( java . io . IOException ioe ) { throw handleIoException ( ioe ) ; } finally { lock . unlock ( ) ; } if ( ( resultSetScrollType ) == ( TYPE_FORWARD_ONLY ) ) { rowPointer = 0 ; return ( dataSize ) > 0 ; } else { ( rowPointer ) ++ ; return ( dataSize ) > ( rowPointer ) ; } } rowPointer = dataSize ; return false ; } }
|
org . junit . Assert . assertTrue ( rs . next ( ) )
|
testStumpCreationForSpecifiedAttributeValuePair ( ) { aima . core . learning . framework . DataSet ds = aima . core . learning . framework . DataSetFactory . getRestaurantDataSet ( ) ; java . util . List < java . lang . String > unmatchedValues = new java . util . ArrayList < java . lang . String > ( ) ; unmatchedValues . add ( aima . test . core . unit . learning . learners . DecisionTreeTest . NO ) ; aima . core . learning . inductive . DecisionTree dt = aima . core . learning . inductive . DecisionTree . getStumpFor ( ds , "alternate" , aima . test . core . unit . learning . learners . DecisionTreeTest . YES , aima . test . core . unit . learning . learners . DecisionTreeTest . YES , unmatchedValues , aima . test . core . unit . learning . learners . DecisionTreeTest . NO ) ; "<AssertPlaceHolder>" ; } getStumpFor ( aima . core . learning . framework . DataSet , java . lang . String , java . lang . String , java . lang . String , java . util . List , java . lang . String ) { aima . core . learning . inductive . DecisionTree dt = new aima . core . learning . inductive . DecisionTree ( attributeName ) ; dt . addLeaf ( attributeValue , returnValueIfMatched ) ; for ( java . lang . String unmatchedValue : unmatchedValues ) { dt . addLeaf ( unmatchedValue , returnValueIfUnmatched ) ; } return dt ; }
|
org . junit . Assert . assertNotNull ( dt )
|
whenAddingVehicleWithDiffStartAndEnd_endLocationMustBeRegisteredInLocationMap ( ) { com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl vehicle = VehicleImpl . Builder . newInstance ( "v" ) . setStartLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "start" ) ) . setEndLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "end" ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . VehicleRoutingProblem . Builder vrpBuilder = VehicleRoutingProblem . Builder . newInstance ( ) ; vrpBuilder . addVehicle ( vehicle ) ; "<AssertPlaceHolder>" ; } getLocationMap ( ) { return com . graphhopper . jsprit . core . problem . Collections . unmodifiableMap ( tentative_coordinates ) ; }
|
org . junit . Assert . assertTrue ( vrpBuilder . getLocationMap ( ) . containsKey ( "end" ) )
|
deveObterDataRetornoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . statusservico . consulta . NFStatusServicoConsultaRetorno consultaRetorno = new com . fincatto . documentofiscal . nfe310 . classes . statusservico . consulta . NFStatusServicoConsultaRetorno ( ) ; final java . time . LocalDateTime dataRetorno = java . time . LocalDateTime . from ( java . time . format . DateTimeFormatter . ofPattern ( "yyyy-MM-dd'T'HH:mm:ss" ) . parse ( "2015-11-13T10:10:10" ) ) ; consultaRetorno . setDataRetorno ( dataRetorno ) ; "<AssertPlaceHolder>" ; } getDataRetorno ( ) { return this . dataRetorno ; }
|
org . junit . Assert . assertEquals ( dataRetorno , consultaRetorno . getDataRetorno ( ) )
|
testIndexPruning ( ) { org . apache . jackrabbit . oak . plugins . index . property . strategy . IndexStoreStrategy store = new org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategy ( ) ; org . apache . jackrabbit . oak . spi . state . NodeState root = EMPTY_NODE ; org . apache . jackrabbit . oak . spi . state . NodeBuilder index = root . builder ( ) ; for ( java . lang . String path : asList ( "/" , "a/b/c" , "a/b/d" , "b" , "d/e" , "d/e/f" ) ) { store . update ( index , path , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY ) ; } org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "" , true ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "a/b/c" , true ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "a/b/d" , true ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "b" , true ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "d/e" , true ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "d/e/f" , true ) ; store . update ( index , "/" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "d/e/f" , true ) ; store . update ( index , "d/e" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "d/e/f" , true ) ; store . update ( index , "d/e/f" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkNotPath ( index , "key" , "d" ) ; store . update ( index , "a/b/d" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; store . update ( index , "a/b" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . checkPath ( index , "key" , "a/b/c" , true ) ; store . update ( index , "" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY ) ; store . update ( index , "d/e/f" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; store . update ( index , "b" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; store . update ( index , "a/b/c" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; store . update ( index , "" , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . KEY , org . apache . jackrabbit . oak . plugins . index . property . strategy . ContentMirrorStoreStrategyTest . EMPTY ) ; "<AssertPlaceHolder>" ; } getChildNodeCount ( long ) { init ( ) ; if ( ( childNodeCount ) == ( Long . MAX_VALUE ) ) { if ( ( childNodeCountMin ) > max ) { return childNodeCountMin ; } java . util . Iterator < ? extends org . apache . jackrabbit . oak . spi . state . ChildNodeEntry > iterator = getChildNodeEntries ( )
|
org . junit . Assert . assertEquals ( 0 , index . getChildNodeCount ( 1 ) )
|
testGetMetadataInstanceFromNullMid ( ) { "<AssertPlaceHolder>" ; } getMetadataInstance ( java . lang . String ) { if ( org . springframework . roo . metadata . MetadataIdentificationUtils . isIdentifyingInstance ( metadataId ) ) { return metadataId . substring ( ( ( metadataId . indexOf ( org . springframework . roo . metadata . MetadataIdentificationUtils . INSTANCE_DELIMITER ) ) + 1 ) ) ; } return null ; }
|
org . junit . Assert . assertNull ( org . springframework . roo . metadata . MetadataIdentificationUtils . getMetadataInstance ( null ) )
|
testQueryMetadataIndexManager2 ( ) { com . orientechnologies . orient . core . sql . executor . OResultSet result = com . orientechnologies . orient . core . sql . executor . OSelectStatementExecutionTest . db . query ( "select<sp>expand(indexes)<sp>from<sp>metadata:indexmanager" ) ; com . orientechnologies . orient . core . sql . executor . ExecutionPlanPrintUtils . printExecutionPlan ( result ) ; "<AssertPlaceHolder>" ; result . close ( ) ; } hasNext ( ) { return this . itty . hasNext ( ) ; }
|
org . junit . Assert . assertTrue ( result . hasNext ( ) )
|
testHashSetClusteringAtFront ( ) { int keys = 500000 ; com . carrotsearch . hppc . IntHashSet target = new com . carrotsearch . hppc . IntHashSet ( keys , 0.9 ) { @ com . carrotsearch . hppc . Override protected void allocateBuffers ( int arraySize ) { super . allocateBuffers ( arraySize ) ; System . out . println ( ( "Rehashed<sp>to:<sp>" + arraySize ) ) ; } } ; int expandAtCount = com . carrotsearch . hppc . HashContainers . expandAtCount ( ( ( target . keys . length ) - 1 ) , 0.9 ) ; int fillUntil = expandAtCount - 100000 ; com . carrotsearch . hppc . IntHashSet source = new com . carrotsearch . hppc . IntHashSet ( keys , 0.9 ) ; int unique = 0 ; while ( ( source . size ( ) ) < ( expandAtCount - 1 ) ) { source . add ( ( unique ++ ) ) ; } System . out . println ( "Source<sp>filled<sp>up." ) ; while ( ( target . size ( ) ) < fillUntil ) { target . add ( ( unique ++ ) ) ; } System . out . println ( "Target<sp>filled<sp>up." ) ; "<AssertPlaceHolder>" ; long start = java . lang . System . currentTimeMillis ( ) ; long deadline = start + ( TimeUnit . SECONDS . toMillis ( 5 ) ) ; int i = 0 ; for ( com . carrotsearch . hppc . cursors . IntCursor c : source ) { target . add ( c . value ) ; if ( ( ( i ++ ) % 5000 ) == 0 ) { if ( ( source . keys . length ) == ( target . keys . length ) ) { System . out . println ( java . lang . String . format ( Locale . ROOT , "Keys:<sp>%7d,<sp>%5d<sp>ms.:<sp>%s" , i , ( ( java . lang . System . currentTimeMillis ( ) ) - start ) , ( com . carrotsearch . hppc . HashCollisionsClusteringTest . debugging ? target . visualizeKeyDistribution ( 80 ) : "--" ) ) ) ; } if ( ( java . lang . System . currentTimeMillis ( ) ) >= deadline ) { org . junit . Assert . fail ( ( ( ( "Takes<sp>too<sp>long,<sp>something<sp>is<sp>wrong.<sp>Added<sp>" + i ) + "<sp>keys<sp>out<sp>of<sp>" ) + ( source . size ( ) ) ) ) ; } } } } add ( KType [ ] ) { add ( elements , 0 , elements . length ) ; }
|
org . junit . Assert . assertEquals ( source . keys . length , target . keys . length )
|
whenDecrypting_cacheHit ( ) { com . amazonaws . encryptionsdk . model . DecryptionMaterialsRequest request = com . amazonaws . encryptionsdk . caching . CacheTestFixtures . createDecryptRequest ( 0 ) ; com . amazonaws . encryptionsdk . model . DecryptionMaterials result = com . amazonaws . encryptionsdk . caching . CacheTestFixtures . createDecryptResult ( request ) ; when ( cache . getEntryForDecrypt ( any ( ) ) ) . thenReturn ( new com . amazonaws . encryptionsdk . caching . CachingCryptoMaterialsManagerTest . TestDecryptCacheEntry ( result ) ) ; com . amazonaws . encryptionsdk . model . DecryptionMaterials actual = cmm . decryptMaterials ( request ) ; "<AssertPlaceHolder>" ; verify ( cache , never ( ) ) . putEntryForDecrypt ( any ( ) , any ( ) , any ( ) ) ; verify ( delegate , never ( ) ) . decryptMaterials ( any ( ) ) ; } decryptMaterials ( com . amazonaws . encryptionsdk . model . DecryptionMaterialsRequest ) { byte [ ] cacheId = getCacheIdentifier ( request ) ; com . amazonaws . encryptionsdk . caching . CryptoMaterialsCache . DecryptCacheEntry entry = cache . getEntryForDecrypt ( cacheId ) ; if ( ( entry != null ) && ( ! ( isEntryExpired ( entry . getEntryCreationTime ( ) ) ) ) ) { return entry . getResult ( ) ; } com . amazonaws . encryptionsdk . model . DecryptionMaterials result = backingCMM . decryptMaterials ( request ) ; cache . putEntryForDecrypt ( cacheId , result , hint ) ; return result ; }
|
org . junit . Assert . assertEquals ( result , actual )
|
testSetRootResourceDirectoriesEmptySetInput ( ) { ddf . catalog . resource . impl . URLResourceReader resourceReader = new ddf . catalog . resource . impl . URLResourceReader ( mimeTypeMapper , clientFactoryFactory ) ; resourceReader . setRootResourceDirectories ( com . google . common . collect . ImmutableSet . of ( ( ( ddf . catalog . resource . impl . URLResourceReaderTest . ABSOLUTE_PATH ) + ( ddf . catalog . resource . impl . URLResourceReaderTest . TEST_PATH ) ) , ( ( ( ddf . catalog . resource . impl . URLResourceReaderTest . ABSOLUTE_PATH ) + ( ddf . catalog . resource . impl . URLResourceReaderTest . TEST_PATH ) ) + "pdf" ) ) ) ; resourceReader . setRootResourceDirectories ( new java . util . HashSet < java . lang . String > ( ) ) ; java . util . Set < java . lang . String > rootResourceDirectories = resourceReader . getRootResourceDirectories ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertThat ( rootResourceDirectories . size ( ) , org . hamcrest . Matchers . is ( 0 ) )
|
testUniqueTableIds ( ) { java . util . Set < java . lang . Long > ids = new java . util . HashSet < java . lang . Long > ( ) ; java . lang . Long id ; for ( java . lang . String table : com . nearinfinity . honeycomb . hbase . HBaseMetadataPropertyTest . tableSchemas . keySet ( ) ) { id = com . nearinfinity . honeycomb . hbase . HBaseMetadataPropertyTest . hbaseMetadata . getTableId ( table ) ; "<AssertPlaceHolder>" ; ids . add ( id ) ; } } getTableId ( java . lang . String ) { return metadata . getTableId ( tableName ) ; }
|
org . junit . Assert . assertFalse ( ids . contains ( id ) )
|
testBuildWithDisabledSecurityConstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject context = new org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>EnrolmentEnrolmentSubject<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . enrolment . enrolment . subject . EnrolmentEnrolmentSubject > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testGetSizeOnOsd ( ) { java . lang . String volumeName = "testGetSizeOnOsd" ; org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . testEnv . startAdditionalOSDs ( 3 ) ; org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . client . createVolume ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . mrcAddress , org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . auth , org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . userCredentials , volumeName ) ; org . xtreemfs . common . libxtreemfs . AdminVolume volume = org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . client . openVolume ( volumeName , null , org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . options ) ; volume . start ( ) ; volume . setDefaultReplicationPolicy ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . userCredentials , "/" , ReplicaUpdatePolicies . REPL_UPDATE_PC_WQRQ , 3 , org . xtreemfs . common . xloc . ReplicationFlags . setSequentialStrategy ( 0 ) ) ; org . xtreemfs . common . libxtreemfs . AdminFileHandle fileHandle = volume . openFile ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . userCredentials , "/test.txt" , ( ( SYSTEM_V_FCNTL . SYSTEM_V_FCNTL_H_O_CREAT . getNumber ( ) ) | ( SYSTEM_V_FCNTL . SYSTEM_V_FCNTL_H_O_RDWR . getNumber ( ) ) ) , 511 ) ; java . lang . String firstReplicaUuid = fileHandle . getReplica ( 0 ) . getOsdUuids ( 0 ) ; java . lang . String content = "" ; for ( int i = 0 ; i < 12000 ; i ++ ) { content = content . concat ( "Hello<sp>World<sp>" ) ; } byte [ ] bytesIn = content . getBytes ( ) ; int length = bytesIn . length ; org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . testEnv . stopOSD ( firstReplicaUuid ) ; fileHandle . write ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . userCredentials , bytesIn , length , 0 ) ; fileHandle . close ( ) ; org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . testEnv . startOSD ( firstReplicaUuid ) ; long size = 0 ; do { while ( ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . testEnv . getPrimary ( fileHandle . getGlobalFileId ( ) ) ) != null ) { java . lang . Thread . sleep ( 5000 ) ; } size = fileHandle . getSizeOnOSD ( ) ; } while ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . testEnv . getPrimary ( fileHandle . getGlobalFileId ( ) ) . equals ( firstReplicaUuid ) ) ; "<AssertPlaceHolder>" ; org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . client . deleteVolume ( org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . auth , org . xtreemfs . common . libxtreemfs . FileHandleImplementationTest . userCredentials , volumeName ) ; } equals ( java . lang . Object ) { try { org . xtreemfs . foundation . flease . Flease o = ( ( org . xtreemfs . foundation . flease . Flease ) ( other ) ) ; boolean sameTo = ( o . leaseTimeout_ms ) == ( this . leaseTimeout_ms ) ; return ( isSameLeaseHolder ( o ) ) && sameTo ; } catch ( java . lang . ClassCastException ex ) { return false ; } }
|
org . junit . Assert . assertEquals ( length , size )
|
testValidateAnnotatedObject_IllegalNullValue ( ) { uow . transformMessage ( ( m ) -> new GenericMessage < java . lang . Object > ( new org . axonframework . messaging . interceptors . JSR303AnnotatedInstance ( null ) ) ) ; try { testSubject . handle ( uow , mockInterceptorChain ) ; org . junit . Assert . fail ( "Expected<sp>exception" ) ; } catch ( org . axonframework . messaging . interceptors . JSR303ViolationException e ) { "<AssertPlaceHolder>" ; } verify ( mockInterceptorChain , never ( ) ) . proceed ( ) ; } getViolations ( ) { return violations ; }
|
org . junit . Assert . assertFalse ( e . getViolations ( ) . isEmpty ( ) )
|
test_GetSplitButton_By_AutomationId ( ) { when ( element . findFirst ( mmarquee . automation . BaseAutomationTest . isTreeScope ( TreeScope . Descendants ) , any ( ) ) ) . thenReturn ( targetElement ) ; mmarquee . automation . controls . AutomationSplitButton btn = spyWndw . getSplitButton ( mmarquee . automation . controls . Search . getBuilder ( ) . automationId ( "myID" ) . build ( ) ) ; "<AssertPlaceHolder>" ; verify ( spyWndw ) . createAutomationIdPropertyCondition ( "myID" ) ; verify ( spyWndw ) . createControlTypeCondition ( ControlType . SplitButton ) ; verify ( element , atLeastOnce ( ) ) . findFirst ( any ( ) , any ( ) ) ; } getElement ( ) { return this . element ; }
|
org . junit . Assert . assertEquals ( targetElement , btn . getElement ( ) )
|
testWithDefaultsPreservesSideInputs ( ) { final org . apache . beam . sdk . values . PCollectionView < java . lang . Integer > view = pipeline . apply ( org . apache . beam . sdk . transforms . Create . of ( 1 ) ) . apply ( org . apache . beam . sdk . transforms . Sum . integersGlobally ( ) . asSingletonView ( ) ) ; Combine . Globally < java . lang . Integer , java . lang . String > combine = org . apache . beam . sdk . transforms . Combine . globally ( new org . apache . beam . sdk . transforms . CombineTest . SharedTestBase . TestCombineFnWithContext ( view ) ) . withSideInputs ( view ) . withoutDefaults ( ) ; "<AssertPlaceHolder>" ; } getSideInputs ( ) { return sideInputs ; }
|
org . junit . Assert . assertEquals ( java . util . Collections . singletonList ( view ) , combine . getSideInputs ( ) )
|
testGetStepData ( ) { org . pentaho . di . trans . kafka . consumer . KafkaConsumerMeta m = new org . pentaho . di . trans . kafka . consumer . KafkaConsumerMeta ( ) ; "<AssertPlaceHolder>" ; } getStepData ( ) { return new org . pentaho . di . trans . kafka . consumer . KafkaConsumerData ( ) ; }
|
org . junit . Assert . assertEquals ( org . pentaho . di . trans . kafka . consumer . KafkaConsumerData . class , m . getStepData ( ) . getClass ( ) )
|
testClearArgs ( ) { final org . apache . oozie . fluentjob . api . action . SparkActionBuilder builder = getBuilderInstance ( ) ; for ( final java . lang . String file : org . apache . oozie . fluentjob . api . action . TestSparkActionBuilder . ARGS ) { builder . withArg ( file ) ; } builder . clearArgs ( ) ; final org . apache . oozie . fluentjob . api . action . SparkAction action = builder . build ( ) ; final java . util . List < java . lang . String > argList = action . getArgs ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return org . apache . oozie . event . MemoryEventQueue . currentSize . intValue ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , argList . size ( ) )
|
testTotalTermFreq ( ) { final java . lang . String tableName = "testTotalTermFreq" ; org . apache . blur . thrift . TableGen . define ( tableName ) . cols ( "test" , "col1" ) . addRows ( 100 , 20 , "r1" , "rec-###" , "value" ) . build ( getClient ( ) ) ; $ . TermsCommand command = new $ . TermsCommand ( ) ; command . setTable ( tableName ) ; command . setFieldName ( "test.col1" ) ; java . util . List < java . lang . String > terms = command . run ( getClient ( ) ) ; java . util . List < java . lang . String > list = com . google . common . collect . Lists . newArrayList ( "value" ) ; "<AssertPlaceHolder>" ; } getClient ( ) { return org . apache . blur . thrift . BlurClient . getClientFromZooKeeperConnectionStr ( org . apache . blur . mapreduce . lib . update . DriverTest . miniCluster . getZkConnectionString ( ) ) ; }
|
org . junit . Assert . assertEquals ( list , terms )
|
shouldReturnFalseOnInitIfTheFileWasCreated ( ) { org . neo4j . kernel . impl . store . id . IdContainer idContainer = new org . neo4j . kernel . impl . store . id . IdContainer ( fs , file , 100 , false ) ; "<AssertPlaceHolder>" ; idContainer . close ( 100 ) ; } init ( ) { }
|
org . junit . Assert . assertFalse ( idContainer . init ( ) )
|
testDropIgnoreNamedPrimaryIndexThatDoesntExistSucceeds ( ) { boolean dropped = indexedBucket . bucketManager ( ) . dropN1qlPrimaryIndex ( "invalidPrimaryIndex" , true ) ; "<AssertPlaceHolder>" ; } dropN1qlPrimaryIndex ( java . lang . String , boolean ) { return drop ( ignoreIfNotExist , com . couchbase . client . java . query . Index . dropNamedPrimaryIndex ( bucket , customName ) . using ( IndexType . GSI ) , ( ( "Error<sp>dropping<sp>custom<sp>primary<sp>index<sp>\"" + customName ) + "\"" ) ) ; }
|
org . junit . Assert . assertFalse ( dropped )
|
saveAndRetrieveTypeWithoutIdPropertyViaRepositoryFindOne ( ) { org . springframework . data . mongodb . core . NoExplicitIdTests . TypeWithoutIdProperty noid = new org . springframework . data . mongodb . core . NoExplicitIdTests . TypeWithoutIdProperty ( ) ; noid . someString = "o.O" ; repo . save ( noid ) ; java . util . Map < java . lang . String , java . lang . Object > map = mongoOps . findOne ( query ( where ( "someString" ) . is ( noid . someString ) ) , java . util . Map . class , "typeWithoutIdProperty" ) ; java . util . Optional < org . springframework . data . mongodb . core . NoExplicitIdTests . TypeWithoutIdProperty > retrieved = repo . findById ( map . get ( "_id" ) . toString ( ) ) ; "<AssertPlaceHolder>" ; } get ( ) { invocationCount . incrementAndGet ( ) ; return session ; }
|
org . junit . Assert . assertThat ( retrieved . get ( ) . someString , org . hamcrest . core . Is . is ( noid . someString ) )
|
testSerialization2 ( ) { org . jfree . data . statistics . DefaultStatisticalCategoryDataset d1 = new org . jfree . data . statistics . DefaultStatisticalCategoryDataset ( ) ; d1 . add ( 1.2 , 3.4 , "Row<sp>1" , "Column<sp>1" ) ; org . jfree . data . statistics . DefaultStatisticalCategoryDataset d2 = ( ( org . jfree . data . statistics . DefaultStatisticalCategoryDataset ) ( org . jfree . chart . TestUtilities . serialised ( d1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( d1 , d2 )
|
testXMLInput ( ) { org . teiid . core . types . XMLType doc = new org . teiid . core . types . XMLType ( new org . teiid . core . types . SQLXMLImpl ( "<foo/>" ) ) ; java . lang . String xpath = "a/b/c" ; java . lang . String value = org . teiid . xquery . saxon . XMLFunctions . xpathValue ( doc , xpath ) ; "<AssertPlaceHolder>" ; } xpathValue ( java . lang . Object , java . lang . String ) { javax . xml . transform . Source s = null ; try { s = org . teiid . query . function . source . XMLSystemFunctions . convertToSource ( doc ) ; net . sf . saxon . sxpath . XPathEvaluator eval = new net . sf . saxon . sxpath . XPathEvaluator ( ) ; net . sf . saxon . sxpath . XPathExpression expr = eval . createExpression ( xpath ) ; net . sf . saxon . sxpath . XPathDynamicContext context = expr . createDynamicContext ( eval . getConfiguration ( ) . buildDocumentTree ( s ) . getRootNode ( ) ) ; java . lang . Object o = expr . evaluateSingle ( context ) ; if ( o == null ) { return null ; } if ( o instanceof net . sf . saxon . om . Item ) { net . sf . saxon . om . Item i = ( ( net . sf . saxon . om . Item ) ( o ) ) ; if ( org . teiid . xquery . saxon . XMLFunctions . isNull ( i ) ) { return null ; } return i . getStringValue ( ) ; } return o . toString ( ) ; } finally { org . teiid . util . WSUtil . closeSource ( s ) ; } }
|
org . junit . Assert . assertNull ( value )
|
testScalarArithmetic ( ) { org . nd4j . linalg . api . ndarray . INDArray linspace = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 6 , 6 ) ; org . nd4j . linalg . api . ndarray . INDArray plusOne = org . nd4j . linalg . factory . Nd4j . linspace ( 2 , 7 , 6 ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . api . ops . impl . scalar . ScalarAdd ( linspace , 1 ) ) ; "<AssertPlaceHolder>" ; } exec ( org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation , int [ ] ) { if ( ( dimension == null ) || ( ( dimension . length ) == 0 ) ) dimension = new int [ ] { Integer . MAX_VALUE } ; checkForCompression ( op ) ; validateDataType ( org . nd4j . linalg . factory . Nd4j . dataType ( ) , op ) ; if ( ( extraz . get ( ) ) == null ) extraz . set ( new org . nd4j . linalg . cpu . nativecpu . ops . PointerPointer ( 32 ) ) ; dimension = org . nd4j . linalg . api . shape . Shape . normalizeAxis ( op . x ( ) . rank ( ) , dimension ) ; for ( int i = 0 ; i < ( dimension . length ) ; i ++ ) { if ( ( dimension [ i ] ) < 0 ) dimension [ i ] += op . x ( ) . rank ( ) ; } if ( ( dimension . length ) == ( op . x ( ) . rank ( ) ) ) dimension = new int [ ] { Integer . MAX_VALUE } ; long [ ] retShape = ( org . nd4j . linalg . api . shape . Shape . wholeArrayDimension ( dimension ) ) ? new long [ ] { 1 , 1 } : org . nd4j . linalg . util . ArrayUtil . removeIndex ( op . x ( ) . shape ( ) , dimension ) ; if ( ( retShape . length ) == 1 ) { if ( ( dimension [ 0 ] ) == 0 ) retShape = new long [ ] { 1 , retShape [ 0 ] } ; else retShape = new long [ ] { retShape [ 0 ] , 1 } ; } else if ( ( retShape . length ) == 0 ) { retShape = new long [ ] { 1 , 1 } ; } if ( ( ( op . z ( ) ) == null ) || ( ( op . x ( ) ) == ( op . z ( ) ) ) ) { org . nd4j . linalg . api . ndarray . INDArray ret ; if ( ( op . x ( ) . data ( ) . dataType ( ) ) == ( DataBuffer . Type . DOUBLE ) ) ret = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( retShape , op . zeroDouble ( ) ) ; else ret = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( retShape , op . zeroFloat ( ) ) ; op . setZ ( ret ) ; } else if ( ! ( org . nd4j . linalg . cpu . nativecpu . ops . Arrays . equals ( retShape , op . z ( ) . shape ( ) ) ) ) { throw new java . lang . IllegalStateException ( ( ( ( ( ( "Z<sp>array<sp>shape<sp>does<sp>not<sp>match<sp>expected<sp>return<sp>type<sp>for<sp>op<sp>" + op ) + ":<sp>expected<sp>shape<sp>" ) + ( org . nd4j . linalg . cpu . nativecpu . ops . Arrays . toString ( retShape ) ) ) + ",<sp>z.shape()=" ) + ( org . nd4j . linalg . cpu . nativecpu . ops . Arrays . toString ( op . z ( ) . shape ( ) ) ) ) ) ; } if ( ( dimension . length ) == ( op . x ( ) . rank ( ) ) ) dimension = new int [ ] { Integer . MAX_VALUE } ; org . nd4j . linalg . cpu . nativecpu . ops . Pointer dimensionAddress = constantHandler . getConstantBuffer ( dimension ) . addressPointer ( ) ; org . nd4j . linalg . primitives . Pair < org . nd4j . linalg . api . buffer . DataBuffer , org . nd4j . linalg . api . buffer . DataBuffer > tadBuffers = tadManager . getTADOnlyShapeInfo ( op . x ( ) , dimension ) ; org . nd4j . linalg . cpu . nativecpu . ops . Pointer hostTadShapeInfo = tadBuffers . getFirst ( ) . addressPointer ( ) ; org . nd4j . linalg . api . buffer . DataBuffer offsets = tadBuffers . getSecond ( ) ; org . nd4j . linalg . cpu . nativecpu . ops . Pointer hostTadOffsets = ( offsets == null ) ? null : offsets . addressPointer ( ) ; org . nd4j . linalg . cpu . nativecpu . ops . PointerPointer dummy = extraz . get ( ) . put ( hostTadShapeInfo , hostTadOffsets ) ; long st = profilingHookIn ( op , tadBuffers . getFirst ( ) ) ; org . nd4j . linalg . cpu . nativecpu . ops . Pointer x = op . x ( ) . data ( ) . addressPointer ( ) ; org . nd4j . linalg . cpu . nativecpu . ops . Pointer z = op . z ( ) . data ( ) . addressPointer ( ) ; if ( ( op . x ( ) . data ( ) . dataType
|
org . junit . Assert . assertEquals ( plusOne , linspace )
|
testODataApplicationException1 ( ) { org . apache . olingo . server . api . ODataApplicationException exp = new org . apache . olingo . server . api . ODataApplicationException ( "Exception" , 500 , java . util . Locale . ENGLISH , new java . lang . RuntimeException ( "Error" ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( exp )
|
GetAllRatePlans ( ) { net . billforward . model . RatePlan [ ] ratePlans = net . billforward . model . RatePlan . getAll ( ) ; "<AssertPlaceHolder>" ; } getAll ( ) { return net . billforward . model . RatePlan . getAll ( net . billforward . model . RatePlan . ResourcePath ( ) ) ; }
|
org . junit . Assert . assertNotNull ( ratePlans )
|
testReadFromWithIllegalMessageNum8 ( ) { java . util . Map < java . lang . String , java . lang . String > attributes = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; attributes . put ( "ATT456" , "VAL456" ) ; org . msgpack . MessagePack msg = new org . msgpack . MessagePack ( ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; org . msgpack . packer . Packer pk = msg . createPacker ( out ) ; byte [ ] bytes ; java . io . ByteArrayInputStream in ; org . msgpack . unpacker . Unpacker upk = null ; try { pk . writeMapBegin ( 8 ) ; pk . write ( "in_link" 3 ) ; pk . write ( "in_link" 5 ) ; pk . write ( "version" ) ; pk . write ( "in_link" 2 ) ; pk . write ( "port_id" ) ; pk . write ( "in_link" 1 ) ; pk . write ( "node_id" ) ; pk . write ( "NODE_ID456" ) ; pk . write ( "in_link" 6 ) ; pk . write ( "OUT_LINK456" ) ; pk . write ( "in_link" ) ; pk . write ( "IN_LINK456" ) ; pk . write ( "attributes" ) ; pk . write ( attributes ) ; pk . writeMapEnd ( ) ; bytes = out . toByteArray ( ) ; in = new java . io . ByteArrayInputStream ( bytes ) ; upk = msg . createUnpacker ( in ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( "in_link" 4 ) ; } try { target . readFrom ( upk ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; return ; } org . junit . Assert . fail ( "in_link" 0 ) ; } readFrom ( org . msgpack . unpacker . Unpacker ) { int size = upk . readMapBegin ( ) ; if ( size != ( org . o3project . odenos . remoteobject . event . BaseObjectChanged . MSG_NUM ) ) { throw new java . io . IOException ( ) ; } while ( ( size -- ) > 0 ) { java . lang . String field = upk . readString ( ) ; switch ( field ) { case "action" : action = upk . readString ( ) ; break ; case "prev" : if ( ! ( upk . trySkipNil ( ) ) ) { prev = upk . read ( this . msgClass ) ; } break ; case "curr" : if ( ! ( upk . trySkipNil ( ) ) ) { curr = upk . read ( this . msgClass ) ; } break ; default : throw new java . io . IOException ( ) ; } } upk . readMapEnd ( ) ; }
|
org . junit . Assert . assertTrue ( ( e instanceof java . io . IOException ) )
|
setValuesMap ( ) { final com . arangodb . internal . DocumentCache cache = new com . arangodb . internal . DocumentCache ( ) ; final java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; final java . util . Map < com . arangodb . entity . DocumentField . Type , java . lang . String > values = new java . util . HashMap < com . arangodb . entity . DocumentField . Type , java . lang . String > ( ) ; values . put ( Type . ID , "testId" ) ; values . put ( Type . KEY , "testKey" ) ; values . put ( Type . REV , "testRev" ) ; cache . setValues ( map , values ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return task . isEmpty ( ) ; }
|
org . junit . Assert . assertThat ( map . isEmpty ( ) , org . hamcrest . Matchers . is ( true ) )
|
reportsWrongTreatmentTimeline ( ) { final java . util . List < com . hartwig . hmftools . common . ecrf . datamodel . ValidationFinding > findings = com . hartwig . hmftools . patientdb . validators . PatientValidator . validateTreatments ( com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . PATIENT_IDENTIFIER , com . google . common . collect . Lists . newArrayList ( com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . TREATMENT_JAN_MAR , com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . TREATMENT_JAN_JAN , com . hartwig . hmftools . patientdb . validators . PatientValidatorTest . TREATMENT_JAN_FEB ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( maxheap . size ( ) ) + ( minheap . size ( ) ) ; }
|
org . junit . Assert . assertEquals ( 1 , findings . size ( ) )
|
shouldHaveOnlyAsManyMessagesAsTheSizeOfTheAuditorLog ( ) { org . ei . drishti . common . audit . Auditor auditor = new org . ei . drishti . common . audit . Auditor ( 2 ) ; audit ( auditor , "Message<sp>1" ) ; audit ( auditor , "Message<sp>2" ) ; audit ( auditor , "Message<sp>3" ) ; "<AssertPlaceHolder>" ; } messagesSince ( long ) { if ( messageIndex <= 0 ) { return messages ; } int index = binarySearch ( messages , new org . ei . drishti . common . audit . AuditMessage ( org . motechproject . util . DateUtil . now ( ) , messageIndex , org . ei . drishti . common . audit . AuditMessageType . NORMAL , null ) ) ; int position = java . lang . Math . abs ( ( index + 1 ) ) ; if ( position >= ( messages . size ( ) ) ) { return org . ei . drishti . common . audit . Collections . emptyList ( ) ; } return messages . subList ( position , messages . size ( ) ) ; }
|
org . junit . Assert . assertThat ( auditor . messagesSince ( 0 ) . size ( ) , org . hamcrest . CoreMatchers . is ( 2 ) )
|
testWriterIsClosed_BadCase ( ) { java . io . PrintWriter pw = mock ( java . io . PrintWriter . class ) ; doThrow ( new java . lang . IllegalStateException ( "Thrown<sp>to<sp>test<sp>if<sp>PrintWriter<sp>is<sp>closed<sp>on<sp>exception" ) ) . when ( pw ) . print ( anyString ( ) ) ; org . oscm . operatorsvc . client . commands . GetUserOperationLogCommand comm = spy ( new org . oscm . operatorsvc . client . commands . GetUserOperationLogCommand ( ) ) ; doReturn ( pw ) . when ( comm ) . createPrintWriter ( any ( java . io . File . class ) ) ; java . lang . String fileName = org . oscm . operatorsvc . client . commands . GetUserOperationLogCommandTest . CORRECT_FILE_NAME ; java . lang . String entityType = "SUBSCR" ; java . lang . String fromDate = "2011-10-01" ; java . lang . String toDate = "2011-11-30" ; args . put ( "filename" , fileName ) ; args . put ( "entitytype" , entityType ) ; args . put ( "from" , fromDate ) ; args . put ( "to" , toDate ) ; stubCallReturn = org . oscm . operatorsvc . client . commands . GetUserOperationLogCommandTest . STUB_RETURN . getBytes ( ) ; "<AssertPlaceHolder>" ; verify ( pw , times ( 1 ) ) . close ( ) ; } run ( org . oscm . operatorsvc . client . CommandContext ) { final org . oscm . internal . vo . VOOrganization organization = new org . oscm . internal . vo . VOOrganization ( ) ; organization . setOrganizationId ( ctx . getString ( org . oscm . operatorsvc . client . commands . AddAvailablePaymentTypesCommand . ARG_ORGID ) ) ; final java . util . Set < java . lang . String > types = new java . util . HashSet < java . lang . String > ( ctx . getList ( org . oscm . operatorsvc . client . commands . AddAvailablePaymentTypesCommand . ARG_PAYMENTTYPES ) ) ; ctx . getService ( ) . addAvailablePaymentTypes ( organization , types ) ; ctx . out ( ) . println ( "The<sp>following<sp>payment<sp>types<sp>were<sp>successfully<sp>enabled:" ) ; for ( java . lang . String t : types ) { ctx . out ( ) . println ( t ) ; } return true ; }
|
org . junit . Assert . assertFalse ( comm . run ( ctx ) )
|
constraintsPreventSwitch ( ) { graph = getCrossFormedGraphWithConstraintsInSecondLayer ( ) ; decider = givenDeciderForFreeLayer ( 1 , CrossingCountSide . WEST ) ; "<AssertPlaceHolder>" ; } doesSwitchReduceCrossings ( int , int ) { if ( constraintsPreventSwitch ( upperNodeIndex , lowerNodeIndex ) ) { return false ; } org . eclipse . elk . alg . layered . graph . LNode upperNode = freeLayer [ upperNodeIndex ] ; org . eclipse . elk . alg . layered . graph . LNode lowerNode = freeLayer [ lowerNodeIndex ] ; org . eclipse . elk . core . util . Pair < java . lang . Integer , java . lang . Integer > leftInlayer = leftInLayerCounter . countInLayerCrossingsBetweenNodesInBothOrders ( upperNode , lowerNode , PortSide . WEST ) ; org . eclipse . elk . core . util . Pair < java . lang . Integer , java . lang . Integer > rightInlayer = rightInLayerCounter . countInLayerCrossingsBetweenNodesInBothOrders ( upperNode , lowerNode , PortSide . EAST ) ; northSouthCounter . countCrossings ( upperNode , lowerNode ) ; int upperLowerCrossings = ( ( ( crossingMatrixFiller . getCrossingMatrixEntry ( upperNode , lowerNode ) ) + ( leftInlayer . getFirst ( ) ) ) + ( rightInlayer . getFirst ( ) ) ) + ( northSouthCounter . getUpperLowerCrossings ( ) ) ; int lowerUpperCrossings = ( ( ( crossingMatrixFiller . getCrossingMatrixEntry ( lowerNode , upperNode ) ) + ( leftInlayer . getSecond ( ) ) ) + ( rightInlayer . getSecond ( ) ) ) + ( northSouthCounter . getLowerUpperCrossings ( ) ) ; if ( countCrossingsCausedByPortSwitch ) { org . eclipse . elk . alg . layered . graph . LPort upperPort = ( ( org . eclipse . elk . alg . layered . graph . LPort ) ( upperNode . getProperty ( InternalProperties . ORIGIN ) ) ) ; org . eclipse . elk . alg . layered . graph . LPort lowerPort = ( ( org . eclipse . elk . alg . layered . graph . LPort ) ( lowerNode . getProperty ( InternalProperties . ORIGIN ) ) ) ; org . eclipse . elk . core . util . Pair < java . lang . Integer , java . lang . Integer > crossingNumbers = parentCrossCounter . countCrossingsBetweenPortsInBothOrders ( upperPort , lowerPort ) ; upperLowerCrossings += crossingNumbers . getFirst ( ) ; lowerUpperCrossings += crossingNumbers . getSecond ( ) ; } return upperLowerCrossings > lowerUpperCrossings ; }
|
org . junit . Assert . assertThat ( decider . doesSwitchReduceCrossings ( 0 , 1 ) , org . hamcrest . CoreMatchers . is ( false ) )
|
sublist_4d ( ) { final com . ericsson . otp . erlang . OtpErlangList r = ( ( com . ericsson . otp . erlang . OtpErlangList ) ( termParser . parse ( "[1,2,3|4]" ) ) ) ; final com . ericsson . otp . erlang . OtpErlangObject s = termParser . parse ( "4" ) ; final com . ericsson . otp . erlang . OtpErlangObject ss = r . getNthTail ( 3 ) ; "<AssertPlaceHolder>" ; } parse ( com . ericsson . otp . erlang . OtpErlangObject ) { try { if ( object instanceof com . ericsson . otp . erlang . OtpErlangTuple ) { final com . ericsson . otp . erlang . OtpErlangTuple objectTuple = ( ( com . ericsson . otp . erlang . OtpErlangTuple ) ( object ) ) ; setUnSuccessful ( ( ( com . ericsson . otp . erlang . OtpErlangString ) ( objectTuple . elementAt ( 1 ) ) ) . stringValue ( ) ) ; } else { final com . ericsson . otp . erlang . OtpErlangList resultList = ( ( com . ericsson . otp . erlang . OtpErlangList ) ( object ) ) ; if ( ( resultList . arity ( ) ) == 0 ) { setUnSuccessful ( emptyErrorMessage ) ; return ; } duplicates = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < ( resultList . arity ( ) ) ; ++ i ) { duplicates . add ( parseDuplicates ( resultList . elementAt ( i ) ) ) ; } isSuccessful = true ; } } catch ( final java . lang . Exception e ) { setUnSuccessful ( e . getMessage ( ) ) ; } }
|
org . junit . Assert . assertEquals ( s , ss )
|
createUnboundFunctionQuery ( ) { com . sdl . odata . client . api . ODataClientQuery query = new com . sdl . odata . client . FunctionImportClientQuery . Builder ( ) . withEntityType ( com . sdl . odata . client . DefaultODataClientQueryTest . EmptyEntity . class ) . withFunctionName ( "SampleFunction" ) . withFunctionParameter ( "ParamName" , "ParamValue" ) . build ( ) ; java . lang . String expectedToString = "SampleFunction(ParamName=ParamValue)" ; "<AssertPlaceHolder>" ; } getQuery ( ) { java . lang . StringBuilder query = new java . lang . StringBuilder ( ) ; query . append ( getEdmEntityName ( ) ) ; if ( ! ( isSingletonEntity ( ) ) ) { query . append ( generateParameters ( ) ) ; } return query . toString ( ) ; }
|
org . junit . Assert . assertThat ( query . getQuery ( ) , org . hamcrest . core . Is . is ( expectedToString ) )
|
testCreateTestWithLogWithDuplicatedStatement ( ) { spoon . reflect . declaration . CtClass testClass = eu . stamp_project . Utils . findClass ( "fr.inria.sample.TestClassWithoutAssert" ) ; final spoon . reflect . declaration . CtMethod < ? > test2 = ( ( spoon . reflect . declaration . CtMethod < ? > ) ( testClass . getMethodsByName ( "test2" ) . get ( 0 ) ) ) ; final spoon . reflect . declaration . CtMethod < ? > testWithLog = eu . stamp_project . dspot . assertgenerator . AssertGeneratorHelper . createTestWithLog ( test2 , "fr.inria.sample" , java . util . Collections . emptyList ( ) ) ; final java . lang . String expectedMethod = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "public<sp>void<sp>test2_withlog()<sp>throws<sp>java.lang.Exception<sp>{" 0 + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "public<sp>void<sp>test2_withlog()<sp>throws<sp>java.lang.Exception<sp>{" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "<sp>fr.inria.sample.ClassWithBoolean<sp>cl<sp>=<sp>new<sp>fr.inria.sample.ClassWithBoolean();" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "<sp>eu.stamp_project.compare.ObjectLog.log(cl,<sp>\"cl\",<sp>\"test2__1\");" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "<sp>cl.getFalse();" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "<sp>cl.getFalse();" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "<sp>cl.getFalse();" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "<sp>eu.stamp_project.compare.ObjectLog.log(cl,<sp>\"cl\",<sp>\"test2__1___end\");" ) + ( eu . stamp_project . utils . AmplificationHelper . LINE_SEPARATOR ) ) + "}" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( "SplittedCommandLineOptions{" + "dspotOptions=" ) + ( dspotOptions ) ) + ",<sp>prettifierOptions=" ) + ( prettifierOptions ) ) + '}' ; }
|
org . junit . Assert . assertEquals ( expectedMethod , testWithLog . toString ( ) )
|
testPreserveCase ( ) { java . nio . file . Path fAr = root . resolve ( "fAr" ) ; java . nio . file . Files . createDirectories ( fAr ) ; try ( java . nio . file . DirectoryStream < java . nio . file . Path > paths = java . nio . file . Files . newDirectoryStream ( root ) ) { "<AssertPlaceHolder>" ; } } getFileName ( ) { java . util . List < java . lang . String > parts = split ( ) ; if ( parts . isEmpty ( ) ) { return null ; } return newPath ( parts . get ( ( ( parts . size ( ) ) - 1 ) ) ) ; }
|
org . junit . Assert . assertEquals ( fAr . getFileName ( ) . toString ( ) , paths . iterator ( ) . next ( ) . getFileName ( ) . toString ( ) )
|
testCopyRequestHeaders ( ) { org . apache . shindig . gadgets . http . HttpRequest origRequest = new org . apache . shindig . gadgets . http . HttpRequest ( org . apache . shindig . common . uri . Uri . parse ( "http://www.example.org/data.html" ) ) ; org . apache . shindig . gadgets . uri . Map < java . lang . String , org . apache . shindig . gadgets . uri . List < java . lang . String > > addedHeaders = com . google . common . collect . ImmutableMap . < java . lang . String , org . apache . shindig . gadgets . uri . List < java . lang . String > > builder ( ) . put ( "h1" , com . google . common . collect . ImmutableList . of ( "http://www.example.org/data.html" 3 , "http://www.example.org/data.html" 2 ) ) . put ( "http://www.example.org/data.html" 7 , com . google . common . collect . ImmutableList . of ( "v3" , "v4" ) ) . put ( "http://www.example.org/data.html" 4 , com . google . common . collect . ImmutableList . of ( "http://www.example.org/data.html" 5 , "http://www.example.org/data.html" 1 ) ) . put ( "unchanged_header" , com . google . common . collect . ImmutableList . < java . lang . String > of ( ) ) . put ( "http://www.example.org/data.html" 0 , com . google . common . collect . ImmutableList . of ( "50" , "100" ) ) . build ( ) ; origRequest . addAllHeaders ( addedHeaders ) ; org . apache . shindig . gadgets . http . HttpRequest req = new org . apache . shindig . gadgets . http . HttpRequest ( org . apache . shindig . common . uri . Uri . parse ( "http://www.example.org/data.html" ) ) ; req . removeHeader ( HttpRequest . DOS_PREVENTION_HEADER ) ; req . addHeader ( "h1" , "hello" ) ; req . addHeader ( "http://www.example.org/data.html" 0 , "10" ) ; req . addHeader ( "unchanged_header" , "original_value" ) ; org . apache . shindig . gadgets . uri . UriUtils . copyRequestHeaders ( origRequest , req , UriUtils . DisallowedHeaders . POST_INCOMPATIBLE_DIRECTIVES ) ; org . apache . shindig . gadgets . uri . Map < java . lang . String , org . apache . shindig . gadgets . uri . List < java . lang . String > > headers = com . google . common . collect . ImmutableMap . < java . lang . String , org . apache . shindig . gadgets . uri . List < java . lang . String > > builder ( ) . put ( "h1" , com . google . common . collect . ImmutableList . of ( "http://www.example.org/data.html" 3 , "http://www.example.org/data.html" 2 ) ) . put ( "http://www.example.org/data.html" 7 , com . google . common . collect . ImmutableList . of ( "v3" , "v4" ) ) . put ( "unchanged_header" , com . google . common . collect . ImmutableList . of ( "original_value" ) ) . put ( "http://www.example.org/data.html" 0 , com . google . common . collect . ImmutableList . of ( "10" ) ) . put ( HttpRequest . DOS_PREVENTION_HEADER , com . google . common . collect . ImmutableList . of ( "http://www.example.org/data.html" 6 ) ) . build ( ) ; "<AssertPlaceHolder>" ; } getHeaders ( ) { return headers ; }
|
org . junit . Assert . assertEquals ( headers , req . getHeaders ( ) )
|
testNewXPath ( ) { javax . xml . xpath . XPath path = org . apache . tuscany . sca . common . xml . xpath . XPathHelperTestCase . xpathHelper . newXPath ( ) ; "<AssertPlaceHolder>" ; } newXPath ( ) { return factory . newXPath ( ) ; }
|
org . junit . Assert . assertNotNull ( path )
|
testStartServerUsedPort ( ) { int port = getFreePort ( 1024 ) ; java . net . InetAddress addr = java . net . InetAddress . getByName ( "localhost" ) ; ( ( org . apache . accumulo . core . conf . ConfigurationCopy ) ( org . apache . accumulo . server . util . TServerUtilsTest . factory . getSystemConfiguration ( ) ) ) . set ( Property . TSERV_CLIENTPORT , java . lang . Integer . toString ( port ) ) ; try ( java . net . ServerSocket s = new java . net . ServerSocket ( port , 50 , addr ) ) { "<AssertPlaceHolder>" ; startServer ( ) ; } } toString ( org . apache . zookeeper . WatchedEvent ) { return new java . lang . StringBuilder ( "{path=" ) . append ( event . getPath ( ) ) . append ( ",state=" ) . append ( event . getState ( ) ) . append ( ",type=" ) . append ( event . getType ( ) ) . append ( "}" ) . toString ( ) ; }
|
org . junit . Assert . assertNotNull ( s )
|
testFindSetNames ( ) { org . oscarehr . common . model . DemographicSets entity = new org . oscarehr . common . model . DemographicSets ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setName ( "a" ) ; dao . persist ( entity ) ; entity = new org . oscarehr . common . model . DemographicSets ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setName ( "b" ) ; dao . persist ( entity ) ; entity = new org . oscarehr . common . model . DemographicSets ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . setName ( "b" ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } findSetNames ( ) { java . lang . String sql = "select<sp>distinct(x.name)<sp>from<sp>DemographicSets<sp>x" ; javax . persistence . Query query = entityManager . createQuery ( sql ) ; @ org . oscarehr . common . dao . SuppressWarnings ( "unchecked" ) java . util . List < java . lang . String > results = query . getResultList ( ) ; return results ; }
|
org . junit . Assert . assertEquals ( 2 , dao . findSetNames ( ) . size ( ) )
|
testJavaFileIsCreatedInOutputDirectory ( ) { org . gradle . api . Project project = org . gradle . testfixtures . ProjectBuilder . builder ( ) . build ( ) ; project . getPluginManager ( ) . apply ( com . fizzed . rocker . gradle . RockerPlugin . class ) ; com . fizzed . rocker . gradle . RockerTask . doCompileRocker ( project , new java . io . File ( "src/test/java" ) , new java . io . File ( "build/generated/source/apt/main" ) , new java . io . File ( "build/classes/main" ) ) ; java . io . File templateFile = new java . io . File ( "build/generated/source/apt/main/com/fizzed/rocker/gradle/views/HelloTemplate.java" ) ; "<AssertPlaceHolder>" ; } doCompileRocker ( org . gradle . api . Project , java . io . File , java . io . File , java . io . File ) { com . fizzed . rocker . gradle . RockerConfiguration ext = ( ( com . fizzed . rocker . gradle . RockerConfiguration ) ( project . getExtensions ( ) . findByName ( "rocker" ) ) ) ; com . fizzed . rocker . gradle . RockerTask . runJavaGeneratorMain ( ext , templateDir , outputDir , classDir ) ; }
|
org . junit . Assert . assertTrue ( templateFile . exists ( ) )
|
testAudoBroadcastAddMatrix ( ) { org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 4 , 4 ) . reshape ( 2 , 2 ) ; org . nd4j . linalg . api . ndarray . INDArray row = org . nd4j . linalg . factory . Nd4j . ones ( 2 ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = arr . add ( 1.0 ) ; org . nd4j . linalg . api . ndarray . INDArray test = arr . add ( row ) ; "<AssertPlaceHolder>" ; } add ( java . lang . Number ) { return null ; }
|
org . junit . Assert . assertEquals ( assertion , test )
|
write_max ( ) { com . asakusafw . runtime . value . ByteOption option = new com . asakusafw . runtime . value . ByteOption ( ) ; option . modify ( Byte . MAX_VALUE ) ; com . asakusafw . runtime . value . ByteOption restored = restore ( option ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( canGet ) { return next ; } throw new java . io . IOException ( ) ; }
|
org . junit . Assert . assertThat ( restored . get ( ) , is ( option . get ( ) ) )
|
testPregnantTreatmentTypeSets ( ) { java . lang . String code = "" ; try { code = _setupTestPregnantTreatmentType ( true ) ; _checkPregnantTreatmentTypeIntoDb ( code ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } return ; } _checkPregnantTreatmentTypeIntoDb ( java . lang . String ) { org . isf . pregtreattype . model . PregnantTreatmentType foundPregnantTreatmentType ; foundPregnantTreatmentType = ( ( org . isf . pregtreattype . model . PregnantTreatmentType ) ( org . isf . pregtreattype . test . Tests . jpa . find ( org . isf . pregtreattype . model . PregnantTreatmentType . class , code ) ) ) ; org . isf . pregtreattype . test . Tests . testPregnantTreatmentType . check ( foundPregnantTreatmentType ) ; return ; }
|
org . junit . Assert . assertEquals ( true , false )
|
testRetryBackoff ( ) { org . apache . hadoop . hbase . master . assignment . AssignmentManager am = org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . UTIL . getMiniHBaseCluster ( ) . getMaster ( ) . getAssignmentManager ( ) ; org . apache . hadoop . hbase . procedure2 . ProcedureExecutor < org . apache . hadoop . hbase . master . procedure . MasterProcedureEnv > procExec = org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . UTIL . getMiniHBaseCluster ( ) . getMaster ( ) . getMasterProcedureExecutor ( ) ; org . apache . hadoop . hbase . client . RegionInfo regionInfo = org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . UTIL . getAdmin ( ) . getRegions ( org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . TABLE_NAME ) . get ( 0 ) ; org . apache . hadoop . hbase . master . assignment . RegionStateNode regionNode = am . getRegionStates ( ) . getRegionStateNode ( regionInfo ) ; org . apache . hadoop . hbase . master . assignment . TransitRegionStateProcedure trsp = org . apache . hadoop . hbase . master . assignment . TransitRegionStateProcedure . unassign ( procExec . getEnvironment ( ) , regionInfo ) ; long openSeqNum ; regionNode . lock ( ) ; try { openSeqNum = regionNode . getOpenSeqNum ( ) ; regionNode . setState ( State . OPENING ) ; regionNode . setOpenSeqNum ( ( - 1L ) ) ; regionNode . setProcedure ( trsp ) ; } finally { regionNode . unlock ( ) ; } org . apache . hadoop . hbase . master . procedure . ReopenTableRegionsProcedure proc = new org . apache . hadoop . hbase . master . procedure . ReopenTableRegionsProcedure ( org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . TABLE_NAME ) ; procExec . submitProcedure ( proc ) ; org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . UTIL . waitFor ( 10000 , ( ) -> ( proc . getState ( ) ) == ProcedureState . WAITING_TIMEOUT ) ; long oldTimeout = 0 ; int timeoutIncrements = 0 ; for ( ; ; ) { long timeout = proc . getTimeout ( ) ; if ( timeout > oldTimeout ) { org . apache . hadoop . hbase . master . procedure . TestReopenTableRegionsProcedureBackoff . LOG . info ( "Timeout<sp>incremented,<sp>was<sp>{},<sp>now<sp>is<sp>{},<sp>increments={}" , timeout , oldTimeout , timeoutIncrements ) ; oldTimeout = timeout ; timeoutIncrements ++ ; if ( timeoutIncrements > 3 ) { break ; } } java . lang . Thread . sleep ( 1000 ) ; } regionNode . lock ( ) ; try { regionNode . setState ( State . OPEN ) ; regionNode . setOpenSeqNum ( openSeqNum ) ; regionNode . unsetProcedure ( trsp ) ; } finally { regionNode . unlock ( ) ; } org . apache . hadoop . hbase . master . procedure . ProcedureSyncWait . waitForProcedureToComplete ( procExec , proc , 60000 ) ; "<AssertPlaceHolder>" ; } getOpenSeqNum ( ) { return openSeqNum ; }
|
org . junit . Assert . assertTrue ( ( ( regionNode . getOpenSeqNum ( ) ) > openSeqNum ) )
|
testPriority ( ) { java . lang . String json = "{" + ( "<sp>\"priority\":<sp>5" + "}" ) ; com . urbanairship . api . push . model . notification . ios . IOSDevicePayload payload = com . urbanairship . api . push . parse . notification . ios . PayloadDeserializerTest . mapper . readValue ( json , com . urbanairship . api . push . model . notification . ios . IOSDevicePayload . class ) ; "<AssertPlaceHolder>" ; } getPriority ( ) { return priority ; }
|
org . junit . Assert . assertTrue ( payload . getPriority ( ) . get ( ) . equals ( 5 ) )
|
testResponse200OnGet ( ) { com . liferay . petra . json . web . service . client . internal . JSONWebServiceClientImpl jsonWebServiceClientImpl = new com . liferay . petra . json . web . service . client . internal . JSONWebServiceClientImpl ( ) ; java . util . Map < java . lang . String , java . lang . Object > properties = getBaseProperties ( ) ; properties . put ( "headers" , "headerKey1=headerValue1;Accept=application/json;" ) ; properties . put ( "protocol" , "http" ) ; jsonWebServiceClientImpl . activate ( properties ) ; java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( SimulatorConstants . HTTP_PARAMETER_RESPOND_WITH_STATUS , "200" ) ; params . put ( SimulatorConstants . HTTP_PARAMETER_RETURN_PARMS_IN_JSON , "true" ) ; java . lang . String json = jsonWebServiceClientImpl . doGet ( "/testGet/" , params ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return com . liferay . segments . service . util . ServiceProps . _instance . _configuration . contains ( key ) ; }
|
org . junit . Assert . assertTrue ( json , json . contains ( SimulatorConstants . HTTP_PARAMETER_RESPOND_WITH_STATUS ) )
|
editWithComplaintTypeLocationRequiredFalse ( ) { complaint = new org . egov . pgr . entity . Complaint ( ) ; complaint . setComplaintType ( complaintType ) ; complaint . setDetails ( "Already<sp>Registered<sp>complaint" ) ; when ( complaintService . getComplaintByCRN ( "CRN-123" ) ) . thenReturn ( complaint ) ; when ( securityUtils . currentUserIsEmployee ( ) ) . thenReturn ( true ) ; final org . springframework . test . web . servlet . MvcResult result = mockMvc . perform ( get ( "/complaint/update/CRN-123" ) ) . andExpect ( view ( ) . name ( "complaint-edit" ) ) . andExpect ( model ( ) . attributeExists ( "complaint" ) ) . andReturn ( ) ; final org . egov . pgr . entity . Complaint existing = ( ( org . egov . pgr . entity . Complaint ) ( result . getModelAndView ( ) . getModelMap ( ) . get ( "complaint" ) ) ) ; "<AssertPlaceHolder>" ; } getDetails ( ) { return details ; }
|
org . junit . Assert . assertEquals ( complaint . getDetails ( ) , existing . getDetails ( ) )
|
shouldNotReturnAnyElementOnEmptySupplier ( ) { org . neo4j . kernel . impl . util . collection . ContinuableArrayCursor cursor = new org . neo4j . kernel . impl . util . collection . ContinuableArrayCursor ( ( ) -> null ) ; "<AssertPlaceHolder>" ; } next ( ) { return false ; }
|
org . junit . Assert . assertFalse ( cursor . next ( ) )
|
testGetPlaceholderSentenceWhenTypeIsNotBuiltInType ( ) { final java . lang . String expectedPlaceholder = "Enter<sp>a<sp>valid<sp>expression" ; when ( translationService . format ( "ConstraintPlaceholderHelper.SentenceDefault" ) ) . thenReturn ( expectedPlaceholder ) ; final java . lang . String actualPlaceholder = placeholderHelper . getPlaceholderSentence ( "Structure" ) ; "<AssertPlaceHolder>" ; } getPlaceholderSentence ( java . lang . String ) { final java . lang . String sentence = getTranslation ( type , org . kie . workbench . common . dmn . client . editors . types . listview . constraint . common . ConstraintPlaceholderHelper . CONSTRAINT_PLACEHOLDER_SENTENCE_PREFIX ) ; return ! ( isEmpty ( sentence ) ) ? sentence : defaultSentence ( ) ; }
|
org . junit . Assert . assertEquals ( expectedPlaceholder , actualPlaceholder )
|
testGetStaticLabel ( ) { System . out . println ( "getStaticLabel" ) ; kg . apc . jmeter . reporters . FlexibleFileWriterGui instance = new kg . apc . jmeter . reporters . FlexibleFileWriterGui ( ) ; java . lang . String result = instance . getStaticLabel ( ) ; "<AssertPlaceHolder>" ; } getStaticLabel ( ) { return kg . apc . jmeter . JMeterPluginsUtils . prefixLabel ( "Response<sp>Codes<sp>per<sp>Second" ) ; }
|
org . junit . Assert . assertTrue ( ( ( result . length ( ) ) > 0 ) )
|
testDecodeGeneralizedTimeWithPosTimeZone ( ) { java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . clear ( ) ; cal . set ( Calendar . YEAR , 2010 ) ; cal . set ( Calendar . MONTH , Calendar . JULY ) ; cal . set ( Calendar . DAY_OF_MONTH , 12 ) ; cal . set ( Calendar . HOUR_OF_DAY , 21 ) ; cal . set ( Calendar . MINUTE , 45 ) ; cal . set ( Calendar . SECOND , 27 ) ; cal . setTimeZone ( java . util . TimeZone . getTimeZone ( "GMT+8" ) ) ; java . util . Date expectedDate = cal . getTime ( ) ; byte [ ] data = new byte [ ] { 24 , 19 , 50 , 48 , 49 , 48 , 48 , 55 , 49 , 50 , 50 , 49 , 52 , 53 , 50 , 55 , 43 , 48 , 56 , 48 , 48 } ; java . util . Date actualDate = org . kaazing . gateway . util . asn1 . Asn1Utils . decodeGeneralizedTime ( java . nio . ByteBuffer . wrap ( data ) ) ; "<AssertPlaceHolder>" ; } wrap ( org . kaazing . mina . netty . buffer . ByteBufferWrappingChannelBuffer ) { this . buffer = buffer . buffer ; order = buffer . order ; capacity = buffer . capacity ; setIndex ( buffer . readerIndex ( ) , buffer . writerIndex ( ) ) ; return this ; }
|
org . junit . Assert . assertEquals ( expectedDate , actualDate )
|
testBigIntToIPv6 ( ) { java . lang . String ip = "::feef:aeae" ; java . lang . String expected = new org . openstack . atlas . util . ip . IPv6 ( ip ) . expand ( ) ; java . math . BigInteger in = new java . math . BigInteger ( "4277120686" ) ; java . lang . String actual = new org . openstack . atlas . util . ip . IPv6 ( in ) . getString ( ) ; "<AssertPlaceHolder>" ; } getString ( ) { return ip ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
shouldGetAsArray ( ) { uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . Object > set = new uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . Object > ( ) ; java . lang . Object [ ] expectedObjects = new java . lang . Object [ ] { 'E' , 9 , null , - 1L , "W" } ; set . addAll ( java . util . Arrays . < java . lang . Object > asList ( expectedObjects ) ) ; java . lang . Object [ ] array = set . toArray ( ) ; "<AssertPlaceHolder>" ; } toArray ( ) { return collection . toArray ( ) ; }
|
org . junit . Assert . assertArrayEquals ( expectedObjects , array )
|
shouldNotDeleteAll ( ) { final com . couchbase . client . java . bucket . BucketManager bucketManager = bucket . bucketManager ( ) ; final com . couchbase . client . java . view . View view = com . couchbase . client . java . view . DefaultView . create ( "all" , org . apache . commons . io . IOUtils . toString ( getClass ( ) . getResourceAsStream ( "/all.js" ) ) ) ; final com . couchbase . client . java . view . DesignDocument document = com . couchbase . client . java . view . DesignDocument . create ( "person" , com . google . common . collect . ImmutableList . of ( view ) ) ; try { bucketManager . upsertDesignDocument ( document ) ; repository . deleteAll ( ) ; final java . lang . Iterable < com . github . jloisel . reactive . repository . couchbase . it . Person > found = repository . findAll ( ) ; "<AssertPlaceHolder>" ; } finally { bucketManager . removeDesignDocument ( document . name ( ) ) ; } } findAll ( ) { return blocking ( async . findAll ( ) . toList ( ) ) . single ( ) ; }
|
org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableList . of ( ) , found )
|
testCreateWithNoMap ( ) { java . util . Optional < com . gh . mygreen . xlsmapper . fieldaccessor . ArrayLabelSetter > labelSetter = setterFactory . create ( com . gh . mygreen . xlsmapper . fieldaccessor . ArrayLabelSetterFactoryTest . ByMapField . NoMapRecord . class , "test" ) ; "<AssertPlaceHolder>" . isEmpty ( ) ; } create ( java . lang . String , java . lang . String ) { com . gh . mygreen . xlsmapper . xml . bind . AnnotationInfo . AttributeInfo attr = new com . gh . mygreen . xlsmapper . xml . bind . AnnotationInfo . AttributeInfo ( ) ; attr . name = name ; attr . value = value ; return attr ; }
|
org . junit . Assert . assertThat ( labelSetter )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.