input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
ignoresExtraFileparts ( ) { when ( this . request . getRequestURI ( ) ) . thenReturn ( "/bin/download/data/P0000001/file.vcf/hacked" ) ; when ( this . access . hasAccessLevel ( this . edit ) ) . thenReturn ( false ) ; this . mocker . getComponentUnderTest ( ) . onEvent ( this . event , this . doc , this . context ) ; "<AssertPlaceHolder>" ; } isCanceled ( ) { return this . canceled ; }
org . junit . Assert . assertTrue ( this . event . isCanceled ( ) )
testGetByIdWithDetail1 ( ) { when ( mockCommentMapper . selectByPrimaryKey ( ModuleHelper . id ) ) . thenReturn ( null ) ; com . onboard . domain . model . Comment comment0 = mockCommentServiceImpl . getByIdWithDetail ( ModuleHelper . id ) ; verify ( mockCommentMapper ) . selectByPrimaryKey ( ModuleHelper . id ) ; "<AssertPlaceHolder>" ; } getByIdWithDetail ( int ) { return getIterableWithBoardables ( id ) ; }
org . junit . Assert . assertNull ( comment0 )
matchingDescendant_true_smallerLength ( ) { T p = createPath ( ) ; if ( ( segments ) != null ) { com . redhat . lightblue . util . Path prefix = p . prefix ( 3 ) ; "<AssertPlaceHolder>" ; } } matchingDescendant ( com . redhat . lightblue . util . Path ) { int n = pattern . numSegments ( ) ; if ( n < ( numSegments ( ) ) ) { return prefix ( n ) . matches ( pattern ) ; } else if ( n == ( numSegments ( ) ) ) { return matches ( pattern ) ; } return false ; }
org . junit . Assert . assertTrue ( p . matchingDescendant ( prefix ) )
testPeerAddressRoundtrip ( ) { java . lang . String fromSpec = "010000000000000000000000000000000000ffff0a000001208d" ; com . matthewmitchell . peercoinj . core . PeerAddress pa = new com . matthewmitchell . peercoinj . core . PeerAddress ( com . matthewmitchell . peercoinj . params . MainNetParams . get ( ) , com . matthewmitchell . peercoinj . core . Utils . HEX . decode ( fromSpec ) , 0 , 0 ) ; java . lang . String reserialized = com . matthewmitchell . peercoinj . core . Utils . HEX . encode ( pa . peercoinSerialize ( ) ) ; "<AssertPlaceHolder>" ; } peercoinSerialize ( ) { return new byte [ 0 ] ; }
org . junit . Assert . assertEquals ( reserialized , fromSpec )
convert_string_array_to_list_with_java_using_collections ( ) { java . lang . String [ ] planetsAsStringArray = new java . lang . String [ ] { "The<sp>Sun" , "Mercury" , "Venus" , "Earth" , "Mars" , "Jupiter" , "Saturn" , "Uranus" , "Neptune" } ; java . util . List < java . lang . String > planetsAsArrayList = new java . util . ArrayList < java . lang . String > ( ) ; java . util . Collections . addAll ( planetsAsArrayList , planetsAsStringArray ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 9 , planetsAsArrayList . size ( ) )
test_toString ( ) { com . hazelblast . client . impl . ProxyProviderImpl proxyProvider = new com . hazelblast . client . impl . ProxyProviderImpl ( ) ; com . hazelblast . client . impl . Partitioned_Test . PartitionedService service = proxyProvider . getProxy ( com . hazelblast . client . impl . Partitioned_Test . PartitionedService . class ) ; java . lang . String s = service . toString ( ) ; System . out . println ( s ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( name ) + "@" ) + ( hazelcastInstance . getName ( ) ) ; }
org . junit . Assert . assertNotNull ( s )
testSerialization ( ) { java . awt . GradientPaint gp = new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . RED , 3.0F , 4.0F , java . awt . Color . BLUE ) ; org . jfree . chart . block . LabelBlock b1 = new org . jfree . chart . block . LabelBlock ( "ABC" , new java . awt . Font ( "Dialog" , java . awt . Font . PLAIN , 12 ) , gp ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( b1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . block . LabelBlock b2 = ( ( org . jfree . chart . block . LabelBlock ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
org . junit . Assert . assertEquals ( b1 , b2 )
testFloorDecimalExpressionNoop ( ) { org . apache . phoenix . expression . LiteralExpression decimalLiteral = org . apache . phoenix . expression . LiteralExpression . newConstant ( 5 , PInteger . INSTANCE ) ; org . apache . phoenix . expression . Expression floorDecimalExpression = org . apache . phoenix . expression . function . FloorDecimalExpression . create ( decimalLiteral , 3 ) ; "<AssertPlaceHolder>" ; } create ( org . apache . phoenix . expression . Expression , int ) { if ( expr . getDataType ( ) . isCoercibleTo ( PLong . INSTANCE ) ) { return expr ; } org . apache . phoenix . expression . Expression scaleExpr = org . apache . phoenix . expression . LiteralExpression . newConstant ( scale , PInteger . INSTANCE , Determinism . ALWAYS ) ; java . util . List < org . apache . phoenix . expression . Expression > expressions = com . google . common . collect . Lists . newArrayList ( expr , scaleExpr ) ; return new org . apache . phoenix . expression . function . FloorDecimalExpression ( expressions ) ; }
org . junit . Assert . assertEquals ( floorDecimalExpression , decimalLiteral )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . Repository > repositories = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( repositories . isEmpty ( ) )
testNewBond_IAtom_IAtom ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IBond bond = builder . newInstance ( org . openscience . cdk . interfaces . IBond . class , builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class ) , builder . newInstance ( org . openscience . cdk . interfaces . IAtom . class ) ) ; "<AssertPlaceHolder>" ; } getBuilder ( ) { return org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ; }
org . junit . Assert . assertNotNull ( bond )
testInsertionSort2 ( ) { int [ ] input = new int [ ] { 1 , 2 , 3 } ; int [ ] result = new int [ ] { 1 , 2 , 3 } ; chapter3 . insertionsort . JaegyuInsertionSort insertionSort = new chapter3 . insertionsort . JaegyuInsertionSort ( ) ; "<AssertPlaceHolder>" ; } sort ( int [ ] ) { int p = 0 ; int r = ( input . length ) - 1 ; this . mergeSort ( input , p , r ) ; return input ; }
org . junit . Assert . assertArrayEquals ( result , insertionSort . sort ( input ) )
testHandleException ( ) { final java . io . CharArrayWriter err = new java . io . CharArrayWriter ( ) ; final org . oscm . operatorsvc . client . OperatorClient client = new org . oscm . operatorsvc . client . OperatorClient ( null , null , new java . io . PrintWriter ( err , true ) ) ; final java . lang . Exception cause1 = new java . lang . Exception ( "Cause<sp>1" ) ; final java . lang . Exception cause2 = new java . lang . Exception ( "Cause<sp>2" , cause1 ) ; final java . lang . Exception exception = new java . lang . Exception ( "Bumm" , cause2 ) ; client . handleException ( exception ) ; final java . lang . String expected = "Bumm\ncaused<sp>by:<sp>Cause<sp>2\ncaused<sp>by:<sp>Cause<sp>1" ; "<AssertPlaceHolder>" ; } toString ( ) { return voTriggerProcess . toString ( ) ; }
org . junit . Assert . assertEquals ( java . lang . String . format ( expected ) , err . toString ( ) )
testGroupWithInvalidResource ( ) { final ro . isdc . wro . model . WroModel model = new ro . isdc . wro . model . WroModel ( ) ; final java . lang . String uri = java . lang . String . format ( ( ( ro . isdc . wro . model . resource . locator . ClasspathUriLocator . PREFIX ) + "%s/expander/INVALID.*" ) , ro . isdc . wro . util . WroUtil . toPackageAsFolder ( getClass ( ) ) ) ; model . addGroup ( new ro . isdc . wro . model . group . Group ( "group" ) . addResource ( ro . isdc . wro . model . resource . Resource . create ( uri , ResourceType . JS ) ) ) ; org . mockito . Mockito . when ( decoratedFactory . create ( ) ) . thenReturn ( model ) ; final ro . isdc . wro . model . WroModel changedModel = transformer . transform ( model ) ; "<AssertPlaceHolder>" ; } getGroups ( ) { return java . util . Collections . unmodifiableSet ( groups ) ; }
org . junit . Assert . assertEquals ( 1 , changedModel . getGroups ( ) . size ( ) )
testEmptyAggregation ( ) { org . eclipse . birt . data . engine . olap . data . api . CubeQueryExecutorHelper cubeQueryExcutorHelper = new org . eclipse . birt . data . engine . olap . data . api . CubeQueryExecutorHelper ( org . eclipse . birt . data . engine . olap . data . api . CubeQueryExecutorHelper . loadCube ( "cube1" , documentManager , new org . eclipse . birt . data . engine . impl . StopSign ( ) ) ) ; org . eclipse . birt . data . engine . olap . data . api . ISelection [ ] [ ] filter = new org . eclipse . birt . data . engine . olap . data . api . ISelection [ 1 ] [ 1 ] ; filter [ 0 ] [ 0 ] = org . eclipse . birt . data . engine . olap . data . impl . SelectionFactory . createRangeSelection ( new java . lang . Object [ ] { "3999" } , new java . lang . Object [ ] { "1" } , true , false ) ; cubeQueryExcutorHelper . addFilter ( new org . eclipse . birt . data . engine . olap . data . impl . aggregation . filter . LevelFilter ( dimLevel21 , filter [ 0 ] ) ) ; org . eclipse . birt . data . engine . olap . data . impl . AggregationDefinition [ ] aggregations = new org . eclipse . birt . data . engine . olap . data . impl . AggregationDefinition [ 4 ] ; int [ ] sortType = new int [ 1 ] ; sortType [ 0 ] = org . eclipse . birt . data . engine . olap . data . api . IDimensionSortDefn . SORT_ASC ; org . eclipse . birt . data . engine . olap . data . api . DimLevel [ ] levelsForFilter = new org . eclipse . birt . data . engine . olap . data . api . DimLevel [ ] { dimLevel21 } ; org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition [ ] funcitons = new org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition [ 1 ] ; funcitons [ 0 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition ( "measure1" , org . eclipse . birt . data . aggregation . api . IBuildInAggregation . TOTAL_SUM_FUNC ) ; org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition [ ] funcitonsWithParameterCol = new org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition [ 2 ] ; funcitonsWithParameterCol [ 0 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition ( "measure1" , org . eclipse . birt . data . aggregation . api . IBuildInAggregation . TOTAL_SUM_FUNC ) ; funcitonsWithParameterCol [ 1 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationFunctionDefinition ( null , "measure1" , new org . eclipse . birt . data . engine . olap . data . api . DimLevel ( "dimension1" , "level12" ) , "col12" , org . eclipse . birt . data . aggregation . api . IBuildInAggregation . TOTAL_WEIGHTEDAVE_FUNC ) ; aggregations [ 0 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationDefinition ( levelsForFilter , sortType , funcitons ) ; sortType = new int [ 2 ] ; sortType [ 0 ] = org . eclipse . birt . data . engine . olap . data . api . IDimensionSortDefn . SORT_ASC ; sortType [ 1 ] = org . eclipse . birt . data . engine . olap . data . api . IDimensionSortDefn . SORT_ASC ; levelsForFilter = new org . eclipse . birt . data . engine . olap . data . api . DimLevel [ ] { dimLevel31 } ; aggregations [ 1 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationDefinition ( levelsForFilter , sortType , funcitons ) ; aggregations [ 2 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationDefinition ( null , null , funcitons ) ; aggregations [ 3 ] = new org . eclipse . birt . data . engine . olap . data . impl . AggregationDefinition ( levelsForFilter , sortType , null ) ; org . eclipse . birt . data . engine . olap . data . api . IAggregationResultSet [ ] resultSet = cubeQueryExcutorHelper . execute ( aggregations , new org . eclipse . birt . data . engine . impl . StopSign ( ) ) ; org . eclipse . birt . data . engine . olap . data . api . CubeQueryExecutorHelper . saveAggregationResultSet ( pathName , "test2" , resultSet ) ; resultSet = org . eclipse . birt . data . engine . olap . data . api . CubeQueryExecutorHelper . loadAggregationResultSet ( pathName , "test2" ) ; for ( int i = 0 ; i < ( resultSet . length ) ; i ++ ) { "<AssertPlaceHolder>" ; resultSet [ i ] . close ( ) ; } } loadAggregationResultSet ( org . eclipse . birt . core . archive . IDocArchiveReader , java . lang . String ) { return org . eclipse . birt . data . engine . olap . data . impl . AggregationResultSetSaveUtil . load ( name , reader , org . eclipse . birt . data . engine . impl . document . stream . VersionManager . getLatestVersion ( ) ,
org . junit . Assert . assertEquals ( resultSet [ i ] . length ( ) , 0 )
testSetter ( ) { com . deezer . research . language . DetectionResult result = new com . deezer . research . language . DetectionResult ( ) ; result . setLanguage ( "en" ) ; result . setConfidence ( 0.7 ) ; "<AssertPlaceHolder>" ; } setConfidence ( double ) { this . confidence = confidence ; }
org . junit . Assert . assertEquals ( new com . deezer . research . language . DetectionResult ( "en" , 0.7 ) , result )
testBasic ( ) { java . util . Map < java . lang . String , java . lang . String > replacements = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; replacements . put ( "to.replace.one" , "foo" ) ; replacements . put ( "to.replace.two" , "bar" ) ; java . lang . String input = "<html><body>This<sp>is<sp>${to.replace.one}<sp>and<sp>this<sp>is<sp>the<sp>${to.replace.two}</body></html>" ; java . lang . String expected = "<html><body>This<sp>is<sp>foo<sp>and<sp>this<sp>is<sp>the<sp>bar</body></html>" ; java . lang . String result = org . sagebionetworks . javadoc . linker . PropertyReplacement . replaceProperties ( input , replacements ) ; "<AssertPlaceHolder>" ; } replaceProperties ( java . lang . String , java . util . Map ) { if ( input == null ) throw new java . lang . IllegalArgumentException ( "Input<sp>string<sp>cannot<sp>be<sp>null" ) ; if ( replacements == null ) throw new java . lang . IllegalArgumentException ( "Replacement<sp>map<sp>cannot<sp>be<sp>null" ) ; java . util . regex . Matcher matcher = org . sagebionetworks . javadoc . linker . PropertyReplacement . PROPERTY_PATTERN . matcher ( input ) ; boolean result = matcher . find ( ) ; if ( result ) { java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; do { java . lang . String group = matcher . group ( ) ; java . lang . String key = group . substring ( 2 , ( ( group . length ( ) ) - 1 ) ) ; java . lang . String value = replacements . get ( key ) ; if ( value == null ) { throw new java . lang . IllegalArgumentException ( ( "No<sp>replacement<sp>found<sp>for<sp>key:<sp>" + key ) ) ; } matcher . appendReplacement ( sb , value ) ; result = matcher . find ( ) ; } while ( result ) ; matcher . appendTail ( sb ) ; java . lang . String results = sb . toString ( ) ; org . sagebionetworks . javadoc . linker . PropertyReplacement . validateNoMissingBrackets ( results ) ; return results ; } return input ; }
org . junit . Assert . assertEquals ( expected , result )
shouldNotBeEqualToZeroDollars ( ) { com . wesabe . api . util . money . Money oneDollar = new com . wesabe . api . util . money . Money ( decimal ( "1.00" ) , USD ) ; com . wesabe . api . util . money . Money zeroDollars = new com . wesabe . api . util . money . Money ( decimal ( "0.00" ) , USD ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof com . wesabe . api . accounts . entities . CurrencyExchangeRate ) { com . wesabe . api . accounts . entities . CurrencyExchangeRate that = ( ( com . wesabe . api . accounts . entities . CurrencyExchangeRate ) ( obj ) ) ; return ( ( com . google . common . base . Objects . equal ( date , that . date ) ) && ( com . google . common . base . Objects . equal ( rate , that . rate ) ) ) && ( com . google . common . base . Objects . equal ( currencyCode , that . currencyCode ) ) ; } return false ; }
org . junit . Assert . assertFalse ( oneDollar . equals ( zeroDollars ) )
shouldReturnContentsOfFile ( ) { java . io . File file = createTemporaryFileWithContent ( "Hello\nThere!\n" ) ; com . dbdeploy . scripts . ChangeScript changeScript = new com . dbdeploy . scripts . ChangeScript ( 5 , file , "UTF-8" ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return getFileContents ( false ) ; }
org . junit . Assert . assertThat ( changeScript . getContent ( ) , is ( "Hello\nThere!\n" ) )
testBasicPattern ( ) { nl . inl . blacklab . search . TextPattern r = new nl . inl . blacklab . search . TextPatternRegex ( "bla" ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return null ; }
org . junit . Assert . assertEquals ( "bla" , ( ( nl . inl . blacklab . search . TextPatternRegex ) ( r ) ) . getValue ( ) )
matchXPathMultiple ( ) { java . lang . String xmlString = "<xml><doc<sp>id='US123456789'></doc></xml>" ; gov . uspto . bulkdata . find . PatternXPath pattern = new gov . uspto . bulkdata . find . PatternXPath ( "//doc/id[starts-with(.,'US1234')]" , "//doc/@id[starts-with(.,'US1234')]" ) ; gov . uspto . bulkdata . find . PatternMatcher matcher = new gov . uspto . bulkdata . find . PatternMatcher ( ) ; matcher . add ( pattern ) ; "<AssertPlaceHolder>" ; } match ( java . lang . String ) { if ( xmlDocStr == null ) { return false ; } javax . xml . parsers . DocumentBuilderFactory dbfact = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) ; dbfact . setAttribute ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; try { javax . xml . parsers . DocumentBuilder builder = dbfact . newDocumentBuilder ( ) ; org . xml . sax . InputSource inputSource = new org . xml . sax . InputSource ( new java . io . StringReader ( xmlDocStr ) ) ; org . w3c . dom . Document document = builder . parse ( inputSource ) ; javax . xml . xpath . XPathFactory fact = javax . xml . xpath . XPathFactory . newInstance ( ) ; javax . xml . xpath . XPath xpath = fact . newXPath ( ) ; java . lang . String value = ( ( java . lang . String ) ( xpath . evaluate ( xPathExpression , document , XPathConstants . STRING ) ) ) ; java . util . regex . Matcher matcher = regexPattern . matcher ( value ) ; if ( matcher . matches ( ) ) { return true ; } } catch ( javax . xml . xpath . XPathExpressionException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>XPathExpressionException<sp>on<sp>doc:{}" , xmlDocStr , e ) ; return false ; } catch ( javax . xml . parsers . ParserConfigurationException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>ParserConfigurationException" , e ) ; return false ; } catch ( org . xml . sax . SAXException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "XML<sp>SAXException<sp>on<sp>doc:{}" , xmlDocStr , e ) ; return false ; } catch ( java . io . IOException e ) { gov . uspto . bulkdata . find . MatchValueRegex . LOGGER . error ( "IOException" , e ) ; return false ; } return false ; }
org . junit . Assert . assertTrue ( matcher . match ( xmlString ) )
testSendNoRetry_emptyResult ( ) { java . lang . String json = "{}" ; setResponseExpectations ( 200 , json ) ; com . google . android . gcm . server . Result result = sender . sendNoRetry ( message , topic ) ; "<AssertPlaceHolder>" ; } sendNoRetry ( com . google . android . gcm . server . Message , java . util . List ) { if ( com . google . android . gcm . server . Sender . nonNull ( registrationIds ) . isEmpty ( ) ) { throw new java . lang . IllegalArgumentException ( "registrationIds<sp>cannot<sp>be<sp>empty" ) ; } java . util . Map < java . lang . Object , java . lang . Object > jsonRequest = new java . util . HashMap < java . lang . Object , java . lang . Object > ( ) ; messageToMap ( message , jsonRequest ) ; jsonRequest . put ( com . google . android . gcm . server . Constants . JSON_REGISTRATION_IDS , registrationIds ) ; java . lang . String responseBody = makeGcmHttpRequest ( jsonRequest ) ; if ( responseBody == null ) { return null ; } org . json . simple . parser . JSONParser parser = new org . json . simple . parser . JSONParser ( ) ; org . json . simple . JSONObject jsonResponse ; try { jsonResponse = ( ( org . json . simple . JSONObject ) ( parser . parse ( responseBody ) ) ) ; int success = getNumber ( jsonResponse , com . google . android . gcm . server . Constants . JSON_SUCCESS ) . intValue ( ) ; int failure = getNumber ( jsonResponse , com . google . android . gcm . server . Constants . JSON_FAILURE ) . intValue ( ) ; int canonicalIds = getNumber ( jsonResponse , com . google . android . gcm . server . Constants . JSON_CANONICAL_IDS ) . intValue ( ) ; long multicastId = getNumber ( jsonResponse , com . google . android . gcm . server . Constants . JSON_MULTICAST_ID ) . longValue ( ) ; com . google . android . gcm . server . MulticastResult . Builder builder = new com . google . android . gcm . server . MulticastResult . Builder ( success , failure , canonicalIds , multicastId ) ; @ com . google . android . gcm . server . SuppressWarnings ( "unchecked" ) java . util . List < java . util . Map < java . lang . String , java . lang . Object > > results = ( ( java . util . List < java . util . Map < java . lang . String , java . lang . Object > > ) ( jsonResponse . get ( com . google . android . gcm . server . Constants . JSON_RESULTS ) ) ) ; if ( results != null ) { for ( java . util . Map < java . lang . String , java . lang . Object > jsonResult : results ) { java . lang . String messageId = ( ( java . lang . String ) ( jsonResult . get ( com . google . android . gcm . server . Constants . JSON_MESSAGE_ID ) ) ) ; java . lang . String canonicalRegId = ( ( java . lang . String ) ( jsonResult . get ( com . google . android . gcm . server . Constants . TOKEN_CANONICAL_REG_ID ) ) ) ; java . lang . String error = ( ( java . lang . String ) ( jsonResult . get ( com . google . android . gcm . server . Constants . JSON_ERROR ) ) ) ; com . google . android . gcm . server . Result result = new com . google . android . gcm . server . Result . Builder ( ) . messageId ( messageId ) . canonicalRegistrationId ( canonicalRegId ) . errorCode ( error ) . build ( ) ; builder . addResult ( result ) ; } } return builder . build ( ) ; } catch ( org . json . simple . parser . ParseException e ) { throw newIoException ( responseBody , e ) ; } catch ( com . google . android . gcm . server . Sender . CustomParserException e ) { throw newIoException ( responseBody , e ) ; } }
org . junit . Assert . assertNull ( result )
testSetLabel_String ( ) { java . lang . String label = "Arg255" ; org . openscience . cdk . interfaces . IPseudoAtom atom = ( ( org . openscience . cdk . interfaces . IPseudoAtom ) ( newChemObject ( ) ) ) ; atom . setLabel ( label ) ; java . lang . String label2 = "His66" ; atom . setLabel ( label2 ) ; "<AssertPlaceHolder>" ; } getLabel ( ) { return this . label ; }
org . junit . Assert . assertEquals ( label2 , atom . getLabel ( ) )
testNullInput ( ) { java . util . Map < java . lang . String , java . lang . String > output = org . opennms . netmgt . jmx . JmxUtils . convertToUnmodifiableStringMap ( null ) ; "<AssertPlaceHolder>" ; } convertToUnmodifiableStringMap ( java . util . Map ) { if ( map != null ) { java . util . Map < java . lang . String , java . lang . String > convertedProperties = new java . util . HashMap ( ) ; for ( Map . Entry < java . lang . String , java . lang . Object > eachEntry : map . entrySet ( ) ) { if ( ( eachEntry . getValue ( ) ) != null ) { convertedProperties . put ( eachEntry . getKey ( ) , eachEntry . getValue ( ) . toString ( ) ) ; } } return java . util . Collections . unmodifiableMap ( convertedProperties ) ; } return null ; }
org . junit . Assert . assertNull ( output )
measure_globalRegistryNull ( ) { java . util . Map < java . lang . String , java . lang . Double > result = publisher . measure ( ) ; "<AssertPlaceHolder>" ; } measure ( ) { return allMeasurements ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testMultipleAdd ( ) { nl . dries . wicket . hibernate . dozer . helper . Seen seen = new nl . dries . wicket . hibernate . dozer . helper . Seen ( ) ; seen . add ( pet1 ) ; seen . add ( pet1 ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return seen . containsKey ( obj ) ; }
org . junit . Assert . assertTrue ( seen . contains ( pet1 ) )
testGetUniquePrincipalNameCase ( ) { java . lang . String input = "BigTop" ; java . lang . String expected = "bigtop" ; java . lang . String result = org . sagebionetworks . repo . model . dbo . principal . AliasUtils . getUniqueAliasName ( input ) ; "<AssertPlaceHolder>" ; } getUniqueAliasName ( java . lang . String ) { if ( inputName == null ) { throw new java . lang . IllegalArgumentException ( "Name<sp>cannot<sp>be<sp>null" ) ; } java . lang . String lower = inputName . toLowerCase ( ) ; java . util . regex . Matcher m = org . sagebionetworks . repo . model . dbo . principal . AliasUtils . PRINICPAL_UNIQUENESS_REPLACE_PATTERN . matcher ( lower ) ; return m . replaceAll ( "" ) ; }
org . junit . Assert . assertEquals ( expected , result )
testValidateUploadMode ( ) { properties . uploadMode . setValue ( UploadMode . READ_CONTENT_FROM_INPUT ) ; testRuntime . initialize ( container , properties ) ; "<AssertPlaceHolder>" ; } validatePutProperties ( org . talend . components . google . drive . put . GoogleDrivePutProperties ) { org . talend . daikon . properties . ValidationResultMutable vr = new org . talend . daikon . properties . ValidationResultMutable ( org . talend . daikon . properties . ValidationResult . Result . OK ) ; if ( org . apache . commons . lang3 . StringUtils . isEmpty ( properties . fileName . getValue ( ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.filename.empty" ) ) ; return vr ; } if ( ! ( org . talend . components . google . drive . runtime . UPLOAD_LOCAL_FILE . equals ( properties . uploadMode . getValue ( ) ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.put.invalid.flow" ) ) ; return vr ; } if ( org . apache . commons . lang3 . StringUtils . isEmpty ( properties . destinationFolder . getValue ( ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.parentfolder.empty" ) ) ; return vr ; } if ( org . apache . commons . lang3 . StringUtils . isEmpty ( properties . localFilePath . getValue ( ) ) ) { vr . setStatus ( Result . ERROR ) ; vr . setMessage ( org . talend . components . google . drive . runtime . GoogleDriveValidator . messages . getMessage ( "error.validation.local.filename.empty" ) ) ; return vr ; } return vr ; }
org . junit . Assert . assertEquals ( Result . ERROR , testRuntime . validatePutProperties ( properties ) . getStatus ( ) )
withTesters_ignoresNullArray ( ) { com . openpojo . validation . ValidatorBuilder validatorBuilder = com . openpojo . validation . ValidatorBuilder . create ( ) . with ( ( ( com . openpojo . validation . test . Tester [ ] ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } getTesters ( ) { return testers ; }
org . junit . Assert . assertEquals ( 0 , validatorBuilder . getTesters ( ) . size ( ) )
testManagerUserRemove ( ) { java . lang . Integer siteId = 1 ; java . lang . String taskId = "0" ; java . lang . String username = "test" ; com . ewcms . publication . task . Taskable task = mock ( com . ewcms . publication . task . Taskable . class ) ; when ( task . getId ( ) ) . thenReturn ( taskId ) ; when ( task . getUsername ( ) ) . thenReturn ( username ) ; com . ewcms . publication . task . MemoryTaskRegistry register = new com . ewcms . publication . task . MemoryTaskRegistry ( 0 ) ; com . ewcms . core . site . model . Site site = new com . ewcms . core . site . model . Site ( ) ; site . setId ( siteId ) ; com . ewcms . core . site . model . SiteServer server = new com . ewcms . core . site . model . SiteServer ( ) ; server . setOutputType ( OutputType . LOCAL ) ; site . setSiteServer ( server ) ; register . registerNewTask ( site , task ) ; try { register . removeTask ( siteId , taskId , TaskRegistryable . MANAGER_USERNAME ) ; "<AssertPlaceHolder>" ; } catch ( com . ewcms . publication . task . TaskException e ) { org . junit . Assert . fail ( ) ; } } containsTask ( com . ewcms . publication . task . Taskable ) { synchronized ( taskPool ) { boolean contains = false ; for ( com . ewcms . publication . task . SiteTaskRunnerable runner : taskPool . values ( ) ) { contains = contains || ( runner . contains ( task ) ) ; } return contains ; } }
org . junit . Assert . assertFalse ( register . containsTask ( task ) )
testUnitLazyVarBinding ( ) { org . kie . internal . builder . fluent . ExecutableBuilder f = org . kie . internal . builder . fluent . ExecutableBuilder . create ( ) ; org . kie . api . runtime . rule . DataSource < org . drools . compiler . Person > people = org . kie . api . runtime . rule . DataSource . create ( new org . drools . compiler . Person ( "Mario" , 10 ) , new org . drools . compiler . Person ( "Daniele" , 30 ) , new org . drools . compiler . Person ( "Mark" , 90 ) ) ; f . newApplicationContext ( "app1" ) . getKieContainer ( releaseIdUnit ) . newRuleUnitExecutor ( ) . run ( ( ) -> new org . drools . compiler . simulation . AdultUnitDifferentDataSourceName ( people ) ) . getGlobal ( "oldName" ) . set ( "test" ) . bindVariableByExpression ( "lazyVariable" , ( context ) -> context . get ( "test" ) ) . get ( "lazyVariable" ) . out ( "firedRules" ) . dispose ( ) ; org . kie . api . runtime . RequestContext requestContext = org . kie . api . runtime . ExecutableRunner . create ( ) . execute ( f . getExecutable ( ) ) ; "<AssertPlaceHolder>" ; } getOutputs ( ) { return outputs ; }
org . junit . Assert . assertEquals ( "Mark" , requestContext . getOutputs ( ) . get ( "firedRules" ) )
testCreateMacroDesc ( ) { org . apache . hadoop . hive . ql . plan . DropMacroDesc desc = new org . apache . hadoop . hive . ql . plan . DropMacroDesc ( name ) ; "<AssertPlaceHolder>" ; } getMacroName ( ) { return macroName ; }
org . junit . Assert . assertEquals ( name , desc . getMacroName ( ) )
collectShortParallel ( ) { org . eclipse . collections . api . list . primitive . ShortList expected = org . eclipse . collections . impl . collector . Collectors2AdditionalTest . LARGE_INTERVAL . collectShort ( ( each ) -> ( ( short ) ( each % Short . MAX_VALUE ) ) , ShortLists . mutable . empty ( ) ) ; org . eclipse . collections . api . list . primitive . ShortList actual = this . bigData . parallelStream ( ) . collect ( org . eclipse . collections . impl . collector . Collectors2 . collectShort ( ( each ) -> ( ( short ) ( each % Short . MAX_VALUE ) ) , org . eclipse . collections . impl . factory . primitive . ShortLists . mutable :: empty ) ) ; "<AssertPlaceHolder>" ; } collectShort ( org . eclipse . collections . api . block . function . primitive . ShortFunction , java . util . function . Supplier ) { return java . util . stream . Collector . of ( supplier , ( collection , each ) -> collection . add ( function . shortValueOf ( each ) ) , ( collection1 , collection2 ) -> { collection1 . addAll ( collection2 ) ; return collection1 ; } , org . eclipse . collections . impl . collector . Collectors2 . EMPTY_CHARACTERISTICS ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testGetRoles ( ) { org . osgi . service . useradmin . User user1 = org . mockito . Mockito . mock ( org . osgi . service . useradmin . User . class ) ; org . mockito . Mockito . when ( user1 . getType ( ) ) . thenReturn ( Role . USER ) ; org . mockito . Mockito . when ( user1 . getName ( ) ) . thenReturn ( "user1" ) ; org . mockito . Mockito . when ( userAdmin . getRoles ( "name=user1" ) ) . thenReturn ( new org . osgi . service . useradmin . Role [ ] { user1 } ) ; java . lang . String [ ] roles = mbean . getRoles ( "name=user1" ) ; "<AssertPlaceHolder>" ; } getRoles ( java . lang . String ) { java . lang . annotation . Annotation ann = getEffective ( methodName ) ; org . junit . Assert . assertTrue ( ( ann instanceof javax . annotation . security . RolesAllowed ) ) ; return ( ( javax . annotation . security . RolesAllowed ) ( ann ) ) . value ( ) ; }
org . junit . Assert . assertArrayEquals ( new java . lang . String [ ] { "user1" } , roles )
testHashCode ( ) { int hashCodeBeforeActivation = mock . hashCode ( ) ; replay ( mock ) ; int hashCodeAfterActivation = mock . hashCode ( ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return - 1 ; }
org . junit . Assert . assertEquals ( hashCodeBeforeActivation , hashCodeAfterActivation )
testInitialize ( ) { org . owasp . dependencycheck . data . nvdcve . ConnectionFactory factory = new org . owasp . dependencycheck . data . nvdcve . ConnectionFactory ( getSettings ( ) ) ; factory . initialize ( ) ; try ( java . sql . Connection result = factory . getConnection ( ) ) { "<AssertPlaceHolder>" ; } factory . cleanup ( ) ; } getConnection ( ) { initialize ( ) ; java . sql . Connection conn = null ; try { conn = java . sql . DriverManager . getConnection ( connectionString , userName , password ) ; } catch ( java . sql . SQLException ex ) { org . owasp . dependencycheck . data . nvdcve . ConnectionFactory . LOGGER . debug ( "" , ex ) ; throw new org . owasp . dependencycheck . data . nvdcve . DatabaseException ( "Unable<sp>to<sp>connect<sp>to<sp>the<sp>database" , ex ) ; } return conn ; }
org . junit . Assert . assertNotNull ( result )
testCreateProducerWithNullDestination ( ) { javax . jms . MessageProducer producer = session . createProducer ( null ) ; "<AssertPlaceHolder>" ; } getDestination ( ) { checkClosed ( ) ; return producerInfo . getDestination ( ) ; }
org . junit . Assert . assertNull ( producer . getDestination ( ) )
testRGBThreads ( ) { int numberOfThreads = 25 ; java . util . List < java . lang . Thread > l = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < numberOfThreads ; i ++ ) { java . lang . Thread t = new java . lang . Thread ( new java . lang . Runnable ( ) { @ de . lmu . ifi . dbs . jfeaturelib . features . Override public void run ( ) { try { ij . process . ColorProcessor processor = new ij . process . ColorProcessor ( javax . imageio . ImageIO . read ( new java . io . File ( de . lmu . ifi . dbs . jfeaturelib . features . MyRGBThreadTest . class . getResource ( "/test.jpg" ) . toURI ( ) ) ) ) ; for ( int j = 0 ; j < 200 ; j ++ ) { de . lmu . ifi . dbs . jfeaturelib . features . Histogram histogram = new de . lmu . ifi . dbs . jfeaturelib . features . Histogram ( ) ; histogram . type = Histogram . TYPE . RGB ; histogram . bins = 128 ; histogram . run ( processor ) ; histogram . getFeatures ( ) ; } } catch ( java . lang . Throwable ex ) { threadException = ex ; } } } ) ; t . start ( ) ; l . add ( t ) ; } java . lang . String message = "" ; for ( java . lang . Thread t : l ) { t . join ( ) ; if ( ( threadException ) != null ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; threadException . printStackTrace ( new java . io . PrintStream ( baos ) ) ; message = baos . toString ( ) ; } "<AssertPlaceHolder>" ; } } toString ( ) { return ( ( ( ( "DerivativeImage{" + "kernelX=" ) + ( de . lmu . ifi . dbs . utilities . Arrays2 . join ( kernelX , "<sp>" ) ) ) + ",<sp>kernelY=" ) + ( de . lmu . ifi . dbs . utilities . Arrays2 . join ( kernelY , "<sp>" ) ) ) + '}' ; }
org . junit . Assert . assertNull ( message , threadException )
test_simple ( ) { byte [ ] key = "test" . getBytes ( ) ; byte [ ] nextKey = com . google . cloud . bigtable . util . RowKeyUtil . calculateTheClosestNextRowKeyForPrefix ( key ) ; "<AssertPlaceHolder>" ; } calculateTheClosestNextRowKeyForPrefix ( byte [ ] ) { int offset = rowKeyPrefix . length ; while ( offset > 0 ) { if ( ( rowKeyPrefix [ ( offset - 1 ) ] ) != ( ( byte ) ( 255 ) ) ) { break ; } offset -- ; } if ( offset == 0 ) { return com . google . cloud . bigtable . util . RowKeyUtil . EMPTY_KEY ; } byte [ ] newStopRow = java . util . Arrays . copyOfRange ( rowKeyPrefix , 0 , offset ) ; ( newStopRow [ ( ( newStopRow . length ) - 1 ) ] ) ++ ; return newStopRow ; }
org . junit . Assert . assertEquals ( ( ( byte ) ( ( key [ ( ( key . length ) - 1 ) ] ) + 1 ) ) , nextKey [ ( ( key . length ) - 1 ) ] )
testCreate ( ) { org . oscarehr . common . model . RoomDemographic entity = new org . oscarehr . common . model . RoomDemographic ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( entity ) ; entity . getId ( ) . setDemographicNo ( 1 ) ; entity . getId ( ) . setRoomId ( 1 ) ; dao . persist ( entity ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; }
org . junit . Assert . assertNotNull ( entity . getId ( ) )
testBatchWriteCompletesAfterClose ( ) { java . nio . ByteBuffer data = java . nio . ByteBuffer . wrap ( "DATA" . getBytes ( ) ) ; final int iterations = 10 ; for ( int i = 0 ; i < iterations ; i ++ ) { journal . write ( data , false ) ; } journal . close ( ) ; "<AssertPlaceHolder>" ; } getInflightWrites ( ) { return inflightWrites ; }
org . junit . Assert . assertTrue ( journal . getInflightWrites ( ) . isEmpty ( ) )
testDefaultStyle ( ) { factory . setServiceClass ( null ) ; "<AssertPlaceHolder>" ; } discoverStyle ( ) { if ( isJaxws ( ) ) { return org . apache . cxf . tools . java2wsdl . processor . FrontendFactory . Style . Jaxws ; } return org . apache . cxf . tools . java2wsdl . processor . FrontendFactory . Style . Simple ; }
org . junit . Assert . assertEquals ( FrontendFactory . Style . Jaxws , factory . discoverStyle ( ) )
shouldValidateAndReturnTrueWhenGroupByPropertiesInSchema ( ) { final uk . gov . gchq . gaffer . store . schema . ViewValidator validator = new uk . gov . gchq . gaffer . store . schema . ViewValidator ( ) ; final uk . gov . gchq . gaffer . data . elementdefinition . view . View view = new uk . gov . gchq . gaffer . data . elementdefinition . view . View . Builder ( ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . data . elementdefinition . view . ViewElementDefinition . Builder ( ) . groupBy ( TestPropertyNames . PROP_1 ) . build ( ) ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . data . elementdefinition . view . ViewElementDefinition . Builder ( ) . groupBy ( TestPropertyNames . PROP_1 , TestPropertyNames . PROP_2 ) . build ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . type ( "vertex" , java . lang . String . class ) . type ( "string|ColumnQualifier" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . clazz ( java . lang . String . class ) . build ( ) ) . type ( "string|Value" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . clazz ( java . lang . String . class ) . build ( ) ) . type ( "true" , uk . gov . gchq . gaffer . store . schema . Boolean . class ) . entity ( TestGroups . ENTITY , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . vertex ( "vertex" ) . property ( TestPropertyNames . PROP_1 , "string|ColumnQualifier" ) . property ( TestPropertyNames . PROP_2 , "string|ColumnQualifier" ) . property ( TestPropertyNames . PROP_3 , "string|Value" ) . groupBy ( TestPropertyNames . PROP_1 ) . build ( ) ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . store . schema . SchemaEdgeDefinition . Builder ( ) . source ( "vertex" ) . destination ( "vertex" ) . directed ( "true" ) . property ( TestPropertyNames . PROP_1 , "string|ColumnQualifier" ) . property ( TestPropertyNames . PROP_2 , "string|ColumnQualifier" ) . property ( TestPropertyNames . PROP_3 , "string|Value" ) . groupBy ( TestPropertyNames . PROP_1 , TestPropertyNames . PROP_2 ) . build ( ) ) . visibilityProperty ( TestPropertyNames . PROP_2 ) . build ( ) ; final uk . gov . gchq . koryphe . ValidationResult result = validator . validate ( view , schema , uk . gov . gchq . gaffer . store . schema . ViewValidatorTest . ALL_STORE_TRAITS ) ; "<AssertPlaceHolder>" ; } validate ( uk . gov . gchq . gaffer . data . elementdefinition . view . View , uk . gov . gchq . gaffer . store . schema . Schema , java . util . Set ) { final boolean isStoreOrdered = storeTraits . contains ( StoreTrait . ORDERED ) ; final uk . gov . gchq . koryphe . ValidationResult result = new uk . gov . gchq . koryphe . ValidationResult ( ) ; if ( null != view ) { final uk . gov . gchq . koryphe . ValidationResult entitiesResult = new uk . gov . gchq . koryphe . ValidationResult ( ) ; validateEntities ( view , schema , storeTraits , isStoreOrdered , result ) ; if ( ! ( entitiesResult . isValid ( ) ) ) { result . add ( entitiesResult ) ; final uk . gov . gchq . koryphe . ValidationResult edgeResult = new uk . gov . gchq . koryphe . ValidationResult ( ) ; validateEdge ( view , schema , storeTraits , isStoreOrdered , result ) ; if ( ! ( edgeResult . isValid ( ) ) ) { result . add ( edgeResult ) ; } } } return result ; }
org . junit . Assert . assertTrue ( result . isValid ( ) )
testJAXBCrossContributionSCA ( ) { itest . common . intf . ClientIntf client = itest . CrossContribTestCase . node . getService ( itest . common . intf . ClientIntf . class , "ClientSCA" ) ; "<AssertPlaceHolder>" ; client . callJAXBCrossContribution ( ) ; } getService ( java . lang . Class , java . lang . String ) { try { return ( ( B ) ( node . getClass ( ) . getMethod ( "getService" , java . lang . Class . class , java . lang . String . class ) . invoke ( node , businessInterface , serviceName ) ) ) ; } catch ( java . lang . Throwable e ) { org . apache . tuscany . sca . node . NodeFactory . NodeProxy . handleException ( e ) ; return null ; } }
org . junit . Assert . assertNotNull ( client )
testDestroy ( ) { tested . open ( session , callback ) ; tested . destroy ( ) ; "<AssertPlaceHolder>" ; verify ( canvasHandler , never ( ) ) . destroy ( ) ; verify ( view , times ( 1 ) ) . clear ( ) ; } getInstance ( ) { return delegate . getInstance ( ) ; }
org . junit . Assert . assertNull ( tested . getInstance ( ) )
testGetInstance ( ) { com . aliyuncs . endpoint . location . model . v20150612 . DescribeEndpointsResponse response = new com . aliyuncs . endpoint . location . model . v20150612 . DescribeEndpointsResponse ( ) ; com . aliyuncs . transform . UnmarshallerContext context = new com . aliyuncs . transform . UnmarshallerContext ( ) ; java . util . Map < java . lang . String , java . lang . String > responseMap = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; responseMap . put ( "DescribeEndpointsResponse.RequestId" , "requestid" ) ; context . setResponseMap ( responseMap ) ; response . getInstance ( context ) ; "<AssertPlaceHolder>" ; } getRequestId ( ) { return this . requestId ; }
org . junit . Assert . assertEquals ( "requestid" , response . getRequestId ( ) )
testGetJSApiTicket ( ) { com . belerweb . social . weixin . bean . JSApiTicket result = weixin . getJsApiTicket ( ) ; "<AssertPlaceHolder>" ; com . belerweb . social . weixin . api . WeixinTest . logger . info ( result . getJsonObject ( ) . toString ( ) ) ; } getJsApiTicket ( ) { if ( ( ( ( jsApiTicket ) == null ) || ( ( jsApiTicketTime ) == null ) ) || ( ( ( ( new java . util . Date ( ) . getTime ( ) ) - ( jsApiTicketTime . getTime ( ) ) ) / 1000 ) > ( jsApiTicket . getExpiresIn ( ) ) ) ) { java . util . List < org . apache . http . NameValuePair > params = new java . util . ArrayList < org . apache . http . NameValuePair > ( ) ; addParameter ( params , "access_token" , getAccessToken ( ) . getToken ( ) ) ; addParameter ( params , "type" , "jsapi" ) ; java . lang . String json = get ( ( "https://api.weixin.qq.com/cgi-bin/ticket/getticket?" + ( org . apache . commons . lang . StringUtils . join ( params , "&" ) ) ) , params ) ; com . belerweb . social . bean . Result < com . belerweb . social . weixin . bean . JSApiTicket > result = com . belerweb . social . bean . Result . parse ( json , com . belerweb . social . weixin . bean . JSApiTicket . class ) ; if ( result . success ( ) ) { jsApiTicket = result . getResult ( ) ; jsApiTicketTime = new java . util . Date ( ) ; } } return jsApiTicket ; }
org . junit . Assert . assertNotNull ( result )
searchAssignedAndPendingHumanTasksFor ( ) { final long rootProcessDefinitionId = 10 ; final long userId = 6 ; final org . bonitasoft . engine . persistence . QueryOptions options = new org . bonitasoft . engine . persistence . QueryOptions ( 0 , 10 ) ; final java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( "userId" , userId ) ; parameters . put ( "rootProcessDefinitionId" , rootProcessDefinitionId ) ; when ( persistenceService . searchEntity ( org . bonitasoft . engine . core . process . instance . model . SHumanTaskInstance . class , "AssignedAndPendingByRootProcessFor" , options , parameters ) ) . thenReturn ( new java . util . ArrayList < org . bonitasoft . engine . core . process . instance . model . SHumanTaskInstance > ( ) ) ; final java . util . List < org . bonitasoft . engine . core . process . instance . model . SHumanTaskInstance > result = activityInstanceServiceImpl . searchAssignedAndPendingHumanTasksFor ( rootProcessDefinitionId , userId , options ) ; "<AssertPlaceHolder>" ; } searchAssignedAndPendingHumanTasksFor ( long , long , org . bonitasoft . engine . persistence . QueryOptions ) { final java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( "userId" , userId ) ; parameters . put ( "rootProcessDefinitionId" , rootProcessDefinitionId ) ; return getPersistenceService ( ) . searchEntity ( org . bonitasoft . engine . core . process . instance . model . SHumanTaskInstance . class , org . bonitasoft . engine . core . process . instance . impl . ActivityInstanceServiceImpl . ASSIGNED_AND_PENDING_BY_ROOT_PROCESS_FOR , queryOptions , parameters ) ; }
org . junit . Assert . assertNotNull ( result )
testGetObject ( ) { final java . lang . String key = "object" ; java . lang . Object result1 = cache . get ( key , new java . util . concurrent . Callable < java . lang . Object > ( ) { @ net . neoremind . mycode . common . cache . Override public java . lang . Object call ( ) throws net . neoremind . mycode . common . cache . Exception { return new java . lang . Object ( ) ; } } ) ; java . lang . Object result2 = cache . get ( key , new java . util . concurrent . Callable < java . lang . Object > ( ) { @ net . neoremind . mycode . common . cache . Override public java . lang . Object call ( ) throws net . neoremind . mycode . common . cache . Exception { return new java . lang . Object ( ) ; } } ) ; "<AssertPlaceHolder>" ; } call ( ) { System . out . println ( "call<sp>execute.." ) ; TimeUnit . SECONDS . sleep ( 1 ) ; return 7 ; }
org . junit . Assert . assertEquals ( result1 , result2 )
testTrainingDefault ( ) { java . io . File temp = java . io . File . createTempFile ( "fannj_" , ".tmp" ) ; temp . deleteOnExit ( ) ; org . apache . commons . io . IOUtils . copy ( this . getClass ( ) . getResourceAsStream ( "xor.data" ) , new java . io . FileOutputStream ( temp ) ) ; java . util . List < com . googlecode . fannj . Layer > layers = new java . util . ArrayList < com . googlecode . fannj . Layer > ( ) ; layers . add ( com . googlecode . fannj . Layer . create ( 2 ) ) ; layers . add ( com . googlecode . fannj . Layer . create ( 3 , ActivationFunction . FANN_SIGMOID_SYMMETRIC ) ) ; layers . add ( com . googlecode . fannj . Layer . create ( 1 , ActivationFunction . FANN_SIGMOID_SYMMETRIC ) ) ; com . googlecode . fannj . Fann fann = new com . googlecode . fannj . Fann ( layers ) ; com . googlecode . fannj . Trainer trainer = new com . googlecode . fannj . Trainer ( fann ) ; float desiredError = 0.001F ; float mse = trainer . train ( temp . getPath ( ) , 500000 , 1000 , desiredError ) ; "<AssertPlaceHolder>" ; } train ( java . lang . String , int , int , float ) { com . googlecode . fannj . Trainer . fann_train_on_file ( fann . ann , trainingFile , maxEpochs , epochsBetweenReports , desiredError ) ; return com . googlecode . fannj . Trainer . fann_get_MSE ( fann . ann ) ; }
org . junit . Assert . assertTrue ( ( "" + mse ) , ( mse <= desiredError ) )
create_and_get ( ) { final org . apache . rya . indexing . entity . model . Entity entity = org . apache . rya . indexing . entity . model . Entity . builder ( ) . setSubject ( new org . apache . rya . api . domain . RyaIRI ( "urn:GTIN-14/00012345600012" ) ) . setExplicitType ( new org . apache . rya . api . domain . RyaIRI ( "urn:icecream" ) ) . setProperty ( new org . apache . rya . api . domain . RyaIRI ( "urn:icecream" ) , new org . apache . rya . indexing . entity . model . Property ( new org . apache . rya . api . domain . RyaIRI ( "urn:brand" ) , new org . apache . rya . api . domain . RyaType ( org . eclipse . rdf4j . model . vocabulary . XMLSchema . STRING , "Awesome<sp>Icecream" ) ) ) . setProperty ( new org . apache . rya . api . domain . RyaIRI ( "urn:icecream" ) , new org . apache . rya . indexing . entity . model . Property ( new org . apache . rya . api . domain . RyaIRI ( "urn:flavor" ) , new org . apache . rya . api . domain . RyaType ( org . eclipse . rdf4j . model . vocabulary . XMLSchema . STRING , "Chocolate" ) ) ) . build ( ) ; final org . apache . rya . indexing . entity . storage . EntityStorage storage = new org . apache . rya . indexing . entity . storage . mongo . MongoEntityStorage ( super . getMongoClient ( ) , org . apache . rya . indexing . entity . storage . mongo . MongoEntityStorageIT . RYA_INSTANCE_NAME ) ; storage . create ( entity ) ; final java . util . Optional < org . apache . rya . indexing . entity . model . Entity > storedEntity = storage . get ( new org . apache . rya . api . domain . RyaIRI ( "urn:GTIN-14/00012345600012" ) ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( ( metadata ) == null ) { metadata = getMetadataFromTable ( ) ; } return metadata ; }
org . junit . Assert . assertEquals ( entity , storedEntity . get ( ) )
shouldFailToSelectAWritableRemoveLocation ( ) { givenAFileWithSeveralLocations ( ) ; givenThisManyLocationsAreOffline ( attributes . getLocations ( ) . size ( ) ) ; whenRemoveTargetIsSelected ( ) ; "<AssertPlaceHolder>" ; } whenRemoveTargetIsSelected ( ) { try { selected = locationSelector . selectRemoveTarget ( collection , null ) ; } catch ( java . lang . Exception e ) { org . dcache . resilience . util . LOGGER . error ( "{}" , new org . dcache . resilience . util . ExceptionMessage ( e ) ) ; } }
org . junit . Assert . assertNull ( selected )
shouldGenerateMapFromElementFieldsAndConstants ( ) { final java . lang . Object vertex = "source<sp>vertex" ; final java . lang . String prop1 = "property<sp>1" ; final int count = 10 ; final uk . gov . gchq . gaffer . data . element . Element element = new uk . gov . gchq . gaffer . data . element . Entity . Builder ( ) . group ( TestGroups . ENTITY ) . vertex ( vertex ) . property ( TestPropertyNames . PROP_1 , prop1 ) . property ( TestPropertyNames . COUNT , count ) . build ( ) ; final uk . gov . gchq . gaffer . data . generator . MapGenerator generator = new uk . gov . gchq . gaffer . data . generator . MapGenerator . Builder ( ) . vertex ( "property<sp>1" 0 ) . group ( "field2" ) . property ( TestPropertyNames . COUNT , "field3" ) . property ( TestPropertyNames . PROP_1 , "field4" ) . source ( "field5" ) . property ( "unknown<sp>property" , "field6" ) . constant ( "constant1" , "constantValue1" ) . build ( ) ; final java . util . Map < java . lang . String , java . lang . Object > map = generator . _apply ( element ) ; final java . util . Map < java . lang . String , java . lang . Object > expectedMap = new java . util . LinkedHashMap ( ) ; expectedMap . put ( "property<sp>1" 0 , vertex ) ; expectedMap . put ( "field2" , TestGroups . ENTITY ) ; expectedMap . put ( "field3" , count ) ; expectedMap . put ( "field4" , prop1 ) ; expectedMap . put ( "constant1" , "constantValue1" ) ; "<AssertPlaceHolder>" ; } put ( uk . gov . gchq . gaffer . graph . GraphSerialisable , uk . gov . gchq . gaffer . federatedstore . FederatedAccess ) { if ( graph != null ) { java . lang . String graphId = graph . getDeserialisedConfig ( ) . getGraphId ( ) ; try { if ( null == access ) { throw new java . lang . IllegalArgumentException ( uk . gov . gchq . gaffer . federatedstore . FederatedGraphStorage . ACCESS_IS_NULL ) ; } if ( null != ( graphLibrary ) ) { graphLibrary . checkExisting ( graphId , graph . getDeserialisedSchema ( ) , graph . getDeserialisedProperties ( ) ) ; } validateExisting ( graph ) ; final uk . gov . gchq . gaffer . graph . Graph builtGraph = graph . getGraph ( ) ; if ( isCacheEnabled ( ) ) { addToCache ( builtGraph , access ) ; } java . util . Set < uk . gov . gchq . gaffer . graph . Graph > existingGraphs = storage . get ( access ) ; if ( null == existingGraphs ) { existingGraphs = com . google . common . collect . Sets . newHashSet ( builtGraph ) ; storage . put ( access , existingGraphs ) ; } else { existingGraphs . add ( builtGraph ) ; } } catch ( final java . lang . Exception e ) { throw new uk . gov . gchq . gaffer . federatedstore . exception . StorageException ( ( ( ( "Error<sp>adding<sp>graph<sp>" + graphId ) + "<sp>to<sp>storage<sp>due<sp>to:<sp>" ) + ( e . getMessage ( ) ) ) , e ) ; } } else { throw new uk . gov . gchq . gaffer . federatedstore . exception . StorageException ( "Graph<sp>cannot<sp>be<sp>null" ) ; } }
org . junit . Assert . assertEquals ( expectedMap , map )
whenAssertingArraysEquality_thenEqual ( ) { char [ ] expected = new char [ ] { 'J' , 'u' , 'n' , 'i' , 't' } ; char [ ] actual = "Junit" . toCharArray ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertArrayEquals ( expected , actual )
marshallCatalogSensorsDeleteInputMessage ( ) { final org . sentilo . platform . client . core . domain . CatalogDeleteInputMessage message = new org . sentilo . platform . client . core . domain . CatalogDeleteInputMessage ( org . sentilo . platform . client . test . converter . DefaultStringMessageConverterTest . PROVIDER_ID ) ; final java . lang . String [ ] sensors = new java . lang . String [ ] { "1" , "2" } ; message . setSensors ( sensors ) ; final java . lang . String json = converter . marshal ( message ) ; final java . lang . String expectedJson = "{\"sensors\":[\"1\",\"2\"]}" ; "<AssertPlaceHolder>" ; } marshal ( java . lang . Object ) { return writeInternalAndReturnString ( message ) ; }
org . junit . Assert . assertEquals ( expectedJson , json )
testWithPassedRepository ( ) { java . lang . System . setProperty ( "maven.repo.local" , tmpdir . newFolder ( "repository" ) . getAbsolutePath ( ) ) ; java . lang . System . setProperty ( "remote.maven.repo" , "http://repository.jboss.org/nexus/content/groups/public/,https://maven-central.storage.googleapis.com/" ) ; try { java . lang . Module module = moduleLoader . loadModule ( org . jboss . modules . MavenResourceTest . MODULE_ID ) ; java . net . URL url = module . getResource ( "org/jboss/resteasy/plugins/providers/jackson/ResteasyJacksonProvider.class" ) ; System . out . println ( url ) ; "<AssertPlaceHolder>" ; } finally { java . lang . System . clearProperty ( "maven.repo.local" ) ; java . lang . System . clearProperty ( "remote.repository" ) ; } } getResource ( java . lang . String ) { return null ; }
org . junit . Assert . assertNotNull ( url )
blocksIfNoInterval ( ) { net . time4j . range . IntervalCollection < net . time4j . PlainDate > windows = net . time4j . range . IntervalCollection . onDateAxis ( ) ; "<AssertPlaceHolder>" ; } withBlocks ( ) { if ( ( this . intervals . size ( ) ) < 2 ) { return this ; } net . time4j . range . Boundary < T > s ; net . time4j . range . Boundary < T > e ; boolean calendrical = this . isCalendrical ( ) ; net . time4j . range . IntervalEdge edge = ( calendrical ) ? IntervalEdge . CLOSED : IntervalEdge . OPEN ; java . util . List < net . time4j . range . ChronoInterval < T > > gaps = this . withGaps ( ) . intervals ; java . util . List < net . time4j . range . ChronoInterval < T > > blocks = new java . util . ArrayList ( ) ; T start = this . getMinimum ( ) ; for ( int i = 0 , n = gaps . size ( ) ; i < n ; i ++ ) { T end = gaps . get ( i ) . getStart ( ) . getTemporal ( ) ; if ( calendrical ) { end = this . getTimeLine ( ) . stepBackwards ( end ) ; } s = this . createStartBoundary ( start ) ; e = net . time4j . range . Boundary . of ( edge , end ) ; blocks . add ( this . newInterval ( s , e ) ) ; net . time4j . range . Boundary < T > b = gaps . get ( i ) . getEnd ( ) ; start = b . getTemporal ( ) ; if ( b . isClosed ( ) ) { start = this . getTimeLine ( ) . stepForward ( start ) ; } } T max = this . getMaximum ( ) ; s = this . createStartBoundary ( start ) ; if ( ( max != null ) && ( ! calendrical ) ) { max = this . getTimeLine ( ) . stepForward ( max ) ; } if ( max == null ) { e = net . time4j . range . Boundary . infiniteFuture ( ) ; } else { e = net . time4j . range . Boundary . of ( edge , max ) ; } blocks . add ( this . newInterval ( s , e ) ) ; return this . create ( blocks ) ; }
org . junit . Assert . assertThat ( windows . withBlocks ( ) . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) )
test03 ( ) { com . itextpdf . kernel . pdf . PdfDocument pdfDocument = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfReader ( ( ( com . itextpdf . kernel . pdf . canvas . parser . BidiTextExtractionTest . sourceFolder ) + "in03.pdf" ) ) ) ; java . lang . String expectedText = "<sp>world<sp>.<sp>Hello<sp>" ; java . lang . String actualText = com . itextpdf . kernel . pdf . canvas . parser . PdfTextExtractor . getTextFromPage ( pdfDocument . getPage ( 1 ) , new com . itextpdf . kernel . pdf . canvas . parser . listener . LocationTextExtractionStrategy ( ) ) ; "<AssertPlaceHolder>" ; } getPage ( com . itextpdf . kernel . pdf . PdfDictionary ) { int pageNum = getPageNumber ( pageDictionary ) ; if ( pageNum > 0 ) { return getPage ( pageNum ) ; } return null ; }
org . junit . Assert . assertEquals ( expectedText , actualText )
test1 ( ) { java . lang . String passwordString = "foo" ; com . psddev . dari . util . Password password = com . psddev . dari . util . Password . create ( passwordString ) ; "<AssertPlaceHolder>" ; } check ( java . lang . String ) { java . lang . String [ ] dataParts = parseData ( ) ; if ( dataParts == null ) { return false ; } java . lang . String algorithm = dataParts [ 0 ] ; java . lang . String salt = dataParts [ 1 ] ; java . lang . String hash = dataParts [ 2 ] ; return hash . equals ( com . psddev . dari . util . Password . hash ( algorithm , salt , string ) ) ; }
org . junit . Assert . assertTrue ( password . check ( passwordString ) )
test_FiniteCapacityItemProduct_QtyPlanned_QtyMoved ( ) { final de . metas . handlingunits . impl . HUPIItemProductDisplayNameBuilder builder = new de . metas . handlingunits . impl . HUPIItemProductDisplayNameBuilder ( ) ; final de . metas . handlingunits . model . I_M_HU_PI_Item_Product piItemProduct = createM_HU_PI_Item_Product ( "IFCO" , "10" , false , "Kg" ) ; final java . lang . String displayNameActual = builder . setM_HU_PI_Item_Product ( piItemProduct ) . setQtyTUPlanned ( new java . math . BigDecimal ( "33" ) ) . setQtyTUMoved ( new java . math . BigDecimal ( "22" ) ) . build ( ) ; final java . lang . String displayNameExpected = "22<sp>/<sp>33<sp>x<sp>[IFCO<sp>x<sp>10<sp>Kg]" ; "<AssertPlaceHolder>" ; } build ( ) { final de . metas . aggregation . model . I_C_Aggregation aggregation = org . adempiere . model . InterfaceWrapperHelper . newInstance ( de . metas . aggregation . model . I_C_Aggregation . class , context ) ; aggregation . setName ( name ) ; aggregation . setAD_Table_ID ( adTableId ) ; aggregation . setIsDefault ( isDefault ) ; aggregation . setIsDefaultPO ( isDefaultPO ) ; aggregation . setIsDefaultSO ( isDefaultSO ) ; de . metas . util . Check . assumeNotEmpty ( aggregationUsageLevel , "aggregationUsageLevel<sp>not<sp>empty" ) ; aggregation . setAggregationUsageLevel ( aggregationUsageLevel ) ; org . adempiere . model . InterfaceWrapperHelper . save ( aggregation ) ; for ( final de . metas . aggregation . model . C_AggregationItem_Builder itemBuilder : itemBuilders ) { itemBuilder . setC_Aggregation ( aggregation ) ; itemBuilder . build ( ) ; } return aggregation ; }
org . junit . Assert . assertEquals ( displayNameExpected , displayNameActual )
shouldNotBeValidWithSamePicture ( ) { io . gravitee . management . model . InlinePictureEntity apiPicture = mock ( io . gravitee . management . model . InlinePictureEntity . class ) ; when ( apiPicture . getContent ( ) ) . thenReturn ( "abcd" . getBytes ( ) ) ; when ( mockApiService . getPicture ( io . gravitee . management . service . ApiQualityMetricLogoTest . API_ID ) ) . thenReturn ( apiPicture ) ; when ( mockApiService . getDefaultPicture ( ) ) . thenReturn ( "abcd" . getBytes ( ) ) ; io . gravitee . management . model . api . ApiEntity api = mock ( io . gravitee . management . model . api . ApiEntity . class ) ; when ( api . getId ( ) ) . thenReturn ( io . gravitee . management . service . ApiQualityMetricLogoTest . API_ID ) ; boolean valid = srv . isValid ( api ) ; "<AssertPlaceHolder>" ; } isValid ( io . gravitee . management . model . api . ApiEntity ) { return ( ( api . getViews ( ) ) != null ) && ( ! ( api . getViews ( ) . isEmpty ( ) ) ) ; }
org . junit . Assert . assertFalse ( valid )
testServiceAccountKey_none ( ) { page . createControl ( shellCreator . getShell ( ) ) ; "<AssertPlaceHolder>" ; } getServiceAccountKey ( ) { return runOptionsDefaultsComponent . getServiceAccountKey ( ) ; }
org . junit . Assert . assertEquals ( "" , page . getServiceAccountKey ( ) )
testSimpleCharacters ( ) { org . eclipse . rdf4j . repository . config . ConfigTemplate temp = new org . eclipse . rdf4j . repository . config . ConfigTemplate ( "{%value%}" ) ; java . util . Map < java . lang . String , java . lang . String > map = new java . util . LinkedHashMap ( ) ; map . put ( "value" , "sob" ) ; "<AssertPlaceHolder>" ; } render ( java . util . Map ) { java . lang . StringBuffer result = new java . lang . StringBuffer ( template . length ( ) ) ; java . util . regex . Matcher matcher = org . eclipse . rdf4j . repository . config . ConfigTemplate . TOKEN_PATTERN . matcher ( template ) ; while ( matcher . find ( ) ) { java . lang . String group = matcher . group ( ) ; java . lang . String [ ] tokensArray = group . substring ( 2 , ( ( group . length ( ) ) - 2 ) ) . split ( "\\|" ) ; java . lang . String var = tokensArray [ 0 ] . trim ( ) ; java . lang . String value = valueMap . get ( var ) ; if ( value == null ) { java . util . List < java . lang . String > values = variableMap . get ( var ) ; value = ( values . isEmpty ( ) ) ? "" : values . get ( 0 ) ; } if ( ( ! ( value . isEmpty ( ) ) ) && ( multilineMap . containsKey ( var ) ) ) { value = org . eclipse . rdf4j . repository . config . ConfigTemplate . escapeMultilineQuotes ( multilineMap . get ( var ) , value ) ; } matcher . appendReplacement ( result , java . util . regex . Matcher . quoteReplacement ( value ) ) ; } matcher . appendTail ( result ) ; return result . toString ( ) ; }
org . junit . Assert . assertEquals ( "sob" , temp . render ( map ) )
testModelRowCountAfterInsertNotSorted ( ) { int rows = controller . getModelRowCount ( ) ; ( ( org . jdesktop . test . AncientSwingTeam ) ( controller . getModel ( ) ) ) . insertRows ( 0 , 1 ) ; "<AssertPlaceHolder>" ; } getModelRowCount ( ) { return delegate . getModelRowCount ( ) ; }
org . junit . Assert . assertEquals ( rows , controller . getModelRowCount ( ) )
testCorrectePeriodeGemeenteGeenPeriode ( ) { java . util . List < nl . bzk . brp . model . validatie . Melding > meldingen = brby0905 . executeer ( null , maakPersoonOverlijden ( maakPlaats ( ( ( short ) ( 24 ) ) , "plaats" , null , null ) , 20120303 ) , maakActie ( "id.actie1" , 20120303 , 20120404 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
test_shallow_copy ( ) { org . omg . CORBA . Any any1 = setup . getClientOrb ( ) . create_any ( ) ; any1 . insert_string ( "foobar" ) ; org . omg . CORBA . Any any2 = setup . getClientOrb ( ) . create_any ( ) ; ( ( org . jacorb . orb . Any ) ( any2 ) ) . insert ( any1 . type ( ) , any1 . extract_string ( ) ) ; "<AssertPlaceHolder>" ; } extract_string ( ) { checkExtract ( TCKind . _tk_string , "Cannot<sp>extract<sp>string" ) ; 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_string ( ) ; } else { throw new org . omg . CORBA . INTERNAL ( ( "Encountered<sp>unexpected<sp>type<sp>of<sp>value:<sp>" + ( value . getClass ( ) ) ) ) ; } }
org . junit . Assert . assertTrue ( ( ( any1 . extract_string ( ) ) == ( any2 . extract_string ( ) ) ) )
testStringExtent_mustNotExpandLineBreaks ( ) { org . eclipse . swt . graphics . Point singleLine = org . eclipse . rap . rwt . internal . textsize . TextSizeUtil . stringExtent ( getFont ( ) , "First<sp>Line" ) ; org . eclipse . swt . graphics . Point multiLine = org . eclipse . rap . rwt . internal . textsize . TextSizeUtil . stringExtent ( getFont ( ) , "First<sp>Line\nSecond<sp>Line" ) ; "<AssertPlaceHolder>" ; } getFont ( ) { return new org . eclipse . swt . graphics . Font ( display , org . eclipse . rap . rwt . internal . textsize . TextSizeUtil_Test . FONT_DATA ) ; }
org . junit . Assert . assertEquals ( singleLine . y , multiLine . y )
testBadPeriodInInterval ( ) { try { modelOf ( "timestamp<sp>=<sp>'2015-02-23T10:00:55.000Z;30m;x;5'" ) ; org . junit . Assert . fail ( ) ; } catch ( com . questdb . ex . ParserException e ) { "<AssertPlaceHolder>" ; } } getPosition ( ) { return com . questdb . parser . sql . QueryError . INSTANCE . tl . get ( ) . position ; }
org . junit . Assert . assertEquals ( 12 , com . questdb . parser . sql . QueryError . getPosition ( ) )
shouldDeserialiseEmpty ( ) { final byte [ ] value = serialiser . deserialiseEmpty ( ) ; "<AssertPlaceHolder>" ; } deserialiseEmpty ( ) { return null ; }
org . junit . Assert . assertEquals ( 0 , value . length )
testProcessDefinitionStatisticsQueryCount ( ) { runtimeService . startProcessInstanceByKey ( "ExampleProcess" ) ; executeAvailableJobs ( ) ; long count = managementService . createProcessDefinitionStatisticsQuery ( ) . includeFailedJobs ( ) . includeIncidents ( ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { return count ( ALL_STATES ) ; }
org . junit . Assert . assertEquals ( 1 , count )
testGetTileY ( ) { java . awt . Point p = new java . awt . Point ( 1 , 2 ) ; org . jaitools . tilecache . DiskCachedTile instance = new org . jaitools . tilecache . DiskCachedTile ( java . lang . Integer . valueOf ( 1234 ) , org . jaitools . tilecache . DiskCachedTileTest . image , p . x , p . y , org . jaitools . tilecache . DiskCachedTileTest . raster , false , null ) ; int result = instance . getTileY ( ) ; "<AssertPlaceHolder>" ; } getTileY ( ) { return tileY ; }
org . junit . Assert . assertEquals ( p . y , result )
createEntryMinimal ( ) { final java . lang . String requestBody = "{\"Id\":\"99\"}" ; final org . apache . http . HttpResponse response = postUri ( "Teams()" , requestBody , HttpContentType . APPLICATION_JSON , HttpStatusCodes . CREATED ) ; "<AssertPlaceHolder>" ; checkUri ( "Teams('4')?$format=json" ) ; } getBody ( org . apache . http . HttpResponse ) { org . junit . Assert . assertNotNull ( response ) ; org . junit . Assert . assertNotNull ( response . getEntity ( ) ) ; org . junit . Assert . assertNotNull ( response . getEntity ( ) . getContent ( ) ) ; return com . sap . core . odata . testutil . helper . StringHelper . inputStreamToString ( response . getEntity ( ) . getContent ( ) ) ; }
org . junit . Assert . assertFalse ( getBody ( response ) . isEmpty ( ) )
blockFail ( ) { org . threadly . test . concurrent . TestConditionTest . DelayCondition dc = new org . threadly . test . concurrent . TestConditionTest . DelayCondition ( ( ( DELAY_TIME ) * 100 ) ) ; long startTime = org . threadly . util . Clock . accurateForwardProgressingMillis ( ) ; try { dc . blockTillTrue ( org . threadly . test . concurrent . DELAY_TIME , 1 ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( org . threadly . test . concurrent . TestCondition e ) { "<AssertPlaceHolder>" ; } } accurateForwardProgressingMillis ( ) { return ( ( org . threadly . util . Clock . nowNanos = java . lang . System . nanoTime ( ) ) - ( org . threadly . util . Clock . CLOCK_STARTUP_TIME_NANOS ) ) / ( org . threadly . util . Clock . NANOS_IN_MILLISECOND ) ; }
org . junit . Assert . assertTrue ( ( ( ( org . threadly . util . Clock . accurateForwardProgressingMillis ( ) ) - startTime ) >= ( DELAY_TIME ) ) )
givenOneByteUIntBase128_ByteDataInputStreamReadsCorrectly ( ) { byte [ ] data = new byte [ ] { 63 } ; org . mabb . fontverter . io . FontDataInput in = new org . mabb . fontverter . io . FontDataInputStream ( data ) ; int readerResult = in . readUIntBase128 ( ) ; "<AssertPlaceHolder>" ; } readUIntBase128 ( ) { int accum = 0 ; for ( int i = 0 ; i < 5 ; i ++ ) { int data_byte = readByte ( ) ; if ( ( i == 0 ) && ( data_byte == 128 ) ) throw new java . io . IOException ( "No<sp>leading<sp>0's" ) ; if ( ( accum & - 33554432 ) > 0 ) throw new java . io . IOException ( "UIntBase128<sp>read<sp>error<sp>If<sp>any<sp>of<sp>top<sp>7<sp>bits<sp>are<sp>set<sp>then<sp><<<sp>7<sp>would<sp>overflow" ) ; accum = ( accum << 7 ) | ( data_byte & 127 ) ; if ( ( data_byte & 128 ) == 0 ) { return accum ; } } throw new java . io . IOException ( "UIntBase128<sp>sequence<sp>exceeds<sp>5<sp>bytes" ) ; }
org . junit . Assert . assertEquals ( 63 , readerResult )
testNonNull ( ) { "<AssertPlaceHolder>" ; } getHostname ( ) { return org . eclipse . hono . util . Hostnames . HOSTNAME ; }
org . junit . Assert . assertNotNull ( org . eclipse . hono . util . Hostnames . getHostname ( ) )
test_readUnsignedShort42 ( ) { java . nio . ByteBuffer buf = java . nio . ByteBuffer . allocate ( 2 ) ; buf . putShort ( ( ( short ) ( 42 ) ) ) ; buf . rewind ( ) ; org . kairosdb . util . ByteBufferDataInput dataInput = new org . kairosdb . util . ByteBufferDataInput ( buf ) ; "<AssertPlaceHolder>" ; } readUnsignedShort ( ) { return ( m_buffer . getShort ( ) ) & 65535 ; }
org . junit . Assert . assertEquals ( 42 , dataInput . readUnsignedShort ( ) )
clusterLinksTest ( ) { se . kth . karamel . common . util . Settings . CB_CLASSPATH_MODE = true ; java . lang . String ymlString = com . google . common . io . Resources . toString ( com . google . common . io . Resources . getResource ( "se/kth/karamel/client/model/test-definitions/hopsworks.yml" ) , Charsets . UTF_8 ) ; se . kth . karamel . common . clusterdef . json . JsonCluster definition = se . kth . karamel . backend . ClusterDefinitionService . yamlToJsonObject ( ymlString ) ; java . lang . String links = se . kth . karamel . backend . converter . UserClusterDataExtractor . clusterLinks ( definition , null ) ; java . lang . String expected = "Visit<sp><a<sp>target='_blank'<sp>href='http://www.hops.io/'>Hop's<sp>Website</a><sp>or<sp><a<sp>target='_blank'<sp>" + "href='http://www.karamel.io/'>Karamel's<sp>Website</a>" ; "<AssertPlaceHolder>" ; se . kth . karamel . backend . running . model . ClusterRuntime dummyRuntime = se . kth . karamel . backend . mocking . MockingUtil . dummyRuntime ( definition ) ; links = se . kth . karamel . backend . converter . UserClusterDataExtractor . clusterLinks ( definition , dummyRuntime ) ; expected = "Click<sp><a<sp>target=\'_blank\'<sp>href=\'https://hopsworks1:8181/hop-dashboard\'>here</a><sp>to<sp>launch<sp>hopsworks<sp>in<sp>your<sp>browser\n" + ( "Visit<sp><a<sp>target=\'_blank\'<sp>href=\'http://www.hops.io/\'>Hop\'s<sp>Website</a><sp>or<sp><a<sp>target=\'_blank\'<sp>href=\'http://www.karamel.io/\'>Karamel\'s<sp>Website</a>\n" + "" ) ; } clusterLinks ( se . kth . karamel . common . clusterdef . json . JsonCluster , se . kth . karamel . backend . running . model . ClusterRuntime ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; java . util . HashSet < java . lang . String > cbids = new java . util . HashSet ( ) ; for ( se . kth . karamel . common . clusterdef . json . JsonGroup jg : cluster . getGroups ( ) ) { for ( se . kth . karamel . common . clusterdef . json . JsonCookbook jc : jg . getCookbooks ( ) ) { java . lang . String cbid = jc . getId ( ) ; cbids . add ( cbid ) ; se . kth . karamel . backend . converter . UserClusterDataExtractor . cookbookCache . prepareParallel ( cbids ) ; } } for ( se . kth . karamel . common . clusterdef . json . JsonGroup jg : cluster . getGroups ( ) ) { for ( se . kth . karamel . common . clusterdef . json . JsonCookbook jc : jg . getCookbooks ( ) ) { for ( se . kth . karamel . common . clusterdef . json . JsonRecipe rec : jc . getRecipes ( ) ) { java . lang . String cbid = jc . getId ( ) ; se . kth . karamel . common . cookbookmeta . KaramelizedCookbook cb = se . kth . karamel . backend . converter . UserClusterDataExtractor . cookbookCache . get ( cbid ) ; se . kth . karamel . common . cookbookmeta . MetadataRb metadataRb = cb . getMetadataRb ( ) ; java . util . List < se . kth . karamel . common . cookbookmeta . Recipe > recipes = metadataRb . getRecipes ( ) ; for ( se . kth . karamel . common . cookbookmeta . Recipe recipe : recipes ) { if ( recipe . getCanonicalName ( ) . equalsIgnoreCase ( rec . getCanonicalName ( ) ) ) { java . util . Set < java . lang . String > links = recipe . getLinks ( ) ; for ( java . lang . String link : links ) { if ( link . contains ( Settings . METADATA_INCOMMENT_HOST_KEY ) ) { if ( clusterEntity != null ) { se . kth . karamel . backend . running . model . GroupRuntime ge = se . kth . karamel . backend . converter . UserClusterDataExtractor . findGroup ( clusterEntity , jg . getName ( ) ) ; if ( ge != null ) { java . util . List < se . kth . karamel . backend . running . model . MachineRuntime > machines = ge . getMachines ( ) ; if ( machines != null ) { for ( se . kth . karamel . backend . running . model . MachineRuntime me : ge . getMachines ( ) ) { java . lang . String l = link . replaceAll ( Settings . METADATA_INCOMMENT_HOST_KEY , me . getPublicIp ( ) ) ; builder . append ( l ) . append ( "\n" ) ; } } } } } else { builder . append ( link ) . append ( "\n" ) ; } } } } } } } return builder . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , links . trim ( ) )
dumpAndRestoreWithReplaceOptionShouldWorkCorrectly ( ) { nativeConnection . set ( org . springframework . data . redis . connection . jedis . KEY_1 , org . springframework . data . redis . connection . jedis . VALUE_1 ) ; byte [ ] dumpedValue = clusterConnection . keyCommands ( ) . dump ( org . springframework . data . redis . connection . jedis . JedisClusterConnectionTests . KEY_1_BYTES ) ; nativeConnection . set ( org . springframework . data . redis . connection . jedis . KEY_1 , org . springframework . data . redis . connection . jedis . VALUE_2 ) ; clusterConnection . keyCommands ( ) . restore ( org . springframework . data . redis . connection . jedis . JedisClusterConnectionTests . KEY_1_BYTES , 0 , dumpedValue , true ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return delegate . get ( key ) ; }
org . junit . Assert . assertThat ( nativeConnection . get ( org . springframework . data . redis . connection . jedis . KEY_1 ) , is ( org . springframework . data . redis . connection . jedis . VALUE_1 ) )
testGetTextContext_2 ( ) { java . lang . String document = "<blah<sp>someattribute=\"somevalue\">foo</blah>" ; org . w3c . dom . Element e = org . apache . activemq . artemis . utils . XMLUtil . stringToElement ( document ) ; "<AssertPlaceHolder>" ; } getTextContent ( org . w3c . dom . Node ) { if ( n . hasChildNodes ( ) ) { java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; org . w3c . dom . NodeList nl = n . getChildNodes ( ) ; for ( int i = 0 ; i < ( nl . getLength ( ) ) ; i ++ ) { sb . append ( org . apache . activemq . artemis . utils . XMLUtil . elementToString ( nl . item ( i ) ) ) ; if ( i < ( ( nl . getLength ( ) ) - 1 ) ) { sb . append ( '\n' ) ; } } java . lang . String s = sb . toString ( ) ; if ( ( s . length ( ) ) != 0 ) { return s ; } } return n . getTextContent ( ) ; }
org . junit . Assert . assertEquals ( "foo" , org . apache . activemq . artemis . utils . XMLUtil . getTextContent ( e ) )
testEnsureDeleteBranchNoNotification ( ) { when ( change . getType ( ) ) . thenReturn ( changeTypeDelete ) ; when ( iterChanges . next ( ) ) . thenReturn ( change ) ; when ( changes . iterator ( ) ) . thenReturn ( iterChanges ) ; when ( event . getRefChanges ( ) ) . thenReturn ( changes ) ; when ( eventContext . getEventSource ( ) ) . thenReturn ( event ) ; "<AssertPlaceHolder>" ; } shouldDeliverNotification ( com . nerdwin15 . stash . webhook . service . eligibility . EventContext ) { if ( ! ( com . atlassian . bitbucket . event . pull . PullRequestEvent . class . isAssignableFrom ( context . getEventSource ( ) . getClass ( ) ) ) ) return true ; com . atlassian . bitbucket . event . pull . PullRequestEvent event = ( ( com . atlassian . bitbucket . event . pull . PullRequestEvent ) ( context . getEventSource ( ) ) ) ; if ( ! ( event . getPullRequest ( ) . getState ( ) . equals ( PullRequestState . OPEN ) ) ) return true ; int repoId = context . getRepository ( ) . getId ( ) ; long pullRequestId = event . getPullRequest ( ) . getId ( ) ; if ( pullRequestService . canMerge ( repoId , pullRequestId ) . isConflicted ( ) ) { com . nerdwin15 . stash . webhook . service . eligibility . IsMergeableEligibilityFilter . logger . debug ( "Ignoring<sp>push<sp>event<sp>due<sp>to<sp>conflicts<sp>in<sp>merge" ) ; return false ; } return true ; }
org . junit . Assert . assertFalse ( filter . shouldDeliverNotification ( eventContext ) )
testEndCursorLessThanOffset ( ) { com . google . appengine . api . datastore . QueryResultList < com . google . appengine . api . datastore . Entity > results = executeQuery ( withLimit ( 1 ) ) ; com . google . appengine . api . datastore . Cursor cursor = results . getCursor ( ) ; results = executeQuery ( withEndCursor ( cursor ) . offset ( 3 ) ) ; "<AssertPlaceHolder>" ; } executeQuery ( com . google . appengine . api . datastore . FetchOptions ) { com . google . appengine . api . datastore . Query query = new com . google . appengine . api . datastore . Query ( "Foo" ) . addSort ( "bar" ) ; return service . prepare ( query ) . asQueryResultList ( fetchOptions ) ; }
org . junit . Assert . assertTrue ( results . isEmpty ( ) )
givenEmptyList_sumEqualsZero_thenCorrect ( ) { int sum = com . baeldung . junit4vstestng . SummationServiceIntegrationTest . numbers . stream ( ) . reduce ( 0 , Integer :: sum ) ; "<AssertPlaceHolder>" ; } stream ( ) { return java . util . stream . Stream . of ( com . baeldung . java . enumiteration . DaysOfWeekEnum . values ( ) ) ; }
org . junit . Assert . assertEquals ( 6 , sum )
testGetParametersWithDefaultEntityAndDisabledSecurity ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . mark . scale . MarkScale entity = new org . lnu . is . domain . mark . scale . MarkScale ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
nullProfileDocumentIsReturned ( ) { "<AssertPlaceHolder>" ; } getProfileDocument ( ) { return null ; }
org . junit . Assert . assertNull ( this . user . getProfileDocument ( ) )
test_getPreferredJavaType ( ) { int sqlType = 1 ; int size = 1 ; int decimalDigits = 1 ; java . lang . String result = databaseDataTypesUtils . getPreferredJavaType ( sqlType , size , decimalDigits ) ; "<AssertPlaceHolder>" ; } getPreferredJavaType ( int , int , int ) { if ( ( ( sqlType == ( java . sql . Types . DECIMAL ) ) || ( sqlType == ( java . sql . Types . NUMERIC ) ) ) && ( decimalDigits == 0 ) ) { if ( size == 1 ) { return "java.lang.Boolean" ; } else if ( size < 3 ) { return "java.lang.Byte" ; } else if ( size < 5 ) { return "java.lang.Short" ; } else if ( size < 10 ) { return "java.lang.Integer" ; } else if ( size < 19 ) { return "java.lang.Long" ; } else { return "java.math.BigDecimal" ; } } java . lang . String result = cn . org . rapid_framework . generator . util . typemapping . DatabaseDataTypesUtils . _preferredJavaTypeForSqlType . getString ( sqlType ) ; if ( result == null ) { result = "java.lang.Object" ; } return result ; }
org . junit . Assert . assertNotNull ( result )
testCartesianProductOfFields3 ( ) { java . util . Set < java . lang . String > recordedFields = new java . util . HashSet ( ) ; datawave . query . cardinality . CardinalityRecord cr = new datawave . query . cardinality . CardinalityRecord ( recordedFields , CardinalityRecord . DateType . DOCUMENT ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > valueMap = new java . util . HashMap ( ) ; java . util . List < java . lang . String > list1 = new java . util . ArrayList ( ) ; list1 . add ( "L1V1" ) ; list1 . add ( "L1V2" ) ; list1 . add ( "L1V3" ) ; list1 . add ( "L1V4" ) ; valueMap . put ( "FIELD1" , list1 ) ; java . util . List < java . lang . String > list2 = new java . util . ArrayList ( ) ; list2 . add ( "L2V1" ) ; list2 . add ( "L2V2" ) ; list2 . add ( "FIELD2" 0 ) ; list2 . add ( "L2V4" ) ; valueMap . put ( "FIELD2" , list2 ) ; java . util . List < java . lang . String > results = cr . assembleValues ( "FIELD1|FIELD2" , valueMap ) ; int expextedSize = ( list1 . size ( ) ) * ( list2 . size ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . typeMetadata . size ( ) ; }
org . junit . Assert . assertEquals ( expextedSize , results . size ( ) )
testManageAckBarrierShouldBeOk ( ) { java . lang . Integer ackTimeout = 500 ; java . lang . String barrierPath = "/stratio/decision/barrier" ; java . lang . Integer nodesExpected = 2 ; com . stratio . decision . clustering . ClusterSyncManager clusterSyncManager = mock ( com . stratio . decision . clustering . ClusterSyncManager . class ) ; when ( clusterSyncManager . getClient ( ) ) . thenReturn ( curatorFramework ) ; final com . stratio . decision . clustering . ClusterBarrierManager clusterBarrierManager = org . powermock . api . mockito . PowerMockito . spy ( new com . stratio . decision . clustering . ClusterBarrierManager ( clusterSyncManager , ackTimeout ) ) ; barrier = mock ( org . apache . curator . framework . recipes . barriers . DistributedDoubleBarrier . class ) ; when ( barrier . enter ( anyLong ( ) , any ( java . util . concurrent . TimeUnit . class ) ) ) . thenReturn ( true ) ; org . powermock . api . mockito . PowerMockito . doReturn ( barrier ) . when ( clusterBarrierManager ) . getDistributedDoubleBarrier ( anyString ( ) , anyInt ( ) ) ; "<AssertPlaceHolder>" ; } manageAckBarrier ( java . lang . String , java . lang . Integer ) { org . apache . curator . framework . recipes . barriers . DistributedDoubleBarrier barrier = getDistributedDoubleBarrier ( barrierPath , nodesExpected ) ; return barrier . enter ( ackTimeout , TimeUnit . MILLISECONDS ) ; }
org . junit . Assert . assertEquals ( true , clusterBarrierManager . manageAckBarrier ( barrierPath , nodesExpected ) )
isPublic_A$String_StringIsNull ( ) { java . lang . String methodSignature = null ; boolean actual = org . junithelper . core . util . AccessModifierDetector . isPublic ( methodSignature ) ; boolean expected = false ; "<AssertPlaceHolder>" ; } isPublic ( java . lang . String ) { return ( methodSignature != null ) && ( methodSignature . matches ( ( ( ( org . junithelper . core . util . AccessModifierDetector . RegExp . Prefix ) + "public" ) + ( org . junithelper . core . util . AccessModifierDetector . RegExp . Suffix ) ) ) ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
testHandlerAddedExceptionFromChildHandlerIsPropagated ( ) { final io . netty . util . concurrent . EventExecutorGroup group1 = new io . netty . util . concurrent . DefaultEventExecutorGroup ( 1 ) ; try { final io . netty . util . concurrent . Promise < java . lang . Void > promise = group1 . next ( ) . newPromise ( ) ; final java . util . concurrent . atomic . AtomicBoolean handlerAdded = new java . util . concurrent . atomic . AtomicBoolean ( ) ; final java . lang . Exception exception = new java . lang . RuntimeException ( ) ; io . netty . channel . ChannelPipeline pipeline = new io . netty . channel . local . LocalChannel ( ) . pipeline ( ) ; pipeline . addLast ( group1 , new io . netty . channel . DefaultChannelPipelineTest . CheckExceptionHandler ( exception , promise ) ) ; pipeline . addFirst ( new io . netty . channel . ChannelHandlerAdapter ( ) { @ io . netty . channel . Override public void handlerAdded ( io . netty . channel . ChannelHandlerContext ctx ) throws io . netty . channel . Exception { handlerAdded . set ( true ) ; throw exception ; } } ) ; "<AssertPlaceHolder>" ; io . netty . channel . DefaultChannelPipelineTest . group . register ( pipeline . channel ( ) ) ; promise . syncUninterruptibly ( ) ; } finally { group1 . shutdownGracefully ( ) ; } } get ( ) { return maybeMoreDataToRead ( ) ; }
org . junit . Assert . assertFalse ( handlerAdded . get ( ) )
testFailIfMissingOutputDir ( ) { com . streamsets . pipeline . stage . destination . mapreduce . jobtype . avroconvert . AvroConversionCommonConfig commonConfig = new com . streamsets . pipeline . stage . destination . mapreduce . jobtype . avroconvert . AvroConversionCommonConfig ( ) ; com . streamsets . pipeline . lib . converter . AvroParquetConfig conf = new com . streamsets . pipeline . lib . converter . AvroParquetConfig ( ) ; commonConfig . inputFile = "" ; commonConfig . outputDirectory = getOutputDir ( ) ; commonConfig . overwriteTmpFile = false ; com . streamsets . pipeline . stage . destination . mapreduce . MapReduceExecutor executor = generateExecutor ( commonConfig , conf , java . util . Collections . emptyMap ( ) ) ; com . streamsets . pipeline . sdk . ExecutorRunner runner = new com . streamsets . pipeline . sdk . ExecutorRunner . Builder ( com . streamsets . pipeline . stage . destination . mapreduce . MapReduceDExecutor . class , executor ) . setOnRecordError ( OnRecordError . TO_ERROR ) . build ( ) ; runner . runInit ( ) ; com . streamsets . pipeline . api . Record record = com . streamsets . pipeline . sdk . RecordCreator . create ( ) ; record . set ( com . streamsets . pipeline . api . Field . create ( java . util . Collections . emptyMap ( ) ) ) ; runner . runWrite ( com . google . common . collect . ImmutableList . of ( record ) ) ; "<AssertPlaceHolder>" ; runner . runDestroy ( ) ; } getErrorRecords ( ) { return errorRecords ; }
org . junit . Assert . assertEquals ( 1 , runner . getErrorRecords ( ) . size ( ) )
testSetName ( ) { co . nubetech . hiho . mapreduce . lib . db . ColumnInfo cInfo = new co . nubetech . hiho . mapreduce . lib . db . ColumnInfo ( 1 , java . sql . Types . INTEGER , "name" ) ; cInfo . setName ( "Student" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( "Student" , cInfo . getName ( ) )
testNoLeaseStartDateSet ( ) { org . joda . time . LocalDate endDate = new org . joda . time . LocalDate ( 2016 , 7 , 31 ) ; lease . setEndDate ( endDate ) ; lease . setTenancyEndDate ( endDate ) ; "<AssertPlaceHolder>" ; } getTenancyDuration ( ) { org . incode . module . base . dom . valuetypes . LocalDateInterval ldi ; if ( ( ( getTenancyStartDate ( ) ) != null ) && ( ( getTenancyEndDate ( ) ) != null ) ) { ldi = getEffectiveInterval ( ) ; } else if ( ( ( ( getTenancyStartDate ( ) ) == null ) && ( ( getTenancyEndDate ( ) ) != null ) ) && ( ( getStartDate ( ) ) != null ) ) { ldi = new org . incode . module . base . dom . valuetypes . LocalDateInterval ( getStartDate ( ) , getTenancyEndDate ( ) ) ; } else if ( ( ( ( getTenancyStartDate ( ) ) != null ) && ( ( getTenancyEndDate ( ) ) == null ) ) && ( ( getEndDate ( ) ) != null ) ) { ldi = new org . incode . module . base . dom . valuetypes . LocalDateInterval ( getTenancyStartDate ( ) , getEndDate ( ) ) ; } else { return null ; } if ( ldi . isValid ( ) ) { return org . incode . module . base . dom . utils . JodaPeriodUtils . asSimpleString ( new org . joda . time . Period ( ldi . asInterval ( ) , org . joda . time . PeriodType . yearMonthDay ( ) ) ) ; } return null ; }
org . junit . Assert . assertNull ( lease . getTenancyDuration ( ) )
testByteAnd ( ) { byte theValue = 3 ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 2 , ( theValue & 2 ) , 0 )
getControllersAsEmptyList ( ) { com . occamlab . te . spi . jaxrs . TestSuiteRegistry registry = com . occamlab . te . spi . jaxrs . TestSuiteRegistry . getInstance ( ) ; "<AssertPlaceHolder>" ; } getControllers ( ) { return controllers ; }
org . junit . Assert . assertTrue ( registry . getControllers ( ) . isEmpty ( ) )
testExecuteJobWithDisabledTenantCheck ( ) { java . lang . String noFailProcessInstanceId = engineRule . getRuntimeService ( ) . startProcessInstanceByKey ( "noFail" ) . getId ( ) ; java . lang . String timerJobId = managementService . createJobQuery ( ) . processInstanceId ( noFailProcessInstanceId ) . singleResult ( ) . getId ( ) ; identityService . setAuthentication ( "aUserId" , null ) ; engineRule . getProcessEngineConfiguration ( ) . setTenantCheckEnabled ( false ) ; managementService . executeJob ( timerJobId ) ; org . camunda . bpm . engine . task . TaskQuery taskQuery = engineRule . getTaskService ( ) . createTaskQuery ( ) . processInstanceId ( noFailProcessInstanceId ) ; "<AssertPlaceHolder>" ; } list ( ) { this . resultType = org . camunda . bpm . engine . impl . AbstractNativeQuery . ResultType . LIST ; if ( ( commandExecutor ) != null ) { return ( ( java . util . List < U > ) ( commandExecutor . execute ( this ) ) ) ; } return executeList ( org . camunda . bpm . engine . impl . context . Context . getCommandContext ( ) , getParameterMap ( ) , 0 , Integer . MAX_VALUE ) ; }
org . junit . Assert . assertEquals ( 0 , taskQuery . list ( ) . size ( ) )
testCreateRetryableError ( ) { com . google . cloud . storage . StorageException exception = new com . google . cloud . storage . StorageException ( new java . net . SocketException ( "Socket<sp>closed" ) ) ; expect ( storageRpcMock . open ( com . google . cloud . storage . BlobWriteChannelTest . BLOB_INFO . toPb ( ) , com . google . cloud . storage . BlobWriteChannelTest . EMPTY_RPC_OPTIONS ) ) . andThrow ( exception ) ; expect ( storageRpcMock . open ( com . google . cloud . storage . BlobWriteChannelTest . BLOB_INFO . toPb ( ) , com . google . cloud . storage . BlobWriteChannelTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( com . google . cloud . storage . BlobWriteChannelTest . UPLOAD_ID ) ; replay ( storageRpcMock ) ; writer = new com . google . cloud . storage . BlobWriteChannel ( options , com . google . cloud . storage . BlobWriteChannelTest . BLOB_INFO , com . google . cloud . storage . BlobWriteChannelTest . EMPTY_RPC_OPTIONS ) ; "<AssertPlaceHolder>" ; } isOpen ( ) { return isOpen ; }
org . junit . Assert . assertTrue ( writer . isOpen ( ) )
addSameClientNameInDifferentOrganizations ( ) { jersey = getClient ( developerOrg2AccountSid , developeerOrg2AuthToken ) ; resource = jersey . resource ( getResourceUrl ( ( ( "/2012-04-24/Accounts/" + ( developerOrg2AccountSid ) ) + "/Clients.json" ) ) ) ; params = new com . sun . jersey . core . util . MultivaluedMapImpl ( ) ; params . add ( "Login" , "maria" ) ; params . add ( "Password" , "RestComm1234!" ) ; response = resource . accept ( MediaType . APPLICATION_JSON ) . post ( com . sun . jersey . api . client . ClientResponse . class , params ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
givenInput_whenMatchesClass_thenCorrect ( ) { java . lang . Object obj = 5 ; java . lang . String s = io . vavr . API . Match ( obj ) . of ( io . vavr . API . Case ( io . vavr . API . $ ( io . vavr . Predicates . instanceOf ( java . lang . String . class ) ) , "string<sp>matched" ) , io . vavr . API . Case ( io . vavr . API . $ ( ) , "not<sp>string" ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( "not<sp>string" , s )
shouldGetProductTitle ( ) { com . iluwatar . information . microservice . InformationController infoController = new com . iluwatar . information . microservice . InformationController ( ) ; java . lang . String title = infoController . getProductTitle ( ) ; "<AssertPlaceHolder>" ; } getProductTitle ( ) { return "The<sp>Product<sp>Title." ; }
org . junit . Assert . assertEquals ( "The<sp>Product<sp>Title." , title )
test3 ( ) { java . lang . String splitRegex = "b.*a" ; java . lang . String splitAttrName = edu . uci . ics . texera . api . constants . test . TestConstantsRegexSplit . DESCRIPTION ; java . util . List < java . lang . String > splitResult = new java . util . ArrayList ( ) ; splitResult . add ( "banana" ) ; splitResult . add ( "mississippi" ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > results = edu . uci . ics . texera . dataflow . regexsplit . RegexSplitOperatorTest . computeRegexSplitResultsOneToMany ( edu . uci . ics . texera . dataflow . regexsplit . RegexSplitOperatorTest . REGEX_TABLE , splitAttrName , splitRegex , RegexSplitPredicate . SplitType . STANDALONE ) ; java . util . List < java . lang . String > splitStrings = results . stream ( ) . map ( ( tuple ) -> tuple . getField ( edu . uci . ics . texera . dataflow . regexsplit . RegexSplitOperatorTest . RESULT_ATTR ) . getValue ( ) . toString ( ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return org . apache . commons . lang3 . builder . ToStringBuilder . reflectionToString ( this ) ; }
org . junit . Assert . assertEquals ( splitResult , splitStrings )
test_contactdb_recipients__recipient_id__get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "contactdb/recipients/{recipient_id}" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; }
org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) )