input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
mockArray ( ) { com . restfb . json . JsonArray jsonArray = org . mockito . Mockito . mock ( com . restfb . json . JsonArray . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( jsonArray ) |
testAddQuestion ( ) { org . mifos . platform . questionnaire . ui . model . QuestionGroupForm questionGroupForm = getQuestionGroupForm ( org . mifos . platform . questionnaire . ui . controller . QuestionGroupControllerTest . TITLE , "Create.Client" , "Default" ) ; questionGroupForm . getCurrentQuestion ( ) . setText ( "Question1" ) ; questionGroupForm . getCurrentQuestion ( ) . setType ( "freeText" ) ; when ( requestContext . getMessageContext ( ) ) . thenReturn ( messageContext ) ; java . lang . String result = questionGroupController . addQuestion ( questionGroupForm , requestContext ) ; "<AssertPlaceHolder>" ; verify ( requestContext , times ( 1 ) ) . getMessageContext ( ) ; } addQuestion ( org . mifos . platform . questionnaire . ui . model . QuestionGroupForm , org . springframework . webflow . execution . RequestContext ) { org . springframework . binding . message . MessageContext context = requestContext . getMessageContext ( ) ; boolean result = validateQuestion ( questionGroupForm , context ) ; if ( result ) { questionGroupForm . addCurrentSection ( ) ; } return result ? "success" : "failure" ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( "success" ) ) |
stopSession_multipleStops_stopTimeNotChanged ( ) { target . startSession ( ) ; com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . Session originalSession = target . getSession ( ) ; target . stopSession ( ) ; long originalStopTime = originalSession . getStopTime ( ) ; java . lang . Thread . sleep ( 500 ) ; target . stopSession ( ) ; "<AssertPlaceHolder>" ; } getStopTime ( ) { return this . stopTime ; } | org . junit . Assert . assertTrue ( ( originalStopTime == ( originalSession . getStopTime ( ) ) ) ) |
testVersion ( ) { org . openscience . cdk . fingerprint . CircularFingerprinter fpr = new org . openscience . cdk . fingerprint . CircularFingerprinter ( CircularFingerprinter . CLASS_ECFP4 ) ; java . lang . String expected = ( "CDK-CircularFingerprinter/" + ( org . openscience . cdk . CDK . getVersion ( ) ) ) + "<sp>classType=ECFP4<sp>perceiveStereochemistry=false" ; "<AssertPlaceHolder>" ; } getVersionDescription ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "CDK-" ) . append ( getClass ( ) . getSimpleName ( ) ) . append ( "/" ) . append ( org . openscience . cdk . CDK . getVersion ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > param : getParameters ( ) ) { sb . append ( '<sp>' ) . append ( param . getKey ( ) ) . append ( '=' ) . append ( param . getValue ( ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertThat ( fpr . getVersionDescription ( ) , org . hamcrest . CoreMatchers . is ( expected ) ) |
testJwsJwkPlainTextHMacUnencoded ( ) { java . lang . String address = ( "https://localhost:" + ( org . apache . cxf . systest . jaxrs . security . jose . jwejws . JAXRSJweJwsTest . PORT ) ) + "/jwsjwkhmac" ; org . apache . cxf . systest . jaxrs . security . jose . BookStore bs = createJwsBookStore ( address , null , false , false ) ; java . lang . String text = bs . echoText ( "book" ) ; "<AssertPlaceHolder>" ; } echoText ( java . lang . String ) { return text ; } | org . junit . Assert . assertEquals ( "book" , text ) |
createResponseMapper ( ) { org . apache . servicecomb . swagger . invocation . response . consumer . ConsumerResponseMapper mapper = factory . createResponseMapper ( null , null , org . apache . servicecomb . swagger . invocation . Response . class ) ; org . apache . servicecomb . swagger . invocation . Response response = org . apache . servicecomb . swagger . invocation . Response . ok ( null ) ; "<AssertPlaceHolder>" ; } mapResponse ( org . apache . servicecomb . swagger . invocation . Response ) { javax . ws . rs . core . Response . ResponseBuilder responseBuilder = javax . ws . rs . core . Response . status ( response . getStatus ( ) ) . entity ( response . getResult ( ) ) ; java . util . Map < java . lang . String , java . util . List < java . lang . Object > > headers = response . getHeaders ( ) . getHeaderMap ( ) ; if ( headers != null ) { for ( java . util . Map . Entry < java . lang . String , java . util . List < java . lang . Object > > entry : headers . entrySet ( ) ) { responseBuilder . header ( entry . getKey ( ) , entry . getValue ( ) ) ; } } return responseBuilder . build ( ) ; } | org . junit . Assert . assertSame ( response , mapper . mapResponse ( response ) ) |
executeWithBeans2 ( ) { mojo . setTargetFolder ( "target/export9" ) ; mojo . setExportBeans ( true ) ; mojo . setBeanSerializerClass ( com . querydsl . sql . codegen . ExtendedBeanSerializer . class . getName ( ) ) ; mojo . execute ( ) ; "<AssertPlaceHolder>" ; } exists ( ) { org . junit . Assert . assertTrue ( ( ( query . where ( title . eq ( "Jurassic<sp>Park" ) ) . fetchCount ( ) ) > 0 ) ) ; org . junit . Assert . assertFalse ( ( ( query . where ( title . eq ( "Jurassic<sp>Park<sp>X" ) ) . fetchCount ( ) ) > 0 ) ) ; } | org . junit . Assert . assertTrue ( new java . io . File ( "target/export9" ) . exists ( ) ) |
onFailure ( ) { io . trane . future . Promise < java . lang . Integer > p = io . trane . future . Promise . apply ( ) ; java . util . concurrent . atomic . AtomicReference < java . lang . Throwable > result = new java . util . concurrent . atomic . AtomicReference ( ) ; io . trane . future . Future < java . lang . Integer > f = p . onFailure ( result :: set ) ; p . setException ( ex ) ; "<AssertPlaceHolder>" ; get ( f ) ; } get ( ) { final java . util . Optional < ? > [ ] ctx = io . trane . future . Local . threadLocal . get ( ) ; if ( ( ctx == null ) || ( ( ctx . length ) <= ( position ) ) ) return java . util . Optional . empty ( ) ; final java . util . Optional < ? > v = ctx [ position ] ; if ( v == null ) return java . util . Optional . empty ( ) ; else return ( ( java . util . Optional < T > ) ( v ) ) ; } | org . junit . Assert . assertEquals ( ex , result . get ( ) ) |
clientSessionDisabled ( ) { org . apache . jackrabbit . oak . plugins . document . mongo . MongoDocumentNodeStoreBuilder builder = new org . apache . jackrabbit . oak . plugins . document . mongo . MongoDocumentNodeStoreBuilder ( ) ; "<AssertPlaceHolder>" ; } isClientSessionDisabled ( ) { return clientSessionDisabled ; } | org . junit . Assert . assertFalse ( builder . isClientSessionDisabled ( ) ) |
testEquals ( ) { org . openrdf . model . URI uri1 = new org . apache . marmotta . ostrich . model . ProtoURI ( "http://apache.org/example" ) ; org . openrdf . model . URI uri2 = new org . apache . marmotta . ostrich . model . ProtoURI ( "http://apache.org/example" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( uri1 , uri2 ) |
calculateMappers_1Node2Reducer_0Mapper ( ) { int mappers = yarnContainerAllocator . getMaxMappers ( 1 , 2 , org . apache . hadoop . dynamodb . util . RoundRobinYarnContainerAllocatorTest . NODE_SLOTS , org . apache . hadoop . dynamodb . util . RoundRobinYarnContainerAllocatorTest . APP_MASTER_SLOTS , org . apache . hadoop . dynamodb . util . RoundRobinYarnContainerAllocatorTest . MAP_SLOTS , org . apache . hadoop . dynamodb . util . RoundRobinYarnContainerAllocatorTest . REDUCE_SLOTS ) ; "<AssertPlaceHolder>" ; } getMaxMappers ( int , int , int , int , int , int ) { int [ ] clusterNodeSlots = new int [ nodes ] ; for ( int k = 0 ; k < nodes ; k ++ ) { clusterNodeSlots [ k ] = nodeSlots ; } clusterNodeSlots [ 0 ] -= appMasterSlots ; int reducerIndex = 0 ; int nodeIndex = 1 ; for ( ; reducerIndex < reducers ; reducerIndex ++ ) { if ( nodeIndex >= nodes ) { nodeIndex = 0 ; } if ( ( clusterNodeSlots [ nodeIndex ] ) >= reduceSlots ) { clusterNodeSlots [ nodeIndex ] -= reduceSlots ; } else { break ; } nodeIndex ++ ; } if ( reducerIndex < reducers ) { org . apache . hadoop . dynamodb . util . RoundRobinYarnContainerAllocator . log . warn ( "All<sp>slots<sp>are<sp>used<sp>for<sp>the<sp>app<sp>master<sp>and<sp>reducers.<sp>No<sp>slots<sp>for<sp>mappers." ) ; return 0 ; } int mappers = 0 ; for ( nodeIndex = 0 ; nodeIndex < nodes ; nodeIndex ++ ) { mappers += ( clusterNodeSlots [ nodeIndex ] ) / mapSlots ; } return mappers ; } | org . junit . Assert . assertEquals ( 0 , mappers ) |
testEditConfValue_1 ( ) { java . lang . String propertyName = "name2" ; java . lang . String newPropertyValue = "value6" ; boolean result = xmlManipulator . editConfValue ( filePath , propertyName , newPropertyValue ) ; "<AssertPlaceHolder>" ; } editConfValue ( java . lang . String , java . lang . String , java . lang . String ) { try { java . io . File confFile = new java . io . File ( file ) ; if ( ! ( confFile . exists ( ) ) ) { System . err . println ( ( ( "File<sp>" + file ) + "<sp>does<sp>not<sp>exists." ) ) ; return false ; } javax . xml . bind . JAXBContext jaxbContext = javax . xml . bind . JAXBContext . newInstance ( "com.impetus.ankush.agent.action.impl" ) ; javax . xml . bind . Unmarshaller unmarshaller = jaxbContext . createUnmarshaller ( ) ; com . impetus . ankush . agent . action . impl . Configuration configuration = ( ( com . impetus . ankush . agent . action . impl . Configuration ) ( unmarshaller . unmarshal ( confFile ) ) ) ; boolean status = false ; java . util . List < com . impetus . ankush . agent . action . impl . Property > propertyList = configuration . getProperty ( ) ; for ( java . util . Iterator < com . impetus . ankush . agent . action . impl . Property > iterator = propertyList . iterator ( ) ; iterator . hasNext ( ) ; ) { com . impetus . ankush . agent . action . impl . Property property = iterator . next ( ) ; if ( property . getName ( ) . equals ( propertyName ) ) { status = configuration . getProperty ( ) . remove ( property ) ; break ; } } if ( status ) { return com . impetus . ankush . agent . action . impl . XMLManipulator . marshallObject ( propertyName , newPropertyValue , jaxbContext , confFile , configuration ) ; } else { return false ; } } catch ( javax . xml . bind . JAXBException e ) { e . printStackTrace ( ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } return false ; } | org . junit . Assert . assertEquals ( true , result ) |
noFiles ( ) { java . io . File in = tmp . newFolder ( "in" ) ; java . io . File out = new java . io . File ( tmp . getRoot ( ) , "out" ) ; org . apache . hadoop . util . ToolRunner . run ( job , new com . m6d . filecrush . crush . Crush ( ) , new java . lang . String [ ] { in . getAbsolutePath ( ) , out . getAbsolutePath ( ) } ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( out . exists ( ) , org . hamcrest . Matchers . is ( false ) ) |
testHttpWithNoScheme ( ) { org . eclipse . microprofile . openapi . models . security . SecurityScheme . Type type = org . eclipse . microprofile . openapi . models . security . SecurityScheme . Type . HTTP ; com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl noScheme = new com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl ( ) ; noScheme . setType ( type ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; com . ibm . ws . microprofile . openapi . impl . validation . SecuritySchemeValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . SecuritySchemeValidator . getInstance ( ) ; validator . validate ( vh , context , key , noScheme ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , vh . getEventsSize ( ) ) |
nullValueIsOK ( ) { previousAgreement . setNext ( otherAgreement ) ; "<AssertPlaceHolder>" ; } validateChangePrevious ( org . estatio . module . agreement . dom . Agreement ) { if ( previousAgreement == null ) { return null ; } if ( ( previousAgreement . getNext ( ) ) != null ) { return "Not<sp>allowed:<sp>the<sp>agreement<sp>chosen<sp>already<sp>is<sp>already<sp>linked<sp>to<sp>a<sp>next." ; } if ( this . getEffectiveInterval ( ) . overlaps ( previousAgreement . getEffectiveInterval ( ) ) ) { return "Not<sp>allowed:<sp>overlapping<sp>date<sp>intervals" ; } final org . joda . time . LocalDate previousEffectiveEndDate = previousAgreement . getEffectiveInterval ( ) . endDate ( ) ; if ( ( previousEffectiveEndDate == null ) || ( this . getEffectiveInterval ( ) . startDate ( ) . isBefore ( previousEffectiveEndDate ) ) ) { return "Not<sp>allowed:<sp>previous<sp>agreement<sp>interval<sp>should<sp>be<sp>before<sp>this<sp>agreements<sp>interval" ; } org . estatio . module . lease . dom . Lease previousLease = ( ( org . estatio . module . lease . dom . Lease ) ( previousAgreement ) ) ; if ( ! ( this . getApplicationTenancyPath ( ) . equals ( previousLease . getApplicationTenancyPath ( ) ) ) ) { return "Not<sp>allowed:<sp>application<sp>tenancy<sp>should<sp>be<sp>equal" ; } return null ; } | org . junit . Assert . assertNull ( agreement . validateChangePrevious ( null ) ) |
testObjectPropertyDomainAxiomLearning ( ) { org . dllearner . test . junit . ObjectPropertyDomainAxiomLearner l = new org . dllearner . test . junit . ObjectPropertyDomainAxiomLearner ( org . dllearner . test . junit . PropertyAxiomLearningTest . ks ) ; l . setMaxExecutionTimeInSeconds ( maxExecutionTimeInSeconds ) ; l . setUsePrecisionOnly ( false ) ; l . setEntityToDescribe ( op1 ) ; l . init ( ) ; l . start ( ) ; org . dllearner . core . EvaluatedAxiom < org . dllearner . test . junit . OWLObjectPropertyDomainAxiom > evAxiom = l . getCurrentlyBestEvaluatedAxiom ( ) ; System . out . println ( evAxiom ) ; double actualScore = evAxiom . getScore ( ) . getAccuracy ( ) ; int cntA = 100 ; int cntB = 70 ; int cntAB = 70 ; double beta = 3.0 ; double precision = org . dllearner . learningproblems . Heuristics . getConfidenceInterval95WaldAverage ( cntB , cntAB ) ; double recall = org . dllearner . learningproblems . Heuristics . getConfidenceInterval95WaldAverage ( cntA , cntAB ) ; double expectedScore = org . dllearner . learningproblems . Heuristics . getFScore ( recall , precision , beta ) ; "<AssertPlaceHolder>" ; } getFScore ( double , double , double ) { return ( precision + recall ) == 0 ? 0 : ( ( 1 + ( beta * beta ) ) * ( precision * recall ) ) / ( ( ( beta * beta ) * precision ) + recall ) ; } | org . junit . Assert . assertEquals ( "" , expectedScore , actualScore , 0.0 ) |
testGetSuccessors ( ) { java . util . List < org . s1ck . gdl . model . Edge > successors = com . google . common . collect . Lists . newArrayList ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . QUERY_HANDLER . getSuccessors ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getEdgeCache ( ) . get ( "e1" ) . getId ( ) ) ) ; java . util . List < org . s1ck . gdl . model . Edge > expected = com . google . common . collect . Lists . newArrayList ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getEdgeCache ( ) . get ( "e2" ) , org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getEdgeCache ( ) . get ( "e3" ) ) ; "<AssertPlaceHolder>" ; } elementsEqual ( java . util . List , java . util . List ) { boolean equal = ( list . size ( ) ) == ( expected . size ( ) ) ; if ( equal ) { list . sort ( java . util . Comparator . comparingLong ( Element :: getId ) ) ; expected . sort ( java . util . Comparator . comparingLong ( Element :: getId ) ) ; for ( int i = 0 ; i < ( list . size ( ) ) ; i ++ ) { if ( ! ( list . get ( i ) . equals ( expected . get ( i ) ) ) ) { equal = false ; break ; } } } return equal ; } | org . junit . Assert . assertTrue ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . elementsEqual ( successors , expected ) ) |
toRst ( ) { "<AssertPlaceHolder>" ; } conf ( ) { return new org . apache . kafka . common . config . ConfigDef ( ) . define ( com . github . mmolimar . kafka . connect . fs . FsSourceConnectorConfig . FS_URIS , Type . LIST , Importance . HIGH , com . github . mmolimar . kafka . connect . fs . FsSourceConnectorConfig . FS_URIS_DOC ) . define ( com . github . mmolimar . kafka . connect . fs . FsSourceConnectorConfig . TOPIC , Type . STRING , Importance . HIGH , com . github . mmolimar . kafka . connect . fs . FsSourceConnectorConfig . TOPIC_DOC ) ; } | org . junit . Assert . assertNotNull ( com . github . mmolimar . kafka . connect . fs . FsSourceConnectorConfig . conf ( ) . toRst ( ) ) |
testElementRule ( ) { org . openscience . cdk . formula . rules . IRule rule = new org . openscience . cdk . formula . rules . ElementRule ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( rule ) |
testGetUserId5 ( ) { com . liferay . portal . kernel . model . PortletInstance portletInstance = com . liferay . portal . kernel . model . PortletInstance . fromPortletInstanceKey ( getPortletInstanceKey ( ) ) ; "<AssertPlaceHolder>" ; } getUserId ( ) { return _userId ; } | org . junit . Assert . assertEquals ( 0 , portletInstance . getUserId ( ) ) |
testGetAvailableFunFromValue ( ) { org . talend . designer . rowgenerator . ui . editor . MetadataColumnExt baseConn = mock ( org . talend . designer . rowgenerator . ui . editor . MetadataColumnExt . class ) ; when ( baseConn . getTalendType ( ) ) . thenReturn ( "id_String" ) ; org . talend . designer . rowgenerator . data . AbstractFunctionParser parser = null ; parser = new org . talend . designer . rowgenerator . data . RoutineFunctionParser ( ) ; parser . parse ( ) ; java . util . List < org . talend . designer . rowgenerator . data . TalendType > talendTypes = parser . getList ( ) ; java . util . List < org . talend . designer . rowgenerator . data . Function > funtions = new java . util . ArrayList < org . talend . designer . rowgenerator . data . Function > ( ) ; for ( org . talend . designer . rowgenerator . data . TalendType talendType : talendTypes ) { if ( talendType . getName ( ) . equals ( baseConn . getTalendType ( ) ) ) { funtions . addAll ( talendType . getFunctions ( ) ) ; } } funtions . add ( createCustomizeFunction ( ) ) ; java . lang . reflect . Method method = org . talend . designer . rowgenerator . data . FunctionManagerExt . class . getDeclaredMethod ( "getAvailableFunFromValue" , new java . lang . Class [ ] { org . talend . designer . rowgenerator . ui . editor . MetadataColumnExt . class , java . lang . String . class , java . util . List . class } ) ; method . setAccessible ( true ) ; org . talend . designer . rowgenerator . data . Function funtion = ( ( org . talend . designer . rowgenerator . data . Function ) ( method . invoke ( new org . talend . designer . rowgenerator . data . FunctionManagerExt ( ) , baseConn , value , funtions ) ) ) ; org . talend . designer . rowgenerator . data . Parameter parameter = null ; for ( java . lang . Object stringParameter : funtion . getParameters ( ) ) { parameter = ( ( org . talend . designer . rowgenerator . data . Parameter ) ( stringParameter ) ) ; } "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( value , parameter . getValue ( ) ) |
testSection4211SourceEntry ( ) { org . apache . abdera . i18n . iri . IRI uri = org . apache . abdera . test . parser . stax . FeedValidatorTest . baseURI . resolve ( "4.2.11/source-entry.xml" ) ; org . apache . abdera . model . Document < org . apache . abdera . model . Feed > doc = parse ( uri ) ; org . apache . abdera . model . Entry entry = doc . getRoot ( ) . getEntries ( ) . get ( 0 ) ; org . apache . abdera . model . Source source = entry . getSource ( ) ; "<AssertPlaceHolder>" ; } getSource ( ) { java . lang . String source = getAttributeValue ( "source" ) ; return source != null ? new org . apache . abdera . i18n . iri . IRI ( source ) : null ; } | org . junit . Assert . assertNotNull ( source ) |
shouldSumSizeWhenCalledMultipleTimes ( ) { final long maxSize = 10 ; final org . neo4j . kernel . impl . transaction . log . pruning . FileSizeThreshold threshold = new org . neo4j . kernel . impl . transaction . log . pruning . FileSizeThreshold ( fs , maxSize ) ; when ( fs . getFileSize ( file ) ) . thenReturn ( 5L ) ; threshold . init ( ) ; threshold . reached ( file , version , source ) ; final boolean result = threshold . reached ( file , version , source ) ; "<AssertPlaceHolder>" ; } reached ( java . io . File , long , org . neo4j . kernel . impl . transaction . log . LogFileInformation ) { try { long lastTx = source . getFirstEntryId ( ( version + 1 ) ) ; if ( lastTx == ( - 1 ) ) { throw new java . lang . IllegalStateException ( ( "The<sp>next<sp>version<sp>should<sp>always<sp>exist,<sp>since<sp>this<sp>is<sp>called<sp>after<sp>rotation<sp>and<sp>the<sp>" + "PruneStrategy<sp>never<sp>checks<sp>the<sp>current<sp>active<sp>log<sp>file" ) ) ; } long highest = source . getLastEntryId ( ) ; return ( highest - lastTx ) >= ( maxTransactionCount ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertTrue ( result ) |
testContainersAreMergedRecursively ( ) { java . util . Map < java . lang . String , java . lang . Object > defaultContainer = org . apache . shindig . config . BasicContainerConfigTest . makeContainer ( "default" , "base" , "bar" 1 , "user" , "bar" 4 , "map" , com . google . common . collect . ImmutableMap . of ( "latitude" , 42 , "bar" 2 , ( - 8 ) ) , "data" , com . google . common . collect . ImmutableList . of ( "bar" 0 , "bar" ) ) ; java . util . Map < java . lang . String , java . lang . Object > newContainer = org . apache . shindig . config . BasicContainerConfigTest . makeContainer ( "bar" 3 , "user" , "anne" , "colour" , "green" , "map" , com . google . common . collect . ImmutableMap . of ( "bar" 2 , 130 ) , "data" , null ) ; java . util . Map < java . lang . String , java . lang . Object > expectedContainer = org . apache . shindig . config . BasicContainerConfigTest . makeContainer ( "bar" 3 , "base" , "bar" 1 , "user" , "anne" , "colour" , "green" , "map" , com . google . common . collect . ImmutableMap . of ( "latitude" , 42 , "bar" 2 , 130 ) , "data" , null ) ; config . newTransaction ( ) . addContainer ( defaultContainer ) . addContainer ( newContainer ) . commit ( ) ; "<AssertPlaceHolder>" ; } getProperties ( java . lang . String ) { return config . get ( container ) ; } | org . junit . Assert . assertEquals ( expectedContainer , config . getProperties ( "bar" 3 ) ) |
testIsReadOnly ( ) { connection = new org . xenei . jdbc4sparql . J4SConnection ( driver , url , properties ) ; "<AssertPlaceHolder>" ; } isReadOnly ( ) { return true ; } | org . junit . Assert . assertTrue ( connection . isReadOnly ( ) ) |
setGet ( ) { int sequenceInitial = 11 ; int position = 262788 ; rollCycleEncodeSequence . setSequence ( sequenceInitial , position ) ; long sequence = rollCycleEncodeSequence . getSequence ( position ) ; "<AssertPlaceHolder>" ; } getSequence ( long ) { if ( ( writePositionAndSequence ) == null ) return net . openhft . chronicle . wire . Sequence . NOT_FOUND ; final long sequenceValue = this . writePositionAndSequence . getVolatileValue2 ( ) ; if ( sequenceValue == 0 ) return net . openhft . chronicle . wire . Sequence . NOT_FOUND ; long writePositionAsCycle = toLongValue ( forWritePosition , 0 ) ; long lowerBitsOfWp = toLowerBitsWritePosition ( writePositionAsCycle ) ; final long toLowerBitsWritePosition = toLowerBitsWritePosition ( sequenceValue ) ; if ( lowerBitsOfWp == toLowerBitsWritePosition ) return toSequenceNumber ( sequenceValue ) ; return net . openhft . chronicle . wire . Sequence . NOT_FOUND_RETRY ; } | org . junit . Assert . assertEquals ( sequenceInitial , sequence ) |
isNotStreaming ( ) { org . apache . http . client . entity . ByteBufHttpEntity entity = new org . apache . http . client . entity . ByteBufHttpEntity ( createDefaultTestByteBuf ( ) , 0 , null ) ; boolean result = entity . isStreaming ( ) ; "<AssertPlaceHolder>" ; } isStreaming ( ) { return false ; } | org . junit . Assert . assertFalse ( result ) |
shouldCreateTheActivityThatNewActivityCalled ( ) { java . lang . Class < ? > clazz = com . uphyca . testing . robolectric . TestSpyActivity . class ; android . content . Context context = mUnderTest . getTargetContext ( ) ; android . os . IBinder token = null ; android . app . Application application = null ; android . content . Intent intent = null ; android . content . pm . ActivityInfo info = null ; java . lang . CharSequence title = null ; android . app . Activity parent = null ; java . lang . String id = null ; java . lang . Object lastNonConfigurationInstance = null ; android . app . Activity newActivity = mUnderTest . newActivity ( clazz , context , token , application , intent , info , title , parent , id , lastNonConfigurationInstance ) ; "<AssertPlaceHolder>" ; } newActivity ( java . lang . Class , android . content . Context , android . os . IBinder , android . app . Application , android . content . Intent , android . content . pm . ActivityInfo , java . lang . CharSequence , android . app . Activity , java . lang . String , java . lang . Object ) { return null ; } | org . junit . Assert . assertNotNull ( newActivity ) |
testPartialOverlap2 ( ) { ru . r2cloud . DefaultScheduleEntry entry = ru . r2cloud . satellite . ScheduleTest . create ( ) ; entry . setStartTimeMillis ( 1 ) ; entry . setEndTimeMillis ( 3 ) ; schedule . add ( entry ) ; "<AssertPlaceHolder>" ; } getOverlap ( long , long ) { if ( end < start ) { throw new java . lang . IllegalArgumentException ( ( ( ( "end<sp>is<sp>less<sp>than<sp>start:<sp>" + end ) + "<sp>start:<sp>" ) + start ) ) ; } for ( T cur : scheduledObservations . values ( ) ) { if ( ( ( cur . getStartTimeMillis ( ) ) < start ) && ( start < ( cur . getEndTimeMillis ( ) ) ) ) { return cur ; } if ( ( ( cur . getStartTimeMillis ( ) ) < end ) && ( end < ( cur . getEndTimeMillis ( ) ) ) ) { return cur ; } } return null ; } | org . junit . Assert . assertNotNull ( schedule . getOverlap ( 0 , 2 ) ) |
testFloat ( ) { java . lang . Class < com . j256 . ormlite . field . types . FloatTypeTest . LocalFloat > clazz = com . j256 . ormlite . field . types . FloatTypeTest . LocalFloat . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . FloatTypeTest . LocalFloat , java . lang . Object > dao = createDao ( clazz , true ) ; float val = 1331.221F ; java . lang . String valStr = java . lang . Float . toString ( val ) ; com . j256 . ormlite . field . types . FloatTypeTest . LocalFloat foo = new com . j256 . ormlite . field . types . FloatTypeTest . LocalFloat ( ) ; foo . floatField = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , val , val , valStr , DataType . FLOAT , com . j256 . ormlite . field . types . FloatTypeTest . FLOAT_COLUMN , false , true , false , true , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } } | org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) ) |
testGetExistingClass_existing ( ) { java . lang . Class < ? > actual = org . objenesis . instantiator . util . ClassUtils . getExistingClass ( getClass ( ) . getClassLoader ( ) , getClass ( ) . getName ( ) ) ; "<AssertPlaceHolder>" ; } getExistingClass ( java . lang . ClassLoader , java . lang . String ) { try { return ( ( java . lang . Class < T > ) ( java . lang . Class . forName ( className , true , classLoader ) ) ) ; } catch ( java . lang . ClassNotFoundException e ) { return null ; } } | org . junit . Assert . assertSame ( actual , getClass ( ) ) |
testResetUsingPlanWhenBeforeBeginningOffset ( ) { final java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > endOffsets = new java . util . HashMap ( ) ; endOffsets . put ( topicPartition , 4L ) ; consumer . updateEndOffsets ( endOffsets ) ; final java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > beginningOffsets = new java . util . HashMap ( ) ; beginningOffsets . put ( topicPartition , 3L ) ; consumer . updateBeginningOffsets ( beginningOffsets ) ; final java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > topicPartitionsAndOffset = new java . util . HashMap ( ) ; topicPartitionsAndOffset . put ( topicPartition , 1L ) ; streamsResetter . resetOffsetsFromResetPlan ( consumer , inputTopicPartitions , topicPartitionsAndOffset ) ; final org . apache . kafka . clients . consumer . ConsumerRecords < byte [ ] , byte [ ] > records = consumer . poll ( java . time . Duration . ofMillis ( 500 ) ) ; "<AssertPlaceHolder>" ; } count ( ) { return count ( org . apache . kafka . streams . kstream . Materialized . with ( keySerde , org . apache . kafka . common . serialization . Serdes . Long ( ) ) ) ; } | org . junit . Assert . assertEquals ( 2 , records . count ( ) ) |
testGetBytesUtf8 ( ) { final java . lang . String charsetName = "UTF-8" ; testGetBytesUnchecked ( charsetName ) ; final byte [ ] expected = org . apache . commons . codec . binary . StringUtilsTest . STRING_FIXTURE . getBytes ( charsetName ) ; final byte [ ] actual = org . apache . commons . codec . binary . StringUtils . getBytesUtf8 ( org . apache . commons . codec . binary . StringUtilsTest . STRING_FIXTURE ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . CharSequence , java . lang . CharSequence ) { if ( cs1 == cs2 ) { return true ; } if ( ( cs1 == null ) || ( cs2 == null ) ) { return false ; } if ( ( cs1 instanceof java . lang . String ) && ( cs2 instanceof java . lang . String ) ) { return cs1 . equals ( cs2 ) ; } return ( ( cs1 . length ( ) ) == ( cs2 . length ( ) ) ) && ( org . apache . commons . codec . binary . CharSequenceUtils . regionMatches ( cs1 , false , 0 , cs2 , 0 , cs1 . length ( ) ) ) ; } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expected , actual ) ) |
testGetAllowedAMAttributes ( ) { java . util . Collection < com . liferay . adaptive . media . AMAttribute < ? , ? > > amAttributes = java . util . Arrays . asList ( com . liferay . adaptive . media . AMAttribute . getConfigurationUuidAMAttribute ( ) , com . liferay . adaptive . media . AMAttribute . getContentLengthAMAttribute ( ) , com . liferay . adaptive . media . AMAttribute . getContentTypeAMAttribute ( ) , com . liferay . adaptive . media . AMAttribute . getFileNameAMAttribute ( ) ) ; java . util . Map < java . lang . String , com . liferay . adaptive . media . AMAttribute < ? , ? > > allowedAMAttributesMap = com . liferay . adaptive . media . AMAttribute . getAllowedAMAttributes ( ) ; java . util . Collection < com . liferay . adaptive . media . AMAttribute < ? , ? > > allowedAMAttributes = allowedAMAttributesMap . values ( ) ; "<AssertPlaceHolder>" ; } containsAll ( java . util . Collection ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertTrue ( allowedAMAttributes . containsAll ( amAttributes ) ) |
testLazyLookup ( ) { jndiTestUtils . namingContext ( ) . bind ( "jdbc/DS" , org . mockito . Mockito . mock ( javax . sql . DataSource . class ) ) ; javax . sql . DataSource dataSource = com . vladmihalcea . flexypool . util . LazyJndiResolver . newInstance ( "jdbc/DS" , javax . sql . DataSource . class ) ; try { java . io . PrintWriter printWriter = new java . io . PrintWriter ( System . out ) ; when ( dataSource . getLogWriter ( ) ) . thenReturn ( printWriter ) ; "<AssertPlaceHolder>" ; } catch ( java . sql . SQLException e ) { org . junit . Assert . fail ( "There<sp>should<sp>be<sp>no<sp>exception<sp>thrown!" ) ; } } getLogWriter ( ) { return targetDataSource . getLogWriter ( ) ; } | org . junit . Assert . assertSame ( printWriter , dataSource . getLogWriter ( ) ) |
testSerialization ( ) { com . google . cloud . bigtable . hbase . filter . TimestampRangeFilter original = new com . google . cloud . bigtable . hbase . filter . TimestampRangeFilter ( 10L , 20L ) ; org . apache . hadoop . hbase . protobuf . generated . FilterProtos . Filter proto = org . apache . hadoop . hbase . protobuf . ProtobufUtil . toFilter ( original ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( original , org . apache . hadoop . hbase . protobuf . ProtobufUtil . toFilter ( proto ) ) |
testRequestsWithLowerProtocolVersionsGetUpgradedTo1_1 ( ) { request = new org . apache . hc . core5 . http . message . BasicClassicHttpRequest ( "GET" , "/foo" ) ; request . setVersion ( new org . apache . hc . core5 . http . ProtocolVersion ( "HTTP" , 1 , 0 ) ) ; final org . apache . hc . core5 . http . ClassicHttpRequest upgraded = new org . apache . hc . core5 . http . message . BasicClassicHttpRequest ( "GET" , "/foo" ) ; upgraded . setVersion ( HttpVersion . HTTP_1_1 ) ; org . easymock . EasyMock . expect ( mockExecChain . proceed ( eqRequest ( upgraded ) , org . easymock . EasyMock . isA ( ExecChain . Scope . class ) ) ) . andReturn ( originResponse ) ; replayMocks ( ) ; final org . apache . hc . core5 . http . ClassicHttpResponse result = execute ( request ) ; verifyMocks ( ) ; "<AssertPlaceHolder>" ; } semanticallyTransparent ( org . apache . hc . core5 . http . ClassicHttpResponse , org . apache . hc . core5 . http . ClassicHttpResponse ) { final boolean entitiesEquivalent = org . apache . hc . client5 . http . impl . cache . HttpTestUtils . equivalent ( r1 . getEntity ( ) , r2 . getEntity ( ) ) ; if ( ! entitiesEquivalent ) { return false ; } final boolean statusLinesEquivalent = ( org . apache . hc . core5 . util . LangUtils . equals ( r1 . getReasonPhrase ( ) , r2 . getReasonPhrase ( ) ) ) && ( ( r1 . getCode ( ) ) == ( r2 . getCode ( ) ) ) ; if ( ! statusLinesEquivalent ) { return false ; } return org . apache . hc . client5 . http . impl . cache . HttpTestUtils . isEndToEndHeaderSubset ( r1 , r2 ) ; } | org . junit . Assert . assertTrue ( org . apache . hc . client5 . http . impl . cache . HttpTestUtils . semanticallyTransparent ( originResponse , result ) ) |
correctTypeProvided ( ) { com . github . rutledgepaulv . qbuilders . utilities . ObjectUtilsTest . SinglePlainArgument instance = com . github . rutledgepaulv . qbuilders . utilities . ObjectUtils . init ( com . github . rutledgepaulv . qbuilders . utilities . ObjectUtilsTest . SinglePlainArgument . class , "stuff" ) ; "<AssertPlaceHolder>" ; } init ( java . lang . Class , java . lang . Object [ ] ) { try { final java . lang . Object [ ] arguments = ( args != null ) ? args : new java . lang . Object [ ] { } ; return ( ( T ) ( java . util . Arrays . stream ( clazz . getConstructors ( ) ) . filter ( ( construct ) -> java . util . Objects . equals ( arguments . length , construct . getParameterCount ( ) ) ) . filter ( ( construct ) -> java . util . stream . IntStream . range ( 0 , arguments . length ) . allMatch ( ( val ) -> construct . getParameterTypes ( ) [ val ] . isAssignableFrom ( arguments [ val ] . getClass ( ) ) ) ) . findFirst ( ) . orElseThrow ( ( ) -> new java . lang . InstantiationException ( "Could<sp>not<sp>find<sp>compatible<sp>constructor." ) ) . newInstance ( arguments ) ) ) ; } catch ( java . lang . InstantiationException | java . lang . reflect . InvocationTargetException | java . lang . IllegalAccessException e ) { throw new java . lang . RuntimeException ( "Could<sp>not<sp>instantiate<sp>class<sp>for<sp>provided<sp>arguments." , e ) ; } } | org . junit . Assert . assertNotNull ( instance ) |
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . trash . model . TrashVersion > trashVersions = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( trashVersions . isEmpty ( ) ) |
testSize ( ) { io . ebeaninternal . json . ModifyAwareMap < java . lang . String , java . lang . String > map = createMap ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return changes . size ( ) ; } | org . junit . Assert . assertEquals ( 5 , map . size ( ) ) |
isExpiredReturnsTrueIfCurrentTimeIsGreaterThanExpiryTime ( ) { final byte [ ] body = new byte [ ] { 97 , 98 , 99 } ; com . microsoft . azure . sdk . iot . device . Message msg = new com . microsoft . azure . sdk . iot . device . Message ( body ) ; msg . setExpiryTime ( 9 ) ; java . lang . Thread . sleep ( 10 ) ; boolean actualResult = msg . isExpired ( ) ; boolean expectedResult = true ; "<AssertPlaceHolder>" ; } isExpired ( ) { return ( ( java . lang . System . currentTimeMillis ( ) ) / 1000 ) >= ( this . expiryTime ) ; } | org . junit . Assert . assertThat ( expectedResult , org . hamcrest . CoreMatchers . is ( actualResult ) ) |
testReadOptionalWithDifferentOrder ( ) { org . pm4j . core . pm . impl . pathresolver . Pojo p = org . pm4j . core . pm . impl . pathresolver . Pojo . make ( "head" , "subName" ) ; org . pm4j . common . expr . Expression expr = org . pm4j . core . pm . impl . expr . PathExpressionChain . parse ( "sub.(o,x)sub.name" ) ; "<AssertPlaceHolder>" ; } exec ( org . pm4j . common . expr . ExprExecCtxt ) { ctxt . setCurrentExpr ( this ) ; java . lang . Object result = execImpl ( ( ( CTXT ) ( ctxt ) ) ) ; ctxt . setCurrentValue ( this , result ) ; return result ; } | org . junit . Assert . assertNull ( expr . exec ( new org . pm4j . common . expr . ExprExecCtxt ( p ) ) ) |
unmodifiableArray_hasSameValues ( ) { array . add ( 23 ) ; com . eclipsesource . json . JsonArray unmodifiableArray = com . eclipsesource . json . JsonArray . unmodifiableArray ( array ) ; "<AssertPlaceHolder>" ; } values ( ) { return java . util . Collections . unmodifiableList ( values ) ; } | org . junit . Assert . assertEquals ( array . values ( ) , unmodifiableArray . values ( ) ) |
calculateBreakend_should_ignore_overlaps_resulting_in_no_breakend ( ) { au . edu . wehi . idsv . BreakendSummary bs = au . edu . wehi . idsv . model . Models . calculateBreakend ( getContext ( ) . getLinear ( ) , com . google . common . collect . Lists . newArrayList ( new au . edu . wehi . idsv . MockDirectedBreakpoint ( new au . edu . wehi . idsv . BreakpointSummary ( 0 , FWD , 1 , 1 , 4 , 1 , BWD , 2 , 2 , 2 ) ) , new au . edu . wehi . idsv . MockDirectedEvidence ( new au . edu . wehi . idsv . BreakendSummary ( 0 , FWD , 3 , 3 , 5 ) ) , new au . edu . wehi . idsv . MockDirectedEvidence ( new au . edu . wehi . idsv . BreakendSummary ( 0 , FWD , 5 , 5 , 5 ) ) ) ) ; "<AssertPlaceHolder>" ; } getLinear ( ) { return linear ; } | org . junit . Assert . assertEquals ( new au . edu . wehi . idsv . BreakendSummary ( 0 , FWD , 3 , 3 , 4 ) , bs ) |
testUserIdentityProvider ( ) { org . apache . hadoop . ipc . UserIdentityProvider uip = new org . apache . hadoop . ipc . UserIdentityProvider ( ) ; java . lang . String identity = uip . makeIdentity ( new org . apache . hadoop . ipc . TestIdentityProviders . FakeSchedulable ( ) ) ; org . apache . hadoop . security . UserGroupInformation ugi = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) ; java . lang . String username = ugi . getUserName ( ) ; "<AssertPlaceHolder>" ; } getUserName ( ) { return java . lang . System . getProperty ( "user.name" ) ; } | org . junit . Assert . assertEquals ( username , identity ) |
testHardwareDeviceWentOfflineAndPushNotWorksForLogoutUser2 ( ) { cc . blynk . server . core . model . Profile profile = cc . blynk . integration . TestUtil . parseProfile ( cc . blynk . integration . TestUtil . readTestUserProfile ( ) ) ; cc . blynk . server . core . model . widgets . notifications . Notification notification = profile . getDashById ( 1 ) . getNotificationWidget ( ) ; notification . notifyWhenOffline = true ; clientPair . appClient . updateDash ( profile . getDashById ( 1 ) ) ; clientPair . appClient . verifyResult ( cc . blynk . integration . TestUtil . ok ( 1 ) ) ; clientPair . appClient . getDevice ( 1 , 0 ) ; cc . blynk . server . core . model . device . Device device = clientPair . appClient . parseDevice ( 2 ) ; clientPair . appClient . send ( "logout" ) ; clientPair . appClient . verifyResult ( cc . blynk . integration . TestUtil . ok ( 3 ) ) ; clientPair . hardwareClient . stop ( ) . await ( ) ; verify ( holder . gcmWrapper , after ( 500 ) . never ( ) ) . send ( any ( ) , any ( ) , any ( ) ) ; cc . blynk . integration . model . tcp . TestAppClient appClient = new cc . blynk . integration . model . tcp . TestAppClient ( properties ) ; appClient . start ( ) ; appClient . login ( getUserName ( ) , "1" , "Android" , "1.10.4" ) ; appClient . verifyResult ( cc . blynk . integration . TestUtil . ok ( 1 ) ) ; cc . blynk . integration . model . tcp . TestHardClient hardClient = new cc . blynk . integration . model . tcp . TestHardClient ( "localhost" , cc . blynk . integration . tcp . NotificationsLogicTest . tcpHardPort ) ; hardClient . start ( ) ; hardClient . login ( device . token ) ; hardClient . verifyResult ( cc . blynk . integration . TestUtil . ok ( 1 ) ) ; appClient . send ( "addPushToken<sp>1 | org . junit . Assert . assertEquals ( expectedJson , message . toJson ( ) ) |
testCreateContextProperties ( ) { task . setContextFactory ( "testFactory" ) ; task . setContextProviderUrl ( "testUrl" ) ; task . setOrbInitialHost ( "testHost" ) ; task . setOrbInitialPort ( "testPort" ) ; final java . util . Properties expected = new java . util . Properties ( ) ; expected . put ( "java.naming.factory.initial" , "testFactory" ) ; expected . put ( "java.naming.provider.url" , "testUrl" ) ; expected . put ( "org.omg.CORBA.ORBInitialHost" , "testHost" ) ; expected . put ( "org.omg.CORBA.ORBInitialPort" , "testPort" ) ; "<AssertPlaceHolder>" ; } createContextProperties ( ) { final java . util . Properties properties = new java . util . Properties ( ) ; properties . put ( "java.naming.factory.initial" , contextFactory ) ; properties . put ( "java.naming.provider.url" , contextProviderUrl ) ; properties . put ( "org.omg.CORBA.ORBInitialHost" , orbInitialHost ) ; properties . put ( "org.omg.CORBA.ORBInitialPort" , orbInitialPort ) ; return properties ; } | org . junit . Assert . assertEquals ( expected , task . createContextProperties ( ) ) |
queryWithOffsetIsSuccessful ( ) { com . ibm . watson . discovery . v1 . model . QueryOptions . Builder queryBuilder = new com . ibm . watson . discovery . v1 . model . QueryOptions . Builder ( com . ibm . watson . discovery . v1 . DiscoveryServiceIT . environmentId , com . ibm . watson . discovery . v1 . DiscoveryServiceIT . collectionId ) ; queryBuilder . offset ( 5L ) ; com . ibm . watson . discovery . v1 . model . QueryResponse queryResponse = discovery . query ( queryBuilder . build ( ) ) . execute ( ) . getResult ( ) ; "<AssertPlaceHolder>" ; } getMatchingResults ( ) { return matchingResults ; } | org . junit . Assert . assertTrue ( ( ( queryResponse . getMatchingResults ( ) ) > 0 ) ) |
getNanosecondTAI ( ) { net . time4j . Moment utc = net . time4j . PlainTimestamp . of ( net . time4j . PlainDate . of ( 1980 , 1 , 6 ) , net . time4j . PlainTime . of ( 0 , 0 , 0 , 123456789 ) ) . inTimezone ( ZonalOffset . UTC ) ; "<AssertPlaceHolder>" ; } getNanosecond ( net . time4j . scale . TimeScale ) { int nano ; switch ( scale ) { case POSIX : case UTC : return this . getNanosecond ( ) ; case TAI : long tai ; if ( ( this . getElapsedTimeUTC ( ) ) < 0 ) { net . time4j . PlainDate date = this . getDateUTC ( ) ; double ttValue = net . time4j . scale . TimeScale . deltaT ( date ) ; ttValue += ( this . posixTime ) - ( net . time4j . Moment . POSIX_UTC_DELTA ) ; ttValue += ( this . getNanosecond ( ) ) / ( ( net . time4j . Moment . MRD ) * 1.0 ) ; long tv = ( ( long ) ( java . lang . Math . floor ( ttValue ) ) ) ; if ( ( java . lang . Double . compare ( ( ( net . time4j . Moment . MRD ) - ( ( ttValue - tv ) * ( net . time4j . Moment . MRD ) ) ) , 1.0 ) ) < 0 ) { tv ++ ; nano = 0 ; } else { nano = net . time4j . Moment . toNanos ( ttValue , tv ) ; } tai = ( tv - 32 ) + ( net . time4j . Moment . UTC_TAI_DELTA ) ; nano -= 184000000 ; if ( nano < 0 ) { tai -- ; nano += net . time4j . Moment . MRD ; } } else { tai = ( this . getElapsedTimeUTC ( ) ) + ( net . time4j . Moment . UTC_TAI_DELTA ) ; nano = this . getNanosecond ( ) ; } if ( tai < 0 ) { throw new java . lang . IllegalArgumentException ( ( "TAI<sp>not<sp>supported<sp>before<sp>1958-01-01:<sp>" + ( this ) ) ) ; } else { return nano ; } case GPS : long utc = this . getElapsedTimeUTC ( ) ; if ( ( net . time4j . scale . LeapSeconds . getInstance ( ) . strip ( utc ) ) < ( net . time4j . Moment . POSIX_GPS_DELTA ) ) { throw new java . lang . IllegalArgumentException ( ( "GPS<sp>not<sp>supported<sp>before<sp>1980-01-06:<sp>" + ( this ) ) ) ; } else { return this . getNanosecond ( ) ; } case TT : if ( ( this . posixTime ) < ( net . time4j . Moment . POSIX_UTC_DELTA ) ) { net . time4j . PlainDate date = this . getDateUTC ( ) ; double ttValue = net . time4j . scale . TimeScale . deltaT ( date ) ; ttValue += ( this . posixTime ) - ( net . time4j . Moment . POSIX_UTC_DELTA ) ; ttValue += ( this . getNanosecond ( ) ) / ( ( net . time4j . Moment . MRD ) * 1.0 ) ; long tt = ( ( long ) ( java . lang . Math . floor ( ttValue ) ) ) ; if ( ( java . lang . Double . compare ( ( ( net . time4j . Moment . MRD ) - ( ( ttValue - tt ) * ( net . time4j . Moment . MRD ) ) ) , 1.0 ) ) < 0 ) { nano = 0 ; } else { nano = net . time4j . Moment . toNanos ( ttValue , tt ) ; } } else { nano = ( this . getNanosecond ( ) ) + 184000000 ; if ( nano >= ( net . time4j . Moment . MRD ) ) { nano -= net . time4j . Moment . MRD ; } } return nano ; case UT : if ( ( this . posixTime ) < ( net . time4j . Moment . POSIX_UTC_DELTA ) ) { return this . getNanosecond ( ) ; } else { double utValue = this . getModernUT ( ) ; long ut = ( ( long ) ( java . lang . Math . floor ( utValue ) ) ) ; return net . time4j . Moment . toNanos ( utValue , ut ) ; } default : throw new java . lang . UnsupportedOperationException ( ( "Not<sp>yet<sp>implemented:<sp>" + scale ) ) ; } } | org . junit . Assert . assertThat ( utc . getNanosecond ( TimeScale . TAI ) , org . hamcrest . CoreMatchers . is ( 123456789 ) ) |
testBuildQuery_justLimit ( ) { java . lang . String expectedQuery = "LIMIT<sp>500" ; java . lang . String query = new com . google . api . ads . admanager . lib . utils . QueryBuilder < java . lang . Object > ( ) . limit ( 500 ) . buildQuery ( ) ; "<AssertPlaceHolder>" ; } buildQuery ( ) { return queryBuilder . buildQuery ( ) ; } | org . junit . Assert . assertEquals ( expectedQuery , query ) |
testWebServiceCallForbidden ( ) { int port = com . streamsets . datacollector . credential . cyberark . TestWebServicesFetcher . getFreePort ( ) ; java . util . Properties props = new java . util . Properties ( ) ; props . setProperty ( WebServicesFetcher . URL_KEY , ( ( "http://localhost:" + port ) + "/AIMWebService/api/Accounts" ) ) ; props . setProperty ( WebServicesFetcher . APP_ID_KEY , "invalid" ) ; com . streamsets . datacollector . credential . cyberark . Configuration conf = createConfig ( props ) ; com . streamsets . datacollector . credential . cyberark . WebServicesFetcher fetcher = new com . streamsets . datacollector . credential . cyberark . WebServicesFetcher ( ) ; try { fetcher . init ( conf ) ; runServer ( port , "none" , ( ) -> { java . lang . String got = fetcher . fetch ( "g" , "safe&folder&object&Content" , com . google . common . collect . ImmutableMap . of ( WebServicesFetcher . CONNECTION_CS_TIMEOUT_PARAM , "12345" ) ) ; "<AssertPlaceHolder>" ; return null ; } ) ; } finally { fetcher . destroy ( ) ; } } init ( com . streamsets . pipeline . api . Stage$Context ) { dbNameELEval = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . HIVE_DB_NAME ) ; tableNameELEval = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . HIVE_TABLE_NAME ) ; partitionValueELEval = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . HIVE_PARTITION_CONFIG_VALUE_EL ) ; tablePathTemplateELEval = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . TABLE_PATH_TEMPLATE ) ; partitionPathTemplateELEval = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . PARTITION_PATH_TEMPLATE ) ; timeDriverElEval = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . TIME_DRIVER ) ; scaleEL = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . SCALE_EXPRESSION ) ; precisionEL = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . PRECISION_EXPRESSION ) ; commentEL = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . COMMENT_EXPRESSION ) ; metadataHeaderAttributeEL = context . createELEval ( com . streamsets . pipeline . stage . processor . hive . HiveMetadataProcessor . ATTRIBUTE_EXPRESSION ) ; } | org . junit . Assert . assertNull ( got ) |
shouldDoBooleanProjectionWithStringBasedQuery ( ) { boolean someBoolean = partyRepository . justABoolean ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( true , someBoolean ) |
localPartitionTap ( ) { java . lang . Class < ? > tapType = com . hotels . plunger . TapTypeUtil . getTapConfigClass ( new cascading . tap . local . PartitionTap ( new cascading . tap . local . FileTap ( new cascading . scheme . local . TextDelimited ( ) , "" ) , new cascading . tap . partition . DelimitedPartition ( new cascading . tuple . Fields ( "A" ) ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( java . util . Properties . class , tapType ) |
onApplicationEventWithNullApplicationContext ( ) { org . springframework . data . gemfire . support . LazyWiringDeclarableSupport declarable = new org . springframework . data . gemfire . support . LazyWiringDeclarableSupportUnitTests . TestLazyWiringDeclarableSupport ( ) ; try { org . springframework . context . event . ContextRefreshedEvent mockContextRefreshedEvent = org . mockito . Mockito . mock ( org . springframework . context . event . ContextRefreshedEvent . class ) ; org . mockito . Mockito . when ( mockContextRefreshedEvent . getApplicationContext ( ) ) . thenReturn ( null ) ; exception . expect ( org . springframework . data . gemfire . support . IllegalArgumentException . class ) ; exception . expectCause ( org . hamcrest . Matchers . is ( org . hamcrest . Matchers . nullValue ( java . lang . Throwable . class ) ) ) ; exception . expectMessage ( "The<sp>Spring<sp>ApplicationContext<sp>[null]<sp>must<sp>be<sp>an<sp>instance<sp>of<sp>ConfigurableApplicationContext" ) ; declarable . onApplicationEvent ( mockContextRefreshedEvent ) ; } catch ( java . lang . Throwable t ) { "<AssertPlaceHolder>" ; throw t ; } finally { org . springframework . data . gemfire . support . SpringContextBootstrappingInitializer . unregister ( declarable ) ; } } isInitialized ( ) { return this . initialized ; } | org . junit . Assert . assertThat ( declarable . isInitialized ( ) , org . hamcrest . Matchers . is ( false ) ) |
testTransformer ( ) { org . datavec . spark . transform . List < org . datavec . api . writable . Writable > input = new org . datavec . spark . transform . ArrayList ( ) ; input . add ( new org . datavec . api . writable . DoubleWritable ( 1.0 ) ) ; input . add ( new org . datavec . api . writable . DoubleWritable ( 2.0 ) ) ; org . datavec . api . transform . schema . Schema schema = new org . datavec . api . transform . schema . Schema . Builder ( ) . addColumnDouble ( "1.0" ) . addColumnDouble ( "2.0" ) . build ( ) ; org . datavec . spark . transform . List < org . datavec . api . writable . Writable > output = new org . datavec . spark . transform . ArrayList ( ) ; output . add ( new org . datavec . api . writable . Text ( "1.0" ) ) ; output . add ( new org . datavec . api . writable . Text ( "2.0" ) ) ; org . datavec . api . transform . TransformProcess transformProcess = new org . datavec . api . transform . TransformProcess . Builder ( schema ) . convertToString ( "1.0" ) . convertToString ( "2.0" ) . build ( ) ; org . datavec . spark . transform . CSVSparkTransform csvSparkTransform = new org . datavec . spark . transform . CSVSparkTransform ( transformProcess ) ; java . lang . String [ ] values = new java . lang . String [ ] { "1.0" , "2.0" } ; org . datavec . spark . transform . model . SingleCSVRecord record = csvSparkTransform . transform ( new org . datavec . spark . transform . model . SingleCSVRecord ( values ) ) ; org . datavec . spark . transform . model . Base64NDArrayBody body = csvSparkTransform . toArray ( new org . datavec . spark . transform . model . SingleCSVRecord ( values ) ) ; org . nd4j . linalg . api . ndarray . INDArray fromBase64 = org . nd4j . serde . base64 . Nd4jBase64 . fromBase64 ( body . getNdarray ( ) ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "Base<sp>64ed<sp>array<sp>" + fromBase64 ) ) ; } isVector ( ) { if ( ( jvmShapeInfo . rank ) == 1 ) return true ; return ( isRowVector ( ) ) || ( isColumnVector ( ) ) ; } | org . junit . Assert . assertTrue ( fromBase64 . isVector ( ) ) |
testToDocumentVisibility_empty ( ) { final com . mongodb . BasicDBObject dbObject = ( ( com . mongodb . BasicDBObject ) ( com . mongodb . util . JSON . parse ( ( "{" + ( "documentVisibility<sp>:<sp>[]" + "}" ) ) ) ) ) ; final org . apache . rya . mongodb . document . visibility . DocumentVisibility dv = org . apache . rya . mongodb . document . visibility . DocumentVisibilityAdapter . toDocumentVisibility ( dbObject ) ; final org . apache . rya . mongodb . document . visibility . DocumentVisibility expected = org . apache . rya . mongodb . MongoDbRdfConstants . EMPTY_DV ; "<AssertPlaceHolder>" ; } toDocumentVisibility ( com . mongodb . DBObject ) { try { final com . mongodb . BasicDBObject basicObj = ( ( com . mongodb . BasicDBObject ) ( mongoObj ) ) ; final java . lang . Object documentVisibilityObject = basicObj . get ( org . apache . rya . mongodb . document . visibility . DocumentVisibilityAdapter . DOCUMENT_VISIBILITY_KEY ) ; java . lang . Object [ ] documentVisibilityArray = null ; if ( documentVisibilityObject instanceof java . lang . Object [ ] ) { documentVisibilityArray = ( ( java . lang . Object [ ] ) ( documentVisibilityObject ) ) ; } else if ( documentVisibilityObject instanceof com . mongodb . BasicDBList ) { documentVisibilityArray = org . apache . rya . mongodb . document . util . DocumentVisibilityUtil . convertBasicDBListToObjectArray ( ( ( com . mongodb . BasicDBList ) ( documentVisibilityObject ) ) ) ; } final java . lang . String documentVisibilityString = org . apache . rya . mongodb . document . util . DocumentVisibilityUtil . multidimensionalArrayToBooleanString ( documentVisibilityArray ) ; final org . apache . rya . mongodb . document . visibility . DocumentVisibility dv = ( documentVisibilityString == null ) ? org . apache . rya . mongodb . MongoDbRdfConstants . EMPTY_DV : new org . apache . rya . mongodb . document . visibility . DocumentVisibility ( documentVisibilityString ) ; return dv ; } catch ( final java . lang . Exception e ) { throw new org . apache . rya . mongodb . document . visibility . DocumentVisibilityAdapter . MalformedDocumentVisibilityException ( "Failed<sp>to<sp>make<sp>Document<sp>Visibility<sp>from<sp>Mongo<sp>Object,<sp>it<sp>is<sp>malformed." , e ) ; } } | org . junit . Assert . assertEquals ( expected , dv ) |
getTypedPropertyValueJSONObjectNullPropertyValue ( ) { java . lang . Object nullValue = com . tinkerpop . rexster . util . ElementHelper . getTypedPropertyValue ( JSONObject . NULL ) ; "<AssertPlaceHolder>" ; } getTypedPropertyValue ( java . lang . Object ) { return com . tinkerpop . rexster . util . ElementHelper . getTypedPropertyValue ( propertyValue , true ) ; } | org . junit . Assert . assertNull ( nullValue ) |
whenGettingLazyStackTrace_ListShouldBeReturned ( ) { java . lang . IllegalArgumentException e = new java . lang . IllegalArgumentException ( "Some<sp>argument<sp>is<sp>incorrect" ) ; java . util . List < java . lang . StackTraceElement > stackTraceElements = com . google . common . base . Throwables . lazyStackTrace ( e ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( stackTraceElements . size ( ) ) > 0 ) ) |
testGetEmptyHeader ( ) { org . apache . cxf . message . Message m = new org . apache . cxf . message . MessageImpl ( ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > headers = new java . util . TreeMap ( String . CASE_INSENSITIVE_ORDER ) ; headers . put ( "A" , java . util . Collections . < java . lang . String > emptyList ( ) ) ; m . put ( Message . PROTOCOL_HEADERS , headers ) ; javax . ws . rs . core . HttpHeaders h = new org . apache . cxf . jaxrs . impl . HttpHeadersImpl ( m ) ; java . util . List < java . lang . String > values = h . getRequestHeader ( "A" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return wrappedEndpoint . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( values . isEmpty ( ) ) |
assertExecuteForSingleStatementSuccessWithDML ( ) { java . sql . Statement statement = getStatement ( ) ; when ( statement . execute ( org . apache . shardingsphere . shardingjdbc . executor . StatementExecutorTest . DML_SQL ) ) . thenReturn ( false ) ; setExecuteGroups ( java . util . Collections . singletonList ( statement ) , SQLType . DML ) ; "<AssertPlaceHolder>" ; verify ( statement ) . execute ( org . apache . shardingsphere . shardingjdbc . executor . StatementExecutorTest . DML_SQL ) ; } execute ( ) { return execute ( new org . apache . shardingsphere . shardingjdbc . executor . StatementExecutor . Executor ( ) { @ org . apache . shardingsphere . shardingjdbc . executor . Override public boolean execute ( final java . sql . Statement statement , final java . lang . String sql ) throws java . sql . SQLException { return statement . execute ( sql ) ; } } ) ; } | org . junit . Assert . assertFalse ( actual . execute ( ) ) |
fromString_format_tz ( ) { com . psddev . dari . util . Date expect = new java . text . SimpleDateFormat ( "yyyy/MM/dd<sp>z<sp>HH:mm:ss" ) . parse ( "2011/05/12<sp>EDT<sp>12:45:27" ) ; "<AssertPlaceHolder>" ; } fromString ( java . lang . String , java . lang . String ) { if ( string == null ) { throw new com . psddev . dari . util . DateFormatException ( "Cannot<sp>convert<sp>a<sp>null<sp>string<sp>into<sp>a<sp>date!" ) ; } string = string . trim ( ) ; try { return new java . util . Date ( com . psddev . dari . util . DateUtils . FORMATTERS . get ( format ) . parseMillis ( string ) ) ; } catch ( java . lang . IllegalArgumentException error ) { } if ( format . contains ( "z" ) ) { try { return new java . text . SimpleDateFormat ( format ) . parse ( string ) ; } catch ( java . text . ParseException error ) { } } throw new com . psddev . dari . util . DateFormatException ( java . lang . String . format ( "Cannot<sp>convert<sp>[%s]<sp>into<sp>a<sp>date<sp>using<sp>the<sp>[%s]<sp>format!" , string , format ) ) ; } | org . junit . Assert . assertEquals ( expect , com . psddev . dari . util . DateUtils . fromString ( "2011/05/12<sp>EDT<sp>12:45:27" , "yyyy/MM/dd<sp>z<sp>HH:mm:ss" ) ) |
getSecondaryGroupUserIDsWhenWhitespaceResultsReturnsEmptyList ( ) { groups = "<sp>" ; when ( result . getString ( configuration . webappSecondaryGroupGroupIDColumn ) ) . thenReturn ( groups ) ; java . util . List < java . lang . String > secondaryGroups = webGroupDao . getSecondaryGroupUserIDs ( group1 ) ; "<AssertPlaceHolder>" ; } getSecondaryGroupUserIDs ( java . lang . String ) { java . util . List < java . lang . String > userIDs = new java . util . ArrayList < java . lang . String > ( ) ; result = sql . sqlQuery ( getSecondaryGroupUserIDsReadQuery ( ) ) ; while ( result . next ( ) ) { java . util . List < java . lang . String > groupIDs = convertDelimitedIDString ( result . getString ( configuration . webappSecondaryGroupGroupIDColumn ) ) ; if ( groupIDs . contains ( groupID ) ) { userIDs . add ( result . getString ( configuration . webappSecondaryGroupUserIDColumn ) ) ; } } return userIDs ; } | org . junit . Assert . assertEquals ( 0 , secondaryGroups . size ( ) ) |
testGreatUncleInLawIsAssignableFromChild ( ) { final org . jboss . errai . codegen . meta . MetaClass metaChild = getMetaClass ( org . jboss . errai . codegen . test . model . tree . Child . class ) ; final org . jboss . errai . codegen . meta . MetaClass metaGreatUncleInLaw = getMetaClass ( org . jboss . errai . codegen . test . model . tree . GrandparentSuperInterface . class ) ; "<AssertPlaceHolder>" ; } isAssignableFrom ( org . jboss . errai . codegen . meta . MetaParameterizedType ) { final org . jboss . errai . codegen . meta . MetaType [ ] compareFrom = org . jboss . errai . common . client . api . Assert . notNull ( fromType ) . getTypeParameters ( ) ; final org . jboss . errai . codegen . meta . MetaType [ ] compareTo = getTypeParameters ( ) ; if ( ( compareTo . length ) != ( compareFrom . length ) ) return false ; for ( int i = 0 ; i < ( compareTo . length ) ; i ++ ) { final org . jboss . errai . codegen . meta . MetaType from = compareFrom [ i ] ; final org . jboss . errai . codegen . meta . MetaType to = compareTo [ i ] ; if ( ( from instanceof org . jboss . errai . codegen . meta . MetaClass ) && ( to instanceof org . jboss . errai . codegen . meta . MetaClass ) ) { if ( ! ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( from ) ) . isAssignableTo ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( to ) ) ) ) ) { return false ; } } else if ( to instanceof org . jboss . errai . codegen . meta . MetaParameterizedType ) { return false ; } else if ( to instanceof org . jboss . errai . codegen . meta . MetaWildcardType ) { if ( from instanceof org . jboss . errai . codegen . meta . MetaClass ) { final org . jboss . errai . codegen . meta . MetaClass fromMC = ( ( org . jboss . errai . codegen . meta . MetaClass ) ( from ) ) ; final boolean violatesUpperBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaWildcardType ) ( to ) ) . getUpperBounds ( ) ) . filter ( ( bound ) -> ! ( fromMC . isAssignableTo ( bound ) ) ) . findAny ( ) . isPresent ( ) ; final boolean violatesLowerBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaWildcardType ) ( to ) ) . getLowerBounds ( ) ) . filter ( ( bound ) -> ! ( bound . isAssignableTo ( fromMC ) ) ) . findAny ( ) . isPresent ( ) ; if ( violatesLowerBound || violatesUpperBound ) { return false ; } } else { return false ; } } else if ( ( from instanceof org . jboss . errai . codegen . meta . MetaTypeVariable ) && ( to instanceof org . jboss . errai . codegen . meta . MetaClass ) ) { final boolean hasAssignableUpperBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaTypeVariable ) ( from ) ) . getBounds ( ) ) . filter ( ( fromBound ) -> fromBound . isAssignableFrom ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( to ) ) ) ) . findAny ( ) . isPresent ( ) ; if ( ! hasAssignableUpperBound ) { return false ; } } } return true ; } | org . junit . Assert . assertTrue ( metaGreatUncleInLaw . isAssignableFrom ( metaChild ) ) |
shouldLoadWroConfigurationFromServletContextAttribute ( ) { final ro . isdc . wro . http . WroFilter filter = new ro . isdc . wro . http . WroFilter ( ) ; final ro . isdc . wro . config . jmx . WroConfiguration expectedConfig = new ro . isdc . wro . config . jmx . WroConfiguration ( ) ; final ro . isdc . wro . http . support . ServletContextAttributeHelper helper = new ro . isdc . wro . http . support . ServletContextAttributeHelper ( mockServletContext ) ; org . mockito . Mockito . when ( mockServletContext . getAttribute ( helper . getAttributeName ( Attribute . CONFIGURATION ) ) ) . thenReturn ( expectedConfig ) ; filter . init ( mockFilterConfig ) ; "<AssertPlaceHolder>" ; } getConfiguration ( ) { return configuration ; } | org . junit . Assert . assertSame ( expectedConfig , filter . getConfiguration ( ) ) |
pendingStreamSucceedAfterShutdown ( ) { initTransport ( ) ; setMaxConcurrentStreams ( 0 ) ; final io . grpc . okhttp . OkHttpClientTransportTest . MockStreamListener listener = new io . grpc . okhttp . OkHttpClientTransportTest . MockStreamListener ( ) ; io . grpc . okhttp . OkHttpClientStream stream = clientTransport . newStream ( method , new io . grpc . Metadata ( ) , CallOptions . DEFAULT ) ; stream . start ( listener ) ; waitForStreamPending ( 1 ) ; clientTransport . shutdown ( io . grpc . okhttp . OkHttpClientTransportTest . SHUTDOWN_REASON ) ; setMaxConcurrentStreams ( 1 ) ; verify ( frameWriter , timeout ( io . grpc . okhttp . OkHttpClientTransportTest . TIME_OUT_MS ) ) . synStream ( anyBoolean ( ) , anyBoolean ( ) , eq ( 3 ) , anyInt ( ) , io . grpc . okhttp . OkHttpClientTransportTest . anyListHeader ( ) ) ; "<AssertPlaceHolder>" ; stream . cancel ( Status . CANCELLED ) ; shutdownAndVerify ( ) ; } activeStreamCount ( ) { return clientTransport . getActiveStreams ( ) . length ; } | org . junit . Assert . assertEquals ( 1 , activeStreamCount ( ) ) |
testEmbedLeft021 ( ) { java . lang . String query = null ; com . ebay . cloud . cms . query . service . IQueryResult result = null ; query = "Manifest.versions+.approvals[@_oid=\"xxxx\"]" ; result = queryService . query ( query , deployContext ) ; "<AssertPlaceHolder>" ; } getEntities ( ) { return entities ; } | org . junit . Assert . assertEquals ( 0 , result . getEntities ( ) . size ( ) ) |
mapStatistics ( ) { final java . lang . String rawResult = this . tut . path ( "maps" ) . request ( MediaType . TEXT_PLAIN ) . get ( java . lang . String . class ) ; javax . json . JsonArray result = com . abien . airhacks . satellite . RESTSupport . convertToArrayFrom ( rawResult ) ; "<AssertPlaceHolder>" ; } convertToArrayFrom ( java . lang . String ) { javax . json . JsonReader reader = javax . json . Json . createReader ( new java . io . StringReader ( rawValue ) ) ; return reader . readArray ( ) ; } | org . junit . Assert . assertFalse ( result . isEmpty ( ) ) |
setPropertyValueOnResourceRelationForContextShouldThrowExceptionWhenWhenResourceUpdatePermissionIsMissing ( ) { java . lang . String resourceGroupName = "resourceGroupName" ; java . lang . String releaseName = "releaseName" ; java . lang . String relatedResourceGroupName = "relatedResourceGroupName" ; java . lang . String relatedResourceReleaseName = "relatedResourceReleaseName" ; java . lang . String contextName = "contextName" ; java . lang . String propertyName = "propertyName" ; java . lang . String propertyValue = "propertyValue" ; ch . puzzle . itc . mobiliar . business . property . boundary . List < ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEditProperty > properties = new ch . puzzle . itc . mobiliar . business . property . boundary . ArrayList ( ) ; properties . add ( new ch . puzzle . itc . mobiliar . builders . ResourceEditPropertyBuilder ( ) . withDisplayAndTechKeyName ( propertyName ) . withValue ( propertyValue ) . build ( ) ) ; ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity contextMock = mock ( ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity . class ) ; ch . puzzle . itc . mobiliar . business . resourcerelation . entity . ConsumedResourceRelationEntity relation = createWithMasterAndSlave ( resourceGroupName , relatedResourceGroupName ) ; when ( resourceRelationLocatorMock . getResourceRelation ( resourceGroupName , releaseName , relatedResourceGroupName , relatedResourceReleaseName ) ) . thenReturn ( relation ) ; when ( contextLocatorMock . getContextByName ( contextName ) ) . thenReturn ( contextMock ) ; when ( entityManagerMock . find ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class , 1 ) ) . thenReturn ( mock ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class ) ) ; when ( entityManagerMock . find ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class , 2 ) ) . thenReturn ( mock ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceEntity . class ) ) ; when ( propertyEditingServiceMock . loadPropertiesForEditRelation ( any ( ResourceEditRelation . Mode . class ) , anyInt ( ) , anyInt ( ) , any ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceTypeEntity . class ) , any ( ch . puzzle . itc . mobiliar . business . property . boundary . ResourceTypeEntity . class ) , any ( ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity . class ) ) ) . thenReturn ( properties ) ; when ( permissionBoundaryMock . hasPermission ( Permission . RESOURCE , contextMock , Action . UPDATE , null , null ) ) . thenReturn ( false ) ; when ( permissionBoundaryMock . hasPermission ( Permission . RESOURCE_PROPERTY_DECRYPT , contextMock , Action . ALL , relation . getMasterResource ( ) , null ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; verify ( propertyValueServiceMock , never ( ) ) . decryptProperties ( anyList ( ) ) ; editor . setPropertyValueOnResourceRelationForContext ( resourceGroupName , releaseName , relatedResourceGroupName , relatedResourceReleaseName , contextName , propertyName , propertyValue ) ; } isEmpty ( ) { if ( ( ( asProperties ) != null ) && ( ! ( asProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( nodeProperties ) != null ) && ( ! ( nodeProperties . isEmpty ( ) ) ) ) { return false ; } if ( ( ( consumerUnit ) != null ) && ( ! ( consumerUnit . isEmpty ( ) ) ) ) { return false ; } return true ; } | org . junit . Assert . assertFalse ( properties . isEmpty ( ) ) |
testReadXlsInputStream ( ) { final joinery . DataFrame < java . lang . Object > df = joinery . DataFrame . readXls ( java . lang . ClassLoader . getSystemResourceAsStream ( "serialization.xls" ) ) ; final java . lang . Object [ ] [ ] expected = new java . lang . Object [ ] [ ] { new java . lang . Object [ ] { "a" , "a" , "b" , "b" , "c" , "c" } , new java . lang . Object [ ] { "alpha" , "bravo" , "charlie" , "delta" , "echo" , "foxtrot" } , new java . lang . Object [ ] { 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 } } ; for ( int i = 0 ; i < ( expected . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } col ( java . lang . Integer ) { return new joinery . impl . Views . SeriesListView < > ( this , column , true ) ; } | org . junit . Assert . assertArrayEquals ( expected [ i ] , df . col ( i ) . toArray ( ) ) |
size ( ) { "<AssertPlaceHolder>" ; } size ( ) { org . junit . Assert . assertEquals ( com . yandex . yoctodb . util . immutable . impl . TrieByteArraySortedSetTest . keys . size ( ) , com . yandex . yoctodb . util . immutable . impl . TrieByteArraySortedSetTest . trieSet . size ( ) ) ; } | org . junit . Assert . assertEquals ( com . yandex . yoctodb . util . immutable . impl . TrieByteArraySortedSetTest . keys . size ( ) , com . yandex . yoctodb . util . immutable . impl . TrieByteArraySortedSetTest . trieSet . size ( ) ) |
nonSpellcheckIndex ( ) { java . lang . String indexNodeType = "nt:base" ; java . lang . String queryNodeType = "nt:base" ; boolean enableSuggestionIndex = false ; boolean enableSpellcheckIndex = false ; boolean queryForSugggestion = false ; org . apache . jackrabbit . oak . plugins . index . lucene . LuceneIndexNode node = createSuggestionOrSpellcheckIndex ( indexNodeType , enableSuggestionIndex , enableSpellcheckIndex ) ; org . apache . jackrabbit . oak . spi . query . QueryIndex . IndexPlan plan = getSuggestOrSpellcheckIndexPlan ( node , queryNodeType , queryForSugggestion ) ; "<AssertPlaceHolder>" ; } getSuggestOrSpellcheckIndexPlan ( org . apache . jackrabbit . oak . plugins . index . lucene . LuceneIndexNode , java . lang . String , boolean ) { org . apache . jackrabbit . oak . query . index . FilterImpl filter = createFilter ( nodeType ) ; filter . restrictProperty ( indexNode . getDefinition ( ) . getFunctionName ( ) , Operator . EQUAL , org . apache . jackrabbit . oak . plugins . memory . PropertyValues . newString ( ( ( forSugggestion ? "suggest" : "spellcheck" ) + "?term=foo" ) ) ) ; org . apache . jackrabbit . oak . plugins . index . search . spi . query . FulltextIndexPlanner planner = new org . apache . jackrabbit . oak . plugins . index . search . spi . query . FulltextIndexPlanner ( indexNode , "/foo" , filter , java . util . Collections . < org . apache . jackrabbit . oak . spi . query . QueryIndex . OrderEntry > emptyList ( ) ) ; return planner . getPlan ( ) ; } | org . junit . Assert . assertNull ( plan ) |
deveObterNomeFantasiaComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroSituacaoCadastral retorno = new com . fincatto . documentofiscal . nfe310 . classes . cadastro . NFRetornoConsultaCadastroSituacaoCadastral ( ) ; retorno . setNomeFantasia ( "Video<sp>locadora<sp>do<sp>Pedro" ) ; "<AssertPlaceHolder>" ; } getNomeFantasia ( ) { return this . nomeFantasia ; } | org . junit . Assert . assertEquals ( "Video<sp>locadora<sp>do<sp>Pedro" , retorno . getNomeFantasia ( ) ) |
setIllegalPageSize ( ) { org . jboss . hal . ballroom . dataprovider . PageInfo pageInfo = new org . jboss . hal . ballroom . dataprovider . PageInfo ( org . jboss . hal . ballroom . dataprovider . PageInfoTest . PAGE_SIZE ) ; pageInfo . setPageSize ( ( - 1 ) ) ; "<AssertPlaceHolder>" ; } getPageSize ( ) { return pageSize ; } | org . junit . Assert . assertEquals ( 1 , pageInfo . getPageSize ( ) ) |
unidirectionalOneToMany ( ) { log . info ( "...<sp>bidirectionalOneToMany<sp>..." ) ; javax . persistence . EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; org . thoughts . on . java . model . Book b = em . find ( org . thoughts . on . java . model . Book . class , 1L ) ; org . thoughts . on . java . model . Review r = new org . thoughts . on . java . model . Review ( ) ; r . setComment ( "This<sp>is<sp>a<sp>comment" ) ; r . setBook ( b ) ; em . persist ( r ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; r = em . find ( org . thoughts . on . java . model . Review . class , 1L ) ; b = r . getBook ( ) ; "<AssertPlaceHolder>" ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( new java . lang . Long ( 1 ) , b . getId ( ) ) |
mergeParentDeclarationsFillTest ( ) { java . util . Map < java . lang . String , java . lang . String > styles = new java . util . HashMap ( ) ; java . lang . String styleProperty = "fill" ; java . lang . String parentPropValue = "blue" ; java . lang . String parentFontSize = "0" ; java . util . Map < java . lang . String , java . lang . String > expectedStyles = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; expectedStyles . put ( styleProperty , parentPropValue ) ; com . itextpdf . svg . css . impl . StyleResolverUtil sru = new com . itextpdf . svg . css . impl . StyleResolverUtil ( ) ; sru . mergeParentStyleDeclaration ( styles , styleProperty , parentPropValue , parentFontSize ) ; boolean equal = ( styles . size ( ) ) == ( expectedStyles . size ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > kvp : expectedStyles . entrySet ( ) ) { equal &= kvp . getValue ( ) . equals ( styles . get ( kvp . getKey ( ) ) ) ; } "<AssertPlaceHolder>" ; } getKey ( ) { return info . getKey ( ) ; } | org . junit . Assert . assertTrue ( equal ) |
test_getNodeWritable_Watcher ( ) { ZK = org . goldenorb . zookeeper . ZookeeperUtils . connect ( org . goldenorb . zookeeper . ZookeeperUtilsTest . orbConf . getOrbZooKeeperQuorum ( ) ) ; org . apache . hadoop . io . Text input = new org . apache . hadoop . io . Text ( "test<sp>node<sp>writable" ) ; org . apache . hadoop . io . Text txt = new org . apache . hadoop . io . Text ( ) ; ZK . create ( "/node" , org . goldenorb . zookeeper . ZookeeperUtils . writableToByteArray ( input ) , Ids . OPEN_ACL_UNSAFE , CreateMode . EPHEMERAL ) ; txt = ( ( org . apache . hadoop . io . Text ) ( org . goldenorb . zookeeper . ZookeeperUtils . getNodeWritable ( ZK , "/node" , org . apache . hadoop . io . Text . class , org . goldenorb . zookeeper . ZookeeperUtilsTest . orbConf , new org . goldenorb . zookeeper . ZookeeperUtilsTest . TestWatcher ( ) ) ) ) ; org . goldenorb . zookeeper . ZookeeperUtils . getNodeWritable ( ZK , "/falsenode" , org . apache . hadoop . io . Text . class , org . goldenorb . zookeeper . ZookeeperUtilsTest . orbConf , new org . goldenorb . zookeeper . ZookeeperUtilsTest . TestWatcher ( ) ) ; "<AssertPlaceHolder>" ; ZK . delete ( "/node" , ( - 1 ) ) ; } getNodeWritable ( org . apache . zookeeper . ZooKeeper , java . lang . String , java . lang . Class , org . goldenorb . conf . OrbConfiguration , org . apache . zookeeper . Watcher ) { byte [ ] data = null ; try { data = zk . getData ( path , watcher , null ) ; } catch ( org . apache . zookeeper . KeeperException e ) { org . goldenorb . zookeeper . ZookeeperUtils . LOG . debug ( ( ( "Node<sp>" + path ) + "<sp>does<sp>not<sp>exist!" ) ) ; } catch ( org . apache . zookeeper . KeeperException e ) { throw new org . goldenorb . zookeeper . OrbZKFailure ( e ) ; } catch ( java . lang . InterruptedException e ) { throw new org . goldenorb . zookeeper . OrbZKFailure ( e ) ; } if ( data != null ) { return org . goldenorb . zookeeper . ZookeeperUtils . byteArrayToWritable ( data , writableClass , orbConf ) ; } else { return null ; } } | org . junit . Assert . assertEquals ( input , txt ) |
whenSaturatedPowTwoIntegerValues_shouldPowThemAndReturnIntMinIfUnderflow ( ) { int result = com . google . common . math . IntMath . saturatedPow ( Integer . MIN_VALUE , 3 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( Integer . MIN_VALUE , result ) |
testLocaleWithNumberRenderer ( ) { java . lang . String templates = "foo(x,y)<sp>::=<sp><<\n" + ( "<x;<sp>format=\"%,d\"><sp><y;<sp>format=\"%,2.3f\">\n" + ">>\n" ) ; writeFile ( tmpdir , "t.stg" , templates ) ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroupFile ( ( ( tmpdir ) + "/t.stg" ) ) ; group . registerRenderer ( org . stringtemplate . v4 . test . Integer . class , new org . stringtemplate . v4 . NumberRenderer ( ) ) ; group . registerRenderer ( org . stringtemplate . v4 . test . Double . class , new org . stringtemplate . v4 . NumberRenderer ( ) ) ; org . stringtemplate . v4 . ST st = group . getInstanceOf ( "t.stg" 0 ) ; st . add ( "x" , ( - 2100 ) ) ; st . add ( "y" , 3.14159 ) ; java . lang . String expecting = "t.stg" 1 ; java . lang . String result = st . render ( new java . util . Locale ( "pl" ) ) ; "<AssertPlaceHolder>" ; } render ( int ) { return render ( java . util . Locale . getDefault ( ) , lineWidth ) ; } | org . junit . Assert . assertEquals ( expecting , result ) |
testNoCandidateMagic ( ) { completer . addCandidateFunction ( "%vars" ) ; completer . addCandidateFunction ( "%vast" ) ; completer . addCandidateFunction ( "%verbotten" ) ; java . lang . Iterable < java . lang . String > result = completer . autoComplete ( "%xy" ) ; java . util . List < java . lang . String > completes = com . google . common . collect . Lists . newArrayList ( result ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( java . util . Map m : variableMappings ) { size += m . size ( ) ; } return size ; } | org . junit . Assert . assertEquals ( 0 , completes . size ( ) ) |
test2 ( ) { try { java . lang . String query = "CONSTRUCT<sp>{<sp>?x<sp><http://www.w3.org/1999/02/22-rdf-syntax-ns#type><sp><http://kres.iks-project.eu/ontology.owl#OldPerson><sp>.<sp>}<sp>WHERE<sp>{<sp>?x<sp><http://kres.iks-project.eu/ontology.owl#age><sp>?age<sp>.<sp>?x<sp><http://www.w3.org/1999/02/22-rdf-syntax-ns#type><sp><http://kres.iks-project.eu/ontology.owl#Person><sp>.<sp>FILTER<sp><http://www.w3.org/2005/xpath-functions#ends-with>(?t,\"string\")<sp>.<sp>FILTER<sp>((?age)<sp>><sp>(((\"70\"^^<http://www.w3.org/2001/XMLSchema#string>)<sp>-<sp>(?k))<sp>+<sp>(?z)))<sp>}" ; org . apache . clerezza . rdf . core . sparql . QueryParser . getInstance ( ) . parse ( query ) ; "<AssertPlaceHolder>" ; } catch ( org . apache . clerezza . rdf . core . sparql . ParseException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } parse ( java . lang . String ) { java . lang . String [ ] referencedCore = new java . lang . String [ 2 ] ; boolean isFile ; if ( uriOrPathOrReference . startsWith ( "file:" ) ) { isFile = true ; java . io . File file = null ; try { file = org . apache . commons . io . FileUtils . toFile ( new java . net . URL ( uriOrPathOrReference ) ) ; } catch ( java . net . MalformedURLException e ) { org . apache . stanbol . commons . solr . IndexReference . log . error ( ( ( "Unable<sp>to<sp>parse<sp>file<sp>URL<sp>'" + uriOrPathOrReference ) + "'!" ) , e ) ; file = null ; } referencedCore [ 0 ] = null ; if ( file != null ) { referencedCore [ 1 ] = org . apache . commons . io . FilenameUtils . normalize ( ( ( file . getAbsolutePath ( ) ) + ( java . io . File . separatorChar ) ) ) ; } else { return null ; } } else if ( ( ( uriOrPathOrReference . indexOf ( File . separatorChar ) ) >= 0 ) || ( ( uriOrPathOrReference . indexOf ( '/' ) ) >= 0 ) ) { isFile = true ; java . io . File file = new java . io . File ( org . apache . commons . io . FilenameUtils . separatorsToSystem ( uriOrPathOrReference ) ) ; referencedCore [ 0 ] = null ; referencedCore [ 1 ] = org . apache . commons . io . FilenameUtils . normalize ( ( ( file . getAbsolutePath ( ) ) + ( java . io . File . separatorChar ) ) ) ; } else { isFile = false ; int index = uriOrPathOrReference . indexOf ( ':' ) ; if ( index < 0 ) { referencedCore [ 0 ] = null ; referencedCore [ 1 ] = uriOrPathOrReference ; } else { referencedCore [ 0 ] = uriOrPathOrReference . substring ( 0 , index ) ; referencedCore [ 1 ] = uriOrPathOrReference . substring ( ( index + 1 ) ) ; org . apache . stanbol . commons . solr . IndexReference . validateIndexName ( referencedCore [ 1 ] , uriOrPathOrReference ) ; } } return new org . apache . stanbol . commons . solr . IndexReference ( referencedCore [ 0 ] , referencedCore [ 1 ] , isFile ) ; } | org . junit . Assert . assertTrue ( true ) |
setAlias ( ) { java . util . List < io . nuls . account . model . Account > accounts = io . nuls . account . service . AliasServiceTest . accountService . createAccount ( 1 , "nuls123456" ) . getData ( ) ; io . nuls . account . model . Account account = accounts . get ( 0 ) ; io . nuls . kernel . model . Result result = io . nuls . account . service . AliasServiceTest . aliasService . setAlias ( account . getAddress ( ) . toString ( ) , "nuls123456" , "Charlie555" ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return success ; } | org . junit . Assert . assertTrue ( result . isSuccess ( ) ) |
test_WithValueMatch ( ) { ctx . request ( ) . setQueryString ( "myParameter=foo" ) ; extension . activate ( configWithRequestParameterValues ) ; boolean actual = extension . accepts ( ctx . request ( ) , null , extension . getAllowedKeyValues ( ) ) ; "<AssertPlaceHolder>" ; } activate ( java . util . Map ) { this . listRoot = org . apache . sling . commons . osgi . PropertiesUtil . toString ( props . get ( com . adobe . acs . commons . genericlists . impl . GenericListJsonResourceProvider . PROP_LIST_ROOT ) , com . adobe . acs . commons . genericlists . impl . GenericListJsonResourceProvider . DEFAULT_LIST_ROOT ) ; } | org . junit . Assert . assertTrue ( actual ) |
shouldEventPresences ( ) { final com . calclab . emite . xtesting . handlers . PresenceReceivedTestHandler handler = new com . calclab . emite . xtesting . handlers . PresenceReceivedTestHandler ( ) ; session . addPresenceReceivedHandler ( handler ) ; connection . receives ( com . calclab . emite . base . xml . XMLBuilder . create ( "presence" ) . getXML ( ) ) ; "<AssertPlaceHolder>" ; } isCalledOnce ( ) { return ( getCalledTimes ( ) ) == 1 ; } | org . junit . Assert . assertTrue ( handler . isCalledOnce ( ) ) |
testCompliesNotWithWidthBiggerThanMaxWidthPercentage ( ) { com . eclipsesource . tabris . passepartout . internal . condition . MaxWidthCondition condition = new com . eclipsesource . tabris . passepartout . internal . condition . MaxWidthCondition ( new com . eclipsesource . tabris . passepartout . internal . unit . Percentage ( java . math . BigDecimal . valueOf ( 40 ) ) ) ; com . eclipsesource . tabris . passepartout . Bounds bounds = new com . eclipsesource . tabris . passepartout . Bounds ( 10 , 10 , 100 , 0 ) ; com . eclipsesource . tabris . passepartout . Bounds referenceBounds = new com . eclipsesource . tabris . passepartout . Bounds ( 10 , 10 , 200 , 0 ) ; boolean complies = condition . compliesWith ( new com . eclipsesource . tabris . passepartout . internal . UIEnvironmentImpl ( bounds , referenceBounds , 16 ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( complies ) |
testSimple ( ) { org . neo4j . test . DbRepresentation someData = createSomeData ( ) ; org . neo4j . graphdb . GraphDatabaseService readGraphDb = new org . neo4j . kernel . EmbeddedReadOnlyGraphDatabase ( org . neo4j . kernel . impl . core . TestReadOnlyNeo4j . PATH ) ; "<AssertPlaceHolder>" ; org . neo4j . graphdb . Transaction tx = readGraphDb . beginTx ( ) ; try { readGraphDb . createNode ( ) ; } catch ( org . neo4j . kernel . impl . core . ReadOnlyDbException e ) { } tx . finish ( ) ; readGraphDb . shutdown ( ) ; } of ( org . neo4j . graphdb . GraphDatabaseService ) { org . neo4j . test . DbRepresentation result = new org . neo4j . test . DbRepresentation ( ) ; for ( org . neo4j . graphdb . Node node : db . getAllNodes ( ) ) { org . neo4j . test . DbRepresentation . NodeRep nodeRep = new org . neo4j . test . DbRepresentation . NodeRep ( node ) ; result . nodes . put ( node . getId ( ) , nodeRep ) ; result . highestNodeId = java . lang . Math . max ( node . getId ( ) , result . highestNodeId ) ; result . highestRelationshipId = java . lang . Math . max ( nodeRep . highestRelationshipId , result . highestRelationshipId ) ; } return result ; } | org . junit . Assert . assertEquals ( someData , org . neo4j . test . DbRepresentation . of ( readGraphDb ) ) |
generateNewId_LineBreak ( ) { s . setName ( "id\n1<sp>(2.5)" ) ; gen = new org . oscm . ui . generator . IdGenerator ( "" , s , new java . util . ArrayList < org . oscm . internal . vo . VOSubscription > ( ) ) ; "<AssertPlaceHolder>" ; } generateNewId ( ) { java . lang . String temp = ( ( prefix ) + ( baseId ) ) . trim ( ) ; if ( ( temp . length ( ) ) > ( org . oscm . validator . ADMValidator . LENGTH_ID ) ) { temp = temp . substring ( 0 , ADMValidator . LENGTH_ID ) ; } java . lang . String template = temp + "%s" ; if ( ( temp . length ( ) ) > ( ( org . oscm . validator . ADMValidator . LENGTH_ID ) - 7 ) ) { template = ( template . substring ( 0 , ( ( org . oscm . validator . ADMValidator . LENGTH_ID ) - 7 ) ) ) + "%s" ; } for ( int index = 2 ; ( index < ( Short . MAX_VALUE ) ) && ( excludedIds . contains ( temp ) ) ; index ++ ) { temp = java . lang . String . format ( template , ( ( "(" + index ) + ")" ) ) ; } return temp ; } | org . junit . Assert . assertEquals ( "id\n1<sp>(2.5)" , gen . generateNewId ( ) ) |
testSetDimension2Success ( ) { org . goodoldai . jeff . explanation . data . Dimension dim = new org . goodoldai . jeff . explanation . data . Dimension ( "Miles" ) ; two . setDimension2 ( dim ) ; "<AssertPlaceHolder>" ; } getDimension2 ( ) { return dimension2 ; } | org . junit . Assert . assertEquals ( dim , two . getDimension2 ( ) ) |
testModify ( ) { org . apache . directory . api . ldap . model . name . Dn dn = new org . apache . directory . api . ldap . model . name . Dn ( "uid=admin,ou=system" ) ; java . lang . String expected = java . lang . String . valueOf ( java . lang . System . currentTimeMillis ( ) ) ; org . apache . directory . api . ldap . model . message . ModifyRequest modRequest = new org . apache . directory . api . ldap . model . message . ModifyRequestImpl ( ) ; modRequest . setName ( dn ) ; modRequest . replace ( SchemaConstants . SN_AT , expected ) ; connection . modify ( modRequest ) ; org . apache . directory . api . ldap . model . entry . Entry entry = session . lookup ( dn ) ; java . lang . String actual = entry . get ( SchemaConstants . SN_AT ) . getString ( ) ; "<AssertPlaceHolder>" ; } getString ( ) { return string ; } | org . junit . Assert . assertEquals ( expected , actual ) |
stringBuilder ( ) { org . eclipse . collections . impl . string . immutable . CharAdapter adapt = org . eclipse . collections . impl . string . immutable . CharAdapter . adapt ( org . eclipse . collections . impl . string . immutable . CharAdapterTest . UNICODE_STRING ) ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( this . key ) ; } | org . junit . Assert . assertEquals ( org . eclipse . collections . impl . string . immutable . CharAdapterTest . UNICODE_STRING , new java . lang . StringBuilder ( adapt ) . toString ( ) ) |
testEqualsWithDiferentName ( ) { System . out . println ( "testEqualsWithDiferentName" ) ; team . bus . model . bean . BusStop o1 = new team . bus . model . bean . BusStop ( ) . withId ( 1 ) . withName ( "a" ) ; team . bus . model . bean . BusStop o2 = new team . bus . model . bean . BusStop ( ) . withId ( 1 ) . withName ( "b" ) ; boolean result = o1 . equals ( o2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { team . bus . model . bean . BusStop busStop = ( ( team . bus . model . bean . BusStop ) ( obj ) ) ; if ( obj == null ) return false ; return ( ( this . id ) == ( busStop . id ) ) && ( this . name . equals ( busStop . name ) ) ; } | org . junit . Assert . assertTrue ( ( ! result ) ) |
nextProducesMappedResult ( ) { com . jnape . palatable . lambda . functions . Fn1 < java . lang . String , java . lang . Integer > stringToLength = String :: length ; java . util . List < java . lang . String > words = asList ( "foo" , "bar" ) ; com . jnape . palatable . lambda . iteration . MappingIterator < java . lang . String , java . lang . Integer > mappingIterator = new com . jnape . palatable . lambda . iteration . MappingIterator ( stringToLength , words . iterator ( ) ) ; "<AssertPlaceHolder>" ; } next ( ) { return function . apply ( iterator . next ( ) ) ; } | org . junit . Assert . assertThat ( mappingIterator . next ( ) , org . hamcrest . core . Is . is ( 3 ) ) |
test_Fp16_Mmuli_1 ( ) { final org . nd4j . linalg . api . ndarray . INDArray activations = org . nd4j . linalg . factory . Nd4j . createUninitialized ( DataType . HALF , new long [ ] { 1 , 3 , 2 } , 'f' ) ; final org . nd4j . linalg . api . ndarray . INDArray z = activations . tensorAlongDimension ( 0 , 1 , 2 ) ; final org . nd4j . linalg . api . ndarray . INDArray a = org . nd4j . linalg . factory . Nd4j . rand ( DataType . HALF , 3 , 4 ) ; final org . nd4j . linalg . api . ndarray . INDArray b = org . nd4j . linalg . factory . Nd4j . rand ( DataType . HALF , 4 , 2 ) ; org . nd4j . linalg . api . ndarray . INDArray ab = a . mmul ( b ) ; a . mmul ( b , z ) ; "<AssertPlaceHolder>" ; } mmul ( org . nd4j . linalg . cpu . nativecpu . INDArray , org . nd4j . linalg . api . blas . params . MMulTranspose ) { return null ; } | org . junit . Assert . assertEquals ( ab , z ) |
testStartsWithExpressionNegative ( ) { org . odata4j . expression . BoolMethodExpression ex = org . odata4j . expression . Expression . startsWith ( org . odata4j . expression . Expression . string ( "ABCDE" ) , org . odata4j . expression . Expression . string ( "BC" ) ) ; boolean evaluate = org . odata4j . producer . inmemory . InMemoryEvaluation . evaluate ( ex , this , new org . odata4j . producer . inmemory . BeanBasedPropertyModel ( getClass ( ) ) ) ; "<AssertPlaceHolder>" ; } evaluate ( org . odata4j . expression . CommonExpression , java . lang . Object , org . odata4j . producer . inmemory . PropertyModel ) { if ( expression instanceof org . odata4j . expression . LiteralExpression ) return org . odata4j . expression . Expression . literalValue ( ( ( org . odata4j . expression . LiteralExpression ) ( expression ) ) ) ; if ( expression instanceof org . odata4j . expression . EntitySimpleProperty ) return properties . getPropertyValue ( target , ( ( org . odata4j . expression . EntitySimpleProperty ) ( expression ) ) . getPropertyName ( ) ) ; if ( expression instanceof org . odata4j . expression . BoolCommonExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . evaluate ( ( ( org . odata4j . expression . BoolCommonExpression ) ( expression ) ) , target , properties ) ; if ( expression instanceof org . odata4j . expression . AddExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . binaryFunction ( ( ( org . odata4j . expression . BinaryCommonExpression ) ( expression ) ) , target , properties , org . odata4j . producer . inmemory . InMemoryEvaluation . BinaryFunction . ADD ) ; if ( expression instanceof org . odata4j . expression . SubExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . binaryFunction ( ( ( org . odata4j . expression . BinaryCommonExpression ) ( expression ) ) , target , properties , org . odata4j . producer . inmemory . InMemoryEvaluation . BinaryFunction . SUB ) ; if ( expression instanceof org . odata4j . expression . MulExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . binaryFunction ( ( ( org . odata4j . expression . BinaryCommonExpression ) ( expression ) ) , target , properties , org . odata4j . producer . inmemory . InMemoryEvaluation . BinaryFunction . MUL ) ; if ( expression instanceof org . odata4j . expression . DivExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . binaryFunction ( ( ( org . odata4j . expression . BinaryCommonExpression ) ( expression ) ) , target , properties , org . odata4j . producer . inmemory . InMemoryEvaluation . BinaryFunction . DIV ) ; if ( expression instanceof org . odata4j . expression . ModExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . binaryFunction ( ( ( org . odata4j . expression . BinaryCommonExpression ) ( expression ) ) , target , properties , org . odata4j . producer . inmemory . InMemoryEvaluation . BinaryFunction . MOD ) ; if ( expression instanceof org . odata4j . expression . ParenExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . evaluate ( ( ( org . odata4j . expression . ParenExpression ) ( expression ) ) . getExpression ( ) , target , properties ) ; if ( expression instanceof org . odata4j . expression . BoolParenExpression ) return org . odata4j . producer . inmemory . InMemoryEvaluation . evaluate ( ( ( org . odata4j . expression . BoolParenExpression ) ( expression ) ) . getExpression ( ) , target , properties ) ; if ( expression instanceof org . odata4j . expression . CastExpression ) { org . odata4j . expression . CastExpression castExpression = ( ( org . odata4j . expression . CastExpression ) ( expression ) ) ; org . odata4j . edm . EdmSimpleType < ? > t = org . odata4j . edm . EdmType . getSimple ( castExpression . getType ( ) ) ; if ( t == null ) throw new java . lang . UnsupportedOperationException ( "Only<sp>simple<sp>types<sp>supported" ) ; java . lang . Class < ? > javaType = t . getJavaTypes ( ) . iterator ( ) . next ( ) ; return org . odata4j . internal . TypeConverter . convert ( org . odata4j . producer . inmemory . InMemoryEvaluation . evaluate ( castExpression . getExpression ( ) , target , properties ) , javaType ) ; } if ( expression instanceof org . odata4j . expression . ToLowerMethodCallExpression ) { org . odata4j . expression . ToLowerMethodCallExpression e = ( ( org . odata4j . expression . ToLowerMethodCallExpression ) ( expression ) ) ; java . lang . String value = org . odata4j . producer . inmemory . InMemoryEvaluation . evaluateToString ( e . getTarget ( ) , target , properties ) ; return value == null ? null : value . toLowerCase ( ) ; } if ( expression instanceof org . odata4j . expression . ToUpperMethodCallExpression ) { org . odata4j . expression . ToUpperMethodCallExpression e = ( ( org . odata4j . expression . ToUpperMethodCallExpression ) ( expression ) ) ; java . lang . String value = org . odata4j . producer . inmemory . InMemoryEvaluation . evaluateToString ( e . getTarget ( ) , target , properties ) ; return value == null ? null : value . toUpperCase ( ) ; } if ( expression instanceof org . odata4j . expression . SubstringMethodCallExpression ) { org . odata4j . expression . SubstringMethodCallExpression e = ( ( org . odata4j . expression . SubstringMethodCallExpression ) ( expression ) ) ; java . lang . String value = org . odata4j . producer . inmemory . InMemoryEvaluation . evaluateToString ( e . getTarget ( ) | org . junit . Assert . assertFalse ( evaluate ) |
xmlFileWellFormedNullPathFailTest ( ) { boolean wellFormed = org . pentaho . di . core . row . ValueDataUtil . isXMLFileWellFormed ( new org . pentaho . di . core . row . value . ValueMetaString ( ) , null , true ) ; "<AssertPlaceHolder>" ; } isXMLFileWellFormed ( org . pentaho . di . core . row . ValueMetaInterface , java . lang . Object , boolean ) { if ( dataA == null ) { return false ; } java . lang . String filename = dataA . toString ( ) ; org . apache . commons . vfs2 . FileObject file = null ; try { file = org . pentaho . di . core . vfs . KettleVFS . getFileObject ( filename ) ; org . pentaho . di . core . row . ValueDataUtil . throwsErrorOnFileNotFound ( file ) ; return org . pentaho . di . core . xml . XMLCheck . isXMLFileWellFormed ( file ) ; } catch ( org . pentaho . di . core . exception . KettleFileNotFoundException e ) { if ( failIfNoFile ) { throw e ; } org . pentaho . di . core . row . ValueDataUtil . log . debug ( e . getMessage ( ) ) ; } catch ( java . lang . Exception e ) { org . pentaho . di . core . row . ValueDataUtil . log . debug ( e . getMessage ( ) ) ; } finally { org . apache . commons . io . IOUtils . closeQuietly ( file ) ; } return false ; } | org . junit . Assert . assertFalse ( wellFormed ) |
testWriteException ( ) { try { throw new java . lang . RuntimeException ( ) ; } catch ( java . lang . Exception ex ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; ex . printStackTrace ( new java . io . PrintStream ( baos ) ) ; java . lang . String expected = ( ( "Exception:<sp>" + ( baos . toString ( ) ) ) + "<sp>END" ) + ( org . smpp . debug . DefaultEventTest . newLine ) ; event . write ( ex , "END" ) ; "<AssertPlaceHolder>" ; } } toString ( ) { java . lang . String s = super . toString ( ) ; if ( ( pdu ) != null ) { s += "\nPDU<sp>debug<sp>string:<sp>" + ( pdu . debugString ( ) ) ; } return s ; } | org . junit . Assert . assertEquals ( expected , out . toString ( ) ) |
testGoofyMonsterRange ( ) { org . calrissian . accumulorecipes . rangestore . impl . AccumuloRangeStore < java . lang . Long > rangeStore = new org . calrissian . accumulorecipes . rangestore . impl . AccumuloRangeStore < java . lang . Long > ( org . calrissian . accumulorecipes . rangestore . impl . AccumuloRangeStoreTest . getConnector ( ) , new org . calrissian . accumulorecipes . rangestore . helper . LongRangeHelper ( ) ) ; rangeStore . save ( singleton ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 5L , 10L ) ) ) ; rangeStore . save ( singleton ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 90L , 95L ) ) ) ; rangeStore . save ( singleton ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 2L , 98L ) ) ) ; rangeStore . save ( singleton ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 20L , 80L ) ) ) ; java . util . List < org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > > results = newArrayList ( rangeStore . query ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 49L , 51L ) , Auths . EMPTY ) ) ; "<AssertPlaceHolder>" ; org . calrissian . accumulorecipes . rangestore . impl . AccumuloRangeStoreTest . compareRanges ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 2L , 98L ) , results . get ( 0 ) ) ; org . calrissian . accumulorecipes . rangestore . impl . AccumuloRangeStoreTest . compareRanges ( new org . calrissian . accumulorecipes . rangestore . support . ValueRange < java . lang . Long > ( 20L , 80L ) , results . get ( 1 ) ) ; } query ( java . util . Set , org . calrissian . mango . criteria . domain . Node , org . calrissian . accumulorecipes . commons . domain . Auths ) { return query ( types , query , null , auths ) ; } | org . junit . Assert . assertEquals ( 2 , results . size ( ) ) |
testIsAccountNonLockedYes ( ) { context . checking ( new org . jmock . Expectations ( ) { { oneOf ( person ) . isAccountLocked ( ) ; will ( returnValue ( false ) ) ; } } ) ; org . eurekastreams . server . service . security . userdetails . ExtendedUserDetailsImpl sut = new org . eurekastreams . server . service . security . userdetails . ExtendedUserDetailsImpl ( person , null , null , null ) ; "<AssertPlaceHolder>" ; } isAccountNonLocked ( ) { return ! ( person . isAccountLocked ( ) ) ; } | org . junit . Assert . assertTrue ( sut . isAccountNonLocked ( ) ) |
toString1 ( ) { "<AssertPlaceHolder>" ; } toString ( boolean ) { org . apache . juneau . rest . Map < java . lang . String , java . lang . Object > m = null ; if ( sorted ) m = new org . apache . juneau . rest . TreeMap ( ) ; else m = new org . apache . juneau . rest . LinkedHashMap ( ) ; for ( Map . Entry < java . lang . String , java . lang . String [ ] > e : this . entrySet ( ) ) { java . lang . String [ ] v = e . getValue ( ) ; if ( v != null ) m . put ( e . getKey ( ) , ( ( v . length ) == 1 ? v [ 0 ] : v ) ) ; } return SimpleJsonSerializer . DEFAULT . toString ( m ) ; } | org . junit . Assert . assertEquals ( r , m . toString ( "foo" ) ) |
writeStartVCard_multiple_calls ( ) { java . io . StringWriter sw = new java . io . StringWriter ( ) ; ezvcard . io . json . JCardRawWriter writer = new ezvcard . io . json . JCardRawWriter ( sw , true ) ; writer . writeStartVCard ( ) ; writer . writeStartVCard ( ) ; writer . close ( ) ; java . lang . String actual = sw . toString ( ) ; java . lang . String expected = "[" + ( ( ( ( ( ( ( ( "[\"vcard\"," + "[" ) + "]" ) + "]," ) + "[\"vcard\"," ) + "[" ) + "]" ) + "]" ) + "]" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return value ; } | org . junit . Assert . assertEquals ( expected , actual ) |
test_toString ( ) { final java . util . Date expiration = new java . util . Date ( ) ; final java . text . SimpleDateFormat dateFormat = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) ; final java . lang . String date = dateFormat . format ( expiration ) ; com . alibaba . dcm . DnsCacheEntry entry1 = new com . alibaba . dcm . DnsCacheEntry ( "a.com" , new java . lang . String [ ] { "1.1.1.1" } , expiration ) ; com . alibaba . dcm . DnsCacheEntry entry2 = new com . alibaba . dcm . DnsCacheEntry ( "b.com" , new java . lang . String [ ] { "1.1.1.2" } , expiration ) ; com . alibaba . dcm . DnsCacheEntry entry3 = new com . alibaba . dcm . DnsCacheEntry ( "c.com" , new java . lang . String [ ] { "1.1.1.2" } , expiration ) ; com . alibaba . dcm . DnsCache dnsCache = new com . alibaba . dcm . DnsCache ( java . util . Arrays . asList ( entry1 , entry2 ) , java . util . Arrays . asList ( entry3 ) ) ; java . lang . String expected = java . lang . String . format ( ( "DnsCache{cache=[DnsCacheEntry{host='a.com',<sp>ips=[1.1.1.1],<sp>expiration=%s}" + ( ",<sp>DnsCacheEntry{host='b.com',<sp>ips=[1.1.1.2],<sp>expiration=%<s}]" + ",<sp>negativeCache=[DnsCacheEntry{host='c.com',<sp>ips=[1.1.1.2],<sp>expiration=%<s}]}" ) ) , date ) ; "<AssertPlaceHolder>" ; } toString ( ) { final java . text . SimpleDateFormat dateFormat = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) ; return ( ( ( ( ( ( ( "DnsCacheEntry{" + "host='" ) + ( host ) ) + '\'' ) + ",<sp>ips=" ) + ( java . util . Arrays . toString ( ips ) ) ) + ",<sp>expiration=" ) + ( dateFormat . format ( expiration ) ) ) + '}' ; } | org . junit . Assert . assertEquals ( expected , dnsCache . toString ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.