input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testDouble ( ) { "<AssertPlaceHolder>" ; } evaluate ( hivemall . ftvec . DeferredObject [ ] ) { assert ( arguments . length ) == 1 ; @ hivemall . ftvec . SuppressWarnings ( "unchecked" ) final java . util . List < java . lang . Double > input = ( ( java . util . List < java . lang . Double > ) ( argumentOI . getList ( arguments [ 0 ] . get ( ) ) ) ) ; return udf . evaluate ( input ) ; } | org . junit . Assert . assertEquals ( true , udf . evaluate ( 1.0 ) ) |
addConflictExecutionException ( ) { when ( mockSource . getConnection ( ) . prepareStatement ( anyString ( ) ) ) . thenThrow ( new java . sql . SQLException ( "propagate<sp>this<sp>message" ) ) ; try { mockSourceConflicts . addConflict ( null , org . locationtech . geogig . storage . postgresql . v9 . PGConflictsDatabaseTest . c1 ) ; org . junit . Assert . fail ( "expected<sp>RTE" ) ; } catch ( java . lang . RuntimeException e ) { "<AssertPlaceHolder>" ; } verify ( mockConnection , times ( 1 ) ) . setAutoCommit ( eq ( false ) ) ; verify ( mockConnection , times ( 1 ) ) . rollback ( ) ; verify ( mockConnection , times ( 1 ) ) . setAutoCommit ( eq ( true ) ) ; } getMessage ( ) { return getTable ( ) . message ( ) ; } | org . junit . Assert . assertTrue ( e . getMessage ( ) . contains ( "propagate<sp>this<sp>message" ) ) |
testGetOffset ( ) { org . kefirsf . bb . proc . Source source = new org . kefirsf . bb . proc . Source ( org . kefirsf . bb . proc . SourceTest . EXAMPLE ) ; source . setConstantSet ( new java . util . HashSet < org . kefirsf . bb . proc . PatternConstant > ( ) ) ; for ( int i = 0 ; i < ( source . length ( ) ) ; ) { "<AssertPlaceHolder>" ; i ++ ; source . incOffset ( ) ; } } getOffset ( ) { return offset ; } | org . junit . Assert . assertEquals ( source . getOffset ( ) , i ) |
testGuestEnglishSessionPathWithEnglishCookieAlgorithm3 ( ) { java . lang . String prependI18nLanguageId = getPrependI18nLanguageId ( 3 , null , LocaleUtil . US , LocaleUtil . US ) ; "<AssertPlaceHolder>" ; } getPrependI18nLanguageId ( int , java . util . Locale , java . util . Locale , java . util . Locale ) { javax . servlet . http . HttpSession session = _mockHttpServletRequest . getSession ( ) ; session . setAttribute ( WebKeys . LOCALE , sessionLocale ) ; if ( userLocale != null ) { com . liferay . portal . kernel . model . User user = com . liferay . portal . kernel . test . util . UserTestUtil . addUser ( null , userLocale , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) , new long [ ] { _group . getGroupId ( ) } ) ; _mockHttpServletRequest . setAttribute ( WebKeys . USER , user ) ; } if ( cookieLocale != null ) { com . liferay . portal . kernel . language . LanguageUtil . updateCookie ( _mockHttpServletRequest , _mockHttpServletResponse , cookieLocale ) ; _mockHttpServletRequest . setCookies ( _mockHttpServletResponse . getCookies ( ) ) ; } return _i18nFilter . prependI18nLanguageId ( _mockHttpServletRequest , localePrependFriendlyURLStyle ) ; } | org . junit . Assert . assertNull ( prependI18nLanguageId ) |
simpleParameters ( ) { com . vaadin . flow . router . QueryParameters simpleParams = com . vaadin . flow . router . QueryParameters . simple ( getSimpleInputParameters ( ) ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > expectedFullParams = new java . util . HashMap ( ) ; expectedFullParams . put ( "one" , java . util . Collections . singletonList ( "1" ) ) ; expectedFullParams . put ( "two" , java . util . Collections . singletonList ( "2" ) ) ; expectedFullParams . put ( "three" , java . util . Collections . singletonList ( "3" ) ) ; "<AssertPlaceHolder>" ; } getParameters ( ) { return parameters ; } | org . junit . Assert . assertEquals ( expectedFullParams , simpleParams . getParameters ( ) ) |
deveObterAssinaturaComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . manifestacaodestinatario . NFEventoManifestacaoDestinatario eventoManifestacaoDestinatario = new com . fincatto . documentofiscal . nfe400 . classes . evento . manifestacaodestinatario . NFEventoManifestacaoDestinatario ( ) ; final com . fincatto . documentofiscal . nfe400 . classes . nota . assinatura . NFSignature assinatura = new com . fincatto . documentofiscal . nfe400 . classes . nota . assinatura . NFSignature ( ) ; final java . lang . String signatureValue = "signature" ; assinatura . setSignatureValue ( signatureValue ) ; eventoManifestacaoDestinatario . setAssinatura ( assinatura ) ; "<AssertPlaceHolder>" ; } getAssinatura ( ) { return this . assinatura ; } | org . junit . Assert . assertEquals ( assinatura , eventoManifestacaoDestinatario . getAssinatura ( ) ) |
testClone ( ) { gnu . trove . TDoubleArrayList t2 = tDoubleArrayList . clone ( ) ; "<AssertPlaceHolder>" ; } clone ( ) { gnu . trove . TDoubleArrayList m = ( ( gnu . trove . TDoubleArrayList ) ( super . clone ( ) ) ) ; m . delegate = new gnu . trove . list . array . TDoubleArrayList ( this . toArray ( ) ) ; return m ; } | org . junit . Assert . assertEquals ( t2 , tDoubleArrayList ) |
sanityCheck ( ) { be . bagofwords . db . Random random = new be . bagofwords . db . Random ( 1204 ) ; be . bagofwords . db . impl . BaseDataInterface < be . bagofwords . db . helper . TestObject > dataInterface = createDataInterface ( "sanityCheck" , be . bagofwords . db . helper . TestObject . class ) . caching ( type ) . create ( ) ; dataInterface . dropAllData ( ) ; writeRandomObjects ( dataInterface , 200 , random ) ; be . bagofwords . db . helper . TestObject randomObj = createRandomObject ( random ) ; dataInterface . write ( "obj" , randomObj ) ; dataInterface . flush ( ) ; writeRandomObjects ( dataInterface , 200 , random ) ; be . bagofwords . db . helper . TestObject readObj = dataInterface . read ( "obj" ) ; "<AssertPlaceHolder>" ; } read ( long ) { be . bagofwords . db . remote . Connection connection = null ; try { connection = selectSmallBufferConnection ( ) ; doAction ( Action . READ_VALUE , connection ) ; connection . writeLong ( key ) ; connection . flush ( ) ; T value = readValue ( connection ) ; releaseConnection ( connection ) ; return value ; } catch ( java . lang . Exception e ) { dropConnection ( connection ) ; throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( randomObj , readObj ) |
serialize_to_string_correct_input_to_mapper ( ) { org . mockito . ArgumentCaptor < com . amazon . ask . model . ResponseEnvelope > captor = org . mockito . ArgumentCaptor . forClass ( com . amazon . ask . model . ResponseEnvelope . class ) ; when ( mockMapper . writeValueAsString ( responseEnvelope ) ) . thenReturn ( "foo" ) ; serializer . serialize ( responseEnvelope ) ; verify ( mockMapper ) . writeValueAsString ( captor . capture ( ) ) ; "<AssertPlaceHolder>" ; } serialize ( T ) { try { return com . amazon . ask . util . JacksonSerializer . mapper . writeValueAsString ( t ) ; } catch ( java . io . IOException e ) { throw new com . amazon . ask . exception . AskSdkException ( "Serialization<sp>error" , e ) ; } } | org . junit . Assert . assertEquals ( captor . getValue ( ) , responseEnvelope ) |
equals_differentType ( ) { final net . sf . qualitycheck . immutableobject . domain . Annotation immutable = net . sf . qualitycheck . immutableobject . domain . Annotation . of ( javax . annotation . concurrent . Immutable . class ) ; final net . sf . qualitycheck . immutableobject . domain . Annotation nonnull = net . sf . qualitycheck . immutableobject . domain . Annotation . of ( javax . annotation . Nonnull . class ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; net . sf . qualitycheck . immutableobject . ImmutableCar other = ( ( net . sf . qualitycheck . immutableobject . ImmutableCar ) ( obj ) ) ; if ( ! ( codes . equals ( other . codes ) ) ) return false ; if ( ( wheels ) != ( other . wheels ) ) return false ; if ( ! ( name . equals ( other . name ) ) ) return false ; return true ; } | org . junit . Assert . assertTrue ( ( ! ( immutable . equals ( nonnull ) ) ) ) |
testDownloadSameUrl ( ) { writeStringToFile ( target , slash . navigation . download . DownloadManagerIT . LOREM_IPSUM_DOLOR_SIT_AMET ) ; slash . navigation . download . Download download1 = manager . queueForDownload ( "447<sp>Bytes" , ( ( slash . navigation . download . DownloadManagerIT . DOWNLOAD ) + "447bytes.txt" ) , slash . navigation . download . Copy , new slash . navigation . download . FileAndChecksum ( target , null ) , null ) ; slash . navigation . download . Download download2 = manager . queueForDownload ( "447<sp>Bytes" , ( ( slash . navigation . download . DownloadManagerIT . DOWNLOAD ) + "447bytes.txt" ) , slash . navigation . download . Copy , new slash . navigation . download . FileAndChecksum ( target , null ) , null ) ; waitFor ( download2 , slash . navigation . download . Succeeded ) ; "<AssertPlaceHolder>" ; } waitFor ( slash . navigation . download . Download , slash . navigation . download . State$State ) { final boolean [ ] found = new boolean [ 1 ] ; found [ 0 ] = false ; javax . swing . event . TableModelListener l = new javax . swing . event . TableModelListener ( ) { public void tableChanged ( javax . swing . event . TableModelEvent e ) { slash . navigation . download . DownloadManagerIT . log . warning ( ( ( ( "Expected<sp>state:<sp>" + expectedState ) + ",<sp>download<sp>state:<sp>" ) + ( download . getState ( ) ) ) ) ; if ( expectedState . equals ( download . getState ( ) ) ) { synchronized ( slash . navigation . download . DownloadManagerIT . notificationMutex ) { found [ 0 ] = true ; slash . navigation . download . DownloadManagerIT . notificationMutex . notifyAll ( ) ; } } } } ; long start = java . lang . System . currentTimeMillis ( ) ; manager . getModel ( ) . addTableModelListener ( l ) ; try { while ( true ) { synchronized ( slash . navigation . download . DownloadManagerIT . notificationMutex ) { if ( found [ 0 ] ) break ; if ( ( ( java . lang . System . currentTimeMillis ( ) ) - start ) > ( slash . navigation . download . DownloadManager . WAIT_TIMEOUT ) ) throw new java . lang . IllegalStateException ( ( ( ( "waited<sp>for<sp>" + ( slash . navigation . download . DownloadManager . WAIT_TIMEOUT ) ) + "<sp>seconds<sp>without<sp>seeing<sp>" ) + expectedState ) ) ; try { slash . navigation . download . DownloadManagerIT . notificationMutex . wait ( 1000 ) ; } catch ( java . lang . InterruptedException e ) { } } } } finally { manager . getModel ( ) . removeTableModelListener ( l ) ; } } | org . junit . Assert . assertEquals ( download2 , download1 ) |
testIsUndefined02 ( ) { org . dresdenocl . modelinstancetype . types . IModelInstanceEnumerationLiteral modelInstanceEnumerationLiteral01 ; modelInstanceEnumerationLiteral01 = org . dresdenocl . modelinstancetype . types . base . BasisJavaModelInstanceFactory . createModelInstanceEnumerationLiteral ( null ) ; "<AssertPlaceHolder>" ; } isUndefined ( ) { return true ; } | org . junit . Assert . assertTrue ( modelInstanceEnumerationLiteral01 . isUndefined ( ) ) |
testWaitForCodeIsBlocked ( ) { final com . google . api . client . extensions . jetty . auth . oauth2 . LocalServerReceiver receiver = new com . google . api . client . extensions . jetty . auth . oauth2 . LocalServerReceiver ( ) ; try { receiver . getRedirectUri ( ) ; runWaitForCodeThread ( receiver ) ; java . lang . Thread . sleep ( 200 ) ; "<AssertPlaceHolder>" ; } finally { receiver . stop ( ) ; } } runWaitForCodeThread ( com . google . api . client . extensions . jetty . auth . oauth2 . LocalServerReceiver ) { java . lang . Thread fork = new java . lang . Thread ( new java . lang . Runnable ( ) { @ com . google . api . client . extensions . jetty . auth . oauth2 . Override public void run ( ) { try { authCode = receiver . waitForCode ( ) ; } catch ( java . io . IOException ioe ) { error = ioe . getMessage ( ) ; } finally { forkTermianted = true ; } } } ) ; fork . start ( ) ; return fork ; } | org . junit . Assert . assertFalse ( forkTermianted ) |
getEmployeeByUserId ( ) { org . egov . pims . model . PersonalInformation emp = personalInformationService . getEmployeeByUserId ( 1L ) ; "<AssertPlaceHolder>" ; } getEmployeeByUserId ( java . lang . Long ) { return personalInformationService . getEmployeeByUserId ( userId ) ; } | org . junit . Assert . assertNotNull ( emp ) |
sortPathsParentChild ( ) { java . util . List < java . lang . String > sorted = org . apache . jackrabbit . oak . index . indexer . document . flatfile . TestUtils . sortPaths ( asList ( "/a" , "/a<sp>b" , "/a/bw" ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( asList ( "/a" , "/a/bw" , "/a<sp>b" ) , sorted ) |
testOAuthSpec_noservice ( ) { java . lang . String xml = "<OAuth/>" ; org . apache . shindig . gadgets . spec . OAuthSpec oauth = new org . apache . shindig . gadgets . spec . OAuthSpec ( org . apache . shindig . common . xml . XmlUtil . parse ( xml ) , org . apache . shindig . gadgets . spec . OAuthSpecTest . SPEC_URL ) ; "<AssertPlaceHolder>" ; } getServices ( ) { return java . util . Collections . unmodifiableMap ( serviceMap ) ; } | org . junit . Assert . assertEquals ( 0 , oauth . getServices ( ) . size ( ) ) |
testGetSetDestination ( ) { control . replay ( ) ; org . apache . cxf . ws . rm . DestinationSequence seq = new org . apache . cxf . ws . rm . DestinationSequence ( id , ref , destination , ProtocolVariation . RM10WSA200408 ) ; seq . setDestination ( destination ) ; "<AssertPlaceHolder>" ; } getDestination ( ) { return destination ; } | org . junit . Assert . assertSame ( destination , seq . getDestination ( ) ) |
computePathFunction ( ) { java . lang . String content = "{<sp>'a'<sp>:<sp>'X',<sp>'b'<sp>:<sp>'Z'<sp>}" ; java . lang . String query = "$.length()" ; java . lang . Object result = org . batfish . common . util . JsonPathUtils . computePathFunction ( query , content ) ; "<AssertPlaceHolder>" ; } computePathFunction ( java . lang . String , java . lang . String ) { return org . batfish . common . util . JsonPathUtils . computePathFunctionPvt ( queryPath , com . jayway . jsonpath . JsonPath . parse ( content , org . batfish . common . util . JsonPathUtils . BatfishJsonPathDefaults . getDefaulConfiguration ( ) ) . json ( ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( 2 ) ) |
testUpdateFileVersion ( ) { java . lang . String fileName = com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ) ; store . addFile ( companyId , repositoryId , fileName , com . liferay . portlet . documentlibrary . store . test . BaseStoreTestCase . _DATA_VERSION_1 ) ; store . updateFileVersion ( companyId , repositoryId , fileName , "1.0" , "1.1" ) ; "<AssertPlaceHolder>" ; } getFileAsBytes ( long , long , java . lang . String , java . lang . String ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertArrayEquals ( com . liferay . portlet . documentlibrary . store . test . BaseStoreTestCase . _DATA_VERSION_1 , store . getFileAsBytes ( companyId , repositoryId , fileName , "1.1" ) ) |
noGapsIfSingleInterval ( ) { net . time4j . range . DateInterval interval = net . time4j . range . DateInterval . between ( net . time4j . PlainDate . of ( 2014 , 4 , 10 ) , net . time4j . PlainDate . of ( 2014 , 6 , 1 ) ) ; net . time4j . range . IntervalCollection < net . time4j . PlainDate > windows = net . time4j . range . IntervalCollection . onDateAxis ( ) ; windows = windows . plus ( interval ) ; "<AssertPlaceHolder>" ; } withGaps ( ) { int len = this . intervals . size ( ) ; if ( len == 0 ) { return this ; } else if ( len == 1 ) { java . util . List < net . time4j . range . ChronoInterval < T > > zero = java . util . Collections . emptyList ( ) ; return this . create ( zero ) ; } java . util . List < net . time4j . range . ChronoInterval < T > > gaps = new java . util . ArrayList ( ) ; T previous = null ; for ( int i = 0 , n = len - 1 ; i < n ; i ++ ) { net . time4j . range . ChronoInterval < T > current = this . intervals . get ( i ) ; if ( current . getEnd ( ) . isInfinite ( ) ) { break ; } T gapStart = current . getEnd ( ) . getTemporal ( ) ; if ( current . getEnd ( ) . isClosed ( ) ) { gapStart = this . getTimeLine ( ) . stepForward ( gapStart ) ; if ( gapStart == null ) { break ; } } if ( ( previous == null ) || ( this . isAfter ( gapStart , previous ) ) ) { previous = gapStart ; } else { gapStart = previous ; } T gapEnd = this . intervals . get ( ( i + 1 ) ) . getStart ( ) . getTemporal ( ) ; if ( ( gapEnd == null ) || ( ! ( this . isAfter ( gapEnd , gapStart ) ) ) ) { continue ; } net . time4j . range . IntervalEdge edge = IntervalEdge . OPEN ; if ( this . isCalendrical ( ) ) { edge = IntervalEdge . CLOSED ; gapEnd = this . getTimeLine ( ) . stepBackwards ( gapEnd ) ; if ( gapEnd == null ) { continue ; } } net . time4j . range . Boundary < T > s = net . time4j . range . Boundary . ofClosed ( gapStart ) ; net . time4j . range . Boundary < T > e = net . time4j . range . Boundary . of ( edge , gapEnd ) ; gaps . add ( this . newInterval ( s , e ) ) ; } return this . create ( gaps ) ; } | org . junit . Assert . assertThat ( windows . withGaps ( ) . isEmpty ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testNullComponentsDoNotInject ( ) { com . picocontainer . MutablePicoContainer pico = createPicoContainer ( null ) . addComponent ( com . picocontainer . tck . AbstractPicoContainerTest . ComponentA . class ) . addComponent ( com . picocontainer . tck . AbstractPicoContainerTest . ComponentB . class ) ; try { pico . addComponent ( com . picocontainer . tck . AbstractPicoContainerTest . ComponentC . class , null ) ; org . junit . Assert . fail ( "Pico<sp>should<sp>not<sp>have<sp>been<sp>able<sp>to<sp>register<sp>null<sp>component<sp>instance" ) ; } catch ( java . lang . NullPointerException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; } | org . junit . Assert . assertNotNull ( e . getMessage ( ) ) |
shouldReturnCorrectNumberOfLinesWhenAnalysedInOneUnit ( ) { final int lines = 100 ; final org . pitest . classinfo . ClassInfo clazz = makeClass ( lines ) ; this . testee = buildSummaryData ( clazz ) ; "<AssertPlaceHolder>" ; } getTotals ( ) { final org . pitest . mutationtest . report . html . MutationTotals mt = new org . pitest . mutationtest . report . html . MutationTotals ( ) ; mt . addFiles ( 1 ) ; mt . addMutations ( this . getNumberOfMutations ( ) ) ; mt . addMutationsDetetcted ( this . getNumberOfMutationsDetected ( ) ) ; mt . addLines ( getNumberOfLines ( ) ) ; mt . addLinesCovered ( this . numberOfCoveredLines ) ; return mt ; } | org . junit . Assert . assertEquals ( lines , this . testee . getTotals ( ) . getNumberOfLines ( ) ) |
testExternalNestedArrayOutOfBoundAccess ( ) { java . util . List < java . lang . String > stmt = new java . util . ArrayList ( ) ; stmt . add ( "CREATE<sp>EXTERNAL<sp>TABLE<sp>FOO<sp>(ID<sp>INT,<sp>MAPFIELD<sp>ANY,<sp>NESTEDMAPFIELD<sp>ANY,<sp>ARRAYFIELD<sp>ANY)<sp>LOCATION<sp>'mocknested:///foo'" ) ; stmt . add ( "CREATE<sp>EXTERNAL<sp>TABLE<sp>BAR<sp>(ID<sp>INT,<sp>MAPFIELD<sp>ANY,<sp>NESTEDMAPFIELD<sp>ANY,<sp>ARRAYFIELD<sp>ANY)<sp>LOCATION<sp>'mocknested:///foo'" ) ; stmt . add ( ( "INSERT<sp>INTO<sp>BAR<sp>SELECT<sp>STREAM<sp>ID,<sp>MAPFIELD,<sp>NESTEDMAPFIELD,<sp>ARRAYFIELD<sp>" + ( "FROM<sp>FOO<sp>" + "WHERE<sp>CAST(ARRAYFIELD[10]<sp>AS<sp>INTEGER)<sp>=<sp>200" ) ) ) ; org . apache . storm . sql . StormSqlLocalClusterImpl impl = new org . apache . storm . sql . StormSqlLocalClusterImpl ( ) ; java . util . List < org . apache . storm . streams . Pair < java . lang . Object , org . apache . storm . tuple . Values > > values = TestUtils . MockInsertBolt . getCollectedValues ( ) ; impl . runLocal ( org . apache . storm . sql . TestStormSql . cluster , stmt , ( __ ) -> true , org . apache . storm . sql . TestStormSql . WAIT_TIMEOUT_MS_NO_RECORDS_EXPECTED ) ; "<AssertPlaceHolder>" ; } size ( ) { return keys . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , values . size ( ) ) |
shouldConstruct ( ) { android . webkit . JsPromptResult result = org . robolectric . shadows . ShadowJsPromptResult . newInstance ( ) ; "<AssertPlaceHolder>" ; } newInstance ( ) { return newInstanceOf ( android . webkit . JsPromptResult . class ) ; } | org . junit . Assert . assertNotNull ( result ) |
encodedFilter ( ) { org . slim3 . datastore . AbstQueryTest . MyQuery query = new org . slim3 . datastore . AbstQueryTest . MyQuery ( ds , "Hoge" ) ; com . google . appengine . api . datastore . Query . Filter filter = new com . google . appengine . api . datastore . Query . FilterPredicate ( "myString" , com . google . appengine . api . datastore . Query . FilterOperator . EQUAL , "aaa" ) ; java . lang . String encodedFilter = org . slim3 . repackaged . com . google . gdata . util . common . util . Base64 . encode ( org . slim3 . util . ByteUtil . toByteArray ( filter ) ) ; query . encodedFilter ( encodedFilter ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { if ( key == null ) { throw new org . slim3 . repackaged . org . json . JSONException ( "Null<sp>key." ) ; } java . lang . Object object = this . opt ( key ) ; if ( object == null ) { throw new org . slim3 . repackaged . org . json . JSONException ( ( ( "JSONObject[" + ( org . slim3 . repackaged . org . json . JSONObject . quote ( key ) ) ) + "]<sp>not<sp>found." ) ) ; } return object ; } | org . junit . Assert . assertThat ( query . filters . get ( 0 ) , org . hamcrest . CoreMatchers . is ( filter ) ) |
testMin2 ( ) { double result = org . diirt . graphene . MathIgnoreNaN . min ( 1 , Double . NaN ) ; "<AssertPlaceHolder>" ; } min ( double , double ) { if ( java . lang . Double . isNaN ( a ) ) { return b ; } if ( java . lang . Double . isNaN ( b ) ) { return a ; } return java . lang . Math . min ( a , b ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . equalTo ( 1.0 ) ) |
testUpdate ( ) { final java . lang . String uuid = "uuid" ; final java . lang . String nameValue = "nameValue" ; final org . kie . workbench . common . dmn . client . editors . types . common . DataType dataType = mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ; final org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition itemDefinition = mock ( org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition . class ) ; final org . kie . workbench . common . dmn . api . property . dmn . Name name = mock ( org . kie . workbench . common . dmn . api . property . dmn . Name . class ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > expectedDependentDataTypes = asList ( mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) , mock ( org . kie . workbench . common . dmn . client . editors . types . common . DataType . class ) ) ; when ( dataType . isValid ( ) ) . thenReturn ( true ) ; when ( dataType . getUUID ( ) ) . thenReturn ( uuid ) ; when ( itemDefinitionStore . get ( uuid ) ) . thenReturn ( itemDefinition ) ; when ( itemDefinition . getName ( ) ) . thenReturn ( name ) ; when ( name . getValue ( ) ) . thenReturn ( nameValue ) ; when ( dataTypeUpdateHandler . refreshDependentDataTypes ( dataType , nameValue ) ) . thenReturn ( expectedDependentDataTypes ) ; final java . util . List < org . kie . workbench . common . dmn . client . editors . types . common . DataType > actualDependentDataTypes = recordEngine . update ( dataType ) ; verify ( recordEngine ) . doUpdate ( dataType , itemDefinition ) ; "<AssertPlaceHolder>" ; } doUpdate ( org . kie . workbench . common . dmn . client . editors . types . common . DataType , org . kie . workbench . common . dmn . api . definition . v1_1 . ItemDefinition ) { dataTypeUpdateHandler . update ( dataType ) ; itemDefinitionUpdateHandler . update ( dataType , itemDefinition ) ; } | org . junit . Assert . assertEquals ( expectedDependentDataTypes , actualDependentDataTypes ) |
testGetFieldLength ( ) { classUnderTest . setFieldLength ( "aTestString" ) ; "<AssertPlaceHolder>" ; } getFieldLength ( ) { return this . fieldLength ; } | org . junit . Assert . assertEquals ( "aTestString" , classUnderTest . getFieldLength ( ) ) |
testGetCardVersion ( ) { java . lang . String expResult = "DK" ; java . lang . String result = stripe . getCardVersion ( ) ; "<AssertPlaceHolder>" ; } getCardVersion ( ) { return cardVersion ; } | org . junit . Assert . assertEquals ( expResult , result ) |
getHoldsThatNodeRefIsHeldBy ( ) { doReturn ( holds ) . when ( mockedHoldService ) . heldBy ( record , true ) ; java . util . Map < java . lang . String , java . lang . String > parameters = buildParameters ( "store_type" , filePlan . getStoreRef ( ) . getProtocol ( ) , "store_id" , filePlan . getStoreRef ( ) . getIdentifier ( ) , "id" , filePlan . getId ( ) , "itemNodeRef" , record . toString ( ) ) ; org . json . JSONObject json = executeJSONWebScript ( parameters ) ; "<AssertPlaceHolder>" ; testForBothHolds ( json ) ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( "RMSite<sp>[id=" + ( id ) ) + ",<sp>guid=" ) + ( guid ) ) + ",<sp>title=" ) + ( title ) ) + ",<sp>description=" ) + ( description ) ) + ",<sp>visibility=" ) + ( visibility ) ) + ",<sp>role=" ) + ( role ) ) + ",<sp>compliance=" ) + ( compliance ) ) + "]" ; } | org . junit . Assert . assertNotNull ( json ) |
commitEmptyDirectory_theEmptyDirectoryShouldNotExistInTheResultCommit ( ) { writeSomethingToGfs ( ) ; java . nio . file . Path dir = gfs . getPath ( "/empty_dir" ) ; java . nio . file . Files . createDirectory ( dir ) ; org . eclipse . jgit . revwalk . RevCommit commit = com . beijunyi . parallelgit . filesystem . Gfs . commit ( gfs ) . execute ( ) . getCommit ( ) ; "<AssertPlaceHolder>" ; } exists ( java . lang . String , com . beijunyi . parallelgit . utils . AnyObjectId , com . beijunyi . parallelgit . utils . ObjectReader ) { return com . beijunyi . parallelgit . utils . TreeUtils . exists ( file , com . beijunyi . parallelgit . utils . GitFileUtils . getRootTree ( commit , reader ) , reader ) ; } | org . junit . Assert . assertFalse ( com . beijunyi . parallelgit . utils . GitFileUtils . exists ( "/empty_dir" , commit , repo ) ) |
testBuildWithLoadBalanceAlgorithm ( ) { com . bazaarvoice . ostrich . LoadBalanceAlgorithm loadBalanceAlgorithm = mock ( com . bazaarvoice . ostrich . LoadBalanceAlgorithm . class ) ; com . bazaarvoice . ostrich . pool . ServicePool < com . bazaarvoice . ostrich . pool . ServicePoolBuilderTest . Service > service = ( ( com . bazaarvoice . ostrich . pool . ServicePool < com . bazaarvoice . ostrich . pool . ServicePoolBuilderTest . Service > ) ( com . bazaarvoice . ostrich . pool . ServicePoolBuilder . create ( com . bazaarvoice . ostrich . pool . ServicePoolBuilderTest . Service . class ) . withServiceFactory ( _serviceFactory ) . withCachingPolicy ( _cachingPolicy ) . withLoadBalanceAlgorithm ( loadBalanceAlgorithm ) . withHostDiscovery ( _hostDiscovery ) . withPartitionFilter ( _partitionFilter ) . withMetricRegistry ( _metricRegistry ) . build ( ) ) ) ; "<AssertPlaceHolder>" ; } getLoadBalanceAlgorithm ( ) { return _loadBalanceAlgorithm ; } | org . junit . Assert . assertEquals ( loadBalanceAlgorithm , service . getLoadBalanceAlgorithm ( ) ) |
testBindColumnToObject ( ) { java . lang . String objectId = "syn123" ; java . util . List < org . sagebionetworks . repo . model . table . ColumnModel > results = columnModelManager . bindColumnToObject ( expectedNewSchemaIds , objectId ) ; "<AssertPlaceHolder>" ; verify ( mockColumnModelDAO ) . bindColumnToObject ( newSchema , objectId ) ; verify ( mockColumnModelDAO , never ( ) ) . unbindAllColumnsFromObject ( anyString ( ) ) ; } bindColumnToObject ( java . util . List , java . lang . String ) { if ( ( columnIds == null ) || ( columnIds . isEmpty ( ) ) ) { columnModelDao . unbindAllColumnsFromObject ( objectId ) ; return new java . util . LinkedList ( ) ; } else { java . util . List < org . sagebionetworks . repo . model . table . ColumnModel > schema = validateSchemaSize ( columnIds ) ; columnModelDao . bindColumnToObject ( schema , objectId ) ; return schema ; } } | org . junit . Assert . assertEquals ( newSchema , results ) |
testCollect_1 ( ) { ksession . setGlobal ( "results" , new java . util . ArrayList < com . sample . domain . complex . Cheese > ( ) ) ; java . util . List < com . sample . domain . complex . Cheese > list = new java . util . ArrayList ( ) ; list . add ( new com . sample . domain . complex . Cheese ( "Cheddar" ) ) ; list . add ( new com . sample . domain . complex . Cheese ( "Swiss" ) ) ; list . add ( new com . sample . domain . complex . Cheese ( "stilton" ) ) ; list . add ( new com . sample . domain . complex . Cheese ( "stilton" ) ) ; ksession . insert ( list ) ; ksession . insert ( list . get ( 0 ) ) ; ksession . insert ( list . get ( 1 ) ) ; ksession . insert ( list . get ( 2 ) ) ; ksession . insert ( list . get ( 3 ) ) ; ksession . fireAllRules ( ) ; @ com . sample . rules . SuppressWarnings ( "unchecked" ) java . util . ArrayList < com . sample . domain . complex . Cheese > results = ( ( java . util . ArrayList < com . sample . domain . complex . Cheese > ) ( ksession . getGlobal ( "results" ) ) ) ; "<AssertPlaceHolder>" ; } getGlobal ( java . lang . String ) { return null ; } | org . junit . Assert . assertEquals ( 2 , results . size ( ) ) |
test_GetItems_Gets_Correct_Size_Of_List_When_findAll_Returns_No_Entries ( ) { when ( elem . findAll ( any ( ) , any ( ) , any ( ) ) ) . thenReturn ( 0 ) ; element . setElement ( elem ) ; mmarquee . automation . controls . AutomationComboBox combo = new mmarquee . automation . controls . AutomationComboBox ( new mmarquee . automation . controls . ElementBuilder ( element ) . addPattern ( collapse ) . addPattern ( value ) . addPattern ( selection ) ) ; java . util . List < mmarquee . automation . controls . AutomationListItem > elements = combo . getItems ( ) ; "<AssertPlaceHolder>" ; } getItems ( ) { mmarquee . automation . controls . menu . Menu realMenu = getRealMenu ( ) ; if ( realMenu != null ) { return realMenu . getItems ( ) ; } java . util . List < mmarquee . automation . Element > items = this . findAll ( new mmarquee . uiautomation . TreeScope ( mmarquee . uiautomation . TreeScope . DESCENDANTS ) , this . createControlTypeCondition ( ControlType . MenuItem ) ) ; java . util . List < mmarquee . automation . controls . menu . MenuItem > list = new java . util . ArrayList ( ) ; for ( mmarquee . automation . Element item : items ) { list . add ( new mmarquee . automation . controls . menu . MenuItem ( new mmarquee . automation . controls . ElementBuilder ( item ) ) ) ; } return list ; } | org . junit . Assert . assertTrue ( ( ( elements . size ( ) ) == 0 ) ) |
testStack ( ) { com . performizeit . mjprof . parser . ThreadInfo js = new com . performizeit . mjprof . parser . ThreadInfo ( ( ( stck ) + ( stck2 ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( stepName ) . append ( "/" ) ; for ( java . lang . String stepV : stepArgs ) { sb . append ( stepV ) . append ( "," ) ; } sb . append ( "/" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( ( ( stck ) + ( stck2 ) ) , js . toString ( ) ) |
testBuiltUpToString ( ) { org . apache . beam . runners . core . triggers . TriggerStateMachine trigger = org . apache . beam . runners . core . triggers . AfterWatermarkStateMachine . pastEndOfWindow ( ) . withLateFirings ( org . apache . beam . runners . core . triggers . AfterProcessingTimeStateMachine . pastFirstElementInPane ( ) . plusDelayOf ( org . joda . time . Duration . standardMinutes ( 10 ) ) ) ; java . lang . String expected = "AfterWatermark.pastEndOfWindow()" + ( ( ".withLateFirings(AfterProcessingTime" + ".pastFirstElementInPane()" ) + ".plusDelayOf(10<sp>minutes))" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "innerTrigger" ; } | org . junit . Assert . assertEquals ( expected , trigger . toString ( ) ) |
testEmptyObject ( ) { try { parseMetadata ( "[{}]" ) ; org . junit . Assert . fail ( ) ; } catch ( com . questdb . cutlass . json . JsonException e ) { "<AssertPlaceHolder>" ; } } getPosition ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 3 , e . getPosition ( ) ) |
testBooleanISProp ( ) { java . lang . String template = "<t.manager>" ; org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( template ) ; st . add ( "t" , new org . stringtemplate . v4 . test . User ( 32 , "Ter" ) ) ; java . lang . String expected = "true" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; } | org . junit . Assert . assertEquals ( expected , result ) |
testJobRepository ( ) { int aJobStatus = 1 ; int aCloud = 0 ; int aInstanceId = 0 ; java . lang . String aJobType = "create" ; org . openinfinity . cloud . domain . Job job = new org . openinfinity . cloud . domain . Job ( aJobType , aInstanceId , aCloud , aJobStatus ) ; int jobId = jobRepository . addJob ( job ) ; org . openinfinity . cloud . domain . Job job2 = jobRepository . getJob ( jobId ) ; for ( int i = 0 ; i < 10 ; i ++ ) { job . setJobStatus ( 3 ) ; jobRepository . addJob ( job ) ; } java . util . List < org . openinfinity . cloud . domain . Job > jobs = jobRepository . getJobs ( 3 , 100 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( jobs . size ( ) , 10 ) |
testDDLTableBlacklist ( ) { server . execute ( "drop<sp>database<sp>if<sp>exists<sp>nodatabase" ) ; com . zendesk . maxwell . filtering . Filter filter = new com . zendesk . maxwell . filtering . Filter ( ) ; filter . addRule ( "blacklist:<sp>*.noseeum" ) ; java . lang . String [ ] allSQL = ( ( java . lang . String [ ] ) ( org . apache . commons . lang3 . ArrayUtils . addAll ( com . zendesk . maxwell . MaxwellIntegrationTest . blacklistSQLDDL , com . zendesk . maxwell . MaxwellIntegrationTest . blacklistSQLDML ) ) ) ; java . util . List < com . zendesk . maxwell . row . RowMap > rows = getRowsForSQL ( filter , allSQL ) ; "<AssertPlaceHolder>" ; } size ( ) { return columns . size ( ) ; } | org . junit . Assert . assertThat ( rows . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
deveObterIcms20ComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemImpostoICMS icms = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemImpostoICMS ( ) ; final com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemImpostoICMS20 icms20 = new com . fincatto . documentofiscal . nfe400 . classes . nota . NFNotaInfoItemImpostoICMS20 ( ) ; icms . setIcms20 ( icms20 ) ; "<AssertPlaceHolder>" ; } getIcms20 ( ) { return this . icms20 ; } | org . junit . Assert . assertEquals ( icms20 , icms . getIcms20 ( ) ) |
shouldDeterminNodeIdFromResourceId ( ) { java . lang . String resourceIdString = "node[Test:1525957453778].interfaceSnmp[opennms-jvm]" ; org . opennms . netmgt . model . ResourceId resourceId = org . opennms . netmgt . model . ResourceId . fromString ( resourceIdString ) ; org . opennms . netmgt . dao . api . ResourceDao resourceDao = org . mockito . Mockito . mock ( org . opennms . netmgt . dao . api . ResourceDao . class ) ; org . opennms . netmgt . model . OnmsResource resource = org . mockito . Mockito . mock ( org . opennms . netmgt . model . OnmsResource . class ) ; org . opennms . netmgt . model . OnmsResource parentResource = org . mockito . Mockito . mock ( org . opennms . netmgt . model . OnmsResource . class ) ; org . opennms . netmgt . model . OnmsNode node = new org . opennms . netmgt . model . OnmsNode ( ) ; node . setId ( 3 ) ; when ( resourceDao . getResourceById ( resourceId ) ) . thenReturn ( resource ) ; when ( resource . getParent ( ) ) . thenReturn ( parentResource ) ; when ( parentResource . getEntity ( ) ) . thenReturn ( node ) ; org . opennms . features . vaadin . dashboard . dashlets . KscDashlet dashlet = new org . opennms . features . vaadin . dashboard . dashlets . KscDashlet ( this . getClass ( ) . getSimpleName ( ) , null , null , resourceDao , null , null ) ; "<AssertPlaceHolder>" ; } determineResourceByResourceId ( org . opennms . netmgt . model . ResourceId ) { org . opennms . netmgt . model . OnmsResource resource = m_resourceDao . getResourceById ( resourceId ) ; resource = ( ( resource . getParent ( ) ) == null ) ? resource : resource . getParent ( ) ; return resource ; } | org . junit . Assert . assertEquals ( parentResource , dashlet . determineResourceByResourceId ( resourceId ) ) |
uniBillTextFormatTest ( ) { java . lang . String inputText = "<sp>\n" + ( ( ( ( ( ( ( ( ( ( "<sp>STATE<sp>OF<sp>NEW<sp>YORK\n" + "<sp>________________________________________________________________________\n" ) + "<sp>\n" ) + "<sp>S.<sp>2005--C<sp>A.<sp>3005--C\n" ) + "<sp>\n" ) + "<sp>SENATE<sp>-<sp>ASSEMBLY\n" ) + "<sp>\n" ) + "<sp>___________\n" 3 ) + "<sp>___________\n" ) + "<sp>\n" ) + "<sp>IN<sp>SENATE<sp>--<sp>A<sp>BUDGET<sp>BILL,<sp>submitted<sp>by<sp>the<sp>Governor<sp>pursuant<sp>to<sp>arti-" ) ; java . lang . String expectedResult = "<sp>___________\n" 2 + ( ( ( ( ( ( ( ( ( ( "<sp>___________\n" 5 + "<sp>________________________________________________________________________\n" ) + "<sp>___________\n" 2 ) + "<sp>___________\n" 4 ) + "<sp>___________\n" 2 ) + "<sp>___________\n" 0 ) + "<sp>___________\n" 2 ) + "<sp>January<sp>23,<sp>2017\n" ) + "<sp>___________\n" 1 ) + "<sp>___________\n" 2 ) + "<sp>IN<sp>SENATE<sp>--<sp>A<sp>BUDGET<sp>BILL,<sp>submitted<sp>by<sp>the<sp>Governor<sp>pursuant<sp>to<sp>arti-" ) ; "<AssertPlaceHolder>" ; } formatHtmlExtractedBillText ( java . lang . String ) { text = text . replaceAll ( "(?<=\n|^)<sp>" , "" ) ; java . util . regex . Matcher matcher = gov . nysenate . openleg . util . BillTextUtils . billHeaderPattern . matcher ( text ) ; if ( matcher . find ( ) ) { java . lang . StringBuilder replacement = new java . lang . StringBuilder ( ) . append ( matcher . group ( "startingNewlines" ) ) . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 27 ) ) . append ( "divider" 0 ) . append ( matcher . group ( "divider" ) ) ; switch ( matcher . group ( "chamber" ) ) { case gov . nysenate . openleg . util . BillTextUtils . inSenate : replacement . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 35 ) ) . append ( "I<sp>N<sp>S<sp>E<sp>N<sp>A<sp>T<sp>E" ) ; break ; case gov . nysenate . openleg . util . BillTextUtils . inAssembly : replacement . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 33 ) ) . append ( "I<sp>N<sp>A<sp>S<sp>S<sp>E<sp>M<sp>B<sp>L<sp>Y" ) ; break ; case gov . nysenate . openleg . util . BillTextUtils . inBoth : replacement . append ( org . apache . commons . lang3 . StringUtils . repeat ( '<sp>' , 29 ) ) . append ( "S<sp>E<sp>N<sp>A<sp>T<sp>E<sp>-<sp>A<sp>S<sp>S<sp>E<sp>M<sp>B<sp>L<sp>Y" ) ; break ; default : throw new java . lang . IllegalStateException ( ( "divider" 1 + ( matcher . group ( "chamber" ) ) ) ) ; } if ( ( matcher . group ( "prefiledWhiteSpace" ) ) != null ) { replacement . append ( matcher . group ( "prefiledWhiteSpace" ) ) . append ( "(PREFILED)" ) ; } text = matcher . replaceFirst ( replacement . toString ( ) ) ; } return text ; } | org . junit . Assert . assertEquals ( expectedResult , gov . nysenate . openleg . util . BillTextUtils . formatHtmlExtractedBillText ( inputText ) ) |
testSavePatientList ( ) { org . raxa . module . raxacore . PatientList pList = new org . raxa . module . raxacore . PatientList ( ) ; pList . setName ( "TestList3" ) ; pList . setDescription ( "Third<sp>Test<sp>List" ) ; pList . setCreator ( org . openmrs . api . context . Context . getUserContext ( ) . getAuthenticatedUser ( ) ) ; pList . setDateCreated ( new java . util . Date ( ) ) ; pList . setUuid ( "68547121-1b70-465c-99ee-c9dfd95e7d30" ) ; pList . setRetired ( Boolean . FALSE ) ; pList . setSearchQuery ( "test<sp>Query" ) ; dao . savePatientList ( pList ) ; java . util . List < org . raxa . module . raxacore . PatientList > result = dao . getPatientListByName ( "TestList3" ) ; java . lang . String name = result . get ( 0 ) . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( name , "TestList3" ) |
testMaakentityConvertorAkteNummer ( ) { nl . bzk . migratiebrp . test . brpnaarlo3 . adapter . ConverterContext ctx = createContext ( nl . bzk . migratiebrp . test . brpnaarlo3 . adapter . entity . IstStapelVoorkomenConverterTest . MINIMAAL ) ; converter . convertInhoudelijk ( ctx , IstStapelVoorkomenConverter . HEADER_AKTE_NUMMER , aktenummer ) ; converter . maakEntity ( ctx ) ; nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . StapelVoorkomen stapelVoorkomen = ctx . getStapel ( java . lang . Integer . parseInt ( volgnummer ) ) . getStapelvoorkomens ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } getAktenummer ( ) { return aktenummer ; } | org . junit . Assert . assertEquals ( aktenummer , stapelVoorkomen . getAktenummer ( ) ) |
serializeReplyWithDiscoveryException ( ) { io . joynr . exceptions . DiscoveryException error = new io . joynr . exceptions . DiscoveryException ( "detail<sp>message:<sp>DiscoveryException" ) ; joynr . Reply reply = new joynr . Reply ( java . util . UUID . randomUUID ( ) . toString ( ) , error ) ; java . lang . String writeValueAsString = objectMapper . writeValueAsString ( reply ) ; joynr . Reply receivedReply = objectMapper . readValue ( writeValueAsString , joynr . Reply . class ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "TestSuiteResult<sp>[" + "name=" ) + ( this . name ) ) + ",<sp>" ) + "time=" ) + ( this . time ) ) + ",<sp>" ) + "tests=" ) + ( this . tests ) ) + ",<sp>" ) + "errors=" ) + ( this . errors ) ) + ",<sp>" ) + "skipped=" ) + ( this . skipped ) ) + ",<sp>" ) + "failures=" ) + ( this . failures ) ) + ",<sp>" ) + "testCaseResults=" ) + ( java . util . Arrays . toString ( this . testCaseResults ) ) ) + "]" ; } | org . junit . Assert . assertEquals ( reply , receivedReply ) |
testReportWithNullHistoryTTL ( ) { prepareDecisionInstances ( org . camunda . bpm . engine . test . history . CleanableHistoricDecisionInstanceReportTest . DECISION_DEFINITION_KEY , ( - 6 ) , null , 5 ) ; prepareDecisionInstances ( org . camunda . bpm . engine . test . history . CleanableHistoricDecisionInstanceReportTest . DECISION_DEFINITION_KEY , 0 , null , 5 ) ; java . util . List < org . camunda . bpm . engine . history . CleanableHistoricDecisionInstanceReportResult > reportResults = historyService . createCleanableHistoricDecisionInstanceReport ( ) . list ( ) ; "<AssertPlaceHolder>" ; checkResultNumbers ( reportResults . get ( 0 ) , 0 , 10 ) ; } size ( ) { return ( ( ( historicProcessInstanceIds . size ( ) ) + ( historicDecisionInstanceIds . size ( ) ) ) + ( historicCaseInstanceIds . size ( ) ) ) + ( historicBatchIds . size ( ) ) ; } | org . junit . Assert . assertEquals ( 1 , reportResults . size ( ) ) |
testSubscriptionLocalizedContentWhenUpdatingBaseModel ( ) { java . util . Map < java . util . Locale , java . lang . String > previousLocalizedContents = new java . util . HashMap ( ) ; previousLocalizedContents . putAll ( localizedContents ) ; localizedContents . put ( LocaleUtil . SPAIN , com . liferay . portlet . subscriptions . test . BaseSubscriptionLocalizedContentTestCase . SPANISH_BODY ) ; setBaseModelSubscriptionBodyPreferences ( getSubscriptionUpdatedBodyPreferenceName ( ) ) ; com . liferay . portal . kernel . util . LocaleThreadLocal . setDefaultLocale ( LocaleUtil . SPAIN ) ; long baseModelId = addBaseModel ( creatorUser . getUserId ( ) , getDefaultContainerModelId ( ) ) ; addSubscriptionContainerModel ( getDefaultContainerModelId ( ) ) ; updateBaseModel ( creatorUser . getUserId ( ) , baseModelId ) ; java . util . List < com . liferay . portal . test . mail . MailMessage > messages = com . liferay . portal . test . mail . MailServiceTestUtil . getMailMessages ( "Body" , com . liferay . portlet . subscriptions . test . BaseSubscriptionLocalizedContentTestCase . SPANISH_BODY ) ; "<AssertPlaceHolder>" ; localizedContents = previousLocalizedContents ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( messages . toString ( ) , 1 , messages . size ( ) ) |
test ( ) { java . lang . String inputStr = "DES" ; java . lang . String key = com . mtools . core . plugin . security . DESCoder . initKey ( ) ; System . err . println ( ( "原文:\t" + inputStr ) ) ; System . err . println ( ( "密钥:\t" + key ) ) ; byte [ ] inputData = inputStr . getBytes ( ) ; inputData = com . mtools . core . plugin . security . DESCoder . encrypt ( inputData , key ) ; System . err . println ( ( "加密后:\t" + ( com . mtools . core . plugin . security . DESCoder . encryptBASE64 ( inputData ) ) ) ) ; byte [ ] outputData = com . mtools . core . plugin . security . DESCoder . decrypt ( inputData , key ) ; java . lang . String outputStr = new java . lang . String ( outputData ) ; System . err . println ( ( "解密后:\t" + outputStr ) ) ; "<AssertPlaceHolder>" ; } decrypt ( byte [ ] , java . lang . String ) { java . security . Key k = com . mtools . core . plugin . security . DESCoder . toKey ( decryptBASE64 ( key ) ) ; javax . crypto . Cipher cipher = javax . crypto . Cipher . getInstance ( com . mtools . core . plugin . security . DESCoder . ALGORITHM ) ; cipher . init ( Cipher . DECRYPT_MODE , k ) ; return cipher . doFinal ( data ) ; } | org . junit . Assert . assertEquals ( inputStr , outputStr ) |
testGetNewPositionOfTheBlackSheep ( ) { for ( it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain t : it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . objectsOfGame . Terrain . values ( ) ) { it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . move . MoveBlackSheep mbs = new it . polimi . deib . provaFinale2014 . andrea . celli_stefano1 . cereda . gameModel . move . MoveBlackSheep ( t , null ) ; mbs . setID ( ) ; "<AssertPlaceHolder>" ; } } getNewPositionOfTheBlackSheep ( ) { return newPosition ; } | org . junit . Assert . assertEquals ( t , mbs . getNewPositionOfTheBlackSheep ( ) ) |
testGetIndividual ( ) { long studyId = user3 . getProjects ( ) . get ( 0 ) . getStudies ( ) . get ( 0 ) . getUid ( ) ; org . opencb . opencga . core . models . Individual individual = new org . opencb . opencga . core . models . Individual ( "an_individual" , "An<sp>Individual" , IndividualProperty . Sex . MALE , "" , new org . opencb . opencga . core . models . Individual . Population ( ) , 1 , java . util . Collections . emptyList ( ) , null ) ; individual = catalogIndividualDBAdaptor . insert ( studyId , individual , null ) . first ( ) ; org . opencb . opencga . core . models . Individual individual2 = catalogIndividualDBAdaptor . get ( individual . getUid ( ) , null ) . first ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( "GenericGrpcServer{" ) ; sb . append ( "storageConfiguration=" ) . append ( storageConfiguration ) ; sb . append ( ",<sp>defaultStorageEngine='" ) . append ( defaultStorageEngine ) . append ( '\'' ) ; sb . append ( '}' ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( individual . toString ( ) , individual2 . toString ( ) ) |
testIsNotNull ( ) { com . j256 . ormlite . stmt . Where < com . j256 . ormlite . stmt . Foo , java . lang . String > where = new com . j256 . ormlite . stmt . Where < com . j256 . ormlite . stmt . Foo , java . lang . String > ( createTableInfo ( ) , null , databaseType ) ; where . isNotNull ( Foo . VAL_COLUMN_NAME ) ; java . lang . StringBuilder whereSb = new java . lang . StringBuilder ( ) ; where . appendSql ( null , whereSb , new java . util . ArrayList < com . j256 . ormlite . stmt . ArgumentHolder > ( ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; databaseType . appendEscapedEntityName ( sb , Foo . VAL_COLUMN_NAME ) ; sb . append ( "<sp>IS<sp>NOT<sp>NULL<sp>" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( getClass ( ) . getSimpleName ( ) ) + ":name=" ) + ( field . getName ( ) ) ) + ",class=" ) + ( field . getDeclaringClass ( ) . getSimpleName ( ) ) ; } | org . junit . Assert . assertEquals ( sb . toString ( ) , whereSb . toString ( ) ) |
testShoudNotThrowExceptionIfAlreadyUnformated ( ) { java . lang . String fotmatedValue = "12345678" ; java . lang . String unformatedValue = formatter . unformat ( fotmatedValue ) ; "<AssertPlaceHolder>" ; } unformat ( java . lang . String ) { return base . unformat ( value ) ; } | org . junit . Assert . assertEquals ( unformatedValue , "12345678" ) |
testDateRangeQuery2 ( ) { lemongrenade . core . database . mongo . Calendar calStart = lemongrenade . core . database . mongo . GregorianCalendar . getInstance ( ) ; calStart . add ( Calendar . DAY_OF_YEAR , ( - 29 ) ) ; lemongrenade . core . database . mongo . Calendar calEnd = lemongrenade . core . database . mongo . GregorianCalendar . getInstance ( ) ; calEnd . add ( Calendar . DAY_OF_YEAR , ( - 31 ) ) ; lemongrenade . core . database . mongo . Date startUtc = new org . apache . storm . shade . org . joda . time . DateTime ( calStart . getTimeInMillis ( ) , org . apache . storm . shade . org . joda . time . DateTimeZone . UTC ) . toDate ( ) ; lemongrenade . core . database . mongo . Date endUtc = new org . apache . storm . shade . org . joda . time . DateTime ( calEnd . getTimeInMillis ( ) , org . apache . storm . shade . org . joda . time . DateTimeZone . UTC ) . toDate ( ) ; lemongrenade . core . database . mongo . List < lemongrenade . core . models . LGJob > jobs1 = lemongrenade . core . database . mongo . LGJobDAOImplTest . dao . getAllByDateRange ( startUtc , endUtc ) ; System . out . println ( ( "Number<sp>of<sp>Jobs<sp>returned<sp>" + ( jobs1 . size ( ) ) ) ) ; for ( lemongrenade . core . models . LGJob job : jobs1 ) { System . out . println ( ( ( ( "<sp>:" + ( job . getCreateDate ( ) ) ) + "<sp>" ) + ( job . getJobConfig ( ) ) ) ) ; } "<AssertPlaceHolder>" ; } lookInList ( lemongrenade . core . database . mongo . List , java . lang . String ) { for ( lemongrenade . core . models . LGJob job : jobs ) { if ( job . getJobId ( ) . equals ( jobId ) ) { return true ; } } return false ; } | org . junit . Assert . assertFalse ( lookInList ( jobs1 , j . getJobId ( ) ) ) |
getsContentType ( ) { javax . ws . rs . core . MultivaluedMap < java . lang . String , java . lang . Object > headers = new javax . ws . rs . core . MultivaluedHashMap ( ) ; javax . ws . rs . core . MediaType mediaType = new javax . ws . rs . core . MediaType ( "text" , "plain" , com . google . common . collect . ImmutableMap . of ( "charset" , "utf-8" ) ) ; headers . putSingle ( org . everrest . core . impl . CONTENT_TYPE , mediaType ) ; org . everrest . core . impl . ResponseImpl response = new org . everrest . core . impl . ResponseImpl ( 200 , "foo" , null , headers ) ; "<AssertPlaceHolder>" ; } getMediaType ( ) { return mediaType ; } | org . junit . Assert . assertSame ( mediaType , response . getMediaType ( ) ) |
testSetAccountPartition ( ) { org . openstack . atlas . util . ip . IPv6 control = new org . openstack . atlas . util . ip . IPv6 ( "ffff::" ) ; org . openstack . atlas . util . ip . IPv6 expected = new org . openstack . atlas . util . ip . IPv6 ( "ffff::f0c6:5ccc:0000:0000" ) ; control . setAccountPartition ( 354934 ) ; "<AssertPlaceHolder>" ; } setAccountPartition ( int ) { byte [ ] accountBytes = java . lang . String . format ( "%s" , accountId ) . getBytes ( ) ; byte [ ] accountSha1 ; try { accountSha1 = org . openstack . atlas . util . crypto . HashUtil . sha1sum ( accountBytes , 0 , 4 ) ; } catch ( java . security . NoSuchAlgorithmException ex ) { throw new org . openstack . atlas . util . ip . exception . AccountUnHashableException ( "Account<sp>was<sp>not<sp>sha1<sp>Sum<sp>Hashable" , ex ) ; } java . math . BigInteger sha1Int = new java . math . BigInteger ( 1 , accountSha1 ) ; this . insertBigInteger ( sha1Int , 64 , 32 ) ; } | org . junit . Assert . assertEquals ( expected , control ) |
split_string_to_list_using_fix_length ( ) { java . util . List < java . lang . String > digits = com . google . common . base . Splitter . fixedLength ( 1 ) . splitToList ( "1234567890" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 10 , digits . size ( ) ) |
shouldReturnFalseWhenExceptionWhileMatching ( ) { org . hamcrest . Matcher delegatedMatcher = org . mockito . Mockito . mock ( org . hamcrest . Matcher . class ) ; when ( delegatedMatcher . matches ( any ( ) ) ) . thenThrow ( cn . jimmyshi . beanquery . NullPointerException . class ) ; cn . jimmyshi . beanquery . BeanPropertyMatcher beanPropertyMatcher = new cn . jimmyshi . beanquery . BeanPropertyMatcher ( "propertyName" , delegatedMatcher ) ; boolean result = beanPropertyMatcher . matches ( new cn . jimmyshi . beanquery . example . Book ( ) ) ; "<AssertPlaceHolder>" ; verify ( delegatedMatcher ) . matches ( any ( ) ) ; } matches ( java . lang . Object ) { java . lang . Object propertyValue = cn . jimmyshi . beanquery . DefaultNullValuePropertyValueGetter . getProperty ( item , property ) ; try { return matcher . matches ( propertyValue ) ; } catch ( java . lang . Exception ex ) { logger . info ( "Exception<sp>[{}]<sp>when<sp>matching<sp>value<sp>[{}]<sp>(property<sp>[{}]<sp>of<sp>item<sp>[{}])<sp>with<sp>matcher<sp>[{}]" , ex . toString ( ) , propertyValue , property , item , matcher ) ; return false ; } } | org . junit . Assert . assertFalse ( result ) |
toWorkFormTest ( ) { org . orcid . jaxb . model . v3 . rc2 . record . Work work = getWork ( ) ; org . orcid . pojo . ajaxForm . WorkForm form = org . orcid . pojo . ajaxForm . WorkForm . valueOf ( work ) ; "<AssertPlaceHolder>" ; } getWorkForm ( ) { org . orcid . pojo . ajaxForm . WorkForm form = new org . orcid . pojo . ajaxForm . WorkForm ( ) ; form . setCitation ( new org . orcid . pojo . ajaxForm . Citation ( "artistic-performance" 3 , "artistic-performance" 6 ) ) ; java . util . List < org . orcid . pojo . ajaxForm . Contributor > ontributors = new java . util . ArrayList < org . orcid . pojo . ajaxForm . Contributor > ( ) ; org . orcid . pojo . ajaxForm . Contributor contributor = new org . orcid . pojo . ajaxForm . Contributor ( ) ; contributor . setContributorRole ( org . orcid . pojo . ajaxForm . Text . valueOf ( "co-inventor" ) ) ; contributor . setContributorSequence ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" 8 ) ) ; contributor . setCreditName ( org . orcid . pojo . ajaxForm . Text . valueOf ( "Contributor<sp>credit<sp>name" ) ) ; contributor . setEmail ( null ) ; contributor . setOrcid ( org . orcid . pojo . ajaxForm . Text . valueOf ( "Contributor<sp>credit<sp>name" 0 ) ) ; contributor . setUri ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" 0 ) ) ; ontributors . add ( contributor ) ; form . setContributors ( ontributors ) ; form . setCountryCode ( org . orcid . pojo . ajaxForm . Text . valueOf ( "US" ) ) ; org . orcid . pojo . ajaxForm . Date createdDate = new org . orcid . pojo . ajaxForm . Date ( ) ; createdDate . setDay ( "artistic-performance" 5 ) ; createdDate . setMonth ( "artistic-performance" 5 ) ; createdDate . setYear ( "Contributor<sp>credit<sp>name" 3 ) ; form . setCreatedDate ( createdDate ) ; form . setJournalTitle ( org . orcid . pojo . ajaxForm . Text . valueOf ( "Journal<sp>title" ) ) ; form . setLanguageCode ( org . orcid . pojo . ajaxForm . Text . valueOf ( "en" ) ) ; org . orcid . pojo . ajaxForm . Date lastModifiedDate = new org . orcid . pojo . ajaxForm . Date ( ) ; lastModifiedDate . setDay ( "2" ) ; lastModifiedDate . setMonth ( "2" ) ; lastModifiedDate . setYear ( "Contributor<sp>credit<sp>name" 3 ) ; form . setLastModified ( lastModifiedDate ) ; org . orcid . pojo . ajaxForm . Date publicationDate = new org . orcid . pojo . ajaxForm . Date ( ) ; publicationDate . setDay ( "artistic-performance" 7 ) ; publicationDate . setMonth ( "artistic-performance" 7 ) ; publicationDate . setYear ( "Contributor<sp>credit<sp>name" 3 ) ; form . setPublicationDate ( publicationDate ) ; form . setDateSortString ( org . orcid . pojo . ajaxForm . PojoUtil . createDateSortString ( null , org . orcid . jaxb . model . v3 . release . common . FuzzyDate . valueOf ( 2015 , 3 , 3 ) ) ) ; form . setPutCode ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" 5 ) ) ; form . setShortDescription ( org . orcid . pojo . ajaxForm . Text . valueOf ( "Short<sp>description" ) ) ; form . setSource ( "artistic-performance" 2 ) ; form . setSubtitle ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" 9 ) ) ; form . setTitle ( org . orcid . pojo . ajaxForm . Text . valueOf ( "Title" ) ) ; form . setTranslatedTitle ( new org . orcid . pojo . ajaxForm . TranslatedTitleForm ( "Contributor<sp>credit<sp>name" 1 , "es" ) ) ; form . setUrl ( org . orcid . pojo . ajaxForm . Text . valueOf ( "Contributor<sp>credit<sp>name" 2 ) ) ; form . setVisibility ( org . orcid . pojo . ajaxForm . Visibility . valueOf ( org . orcid . jaxb . model . v3 . release . common . Visibility . PUBLIC ) ) ; java . util . List < org . orcid . pojo . ajaxForm . ActivityExternalIdentifier > extIds = new java . util . ArrayList < org . orcid . pojo . ajaxForm . ActivityExternalIdentifier > ( ) ; org . orcid . pojo . ajaxForm . ActivityExternalIdentifier extId = new org . orcid . pojo . ajaxForm . ActivityExternalIdentifier ( ) ; extId . setExternalIdentifierId ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" 1 ) ) ; extId . setExternalIdentifierType ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" 4 ) ) ; extId . setRelationship ( org . orcid . pojo . ajaxForm . Text . valueOf ( Relationship . SELF . value ( ) ) ) ; extIds . add ( extId ) ; form . setWorkExternalIdentifiers ( extIds ) ; form . setWorkType ( org . orcid . pojo . ajaxForm . Text . valueOf ( "artistic-performance" ) ) ; org . orcid . jaxb . model . v3 . release . record . WorkCategory category = org . orcid . jaxb . model . v3 . release . record . WorkCategory . fromWorkType ( org . orcid . jaxb . model . common . WorkType . fromValue ( form . getWorkType ( ) . getValue ( ) ) ) ; form . setWorkCategory ( org . orcid . pojo . ajaxForm . Text . valueOf ( category . value ( ) ) ) ; return form ; } | org . junit . Assert . assertEquals ( getWorkForm ( ) , form ) |
testGetBackupRangeBatch ( ) { java . lang . String expectedSql = "SELECT<sp>*<sp>FROM<sp>SOME_TABLE<sp>WHERE<sp>`ID`<sp>BETWEEN<sp>:BMINID<sp>AND<sp>:BMAXID" ; java . lang . String sql = org . sagebionetworks . repo . model . dbo . DMLUtils . getBackupRangeBatch ( mapping ) ; "<AssertPlaceHolder>" ; } getBackupRangeBatch ( org . sagebionetworks . repo . model . dbo . TableMapping ) { org . sagebionetworks . repo . model . dbo . DMLUtils . validateMigratableTableMapping ( mapping ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( "SELECT<sp>*<sp>FROM<sp>" ) ; builder . append ( mapping . getTableName ( ) ) ; org . sagebionetworks . repo . model . dbo . DMLUtils . addBackupRange ( builder , mapping ) ; return builder . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedSql , sql ) |
testEmptyAssemblyConfig ( ) { io . fabric8 . maven . docker . assembly . DockerAssemblyConfigurationSource source = new io . fabric8 . maven . docker . assembly . DockerAssemblyConfigurationSource ( new io . fabric8 . maven . docker . util . MojoParameters ( null , null , null , null , null , null , "/src/docker" , "/output/docker" , null ) , null , null ) ; "<AssertPlaceHolder>" ; } getDescriptors ( ) { if ( ( assemblyConfig ) != null ) { java . lang . String descriptor = assemblyConfig . getDescriptor ( ) ; if ( descriptor != null ) { return new java . lang . String [ ] { io . fabric8 . maven . docker . util . EnvUtil . prepareAbsoluteSourceDirPath ( params , descriptor ) . getAbsolutePath ( ) } ; } } return new java . lang . String [ 0 ] ; } | org . junit . Assert . assertEquals ( 0 , source . getDescriptors ( ) . length ) |
testConvertNull ( ) { java . lang . Byte result = underTest . convert ( null ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { if ( "S" . equalsIgnoreCase ( value ) ) { return Size . TINY ; } else if ( "M" . equalsIgnoreCase ( value ) ) { return Size . NORMAL ; } else if ( "L" . equalsIgnoreCase ( value ) ) { return Size . HUGE ; } else { return null ; } } | org . junit . Assert . assertNull ( result ) |
testGetElapsedTimeInMilliSeconds ( ) { org . openscience . smsd . tools . TimeManager instance = new org . openscience . smsd . tools . TimeManager ( ) ; double expResult = 360 ; myMethod ( 360 ) ; double result = instance . getElapsedTimeInMilliSeconds ( ) ; "<AssertPlaceHolder>" ; } getElapsedTimeInMilliSeconds ( ) { double currentTime = java . lang . System . currentTimeMillis ( ) ; return currentTime - ( startTime ) ; } | org . junit . Assert . assertEquals ( expResult , result , 360 ) |
testMultipleTimeSeriesMovingAverage ( ) { table . clear ( ) ; long ts = java . lang . System . currentTimeMillis ( ) ; timely . store . iterators . List < timely . model . Tag > tags1 = new timely . store . iterators . ArrayList ( ) ; tags1 . add ( new timely . model . Tag ( "host" , "r01n01" ) ) ; timely . store . iterators . List < timely . model . Tag > tags2 = new timely . store . iterators . ArrayList ( ) ; tags2 . add ( new timely . model . Tag ( "host" , "r01n02" ) ) ; for ( int i = 0 ; i < 100 ; i ++ ) { ts += 1000 ; timely . model . Metric m = new timely . model . Metric ( "sys.cpu.user" , ts , ( i * 1.0 ) , tags1 ) ; byte [ ] row = timely . adapter . accumulo . MetricAdapter . encodeRowKey ( m ) ; org . apache . accumulo . core . data . Key k = new org . apache . accumulo . core . data . Key ( row , tags1 . get ( 0 ) . join ( ) . getBytes ( StandardCharsets . UTF_8 ) , timely . adapter . accumulo . MetricAdapter . encodeColQual ( ts , "" ) , new byte [ 0 ] , ts ) ; org . apache . accumulo . core . data . Value v = new org . apache . accumulo . core . data . Value ( timely . adapter . accumulo . MetricAdapter . encodeValue ( m . getValue ( ) . getMeasure ( ) ) ) ; table . put ( k , v ) ; timely . model . Metric m2 = new timely . model . Metric ( "sys.cpu.user" , ts , ( i * 2.0 ) , tags2 ) ; byte [ ] row2 = timely . adapter . accumulo . MetricAdapter . encodeRowKey ( m2 ) ; org . apache . accumulo . core . data . Key k2 = new org . apache . accumulo . core . data . Key ( row2 , tags2 . get ( 0 ) . join ( ) . getBytes ( StandardCharsets . UTF_8 ) , timely . adapter . accumulo . MetricAdapter . encodeColQual ( ts , "" ) , new byte [ 0 ] , ts ) ; org . apache . accumulo . core . data . Value v2 = new org . apache . accumulo . core . data . Value ( timely . adapter . accumulo . MetricAdapter . encodeValue ( m2 . getValue ( ) . getMeasure ( ) ) ) ; table . put ( k2 , v2 ) ; } org . apache . accumulo . core . iterators . SortedMapIterator source = new org . apache . accumulo . core . iterators . SortedMapIterator ( table ) ; timely . store . iterators . TimeSeriesGroupingIterator iter = new timely . store . iterators . TimeSeriesGroupingIterator ( ) ; org . apache . accumulo . core . client . IteratorSetting settings = new org . apache . accumulo . core . client . IteratorSetting ( 100 , timely . store . iterators . TimeSeriesGroupingIterator . class ) ; settings . addOption ( TimeSeriesGroupingIterator . FILTER , "0.20,0.20,0.20,0.20,0.20" ) ; iter . init ( source , settings . getOptions ( ) , timely . store . iterators . SCAN_IE ) ; iter . seek ( new org . apache . accumulo . core . data . Range ( ) , timely . store . iterators . EMPTY_COL_FAMS , true ) ; for ( int i = 4 ; i < 100 ; i ++ ) { checkNextResult ( iter , new double [ ] { i - 4 , i - 3 , i - 2 , i - 1 , i } ) ; } for ( int i = 4 ; i < 100 ; i ++ ) { checkNextResult ( iter , new double [ ] { ( i - 4 ) * 2 , ( i - 3 ) * 2 , ( i - 2 ) * 2 , ( i - 1 ) * 2 , i * 2 } ) ; } "<AssertPlaceHolder>" ; } hasTop ( ) { while ( super . hasTop ( ) ) { last = super . getTopKey ( ) ; java . util . Map < java . util . Set < timely . model . Tag > , timely . sample . Downsample > samples = null ; try { samples = timely . sample . iterators . DownsampleIterator . decodeValue ( super . getTopValue ( ) ) ; } catch ( timely . sample . iterators . IOException e ) { throw new java . lang . RuntimeException ( "Unable<sp>to<sp>decode<sp>upstream<sp>value<sp>as<sp>a<sp>Downsample" , e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( "Unable<sp>to<sp>find<sp>class<sp>for<sp>value<sp>(expected<sp>to<sp>be<sp>a<sp>Downsample)" , e ) ; } for ( Map . Entry < java . util . Set < timely . model . Tag > , timely . sample . Downsample > entry : samples . entrySet ( ) ) { for ( timely . sample . Sample sample : entry . getValue ( ) ) { aggregation . add ( sample . timestamp , sample . value ) ; } } try { super . next ( ) ; } catch ( timely . sample . iterators . IOException e ) { throw new java . lang . RuntimeException ( "Downstream<sp>next()<sp>failed" , e ) ; } } return ( last ) != null ; } | org . junit . Assert . assertFalse ( iter . hasTop ( ) ) |
testCreateDir ( ) { System . out . println ( "Testing<sp>HDFSBackendImplREST.createDir" ) ; try { backend . setHttpClient ( mockHttpClientExistsCreateDir ) ; backend . createDir ( dirPath ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } finally { "<AssertPlaceHolder>" ; } createDir ( java . lang . String ) { com . telefonica . iot . cygnus . backends . hdfs . HDFSBackendImplBinary . CreateDirPEA pea = new com . telefonica . iot . cygnus . backends . hdfs . HDFSBackendImplBinary . CreateDirPEA ( dirPath ) ; org . apache . hadoop . security . UserGroupInformation ugi = org . apache . hadoop . security . UserGroupInformation . createRemoteUser ( hdfsUser ) ; try { ugi . doAs ( pea ) ; } catch ( java . io . IOException e ) { throw new com . telefonica . iot . cygnus . errors . CygnusPersistenceError ( "Directory<sp>creation<sp>error" , "IOException" , e . getMessage ( ) ) ; } catch ( java . lang . InterruptedException e ) { throw new com . telefonica . iot . cygnus . errors . CygnusPersistenceError ( "Directory<sp>creation<sp>error" , "InterruptedException" , e . getMessage ( ) ) ; } | org . junit . Assert . assertTrue ( true ) |
testProcessIndication ( ) { javax . cim . CIMInstance indication = createAlertIndication ( ) ; com . emc . storageos . cimadapter . connections . ecom . EcomConnection connection = createEcomConnection ( ) ; com . emc . storageos . cimadapter . processors . EcomIndicationProcessor processor = new com . emc . storageos . cimadapter . processors . EcomIndicationProcessor ( connection ) ; com . emc . storageos . cimadapter . processors . CimIndicationSet indicationData = processor . processIndication ( indication ) ; "<AssertPlaceHolder>" ; } isAlertIndication ( ) { return containsKey ( CimConstants . ALERT_INDICATION_KEY ) ; } | org . junit . Assert . assertTrue ( indicationData . isAlertIndication ( ) ) |
testRoundTripDate ( ) { com . hp . hpl . jena . rdf . model . Literal l = com . hp . hpl . jena . rdf . model . ResourceFactory . createTypedLiteral ( "1999-05-31" , XSDDatatype . XSDdate ) ; java . lang . String date = com . epimorphics . jsonrdf . RDFUtil . formatDateTime ( l , false ) ; com . hp . hpl . jena . rdf . model . Literal lret = com . epimorphics . jsonrdf . RDFUtil . parseDateTime ( date , l . getDatatypeURI ( ) ) ; "<AssertPlaceHolder>" ; } formatDateTime ( com . epimorphics . jsonrdf . Literal , boolean ) { java . lang . Object val = com . epimorphics . jsonrdf . RDFUtil . getTemporalValue ( l ) ; if ( val instanceof com . hp . hpl . jena . datatypes . xsd . XSDDateTime ) { boolean isDate = l . getDatatype ( ) . equals ( XSDDatatype . XSDdate ) ; com . epimorphics . jsonrdf . Date date = ( ( com . hp . hpl . jena . datatypes . xsd . XSDDateTime ) ( val ) ) . asCalendar ( ) . getTime ( ) ; if ( jsonUsesISOdate ) { return com . epimorphics . jsonrdf . RDFUtil . dateFormatISO ( com . epimorphics . jsonrdf . RDFUtil . hasTimeZone ( l . getLexicalForm ( ) ) , isDate ) . format ( date ) ; } else { return com . epimorphics . jsonrdf . RDFUtil . dateFormat ( com . epimorphics . jsonrdf . RDFUtil . hasTimeZone ( l . getLexicalForm ( ) ) , isDate ) . format ( date ) ; } } else { return null ; } } | org . junit . Assert . assertEquals ( l , lret ) |
testHashCode ( ) { java . util . Set < java . lang . Integer > uniques = result . stream ( ) . map ( Token :: hashCode ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; "<AssertPlaceHolder>" ; } stream ( ) { return java . util . stream . StreamSupport . stream ( java . util . Spliterators . spliteratorUnknownSize ( iterator ( ) , ( ( java . util . Spliterator . DISTINCT ) | ( java . util . Spliterator . NONNULL ) ) ) , false ) ; } | org . junit . Assert . assertEquals ( result . size ( ) , uniques . size ( ) ) |
getDefaultFsUrl ( ) { com . hortonworks . streamline . streams . cluster . service . metadata . HDFSMetadataService hdfsMetadataService = new com . hortonworks . streamline . streams . cluster . service . metadata . HDFSMetadataService ( configuration ) ; new mockit . Expectations ( ) { { configuration . get ( HDFSMetadataService . CONFIG_KEY_DEFAULT_FS ) ; result = com . hortonworks . streamline . streams . cluster . service . metadata . HDFSMetadataServiceTest . TEST_FS_URL ; } } ; "<AssertPlaceHolder>" ; } getDefaultFsUrl ( ) { return hdfsConfiguration . get ( com . hortonworks . streamline . streams . cluster . service . metadata . HDFSMetadataService . CONFIG_KEY_DEFAULT_FS ) ; } | org . junit . Assert . assertEquals ( com . hortonworks . streamline . streams . cluster . service . metadata . HDFSMetadataServiceTest . TEST_FS_URL , hdfsMetadataService . getDefaultFsUrl ( ) ) |
testDeleteCacheByGridSetId ( ) { when ( storageBroker . deleteByGridSetId ( eq ( "layer" ) , eq ( "gset1" ) ) ) . thenThrow ( new org . geowebcache . storage . StorageException ( "fake" ) ) ; try { mediator . deleteCacheByGridSetId ( "layer" , "gset1" ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . RuntimeException e ) { "<AssertPlaceHolder>" ; } mediator . deleteCacheByGridSetId ( "layer" , "gset2" ) ; verify ( storageBroker , times ( 1 ) ) . deleteByGridSetId ( eq ( "layer" ) , eq ( "gset2" ) ) ; } deleteCacheByGridSetId ( java . lang . String , java . lang . String ) { try { storageBroker . deleteByGridSetId ( layerName , gridSetId ) ; } catch ( org . geowebcache . storage . StorageException e ) { throw propagate ( getRootCause ( e ) ) ; } } | org . junit . Assert . assertTrue ( true ) |
testGetGeneratorNameWhenUndefined ( ) { "<AssertPlaceHolder>" ; } getGeneratorName ( ) { return org . apache . commons . lang . StringUtils . defaultIfEmpty ( asString ( "generate" ) , asString ( "generator" ) ) ; } | org . junit . Assert . assertEquals ( "" , param . getGeneratorName ( ) ) |
shouldInValidateWithExplicitlyNullStringsAuth ( ) { final uk . gov . gchq . gaffer . federatedstore . FederatedAccess access = new uk . gov . gchq . gaffer . federatedstore . FederatedAccess . Builder ( ) . graphAuths ( ( ( java . lang . String [ ] ) ( null ) ) ) . build ( ) ; "<AssertPlaceHolder>" ; } isValidToExecute ( uk . gov . gchq . gaffer . user . User ) { return ( isPublic ) || ( ( null != user ) && ( ( isAddingUser ( user ) ) || ( ( ! ( isAuthsNullOrEmpty ( ) ) ) && ( isUserHasASharedAuth ( user ) ) ) ) ) ; } | org . junit . Assert . assertFalse ( access . isValidToExecute ( user ) ) |
testCrash_119_simpleif_0 ( ) { org . nd4j . linalg . factory . Nd4j . create ( 1 ) ; lombok . val tg = org . nd4j . imports . graphmapper . tf . TFGraphMapper . getInstance ( ) . importGraph ( new org . nd4j . linalg . io . ClassPathResource ( "tf_graphs/examples/simpleif_0/frozen_model.pb" ) . getInputStream ( ) ) ; "<AssertPlaceHolder>" ; lombok . val input0 = org . nd4j . linalg . factory . Nd4j . create ( new float [ ] { 1 , 2 , 3 , 4 } , new int [ ] { 2 , 2 } ) ; lombok . val input1 = org . nd4j . linalg . factory . Nd4j . trueScalar ( 11.0F ) ; tg . associateArrayWithVariable ( input0 , tg . getVariable ( "input_0" ) ) ; tg . associateArrayWithVariable ( input1 , tg . getVariable ( "input_1" ) ) ; } getInputStream ( ) { java . net . URL url = this . getUrl ( ) ; if ( isJarURL ( url ) ) { try { url = extractActualUrl ( url ) ; java . util . zip . ZipFile zipFile = new java . util . zip . ZipFile ( url . getFile ( ) ) ; java . util . zip . ZipEntry entry = zipFile . getEntry ( this . resourceName ) ; org . nd4j . linalg . util . InputStream stream = zipFile . getInputStream ( entry ) ; return stream ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } } else { org . nd4j . linalg . util . File srcFile = this . getFile ( ) ; return new org . nd4j . linalg . util . FileInputStream ( srcFile ) ; } } | org . junit . Assert . assertNotNull ( tg ) |
shouldReturnFalseWhenShouldOverrideTranslation ( ) { java . lang . String key = "key" ; java . util . Locale locale = new java . util . Locale ( "pl" ) ; org . springframework . test . util . ReflectionTestUtils . setField ( translationServiceOverrideUtil , "useCustomTranslations" , false ) ; given ( pluginStateResolver . isEnabled ( CustomTranslationContants . PLUGIN_IDENTIFIER ) ) . willReturn ( false ) ; given ( customTranslationResolver . isCustomTranslationActive ( key , locale ) ) . willReturn ( false ) ; boolean result = translationServiceOverrideUtil . shouldOverrideTranslation ( key , locale ) ; "<AssertPlaceHolder>" ; } shouldOverrideTranslation ( java . lang . String , java . util . Locale ) { return ( ( useCustomTranslations ) && ( pluginStateResolver . isEnabled ( CustomTranslationContants . PLUGIN_IDENTIFIER ) ) ) && ( customTranslationResolver . isCustomTranslationActive ( key , locale ) ) ; } | org . junit . Assert . assertFalse ( result ) |
testNotRemoveIdentities ( ) { org . drools . core . impl . InternalKnowledgeBase kBase = ( ( org . drools . core . impl . InternalKnowledgeBase ) ( org . drools . core . impl . KnowledgeBaseFactory . newKnowledgeBase ( ) ) ) ; kBase . addPackage ( this . pkg ) ; this . ksession = kBase . newKieSession ( ) ; this . ksession . insert ( "F1" ) ; this . ksession . insert ( "F2" ) ; this . ksession . insert ( "F3" ) ; this . ksession . insert ( "F4" ) ; this . ksession . fireAllRules ( ) ; System . out . println ( values ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( 16 , this . values . size ( ) ) |
cloneAsVersionTest ( ) { final org . opendaylight . controller . cluster . access . commands . TransactionDoCommitRequest clone = org . opendaylight . controller . cluster . access . commands . TransactionDoCommitRequestTest . OBJECT . cloneAsVersion ( ABIVersion . BORON ) ; "<AssertPlaceHolder>" ; } cloneAsVersion ( org . opendaylight . controller . cluster . access . ABIVersion ) { return ( ( T ) ( this ) ) ; } | org . junit . Assert . assertEquals ( org . opendaylight . controller . cluster . access . commands . TransactionDoCommitRequestTest . OBJECT , clone ) |
encodeMapQueryParam_mapOfStringToBoolean ( ) { java . lang . String prefix = "definedTags<sp>Exists." ; java . lang . String keyName1 = "tagMustExist" ; java . lang . String keyName2 = "tagMust<sp>NotExist" ; java . util . Map < java . lang . String , java . lang . Boolean > definedTagsExists = com . google . common . collect . ImmutableMap . of ( keyName1 , true , keyName2 , false ) ; javax . ws . rs . client . WebTarget target = mock ( javax . ws . rs . client . WebTarget . class ) ; when ( target . queryParam ( anyString ( ) , any ( ) ) ) . thenReturn ( target ) ; com . oracle . bmc . http . internal . WrappedWebTarget wrapped = new com . oracle . bmc . http . internal . WrappedWebTarget ( target ) ; com . oracle . bmc . http . internal . WrappedWebTarget result = com . oracle . bmc . util . internal . HttpUtils . encodeMapQueryParam ( wrapped , prefix , definedTagsExists ) ; "<AssertPlaceHolder>" ; java . lang . String prefixEncoded = "definedTags%20Exists." ; java . lang . String keyName2Encoded = "tagMust%20NotExist" ; verify ( target ) . queryParam ( ( prefixEncoded + keyName1 ) , true ) ; verify ( target ) . queryParam ( ( prefixEncoded + keyName2Encoded ) , false ) ; } encodeMapQueryParam ( com . oracle . bmc . http . internal . WrappedWebTarget , java . lang . String , java . util . Map ) { if ( prefix == null ) { prefix = "" ; } if ( queryParam != null ) { for ( java . util . Map . Entry < java . lang . String , ? > e : queryParam . entrySet ( ) ) { target = com . oracle . bmc . util . internal . HttpUtils . encodeMapQueryParamValue ( target , ( prefix + ( e . getKey ( ) ) ) , e . getValue ( ) ) ; } } return target ; } | org . junit . Assert . assertNotNull ( result ) |
testHasJsps_noFiles ( ) { org . eclipse . wst . common . componentcore . resources . IVirtualFolder root = mock ( org . eclipse . wst . common . componentcore . resources . IVirtualFolder . class , "/" ) ; org . eclipse . wst . common . componentcore . resources . IVirtualFile txt = mock ( org . eclipse . wst . common . componentcore . resources . IVirtualFile . class , "/a.txt" ) ; when ( txt . getFileExtension ( ) ) . thenReturn ( "txt" ) ; org . eclipse . wst . common . componentcore . resources . IVirtualFolder folder = mock ( org . eclipse . wst . common . componentcore . resources . IVirtualFolder . class , "/a" ) ; when ( root . members ( ) ) . thenReturn ( new org . eclipse . wst . common . componentcore . resources . IVirtualResource [ ] { txt , folder } ) ; when ( folder . members ( ) ) . thenReturn ( new org . eclipse . wst . common . componentcore . resources . IVirtualResource [ ] { } ) ; "<AssertPlaceHolder>" ; verify ( root , times ( 2 ) ) . members ( ) ; verify ( folder , times ( 2 ) ) . members ( ) ; verify ( txt ) . getFileExtension ( ) ; verifyNoMoreInteractions ( root , folder , txt ) ; } hasJsps ( org . eclipse . core . resources . IProject ) { org . eclipse . wst . common . componentcore . resources . IVirtualComponent component = org . eclipse . wst . common . componentcore . ComponentCore . createComponent ( project ) ; if ( ( component == null ) || ( ! ( component . exists ( ) ) ) ) { return false ; } return com . google . cloud . tools . eclipse . appengine . facets . WebProjectUtil . hasJsps ( component . getRootFolder ( ) ) ; } | org . junit . Assert . assertFalse ( com . google . cloud . tools . eclipse . appengine . facets . WebProjectUtil . hasJsps ( root ) ) |
testRewriteUri ( ) { javax . servlet . http . HttpServletRequest request = buildGoogleDotComServletRequest ( ) ; java . net . URL redirectUrl = buildRedirectUrl ( ) ; com . woonoz . proxy . servlet . UrlRewriter rewriter = new com . woonoz . proxy . servlet . UrlRewriterImpl ( request , redirectUrl ) ; java . net . URI uri = new java . net . URI ( "http://www.google.com/proxy/docs/index.html" ) ; java . net . URI expectedUri = new java . net . URI ( "http://localhost:8180/services/docs/index.html" ) ; "<AssertPlaceHolder>" ; org . easymock . EasyMock . verify ( request ) ; } rewriteUri ( java . net . URI ) { if ( requestedUrlPointsToServlet ( url ) ) { final java . lang . String targetPath = rewritePathIfNeeded ( url . getPath ( ) ) ; return new org . apache . http . client . utils . URIBuilder ( ) . setScheme ( targetServer . getProtocol ( ) ) . setHost ( targetServer . getHost ( ) ) . setPort ( targetServer . getPort ( ) ) . setPath ( targetPath ) . setQuery ( servletRequest . getQueryString ( ) ) . build ( ) ; } else { return url ; } } | org . junit . Assert . assertEquals ( expectedUri , rewriter . rewriteUri ( uri ) ) |
fetchItems ( ) { itemProvider . addItems ( book . twju . chapter_5 . TimelineTest . FIRST_ITEM , book . twju . chapter_5 . TimelineTest . SECOND_ITEM , book . twju . chapter_5 . TimelineTest . THIRD_ITEM , book . twju . chapter_5 . TimelineTest . FOURTH_ITEM , book . twju . chapter_5 . TimelineTest . FIFTH_ITEM , book . twju . chapter_5 . TimelineTest . SIXTH_ITEM ) ; timeline . setFetchCount ( 2 ) ; timeline . fetchItems ( ) ; timeline . fetchItems ( ) ; java . util . List < book . twju . chapter_5 . Item > actual = timeline . getItems ( ) ; "<AssertPlaceHolder>" ; } getItems ( ) { java . util . Set < book . twju . timeline . model . FakeItem > actual = memento . getItems ( ) ; book . twju . timeline . model . MementoAssert . assertThat ( actual ) . isEqualTo ( book . twju . timeline . model . FakeItems . ALL_ITEMS ) ; } | org . junit . Assert . assertArrayEquals ( new book . twju . chapter_5 . Item [ ] { book . twju . chapter_5 . TimelineTest . SIXTH_ITEM , book . twju . chapter_5 . TimelineTest . FIFTH_ITEM , book . twju . chapter_5 . TimelineTest . FOURTH_ITEM , book . twju . chapter_5 . TimelineTest . THIRD_ITEM } , actual . toArray ( new book . twju . chapter_5 . Item [ 2 ] ) ) |
testCreateSingleSetter ( ) { try { org . eclipse . xtend2 . lib . StringConcatenation _builder = new org . eclipse . xtend2 . lib . StringConcatenation ( ) ; _builder . append ( "import<sp>org.eclipse.xtend.lib.annotations.Accessors" ) ; _builder . newLine ( ) ; _builder . append ( "class<sp>Foo<sp>{" ) ; _builder . newLine ( ) ; _builder . append ( "\t" ) ; _builder . append ( "@Accessors<sp>int<sp>foo" ) ; _builder . newLine ( ) ; _builder . append ( "}" ) ; _builder . newLine ( ) ; final org . eclipse . xtext . util . IAcceptor < org . eclipse . xtext . xbase . testing . CompilationTestHelper . Result > _function = ( org . eclipse . xtext . xbase . testing . CompilationTestHelper . Result it ) -> { try { final java . lang . Object instance = it . getCompiledClass ( ) . newInstance ( ) ; final java . lang . reflect . Method setFoo = it . getCompiledClass ( ) . getDeclaredMethod ( "setFoo" , . class ) ; java . lang . reflect . Field _declaredField = it . getCompiledClass ( ) . getDeclaredField ( "foo" ) ; final Procedure1 < java . lang . reflect . Field > _function_1 = ( java . lang . reflect . Field it_1 ) -> { it_1 . setAccessible ( true ) ; } ; final java . lang . reflect . Field fooField = org . eclipse . xtext . xbase . lib . ObjectExtensions . < java . lang . reflect . Field > operator_doubleArrow ( _declaredField , _function_1 ) ; setFoo . invoke ( instance , java . lang . Integer . valueOf ( 1 ) ) ; "<AssertPlaceHolder>" ; } catch ( _e ) { throw org . eclipse . xtext . xbase . lib . Exceptions . sneakyThrow ( org . eclipse . xtend . core . tests . compiler . _e ) ; } } ; this . compilationTestHelper . compile ( _builder , _function ) ; } catch ( java . lang . Throwable _e ) { throw org . eclipse . xtext . xbase . lib . Exceptions . sneakyThrow ( _e ) ; } } get ( org . eclipse . emf . ecore . resource . ResourceSet ) { for ( org . eclipse . emf . common . notify . Adapter a : rs . eAdapters ( ) ) if ( a instanceof org . eclipse . xtend . maven . MavenProjectAdapter ) return ( ( org . eclipse . xtend . maven . MavenProjectAdapter ) ( a ) ) . project ; throw new java . lang . RuntimeException ( "The<sp>Maven<sp>Project<sp>is<sp>not<sp>registered<sp>in<sp>the<sp>ResourceSet" ) ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 1 ) , fooField . get ( instance ) ) |
remoteDifferent_Operations_nonBlocking ( ) { org . ebayopensource . turmeric . runtime . tests . service1 . sample . types1 . MyMessage msg = org . ebayopensource . turmeric . runtime . tests . common . util . TestUtils . createTestMessage ( ) ; org . ebayopensource . turmeric . runtime . sif . service . Service service = org . ebayopensource . turmeric . runtime . sif . service . ServiceFactory . create ( "test1" , "remote" , serverUri . toURL ( ) ) ; service . createDispatch ( "echoString" ) . invokeAsync ( ECHO_STRING ) ; msg . setBody ( msg . getBody ( ) ) ; service . createDispatch ( "myTestOperation" ) . invokeAsync ( msg ) ; java . util . List < javax . xml . ws . Response < ? > > responseList = service . poll ( false , false ) ; "<AssertPlaceHolder>" ; } poll ( boolean , boolean ) { java . util . List < javax . xml . ws . Response < ? > > result = null ; try { m_proxy = getProxy ( ) ; } catch ( com . ebay . soaframework . common . exceptions . ServiceException serviceException ) { throw com . ebay . soaframework . common . exceptions . ServiceRuntimeException . wrap ( serviceException ) ; } result = m_proxy . poll ( param0 , param1 ) ; return result ; } | org . junit . Assert . assertTrue ( ( ( responseList . size ( ) ) == 2 ) ) |
testSignVerify ( ) { org . ethereum . crypto . ECKey key = org . ethereum . crypto . ECKey . fromPrivate ( privateKey ) ; java . lang . String message = new java . lang . String ( "This<sp>is<sp>an<sp>example<sp>of<sp>a<sp>signed<sp>message." ) ; org . ethereum . crypto . ECKey . ECDSASignature output = key . doSign ( message . getBytes ( ) ) ; "<AssertPlaceHolder>" ; } verify ( byte [ ] , org . ethereum . crypto . ECKey$ECDSASignature ) { return org . ethereum . crypto . ECKey . verify ( sigHash , signature , getPubKey ( ) ) ; } | org . junit . Assert . assertTrue ( key . verify ( message . getBytes ( ) , output ) ) |
testMatch_novar ( ) { final com . ericsson . otp . erlang . OtpErlangObject p = org . erlide . util . erlang . OtpErlang . parse ( "[a,<sp>{b}]" ) ; final com . ericsson . otp . erlang . OtpErlangObject t1 = org . erlide . util . erlang . OtpErlang . parse ( "[a,<sp>{b}]" ) ; final org . erlide . util . erlang . OtpBindings r = org . erlide . util . erlang . OtpErlang . match ( p , t1 ) ; "<AssertPlaceHolder>" ; } match ( java . lang . String , java . lang . String ) { return org . erlide . util . erlang . OtpErlang . match ( org . erlide . util . erlang . OtpErlang . parse ( pattern ) , org . erlide . util . erlang . OtpErlang . parse ( term ) , new org . erlide . util . erlang . OtpBindings ( ) ) ; } | org . junit . Assert . assertNotNull ( r ) |
experimentTypeCV ( ) { builder . experiment ( ExperimentType . CROSS_VALIDATION , "cv" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return name ; } | org . junit . Assert . assertEquals ( builder . type . toString ( ) , ExperimentType . CROSS_VALIDATION . toString ( ) ) |
testExcludeUsingOrRegex ( ) { com . streamsets . pipeline . stage . origin . jdbc . table . TableConfigBean tableConfigBean = new com . streamsets . pipeline . stage . origin . jdbc . table . TableJdbcSourceTestBuilder . TableConfigBeanTestBuilder ( ) . tablePattern ( "TABLE%" ) . schema ( com . streamsets . pipeline . stage . origin . jdbc . table . TestTableExclusion . SCHEMA ) . tableExclusionPattern ( "TABLE1|TABLE2" ) . build ( ) ; "<AssertPlaceHolder>" ; } listTablesForConfig ( java . sql . Connection , com . streamsets . pipeline . stage . origin . jdbc . table . TableConfigBean , com . streamsets . pipeline . stage . origin . jdbc . table . TableJdbcELEvalContext ) { return com . streamsets . pipeline . stage . origin . jdbc . table . TestTableExclusion . tableContextUtil . listTablesForConfig ( com . streamsets . pipeline . stage . origin . jdbc . table . TestTableExclusion . createTestContext ( ) , new java . util . LinkedList < com . streamsets . pipeline . api . Stage . ConfigIssue > ( ) , connection , tableConfigBean , tableJdbcELEvalContext , QuoteChar . NONE ) ; } | org . junit . Assert . assertEquals ( 8 , com . streamsets . pipeline . stage . origin . jdbc . table . TestTableExclusion . listTablesForConfig ( com . streamsets . pipeline . stage . origin . jdbc . table . TestTableExclusion . connection , tableConfigBean , com . streamsets . pipeline . stage . origin . jdbc . table . TestTableExclusion . tableJdbcELEvalContext ) . size ( ) ) |
testRetriesRequests_for_bad_request ( ) { final int retries = 2 ; com . findwise . utils . http . HttpFetchConfiguration settings = new com . findwise . utils . http . HttpFetchConfigurationBuilder ( ) . setRetries ( retries ) . build ( ) ; com . findwise . utils . http . HttpFetcher httpFetcher = new com . findwise . utils . http . HttpFetcher ( settings ) ; stubFor ( get ( urlEqualTo ( "/1" ) ) . willReturn ( aResponse ( ) . withStatus ( HttpStatus . SC_BAD_REQUEST ) ) ) ; stubFor ( get ( urlEqualTo ( "/2" ) ) . willReturn ( aResponse ( ) . withStatus ( HttpStatus . SC_OK ) . withBody ( "body" ) ) ) ; org . apache . http . HttpEntity responseEntity = httpFetcher . fetch ( "http://localhost:37777" , "*/*" , new com . findwise . utils . http . HttpFetcherTest . IncrementingUriProvider ( ) , new com . findwise . utils . http . PlainGetRequestProvider ( ) ) ; java . lang . String bodyContent = readStream ( responseEntity . getContent ( ) ) ; org . apache . http . util . EntityUtils . consume ( responseEntity ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return textSanitizer . filterInvalidChars ( content ) ; } | org . junit . Assert . assertThat ( bodyContent , org . hamcrest . CoreMatchers . equalTo ( "body" ) ) |
testInvocationTargetException ( ) { nl . bzk . brp . beheer . webapp . validatie . GenericValidator < nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij > partijValidator = new nl . bzk . brp . beheer . webapp . validatie . GenericValidator ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij . class ) ; final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "partij" ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij partij = org . mockito . Mockito . mock ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij . class ) ; partij . setDatumIngang ( 19700101 ) ; partij . setDatumEinde ( 20991231 ) ; org . mockito . Mockito . when ( partij . getDatumIngang ( ) ) . thenThrow ( java . lang . reflect . InvocationTargetException . class ) ; partijValidator . validate ( partij , errors ) ; "<AssertPlaceHolder>" ; } errorCount ( nl . bzk . brp . beheer . webapp . validatie . GenericValidator , nl . bzk . algemeenbrp . dal . domein . brp . entity . Afleidbaar ) { final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "afleidbareEntiteit" ) ; subject . validate ( afleidbareEntiteit , errors ) ; return errors . getErrorCount ( ) ; } | org . junit . Assert . assertEquals ( 2 , errorCount ( partijValidator , partij ) ) |
testCalculateChebyshev1Prototype ( ) { org . jdsp . iirfilterdesigner . model . FilterZerosPolesGain zpk1 = iirdesigner . calculatePrototype ( 3 , 3 ) ; org . apache . commons . math . complex . Complex [ ] zeros = new org . apache . commons . math . complex . Complex [ 0 ] ; org . apache . commons . math . complex . Complex [ ] poles = new org . apache . commons . math . complex . Complex [ ] { new org . apache . commons . math . complex . Complex ( ( - 0.1493101 ) , 0.903814429 ) , new org . apache . commons . math . complex . Complex ( ( - 0.29862021 ) , 6.39042136E-17 ) , new org . apache . commons . math . complex . Complex ( ( - 0.1493101 ) , ( - 0.903814429 ) ) } ; org . jdsp . iirfilterdesigner . model . FilterZerosPolesGain zpk2 = new org . jdsp . iirfilterdesigner . model . FilterZerosPolesGain ( zeros , poles , 0.2505943232519002 ) ; "<AssertPlaceHolder>" ; } calculatePrototype ( int , double ) { double epsilon = java . lang . Math . sqrt ( ( ( java . lang . Math . pow ( 10 , ( 0.1 * gpass ) ) ) - 1.0 ) ) ; double mu = ( 1.0 / filterOrder ) * ( java . lang . Math . log ( ( ( 1.0 + ( java . lang . Math . sqrt ( ( 1.0 + ( epsilon * epsilon ) ) ) ) ) / epsilon ) ) ) ; org . apache . commons . math . complex . Complex [ ] poles = new org . apache . commons . math . complex . Complex [ filterOrder ] ; double theta ; for ( int i = 1 ; i <= filterOrder ; i ++ ) { theta = ( ( ( Math . PI ) / 2.0 ) * ( ( 2 * i ) - 1.0 ) ) / filterOrder ; poles [ ( i - 1 ) ] = new org . apache . commons . math . complex . Complex ( ( ( - ( java . lang . Math . sinh ( mu ) ) ) * ( java . lang . Math . sin ( theta ) ) ) , ( ( java . lang . Math . cosh ( mu ) ) * ( java . lang . Math . cos ( theta ) ) ) ) ; } org . apache . commons . math . complex . Complex product = new org . apache . commons . math . complex . Complex ( 1.0 , 0.0 ) ; for ( int i = 0 ; i < ( poles . length ) ; i ++ ) product = product . multiply ( poles [ i ] . negate ( ) ) ; double gain = product . getReal ( ) ; if ( org . jdsp . iirfilterdesigner . math . SpecialMath . isEven ( filterOrder ) ) gain = gain / ( java . lang . Math . sqrt ( ( 1 + ( epsilon * epsilon ) ) ) ) ; org . jdsp . iirfilterdesigner . model . FilterZerosPolesGain zpk = new org . jdsp . iirfilterdesigner . model . FilterZerosPolesGain ( new org . apache . commons . math . complex . Complex [ 0 ] , poles , gain ) ; return zpk ; } | org . junit . Assert . assertEquals ( zpk1 , zpk2 ) |
testTarBzip2ImportCommandAutoDetect ( ) { command . targets = com . beust . jcommander . internal . Lists . newArrayList ( org . kitesdk . cli . commands . TestTarImportCommand . TAR_TEST_BZIP2_FILE , org . kitesdk . cli . commands . TestTarImportCommand . datasetUri ) ; "<AssertPlaceHolder>" ; verify ( console ) . info ( "Using<sp>{}<sp>compression" , TarImportCommand . CompressionType . BZIP2 ) ; verify ( console ) . info ( "Added<sp>{}<sp>records<sp>to<sp>\"{}\"" , org . kitesdk . cli . commands . TestTarImportCommand . NUM_TEST_FILES , org . kitesdk . cli . commands . TestTarImportCommand . TEST_DATASET_NAME ) ; } run ( ) { try { command . run ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "Caught<sp>IOException" , e ) ; } } | org . junit . Assert . assertEquals ( 0 , command . run ( ) ) |
test_issue37_RunningUpdaterTwiceMustNotChangeTheFile ( ) { java . io . File tmp = new java . io . File ( "target/test/update/issue37" ) ; tmp . mkdirs ( ) ; com . mycila . maven . plugin . license . util . FileUtils . copyFileToFolder ( new java . io . File ( "src/test/resources/update/issue37/xwiki.xml" ) , tmp ) ; com . mycila . maven . plugin . license . LicenseFormatMojo execution1 = new com . mycila . maven . plugin . license . LicenseFormatMojo ( ) ; execution1 . basedir = tmp ; execution1 . header = "src/test/resources/update/issue37/xwiki-license.txt" ; execution1 . project = new org . apache . maven . plugin . testing . stubs . MavenProjectStub ( ) ; execution1 . execute ( ) ; java . lang . String execution1FileContent = com . mycila . maven . plugin . license . util . FileUtils . read ( new java . io . File ( tmp , "xwiki.xml" ) , java . lang . System . getProperty ( "file.encoding" ) ) ; com . mycila . maven . plugin . license . LicenseFormatMojo execution2 = new com . mycila . maven . plugin . license . LicenseFormatMojo ( ) ; execution2 . basedir = tmp ; execution2 . header = "src/test/resources/update/issue37/xwiki-license.txt" ; execution2 . project = new org . apache . maven . plugin . testing . stubs . MavenProjectStub ( ) ; execution2 . execute ( ) ; java . lang . String execution2FileContent = com . mycila . maven . plugin . license . util . FileUtils . read ( new java . io . File ( tmp , "xwiki.xml" ) , java . lang . System . getProperty ( "file.encoding" ) ) ; "<AssertPlaceHolder>" ; } is ( com . mycila . maven . plugin . license . header . Header ) { try { return header . getLocation ( ) . isFromUrl ( this . file . toURI ( ) . toURL ( ) ) ; } catch ( java . lang . Exception e ) { throw new java . lang . IllegalStateException ( ( ( ( ( ( "Error<sp>comparing<sp>document<sp>" + ( this . file ) ) + "<sp>with<sp>file<sp>" ) + ( file ) ) + ".<sp>Cause:<sp>" ) + ( e . getMessage ( ) ) ) , e ) ; } } | org . junit . Assert . assertThat ( execution1FileContent , org . hamcrest . CoreMatchers . is ( execution2FileContent ) ) |
getUserRegistry ( ) { com . ibm . ws . security . authentication . internal . jaas . modules . ServerCommonLoginModuleTest . TestLoginModule module = new com . ibm . ws . security . authentication . internal . jaas . modules . ServerCommonLoginModuleTest . TestLoginModule ( ) ; "<AssertPlaceHolder>" ; } getUserRegistry ( ) { com . ibm . ws . security . authentication . internal . jaas . modules . ServerCommonLoginModuleTest . TestLoginModule module = new com . ibm . ws . security . authentication . internal . jaas . modules . ServerCommonLoginModuleTest . TestLoginModule ( ) ; org . junit . Assert . assertSame ( "Did<sp>not<sp>get<sp>back<sp>the<sp>expected<sp>userRegistry<sp>object" , userRegistry , module . getUserRegistry ( ) ) ; } | org . junit . Assert . assertSame ( "Did<sp>not<sp>get<sp>back<sp>the<sp>expected<sp>userRegistry<sp>object" , userRegistry , module . getUserRegistry ( ) ) |
testEnableCache ( ) { org . jboss . forge . addon . projects . Projects . enableCache ( ) ; "<AssertPlaceHolder>" ; } isCacheDisabled ( ) { return org . jboss . forge . addon . projects . Projects . cacheDisabledFlag ; } | org . junit . Assert . assertFalse ( org . jboss . forge . addon . projects . Projects . isCacheDisabled ( ) ) |
shouldValidate_jsonPathCondition ( ) { java . lang . String assertion = "#jsonPath(#response.content,<sp>'$.status')<sp>==<sp>'green'" ; io . gravitee . gateway . services . healthcheck . eval . assertion . AssertionEvaluation evaluation = new io . gravitee . gateway . services . healthcheck . eval . assertion . AssertionEvaluation ( assertion ) ; io . gravitee . gateway . services . healthcheck . eval . assertion . AssertionEvaluationTest . EvaluableHttpResponse response = new io . gravitee . gateway . services . healthcheck . eval . assertion . AssertionEvaluationTest . EvaluableHttpResponse ( ) ; response . status = io . gravitee . common . http . HttpStatusCode . OK_200 ; response . content = "{\"status\":<sp>\"green\"}" ; evaluation . setVariable ( "response" , response ) ; boolean result = evaluation . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { try { final org . springframework . expression . ExpressionParser parser = new org . springframework . expression . spel . standard . SpelExpressionParser ( ) ; final org . springframework . expression . Expression expr = parser . parseExpression ( assertion ) ; final org . springframework . expression . spel . support . StandardEvaluationContext context = new org . springframework . expression . spel . support . StandardEvaluationContext ( ) ; context . registerFunction ( "jsonPath" , org . springframework . beans . BeanUtils . resolveSignature ( "evaluate" , io . gravitee . el . spel . function . JsonPathFunction . class ) ) ; context . setVariables ( variables ) ; return expr . getValue ( context , boolean . class ) ; } catch ( org . springframework . expression . spel . SpelEvaluationException spelex ) { throw new io . gravitee . gateway . services . healthcheck . eval . EvaluationException ( ( "Assertion<sp>can<sp>not<sp>be<sp>verified<sp>:<sp>" + ( assertion ) ) , spelex ) ; } } | org . junit . Assert . assertTrue ( result ) |
testSetRingSet_IRingSet ( ) { org . openscience . cdk . interfaces . IChemModel chemModel = ( ( org . openscience . cdk . interfaces . IChemModel ) ( newChemObject ( ) ) ) ; org . openscience . cdk . interfaces . IRingSet crystal = chemModel . getBuilder ( ) . newInstance ( org . openscience . cdk . interfaces . IRingSet . class ) ; chemModel . setRingSet ( crystal ) ; "<AssertPlaceHolder>" ; } getRingSet ( ) { return this . ringSet ; } | org . junit . Assert . assertEquals ( crystal , chemModel . getRingSet ( ) ) |
givenAsyncRunner_whenExecutingQuery_thenExpectedList ( ) { org . apache . commons . dbutils . AsyncQueryRunner runner = new org . apache . commons . dbutils . AsyncQueryRunner ( java . util . concurrent . Executors . newCachedThreadPool ( ) ) ; com . baeldung . commons . dbutils . EmployeeHandler employeeHandler = new com . baeldung . commons . dbutils . EmployeeHandler ( connection ) ; java . lang . String query = "SELECT<sp>*<sp>FROM<sp>employee" ; java . util . concurrent . Future < java . util . List < com . baeldung . commons . dbutils . Employee > > future = runner . query ( connection , query , employeeHandler ) ; java . util . List < com . baeldung . commons . dbutils . Employee > employeeList = future . get ( 10 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; } | org . junit . Assert . assertEquals ( employeeList . size ( ) , 5 ) |
testFilterString13 ( ) { java . lang . String filter = ( ( ( ( org . opennms . features . topology . plugins . topo . asset . layers . NodeParamLabels . ASSET_DISPLAYCATEGORY ) + "=!testDisplayCategory" ) + ";" ) + ( org . opennms . features . topology . plugins . topo . asset . layers . NodeParamLabels . NODE_FOREIGNSOURCE ) ) + "=testForeignSource1,,testForeignSource2" ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( "Start<sp>testFilterString13()<sp>filter=" + filter ) ) ; boolean expectedException = false ; try { testFilterParser ( filter ) ; } catch ( java . lang . IllegalArgumentException e ) { expectedException = true ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( "<sp>expected<sp>IllegalArgumentException<sp>thrown=" + ( e . getMessage ( ) ) ) ) ; } "<AssertPlaceHolder>" ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( "End<sp>testFilterString13()" ) ; } getMessage ( ) { return message ; } | org . junit . Assert . assertEquals ( true , expectedException ) |
updateOwner ( ) { org . springframework . samples . petclinic . model . Owner o1 = this . clinicService . findOwnerById ( 1 ) ; java . lang . String old = o1 . getLastName ( ) ; o1 . setLastName ( ( old + "X" ) ) ; this . clinicService . saveOwner ( o1 ) ; o1 = this . clinicService . findOwnerById ( 1 ) ; "<AssertPlaceHolder>" ; } getLastName ( ) { return this . lastName ; } | org . junit . Assert . assertEquals ( ( old + "X" ) , o1 . getLastName ( ) ) |
testGetElementAt ( ) { org . geotools . swing . control . DnDListModel < java . lang . String > model = new org . geotools . swing . control . DnDListModel < java . lang . String > ( ) ; model . addItem ( "one" ) ; model . addItem ( "two" ) ; "<AssertPlaceHolder>" ; } getElementAt ( int ) { return items . get ( index ) ; } | org . junit . Assert . assertEquals ( "one" , model . getElementAt ( 0 ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.