input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testEmpyHeader ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "\r\n" ) ; sb . append ( "The<sp>body<sp>is<sp>right<sp>here\r\n" ) ; final java . lang . StringBuilder body = new java . lang . StringBuilder ( ) ; org . apache . james . mime4j . parser . MimeStreamParser parser = new org . apache . james . mime4j . parser . MimeStreamParser ( ) ; parser . setContentHandler ( new org . apache . james . mime4j . parser . AbstractContentHandler ( ) { @ org . apache . james . mime4j . parser . Override public void field ( org . apache . james . mime4j . stream . Field field ) { org . junit . Assert . fail ( "No<sp>fields<sp>should<sp>be<sp>reported" ) ; } @ org . apache . james . mime4j . parser . Override public void body ( org . apache . james . mime4j . stream . BodyDescriptor bd , java . io . InputStream is ) throws java . io . IOException { int b ; while ( ( b = is . read ( ) ) != ( - 1 ) ) { body . append ( ( ( char ) ( b ) ) ) ; } } } ) ; parser . parse ( new java . io . ByteArrayInputStream ( sb . toString ( ) . getBytes ( ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return getAddress ( ) ; }
org . junit . Assert . assertEquals ( "The<sp>body<sp>is<sp>right<sp>here\r\n" , body . toString ( ) )
ddocStreamOpener ( ) { try ( org . digidoc4j . impl . ddoc . FileInputStream stream = new org . digidoc4j . impl . ddoc . FileInputStream ( new org . digidoc4j . impl . ddoc . File ( "src/test/resources/testFiles/valid-containers/ddoc_wo_x509IssueName_xmlns.ddoc" ) ) ) { org . digidoc4j . impl . ddoc . DDocContainer container = new org . digidoc4j . impl . ddoc . DDocOpener ( ) . open ( stream ) ; "<AssertPlaceHolder>" ; } } validate ( ) { java . util . ArrayList errs = new java . util . ArrayList ( ) ; org . digidoc4j . ddoc . DigiDocException ex = null ; java . security . cert . X509Certificate cert = getRespondersCertificate ( ) ; if ( cert == null ) ex = validateRespondersCertificate ( cert ) ; if ( ex != null ) errs . add ( ex ) ; java . util . ArrayList e = null ; if ( ( m_certRefs ) != null ) { e = m_certRefs . validate ( ) ; if ( ! ( e . isEmpty ( ) ) ) errs . addAll ( e ) ; } if ( ( m_revRefs ) != null ) { e = m_revRefs . validate ( ) ; if ( ! ( e . isEmpty ( ) ) ) errs . addAll ( e ) ; } return errs ; }
org . junit . Assert . assertTrue ( container . validate ( ) . isValid ( ) )
whenMatchworks_thenCorrect ( ) { int input = 2 ; java . lang . String output = io . vavr . API . Match ( input ) . of ( io . vavr . API . Case ( io . vavr . API . $ ( 1 ) , "one" ) , io . vavr . API . Case ( io . vavr . API . $ ( 2 ) , "two" ) , io . vavr . API . Case ( io . vavr . API . $ ( 3 ) , "three" ) , io . vavr . API . Case ( io . vavr . API . $ ( ) , "?" ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( "two" , output )
getClusterName ( ) { java . lang . String expected = "cluster" ; when ( this . manager . getClusterName ( ) ) . thenReturn ( expected ) ; java . lang . String result = this . subject . getClusterName ( ) ; "<AssertPlaceHolder>" ; } getClusterName ( ) { return clusterName ; }
org . junit . Assert . assertSame ( expected , result )
testV2ToV3 ( ) { java . util . List < com . streamsets . pipeline . api . Config > configs = new java . util . ArrayList ( ) ; com . streamsets . pipeline . stage . processor . http . HttpProcessorUpgrader upgrader = new com . streamsets . pipeline . stage . processor . http . HttpProcessorUpgrader ( ) ; upgrader . upgrade ( "a" , "b" , "c" , 2 , 3 , configs ) ; java . util . Map < java . lang . String , java . lang . Object > configValues = com . streamsets . pipeline . stage . processor . http . TestHttpProcessorUpgrader . getConfigsAsMap ( configs ) ; java . util . List < java . lang . String > newConfigs = com . google . common . collect . ImmutableList . of ( "conf.headerOutputLocation" , "conf.headerAttributePrefix" , "conf.headerOutputField" ) ; for ( java . lang . String config : newConfigs ) { boolean isPresent = configValues . containsKey ( config ) ; "<AssertPlaceHolder>" ; } } containsKey ( java . lang . Object ) { return super . containsKey ( key ) ; }
org . junit . Assert . assertTrue ( isPresent )
testSizeOf ( ) { System . out . println ( "sizeof" ) ; final int [ ] counter = new int [ 1 ] ; instance . executeQuery ( "select<sp>sizeof(o)<sp>from<sp>[I<sp>o" , new org . graalvm . visualvm . lib . profiler . oql . engine . api . OQLEngine . ObjectVisitor ( ) { public boolean visit ( java . lang . Object o ) { if ( o instanceof java . lang . Number ) ( counter [ 0 ] ) ++ ; return false ; } } ) ; "<AssertPlaceHolder>" ; } visit ( java . lang . Object ) { sb . append ( ( oddRow [ 0 ] ? ( "<tr><td<sp>style='background-color:<sp>" + oddRowBackgroundString ) + ";'>" : "<tr><td>" ) ) ; oddRow [ 0 ] = ! ( oddRow [ 0 ] ) ; dump ( o , sb ) ; sb . append ( "</td></tr>" ) ; return ( ( counter . decrementAndGet ( ) ) == 0 ) || ( ( ! ( analysisRunning . get ( ) ) ) && ( ! ( engine . isCancelled ( ) ) ) ) ; }
org . junit . Assert . assertTrue ( ( ( counter [ 0 ] ) > 0 ) )
testMacTestVectors ( ) { for ( com . google . crypto . tink . subtle . AesCmacTest . MacTestVector t : com . google . crypto . tink . subtle . AesCmacTest . CMAC_TEST_VECTORS ) { com . google . crypto . tink . Mac mac = new com . google . crypto . tink . subtle . AesCmac ( t . key , t . tag . length ) ; "<AssertPlaceHolder>" ; try { mac . verifyMac ( t . tag , t . message ) ; } catch ( java . security . GeneralSecurityException e ) { org . junit . Assert . fail ( "Valid<sp>MAC,<sp>should<sp>not<sp>throw<sp>exception" ) ; } } } computeMac ( byte [ ] ) { if ( primitives . getPrimary ( ) . getOutputPrefixType ( ) . equals ( OutputPrefixType . LEGACY ) ) { return com . google . crypto . tink . subtle . Bytes . concat ( primitives . getPrimary ( ) . getIdentifier ( ) , primitives . getPrimary ( ) . getPrimitive ( ) . computeMac ( com . google . crypto . tink . subtle . Bytes . concat ( data , formatVersion ) ) ) ; } return com . google . crypto . tink . subtle . Bytes . concat ( primitives . getPrimary ( ) . getIdentifier ( ) , primitives . getPrimary ( ) . getPrimitive ( ) . computeMac ( data ) ) ; }
org . junit . Assert . assertArrayEquals ( t . tag , mac . computeMac ( t . message ) )
testFusedRingFragments ( ) { org . openscience . cdk . ringsearch . RingSearch search = new org . openscience . cdk . ringsearch . RingSearch ( benzene ) ; java . util . List < org . openscience . cdk . interfaces . IAtomContainer > fused = search . fusedRingFragments ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . cells . size ( ) ; }
org . junit . Assert . assertThat ( fused . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
shouldGetLast ( ) { uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . Object > set = new uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . Object > ( ) ; java . lang . String expectedLast = "Z" ; set . addAll ( java . util . Arrays . < java . lang . Object > asList ( 'F' , 0 , null , ( - 2L ) , expectedLast ) ) ; java . lang . Object last = set . last ( ) ; "<AssertPlaceHolder>" ; } last ( ) { T last = null ; for ( T candidate : orderedSet ) { last = candidate ; } return last ; }
org . junit . Assert . assertEquals ( expectedLast , last )
testSetBooleanPrimitiveArrayProperty ( ) { org . junit . Assume . assumeTrue ( this . sqlgGraph . getSqlDialect ( ) . supportsBooleanArrayValues ( ) ) ; org . apache . tinkerpop . gremlin . structure . Vertex marko = this . sqlgGraph . addVertex ( T . label , "Person" , "name" , "marko" ) ; marko . property ( "bools" , new boolean [ ] { true , false } ) ; this . sqlgGraph . tx ( ) . commit ( ) ; "<AssertPlaceHolder>" ; } property ( java . lang . String ) { this . sqlgGraph . tx ( ) . readWrite ( ) ; if ( this . removed ) { throw new java . lang . IllegalStateException ( java . lang . String . format ( "Vertex<sp>with<sp>id<sp>%s<sp>was<sp>removed." , id ( ) . toString ( ) ) ) ; } else { if ( ! ( sqlgGraph . tx ( ) . isInBatchMode ( ) ) ) { org . umlg . sqlg . structure . SqlgVertex sqlgVertex = this . sqlgGraph . tx ( ) . putVertexIfAbsent ( this ) ; if ( sqlgVertex != ( this ) ) { this . properties = sqlgVertex . properties ; } } return ( ( org . umlg . sqlg . structure . VertexProperty < V > ) ( super . property ( key ) ) ) ; } }
org . junit . Assert . assertArrayEquals ( new boolean [ ] { true , false } , ( ( boolean [ ] ) ( marko . property ( "bools" ) . value ( ) ) ) )
distinct_count ( ) { long count1 = query ( ) . from ( employee ) . distinct ( ) . fetchCount ( ) ; long count2 = query ( ) . from ( employee ) . distinct ( ) . fetchCount ( ) ; "<AssertPlaceHolder>" ; } fetchCount ( ) { return innerCount ( ) ; }
org . junit . Assert . assertEquals ( count1 , count2 )
testSetId ( ) { tillerino . tillerinobot . UserDataManager . UserData userData = mock ( tillerino . tillerinobot . UserDataManager . UserData . class ) ; when ( userData . getLanguage ( ) ) . thenReturn ( new tillerino . tillerinobot . lang . Default ( ) ) ; try { new tillerino . tillerinobot . handlers . NPHandler ( null , mock ( tillerino . tillerinobot . websocket . LiveActivityEndpoint . class ) ) . handle ( "is<sp>editing<sp>[https://osu.ppy.sh/s/123<sp>title]" , null , userData ) ; org . junit . Assert . fail ( ) ; } catch ( tillerino . tillerinobot . UserException e ) { "<AssertPlaceHolder>" ; } } isSetId ( ) { return "" ; }
org . junit . Assert . assertEquals ( new tillerino . tillerinobot . lang . Default ( ) . isSetId ( ) , e . getMessage ( ) )
testNamedClass ( ) { org . semanticweb . owlapi . model . OWLClassExpression desc = clsA ; org . semanticweb . owlapi . model . OWLClassExpression nnf = clsA ; org . semanticweb . owlapi . model . OWLClassExpression comp = org . semanticweb . owlapi . api . test . axioms . NNFTestCase . getNNF ( desc ) ; "<AssertPlaceHolder>" ; } getNNF ( org . semanticweb . owlapi . model . OWLClassExpression ) { org . semanticweb . owlapi . util . NNF nnf = new org . semanticweb . owlapi . util . NNF ( df ) ; return classExpression . accept ( nnf . getClassVisitor ( ) ) ; }
org . junit . Assert . assertEquals ( nnf , comp )
testBcryptHash ( ) { com . google . firebase . auth . UserImportHash bcrypt = com . google . firebase . auth . hash . Bcrypt . getInstance ( ) ; java . util . Map < java . lang . String , java . lang . Object > properties = com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( "hashAlgorithm" , "BCRYPT" ) ; "<AssertPlaceHolder>" ; } getProperties ( ) { return this . properties ; }
org . junit . Assert . assertEquals ( properties , bcrypt . getProperties ( ) )
testAgentThreadCatchesUncaughtExceptions ( ) { final org . jsoar . runtime . ThreadedAgent agent = org . jsoar . runtime . ThreadedAgent . create ( ) ; agent . execute ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . jsoar . runtime . Override public org . jsoar . runtime . Void call ( ) throws java . lang . Exception { throw new java . lang . IllegalStateException ( "Test<sp>exception<sp>thrown<sp>by<sp>testAgentThreadCatchesUnhandledExceptions" ) ; } } , null ) ; final java . lang . String result = agent . executeAndWait ( new java . util . concurrent . Callable < java . lang . String > ( ) { @ org . jsoar . runtime . Override public java . lang . String call ( ) throws java . lang . Exception { return "success" ; } } , 10000 , TimeUnit . MILLISECONDS ) ; "<AssertPlaceHolder>" ; } call ( ) { org . jsoar . util . commands . SoarCommands . source ( agent . getInterpreter ( ) , source ) ; return null ; }
org . junit . Assert . assertEquals ( "success" , result )
testGetCapitalizedName13 ( ) { java . lang . String input = "xIndex" ; java . lang . String output = com . jmethods . catatumbo . impl . IntrospectionUtils . getCapitalizedName ( input ) ; com . jmethods . catatumbo . impl . IntrospectionUtilsTest . LOGGER . info ( ( ( input + "-->" ) + output ) ) ; "<AssertPlaceHolder>" ; } getCapitalizedName ( java . lang . String ) { if ( ( ( fieldName . length ( ) ) > 1 ) && ( java . lang . Character . isUpperCase ( fieldName . charAt ( 1 ) ) ) ) { return fieldName ; } return ( java . lang . Character . toUpperCase ( fieldName . charAt ( 0 ) ) ) + ( fieldName . substring ( 1 ) ) ; }
org . junit . Assert . assertEquals ( "xIndex" , output )
testWeightedXentWithLogits ( ) { org . nd4j . autodiff . samediff . SameDiff sameDiff = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . linalg . api . ndarray . INDArray targets = org . nd4j . linalg . factory . Nd4j . create ( new long [ ] { 1 , 5 } ) ; org . nd4j . linalg . api . ndarray . INDArray inputs = org . nd4j . linalg . factory . Nd4j . create ( new long [ ] { 1 , 5 } ) ; org . nd4j . linalg . api . ndarray . INDArray weights = org . nd4j . linalg . factory . Nd4j . create ( new long [ ] { 1 , 5 } ) ; org . nd4j . autodiff . samediff . SDVariable sdInputs = sameDiff . var ( "inputs" , inputs ) ; org . nd4j . autodiff . samediff . SDVariable sdWeights = sameDiff . var ( "weights" , weights ) ; org . nd4j . autodiff . samediff . SDVariable sdTargets = sameDiff . var ( "targets" , targets ) ; org . nd4j . autodiff . samediff . SDVariable res = sameDiff . weightedCrossEntropyWithLogits ( sdTargets , sdInputs , sdWeights ) ; sameDiff . exec ( ) ; org . nd4j . linalg . api . ndarray . INDArray resultArray = res . getArr ( ) ; "<AssertPlaceHolder>" ; } getShape ( ) { long [ ] initialShape = sameDiff . getShapeForVarName ( getVarName ( ) ) ; if ( initialShape == null ) { org . nd4j . autodiff . samediff . val arr = getArr ( ) ; if ( arr != null ) return arr . shape ( ) ; } return initialShape ; }
org . junit . Assert . assertArrayEquals ( new long [ ] { 1 , 5 } , res . getShape ( ) )
testConvertAplicationIdToString ( ) { org . apache . hadoop . yarn . api . records . ApplicationId applicationId = org . apache . hadoop . yarn . api . records . ApplicationId . newInstance ( 0 , 1 ) ; java . lang . String applicationIdStr = org . apache . hadoop . yarn . server . timelineservice . storage . common . HBaseTimelineSchemaUtils . convertApplicationIdToString ( applicationId ) ; "<AssertPlaceHolder>" ; } fromString ( java . lang . String ) { java . lang . StringBuffer buf = new java . lang . StringBuffer ( ) ; java . util . Iterator < java . lang . String > it = org . apache . hadoop . yarn . api . records . timeline . TimelineEntityGroupId . SPLITTER . split ( timelineEntityGroupIdStr ) . iterator ( ) ; if ( ! ( it . next ( ) . equals ( org . apache . hadoop . yarn . api . records . timeline . TimelineEntityGroupId . TIMELINE_ENTITY_GROUPID_STR_PREFIX ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>TimelineEntityGroupId<sp>prefix:<sp>" + timelineEntityGroupIdStr ) ) ; } org . apache . hadoop . yarn . api . records . ApplicationId appId = org . apache . hadoop . yarn . api . records . ApplicationId . newInstance ( java . lang . Long . parseLong ( it . next ( ) ) , java . lang . Integer . parseInt ( it . next ( ) ) ) ; buf . append ( it . next ( ) ) ; while ( it . hasNext ( ) ) { buf . append ( "_" ) ; buf . append ( it . next ( ) ) ; } return org . apache . hadoop . yarn . api . records . timeline . TimelineEntityGroupId . newInstance ( appId , buf . toString ( ) ) ; }
org . junit . Assert . assertEquals ( applicationId , org . apache . hadoop . yarn . api . records . ApplicationId . fromString ( applicationIdStr ) )
switchDtoTest ( ) { org . openkilda . northbound . dto . v1 . switches . SwitchDto dto = new org . openkilda . northbound . dto . v1 . switches . SwitchDto ( org . openkilda . northbound . dto . JsonSerializationTest . SWITCH_ID , "address-test" , "host" , "desc" , "state" , false ) ; "<AssertPlaceHolder>" ; } pass ( T , java . lang . Class ) { return mapper . readValue ( mapper . writeValueAsString ( entity ) , clazz ) ; }
org . junit . Assert . assertEquals ( dto , pass ( dto , org . openkilda . northbound . dto . v1 . switches . SwitchDto . class ) )
toString_A$ ( ) { com . m3 . scalaflavor4j . RichFunction5 < java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . Integer > f = new com . m3 . scalaflavor4j . RichFunction5 ( new com . m3 . scalaflavor4j . F5 < java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . Integer > ( ) { public com . m3 . scalaflavor4j . Integer apply ( java . lang . String v1 , java . lang . String v2 , java . lang . String v3 , java . lang . String v4 , java . lang . String v5 ) { return ( ( ( ( v1 + v2 ) + v3 ) + v4 ) + v5 ) . length ( ) ; } } ) ; java . lang . String actual = f . toString ( ) ; java . lang . String expected = "<function5>" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( "SInt(" + ( value ) ) + ")" ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
testCreateRouterApiException ( ) { _resource . configure ( "BigSwitchBcfResource" , _parameters ) ; doThrow ( new com . cloud . network . bigswitch . BigSwitchBcfApiException ( ) ) . when ( _bigswitchBcfApi ) . createRouter ( ( ( java . lang . String ) ( any ( ) ) ) , ( ( com . cloud . network . bigswitch . RouterData ) ( any ( ) ) ) ) ; com . cloud . agent . api . CreateBcfRouterCommand cmd = new com . cloud . agent . api . CreateBcfRouterCommand ( "tenantid" ) ; com . cloud . agent . api . BcfAnswer ans = ( ( com . cloud . agent . api . BcfAnswer ) ( _resource . executeRequest ( cmd ) ) ) ; "<AssertPlaceHolder>" ; verify ( _bigswitchBcfApi , times ( 3 ) ) . createRouter ( ( ( java . lang . String ) ( any ( ) ) ) , ( ( com . cloud . network . bigswitch . RouterData ) ( any ( ) ) ) ) ; } getResult ( ) { return this . result ; }
org . junit . Assert . assertFalse ( ans . getResult ( ) )
toString_A$ ( ) { java . lang . String line = null ; com . github . seratch . taskun . scheduler . crond . RawCrontabLine target = new com . github . seratch . taskun . scheduler . crond . RawCrontabLine ( line ) ; java . lang . String actual = target . toString ( ) ; java . lang . String expected = "" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( commandClassName ) == null ? "" : this . commandClassName . trim ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
shouldReturnFigureWhenSeveralLines ( ) { logFile . log ( "/tetrisServlet?figure=S&x=4&y=17&glass=+++" , "" ) ; logFile . log ( "/tetrisServlet?figure=T&x=4&y=16&glass=+++" , "" ) ; logFile . readNextStep ( ) ; logFile . readNextStep ( ) ; "<AssertPlaceHolder>" ; } getCurrentFigure ( ) { java . util . regex . Matcher matcher = figurePattern . matcher ( currentLine ) ; if ( matcher . find ( ) ) { try { return Figure . Type . valueOf ( matcher . group ( 1 ) ) ; } catch ( java . lang . IllegalArgumentException e ) { return null ; } } return null ; }
org . junit . Assert . assertEquals ( Figure . Type . T , logFile . getCurrentFigure ( ) )
testRun2 ( ) { ij . process . ImageProcessor cp1 = new ij . process . ColorProcessor ( javax . imageio . ImageIO . read ( new java . io . File ( "src/test/resources/susan-in.gif" ) ) ) ; ij . process . ImageProcessor cp2 = new ij . process . ColorProcessor ( javax . imageio . ImageIO . read ( new java . io . File ( "src/test/resources/susan-in.gif" ) ) ) ; cp2 = cp2 . convertToByte ( true ) ; de . lmu . ifi . dbs . jfeaturelib . edgeDetector . Susan s1 = new de . lmu . ifi . dbs . jfeaturelib . edgeDetector . Susan ( ) ; de . lmu . ifi . dbs . jfeaturelib . edgeDetector . Susan s2 = new de . lmu . ifi . dbs . jfeaturelib . edgeDetector . Susan ( ) ; s1 . run ( cp1 ) ; s2 . run ( cp2 ) ; cp1 = s1 . getEdgemask ( ) ; cp2 = s2 . getEdgemask ( ) ; int delta = 0 ; for ( int i = 0 ; i < ( cp1 . getPixelCount ( ) ) ; i ++ ) { if ( ( cp1 . get ( i ) ) != ( cp2 . get ( i ) ) ) { delta ++ ; } } "<AssertPlaceHolder>" ; } get ( java . awt . Rectangle ) { int x2 = java . lang . Math . min ( ( ( region . x ) + ( region . width ) ) , m_width ) ; int y2 = java . lang . Math . min ( ( ( region . y ) + ( region . height ) ) , m_height ) ; return ( ( ( get ( x2 , y2 ) ) - ( get ( region . x , y2 ) ) ) - ( get ( x2 , region . y ) ) ) + ( get ( region . x , region . y ) ) ; }
org . junit . Assert . assertTrue ( ( 200 > delta ) )
testGetRegularMessage ( ) { final java . lang . String expectedErrorMessage = "Expected<sp>regular<sp>message." ; final org . kie . workbench . common . dmn . client . editors . types . common . errors . DataTypeNameIsDefaultTypeMessage errorMessage = new org . kie . workbench . common . dmn . client . editors . types . common . errors . DataTypeNameIsDefaultTypeMessage ( translationService ) ; when ( translationService . format ( org . kie . workbench . common . dmn . client . editors . types . common . errors . DataTypeNameIsDefaultTypeMessage_RegularMessage ) ) . thenReturn ( expectedErrorMessage ) ; final java . lang . String actualErrorMessage = errorMessage . getRegularMessage ( ) ; "<AssertPlaceHolder>" ; } getRegularMessage ( ) { return regularMessage ; }
org . junit . Assert . assertEquals ( expectedErrorMessage , actualErrorMessage )
shouldContinueThroughEmptyIdBatch ( ) { org . neo4j . kernel . impl . store . id . IdSequence idSource = mock ( org . neo4j . kernel . impl . store . id . IdSequence . class ) ; java . util . Iterator < org . neo4j . kernel . impl . store . id . IdRange > ranges = asList ( new org . neo4j . kernel . impl . store . id . IdRange ( EMPTY_LONG_ARRAY , 0 , org . neo4j . kernel . impl . store . id . RenewableBatchIdSequenceTest . BATCH_SIZE ) , new org . neo4j . kernel . impl . store . id . IdRange ( EMPTY_LONG_ARRAY , org . neo4j . kernel . impl . store . id . RenewableBatchIdSequenceTest . BATCH_SIZE , 0 ) , new org . neo4j . kernel . impl . store . id . IdRange ( EMPTY_LONG_ARRAY , org . neo4j . kernel . impl . store . id . RenewableBatchIdSequenceTest . BATCH_SIZE , org . neo4j . kernel . impl . store . id . RenewableBatchIdSequenceTest . BATCH_SIZE ) ) . iterator ( ) ; when ( idSource . nextIdBatch ( anyInt ( ) ) ) . thenAnswer ( ( invocation ) -> ranges . next ( ) ) ; org . neo4j . kernel . impl . store . id . RenewableBatchIdSequence ids = new org . neo4j . kernel . impl . store . id . RenewableBatchIdSequence ( idSource , org . neo4j . kernel . impl . store . id . RenewableBatchIdSequenceTest . BATCH_SIZE , excessIds :: add ) ; for ( long expectedId = 0 ; expectedId < ( ( org . neo4j . kernel . impl . store . id . RenewableBatchIdSequenceTest . BATCH_SIZE ) * 2 ) ; expectedId ++ ) { "<AssertPlaceHolder>" ; } } nextId ( ) { assert ! ( closed ) ; long id ; while ( ( ( currentBatch ) == null ) || ( ( id = currentBatch . nextId ( ) ) == ( org . neo4j . kernel . impl . store . id . IdRangeIterator . VALUE_REPRESENTING_NULL ) ) ) { currentBatch = source . nextIdBatch ( batchSize ) . iterator ( ) ; } return id ; }
org . junit . Assert . assertEquals ( expectedId , ids . nextId ( ) )
testDumpSensitiveProperty ( ) { final java . lang . String myPassword = "ThisIsMyPassword" ; org . apache . hadoop . conf . Configuration testConf = new org . apache . hadoop . conf . Configuration ( false ) ; out = new java . io . BufferedWriter ( new java . io . FileWriter ( org . apache . hadoop . conf . TestConfiguration . CONFIG ) ) ; startConfig ( ) ; appendProperty ( "test.password" , myPassword ) ; endConfig ( ) ; org . apache . hadoop . fs . Path fileResource = new org . apache . hadoop . fs . Path ( org . apache . hadoop . conf . TestConfiguration . CONFIG ) ; testConf . addResource ( fileResource ) ; try ( java . io . StringWriter outWriter = new java . io . StringWriter ( ) ) { testConf . set ( org . apache . hadoop . conf . TestConfiguration . SENSITIVE_CONFIG_KEYS , "password$" ) ; org . apache . hadoop . conf . Configuration . dumpConfiguration ( testConf , "test.password" , outWriter ) ; "<AssertPlaceHolder>" ; } } toString ( ) { return ( ( ( ( ( ( ( ( ( ( "OzoneFileSystem{URI=" + ( uri ) ) + ",<sp>" ) + "workingDir=" ) + ( workingDir ) ) + ",<sp>" ) + "userName=" ) + ( userName ) ) + ",<sp>" ) + "statistics=" ) + ( statistics ) ) + "}" ; }
org . junit . Assert . assertFalse ( outWriter . toString ( ) . contains ( myPassword ) )
should_be_able_to_handle_two_params_without_named_nodes ( ) { java . util . Map < java . lang . String , java . lang . Object > props1 = new java . util . HashMap ( ) ; props1 . put ( "name" , "Andy" ) ; props1 . put ( "position" , "Andy" 1 ) ; java . util . Map < java . lang . String , java . lang . Object > props2 = new java . util . HashMap ( ) ; props2 . put ( "name" , "Andy" 0 ) ; props2 . put ( "awesome" , "true" ) ; java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap ( ) ; params . put ( "props1" , props1 ) ; params . put ( "props2" , props2 ) ; java . lang . String query = "MATCH<sp>(n)<sp>WHERE<sp>id(n)<sp>=<sp>0<sp>" + ( "MERGE<sp>p<sp>=<sp>(n)-[:REL]->({name:<sp>$props1.name,<sp>position:<sp>$props1.position})-[:LER]->({name:<sp>$props2.name,<sp>awesome:<sp>$props2.awesome})<sp>" + "RETURN<sp>p" ) ; org . neo4j . graphdb . Result result = db . execute ( query , params ) ; "<AssertPlaceHolder>" ; } execute ( java . lang . String , java . util . Map ) { return getGraphDatabaseAPI ( ) . execute ( query , parameters ) ; }
org . junit . Assert . assertThat ( count ( result ) , org . hamcrest . CoreMatchers . is ( 1L ) )
testRemoveMessageFuture ( ) { com . navercorp . pinpoint . rpc . client . RequestManager requestManager = new com . navercorp . pinpoint . rpc . client . RequestManager ( timer , 3000 ) ; try { int requestId = requestManager . nextRequestId ( ) ; com . navercorp . pinpoint . rpc . DefaultFuture future = requestManager . register ( requestId , 2000 ) ; future . setFailure ( new java . lang . RuntimeException ( ) ) ; com . navercorp . pinpoint . rpc . Future nullFuture = requestManager . removeMessageFuture ( requestId ) ; "<AssertPlaceHolder>" ; } finally { requestManager . close ( ) ; } } removeMessageFuture ( int ) { return this . requestMap . remove ( requestId ) ; }
org . junit . Assert . assertNull ( nullFuture )
testThatTheMortgageBalanceIsNotImpactedIfTheCashDownIsSufficient ( ) { float insufficientCashDown = ( minCashDown ) + 1 ; float expetedBalance = ( mortgageAllowance ) - insufficientCashDown ; "<AssertPlaceHolder>" ; } evaluate ( float , float ) { float mortgageBalance = mortgageAllowance - cashDown ; if ( info . novatec . testit . livingdoc . samples . application . mortgage . MortgageBalanceCalculator . isInsufficient ( mortgageAllowance , cashDown ) ) { mortgageBalance = mortgageBalance * ( 1 + ( info . novatec . testit . livingdoc . samples . application . mortgage . MortgageBalanceCalculator . MIN_CASH_DOWN_FEE_RATIO ) ) ; } return mortgageBalance ; }
org . junit . Assert . assertTrue ( ( expetedBalance == ( info . novatec . testit . livingdoc . samples . application . mortgage . MortgageBalanceCalculator . evaluate ( mortgageAllowance , insufficientCashDown ) ) ) )
testUncachedStatementReallyCloses ( ) { java . sql . PreparedStatement proxy = JdbcProxyFactory . INSTANCE . getProxyPreparedStatement ( connection , stmt , null ) ; proxy . close ( ) ; "<AssertPlaceHolder>" ; verify ( stmt ) . close ( ) ; } isClosed ( ) { return ( delegate ) == null ; }
org . junit . Assert . assertTrue ( proxy . isClosed ( ) )
testCommonOrderGeneratedImplicitlyFromGroupFields ( ) { com . datasalt . pangool . tuplemr . TupleMRConfigBuilder b = new com . datasalt . pangool . tuplemr . TupleMRConfigBuilder ( ) ; b . addIntermediateSchema ( new com . datasalt . pangool . io . Schema ( "schema1" , com . datasalt . pangool . io . Fields . parse ( "a:int,b:string,c:string,blabla:string" ) ) ) ; b . setGroupByFields ( "c" , "b" ) ; com . datasalt . pangool . tuplemr . TupleMRConfig config = b . buildConf ( ) ; config . getSerializationInfo ( ) ; { java . util . List < com . datasalt . pangool . tuplemr . Criteria . SortElement > expectedCommon = new java . util . ArrayList < com . datasalt . pangool . tuplemr . Criteria . SortElement > ( ) ; expectedCommon . add ( new com . datasalt . pangool . tuplemr . Criteria . SortElement ( "c" , com . datasalt . pangool . tuplemr . Criteria . Order . ASC , Criteria . NullOrder . NULL_SMALLEST ) ) ; expectedCommon . add ( new com . datasalt . pangool . tuplemr . Criteria . SortElement ( "b" , com . datasalt . pangool . tuplemr . Criteria . Order . ASC , Criteria . NullOrder . NULL_SMALLEST ) ) ; "<AssertPlaceHolder>" ; } } getCommonCriteria ( ) { return commonCriteria ; }
org . junit . Assert . assertEquals ( new com . datasalt . pangool . tuplemr . Criteria ( expectedCommon ) , config . getCommonCriteria ( ) )
startSession_sessionIsPaused_stateChangedToActive ( ) { target . startSession ( ) ; target . pauseSession ( ) ; target . startSession ( ) ; "<AssertPlaceHolder>" ; } getSessionState ( ) { if ( ( this . session ) != null ) { return this . session . isPaused ( ) ? com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . client . DefaultSessionClient . SessionState . PAUSED : com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . client . DefaultSessionClient . SessionState . ACTIVE ; } return com . amazonaws . mobileconnectors . amazonmobileanalytics . internal . session . client . DefaultSessionClient . SessionState . INACTIVE ; }
org . junit . Assert . assertEquals ( target . getSessionState ( ) , DefaultSessionClient . SessionState . ACTIVE )
testIsNotRevealedWhenFullyOutOfRightBottomEdge ( ) { org . eclipse . swt . graphics . Point origin = new org . eclipse . swt . graphics . Point ( 0 , 0 ) ; org . eclipse . swt . graphics . Rectangle clientArea = createRectangle ( 0 , 0 , 100 , 100 ) ; org . eclipse . swt . graphics . Rectangle controlBounds = createRectangle ( 120 , 120 , 10 , 10 ) ; boolean isRevealed = com . eclipsesource . tabris . internal . ScrollingCompositeUtil . isRevealed ( origin , clientArea , controlBounds ) ; "<AssertPlaceHolder>" ; } isRevealed ( org . eclipse . swt . graphics . Point , org . eclipse . swt . graphics . Rectangle , org . eclipse . swt . graphics . Rectangle ) { boolean verticalVisible = com . eclipsesource . tabris . internal . ScrollingCompositeUtil . isVerticallyVisible ( origin , clientArea , controlBounds ) ; boolean horizontalVisible = com . eclipsesource . tabris . internal . ScrollingCompositeUtil . isHorizontallyVisible ( origin , clientArea , controlBounds ) ; return horizontalVisible && verticalVisible ; }
org . junit . Assert . assertFalse ( isRevealed )
testDoubleListApplyWithNullValueAndNullOption ( ) { org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroup ( ) ; group . defineTemplate ( "test" , "name" , "<name:{n<sp>|<sp><n>}:{n<sp>|<sp>[<n>]};<sp>null=\"n/a\">" ) ; org . stringtemplate . v4 . ST st = group . getInstanceOf ( "test" ) ; st . add ( "name" , "Ter" ) ; st . add ( "name" , null ) ; st . add ( "name" , "Sumana" ) ; java . lang . String expected = "[Ter]n/a[Sumana]" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
shouldCreateNewObjectInEmbeddedMongoDb ( ) { com . mongodb . DB db = mongo . getDB ( com . dp . nebula . wormhole . plugins . reader . mongoreader . MongoReaderTest . DATABASE_NAME ) ; com . mongodb . DBCollection col = db . createCollection ( "testCollection" , new com . mongodb . BasicDBObject ( ) ) ; com . mongodb . BasicDBObject document = new com . mongodb . BasicDBObject ( ) ; document . put ( "id" , 1001 ) ; document . put ( "msg" , "hello<sp>world<sp>mongoDB<sp>in<sp>Java" ) ; col . insert ( document ) ; com . mongodb . DBCursor cursor = col . find ( null , com . dp . nebula . wormhole . plugins . common . MongoUtils . convertStringToDBObject ( "{<sp>msg:1}" ) ) ; while ( cursor . hasNext ( ) ) { System . out . println ( cursor . next ( ) . toString ( ) ) ; } com . dp . nebula . wormhole . plugins . reader . mongoreader . MongoReader mongoReader = new com . dp . nebula . wormhole . plugins . reader . mongoreader . MongoReader ( ) ; java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( ParamKey . inputUri , ( ( "mongodb://localhost:" + ( com . dp . nebula . wormhole . plugins . reader . mongoreader . MongoReaderTest . MONGODB_PORT ) ) + "/embedded.testCollection" ) ) ; params . put ( ParamKey . inputFields , "{<sp>msg<sp>:<sp>1<sp>}" ) ; com . dp . nebula . wormhole . common . interfaces . IParam iParam = new com . dp . nebula . wormhole . common . DefaultParam ( params ) ; mongoReader . setParam ( iParam ) ; com . dp . nebula . wormhole . common . BufferedLineExchanger bufLineExchanger = com . dp . nebula . wormhole . plugins . reader . hivereader . HiveReaderTest . getBufferedLineExchangerInstance ( ) ; com . dp . nebula . wormhole . common . interfaces . IPluginMonitor pluginMonitor = mock ( com . dp . nebula . wormhole . common . interfaces . IPluginMonitor . class ) ; mongoReader . setMonitor ( pluginMonitor ) ; mongoReader . init ( ) ; mongoReader . connection ( ) ; mongoReader . read ( bufLineExchanger ) ; com . dp . nebula . wormhole . common . interfaces . ILine line = bufLineExchanger . receive ( ) ; System . out . println ( line . getField ( 0 ) ) ; "<AssertPlaceHolder>" ; mongoReader . finish ( ) ; } getField ( int ) { return fieldList [ idx ] ; }
org . junit . Assert . assertEquals ( "hello<sp>world<sp>mongoDB<sp>in<sp>Java" , line . getField ( 0 ) )
testSubnentNotFound ( ) { ec2mock . createDescribeSubnetsResult ( "Testsubnet-a77430d0" ) ; com . amazonaws . services . ec2 . model . Subnet subnet = ec2comm . resolveSubnet ( "subnet-a77430d0" ) ; "<AssertPlaceHolder>" ; } resolveSubnet ( java . lang . String ) { com . amazonaws . services . ec2 . model . DescribeSubnetsRequest request = new com . amazonaws . services . ec2 . model . DescribeSubnetsRequest ( ) ; com . amazonaws . services . ec2 . model . DescribeSubnetsResult result = getEC2 ( ) . describeSubnets ( request . withSubnetIds ( subnetString ) ) ; java . util . List < com . amazonaws . services . ec2 . model . Subnet > subnets = result . getSubnets ( ) ; if ( ! ( subnets . isEmpty ( ) ) ) { org . oscm . app . aws . EC2Communication . LOGGER . debug ( ( "<sp>number<sp>of<sp>subnets<sp>found:<sp>" + ( subnets . size ( ) ) ) ) ; for ( com . amazonaws . services . ec2 . model . Subnet subnet : subnets ) { org . oscm . app . aws . EC2Communication . LOGGER . debug ( ( "return<sp>subnet<sp>with<sp>id<sp>" + ( subnet . getSubnetId ( ) ) ) ) ; return subnet ; } } throw new org . oscm . app . v2_0 . exceptions . APPlatformException ( ( ( org . oscm . app . aws . i18n . Messages . getAll ( "error_invalid_subnet_id" ) ) + subnetString ) ) ; }
org . junit . Assert . assertFalse ( "subnet-a77430d0" . equals ( subnet . getSubnetId ( ) ) )
whenFileSystemIsClean_stashShouldBeUnsuccessful ( ) { com . beijunyi . parallelgit . filesystem . commands . GfsCreateStash . Result result = com . beijunyi . parallelgit . filesystem . Gfs . createStash ( gfs ) . execute ( ) ; "<AssertPlaceHolder>" ; } isSuccessful ( ) { return ( commit ) != null ; }
org . junit . Assert . assertFalse ( result . isSuccessful ( ) )
testConvert ( ) { java . lang . Long id = 1L ; java . lang . Long departmentId = 2L ; java . lang . Long specialtyId = 3L ; org . lnu . is . domain . specialty . Specialty specialty = new org . lnu . is . domain . specialty . Specialty ( ) ; specialty . setId ( specialtyId ) ; org . lnu . is . domain . department . Department department = new org . lnu . is . domain . department . Department ( ) ; department . setId ( departmentId ) ; org . lnu . is . domain . department . specialty . DepartmentSpecialty expected = new org . lnu . is . domain . department . specialty . DepartmentSpecialty ( ) ; expected . setId ( id ) ; expected . setDepartment ( department ) ; expected . setSpecialty ( specialty ) ; org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource source = new org . lnu . is . resource . department . specialty . DepartmentSpecialtyResource ( ) ; source . setId ( id ) ; source . setDepartmentId ( departmentId ) ; source . setSpecialtyId ( specialtyId ) ; org . lnu . is . domain . department . specialty . DepartmentSpecialty actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testInvalidRead ( ) { org . kuali . rice . kcb . bo . Message m = messageService . getMessage ( java . lang . Long . valueOf ( ( - 1 ) ) ) ; "<AssertPlaceHolder>" ; } getMessage ( java . lang . Object [ ] ) { java . lang . StringBuilder retval = new java . lang . StringBuilder ( ) ; for ( java . lang . Object obj : objs ) { retval . append ( obj ) ; } return retval ; }
org . junit . Assert . assertNull ( m )
indirectsChain2 ( ) { com . itextpdf . kernel . pdf . PdfDocument document = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfWriter ( new java . io . ByteArrayOutputStream ( ) ) ) ; document . addNewPage ( ) ; com . itextpdf . kernel . pdf . PdfDictionary catalog = document . getCatalog ( ) . getPdfObject ( ) ; com . itextpdf . kernel . pdf . PdfDictionary dictionary = com . itextpdf . kernel . pdf . PdfObjectTest . getTestPdfDictionary ( ) ; com . itextpdf . kernel . pdf . PdfObject object = dictionary ; for ( int i = 0 ; i < 200 ; i ++ ) { object = object . makeIndirect ( document ) . getIndirectReference ( ) ; } catalog . put ( new com . itextpdf . kernel . pdf . PdfName ( "a" ) , object ) ; ( ( com . itextpdf . kernel . pdf . PdfIndirectReference ) ( catalog . get ( new com . itextpdf . kernel . pdf . PdfName ( "a" ) ) ) ) . getRefersTo ( true ) ; "<AssertPlaceHolder>" ; document . close ( ) ; } get ( int ) { return vals [ index ] ; }
org . junit . Assert . assertNotNull ( ( ( com . itextpdf . kernel . pdf . PdfIndirectReference ) ( catalog . get ( new com . itextpdf . kernel . pdf . PdfName ( "a" ) ) ) ) . getRefersTo ( true ) )
testGeboorteZelfdeMamaAnderePapaMetBroertjeMetAndereNaam ( ) { voegKindToeAanOuder ( broertje2 , papa2 , mama ) ; final nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . NaamParameters sPara = new nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . NaamParameters ( ) ; sPara . indicatieNamenreeks ( false ) ; final nl . bzk . brp . bijhouding . bericht . model . AdministratieveHandelingElement ah = createAdministratieveHandelingRegistratieGeborene ( 20100101 , sPara , "0001" , "Karel<sp>appel" , "Stam" , "1" , "2" , null , null , null , null , null , null , null ) ; final java . util . List < nl . bzk . brp . bijhouding . bericht . model . MeldingElement > meldingen = ah . valideerInhoud ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
createdMatcher ( ) { org . hamcrest . Matcher < javax . ws . rs . core . Response > created = com . airhacks . rulz . jaxrsclient . HttpMatchers . created ( ) ; javax . ws . rs . core . Response response = mock ( javax . ws . rs . core . Response . class ) ; when ( response . getHeaderString ( "Location" ) ) . thenReturn ( "http://something" ) ; when ( response . getStatus ( ) ) . thenReturn ( 201 ) ; "<AssertPlaceHolder>" ; } created ( ) { final int statusCode = Response . Status . CREATED . getStatusCode ( ) ; return new org . hamcrest . CustomMatcher < javax . ws . rs . core . Response > ( ( ( "created<sp>status<sp>(" + statusCode ) + ")<sp>with<sp>location<sp>header" ) ) { @ com . airhacks . rulz . jaxrsclient . Override public boolean matches ( java . lang . Object o ) { if ( ! ( o instanceof javax . ws . rs . core . Response ) ) { return false ; } javax . ws . rs . core . Response response = ( ( javax . ws . rs . core . Response ) ( o ) ) ; if ( ( response . getStatus ( ) ) == statusCode ) { java . lang . String header = response . getHeaderString ( "Location" ) ; return header != null ; } else { return false ; } } @ com . airhacks . rulz . jaxrsclient . Override public void describeMismatch ( java . lang . Object item , org . hamcrest . Description description ) { javax . ws . rs . core . Response response = ( ( javax . ws . rs . core . Response ) ( item ) ) ; com . airhacks . rulz . jaxrsclient . HttpMatchers . provideDescription ( response , description ) ; } } ; }
org . junit . Assert . assertThat ( response , org . hamcrest . CoreMatchers . is ( created ) )
testPassiveQueryDataDriven ( ) { java . lang . String str = "global<sp>java.util.List<sp>list\n" + ( ( ( ( ( ( ( ( "query<sp>Q<sp>(Integer<sp>i)\n" + "<sp>String(<sp>this<sp>==<sp>i.toString()<sp>)\n" ) + "end\n" ) + "global<sp>java.util.List<sp>list\n" 0 ) + "<sp>$i<sp>:<sp>Integer()\n" ) + "<sp>?Q(<sp>$i;<sp>)\n" ) + "then\n" ) + "<sp>list.add(<sp>$i<sp>);\n" ) + "end\n" ) ; org . kie . api . runtime . KieSession ksession = new org . kie . internal . utils . KieHelper ( ) . addContent ( str , ResourceType . DRL ) . build ( ) . newKieSession ( ) ; java . util . List < java . lang . Integer > list = new java . util . ArrayList < java . lang . Integer > ( ) ; ksession . setGlobal ( "list" , list ) ; ksession . insert ( 1 ) ; ksession . insert ( "1" ) ; ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return rulesFired . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , list . size ( ) )
testDelete ( ) { net . magja . model . product . ProductAttribute pa = createTextAttributeSimple ( ) ; service . save ( pa ) ; "<AssertPlaceHolder>" ; service . delete ( pa . getCode ( ) ) ; } getId ( ) { return id ; }
org . junit . Assert . assertTrue ( ( ( pa . getId ( ) ) != null ) )
testLookupSuccess ( ) { namingContext . bind ( "abc" , "def" ) ; "<AssertPlaceHolder>" ; } lookup ( java . lang . String ) { javax . naming . InitialContext initialContext = com . vladmihalcea . flexypool . util . JndiUtils . initialContext ( ) ; try { @ com . vladmihalcea . flexypool . util . SuppressWarnings ( "unchecked" ) T object = ( ( T ) ( initialContext . lookup ( name ) ) ) ; if ( object == null ) { throw new javax . naming . NameNotFoundException ( ( name + "<sp>was<sp>found<sp>but<sp>is<sp>null" ) ) ; } return object ; } catch ( javax . naming . NameNotFoundException e ) { throw new java . lang . IllegalArgumentException ( ( name + "<sp>was<sp>not<sp>found<sp>in<sp>JNDI" ) , e ) ; } catch ( javax . naming . NamingException e ) { throw new java . lang . IllegalArgumentException ( "JNDI<sp>lookup<sp>failed" , e ) ; } finally { com . vladmihalcea . flexypool . util . JndiUtils . closeContext ( initialContext ) ; } }
org . junit . Assert . assertEquals ( "def" , com . vladmihalcea . flexypool . util . JndiUtils . lookup ( "abc" ) )
testWrite ( ) { java . lang . String path = "src/test/resources/h264/sps/sps1.dat" ; java . nio . ByteBuffer bb = java . nio . ByteBuffer . allocate ( 1024 ) ; sps1 . write ( bb ) ; bb . flip ( ) ; java . nio . ByteBuffer expect = org . jcodec . common . io . NIOUtils . fetchFromFile ( new java . io . File ( path ) ) ; "<AssertPlaceHolder>" ; } toArray ( java . nio . ByteBuffer ) { byte [ ] result = new byte [ buffer . remaining ( ) ] ; buffer . duplicate ( ) . get ( result ) ; return result ; }
org . junit . Assert . assertArrayEquals ( org . jcodec . common . io . NIOUtils . toArray ( bb ) , org . jcodec . common . io . NIOUtils . toArray ( expect ) )
testResetWithoutFailOnMissingPhase ( ) { org . eclipse . elk . core . alg . AlgorithmAssembler < org . eclipse . elk . alg . common . structure . TestPhases , java . lang . StringBuffer > assembler = org . eclipse . elk . core . alg . AlgorithmAssembler . create ( org . eclipse . elk . alg . common . structure . TestPhases . class ) ; assembler . withFailOnMissingPhase ( false ) ; assembler . setPhase ( TestPhases . PHASE_1 , TestPhases . PHASE_1 ) ; assembler . setPhase ( TestPhases . PHASE_2 , TestPhases . PHASE_2 ) ; assembler . reset ( ) ; "<AssertPlaceHolder>" ; } build ( G ) { if ( ( failOnMissingPhase ) && ( ( configuredPhases . size ( ) ) < ( numberOfPhases ) ) ) { throw new java . lang . IllegalStateException ( ( ( ( ( "Expected<sp>" + ( numberOfPhases ) ) + "<sp>phases<sp>to<sp>be<sp>configured;<sp>" ) + "only<sp>found<sp>" ) + ( configuredPhases . size ( ) ) ) ) ; } P [ ] phaseEnumConstants = phasesEnumClass . getEnumConstants ( ) ; java . util . List < org . eclipse . elk . core . alg . ILayoutPhase < P , G > > phaseImplementations = com . google . common . collect . Lists . newArrayListWithCapacity ( numberOfPhases ) ; for ( P phase : phaseEnumConstants ) { org . eclipse . elk . core . alg . ILayoutPhaseFactory < P , G > phaseFactory = getListItem ( phase . ordinal ( ) ) ; if ( phaseFactory != null ) { phaseImplementations . add ( retrievePhase ( phaseFactory ) ) ; } else { phaseImplementations . add ( null ) ; } } org . eclipse . elk . core . alg . LayoutProcessorConfiguration < P , G > processorConfiguration = org . eclipse . elk . core . alg . LayoutProcessorConfiguration . create ( ) ; phaseImplementations . stream ( ) . filter ( ( phase ) -> phase != null ) . map ( ( phase ) -> phase . getLayoutProcessorConfiguration ( graph ) ) . filter ( ( config ) -> config != null ) . forEach ( ( config ) -> processorConfiguration . addAll ( config ) ) ; processorConfiguration . addAll ( additionalProcessors ) ; java . util . List < org . eclipse . elk . core . alg . ILayoutProcessor < G > > algorithm = com . google . common . collect . Lists . newArrayList ( ) ; for ( P phase : phaseEnumConstants ) { algorithm . addAll ( retrieveProcessors ( processorConfiguration . processorsBefore ( phase ) ) ) ; org . eclipse . elk . core . alg . ILayoutPhase < P , G > phaseImplementation = phaseImplementations . get ( phase . ordinal ( ) ) ; if ( phaseImplementation != null ) { algorithm . add ( phaseImplementation ) ; } } algorithm . addAll ( retrieveProcessors ( processorConfiguration . processorsAfter ( phaseEnumConstants [ ( ( phaseEnumConstants . length ) - 1 ) ] ) ) ) ; return algorithm ; }
org . junit . Assert . assertEquals ( 0 , assembler . build ( null ) . size ( ) )
testSynchronized ( ) { int currentNumberOfDbs = org . apache . hadoop . hive . metastore . TestHiveMetaStore . client . getAllDatabases ( ) . size ( ) ; org . apache . hadoop . hive . metastore . IMetaStoreClient synchronizedClient = org . apache . hadoop . hive . metastore . HiveMetaStoreClient . newSynchronizedClient ( org . apache . hadoop . hive . metastore . TestHiveMetaStore . client ) ; java . util . List < java . lang . String > databases = synchronizedClient . getAllDatabases ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( currentNumberOfDbs , databases . size ( ) )
testDataSetSchema ( ) { try ( final com . dremio . datastore . KVStoreProvider kvstore = new com . dremio . datastore . LocalKVStoreProvider ( com . dremio . test . DremioTest . CLASSPATH_SCAN_RESULT , null , true , false ) ) { kvstore . start ( ) ; final com . dremio . service . namespace . NamespaceService ns = new com . dremio . service . namespace . NamespaceServiceImpl ( kvstore ) ; org . apache . arrow . vector . types . pojo . Field field1 = new org . apache . arrow . vector . types . pojo . Field ( "a" , true , new org . apache . arrow . vector . types . pojo . ArrowType . Int ( 32 , true ) , null ) ; org . apache . arrow . vector . types . pojo . Field child1 = new org . apache . arrow . vector . types . pojo . Field ( "c" , true , org . apache . arrow . vector . types . pojo . ArrowType . Utf8 . INSTANCE , null ) ; org . apache . arrow . vector . types . pojo . Field field2 = new org . apache . arrow . vector . types . pojo . Field ( "b" , true , org . apache . arrow . vector . types . pojo . ArrowType . Struct . INSTANCE , com . google . common . collect . ImmutableList . of ( child1 ) ) ; org . apache . arrow . vector . types . pojo . Schema schema = new org . apache . arrow . vector . types . pojo . Schema ( com . google . common . collect . ImmutableList . of ( field1 , field2 ) ) ; com . google . flatbuffers . FlatBufferBuilder builder = new com . google . flatbuffers . FlatBufferBuilder ( ) ; schema . getSchema ( builder ) ; builder . finish ( schema . getSchema ( builder ) ) ; com . dremio . service . namespace . TestNamespaceService . addSource ( ns , "s" ) ; com . dremio . service . namespace . TestNamespaceService . addPhysicalDS ( ns , "s.foo" , builder . sizedByteArray ( ) ) ; java . nio . ByteBuffer bb = java . nio . ByteBuffer . wrap ( com . dremio . service . namespace . DatasetHelper . getSchemaBytes ( ns . getDataset ( new com . dremio . service . namespace . NamespaceKey ( com . dremio . common . utils . PathUtils . parseFullPath ( "s.foo" ) ) ) ) . toByteArray ( ) ) ; org . apache . arrow . vector . types . pojo . Schema returnedSchema = org . apache . arrow . vector . types . pojo . Schema . convertSchema ( org . apache . arrow . flatbuf . Schema . getRootAsSchema ( bb ) ) ; "<AssertPlaceHolder>" ; } } toByteArray ( ) { return pageBytes ; }
org . junit . Assert . assertEquals ( schema , returnedSchema )
testComputeSegment_Imbalanced ( ) { java . util . List < org . axonframework . eventhandling . Segment > segments = new java . util . ArrayList ( ) ; org . axonframework . eventhandling . Segment initialSegment = Segment . ROOT_SEGMENT ; for ( int i = 0 ; i < 8 ; i ++ ) { org . axonframework . eventhandling . Segment [ ] split = initialSegment . split ( ) ; initialSegment = split [ 0 ] ; segments . add ( split [ 1 ] ) ; } segments . add ( initialSegment ) ; int [ ] segmentIds = new int [ segments . size ( ) ] ; for ( int i = 0 ; i < ( segmentIds . length ) ; i ++ ) { segmentIds [ i ] = segments . get ( i ) . getSegmentId ( ) ; } for ( org . axonframework . eventhandling . Segment segment : segments ) { "<AssertPlaceHolder>" ; } } computeSegment ( int , int [ ] ) { org . axonframework . eventhandling . Arrays . sort ( availableSegmentIds ) ; int splitCandidate = ( segmentId == 0 ) ? 1 : ( java . lang . Integer . highestOneBit ( segmentId ) ) << 1 ; while ( ( org . axonframework . eventhandling . Arrays . binarySearch ( availableSegmentIds , ( splitCandidate | segmentId ) ) ) >= 0 ) { splitCandidate = splitCandidate << 1 ; } int mask = splitCandidate - 1 ; return new org . axonframework . eventhandling . Segment ( segmentId , mask ) ; }
org . junit . Assert . assertEquals ( segment , org . axonframework . eventhandling . Segment . computeSegment ( segment . getSegmentId ( ) , segmentIds ) )
testClearMoves ( ) { final org . apache . oozie . fluentjob . api . action . FSActionBuilder builder = getBuilderInstance ( ) ; for ( final org . apache . oozie . fluentjob . api . action . Move move : org . apache . oozie . fluentjob . api . action . TestFSActionBuilder . MOVES ) { builder . withMove ( move ) ; } builder . clearMoves ( ) ; final org . apache . oozie . fluentjob . api . action . FSAction fsAction = builder . build ( ) ; "<AssertPlaceHolder>" ; } getMoves ( ) { return attributes . getMoves ( ) ; }
org . junit . Assert . assertTrue ( fsAction . getMoves ( ) . isEmpty ( ) )
testGetAuthorBooksCount ( ) { java . math . BigInteger bookCount = com . iluwatar . cqrs . IntegrationTest . queryService . getAuthorBooksCount ( "username1" ) ; "<AssertPlaceHolder>" ; } getAuthorBooksCount ( java . lang . String ) { java . math . BigInteger bookcount = null ; try ( org . hibernate . Session session = sessionFactory . openSession ( ) ) { org . hibernate . SQLQuery sqlQuery = session . createSQLQuery ( ( "SELECT<sp>count(b.title)" + "<sp>FROM<sp>Book<sp>b,<sp>Author<sp>a<sp>where<sp>b.author_id<sp>=<sp>a.id<sp>and<sp>a.username=:username" ) ) ; sqlQuery . setParameter ( "username" , username ) ; bookcount = ( ( java . math . BigInteger ) ( sqlQuery . uniqueResult ( ) ) ) ; } return bookcount ; }
org . junit . Assert . assertEquals ( new java . math . BigInteger ( "2" ) , bookCount )
testFindAllUsesViewWithConfiguredConsistency ( ) { java . lang . String expectedQueryParams = "ViewQuery(string/all){params=\"reduce=false&stale=false\"}" ; repository . findAll ( ) ; verify ( couchbaseOperations , never ( ) ) . queryView ( any ( com . couchbase . client . java . view . ViewQuery . class ) ) ; verify ( couchbaseOperations , never ( ) ) . findByN1QL ( any ( com . couchbase . client . java . query . N1qlQuery . class ) , any ( java . lang . Class . class ) ) ; verify ( couchbaseOperations , never ( ) ) . queryN1QL ( any ( com . couchbase . client . java . query . N1qlQuery . class ) ) ; org . mockito . ArgumentCaptor < com . couchbase . client . java . view . ViewQuery > queryCaptor = org . mockito . ArgumentCaptor . forClass ( com . couchbase . client . java . view . ViewQuery . class ) ; verify ( couchbaseOperations ) . findByView ( queryCaptor . capture ( ) , any ( java . lang . Class . class ) ) ; java . lang . String sQuery = queryCaptor . getValue ( ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( "Beer<sp>[id=" + ( id ) ) + ",<sp>name=" ) + ( name ) ) + ",<sp>active=" ) + ( active ) ) + ",<sp>description=" ) + ( description ) ) + "]" ; }
org . junit . Assert . assertEquals ( expectedQueryParams , sQuery )
testAbortWithFailedSystemLogout ( ) { org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModule loginModule = org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . initLoginModule ( org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . TestCredentials . class , new org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . TestCallbackHandler ( new org . apache . jackrabbit . oak . spi . security . authentication . AbstractLoginModuleTest . TestContentRepository ( ) , null , null ) ) ; loginModule . getRoot ( ) ; "<AssertPlaceHolder>" ; } abort ( ) { clearState ( ) ; return true ; }
org . junit . Assert . assertTrue ( loginModule . abort ( ) )
encodeCollectionFormatQueryParam_listOfNulls ( ) { final java . util . List < java . lang . String > values = new java . util . ArrayList ( ) ; values . add ( null ) ; values . add ( null ) ; javax . ws . rs . client . WebTarget target = mock ( javax . ws . rs . client . WebTarget . class ) ; com . oracle . bmc . http . internal . WrappedWebTarget wrapped = new com . oracle . bmc . http . internal . WrappedWebTarget ( target ) ; com . oracle . bmc . http . internal . WrappedWebTarget result = com . oracle . bmc . util . internal . HttpUtils . encodeCollectionFormatQueryParam ( wrapped , "unitTest" , values , CollectionFormatType . Multi ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verifyNoMoreInteractions ( target ) ; } encodeCollectionFormatQueryParam ( com . oracle . bmc . http . internal . WrappedWebTarget , java . lang . String , java . util . List , com . oracle . bmc . util . internal . CollectionFormatType ) { if ( org . apache . commons . lang3 . StringUtils . isBlank ( queryParamName ) ) { throw new java . lang . IllegalArgumentException ( "A<sp>non-blank<sp>queryParamName<sp>must<sp>be<sp>provided" ) ; } if ( ( values != null ) && ( ! ( values . isEmpty ( ) ) ) ) { final java . util . List < java . lang . Object > valuesToUse = new java . util . ArrayList ( ) ; for ( T v : values ) { if ( v == null ) { continue ; } if ( v instanceof java . lang . Enum ) { final java . lang . Object rawValue = com . oracle . bmc . util . internal . ReflectionUtils . invokeGetter ( v , "getValue" ) ; if ( rawValue != null ) { valuesToUse . add ( ( ( java . lang . String ) ( rawValue ) ) ) ; } else { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Could<sp>not<sp>get<sp>the<sp>correct<sp>value<sp>for<sp>enum<sp>%s" , v . getClass ( ) . getCanonicalName ( ) ) ) ; } } else { valuesToUse . add ( v ) ; } } if ( valuesToUse . isEmpty ( ) ) { return target ; } if ( collectionFormatType == ( CollectionFormatType . CommaSeparated ) ) { target = target . queryParam ( queryParamName , com . oracle . bmc . util . internal . HttpUtils . attemptEncodeQueryParam ( org . apache . commons . lang3 . StringUtils . join ( valuesToUse , ',' ) ) ) ; } else if ( collectionFormatType == ( CollectionFormatType . PipeSeparated ) ) { target = target . queryParam ( queryParamName , com . oracle . bmc . util . internal . HttpUtils . attemptEncodeQueryParam ( org . apache . commons . lang3 . StringUtils . join ( valuesToUse , '|' ) ) ) ; } else if ( collectionFormatType == ( CollectionFormatType . SpaceSeparated ) ) { target = target . queryParam ( queryParamName , com . oracle . bmc . util . internal . HttpUtils . attemptEncodeQueryParam ( org . apache . commons . lang3 . StringUtils . join ( valuesToUse , '<sp>' ) ) ) ; } else if ( collectionFormatType == ( CollectionFormatType . TabSeparated ) ) { target = target . queryParam ( queryParamName , com . oracle . bmc . util . internal . HttpUtils . attemptEncodeQueryParam ( org . apache . commons . lang3 . StringUtils . join ( valuesToUse , '\t' ) ) ) ; } else if ( collectionFormatType == ( CollectionFormatType . Multi ) ) { final java . lang . Object [ ] encodedValuesToUse = new java . lang . Object [ valuesToUse . size ( ) ] ; for ( int i = 0 ; i < ( valuesToUse . size ( ) ) ; i ++ ) { encodedValuesToUse [ i ] = com . oracle . bmc . util . internal . HttpUtils . attemptEncodeQueryParam ( valuesToUse . get ( i ) ) ; } target = target . queryParam ( queryParamName , encodedValuesToUse ) ; } else { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Unknown<sp>collection<sp>format<sp>type:<sp>%s" , collectionFormatType ) ) ; } } return target ; }
org . junit . Assert . assertTrue ( ( result == wrapped ) )
testConstructor ( ) { org . openscience . cdk . renderer . font . IFontManager fontManager = new org . openscience . cdk . renderer . font . AWTFontManager ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( fontManager )
testMatch03 ( ) { boolean matchResult = namespacePatternMatcher . matchesEndToEnd ( "a" ) ; "<AssertPlaceHolder>" ; } matchesEndToEnd ( java . lang . String ) { return pattern . matcher ( input ) . matches ( ) ; }
org . junit . Assert . assertTrue ( matchResult )
testGetReference ( ) { org . wikidata . wdtk . datamodel . implementation . Reference r1 = new org . wikidata . wdtk . datamodel . implementation . ReferenceImpl ( java . util . Collections . emptyList ( ) ) ; org . wikidata . wdtk . datamodel . implementation . Reference r2 = factory . getReference ( java . util . Collections . emptyList ( ) ) ; "<AssertPlaceHolder>" ; } getReference ( java . util . List ) { return new org . wikidata . wdtk . datamodel . implementation . ReferenceImpl ( snakGroups ) ; }
org . junit . Assert . assertEquals ( r1 , r2 )
testCapitalizeWords9 ( ) { java . lang . Object s = "<sp>aaaaa....zzzzz<sp>ttttt<sp>nnnnn" ; java . lang . String expResult = "<sp>Aaaaa....Zzzzz<sp>Ttttt<sp>Nnnnn" ; java . lang . String result = org . thymeleaf . util . StringUtils . capitalizeWords ( s , "<sp>." ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( expResult , result )
trashDelete ( ) { org . cojen . tupl . Index ix = mDb . openIndex ( "trash" ) ; ix . store ( null , "hello" . getBytes ( ) , "world" . getBytes ( ) ) ; mDb . checkpoint ( ) ; ix . store ( null , "goodbye" . getBytes ( ) , "world" . getBytes ( ) ) ; mDb . deleteIndex ( ix ) ; mDb = reopenTempDatabase ( getClass ( ) , mDb , mConfig ) ; "<AssertPlaceHolder>" ; } findIndex ( org . cojen . tupl . Index ) { if ( ( activeIndex == null ) || ( activeIndex . isClosed ( ) ) ) { activeIndex = mDatabase . anyIndexById ( mActiveIndexId ) ; } return activeIndex ; }
org . junit . Assert . assertNull ( mDb . findIndex ( "trash" ) )
testConvertBean ( ) { com . bagri . core . server . api . ModelManagement dict = new com . bagri . core . server . api . impl . ModelManagementImpl ( ) ; com . bagri . core . server . api . df . json . JsonpHandler handler = new com . bagri . core . server . api . df . json . JsonpHandler ( dict ) ; com . bagri . core . server . api . ContentConverter < java . lang . String , com . bagri . core . server . api . df . json . JsonpConverterTest . Person > cc = ( ( com . bagri . core . server . api . ContentConverter < java . lang . String , com . bagri . core . server . api . df . json . JsonpConverterTest . Person > ) ( handler . getConverter ( com . bagri . core . server . api . df . json . JsonpConverterTest . Person . class ) ) ) ; com . bagri . core . server . api . df . json . JsonpConverterTest . Person p = new com . bagri . core . server . api . df . json . JsonpConverterTest . Person ( ) ; p . firstName = "John" ; p . lastName = "Smith" ; p . age = 25 ; p . address = new com . bagri . core . server . api . df . json . JsonpConverterTest . Address ( ) ; p . address . streetAddress = "21<sp>2nd<sp>Street" ; p . address . city = "New<sp>York" ; p . address . state = "NY" ; p . address . postalCode = "10021" ; p . phoneNumber = new java . util . ArrayList ( ) ; com . bagri . core . server . api . df . json . JsonpConverterTest . PhoneNumber phone = new com . bagri . core . server . api . df . json . JsonpConverterTest . PhoneNumber ( ) ; phone . type = com . bagri . core . server . api . df . json . JsonpConverterTest . PhoneNumber . PhoneType . home ; phone . number = "212<sp>555-1234" ; p . phoneNumber . add ( phone ) ; phone = new com . bagri . core . server . api . df . json . JsonpConverterTest . PhoneNumber ( ) ; phone . type = com . bagri . core . server . api . df . json . JsonpConverterTest . PhoneNumber . PhoneType . fax ; phone . number = "646<sp>555-4567" ; p . phoneNumber . add ( phone ) ; p . gender = new com . bagri . core . server . api . df . json . JsonpConverterTest . Gender ( ) ; p . gender . type = com . bagri . core . server . api . df . json . JsonpConverterTest . Gender . GenderType . male ; java . lang . String result = cc . convertFrom ( p ) ; System . out . println ( result ) ; "<AssertPlaceHolder>" ; com . bagri . core . server . api . ContentConverter < java . lang . String , java . util . Map > ccm = ( ( com . bagri . core . server . api . ContentConverter < java . lang . String , java . util . Map > ) ( handler . getConverter ( java . util . Map . class ) ) ) ; testPersonConversion ( ccm , result ) ; } convertFrom ( java . lang . Object ) { try { return w . writeValueAsString ( source ) ; } catch ( com . fasterxml . jackson . core . JsonProcessingException ex ) { ex . printStackTrace ( ) ; return null ; } }
org . junit . Assert . assertNotNull ( result )
testMergeAfterNewFieldIsAddedAndPublishingContentAtBranch ( ) { com . liferay . dynamic . data . mapping . model . DDMForm ddmForm = createDDMForm ( ) ; addDDMFormFields ( ddmForm , createTextDDMFormField ( "Text1807" , "" , true , false , false ) ) ; com . liferay . dynamic . data . mapping . model . DDMStructure ddmStructure = createStructure ( "Test<sp>Structure" , ddmForm ) ; com . liferay . dynamic . data . mapping . storage . Field existingField = createField ( ddmStructure . getStructureId ( ) , "Text1807" , null , null ) ; com . liferay . dynamic . data . mapping . storage . Field existingFieldsDisplayField = createFieldsDisplayField ( ddmStructure . getStructureId ( ) , "Text1807_INSTANCE_hgfs" ) ; com . liferay . dynamic . data . mapping . storage . Fields existingFields = createFields ( existingField , existingFieldsDisplayField ) ; ddmStructure . setDDMForm ( ddmForm ) ; com . liferay . dynamic . data . mapping . storage . Field newField = createField ( ddmStructure . getStructureId ( ) , "Test2" , null , null ) ; com . liferay . dynamic . data . mapping . storage . Field newFieldsDisplayField = createFieldsDisplayField ( ddmStructure . getStructureId ( ) , "Text1807_INSTANCE_hgfs,Text1853_INSTANCE_cgac" ) ; com . liferay . dynamic . data . mapping . storage . Fields newFields = createFields ( newField , newFieldsDisplayField ) ; com . liferay . dynamic . data . mapping . storage . Fields mergedFields = _ddm . mergeFields ( newFields , existingFields ) ; com . liferay . dynamic . data . mapping . storage . Field fieldsDisplayField = mergedFields . get ( DDMImpl . FIELDS_DISPLAY_NAME ) ; "<AssertPlaceHolder>" ; java . lang . String fieldsDisplayValue = ( ( java . lang . String ) ( fieldsDisplayField . getValue ( ) ) ) ; java . lang . String [ ] fieldsDisplayValues = com . liferay . portal . kernel . util . StringUtil . split ( fieldsDisplayValue ) ; testValues ( fieldsDisplayValues , "Text1807_INSTANCE_hgfs" , "Text1853_INSTANCE_cgac" ) ; } get ( java . lang . String ) { return com . liferay . journal . content . search . web . configuration . JournalContentSearchWebConfigurationUtil . _configuration . get ( key ) ; }
org . junit . Assert . assertNotNull ( fieldsDisplayField )
testNotEquals ( ) { com . facebook . buck . core . model . BuildTarget utilTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( com . facebook . buck . core . model . BuildTargetTest . ROOT , "//src/com/facebook/buck/util" , "util" ) ; com . facebook . buck . core . model . BuildTarget ioTarget = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( com . facebook . buck . core . model . BuildTargetTest . ROOT , "//src/com/facebook/buck/util" , "io" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( super . equals ( o ) ) ) { return false ; } throw new java . lang . UnsupportedOperationException ( "Multiple<sp>conflicting<sp>Finished<sp>events<sp>detected." ) ; }
org . junit . Assert . assertFalse ( utilTarget . equals ( ioTarget ) )
testTransformReturnsNullIfMonitoringInfoWithUnknownPCollectionLabelPresent ( ) { java . util . Map < java . lang . String , org . apache . beam . runners . dataflow . worker . counters . NameContext > pcollectionNameMapping = new java . util . HashMap ( ) ; org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo monitoringInfo = org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo . newBuilder ( ) . setUrn ( "beam:metric:element_count:v1" ) . putLabels ( MonitoringInfoConstants . Labels . PCOLLECTION , "anyValue" ) . build ( ) ; org . apache . beam . runners . dataflow . worker . fn . control . ElementCountMonitoringInfoToCounterUpdateTransformer testObject = new org . apache . beam . runners . dataflow . worker . fn . control . ElementCountMonitoringInfoToCounterUpdateTransformer ( mockSpecValidator , pcollectionNameMapping ) ; when ( mockSpecValidator . validate ( any ( ) ) ) . thenReturn ( java . util . Optional . empty ( ) ) ; "<AssertPlaceHolder>" ; } transform ( org . apache . beam . model . pipeline . v1 . MetricsApi . MonitoringInfo ) { java . util . Optional < java . lang . String > validationResult = validate ( monitoringInfo ) ; if ( validationResult . isPresent ( ) ) { org . apache . beam . runners . dataflow . worker . fn . control . ElementCountMonitoringInfoToCounterUpdateTransformer . LOG . info ( validationResult . get ( ) ) ; return null ; } long value = monitoringInfo . getMetric ( ) . getCounterData ( ) . getInt64Value ( ) ; final java . lang . String pcollectionId = monitoringInfo . getLabelsMap ( ) . get ( MonitoringInfoConstants . Labels . PCOLLECTION ) ; final java . lang . String pcollectionName = pcollectionIdToNameContext . get ( pcollectionId ) . userName ( ) ; java . lang . String counterName = pcollectionName + "-ElementCount" ; com . google . api . services . dataflow . model . NameAndKind name = new com . google . api . services . dataflow . model . NameAndKind ( ) ; name . setName ( counterName ) . setKind ( "SUM" ) ; return new com . google . api . services . dataflow . model . CounterUpdate ( ) . setNameAndKind ( name ) . setCumulative ( true ) . setInteger ( org . apache . beam . runners . dataflow . worker . counters . DataflowCounterUpdateExtractor . longToSplitInt ( value ) ) ; }
org . junit . Assert . assertEquals ( null , testObject . transform ( monitoringInfo ) )
testGetNotExist ( ) { jp . primecloud . auto . zabbix . model . application . ApplicationGetParam param = new jp . primecloud . auto . zabbix . model . application . ApplicationGetParam ( ) ; param . setApplicationids ( java . util . Arrays . asList ( "999999" ) ) ; param . setOutput ( "extend" ) ; java . util . List < jp . primecloud . auto . zabbix . model . application . Application > applications = client . application ( ) . get ( param ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { if ( ( jp . primecloud . auto . ui . util . ViewProperties . userBundle ) != null ) { try { return jp . primecloud . auto . ui . util . ViewProperties . userBundle . getString ( key ) ; } catch ( java . util . MissingResourceException ignore ) { } } try { return jp . primecloud . auto . ui . util . ViewProperties . defaultBundle . getString ( key ) ; } catch ( java . util . MissingResourceException ignore ) { } return "" ; }
org . junit . Assert . assertEquals ( 0 , applications . size ( ) )
testFindAddresses ( ) { "<AssertPlaceHolder>" ; } findAddresses ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { java . lang . String search_mode = ( searchModeParam == null ) ? "search_name" : searchModeParam ; java . lang . String orderBy = ( orderByParam == null ) ? "company_name" : orderByParam ; java . lang . String where = "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 1 ; java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; if ( "search_name" . equals ( search_mode ) ) { if ( keyword == null ) { keyword = "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 1 ; } java . lang . String [ ] temp = keyword . split ( "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 3 ) ; if ( ( temp . length ) > 1 ) { where = "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" ; params . put ( "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 7 , ( ( temp [ 0 ] ) + "%" ) ) ; params . put ( "compName1" , ( ( temp [ 1 ] ) + "%" ) ) ; } else { where = "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 4 ; params . put ( "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 7 , ( ( temp [ 0 ] ) + "%" ) ) ; } } else { where = search_mode + "<sp>like<sp>:searchMode" ; params . put ( "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 5 , ( keyword + "%" ) ) ; } java . lang . String strLimit1 = "0" ; java . lang . String strLimit2 = "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 2 ; if ( limit1 != null ) strLimit1 = limit1 ; if ( limit2 != null ) strLimit2 = limit2 ; java . lang . String sql = ( ( ( ( ( ( "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 6 + where ) + "company_name<sp>like<sp>:compName0<sp>and<sp>company_name<sp>like<sp>:compName1" 0 ) + orderBy ) + "<sp>limit<sp>" ) + strLimit1 ) + "," ) + strLimit2 ; try { javax . persistence . Query q = entityManager . createNativeQuery ( sql , modelClass ) ; for ( java . util . Map . Entry < java . lang . String , java . lang . Object > o : params . entrySet ( ) ) { q . setParameter ( o . getKey ( ) , o . getValue ( ) ) ; } return q . getResultList ( ) ; } catch ( java . lang . Exception e ) { org . oscarehr . util . MiscUtils . getLogger ( ) . error ( "error" , e ) ; return new java . util . ArrayList < org . oscarehr . billing . CA . ON . model . Billing3rdPartyAddress > ( ) ; } }
org . junit . Assert . assertNotNull ( dao . findAddresses ( null , null , null , null , null ) )
testMultiGet ( ) { java . util . List < java . util . Map < java . lang . String , java . lang . Object > > expected = com . google . common . collect . ImmutableList . < java . util . Map < java . lang . String , java . lang . Object > > of ( com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( Intrinsic . TABLE , "testtable1" , Intrinsic . ID , "key1" , "count" , 1234 ) , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( Intrinsic . TABLE , "testtable2" , Intrinsic . ID , "key&2" , "count" , 5678 ) ) ; java . util . List < com . bazaarvoice . emodb . sor . api . Coordinate > coordinates = com . google . common . collect . Lists . newArrayList ( com . bazaarvoice . emodb . sor . api . Coordinate . of ( "testtable" , "key1" ) , com . bazaarvoice . emodb . sor . api . Coordinate . of ( "testtable2" , "key&2" ) ) ; when ( _server . multiGet ( coordinates , ReadConsistency . STRONG ) ) . thenReturn ( expected . iterator ( ) ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > actual = com . google . common . collect . Lists . newArrayList ( sorClient ( test . integration . sor . DataStoreJerseyTest . APIKEY_TABLE ) . multiGet ( coordinates ) ) ; "<AssertPlaceHolder>" ; verify ( _server ) . multiGet ( coordinates , ReadConsistency . STRONG ) ; verifyNoMoreInteractions ( _server ) ; } multiGet ( java . util . List , com . bazaarvoice . emodb . sor . api . ReadConsistency ) { return _local . get ( ) . multiGet ( coordinates , consistency ) ; }
org . junit . Assert . assertEquals ( actual , expected )
testAddScalar ( ) { org . nd4j . linalg . api . ndarray . INDArray div = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( new long [ ] { 1 , 4 } , 4 ) ; org . nd4j . linalg . api . ndarray . INDArray rdiv = div . add ( 1 ) ; org . nd4j . linalg . api . ndarray . INDArray answer = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( new long [ ] { 1 , 4 } , 5 ) ; "<AssertPlaceHolder>" ; } valueArrayOf ( long [ ] , double , org . nd4j . linalg . api . buffer . DataType ) { if ( ( shape . length ) == 0 ) return org . nd4j . linalg . factory . Nd4j . scalar ( type , value ) ; org . nd4j . linalg . factory . Nd4j . checkShapeValues ( shape ) ; org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . createUninitialized ( type , shape ) ; org . nd4j . linalg . factory . Nd4j . logCreationIfNecessary ( ret ) ; ret . assign ( value ) ; return ret ; }
org . junit . Assert . assertEquals ( answer , rdiv )
entityManagerFactoryCreated ( ) { final java . util . Properties properties = new java . util . Properties ( ) ; properties . load ( getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "persistence.properties" ) ) ; final java . lang . String persistenceUnitName = getClass ( ) . getPackage ( ) . getName ( ) ; final javax . persistence . EntityManagerFactory entityManagerFactory = javax . persistence . Persistence . createEntityManagerFactory ( persistenceUnitName , properties ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertNotNull ( entityManagerFactory )
getProcFileAsRowColumn_NotExistingFile ( ) { java . util . List < java . lang . String [ ] > result = com . uber . profiling . util . ProcFileUtils . getProcFileAsRowColumn ( "/not/existing/file" ) ; "<AssertPlaceHolder>" ; } getProcFileAsRowColumn ( java . lang . String ) { try { java . io . File file = new java . io . File ( filePath ) ; if ( ( ( ! ( file . exists ( ) ) ) || ( file . isDirectory ( ) ) ) || ( ! ( file . canRead ( ) ) ) ) { return java . util . Collections . emptyList ( ) ; } java . util . List < java . lang . String [ ] > result = new java . util . ArrayList ( ) ; java . util . List < java . lang . String > lines = java . nio . file . Files . readAllLines ( file . toPath ( ) , StandardCharsets . UTF_8 ) ; for ( java . lang . String line : lines ) { result . add ( line . split ( "\\s+" ) ) ; } return result ; } catch ( java . lang . Throwable ex ) { com . uber . profiling . util . ProcFileUtils . logger . warn ( ( "Failed<sp>to<sp>read<sp>file<sp>" + filePath ) , ex ) ; return java . util . Collections . emptyList ( ) ; } }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testGetDefaultGcsBucketName ( ) { com . google . apphosting . api . ApiProxy . Environment env = com . google . apphosting . api . ApiProxy . getCurrentEnvironment ( ) ; java . lang . String expectedBucketName ; com . google . appengine . tck . event . Property property = property ( "testGetDefaultGcsBucketName" ) ; if ( property . exists ( ) ) { expectedBucketName = property . getPropertyValue ( ) ; } else { expectedBucketName = ( ( java . lang . String ) ( env . getAttributes ( ) . get ( "com.google.appengine.runtime.default_version_hostname" ) ) ) ; } try { java . lang . String bucketName = appIdentity . getDefaultGcsBucketName ( ) ; "<AssertPlaceHolder>" ; } catch ( com . google . appengine . api . appidentity . AppIdentityServiceFailureException aisfe ) { } } get ( com . google . appengine . api . datastore . Key ) { return com . google . appengine . tck . modules . support . LibHelper . ds . get ( key ) ; }
org . junit . Assert . assertEquals ( expectedBucketName , bucketName )
testReportForFileSizeGroupByYearOfLastModifiedDate ( ) { reportData = reportDao . getReportData ( null , ReportFieldEnum . FILE_SIZE , getGroupByFieldList ( ReportFieldEnum . LAST_MODIFIED_DATE , "year" ) ) ; "<AssertPlaceHolder>" ; printReportData ( reportData ) ; } size ( ) { return size ; }
org . junit . Assert . assertTrue ( ( ( reportData . size ( ) ) > 0 ) )
testFromBitmap ( ) { org . jcodec . scale . BitmapUtil bitmapUtil = mock ( org . jcodec . scale . BitmapUtil . class ) ; org . jcodec . common . model . Picture src = org . jcodec . common . model . Picture . create ( 16 , 16 , ColorSpace . RGB ) ; for ( int i = 0 ; i < ( 256 * 3 ) ; i += 3 ) { src . getPlaneData ( 0 ) [ i ] = ( ( byte ) ( 134 - 128 ) ) ; src . getPlaneData ( 0 ) [ ( i + 1 ) ] = ( ( byte ) ( 215 - 128 ) ) ; src . getPlaneData ( 0 ) [ ( i + 2 ) ] = ( ( byte ) ( 22 - 128 ) ) ; } when ( bitmapUtil . fromBitmapImpl ( any ( android . graphics . Bitmap . class ) ) ) . thenReturn ( src ) ; org . jcodec . common . model . Picture expected = org . jcodec . common . model . Picture . create ( 16 , 16 , ColorSpace . YUV420J ) ; java . util . Arrays . fill ( expected . getPlaneData ( 0 ) , ( ( byte ) ( 168 - 128 ) ) ) ; java . util . Arrays . fill ( expected . getPlaneData ( 1 ) , ( ( byte ) ( 45 - 128 ) ) ) ; java . util . Arrays . fill ( expected . getPlaneData ( 2 ) , ( ( byte ) ( 103 - 128 ) ) ) ; org . jcodec . common . AndroidUtil util = new org . jcodec . common . AndroidUtil ( bitmapUtil ) ; android . graphics . Bitmap mock = mock ( android . graphics . Bitmap . class ) ; when ( mock . getConfig ( ) ) . thenReturn ( Bitmap . Config . ARGB_8888 ) ; when ( mock . getWidth ( ) ) . thenReturn ( 16 ) ; when ( mock . getHeight ( ) ) . thenReturn ( 16 ) ; org . jcodec . common . model . Picture res = util . fromBitmapImpl ( mock , ColorSpace . YUV420J ) ; "<AssertPlaceHolder>" ; } fromBitmapImpl ( android . graphics . Bitmap , org . jcodec . common . model . Picture ) { if ( bitmap == null ) throw new java . lang . IllegalArgumentException ( "Input<sp>pic<sp>is<sp>null" ) ; if ( out == null ) throw new java . lang . IllegalArgumentException ( "Out<sp>bitmap<sp>is<sp>null" ) ; if ( ( bitmap . getConfig ( ) ) != ( Bitmap . Config . ARGB_8888 ) ) { throw new java . lang . RuntimeException ( ( "Unsupported<sp>bitmap<sp>config:<sp>" + ( bitmap . getConfig ( ) ) ) ) ; } org . jcodec . common . model . Picture rgb = bitmapUtil . fromBitmapImpl ( bitmap ) ; org . jcodec . scale . Transform transform = org . jcodec . scale . ColorUtil . getTransform ( ColorSpace . RGB , out . getColor ( ) ) ; transform . transform ( rgb , out ) ; }
org . junit . Assert . assertEquals ( expected , res )
sequencedMap2 ( ) { long [ ] l = new long [ ] { 10 , 100 , 50 , 250 , 100 , 15 , 35 , 250 , 100 , 65 , 45 , 50 , 65 , 80 , 90 , 70 , 250 , 100 } ; long [ ] expected = new long [ ] { 15 , 35 , 45 , 50 , 65 , 80 , 90 , 70 , 250 , 100 } ; org . exist . util . hashtable . SequencedLongHashMap < java . lang . String > table = new org . exist . util . hashtable . SequencedLongHashMap ( 100000 ) ; for ( int i = 0 ; i < ( l . length ) ; i ++ ) { table . put ( l [ i ] , ( "k" + ( l [ i ] ) ) ) ; } table . removeFirst ( ) ; org . exist . util . hashtable . SequencedLongHashMap . Entry < java . lang . String > next = table . getFirstEntry ( ) ; int i = 0 ; while ( next != null ) { "<AssertPlaceHolder>" ; next = next . getNext ( ) ; i ++ ; } } getKey ( ) { return key ; }
org . junit . Assert . assertEquals ( next . getKey ( ) , expected [ i ] )
fromExternalChange ( ) { org . apache . jackrabbit . oak . plugins . document . DocumentStore store = new org . apache . jackrabbit . oak . plugins . document . memory . MemoryDocumentStore ( ) ; org . apache . jackrabbit . oak . plugins . document . DocumentNodeStore ns1 = builderProvider . newBuilder ( ) . setClusterId ( 1 ) . clock ( clock ) . setDocumentStore ( store ) . setAsyncDelay ( 0 ) . getNodeStore ( ) ; org . apache . jackrabbit . oak . plugins . document . DocumentNodeStore ns2 = builderProvider . newBuilder ( ) . setClusterId ( 2 ) . clock ( clock ) . setDocumentStore ( store ) . setAsyncDelay ( 0 ) . getNodeStore ( ) ; org . apache . jackrabbit . oak . plugins . document . DocumentNodeState s1 = ns1 . getRoot ( ) ; org . apache . jackrabbit . oak . spi . state . NodeBuilder builder = ns1 . getRoot ( ) . builder ( ) ; builder . child ( "foo" ) ; org . apache . jackrabbit . oak . plugins . document . JournalDiffLoaderTest . merge ( ns1 , builder ) ; builder = ns2 . getRoot ( ) . builder ( ) ; builder . child ( "bar" ) ; org . apache . jackrabbit . oak . plugins . document . JournalDiffLoaderTest . merge ( ns2 , builder ) ; ns2 . runBackgroundOperations ( ) ; ns1 . runBackgroundOperations ( ) ; builder = ns1 . getRoot ( ) . builder ( ) ; builder . child ( "baz" ) ; org . apache . jackrabbit . oak . plugins . document . JournalDiffLoaderTest . merge ( ns1 , builder ) ; org . apache . jackrabbit . oak . plugins . document . DocumentNodeState s2 = ns1 . getRoot ( ) ; "<AssertPlaceHolder>" ; } changeChildNodes ( org . apache . jackrabbit . oak . plugins . document . DocumentNodeStore , org . apache . jackrabbit . oak . plugins . document . AbstractDocumentNodeState , org . apache . jackrabbit . oak . plugins . document . AbstractDocumentNodeState ) { java . lang . String diff = new org . apache . jackrabbit . oak . plugins . document . JournalDiffLoader ( before , after , store ) . call ( ) ; final java . util . Set < java . lang . String > changes = newHashSet ( ) ; org . apache . jackrabbit . oak . plugins . document . DiffCache . parseJsopDiff ( diff , new org . apache . jackrabbit . oak . plugins . document . DiffCache . Diff ( ) { @ org . apache . jackrabbit . oak . plugins . document . Override public boolean childNodeAdded ( java . lang . String name ) { org . junit . Assert . fail ( ) ; return true ; } @ org . apache . jackrabbit . oak . plugins . document . Override public boolean childNodeChanged ( java . lang . String name ) { changes . add ( name ) ; return true ; } @ org . apache . jackrabbit . oak . plugins . document . Override public boolean childNodeDeleted ( java . lang . String name ) { org . junit . Assert . fail ( ) ; return true ; } } ) ; return changes ; }
org . junit . Assert . assertEquals ( newHashSet ( "foo" , "bar" , "baz" ) , org . apache . jackrabbit . oak . plugins . document . JournalDiffLoaderTest . changeChildNodes ( ns1 , s1 , s2 ) )
MOVEDepthinfinity ( ) { final java . lang . String depth = "infinity" ; final java . lang . String srcCol = "davColforMOVE" ; final java . lang . String destCol = "destCol" ; final java . lang . String destUrl = com . fujitsu . dc . test . unit . core . UrlUtils . box ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , destCol ) ; try { com . fujitsu . dc . test . utils . DavResourceUtils . createWebDavCollection ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . TOKEN , HttpStatus . SC_CREATED , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , srcCol ) ; java . lang . String url = com . fujitsu . dc . test . unit . core . UrlUtils . box ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , srcCol ) ; com . fujitsu . dc . test . jersey . DcRequest req = com . fujitsu . dc . test . jersey . DcRequest . move ( url ) ; req . header ( HttpHeaders . AUTHORIZATION , AbstractCase . BEARER_MASTER_TOKEN ) ; req . header ( HttpHeaders . DESTINATION , destUrl ) ; req . header ( HttpHeaders . DEPTH , depth ) ; com . fujitsu . dc . test . jersey . DcResponse response = com . fujitsu . dc . test . jersey . AbstractCase . request ( req ) ; "<AssertPlaceHolder>" ; com . fujitsu . dc . test . utils . DavResourceUtils . getWebDav ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . TOKEN , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , srcCol , HttpStatus . SC_NOT_FOUND ) ; com . fujitsu . dc . test . utils . DavResourceUtils . getWebDav ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . TOKEN , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , destCol , HttpStatus . SC_OK ) ; } finally { com . fujitsu . dc . test . utils . DavResourceUtils . deleteCollection ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , srcCol , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . TOKEN , ( - 1 ) ) ; com . fujitsu . dc . test . utils . DavResourceUtils . deleteCollection ( com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . CELL_NAME , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . BOX_NAME , destCol , com . fujitsu . dc . test . jersey . box . dav . col . MoveCollectionHeaderValidateTest . TOKEN , ( - 1 ) ) ; } } getStatusCode ( ) { return this . statusCode ; }
org . junit . Assert . assertEquals ( HttpStatus . SC_CREATED , response . getStatusCode ( ) )
getProperty_success ( ) { net . sharkfw . system . L . setLogLevel ( L . LOGLEVEL_ALL ) ; net . sharkfw . knowledgeBase . inmemory . InMemoSharkKB inMemoSharkKB = new net . sharkfw . knowledgeBase . inmemory . InMemoSharkKB ( ) ; net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfoSerializer syncMergeInfoSerializer = new net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfoSerializer ( inMemoSharkKB ) ; net . sharkfw . knowledgeBase . PeerSemanticTag peerSemanticTag = net . sharkfw . knowledgeBase . inmemory . InMemoSharkKB . createInMemoPeerSemanticTag ( "BOB" , "bob.de" , "tcp://localhost:7070" ) ; net . sharkfw . knowledgeBase . SemanticTag semanticTag = net . sharkfw . knowledgeBase . inmemory . InMemoSharkKB . createInMemoSemanticTag ( "KnowledgeBase" , "knowledgeBase.de" ) ; net . sharkfw . knowledgeBase . SemanticTag anotherSemanticTag = net . sharkfw . knowledgeBase . inmemory . InMemoSharkKB . createInMemoSemanticTag ( "anotherKnowledgeBase" , "another-knowledgeBase.de" ) ; long millis = java . lang . System . currentTimeMillis ( ) ; long anotherMillis = millis - 5000 ; net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfo mergeProperty = new net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfo ( peerSemanticTag , semanticTag , millis ) ; net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfo anotherMergeProperty = new net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfo ( peerSemanticTag , anotherSemanticTag , anotherMillis ) ; syncMergeInfoSerializer . add ( mergeProperty ) ; syncMergeInfoSerializer . add ( anotherMergeProperty ) ; net . sharkfw . knowledgeBase . sync . manager . SyncMergeInfo retrievedProperty = syncMergeInfoSerializer . get ( peerSemanticTag , semanticTag ) ; "<AssertPlaceHolder>" ; } asString ( ) { return this . asJSON ( ) . toString ( ) ; }
org . junit . Assert . assertTrue ( retrievedProperty . asString ( ) . equals ( mergeProperty . asString ( ) ) )
testSetIconUrl ( ) { net . holmes . core . business . media . model . AbstractNodeTest . AbstractNodeTester node = buildAbstractNodeTester ( "" ) ; node . setIconUrl ( "iconUrl" ) ; "<AssertPlaceHolder>" ; } getIconUrl ( ) { return iconUrl ; }
org . junit . Assert . assertEquals ( node . getIconUrl ( ) , "iconUrl" )
shouldConvert ( ) { br . com . uol . pagseguro . api . utils . RequestMap expectedMap = new br . com . uol . pagseguro . api . utils . RequestMap ( ) ; expectedMap . putMap ( new java . util . HashMap < java . lang . String , java . lang . String > ( ) { { put ( "currency" , "BRL" ) ; put ( "extraAmount" , "9.99" ) ; put ( "reference" , "reference" ) ; } } ) ; br . com . uol . pagseguro . api . utils . RequestMap map = mapConverter . convert ( checkoutRegistration ) ; "<AssertPlaceHolder>" ; } convert ( br . com . uol . pagseguro . api . common . domain . AccountRegisterSuggestion ) { if ( account == null ) { return null ; } br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter convertedAccount = new br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter ( ) ; convertedAccount . setEmail ( account . getEmail ( ) ) ; convertedAccount . setType ( account . getType ( ) ) ; convertedAccount . setPerson ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . PERSON_V_2_XML_CONVERTER . convert ( account . getPerson ( ) ) ) ; convertedAccount . setCompany ( br . com . uol . pagseguro . api . application . authorization . AccountV2XMLConverter . COMPANY_V_2_XML_CONVERTER . convert ( account . getCompany ( ) ) ) ; return convertedAccount ; }
org . junit . Assert . assertEquals ( expectedMap , map )
testLemmasAsArray ( ) { java . lang . String [ ] lemmas = lemmatizer . lemmatize ( opennlp . tools . lemmatizer . LemmatizerMETest . tokens , opennlp . tools . lemmatizer . LemmatizerMETest . postags ) ; "<AssertPlaceHolder>" ; } lemmatize ( java . lang . String , java . lang . String ) { java . util . List < morfologik . stemming . WordData > dictMap = dictLookup . lookup ( word . toLowerCase ( ) ) ; java . util . Set < java . lang . String > lemmas = new java . util . HashSet ( ) ; for ( morfologik . stemming . WordData wordData : dictMap ) { if ( java . util . Objects . equals ( postag , asString ( wordData . getTag ( ) ) ) ) { lemmas . add ( asString ( wordData . getStem ( ) ) ) ; } } return java . util . Collections . unmodifiableList ( new java . util . ArrayList ( lemmas ) ) ; }
org . junit . Assert . assertArrayEquals ( opennlp . tools . lemmatizer . LemmatizerMETest . expect , lemmas )
testIsNewColumnWhenColumnIsNull ( ) { final org . drools . workbench . screens . guided . dtable . client . wizard . column . plugins . commons . BaseDecisionTableColumnPlugin plugin = makeBasePlugin ( ) ; plugin . setOriginalColumnConfig52 ( null ) ; "<AssertPlaceHolder>" ; } isNewColumn ( ) { return ! ( java . util . Optional . ofNullable ( originalColumnConfig52 ) . isPresent ( ) ) ; }
org . junit . Assert . assertTrue ( plugin . isNewColumn ( ) )
testFloatCast2DoubleThriftSerializeInTasks ( ) { java . sql . Statement stmt = org . apache . hive . jdbc . TestJdbcWithMiniHS2 . conTestDb . createStatement ( ) ; setSerializeInTasksInConf ( stmt ) ; stmt . execute ( "drop<sp>table<sp>if<sp>exists<sp>testThriftSerializeShow1" ) ; stmt . execute ( "drop<sp>table<sp>if<sp>exists<sp>testThriftSerializeShow2" ) ; stmt . execute ( "create<sp>table<sp>testThriftSerializeShow1<sp>(a<sp>float)" ) ; stmt . execute ( "create<sp>table<sp>testThriftSerializeShow2<sp>(b<sp>double)" ) ; stmt . execute ( "insert<sp>into<sp>testThriftSerializeShow1<sp>values<sp>(1.1),<sp>(2.2),<sp>(3.3)" ) ; stmt . execute ( "insert<sp>into<sp>testThriftSerializeShow2<sp>values<sp>(2.2),<sp>(3.3),<sp>(4.4)" ) ; java . sql . ResultSet rs = stmt . executeQuery ( ( "select<sp>*<sp>from<sp>testThriftSerializeShow1<sp>inner<sp>join<sp>" + "testThriftSerializeShow2<sp>where<sp>testThriftSerializeShow1.a=testThriftSerializeShow2.b" ) ) ; "<AssertPlaceHolder>" ; stmt . execute ( "drop<sp>table<sp>testThriftSerializeShow1" ) ; stmt . execute ( "drop<sp>table<sp>testThriftSerializeShow2" ) ; stmt . close ( ) ; } next ( ) { org . apache . hadoop . hive . serde2 . WriteBuffers . ByteSegmentRef byteSegmentRef = hashMapResult . next ( ) ; if ( byteSegmentRef == null ) { return null ; } else { return unpack ( byteSegmentRef ) ; } }
org . junit . Assert . assertTrue ( ( ! ( rs . next ( ) ) ) )
sexEqualOrNameEqual ( ) { java . lang . String sqlite = "SELECT<sp>*<sp>FROM<sp>users<sp>WHERE<sp>sex<sp>=<sp>'female'<sp>or<sp>name<sp>=<sp>'curioe'<sp>ORDER<sp>BY<sp>created<sp>DESC<sp>LIMIT<sp>10" ; java . lang . String api = "select<sp>*<sp>where<sp>sex<sp>=<sp>'female'<sp>or<sp>name<sp>=<sp>'curioe'<sp>order<sp>by<sp>created<sp>desc" ; org . apache . usergrid . query . validator . QueryRequest request = new org . apache . usergrid . query . validator . QueryRequest ( ) ; request . setDbQuery ( sqlite ) ; request . getApiQuery ( ) . setQuery ( api ) ; org . apache . usergrid . query . validator . QueryResponse response = validator . execute ( request ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ( serviceName ) != null ) { sb . append ( "/" ) ; sb . append ( serviceName ) ; } for ( int i = 0 ; i < ( parameters . size ( ) ) ; i ++ ) { org . apache . usergrid . services . ServiceParameter p = parameters . get ( i ) ; if ( p instanceof org . apache . usergrid . services . ServiceParameter . QueryParameter ) { if ( i == ( ( parameters . size ( ) ) - 1 ) ) { sb . append ( '?' ) ; } else { sb . append ( ';' ) ; } boolean has_prev_param = false ; java . lang . String q = p . toString ( ) ; if ( isNotBlank ( q ) ) { try { sb . append ( "ql=" ) . append ( java . net . URLEncoder . encode ( q , "UTF-8" ) ) ; } catch ( java . io . UnsupportedEncodingException e ) { org . apache . usergrid . services . ServiceRequest . logger . error ( "Unable<sp>to<sp>encode<sp>url" , e ) ; } has_prev_param = true ; } int limit = p . getQuery ( ) . getLimit ( ) ; if ( limit != ( org . apache . usergrid . persistence . Query . DEFAULT_LIMIT ) ) { if ( has_prev_param ) { sb . append ( '&' ) ; } sb . append ( "limit=" ) . append ( limit ) ; has_prev_param = true ; } if ( ( p . getQuery ( ) . getStartResult ( ) ) != null ) { if ( has_prev_param ) { sb . append ( '&' ) ; } sb . append ( "start=" ) . append ( p . getQuery ( ) . getStartResult ( ) ) ; has_prev_param = true ; } } else { sb . append ( '/' ) ; sb . append ( p . toString ( ) ) ; } } return sb . toString ( ) ; }
org . junit . Assert . assertTrue ( response . toString ( ) , response . result ( ) )
testAckBeforeSync ( ) { java . io . File journalDir = tempDir . newFolder ( ) ; org . apache . bookkeeper . bookie . Bookie . checkDirectoryStructure ( org . apache . bookkeeper . bookie . Bookie . getCurrentDirectory ( journalDir ) ) ; org . apache . bookkeeper . conf . ServerConfiguration conf = org . apache . bookkeeper . conf . TestBKConfiguration . newServerConfiguration ( ) ; conf . setJournalDirName ( journalDir . getPath ( ) ) . setMetadataServiceUri ( null ) . setJournalAdaptiveGroupWrites ( false ) ; org . apache . bookkeeper . bookie . JournalChannel jc = spy ( new org . apache . bookkeeper . bookie . JournalChannel ( journalDir , 1 ) ) ; whenNew ( org . apache . bookkeeper . bookie . JournalChannel . class ) . withAnyArguments ( ) . thenReturn ( jc ) ; org . apache . bookkeeper . bookie . LedgerDirsManager ledgerDirsManager = mock ( org . apache . bookkeeper . bookie . LedgerDirsManager . class ) ; org . apache . bookkeeper . bookie . Journal journal = new org . apache . bookkeeper . bookie . Journal ( 0 , journalDir , conf , ledgerDirsManager ) ; java . util . concurrent . CountDownLatch forceWriteThreadSuspendedLatch = new java . util . concurrent . CountDownLatch ( 1 ) ; enableForceWriteThreadSuspension ( forceWriteThreadSuspendedLatch , journal ) ; journal . start ( ) ; org . apache . bookkeeper . bookie . LogMark lastLogMarkBeforeWrite = journal . getLastLogMark ( ) . markLog ( ) . getCurMark ( ) ; java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; long ledgerId = 1 ; long entryId = 0 ; journal . logAddEntry ( ledgerId , entryId , org . apache . bookkeeper . bookie . BookieJournalForceTest . DATA , true , new org . apache . bookkeeper . proto . BookkeeperInternalCallbacks . WriteCallback ( ) { @ org . apache . bookkeeper . bookie . Override public void writeComplete ( int rc , long ledgerId , long entryId , org . apache . bookkeeper . net . BookieSocketAddress addr , java . lang . Object ctx ) { latch . countDown ( ) ; } } , null ) ; latch . await ( 20 , TimeUnit . SECONDS ) ; verify ( jc , times ( 0 ) ) . forceWrite ( true ) ; verify ( jc , times ( 0 ) ) . forceWrite ( false ) ; org . apache . bookkeeper . bookie . Journal . LastLogMark lastLogMarkAfterForceWrite = journal . getLastLogMark ( ) ; "<AssertPlaceHolder>" ; forceWriteThreadSuspendedLatch . countDown ( ) ; journal . shutdown ( ) ; } compare ( org . apache . bookkeeper . versioning . Version ) { if ( null == v ) { throw new java . lang . NullPointerException ( "Version<sp>is<sp>not<sp>allowed<sp>to<sp>be<sp>null." ) ; } if ( v == ( Version . NEW ) ) { return Occurred . AFTER ; } else if ( v == ( Version . ANY ) ) { return Occurred . CONCURRENTLY ; } else if ( ! ( v instanceof org . apache . bookkeeper . versioning . LongVersion ) ) { throw new java . lang . IllegalArgumentException ( "Invalid<sp>version<sp>type" ) ; } org . apache . bookkeeper . versioning . LongVersion zv = ( ( org . apache . bookkeeper . versioning . LongVersion ) ( v ) ) ; int res = java . lang . Long . compare ( version , zv . version ) ; if ( res == 0 ) { return Occurred . CONCURRENTLY ; } else if ( res < 0 ) { return Occurred . BEFORE ; } else { return Occurred . AFTER ; } }
org . junit . Assert . assertEquals ( 0 , lastLogMarkAfterForceWrite . getCurMark ( ) . compare ( lastLogMarkBeforeWrite ) )
testNotAsync ( ) { java . util . List < com . google . gwt . core . ext . typeinfo . JClassType > annotedClasses = new java . util . ArrayList < com . google . gwt . core . ext . typeinfo . JClassType > ( ) ; com . google . gwt . core . ext . typeinfo . JClassType type = oracle . addClass ( com . mvp4g . rebind . config . loader . annotation . AbstractHandlerAnnotationsLoaderTest . getSimpleClass ( ) ) ; annotedClasses . add ( type ) ; loader . load ( annotedClasses , configuration ) ; E element = loader . getConfigList ( configuration ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } isAsync ( ) { return Boolean . TRUE . toString ( ) . equalsIgnoreCase ( getAsync ( ) ) ; }
org . junit . Assert . assertFalse ( element . isAsync ( ) )
listRequestInit ( ) { org . searchisko . api . service . ProviderService tested = getTested ( ) ; org . searchisko . persistence . service . ListRequest expected = org . mockito . Mockito . mock ( org . searchisko . persistence . service . ListRequest . class ) ; org . mockito . Mockito . when ( tested . entityService . listRequestInit ( ) ) . thenReturn ( expected ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( tested . entityService ) . listRequestInit ( ) ; org . mockito . Mockito . verifyNoMoreInteractions ( tested . entityService ) ; } listRequestInit ( ) { return entityService . listRequestInit ( ) ; }
org . junit . Assert . assertEquals ( expected , tested . listRequestInit ( ) )
testSecurityDef ( ) { "<AssertPlaceHolder>" ; } getContextType ( java . lang . String ) { if ( ( path != null ) && ( path . endsWith ( "/securityDefinitions" 3 ) ) ) { path = path . substring ( 0 , ( ( path . length ( ) ) - 1 ) ) ; } if ( ( ( path == null ) || ( path . isEmpty ( ) ) ) || ( "/securityDefinitions" 3.e quals ( path ) ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . RootContextType . CONTEXT_ID ; } if ( path . equals ( "/securityDefinitions" ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . SecurityDefContextType . CONTEXT_ID ; } if ( path . equals ( "/paths" ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . PathsContextType . CONTEXT_ID ; } if ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PATH_ITEM_REGEX ) + "/securityDefinitions" 2 ) ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . PathItemContextType . CONTEXT_ID ; } if ( ( path . equals ( "/securityDefinitions" 1 ) ) || ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PATH_ITEM_REGEX ) + "/[^/]+/responses$" ) ) ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . ResponsesContextType . CONTEXT_ID ; } if ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PARAMETERS_LIST_REGEX ) + "/securityDefinitions" 2 ) ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . ParametersListContextType . CONTEXT_ID ; } if ( ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PARAMETERS_LIST_REGEX ) + "/\\d+$" ) ) ) || ( path . matches ( "/parameters/[^/]+$" ) ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . ParameterObjectContextType . CONTEXT_ID ; } if ( path . equals ( "/parameters" ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . ParameterDefinitionContextType . CONTEXT_ID ; } if ( ( ( ( ( ( path . matches ( "/definitions/[^/]+$" ) ) || ( path . matches ( ".+/[^/]+/additionalProperties$" ) ) ) || ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PARAMETERS_SCHEMA_REGEX ) + "/securityDefinitions" 2 ) ) ) ) || ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PARAMETERS_SCHEMA_REGEX ) + "/items$" ) ) ) ) || ( path . matches ( ( ( com . reprezen . swagedit . templates . SwaggerContextType . PARAMETERS_SCHEMA_REGEX ) + "/properties/[^/]+$" ) ) ) ) || ( path . matches ( "/securityDefinitions" 0 ) ) ) { return com . reprezen . swagedit . templates . SwaggerContextType . SchemaContextType . CONTEXT_ID ; } return null ; }
org . junit . Assert . assertThat ( com . reprezen . swagedit . templates . SwaggerContextType . getContextType ( "/securityDefinitions" ) , org . hamcrest . CoreMatchers . equalTo ( SecurityDefContextType . CONTEXT_ID ) )
whenWriteToTmpFile_thenCorrect ( ) { final java . lang . String toWrite = "Hello" ; final java . io . File tmpFile = java . io . File . createTempFile ( "test" , ".tmp" ) ; final java . io . FileWriter writer = new java . io . FileWriter ( tmpFile ) ; writer . write ( toWrite ) ; writer . close ( ) ; final java . io . BufferedReader reader = new java . io . BufferedReader ( new java . io . FileReader ( tmpFile ) ) ; "<AssertPlaceHolder>" ; reader . close ( ) ; } readLine ( ) { try { if ( ( CSVReader ) == null ) initReader ( ) ; java . lang . String [ ] line = CSVReader . readNext ( ) ; if ( line == null ) return null ; return new org . baeldung . taskletsvschunks . model . Line ( line [ 0 ] , java . time . LocalDate . parse ( line [ 1 ] , java . time . format . DateTimeFormatter . ofPattern ( "MM/dd/yyyy" ) ) ) ; } catch ( java . lang . Exception e ) { logger . error ( ( "Error<sp>while<sp>reading<sp>line<sp>in<sp>file:<sp>" + ( this . fileName ) ) ) ; return null ; } }
org . junit . Assert . assertEquals ( toWrite , reader . readLine ( ) )
test11DeleteEmbedWithNestedArray ( ) { com . ebay . cloud . cms . dal . entity . impl . BsonEntity approvalInst = createEmbedApproval ( ) ; java . lang . String embedId = approvalInst . getId ( ) ; com . ebay . cloud . cms . dal . persistence . EmbedPersistenceServiceTest . persistenceService . delete ( approvalInst , com . ebay . cloud . cms . dal . persistence . EmbedPersistenceServiceTest . manifestContext ) ; com . ebay . cloud . cms . dal . entity . impl . BsonEntity queryEntity = com . ebay . cloud . cms . dal . persistence . EmbedPersistenceServiceTest . buildQueryEntity ( com . ebay . cloud . cms . dal . persistence . EmbedPersistenceServiceTest . BRANCH_TEST , DeploymentEntityGenerator . TypeEnum . Approval . name ( ) , embedId ) ; com . ebay . cloud . cms . dal . entity . impl . BsonEntity getEntity = ( ( com . ebay . cloud . cms . dal . entity . impl . BsonEntity ) ( com . ebay . cloud . cms . dal . persistence . EmbedPersistenceServiceTest . persistenceService . get ( queryEntity , com . ebay . cloud . cms . dal . persistence . EmbedPersistenceServiceTest . manifestContext ) ) ) ; "<AssertPlaceHolder>" ; } get ( com . ebay . cloud . cms . dal . entity . IEntity , com . ebay . cloud . cms . dal . persistence . PersistenceContext ) { java . lang . String branchId = queryEntity . getBranchId ( ) ; java . lang . String entityId = queryEntity . getId ( ) ; java . lang . String entityType = queryEntity . getType ( ) ; checkArguments ( branchId , entityId , entityType ) ; setupContext ( context ) ; com . ebay . cloud . cms . metadata . model . MetaClass meta = queryEntity . getMetaClass ( ) ; com . ebay . cloud . cms . dal . persistence . IRetrievalCommand getCommand = null ; if ( meta . isEmbed ( ) ) { if ( ! ( com . ebay . cloud . cms . dal . entity . AbstractEntityIDHelper . isEmbedEntity ( entityId ) ) ) { entityId = com . ebay . cloud . cms . dal . entity . AbstractEntityIDHelper . generateEmbedIdByEmbedPath ( queryEntity . getEmbedPath ( ) , entityId ) ; } getCommand = new com . ebay . cloud . cms . dal . persistence . flatten . impl . embed . EmbedGetCommand ( branchId , entityId , meta , helper ) ; } else { getCommand = new com . ebay . cloud . cms . dal . persistence . flatten . impl . root . RootGetCommand ( branchId , entityId , meta ) ; } getCommand . execute ( context ) ; com . ebay . cloud . cms . dal . entity . flatten . impl . NewBsonEntity resultEntity = ( ( com . ebay . cloud . cms . dal . entity . flatten . impl . NewBsonEntity ) ( getCommand . getResult ( ) ) ) ; if ( resultEntity != null ) { com . ebay . cloud . cms . dal . entity . flatten . visitor . BsonPopulator populator = new com . ebay . cloud . cms . dal . entity . flatten . visitor . BsonPopulator ( ) ; resultEntity . traverse ( populator ) ; } return resultEntity ; }
org . junit . Assert . assertTrue ( ( getEntity == null ) )
testComparableKey ( ) { open ( ) ; com . sleepycat . persist . test . BindingTest . ComparableKey key = new com . sleepycat . persist . test . BindingTest . ComparableKey ( 123 , 456 ) ; checkEntity ( com . sleepycat . persist . test . BindingTest . UseComparableKey . class , new com . sleepycat . persist . test . BindingTest . UseComparableKey ( key , "one" ) ) ; checkMetadata ( com . sleepycat . persist . test . BindingTest . ComparableKey . class . getName ( ) , new java . lang . String [ ] [ ] { new java . lang . String [ ] { "f1" , "int" } , new java . lang . String [ ] { "f2" , "int" } } , ( - 1 ) , null ) ; com . sleepycat . persist . model . ClassMetadata classMeta = model . getClassMetadata ( com . sleepycat . persist . test . BindingTest . UseComparableKey . class . getName ( ) ) ; "<AssertPlaceHolder>" ; com . sleepycat . persist . impl . PersistKeyBinding binding = new com . sleepycat . persist . impl . PersistKeyBinding ( catalog , com . sleepycat . persist . test . BindingTest . ComparableKey . class . getName ( ) , false ) ; com . sleepycat . persist . impl . PersistComparator comparator = new com . sleepycat . persist . impl . PersistComparator ( binding ) ; compareKeys ( comparator , binding , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 1 , 1 ) , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 1 , 1 ) , 0 ) ; compareKeys ( comparator , binding , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 1 , 2 ) , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 1 , 1 ) , ( - 1 ) ) ; compareKeys ( comparator , binding , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 2 , 1 ) , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 1 , 1 ) , ( - 1 ) ) ; compareKeys ( comparator , binding , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 2 , 1 ) , new com . sleepycat . persist . test . BindingTest . ComparableKey ( 3 , 1 ) , 1 ) ; close ( ) ; } getName ( ) { return name ; }
org . junit . Assert . assertNotNull ( classMeta )
mergeTextDecorationBothInputsNoneTest ( ) { java . lang . String firstValue = "underline<sp>none" ; java . lang . String secondValue = "strikethrough<sp>none" ; java . lang . String expected = "none" ; java . lang . String actual = com . itextpdf . styledxmlparser . css . resolve . CssPropertyMerger . mergeTextDecoration ( firstValue , secondValue ) ; "<AssertPlaceHolder>" ; } mergeTextDecoration ( java . lang . String , java . lang . String ) { if ( firstValue == null ) { return secondValue ; } else if ( secondValue == null ) { return firstValue ; } java . util . Set < java . lang . String > merged = com . itextpdf . styledxmlparser . css . resolve . CssPropertyMerger . normalizeTextDecoration ( firstValue ) ; merged . addAll ( com . itextpdf . styledxmlparser . css . resolve . CssPropertyMerger . normalizeTextDecoration ( secondValue ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( java . lang . String mergedProp : merged ) { if ( ( sb . length ( ) ) != 0 ) { sb . append ( "<sp>" ) ; } sb . append ( mergedProp ) ; } return ( sb . length ( ) ) != 0 ? sb . toString ( ) : com . itextpdf . styledxmlparser . css . CommonCssConstants . NONE ; }
org . junit . Assert . assertEquals ( expected , actual )
testMagLeverenDoorgaanTrueAndereDienst ( ) { when ( bepaler . bepaalAttributenGewijzigd ( eq ( persoon ) , eq ( administratieveHandelingModel ) , any ( nl . bzk . brp . expressietaal . Expressie . class ) , any ( nl . bzk . brp . model . algemeen . stamgegeven . autaut . Leveringsautorisatie . class ) ) ) . thenReturn ( true ) ; when ( expressieService . geefAttenderingsCriterium ( any ( nl . bzk . brp . levering . model . Leveringinformatie . class ) ) ) . thenReturn ( nl . bzk . brp . expressietaal . parser . BRPExpressies . parse ( nl . bzk . brp . levering . business . filters . SleutelrubriekGewijzigdFilterTest . WAAR ) . getExpressie ( ) ) ; final boolean resultaat = sleutelrubriekGewijzigdFilter . magLeverenDoorgaan ( persoon , null , leveringAutorisatieAndereDienst , administratieveHandelingModel ) ; "<AssertPlaceHolder>" ; } magLeverenDoorgaan ( nl . bzk . brp . model . hisvolledig . kern . PersoonHisVolledig , nl . bzk . brp . levering . model . Populatie , nl . bzk . brp . levering . model . Leveringinformatie , nl . bzk . brp . model . operationeel . kern . AdministratieveHandelingModel ) { final boolean resultaat ; switch ( leveringinformatie . getSoortDienst ( ) ) { case MUTATIELEVERING_OP_BASIS_VAN_DOELBINDING : resultaat = ( nl . bzk . brp . levering . model . Populatie . BUITEN ) != populatie ; break ; case MUTATIELEVERING_OP_BASIS_VAN_AFNEMERINDICATIE : resultaat = true ; break ; case ATTENDERING : switch ( populatie ) { case BINNEN : resultaat = true ; break ; case BUITEN : resultaat = false ; break ; default : throw new java . lang . IllegalArgumentException ( "Attendering<sp>kent<sp>alleen<sp>BINNEN<sp>en<sp>BUITEN<sp>populatie." ) ; } break ; default : throw new java . lang . IllegalArgumentException ( ( ( ( "Kan<sp>niet<sp>bepalen<sp>of<sp>de<sp>persoon<sp>geleverd<sp>moet<sp>worden<sp>voor<sp>populatie" + ( administratieveHandeling . getSoort ( ) ) ) + "<sp>en<sp>catalogusoptie<sp>" ) + ( leveringinformatie . getSoortDienst ( ) ) ) ) ; } if ( ! resultaat ) { nl . bzk . brp . levering . business . filters . PopulatieBepalingFilter . LOGGER . debug ( "Persoon<sp>{}<sp>zal<sp>niet<sp>geleverd<sp>worden<sp>voor<sp>dienst<sp>{}<sp>vanwege<sp>populatie<sp>{}<sp>voor<sp>categorie<sp>dienst<sp>{}." , persoon . getID ( ) , leveringinformatie . getDienst ( ) . getID ( ) , populatie , leveringinformatie . getSoortDienst ( ) ) ; } return resultaat ; }
org . junit . Assert . assertTrue ( resultaat )
addFeatureIncrementsSize ( ) { createPointFeatures ( org . geotools . data . collection . ListFeatureCollectionTest . WORLD , 1 ) ; featureCollection . add ( createPointFeature ( org . geotools . data . collection . ListFeatureCollectionTest . WORLD . getMinX ( ) , org . geotools . data . collection . ListFeatureCollectionTest . WORLD . getMinY ( ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return categories . length ; }
org . junit . Assert . assertEquals ( 2 , featureCollection . size ( ) )
test_success_equals_message_older_equals_flag_true ( ) { defaultEntityAgeFilterService . initialise ( "client-d" ) ; defaultEntityAgeFilterService . setOlderIfEquals ( true ) ; org . ikasan . filter . duplicate . model . FilterEntry aMessage = new org . ikasan . filter . duplicate . model . DefaultFilterEntry ( "business-id-1" . hashCode ( ) , "client-d" , "12345" , 30 ) ; boolean result = defaultEntityAgeFilterService . isOlderEntity ( aMessage ) ; "<AssertPlaceHolder>" ; } isOlderEntity ( org . ikasan . filter . duplicate . model . FilterEntry ) { org . ikasan . filter . duplicate . model . DefaultFilterEntry cachedEntry = this . filterEntryMap . get ( ( ( entry . getCriteria ( ) ) + ( entry . getClientId ( ) ) ) ) ; if ( cachedEntry == null ) { this . filteredMessageDao . save ( entry ) ; filterEntryMap . put ( ( ( entry . getCriteria ( ) ) + ( entry . getClientId ( ) ) ) , ( ( org . ikasan . filter . duplicate . model . DefaultFilterEntry ) ( entry ) ) ) ; return false ; } long cachedEntryUpdatedTimeMilliseconds = java . lang . Long . parseLong ( cachedEntry . getCriteriaDescription ( ) ) ; long entryUpdatedTimeMilliseconds = java . lang . Long . parseLong ( entry . getCriteriaDescription ( ) ) ; org . ikasan . filter . duplicate . service . DefaultEntityAgeFilterService . logger . debug ( ( ( ( ( ( ( ( ( ( ( "Comparing<sp>cached<sp>time:<sp>[" + cachedEntryUpdatedTimeMilliseconds ) + "]<sp>to<sp>last<sp>updated<sp>time" ) + "[" ) + entryUpdatedTimeMilliseconds ) + "]<sp>for<sp>criteria:<sp>[" ) + ( entry . getCriteria ( ) ) ) + "]<sp>and<sp>" ) + "<sp>client:<sp>[" ) + ( entry . getClientId ( ) ) ) + "]" ) ) ; if ( ( ( cachedEntryUpdatedTimeMilliseconds <= entryUpdatedTimeMilliseconds ) && ( ! ( olderIfEquals ) ) ) || ( cachedEntryUpdatedTimeMilliseconds < entryUpdatedTimeMilliseconds ) ) { if ( cachedEntryUpdatedTimeMilliseconds != entryUpdatedTimeMilliseconds ) { cachedEntry . setCriteriaDescription ( entry . getCriteriaDescription ( ) ) ; cachedEntry . setExpiry ( entry . getExpiry ( ) ) ; cachedEntry . setCreatedDateTime ( entry . getCreatedDateTime ( ) ) ; this . filteredMessageDao . saveOrUpdate ( cachedEntry ) ; org . ikasan . filter . duplicate . service . DefaultEntityAgeFilterService . logger . debug ( ( "Is<sp>older:<sp>[false].<sp>Saving:<sp>" + cachedEntry ) ) ; } else { org . ikasan . filter . duplicate . service . DefaultEntityAgeFilterService . logger . debug ( "Is<sp>older:<sp>[false]." ) ; } return false ; } else { org . ikasan . filter . duplicate . service . DefaultEntityAgeFilterService . logger . debug ( "Is<sp>older:<sp>[true]." ) ; return true ; } }
org . junit . Assert . assertTrue ( result )
testAsInt8 ( ) { org . apache . tajo . datum . Datum d = org . apache . tajo . datum . DatumFactory . createInt2 ( ( ( short ) ( 5 ) ) ) ; "<AssertPlaceHolder>" ; } asInt8 ( ) { throw new org . apache . tajo . datum . exception . InvalidCastException ( ( ( type ) + "<sp>cannot<sp>be<sp>casted<sp>to<sp>LONG<sp>type" ) ) ; }
org . junit . Assert . assertEquals ( 5 , d . asInt8 ( ) )
testExample1 ( ) { java . util . List < de . hu . berlin . wbi . objects . MutationMention > mutationMentions = seth . findMutations ( "c.31+3insT" ) ; "<AssertPlaceHolder>" ; } findMutations ( java . lang . String ) { seth . Set < seth . MutationMention > mutations = new seth . HashSet < seth . MutationMention > ( ) ; if ( ( seth ) != null ) mutations . addAll ( seth . extractMutations ( text ) ) ; if ( ( snpRecognizer ) != null ) mutations . addAll ( snpRecognizer . extractMutations ( text ) ) ; if ( ( bl ) != null ) mutations . addAll ( bl . extractMutations ( text ) ) ; try { seth . Map < edu . uchsc . ccp . nlp . ei . mutation . Mutation , seth . Set < int [ ] > > map = mf . extractMutations ( text ) ; for ( edu . uchsc . ccp . nlp . ei . mutation . Mutation mutation : map . keySet ( ) ) { edu . uchsc . ccp . nlp . ei . mutation . PointMutation pm = ( ( edu . uchsc . ccp . nlp . ei . mutation . PointMutation ) ( mutation ) ) ; for ( int [ ] location : map . get ( mutation ) ) { java . lang . String originalMatch = text . substring ( location [ 0 ] , location [ 1 ] ) ; seth . MutationMention tmpMutation = new seth . MutationMention ( location [ 0 ] , location [ 1 ] , originalMatch , null , pm . getPosition ( ) , java . lang . String . valueOf ( pm . getWtResidue ( ) ) , java . lang . String . valueOf ( pm . getMutResidue ( ) ) , seth . ner . wrapper . Type . SUBSTITUTION , MutationMention . Tool . MUTATIONFINDER ) ; tmpMutation . setPatternId ( pm . getId ( ) ) ; if ( pm . isMatchesLongForm ( ) ) { tmpMutation . setPsm ( true ) ; tmpMutation . setAmbiguous ( false ) ; tmpMutation . setNsm ( false ) ; } mutations . add ( tmpMutation ) ; } } } catch ( edu . uchsc . ccp . nlp . ei . mutation . MutationException e ) { e . printStackTrace ( ) ; java . lang . System . exit ( 1 ) ; } seth . List < seth . MutationMention > result = new seth . ArrayList < seth . MutationMention > ( mutations . size ( ) ) ; for ( seth . MutationMention mm : mutations ) { boolean contained = false ; loop : for ( seth . MutationMention m : result ) { boolean equal = false ; equal = ( ( seth . Objects . equals ( mm . getPosition ( ) , m . getPosition ( ) ) ) && ( seth . Objects . equals ( mm . getMutResidue ( ) , m . getMutResidue ( ) ) ) ) && ( seth . Objects . equals ( mm . getWtResidue ( ) , m . getWtResidue ( ) ) ) ; if ( ( ( mm . getStart ( ) ) == ( m . getStart ( ) ) ) && ( ( mm . getEnd ( ) ) == ( m . getEnd ( ) ) ) ) { if ( ( ( mm . getTool ( ) ) == ( MutationMention . Tool . SETH ) ) && ( ( m . getTool ( ) ) == ( MutationMention . Tool . DBSNP ) ) ) { contained = true ; break loop ; } else if ( ( ( m . getTool ( ) ) == ( MutationMention . Tool . SETH ) ) && ( ( mm . getTool ( ) ) == ( MutationMention . Tool . DBSNP ) ) ) { result . remove ( m ) ; break loop ; } } else if ( ( ( ( mm . getStart ( ) ) >= ( m . getStart ( ) ) ) && ( ( mm . getEnd ( ) ) <= ( m . getEnd ( ) ) ) ) && equal ) { contained = true ; break loop ; } else if ( ( ( ( m . getStart ( ) ) >= ( mm . getStart ( ) ) ) && ( ( m . getEnd ( ) ) <= ( mm . getEnd ( ) ) ) ) && equal ) { result . remove ( m ) ; break loop ; } } if ( ! contained ) result . add ( mm ) ; } return result ; }
org . junit . Assert . assertEquals ( mutationMentions . size ( ) , 1 )
testExceptionInValidateDuringBindAndOnFailureDoesNotThrow ( ) { org . glassfish . hk2 . api . ServiceLocator locator = org . glassfish . hk2 . tests . locator . utilities . LocatorHelper . getServiceLocator ( org . glassfish . hk2 . tests . locator . negative . validation . ValidationServiceImpl . class , org . glassfish . hk2 . tests . locator . negative . validation . ErrorServiceImpl . class ) ; org . glassfish . hk2 . tests . locator . negative . validation . ValidationServiceImpl vsi = locator . getService ( org . glassfish . hk2 . tests . locator . negative . validation . ValidationServiceImpl . class ) ; org . glassfish . hk2 . tests . locator . negative . validation . ErrorServiceImpl esi = locator . getService ( org . glassfish . hk2 . tests . locator . negative . validation . ErrorServiceImpl . class ) ; vsi . setThrowFromValidate ( true ) ; esi . setThrowInOnFailure ( true ) ; try { org . glassfish . hk2 . utilities . ServiceLocatorUtilities . addClasses ( locator , org . glassfish . hk2 . tests . locator . negative . validation . SimpleService . class ) ; org . junit . Assert . fail ( "Should<sp>have<sp>failed<sp>with<sp>MultiException" ) ; } catch ( org . glassfish . hk2 . api . MultiException me ) { } catch ( java . lang . Throwable th ) { if ( th instanceof java . lang . RuntimeException ) { throw ( ( java . lang . RuntimeException ) ( th ) ) ; } throw new java . lang . RuntimeException ( th ) ; } org . glassfish . hk2 . tests . locator . negative . validation . SimpleService ss = locator . getService ( org . glassfish . hk2 . tests . locator . negative . validation . SimpleService . class ) ; "<AssertPlaceHolder>" ; } getService ( org . glassfish . hk2 . api . ServiceHandle ) { if ( ( root ) instanceof org . jvnet . hk2 . internal . Closeable ) { org . jvnet . hk2 . internal . Closeable closeable = ( ( org . jvnet . hk2 . internal . Closeable ) ( root ) ) ; if ( closeable . isClosed ( ) ) { throw new java . lang . IllegalStateException ( ( "This<sp>service<sp>has<sp>been<sp>unbound:<sp>" + ( root ) ) ) ; } } synchronized ( lock ) { if ( serviceDestroyed ) throw new java . lang . IllegalStateException ( "Service<sp>has<sp>been<sp>disposed" ) ; if ( serviceSet ) return service ; org . glassfish . hk2 . api . Injectee injectee = getLastInjectee ( ) ; java . lang . Class < ? > requiredClass = ( injectee == null ) ? null : org . glassfish . hk2 . utilities . reflection . ReflectionHelper . getRawClass ( injectee . getRequiredType ( ) ) ; service = org . jvnet . hk2 . internal . Utilities . createService ( root , injectee , locator , handle , requiredClass ) ; serviceSet = true ; return service ; } }
org . junit . Assert . assertNull ( ss )
testCompletenessOfSpecifiedParent ( ) { org . apache . taverna . scufl2 . api . core . Workflow w = new org . apache . taverna . scufl2 . api . core . Workflow ( ) ; w . setName ( "fred" ) ; org . apache . taverna . scufl2 . api . container . WorkflowBundle wb = new org . apache . taverna . scufl2 . api . container . WorkflowBundle ( ) ; w . setParent ( wb ) ; org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator cv = new org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator ( ) ; org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener rcvl = new org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener ( ) ; cv . checkCorrectness ( w , true , rcvl ) ; java . util . Set < org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem > nullFieldProblems = rcvl . getNullFieldProblems ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return namedMap . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , nullFieldProblems . size ( ) )
testFindAll ( ) { org . oscarehr . common . model . ScheduleTemplateCode scheduleTempCode1 = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( scheduleTempCode1 ) ; dao . persist ( scheduleTempCode1 ) ; org . oscarehr . common . model . ScheduleTemplateCode scheduleTempCode2 = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( scheduleTempCode2 ) ; dao . persist ( scheduleTempCode2 ) ; org . oscarehr . common . model . ScheduleTemplateCode scheduleTempCode3 = new org . oscarehr . common . model . ScheduleTemplateCode ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( scheduleTempCode3 ) ; dao . persist ( scheduleTempCode3 ) ; java . util . List < org . oscarehr . common . model . ScheduleTemplateCode > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . ScheduleTemplateCode > ( java . util . Arrays . asList ( scheduleTempCode1 , scheduleTempCode2 , scheduleTempCode3 ) ) ; java . util . List < org . oscarehr . common . model . ScheduleTemplateCode > result = dao . findAll ( ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } }
org . junit . Assert . assertTrue ( true )