input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
messageArrivedShouldShowMessageAndNotifyUserInterfaceButNotSetNewMessageFlagWhenNotVisible ( ) { setUpExistingUser ( ) ; when ( userInterface . isVisible ( ) ) . thenReturn ( false ) ; when ( userInterface . isFocused ( ) ) . thenReturn ( false ) ; responder . messageArrived ( 100 , "msg3" , 200 ) ; verify ( messageController ) . showUserMessage ( "Tester" , "msg3" , 200 ) ; verify ( userInterface ) . notifyMessageArrived ( user , "msg3" ) ; "<AssertPlaceHolder>" ; } isNewMsg ( ) { return newMsg ; }
org . junit . Assert . assertFalse ( me . isNewMsg ( ) )
testReflect2 ( ) { com . ibm . wala . ipa . callgraph . AnalysisScope scope = com . ibm . wala . core . tests . callGraph . ReflectionTest . findOrCreateAnalysisScope ( ) ; com . ibm . wala . ipa . cha . IClassHierarchy cha = com . ibm . wala . core . tests . callGraph . ReflectionTest . findOrCreateCHA ( scope ) ; java . lang . Iterable < com . ibm . wala . ipa . callgraph . Entrypoint > entrypoints = com . ibm . wala . ipa . callgraph . impl . Util . makeMainEntrypoints ( scope , cha , TestConstants . REFLECT2_MAIN ) ; com . ibm . wala . ipa . callgraph . AnalysisOptions options = com . ibm . wala . core . tests . callGraph . CallGraphTestUtil . makeAnalysisOptions ( scope , entrypoints ) ; com . ibm . wala . ipa . callgraph . CallGraph cg = com . ibm . wala . core . tests . callGraph . CallGraphTestUtil . buildZeroOneCFA ( options , new com . ibm . wala . ipa . callgraph . AnalysisCacheImpl ( ) , cha , scope , false ) ; com . ibm . wala . types . TypeReference tr = com . ibm . wala . types . TypeReference . findOrCreate ( ClassLoaderReference . Application , "Ljava/lang/Integer" ) ; com . ibm . wala . types . MethodReference mr = com . ibm . wala . types . MethodReference . findOrCreate ( tr , "<clinit>" , "()V" ) ; java . util . Set < com . ibm . wala . ipa . callgraph . CGNode > nodes = cg . getNodes ( mr ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( top ) == ( - 1 ) ; }
org . junit . Assert . assertFalse ( nodes . isEmpty ( ) )
testGetLocaleWhenEmpty ( ) { java . util . Locale . setDefault ( defaultLocale ) ; properties . put ( "locale" , "" ) ; userTaskPageProviver . setProperties ( properties ) ; "<AssertPlaceHolder>" ; } getLocale ( ) { return locale ; }
org . junit . Assert . assertEquals ( defaultLocale , userTaskPageProviver . getLocale ( ) )
testMatchFilter ( ) { org . eclipse . linuxtools . systemtap . graphing . core . filters . MatchFilter filter = new org . eclipse . linuxtools . systemtap . graphing . core . filters . MatchFilter ( ( - 1 ) , null , org . eclipse . linuxtools . systemtap . graphing . core . filters . MatchFilter . KEEP_MATCHING ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( filter )
testObjectFunctionCallNoParameters ( ) { v8 . executeVoidScript ( "function<sp>foo()<sp>{return<sp>{bar:8};}" ) ; com . eclipsesource . v8 . V8Array parameters = new com . eclipsesource . v8 . V8Array ( v8 ) ; com . eclipsesource . v8 . V8Object result = v8 . executeObjectFunction ( "foo" , parameters ) ; "<AssertPlaceHolder>" ; parameters . close ( ) ; result . close ( ) ; } getInteger ( java . lang . String ) { throw new java . lang . UnsupportedOperationException ( ) ; }
org . junit . Assert . assertEquals ( 8 , result . getInteger ( "bar" ) )
testFindFromClasspath ( ) { org . pf4j . ExtensionFinder instance = new org . pf4j . AbstractExtensionFinder ( pluginManager ) { @ org . pf4j . Override public java . util . Map < java . lang . String , java . util . Set < java . lang . String > > readPluginsStorages ( ) { return java . util . Collections . emptyMap ( ) ; } @ org . pf4j . Override public java . util . Map < java . lang . String , java . util . Set < java . lang . String > > readClasspathStorages ( ) { java . util . Map < java . lang . String , java . util . Set < java . lang . String > > entries = new java . util . LinkedHashMap ( ) ; java . util . Set < java . lang . String > bucket = new java . util . HashSet ( ) ; bucket . add ( "org.pf4j.plugin.TestExtension" ) ; bucket . add ( "org.pf4j.plugin.FailTestExtension" ) ; entries . put ( null , bucket ) ; return entries ; } } ; java . util . List < org . pf4j . ExtensionWrapper < org . pf4j . plugin . TestExtensionPoint > > list = instance . find ( org . pf4j . plugin . TestExtensionPoint . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return finders . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , list . size ( ) )
testRemoveAggregation_emptyRepository_assertExcpetion ( ) { final org . nhindirect . monitor . dao . entity . Aggregation remove = new org . nhindirect . monitor . dao . entity . Aggregation ( ) ; remove . setExchangeBlob ( new byte [ ] { 0 , 3 , 2 } ) ; remove . setId ( "12345" ) ; remove . setVersion ( 0 ) ; boolean exceptionOccured = false ; try { notifDao . removeAggregation ( remove , "12345" ) ; } catch ( org . nhindirect . monitor . dao . AggregationDAOException e ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( exceptionOccured )
testRegistration ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( service )
refinementCardinalityExactlyOne ( ) { generateDrugHierarchy ( ) ; final com . b2international . index . query . Expression actual = eval ( java . lang . String . format ( "<%s:<sp>[1..1]<sp>%s=<%s" , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . DRUG_ROOT , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . HAS_ACTIVE_INGREDIENT , com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . SUBSTANCE ) ) ; final com . b2international . index . query . Expression expected = com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . and ( descendantsOf ( com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . DRUG_ROOT ) , ids ( java . util . Collections . singleton ( com . b2international . snowowl . snomed . core . ecl . SnomedEclEvaluationRequestTest . PANADOL_TABLET ) ) ) ; "<AssertPlaceHolder>" ; } ids ( java . util . Collection ) { return matchAny ( ID , ids ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testItemCollectionRawtype ( ) { org . imixs . workflow . ItemCollection itemCollection = new org . imixs . workflow . ItemCollection ( ) ; itemCollection . replaceItemValue ( "txtTitel" , "Hello" ) ; double d = 5.2 ; itemCollection . replaceItemValue ( "price" , d ) ; byte [ ] bytes = "Some<sp>Data" . getBytes ( ) ; itemCollection . replaceItemValue ( "data" , bytes ) ; "<AssertPlaceHolder>" ; } replaceItemValue ( java . lang . String , java . lang . Object ) { setItemValue ( itemName , itemValue , false ) ; }
org . junit . Assert . assertNotNull ( itemCollection )
testIllegalSpdyRstStreamFrameStatusCode ( ) { short type = 3 ; byte flags = 0 ; int length = 8 ; int streamId = ( ( io . netty . handler . codec . spdy . SpdyFrameDecoderTest . RANDOM . nextInt ( ) ) & 2147483647 ) | 1 ; int statusCode = 0 ; io . netty . buffer . ByteBuf buf = io . netty . buffer . Unpooled . buffer ( ( ( io . netty . handler . codec . spdy . SpdyCodecUtil . SPDY_HEADER_SIZE ) + length ) ) ; io . netty . handler . codec . spdy . SpdyFrameDecoderTest . encodeControlFrameHeader ( buf , type , flags , length ) ; buf . writeInt ( streamId ) ; buf . writeInt ( statusCode ) ; decoder . decode ( buf ) ; verify ( delegate ) . readFrameError ( anyString ( ) ) ; "<AssertPlaceHolder>" ; buf . release ( ) ; } isReadable ( ) { return ( writerIndex ) > ( readerIndex ) ; }
org . junit . Assert . assertFalse ( buf . isReadable ( ) )
shouldNotBeInitializedIfChangelogPartitionsIsNonEmpty ( ) { final org . apache . kafka . streams . processor . internals . StreamTask task = createStatefulTask ( createConfig ( false ) , true ) ; "<AssertPlaceHolder>" ; } initializeStateStores ( ) { log . trace ( "Initializing<sp>state<sp>stores" ) ; registerStateStores ( ) ; checkpointedOffsets = java . util . Collections . unmodifiableMap ( stateMgr . checkpointed ( ) ) ; processorContext . initialize ( ) ; taskInitialized = true ; return true ; }
org . junit . Assert . assertFalse ( task . initializeStateStores ( ) )
testTopK ( ) { com . clearspring . analytics . stream . StreamSummary < java . lang . String > vs = new com . clearspring . analytics . stream . StreamSummary < java . lang . String > ( 3 ) ; java . lang . String [ ] stream = new java . lang . String [ ] { "X" , "X" , "Y" , "Z" , "A" , "B" , "C" , "X" , "X" , "A" , "C" , "A" , "A" } ; for ( java . lang . String i : stream ) { vs . offer ( i ) ; } java . util . List < com . clearspring . analytics . stream . Counter < java . lang . String > > topK = vs . topK ( 3 ) ; for ( com . clearspring . analytics . stream . Counter < java . lang . String > c : topK ) { "<AssertPlaceHolder>" ; } } getItem ( ) { return item ; }
org . junit . Assert . assertTrue ( java . util . Arrays . asList ( "A" , "C" , "X" ) . contains ( c . getItem ( ) ) )
testGetDescription ( ) { java . lang . String actual = ServerCapability . PLC . getDescription ( ) ; java . lang . String expected = "Supports<sp>the<sp>PLCopen<sp>information<sp>model." ; "<AssertPlaceHolder>" ; } getDescription ( ) { return description ; }
org . junit . Assert . assertEquals ( expected , actual )
shouldNotRollDateForwardWhenItMatchesDayOfWeek ( ) { org . joda . time . DateTime firstOfNextMonth = new org . joda . time . DateTime ( ) . plusMonths ( 1 ) . withDayOfMonth ( 1 ) . toDateMidnight ( ) . toDateTime ( ) ; org . joda . time . DateTime firstThursdayOfNextMonth = firstOfNextMonth . withDayOfWeek ( org . mifos . calendar . DayOfWeek . thursday ( ) ) ; org . joda . time . DateTime adjustedDate = org . mifos . calendar . CalendarUtils . getFirstDateForWeek ( firstThursdayOfNextMonth , org . mifos . calendar . DayOfWeek . thursday ( ) ) ; "<AssertPlaceHolder>" ; } thursday ( ) { return Days . FOUR . getDays ( ) ; }
org . junit . Assert . assertThat ( adjustedDate , org . hamcrest . CoreMatchers . is ( firstThursdayOfNextMonth ) )
test6 ( ) { java . lang . String [ ] vars = new java . lang . String [ ] { "a" , "b" , "c" , "d" , "e" , "f" , "g" , "h" } ; for ( cc . redberry . rings . Ring < cc . redberry . rings . bigint . BigInteger > ring : java . util . Arrays . < cc . redberry . rings . Ring < cc . redberry . rings . bigint . BigInteger > > asList ( new cc . redberry . rings . IntegersZp ( 2 ) , Rings . Z ) ) { cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > poly = cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "a^2*b^4*c*e^5" , ring , vars ) ; cc . redberry . rings . poly . PolynomialFactorDecomposition < cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > > expected = cc . redberry . rings . poly . PolynomialFactorDecomposition . empty ( poly ) ; expected . addFactor ( cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "a" , ring , vars ) , 2 ) ; expected . addFactor ( cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "b" , ring , vars ) , 4 ) ; expected . addFactor ( cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "c" , ring , vars ) , 1 ) ; expected . addFactor ( cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "e" , ring , vars ) , 5 ) ; "<AssertPlaceHolder>" ; } } SquareFreeFactorization ( Poly extends cc . redberry . rings . poly . multivar . AMultivariatePolynomial ) { if ( poly . isOverFiniteField ( ) ) return cc . redberry . rings . poly . multivar . MultivariateSquareFreeFactorization . SquareFreeFactorizationMusser ( poly ) ; else if ( cc . redberry . rings . poly . multivar . MultivariateGCD . isOverPolynomialRing ( poly ) ) return cc . redberry . rings . poly . multivar . MultivariateFactorization . tryNested ( poly , cc . redberry . rings . poly . multivar . MultivariateSquareFreeFactorization :: SquareFreeFactorization ) ; else if ( poly . coefficientRingCharacteristic ( ) . isZero ( ) ) return cc . redberry . rings . poly . multivar . MultivariateSquareFreeFactorization . SquareFreeFactorizationYunZeroCharacteristics ( poly ) ; else return cc . redberry . rings . poly . multivar . MultivariateSquareFreeFactorization . SquareFreeFactorizationMusser ( poly ) ; }
org . junit . Assert . assertEquals ( expected , cc . redberry . rings . poly . multivar . MultivariateSquareFreeFactorization . SquareFreeFactorization ( poly ) )
testIsArchived ( ) { net . rcarz . jiraclient . Version version = new net . rcarz . jiraclient . Version ( null , getTestJSON ( ) ) ; "<AssertPlaceHolder>" ; } isArchived ( ) { return archived ; }
org . junit . Assert . assertFalse ( version . isArchived ( ) )
getAliasSuffix ( ) { when ( wikiConfiguration . getAliasSuffix ( ) ) . thenReturn ( "mysuffix.org" ) ; "<AssertPlaceHolder>" ; } getAliasSuffix ( ) { when ( configuration . getProperty ( "wiki.alias.suffix" , "" ) ) . thenReturn ( "xwiki.org" ) ; org . junit . Assert . assertEquals ( "xwiki.org" , mocker . getComponentUnderTest ( ) . getAliasSuffix ( ) ) ; when ( configuration . getProperty ( "wiki.alias.suffix" , "" ) ) . thenReturn ( "blabla.org" ) ; org . junit . Assert . assertEquals ( "blabla.org" , mocker . getComponentUnderTest ( ) . getAliasSuffix ( ) ) ; }
org . junit . Assert . assertEquals ( mocker . getComponentUnderTest ( ) . getAliasSuffix ( ) , "mysuffix.org" )
testTransactionJoinIfPossible ( ) { org . mule . runtime . core . api . transaction . MuleTransactionConfig txConfig = new org . mule . runtime . core . api . transaction . MuleTransactionConfig ( TransactionConfig . ACTION_JOIN_IF_POSSIBLE ) ; txConfig . setMuleContext ( muleContext ) ; txConfig . setFactory ( new org . mule . tck . testmodels . mule . TestTransactionFactory ( ) ) ; "<AssertPlaceHolder>" ; } isTransacted ( ) { return false ; }
org . junit . Assert . assertFalse ( txConfig . isTransacted ( ) )
testWSDLRequestNoWSDL ( ) { when ( httpServletResponse . getOutputStream ( ) ) . thenReturn ( sos ) ; handler . handle ( "/wsdl/foooooooo.wsdl" , request , request , httpServletResponse ) ; "<AssertPlaceHolder>" ; verify ( httpServletResponse ) . setStatus ( HttpServletResponse . SC_NOT_FOUND ) ; logCheck ( ) ; } isHandled ( ) { return handled ; }
org . junit . Assert . assertTrue ( request . isHandled ( ) )
shouldReturnPodTemplateWhenParentIsNull ( ) { org . csanchez . jenkins . plugins . kubernetes . PodTemplate template = new org . csanchez . jenkins . plugins . kubernetes . PodTemplate ( ) ; template . setName ( "template" ) ; template . setServiceAccount ( "sa1" ) ; org . csanchez . jenkins . plugins . kubernetes . PodTemplate result = combine ( null , template ) ; "<AssertPlaceHolder>" ; } combine ( org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate$ContainerTemplate , org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate$ContainerTemplate ) { com . google . common . base . Preconditions . checkNotNull ( template , "Container<sp>template<sp>should<sp>not<sp>be<sp>null" ) ; if ( parent == null ) { return template ; } java . lang . String name = template . getName ( ) ; java . lang . String image = ( com . google . common . base . Strings . isNullOrEmpty ( template . getImage ( ) ) ) ? parent . getImage ( ) : template . getImage ( ) ; boolean privileged = ( template . isPrivileged ( ) ) ? template . isPrivileged ( ) : parent . isPrivileged ( ) ? parent . isPrivileged ( ) : false ; boolean alwaysPullImage = ( template . isAlwaysPullImage ( ) ) ? template . isAlwaysPullImage ( ) : parent . isAlwaysPullImage ( ) ? parent . isAlwaysPullImage ( ) : false ; java . lang . String workingDir = ( com . google . common . base . Strings . isNullOrEmpty ( template . getWorkingDir ( ) ) ) ? com . google . common . base . Strings . isNullOrEmpty ( parent . getWorkingDir ( ) ) ? DEFAULT_WORKING_DIR : parent . getWorkingDir ( ) : template . getWorkingDir ( ) ; java . lang . String command = ( com . google . common . base . Strings . isNullOrEmpty ( template . getCommand ( ) ) ) ? parent . getCommand ( ) : template . getCommand ( ) ; java . lang . String args = ( com . google . common . base . Strings . isNullOrEmpty ( template . getArgs ( ) ) ) ? parent . getArgs ( ) : template . getArgs ( ) ; boolean ttyEnabled = ( template . isTtyEnabled ( ) ) ? template . isTtyEnabled ( ) : parent . isTtyEnabled ( ) ? parent . isTtyEnabled ( ) : false ; java . lang . String resourceRequestCpu = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceRequestCpu ( ) ) ) ? parent . getResourceRequestCpu ( ) : template . getResourceRequestCpu ( ) ; java . lang . String resourceRequestMemory = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceRequestMemory ( ) ) ) ? parent . getResourceRequestMemory ( ) : template . getResourceRequestMemory ( ) ; java . lang . String resourceLimitCpu = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceLimitCpu ( ) ) ) ? parent . getResourceLimitCpu ( ) : template . getResourceLimitCpu ( ) ; java . lang . String resourceLimitMemory = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceLimitMemory ( ) ) ) ? parent . getResourceLimitMemory ( ) : template . getResourceLimitMemory ( ) ; org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate . ContainerTemplate combined = new org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate . ContainerTemplate ( image ) ; combined . setName ( name ) ; combined . setImage ( image ) ; combined . setAlwaysPullImage ( alwaysPullImage ) ; combined . setCommand ( command ) ; combined . setArgs ( args ) ; combined . setTtyEnabled ( ttyEnabled ) ; combined . setResourceLimitCpu ( resourceLimitCpu ) ; combined . setResourceLimitMemory ( resourceLimitMemory ) ; combined . setResourceRequestCpu ( resourceRequestCpu ) ; combined . setResourceRequestMemory ( resourceRequestMemory ) ; combined . setWorkingDir ( workingDir ) ; combined . setPrivileged ( privileged ) ; combined . setEnvVars ( org . csanchez . jenkins . plugins . kubernetes . PodTemplateUtils . combineEnvVars ( parent , template ) ) ; return combined ; }
org . junit . Assert . assertEquals ( result , template )
testNode ( ) { org . antlr . test . TreeAdaptor adaptor = new org . antlr . test . CommonTreeAdaptor ( ) ; org . antlr . test . TreeWizard wiz = new org . antlr . test . TreeWizard ( adaptor , org . antlr . test . TestTreeIterator . tokens ) ; org . antlr . test . CommonTree t = ( ( org . antlr . test . CommonTree ) ( wiz . create ( "A" ) ) ) ; org . antlr . test . TreeIterator it = new org . antlr . test . TreeIterator ( t ) ; java . lang . StringBuffer buf = org . antlr . test . TestTreeIterator . toString ( it ) ; java . lang . String expecting = "A<sp>EOF" ; java . lang . String found = buf . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return new java . lang . String ( data , start , length ( ) ) ; }
org . junit . Assert . assertEquals ( expecting , found )
moreThanOneStreamCommentsSecondFail ( ) { java . lang . String script = "#Comment<sp>1\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( "\tconnect<sp>\'tcp://localhost:8080\'<sp>#comment<sp>2\n" + "\tclose\n" 4 ) + "\t#comment<sp>3\n" ) + "\tclose\n" ) + "\tclose\n" 2 ) + "\tclose\n" 1 ) + "\t#comment<sp>4\n" ) + "\tconnect<sp>\'tcp://localhost:8081\'\n" ) + "\tconnected\n" ) + "#comment<sp>7\n" ) + "\tclose\n" ) + "#comment<sp>6\n" ) + "\tclose\n" 1 ) + "\t#comment<sp>5\n" ) ; org . kaazing . k3po . lang . internal . parser . ScriptParser parser = new org . kaazing . k3po . lang . internal . parser . ScriptParserImpl ( ) ; org . kaazing . k3po . lang . internal . ast . AstScriptNode scriptAST = parser . parse ( new java . io . ByteArrayInputStream ( script . getBytes ( org . kaazing . k3po . driver . internal . behavior . UTF_8 ) ) ) ; org . kaazing . k3po . lang . internal . ast . AstStreamNode connectAST = scriptAST . getStreams ( ) . get ( 1 ) ; org . kaazing . k3po . lang . internal . ast . AstRegion closeAST = connectAST . getStreamables ( ) . get ( 1 ) ; org . kaazing . k3po . lang . internal . RegionInfo scriptInfo = scriptAST . getRegionInfo ( ) ; org . kaazing . k3po . driver . internal . behavior . ScriptProgress progress = new org . kaazing . k3po . driver . internal . behavior . ScriptProgress ( scriptInfo , script ) ; progress . addScriptFailure ( closeAST . getRegionInfo ( ) , "\tclose\n" 0 ) ; java . lang . String observedScript = progress . getObservedScript ( ) ; java . lang . String expectedScript = "#Comment<sp>1\n" + ( ( ( ( ( ( ( ( ( ( ( "\tconnect<sp>\'tcp://localhost:8080\'<sp>#comment<sp>2\n" + "\tclose\n" 4 ) + "\t#comment<sp>3\n" ) + "\tclose\n" ) + "\tclose\n" 2 ) + "\tclose\n" 1 ) + "\t#comment<sp>4\n" ) + "\tconnect<sp>\'tcp://localhost:8081\'\n" ) + "\tconnected\n" ) + "#comment<sp>7\n" ) + "\tclose\n" 3 ) + "\t#comment<sp>5\n" ) ; "<AssertPlaceHolder>" ; } getObservedScript ( ) { return ( progress ) != null ? progress . getObservedScript ( ) : null ; }
org . junit . Assert . assertEquals ( expectedScript , observedScript )
testForCharArray ( ) { java . lang . String [ ] strArr = new java . lang . String [ 2 ] ; strArr [ 0 ] = "a" ; strArr [ 1 ] = "d" ; org . apache . phoenix . schema . types . PhoenixArray arr = org . apache . phoenix . schema . types . PArrayDataType . instantiatePhoenixArray ( PChar . INSTANCE , strArr ) ; byte [ ] bytes = PCharArray . INSTANCE . toBytes ( arr ) ; org . apache . phoenix . schema . types . PhoenixArray resultArr = ( ( org . apache . phoenix . schema . types . PhoenixArray ) ( PCharArray . INSTANCE . toObject ( bytes , 0 , bytes . length , PCharArray . INSTANCE , null , 1 , null ) ) ) ; "<AssertPlaceHolder>" ; } toObject ( byte [ ] , int , int , org . apache . phoenix . schema . types . PDataType , org . apache . phoenix . schema . SortOrder , java . lang . Integer , java . lang . Integer ) { return toObject ( bytes , offset , length , PChar . INSTANCE , sortOrder , maxLength , scale , PChar . INSTANCE ) ; }
org . junit . Assert . assertEquals ( arr , resultArr )
testValid ( ) { java . util . Set < javax . validation . ConstraintViolation < com . cloudera . parcel . descriptors . AlternativesDescriptor > > violations = validator . getViolations ( com . cloudera . parcel . validation . ParcelTestUtils . getParserAlternativesJson ( "good_alternatives.json" ) ) ; "<AssertPlaceHolder>" ; } getParserAlternativesJson ( java . lang . String ) { return com . cloudera . parcel . validation . ParcelTestUtils . parseJson ( com . cloudera . parcel . validation . ParcelTestUtils . ALTERNATIVES_PARSER , ( ( com . cloudera . parcel . validation . ParcelTestUtils . PARCEL_PARSER_RESOURCE_PATH ) + filename ) ) ; }
org . junit . Assert . assertTrue ( violations . isEmpty ( ) )
testParseIonic_StatisticalUnit ( ) { final java . lang . String [ ] properties = new java . lang . String [ ] { "unitId" , "typeAbbreviation" , "instanceName" , "geometry" } ; final javax . xml . namespace . QName featureName = org . geotools . data . wfs . v1_1_0 . DataTestSupport . IONIC_STATISTICAL_UNIT . TYPENAME ; final java . lang . String schemaLocation = org . geotools . data . wfs . v1_1_0 . DataTestSupport . IONIC_STATISTICAL_UNIT . SCHEMA ; final org . opengis . feature . simple . SimpleFeatureType featureType = getTypeView ( featureName , schemaLocation , CUBEWERX_ROADSEG . CRS , properties ) ; java . net . URL url = org . geotools . test . TestData . getResource ( this , IONIC_STATISTICAL_UNIT . DATA ) ; final org . geotools . data . wfs . protocol . wfs . GetFeatureParser parser = getParser ( featureName , schemaLocation , featureType , url ) ; int nof = parser . getNumberOfFeatures ( ) ; "<AssertPlaceHolder>" ; org . opengis . feature . FeatureVisitor assertor = new org . geotools . data . wfs . v1_1_0 . AbstractGetFeatureParserTest . FeatureAssertor ( featureType ) ; testParseGetFeatures ( featureName , featureType , parser , assertor , 2 ) ; } getNumberOfFeatures ( ) { return numberOfFeatures ; }
org . junit . Assert . assertEquals ( ( - 1 ) , nof )
testZeroOne ( ) { java . lang . String numA = "0" ; java . lang . String numB = "1" ; java . lang . String res = "1" ; java . math . BigInteger aNumber = new java . math . BigInteger ( numA ) ; java . math . BigInteger bNumber = new java . math . BigInteger ( numB ) ; java . math . BigInteger result = aNumber . xor ( bNumber ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( object instanceof org . teavm . classlib . java . text . TParsePosition ) ) { return false ; } org . teavm . classlib . java . text . TParsePosition pos = ( ( org . teavm . classlib . java . text . TParsePosition ) ( object ) ) ; return ( ( currentPosition ) == ( pos . currentPosition ) ) && ( ( errorIndex ) == ( pos . errorIndex ) ) ; }
org . junit . Assert . assertTrue ( res . equals ( result . toString ( ) ) )
testSubtractMinute ( ) { java . lang . String str1 = "2015-02-23<sp>18:54:00" ; java . lang . String str2 = "2015-02-23<sp>18:55:22" ; int rs = com . opslab . util . DateUtil . subtractMinute ( str1 , str2 ) ; "<AssertPlaceHolder>" ; } subtractMinute ( java . lang . String , java . lang . String ) { int rs = 0 ; try { java . util . Date start = com . opslab . util . DateUtil . DateTimeInstance ( ) . parse ( date1 ) ; java . util . Date end = com . opslab . util . DateUtil . DateTimeInstance ( ) . parse ( date2 ) ; long cha = ( ( end . getTime ( ) ) - ( start . getTime ( ) ) ) / 1000 ; rs = ( ( int ) ( cha ) ) / 60 ; } catch ( java . text . ParseException e ) { e . printStackTrace ( ) ; } return rs ; }
org . junit . Assert . assertEquals ( "" , 1 , rs )
testStickyForceCheck ( ) { int count = testSticky ( null , true ) ; "<AssertPlaceHolder>" ; } testSticky ( java . lang . String , boolean ) { if ( methodName == null ) { url = url . addParameter ( Constants . CLUSTER_STICKY_KEY , java . lang . String . valueOf ( check ) ) ; } else { url = url . addParameter ( ( ( methodName + "." ) + ( com . alibaba . dubbo . common . Constants . CLUSTER_STICKY_KEY ) ) , java . lang . String . valueOf ( check ) ) ; } org . easymock . EasyMock . reset ( invoker1 ) ; org . easymock . EasyMock . expect ( invoker1 . invoke ( invocation ) ) . andReturn ( result ) . anyTimes ( ) ; org . easymock . EasyMock . expect ( invoker1 . isAvailable ( ) ) . andReturn ( true ) . anyTimes ( ) ; org . easymock . EasyMock . expect ( invoker1 . getUrl ( ) ) . andReturn ( url ) . anyTimes ( ) ; org . easymock . EasyMock . expect ( invoker1 . getInterface ( ) ) . andReturn ( com . alibaba . dubbo . rpc . cluster . StickyTest . class ) . anyTimes ( ) ; org . easymock . EasyMock . replay ( invoker1 ) ; org . easymock . EasyMock . reset ( invoker2 ) ; org . easymock . EasyMock . expect ( invoker2 . invoke ( invocation ) ) . andReturn ( result ) . anyTimes ( ) ; org . easymock . EasyMock . expect ( invoker2 . isAvailable ( ) ) . andReturn ( true ) . anyTimes ( ) ; org . easymock . EasyMock . expect ( invoker2 . getUrl ( ) ) . andReturn ( url ) . anyTimes ( ) ; org . easymock . EasyMock . expect ( invoker2 . getInterface ( ) ) . andReturn ( com . alibaba . dubbo . rpc . cluster . StickyTest . class ) . anyTimes ( ) ; org . easymock . EasyMock . replay ( invoker2 ) ; invocation . setMethodName ( methodName ) ; int count = 0 ; for ( int i = 0 ; i < ( runs ) ; i ++ ) { org . junit . Assert . assertEquals ( null , clusterinvoker . invoke ( invocation ) ) ; if ( ( invoker1 ) == ( clusterinvoker . getSelectedInvoker ( ) ) ) { count ++ ; } } return count ; }
org . junit . Assert . assertTrue ( ( ( count == 0 ) || ( count == ( runs ) ) ) )
testUnknownFrontendUrlWithNoMapping ( ) { java . util . Map < java . net . URI , java . net . URI > emptyMap = new java . util . HashMap ( ) ; when ( graphiteSources . getIpportsByUrl ( ) ) . thenReturn ( new java . util . HashMap ( ) ) ; when ( this . graphiteSources . getSources ( ) ) . thenReturn ( new java . util . ArrayList < com . vsct . supervision . notification . model . GraphiteSources . GraphiteSource > ( ) ) ; com . vsct . supervision . seyren . api . Alarm frontendAlarm = com . vsct . supervision . notification . TestUtils . getDefaultAlarm ( ) ; frontendAlarm . setGraphiteBaseUrl ( com . vsct . supervision . notification . model . AlarmMapperTest . OTHER_GRAPHITE_URL ) ; com . vsct . supervision . seyren . api . Alarm backendAlarm = alarmMapper . mapNewAlarmFormToSeyren ( frontendAlarm ) ; "<AssertPlaceHolder>" ; } getGraphiteBaseUrl ( ) { return graphiteBaseUrl ; }
org . junit . Assert . assertEquals ( com . vsct . supervision . notification . model . AlarmMapperTest . OTHER_GRAPHITE_URL , backendAlarm . getGraphiteBaseUrl ( ) )
test_RcDownloadOperation ( ) { com . hazelcast . simulator . coordinator . operations . RcDownloadOperation op = new com . hazelcast . simulator . coordinator . operations . RcDownloadOperation ( ) ; java . lang . String result = remote . execute ( op ) ; "<AssertPlaceHolder>" ; verify ( coordinator ) . download ( ) ; } execute ( java . lang . String ) { return new com . hazelcast . simulator . utils . BashCommand ( command ) . execute ( ) ; }
org . junit . Assert . assertNull ( result )
testClone ( ) { com . google . zxing . common . BitArray array = new com . google . zxing . common . BitArray ( 32 ) ; array . clone ( ) . set ( 0 ) ; "<AssertPlaceHolder>" ; } get ( int ) { return ( ( bits [ ( i / 32 ) ] ) & ( 1 << ( i & 31 ) ) ) != 0 ; }
org . junit . Assert . assertFalse ( array . get ( 0 ) )
whenLog2DoubleValues_shouldog2ThemAndReturnTheResultForFloorRounding ( ) { int result = com . google . common . math . DoubleMath . log2 ( 30 , RoundingMode . FLOOR ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 4 , result )
convertToAndFromBigInteger ( ) { final int nTests = 10000 ; final java . util . Random rg = new java . util . Random ( ) ; for ( int i = 0 ; i < nTests ; i ++ ) { byte [ ] randomBytes = new byte [ 16 ] ; rg . nextBytes ( randomBytes ) ; java . math . BigInteger randomBigInteger = new java . math . BigInteger ( 1 , randomBytes ) ; final com . googlecode . ipv6 . IPv6Address address = com . googlecode . ipv6 . IPv6Address . fromBigInteger ( randomBigInteger ) ; "<AssertPlaceHolder>" ; } } toBigInteger ( ) { return new java . math . BigInteger ( 1 , toByteArray ( ) ) ; }
org . junit . Assert . assertEquals ( randomBigInteger , address . toBigInteger ( ) )
testFetchByPrimaryKeyExisting ( ) { com . liferay . portal . workflow . kaleo . model . KaleoTaskForm newKaleoTaskForm = addKaleoTaskForm ( ) ; com . liferay . portal . workflow . kaleo . model . KaleoTaskForm existingKaleoTaskForm = _persistence . fetchByPrimaryKey ( newKaleoTaskForm . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingKaleoTaskForm , newKaleoTaskForm )
shouldReturnEmptyWantDigestForEmptyChecksums ( ) { java . util . Set < org . dcache . util . Checksum > checksums = java . util . Collections . emptySet ( ) ; java . util . Optional < java . lang . String > wantDigest = org . dcache . util . Checksums . asWantDigest ( checksums ) ; "<AssertPlaceHolder>" ; } isPresent ( ) { return _present ; }
org . junit . Assert . assertFalse ( wantDigest . isPresent ( ) )
testGetNullStatement ( ) { com . datastax . driver . core . PreparedStatement preparedStatement = statement . get ( ) ; org . mockito . Mockito . verify ( mock ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { com . datastax . driver . core . ResultSet resultSet = null ; try { resultSet = resultSetFuture . get ( ) ; } finally { com . ibm . profiler . cassandra . ProfilingUtilities . logMetric ( metric , resultSet ) ; } return resultSet ; }
org . junit . Assert . assertNull ( preparedStatement )
testNonExistingFileWithoutArguments ( ) { try { java . lang . String [ ] parameters = new java . lang . String [ ] { "/some/none/existing/path" } ; org . apache . commons . cli . CommandLine line = new org . apache . commons . cli . PosixParser ( ) . parse ( eu . stratosphere . client . CliFrontend . getProgramSpecificOptions ( new org . apache . commons . cli . Options ( ) ) , parameters , false ) ; eu . stratosphere . client . CliFrontend frontend = new eu . stratosphere . client . CliFrontend ( ) ; java . lang . Object result = frontend . buildProgram ( line ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { System . err . println ( e . getMessage ( ) ) ; e . printStackTrace ( ) ; org . junit . Assert . fail ( ( "Program<sp>caused<sp>an<sp>exception:<sp>" + ( e . getMessage ( ) ) ) ) ; } } buildProgram ( org . apache . commons . cli . CommandLine ) { java . lang . String [ ] programArgs = ( line . hasOption ( eu . stratosphere . client . CliFrontend . ARGS_OPTION . getOpt ( ) ) ) ? line . getOptionValues ( eu . stratosphere . client . CliFrontend . ARGS_OPTION . getOpt ( ) ) : line . getArgs ( ) ; java . lang . String jarFilePath = null ; if ( line . hasOption ( eu . stratosphere . client . CliFrontend . JAR_OPTION . getOpt ( ) ) ) { jarFilePath = line . getOptionValue ( eu . stratosphere . client . CliFrontend . JAR_OPTION . getOpt ( ) ) ; } else if ( ( programArgs . length ) > 0 ) { jarFilePath = programArgs [ 0 ] ; programArgs = java . util . Arrays . copyOfRange ( programArgs , 1 , programArgs . length ) ; } else { System . out . println ( "Error:<sp>Jar<sp>file<sp>is<sp>not<sp>set." ) ; return null ; } java . io . File jarFile = new java . io . File ( jarFilePath ) ; if ( ! ( jarFile . exists ( ) ) ) { System . out . println ( "Error:<sp>Jar<sp>file<sp>does<sp>not<sp>exist." ) ; return null ; } else if ( ! ( jarFile . isFile ( ) ) ) { System . out . println ( "Error:<sp>Jar<sp>file<sp>is<sp>not<sp>a<sp>file." ) ; return null ; } java . lang . String entryPointClass = ( line . hasOption ( eu . stratosphere . client . CliFrontend . CLASS_OPTION . getOpt ( ) ) ) ? line . getOptionValue ( eu . stratosphere . client . CliFrontend . CLASS_OPTION . getOpt ( ) ) : null ; try { return entryPointClass == null ? new eu . stratosphere . client . program . PackagedProgram ( jarFile , programArgs ) : new eu . stratosphere . client . program . PackagedProgram ( jarFile , entryPointClass , programArgs ) ; } catch ( eu . stratosphere . client . program . ProgramInvocationException e ) { handleError ( e ) ; return null ; } }
org . junit . Assert . assertTrue ( ( result == null ) )
isSubsetOf ( ) { org . eclipse . collections . api . set . sorted . ImmutableSortedSet < java . lang . Integer > set = this . classUnderTest ( ) ; "<AssertPlaceHolder>" ; } isSubsetOf ( org . eclipse . collections . api . set . SetIterable ) { synchronized ( this . getLock ( ) ) { return this . getMutableSet ( ) . isSubsetOf ( candidateSuperset ) ; } }
org . junit . Assert . assertTrue ( set . isSubsetOf ( set ) )
testNoCampaigns ( ) { java . io . InputStream is = com . xrtb . common . Configuration . getInputStream ( "SampleBids/nexage.txt" ) ; com . xrtb . pojo . BidRequest request = new com . xrtb . pojo . BidRequest ( is ) ; com . xrtb . bidder . AbortableCountDownLatch latch = new com . xrtb . bidder . AbortableCountDownLatch ( 1 , 1 ) ; java . util . concurrent . CountDownLatch flag = new java . util . concurrent . CountDownLatch ( 1 ) ; com . xrtb . bidder . CampaignProcessor proc = new com . xrtb . bidder . CampaignProcessor ( null , request , flag , latch ) ; flag . countDown ( ) ; proc . run ( ) ; com . xrtb . bidder . SelectedCreative resp = proc . getSelectedCreative ( ) ; try { latch . await ( ) ; org . junit . Assert . fail ( "This<sp>latch<sp>should<sp>have<sp>aborted" ) ; } catch ( java . lang . Exception e ) { } "<AssertPlaceHolder>" ; } await ( ) { super . await ( ) ; if ( aborted ) throw new com . xrtb . bidder . AbortableCountDownLatch . AbortedException ( ) ; }
org . junit . Assert . assertNull ( resp )
testParserWriter1 ( ) { org . matsim . core . config . Config config = org . matsim . core . config . ConfigUtils . createConfig ( ) ; org . matsim . examples . TriangleScenario . setUpScenarioConfig ( config ) ; org . matsim . api . core . v01 . Scenario scenario = org . matsim . core . scenario . ScenarioUtils . createScenario ( config ) ; org . matsim . facilities . ActivityFacilities facilities = scenario . getActivityFacilities ( ) ; new org . matsim . facilities . MatsimFacilitiesReader ( scenario ) . readFile ( config . facilities ( ) . getInputFile ( ) ) ; java . lang . String outputFilename = ( this . utils . getOutputDirectory ( ) ) + "output_facilities.xml" ; org . matsim . examples . TriangleScenario . writeFacilities ( facilities , outputFilename ) ; long checksum_ref = org . matsim . core . utils . misc . CRCChecksum . getCRCFromFile ( config . facilities ( ) . getInputFile ( ) ) ; long checksum_run = org . matsim . core . utils . misc . CRCChecksum . getCRCFromFile ( outputFilename ) ; "<AssertPlaceHolder>" ; } getCRCFromFile ( java . lang . String ) { org . matsim . core . utils . misc . CRCChecksum . log . info ( ( "filename=" + filename ) ) ; if ( new java . io . File ( filename ) . exists ( ) ) { org . matsim . core . utils . misc . CRCChecksum . log . info ( "file<sp>exists" ) ; if ( filename . endsWith ( ".gz" ) ) { org . matsim . core . utils . misc . CRCChecksum . log . info ( "file<sp>ends<sp>in<sp>gz" ) ; try ( java . io . InputStream in = new java . util . zip . GZIPInputStream ( new java . io . BufferedInputStream ( new java . io . FileInputStream ( filename ) ) ) ) { long result = org . matsim . core . utils . misc . CRCChecksum . getCRCFromStream ( in ) ; in . close ( ) ; return result ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } else { org . matsim . core . utils . misc . CRCChecksum . log . info ( "file<sp>does<sp>not<sp>end<sp>in<sp>gz" ) ; try ( java . io . InputStream in = new java . io . BufferedInputStream ( new java . io . FileInputStream ( filename ) ) ) { long result = org . matsim . core . utils . misc . CRCChecksum . getCRCFromStream ( in ) ; in . close ( ) ; return result ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } } else { org . matsim . core . utils . misc . CRCChecksum . log . info ( "file<sp>does<sp>not<sp>exist;<sp>search<sp>via<sp>class<sp>loader" ) ; if ( filename . endsWith ( ".gz" ) ) { org . matsim . core . utils . misc . CRCChecksum . log . info ( "file<sp>ends<sp>in<sp>gz" ) ; try ( java . io . InputStream stream = org . matsim . core . utils . misc . CRCChecksum . class . getClassLoader ( ) . getResourceAsStream ( filename ) ; java . io . InputStream in = new java . util . zip . GZIPInputStream ( new java . io . BufferedInputStream ( stream ) ) ) { long result = org . matsim . core . utils . misc . CRCChecksum . getCRCFromStream ( in ) ; in . close ( ) ; return result ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } else { org . matsim . core . utils . misc . CRCChecksum . log . info ( "file<sp>does<sp>not<sp>end<sp>in<sp>gz" ) ; try ( java . io . InputStream stream = org . matsim . core . utils . misc . CRCChecksum . class . getClassLoader ( ) . getResourceAsStream ( filename ) ; java . io . InputStream in = new java . io . BufferedInputStream ( stream ) ) { long result = org . matsim . core . utils . misc . CRCChecksum . getCRCFromStream ( in ) ; in . close ( ) ; return result ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } } }
org . junit . Assert . assertEquals ( checksum_ref , checksum_run )
parseVARIANCETest ( ) { java . lang . String operation = "VAR(COL(column1))" ; analyze . computing . ComputingParser parser = new analyze . computing . ComputingParser ( ) ; model . datafield . DataField actual = parser . parseOperation ( operation , userData ) ; model . datafield . DataField expected = new model . datafield . DataFieldDouble ( 13.0 ) ; "<AssertPlaceHolder>" ; } parseOperation ( java . lang . String , model . datafield . DataField ) { throw new analyze . labeling . LabelingException ( "Labeling<sp>on<sp>a<sp>single<sp>value<sp>is<sp>not<sp>possible" ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetInnerExpression5 ( ) { java . lang . String backText = "modify(m)<sp>{asdasdas==asdasd,<sp>asdasd" ; java . lang . String previous = "asdasd" ; "<AssertPlaceHolder>" ; } getInnerExpression ( java . lang . String ) { java . lang . String last = org . drools . eclipse . editors . completion . CompletionUtil . getLastExpression ( backText ) . trim ( ) ; char [ ] c = last . toCharArray ( ) ; int start = 0 ; for ( int i = ( c . length ) - 1 ; i >= 0 ; i -- ) { if ( ( ( ( ( ( ( ( ( ( ( ( ( java . lang . Character . isWhitespace ( c [ i ] ) ) || ( ( c [ i ] ) == '(' ) ) || ( ( c [ i ] ) == '+' ) ) || ( ( c [ i ] ) == ')' ) ) || ( ( c [ i ] ) == '[' ) ) || ( ( c [ i ] ) == ']' ) ) || ( ( c [ i ] ) == ':' ) ) || ( ( c [ i ] ) == '=' ) ) || ( ( c [ i ] ) == '<' ) ) || ( ( c [ i ] ) == '>' ) ) || ( ( c [ i ] ) == ',' ) ) || ( ( c [ i ] ) == '{' ) ) || ( ( c [ i ] ) == '}' ) ) { start = i + 1 ; break ; } } last = last . substring ( start ) ; return last ; }
org . junit . Assert . assertEquals ( previous , org . drools . eclipse . editors . completion . CompletionUtil . getInnerExpression ( backText ) )
givenMultimatchQuery_whenDoSearch_thenAllProvidedFieldsMatch ( ) { final org . springframework . data . elasticsearch . core . query . SearchQuery searchQuery = new org . springframework . data . elasticsearch . core . query . NativeSearchQueryBuilder ( ) . withQuery ( multiMatchQuery ( "tutorial" ) . field ( "title" ) . field ( "tags" ) . type ( MultiMatchQueryBuilder . Type . BEST_FIELDS ) ) . build ( ) ; final java . util . List < com . baeldung . spring . data . es . model . Article > articles = elasticsearchTemplate . queryForList ( searchQuery , com . baeldung . spring . data . es . model . Article . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , articles . size ( ) )
shouldReturnFalseWhenTT2DoseIsNotGiven ( ) { boolean didRuleSucceed = rule . apply ( new org . ei . drishti . util . SafeMap ( ) . put ( "ttDose" , "tt1" ) ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . String ) { data . put ( key , value ) ; return this ; }
org . junit . Assert . assertFalse ( didRuleSucceed )
deserializeArrayOfInt8 ( ) { com . facebook . buck . util . bser . BserDeserializer deserializer = new com . facebook . buck . util . bser . BserDeserializer ( BserDeserializer . KeyOrdering . UNSORTED ) ; java . util . List < java . lang . Object > deserialized = ( ( java . util . List < java . lang . Object > ) ( deserializer . deserializeBserValue ( com . facebook . buck . util . bser . BserDeserializerTest . getByteStream ( "000103090003030323034203F0" ) ) ) ) ; java . util . List < java . lang . Object > expected = com . google . common . collect . ImmutableList . of ( ( ( byte ) ( 35 ) ) , ( ( byte ) ( 66 ) ) , ( ( byte ) ( 240 ) ) ) ; "<AssertPlaceHolder>" ; } equalTo ( com . facebook . buck . query . QueryEnvironment$Argument ) { return ( ( ( type . equals ( other . type ) ) && ( ( integer ) == ( other . integer ) ) ) && ( java . util . Objects . equals ( expression , other . expression ) ) ) && ( java . util . Objects . equals ( word , other . word ) ) ; }
org . junit . Assert . assertThat ( deserialized , org . hamcrest . Matchers . equalTo ( expected ) )
testOngeldigeAangewezenObjectOfVoorkomen_GeenPartnerEntiteit ( ) { when ( bericht . getEntiteitVoorObjectSleutel ( nl . bzk . brp . bijhouding . bericht . model . BijhoudingPersoon . class , nl . bzk . brp . bijhouding . bericht . model . CorrectieVervalGeslachtsaanduidingGerelateerdeTest . PARTNER_OBJ_SLEUTEL ) ) . thenReturn ( null ) ; final nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . PersoonParameters persoonParams = new nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . PersoonParameters ( ) ; final nl . bzk . brp . bijhouding . bericht . model . GeslachtsaanduidingElement element = builder . maakGeslachtsaanduidingElementVoorVerval ( "ident" , "1234" ) ; persoonParams . geslachtsaanduiding ( element ) ; final nl . bzk . brp . bijhouding . bericht . model . CorrectieVervalGeslachtsaanduidingGerelateerde actie = maakBasisActie ( persoonParams ) ; "<AssertPlaceHolder>" ; } getOngeldigAangewezenObjectOfVoorkomen ( ) { nl . bzk . brp . bijhouding . bericht . model . BmrGroep result = null ; final nl . bzk . brp . bijhouding . bericht . model . BijhoudingPersoon persoon = getPartner ( ) . getPersoonEntiteit ( ) ; final java . lang . String voorkomenSleutel = getPartner ( ) . getGeboorte ( ) . getVoorkomenSleutel ( ) ; if ( ( persoon != null ) && ( voorkomenSleutel != null ) ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonGeboorteHistorie historie = persoon . zoekRelatieHistorieVoorVoorkomenSleutel ( voorkomenSleutel , nl . bzk . algemeenbrp . dal . domein . brp . entity . PersoonGeboorteHistorie . class ) ; if ( historie == null ) { result = getPartner ( ) . getGeboorte ( ) ; } } return result ; }
org . junit . Assert . assertNull ( actie . getOngeldigAangewezenObjectOfVoorkomen ( ) )
predecessorKeyIsCorrect ( ) { for ( java . util . Map < java . lang . Integer , java . lang . Integer > any : net . java . quickcheck . generator . CombinedGeneratorsIterables . someMaps ( net . java . quickcheck . generator . PrimitiveGenerators . integers ( ) , net . java . quickcheck . generator . PrimitiveGenerators . integers ( ) ) ) { com . google . firebase . database . collection . ImmutableSortedMap < java . lang . Integer , java . lang . Integer > map = com . google . firebase . database . collection . RBTreeSortedMap . fromMap ( any , com . google . firebase . database . collection . RBTreeSortedMapTest . IntComparator ) ; java . lang . Integer predecessorKey = null ; for ( Map . Entry < java . lang . Integer , java . lang . Integer > entry : map ) { "<AssertPlaceHolder>" ; predecessorKey = entry . getKey ( ) ; } } } getPredecessorKey ( K ) { int pos = findKey ( key ) ; if ( pos == ( - 1 ) ) { throw new java . lang . IllegalArgumentException ( "Can't<sp>find<sp>predecessor<sp>of<sp>nonexistent<sp>key" ) ; } else { return pos > 0 ? this . keys [ ( pos - 1 ) ] : null ; } }
org . junit . Assert . assertEquals ( predecessorKey , map . getPredecessorKey ( entry . getKey ( ) ) )
testNull ( ) { org . mapstruct . ap . test . nestedproperties . simple . _target . TargetObject targetObject = SimpleMapper . MAPPER . toTargetObject ( null ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( targetObject )
testInit ( ) { final org . kie . workbench . common . dmn . client . editors . types . persistence . ItemDefinitionRecordEngine expectedRecordEngine = mock ( org . kie . workbench . common . dmn . client . editors . types . persistence . ItemDefinitionRecordEngine . class ) ; handler . init ( expectedRecordEngine ) ; final org . kie . workbench . common . dmn . client . editors . types . persistence . ItemDefinitionRecordEngine actualRecordEngine = handler . getRecordEngine ( ) ; "<AssertPlaceHolder>" ; } getRecordEngine ( ) { return recordEngine ; }
org . junit . Assert . assertEquals ( expectedRecordEngine , actualRecordEngine )
testValidateInvalidFunctionWithTooFewArgumentsAndOperands ( ) { net . objecthunter . exp4j . Expression exp = new net . objecthunter . exp4j . ExpressionBuilder ( "beta(1<sp>+<sp>)" ) . functions ( beta ) . build ( ) ; net . objecthunter . exp4j . ValidationResult result = exp . validate ( false ) ; "<AssertPlaceHolder>" ; } isValid ( ) { return valid ; }
org . junit . Assert . assertFalse ( result . isValid ( ) )
should_find_by_pk ( ) { com . ctp . cdi . query . test . domain . Simple simple = createSimple ( "testFindByPk" ) ; com . ctp . cdi . query . test . domain . Simple find = dao . findBy ( simple . getId ( ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( simple . getName ( ) , find . getName ( ) )
testCompareVersions ( ) { org . apache . maven . artifact . versioning . DefaultArtifactVersion newer = new org . apache . maven . artifact . versioning . DefaultArtifactVersion ( "0.25.0-alpha" ) ; org . apache . maven . artifact . versioning . DefaultArtifactVersion older = new org . apache . maven . artifact . versioning . DefaultArtifactVersion ( "0.8.0" ) ; "<AssertPlaceHolder>" ; } compareTo ( com . google . cloud . tools . eclipse . appengine . libraries . model . LibraryFile ) { return this . mavenCoordinates . toStringCoordinates ( ) . compareTo ( other . mavenCoordinates . toStringCoordinates ( ) ) ; }
org . junit . Assert . assertTrue ( ( ( newer . compareTo ( older ) ) > 0 ) )
testSetSeedDistribution ( ) { org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 123 ) ; org . deeplearning4j . nn . api . Layer model = org . deeplearning4j . nn . conf . NeuralNetConfigurationTest . getLayer ( trainingSet . numInputs ( ) , trainingSet . numOutcomes ( ) , new org . deeplearning4j . nn . conf . WeightInitDistribution ( new org . deeplearning4j . nn . conf . distribution . NormalDistribution ( 1 , 1 ) ) , true ) ; org . nd4j . linalg . api . ndarray . INDArray modelWeights = model . getParam ( DefaultParamInitializer . WEIGHT_KEY ) ; org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 123 ) ; org . deeplearning4j . nn . api . Layer model2 = org . deeplearning4j . nn . conf . NeuralNetConfigurationTest . getLayer ( trainingSet . numInputs ( ) , trainingSet . numOutcomes ( ) , new org . deeplearning4j . nn . conf . WeightInitDistribution ( new org . deeplearning4j . nn . conf . distribution . NormalDistribution ( 1 , 1 ) ) , true ) ; org . nd4j . linalg . api . ndarray . INDArray modelWeights2 = model2 . getParam ( DefaultParamInitializer . WEIGHT_KEY ) ; "<AssertPlaceHolder>" ; } getParam ( java . lang . String ) { int idx = param . indexOf ( '_' ) ; if ( idx == ( - 1 ) ) throw new java . lang . IllegalStateException ( ( ( "Invalid<sp>param<sp>key:<sp>does<sp>not<sp>have<sp>layer<sp>separator:<sp>\"" + param ) + "\"" ) ) ; int layerIdx = java . lang . Integer . parseInt ( param . substring ( 0 , idx ) ) ; java . lang . String newKey = param . substring ( ( idx + 1 ) ) ; return layers [ layerIdx ] . getParam ( newKey ) ; }
org . junit . Assert . assertEquals ( modelWeights , modelWeights2 )
ReplaceGroupbyIndexTest ( ) { org . verdictdb . sqlreader . RelationStandardizer . resetItemID ( ) ; java . lang . String sql = "select<sp>ps_partkey<sp>as<sp>g,<sp>ps_supplycost<sp>as<sp>g2,<sp>count(*)<sp>as<sp>c\n" + ( "from<sp>partsupp\n" + "group<sp>by<sp>1,<sp>2" ) ; org . verdictdb . sqlreader . NonValidatingSQLParser sqlToRelation = new org . verdictdb . sqlreader . NonValidatingSQLParser ( ) ; org . verdictdb . core . sqlobject . AbstractRelation relation = sqlToRelation . toRelation ( sql ) ; org . verdictdb . sqlreader . RelationStandardizer gen = new org . verdictdb . sqlreader . RelationStandardizer ( meta ) ; relation = gen . standardize ( ( ( org . verdictdb . core . sqlobject . SelectQuery ) ( relation ) ) ) ; org . verdictdb . sqlwriter . SelectQueryToSql selectQueryToSql = new org . verdictdb . sqlwriter . SelectQueryToSql ( new org . verdictdb . sqlsyntax . MysqlSyntax ( ) ) ; java . lang . String actual = selectQueryToSql . toSql ( relation ) ; java . lang . String expected = "select<sp>" + ( ( ( ( "vt1.`ps_partkey`<sp>as<sp>`g`,<sp>" + "vt1.`ps_supplycost`<sp>as<sp>`g2`,<sp>" ) + "count(*)<sp>as<sp>`c`<sp>" ) + "from<sp>`tpch`.`partsupp`<sp>as<sp>vt1<sp>" ) + "group<sp>by<sp>vt1.`ps_partkey`,<sp>vt1.`ps_supplycost`" ) ; "<AssertPlaceHolder>" ; } toSql ( org . verdictdb . core . sqlobject . InsertValuesQuery ) { java . lang . StringBuilder sql = new java . lang . StringBuilder ( ) ; java . lang . String schemaName = query . getSchemaName ( ) ; java . lang . String tableName = query . getTableName ( ) ; java . util . List < java . lang . Object > values = query . getValues ( ) ; sql . append ( "insert<sp>into<sp>" ) ; sql . append ( quoteName ( schemaName ) ) ; sql . append ( "." ) ; sql . append ( quoteName ( tableName ) ) ; sql . append ( "<sp>values<sp>(" ) ; boolean isFirst = true ; for ( java . lang . Object v : values ) { if ( isFirst == false ) { sql . append ( ",<sp>" ) ; } if ( v instanceof org . verdictdb . commons . VerdictTimestamp ) { if ( ( syntax ) instanceof org . verdictdb . sqlsyntax . PrestoSyntax ) { sql . append ( ( ( "timestamp<sp>'" + ( v . toString ( ) ) ) + "'" ) ) ; } else { sql . append ( ( ( "'" + ( v . toString ( ) ) ) + "'" ) ) ; } } else if ( v instanceof java . lang . String ) { sql . append ( ( ( "'" + v ) + "'" ) ) ; } else { sql . append ( v . toString ( ) ) ; } isFirst = false ; } sql . append ( ")" ) ; return sql . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testRejectedOnOffAttributeTurnedOff ( ) { org . jboss . dmr . ModelNode model = new org . jboss . dmr . ModelNode ( ) ; model . get ( "monitoring" ) . set ( "off" ) ; java . util . List < java . lang . String > result = org . jboss . as . jacorb . TransformUtils . validateDeprecatedProperites ( model ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return deque . get ( ) . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( result . isEmpty ( ) )
testCanInitListened ( ) { java . net . ServerSocket ss = new java . net . ServerSocket ( 0 ) ; int port = ss . getLocalPort ( ) ; new mockit . Expectations ( org . apache . servicecomb . transport . rest . servlet . ServletConfig . class ) { { org . apache . servicecomb . transport . rest . servlet . ServletConfig . getLocalServerAddress ( ) ; result = "0.0.0.0:" + port ; } } ; org . apache . servicecomb . transport . rest . servlet . ServletRestTransport transport = new org . apache . servicecomb . transport . rest . servlet . ServletRestTransport ( ) ; "<AssertPlaceHolder>" ; ss . close ( ) ; } canInit ( ) { java . lang . String listenAddress = org . apache . servicecomb . transport . rest . servlet . ServletConfig . getLocalServerAddress ( ) ; if ( listenAddress == null ) { return true ; } if ( ! ( org . apache . servicecomb . transport . rest . servlet . ServletUtils . canPublishEndpoint ( listenAddress ) ) ) { org . apache . servicecomb . transport . rest . servlet . ServletRestTransport . LOGGER . info ( "ignore<sp>transport<sp>{}." , this . getClass ( ) . getName ( ) ) ; return false ; } return true ; }
org . junit . Assert . assertTrue ( transport . canInit ( ) )
setAsText_shouldSetUsingUuid ( ) { org . openmrs . propertyeditor . PrivilegeEditor editor = new org . openmrs . propertyeditor . PrivilegeEditor ( ) ; editor . setAsText ( "d979d066-15e6-467c-9d4b-cb575ef97f0f" ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertNotNull ( editor . getValue ( ) )
testAlignedResidues1 ( ) { java . lang . String result = org . biojava . nbio . structure . align . multiple . util . MultipleAlignmentWriter . toAlignedResidues ( alignment1 ) ; java . io . FileReader file = new java . io . FileReader ( "src/test/resources/testMSTA1_alnres.tsv" ) ; java . io . BufferedReader reader = new java . io . BufferedReader ( file ) ; java . lang . String line = null ; java . lang . StringBuilder stringBuilder = new java . lang . StringBuilder ( ) ; while ( ( line = reader . readLine ( ) ) != null ) { stringBuilder . append ( line ) ; stringBuilder . append ( "\n" ) ; } reader . close ( ) ; java . lang . String expected = stringBuilder . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( "Cytoband<sp>[chromosome=" + ( chromosome ) ) + ",<sp>start=" ) + ( start ) ) + ",<sp>end=" ) + ( end ) ) + ",<sp>locus=" ) + ( locus ) ) + ",<sp>type=" ) + ( type ) ) + "]" ; }
org . junit . Assert . assertEquals ( expected , result )
testConstruct_nullServiceUrl_assertIllegalArgumentException ( ) { org . apache . http . client . HttpClient client = mock ( org . apache . http . client . HttpClient . class ) ; boolean exceptionOccured = false ; try { new org . nhindirect . common . rest . MockService ( null , client ) ; } catch ( java . lang . IllegalArgumentException e ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( exceptionOccured )
entIsCompliantIfSocketsNotSetOnEntPool ( ) { org . candlepin . model . Consumer c = mockConsumer ( PRODUCT_1 ) ; c . setFact ( "cpu.cpu_socket(s)" , "2" ) ; org . candlepin . model . Entitlement ent = mockEntitlement ( c , PRODUCT_1 ) ; org . candlepin . model . CandlepinQuery cqmock = mock ( org . candlepin . model . CandlepinQuery . class ) ; when ( cqmock . list ( ) ) . thenReturn ( java . util . Arrays . asList ( ent ) ) ; when ( entCurator . listByConsumerAndDate ( eq ( c ) , any ( java . util . Date . class ) ) ) . thenReturn ( cqmock ) ; "<AssertPlaceHolder>" ; } isEntitlementCompliant ( org . candlepin . model . Consumer , org . candlepin . model . Entitlement , java . util . Date ) { java . util . List < org . candlepin . model . Entitlement > ents = entCurator . listByConsumerAndDate ( consumer , onDate ) . list ( ) ; java . util . stream . Stream < org . candlepin . dto . rules . v1 . EntitlementDTO > entStream = ( ents == null ) ? java . util . stream . Stream . empty ( ) : ents . stream ( ) . map ( this . translator . getStreamMapper ( org . candlepin . model . Entitlement . class , org . candlepin . dto . rules . v1 . EntitlementDTO . class ) ) ; java . util . stream . Stream < org . candlepin . dto . rules . v1 . GuestIdDTO > guestIdStream = ( ( consumer . getGuestIds ( ) ) == null ) ? java . util . stream . Stream . empty ( ) : consumer . getGuestIds ( ) . stream ( ) . map ( this . translator . getStreamMapper ( org . candlepin . model . GuestId . class , org . candlepin . dto . rules . v1 . GuestIdDTO . class ) ) ; org . candlepin . policy . js . JsonJsContext args = new org . candlepin . policy . js . JsonJsContext ( mapper ) ; args . put ( "consumer" , this . translator . translate ( consumer , org . candlepin . dto . rules . v1 . ConsumerDTO . class ) ) ; args . put ( "entitlement" , this . translator . translate ( ent , org . candlepin . dto . rules . v1 . EntitlementDTO . class ) ) ; args . put ( "entitlements" , entStream ) ; args . put ( "log" , org . candlepin . policy . js . compliance . ComplianceRules . log , false ) ; args . put ( "guestIds" , guestIdStream ) ; return jsRules . runJsFunction ( org . candlepin . policy . js . compliance . Boolean . class , "is_ent_compliant" , args ) ; }
org . junit . Assert . assertTrue ( compliance . isEntitlementCompliant ( c , ent , new java . util . Date ( ) ) )
stressInstantiationWithClose ( ) { org . neo4j . kernel . impl . index . schema . SpatialIndexCacheTest . StringFactory factory = new org . neo4j . kernel . impl . index . schema . SpatialIndexCacheTest . StringFactory ( ) ; org . neo4j . kernel . impl . index . schema . SpatialIndexCache < java . lang . String > cache = new org . neo4j . kernel . impl . index . schema . SpatialIndexCache ( factory ) ; org . neo4j . test . Race race = new org . neo4j . test . Race ( ) . withRandomStartDelays ( ) ; org . apache . commons . lang3 . mutable . MutableInt instantiatedAtClose = new org . apache . commons . lang3 . mutable . MutableInt ( ) ; race . addContestant ( ( ) -> { try { cache . uncheckedSelect ( CoordinateReferenceSystem . WGS84 ) ; cache . uncheckedSelect ( CoordinateReferenceSystem . Cartesian_3D ) ; } catch ( e ) { } } , 1 ) ; race . addContestant ( ( ) -> { cache . closeInstantiateCloseLock ( ) ; instantiatedAtClose . setValue ( count ( cache ) ) ; } , 1 ) ; race . go ( ) ; try { cache . uncheckedSelect ( CoordinateReferenceSystem . Cartesian ) ; org . junit . Assert . fail ( "No<sp>instantiation<sp>after<sp>closed" ) ; } catch ( java . lang . IllegalStateException e ) { } "<AssertPlaceHolder>" ; } intValue ( ) { return type ; }
org . junit . Assert . assertEquals ( instantiatedAtClose . intValue ( ) , count ( cache ) )
getRootCauseMidCycleTest ( ) { java . lang . Exception rootCause = new org . threadly . util . SuppressedStackRuntimeException ( ) ; java . lang . Exception e = new org . threadly . util . SuppressedStackRuntimeException ( org . threadly . util . ExceptionUtilsTest . makeCycle ( rootCause ) ) ; "<AssertPlaceHolder>" ; } getRootCause ( java . lang . Throwable ) { org . threadly . util . ArgumentVerifier . assertNotNull ( throwable , "throwable" ) ; java . lang . Throwable result = throwable ; java . lang . Throwable cause ; int depth = 0 ; while ( ( cause = result . getCause ( ) ) != null ) { result = cause ; if ( ( ++ depth ) > ( org . threadly . util . ExceptionUtils . CAUSE_CYCLE_DEPTH_TRIGGER ) ) { java . util . ArrayList < java . lang . Throwable > causeChain = org . threadly . util . ExceptionUtils . unwrapThrowableCycleAwareCauseChain ( throwable ) ; return causeChain . get ( ( ( causeChain . size ( ) ) - 1 ) ) ; } } return result ; }
org . junit . Assert . assertTrue ( ( ( org . threadly . util . ExceptionUtils . getRootCause ( e ) ) == rootCause ) )
testCountMaxValue ( ) { long count = com . annimon . stream . Stream . range ( ( ( Long . MAX_VALUE ) - 100 ) , Long . MAX_VALUE ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { long count = 0 ; while ( iterator . hasNext ( ) ) { iterator . nextLong ( ) ; count ++ ; } return count ; }
org . junit . Assert . assertEquals ( 100 , count )
testRecursive ( ) { com . gargoylesoftware . htmlunit . html . HtmlSubmitInput button = ( ( com . gargoylesoftware . htmlunit . html . HtmlSubmitInput ) ( page . getElementById ( "button" ) ) ) ; page = button . click ( ) ; text = page . asText ( ) ; first = text . indexOf ( "Dynamically" ) ; next = text . indexOf ( "Dynamically" , ( first + ( "Dynamically" . length ( ) ) ) ) ; "<AssertPlaceHolder>" ; } indexOf ( java . lang . String , java . lang . String ) { if ( name == null ) { name = "" ; } if ( searchString == null ) { searchString = "" ; } return name . indexOf ( searchString ) ; }
org . junit . Assert . assertTrue ( ( first < next ) )
testReplaceSubsetThenFetch ( ) { org . antlr . v4 . tool . LexerGrammar g = new org . antlr . v4 . tool . LexerGrammar ( ( "lexer<sp>grammar<sp>T;\n" + ( ( "A<sp>:<sp>\'a\';\n" + "B<sp>:<sp>\'b\';\n" ) + "C<sp>:<sp>\'c\';\n" ) ) ) ; java . lang . String input = "abcccba" ; org . antlr . v4 . runtime . LexerInterpreter lexEngine = g . createLexerInterpreter ( new org . antlr . v4 . runtime . ANTLRInputStream ( input ) ) ; org . antlr . v4 . runtime . CommonTokenStream stream = new org . antlr . v4 . runtime . CommonTokenStream ( lexEngine ) ; stream . fill ( ) ; org . antlr . v4 . runtime . TokenStreamRewriter tokens = new org . antlr . v4 . runtime . TokenStreamRewriter ( stream ) ; tokens . replace ( 2 , 4 , "xyz" ) ; java . lang . String result = tokens . getText ( org . antlr . v4 . runtime . misc . Interval . of ( 0 , 6 ) ) ; java . lang . String expecting = "abxyzba" ; "<AssertPlaceHolder>" ; } of ( int , int ) { if ( ( ( a != b ) || ( a < 0 ) ) || ( a > ( org . antlr . v4 . runtime . misc . Interval . INTERVAL_POOL_MAX_VALUE ) ) ) { return new org . antlr . v4 . runtime . misc . Interval ( a , b ) ; } if ( ( org . antlr . v4 . runtime . misc . Interval . cache [ a ] ) == null ) { org . antlr . v4 . runtime . misc . Interval . cache [ a ] = new org . antlr . v4 . runtime . misc . Interval ( a , a ) ; } return org . antlr . v4 . runtime . misc . Interval . cache [ a ] ; }
org . junit . Assert . assertEquals ( expecting , result )
addressNullTest ( ) { org . marc . everest . datatypes . generic . SET < org . marc . everest . datatypes . AD > addrSet = org . oscarehr . e2e . model . export . header . RecordTargetModelTest . nullRecordTargetModel . getAddresses ( ) ; "<AssertPlaceHolder>" ; } getAddresses ( ) { return addresses ; }
org . junit . Assert . assertNull ( addrSet )
testGetWidget ( ) { com . agiletec . aps . system . services . user . UserDetails user = new org . entando . entando . web . utils . OAuth2TestUtils . UserBuilder ( "jack_bauer" , "0x24" ) . grantedToRoleAdmin ( ) . build ( ) ; java . lang . String accessToken = mockOAuthInterceptor ( user ) ; org . springframework . test . web . servlet . ResultActions result = mockMvc . perform ( get ( "/widgets/1" ) . header ( "Authorization" , ( "Bearer<sp>" + accessToken ) ) ) ; java . lang . String response = result . andReturn ( ) . getResponse ( ) . getContentAsString ( ) ; "<AssertPlaceHolder>" ; } getResponse ( ) { return _response ; }
org . junit . Assert . assertNotNull ( response )
test_monthsBetween ( java . time . LocalDate , java . time . LocalDate , long ) { "<AssertPlaceHolder>" ; } between ( java . time . temporal . Temporal , java . time . temporal . Temporal ) { if ( ( temporal1Inclusive . getClass ( ) ) != ( temporal2Exclusive . getClass ( ) ) ) { return temporal1Inclusive . until ( temporal2Exclusive , this ) ; } switch ( this ) { case WEEK_BASED_YEARS : return java . lang . Math . subtractExact ( temporal2Exclusive . getLong ( java . time . temporal . IsoFields . WEEK_BASED_YEAR ) , temporal1Inclusive . getLong ( java . time . temporal . IsoFields . WEEK_BASED_YEAR ) ) ; case QUARTER_YEARS : return ( temporal1Inclusive . until ( temporal2Exclusive , java . time . temporal . ChronoUnit . MONTHS ) ) / 3 ; default : throw new java . lang . IllegalStateException ( "Unreachable" ) ; } }
org . junit . Assert . assertEquals ( test . java . time . temporal . MONTHS . between ( start , end ) , expected )
testByteValue ( ) { final byte [ ] klvBytes = new byte [ ] { - 8 , 1 , - 128 } ; final org . codice . ddf . libs . klv . data . numerical . KlvByte klvByte = new org . codice . ddf . libs . klv . data . numerical . KlvByte ( new byte [ ] { - 8 } , "test" ) ; final org . codice . ddf . libs . klv . KlvContext decodedKlvContext = decodeKLV ( KeyLength . OneByte , LengthEncoding . OneByte , klvByte , klvBytes ) ; final byte value = ( ( org . codice . ddf . libs . klv . data . numerical . KlvByte ) ( decodedKlvContext . getDataElementByName ( "test" ) ) ) . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return null ; }
org . junit . Assert . assertThat ( value , org . hamcrest . CoreMatchers . is ( ( ( byte ) ( - 128 ) ) ) )
test_wstring_stream ( ) { java . lang . String testValue = "hello<sp>world" ; org . omg . CORBA . Any any = setup . getClientOrb ( ) . create_any ( ) ; any . type ( setup . getClientOrb ( ) . get_primitive_tc ( TCKind . tk_wstring ) ) ; any . create_output_stream ( ) . write_wstring ( testValue ) ; java . lang . String outValue = any . extract_wstring ( ) ; "<AssertPlaceHolder>" ; } extract_wstring ( ) { checkExtract ( TCKind . _tk_wstring , "Cannot<sp>extract<sp>wstring" ) ; checkNull ( ) ; if ( ( value ) instanceof java . lang . String ) { return ( ( java . lang . String ) ( value ) ) ; } else if ( ( value ) instanceof org . omg . CORBA . StringHolder ) { return ( ( org . omg . CORBA . StringHolder ) ( value ) ) . value ; } else if ( ( value ) instanceof org . jacorb . orb . CDROutputStream ) { return create_input_stream ( ) . read_wstring ( ) ; } else { throw new org . omg . CORBA . INTERNAL ( ( "Encountered<sp>unexpected<sp>type<sp>of<sp>value:<sp>" + ( value . getClass ( ) ) ) ) ; } }
org . junit . Assert . assertEquals ( testValue , outValue )
testChainWithSystemMissingId ( ) { system . remove ( org . sagebionetworks . aws . AbstractSynapseCredentialProvider . ORG_SAGEBIONETWORKS_STACK_IAM_ID ) ; when ( mockPropertyProvider . getMavenSettingsProperties ( ) ) . thenReturn ( null ) ; when ( mockPropertyProvider . getSystemProperties ( ) ) . thenReturn ( system ) ; org . sagebionetworks . aws . SynapseCredentialProviderChain chain = createChain ( ) ; com . amazonaws . auth . AWSCredentials creds = chain . getCredentials ( ) ; "<AssertPlaceHolder>" ; verify ( mockDefaultProvider , times ( 1 ) ) . getCredentials ( ) ; } getCredentials ( ) { try { java . util . Properties properties = getProperties ( ) ; if ( properties != null ) { java . lang . String accessKey = com . amazonaws . util . StringUtils . trim ( properties . getProperty ( org . sagebionetworks . aws . AbstractSynapseCredentialProvider . ORG_SAGEBIONETWORKS_STACK_IAM_ID ) ) ; java . lang . String secretKey = com . amazonaws . util . StringUtils . trim ( properties . getProperty ( org . sagebionetworks . aws . AbstractSynapseCredentialProvider . ORG_SAGEBIONETWORKS_STACK_IAM_KEY ) ) ; if ( ( accessKey != null ) && ( secretKey != null ) ) { return new com . amazonaws . auth . BasicAWSCredentials ( accessKey , secretKey ) ; } } throw new java . lang . IllegalStateException ( org . sagebionetworks . aws . AbstractSynapseCredentialProvider . AWS_CREDENTIALS_WERE_NOT_FOUND ) ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } }
org . junit . Assert . assertNotNull ( creds )
UmlLinkType_Implements ( ) { java . lang . String fromClass = "Domain.Direct.Violating.InheritanceImplementsInterface" ; java . lang . String toClass = "Technology.Direct.Dao.IMapDAO" ; java . lang . String fromAttribute = "" ; boolean isComposite = false ; java . lang . String typeToFind = "Implements" ; "<AssertPlaceHolder>" ; } isUmlLinkDetected ( java . lang . String , java . lang . String , java . lang . String , boolean , java . lang . String ) { boolean umlLinkDetected = false ; husaccttest . analyse . CSharp_AccuracyTestDependencyDetection . analyseService = husacct . ServiceProvider . getInstance ( ) . getAnalyseService ( ) ; husacct . common . dto . UmlLinkDTO [ ] umlLinkDTOs = husaccttest . analyse . CSharp_AccuracyTestDependencyDetection . analyseService . getUmlLinksFromClassToToClass ( classFrom , classTo ) ; for ( husacct . common . dto . UmlLinkDTO linkDTO : umlLinkDTOs ) { if ( ( ( ( ( linkDTO . from . equals ( classFrom ) ) && ( linkDTO . to . equals ( classTo ) ) ) && ( linkDTO . attributeFrom . equals ( attributeFrom ) ) ) && ( ( linkDTO . isComposite ) == isComposite ) ) && ( linkDTO . type . equals ( linkType ) ) ) { umlLinkDetected = true ; } } return umlLinkDetected ; }
org . junit . Assert . assertTrue ( isUmlLinkDetected ( fromClass , toClass , fromAttribute , isComposite , typeToFind ) )
should_return_this ( ) { org . fest . assertions . api . IntegerAssert returned = assertions . isNotEqualTo ( expected ) ; "<AssertPlaceHolder>" ; } isNotEqualTo ( byte ) { bytes . assertNotEqualTo ( description , actual , expected ) ; return this ; }
org . junit . Assert . assertSame ( assertions , returned )
testRequestTooLong ( ) { com . mozilla . bagheera . http . ContentLengthFilter filter = new com . mozilla . bagheera . http . ContentLengthFilter ( 1 ) ; byte [ ] contentBytes = new java . lang . String ( "foo" ) . getBytes ( ) ; boolean success = false ; try { filter . messageReceived ( ctx , createMockEvent ( ctx . getChannel ( ) , com . mozilla . bagheera . http . HTTP_1_1 , com . mozilla . bagheera . http . POST , "/" , contentBytes ) ) ; } catch ( org . jboss . netty . handler . codec . frame . TooLongFrameException e ) { success = true ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } "<AssertPlaceHolder>" ; } getChannel ( ) { return channel ; }
org . junit . Assert . assertTrue ( success )
testDisplayProperty ( ) { java . util . Locale definedNameLocale = new java . util . Locale ( "en" , "US" ) ; org . openmrs . Concept concept = new org . openmrs . Concept ( ) ; org . openmrs . ConceptName fullySpecifiedName = new org . openmrs . ConceptName ( "some<sp>name" , definedNameLocale ) ; fullySpecifiedName . setConceptNameId ( 1 ) ; fullySpecifiedName . setConceptNameType ( ConceptNameType . FULLY_SPECIFIED ) ; fullySpecifiedName . setLocalePreferred ( false ) ; concept . addName ( fullySpecifiedName ) ; org . openmrs . CodedOrFreeText codedOrFreeText = new org . openmrs . CodedOrFreeText ( concept , fullySpecifiedName , "" ) ; org . openmrs . ConditionClinicalStatus clinicalStatus = org . openmrs . ConditionClinicalStatus . ACTIVE ; org . openmrs . ConditionVerificationStatus verificationStatus = org . openmrs . ConditionVerificationStatus . CONFIRMED ; org . openmrs . Patient patient = new org . openmrs . Patient ( 2 ) ; java . util . Date onsetDate = new java . util . Date ( ) ; java . lang . String additionalDetail = "additionalDetail" ; int conditionId = 20 ; org . openmrs . Condition condition = new org . openmrs . Condition ( ) ; condition . setConditionId ( conditionId ) ; condition . setCondition ( codedOrFreeText ) ; condition . setClinicalStatus ( clinicalStatus ) ; condition . setVerificationStatus ( verificationStatus ) ; condition . setAdditionalDetail ( additionalDetail ) ; condition . setOnsetDate ( onsetDate ) ; condition . setPatient ( patient ) ; org . openmrs . module . webservices . rest . web . v1_0 . resource . openmrs2_2 . ConditionResource2_2 resource = new org . openmrs . module . webservices . rest . web . v1_0 . resource . openmrs2_2 . ConditionResource2_2 ( ) ; java . lang . String result = resource . getDisplayString ( condition ) ; "<AssertPlaceHolder>" ; } getDisplayString ( org . openmrs . ConceptSearchResult ) { org . openmrs . ConceptName cn = csr . getConcept ( ) . getName ( ) ; return cn == null ? null : cn . getName ( ) ; }
org . junit . Assert . assertEquals ( "some<sp>name" , result )
messageBodyWriterProviderReferenceTest ( ) { _consumerService . operation ( org . switchyard . component . resteasy . context . RESTEasyContextParamsTest . OP_CREATE_WITH_OWN_MEDIA_TYPE ) . sendInOut ( org . switchyard . component . resteasy . context . RESTEasyContextParamsTest . PAYLOAD ) ; "<AssertPlaceHolder>" ; } isInvoked ( ) { return org . switchyard . component . resteasy . context . SyTxtMessageBodyRW . invoked ; }
org . junit . Assert . assertTrue ( org . switchyard . component . resteasy . context . SyTxtMessageBodyRW . isInvoked ( ) )
getCountOfPatients_shouldCountPatientsByIdentifier_SignatureNo2 ( ) { long patientCount = dao . getCountOfPatients ( "42-42-42" ) ; "<AssertPlaceHolder>" ; } getCountOfPatients ( java . lang . String ) { return getCountOfPatients ( query , false ) ; }
org . junit . Assert . assertEquals ( 1 , patientCount )
testUpdateAnnotationsFromValuesEmptyScheam ( ) { org . sagebionetworks . repo . model . Annotations annos = new org . sagebionetworks . repo . model . Annotations ( ) ; java . util . Map < java . lang . String , java . lang . String > values = new java . util . HashMap ( ) ; boolean updated = org . sagebionetworks . repo . manager . table . TableViewManagerImpl . updateAnnotationsFromValues ( annos , new java . util . LinkedList < org . sagebionetworks . repo . model . table . ColumnModel > ( ) , values ) ; "<AssertPlaceHolder>" ; } updateAnnotationsFromValues ( org . sagebionetworks . repo . model . Annotations , java . util . List , java . util . Map ) { boolean updated = false ; for ( org . sagebionetworks . repo . model . table . ColumnModel column : tableSchema ) { org . sagebionetworks . repo . model . table . EntityField matchedField = org . sagebionetworks . repo . model . table . EntityField . findMatch ( column ) ; if ( matchedField == null ) { if ( values . containsKey ( column . getId ( ) ) ) { updated = true ; org . sagebionetworks . repo . model . table . AnnotationType type = org . sagebionetworks . table . cluster . SQLUtils . translateColumnTypeToAnnotationType ( column . getColumnType ( ) ) ; java . lang . String value = values . get ( column . getId ( ) ) ; additional . deleteAnnotation ( column . getName ( ) ) ; if ( value != null ) { java . lang . Object objectValue = type . parseValue ( value ) ; additional . replaceAnnotation ( column . getName ( ) , objectValue ) ; } } } } return updated ; }
org . junit . Assert . assertFalse ( updated )
drop_last_element_java ( ) { java . lang . String [ ] lastElementRemoved = new java . lang . String [ ] { "one" , "two" , "three" } ; java . lang . String [ ] removedElement = java . util . Arrays . copyOf ( lastElementRemoved , 2 ) ; com . levelup . java . array . RemoveLastElementInArray . logger . info ( java . util . Arrays . toString ( removedElement ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 2 , removedElement . length )
testThresholdCrossedAscendingWithStep ( ) { org . rioproject . impl . watch . BoundedThresholdManager thresholdManager = new org . rioproject . impl . watch . BoundedThresholdManager ( "foo" ) ; org . rioproject . watch . ThresholdValues thresholdValues = new org . rioproject . watch . ThresholdValues ( 0 , 5 , 2 ) ; thresholdManager . setThresholdValues ( thresholdValues ) ; org . rioproject . impl . watch . BoundedThresholdManagerTest . MyThresholdListener listener = new org . rioproject . impl . watch . BoundedThresholdManagerTest . MyThresholdListener ( ) ; thresholdManager . addThresholdListener ( listener ) ; for ( org . rioproject . watch . Calculable calculable : makeCalculables ( 20 ) ) { thresholdManager . checkThreshold ( calculable ) ; } for ( Map . Entry < java . lang . Integer , org . rioproject . watch . Calculable > entry : listener . breached . entrySet ( ) ) { System . out . println ( entry . getValue ( ) . getValue ( ) ) ; } "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( 7 , listener . breached . size ( ) )
shouldPurgeAConceptDescription ( ) { int before = service . getConceptByUuid ( conceptUuid ) . getDescriptions ( ) . size ( ) ; handle ( newDeleteRequest ( ( ( ( getURI ( ) ) + "/" ) + ( getUuid ( ) ) ) , new org . openmrs . module . webservices . rest . web . v1_0 . controller . openmrs1_9 . Parameter ( "purge" , "" ) ) ) ; int after = service . getConceptByUuid ( conceptUuid ) . getDescriptions ( ) . size ( ) ; "<AssertPlaceHolder>" ; } getUuid ( ) { return org . openmrs . module . webservices . rest . web . RestTestConstants1_10 . ORDER_FREQUENCY_UUID ; }
org . junit . Assert . assertEquals ( ( before - 1 ) , after )
isNotEmptyIfKeySetContainsValuesRegardlessOfMDC ( ) { traceeKeys . get ( ) . add ( "A" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return backendValues . isEmpty ( ) ; }
org . junit . Assert . assertThat ( unit . isEmpty ( ) , org . hamcrest . Matchers . is ( false ) )
testGo ( ) { org . jboss . weld . environment . se . Weld w = new org . jboss . weld . environment . se . Weld ( ) ; org . jboss . weld . environment . se . WeldContainer wc = w . initialize ( ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintStream ps = new java . io . PrintStream ( baos ) ; org . drools . example . cdi . cdiexamplewithinclusion . CDIExampleWithInclusion bean = wc . instance ( ) . select ( org . drools . example . cdi . cdiexamplewithinclusion . CDIExampleWithInclusion . class ) . get ( ) ; bean . go ( ps ) ; ps . close ( ) ; java . lang . String actual = new java . lang . String ( baos . toByteArray ( ) ) ; java . lang . String expected = ( ( ( ( ( ( ( "" + "Dave:<sp>Hello,<sp>HAL.<sp>Do<sp>you<sp>read<sp>me,<sp>HAL?" ) + ( org . drools . example . cdi . cdiexamplewithinclusion . CDIExampleWithInclusionTest . NL ) ) + "HAL:<sp>Dave.<sp>I<sp>read<sp>you." ) + ( org . drools . example . cdi . cdiexamplewithinclusion . CDIExampleWithInclusionTest . NL ) ) + "Dave:<sp>Open<sp>the<sp>pod<sp>bay<sp>doors,<sp>HAL." ) + ( org . drools . example . cdi . cdiexamplewithinclusion . CDIExampleWithInclusionTest . NL ) ) + "HAL:<sp>I'm<sp>sorry,<sp>Dave.<sp>I'm<sp>afraid<sp>I<sp>can't<sp>do<sp>that." ) + ( org . drools . example . cdi . cdiexamplewithinclusion . CDIExampleWithInclusionTest . NL ) ; "<AssertPlaceHolder>" ; w . shutdown ( ) ; } toByteArray ( ) { java . io . ByteArrayOutputStream buf = new java . io . ByteArrayOutputStream ( ) ; try { java . io . ObjectOutputStream out = new java . io . ObjectOutputStream ( buf ) ; out . writeObject ( xjcOpts ) ; out . writeObject ( systemId ) ; out . writeObject ( classes ) ; out . close ( ) ; } catch ( java . io . IOException e ) { logger . error ( "Error<sp>serializing<sp>decision<sp>table<sp>configuration." , e ) ; } return buf . toByteArray ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testFindBySpecialty ( ) { java . lang . String lName1 = "LastName1" ; java . lang . String lName2 = "LastName2" ; java . lang . String lName3 = "LastName3" ; java . lang . String specialty1 = "alpha" ; java . lang . String specialty2 = "bravo" ; org . oscarehr . common . model . ProfessionalSpecialist professionalSpecialist1 = new org . oscarehr . common . model . ProfessionalSpecialist ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( professionalSpecialist1 ) ; professionalSpecialist1 . setSpecialtyType ( specialty1 ) ; professionalSpecialist1 . setLastName ( lName2 ) ; dao . persist ( professionalSpecialist1 ) ; org . oscarehr . common . model . ProfessionalSpecialist professionalSpecialist2 = new org . oscarehr . common . model . ProfessionalSpecialist ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( professionalSpecialist2 ) ; professionalSpecialist2 . setSpecialtyType ( specialty2 ) ; professionalSpecialist2 . setLastName ( lName3 ) ; dao . persist ( professionalSpecialist2 ) ; org . oscarehr . common . model . ProfessionalSpecialist professionalSpecialist3 = new org . oscarehr . common . model . ProfessionalSpecialist ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( professionalSpecialist3 ) ; professionalSpecialist3 . setSpecialtyType ( specialty1 ) ; professionalSpecialist3 . setLastName ( lName1 ) ; dao . persist ( professionalSpecialist3 ) ; java . util . List < org . oscarehr . common . model . ProfessionalSpecialist > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . ProfessionalSpecialist > ( java . util . Arrays . asList ( professionalSpecialist3 , professionalSpecialist1 ) ) ; java . util . List < org . oscarehr . common . model . ProfessionalSpecialist > result = dao . findBySpecialty ( specialty1 ) ; 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 )
defaultValueOfOracleEscapingDisabledShouldBeFalse ( ) { java . lang . System . clearProperty ( SqoopOptions . ORACLE_ESCAPING_DISABLED ) ; org . apache . sqoop . SqoopOptions opts = new org . apache . sqoop . SqoopOptions ( ) ; "<AssertPlaceHolder>" ; } isOracleEscapingDisabled ( ) { return org . apache . sqoop . manager . oracle . OracleUtils . isOracleEscapingDisabled ( org . apache . sqoop . mapreduce . OracleUpsertOutputFormat . OracleUpsertRecordWriter . getConf ( ) ) ; }
org . junit . Assert . assertThat ( opts . isOracleEscapingDisabled ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( true ) ) )
shouldExcecuteFromBeanMethodWorksWithWhereCondition ( ) { cn . jimmyshi . beanquery . example . Book book = new cn . jimmyshi . beanquery . example . Book ( ) ; book . setName ( "abc123" ) ; java . util . Map < java . lang . String , java . lang . Object > result = select ( "name,price" ) . where ( value ( "name" , startsWith ( "abc" ) ) ) . executeFrom ( book ) ; "<AssertPlaceHolder>" ; } executeFrom ( java . util . Collection ) { return from ( from ) . execute ( ) ; }
org . junit . Assert . assertThat ( ( ( java . lang . String ) ( result . get ( "name" ) ) ) , is ( "abc123" ) )
testWeekDayMappingQuartzToCrontab ( ) { final com . cronutils . mapper . WeekDay quartz = ConstantsMapper . QUARTZ_WEEK_DAY ; final com . cronutils . mapper . WeekDay crontab = ConstantsMapper . CRONTAB_WEEK_DAY ; for ( int j = 1 ; j < 7 ; j ++ ) { "<AssertPlaceHolder>" ; } } weekDayMapping ( com . cronutils . mapper . WeekDay , com . cronutils . mapper . WeekDay , int ) { return source . mapTo ( weekday , target ) ; }
org . junit . Assert . assertEquals ( ( j - 1L ) , com . cronutils . mapper . ConstantsMapper . weekDayMapping ( quartz , crontab , j ) )
privateFilterAccessModifierChangesFromPrivateToPublicVisible ( ) { org . jsoup . select . Elements divForClass = japicmp . test . output . xml . XmlHelper . getDivForClass ( japicmp . test . output . xml . XmlOutputGeneratorAccessModifierTest . documentPrivate , replaceLastDotWith$ ( AccessModifierLevel . AccessModifierChangesFromPrivateToPublic . class . getCanonicalName ( ) ) ) ; "<AssertPlaceHolder>" ; } getDivForClass ( org . jsoup . nodes . Document , java . lang . String ) { return document . select ( ( ( "div[id=<sp>" + className ) + "]" ) ) ; }
org . junit . Assert . assertThat ( divForClass . isEmpty ( ) , org . hamcrest . core . Is . is ( false ) )
attrUnsupportedType ( ) { java . util . function . Function < java . lang . String , org . jooby . Route . Definition > route = ( path ) -> new org . jooby . Route . Definition ( "*" , path , ( ) -> null ) ; org . jooby . Route . Definition r = route . apply ( "/" ) ; r . attr ( "i" , new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } attr ( java . lang . String ) { return ( ( T ) ( attrs . get ( name ) ) ) ; }
org . junit . Assert . assertNull ( r . attr ( "i" ) )
decode_5 ( ) { final java . lang . String arg = "foob" ; final java . lang . String exp = "Zm9vYg==" ; "<AssertPlaceHolder>" ; } decode ( byte [ ] ) { if ( ( data . length ) == 0 ) { return data ; } int lastRealDataIndex = ( data . length ) - 1 ; while ( ( data [ lastRealDataIndex ] ) == ( org . erlide . util . Base64 . EQUAL_SIGN ) ) { lastRealDataIndex -- ; } final int padBytes = ( ( data . length ) - 1 ) - lastRealDataIndex ; final int byteLength = ( ( ( data . length ) * 6 ) / 8 ) - padBytes ; final byte [ ] result = new byte [ byteLength ] ; int dataIndex = 0 ; int resultIndex = 0 ; int allBits = 0 ; final int resultChunks = ( lastRealDataIndex + 1 ) / 4 ; for ( int i = 0 ; i < resultChunks ; i ++ ) { allBits = 0 ; for ( int j = 0 ; j < 4 ; j ++ ) { allBits = ( allBits << 6 ) | ( org . erlide . util . Base64 . decodeDigit ( data [ ( dataIndex ++ ) ] ) ) ; } for ( int j = resultIndex + 2 ; j >= resultIndex ; j -- ) { result [ j ] = ( ( byte ) ( allBits & 255 ) ) ; allBits = allBits > > > 8 ; } resultIndex += 3 ; } if ( padBytes == 1 ) { allBits = 0 ; for ( int j = 0 ; j < 3 ; j ++ ) { allBits = ( allBits << 6 ) | ( org . erlide . util . Base64 . decodeDigit ( data [ ( dataIndex ++ ) ] ) ) ; } allBits = allBits << 6 ; allBits = allBits > > > 8 ; for ( int j = resultIndex + 1 ; j >= resultIndex ; j -- ) { result [ j ] = ( ( byte ) ( allBits & 255 ) ) ; allBits = allBits > > > 8 ; } } else if ( padBytes == 2 ) { allBits = 0 ; for ( int j = 0 ; j < 2 ; j ++ ) { allBits = ( allBits << 6 ) | ( org . erlide . util . Base64 . decodeDigit ( data [ ( dataIndex ++ ) ] ) ) ; } allBits = allBits << 6 ; allBits = allBits << 6 ; allBits = allBits > > > 8 ; allBits = allBits > > > 8 ; result [ resultIndex ] = ( ( byte ) ( allBits & 255 ) ) ; } return result ; }
org . junit . Assert . assertEquals ( arg , new java . lang . String ( org . erlide . util . Base64 . decode ( exp . getBytes ( ) ) ) )
testEventSinkWithKafka ( ) { java . util . Date startOfTest = new java . util . Date ( ) ; java . lang . String kafkaHost = org . opennms . smoketest . EventSinkIT . m_testEnvironment . getContainerInfo ( ContainerAlias . KAFKA ) . networkSettings ( ) . ipAddress ( ) ; kafkaHost = kafkaHost + ":9092" ; org . opennms . netmgt . model . events . EventBuilder eventBuilder = new org . opennms . netmgt . model . events . EventBuilder ( org . opennms . netmgt . events . api . EventConstants . NEW_SUSPECT_INTERFACE_EVENT_UEI , "system-test" ) ; eventBuilder . setHost ( org . opennms . smoketest . EventSinkIT . SENDER_IP ) ; eventBuilder . setInterface ( java . net . InetAddress . getByName ( org . opennms . smoketest . EventSinkIT . SENDER_IP ) ) ; org . opennms . netmgt . xml . event . Log eventLog = new org . opennms . netmgt . xml . event . Log ( ) ; eventLog . addEvent ( eventBuilder . getEvent ( ) ) ; java . lang . String xmlString = org . opennms . core . xml . JaxbUtils . marshal ( eventLog ) ; final java . util . Properties producerConfig = new java . util . Properties ( ) ; producerConfig . put ( ProducerConfig . BOOTSTRAP_SERVERS_CONFIG , kafkaHost ) ; producerConfig . put ( ProducerConfig . KEY_SERIALIZER_CLASS_CONFIG , org . apache . kafka . common . serialization . StringSerializer . class . getCanonicalName ( ) ) ; producerConfig . put ( ProducerConfig . VALUE_SERIALIZER_CLASS_CONFIG , org . apache . kafka . common . serialization . ByteArraySerializer . class . getCanonicalName ( ) ) ; org . apache . kafka . clients . producer . KafkaProducer < java . lang . String , byte [ ] > producer = new org . apache . kafka . clients . producer . KafkaProducer ( producerConfig ) ; final org . opennms . core . camel . JmsQueueNameFactory topicNameFactory = new org . opennms . core . camel . JmsQueueNameFactory ( "Sink" , "Events" ) ; org . apache . kafka . clients . producer . ProducerRecord < java . lang . String , byte [ ] > producerRecord = new org . apache . kafka . clients . producer . ProducerRecord < java . lang . String , byte [ ] > ( topicNameFactory . getName ( ) , xmlString . getBytes ( StandardCharsets . UTF_8 ) ) ; producer . send ( producerRecord ) ; java . net . InetSocketAddress pgsql = org . opennms . smoketest . EventSinkIT . m_testEnvironment . getServiceAddress ( ContainerAlias . POSTGRES , 5432 ) ; org . opennms . smoketest . utils . HibernateDaoFactory daoFactory = new org . opennms . smoketest . utils . HibernateDaoFactory ( pgsql ) ; org . opennms . netmgt . dao . api . NodeDao nodeDao = daoFactory . getDao ( org . opennms . netmgt . dao . hibernate . NodeDaoHibernate . class ) ; final org . opennms . netmgt . model . OnmsNode onmsNode = await ( ) . atMost ( 1 , org . opennms . smoketest . MINUTES ) . pollInterval ( 5 , org . opennms . smoketest . SECONDS ) . until ( org . opennms . smoketest . utils . DaoUtils . findMatchingCallable ( nodeDao , new org . opennms . core . criteria . CriteriaBuilder ( org . opennms . netmgt . model . OnmsNode . class ) . eq ( "label" , org . opennms . smoketest . EventSinkIT . SENDER_IP ) . ge ( "createTime" , startOfTest ) . toCriteria ( ) ) , org . hamcrest . Matchers . notNullValue ( ) ) ; "<AssertPlaceHolder>" ; producer . close ( ) ; } toCriteria ( ) { final org . opennms . core . criteria . Criteria criteria = new org . opennms . core . criteria . Criteria ( m_class , m_rootAlias ) ; criteria . setOrders ( m_orderBuilder . getOrderCollection ( ) ) ; criteria . setAliases ( m_aliasBuilder . getAliasCollection ( ) ) ; criteria . setFetchTypes ( m_fetch ) ; criteria . setDistinct ( m_distinct ) ; criteria . setLimit ( m_limit ) ; criteria . setOffset ( m_offset ) ; if ( "any" . equals ( m_matchType ) ) { criteria . setRestrictions ( java . util . Collections . singleton ( org . opennms . core . criteria . restrictions . Restrictions . any ( m_restrictions . toArray ( org . opennms . core . criteria . CriteriaBuilder . EMPTY_RESTRICTION_ARRAY ) ) ) ) ; } else { criteria . setRestrictions ( m_restrictions ) ; } return criteria ; }
org . junit . Assert . assertNotNull ( onmsNode )
appendString_throws ( ) { try { this . classUnderTest ( ) . appendString ( new java . lang . Appendable ( ) { public com . gs . collections . impl . lazy . parallel . Appendable append ( java . lang . CharSequence csq ) throws java . io . IOException { throw new java . io . IOException ( "Test<sp>exception" ) ; } public com . gs . collections . impl . lazy . parallel . Appendable append ( java . lang . CharSequence csq , int start , int end ) throws java . io . IOException { throw new java . io . IOException ( "Test<sp>exception" ) ; } public com . gs . collections . impl . lazy . parallel . Appendable append ( char c ) throws java . io . IOException { throw new java . io . IOException ( "Test<sp>exception" ) ; } } ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . RuntimeException e ) { java . io . IOException cause = ( ( java . io . IOException ) ( e . getCause ( ) ) ) ; "<AssertPlaceHolder>" ; } } append ( char ) { return this . builder . append ( c ) ; }
org . junit . Assert . assertEquals ( "Test<sp>exception" , cause . getMessage ( ) )
testNoError ( ) { boolean result = checkNoError ( "Social_Search_REST_Tag_Search" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
testBasic ( ) { org . talend . components . salesforce . tsalesforceoutputbulk . TSalesforceOutputBulkDefinition definition = ( ( org . talend . components . salesforce . tsalesforceoutputbulk . TSalesforceOutputBulkDefinition ) ( getComponentService ( ) . getComponentDefinition ( TSalesforceOutputBulkDefinition . COMPONENT_NAME ) ) ) ; java . lang . String data_file = tempFolder . newFile ( "data.txt" ) . getAbsolutePath ( ) ; org . talend . components . salesforce . tsalesforceoutputbulk . TSalesforceOutputBulkProperties modelProperties = util . simulateUserBasicAction ( definition , data_file , util . getTestSchema1 ( ) ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "FirstName" , "LastName" , "Phone" } ; java . util . List < java . lang . String > actual = ( ( java . util . List < java . lang . String > ) ( modelProperties . upsertRelationTable . columnName . getPossibleValues ( ) ) ) ; "<AssertPlaceHolder>" ; util . simulateRuntimeCaller ( definition , modelProperties , util . getTestSchema1 ( ) , util . getTestData ( ) ) ; java . lang . String [ ] expected1 = new java . lang . String [ ] { "FirstName,LastName,Phone" , "Wei,Wang,010-11111111" , "Jin,Zhao,010-11111112" , "Wei,Yuan,#N/A" } ; util . compareFileContent ( data_file , expected1 ) ; modelProperties . ignoreNull . setValue ( true ) ; util . simulateRuntimeCaller ( definition , modelProperties , util . getTestSchema1 ( ) , util . getTestData ( ) ) ; java . lang . String [ ] expected2 = new java . lang . String [ ] { "FirstName,LastName,Phone" , "Wei,Wang,010-11111111" , "Jin,Zhao,010-11111112" , "Wei,Yuan," } ; util . compareFileContent ( data_file , expected2 ) ; modelProperties . append . setValue ( true ) ; util . simulateRuntimeCaller ( definition , modelProperties , util . getTestSchema1 ( ) , util . getTestData ( ) ) ; java . lang . String [ ] expected3 = new java . lang . String [ ] { "FirstName,LastName,Phone" , "Wei,Wang,010-11111111" , "Jin,Zhao,010-11111112" , "Wei,Yuan," , "Wei,Wang,010-11111111" , "Jin,Zhao,010-11111112" , "Wei,Yuan," } ; util . compareFileContent ( data_file , expected3 ) ; } getTestSchema1 ( ) { return schema1 ; }
org . junit . Assert . assertArrayEquals ( expected , actual . toArray ( ) )
findAndProcessAcks ( ) { org . opennms . netmgt . ackd . AckReader reader = new org . opennms . netmgt . ackd . readers . DefaultAckReader ( ) ; java . util . concurrent . ScheduledThreadPoolExecutor executor = new java . util . concurrent . ScheduledThreadPoolExecutor ( 1 ) ; reader . setAckProcessor ( m_processor ) ; java . util . concurrent . Future < ? > f = executor . schedule ( m_processor , 5 , TimeUnit . SECONDS ) ; m_processor . setJmConfigDao ( m_jmDao ) ; m_processor . setAckdConfigDao ( createAckdConfigDao ( ) ) ; while ( ! ( f . isDone ( ) ) ) { java . lang . Thread . sleep ( 10 ) ; } "<AssertPlaceHolder>" ; } isDone ( ) { return future . isDone ( ) ; }
org . junit . Assert . assertTrue ( f . isDone ( ) )
testMaximumTimeMillisecondsDefault ( ) { final com . allanbank . mongodb . builder . Find . Builder b = com . allanbank . mongodb . builder . Find . builder ( ) ; final com . allanbank . mongodb . builder . Find command = b . build ( ) ; "<AssertPlaceHolder>" ; } getMaximumTimeMilliseconds ( ) { return myMaximumTimeMilliseconds ; }
org . junit . Assert . assertThat ( command . getMaximumTimeMilliseconds ( ) , org . hamcrest . Matchers . is ( 0L ) )
removeConfigurationWithNamespaceTest ( ) { final org . guvnor . structure . server . config . ConfigGroup config = configurationFactory . newConfigGroup ( ConfigType . REPOSITORY , "namespace" , "config" , "description" ) ; configurationService . addConfiguration ( config ) ; configurationService . removeConfiguration ( config ) ; final java . util . List < org . guvnor . structure . server . config . ConfigGroup > configGroups = configurationService . getConfiguration ( ConfigType . REPOSITORY , "namespace" ) ; "<AssertPlaceHolder>" ; } size ( ) { return fileAttrs . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , configGroups . size ( ) )
testGetMgr ( ) { "<AssertPlaceHolder>" ; verify ( autosaveMgr , never ( ) ) . autosave ( ) ; } getMgr ( ) { return mgr ; }
org . junit . Assert . assertSame ( autosaveMgr , a . getMgr ( ) )
renderConfluencePage_asciiDocWithBr_returnsConfluencePageContentWithXhtml ( ) { java . lang . String adocContent = "a<sp>+\nb<sp>+\nc" ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage asciidocConfluencePage = org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage . newAsciidocConfluencePage ( asciidocPage ( org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . prependTitle ( adocContent ) ) , org . sahli . asciidoc . confluence . publisher . converter . UTF_8 , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . TEMPLATES_FOLDER , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . dummyAssetsTargetPath ( ) ) ; java . lang . String expectedContent = "<p>a<br/>\nb<br/>\nc</p>" ; "<AssertPlaceHolder>" ; } content ( ) { return this . htmlContent ; }
org . junit . Assert . assertThat ( asciidocConfluencePage . content ( ) , org . hamcrest . Matchers . is ( expectedContent ) )