input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
longstream_iterate ( ) { java . util . List < java . lang . Long > numbers = java . util . stream . LongStream . iterate ( 0 , ( n ) -> n + 3 ) . limit ( 3 ) . boxed ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertThat ( numbers , contains ( new java . lang . Long ( 0 ) , new java . lang . Long ( 3 ) , new java . lang . Long ( 6 ) ) )
testIsReadableNode ( ) { org . powermock . api . mockito . PowerMockito . mockStatic ( org . silverpeas . core . sharing . model . EJBUtilitaire . class ) ; com . stratelia . webactiv . node . model . NodePK pk = new com . stratelia . webactiv . node . model . NodePK ( "10" , "kmelia10" ) ; com . stratelia . webactiv . node . control . NodeService nodeService = org . powermock . api . mockito . PowerMockito . mock ( com . stratelia . webactiv . node . control . NodeService . class ) ; java . util . Collection < com . stratelia . webactiv . node . model . NodePK > descendants = new java . util . ArrayList < com . stratelia . webactiv . node . model . NodePK > ( java . util . Arrays . asList ( new com . stratelia . webactiv . node . model . NodePK ( "100" , "kmelia10" ) , new com . stratelia . webactiv . node . model . NodePK ( "11" , "kmelia11" ) , new com . stratelia . webactiv . node . model . NodePK ( "12" , "kmelia12" ) ) ) ; org . powermock . api . mockito . PowerMockito . when ( nodeService . getDescendantPKs ( pk ) ) . thenReturn ( descendants ) ; com . stratelia . webactiv . node . model . NodeDetail nodeDetail = new com . stratelia . webactiv . node . model . NodeDetail ( ) ; nodeDetail . setNodePK ( pk ) ; final java . lang . String token = "965e985d-c711-47b3-a467-62779505965e985d-c711-47b3-a467-62779505" ; org . silverpeas . core . sharing . security . ShareableNode resource = new org . silverpeas . core . sharing . security . ShareableNode ( token , nodeDetail ) ; org . powermock . api . mockito . PowerMockito . mockStatic ( org . silverpeas . core . sharing . services . SharingServiceProvider . class ) ; org . powermock . api . mockito . PowerMockito . when ( org . silverpeas . core . sharing . services . SharingServiceProvider . getSharingTicketService ( ) ) . thenReturn ( new com . silverpeas . sharing . mock . NodeSharingTicketService ( token , pk ) ) ; org . silverpeas . core . sharing . model . NodeAccessControl instance = new org . silverpeas . core . sharing . model . NodeAccessControl ( ) ; boolean result = instance . isReadable ( resource ) ; "<AssertPlaceHolder>" ; } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( true ) )
testExecuteCommand ( ) { java . lang . Long id = 123L ; cern . c2mon . shared . client . request . ClientRequestImpl < cern . c2mon . shared . client . command . CommandReport > executeCommandRequest = new cern . c2mon . shared . client . request . ClientRequestImpl < cern . c2mon . shared . client . command . CommandReport > ( cern . c2mon . shared . client . command . CommandReport . class ) ; cern . c2mon . shared . client . command . CommandExecuteRequest < java . lang . Boolean > executeRequest = new cern . c2mon . shared . client . command . CommandExecuteRequestImpl < java . lang . Boolean > ( id , Boolean . TRUE , 1000 , "FRED" , "CIA" ) ; executeCommandRequest . setObjectParameter ( executeRequest ) ; java . util . Collection < cern . c2mon . shared . client . request . ClientRequestResult > response = new java . util . ArrayList ( ) ; response . add ( createCommandReport ( executeCommandRequest ) ) ; org . easymock . EasyMock . expect ( jmsProxy . sendRequest ( org . easymock . EasyMock . isA ( cern . c2mon . shared . client . request . JsonRequest . class ) , org . easymock . EasyMock . eq ( "c2mon.client.request" ) , org . easymock . EasyMock . eq ( 1000 ) ) ) . andReturn ( response ) ; org . easymock . EasyMock . replay ( jmsProxy ) ; cern . c2mon . shared . client . command . CommandReport report = requestHandlerImpl . executeCommand ( executeRequest ) ; org . easymock . EasyMock . verify ( jmsProxy ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( id , report . getId ( ) )
containsRowWithKeys_queryContainingWhereClauseAndExistingKeys_returnsTrue ( ) { com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQuery query = new com . vaadin . v7 . data . util . sqlcontainer . query . FreeformQuery ( "SELECT<sp>*<sp>FROM<sp>people<sp>WHERE<sp>\"NAME\"<sp>LIKE<sp>\'%lle\'" , java . util . Arrays . asList ( "ID" ) , connectionPool ) ; "<AssertPlaceHolder>" ; } containsRowWithKey ( java . lang . Object [ ] ) { java . util . List < com . vaadin . v7 . data . Container . Filter > filtersAndKeys = new java . util . ArrayList < com . vaadin . v7 . data . Container . Filter > ( ) ; if ( ( filters ) != null ) { filtersAndKeys . addAll ( filters ) ; } int ix = 0 ; for ( java . lang . String colName : primaryKeyColumns ) { filtersAndKeys . add ( new com . vaadin . v7 . data . util . filter . Compare . Equal ( colName , keys [ ix ] ) ) ; ix ++ ; } com . vaadin . v7 . data . util . sqlcontainer . query . generator . StatementHelper sh = sqlGenerator . generateSelectQuery ( getFullTableName ( ) , filtersAndKeys , orderBys , 0 , 0 , "*" ) ; boolean shouldCloseTransaction = false ; if ( ! ( isInTransaction ( ) ) ) { shouldCloseTransaction = true ; beginTransaction ( ) ; } java . sql . ResultSet rs = null ; try { rs = executeQuery ( sh ) ; boolean contains = rs . next ( ) ; return contains ; } finally { try { if ( rs != null ) { releaseConnection ( null , rs . getStatement ( ) , rs ) ; } } finally { if ( shouldCloseTransaction ) { commit ( ) ; } } } }
org . junit . Assert . assertTrue ( query . containsRowWithKey ( 1 ) )
shouldGetUntypedVariable ( ) { org . camunda . bpm . engine . runtime . ProcessInstance instance = runtimeService . startProcessInstanceByKey ( org . camunda . bpm . engine . test . api . variables . PrimitiveTypeValueSerializationTest . PROCESS_DEFINITION_KEY ) ; runtimeService . setVariable ( instance . getId ( ) , org . camunda . bpm . engine . test . api . variables . PrimitiveTypeValueSerializationTest . VARIABLE_NAME , typedValue ) ; java . lang . Object variableValue = runtimeService . getVariable ( instance . getId ( ) , org . camunda . bpm . engine . test . api . variables . PrimitiveTypeValueSerializationTest . VARIABLE_NAME ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return id ; }
org . junit . Assert . assertEquals ( typedValue . getValue ( ) , variableValue )
queryRemoveResource ( ) { org . xmldb . api . base . Resource resource = null ; org . xmldb . api . base . Collection testCollection = org . xmldb . api . DatabaseManager . getCollection ( ( ( ( ROOT_URI ) + "/" ) + ( org . exist . xmldb . ResourceTest . TEST_COLLECTION ) ) ) ; "<AssertPlaceHolder>" ; java . lang . String resourceName = "QueryTestPerson.xml" ; java . lang . String id = "XPathQueryService" 0 + ( java . lang . System . currentTimeMillis ( ) ) ; java . lang . String content = ( "<?xml<sp>version=\'1.0\'?><person<sp>id=\"" + id ) + "\"><name>Jason</name></person>" ; resource = testCollection . createResource ( resourceName , "XMLResource" ) ; resource . setContent ( content ) ; testCollection . storeResource ( resource ) ; org . xmldb . api . modules . XPathQueryService service = ( ( org . xmldb . api . modules . XPathQueryService ) ( testCollection . getService ( "XPathQueryService" , "1.0" ) ) ) ; org . xmldb . api . base . ResourceSet rs = service . query ( ( ( "/person[@id='" + id ) + "']" ) ) ; for ( org . xmldb . api . base . ResourceIterator iterator = rs . getIterator ( ) ; iterator . hasMoreResources ( ) ; ) { org . xmldb . api . base . Resource r = iterator . nextResource ( ) ; testCollection . removeResource ( r ) ; resource = null ; } } getCollection ( java . lang . String ) { return org . xmldb . api . DatabaseManager . getCollection ( ( ( properties . getProperty ( org . exist . client . InteractiveClient . URI ) ) + path ) , properties . getProperty ( org . exist . client . InteractiveClient . USER ) , properties . getProperty ( org . exist . client . InteractiveClient . PASSWORD ) ) ; }
org . junit . Assert . assertNotNull ( testCollection )
testDatatypeValue4 ( ) { java . lang . String init = "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," 2 + ( ( ( ( ( ( ( ( "<Jack><sp>" + "rdf:value<sp>" ) + "<sp>1,<sp>1.0,<sp>'1'^^xsd:long,<sp>1e0,<sp>'1'^^xsd:double,<sp>'1'^^xsd:float,<sp>" ) + "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," 4 ) + "'1'^^xsd:boolean,<sp>'0'^^xsd:boolean<sp>." ) + "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," ) + "'01'^^xsd:integer,<sp>'1'^^xsd:integer" ) + ",<sp>'1'^^xsd:short,<sp>'1'^^xsd:byte<sp>,<sp>'1'^^xsd:int,<sp>'01'^^xsd:byte,<sp>'1'^^xsd:byte" ) + "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," 0 ) ; java . lang . String q = "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," 3 + ( ( ( "<sp><Jim><sp>rdf:value<sp>false,<sp>'01'^^xsd:double,<sp>'1.0'^^xsd:float," 1 + "}" ) + "order<sp>by<sp>?x<sp>?v<sp>" ) + "values<sp>?v<sp>{<sp>1<sp>}" ) ; fr . inria . corese . core . Graph g = createGraph ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( g ) ; exec . query ( init ) ; fr . inria . corese . kgram . core . Mappings map = exec . query ( q ) ; "<AssertPlaceHolder>" ; } size ( ) { return tests . size ( ) ; }
org . junit . Assert . assertEquals ( 10 , map . size ( ) )
testDOMIdentityWS ( ) { itest . common . intf . ClientIntf client = itest . CrossContribTestCase . node . getService ( itest . common . intf . ClientIntf . class , "ClientSCA" ) ; "<AssertPlaceHolder>" ; client . testRoundTripDOMIdentity ( ) ; } getService ( java . lang . Class , java . lang . String ) { try { return ( ( B ) ( node . getClass ( ) . getMethod ( "getService" , java . lang . Class . class , java . lang . String . class ) . invoke ( node , businessInterface , serviceName ) ) ) ; } catch ( java . lang . Throwable e ) { org . apache . tuscany . sca . node . NodeFactory . NodeProxy . handleException ( e ) ; return null ; } }
org . junit . Assert . assertNotNull ( client )
testGetSet ( ) { java . lang . reflect . Field [ ] fields = com . j256 . ormlite . field . FieldTypeTest . GetSet . class . getDeclaredFields ( ) ; "<AssertPlaceHolder>" ; java . lang . reflect . Field idField = fields [ 0 ] ; com . j256 . ormlite . field . FieldType . createFieldType ( databaseType , com . j256 . ormlite . field . FieldTypeTest . GetSet . class . getSimpleName ( ) , idField , com . j256 . ormlite . field . FieldTypeTest . GetSet . class ) ; }
org . junit . Assert . assertTrue ( ( ( fields . length ) >= 1 ) )
receiveMessageWithData ( ) { final org . bonitasoft . engine . bpm . process . ProcessDefinition sendMessageProcess = deployAndEnableProcessWithEndMessageEvent ( "sendMessageProcess" , "m5" , "receiveMessageProcess" , "waitForMessage" , null , java . util . Collections . singletonMap ( "lastName" , java . lang . String . class . getName ( ) ) , java . util . Collections . singletonMap ( "lName" , java . lang . String . class . getName ( ) ) , java . util . Collections . singletonMap ( "lName" , "lastName" ) ) ; final java . util . List < org . bonitasoft . engine . operation . Operation > receiveMessageOperations = java . util . Collections . singletonList ( buildAssignOperation ( "name" , "lName" , java . lang . String . class . getName ( ) , ExpressionType . TYPE_VARIABLE ) ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition receiveMessageProcess = deployAndEnableProcessWithReceivedTask ( "receiveMessageProcess" , "waitForMessage" , "userTask1" , "delivery" , user , "m5" , null , java . util . Collections . singletonMap ( "name" , java . lang . String . class . getName ( ) ) , receiveMessageOperations ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance receiveMessageProcessInstance = getProcessAPI ( ) . startProcess ( receiveMessageProcess . getId ( ) ) ; waitForFlowNodeInState ( receiveMessageProcessInstance , "waitForMessage" , TestStates . WAITING , true ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance sendMessageProcessInstance = getProcessAPI ( ) . startProcess ( sendMessageProcess . getId ( ) , java . util . Arrays . asList ( buildAssignOperation ( "lastName" , "Doe" , java . lang . String . class . getName ( ) , ExpressionType . TYPE_CONSTANT ) ) , null ) ; waitForProcessToFinish ( sendMessageProcessInstance ) ; final org . bonitasoft . engine . bpm . flownode . HumanTaskInstance step1 = waitForUserTaskAndGetIt ( receiveMessageProcessInstance , "userTask1" ) ; final org . bonitasoft . engine . bpm . data . DataInstance dataInstance = getProcessAPI ( ) . getProcessDataInstance ( "name" , step1 . getRootContainerId ( ) ) ; "<AssertPlaceHolder>" ; disableAndDeleteProcess ( sendMessageProcess ) ; disableAndDeleteProcess ( receiveMessageProcess ) ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( "Doe" , dataInstance . getValue ( ) )
testReadAndWrite ( ) { de . mirkosertic . bytecoder . classlib . MemoryManager . initWithSize ( 100 ) ; de . mirkosertic . bytecoder . classlib . Address theAddress = new de . mirkosertic . bytecoder . classlib . Address ( 20 ) ; de . mirkosertic . bytecoder . classlib . Address . setIntValue ( theAddress , 5 , 10 ) ; int theStored = de . mirkosertic . bytecoder . classlib . Address . getIntValue ( theAddress , 5 ) ; "<AssertPlaceHolder>" ; } getIntValue ( de . mirkosertic . bytecoder . classlib . Address , int ) { return ( ( int ) ( MemoryManager . data [ ( ( aAddress . start ) + aIndex ) ] ) ) ; }
org . junit . Assert . assertEquals ( 10 , theStored , 0 )
testBinaryLast ( ) { System . out . println ( "binarySearch" ) ; int [ ] index = new int [ ] { 10 , 11 , 12 , 13 , 14 } ; int key = 14 ; int begin = 0 ; int end = 5 ; int expResult = 4 ; int result = org . genemania . engine . matricks . Utils . binarySearch ( index , key , begin , end ) ; "<AssertPlaceHolder>" ; } binarySearch ( int [ ] , int , int , int ) { end -- ; while ( begin <= end ) { int mid = ( end + begin ) > > 1 ; if ( ( index [ mid ] ) < key ) { begin = mid + 1 ; } else if ( ( index [ mid ] ) > key ) { end = mid - 1 ; } else { return mid ; } } return - 1 ; }
org . junit . Assert . assertEquals ( expResult , result )
validOcspTest01 ( ) { java . security . cert . X509Certificate caCert = ( ( java . security . cert . X509Certificate ) ( com . itextpdf . signatures . testutils . Pkcs12FileHelper . readFirstChain ( com . itextpdf . signatures . verify . OcspVerifierTest . caCertFileName , com . itextpdf . signatures . verify . OcspVerifierTest . password ) [ 0 ] ) ) ; java . security . PrivateKey caPrivateKey = com . itextpdf . signatures . testutils . Pkcs12FileHelper . readFirstKey ( com . itextpdf . signatures . verify . OcspVerifierTest . caCertFileName , com . itextpdf . signatures . verify . OcspVerifierTest . password , com . itextpdf . signatures . verify . OcspVerifierTest . password ) ; com . itextpdf . signatures . testutils . builder . TestOcspResponseBuilder builder = new com . itextpdf . signatures . testutils . builder . TestOcspResponseBuilder ( caCert , caPrivateKey ) ; "<AssertPlaceHolder>" ; } verifyTest ( com . itextpdf . signatures . testutils . builder . TestOcspResponseBuilder ) { return verifyTest ( rootRsaOcspBuilder , ( ( com . itextpdf . signatures . verify . OcspVerifierTest . certsSrc ) + "signCertRsa01.p12" ) , com . itextpdf . io . util . DateTimeUtil . getCurrentTimeDate ( ) ) ; }
org . junit . Assert . assertTrue ( verifyTest ( builder ) )
testParse1 ( ) { java . lang . String parse = "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" ; java . lang . String text = "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 6 ; org . cleartk . util . treebank . TopTreebankNode topNode = org . cleartk . util . treebank . TreebankFormatParser . parse ( parse , text , 0 ) ; "<AssertPlaceHolder>" ; java . util . List < org . cleartk . util . treebank . TreebankNode > children = topNode . getChildren ( ) ; testNode ( children . get ( 0 ) , "(" , "12" 7 , "(-LRB-<sp>-LRB-<sp>)" ) ; testNode ( children . get ( 1 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 4 , "ADVP" 1 , "NP" 6 ) ; testNode ( children . get ( 2 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 3 , "NP" 4 , "(-NONE-<sp>CD_)" 3 ) ; children = children . get ( 1 ) . getChildren ( ) ; testNode ( children . get ( 0 ) , "i.e." , "ADVP" , "ADVP" 3 ) ; testNode ( children . get ( 1 ) , "ADVP" 2 , "ADVP" 2 , "i.e." 7 ) ; testNode ( children . get ( 2 ) , "(-NONE-<sp>CD_)" 9 , "NP" , "NP" 0 ) ; org . cleartk . util . treebank . TreebankNode node1 = children . get ( 2 ) ; children = children . get ( 0 ) . getChildren ( ) ; testNode ( children . get ( 0 ) , "i.e." , "i.e." 5 , "NP" 7 ) ; children = node1 . getChildren ( ) ; testNode ( children . get ( 0 ) , "a<sp>residual<sp>of<sp>-116,000" , "NP" , "(-NONE-<sp>CD_)" 4 ) ; testNode ( children . get ( 1 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 2 , "12" 2 , "NP" 3 ) ; testNode ( children . get ( 2 ) , "NP" 5 , "ADVP" 1 , "12" 8 ) ; node1 = children . get ( 0 ) ; org . cleartk . util . treebank . TreebankNode node2 = children . get ( 2 ) ; children = node1 . getChildren ( ) ; testNode ( children . get ( 0 ) , "NP" 9 , "NP" , "i.e." 9 ) ; testNode ( children . get ( 1 ) , "NP" 1 , "i.e." 4 , "i.e." 3 ) ; children = children . get ( 0 ) . getChildren ( ) ; testNode ( children . get ( 0 ) , "12" 5 , "(-NONE-<sp>CD_)" 0 , "(-NONE-<sp>CD_)" 1 ) ; testNode ( children . get ( 1 ) , "i.e." 0 , "12" 1 , "12" 9 ) ; children = node1 . getChildren ( ) . get ( 1 ) . getChildren ( ) ; testNode ( children . get ( 0 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 9 , "(-NONE-<sp>CD_)" 8 , "i.e." 1 ) ; testNode ( children . get ( 1 ) , "NP" 8 , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 5 , "(-NONE-<sp>CD_)" ) ; testNode ( children . get ( 2 ) , "(-NONE-<sp>CD_)" 7 , "12" 3 , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 0 ) ; testNode ( children . get ( 3 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 7 , "NP" , "(-NONE-<sp>CD_)" 5 ) ; children = children . get ( 3 ) . getChildren ( ) ; testNode ( children . get ( 0 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 7 , "i.e." 6 , "12" 4 ) ; children = node2 . getChildren ( ) ; testNode ( children . get ( 0 ) , "12" 6 , "NP" , "(NP-SBJ<sp>(NN<sp>n<sp>))" ) ; testNode ( children . get ( 0 ) . getChildren ( ) . get ( 0 ) , "12" 6 , "12" 1 , "NP" 2 ) ; testNode ( children . get ( 1 ) , "(-NONE-<sp>CD_)" 6 , "12" 0 , "ADVP" 0 ) ; testNode ( children . get ( 1 ) . getChildren ( ) . get ( 0 ) , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 1 , "(PRN<sp>(-LRB-<sp>-LRB-<sp>)<sp>(S-ADV<sp>(ADVP<sp>(FW<sp>i.e.<sp>))<sp>(,<sp>,<sp>)<sp>(NP<sp>(NP<sp>(NP<sp>(DT<sp>a<sp>)<sp>(NN<sp>residual<sp>))<sp>(PP<sp>(IN<sp>of<sp>)<sp>(-NONE-<sp>CD_)<sp>(HYPH<sp>-<sp>)<sp>(NP<sp>(CD<sp>116,000<sp>))))<sp>(:<sp>;<sp>)<sp>(S<sp>(NP-SBJ<sp>(NN<sp>n<sp>))<sp>(VP<sp>(SYM<sp>=<sp>)<sp>(NP<sp>(CD<sp>12<sp>))))))<sp>(-RRB-<sp>-RRB-<sp>))" 8 , "i.e." 8 ) ; testNode ( children . get ( 1 ) . getChildren ( ) . get ( 1 ) , "12" , "NP" , "(-NONE-<sp>CD_)" 2 ) ; testNode ( children . get ( 1 ) . getChildren ( ) . get ( 1 ) . getChildren ( ) . get ( 0 ) , "12" , "i.e." 6 , "i.e." 2 ) ; } getText ( ) { return text ; }
org . junit . Assert . assertEquals ( text , topNode . getText ( ) )
sleep ( ) { com . netflix . hystrix . HystrixCommand . Setter setter = com . redhat . application . hystrix . HystrixConfiguration . Setter ( com . redhat . application . hystrix . SleepThreadCommand . class , "test" ) ; "<AssertPlaceHolder>" ; } Setter ( java . lang . Class , java . lang . String ) { com . redhat . application . hystrix . HystrixConfiguration config = com . redhat . application . hystrix . HystrixConfiguration . configs . get ( x ) ; if ( config == null ) { config = new com . redhat . application . hystrix . HystrixConfiguration ( x ) ; com . redhat . application . hystrix . HystrixConfiguration . configs . put ( x , config ) ; } return config . setter ( x , groupName ) ; }
org . junit . Assert . assertNotNull ( setter )
shouldNotBeAbleToReadFromDifferentThread ( ) { final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; final org . jboss . arquillian . impl . core . spi . context . SuiteContext context = new org . jboss . arquillian . impl . core . context . SuiteContextImpl ( ) ; try { context . activate ( ) ; context . getObjectStore ( ) . add ( java . lang . Object . class , new java . lang . Object ( ) ) ; java . lang . Thread thread = new java . lang . Thread ( ) { public void run ( ) { "<AssertPlaceHolder>" ; latch . countDown ( ) ; } } ; thread . start ( ) ; if ( ! ( latch . await ( 1 , TimeUnit . SECONDS ) ) ) { org . junit . Assert . fail ( "Thread<sp>never<sp>called?" ) ; } } finally { context . deactivate ( ) ; context . destroy ( ) ; } } isActive ( ) { return ( activeStore . get ( ) ) != null ; }
org . junit . Assert . assertFalse ( context . isActive ( ) )
test3x1 ( ) { java . util . List < java . util . List < java . lang . Integer > > matrix = java . util . Arrays . asList ( java . util . Arrays . asList ( 1 , 2 , 3 ) ) ; final java . lang . Iterable < java . util . List < java . lang . Integer > > crossProductStream = org . qcri . rheem . core . util . RheemCollections . streamedCrossProduct ( matrix ) ; final java . util . List < java . util . List < java . lang . Integer > > crossProduct = java . util . stream . StreamSupport . stream ( crossProductStream . spliterator ( ) , false ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < java . util . List < java . lang . Integer > > expectedCrossProduct = java . util . Arrays . asList ( java . util . Arrays . asList ( 1 ) , java . util . Arrays . asList ( 2 ) , java . util . Arrays . asList ( 3 ) ) ; "<AssertPlaceHolder>" ; } asList ( long [ ] ) { return java . util . Arrays . stream ( values ) . mapToObj ( Long :: valueOf ) . collect ( java . util . stream . Collectors . toList ( ) ) ; }
org . junit . Assert . assertEquals ( expectedCrossProduct , crossProduct )
testListValueWithNull ( ) { java . util . List < java . lang . Void > l = com . googlecode . jslint4java . Util . listValue ( "foo" , scope , new com . googlecode . jslint4java . Util . Converter < java . lang . Void > ( ) { public com . googlecode . jslint4java . Void convert ( java . lang . Object obj ) { return null ; } } ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . Object ) { org . mozilla . javascript . Scriptable scope = ( ( org . mozilla . javascript . Scriptable ) ( obj ) ) ; java . lang . String name = com . googlecode . jslint4java . Util . stringValue ( "name" , scope ) ; int line = com . googlecode . jslint4java . Util . intValue ( "line" , scope ) ; com . googlecode . jslint4java . JSFunction . Builder b = new com . googlecode . jslint4java . JSFunction . Builder ( name , line ) ; b . last ( com . googlecode . jslint4java . Util . intValue ( "last" , scope ) ) ; for ( java . lang . String param : com . googlecode . jslint4java . Util . listValueOfType ( "parameter" , java . lang . String . class , scope ) ) { b . addParam ( param ) ; } for ( java . lang . String closure : com . googlecode . jslint4java . Util . listValueOfType ( "var" 0 , java . lang . String . class , scope ) ) { b . addClosure ( closure ) ; } for ( java . lang . String var : com . googlecode . jslint4java . Util . listValueOfType ( "var" , java . lang . String . class , scope ) ) { b . addVar ( var ) ; } for ( java . lang . String exception : com . googlecode . jslint4java . Util . listValueOfType ( "exception" , java . lang . String . class , scope ) ) { b . addException ( exception ) ; } for ( java . lang . String outer : com . googlecode . jslint4java . Util . listValueOfType ( "outer" , java . lang . String . class , scope ) ) { b . addOuter ( outer ) ; } for ( java . lang . String unused : com . googlecode . jslint4java . Util . listValueOfType ( "unused" , java . lang . String . class , scope ) ) { b . addUnused ( unused ) ; } for ( java . lang . String global : com . googlecode . jslint4java . Util . listValueOfType ( "global" , java . lang . String . class , scope ) ) { b . addGlobal ( global ) ; } for ( java . lang . String label : com . googlecode . jslint4java . Util . listValueOfType ( "label" , java . lang . String . class , scope ) ) { b . addLabel ( label ) ; } return b . build ( ) ; }
org . junit . Assert . assertThat ( l , org . hamcrest . Matchers . empty ( ) )
instanceOf_type_isValid ( ) { final java . lang . Object id = 12376L ; final java . lang . Long result = net . sf . qualitycheck . Check . instanceOf ( net . sf . qualitycheck . Long . class , id ) ; "<AssertPlaceHolder>" ; } instanceOf ( java . lang . Class , java . lang . Object ) { return ( ( T ) ( net . sf . qualitycheck . Check . instanceOf ( type , obj , net . sf . qualitycheck . Check . EMPTY_ARGUMENT_NAME ) ) ) ; }
org . junit . Assert . assertEquals ( id , result )
testNoFieldConstructor ( ) { org . cytoscape . work . BasicTunableHandlerFactory < org . cytoscape . work . TunableHandler > thf = new org . cytoscape . work . BasicTunableHandlerFactory ( org . cytoscape . work . NoFieldTunableHandler . class , int . class ) ; org . cytoscape . work . TunableHandler th = thf . createTunableHandler ( getField ( ) , source , getFieldTunable ( ) ) ; "<AssertPlaceHolder>" ; } getFieldTunable ( ) { try { return getField ( ) . getAnnotation ( org . cytoscape . work . Tunable . class ) ; } catch ( java . lang . Exception e ) { return null ; } }
org . junit . Assert . assertNull ( th )
shouldDeserialiseNewHllpWithOffers ( ) { final java . lang . String sketchAsString = "{\"p\":<sp>5,<sp>\"sp\":<sp>5,<sp>\"offers\":<sp>[\"value1\",<sp>\"value2\",<sp>\"value2\",<sp>\"value2\",<sp>\"value3\"]}" ; com . clearspring . analytics . stream . cardinality . HyperLogLogPlus hllp = uk . gov . gchq . gaffer . jsonserialisation . JSONSerialiser . deserialise ( sketchAsString , com . clearspring . analytics . stream . cardinality . HyperLogLogPlus . class ) ; com . clearspring . analytics . stream . cardinality . HyperLogLogPlus expected = new com . clearspring . analytics . stream . cardinality . HyperLogLogPlus ( 5 , 5 ) ; expected . offer ( "value1" ) ; expected . offer ( "value2" ) ; expected . offer ( "value2" ) ; expected . offer ( "value2" ) ; expected . offer ( "value3" ) ; "<AssertPlaceHolder>" ; } getBytes ( ) { return bytes ; }
org . junit . Assert . assertArrayEquals ( expected . getBytes ( ) , hllp . getBytes ( ) )
setMeasurand_voltage_measurandIsSet ( ) { java . lang . String measurand = "Voltage" ; sampledValue . setMeasurand ( measurand ) ; "<AssertPlaceHolder>" ; } getMeasurand ( ) { return measurand ; }
org . junit . Assert . assertThat ( sampledValue . getMeasurand ( ) , org . hamcrest . CoreMatchers . equalTo ( measurand ) )
testRemove ( ) { com . liferay . portal . workflow . kaleo . model . KaleoDefinition newKaleoDefinition = addKaleoDefinition ( ) ; _persistence . remove ( newKaleoDefinition ) ; com . liferay . portal . workflow . kaleo . model . KaleoDefinition existingKaleoDefinition = _persistence . fetchByPrimaryKey ( newKaleoDefinition . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertNull ( existingKaleoDefinition )
testColors ( ) { for ( net . tridentsdk . ui . bossbar . BossBarColor color : net . tridentsdk . ui . bossbar . BossBarColor . values ( ) ) { "<AssertPlaceHolder>" ; } } of ( int ) { for ( net . tridentsdk . ui . bossbar . BossBarColor c : net . tridentsdk . ui . bossbar . BossBarColor . values ( ) ) if ( ( c . id ) == id ) return c ; throw new java . lang . IllegalArgumentException ( ( "no<sp>boss<sp>bar<sp>color<sp>with<sp>id<sp>=<sp>" + id ) ) ; }
org . junit . Assert . assertEquals ( color , net . tridentsdk . ui . bossbar . BossBarColor . of ( color . getId ( ) ) )
testTemplateRenderWithConfigurationVariables ( ) { final java . lang . String TEMPLATE = "foo<sp>bar\n<sp>myVariable:<sp>${user.myVariable}\n" ; final java . lang . String TEMPLATE_RENDERED = "foo<sp>bar\n<sp>myVariable:<sp>content<sp>of<sp>myVariable\n" ; configuration = buildTestConfig ( TEMPLATE ) ; this . configurationService . save ( configuration ) ; org . graylog . plugins . sidecar . rest . models . ConfigurationVariable myVariable = org . graylog . plugins . sidecar . rest . models . ConfigurationVariable . create ( "myVariable" , "desc" , "content<sp>of<sp>myVariable" ) ; this . configurationVariableService . save ( myVariable ) ; org . graylog . plugins . sidecar . rest . models . Configuration result = this . configurationService . renderConfigurationForCollector ( sidecar , configuration ) ; "<AssertPlaceHolder>" ; } renderConfigurationForCollector ( org . graylog . plugins . sidecar . rest . models . Sidecar , org . graylog . plugins . sidecar . rest . models . Configuration ) { java . util . Map < java . lang . String , java . lang . Object > context = new java . util . HashMap ( ) ; context . put ( "nodeId" , sidecar . nodeId ( ) ) ; context . put ( "nodeName" , sidecar . nodeName ( ) ) ; context . put ( "sidecarVersion" , sidecar . sidecarVersion ( ) ) ; context . put ( "operatingSystem" , sidecar . nodeDetails ( ) . operatingSystem ( ) ) ; return org . graylog . plugins . sidecar . rest . models . Configuration . create ( configuration . id ( ) , configuration . collectorId ( ) , configuration . name ( ) , configuration . color ( ) , renderTemplate ( configuration . id ( ) , context ) ) ; }
org . junit . Assert . assertEquals ( TEMPLATE_RENDERED , result . template ( ) )
testRule ( ) { waitTillSSMExitSafeMode ( ) ; java . lang . String rule = "file:<sp>path<sp>matches<sp>\"/test/small_files/file*\"<sp>and<sp>length<sp><<sp>20KB" + "<sp>|<sp>compact<sp>-containerFile<sp>\"/test/small_files/container_file_1\"" ; org . smartdata . admin . SmartAdmin admin = new org . smartdata . admin . SmartAdmin ( smartContext . getConf ( ) ) ; admin . submitRule ( rule , RuleState . ACTIVE ) ; java . lang . Thread . sleep ( 6000 ) ; java . util . List < org . smartdata . model . RuleInfo > ruleInfoList = admin . listRulesInfo ( ) ; for ( org . smartdata . model . RuleInfo info : ruleInfoList ) { System . out . println ( info ) ; } "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , ruleInfoList . size ( ) )
isArray ( ) { "<AssertPlaceHolder>" ; } isArray ( ) { return false ; }
org . junit . Assert . assertTrue ( array . isArray ( ) )
testEncodeAndDecodeRandomDataWithoutPadding ( ) { org . kocakosm . pitaya . util . BaseEncoding e = BaseEncoding . BASE_64 . withoutPadding ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { byte [ ] bytes = new byte [ org . kocakosm . pitaya . util . Base64Test . RND . nextInt ( 2049 ) ] ; org . kocakosm . pitaya . util . Base64Test . RND . nextBytes ( bytes ) ; "<AssertPlaceHolder>" ; } } decode ( java . lang . String ) { java . lang . String encoded = ( ( n ) > 0 ) ? in . replace ( separator , "" ) : in ; org . kocakosm . pitaya . util . ByteBuffer buf = new org . kocakosm . pitaya . util . ByteBuffer ( maxDecodedLength ( encoded . length ( ) ) ) ; int accu = 0 ; int count = 0 ; int decoded = 0 ; for ( int i = 0 ; i < ( encoded . length ( ) ) ; i ++ ) { char c = encoded . charAt ( i ) ; if ( ( isPaddingChar ( c ) ) && ( ! ( omitPadding ) ) ) { break ; } int v = decode ( c ) ; if ( v != ( - 1 ) ) { decoded ++ ; accu = ( accu << ( alphabet . bitsPerChar ( ) ) ) | v ; count += alphabet . bitsPerChar ( ) ; while ( count >= 8 ) { count -= 8 ; buf . append ( ( ( byte ) ( accu > > > count ) ) ) ; } } } if ( ( ! ( omitPadding ) ) || ( ! ( alphabet . requiresPadding ( ) ) ) ) { decoded += getPaddingLength ( encoded ) ; int blockSize = alphabet . charsPerBlock ( ) ; org . kocakosm . pitaya . util . Parameters . checkCondition ( ( ( decoded % blockSize ) == 0 ) ) ; } return buf . toByteArray ( ) ; }
org . junit . Assert . assertArrayEquals ( bytes , e . decode ( e . encode ( bytes ) ) )
testLoop ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( "options<sp>{output=AST;}\n" + "a<sp>:<sp>ID+<sp>INT+<sp>-><sp>(^(ID<sp>INT))+<sp>;\n" ) + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" ) + "a" 1 ) + "a" 2 ) ; java . lang . String treeGrammar = "a" 0 + ( ( "options<sp>{output=AST;<sp>ASTLabelType=CommonTree;<sp>tokenVocab=T;}\n" + "a" 7 ) + "<sp>;\n" ) ; java . lang . String found = execTreeParser ( "a" 5 , grammar , "TParser" , "a" 4 , treeGrammar , "TP" , "a" 3 , "a" , "a" , "a<sp>b<sp>c<sp>3<sp>4<sp>5" ) ; "<AssertPlaceHolder>" ; } execTreeParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { return execTreeParser ( parserGrammarFileName , parserGrammarStr , parserName , treeParserGrammarFileName , treeParserGrammarStr , treeParserName , lexerName , parserStartRuleName , treeParserStartRuleName , input , false ) ; }
org . junit . Assert . assertEquals ( "a" 6 , found )
testLocalInvocation ( ) { try { i5 . las2peer . p2p . LocalNode node = manager . newNode ( ) ; i5 . las2peer . security . UserAgentImpl eve = i5 . las2peer . testing . MockAgentFactory . getEve ( ) ; eve . unlock ( "evespass" ) ; node . storeAgent ( eve ) ; node . launch ( ) ; i5 . las2peer . security . ServiceAgentImpl testServiceAgent = node . startService ( i5 . las2peer . api . p2p . ServiceNameVersion . fromString ( "i5.las2peer.api.TestService@1.0" ) , "a<sp>pass" ) ; java . lang . Object result = node . invokeLocally ( eve , testServiceAgent , "inc" , new java . io . Serializable [ ] { new java . lang . Integer ( 10 ) } ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . toString ( ) ) ; } } fromString ( java . lang . String ) { java . lang . String [ ] a = nameVersion . split ( i5 . las2peer . api . p2p . ServiceNameVersion . SEPERATOR ) ; if ( ( a . length ) > 1 ) { return new i5 . las2peer . api . p2p . ServiceNameVersion ( a [ 0 ] , a [ 1 ] ) ; } else { return new i5 . las2peer . api . p2p . ServiceNameVersion ( a [ 0 ] , "*" ) ; } }
org . junit . Assert . assertEquals ( 12 , result )
testCompareZoekPersoon ( ) { final nl . bzk . brp . domain . berichtmodel . BijgehoudenPersoon bijgehoudenPersoon1 = bouwPersoonMetBsn ( "987654321" ) ; final nl . bzk . brp . domain . berichtmodel . BijgehoudenPersoon bijgehoudenPersoon2 = bouwPersoonMetBsn ( "123456789" ) ; final int compare = ZoekPersoonComparator . INSTANCE . compare ( bijgehoudenPersoon1 , bijgehoudenPersoon2 ) ; "<AssertPlaceHolder>" ; } compare ( nl . bzk . brp . domain . berichtmodel . BijgehoudenPersoon , nl . bzk . brp . domain . berichtmodel . BijgehoudenPersoon ) { final java . lang . String bsn1 = geefBurgerServiceNummer ( bijgehoudenPersoon1 ) ; final java . lang . String bsn2 = geefBurgerServiceNummer ( bijgehoudenPersoon2 ) ; return bsn1 . compareTo ( bsn2 ) ; }
org . junit . Assert . assertTrue ( ( compare > 0 ) )
testValidateRequestMandatoryNoRESTCall ( ) { com . streamsets . lib . security . http . SSOService ssoService = org . mockito . Mockito . mock ( com . streamsets . lib . security . http . SSOService . class ) ; com . streamsets . lib . security . http . SSOAppAuthenticator authenticator = org . mockito . Mockito . spy ( new com . streamsets . lib . security . http . SSOAppAuthenticator ( ssoService ) ) ; javax . servlet . http . HttpServletRequest req = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletRequest . class ) ; javax . servlet . http . HttpServletResponse res = org . mockito . Mockito . mock ( javax . servlet . http . HttpServletResponse . class ) ; org . mockito . Mockito . when ( req . getHeader ( org . mockito . Mockito . eq ( SSOConstants . X_APP_COMPONENT_ID ) ) ) . thenReturn ( "componentId" ) ; org . mockito . Mockito . when ( req . getHeader ( org . mockito . Mockito . eq ( SSOConstants . X_REST_CALL ) ) ) . thenReturn ( null ) ; org . mockito . Mockito . doReturn ( Authentication . SEND_FAILURE ) . when ( authenticator ) . returnUnauthorized ( org . mockito . Mockito . eq ( req ) , org . mockito . Mockito . eq ( res ) , org . mockito . Mockito . eq ( "componentId" ) , org . mockito . Mockito . anyString ( ) ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( authenticator ) . returnUnauthorized ( org . mockito . Mockito . eq ( req ) , org . mockito . Mockito . eq ( res ) , org . mockito . Mockito . eq ( "componentId" ) , org . mockito . Mockito . anyString ( ) ) ; } validateRequest ( javax . servlet . ServletRequest , javax . servlet . ServletResponse , boolean ) { javax . servlet . http . HttpServletRequest request = ( ( javax . servlet . http . HttpServletRequest ) ( req ) ) ; javax . servlet . http . HttpServletResponse response = ( ( javax . servlet . http . HttpServletResponse ) ( res ) ) ; javax . servlet . http . HttpSession session = request . getSession ( true ) ; org . eclipse . jetty . server . Authentication authentication = ( ( org . eclipse . jetty . server . Authentication ) ( session . getAttribute ( SessionAuthentication . __J_AUTHENTICATED ) ) ) ; if ( "OPTIONS" . equals ( request . getMethod ( ) ) ) { response . setHeader ( "Access-Control-Allow-Origin" , conf . get ( CORSConstants . HTTP_ACCESS_CONTROL_ALLOW_ORIGIN , CORSConstants . HTTP_ACCESS_CONTROL_ALLOW_ORIGIN_DEFAULT ) ) ; response . setHeader ( "Access-Control-Allow-Headers" , conf . get ( CORSConstants . HTTP_ACCESS_CONTROL_ALLOW_HEADERS , CORSConstants . HTTP_ACCESS_CONTROL_ALLOW_HEADERS_DEFAULT ) ) ; response . setHeader ( "Access-Control-Allow-Methods" , conf . get ( CORSConstants . HTTP_ACCESS_CONTROL_ALLOW_METHODS , CORSConstants . HTTP_ACCESS_CONTROL_ALLOW_METHODS_DEFAULT ) ) ; return org . eclipse . jetty . server . Authentication . SEND_SUCCESS ; } if ( authentication == null ) { java . lang . String authToken = request . getHeader ( com . streamsets . datacollector . http . ProxyAuthenticator . AUTH_TOKEN ) ; java . lang . String authUser = request . getHeader ( com . streamsets . datacollector . http . ProxyAuthenticator . AUTH_USER ) ; if ( authToken == null ) { authToken = request . getParameter ( com . streamsets . datacollector . http . ProxyAuthenticator . AUTH_TOKEN ) ; authUser = request . getParameter ( com . streamsets . datacollector . http . ProxyAuthenticator . AUTH_USER ) ; if ( authUser == null ) { authUser = com . streamsets . datacollector . http . ProxyAuthenticator . TOKEN_AUTHENTICATION_USER_NAME ; } } if ( ( authToken != null ) && ( runtimeInfo . isValidAuthenticationToken ( authToken ) ) ) { com . streamsets . datacollector . http . SdcHashLoginService loginService = ( ( com . streamsets . datacollector . http . SdcHashLoginService ) ( getLoginService ( ) ) ) ; org . eclipse . jetty . server . UserIdentity userIdentity = loginService . getUserIdentity ( authUser ) ; org . eclipse . jetty . server . Authentication cached = new org . eclipse . jetty . security . authentication . SessionAuthentication ( getAuthMethod ( ) , userIdentity , null ) ; session . setAttribute ( SessionAuthentication . __J_AUTHENTICATED , cached ) ; } if ( ( this . authenticator ) instanceof org . eclipse . jetty . security . authentication . FormAuthenticator ) { java . lang . String credentials = request . getHeader ( HttpHeader . AUTHORIZATION . asString ( ) ) ; if ( credentials != null ) { int space = credentials . indexOf ( '<sp>' ) ; if ( space > 0 ) { java . lang . String method = credentials . substring ( 0 , space ) ; if ( "basic" . equalsIgnoreCase ( method ) ) { credentials = credentials . substring ( ( space + 1 ) ) ; credentials = org . eclipse . jetty . util . B64Code . decode ( credentials , StandardCharsets . ISO_8859_1 ) ; int i = credentials . indexOf ( ':' ) ; if ( i > 0 ) { java . lang . String username = credentials . substring ( 0 , i ) ; java . lang . String password = credentials . substring ( ( i + 1 ) ) ; org . eclipse . jetty . server . UserIdentity userIdentity = login ( username , password , request ) ; if ( userIdentity != null ) { if ( ( session . getAttribute ( SessionAuthentication . __J_AUTHENTICATED ) ) == null ) { org . eclipse . jetty . server . Authentication cached = new org . eclipse . jetty . security . authentication
org . junit . Assert . assertEquals ( Authentication . SEND_FAILURE , authenticator . validateRequest ( req , res , true ) )
getWorkingServerName_A$SchedulerConfig$String ( ) { com . github . seratch . taskun . scheduler . config . TaskunConfig config = new com . github . seratch . taskun . scheduler . config . TaskunConfig ( ) ; java . lang . String actual = com . github . seratch . taskun . scheduler . CurrentServer . getServerName ( config ) ; "<AssertPlaceHolder>" ; } getServerName ( com . github . seratch . taskun . scheduler . config . TaskunConfig ) { if ( config != null ) { java . util . Map < java . lang . String , java . lang . String > servers = config . namedServers ; java . util . Set < java . lang . String > names = servers . keySet ( ) ; for ( java . lang . String name : names ) { if ( com . github . seratch . taskun . scheduler . CurrentServer . getHostname ( ) . matches ( servers . get ( name ) ) ) { return name ; } } } return com . github . seratch . taskun . scheduler . CurrentServer . getHostname ( ) ; }
org . junit . Assert . assertNotNull ( actual )
testBasic ( ) { java . lang . String input = "\r\n" + ( ( ( ( ( ( ( ( ( ( ( "\r\n" + "<table<sp>border=\"1\"<sp>cellpadding=\"1\"<sp>cellspacing=\"1\"\r\n" 0 ) + "\r\n" 2 ) + "<sp><tr<sp>class=\"title<sp>status_passed\"><td><b>Test<sp>Suite</b></td></tr>\r\n" ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"./TestQuickOpen.html\"\r\n" 1 ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"./TestQuickOpen.html\"\r\n" 1 ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"./TestQuickOpen.html\"\r\n" 1 ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"./TestQuickOpen.html\"\r\n" 1 ) + "<sp></tbody>\r\n" ) + "<sp></table>\r\n" ) + "\r\n" ) + "" ) ; org . openqa . selenium . server . htmlrunner . HTMLSuiteResult hsr = new org . openqa . selenium . server . htmlrunner . HTMLSuiteResult ( input ) ; java . lang . String expected = "\r\n" + ( ( ( ( ( ( ( ( ( ( ( "\r\n" + "<table<sp>border=\"1\"<sp>cellpadding=\"1\"<sp>cellspacing=\"1\"\r\n" 0 ) + "\r\n" 2 ) + "<sp><tr<sp>class=\"title<sp>status_passed\"><td><b>Test<sp>Suite</b></td></tr>\r\n" ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"#testresult0\"\r\n" 1 ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"#testresult1\"\r\n" 1 ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"#testresult2\"\r\n" 1 ) + "<sp><tr<sp>class=\"status_passed\"><td><a<sp>href=\"#testresult3\"\r\n" 1 ) + "<sp></tbody>\r\n" ) + "<sp></table>\r\n" ) + "\r\n" ) + "" ) ; "<AssertPlaceHolder>" ; } getUpdatedSuite ( ) { return this . updatedSuite ; }
org . junit . Assert . assertEquals ( expected , hsr . getUpdatedSuite ( ) )
getDiskImageId ( ) { org . apache . commons . configuration . HierarchicalConfiguration configuration = mock ( org . apache . commons . configuration . HierarchicalConfiguration . class ) ; when ( configuration . getString ( eq ( "diskimageId" ) ) ) . thenReturn ( org . oscm . app . ror . RORDiskImageTest . DISKIMAGEID ) ; rorDiskImage = new org . oscm . app . ror . data . RORDiskImage ( configuration ) ; java . lang . String result = rorDiskImage . getDiskImageId ( ) ; "<AssertPlaceHolder>" ; } getDiskImageId ( ) { return props . getValidatedProperty ( org . oscm . app . iaas . PropertyHandler . DISKIMG_ID ) ; }
org . junit . Assert . assertEquals ( result , org . oscm . app . ror . RORDiskImageTest . DISKIMAGEID )
getEndCellReference ( ) { org . apache . poi . xssf . usermodel . XSSFWorkbook wb = org . apache . poi . xssf . XSSFTestDataSamples . openSampleWorkbook ( "StructuredReferences.xlsx" ) ; org . apache . poi . xssf . usermodel . XSSFTable table = wb . getTable ( "\\_Prime.1" ) ; "<AssertPlaceHolder>" ; wb . close ( ) ; } getEndCellReference ( ) { org . apache . poi . xssf . usermodel . XSSFWorkbook wb = org . apache . poi . xssf . XSSFTestDataSamples . openSampleWorkbook ( "StructuredReferences.xlsx" ) ; org . apache . poi . xssf . usermodel . XSSFTable table = wb . getTable ( "\\_Prime.1" ) ; org . junit . Assert . assertEquals ( new org . apache . poi . ss . util . CellReference ( "C7" ) , table . getEndCellReference ( ) ) ; wb . close ( ) ; }
org . junit . Assert . assertEquals ( new org . apache . poi . ss . util . CellReference ( "C7" ) , table . getEndCellReference ( ) )
testPgEventProducerStart ( ) { when ( endpoint . getDatasource ( ) ) . thenReturn ( dataSource ) ; when ( dataSource . getConnection ( ) ) . thenReturn ( connection ) ; org . apache . camel . component . pgevent . PgEventProducer producer = new org . apache . camel . component . pgevent . PgEventProducer ( endpoint ) ; producer . start ( ) ; "<AssertPlaceHolder>" ; } isStarted ( ) { return ( startPos ) >= 0 ; }
org . junit . Assert . assertTrue ( producer . isStarted ( ) )
testHasNextSafe2 ( ) { com . googlecode . javaewah . EWAHCompressedBitmap bitmap = new com . googlecode . javaewah . EWAHCompressedBitmap ( ) ; bitmap . set ( 0 ) ; com . googlecode . javaewah . IntIterator it = bitmap . intIterator ( ) ; "<AssertPlaceHolder>" ; } next ( ) { return bitmaps [ ( ( k ) ++ ) ] ; }
org . junit . Assert . assertEquals ( 0 , it . next ( ) )
shouldFailWebSocketConnectionWhenServerSendCloseFrameWithRsv1 ( ) { final org . apache . mina . core . service . IoHandler handler = context . mock ( org . apache . mina . core . service . IoHandler . class ) ; context . checking ( new org . jmock . Expectations ( ) { { oneOf ( handler ) . sessionCreated ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionOpened ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionClosed ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; atMost ( 1 ) . of ( handler ) . exceptionCaught ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) , with ( org . hamcrest . core . AllOf . allOf ( any ( java . io . IOException . class ) , org . junit . internal . matchers . ThrowableMessageMatcher . hasMessage ( equal ( LoggingUtils . EARLY_TERMINATION_OF_IOSESSION_MESSAGE ) ) ) ) ) ; } } ) ; org . apache . mina . core . future . ConnectFuture connectFuture = connector . connect ( "ws://localhost:8080/echo" , null , handler ) ; connectFuture . awaitUninterruptibly ( ) ; "<AssertPlaceHolder>" ; k3po . finish ( ) ; } isConnected ( ) { return channel . isConnected ( ) ; }
org . junit . Assert . assertTrue ( connectFuture . isConnected ( ) )
test_search_boolean_and_terms ( ) { java . lang . String query = "Select<sp>name,address<sp>from<sp>'/path/to/index/'<sp>where<sp>first_name='beth'<sp>and<sp>last_name='bejeck'" ; bbejeck . sql . lucene . BooleanQuery booleanQuery = bbejeck . sql . antlr . LuceneQueryParser . parseQuery ( query ) . getBooleanQuery ( ) ; bbejeck . sql . lucene . ScoreDoc [ ] scoreDocs = search ( booleanQuery , 100 ) ; "<AssertPlaceHolder>" ; } search ( org . apache . lucene . search . Query , int ) { if ( ( ireader ) == null ) { openSearcher ( ) ; } return isearcher . search ( query , limit ) . scoreDocs ; }
org . junit . Assert . assertThat ( scoreDocs . length , org . hamcrest . CoreMatchers . is ( 1 ) )
testCreateSettingsPanel ( ) { System . out . println ( "createSettingsPanel" ) ; kg . apc . jmeter . vizualizers . SynthesisReportGui instance = new kg . apc . jmeter . vizualizers . SynthesisReportGui ( ) ; kg . apc . jmeter . vizualizers . JSettingsPanel result = instance . createSettingsPanel ( ) ; "<AssertPlaceHolder>" ; } createSettingsPanel ( ) { return new kg . apc . jmeter . vizualizers . JSettingsPanel ( this , ( ( ( ( ( ( ( JSettingsPanel . TIMELINE_OPTION ) | ( JSettingsPanel . GRADIENT_OPTION ) ) | ( JSettingsPanel . FINAL_ZEROING_OPTION ) ) | ( JSettingsPanel . LIMIT_POINT_OPTION ) ) | ( JSettingsPanel . MAXY_OPTION ) ) | ( JSettingsPanel . RELATIVE_TIME_OPTION ) ) | ( JSettingsPanel . MARKERS_OPTION ) ) ) ; }
org . junit . Assert . assertNotNull ( result )
transform_filter ( ) { java . lang . String [ ] [ ] result = read ( ( s ) -> s . toString ( ) . equals ( "b" ) ? null : s , new java . lang . String [ ] { "a" , "b" , "c" } ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } com . asakusafw . dmdl . directio . util . ClassName other = ( ( com . asakusafw . dmdl . directio . util . ClassName ) ( obj ) ) ; if ( ! ( java . util . Objects . equals ( name , other . name ) ) ) { return false ; } return true ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( new java . lang . String [ ] [ ] { new java . lang . String [ ] { "a" } , new java . lang . String [ ] { "c" } } ) )
testDetDoctorsWithNonEmptyCredentials ( ) { "<AssertPlaceHolder>" ; } getDoctorsWithNonEmptyCredentials ( ) { java . lang . String sql = "FROM<sp>Provider<sp>p<sp>WHERE<sp>p.ProviderType<sp>=<sp>'doctor'<sp>" + ( ( ( "AND<sp>p.Status='1'<sp>" + "AND<sp>p.OhipNo<sp>IS<sp>NOT<sp>NULL<sp>" ) + "AND<sp>p.OhipNo<sp>!=<sp>''<sp>" ) + "ORDER<sp>BY<sp>p.LastName,<sp>p.FirstName" ) ; return getHibernateTemplate ( ) . find ( sql ) ; }
org . junit . Assert . assertNotNull ( dao . getDoctorsWithNonEmptyCredentials ( ) )
getRootProjectForNull ( ) { "<AssertPlaceHolder>" ; } getRootProject ( org . apache . maven . project . MavenProject ) { if ( project == null ) { return null ; } org . apache . maven . project . MavenProject current = project ; while ( ! ( org . apache . maven . shared . project . utils . ProjectUtils . isRootProject ( current ) ) ) { current = current . getParent ( ) ; } return current ; }
org . junit . Assert . assertNull ( org . apache . maven . shared . project . utils . ProjectUtils . getRootProject ( null ) )
shouldEqualWhenValuesInConfigAreSameDeeperInHierarchy ( ) { org . apache . commons . configuration . HierarchicalConfiguration hc1 = new org . apache . commons . configuration . HierarchicalConfiguration ( ) ; hc1 . addProperty ( "key1" , "value1" ) ; org . apache . commons . configuration . HierarchicalConfiguration hc1i = new org . apache . commons . configuration . HierarchicalConfiguration ( ) ; hc1i . addProperty ( "key2i" , "value2i" ) ; hc1 . addProperty ( "key2" , hc1i ) ; com . tinkerpop . rexster . extension . ExtensionConfiguration config1 = new com . tinkerpop . rexster . extension . ExtensionConfiguration ( "ns" , "name" , hc1 ) ; org . apache . commons . configuration . HierarchicalConfiguration hc2 = new org . apache . commons . configuration . HierarchicalConfiguration ( ) ; hc2 . addProperty ( "key1" , "value1" ) ; org . apache . commons . configuration . HierarchicalConfiguration hc2i = new org . apache . commons . configuration . HierarchicalConfiguration ( ) ; hc2i . addProperty ( "key2i" , "value2i" ) ; hc2 . addProperty ( "key2" , hc2i ) ; com . tinkerpop . rexster . extension . ExtensionConfiguration config2 = new com . tinkerpop . rexster . extension . ExtensionConfiguration ( "ns" , "name" , hc2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; final com . tinkerpop . rexster . RexsterApplicationGraph that = ( ( com . tinkerpop . rexster . RexsterApplicationGraph ) ( o ) ) ; if ( ! ( graphName . equals ( that . graphName ) ) ) return false ; if ( ! ( graph . getClass ( ) . equals ( that . graph . getClass ( ) ) ) ) return false ; for ( com . tinkerpop . rexster . extension . ExtensionAllowed extensionAllowed : extensionAllowables ) { if ( ! ( that . getExtensionAllowables ( ) . contains ( extensionAllowed ) ) ) { return false ; } } for ( com . tinkerpop . rexster . extension . ExtensionConfiguration configuration : extensionConfigurations ) { if ( ! ( that . getExtensionConfigurations ( ) . contains ( configuration ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertTrue ( config1 . equals ( config2 ) )
testIsComplete_noMessageToTrack_emptyTxs ( ) { org . nhindirect . monitor . condition . impl . GeneralCompletionCondition condition = new org . nhindirect . monitor . condition . impl . GeneralCompletionCondition ( ) ; org . nhindirect . common . tx . model . Tx originalMessage = org . nhindirect . monitor . util . TestUtils . makeMessage ( TxMessageType . DSN , "" , java . util . UUID . randomUUID ( ) . toString ( ) , "gm2552@cerner.com" , "gm2552@direct.securehealthemail.com" , "" ) ; java . util . Collection < org . nhindirect . common . tx . model . Tx > txs = new java . util . ArrayList < org . nhindirect . common . tx . model . Tx > ( ) ; txs . add ( originalMessage ) ; java . util . Collection < java . lang . String > recips = condition . getIncompleteRecipients ( txs ) ; "<AssertPlaceHolder>" ; } toString ( ) { return digestString ; }
org . junit . Assert . assertEquals ( 0 , recips . size ( ) )
testWriteUtf8Composite ( ) { java . lang . String utf8 = "Some<sp>UTF-8<sp>like<sp>" ; io . netty . buffer . ByteBuf buf = io . netty . buffer . Unpooled . buffer ( 16 ) ; buf . writeBytes ( utf8 . getBytes ( CharsetUtil . UTF_8 ) ) ; io . netty . buffer . ByteBuf buf2 = io . netty . buffer . Unpooled . compositeBuffer ( ) . addComponent ( io . netty . buffer . Unpooled . buffer ( 8 ) ) . addComponent ( io . netty . buffer . Unpooled . buffer ( 24 ) ) ; buf2 . writeByte ( 1 ) ; io . netty . buffer . ByteBufUtil . writeUtf8 ( buf2 , utf8 ) ; "<AssertPlaceHolder>" ; buf . release ( ) ; buf2 . release ( ) ; } skipBytes ( int ) { int nBytes = java . lang . Math . min ( available ( ) , n ) ; buffer . skipBytes ( nBytes ) ; return nBytes ; }
org . junit . Assert . assertEquals ( buf , buf2 . skipBytes ( 1 ) )
testShouldBeAbleToGrabTheBodyOfFrameOnceSwitchedTo ( ) { driver . get ( pages . richTextPage ) ; driver . switchTo ( ) . frame ( "editFrame" ) ; org . openqa . selenium . WebElement body = ( ( org . openqa . selenium . WebElement ) ( executeScript ( "return<sp>document.body" ) ) ) ; java . lang . String text = body . getText ( ) ; driver . switchTo ( ) . defaultContent ( ) ; "<AssertPlaceHolder>" ; } defaultContent ( ) { throw new java . lang . UnsupportedOperationException ( "defaultContent()" ) ; }
org . junit . Assert . assertEquals ( "" , text )
howManyPeopleHaveCats ( ) { int count = 0 ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 2 , count )
testSetMaximum ( ) { java . util . Date maximum = formatter . parse ( "2020-03-15<sp>11:00:00" ) ; dateTime . setMaximum ( maximum ) ; "<AssertPlaceHolder>" ; } getMaximum ( ) { return 0 ; }
org . junit . Assert . assertEquals ( maximum , dateTime . getMaximum ( ) )
testFormattedNotificationsXml ( ) { org . opennms . test . mock . MockUtil . println ( "#################<sp>Running<sp>Test<sp>################" ) ; org . opennms . core . test . MockLogAppender . setupLogging ( ) ; org . opennms . netmgt . config . mock . MockNotifdConfigManager notifdConfig = new org . opennms . netmgt . config . mock . MockNotifdConfigManager ( org . opennms . core . test . ConfigurationTestUtils . getConfigForResourceWithReplacements ( this , "notifd-configuration.xml" ) ) ; org . opennms . netmgt . config . NotificationManager manager = new org . opennms . netmgt . config . mock . MockNotificationManager ( notifdConfig , null , org . opennms . core . test . ConfigurationTestUtils . getConfigForResourceWithReplacements ( this , "notifications-config-test.xml" ) ) ; org . opennms . netmgt . config . notifications . Notification n = manager . getNotification ( "crazyTestNotification" ) ; "<AssertPlaceHolder>" ; } getTextMessage ( ) { return this . m_txtMsg ; }
org . junit . Assert . assertTrue ( n . getTextMessage ( ) . contains ( "\n" ) )
shouldConvertStringToLongCorrectly ( ) { final java . lang . Long l = io . confluent . ksql . serde . util . SerdeUtils . toLong ( "1" ) ; "<AssertPlaceHolder>" ; } toLong ( java . lang . Object ) { java . util . Objects . requireNonNull ( object , "Object<sp>cannot<sp>be<sp>null" ) ; if ( object instanceof java . lang . Long ) { return ( ( java . lang . Long ) ( object ) ) ; } if ( object instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( object ) ) . longValue ( ) ; } if ( object instanceof java . lang . String ) { try { return java . lang . Long . parseLong ( ( ( java . lang . String ) ( object ) ) ) ; } catch ( final java . lang . NumberFormatException e ) { throw new io . confluent . ksql . util . KsqlException ( ( ( "Cannot<sp>convert<sp>" + object ) + "<sp>to<sp>BIGINT." ) , e ) ; } } throw new java . lang . IllegalArgumentException ( "This<sp>Object<sp>doesn't<sp>represent<sp>a<sp>long" ) ; }
org . junit . Assert . assertThat ( l , org . hamcrest . CoreMatchers . equalTo ( 1L ) )
testInitiateAutoFinalizeServiceUpgrade ( ) { java . lang . String [ ] args = new java . lang . String [ ] { "app" , "-upgrade" , "app-1" , "-initiate" , org . apache . hadoop . yarn . service . conf . ExampleAppJson . resourceName ( ExampleAppJson . APP_JSON ) , "-autoFinalize" , "-appTypes" , org . apache . hadoop . yarn . service . client . TestServiceCLI . DUMMY_APP_TYPE } ; int result = cli . run ( org . apache . hadoop . yarn . client . cli . ApplicationCLI . preProcessArgs ( args ) ) ; "<AssertPlaceHolder>" ; } preProcessArgs ( java . lang . String [ ] ) { if ( ( args . length ) > 0 ) { org . apache . hadoop . yarn . client . cli . ApplicationCLI . firstArg = args [ 0 ] ; return org . apache . hadoop . yarn . client . cli . Arrays . copyOfRange ( args , 1 , args . length ) ; } else { return args ; } }
org . junit . Assert . assertEquals ( result , 0 )
fromLocalDate ( ) { java . time . LocalDate input = java . time . LocalDate . of ( 2015 , 5 , 9 ) ; "<AssertPlaceHolder>" ; } from ( net . time4j . base . GregorianDate ) { if ( date instanceof net . time4j . PlainDate ) { return ( ( net . time4j . PlainDate ) ( date ) ) ; } else { return net . time4j . PlainDate . of ( date . getYear ( ) , date . getMonth ( ) , date . getDayOfMonth ( ) ) ; } }
org . junit . Assert . assertThat ( net . time4j . PlainDate . from ( input ) , org . hamcrest . CoreMatchers . is ( net . time4j . PlainDate . of ( 2015 , 5 , 9 ) ) )
test2502355_zoomInDomain ( ) { org . jfree . data . xy . DefaultXYDataset dataset = new org . jfree . data . xy . DefaultXYDataset ( ) ; org . jfree . chart . JFreeChart chart = org . jfree . chart . ChartFactory . createXYLineChart ( "TestChart" , "X" , "Y" , dataset ) ; org . jfree . chart . plot . XYPlot plot = ( ( org . jfree . chart . plot . XYPlot ) ( chart . getPlot ( ) ) ) ; plot . setDomainAxis ( 1 , new org . jfree . chart . axis . NumberAxis ( "X2" ) ) ; org . jfree . chart . ChartPanel panel = new org . jfree . chart . ChartPanel ( chart ) ; chart . addChangeListener ( this ) ; this . chartChangeEvents . clear ( ) ; panel . zoomInDomain ( 1.0 , 2.0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . tickUnits . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , this . chartChangeEvents . size ( ) )
testCreatingProject ( ) { java . lang . String projectName = "test-creation" ; org . eclipse . reddeer . direct . project . Project . create ( projectName ) ; "<AssertPlaceHolder>" ; } isProject ( java . lang . String ) { return org . eclipse . reddeer . direct . project . Project . getProject ( projectName ) . exists ( ) ; }
org . junit . Assert . assertTrue ( org . eclipse . reddeer . direct . project . Project . isProject ( projectName ) )
testMaxInRange ( ) { parameter . setMaximumValue ( 0 , false ) ; parameter . configure ( org . apache . flink . api . java . utils . ParameterTool . fromArgs ( new java . lang . String [ ] { "--test" , "-1" } ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( new java . lang . Double ( ( - 1 ) ) , parameter . getValue ( ) )
testUnpins ( ) { mBufferedDiskCache . put ( mCacheKey , mEncodedImage ) ; mWritePriorityExecutor . runUntilIdle ( ) ; org . mockito . ArgumentCaptor < com . facebook . imagepipeline . image . EncodedImage > argumentCaptor = org . mockito . ArgumentCaptor . forClass ( com . facebook . imagepipeline . image . EncodedImage . class ) ; verify ( mStagingArea ) . remove ( eq ( mCacheKey ) , argumentCaptor . capture ( ) ) ; com . facebook . imagepipeline . image . EncodedImage encodedImage = argumentCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; } getUnderlyingReferenceTestOnly ( ) { return ( mPooledByteBufferRef ) != null ? mPooledByteBufferRef . getUnderlyingReferenceTestOnly ( ) : null ; }
org . junit . Assert . assertSame ( mEncodedImage . getUnderlyingReferenceTestOnly ( ) , encodedImage . getUnderlyingReferenceTestOnly ( ) )
rejectedExecutionExceptionCountTest ( ) { org . threadly . concurrent . wrapper . limiter . ExecutorQueueLimitRejector queueRejector = new org . threadly . concurrent . wrapper . limiter . ExecutorQueueLimitRejector ( new java . util . concurrent . Executor ( ) { @ org . threadly . concurrent . wrapper . limiter . Override public void execute ( java . lang . Runnable command ) { throw new java . util . concurrent . RejectedExecutionException ( ) ; } } , TEST_QTY ) ; try { queueRejector . execute ( org . threadly . concurrent . DoNothingRunnable . instance ( ) ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>thrown" ) ; } catch ( java . util . concurrent . RejectedExecutionException e ) { } "<AssertPlaceHolder>" ; } getQueuedTaskCount ( ) { return org . threadly . concurrent . CentralThreadlyPool . MASTER_SCHEDULER . getQueuedTaskCount ( ) ; }
org . junit . Assert . assertEquals ( 0 , queueRejector . getQueuedTaskCount ( ) )
testGetBigInteger ( ) { final net . imglib2 . type . logic . NativeBoolType l = new net . imglib2 . type . logic . NativeBoolType ( false ) ; "<AssertPlaceHolder>" ; } getBigInteger ( ) { return get ( ) ? java . math . BigInteger . ONE : java . math . BigInteger . ZERO ; }
org . junit . Assert . assertEquals ( BigInteger . ZERO , l . getBigInteger ( ) )
deveObterReferenceComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFSignedInfo info = new com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFSignedInfo ( ) ; final com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFReference reference = new com . fincatto . documentofiscal . nfe310 . classes . nota . assinatura . NFReference ( ) ; info . setReference ( reference ) ; "<AssertPlaceHolder>" ; } getReference ( ) { return this . reference ; }
org . junit . Assert . assertEquals ( reference , info . getReference ( ) )
testGetExtendedProperties ( ) { java . util . Map < java . lang . String , java . lang . String > properties = odps . projects ( ) . get ( ) . getExtendedProperties ( ) ; "<AssertPlaceHolder>" ; System . out . println ( properties ) ; } size ( ) { return getProps ( ) . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( properties . size ( ) ) > 0 ) )
testGetValue_Gets_Value_From_Value_Pattern ( ) { mmarquee . automation . AutomationElement element = org . mockito . Mockito . mock ( mmarquee . automation . AutomationElement . class ) ; mmarquee . automation . pattern . Value value = org . mockito . Mockito . mock ( mmarquee . automation . pattern . Value . class ) ; when ( value . isAvailable ( ) ) . thenReturn ( true ) ; when ( element . getClassName ( ) ) . thenReturn ( AutomationMaskedEdit . CLASS_NAME ) ; when ( value . value ( ) ) . thenReturn ( "VALUE" ) ; mmarquee . automation . uiautomation . IUIAutomation mocked_automation = org . mockito . Mockito . mock ( mmarquee . automation . uiautomation . IUIAutomation . class ) ; mmarquee . automation . UIAutomation instance = new mmarquee . automation . UIAutomation ( mocked_automation ) ; mmarquee . automation . controls . AutomationMaskedEdit control = new mmarquee . automation . controls . AutomationMaskedEdit ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( value ) . automation ( instance ) ) ; java . lang . String val = control . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { final mmarquee . automation . pattern . Value valuePattern = requestAutomationPattern ( mmarquee . automation . pattern . Value . class ) ; if ( valuePattern . isAvailable ( ) ) { return valuePattern . value ( ) ; } else { throw new mmarquee . automation . pattern . PatternNotFoundException ( "Cannot<sp>get<sp>value" ) ; } }
org . junit . Assert . assertTrue ( val . equals ( "VALUE" ) )
mapped ( ) { byte [ ] input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" . getBytes ( ) ; byte [ ] expected = new byte [ ] { ( ( byte ) ( 0 ) ) , ( ( byte ) ( 16 ) ) , ( ( byte ) ( 131 ) ) , ( ( byte ) ( 16 ) ) , ( ( byte ) ( 81 ) ) , ( ( byte ) ( 135 ) ) , ( ( byte ) ( 32 ) ) , ( ( byte ) ( 146 ) ) , ( ( byte ) ( 139 ) ) , ( ( byte ) ( 48 ) ) , ( ( byte ) ( 211 ) ) , ( ( byte ) ( 143 ) ) , ( ( byte ) ( 65 ) ) , ( ( byte ) ( 20 ) ) , ( ( byte ) ( 147 ) ) , ( ( byte ) ( 81 ) ) , ( ( byte ) ( 85 ) ) , ( ( byte ) ( 151 ) ) , ( ( byte ) ( 97 ) ) , ( ( byte ) ( 150 ) ) , ( ( byte ) ( 155 ) ) , ( ( byte ) ( 113 ) ) , ( ( byte ) ( 215 ) ) , ( ( byte ) ( 159 ) ) , ( ( byte ) ( 130 ) ) , ( ( byte ) ( 24 ) ) , ( ( byte ) ( 163 ) ) , ( ( byte ) ( 146 ) ) , ( ( byte ) ( 89 ) ) , ( ( byte ) ( 167 ) ) , ( ( byte ) ( 162 ) ) , ( ( byte ) ( 154 ) ) , ( ( byte ) ( 171 ) ) , ( ( byte ) ( 178 ) ) , ( ( byte ) ( 219 ) ) , ( ( byte ) ( 175 ) ) , ( ( byte ) ( 195 ) ) , ( ( byte ) ( 28 ) ) , ( ( byte ) ( 179 ) ) , ( ( byte ) ( 211 ) ) , ( ( byte ) ( 93 ) ) , ( ( byte ) ( 183 ) ) , ( ( byte ) ( 227 ) ) , ( ( byte ) ( 158 ) ) , ( ( byte ) ( 187 ) ) , ( ( byte ) ( 243 ) ) , ( ( byte ) ( 223 ) ) , ( ( byte ) ( 191 ) ) } ; java . nio . ByteBuffer out = Encoding . BASE64 . decode ( java . nio . ByteBuffer . wrap ( input ) ) ; "<AssertPlaceHolder>" ; } wrap ( org . kaazing . mina . netty . buffer . ByteBufferWrappingChannelBuffer ) { this . buffer = buffer . buffer ; order = buffer . order ; capacity = buffer . capacity ; setIndex ( buffer . readerIndex ( ) , buffer . writerIndex ( ) ) ; return this ; }
org . junit . Assert . assertEquals ( out , java . nio . ByteBuffer . wrap ( expected ) )
propertyToAttribute ( ) { com . vaadin . flow . dom . StyleUtilTest . stylepPropertyToAttribute . entrySet ( ) . forEach ( ( entry ) -> { java . lang . String property = entry . getKey ( ) ; java . lang . String attribute = entry . getValue ( ) ; "<AssertPlaceHolder>" ; } ) ; } stylePropertyToAttribute ( java . lang . String ) { java . lang . String attributeStyle = com . vaadin . flow . shared . util . SharedUtil . camelCaseToDashSeparated ( propertyStyle ) ; int dashIndex = attributeStyle . indexOf ( "-" ) ; if ( dashIndex != ( - 1 ) ) { java . lang . String possibleVendorPrefix = propertyStyle . substring ( 0 , dashIndex ) ; for ( java . lang . String vendorPrefix : com . vaadin . flow . dom . StyleUtil . vendorPrefixes ) { if ( vendorPrefix . equals ( possibleVendorPrefix ) ) { return "-" + attributeStyle ; } } } return attributeStyle ; }
org . junit . Assert . assertEquals ( attribute , com . vaadin . flow . dom . StyleUtil . stylePropertyToAttribute ( property ) )
testConvertText ( ) { org . apache . hadoop . io . Text t = new org . apache . hadoop . io . Text ( "abc" . getBytes ( ) ) ; java . lang . String s = t . toString ( ) ; org . apache . hadoop . io . Text t1 = new org . apache . hadoop . io . Text ( s ) ; "<AssertPlaceHolder>" ; } toString ( ) { return getName ( ) ; }
org . junit . Assert . assertEquals ( t , t1 )
testGetAll ( ) { java . util . List < edu . illinois . library . cantaloupe . http . KeyValuePair > actual = instance . getAll ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return pairs . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , actual . size ( ) )
testXor ( ) { System . out . println ( "testXor<sp>" ) ; java . util . Iterator < com . googlecode . javaewah . EWAHCompressedBitmap [ ] > i = com . googlecode . javaewah . IteratorAggregationTest . getCollections ( 2 , 3 ) ; while ( i . hasNext ( ) ) { com . googlecode . javaewah . EWAHCompressedBitmap [ ] x = i . next ( ) ; com . googlecode . javaewah . EWAHCompressedBitmap tanswer = x [ 0 ] . xor ( x [ 1 ] ) ; com . googlecode . javaewah . EWAHCompressedBitmap x1 = com . googlecode . javaewah . IteratorUtil . materialize ( com . googlecode . javaewah . IteratorAggregation . bufferedxor ( x [ 0 ] . getIteratingRLW ( ) , x [ 1 ] . getIteratingRLW ( ) ) ) ; "<AssertPlaceHolder>" ; } java . lang . System . gc ( ) ; } equals ( java . lang . Object ) { if ( o instanceof com . googlecode . javaewah . EWAHCompressedBitmap ) { try { this . xorToContainer ( ( ( com . googlecode . javaewah . EWAHCompressedBitmap ) ( o ) ) , new com . googlecode . javaewah . NonEmptyVirtualStorage ( ) ) ; return true ; } catch ( com . googlecode . javaewah . NonEmptyVirtualStorage e ) { return false ; } } return false ; }
org . junit . Assert . assertTrue ( x1 . equals ( tanswer ) )
test_no_xslt_file ( ) { try { getTransformer ( "xslt-config-02.xml" ) ; org . junit . Assert . fail ( "the<sp>configuration<sp>file<sp>should<sp>be<sp>invalid" ) ; } catch ( java . lang . RuntimeException e ) { boolean exceptionMatch = e . getMessage ( ) . contains ( "SWITCHYARD016801" ) ; "<AssertPlaceHolder>" ; } } getMessage ( ) { return _message ; }
org . junit . Assert . assertTrue ( exceptionMatch )
shouldCreateTheRightAmountOfRestrictionsIfUsersAndRoleAndTwoActionsAreGiven ( ) { java . lang . String roleName1 = "Role1" ; java . lang . String userName1 = "User1" ; java . lang . String userName2 = "User2" ; when ( permissionRepository . getPermissionByName ( resourcePermission . getValue ( ) ) ) . thenReturn ( resourcePermission ) ; when ( permissionRepository . getPermissionByName ( resourceTypePermission . getValue ( ) ) ) . thenReturn ( resourceTypePermission ) ; when ( resourceGroupRepository . find ( 1 ) ) . thenReturn ( new ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceGroupEntity ( ) ) ; int total = permissionBoundary . createMultipleRestrictions ( roleName1 , java . util . Arrays . asList ( userName1 , userName2 ) , java . util . Arrays . asList ( resourcePermission . getValue ( ) , resourceTypePermission . getValue ( ) ) , java . util . Arrays . asList ( 1 ) , null , ResourceTypePermission . ANY , null , java . util . Arrays . asList ( Action . CREATE , Action . UPDATE ) , false , true ) ; "<AssertPlaceHolder>" ; verify ( restrictionRepository , times ( total ) ) . create ( any ( ch . puzzle . itc . mobiliar . business . security . boundary . RestrictionEntity . class ) ) ; verify ( permissionRepository , times ( 1 ) ) . forceReloadingOfLists ( ) ; } getValue ( ) { if ( ( value ) != null ) { if ( isLabeledDateType ( ) ) { return ch . puzzle . itc . mobiliar . business . deploy . entity . CustomFilter . convertDateToString ( getDateValue ( ) ) ; } return value . toString ( ) ; } else { return null ; } }
org . junit . Assert . assertThat ( total , org . hamcrest . CoreMatchers . is ( 12 ) )
getPrivatePlaylistContent ( ) { java . util . List < com . github . felixgail . gplaymusic . model . Playlist > playlists = getApi ( ) . getPlaylistApi ( ) . listPlaylists ( ) ; assume ( playlists ) ; java . util . Optional < com . github . felixgail . gplaymusic . model . Playlist > privatePlaylistOptional = playlists . stream ( ) . filter ( ( p ) -> p . getType ( ) . equals ( Playlist . PlaylistType . USER_GENERATED ) ) . findFirst ( ) ; org . junit . Assume . assumeTrue ( "Test<sp>could<sp>not<sp>be<sp>run.<sp>No<sp>private<sp>playlist<sp>found." , privatePlaylistOptional . isPresent ( ) ) ; com . github . felixgail . gplaymusic . model . Playlist privatePlaylist = privatePlaylistOptional . get ( ) ; System . out . println ( privatePlaylist . getId ( ) ) ; java . util . List < com . github . felixgail . gplaymusic . model . PlaylistEntry > entries = privatePlaylist . getContents ( ( - 1 ) ) ; "<AssertPlaceHolder>" ; testPlaylistEntries ( entries ) ; System . out . printf ( "%d<sp>playlist<sp>entries<sp>found<sp>and<sp>validated.\n" , entries . size ( ) ) ; } getContents ( int ) { return mainApi . getPlaylistApi ( ) . getContents ( this , maxResults ) ; }
org . junit . Assert . assertNotNull ( entries )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . LayoutPrototype > layoutPrototypes = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( layoutPrototypes . isEmpty ( ) )
testHandleManagementMessageWithOperation ( ) { java . lang . String queue = org . apache . activemq . artemis . utils . RandomUtil . randomString ( ) ; java . lang . String address = org . apache . activemq . artemis . utils . RandomUtil . randomString ( ) ; org . apache . activemq . artemis . core . config . Configuration config = createBasicConfig ( ) . setJMXManagementEnabled ( false ) ; org . apache . activemq . artemis . core . server . ActiveMQServer server = addServer ( org . apache . activemq . artemis . core . server . ActiveMQServers . newActiveMQServer ( config , false ) ) ; server . start ( ) ; org . apache . activemq . artemis . core . message . impl . CoreMessage message = new org . apache . activemq . artemis . core . message . impl . CoreMessage ( 1 , 100 ) ; org . apache . activemq . artemis . api . core . management . ManagementHelper . putOperationInvocation ( message , ResourceNames . BROKER , "createQueue" , queue , address ) ; org . apache . activemq . artemis . api . core . Message reply = server . getManagementService ( ) . handleMessage ( message ) ; "<AssertPlaceHolder>" ; } hasOperationSucceeded ( org . apache . activemq . artemis . api . core . Message ) { if ( ! ( org . apache . activemq . artemis . api . core . management . ManagementHelper . isOperationResult ( message ) ) ) { return false ; } if ( message . containsProperty ( org . apache . activemq . artemis . api . core . management . ManagementHelper . HDR_OPERATION_SUCCEEDED ) ) { return message . getBooleanProperty ( org . apache . activemq . artemis . api . core . management . ManagementHelper . HDR_OPERATION_SUCCEEDED ) ; } return false ; }
org . junit . Assert . assertTrue ( org . apache . activemq . artemis . api . core . management . ManagementHelper . hasOperationSucceeded ( reply ) )
visitFull ( ) { byte [ ] value = adapter . visit_full ( fm . last . commons . kyoto . factory . WritableVisitorAdapterTest . BYTE_ARRAY_VALUE , fm . last . commons . kyoto . factory . WritableVisitorAdapterTest . BYTE_ARRAY_VALUE ) ; verify ( mockVisitor ) . record ( fm . last . commons . kyoto . factory . WritableVisitorAdapterTest . BYTE_ARRAY_VALUE , fm . last . commons . kyoto . factory . WritableVisitorAdapterTest . BYTE_ARRAY_VALUE ) ; "<AssertPlaceHolder>" ; } record ( byte [ ] , byte [ ] ) { capture . put ( new java . lang . String ( key ) , new java . lang . String ( value ) ) ; }
org . junit . Assert . assertThat ( value , org . hamcrest . CoreMatchers . is ( fm . last . commons . kyoto . factory . WritableVisitorAdapterTest . BYTE_ARRAY_VALUE ) )
testCompareExceptionMethod ( ) { org . evosuite . junit . naming . methods . GoalComparator comparator = new org . evosuite . junit . naming . methods . GoalComparator ( ) ; org . evosuite . coverage . method . MethodCoverageTestFitness goal1 = new org . evosuite . coverage . method . MethodCoverageTestFitness ( "FooClass" , "toString()" ) ; org . evosuite . coverage . exception . ExceptionCoverageTestFitness goal2 = new org . evosuite . coverage . exception . ExceptionCoverageTestFitness ( "FooClass" , "toString()" , org . evosuite . runtime . mock . java . lang . MockArithmeticException . class , ExceptionCoverageTestFitness . ExceptionType . EXPLICIT ) ; "<AssertPlaceHolder>" ; } compare ( org . evosuite . ga . Chromosome , org . evosuite . ga . Chromosome ) { if ( ( c1 . getDistance ( ) ) > ( c2 . getDistance ( ) ) ) { return - 1 ; } else if ( ( c1 . getDistance ( ) ) < ( c2 . getDistance ( ) ) ) { return + 1 ; } else { return 0 ; } }
org . junit . Assert . assertEquals ( 1 , comparator . compare ( goal1 , goal2 ) )
testSaml1TokenHOK ( ) { org . apache . cxf . service . Service service = createService ( ) ; org . apache . wss4j . stax . ext . WSSSecurityProperties inProperties = new org . apache . wss4j . stax . ext . WSSSecurityProperties ( ) ; java . util . Properties cryptoProperties = org . apache . wss4j . common . crypto . CryptoFactory . getProperties ( "insecurity.properties" , this . getClass ( ) . getClassLoader ( ) ) ; inProperties . setSignatureVerificationCryptoProperties ( cryptoProperties ) ; org . apache . cxf . ws . security . wss4j . saml . CustomStaxSamlValidator validator = new org . apache . cxf . ws . security . wss4j . saml . CustomStaxSamlValidator ( ) ; inProperties . addValidator ( WSConstants . SAML_TOKEN , validator ) ; inProperties . addValidator ( WSConstants . SAML2_TOKEN , validator ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor inhandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor ( inProperties ) ; service . getInInterceptors ( ) . add ( inhandler ) ; org . apache . cxf . ws . security . wss4j . Echo echo = createClientProxy ( ) ; org . apache . cxf . endpoint . Client client = org . apache . cxf . frontend . ClientProxy . getClient ( echo ) ; client . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; client . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( ConfigurationConstants . ACTION , ConfigurationConstants . SAML_TOKEN_SIGNED ) ; org . apache . cxf . ws . security . wss4j . saml . SAML1CallbackHandler callbackHandler = new org . apache . cxf . ws . security . wss4j . saml . SAML1CallbackHandler ( ) ; callbackHandler . setConfirmationMethod ( SAML1Constants . CONF_HOLDER_KEY ) ; callbackHandler . setSignAssertion ( true ) ; properties . put ( ConfigurationConstants . SAML_CALLBACK_REF , callbackHandler ) ; properties . put ( ConfigurationConstants . SIG_KEY_ID , "DirectReference" ) ; properties . put ( ConfigurationConstants . USER , "alice" ) ; properties . put ( ConfigurationConstants . PW_CALLBACK_REF , new org . apache . cxf . ws . security . wss4j . saml . PasswordCallbackHandler ( ) ) ; properties . put ( ConfigurationConstants . SIG_PROP_FILE , "alice.properties" ) ; org . apache . cxf . ws . security . wss4j . WSS4JOutInterceptor ohandler = new org . apache . cxf . ws . security . wss4j . WSS4JOutInterceptor ( properties ) ; client . getOutInterceptors ( ) . add ( ohandler ) ; try { echo . echo ( "test" ) ; org . junit . Assert . fail ( "Failure<sp>expected<sp>on<sp>receiving<sp>sender<sp>vouches<sp>instead<sp>of<sp>HOK" ) ; } catch ( org . apache . cxf . ws . security . wss4j . saml . javax ex ) { } validator . setRequireSenderVouches ( false ) ; "<AssertPlaceHolder>" ; } echo ( int ) { return i ; }
org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) )
verifyListenerCalledOnNodeRemoved ( ) { ensure ( "/foos/foo" , new com . spotify . helios . servicescommon . coordination . PersistentPathChildrenCacheTest . DataPojo ( "foo" ) ) ; verify ( listener , timeout ( 60000 ) . atLeastOnce ( ) ) . nodesChanged ( cache ) ; reset ( listener ) ; try { zk . curatorWithSuperAuth ( ) . delete ( ) . forPath ( "/foos/foo" ) ; } catch ( com . spotify . helios . servicescommon . coordination . NoNodeException ignore ) { } verify ( listener , timeout ( 60000 ) . atLeastOnce ( ) ) . nodesChanged ( cache ) ; "<AssertPlaceHolder>" ; } getNodes ( ) { return snapshot . get ( ) ; }
org . junit . Assert . assertTrue ( cache . getNodes ( ) . isEmpty ( ) )
testReportExpiration ( ) { org . apache . hadoop . conf . Configuration conf = org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . getConfiguration ( ) ; conf . setInt ( RegionSizeReportingChore . REGION_SIZE_REPORTING_CHORE_PERIOD_KEY , 25000 ) ; conf . setInt ( QuotaObserverChore . REGION_REPORT_RETENTION_DURATION_KEY , 5000 ) ; org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . startMiniCluster ( 1 ) ; final java . lang . String FAM1 = "f1" ; final org . apache . hadoop . hbase . master . HMaster master = org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . getMiniHBaseCluster ( ) . getMaster ( ) ; while ( ( master . getMasterQuotaManager ( ) ) == null ) { org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . LOG . debug ( "MasterQuotaManager<sp>is<sp>null,<sp>waiting..." ) ; java . lang . Thread . sleep ( 500 ) ; } final org . apache . hadoop . hbase . quotas . MasterQuotaManager quotaManager = master . getMasterQuotaManager ( ) ; final org . apache . hadoop . hbase . TableName tn = org . apache . hadoop . hbase . TableName . valueOf ( "reportExpiration" ) ; org . apache . hadoop . hbase . client . TableDescriptor tableDesc = org . apache . hadoop . hbase . client . TableDescriptorBuilder . newBuilder ( tn ) . setColumnFamily ( org . apache . hadoop . hbase . client . ColumnFamilyDescriptorBuilder . of ( FAM1 ) ) . build ( ) ; org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . getAdmin ( ) . createTable ( tableDesc ) ; "<AssertPlaceHolder>" ; final long sizeLimit = 100L * ( SpaceQuotaHelperForTests . ONE_MEGABYTE ) ; final org . apache . hadoop . hbase . quotas . SpaceViolationPolicy violationPolicy = SpaceViolationPolicy . NO_INSERTS ; org . apache . hadoop . hbase . quotas . QuotaSettings settings = org . apache . hadoop . hbase . quotas . QuotaSettingsFactory . limitTableSpace ( tn , sizeLimit , violationPolicy ) ; org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . getAdmin ( ) . setQuota ( settings ) ; org . apache . hadoop . hbase . Waiter . waitFor ( org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . getConfiguration ( ) , 45000 , 1000 , new org . apache . hadoop . hbase . Waiter . Predicate < java . lang . Exception > ( ) { @ java . lang . Override public boolean evaluate ( ) throws java . lang . Exception { int numReports = getRegionReportsForTable ( quotaManager . snapshotRegionSizes ( ) , tn ) ; org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . LOG . debug ( ( ( ( ( "Saw<sp>" + numReports ) + "<sp>reports<sp>for<sp>" ) + tn ) + "<sp>while<sp>waiting<sp>for<sp>1" ) ) ; return numReports == 1 ; } } ) ; org . apache . hadoop . hbase . Waiter . waitFor ( org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . TEST_UTIL . getConfiguration ( ) , 15000 , 1000 , new org . apache . hadoop . hbase . Waiter . Predicate < java . lang . Exception > ( ) { @ java . lang . Override public boolean evaluate ( ) throws java . lang . Exception { int numReports = getRegionReportsForTable ( quotaManager . snapshotRegionSizes ( ) , tn ) ; org . apache . hadoop . hbase . quotas . TestQuotaObserverChoreRegionReports . LOG . debug ( ( ( ( ( "Saw<sp>" + numReports ) + "<sp>reports<sp>for<sp>" ) + tn ) + "<sp>while<sp>waiting<sp>for<sp>none" ) ) ; return numReports == 0 ; } } ) ; } getRegionReportsForTable ( java . util . Map , org . apache . hadoop . hbase . TableName ) { int numReports = 0 ; for ( java . util . Map . Entry < org . apache . hadoop . hbase . client . RegionInfo , java . lang . Long > entry : reports . entrySet ( ) ) { if ( tn . equals ( entry . getKey ( ) . getTable ( ) ) ) { numReports ++ ; } } return numReports ; }
org . junit . Assert . assertEquals ( 0 , getRegionReportsForTable ( quotaManager . snapshotRegionSizes ( ) , tn ) )
showDbDialog_LoopsUntilUniqueValueIsInput ( ) { org . pentaho . di . core . database . DatabaseMeta db1 = createDefaultDatabase ( ) ; org . pentaho . di . core . database . DatabaseMeta db2 = createDefaultDatabase ( ) ; db2 . setName ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . INPUT_NAME ) ; org . pentaho . di . trans . TransMeta transMeta = new org . pentaho . di . trans . TransMeta ( ) ; transMeta . addDatabase ( db1 ) ; transMeta . addDatabase ( db2 ) ; final java . lang . String expectedResult = ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . INPUT_NAME ) + "2" ; org . pentaho . di . ui . core . database . dialog . DatabaseDialog databaseDialog = mock ( org . pentaho . di . ui . core . database . dialog . DatabaseDialog . class ) ; when ( databaseDialog . open ( ) ) . thenReturn ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . INPUT_NAME ) . thenReturn ( ( ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . INPUT_NAME ) + "<sp>" ) ) . thenReturn ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . INPUT_NAME . toUpperCase ( ) ) . thenReturn ( expectedResult ) ; org . pentaho . di . ui . trans . step . BaseStepDialog dialog = mock ( org . pentaho . di . ui . trans . step . BaseStepDialog . class ) ; dialog . databaseDialog = databaseDialog ; dialog . transMeta = transMeta ; when ( dialog . showDbDialogUnlessCancelledOrValid ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . anyDbMeta ( ) , org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . anyDbMeta ( ) ) ) . thenCallRealMethod ( ) ; when ( dialog . getDatabaseDialog ( any ( org . eclipse . swt . widgets . Shell . class ) ) ) . thenCallRealMethod ( ) ; java . lang . String result = dialog . showDbDialogUnlessCancelledOrValid ( ( ( org . pentaho . di . core . database . DatabaseMeta ) ( db1 . clone ( ) ) ) , db1 ) ; "<AssertPlaceHolder>" ; verify ( databaseDialog , times ( 4 ) ) . open ( ) ; verify ( dialog , times ( 3 ) ) . showDbExistsDialog ( org . pentaho . di . ui . trans . step . BaseStepDialog_ConnectionLine_Test . anyDbMeta ( ) ) ; } clone ( ) { try { java . lang . Object retval = super . clone ( ) ; return retval ; } catch ( java . lang . CloneNotSupportedException e ) { return null ; } }
org . junit . Assert . assertEquals ( expectedResult , result )
testRunWithDefaultNonList ( ) { attrs . put ( "dest" , "default" ) ; act . run ( null , arg , attrs , null , "hello" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return ( ( T ) ( attrs_ . get ( dest ) ) ) ; }
org . junit . Assert . assertEquals ( singletonList ( "hello" ) , attrs . get ( "dest" ) )
shouldGenerateKey ( ) { final org . talend . dataprep . cache . TransformationCacheKey key = createTestDefaultKey ( ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return ( org . talend . dataprep . dataset . service . cache . UpdateDataSetCacheKey . PREFIX ) + ( dataSetId ) ; }
org . junit . Assert . assertNotNull ( key . getKey ( ) )
testConvert ( ) { java . lang . Long id = 1L ; java . lang . String name = "name" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; java . lang . Long publicActiveTypeId = 2L ; org . lnu . is . domain . publicactivity . PublicActivityType publicActiveType = new org . lnu . is . domain . publicactivity . PublicActivityType ( ) ; publicActiveType . setId ( publicActiveTypeId ) ; java . lang . Long timePeriodId = 3L ; org . lnu . is . domain . timeperiod . TimePeriod timePeriod = new org . lnu . is . domain . timeperiod . TimePeriod ( ) ; timePeriod . setId ( timePeriodId ) ; org . lnu . is . domain . publicactivity . PublicActivity expected = new org . lnu . is . domain . publicactivity . PublicActivity ( ) ; expected . setId ( id ) ; expected . setName ( name ) ; expected . setBegDate ( begDate ) ; expected . setEndDate ( endDate ) ; expected . setPublicActivityType ( publicActiveType ) ; expected . setTimePeriod ( timePeriod ) ; org . lnu . is . resource . publicactivity . PublicActivityResource source = new org . lnu . is . resource . publicactivity . PublicActivityResource ( ) ; source . setId ( id ) ; source . setName ( name ) ; source . setBegDate ( begDate ) ; source . setEndDate ( endDate ) ; source . setPublicActivityTypeId ( publicActiveTypeId ) ; source . setTimePeriodId ( timePeriodId ) ; org . lnu . is . domain . publicactivity . PublicActivity actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
readResouceReturnsServiceExceptionFor5xxResponse ( ) { generateStub ( 500 , "{\"code\":\"500<sp>Internal<sp>Server<sp>Error\",\"message\":\"ERROR_MESSAGE\"}" ) ; try { software . amazon . awssdk . regions . util . HttpCredentialsUtilsTest . httpCredentialsUtils . readResource ( software . amazon . awssdk . regions . util . HttpCredentialsUtilsTest . endpoint ) ; org . junit . Assert . fail ( "Expected<sp>SdkServiceException" ) ; } catch ( software . amazon . awssdk . core . exception . SdkServiceException exception ) { "<AssertPlaceHolder>" ; } } statusCode ( ) { return statusCode ; }
org . junit . Assert . assertEquals ( 500 , exception . statusCode ( ) )
communicateBetweenJvms ( ) { org . neo4j . com . ServerInterface server = new org . neo4j . com . MadeUpServerProcess ( ) . start ( new java . lang . Long [ ] { storeIdToUse . getCreationTime ( ) , storeIdToUse . getRandomId ( ) } ) ; server . awaitStarted ( ) ; org . neo4j . com . MadeUpClient client = new org . neo4j . com . MadeUpClient ( MadeUpServerProcess . PORT , storeIdToUse ) ; "<AssertPlaceHolder>" ; client . streamSomeData ( new org . neo4j . com . ToAssertionWriter ( ) , ( ( 1024 * 1024 ) * 50 ) ) ; client . shutdown ( ) ; server . shutdown ( ) ; } multiply ( int , int ) { gotCalled = true ; return new org . neo4j . com . Response < java . lang . Integer > ( ( value1 * value2 ) , storeIdToRespondWith , TransactionStream . EMPTY ) ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 9 * 5 ) ) , client . multiply ( 9 , 5 ) . response ( ) )
test_noOverrides ( ) { java . util . Properties properties = new java . util . Properties ( ) ; if ( ( unusedPortsSystemPropertyValue ) != null ) { properties . setProperty ( TestPortFinder . UNUSED_PORTS_PROPERTY_KEY , unusedPortsSystemPropertyValue ) ; } com . google . api . ads . common . lib . testing . TestPortFinder portFinder = new com . google . api . ads . common . lib . testing . TestPortFinder ( properties ) ; int port = portFinder . checkOutUnusedPort ( ) ; "<AssertPlaceHolder>" ; portFinder . releaseUnusedPort ( port ) ; } checkOutUnusedPort ( ) { if ( ( availablePorts ) == null ) { return org . openqa . selenium . net . PortProber . findFreePort ( ) ; } else if ( availablePorts . isEmpty ( ) ) { throw new java . util . NoSuchElementException ( "No<sp>unused<sp>ports<sp>are<sp>available" ) ; } return availablePorts . pop ( ) ; }
org . junit . Assert . assertTrue ( ( port > 0 ) )
filePlanFilling ( ) { org . alfresco . service . cmr . repository . NodeRef holdContainer = generateNodeRef ( org . alfresco . module . org_alfresco_module_rm . capability . declarative . condition . TYPE_HOLD_CONTAINER ) ; when ( mockedFilePlanService . getHoldContainer ( filePlan ) ) . thenReturn ( holdContainer ) ; when ( mockedPermissionService . hasPermission ( holdContainer , RMPermissionModel . FILE_RECORDS ) ) . thenReturn ( AccessStatus . ALLOWED ) ; "<AssertPlaceHolder>" ; } evaluateImpl ( org . alfresco . service . cmr . repository . NodeRef ) { org . alfresco . util . ParameterCheck . mandatory ( "nodeRef" , nodeRef ) ; boolean result = false ; if ( ( nodeService . getProperty ( nodeRef , getPropertyQName ( ) ) ) != null ) { result = true ; } return result ; }
org . junit . Assert . assertTrue ( condition . evaluateImpl ( holdContainer ) )
testRegisterServiceFromTracker ( ) { final org . csstudio . servicelocator . ServiceLocatorUnitTest . MyService myService = new org . csstudio . servicelocator . ServiceLocatorUnitTest . MyService ( ) ; final org . osgi . util . tracker . ServiceTracker < org . csstudio . servicelocator . ServiceLocatorUnitTest . IService , java . lang . Object > myServiceTracker = mock ( org . osgi . util . tracker . ServiceTracker . class ) ; when ( myServiceTracker . getService ( ) ) . thenReturn ( myService ) ; org . csstudio . servicelocator . ServiceLocator . registerServiceTracker ( org . csstudio . servicelocator . ServiceLocatorUnitTest . IService . class , myServiceTracker ) ; final org . csstudio . servicelocator . ServiceLocatorUnitTest . IService service = org . csstudio . servicelocator . ServiceLocator . getService ( org . csstudio . servicelocator . ServiceLocatorUnitTest . IService . class ) ; "<AssertPlaceHolder>" ; } getService ( ) { return service ; }
org . junit . Assert . assertSame ( myService , service )
should_exclude_test_class_when_excluding_single_category_of_many ( ) { categorizedConfig . setCategories ( new java . lang . String [ ] { org . arquillian . smart . testing . strategies . categorized . project . categories . FirstCategory . class . getSimpleName ( ) } ) ; categorizedConfig . setExcludedCategories ( new java . lang . String [ ] { org . arquillian . smart . testing . strategies . categorized . project . categories . SecondCategory . class . getSimpleName ( ) } ) ; java . util . Collection < org . arquillian . smart . testing . TestSelection > testSelection = new org . arquillian . smart . testing . strategies . categorized . CategorizedTestsDetector ( config ) . selectTestsFromClasses ( java . util . Collections . singleton ( org . arquillian . smart . testing . strategies . categorized . project . categories . FirstAndSecondCategorizedClass . class ) ) ; "<AssertPlaceHolder>" ; } selectTestsFromClasses ( java . lang . Iterable ) { return java . util . Collections . emptyList ( ) ; }
org . junit . Assert . assertTrue ( testSelection . isEmpty ( ) )
testSerialization ( ) { org . jfree . chart . plot . PieLabelRecord p1 = new org . jfree . chart . plot . PieLabelRecord ( "A" , 1.0 , 2.0 , new org . jfree . text . TextBox ( "B" ) , 3.0 , 4.0 , 5.0 ) ; org . jfree . chart . plot . PieLabelRecord p2 = ( ( org . jfree . chart . plot . PieLabelRecord ) ( org . jfree . chart . TestUtilities . serialised ( p1 ) ) ) ; boolean b = p1 . equals ( p2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; mdz . hc . ProcessValue other = ( ( mdz . hc . ProcessValue ) ( obj ) ) ; if ( ( state ) != ( other . state ) ) return false ; if ( ( timestamp ) == null ) { if ( ( other . timestamp ) != null ) return false ; } else if ( ! ( timestamp . equals ( other . timestamp ) ) ) return false ; if ( ( value ) == null ) { if ( ( other . value ) != null ) return false ; } else if ( ! ( value . equals ( other . value ) ) ) return false ; return true ; }
org . junit . Assert . assertTrue ( b )
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . DndUpdatedEvent event = new com . github . seratch . jslack . api . model . event . DndUpdatedEvent ( ) ; event . setUser ( "u" ) ; event . setDndStatus ( new com . github . seratch . jslack . api . model . event . DndUpdatedEvent . DndStatus ( ) ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"dnd_updated\",\"user\":\"u\",\"dnd_status\":{\"dnd_enabled\":false,\"snooze_enabled\":false}}" ; "<AssertPlaceHolder>" ; } createSnakeCase ( ) { return new com . google . gson . GsonBuilder ( ) . setFieldNamingPolicy ( FieldNamingPolicy . LOWER_CASE_WITH_UNDERSCORES ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . LayoutBlock . class , new com . github . seratch . jslack . common . json . GsonLayoutBlockFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . composition . TextObject . class , new com . github . seratch . jslack . common . json . GsonTextObjectFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . ContextBlockElement . class , new com . github . seratch . jslack . common . json . GsonContextBlockElementFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . element . BlockElement . class , new com . github . seratch . jslack . common . json . GsonBlockElementFactory ( ) ) . create ( ) ; }
org . junit . Assert . assertThat ( generatedJson , org . hamcrest . CoreMatchers . is ( expectedJson ) )
testRequireNonNullWithMessageSupplier ( ) { java . lang . Object result = com . annimon . stream . Objects . requireNonNull ( "test" , new com . annimon . stream . function . Supplier < java . lang . String > ( ) { @ com . annimon . stream . Override public java . lang . String get ( ) { return "supplied<sp>message" ; } } ) ; "<AssertPlaceHolder>" ; } get ( ) { return new java . lang . StringBuilder ( ) ; }
org . junit . Assert . assertEquals ( "test" , result )
checkTraverseByProperties ( ) { org . neo4j . graphdb . traversal . Traverser heroesTraverserRest = getHeroesViaRest ( ) ; org . neo4j . graphdb . traversal . Traverser heroesTraverserByProperties = getHeroesByNodeProperties ( ) ; "<AssertPlaceHolder>" ; } nodes ( ) { return new org . neo4j . helpers . collection . IterableWrapper < org . neo4j . graphdb . Node , org . neo4j . graphdb . Path > ( paths ) { @ org . neo4j . rest . graphdb . traversal . Override protected org . neo4j . graphdb . Node underlyingObjectToObject ( org . neo4j . graphdb . Path path ) { return path . endNode ( ) ; } } ; }
org . junit . Assert . assertEquals ( heroesTraverserRest . nodes ( ) . iterator ( ) . next ( ) . getId ( ) , heroesTraverserByProperties . nodes ( ) . iterator ( ) . next ( ) . getId ( ) )
testEmailPayload ( ) { java . lang . String expectedEmailpayloadString = "{\"subject\":\"Welcome<sp>to<sp>the<sp>Winter<sp>Sale!<sp>\",\"html_body\":\"<h1>Seasons<sp>Greetings</h1><p>Check<sp>out<sp>our<sp>winter<sp>deals!</p><p><a<sp>data-ua-unsubscribe=\\\"1\\\"<sp>title=\\\"unsubscribe\\\"<sp>href=\\\"http://unsubscribe.urbanairship.com/email/success.html\\\">Unsubscribe</a></p>\",\"plaintext_body\":\"Greetings!<sp>Check<sp>out<sp>our<sp>latest<sp>winter<sp>deals!<sp>[[ua-unsubscribe<sp>href=\\\"http://unsubscribe.urbanairship.com/email/success.html\\\"]]\",\"message_type\":\"commercial\",\"sender_name\":\"Urban<sp>Airship\",\"sender_address\":\"team@urbanairship.com\",\"reply_to\":\"no-reply@urbanairship.com\"}" ; java . lang . String parsedJson = com . urbanairship . api . createandsend . CreateAndSendEmailTest . PUSH_OBJECT_MAPPER . writeValueAsString ( createAndSendEmailPayload ) ; com . fasterxml . jackson . databind . JsonNode actual = com . urbanairship . api . createandsend . CreateAndSendEmailTest . PUSH_OBJECT_MAPPER . readTree ( parsedJson ) ; com . fasterxml . jackson . databind . JsonNode expected = com . urbanairship . api . createandsend . CreateAndSendEmailTest . PUSH_OBJECT_MAPPER . readTree ( expectedEmailpayloadString ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expected , actual )
generateDDL_whenExecLocationIsMasterOnly_returnsDDLStringWithAMasterOnlyExecLocation ( ) { org . jkiss . dbeaver . ext . greenplum . model . PostgreTableColumn mockPostgreTableColumn = mockDbColumn ( "column1" , "int4" , 1 ) ; java . util . List < org . jkiss . dbeaver . ext . greenplum . model . PostgreTableColumn > tableColumns = java . util . Collections . singletonList ( mockPostgreTableColumn ) ; org . mockito . Mockito . when ( mockResults . getString ( "execlocation" ) ) . thenReturn ( "MASTER_ONLY" ) ; org . jkiss . dbeaver . ext . greenplum . model . GreenplumExternalTable table = new org . jkiss . dbeaver . ext . greenplum . model . GreenplumExternalTable ( mockSchema , mockResults ) ; addMockColumnsToTableCache ( tableColumns , table ) ; java . lang . String expectedDDL = "CREATE<sp>EXTERNAL<sp>TABLE<sp>sampleDatabase.sampleSchema.sampleTable<sp>(\n\tcolumn1<sp>int4\n)\n" + ( ( ( ( "LOCATION<sp>(\n" + "\t\'gpfdist://filehost:8081/*.txt\'\n" ) + ")<sp>ON<sp>MASTER\n" ) + "FORMAT<sp>\'CSV\'<sp>(<sp>DELIMITER<sp>\',\'<sp>)\n" ) + "ENCODING<sp>'UTF8'" ) ; "<AssertPlaceHolder>" ; } generateDDL ( org . jkiss . dbeaver . model . runtime . DBRProgressMonitor ) { java . lang . StringBuilder ddlBuilder = new java . lang . StringBuilder ( ) ; ddlBuilder . append ( "\nLOG<sp>ERRORS" 1 ) . append ( ( this . isWritable ( ) ? "WRITABLE<sp>" : "" ) ) . append ( "EXTERNAL<sp>" ) . append ( ( isWebTable ( ) ? "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 6 : "" ) ) . append ( ( this . isTemporaryTable ( ) ? "TEMPORARY<sp>" : "" ) ) . append ( "TABLE<sp>" ) . append ( addDatabaseQualifier ( ) ) . append ( this . getName ( ) ) . append ( "\nLOG<sp>ERRORS" 0 ) ; java . util . List < org . jkiss . dbeaver . ext . postgresql . model . PostgreTableColumn > tableColumns = filterOutNonMetadataColumns ( monitor ) ; if ( ( tableColumns . size ( ) ) == 0 ) { ddlBuilder . append ( "\nLOG<sp>ERRORS" 2 ) ; } else if ( ( tableColumns . size ( ) ) == 1 ) { org . jkiss . dbeaver . ext . postgresql . model . PostgreTableColumn column = tableColumns . get ( 0 ) ; ddlBuilder . append ( ( ( ( ( "\t" + ( column . getName ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 ) + ( column . getTypeName ( ) ) ) + "\nLOG<sp>ERRORS" 2 ) ) ; } else { ddlBuilder . append ( tableColumns . stream ( ) . map ( ( field ) -> ( ( "\t" + ( field . getName ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 ) + ( field . getTypeName ( ) ) ) . collect ( java . util . stream . Collectors . joining ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 4 ) ) ) ; ddlBuilder . append ( "\nLOG<sp>ERRORS" 2 ) ; } if ( org . jkiss . utils . CommonUtils . isNotEmpty ( this . getUriLocations ( ) ) ) { ddlBuilder . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 7 ) ; ddlBuilder . append ( this . uriLocationsHandler . stream ( ) . map ( ( location ) -> ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 2 + location ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 1 ) . collect ( java . util . stream . Collectors . joining ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 4 ) ) ) ; ddlBuilder . append ( ( ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 5 + ( determineExecutionLocation ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 9 ) ) ; } else if ( tableHasCommand ( ) ) { ddlBuilder . append ( ( ( ( ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 8 + ( this . getCommand ( ) ) ) + "'<sp>" ) + ( determineExecutionLocation ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 9 ) ) ; } ddlBuilder . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 3 ) . append ( this . getFormatType ( ) ) . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 1 ) ; if ( ( this . getFormatOptions ( ) ) != null ) { ddlBuilder . append ( generateFormatOptions ( this . formatType , this . getFormatOptions ( ) ) ) ; } if ( ( ( this . getEncoding ( ) ) != null ) && ( ( this . getEncoding ( ) . length ( ) ) > 0 ) ) { ddlBuilder . append ( ( ( "\nENCODING<sp>\'" + ( this . getEncoding ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 1 ) ) ; } if ( this . isLoggingErrors ( ) ) { ddlBuilder . append ( "\nLOG<sp>ERRORS" ) ; } if ( ( ( this . getRejectLimit ( ) ) > 0 ) && ( ( this . getRejectLimitType ( ) ) != null ) ) { ddlBuilder . append ( ( this . isLoggingErrors ( ) ? "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 : "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 9 ) ) . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" ) . append ( this . getRejectLimit ( ) ) . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 ) . append ( this . getRejectLimitType ( ) . getValue ( ) ) ; } return ddlBuilder . toString ( ) ; }
org . junit . Assert . assertEquals ( expectedDDL , table . generateDDL ( monitor ) )
testDecodeWrongKey ( ) { java . lang . String data = sut . decode ( "X8xF5hXq+v3HsPnb0F5wXw==" , "ThisIsNotTheRightKey" . getBytes ( ) ) ; "<AssertPlaceHolder>" ; } decode ( java . lang . String , byte [ ] ) { byte [ ] encrypted = javax . xml . bind . DatatypeConverter . parseBase64Binary ( token ) ; if ( ( encrypted . length ) == 0 ) { return null ; } java . security . Key key = new javax . crypto . spec . SecretKeySpec ( keyBytes , algorithm ) ; byte [ ] decrypted ; try { javax . crypto . Cipher cipher = javax . crypto . Cipher . getInstance ( algorithm ) ; cipher . init ( Cipher . DECRYPT_MODE , key ) ; decrypted = cipher . doFinal ( encrypted ) ; } catch ( java . security . GeneralSecurityException ex ) { log . error ( "Error<sp>decrypting<sp>data<sp>from<sp>token" , ex ) ; return null ; } return new java . lang . String ( decrypted ) ; }
org . junit . Assert . assertNull ( data )
getMembers ( ) { java . util . Collection < java . lang . String > members = new java . util . ArrayList < java . lang . String > ( ) ; when ( wikiUserManager . getMembers ( "subwiki" ) ) . thenReturn ( members ) ; java . util . Collection < java . lang . String > result = mocker . getComponentUnderTest ( ) . getMembers ( "subwiki" ) ; "<AssertPlaceHolder>" ; } getMembers ( org . xwiki . model . reference . DocumentReference ) { com . xpn . xwiki . XWikiContext xcontext = this . xcontextProvider . get ( ) ; com . xpn . xwiki . user . api . XWikiGroupService groupService = getXWikiGroupService ( xcontext ) ; java . util . Collection < java . lang . String > memberStrings ; try { memberStrings = groupService . getAllMembersNamesForGroup ( this . serializer . serialize ( reference ) , ( - 1 ) , 0 , xcontext ) ; } catch ( com . xpn . xwiki . XWikiException e ) { throw new org . xwiki . user . group . GroupException ( ( ( "Failed<sp>to<sp>get<sp>members<sp>of<sp>group<sp>[" + reference ) + "]" ) , e ) ; } java . util . Set < org . xwiki . model . reference . DocumentReference > members = new java . util . LinkedHashSet ( ) ; for ( java . lang . String memberString : memberStrings ) { members . add ( this . referenceFactory . getReference ( this . resolver . resolve ( memberString , reference ) ) ) ; } return members ; }
org . junit . Assert . assertEquals ( members , result )
testConsumingMultipleTokensDecreasesNumTokens ( ) { refillStrategy . addTokens ( org . isomorphism . util . TokenBucketImplTest . CAPACITY ) ; bucket . consume ( 2 ) ; "<AssertPlaceHolder>" ; } getNumTokens ( ) { refill ( refillStrategy . refill ( ) ) ; return size ; }
org . junit . Assert . assertEquals ( ( ( org . isomorphism . util . TokenBucketImplTest . CAPACITY ) - 2 ) , bucket . getNumTokens ( ) )
testGetTableForException ( ) { java . lang . String dbName = "default" ; java . lang . String tableName = "tableName" ; given ( client . getTable ( dbName , tableName ) ) . willThrow ( org . apache . griffin . core . metastore . hive . Exception . class ) ; doNothing ( ) . when ( client ) . reconnect ( ) ; "<AssertPlaceHolder>" ; verify ( client ) . reconnect ( ) ; verify ( client ) . getTable ( dbName , tableName ) ; service . getTable ( dbName , tableName ) ; verify ( client , times ( 2 ) ) . reconnect ( ) ; verify ( client , times ( 2 ) ) . getTable ( dbName , tableName ) ; } getTable ( java . lang . String , java . lang . String ) { return hiveMetaStoreService . getTable ( dbName , tableName ) ; }
org . junit . Assert . assertTrue ( ( ( service . getTable ( dbName , tableName ) ) == null ) )
testNullHashing ( ) { final org . kie . api . KieBase kbase = org . drools . compiler . integrationtests . SerializationHelper . serializeObject ( loadKnowledgeBase ( "test_NullHashing.drl" ) ) ; final org . kie . api . runtime . KieSession ksession = createKnowledgeSession ( kbase ) ; final java . util . List results = new java . util . ArrayList ( ) ; ksession . setGlobal ( "results" , results ) ; ksession . insert ( new org . drools . compiler . Cheese ( "stilton" , 15 ) ) ; ksession . insert ( new org . drools . compiler . Cheese ( "" , 10 ) ) ; ksession . insert ( new org . drools . compiler . Cheese ( null , 8 ) ) ; ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , results . size ( ) )
testDeleteZoneOperation_False ( ) { org . easymock . EasyMock . expect ( computeRpcMock . deleteZoneOperation ( com . google . cloud . compute . deprecated . ComputeImplTest . ZONE_OPERATION_ID . getZone ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . ZONE_OPERATION_ID . getOperation ( ) ) ) . andReturn ( false ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; "<AssertPlaceHolder>" ; } deleteOperation ( com . google . cloud . compute . deprecated . OperationId ) { try { return com . google . cloud . RetryHelper . runWithRetries ( new java . util . concurrent . Callable < java . lang . Boolean > ( ) { @ com . google . cloud . compute . deprecated . Override public com . google . cloud . compute . deprecated . Boolean call ( ) { switch ( operation . getType ( ) ) { case REGION : com . google . cloud . compute . deprecated . RegionOperationId regionOperationId = ( ( com . google . cloud . compute . deprecated . RegionOperationId ) ( operation ) ) ; return computeRpc . deleteRegionOperation ( regionOperationId . getRegion ( ) , regionOperationId . getOperation ( ) ) ; case ZONE : com . google . cloud . compute . deprecated . ZoneOperationId zoneOperationId = ( ( com . google . cloud . compute . deprecated . ZoneOperationId ) ( operation ) ) ; return computeRpc . deleteZoneOperation ( zoneOperationId . getZone ( ) , zoneOperationId . getOperation ( ) ) ; case GLOBAL : return computeRpc . deleteGlobalOperation ( operation . getOperation ( ) ) ; default : throw new java . lang . IllegalArgumentException ( "Unexpected<sp>operation<sp>identity<sp>type" ) ; } } } , getOptions ( ) . getRetrySettings ( ) , com . google . cloud . compute . deprecated . EXCEPTION_HANDLER , getOptions ( ) . getClock ( ) ) ; } catch ( com . google . cloud . RetryHelper e ) { throw com . google . cloud . compute . deprecated . ComputeException . translateAndThrow ( e ) ; } }
org . junit . Assert . assertFalse ( compute . deleteOperation ( com . google . cloud . compute . deprecated . ComputeImplTest . ZONE_OPERATION_ID ) )