input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
get ( ) { org . oscm . billingservice . business . calculation . revenue . model . OverallCosts costs = org . oscm . billingservice . business . calculation . revenue . model . OverallCosts . newInstance ( ) ; costs = costs . add ( "EUR" , BigDecimal . TEN ) ; java . math . BigDecimal amount = costs . get ( "EUR" ) ; "<AssertPlaceHolder>" ; } get ( org . oscm . domobjects . BillingAdapter ) { org . oscm . domobjects . BillingAdapter ba = null ; if ( ( billingAdapter . getKey ( ) ) != 0L ) { ba = ds . find ( org . oscm . domobjects . BillingAdapter . class , billingAdapter . getKey ( ) ) ; } else { ba = ( ( org . oscm . domobjects . BillingAdapter ) ( ds . find ( billingAdapter ) ) ) ; } return ba ; } | org . junit . Assert . assertEquals ( BigDecimal . TEN , amount ) |
testSetValue ( ) { view . setHandle ( 0 , 4 ) ; view . valueChanged ( 0.0F ) ; view . setHandle ( 0 , 4 ) ; replay ( view ) ; scrollbar . bindToView ( view , 0.0F , 4.0F , viewSize , 1.0F , 4.0F ) ; scrollbar . setValue ( 4.0F ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( 0.0F , scrollbar . getValue ( ) ) |
debieraMostrarEstado ( ) { log . debug ( "Debiera<sp>mostrar<sp>Estado" ) ; mx . edu . um . mateo . colportor . model . Pais pais = new mx . edu . um . mateo . colportor . model . Pais ( "test3" ) ; currentSession ( ) . save ( pais ) ; mx . edu . um . mateo . colportor . model . Estado estado = new mx . edu . um . mateo . colportor . model . Estado ( mx . edu . um . mateo . general . utils . Constantes . NOMBRE ) ; estado . setPais ( pais ) ; estado = estadoDao . crea ( estado ) ; "<AssertPlaceHolder>" ; this . mockMvc . perform ( get ( ( ( ( mx . edu . um . mateo . general . utils . Constantes . PATH_ESTADO_VER ) + "/" ) + ( estado . getId ( ) ) ) ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( forwardedUrl ( ( ( "/WEB-INF/jsp/" + ( mx . edu . um . mateo . general . utils . Constantes . PATH_ESTADO_VER ) ) + ".jsp" ) ) ) . andExpect ( model ( ) . attributeExists ( Constantes . ADDATTRIBUTE_ESTADO ) ) ; } crea ( mx . edu . um . mateo . contabilidad . model . CuentaMayor ) { return crea ( cuentaMayor , null ) ; } | org . junit . Assert . assertNotNull ( estado ) |
trivialTestPiecesCount ( ) { org . dkf . jed2k . test . PiecePicker picker = new org . dkf . jed2k . test . PiecePicker ( 3 , 42 ) ; "<AssertPlaceHolder>" ; } getPieceCount ( ) { return pieceStatus . length ; } | org . junit . Assert . assertEquals ( 3 , picker . getPieceCount ( ) ) |
testGetShortFromString ( ) { short value = org . apache . activemq . artemis . utils . RandomUtil . randomShort ( ) ; org . apache . activemq . artemis . jms . client . ActiveMQMapMessage message = new org . apache . activemq . artemis . jms . client . ActiveMQMapMessage ( ) ; message . setString ( itemName , java . lang . Short . toString ( value ) ) ; "<AssertPlaceHolder>" ; } getShort ( java . lang . String ) { java . lang . Object value ; value = content . get ( name ) ; if ( value == null ) { return java . lang . Short . parseShort ( null ) ; } if ( value instanceof java . lang . Byte ) { return ( ( java . lang . Byte ) ( value ) ) . shortValue ( ) ; } else if ( value instanceof java . lang . Short ) { return ( ( java . lang . Short ) ( value ) ) . shortValue ( ) ; } else if ( value instanceof java . lang . String ) { return java . lang . Short . parseShort ( ( ( java . lang . String ) ( value ) ) ) ; } else { throw new javax . jms . MessageFormatException ( "Invalid<sp>conversion" ) ; } } | org . junit . Assert . assertEquals ( value , message . getShort ( itemName ) ) |
testConcurrency_03 ( ) { iot . jcypher . concurrency . Locking lockingStrategy = iot . jcypher . concurrency . Locking . NONE ; test . concurrency . ConcurrencyTest . initDB ( lockingStrategy ) ; j_smith . setFirstName ( "Johnny<sp>boy" ) ; errors = da1 . store ( j_smith ) ; "<AssertPlaceHolder>" ; if ( ( errors . size ( ) ) > 0 ) { printErrors ( errors ) ; } return ; } isEmpty ( ) { return ( ( ( this . localNodesById ) == null ) || ( ( this . localNodesById . size ( ) ) == 0 ) ) && ( ( ( this . localRelationsById ) == null ) || ( ( this . localRelationsById . size ( ) ) == 0 ) ) ; } | org . junit . Assert . assertTrue ( errors . isEmpty ( ) ) |
insertTest ( ) { org . easycassandra . bean . model . Person person = getPerson ( ) ; person . setName ( org . easycassandra . bean . PersonDAOTest . NAME ) ; person . setId ( org . easycassandra . bean . PersonDAOTest . FOUR ) ; person . setYear ( org . easycassandra . bean . PersonDAOTest . YEAR ) ; org . easycassandra . bean . model . Address address = getAddress ( ) ; person . setAddress ( address ) ; "<AssertPlaceHolder>" ; } insert ( T ) { return persistence . insert ( bean ) ; } | org . junit . Assert . assertTrue ( dao . insert ( person ) ) |
loopTest ( ) { soot . jimple . infoflow . IInfoflow infoflow = initInfoflow ( ) ; java . util . List < java . lang . String > epoints = new java . util . ArrayList < java . lang . String > ( ) ; epoints . add ( "<soot.jimple.infoflow.test.OtherTestCode:<sp>void<sp>loopTest()>" ) ; infoflow . computeInfoflow ( appPath , libPath , epoints , sources , sinks ) ; checkInfoflow ( infoflow , 1 ) ; "<AssertPlaceHolder>" ; } getResults ( ) { return this . results ; } | org . junit . Assert . assertEquals ( 1 , infoflow . getResults ( ) . size ( ) ) |
testParse ( ) { com . google . gson . Gson gson = new com . google . gson . Gson ( ) ; java . lang . String json = "" ; org . jinstagram . entity . common . InstagramErrorResponse result = org . jinstagram . entity . common . InstagramErrorResponse . parse ( gson , json ) ; "<AssertPlaceHolder>" ; } parse ( com . google . gson . Gson , java . lang . String ) { com . google . gson . JsonElement jsonElement = gson . fromJson ( json , com . google . gson . JsonElement . class ) ; com . google . gson . JsonElement metaMember = null ; if ( jsonElement != null ) { metaMember = jsonElement . getAsJsonObject ( ) . get ( "meta" ) ; } final org . jinstagram . entity . common . Meta meta ; if ( metaMember != null ) { meta = gson . fromJson ( metaMember , org . jinstagram . entity . common . Meta . class ) ; } else { meta = gson . fromJson ( jsonElement , org . jinstagram . entity . common . Meta . class ) ; } if ( ( ( meta . getCode ( ) ) != 0 ) && ( ( meta . getErrorType ( ) ) != null ) ) { return new org . jinstagram . entity . common . InstagramErrorResponse ( meta ) ; } else { return new org . jinstagram . entity . common . InstagramErrorResponse ( null ) ; } } | org . junit . Assert . assertNotNull ( result ) |
testStartAgent ( ) { console1 = new net . grinder . SingleConsole ( getFreePort ( ) ) ; console1 . start ( ) ; console1 . setReportPath ( new java . io . File ( "./tmp/console-home" ) ) ; "<AssertPlaceHolder>" ; net . grinder . common . GrinderProperties grinderProperties = new net . grinder . common . GrinderProperties ( ) ; grinderProperties . setInt ( GrinderProperties . CONSOLE_PORT , console1 . getConsolePort ( ) ) ; java . lang . String localHostAddress = net . grinder . util . NetworkUtils . getLocalHostAddress ( ) ; grinderProperties . setProperty ( GrinderProperties . CONSOLE_HOST , localHostAddress ) ; net . grinder . common . processidentity . AgentIdentity next = getAgentIdentity ( allAvailableAgents , 0 ) ; agentControllerServerDaemon . startAgent ( grinderProperties , next ) ; waitAndAssertUntilAgentAttachedTo ( console1 , 1 , 2 ) ; agentControllerServerDaemon . shutdown ( ) ; waitAndAssertUntilAgentAttachedTo ( console1 , 0 , 5 ) ; } getAllAttachedAgentsCount ( ) { return agentControllerServer . getComponent ( net . grinder . AgentProcessControlImplementation . class ) . getNumberOfLiveAgents ( ) ; } | org . junit . Assert . assertThat ( console1 . getAllAttachedAgentsCount ( ) , org . hamcrest . Matchers . is ( 0 ) ) |
shouldPassWhenANCVisitIsTheThirdOne ( ) { java . util . Map < java . lang . String , java . lang . String > fields = org . ei . drishti . common . util . EasyMap . create ( "ancVisitNumber" , "3" ) . map ( ) ; "<AssertPlaceHolder>" ; } apply ( org . ei . drishti . util . SafeMap ) { return new org . ei . drishti . service . reporting . ChildImmunization ( ) . isImmunizedWith ( ChildImmunizationFields . BCG_VALUE , reportFields ) ; } | org . junit . Assert . assertTrue ( rule . apply ( new org . ei . drishti . util . SafeMap ( fields ) ) ) |
testIpv4LocRouterId ( ) { java . util . List list = new java . util . ArrayList ( ) ; list . add ( org . onlab . packet . Ip4Address . valueOf ( 1 ) ) ; ospfLinkTed . setIpv4LocRouterId ( list ) ; "<AssertPlaceHolder>" ; } ipv4LocRouterId ( ) { return ipv4LocRouterId ; } | org . junit . Assert . assertThat ( ospfLinkTed . ipv4LocRouterId ( ) . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
shouldMapNodeWithoutToken ( ) { stubNodeResultSet ( ) ; given ( resultSet . wasNull ( ) ) . willReturn ( false ) ; annis . model . AnnisNode node = generator . mapNode ( resultSet , tableAccessStrategy , null ) ; "<AssertPlaceHolder>" ; } isToken ( ) { return token ; } | org . junit . Assert . assertThat ( node . isToken ( ) , org . hamcrest . Matchers . is ( true ) ) |
testFormatting ( ) { java . lang . String [ ] cases = new java . lang . String [ ] { "" , "" , "foo" 1 , "foo" , "$$" , "foo" 1 , "$$$" , "$foo" , "$<sp>$" , "foo<sp>foo" , "$:2181" , "foo:2181" , "http://$/" , "foo" 0 } ; for ( int i = 0 ; i < ( cases . length ) ; i += 2 ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; new co . cask . coopr . macro . Expression ( null , cases [ i ] , null ) . format ( "foo" , builder ) ; "<AssertPlaceHolder>" ; } } toString ( ) { return com . google . common . base . Objects . toStringHelper ( this ) . add ( "tenantId" , tenantId ) . add ( "userId" , userId ) . add ( "clusterId" , clusterId ) . add ( "clusterTemplate" , clusterTemplate ) . add ( "start" , start ) . add ( "end" , end ) . add ( "periodicity" , periodicity ) . add ( "timeUnit" , timeUnit ) . toString ( ) ; } | org . junit . Assert . assertEquals ( cases [ ( i + 1 ) ] , builder . toString ( ) ) |
testSerialization ( ) { org . jfree . data . function . NormalDistributionFunction2D f1 = new org . jfree . data . function . NormalDistributionFunction2D ( 1.0 , 2.0 ) ; org . jfree . data . function . NormalDistributionFunction2D f2 = ( ( org . jfree . data . function . NormalDistributionFunction2D ) ( org . jfree . chart . TestUtilities . serialised ( f1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( f1 , f2 ) |
testStart_Compiled ( ) { java . lang . String main = com . englishtown . vertx . guice . integration . DependencyInjectionVerticle . class . getName ( ) ; doTest ( main ) ; verifyZeroInteractions ( com . englishtown . vertx . guice . GuiceVerticleLoaderTest . logger ) ; "<AssertPlaceHolder>" ; } doTest ( java . lang . String ) { java . lang . ClassLoader cl = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; com . englishtown . vertx . guice . GuiceVerticleLoader loader = new com . englishtown . vertx . guice . GuiceVerticleLoader ( main , cl , parent ) ; loader . init ( vertx , context ) ; loader . start ( future ) ; verify ( verticle ) . init ( eq ( vertx ) , eq ( context ) ) ; verify ( verticle ) . start ( future ) ; verify ( parent ) . createChildInjector ( modulesCaptor . capture ( ) ) ; verify ( child ) . getInstance ( classCaptor . capture ( ) ) ; loader . stop ( future ) ; verify ( verticle ) . stop ( eq ( future ) ) ; return loader ; } | org . junit . Assert . assertEquals ( com . englishtown . vertx . guice . integration . DependencyInjectionVerticle . class , classCaptor . getValue ( ) ) |
testDeleteUser ( ) { qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . entityManager . getTransaction ( ) . begin ( ) ; int result = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . userResourceFacadeImp . deleteUser ( qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . user . getUserID ( ) ) ; qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . entityManager . getTransaction ( ) . commit ( ) ; "<AssertPlaceHolder>" ; qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestUsersResourceFacadeImp . user = null ; } getUserID ( ) { return userID ; } | org . junit . Assert . assertEquals ( 1 , result ) |
testSuccessfulPending ( ) { io . netty . util . concurrent . Promise < java . lang . Void > p = mock ( io . netty . util . concurrent . Promise . class ) ; io . netty . util . concurrent . PromiseAggregator < java . lang . Void , io . netty . util . concurrent . Future < java . lang . Void > > a = new io . netty . util . concurrent . PromiseAggregator < java . lang . Void , io . netty . util . concurrent . Future < java . lang . Void > > ( p ) ; io . netty . util . concurrent . Promise < java . lang . Void > p1 = mock ( io . netty . util . concurrent . Promise . class ) ; io . netty . util . concurrent . Promise < java . lang . Void > p2 = mock ( io . netty . util . concurrent . Promise . class ) ; when ( p1 . addListener ( a ) ) . thenReturn ( p1 ) ; when ( p2 . addListener ( a ) ) . thenReturn ( p2 ) ; when ( p1 . isSuccess ( ) ) . thenReturn ( true ) ; when ( p2 . isSuccess ( ) ) . thenReturn ( true ) ; when ( p . setSuccess ( null ) ) . thenReturn ( p ) ; "<AssertPlaceHolder>" ; a . operationComplete ( p1 ) ; a . operationComplete ( p2 ) ; verify ( p1 ) . addListener ( a ) ; verify ( p2 ) . addListener ( a ) ; verify ( p1 ) . isSuccess ( ) ; verify ( p2 ) . isSuccess ( ) ; verify ( p ) . setSuccess ( null ) ; } add ( java . lang . StringBuilder , java . lang . String , long ) { sb . append ( name ) ; sb . append ( '=' ) ; sb . append ( val ) ; sb . append ( ';' ) ; sb . append ( HttpConstants . SP_CHAR ) ; } | org . junit . Assert . assertThat ( a . add ( p1 , null , p2 ) , org . hamcrest . CoreMatchers . is ( a ) ) |
cancelTest ( ) { org . threadly . concurrent . future . SettableListenableFuture < java . lang . Object > slf = new org . threadly . concurrent . future . SettableListenableFuture ( ) ; slf . cancel ( false ) ; org . threadly . concurrent . future . ListenableFutureAdapterTask < java . lang . Object > adapter = new org . threadly . concurrent . future . ListenableFutureAdapterTask ( slf ) ; adapter . run ( ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return futureImp . isCancelled ( ) ; } | org . junit . Assert . assertTrue ( adapter . isCancelled ( ) ) |
setOwnerPreviousOwnerIsNullNoCollaboratorIsAddedAndOneIsDeleted ( ) { when ( this . helper . getStringProperty ( this . entityDoc , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . OWNER , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . OWNER_LABEL ) ) . thenReturn ( null ) ; when ( this . entityDoc . getXObject ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_CLASS , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_LABEL , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_STR , false ) ) . thenReturn ( this . collaboratorObject1 ) ; final boolean ownerSet = this . component . setOwner ( this . entity , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR ) ; verify ( this . entityDoc , times ( 1 ) ) . getXObject ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_CLASS , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_LABEL , org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_STR , false ) ; verify ( this . entityDoc , times ( 1 ) ) . removeXObject ( this . collaboratorObject1 ) ; verify ( this . entityDoc , never ( ) ) . newXObject ( eq ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR ) , eq ( this . context ) ) ; verify ( this . xwiki , times ( 1 ) ) . saveDocument ( this . entityDoc , ( "Set<sp>owner:<sp>" + ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . COLLABORATOR_STR ) ) , true , this . context ) ; "<AssertPlaceHolder>" ; } setOwner ( com . xpn . xwiki . doc . XWikiDocument , com . xpn . xwiki . doc . XWikiDocument ) { com . xpn . xwiki . objects . BaseObject owner = familyXDocument . newXObject ( Owner . CLASS_REFERENCE , this . context ) ; owner . setStringValue ( Owner . PROPERTY_NAME , this . getOwner ( patientXDoc ) ) ; } | org . junit . Assert . assertTrue ( ownerSet ) |
getNumberValueFromJsonObject_input_key_null ( ) { java . lang . String jsonString = "{\"deviceId\":\"xxx-device\",\"generationId\":\"111111111111111111\",\"etag\":\"MA==\",\"connectionState\":\"Disconnected\",\"status\":\"Disabled\",\"statusReason\":null,\"connectionStateUpdatedTime\":\"0001-01-01T00:00:00\",\"statusUpdatedTime\":\"0001-01-01T00:00:00\",\"lastActivityTime\":\"0001-01-01T00:00:00\",\"cloudToDeviceMessageCount\":0,\"authentication\":{\"symmetricKey\":{\"primaryKey\":\"AAABBBCCC111222333444000\",\"secondaryKey\":\"111222333444555AAABBBCCC\"}}}" ; java . io . StringReader stringReader = new java . io . StringReader ( jsonString ) ; javax . json . JsonReader jsonReader = javax . json . Json . createReader ( stringReader ) ; javax . json . JsonObject jsonObject = jsonReader . readObject ( ) ; java . lang . String key = null ; long expResult = 0 ; long result = com . microsoft . azure . sdk . iot . provisioning . service . Tools . getNumberValueFromJsonObject ( jsonObject , key ) ; "<AssertPlaceHolder>" ; } getNumberValueFromJsonObject ( javax . json . JsonObject , java . lang . String ) { long retVal ; javax . json . JsonNumber jsonNumber = null ; if ( ( ( ( jsonObject == null ) || ( jsonObject == ( javax . json . JsonObject . NULL ) ) ) || ( key == null ) ) || ( ( key . length ( ) ) == 0 ) ) { retVal = 0 ; } else { javax . json . JsonValue jsonValue = jsonObject . get ( key ) ; if ( jsonValue != ( javax . json . JsonValue . NULL ) ) { jsonNumber = jsonObject . getJsonNumber ( key ) ; if ( jsonNumber != null ) { retVal = jsonNumber . longValue ( ) ; } else { retVal = 0 ; } } else { retVal = 0 ; } } return retVal ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testParseNull ( ) { org . openl . rules . convertor . String2NumberConverter < java . lang . Number > converter = getNumberConverter ( ) ; "<AssertPlaceHolder>" ; } parse ( org . openl . rules . table . ILogicalTable , org . openl . rules . structure . ITableObject ) { if ( ( ( selector ) != null ) && ( ! ( selector . select ( unparsedTable ) ) ) ) { return unparsedTable ; } return parseInternal ( unparsedTable , tobj ) ; } | org . junit . Assert . assertNull ( converter . parse ( null , null ) ) |
testSerialization3 ( ) { org . jfree . data . xy . XYSeriesCollection dataset = new org . jfree . data . xy . XYSeriesCollection ( ) ; org . jfree . chart . JFreeChart chart = org . jfree . chart . ChartFactory . createXYLineChart ( "Test<sp>Chart" , "Domain<sp>Axis" , "Range<sp>Axis" , dataset ) ; org . jfree . chart . JFreeChart chart2 = ( ( org . jfree . chart . JFreeChart ) ( org . jfree . chart . TestUtils . serialised ( chart ) ) ) ; "<AssertPlaceHolder>" ; try { chart2 . createBufferedImage ( 300 , 200 ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( "No<sp>exception<sp>should<sp>be<sp>thrown." ) ; } } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( chart , chart2 ) |
testSmartDataThreshold1 ( ) { com . vmware . vrack . hms . boardservice . ib . api . HddInfoHelperTest . logger . info ( "Testing<sp>hms-inband<sp>HddInfoHelperTest::isSmartDataBeyondThreshold1" ) ; try { com . vmware . vrack . hms . common . servernodes . api . hdd . HddSMARTData hddSMARTData = new com . vmware . vrack . hms . common . servernodes . api . hdd . HddSMARTData ( ) ; hddSMARTData . setParameter ( "Raw<sp>Read<sp>Error<sp>Rate" ) ; hddSMARTData . setValue ( "0" ) ; hddSMARTData . setThreshold ( "0" ) ; hddSMARTData . setWorst ( "0" ) ; boolean isDataConcerning = com . vmware . vrack . hms . boardservice . ib . api . HddInfoHelper . isSmartDataBeyondThreshold ( hddSMARTData , false ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { com . vmware . vrack . hms . boardservice . ib . api . HddInfoHelperTest . logger . info ( "Test<sp>hms-inband<sp>HddInfoHelperTest::isSmartDataBeyondThreshold1<sp>Failed" ) ; e . printStackTrace ( ) ; } } isSmartDataBeyondThreshold ( com . vmware . vrack . hms . common . servernodes . api . hdd . HddSMARTData , boolean ) { boolean isDataConcerning = false ; if ( hddSMARTData != null ) { java . lang . String thresholdString = hddSMARTData . getThreshold ( ) ; java . lang . String valueString = hddSMARTData . getValue ( ) ; if ( valueString != null ) { if ( thresholdString != null ) { java . lang . Integer value = null ; java . lang . Integer threshold = null ; try { value = java . lang . Integer . parseInt ( valueString ) ; threshold = java . lang . Integer . parseInt ( thresholdString ) ; } catch ( java . lang . Exception e ) { return false ; } if ( isValueGreaterThanThresholdConcerning ) { if ( ( value >= threshold ) && ( threshold != 0 ) ) { isDataConcerning = true ; } } else { if ( ( value <= threshold ) && ( threshold != 0 ) ) { isDataConcerning = true ; } } } } } return isDataConcerning ; } | org . junit . Assert . assertFalse ( isDataConcerning ) |
testRangeFormatting ( ) { org . eclipse . jdt . core . ICompilationUnit unit = getWorkingCopy ( "src/org/sample/Baz.java" , ( "package<sp>org.sample;\n" + ( ( ( "<sp>public<sp>class<sp>Baz<sp>{\n" + "\tvoid<sp>foo(){\n" ) + "<sp>}\n" ) + "\t}\n" ) ) ) ; java . lang . String uri = org . eclipse . jdt . ls . core . internal . JDTUtils . toURI ( unit ) ; org . eclipse . lsp4j . TextDocumentIdentifier textDocument = new org . eclipse . lsp4j . TextDocumentIdentifier ( uri ) ; org . eclipse . lsp4j . Range range = new org . eclipse . lsp4j . Range ( new org . eclipse . lsp4j . Position ( 2 , 0 ) , new org . eclipse . lsp4j . Position ( 3 , 5 ) ) ; org . eclipse . lsp4j . DocumentRangeFormattingParams params = new org . eclipse . lsp4j . DocumentRangeFormattingParams ( range ) ; params . setTextDocument ( textDocument ) ; params . setOptions ( new org . eclipse . lsp4j . FormattingOptions ( 3 , true ) ) ; java . util . List < ? extends org . eclipse . lsp4j . TextEdit > edits = server . rangeFormatting ( params ) . get ( ) ; java . lang . String expectedText = "package<sp>org.sample;\n" + ( ( ( "<sp>public<sp>class<sp>Baz<sp>{\n" + "<sp>void<sp>foo()<sp>{\n" ) + "<sp>}\n" ) + "\t}\n" ) ; java . lang . String newText = org . eclipse . jdt . ls . core . internal . TextEditUtil . apply ( unit , edits ) ; "<AssertPlaceHolder>" ; } apply ( org . eclipse . jdt . core . ICompilationUnit , java . util . Collection ) { org . eclipse . core . runtime . Assert . isNotNull ( cu ) ; org . eclipse . core . runtime . Assert . isNotNull ( edits ) ; return org . eclipse . jdt . ls . core . internal . TextEditUtil . apply ( cu . getSource ( ) , edits ) ; } | org . junit . Assert . assertEquals ( expectedText , newText ) |
testPiPaperExample ( ) { theory . intervals . RealSolver ba = new theory . intervals . RealSolver ( ) ; java . lang . Integer init = 0 ; java . util . List < java . lang . Integer > fin = java . util . Arrays . asList ( 0 , 1 , 2 , 3 ) ; java . util . List < automata . sfa . SFAMove < theory . intervals . RealPred , java . lang . Double > > trans = new java . util . ArrayList < automata . sfa . SFAMove < theory . intervals . RealPred , java . lang . Double > > ( ) ; trans . add ( new automata . sfa . SFAInputMove < theory . intervals . RealPred , java . lang . Double > ( 0 , 1 , new theory . intervals . RealPred ( 0.0 , false , ( ( java . lang . Math . PI ) / 2 ) , true ) ) ) ; trans . add ( new automata . sfa . SFAInputMove < theory . intervals . RealPred , java . lang . Double > ( 1 , 2 , new theory . intervals . RealPred ( ( ( java . lang . Math . PI ) / 2 ) , false , java . lang . Math . PI , true ) ) ) ; trans . add ( new automata . sfa . SFAInputMove < theory . intervals . RealPred , java . lang . Double > ( 2 , 3 , new theory . intervals . RealPred ( java . lang . Math . PI , false , ( ( 3 * ( java . lang . Math . PI ) ) / 2 ) , true ) ) ) ; trans . add ( new automata . sfa . SFAInputMove < theory . intervals . RealPred , java . lang . Double > ( 3 , 0 , new theory . intervals . RealPred ( ( ( 3 * ( java . lang . Math . PI ) ) / 2 ) , false , ( 2 * ( java . lang . Math . PI ) ) , true ) ) ) ; automata . sfa . SFA < theory . intervals . RealPred , java . lang . Double > given = automata . sfa . SFA . MkSFA ( trans , init , fin , ba , false ) ; learning_symbolic_ce . sfa . SymbolicLearner < theory . intervals . RealPred , java . lang . Double > ell = new learning_symbolic_ce . sfa . SymbolicLearner < theory . intervals . RealPred , java . lang . Double > ( ) ; learning_symbolic_ce . sfa . SymbolicOracle < theory . intervals . RealPred , java . lang . Double > o = new learning_symbolic_ce . sfa . SinglePathSFAOracle < theory . intervals . RealPred , java . lang . Double > ( given , ba ) ; automata . sfa . SFA < theory . intervals . RealPred , java . lang . Double > learned = ell . learn ( o , ba ) ; "<AssertPlaceHolder>" ; } isEquivalentTo ( automata . sfa . SFA , theory . BooleanAlgebra ) { return automata . sfa . SFA . areEquivalent ( this , aut , ba ) ; } | org . junit . Assert . assertTrue ( learned . isEquivalentTo ( given , ba ) ) |
testEmptyFaultSoap11 ( ) { java . lang . String emptyFaultSoap11 = org . reficio . ws . legacy . SoapLegacyFacade . buildEmptyFault ( SoapLegacyFacade . Soap . SOAP_1_1 , org . reficio . ws . builder . MessageComplianceTest . context ) ; org . reficio . ws . builder . MessageComplianceTest . log . info ( ( "\n" + emptyFaultSoap11 ) ) ; java . lang . String expectedMsg = org . reficio . ws . builder . MessageComplianceTest . getContent ( "messages" , "EmptyFault11.xml" ) ; "<AssertPlaceHolder>" ; } getContent ( java . lang . String , java . lang . String ) { java . net . URL fileUrl = org . reficio . ws . common . ResourceUtils . getResourceWithAbsolutePackagePath ( folderPath , fileName ) ; java . io . File file = null ; try { file = new java . io . File ( fileUrl . toURI ( ) ) ; } catch ( java . net . URISyntaxException e ) { file = new java . io . File ( fileUrl . getPath ( ) ) ; } try { return org . apache . commons . io . FileUtils . readFileToString ( file ) . trim ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( expectedMsg , emptyFaultSoap11 ) |
testIsFilterAvailableWithoutDDR ( ) { this . config . setSampleRate ( 1 ) ; "<AssertPlaceHolder>" ; } isFilterAvailable ( ) { boolean result = ! ( isDoubleDataRateEnabled ( ) ) ; if ( result && ( ( this . deviceProfile ) != null ) ) { result = this . deviceProfile . isNoiseFilterSupported ( ) ; } return result ; } | org . junit . Assert . assertTrue ( this . config . isFilterAvailable ( ) ) |
testCreateClusterWithHostMapping ( ) { java . lang . String cluster1 = org . apache . ambari . server . controller . AmbariManagementControllerTest . getUniqueName ( ) ; java . lang . String host1 = org . apache . ambari . server . controller . AmbariManagementControllerTest . getUniqueName ( ) ; java . lang . String host2 = org . apache . ambari . server . controller . AmbariManagementControllerTest . getUniqueName ( ) ; java . util . Set < java . lang . String > hostNames = new java . util . HashSet ( ) ; hostNames . add ( host1 ) ; hostNames . add ( host2 ) ; org . apache . ambari . server . controller . ClusterRequest r = new org . apache . ambari . server . controller . ClusterRequest ( null , cluster1 , "HDP-0.1" , hostNames ) ; try { org . apache . ambari . server . controller . AmbariManagementControllerTest . controller . createCluster ( r ) ; org . junit . Assert . fail ( "Expected<sp>create<sp>cluster<sp>to<sp>fail<sp>for<sp>invalid<sp>hosts" ) ; } catch ( java . lang . Exception e ) { } try { org . apache . ambari . server . controller . AmbariManagementControllerTest . clusters . getCluster ( cluster1 ) ; org . junit . Assert . fail ( "Expected<sp>to<sp>fail<sp>for<sp>non<sp>created<sp>cluster" ) ; } catch ( org . apache . ambari . server . ClusterNotFoundException e ) { } org . apache . ambari . server . controller . AmbariManagementControllerTest . clusters . addHost ( host1 ) ; org . apache . ambari . server . controller . AmbariManagementControllerTest . clusters . addHost ( host2 ) ; setOsFamily ( org . apache . ambari . server . controller . AmbariManagementControllerTest . clusters . getHost ( host1 ) , "redhat" , "6.3" ) ; setOsFamily ( org . apache . ambari . server . controller . AmbariManagementControllerTest . clusters . getHost ( host2 ) , "redhat" , "6.3" ) ; org . apache . ambari . server . controller . AmbariManagementControllerTest . controller . createCluster ( r ) ; "<AssertPlaceHolder>" ; } getCluster ( java . lang . String ) { if ( ( ( ( org . apache . ambari . server . controller . utilities . state . DefaultServiceCalculatedState . clustersProvider ) != null ) && ( clusterName != null ) ) && ( ( clusterName . length ( ) ) > 0 ) ) { org . apache . ambari . server . state . Clusters clusters = org . apache . ambari . server . controller . utilities . state . DefaultServiceCalculatedState . clustersProvider . get ( ) ; if ( clusters != null ) { return clusters . getCluster ( clusterName ) ; } } return null ; } | org . junit . Assert . assertNotNull ( org . apache . ambari . server . controller . AmbariManagementControllerTest . clusters . getCluster ( cluster1 ) ) |
testSendPrepared ( ) { final java . lang . String messageId = "testSendPrepared" ; final com . arjuna . webservices11 . wsarj . InstanceIdentifier instanceIdentifier = new com . arjuna . webservices11 . wsarj . InstanceIdentifier ( "1" ) ; javax . xml . ws . wsaddressing . W3CEndpointReference coordinatorEndpoint = com . arjuna . wst . tests . TestUtil . getCoordinatorEndpoint ( instanceIdentifier . getInstanceIdentifier ( ) ) ; final org . jboss . ws . api . addressing . MAP map = com . arjuna . webservices11 . wsaddr . AddressingHelper . createRequestContext ( TestUtil . coordinatorServiceURI , messageId ) ; com . arjuna . webservices11 . wsat . client . CoordinatorClient . getClient ( ) . sendPrepared ( coordinatorEndpoint , map , new com . arjuna . webservices11 . wsarj . InstanceIdentifier ( "sender" ) ) ; com . arjuna . wst . tests . arq . TestCoordinatorProcessor . CoordinatorDetails details = testCoordinatorProcessor . getCoordinatorDetails ( messageId , 10000 ) ; "<AssertPlaceHolder>" ; checkDetails ( details , true , true , messageId , instanceIdentifier ) ; } hasPrepared ( ) { return prepared ; } | org . junit . Assert . assertTrue ( details . hasPrepared ( ) ) |
testMultipleConcurrentEPs4 ( ) { final org . kie . api . runtime . KieSession ksession = getKieSessionWith3Segments ( ) ; java . util . List < java . lang . String > results = new java . util . ArrayList ( ) ; ksession . setGlobal ( "results" , results ) ; org . drools . compiler . integrationtests . PhreakConcurrencyTest . EPManipulator4 [ ] epManipulators = new org . drools . compiler . integrationtests . PhreakConcurrencyTest . EPManipulator4 [ 9 ] ; java . util . concurrent . CyclicBarrier barrier = new java . util . concurrent . CyclicBarrier ( 9 , new org . drools . compiler . integrationtests . PhreakConcurrencyTest . SegmentChecker ( epManipulators ) ) ; for ( int i = 0 ; i < 9 ; i ++ ) { epManipulators [ i ] = new org . drools . compiler . integrationtests . PhreakConcurrencyTest . EPManipulator4 ( ksession , ( i + 1 ) , barrier ) ; } new java . lang . Thread ( ksession :: fireUntilHalt ) . start ( ) ; try { for ( int deleteIndex = 0 ; deleteIndex < 11 ; deleteIndex ++ ) { boolean success = true ; final java . util . concurrent . ExecutorService executor = java . util . concurrent . Executors . newFixedThreadPool ( 9 , ( r ) -> { java . lang . Thread t = new java . lang . Thread ( r ) ; t . setDaemon ( true ) ; return t ; } ) ; try { java . util . concurrent . CompletionService < java . lang . Boolean > ecs = new java . util . concurrent . ExecutorCompletionService ( executor ) ; for ( int i = 0 ; i < 9 ; i ++ ) { ecs . submit ( epManipulators [ i ] . setDeleteIndex ( ( deleteIndex % 10 ) ) ) ; } for ( int i = 0 ; i < 9 ; i ++ ) { try { success = ( ecs . take ( ) . get ( ) ) && success ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } } "<AssertPlaceHolder>" ; } finally { executor . shutdownNow ( ) ; } } } finally { ksession . halt ( ) ; ksession . dispose ( ) ; } } get ( ) { return t ; } | org . junit . Assert . assertTrue ( success ) |
interceptCall_restoresIfNextThrows ( ) { io . grpc . Context origContext = io . grpc . Context . current ( ) ; try { io . grpc . Contexts . interceptCall ( uniqueContext , call , headers , new io . grpc . ServerCallHandler < java . lang . Object , java . lang . Object > ( ) { @ io . grpc . Override public io . grpc . ServerCall . Listener < java . lang . Object > startCall ( io . grpc . ServerCall < java . lang . Object , java . lang . Object > call , io . grpc . Metadata headers ) { throw new java . lang . RuntimeException ( ) ; } } ) ; org . junit . Assert . fail ( "Expected<sp>exception" ) ; } catch ( java . lang . RuntimeException expected ) { } "<AssertPlaceHolder>" ; } current ( ) { return null ; } | org . junit . Assert . assertSame ( origContext , io . grpc . Context . current ( ) ) |
testReturnEmptyCollectionOnNamedClusterServiceThrowMetaStoreException ( ) { org . pentaho . big . data . api . cluster . NamedClusterService namedClusterService = mock ( org . pentaho . big . data . api . cluster . NamedClusterService . class ) ; org . pentaho . big . data . kettle . plugins . oozie . OozieJobExecutorJobEntry jobEntry = new org . pentaho . big . data . kettle . plugins . oozie . OozieJobExecutorJobEntry ( namedClusterService , mock ( org . pentaho . runtime . test . action . RuntimeTestActionService . class ) , mock ( org . pentaho . runtime . test . RuntimeTester . class ) , mock ( org . pentaho . big . data . api . cluster . service . locator . NamedClusterServiceLocator . class ) ) ; org . pentaho . big . data . kettle . plugins . oozie . OozieJobExecutorJobEntryController controller = new org . pentaho . big . data . kettle . plugins . oozie . OozieJobExecutorJobEntryController ( new org . pentaho . di . job . JobMeta ( ) , new org . pentaho . ui . xul . impl . XulFragmentContainer ( null ) , jobEntry , new org . pentaho . ui . xul . binding . DefaultBindingFactory ( ) , delegate ) ; when ( jobEntry . getNamedClusterService ( ) . list ( anyObject ( ) ) ) . thenThrow ( new org . pentaho . metastore . api . exceptions . MetaStoreException ( ) ) ; java . util . List < org . pentaho . big . data . api . cluster . NamedCluster > namedClusters = controller . getNamedClusters ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return getPropertyNames ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( namedClusters . size ( ) , 0 ) |
testRestrictionsReturnedInClosure ( ) { owltools . graph . OWLGraphWrapper g = getOntologyWrapper ( ) ; g . config . isGraphReasonedAndRelaxed = false ; org . semanticweb . owlapi . model . OWLObject obj = g . getOWLObject ( "http://example.org#deformed_hippocampus" ) ; boolean ok = false ; for ( owltools . graph . OWLGraphEdge e : g . getOutgoingEdgesClosureReflexive ( obj ) ) { if ( owltools . graph . Ancestors2Test . RENDER_ONTOLOGY_FLAG ) { System . out . println ( e ) ; } if ( ( e . getTarget ( ) ) instanceof org . semanticweb . owlapi . model . OWLRestriction ) ok = true ; } "<AssertPlaceHolder>" ; } getTarget ( ) { return target ; } | org . junit . Assert . assertTrue ( ok ) |
testCastCharToByte ( ) { byte expected = org . stjs . generator . exec . ints . CharToByte . method ( CharToByte . BIG_CHAR ) ; double expectedDouble = ( ( double ) ( expected ) ) ; "<AssertPlaceHolder>" ; } executeAndReturnNumber ( java . lang . Class ) { return executeAndReturnNumber ( clazz , null ) ; } | org . junit . Assert . assertEquals ( expectedDouble , executeAndReturnNumber ( org . stjs . generator . exec . ints . CharToByte . class ) , 0 ) |
testCreateHeaderWithSemicolon ( ) { exporter . setDelimiter ( ';' ) ; java . lang . String [ ] elements = new java . lang . String [ ] { "One" , "Two" , "Three" } ; java . lang . String expected = "\"One\";\"Two\";\"Three\"" ; "<AssertPlaceHolder>" ; } createHeader ( java . lang . String [ ] ) { java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; for ( int i = 0 ; i < ( elements . length ) ; i ++ ) { java . lang . String s = elements [ i ] ; sb . append ( "\"" ) ; sb . append ( s ) ; sb . append ( "\"" ) ; if ( i < ( ( elements . length ) - 1 ) ) { sb . append ( fDelimiter ) ; } } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , exporter . createHeader ( elements ) ) |
testVoidAndReturnedVoidAreTheExactSame ( ) { try { com . laytonsmith . core . environments . Environment env = com . laytonsmith . core . Static . GenerateStandaloneEnvironment ( true ) ; com . laytonsmith . core . natives . interfaces . Mixed returnedVoid = new ArrayHandling . array_insert ( ) . exec ( Target . UNKNOWN , env , com . laytonsmith . testing . C . Array ( ) , com . laytonsmith . testing . C . String ( "" ) , com . laytonsmith . testing . C . Int ( 0 ) ) ; com . laytonsmith . core . constructs . Construct voidKeyword = com . laytonsmith . core . Static . resolveConstruct ( "void" , Target . UNKNOWN ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( System . err ) ; throw e ; } } resolveConstruct ( java . lang . String , com . laytonsmith . core . constructs . Target ) { return com . laytonsmith . core . Static . resolveConstruct ( val , t , false ) ; } | org . junit . Assert . assertTrue ( ( returnedVoid == voidKeyword ) ) |
test_min_long_long ( ) { long result = server . bounce_long_long ( - 9223372036854775808L ) ; "<AssertPlaceHolder>" ; } bounce_long_long ( long ) { return x ; } | org . junit . Assert . assertEquals ( - 9223372036854775808L , result ) |
getEffectiveExceptionTypes ( ) { "<AssertPlaceHolder>" ; } getEffectiveExceptionTypes ( ) { return effectiveExceptionTypes ; } | org . junit . Assert . assertEquals ( effectiveExceptionTypes , method . getEffectiveExceptionTypes ( ) . toString ( ) ) |
testEvaluationNoContentFields ( ) { java . lang . String query = buildFunction ( ContentFunctions . CONTENT_WITHIN_FUNCTION_NAME , "1" , Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , "'dog'" , "'cat'" ) ; org . apache . commons . jexl2 . Expression expr = datawave . query . jexl . functions . ContentFunctionsTest . engine . createExpression ( query ) ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list1 ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list2 ; list1 = asList ( java . util . Arrays . asList ( 1 , 2 , 3 ) , java . util . Arrays . asList ( 0 , 0 , 0 ) ) ; list2 = asList ( java . util . Arrays . asList ( 5 , 6 , 7 ) , java . util . Arrays . asList ( 0 , 0 , 3 ) ) ; termOffSetMap . put ( "dog" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , false , eventId ) , list1 ) ) ) ; termOffSetMap . put ( "cat" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , false , eventId ) , list2 ) ) ) ; context . set ( Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , termOffSetMap ) ; java . lang . Object o = expr . evaluate ( context ) ; "<AssertPlaceHolder>" ; } expect ( java . lang . Object , java . lang . Boolean ) { if ( null == result ) { return Boolean . FALSE . equals ( expected ) ; } if ( result instanceof java . lang . Boolean ) { return result . equals ( expected ) ; } return false ; } | org . junit . Assert . assertTrue ( datawave . query . jexl . functions . ContentFunctionsTest . expect ( o , false ) ) |
isNameSecondCategoryShowNull_NameNull ( ) { givenModel ( newCategories ( true , "red" , "blue" ) , noEntries ( ) ) ; boolean result = ctrl . isNameSecondCategoryShowNull ( ) ; "<AssertPlaceHolder>" ; } isNameSecondCategoryShowNull ( ) { return ( ( model . getNameSecondCategory ( ) ) == null ) || ( model . getNameSecondCategory ( ) . isEmpty ( ) ) ; } | org . junit . Assert . assertTrue ( result ) |
testBuildWithParametersAndDisabledDefaultConstraintsWithOrderBy ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . enrolment . Enrolment enrolment = new org . lnu . is . domain . enrolment . Enrolment ( ) ; org . lnu . is . domain . specoffer . SpecOfferWave specOfferWave = new org . lnu . is . domain . specoffer . SpecOfferWave ( ) ; org . lnu . is . domain . enrolment . status . type . EnrolmentStatusType enrolmentStatusType = new org . lnu . is . domain . enrolment . status . type . EnrolmentStatusType ( ) ; org . lnu . is . domain . enrolment . status . EnrolmentStatus context = new org . lnu . is . domain . enrolment . status . EnrolmentStatus ( ) ; context . setEnrolment ( enrolment ) ; context . setSpecOfferWave ( specOfferWave ) ; context . setEnrolmentStatusType ( enrolmentStatusType ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "enrolment" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "specOfferWave" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "enrolmentStatusType" , org . lnu . is . pagination . OrderByType . ASC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 , orderBy3 ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>EnrolmentStatus<sp>e<sp>WHERE<sp>(<sp>e.enrolment<sp>=<sp>:enrolment<sp>AND<sp>e.specOfferWave<sp>=:specOfferWave<sp>AND<sp>e.enrolmentStatusType<sp>=:enrolmentStatusType<sp>)<sp>ORDER<sp>BY<sp>e.enrolment<sp>ASC,<sp>e.specOfferWave<sp>DESC,<sp>e.enrolmentStatusType<sp>ASC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . enrolment . status . EnrolmentStatus > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
testGetWikidataFormId ( ) { org . wikidata . wdtk . datamodel . helpers . FormIdValue o1 = org . wikidata . wdtk . datamodel . helpers . Datamodel . makeWikidataFormIdValue ( "L42-F1" ) ; org . wikidata . wdtk . datamodel . helpers . FormIdValue o2 = factory . getFormIdValue ( "L42-F1" , "http://www.wikidata.org/entity/" ) ; "<AssertPlaceHolder>" ; } getFormIdValue ( java . lang . String , java . lang . String ) { return new org . wikidata . wdtk . datamodel . implementation . FormIdValueImpl ( id , siteIri ) ; } | org . junit . Assert . assertEquals ( o1 , o2 ) |
test1 ( ) { int result = spl . shortest_path_length ( java_testcases . SHORTEST_PATH_LENGTH_TEST . length_by_edge , java_testcases . SHORTEST_PATH_LENGTH_TEST . node0 , java_testcases . SHORTEST_PATH_LENGTH_TEST . node1 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 4 , result ) |
testScript ( ) { try ( final io . vertigo . commons . transaction . VTransactionWritable transaction = transactionManager . createCurrentTransaction ( ) ) { final io . vertigo . dynamo . task . metamodel . TaskDefinition taskDefinition = registerTaskObject ( "TK_SCRIPT_TEST" , "select<sp>*<sp>from<sp>SUPER_HERO<sp><%if(false)<sp>{%>where<sp>ID<sp>=<sp>#DTO_SUPER_HERO.ID#<%}%>" ) ; final io . vertigo . dynamo . task . data . domain . SuperHero superHero = io . vertigo . dynamo . task . x . TaskEngineSelectDynamicTest . createSuperHero ( ( 10001L + 1 ) ) ; final io . vertigo . dynamo . task . model . Task task = io . vertigo . dynamo . task . model . Task . builder ( taskDefinition ) . addValue ( io . vertigo . dynamo . task . x . TaskEngineSelectDynamicTest . DTO_SUPER_HERO , superHero ) . build ( ) ; final io . vertigo . dynamo . domain . model . DtList < io . vertigo . dynamo . task . data . domain . SuperHero > resultList = taskManager . execute ( task ) . getResult ( ) ; "<AssertPlaceHolder>" ; } } size ( ) { return lines . size ( ) ; } | org . junit . Assert . assertEquals ( 10 , resultList . size ( ) ) |
deleteAllDataElements_empty_emptyAfterwards ( ) { dbHandler . deleteAllDataElements ( ) ; "<AssertPlaceHolder>" ; } getDataElementCount ( ) { final android . database . Cursor cursor = getReadableDatabase ( ) . rawQuery ( ( "SELECT<sp>COUNT(1)<sp>FROM<sp>" + ( io . github . data4all . handler . DataBaseHandler . TABLE_DATAELEMENT ) ) , null ) ; cursor . moveToNext ( ) ; final int count = cursor . getInt ( 0 ) ; cursor . close ( ) ; return count ; } | org . junit . Assert . assertEquals ( 0 , dbHandler . getDataElementCount ( ) ) |
testWriteToSequencefile ( ) { org . apache . hadoop . mapred . JobConf conf = new org . apache . hadoop . mapred . JobConf ( org . apache . hadoop . mapred . TestJavaSerialization . class ) ; conf . setJobName ( "JavaSerialization" ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( conf ) ; cleanAndCreateInput ( fs ) ; conf . set ( "io.serializations" , ( "org.apache.hadoop.io.serializer.JavaSerialization," + "org.apache.hadoop.io.serializer.WritableSerialization" ) ) ; conf . setInputFormat ( org . apache . hadoop . mapred . TextInputFormat . class ) ; conf . setOutputFormat ( org . apache . hadoop . mapred . SequenceFileOutputFormat . class ) ; conf . setOutputKeyClass ( java . lang . String . class ) ; conf . setOutputValueClass ( org . apache . hadoop . mapred . Long . class ) ; conf . setOutputKeyComparatorClass ( org . apache . hadoop . io . serializer . JavaSerializationComparator . class ) ; conf . setMapperClass ( org . apache . hadoop . mapred . TestJavaSerialization . WordCountMapper . class ) ; conf . setReducerClass ( org . apache . hadoop . mapred . TestJavaSerialization . SumReducer . class ) ; conf . set ( MRConfig . FRAMEWORK_NAME , MRConfig . LOCAL_FRAMEWORK_NAME ) ; org . apache . hadoop . mapred . FileInputFormat . setInputPaths ( conf , INPUT_DIR ) ; org . apache . hadoop . mapred . FileOutputFormat . setOutputPath ( conf , OUTPUT_DIR ) ; org . apache . hadoop . mapred . JobClient . runJob ( conf ) ; org . apache . hadoop . fs . Path [ ] outputFiles = org . apache . hadoop . fs . FileUtil . stat2Paths ( fs . listStatus ( OUTPUT_DIR , new org . apache . hadoop . mapred . Utils . OutputFileUtils . OutputFilesFilter ( ) ) ) ; "<AssertPlaceHolder>" ; } listStatus ( org . apache . commons . net . ftp . FTPClient , org . apache . hadoop . fs . Path ) { org . apache . hadoop . fs . Path workDir = new org . apache . hadoop . fs . Path ( client . printWorkingDirectory ( ) ) ; org . apache . hadoop . fs . Path absolute = makeAbsolute ( workDir , file ) ; org . apache . hadoop . fs . FileStatus fileStat = getFileStatus ( client , absolute ) ; if ( fileStat . isFile ( ) ) { return new org . apache . hadoop . fs . FileStatus [ ] { fileStat } ; } org . apache . commons . net . ftp . FTPFile [ ] ftpFiles = client . listFiles ( absolute . toUri ( ) . getPath ( ) ) ; org . apache . hadoop . fs . FileStatus [ ] fileStats = new org . apache . hadoop . fs . FileStatus [ ftpFiles . length ] ; for ( int i = 0 ; i < ( ftpFiles . length ) ; i ++ ) { fileStats [ i ] = getFileStatus ( ftpFiles [ i ] , absolute ) ; } return fileStats ; } | org . junit . Assert . assertEquals ( 1 , outputFiles . length ) |
sendReadsStatusCode ( com . microsoft . azure . sdk . iot . device . transport . https . HttpsConnection , java . net . URL ) { final com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod httpsMethod = com . microsoft . azure . sdk . iot . device . transport . https . HttpsMethod . GET ; final byte [ ] body = new byte [ 0 ] ; final int status = 204 ; new tests . unit . com . microsoft . azure . sdk . iot . device . transport . https . NonStrictExpectations ( ) { { mockUrl . getProtocol ( ) ; result = "https" ; mockConn . getResponseStatus ( ) ; result = status ; } } ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsRequest request = new com . microsoft . azure . sdk . iot . device . transport . https . HttpsRequest ( mockUrl , httpsMethod , body , "" ) ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsResponse response = request . send ( ) ; int testStatus = response . getStatus ( ) ; final int expectedStatus = status ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; } | org . junit . Assert . assertThat ( testStatus , org . hamcrest . CoreMatchers . is ( expectedStatus ) ) |
toSimpleListValue_null ( ) { "<AssertPlaceHolder>" ; } toSimpleListValue ( java . util . List ) { if ( values == null ) { return null ; } java . util . List < T > result = new java . util . ArrayList < T > ( values . size ( ) ) ; for ( software . amazon . awssdk . services . dynamodb . model . AttributeValue v : values ) { T t = software . amazon . awssdk . services . dynamodb . document . internal . InternalUtils . toSimpleValue ( v ) ; result . add ( t ) ; } return result ; } | org . junit . Assert . assertNull ( software . amazon . awssdk . services . dynamodb . document . internal . InternalUtils . toSimpleListValue ( null ) ) |
testStringFormattingEndingWithComments ( ) { java . lang . String formatted = cucumber . eclipse . editor . editors . GherkinFormatterUtil . format ( feature_with_comments_unformatted_and_formatted ) ; "<AssertPlaceHolder>" ; } format ( java . lang . String ) { java . io . StringWriter output = new java . io . StringWriter ( ) ; java . io . PrintWriter out = new java . io . PrintWriter ( output ) ; org . eclipse . jface . preference . IPreferenceStore store = cucumber . eclipse . editor . Activator . getDefault ( ) . getPreferenceStore ( ) ; cucumber . eclipse . editor . editors . PrettyFormatter formatter = cucumber . eclipse . editor . editors . PrettyFormatter . builder ( ) . output ( out ) . monochrome ( true ) . executing ( false ) . rightAlignNumeric ( store . getBoolean ( ICucumberPreferenceConstants . PREF_FORMAT_RIGHT_ALIGN_NUMERIC_VALUES_IN_TABLES ) ) . centerSteps ( store . getBoolean ( ICucumberPreferenceConstants . PREF_FORMAT_CENTER_STEPS ) ) . preserveBlankLineBetweenSteps ( store . getBoolean ( ICucumberPreferenceConstants . PREF_FORMAT_PRESERVE_BLANK_LINE_BETWEEN_STEPS ) ) . indentation ( store . getString ( ICucumberPreferenceConstants . PREF_INDENTATION_STYLE ) ) . build ( ) ; java . util . List < java . lang . String > trailingComments = cucumber . eclipse . editor . editors . GherkinFormatterUtil . getTrailingComments ( contents ) ; new gherkin . parser . Parser ( formatter ) . parse ( contents , "" , 0 ) ; cucumber . eclipse . editor . editors . GherkinFormatterUtil . appendTrailingComments ( out , trailingComments ) ; out . flush ( ) ; return output . toString ( ) ; } | org . junit . Assert . assertThat ( formatted , org . hamcrest . CoreMatchers . is ( feature_with_comments_unformatted_and_formatted ) ) |
testCoGroup ( ) { org . gradoop . common . model . impl . pojo . VertexFactory vertexFactory = getConfig ( ) . getVertexFactory ( ) ; org . gradoop . common . model . impl . pojo . Vertex v1 = vertexFactory . createVertex ( "a" ) ; org . apache . flink . api . java . tuple . Tuple2 < org . gradoop . common . model . impl . id . GradoopId , org . gradoop . common . model . impl . properties . PropertyValue > property1 = org . apache . flink . api . java . tuple . Tuple2 . of ( v1 . getId ( ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( 1L ) ) ; org . gradoop . common . model . impl . pojo . Vertex v2 = vertexFactory . createVertex ( "a" ) ; org . gradoop . common . model . impl . pojo . Vertex v3 = vertexFactory . createVertex ( "b" ) ; org . apache . flink . api . java . tuple . Tuple2 < org . gradoop . common . model . impl . id . GradoopId , org . gradoop . common . model . impl . properties . PropertyValue > property2 = org . apache . flink . api . java . tuple . Tuple2 . of ( v3 . getId ( ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( 1L ) ) ; java . util . List < org . gradoop . common . model . impl . pojo . Vertex > input = java . util . Arrays . asList ( v1 , v2 , v3 ) ; java . util . List < org . gradoop . common . model . impl . pojo . Vertex > result = getExecutionEnvironment ( ) . fromElements ( property1 , property2 ) . coGroup ( getExecutionEnvironment ( ) . fromCollection ( input ) ) . where ( 0 ) . equalTo ( new org . gradoop . flink . model . impl . functions . epgm . Id ( ) ) . with ( new org . gradoop . dataintegration . transformation . functions . AccumulatePropagatedValues ( "k" , java . util . Collections . singleton ( "a" ) ) ) . collect ( ) ; v1 . setProperty ( "k" , org . gradoop . common . model . impl . properties . PropertyValue . create ( java . util . Collections . singletonList ( org . gradoop . common . model . impl . properties . PropertyValue . create ( 1L ) ) ) ) ; java . util . List < org . gradoop . common . model . impl . pojo . Vertex > expected = java . util . Arrays . asList ( v1 , v2 , v3 ) ; java . util . Comparator < org . gradoop . common . model . impl . pojo . Vertex > comparator = java . util . Comparator . comparing ( Vertex :: getId ) ; expected . sort ( comparator ) ; result . sort ( comparator ) ; "<AssertPlaceHolder>" ; } create ( java . lang . Object ) { return new org . gradoop . common . model . impl . properties . PropertyValue ( value ) ; } | org . junit . Assert . assertArrayEquals ( expected . toArray ( ) , result . toArray ( ) ) |
testEventNotification ( ) { org . jfree . chart . renderer . RendererChangeDetector detector = new org . jfree . chart . renderer . RendererChangeDetector ( ) ; org . jfree . chart . renderer . category . BarRenderer r1 = new org . jfree . chart . renderer . category . BarRenderer ( ) ; r1 . addChangeListener ( detector ) ; detector . setNotified ( false ) ; r1 . setBasePaint ( Color . red ) ; "<AssertPlaceHolder>" ; } getNotified ( ) { return this . notified ; } | org . junit . Assert . assertTrue ( detector . getNotified ( ) ) |
shouldBeAbleToRetrieveTheHighestLogVersion ( ) { org . neo4j . kernel . impl . transaction . log . files . LogFiles files = createLogFiles ( ) ; org . neo4j . io . layout . DatabaseLayout databaseLayout = testDirectory . databaseLayout ( ) ; fileSystemRule . create ( databaseLayout . file ( getVersionedLogFileName ( "1" ) ) ) . close ( ) ; fileSystemRule . create ( databaseLayout . file ( getVersionedLogFileName ( "some" , "4" ) ) ) . close ( ) ; fileSystemRule . create ( databaseLayout . file ( getVersionedLogFileName ( "3" ) ) ) . close ( ) ; fileSystemRule . create ( databaseLayout . file ( filename ) ) . close ( ) ; final long highestLogVersion = files . getHighestLogVersion ( ) ; "<AssertPlaceHolder>" ; files . shutdown ( ) ; } getHighestLogVersion ( ) { org . neo4j . kernel . impl . transaction . log . files . TransactionLogFiles . RangeLogVersionVisitor visitor = new org . neo4j . kernel . impl . transaction . log . files . TransactionLogFiles . RangeLogVersionVisitor ( ) ; accept ( visitor ) ; return visitor . highest ; } | org . junit . Assert . assertEquals ( 3 , highestLogVersion ) |
testPositive ( ) { java . util . Optional < java . lang . Boolean > actual = org . openhab . io . transport . modbus . ModbusBitUtilities . translateCommand2Boolean ( new org . eclipse . smarthome . core . library . types . DecimalType ( 3.4 ) ) ; "<AssertPlaceHolder>" ; } is ( org . eclipse . smarthome . core . thing . ThingTypeUID ) { return thingTypeUID . equals ( otherThingTypeUID ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( java . util . Optional . of ( true ) ) ) ) |
ifOutputIsFileNotFolderReject ( ) { java . io . File file = java . io . File . createTempFile ( getClass ( ) . getSimpleName ( ) , "tmp" ) ; "<AssertPlaceHolder>" ; testBuilder ( ) . setOutputDirectory ( file ) . build ( ) ; } exists ( ) { return new com . crawljax . test . matchers . FileMatcher ( ) ; } | org . junit . Assert . assertThat ( file . exists ( ) , org . hamcrest . core . Is . is ( true ) ) |
testCreateSeverityKeyByErrorValueForAllOps ( ) { java . lang . String actual = dao . createSeverityKeyByErrorValueForAllOps ( errorValue , errorToSave ) ; java . lang . String expected = "TheServerName|TheServiceAdminName|theTestConsumer|All|ERROR|true" ; "<AssertPlaceHolder>" ; } createSeverityKeyByErrorValueForAllOps ( org . ebayopensource . turmeric . runtime . error . cassandra . model . ErrorValue , org . ebayopensource . turmeric . runtime . error . cassandra . model . ErrorById ) { return this . createSuffixedErrorCountKeyAllOps ( errorValue , error . getSeverity ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testOFPFlowActionSetQueueInteger ( ) { org . o3project . odenos . core . component . network . flow . ofpflow . OFPFlowActionSetQueue target = new org . o3project . odenos . core . component . network . flow . ofpflow . OFPFlowActionSetQueue ( 1234 ) ; "<AssertPlaceHolder>" ; } getQueueId ( ) { return queueId ; } | org . junit . Assert . assertThat ( target . getQueueId ( ) , org . hamcrest . CoreMatchers . is ( new java . lang . Integer ( 1234 ) ) ) |
testAtanh ( ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . linspace ( ( - 0.9 ) , 0.9 , 10 ) ; org . nd4j . linalg . api . ndarray . INDArray out = org . nd4j . linalg . ops . transforms . Transforms . atanh ( in , true ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( in . shape ( ) ) ; for ( int i = 0 ; i < 10 ; i ++ ) { double x = in . getDouble ( i ) ; double y = ( 0.5 * ( java . lang . Math . log ( ( x + 1.0 ) ) ) ) - ( 0.5 * ( java . lang . Math . log ( ( 1.0 - x ) ) ) ) ; exp . putScalar ( i , y ) ; } "<AssertPlaceHolder>" ; } putScalar ( long [ ] , int ) { return putScalar ( indexes , ( ( double ) ( value ) ) ) ; } | org . junit . Assert . assertEquals ( exp , out ) |
withInlineComment ( ) { java . util . StringTokenizer tokenizer = new java . util . StringTokenizer ( "x<sp>--<sp>a<sp>b\n" , "<sp>" , true ) ; com . klarna . hiverunner . sql . split . Context context = new com . klarna . hiverunner . sql . split . BaseContext ( tokenizer ) ; com . klarna . hiverunner . sql . split . PreserveCommentsRuleTest . rule . handle ( tokenizer . nextToken ( ) , context ) ; com . klarna . hiverunner . sql . split . PreserveCommentsRuleTest . rule . handle ( tokenizer . nextToken ( ) , context ) ; com . klarna . hiverunner . sql . split . PreserveCommentsRuleTest . rule . handle ( tokenizer . nextToken ( ) , context ) ; "<AssertPlaceHolder>" ; } statement ( ) { return statement ; } | org . junit . Assert . assertThat ( context . statement ( ) , org . hamcrest . CoreMatchers . is ( "x<sp>--<sp>a<sp>b\n" ) ) |
RequestAccessAndRefreshTokensUsingRefreshToken_ReturnsCorrectTokens ( ) { try { expect ( oauthService . getAccessTokens ( new com . microsoft . bingads . internal . OAuthRequestParameters ( "test_id" , "test_secret" , new java . net . URL ( "https://test.com/login" ) , "refresh_token" , "refresh_token" , "xxx" ) ) ) . andReturn ( expectedTokenInfo ) ; com . microsoft . bingads . OAuthWebAuthCodeGrant auth = com . microsoft . bingads . OAuthTest . CreateWebAuth ( "test_id" , "test_secret" , oauthService ) ; replayAll ( ) ; com . microsoft . bingads . OAuthTokens tokens = auth . requestAccessAndRefreshTokens ( "xxx" ) ; "<AssertPlaceHolder>" ; } catch ( java . net . MalformedURLException e ) { org . junit . Assert . fail ( "Malformed<sp>Test<sp>URL" ) ; } } requestAccessAndRefreshTokens ( java . lang . String ) { this . oAuthTokens = this . oauthService . getAccessTokens ( new com . microsoft . bingads . internal . OAuthRequestParameters ( clientId , clientSecret , redirectionUri , com . microsoft . bingads . internal . OAuthWithAuthorizationCode . REFRESH_TOKEN , com . microsoft . bingads . internal . OAuthWithAuthorizationCode . REFRESH_TOKEN , refreshToken ) ) ; raiseNewTokensEventIfNeeded ( ) ; return oAuthTokens ; } | org . junit . Assert . assertEquals ( expectedTokenInfo , tokens ) |
testScriptFelix4679 ( ) { java . lang . String script = "addcommand<sp>system<sp>(((${.context}<sp>bundles)<sp>0)<sp>loadclass<sp>java.lang.System)" ; java . io . PrintStream sout = new java . io . PrintStream ( System . out ) { @ org . apache . felix . gogo . runtime . Override public void close ( ) { } } ; java . io . PrintStream serr = new java . io . PrintStream ( System . err ) { @ org . apache . felix . gogo . runtime . Override public void close ( ) { } } ; org . apache . felix . gogo . runtime . threadio . ThreadIOImpl tio = new org . apache . felix . gogo . runtime . threadio . ThreadIOImpl ( ) ; tio . start ( ) ; try { org . osgi . framework . BundleContext bc = createMockContext ( ) ; org . apache . felix . gogo . runtime . CommandProcessorImpl processor = new org . apache . felix . gogo . runtime . CommandProcessorImpl ( tio ) ; processor . addCommand ( "gogo" , processor , "addcommand" ) ; processor . addConstant ( ".context" , bc ) ; org . apache . felix . gogo . runtime . CommandSessionImpl session = new org . apache . felix . gogo . runtime . CommandSessionImpl ( processor , new java . io . ByteArrayInputStream ( script . getBytes ( ) ) , sout , serr ) ; org . apache . felix . gogo . runtime . Closure c = new org . apache . felix . gogo . runtime . Closure ( session , null , script ) ; "<AssertPlaceHolder>" ; } finally { tio . stop ( ) ; } } execute ( java . lang . Runnable , boolean ) { java . lang . Thread currThread = java . lang . Thread . currentThread ( ) ; if ( ( m_executingThread ) == currThread ) { runTask ( task ) ; } else { schedule ( task ) ; execute ( threadpool ) ; } } | org . junit . Assert . assertNull ( c . execute ( session , null ) ) |
testGetUniquePrincipalNameAll ( ) { java . lang . String input = "1.2<sp>3-4_567890AbCdEfGhIJklmnoPqRSTUvwxyz" ; java . lang . String expected = "1234567890abcdefghijklmnopqrstuvwxyz" ; java . lang . String result = org . sagebionetworks . repo . model . dbo . principal . AliasUtils . getUniqueAliasName ( input ) ; "<AssertPlaceHolder>" ; } getUniqueAliasName ( java . lang . String ) { if ( inputName == null ) { throw new java . lang . IllegalArgumentException ( "Name<sp>cannot<sp>be<sp>null" ) ; } java . lang . String lower = inputName . toLowerCase ( ) ; java . util . regex . Matcher m = org . sagebionetworks . repo . model . dbo . principal . AliasUtils . PRINICPAL_UNIQUENESS_REPLACE_PATTERN . matcher ( lower ) ; return m . replaceAll ( "" ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
passwordMismatchErrorUser ( ) { usersResource . post ( new org . apache . usergrid . rest . applications . collection . users . User ( "edanuff" , "edanuff" , "edanuff@email.com" , "sesame" ) ) ; java . lang . String origPassword = "foofoo" ; java . lang . String newPassword = "barbar" ; org . apache . usergrid . rest . applications . collection . users . ChangePasswordEntity data = new org . apache . usergrid . rest . applications . collection . users . ChangePasswordEntity ( origPassword , newPassword ) ; int responseStatus = 0 ; try { usersResource . entity ( "edanuff" ) . connection ( "password" ) . post ( data ) ; } catch ( javax . ws . rs . ClientErrorException uie ) { responseStatus = uie . getResponse ( ) . getStatus ( ) ; } "<AssertPlaceHolder>" ; } getStatus ( ) { return "good" ; } | org . junit . Assert . assertEquals ( 0 , responseStatus ) |
givenClientCertificateSha256WhenMatchRealmThenReturnTrue ( ) { final java . util . Set < java . security . cert . X509Certificate > grantedIssuers = new java . util . HashSet ( ) ; grantedIssuers . add ( cert ) ; final fr . gouv . vitam . common . auth . core . authc . X509AuthenticationInfo info = new fr . gouv . vitam . common . auth . core . authc . X509AuthenticationInfo ( "username" , cert , grantedIssuers , "testRealm" ) ; "<AssertPlaceHolder>" ; } doCredentialsMatch ( org . apache . shiro . authc . AuthenticationToken , org . apache . shiro . authc . AuthenticationInfo ) { return doX509CredentialsMatch ( ( ( fr . gouv . vitam . common . auth . core . authc . X509AuthenticationToken ) ( token ) ) , ( ( fr . gouv . vitam . common . auth . core . authc . X509AuthenticationInfo ) ( info ) ) ) ; } | org . junit . Assert . assertTrue ( match . doCredentialsMatch ( token , info ) ) |
testSaveTechnicalProductInUseLicenseNull ( ) { org . oscm . internal . vo . VOTechnicalService techProd = createTechnicalProduct ( svcProv ) ; java . lang . String license = techProd . getLicense ( ) ; techProd . setLicense ( null ) ; deleteEmptyTp_keyRecord ( techProd ) ; svcProv . saveTechnicalServiceLocalization ( techProd ) ; techProd = svcProv . getTechnicalServices ( OrganizationRoleType . TECHNOLOGY_PROVIDER ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } getLicense ( ) { return vo . getLicense ( ) ; } | org . junit . Assert . assertEquals ( license , techProd . getLicense ( ) ) |
forEach ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; com . gs . collections . impl . utility . StringIterate . forEach ( "1a2b3c" , ( ( com . gs . collections . api . block . procedure . primitive . CharProcedure ) ( builder :: append ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . appendable . toString ( ) ; } | org . junit . Assert . assertEquals ( "1a2b3c" , builder . toString ( ) ) |
testHoldAlt ( ) { org . opennms . gwtterminal . TermHandlerTest . SudoKeyDownEvent altPress = new org . opennms . gwtterminal . TermHandlerTest . SudoKeyDownEvent ( ALT_KEY , false , false , false ) ; termHandler . onKeyDown ( altPress ) ; "<AssertPlaceHolder>" ; } getKeybuf ( ) { return keybuf ; } | org . junit . Assert . assertEquals ( "" , termHandler . getKeybuf ( ) . toString ( ) ) |
matchNumber_matchedIsTrue ( ) { java . lang . String s = "123" ; com . github . sgreben . regex_builder . Pattern p = com . github . sgreben . regex_builder . Pattern . compile ( com . github . sgreben . regex_builder . Re . Re . number ( ) ) ; com . github . sgreben . regex_builder . Matcher m = p . matcher ( s ) ; "<AssertPlaceHolder>" ; } matches ( ) { return matcher . matches ( ) ; } | org . junit . Assert . assertTrue ( m . matches ( ) ) |
getPreferredProcessorsWhenAssignedAndFallbackAreSet ( ) { edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; config . setProperty ( "processor.ManualSelectionStrategy.jpg" , edu . illinois . library . cantaloupe . processor . GraphicsMagickProcessor . class . getSimpleName ( ) ) ; config . setProperty ( Key . PROCESSOR_FALLBACK , edu . illinois . library . cantaloupe . processor . ImageMagickProcessor . class . getSimpleName ( ) ) ; java . util . List < java . lang . Class < ? extends edu . illinois . library . cantaloupe . processor . Processor > > expected = java . util . List . of ( edu . illinois . library . cantaloupe . processor . GraphicsMagickProcessor . class , edu . illinois . library . cantaloupe . processor . ImageMagickProcessor . class ) ; "<AssertPlaceHolder>" ; } getPreferredProcessors ( edu . illinois . library . cantaloupe . image . Format ) { if ( Format . JP2 . equals ( sourceFormat ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . JP2_CANDIDATES ; } else if ( Format . JPG . equals ( sourceFormat ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . JPG_CANDIDATES ; } else if ( Format . PDF . equals ( sourceFormat ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . PDF_CANDIDATES ; } else if ( Format . Type . VIDEO . equals ( sourceFormat . getType ( ) ) ) { return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . VIDEO_CANDIDATES ; } return edu . illinois . library . cantaloupe . processor . AutomaticSelectionStrategy . FALLBACK_CANDIDATES ; } | org . junit . Assert . assertEquals ( expected , instance . getPreferredProcessors ( Format . JPG ) ) |
testBuildWithDisabledSecurityConstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . language . Language context = new org . lnu . is . domain . language . Language ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Language<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . language . Language > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
testConcurrentSignals ( ) { org . eclipse . tracecompass . tmf . core . tests . signal . TmfSignalManagerTest . TestSignalHandlerNested signalResender = new org . eclipse . tracecompass . tmf . core . tests . signal . TmfSignalManagerTest . TestSignalHandlerNested ( ) ; org . eclipse . tracecompass . tmf . core . tests . signal . TmfSignalManagerTest . TestSignalHandler signalReceiver = new org . eclipse . tracecompass . tmf . core . tests . signal . TmfSignalManagerTest . TestSignalHandler ( false , null ) ; try { for ( int k = 0 ; k < 10 ; k ++ ) { final java . util . concurrent . CountDownLatch startLatch = new java . util . concurrent . CountDownLatch ( 2 ) ; final java . util . concurrent . CountDownLatch sendLatch = new java . util . concurrent . CountDownLatch ( 1 ) ; final java . util . concurrent . CountDownLatch endLatch = new java . util . concurrent . CountDownLatch ( 2 ) ; signalReceiver . receivedSignals . clear ( ) ; java . lang . Thread senderThread1 = new java . lang . Thread ( ) { @ org . eclipse . tracecompass . tmf . core . tests . signal . Override public void run ( ) { startLatch . countDown ( ) ; try { sendLatch . await ( ) ; } catch ( java . lang . InterruptedException e ) { } signalSender . sendSignal ( new org . eclipse . tracecompass . tmf . core . tests . signal . TmfSignalManagerTest . TestSignal1 ( signalSender ) ) ; endLatch . countDown ( ) ; } } ; java . lang . Thread senderThread2 = new java . lang . Thread ( ) { @ org . eclipse . tracecompass . tmf . core . tests . signal . Override public void run ( ) { startLatch . countDown ( ) ; try { sendLatch . await ( ) ; } catch ( java . lang . InterruptedException e ) { } signalSender . sendSignal ( new org . eclipse . tracecompass . tmf . core . tests . signal . TmfSignalManagerTest . TestSignal4 ( signalSender ) ) ; endLatch . countDown ( ) ; } } ; senderThread1 . start ( ) ; senderThread2 . start ( ) ; try { startLatch . await ( ) ; } catch ( java . lang . InterruptedException e ) { } sendLatch . countDown ( ) ; try { endLatch . await ( ) ; } catch ( java . lang . InterruptedException e ) { } "<AssertPlaceHolder>" ; boolean pass = true ; for ( int i = 0 ; i < ( expectedOrder1 . length ) ; i ++ ) { if ( ! ( signalReceiver . receivedSignals . get ( i ) . getClass ( ) . equals ( expectedOrder1 [ i ] ) ) ) { pass = false ; break ; } } if ( ! pass ) { for ( int i = 0 ; i < ( expectedOrder2 . length ) ; i ++ ) { if ( ! ( signalReceiver . receivedSignals . get ( i ) . getClass ( ) . equals ( expectedOrder2 [ i ] ) ) ) { org . junit . Assert . fail ( "Concurrent<sp>signal<sp>test<sp>failure!" ) ; } } } } } finally { signalResender . dispose ( ) ; signalReceiver . dispose ( ) ; } } size ( ) { return fSize . get ( ) ; } | org . junit . Assert . assertEquals ( expectedOrder1 . length , signalReceiver . receivedSignals . size ( ) ) |
testRemoveQualityForm ( ) { org . libreplan . business . qualityforms . entities . QualityForm qualityForm = createValidQualityForm ( ) ; qualityFormDAO . save ( qualityForm ) ; qualityFormDAO . remove ( qualityForm . getId ( ) ) ; "<AssertPlaceHolder>" ; } exists ( PK extends java . io . Serializable ) { return ( getSession ( ) . createCriteria ( entityClass ) . add ( org . hibernate . criterion . Restrictions . idEq ( id ) ) . setProjection ( org . hibernate . criterion . Projections . id ( ) ) . uniqueResult ( ) ) != null ; } | org . junit . Assert . assertFalse ( qualityFormDAO . exists ( qualityForm . getId ( ) ) ) |
testSetSchedulingOptions_Null ( ) { com . google . cloud . compute . deprecated . SchedulingOptions schedulingOptions = com . google . cloud . compute . deprecated . SchedulingOptions . standard ( true , SchedulingOptions . Maintenance . MIGRATE ) ; org . easymock . EasyMock . expect ( computeRpcMock . setScheduling ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getZone ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getInstance ( ) , schedulingOptions . toPb ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( null ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; "<AssertPlaceHolder>" ; } setSchedulingOptions ( com . google . cloud . compute . deprecated . SchedulingOptions , com . google . cloud . compute . deprecated . Compute . OperationOption [ ] ) { return compute . setSchedulingOptions ( getInstanceId ( ) , scheduling , options ) ; } | org . junit . Assert . assertNull ( compute . setSchedulingOptions ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID , schedulingOptions ) ) |
resizerWhereSourceLargerThanDestination ( ) { net . coobird . thumbnailator . resizers . Resizer resizer = Resizers . BICUBIC ; net . coobird . thumbnailator . resizers . ResizerFactory factory = new net . coobird . thumbnailator . resizers . FixedResizerFactory ( resizer ) ; java . awt . Dimension sourceDimension = new java . awt . Dimension ( 200 , 200 ) ; java . awt . Dimension targetDimension = new java . awt . Dimension ( 100 , 100 ) ; net . coobird . thumbnailator . resizers . Resizer receivedResizer = factory . getResizer ( sourceDimension , targetDimension ) ; "<AssertPlaceHolder>" ; } getResizer ( java . awt . Dimension , java . awt . Dimension ) { return resizer ; } | org . junit . Assert . assertEquals ( resizer , receivedResizer ) |
shouldReturnFirstNonNull ( ) { new org . springframework . springfaces . selectitems . SelectItemsTest . TestableSelectItems ( ) { @ org . springframework . springfaces . selectitems . Override public void test ( ) throws org . springframework . springfaces . selectitems . Exception { java . lang . Object v = firstNonNullValue ( null , null , "a" , "b" ) ; "<AssertPlaceHolder>" ; } } . test ( ) ; } | org . junit . Assert . assertThat ( v , org . hamcrest . CoreMatchers . is ( ( ( java . lang . Object ) ( "a" ) ) ) ) |
testEdgeTypeUniqueConstraintViolation ( ) { "<AssertPlaceHolder>" ; com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition < java . lang . String > definition = new com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition ( com . puresoltechnologies . ductiledb . core . graph . ElementType . EDGE , "property" , java . lang . String . class , UniqueConstraint . TYPE ) ; com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . schemaManager . defineProperty ( definition ) ; java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( "property" , "value" ) ; try { com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex1 = com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . addVertex ( ) ; com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex2 = com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . addVertex ( ) ; com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex3 = com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . addVertex ( ) ; vertex1 . addEdge ( "type1" , vertex2 , properties ) ; vertex2 . addEdge ( "type1" , vertex3 , properties ) ; } finally { com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . rollback ( ) ; } } getPropertyDefinition ( com . puresoltechnologies . ductiledb . core . graph . ElementType , java . lang . String ) { try { com . puresoltechnologies . ductiledb . bigtable . BigTable table = namespace . getTable ( DatabaseTable . PROPERTY_DEFINITIONS . getName ( ) ) ; com . puresoltechnologies . ductiledb . bigtable . Get get = new com . puresoltechnologies . ductiledb . bigtable . Get ( com . puresoltechnologies . ductiledb . logstore . Key . of ( propertyKey ) ) ; com . puresoltechnologies . ductiledb . logstore . Key columnFamily = null ; switch ( elementType ) { case VERTEX : columnFamily = DatabaseColumnFamily . VERTEX_DEFINITION . getKey ( ) ; break ; case EDGE : columnFamily = DatabaseColumnFamily . EDGE_DEFINITION . getKey ( ) ; break ; default : throw new com . puresoltechnologies . ductiledb . core . graph . manager . DuctileDBSchemaManagerException ( ( ( "Cannot<sp>read<sp>property<sp>for<sp>element<sp>'" + elementType ) + "'." ) ) ; } get . addFamily ( columnFamily ) ; com . puresoltechnologies . ductiledb . bigtable . Result result = table . get ( get ) ; if ( result == null ) { return null ; } java . util . NavigableMap < com . puresoltechnologies . ductiledb . logstore . Key , com . puresoltechnologies . ductiledb . columnfamily . ColumnValue > familyMap = result . getFamilyMap ( columnFamily ) ; if ( familyMap == null ) { return null ; } @ com . puresoltechnologies . ductiledb . core . graph . schema . SuppressWarnings ( "unchecked" ) java . lang . Class < T > type = ( ( java . lang . Class < T > ) ( java . lang . Class . forName ( familyMap . get ( GraphSchema . PROPERTY_TYPE_KEY ) . toString ( ) ) ) ) ; com . puresoltechnologies . ductiledb . core . graph . schema . UniqueConstraint unique = com . puresoltechnologies . ductiledb . core . graph . schema . UniqueConstraint . valueOf ( familyMap . get ( GraphSchema . UNIQUENESS_COLUMN_KEY ) . toString ( ) ) ; com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition < T > definition = new com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition ( elementType , propertyKey , type , unique ) ; return definition ; } catch ( java . lang . ClassNotFoundException e ) { throw new com . puresoltechnologies . ductiledb . core . graph . manager . DuctileDBSchemaManagerException ( "Could<sp>not<sp>read<sp>property<sp>names." , e ) ; } catch ( com . puresoltechnologies . ductiledb . storage . api . StorageException e ) { throw new com . puresoltechnologies . ductiledb . core . graph . manager . DuctileDBGraphManagerException ( "Could<sp>not<sp>read<sp>property<sp>definition." , e ) ; } } | org . junit . Assert . assertNull ( com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . schemaManager . getPropertyDefinition ( ElementType . EDGE , "property" ) ) |
testImportTableNoAccumuloJarPresent ( ) { org . apache . sqoop . accumulo . AccumuloUtil . setAlwaysNoAccumuloJarMode ( true ) ; opts . setAccumuloTable ( "dummy_table" ) ; try { manager . importTable ( context ) ; org . junit . Assert . fail ( ( "An<sp>ImportException<sp>should<sp>be<sp>thrown:<sp>" + ( "Accumulo<sp>jars<sp>are<sp>not<sp>present<sp>in<sp>classpath,<sp>cannot<sp>import<sp>to<sp>" + "Accumulo!" ) ) ) ; } catch ( org . apache . sqoop . util . ImportException e ) { "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( "No<sp>IOException<sp>should<sp>be<sp>thrown!" ) ; } finally { org . apache . sqoop . accumulo . AccumuloUtil . setAlwaysNoAccumuloJarMode ( false ) ; opts . setAccumuloTable ( null ) ; } } toString ( ) { return this . getColumnName ( ) ; } | org . junit . Assert . assertEquals ( e . toString ( ) , ( "Accumulo<sp>jars<sp>are<sp>not<sp>present<sp>in<sp>classpath,<sp>cannot<sp>import<sp>to<sp>" + "Accumulo!" ) ) |
testTransactionOnCommit ( ) { com . github . davidmoten . rx . jdbc . Database db = db ( ) ; rx . Observable < java . lang . Boolean > begin = db . beginTransaction ( ) ; rx . Observable < java . lang . Integer > updateCount = db . update ( "update<sp>person<sp>set<sp>score=?" ) . dependsOn ( begin ) . parameter ( 99 ) . count ( ) ; rx . Observable < java . lang . Boolean > commit = db . commit ( updateCount ) ; long count = db . select ( "select<sp>count(*)<sp>from<sp>person<sp>where<sp>score=?" ) . parameter ( 99 ) . dependsOn ( commit ) . getAs ( com . github . davidmoten . rx . jdbc . Long . class ) . doOnEach ( com . github . davidmoten . rx . RxUtil . log ( ) ) . toBlocking ( ) . single ( ) ; "<AssertPlaceHolder>" ; } log ( ) { return new rx . Observer < T > ( ) { @ com . github . davidmoten . rx . Override public void onCompleted ( ) { } @ com . github . davidmoten . rx . Override public void onError ( java . lang . Throwable e ) { com . github . davidmoten . rx . RxUtil . log . error ( e . getMessage ( ) , e ) ; } @ com . github . davidmoten . rx . Override public void onNext ( T t ) { com . github . davidmoten . rx . RxUtil . log . info ( ( t + "" ) ) ; } } ; } | org . junit . Assert . assertEquals ( 3 , count ) |
testClientWithAllPossibleValues ( ) { final de . saxsys . synchronizefx . core . clientserver . SynchronizeFxClient client = de . saxsys . synchronizefx . SynchronizeFxBuilder . create ( ) . client ( ) . address ( "192.168.0.1" ) . callback ( clientCallback ) . port ( 16789 ) . customSerializer ( de . saxsys . synchronizefx . Double . class , doubleSerializer ) . customSerializer ( de . saxsys . synchronizefx . Integer . class , integerSerializer ) . build ( ) ; "<AssertPlaceHolder>" ; } build ( ) { final de . saxsys . synchronizefx . netty . tcp . NettyClient netty = new de . saxsys . synchronizefx . netty . tcp . NettyClient ( address , port , serializer ) ; if ( ( changeExecutor ) == null ) { return new de . saxsys . synchronizefx . core . clientserver . SynchronizeFxClient ( netty , callback ) ; } else { return new de . saxsys . synchronizefx . core . clientserver . SynchronizeFxClient ( netty , callback , changeExecutor ) ; } } | org . junit . Assert . assertNotNull ( client ) |
testProjectile ( ) { world . bentobox . bentobox . listeners . flags . worldsettings . ItemFrameListener ifl = new world . bentobox . bentobox . listeners . flags . worldsettings . ItemFrameListener ( ) ; org . bukkit . entity . Entity entity = mock ( org . bukkit . entity . ItemFrame . class ) ; org . bukkit . event . entity . EntityDamageEvent . DamageCause cause = org . bukkit . event . entity . EntityDamageEvent . DamageCause . ENTITY_ATTACK ; org . bukkit . entity . Projectile p = mock ( org . bukkit . entity . Projectile . class ) ; when ( p . getShooter ( ) ) . thenReturn ( world . bentobox . bentobox . listeners . flags . worldsettings . ItemFrameListenerTest . enderman ) ; org . bukkit . event . entity . EntityDamageByEntityEvent e = new org . bukkit . event . entity . EntityDamageByEntityEvent ( p , entity , cause , 0 ) ; ifl . onItemFrameDamage ( e ) ; "<AssertPlaceHolder>" ; } isCancelled ( ) { return cancelled ; } | org . junit . Assert . assertTrue ( e . isCancelled ( ) ) |
existingSession ( ) { final com . clouway . oauth2 . exampleapp . ResourceOwner owner = new com . clouway . oauth2 . exampleapp . ResourceOwner ( "Ivan" , "password" ) ; final com . clouway . oauth2 . Session session = new com . clouway . oauth2 . Session ( "token4321" ) ; context . checking ( new org . jmock . Expectations ( ) { { oneOf ( tokenGenerator ) . generate ( ) ; will ( returnValue ( session . value ) ) ; } } ) ; repository . save ( owner ) ; repository . auth ( owner . username , owner . password , remoteAddress ) ; java . lang . Boolean sessionIsPresented = repository . exists ( session ) ; "<AssertPlaceHolder>" ; } exists ( com . clouway . oauth2 . Session ) { return sessions . contains ( session ) ; } | org . junit . Assert . assertTrue ( sessionIsPresented ) |
sizeVariableU32InTwoBytes ( ) { "<AssertPlaceHolder>" ; } sizeVariableU32 ( int ) { int val = value ; int size = 1 ; while ( val > ( com . flagstone . transform . coder . Coder . VAR_INT_MAX ) ) { size += 1 ; val = val > > > ( com . flagstone . transform . coder . Coder . VAR_INT_SHIFT ) ; } return size ; } | org . junit . Assert . assertEquals ( 2 , com . flagstone . transform . coder . Coder . sizeVariableU32 ( 255 ) ) |
testNowFunction ( ) { com . srotya . sidewinder . core . sql . calcite . SqlFunctions . Now function = new com . srotya . sidewinder . core . sql . calcite . SqlFunctions . Now ( ) ; long currentTimeMillis = java . lang . System . currentTimeMillis ( ) ; java . sql . Timestamp ts = function . eval ( ) ; "<AssertPlaceHolder>" ; } eval ( ) { return java . sql . Timestamp . from ( java . time . Instant . now ( ) ) ; } | org . junit . Assert . assertEquals ( currentTimeMillis , ts . getTime ( ) , 5 ) |
testShouldReturnEmptyListWhenNoVoluntarySavingsAccountsForCentersOrGroupsWithPerIndividualStatusExist ( ) { java . util . List < org . mifos . application . servicefacade . CollectionSheetCustomerSavingDto > mandatorySavingAccounts = savingsDao . findAllVoluntarySavingAccountsForIndividualChildrenOfCentersOrGroupsWithPerIndividualStatusForCustomerHierarchy ( customerHierarchyParams ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( org . apache . commons . lang . StringUtils . isBlank ( loanAmount ) ) && ( org . apache . commons . lang . StringUtils . isBlank ( businessActivity ) ) ; } | org . junit . Assert . assertTrue ( mandatorySavingAccounts . isEmpty ( ) ) |
validateOptionalAndNotEmpty ( ) { optionalSubject . setValue ( 1234 ) ; "<AssertPlaceHolder>" ; } validate ( ) { if ( ( isMandatory ( ) ) && ( isEmpty ( ) ) ) { throw new java . lang . IllegalStateException ( java . lang . String . format ( "field<sp>%s<sp>is<sp>mandatory<sp>and<sp>empty" , name ( ) ) ) ; } return true ; } | org . junit . Assert . assertEquals ( true , optionalSubject . validate ( ) ) |
testSimpleExcelTestCase ( ) { double result = name . abuchen . portfolio . math . IRR . calculate ( java . util . Arrays . asList ( java . time . LocalDate . of ( 2010 , Month . JANUARY , 1 ) , java . time . LocalDate . of ( 2010 , Month . DECEMBER , 31 ) ) , java . util . Arrays . asList ( ( - 200.0 ) , 210.0 ) ) ; result = new java . math . BigDecimal ( result ) . setScale ( 8 , RoundingMode . HALF_UP ) . doubleValue ( ) ; double excel = new java . math . BigDecimal ( 0.050140747 ) . setScale ( 8 , RoundingMode . HALF_UP ) . doubleValue ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( excel ) ) |
testAdjustTLSContext ( ) { de . rub . nds . tlsattacker . core . protocol . message . HelloVerifyRequestMessage message = new de . rub . nds . tlsattacker . core . protocol . message . HelloVerifyRequestMessage ( ) ; message . setCookie ( new byte [ ] { 0 , 1 , 2 , 3 } ) ; handler . adjustTLSContext ( message ) ; "<AssertPlaceHolder>" ; } getDtlsCookie ( ) { if ( ( context . getDtlsCookie ( ) ) != null ) { return copy ( context . getDtlsCookie ( ) ) ; } else { return config . getDefaultDtlsCookie ( ) ; } } | org . junit . Assert . assertArrayEquals ( new byte [ ] { 0 , 1 , 2 , 3 } , context . getDtlsCookie ( ) ) |
testIsSampleIncluded_SampleResult ( ) { System . out . println ( "isSampleIncluded" ) ; org . apache . jmeter . samplers . SampleResult res = null ; kg . apc . jmeter . graphs . AbstractGraphPanelVisualizer instance = new kg . apc . jmeter . graphs . AbstractGraphPanelVisualizerTest . AbstractGraphPanelVisualizerImpl ( ) ; boolean expResult = true ; boolean result = instance . isSampleIncluded ( res ) ; "<AssertPlaceHolder>" ; } println ( java . lang . String ) { kg . apc . jmeter . reporters . ConsoleStatusLogger . log . info ( msg ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testBuildTimerNormalValue ( ) { final org . opendaylight . protocol . bgp . rib . spi . state . BGPTimersState timerState = mock ( org . opendaylight . protocol . bgp . rib . spi . state . BGPTimersState . class ) ; doReturn ( 90L ) . when ( timerState ) . getNegotiatedHoldTime ( ) ; doReturn ( 5000L ) . when ( timerState ) . getUpTime ( ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation timerStateAug = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentationBuilder ( ) . setNegotiatedHoldTime ( java . math . BigDecimal . valueOf ( 90L ) ) . setUptime ( new org . opendaylight . yang . gen . v1 . urn . ietf . params . xml . ns . yang . ietf . yang . types . rev130715 . Timeticks ( 500L ) ) . build ( ) ; final org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . Timers expectedTimers = new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . TimersBuilder ( ) . setState ( new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . timers . StateBuilder ( ) . addAugmentation ( org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation . class , timerStateAug ) . build ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } buildTimer ( org . opendaylight . protocol . bgp . rib . spi . state . BGPTimersState ) { if ( neighbor == null ) { return null ; } final long uptimeTicks = ( ( neighbor . getUpTime ( ) ) / 10 ) % ( org . opendaylight . protocol . bgp . state . NeighborUtil . TIMETICK_ROLLOVER_VALUE ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation timerState = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentationBuilder ( ) . setNegotiatedHoldTime ( java . math . BigDecimal . valueOf ( neighbor . getNegotiatedHoldTime ( ) ) ) . setUptime ( new org . opendaylight . yang . gen . v1 . urn . ietf . params . xml . ns . yang . ietf . yang . types . rev130715 . Timeticks ( uptimeTicks ) ) . build ( ) ; return new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . TimersBuilder ( ) . setState ( new org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . rev151009 . bgp . neighbor . group . timers . StateBuilder ( ) . addAugmentation ( org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . openconfig . extensions . rev180329 . NeighborTimersStateAugmentation . class , timerState ) . build ( ) ) . build ( ) ; } | org . junit . Assert . assertEquals ( expectedTimers , org . opendaylight . protocol . bgp . state . NeighborUtil . buildTimer ( timerState ) ) |
testGetConsistencyGroups ( ) { boolean wasException = false ; try { java . util . List < com . emc . storageos . vplex . api . VPlexConsistencyGroupInfo > cgInfoList = com . emc . storageos . vplex . api . VPlexApiTest . _client . getConsistencyGroups ( ) ; for ( com . emc . storageos . vplex . api . VPlexConsistencyGroupInfo cgInfo : cgInfoList ) { System . out . println ( cgInfo . toString ( ) ) ; } } catch ( java . lang . Exception e ) { wasException = true ; } "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder s = new java . lang . StringBuilder ( ) ; s . append ( "licenseType=" ) ; s . append ( _licenseType . toString ( ) ) ; s . append ( "<sp>expirationDate=" ) ; s . append ( _expirationDate ) ; return s . toString ( ) ; } | org . junit . Assert . assertFalse ( wasException ) |
testCompletedMetaModelFalseWithLessThanTwoCriteria ( ) { org . drugis . addis . presentation . wizard . MetaCriteriaAndAlternativesPresentation pm = d_pm . getMetaBRPresentation ( ) ; pm . getCriterionSelectedModel ( org . drugis . addis . ExampleData . buildEndpointHamd ( ) ) . setValue ( true ) ; pm . getMetaAnalysesSelectedModel ( org . drugis . addis . ExampleData . buildEndpointHamd ( ) ) . setValue ( org . drugis . addis . ExampleData . buildMetaAnalysisHamd ( ) ) ; pm . getAlternativeSelectedModel ( d_fluoxSet ) . setValue ( true ) ; pm . getAlternativeSelectedModel ( d_paroxSet ) . setValue ( true ) ; "<AssertPlaceHolder>" ; } getCompleteModel ( ) { return d_metaCompleteModel ; } | org . junit . Assert . assertFalse ( ( ( java . lang . Boolean ) ( pm . getCompleteModel ( ) . getValue ( ) ) ) ) |
isOverridingResourceTypeFunctionWhenNotOverridingShouldReturnFalse ( ) { ch . puzzle . itc . mobiliar . business . function . entity . AmwFunctionEntity function2 = new ch . puzzle . itc . mobiliar . business . function . entity . AmwFunctionEntityBuilder ( "name2" , 3 ) . forResourceType ( resourceType ) . build ( ) ; boolean isOverwritten = function2 . isOverwritingResourceTypeFunction ( ) ; "<AssertPlaceHolder>" ; } isOverwritingResourceTypeFunction ( ) { return ( overwrittenParent ) != null ; } | org . junit . Assert . assertFalse ( isOverwritten ) |
testGetPropertyName ( ) { com . liferay . dynamic . data . mapping . form . evaluator . internal . function . SetValueFunction setValueFunction = new com . liferay . dynamic . data . mapping . form . evaluator . internal . function . SetValueFunction ( ) ; "<AssertPlaceHolder>" ; } getPropertyName ( ) { return "struts.action" ; } | org . junit . Assert . assertEquals ( "value" , setValueFunction . getPropertyName ( ) ) |
test_LocalDate_adjustToSymmetry454Date ( ) { org . threeten . extra . chrono . Symmetry454Date sym454 = org . threeten . extra . chrono . Symmetry454Date . of ( 2012 , 7 , 19 ) ; java . time . LocalDate test = LocalDate . MIN . with ( sym454 ) ; "<AssertPlaceHolder>" ; } of ( int , int , int ) { org . threeten . extra . chrono . YEAR . checkValidValue ( prolepticYear ) ; PaxChronology . MONTH_OF_YEAR_RANGE . checkValidValue ( month , org . threeten . extra . chrono . MONTH_OF_YEAR ) ; PaxChronology . DAY_OF_MONTH_RANGE . checkValidValue ( dayOfMonth , org . threeten . extra . chrono . DAY_OF_MONTH ) ; if ( ( month == ( ( org . threeten . extra . chrono . PaxChronology . MONTHS_IN_YEAR ) + 1 ) ) && ( ! ( PaxChronology . INSTANCE . isLeapYear ( prolepticYear ) ) ) ) { throw new java . time . DateTimeException ( ( ( "Invalid<sp>month<sp>14<sp>as<sp>" + prolepticYear ) + "is<sp>not<sp>a<sp>leap<sp>year" ) ) ; } if ( ( ( dayOfMonth > ( org . threeten . extra . chrono . PaxChronology . DAYS_IN_WEEK ) ) && ( month == ( org . threeten . extra . chrono . PaxChronology . MONTHS_IN_YEAR ) ) ) && ( PaxChronology . INSTANCE . isLeapYear ( prolepticYear ) ) ) { throw new java . time . DateTimeException ( ( ( "Invalid<sp>date<sp>during<sp>Pax<sp>as<sp>" + prolepticYear ) + "<sp>is<sp>a<sp>leap<sp>year" ) ) ; } return new org . threeten . extra . chrono . PaxDate ( prolepticYear , month , dayOfMonth ) ; } | org . junit . Assert . assertEquals ( java . time . LocalDate . of ( 2012 , 7 , 20 ) , test ) |
testClearAllMessageAnnotationsUsingReceivedMessageWithMessageAnnotationsSection ( ) { java . lang . String symbolKeyName = "myTestSymbolName" ; java . lang . String value = "myTestValue" ; org . apache . qpid . proton . message . Message message = org . apache . qpid . proton . Proton . message ( ) ; java . util . Map < org . apache . qpid . proton . amqp . Symbol , java . lang . Object > annotationsMap = new java . util . HashMap < org . apache . qpid . proton . amqp . Symbol , java . lang . Object > ( ) ; annotationsMap . put ( org . apache . qpid . proton . amqp . Symbol . valueOf ( symbolKeyName ) , value ) ; message . setMessageAnnotations ( new org . apache . qpid . proton . amqp . messaging . MessageAnnotations ( annotationsMap ) ) ; org . apache . qpid . jms . provider . amqp . message . AmqpJmsMessageFacade amqpMessageFacade = createReceivedMessageFacade ( createMockAmqpConsumer ( ) , message ) ; amqpMessageFacade . clearMessageAnnotations ( ) ; "<AssertPlaceHolder>" ; } getMessageAnnotations ( ) { org . apache . qpid . proton . amqp . messaging . MessageAnnotations result = null ; if ( ( ( messageAnnotationsMap ) != null ) && ( ! ( messageAnnotationsMap . isEmpty ( ) ) ) ) { result = new org . apache . qpid . proton . amqp . messaging . MessageAnnotations ( messageAnnotationsMap ) ; } return result ; } | org . junit . Assert . assertNull ( amqpMessageFacade . getMessageAnnotations ( ) ) |
testList1 ( ) { final java . util . List < java . lang . Object > packages = conf . getList ( "test.threesome.one" ) ; "<AssertPlaceHolder>" ; } size ( ) { int count = 0 ; for ( final java . util . Iterator < java . lang . String > iterator = configuration . getKeys ( ) ; iterator . hasNext ( ) ; ) { iterator . next ( ) ; count ++ ; } return count ; } | org . junit . Assert . assertEquals ( 3 , packages . size ( ) ) |
testWithShardIteratorTypeAsType ( ) { java . lang . Object actual = adapter . withShardIteratorType ( com . amazonaws . services . dynamodbv2 . model . ShardIteratorType . LATEST ) ; "<AssertPlaceHolder>" ; } withShardIteratorType ( java . lang . String ) { setShardIteratorType ( shardIteratorType ) ; return this ; } | org . junit . Assert . assertEquals ( adapter , actual ) |
givenMapKeyWithoutHashCode_whenSearched_thenReturnsWrongValue ( ) { java . util . Map < com . baeldung . equalshashcode . WrongTeam , java . lang . String > leaders = new java . util . HashMap ( ) ; leaders . put ( new com . baeldung . equalshashcode . WrongTeam ( "New<sp>York" , "development" ) , "Anne" ) ; leaders . put ( new com . baeldung . equalshashcode . WrongTeam ( "Boston" , "development" ) , "Brian" ) ; leaders . put ( new com . baeldung . equalshashcode . WrongTeam ( "Boston" , "marketing" ) , "Charlie" ) ; com . baeldung . equalshashcode . WrongTeam myTeam = new com . baeldung . equalshashcode . WrongTeam ( "New<sp>York" , "development" ) ; java . lang . String myTeamleader = leaders . get ( myTeam ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Integer ) { return emf . unwrap ( org . hibernate . SessionFactory . class ) . getCurrentSession ( ) . get ( org . baeldung . demo . model . Foo . class , id ) ; } | org . junit . Assert . assertFalse ( "Anne" . equals ( myTeamleader ) ) |
testNextAbsentValueEmpty ( ) { org . roaringbitmap . BitmapContainer container = new org . roaringbitmap . ArrayContainer ( ) . toBitmapContainer ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { "<AssertPlaceHolder>" ; } } nextAbsentValue ( int ) { long nextAbsentBit = computeNextAbsentValue ( fromValue ) ; assert nextAbsentBit <= 4294967295L ; assert nextAbsentBit >= ( org . roaringbitmap . buffer . Util . toUnsignedLong ( fromValue ) ) ; assert ! ( contains ( ( ( int ) ( nextAbsentBit ) ) ) ) ; return nextAbsentBit ; } | org . junit . Assert . assertEquals ( i , container . nextAbsentValue ( ( ( short ) ( i ) ) ) ) |
createInvalidSridGeometry ( ) { org . locationtech . jts . geom . Geometry geom = org . n52 . shetland . util . JTSHelper . createGeometryFromWKT ( "POLYGON<sp>((30<sp>10,<sp>40<sp>40,<sp>20<sp>40,<sp>10<sp>20,<sp>30<sp>10))" , 9999 ) ; org . n52 . shetland . ogc . filter . SpatialFilter filter = new org . n52 . shetland . ogc . filter . SpatialFilter ( org . n52 . shetland . ogc . filter . FilterConstants . SpatialOperator . BBOX , geom , "value-ref" ) ; java . util . Map < java . lang . String , java . lang . Object > map = org . n52 . sos . statistics . sos . models . SpatialFilterEsModel . convert ( filter ) ; "<AssertPlaceHolder>" ; } convert ( org . n52 . shetland . ogc . filter . SpatialFilter ) { return new org . n52 . sos . statistics . sos . models . SpatialFilterEsModel ( filter ) . getAsMap ( ) ; } | org . junit . Assert . assertNull ( map ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.