input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testIncorrectNumberOfArgs ( ) { com . yahoo . hive . udf . funnel . Fallout udf = new com . yahoo . hive . udf . funnel . Fallout ( ) ; org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspector [ ] inputOiList = new org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspector [ ] { org . apache . hadoop . hive . serde2 . objectinspector . ObjectInspectorFactory . getStandardListObjectInspector ( PrimitiveObjectInspectorFactory . javaLongObjectInspector ) } ; udf . initialize ( inputOiList ) ; java . util . List < java . lang . Long > inputList = java . util . Arrays . asList ( 10L ) ; org . apache . hadoop . hive . ql . udf . generic . GenericUDF . DeferredObject obj1 = mock ( org . apache . hadoop . hive . ql . udf . generic . GenericUDF . DeferredObject . class ) ; org . apache . hadoop . hive . ql . udf . generic . GenericUDF . DeferredObject [ ] objs = new org . apache . hadoop . hive . ql . udf . generic . GenericUDF . DeferredObject [ ] { obj1 , obj1 } ; when ( obj1 . get ( ) ) . thenReturn ( inputList ) ; "<AssertPlaceHolder>" ; } evaluate ( com . yahoo . hive . udf . funnel . DeferredObject [ ] ) { if ( ( args . length ) != 1 ) { return null ; } java . util . List < java . lang . Long > funnel = ( ( java . util . List < java . lang . Long > ) ( listInputObjectInspector . getList ( args [ 0 ] . get ( ) ) ) ) ; java . util . List < java . lang . Double > result = new java . util . ArrayList ( ) ; if ( ( funnel . size ( ) ) <= 0 ) { return result ; } result . add ( 1.0 ) ; for ( int i = 1 ; i < ( funnel . size ( ) ) ; i ++ ) { if ( ( ( funnel . get ( i ) ) <= 0 ) || ( ( funnel . get ( ( i - 1 ) ) ) <= 0 ) ) { result . add ( 0.0 ) ; } else { result . add ( ( ( ( double ) ( funnel . get ( i ) ) ) / ( funnel . get ( ( i - 1 ) ) ) ) ) ; } } return result ; } | org . junit . Assert . assertEquals ( null , udf . evaluate ( objs ) ) |
exceptionWithRemainingRetriesIsNotDone ( ) { final int NUM_TRIES = 2 ; com . basho . riak . client . core . FutureOperation operation = org . powermock . api . mockito . PowerMockito . spy ( new com . basho . riak . client . core . FutureOperationTest . FutureOperationImpl ( ) ) ; com . basho . riak . client . core . OperationRetrier retrier = mock ( com . basho . riak . client . core . OperationRetrier . class ) ; operation . setRetrier ( retrier , NUM_TRIES ) ; operation . setException ( new java . lang . Exception ( ) ) ; "<AssertPlaceHolder>" ; } isDone ( ) { return coreFuture . isDone ( ) ; } | org . junit . Assert . assertFalse ( operation . isDone ( ) ) |
findReturnsNullWhenEnforceGoalConfigurationIsNull ( ) { java . util . ArrayList < org . apache . maven . model . Plugin > buildPlugins = new java . util . ArrayList ( ) ; buildPlugins . add ( enforcerPlugin ) ; when ( mavenProject . getBuildPlugins ( ) ) . thenReturn ( buildPlugins ) ; java . util . ArrayList < org . apache . maven . model . PluginExecution > pluginExecutions = new java . util . ArrayList ( ) ; pluginExecutions . add ( pluginExecution ) ; java . util . ArrayList < java . lang . String > goals = new java . util . ArrayList ( ) ; goals . add ( "enforce" ) ; when ( pluginExecution . getGoals ( ) ) . thenReturn ( goals ) ; when ( enforcerPlugin . getExecutions ( ) ) . thenReturn ( pluginExecutions ) ; when ( pluginExecution . getConfiguration ( ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; } find ( ) { org . apache . maven . artifact . versioning . ArtifactVersion childMavenVersion = getHighestArtifactVersion ( getPrerequisitesMavenVersion ( ) , getEnforcerMavenVersion ( ) ) ; if ( ! ( mavenProject . hasParent ( ) ) ) { return childMavenVersion ; } org . apache . maven . artifact . versioning . ArtifactVersion parentMavenVersion = new org . codehaus . mojo . versions . RequiredMavenVersionFinder ( mavenProject . getParent ( ) ) . find ( ) ; return getHighestArtifactVersion ( childMavenVersion , parentMavenVersion ) ; } | org . junit . Assert . assertNull ( new org . codehaus . mojo . versions . RequiredMavenVersionFinder ( mavenProject ) . find ( ) ) |
testRotateLeft ( ) { int [ ] [ ] test = new int [ ] [ ] { new int [ ] { 1 , 0 , 1 , 0 } , new int [ ] { 1 , 0 , 1 , 0 } , new int [ ] { 1 , 0 , 1 , 0 } , new int [ ] { 1 , 0 , 1 , 0 } } ; int [ ] [ ] expected = new int [ ] [ ] { new int [ ] { 0 , 0 , 0 , 0 } , new int [ ] { 1 , 1 , 1 , 1 } , new int [ ] { 0 , 0 , 0 , 0 } , new int [ ] { 1 , 1 , 1 , 1 } } ; int [ ] [ ] result = org . numenta . nupic . util . ArrayUtils . rotateLeft ( test ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { for ( int j = 0 ; j < ( result [ i ] . length ) ; j ++ ) { "<AssertPlaceHolder>" ; } } } rotateLeft ( int [ ] [ ] ) { int r = array . length ; if ( r == 0 ) { return new int [ 0 ] [ 0 ] ; } int c = array [ 0 ] . length ; int [ ] [ ] result = new int [ c ] [ r ] ; for ( int i = 0 ; i < r ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) { result [ ( ( c - 1 ) - j ) ] [ i ] = array [ i ] [ j ] ; } } return result ; } | org . junit . Assert . assertEquals ( result [ i ] [ j ] , expected [ i ] [ j ] ) |
testGetKebabMenu ( ) { final elemental2 . dom . Element element = mock ( elemental2 . dom . Element . class ) ; doReturn ( element ) . when ( view ) . querySelector ( "kebab-menu" ) ; "<AssertPlaceHolder>" ; } getKebabMenu ( ) { return querySelector ( "kebab-menu" ) ; } | org . junit . Assert . assertEquals ( element , view . getKebabMenu ( ) ) |
testGeenGeefDetailsPersoonDienst ( ) { final int leveringAutorisatieId = 1 ; org . mockito . Mockito . when ( leveringsautorisatieService . geefLeveringautorisatie ( leveringAutorisatieId ) ) . thenReturn ( bouwLeveringsautorisatieNietGeheim ( leveringAutorisatieId ) ) ; final nl . bzk . brp . domain . leveringmodel . persoon . Persoonslijst persoonslijst = maakPersoonMetAfnemerindicatie ( leveringAutorisatieId , "000001" ) ; final nl . bzk . brp . service . maakbericht . algemeen . MaakBerichtParameters maakBerichtParameters = new nl . bzk . brp . service . maakbericht . algemeen . MaakBerichtParameters ( ) ; final nl . bzk . brp . domain . algemeen . Autorisatiebundel autorisatiebundel = new nl . bzk . brp . domain . algemeen . Autorisatiebundel ( null , nl . bzk . brp . domain . algemeen . AutAutUtil . zoekDienst ( nl . bzk . brp . domain . algemeen . TestAutorisaties . metSoortDienst ( SoortDienst . ZOEK_PERSOON ) , SoortDienst . ZOEK_PERSOON ) ) ; maakBerichtParameters . setAutorisatiebundels ( com . google . common . collect . Lists . newArrayList ( autorisatiebundel ) ) ; final nl . bzk . brp . service . maakbericht . algemeen . Berichtgegevens berichtgegevens = new nl . bzk . brp . service . maakbericht . algemeen . Berichtgegevens ( maakBerichtParameters , persoonslijst , new nl . bzk . brp . service . maakbericht . algemeen . MaakBerichtPersoonInformatie ( nl . bzk . algemeenbrp . dal . domein . brp . enums . SoortSynchronisatie . VOLLEDIG_BERICHT ) , autorisatiebundel , new nl . bzk . brp . service . maakbericht . bepaling . StatischePersoongegevens ( ) ) ; new nl . bzk . brp . service . maakbericht . AutorisatieAlles ( berichtgegevens ) ; berichtgegevens . setKandidaatRecords ( com . google . common . collect . Sets . newHashSet ( ) ) ; persoonslijst . getMetaObject ( ) . accept ( new nl . bzk . brp . domain . leveringmodel . ParentFirstModelVisitor ( ) { @ nl . bzk . brp . service . maakbericht . filterstappen . Override protected void doVisit ( final nl . bzk . brp . domain . leveringmodel . MetaRecord record ) { berichtgegevens . getKandidaatRecords ( ) . add ( record ) ; } } ) ; autoriseerAfnemerindicatiesService . execute ( berichtgegevens ) ; final java . util . Set < nl . bzk . brp . domain . leveringmodel . MetaObject > afnemerIndicaties = berichtgegevens . getPersoonslijst ( ) . getModelIndex ( ) . geefObjecten ( Element . PERSOON_AFNEMERINDICATIE ) ; for ( nl . bzk . brp . domain . leveringmodel . MetaObject afnemerIndicatie : afnemerIndicaties ) { "<AssertPlaceHolder>" ; } } isGeautoriseerd ( nl . bzk . brp . domain . leveringmodel . MetaModel ) { return berichtmodel . containsKey ( model ) ; } | org . junit . Assert . assertFalse ( berichtgegevens . isGeautoriseerd ( afnemerIndicatie ) ) |
testSplitSwiftPath ( ) { java . lang . String input = ( "container" + ( java . io . File . separator ) ) + "object" ; java . lang . String [ ] output = com . cloud . utils . SwiftUtil . splitSwiftPath ( input ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "container" , "object" } ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertArrayEquals ( expected , output ) |
testDoSomething ( ) { javax . ws . rs . core . Response something = service . doSomething ( ) ; "<AssertPlaceHolder>" ; } doSomething ( ) { eventStore . tell ( new no . jansoren . mymicroservice . something . DoSomethingCommand ( ) , null ) ; return javax . ws . rs . core . Response . ok ( ) . build ( ) ; } | org . junit . Assert . assertNull ( something ) |
testCloning ( ) { com . flowpowered . math . imaginary . Quaternionf quaternion = new com . flowpowered . math . imaginary . Quaternionf ( 3 , 2 , 5 , 6 ) ; "<AssertPlaceHolder>" ; } clone ( ) { return new com . flowpowered . math . matrix . MatrixNd ( this ) ; } | org . junit . Assert . assertEquals ( quaternion , quaternion . clone ( ) ) |
testIndentOfMultilineAttributes ( ) { java . lang . String templates = ( ( ( "Terence\nis\na\nmaniac" 2 + "<sp><names;<sp>separator=\"\n\"Terence\nis\na\nmaniac" 4 ) + ( newline ) ) + "Terence\nis\na\nmaniac" 5 ) + ( newline ) ; writeFile ( tmpdir , "t.stg" , templates ) ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroupFile ( ( ( ( tmpdir ) + "Terence\nis\na\nmaniac" 3 ) + "t.stg" ) ) ; org . stringtemplate . v4 . ST t = group . getInstanceOf ( "list" ) ; t . add ( "Terence\nis\na\nmaniac" 0 , "Terence\nis\na\nmaniac" ) ; t . add ( "Terence\nis\na\nmaniac" 0 , "Jim" ) ; t . add ( "Terence\nis\na\nmaniac" 0 , "Terence\nis\na\nmaniac" 7 ) ; java . lang . String expecting = ( ( ( ( ( ( ( ( ( ( ( ( ( "<sp>Terence" + ( newline ) ) + "Terence\nis\na\nmaniac" 1 ) + ( newline ) ) + "<sp>a" ) + ( newline ) ) + "Terence\nis\na\nmaniac" 6 ) + ( newline ) ) + "<sp>Jim" ) + ( newline ) ) + "<sp>Sriram" ) + ( newline ) ) + "Terence\nis\na\nmaniac" 1 ) + ( newline ) ) + "<sp>cool" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; } | org . junit . Assert . assertEquals ( expecting , t . render ( ) ) |
notIsStoppedIfStillItemsInBuffer ( ) { buffer . put ( org . talend . esb . job . controller . internal . MessageExchangeBufferTest . ME_1 ) ; buffer . stop ( ) ; "<AssertPlaceHolder>" ; } isStopped ( ) { return status . isStopped ( ) ; } | org . junit . Assert . assertFalse ( buffer . isStopped ( ) ) |
getUserId ( ) { java . lang . String userIdGiven = "xyzäüöß\"´`*~!§$%&/()" ; doReturn ( userIdGiven ) . when ( requestMock ) . getParameter ( Constants . REQ_PARAM_USER_ID ) ; java . lang . String userId = userBean . getUserId ( ) ; "<AssertPlaceHolder>" ; } getUserId ( ) { return userId ; } | org . junit . Assert . assertEquals ( userIdGiven , userId ) |
Superscript ( ) { gov . uspto . patent . doc . simplehtml . FreetextConfig config = new gov . uspto . patent . doc . simplehtml . FreetextConfig ( true , false ) ; java . lang . String xml = "<p>metallic<sp>barium<sp>ion<sp>can<sp>lose<sp>2<sp>electrons<sp>to<sp>become<sp>Ba<sup>2+</sup></p>" ; java . lang . String expect = "\nmetallic<sp>barium<sp>ion<sp>can<sp>lose<sp>2<sp>electrons<sp>to<sp>become<sp>Ba^{2+}\n" ; org . jsoup . nodes . Document jsoupDoc = org . jsoup . Jsoup . parse ( xml , "" , org . jsoup . parser . Parser . xmlParser ( ) ) ; gov . uspto . patent . doc . simplehtml . HtmlToPlainText converter = new gov . uspto . patent . doc . simplehtml . HtmlToPlainText ( config ) ; java . lang . String plainText = converter . getPlainText ( jsoupDoc ) ; "<AssertPlaceHolder>" ; } getPlainText ( org . jsoup . nodes . Element ) { traverse ( element ) ; return this . toString ( ) ; } | org . junit . Assert . assertEquals ( expect , plainText ) |
testApplyOrientation ( ) { java . io . InputStream inputStream = getClassLoaderResource ( "/contrib/tiff/multipage.tif" ) . openStream ( ) ; java . io . File inputFile = java . io . File . createTempFile ( "imageiotest" , "tif" ) ; byte [ ] data = com . twelvemonkeys . io . FileUtil . read ( inputStream ) ; com . twelvemonkeys . io . FileUtil . write ( inputFile , data ) ; inputStream . close ( ) ; java . awt . image . BufferedImage image = javax . imageio . ImageIO . read ( inputFile ) ; java . awt . image . BufferedImage image90 = com . twelvemonkeys . contrib . tiff . TIFFUtilities . applyOrientation ( image , TIFFExtension . ORIENTATION_RIGHTTOP ) ; java . awt . image . BufferedImage image360 = com . twelvemonkeys . contrib . tiff . TIFFUtilities . applyOrientation ( image90 , TIFFExtension . ORIENTATION_LEFTBOT ) ; byte [ ] original = ( ( java . awt . image . DataBufferByte ) ( image . getData ( ) . getDataBuffer ( ) ) ) . getData ( ) ; byte [ ] rotated = ( ( java . awt . image . DataBufferByte ) ( image360 . getData ( ) . getDataBuffer ( ) ) ) . getData ( ) ; "<AssertPlaceHolder>" ; } getData ( ) { return getResource ( "/psd/psd-jpeg-segment.bin" ) . openStream ( ) ; } | org . junit . Assert . assertArrayEquals ( original , rotated ) |
testOpen ( ) { java . util . Map conf = mock ( java . util . HashMap . class ) ; backtype . storm . task . TopologyContext context = mock ( backtype . storm . task . TopologyContext . class ) ; backtype . storm . spout . SpoutOutputCollector collector = mock ( backtype . storm . spout . SpoutOutputCollector . class ) ; when ( context . getThisTaskId ( ) ) . thenReturn ( 1 ) ; when ( context . getComponentTasks ( anyString ( ) ) ) . thenReturn ( new java . util . ArrayList < java . lang . Integer > ( ) { { add ( 1 ) ; } } ) ; org . apache . eagle . security . hive . jobrunning . HiveJobRunningSourcedStormSpoutProvider provider = new org . apache . eagle . security . hive . jobrunning . HiveJobRunningSourcedStormSpoutProvider ( ) ; org . apache . eagle . security . hive . jobrunning . HiveJobFetchSpout spout = ( ( org . apache . eagle . security . hive . jobrunning . HiveJobFetchSpout ) ( provider . getSpout ( org . apache . eagle . security . hive . jobrunning . TestHiveJobFetchSpout . config , 1 ) ) ) ; spout . open ( conf , context , collector ) ; java . lang . Long yesterday = java . lang . Long . valueOf ( new java . lang . String ( org . apache . eagle . security . hive . jobrunning . TestHiveJobFetchSpout . curator . getData ( ) . forPath ( org . apache . eagle . security . hive . jobrunning . TestHiveJobFetchSpout . SHARE_RESOURCES ) ) ) ; "<AssertPlaceHolder>" ; } getData ( ) { return data ; } | org . junit . Assert . assertTrue ( ( ( java . lang . System . currentTimeMillis ( ) ) > yesterday ) ) |
shouldFindPostsWithAuthorAndBlogIdUsingDynamicSql ( ) { org . apache . ibatis . session . SqlSession session = org . apache . ibatis . session . SqlSessionTest . sqlMapper . openSession ( ) ; try { java . util . List < org . apache . ibatis . domain . blog . Post > posts = session . selectList ( "org.apache.ibatis.domain.blog.mappers.PostMapper.findPost" , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "ids" , new java . util . ArrayList < java . lang . Integer > ( ) { { add ( 1 ) ; add ( 2 ) ; add ( 3 ) ; } } ) ; put ( "blog_id" , 1 ) ; } } ) ; "<AssertPlaceHolder>" ; } finally { session . close ( ) ; } } size ( ) { return loaderMap . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , posts . size ( ) ) |
testUpdate ( ) { org . easymock . EasyMock . reset ( batchMock ) ; org . easymock . Capture < com . google . cloud . storage . spi . v1 . RpcBatch . Callback < com . google . api . services . storage . model . StorageObject > > callback = org . easymock . Capture . newInstance ( ) ; batchMock . addPatch ( org . easymock . EasyMock . eq ( com . google . cloud . storage . StorageBatchTest . BLOB_INFO . toPb ( ) ) , org . easymock . EasyMock . capture ( callback ) , org . easymock . EasyMock . eq ( com . google . common . collect . ImmutableMap . < com . google . cloud . storage . spi . v1 . StorageRpc . Option , java . lang . Object > of ( ) ) ) ; org . easymock . EasyMock . replay ( batchMock ) ; com . google . cloud . storage . StorageBatchResult < com . google . cloud . storage . Blob > batchResult = storageBatch . update ( com . google . cloud . storage . StorageBatchTest . BLOB_INFO ) ; "<AssertPlaceHolder>" ; try { batchResult . get ( ) ; org . junit . Assert . fail ( "No<sp>result<sp>available<sp>yet." ) ; } catch ( java . lang . IllegalStateException ex ) { } com . google . cloud . storage . spi . v1 . RpcBatch . Callback < com . google . api . services . storage . model . StorageObject > capturedCallback = callback . getValue ( ) ; capturedCallback . onFailure ( com . google . cloud . storage . StorageBatchTest . GOOGLE_JSON_ERROR ) ; try { batchResult . get ( ) ; org . junit . Assert . fail ( "Should<sp>throw<sp>a<sp>StorageExcetion<sp>on<sp>error." ) ; } catch ( com . google . cloud . storage . StorageException ex ) { } } getValue ( ) { return value ; } | org . junit . Assert . assertNotNull ( callback . getValue ( ) ) |
shouldInstrumentES6ClassMixin ( ) { java . lang . String source = "var<sp>calculatorMixin<sp>=<sp>Base<sp>=><sp>class<sp>extends<sp>Base<sp>{\n" + ( "<sp>calc()<sp>{<sp>}\n" + "};" ) ; java . lang . String instrumentedSource = sourceProcessor . instrumentSource ( source ) ; java . lang . String expectedSource = "_$jscoverage[\'test.js\'].lineData[1]++;\n" + ( ( ( ( "var<sp>calculatorMixin<sp>=<sp>Base<sp>=><sp>class<sp>extends<sp>Base<sp>{\n" + "<sp>calc()<sp>{\n" ) + "<sp>_$jscoverage[\'test.js\'].functionData[0]++;\n" ) + "<sp>}\n" ) + "};\n" ) ; "<AssertPlaceHolder>" ; } instrumentSource ( java . lang . String ) { return instrumentSource ( uri , source ) ; } | org . junit . Assert . assertEquals ( expectedSource , instrumentedSource ) |
testUpdate ( ) { studentService . createStudents ( 5 ) ; net . neoremind . fountain . test . po . Student student = net . neoremind . fountain . test . support . StudentHelper . getSingleStudent ( ) ; student . setStudentId ( ( ( net . neoremind . fountain . test . support . StudentHelper . STUDENT_ID_LAST ) + 2 ) ) ; studentService . updateStudent ( ( ( net . neoremind . fountain . test . support . StudentHelper . STUDENT_ID_LAST ) + 2 ) ) ; net . neoremind . fountain . test . po . Student student2 = studentService . getById ( ( ( net . neoremind . fountain . test . support . StudentHelper . STUDENT_ID_LAST ) + 2 ) ) ; "<AssertPlaceHolder>" ; } getById ( java . lang . Integer ) { return cityDao . getById ( id ) ; } | org . junit . Assert . assertThat ( student2 , org . hamcrest . Matchers . is ( student ) ) |
testAddAllListOfRdn002 ( ) { java . util . LinkedList < javax . naming . ldap . Rdn > test = new java . util . LinkedList < javax . naming . ldap . Rdn > ( ) ; javax . naming . ldap . LdapName ln = new javax . naming . ldap . LdapName ( "" ) ; ln . addAll ( test ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . toString ( "" ) ; } | org . junit . Assert . assertEquals ( "" , ln . toString ( ) ) |
testIsJsonWorks ( ) { when ( httpServletRequest . getContentType ( ) ) . thenReturn ( ContentTypes . APPLICATION_JSON ) ; context . init ( servletContext , httpServletRequest , httpServletResponse ) ; "<AssertPlaceHolder>" ; } isRequestJson ( ) { return wrapped . isRequestJson ( ) ; } | org . junit . Assert . assertTrue ( context . isRequestJson ( ) ) |
testFilterString5 ( ) { java . lang . String filter = ( ( ( ( org . opennms . features . topology . plugins . topo . asset . layers . NodeParamLabels . ASSET_POLLERCATEGORY ) + "=testPollerCategory1" ) + ";" ) + ( org . opennms . features . topology . plugins . topo . asset . layers . NodeParamLabels . NODE_FOREIGNSOURCE ) ) + "=testForeignSource1,testForeignSource2" ; java . lang . String expected = "nodeList:{<sp>[5]<sp>[6]<sp>[7]<sp>[8]<sp>[9]<sp>[10]<sp>[11]<sp>[12]<sp>[13]<sp>[14]<sp>}" ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( ( ( "Start<sp>testFilterString5():<sp>filter=" + filter ) + "<sp>expected=" ) + expected ) ) ; java . lang . String s2 = testFilterParser ( filter ) ; "<AssertPlaceHolder>" ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( "End<sp>testFilterString5()" ) ; } testFilterParser ( java . lang . String ) { java . util . List < org . opennms . netmgt . model . OnmsNode > nodeList = org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . getMockNodeList ( ) ; java . lang . String s1 = org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . nodelistToString ( nodeList ) ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( "<sp>before:" + s1 ) ) ; final org . opennms . features . topology . plugins . topo . asset . GeneratorConfig config = new org . opennms . features . topology . plugins . topo . asset . GeneratorConfigBuilder ( ) . withFilters ( filter ) . build ( ) ; final java . util . Map < java . lang . String , org . opennms . features . topology . plugins . topo . asset . filter . Filter > filterMap = new org . opennms . features . topology . plugins . topo . asset . filter . FilterParser ( ) . parse ( config . getFilters ( ) ) ; java . util . List < org . opennms . netmgt . model . OnmsNode > filteredNodeList = testFilterCode ( nodeList , filterMap ) ; java . lang . String s2 = org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . nodelistToString ( filteredNodeList ) ; org . opennms . features . topology . plugins . topo . asset . filter . FilterParserTest . LOG . debug ( ( "<sp>after:" + s2 ) ) ; return s2 ; } | org . junit . Assert . assertEquals ( expected , s2 ) |
badFlowOngeldigeLa01MetPf03 ( ) { startProcess ( maakUc811Bericht ( "0599" , 1231231234L ) ) ; controleerBerichten ( 0 , 1 , 0 ) ; final nl . bzk . migratiebrp . bericht . model . lo3 . impl . Lq01Bericht lq01Bericht = getBericht ( nl . bzk . migratiebrp . bericht . model . lo3 . impl . Lq01Bericht . class ) ; lq01Bericht . setANummer ( "9876543210" ) ; signalVospg ( maakLa01Bericht ( lq01Bericht , true ) ) ; signalHumanTask ( "restartAtVragen" ) ; controleerBerichten ( 0 , 1 , 0 ) ; getBericht ( nl . bzk . migratiebrp . bericht . model . lo3 . impl . Lq01Bericht . class ) ; signalVospg ( maakLa01Bericht ( lq01Bericht , true ) ) ; signalHumanTask ( "end" ) ; controleerBerichten ( 0 , 2 , 0 ) ; getBericht ( nl . bzk . migratiebrp . bericht . model . lo3 . impl . Pf03Bericht . class ) ; getBericht ( nl . bzk . migratiebrp . bericht . model . lo3 . impl . Vb01Bericht . class ) ; "<AssertPlaceHolder>" ; } processEnded ( ) { final org . jbpm . JbpmContext jbpmContext = org . jbpm . JbpmConfiguration . getInstance ( ) . createJbpmContext ( ) ; try { final org . jbpm . graph . exe . ProcessInstance processInstance = jbpmContext . loadProcessInstance ( processInstanceId ) ; return processInstance . hasEnded ( ) ; } finally { jbpmContext . close ( ) ; } } | org . junit . Assert . assertTrue ( processEnded ( ) ) |
booleansNotEqual ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( true , false ) |
Set_As_Text_And_Get_Value ( ) { com . mysema . rdfbean . model . UIDEditor editor = new com . mysema . rdfbean . model . UIDEditor ( ) ; editor . setAsText ( RDF . type . getId ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( RDF . type , editor . getValue ( ) ) |
testConflictEditedSamePoint ( ) { org . locationtech . jts . geom . Geometry oldGeom = new org . locationtech . jts . io . WKTReader ( ) . read ( "MULTILINESTRING<sp>((40<sp>40,<sp>20<sp>45,<sp>45<sp>30,<sp>40<sp>40),(20<sp>35,<sp>45<sp>10,<sp>30<sp>5,<sp>10<sp>30,<sp>20<sp>35))" ) ; org . locationtech . jts . geom . Geometry newGeom = new org . locationtech . jts . io . WKTReader ( ) . read ( "MULTILINESTRING<sp>((40<sp>40,<sp>20<sp>45,<sp>48<sp>32,<sp>40<sp>40),(20<sp>35,<sp>45<sp>10,<sp>30<sp>5,<sp>10<sp>30,<sp>20<sp>35))" ) ; org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff diff = new org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff ( oldGeom , newGeom ) ; org . locationtech . jts . geom . Geometry newGeom2 = new org . locationtech . jts . io . WKTReader ( ) . read ( "MULTILINESTRING<sp>((40<sp>40,<sp>20<sp>45,<sp>41<sp>33,<sp>40<sp>40),(20<sp>35,<sp>45<sp>10,<sp>30<sp>5,<sp>10<sp>30,<sp>20<sp>35))" ) ; org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff diff2 = new org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff ( oldGeom , newGeom2 ) ; "<AssertPlaceHolder>" ; } conflicts ( org . locationtech . geogig . plumbing . diff . AttributeDiff ) { if ( ! ( ad instanceof org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff ) ) { return true ; } final org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff gad = ( ( org . locationtech . geogig . plumbing . diff . GeometryAttributeDiff ) ( ad ) ) ; final org . locationtech . geogig . plumbing . diff . TYPE myType = getType ( ) ; final org . locationtech . geogig . plumbing . diff . TYPE otherType = ad . getType ( ) ; if ( ( ( TYPE . NO_CHANGE ) == myType ) || ( ( TYPE . NO_CHANGE ) == otherType ) ) { return false ; } if ( ( ( TYPE . REMOVED ) == myType ) && ( ( TYPE . REMOVED ) == otherType ) ) { return false ; } if ( ( ( TYPE . MODIFIED ) == myType ) && ( ( TYPE . MODIFIED ) == otherType ) ) { if ( gad . diff . equals ( diff ) ) { return false ; } else { return true ; } } if ( ( ( TYPE . ADDED ) == myType ) && ( ( TYPE . ADDED ) == otherType ) ) { return ! ( gad . newGeometry . equalsExact ( newGeometry ) ) ; } return true ; } | org . junit . Assert . assertTrue ( diff . conflicts ( diff2 ) ) |
testBrpPersoonslijstGetter ( ) { final java . lang . String berichtOrigineel = org . apache . commons . io . IOUtils . toString ( nl . moderniseringgba . isc . esb . message . brp . impl . NotificatieVerzoekBerichtTest . class . getResourceAsStream ( "geslachtsnaamwijzigingVerzoekBericht.xml" ) ) ; final nl . moderniseringgba . isc . esb . message . brp . impl . GeslachtsnaamwijzigingVerzoekBericht geslachtsnaamwijzigingVerzoekBericht = ( ( nl . moderniseringgba . isc . esb . message . brp . impl . GeslachtsnaamwijzigingVerzoekBericht ) ( factory . getBericht ( berichtOrigineel ) ) ) ; "<AssertPlaceHolder>" ; } getBrpPersoonslijst ( ) { return asBrpPersoonslijst ( leesUitBrpAntwoordType . getBrpPl ( ) ) ; } | org . junit . Assert . assertNotNull ( geslachtsnaamwijzigingVerzoekBericht . getBrpPersoonslijst ( ) ) |
test_TransformationCompositionWithFilters ( ) { 1 2 3 4 5 6 1 2 3 4 java . util . ArrayList < java . lang . Double > input = new java . util . ArrayList < java . lang . Double > ( java . util . Arrays . asList ( 88.0 , 754.8 , 0.0 , 123456.2 , 321.3 , 3210.5 ) ) ; java . lang . Integer [ ] filteredOutFirstStage = new java . lang . Integer [ ] { 2 , 4 } ; java . lang . Integer [ ] filteredOutSecondStage = new java . lang . Integer [ ] { 4 } ; java . util . ArrayList < java . lang . Integer > expectedResults = new java . util . ArrayList < java . lang . Integer > ( java . util . Arrays . asList ( 4 , 3 , 5 ) ) ; org . geolatte . common . transformer . ProgrammableFilter < java . lang . Double > firstFilterTransformation = new org . geolatte . common . transformer . ProgrammableFilter < java . lang . Double > ( filteredOutFirstStage ) ; org . geolatte . common . transformer . ProgrammableFilter < java . lang . String > secondFilterTransformation = new org . geolatte . common . transformer . ProgrammableFilter < java . lang . String > ( filteredOutSecondStage ) ; org . geolatte . common . transformer . Transformer < java . lang . Double , java . lang . Integer > compositeTransformer = org . geolatte . common . transformer . TransformerChainFactory . < java . lang . Double , java . lang . Integer > newChain ( ) . addFilter ( firstFilterTransformation ) . add ( numberTransformer ) . addFilter ( secondFilterTransformation ) . add ( capitalizeTransformer ) . last ( countTransformer ) ; compositeTransformer . setInput ( input ) ; int count = 0 ; for ( java . lang . Integer i : compositeTransformer . output ( ) ) { "<AssertPlaceHolder>" ; count ++ ; } } output ( ) { if ( ( ( currentInput ) == null ) && ( ( currentOutput ) == null ) ) return null ; if ( ( currentOutput ) != null ) return currentOutput ; currentOutput = new DefaultTransformerIterable < Target > ( currentInput . iterator ( ) ) ; currentInput = null ; return currentOutput ; } | org . junit . Assert . assertEquals ( expectedResults . get ( count ) , i ) |
testCompareDynAnyNamedMember ( ) { java . lang . String msg ; org . jacorb . test . UnionDefaultShortType type ; org . omg . CORBA . Any any = null ; org . omg . DynamicAny . DynUnion dynAny = null ; org . omg . DynamicAny . DynUnion dynAny2 = null ; type = new org . jacorb . test . UnionDefaultShortType ( ) ; type . win ( 10 ) ; any = orb . create_any ( ) ; org . jacorb . test . UnionDefaultShortTypeHelper . insert ( any , type ) ; dynAny = createDynAnyFromAny ( any ) ; dynAny2 = createDynAnyFromAny ( any ) ; msg = "Comparing<sp>two<sp>equal<sp>DynAny<sp>values<sp>using<sp>DynAny::equal<sp>failed" ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; } | org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) ) |
shouldHaveSameHashcodeGivenSameContents ( ) { java . util . List < java . lang . String > values = java . util . Arrays . asList ( "One" , "Two" ) ; uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . String > set = new uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . String > ( ) ; uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . String > otherSet = new uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . String > ( ) ; set . addAll ( values ) ; otherSet . addAll ( values ) ; int distance = ( set . hashCode ( ) ) - ( otherSet . hashCode ( ) ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return collection . hashCode ( ) ; } | org . junit . Assert . assertEquals ( 0 , distance ) |
toStrTest3 ( ) { char a = 'a' ; java . lang . String result = cn . hutool . core . convert . Convert . convert ( java . lang . String . class , a ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . Object , java . lang . CharSequence ) { return "Custom:<sp>" + ( value . toString ( ) ) ; } | org . junit . Assert . assertEquals ( "a" , result ) |
embedded_05 ( ) { org . apache . jena . sparql . core . DatasetGraph dsg = org . apache . jena . fuseki . main . TestEmbeddedFuseki . dataset ( ) ; int port = org . apache . jena . atlas . web . WebLib . choosePort ( ) ; org . apache . jena . fuseki . main . FusekiServer server = org . apache . jena . fuseki . main . FusekiServer . create ( ) . port ( port ) . add ( "/ds0" , dsg ) . build ( ) ; server . start ( ) ; try { java . lang . String x = org . apache . jena . riot . web . HttpOp . execHttpGetString ( ( ( "http://localhost:" + port ) + "/$/stats" ) ) ; "<AssertPlaceHolder>" ; } finally { server . stop ( ) ; } } execHttpGetString ( java . lang . String ) { return org . apache . jena . riot . web . HttpOp . execHttpGetString ( url , null ) ; } | org . junit . Assert . assertNull ( x ) |
test_getPathInWorkspace_windows_mixed_case_ok_JENKINS_45221 ( ) { java . lang . String workspace = "d:\\jenkins\\workspace\\d.admin_feature_Jenkinsfile-SCSMHLROYAGBAWY5ZNNG6ALR77MVLEH3F3EFF3O7XN3RO5BL6AMA" ; java . lang . String absolutePath = "D:\\jenkins\\workspace\\d.admin_feature_Jenkinsfile-SCSMHLROYAGBAWY5ZNNG6ALR77MVLEH3F3EFF3O7XN3RO5BL6AMA\\admin\\xyz\\target\\pad-admin-xyz-2.4.0-SNAPSHOT-tests.jar" ; java . lang . String actual = org . jenkinsci . plugins . pipeline . maven . util . XmlUtils . getPathInWorkspace ( absolutePath , new hudson . FilePath ( new java . io . File ( workspace ) ) ) ; java . lang . String expected = "admin\\xyz\\target\\pad-admin-xyz-2.4.0-SNAPSHOT-tests.jar" ; "<AssertPlaceHolder>" ; } getPathInWorkspace ( java . lang . String , hudson . FilePath ) { boolean windows = org . jenkinsci . plugins . pipeline . maven . util . FileUtils . isWindows ( workspace ) ; final java . lang . String workspaceRemote = workspace . getRemote ( ) ; java . lang . String sanitizedAbsoluteFilePath ; java . lang . String sanitizedWorkspaceRemote ; if ( windows ) { sanitizedWorkspaceRemote = workspaceRemote . replace ( '/' , '\\' ) ; sanitizedAbsoluteFilePath = absoluteFilePath . replace ( '/' , '\\' ) ; } else if ( ( workspaceRemote . startsWith ( "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 2 ) ) && ( absoluteFilePath . startsWith ( "/private/var/" ) ) ) { sanitizedWorkspaceRemote = workspaceRemote ; sanitizedAbsoluteFilePath = absoluteFilePath . substring ( "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 1.le ngth ( ) ) ; } else { sanitizedAbsoluteFilePath = absoluteFilePath ; sanitizedWorkspaceRemote = workspaceRemote ; } if ( org . apache . commons . lang . StringUtils . startsWithIgnoreCase ( sanitizedAbsoluteFilePath , sanitizedWorkspaceRemote ) ) { } else if ( ( sanitizedWorkspaceRemote . contains ( "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 ) ) && ( sanitizedAbsoluteFilePath . contains ( "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 ) ) ) { sanitizedAbsoluteFilePath = "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 + ( org . apache . commons . lang . StringUtils . substringAfter ( sanitizedAbsoluteFilePath , "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 ) ) ; sanitizedWorkspaceRemote = "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 + ( org . apache . commons . lang . StringUtils . substringAfter ( sanitizedWorkspaceRemote , "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 ) ) ; } else if ( ( sanitizedWorkspaceRemote . endsWith ( "/workspace" ) ) && ( sanitizedAbsoluteFilePath . contains ( "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 ) ) ) { sanitizedAbsoluteFilePath = "workspace/" + ( org . apache . commons . lang . StringUtils . substringAfter ( sanitizedAbsoluteFilePath , "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 5 ) ) ; sanitizedWorkspaceRemote = "workspace/" ; } else { throw new java . lang . IllegalArgumentException ( ( ( ( ( "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 0 + absoluteFilePath ) + "'<sp>relatively<sp>to<sp>'" ) + ( workspace . getRemote ( ) ) ) + "'" ) ) ; } java . lang . String relativePath = org . apache . commons . lang . StringUtils . removeStartIgnoreCase ( sanitizedAbsoluteFilePath , sanitizedWorkspaceRemote ) ; java . lang . String fileSeparator = ( windows ) ? "\\" : "/private/var/folders/lq/50t8n2nx7l316pwm8gc_2rt40000gn/T/jenkinsTests.tmp/jenkins3845105900446934883test/workspace/build-on-master-with-tool-provided-maven/pom.xml" 4 ; if ( relativePath . startsWith ( fileSeparator ) ) { relativePath = relativePath . substring ( fileSeparator . length ( ) ) ; } org . jenkinsci . plugins . pipeline . maven . util . XmlUtils . LOGGER . log ( Level . FINEST , "getPathInWorkspace({0},<sp>{1}:<sp>{2}" , new java . lang . Object [ ] { absoluteFilePath , workspaceRemote , relativePath } ) ; return relativePath ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( expected ) ) |
hasAdminAccessReturnsTrueIfTheRolesContainUnverifiedUserAndAdmin ( ) { nl . knaw . huygens . timbuctoo . security . dto . VreAuthorization instance = nl . knaw . huygens . timbuctoo . security . dto . VreAuthorization . create ( "" , "" , nl . knaw . huygens . timbuctoo . security . UNVERIFIED_USER_ROLE , nl . knaw . huygens . timbuctoo . security . ADMIN_ROLE ) ; boolean allowedToWrite = instance . hasAdminAccess ( ) ; "<AssertPlaceHolder>" ; } hasAdminAccess ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented" ) ; } | org . junit . Assert . assertThat ( allowedToWrite , org . hamcrest . core . Is . is ( true ) ) |
testDeprecation ( ) { java . lang . String value = "bar" ; java . lang . String oldKey = ( com . datatorrent . api . StreamingApplication . DT_PREFIX ) + ( Context . DAGContext . APPLICATION_NAME . getName ( ) ) ; java . lang . String newKey = LogicalPlanConfiguration . KEY_APPLICATION_NAME ; org . apache . hadoop . conf . Configuration config = new org . apache . hadoop . conf . Configuration ( false ) ; config . set ( oldKey , value ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { com . datatorrent . stram . client . DTConfiguration . ValueEntry value = map . get ( key ) ; return value == null ? null : value . value ; } | org . junit . Assert . assertEquals ( value , config . get ( newKey ) ) |
checkDefault ( ) { final org . apache . openejb . server . FilteredServiceManager fsm = new org . apache . openejb . server . FilteredServiceManager ( new java . lang . String [ ] { "foo" } ) ; "<AssertPlaceHolder>" ; } accept ( java . io . File ) { return true ; } | org . junit . Assert . assertTrue ( fsm . accept ( "foo" ) ) |
testConstantSizePolicyWithJitter ( ) { conf . set ( HConstants . HBASE_REGION_SPLIT_POLICY_KEY , org . apache . hadoop . hbase . regionserver . ConstantSizeRegionSplitPolicy . class . getName ( ) ) ; htd . setMaxFileSize ( Long . MAX_VALUE ) ; boolean positiveJitter = false ; org . apache . hadoop . hbase . regionserver . ConstantSizeRegionSplitPolicy policy = null ; while ( ! positiveJitter ) { policy = ( ( org . apache . hadoop . hbase . regionserver . ConstantSizeRegionSplitPolicy ) ( org . apache . hadoop . hbase . regionserver . RegionSplitPolicy . create ( mockRegion , conf ) ) ) ; positiveJitter = policy . positiveJitterRate ( ) ; } org . apache . hadoop . hbase . regionserver . HStore mockStore = org . mockito . Mockito . mock ( org . apache . hadoop . hbase . regionserver . HStore . class ) ; org . mockito . Mockito . doReturn ( 2000L ) . when ( mockStore ) . getSize ( ) ; org . mockito . Mockito . doReturn ( true ) . when ( mockStore ) . canSplit ( ) ; stores . add ( mockStore ) ; "<AssertPlaceHolder>" ; } shouldSplit ( ) { float blockedReqRate = updateRate ( ) ; if ( super . shouldSplit ( ) ) { return true ; } if ( ( org . apache . hadoop . hbase . util . EnvironmentEdgeManager . currentTime ( ) ) < ( ( startTime ) + ( minAge ) ) ) { return false ; } for ( org . apache . hadoop . hbase . regionserver . HStore store : region . getStores ( ) ) { if ( ! ( store . canSplit ( ) ) ) { return false ; } } if ( blockedReqRate >= ( maxBlockedRequests ) ) { if ( org . apache . hadoop . hbase . regionserver . BusyRegionSplitPolicy . LOG . isDebugEnabled ( ) ) { org . apache . hadoop . hbase . regionserver . BusyRegionSplitPolicy . LOG . debug ( ( ( ( "Going<sp>to<sp>split<sp>region<sp>" + ( region . getRegionInfo ( ) . getRegionNameAsString ( ) ) ) + "<sp>because<sp>it's<sp>too<sp>busy.<sp>Blocked<sp>Request<sp>rate:<sp>" ) + blockedReqRate ) ) ; } return true ; } return false ; } | org . junit . Assert . assertFalse ( policy . shouldSplit ( ) ) |
testConfigureEnableDistanceOnly ( ) { System . out . println ( ( ( getTestTraceHead ( "[NGSICartoDBSink.configure]" ) ) + "--------<sp>Only<sp>enable_distance<sp>configuration<sp>works" ) ) ; org . apache . flume . Context context = new org . apache . flume . Context ( ) ; context . put ( "enable_distance" , "true" ) ; context . put ( "keys_conf_file" , "" ) ; com . telefonica . iot . cygnus . sinks . NGSICartoDBSink sink = new com . telefonica . iot . cygnus . sinks . NGSICartoDBSink ( ) ; sink . configure ( context ) ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( getTestTraceHead ( "[NGSICartoDBSink.configure]" ) ) + "-<sp>OK<sp>-<sp>Only<sp>'enable_distance'<sp>was<sp>configured<sp>and<sp>worked" ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( getTestTraceHead ( "[NGSICartoDBSink.configure]" ) ) + "-<sp>FAIL<sp>-<sp>Only<sp>'enable_distance'<sp>was<sp>configured<sp>and<sp>did<sp>not<sp>work" ) ) ; throw e ; } getEnableDistanceHistoric ( ) { return enableDistanceHistoric ; } | org . junit . Assert . assertTrue ( sink . getEnableDistanceHistoric ( ) ) |
itShouldProperlyBuild_Pow2_Histogram ( ) { io . datakernel . jmx . ValueStats stats = io . datakernel . jmx . ValueStats . create ( io . datakernel . jmx . ValueStatsTest . SMOOTHING_WINDOW ) . withHistogram ( ValueStats . POWERS_OF_TWO ) ; stats . recordValue ( ( - 10 ) ) ; stats . recordValue ( 0 ) ; stats . recordValue ( 0 ) ; stats . recordValue ( 2 ) ; stats . recordValue ( 3 ) ; stats . recordValue ( 3 ) ; stats . recordValue ( 7 ) ; java . util . List < java . lang . String > expected = asList ( "(-,<sp>0)<sp>:<sp>1" , "[<sp>0,<sp>1)<sp>:<sp>2" , "[<sp>1,<sp>2)<sp>:<sp>0" , "[<sp>2,<sp>4)<sp>:<sp>3" , "[<sp>4,<sp>8)<sp>:<sp>1" , "[<sp>8,<sp>+)<sp>:<sp>0" ) ; "<AssertPlaceHolder>" ; } getHistogram ( ) { if ( ( histogramLevels ) == null ) { return null ; } if ( ! ( histogramContainsValues ( ) ) ) { return null ; } int left = findLeftHistogramLimit ( ) ; int right = findRightHistogramLimit ( ) ; java . lang . String [ ] lines = new java . lang . String [ ( right - left ) + 1 ] ; java . lang . String [ ] labels = io . datakernel . jmx . ValueStats . createHistogramLabels ( histogramLevels , left , ( right - 1 ) ) ; long [ ] values = java . util . Arrays . copyOfRange ( histogramValues , left , ( right + 1 ) ) ; int maxValueStrLen = 0 ; for ( long value : histogramValues ) { java . lang . String valueStr = java . lang . Long . toString ( value ) ; if ( ( valueStr . length ( ) ) > maxValueStrLen ) { maxValueStrLen = valueStr . length ( ) ; } } java . lang . String pattern = ( "<sp>:<sp>%" + maxValueStrLen ) + "s" ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { lines [ i ] = ( labels [ i ] ) + ( java . lang . String . format ( pattern , values [ i ] ) ) ; } return asList ( lines ) ; } | org . junit . Assert . assertEquals ( expected , stats . getHistogram ( ) ) |
canBuildDummyPrincipal ( ) { java . security . Principal dummyPrincipal = login . login ( "dummyName" ) ; "<AssertPlaceHolder>" ; } login ( javax . security . auth . callback . CallbackHandler ) { if ( ( clientLogin ) != null ) { return clientLogin . login ( cbHandler ) ; } return null ; } | org . junit . Assert . assertNotNull ( dummyPrincipal ) |
testCreateSyncedIdentityNull ( ) { "<AssertPlaceHolder>" ; } createSyncedIdentity ( org . apache . jackrabbit . api . security . user . Authorizable ) { if ( auth == null ) { return null ; } org . apache . jackrabbit . oak . spi . security . authentication . external . ExternalIdentityRef ref = org . apache . jackrabbit . oak . spi . security . authentication . external . basic . DefaultSyncContext . getIdentityRef ( auth ) ; javax . jcr . Value [ ] lmValues = auth . getProperty ( org . apache . jackrabbit . oak . spi . security . authentication . external . basic . DefaultSyncContext . REP_LAST_SYNCED ) ; long lastModified = - 1 ; if ( ( lmValues != null ) && ( ( lmValues . length ) > 0 ) ) { lastModified = lmValues [ 0 ] . getLong ( ) ; } return new org . apache . jackrabbit . oak . spi . security . authentication . external . basic . DefaultSyncedIdentity ( auth . getID ( ) , ref , auth . isGroup ( ) , lastModified ) ; } | org . junit . Assert . assertNull ( org . apache . jackrabbit . oak . spi . security . authentication . external . basic . DefaultSyncContext . createSyncedIdentity ( null ) ) |
copyCollection_oneSubDoc_toExistingDest_canWriteDest ( ) { final org . exist . xmldb . XmldbURI src = org . exist . xmldb . XmldbURI . create ( "/db/test/source" ) ; final org . exist . xmldb . XmldbURI dest = org . exist . xmldb . XmldbURI . create ( "/db/test" ) ; final org . exist . xmldb . XmldbURI newName = org . exist . xmldb . XmldbURI . create ( "dest" ) ; final org . exist . collections . Collection srcCollection = org . easymock . EasyMock . createStrictMock ( org . exist . collections . Collection . class ) ; final org . exist . security . Permission srcPermissions = org . easymock . EasyMock . createStrictMock ( org . exist . security . Permission . class ) ; final org . exist . dom . persistent . DocumentImpl srcSubDocument = org . easymock . EasyMock . createStrictMock ( org . exist . dom . persistent . DocumentImpl . class ) ; final org . exist . security . Permission srcSubDocumentPermissions = org . easymock . EasyMock . createStrictMock ( org . exist . security . Permission . class ) ; final org . exist . collections . Collection destCollection = org . easymock . EasyMock . createStrictMock ( org . exist . collections . Collection . class ) ; final org . exist . security . Permission destPermissions = org . easymock . EasyMock . createStrictMock ( org . exist . security . Permission . class ) ; final org . exist . collections . Collection newDestCollection = org . easymock . EasyMock . createStrictMock ( org . exist . collections . Collection . class ) ; final org . exist . security . Permission newDestPermissions = org . easymock . EasyMock . createStrictMock ( org . exist . security . Permission . class ) ; final org . exist . storage . NativeBroker broker = org . easymock . EasyMock . createMockBuilder ( org . exist . storage . NativeBroker . class ) . addMockedMethod ( "getCollection" ) . addMockedMethod ( "getCurrentSubject" ) . createStrictMock ( ) ; final org . exist . security . Subject subject = org . easymock . EasyMock . createStrictMock ( org . exist . security . Subject . class ) ; expect ( srcCollection . getPermissionsNoLock ( ) ) . andReturn ( srcPermissions ) ; expect ( broker . getCurrentSubject ( ) ) . andReturn ( subject ) ; expect ( srcPermissions . validate ( subject , ( ( org . exist . security . Permission . EXECUTE ) | ( org . exist . security . Permission . READ ) ) ) ) . andReturn ( true ) ; expect ( destCollection . getURI ( ) ) . andReturn ( dest ) ; final org . easymock . Capture < org . exist . xmldb . XmldbURI > newDestURICapture = newCapture ( ) ; expect ( broker . getCollection ( capture ( newDestURICapture ) ) ) . andReturn ( newDestCollection ) ; expect ( destCollection . getPermissionsNoLock ( ) ) . andReturn ( destPermissions ) ; expect ( broker . getCurrentSubject ( ) ) . andReturn ( subject ) ; expect ( destPermissions . validate ( subject , ( ( org . exist . security . Permission . EXECUTE ) | ( org . exist . security . Permission . WRITE ) ) ) ) . andReturn ( true ) ; expect ( newDestCollection . getPermissionsNoLock ( ) ) . andReturn ( newDestPermissions ) ; expect ( broker . getCurrentSubject ( ) ) . andReturn ( subject ) ; expect ( newDestPermissions . validate ( subject , ( ( org . exist . security . Permission . EXECUTE ) | ( org . exist . security . Permission . WRITE ) ) ) ) . andReturn ( true ) ; expect ( srcCollection . iteratorNoLock ( broker ) ) . andReturn ( new org . exist . storage . NativeBrokerTest . ArrayIterator ( srcSubDocument ) ) ; expect ( srcSubDocument . getPermissions ( ) ) . andReturn ( srcSubDocumentPermissions ) ; expect ( broker . getCurrentSubject ( ) ) . andReturn ( subject ) ; expect ( srcSubDocumentPermissions . validate ( subject , Permission . READ ) ) . andReturn ( true ) ; expect ( newDestCollection . isEmpty ( broker ) ) . andReturn ( true ) ; expect ( srcCollection . collectionIteratorNoLock ( broker ) ) . andReturn ( org . exist . storage . Collections . emptyIterator ( ) ) ; replay ( newDestPermissions , newDestCollection , srcSubDocumentPermissions , srcSubDocument , destCollection , destPermissions , srcCollection , srcPermissions , subject , broker ) ; broker . checkPermissionsForCopy ( srcCollection , destCollection , newName ) ; verify ( newDestPermissions , newDestCollection , srcSubDocumentPermissions , srcSubDocument , destCollection , destPermissions , srcCollection , srcPermissions , subject , broker ) ; "<AssertPlaceHolder>" ; } append ( java . lang . String ) { int startOffset = 0 ; if ( ( segment . charAt ( 0 ) ) == ( org . exist . collections . CollectionURI . FRAGMENT_SEPARATOR ) ) { startOffset = 1 ; } if ( ( uri ) == null ) { uri = new char [ ( ( segment . length ( ) ) + 1 ) - startOffset ] ; uri [ 0 ] = org . exist . collections . CollectionURI . FRAGMENT_SEPARATOR ; segment . getChars ( startOffset , segment . length ( ) , uri , 1 ) ; } else { char [ ] newURI = new char [ ( ( ( length ) + 1 ) + ( segment . length ( ) ) ) - startOffset ] ; java . lang . System . arraycopy ( uri , 0 , newURI , 0 , length ) ; newURI [ length ] = org . exist . collections . CollectionURI . FRAGMENT_SEPARATOR ; segment . getChars ( startOffset , segment . length ( ) , newURI , ( | org . junit . Assert . assertEquals ( dest . append ( newName ) , newDestURICapture . getValue ( ) ) |
testParam ( ) { class Struct { @ org . scijava . util . SuppressWarnings ( "unused" ) private java . util . List < int [ ] > list ; } final java . lang . reflect . Type listType = type ( Struct . class , "list" ) ; final java . lang . reflect . Type paramType = org . scijava . util . Types . param ( listType , java . util . List . class , 0 ) ; final java . lang . Class < ? > paramClass = org . scijava . util . Types . raw ( paramType ) ; "<AssertPlaceHolder>" ; } raw ( java . lang . reflect . Type ) { if ( type == null ) return null ; if ( type instanceof java . lang . Class ) return ( ( java . lang . Class < ? > ) ( type ) ) ; final java . util . List < java . lang . Class < ? > > c = org . scijava . util . Types . raws ( type ) ; if ( ( c == null ) || ( ( c . size ( ) ) == 0 ) ) return null ; return c . get ( 0 ) ; } | org . junit . Assert . assertSame ( int [ ] . class , paramClass ) |
equals5 ( ) { org . diirt . util . time . TimeInterval interval = org . diirt . util . time . TimeInterval . between ( null , java . time . Instant . ofEpochSecond ( 0 , 0 ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( interval , equalTo ( org . diirt . util . time . TimeInterval . between ( null , java . time . Instant . ofEpochSecond ( 0 , 0 ) ) ) ) |
testBatchGetMaterial ( ) { com . jfinal . weixin . sdk . api . ApiResult ar = com . jfinal . weixin . sdk . api . MediaApi . batchGetMaterial ( MediaType . IMAGE , 1 , 10 ) ; java . lang . String json = ar . getJson ( ) ; System . out . println ( ( "testBatchGetMaterial:<sp>" + json ) ) ; "<AssertPlaceHolder>" ; } getJson ( ) { return json ; } | org . junit . Assert . assertNotNull ( json ) |
shouldNotFilterLinksToWasNodes ( ) { com . navercorp . pinpoint . web . vo . Application fromApplication = new com . navercorp . pinpoint . web . vo . Application ( "WAS_FROM" , com . navercorp . pinpoint . common . trace . ServiceType . TEST_STAND_ALONE ) ; com . navercorp . pinpoint . web . vo . Application toApplication = new com . navercorp . pinpoint . web . vo . Application ( "WAS_TO" , com . navercorp . pinpoint . common . trace . ServiceType . TEST_STAND_ALONE ) ; com . navercorp . pinpoint . web . applicationmap . rawdata . LinkData wasToWasLinkData = new com . navercorp . pinpoint . web . applicationmap . rawdata . LinkData ( fromApplication , toApplication ) ; com . navercorp . pinpoint . web . applicationmap . rawdata . LinkDataMap linkDataMap = new com . navercorp . pinpoint . web . applicationmap . rawdata . LinkDataMap ( ) ; linkDataMap . addLinkData ( wasToWasLinkData ) ; com . navercorp . pinpoint . web . service . map . processor . WasOnlyProcessor wasOnlyProcessor = new com . navercorp . pinpoint . web . service . map . processor . WasOnlyProcessor ( ) ; com . navercorp . pinpoint . web . applicationmap . rawdata . LinkDataMap filteredLinkDataMap = wasOnlyProcessor . processLinkDataMap ( linkDataMap , testRange ) ; "<AssertPlaceHolder>" ; } getLinkDataList ( ) { return linkDataMap . values ( ) ; } | org . junit . Assert . assertFalse ( filteredLinkDataMap . getLinkDataList ( ) . isEmpty ( ) ) |
test_getChildren ( ) { ZK = org . goldenorb . zookeeper . ZookeeperUtils . connect ( org . goldenorb . zookeeper . ZookeeperUtilsTest . orbConf . getOrbZooKeeperQuorum ( ) ) ; ZK . create ( "/node" , new byte [ 0 ] , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; ZK . create ( "/node/child1" , new byte [ 0 ] , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; ZK . create ( "/node/child2" , new byte [ 0 ] , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; java . util . List < java . lang . String > list = org . goldenorb . zookeeper . ZookeeperUtils . getChildren ( ZK , "/node" , null ) ; "<AssertPlaceHolder>" ; ZK . delete ( "/node/child1" , ( - 1 ) ) ; ZK . delete ( "/node/child2" , ( - 1 ) ) ; ZK . delete ( "/node" , ( - 1 ) ) ; } size ( ) { return messages . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( list . size ( ) ) == 2 ) ) |
givenRandomPerson_whenCreate_thenPersonPersisted ( ) { com . baeldung . couchbase . spring . person . Person person = randomPerson ( ) ; personService . create ( person ) ; java . lang . String id = person . getId ( ) ; "<AssertPlaceHolder>" ; } read ( int ) { return this . getContent ( ) . toString ( ) . substring ( 0 , limit ) ; } | org . junit . Assert . assertNotNull ( personService . read ( id ) ) |
testGunzip ( ) { byte [ ] input1 = org . apache . cayenne . crypto . unit . CryptoUnitUtils . hexToBytes ( "1f8b0800000000000000f348cdc9c957f0409000a91a078c11000000" ) ; byte [ ] output1 = org . apache . cayenne . crypto . transformer . bytes . GzipDecryptor . gunzip ( input1 ) ; byte [ ] expectedOutput1 = "Hello<sp>Hello<sp>Hello" . getBytes ( "UTF8" ) ; "<AssertPlaceHolder>" ; } gunzip ( byte [ ] ) { java . io . ByteArrayInputStream zipBytes = new java . io . ByteArrayInputStream ( input ) ; java . util . zip . GZIPInputStream in = new java . util . zip . GZIPInputStream ( zipBytes ) ; byte [ ] out = new byte [ ( input . length ) * 2 ] ; int totalRead = 0 ; int read ; int resizeBy = input . length ; while ( ( read = in . read ( out , totalRead , ( ( ( out . length ) - totalRead ) - 1 ) ) ) > 0 ) { totalRead += read ; if ( ( totalRead + 1 ) == ( out . length ) ) { out = java . util . Arrays . copyOf ( out , ( ( out . length ) + resizeBy ) ) ; } } if ( totalRead < ( out . length ) ) { out = java . util . Arrays . copyOf ( out , totalRead ) ; } return out ; } | org . junit . Assert . assertArrayEquals ( expectedOutput1 , output1 ) |
testMessageCorrelateAllResultListWithResultTypeProcessDefinition ( ) { java . util . List < org . camunda . bpm . engine . runtime . MessageCorrelationResult > resultList = runtimeService . createMessageCorrelation ( "newInvoiceMessage" ) . correlateAllWithResult ( ) ; "<AssertPlaceHolder>" ; for ( org . camunda . bpm . engine . runtime . MessageCorrelationResult result : resultList ) { checkProcessDefinitionMessageCorrelationResult ( result , "theStart" , "messageStartEvent" ) ; } } size ( ) { return ( ( ( historicProcessInstanceIds . size ( ) ) + ( historicDecisionInstanceIds . size ( ) ) ) + ( historicCaseInstanceIds . size ( ) ) ) + ( historicBatchIds . size ( ) ) ; } | org . junit . Assert . assertEquals ( 1 , resultList . size ( ) ) |
should_create_complex_query ( ) { final java . lang . String name = "findByNameAndTemporalBetweenOrEnabledIsNull" + ( "AndCamelCaseLikeIgnoreCaseAndEmbedded_embeddNotEqualIgnoreCase" + "OrderByEmbedded_embeddDesc" ) ; final java . lang . String expected = "select<sp>e<sp>from<sp>Simple<sp>e<sp>" + ( ( ( ( ( "where<sp>e.name<sp>=<sp>?1<sp>" + "and<sp>e.temporal<sp>between<sp>?2<sp>and<sp>?3<sp>" ) + "or<sp>e.enabled<sp>IS<sp>NULL<sp>" ) + "and<sp>upper(e.camelCase)<sp>like<sp>?4<sp>" ) + "and<sp>upper(e.embedded.embedd)<sp><><sp>upper(?5)<sp>" ) + "order<sp>by<sp>e.embedded.embedd<sp>desc" ) ; java . lang . String result = org . apache . deltaspike . data . impl . builder . part . QueryRoot . create ( name , repo , prefix ( name ) ) . getJpqlQuery ( ) . trim ( ) ; "<AssertPlaceHolder>" ; } getJpqlQuery ( ) { return jpqlQuery ; } | org . junit . Assert . assertEquals ( expected , result ) |
testWithNoModeChanges ( ) { org . kitteh . irc . client . library . Client clientMock = org . mockito . Mockito . mock ( org . kitteh . irc . client . library . Client . class ) ; org . mockito . Mockito . when ( clientMock . getNick ( ) ) . thenReturn ( org . kitteh . irc . client . library . command . UserModeCommandTest . USER ) ; org . kitteh . irc . client . library . command . UserModeCommand sut = new org . kitteh . irc . client . library . command . UserModeCommand ( clientMock ) ; sut . execute ( ) ; org . mockito . Mockito . verify ( clientMock , org . mockito . Mockito . times ( 1 ) ) . sendRawLine ( ( "MODE<sp>" + ( org . kitteh . irc . client . library . command . UserModeCommandTest . USER ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . toStringer ( ) . toString ( ) ; } | org . junit . Assert . assertFalse ( sut . toString ( ) . isEmpty ( ) ) |
hashCodeBlankNode ( ) { final org . apache . commons . rdf . api . BlankNode bnode1 = factory . createBlankNode ( ) ; "<AssertPlaceHolder>" ; } uniqueReference ( ) { return uniqueReference ; } | org . junit . Assert . assertEquals ( bnode1 . uniqueReference ( ) . hashCode ( ) , bnode1 . hashCode ( ) ) |
doesNotAcceptEmptyFile ( ) { boolean fileAccepted = caseInsensitiveFileFilter . accept ( new java . io . File ( "" ) ) ; "<AssertPlaceHolder>" ; } accept ( java . io . File ) { return ( ( f . isDirectory ( ) ) || ( "*" . equals ( extension ) ) ) || ( f . getName ( ) . toLowerCase ( java . util . Locale . getDefault ( ) ) . endsWith ( extension ) ) ; } | org . junit . Assert . assertThat ( fileAccepted , org . hamcrest . core . Is . is ( false ) ) |
toCompilableType_A$String$List$String_StringIsEmpty ( ) { org . junithelper . core . extractor . TypeNameConverter target = new org . junithelper . core . extractor . TypeNameConverter ( config ) ; java . lang . String typeName = "" ; java . util . List < java . lang . String > importedList = new java . util . ArrayList < java . lang . String > ( ) ; java . lang . String callerClassPackageName = "" ; java . lang . String actual = target . toCompilableType ( typeName , importedList , callerClassPackageName ) ; java . lang . String expected = "Object" ; "<AssertPlaceHolder>" ; } toCompilableType ( java . lang . String , java . util . List , java . lang . String ) { return toCompilableType ( typeName , null , importedList , callerClassPackageName ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) ) |
testEmptyAddressParse ( ) { com . sun . mail . util . logging . InternetAddress [ ] a = com . sun . mail . util . logging . InternetAddress . parse ( "" , false ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String , boolean ) { return javax . mail . internet . InternetAddress . parse ( addresslist , strict , false ) ; } | org . junit . Assert . assertTrue ( ( ( a . length ) == 0 ) ) |
EmptyPlan ( ) { System . out . println ( "EmptyPlan" ) ; org . aksw . limes . core . execution . planning . planner . HeliosPlanner p = new org . aksw . limes . core . execution . planning . planner . HeliosPlanner ( source , target ) ; org . aksw . limes . core . io . ls . LinkSpecification ls = new org . aksw . limes . core . io . ls . LinkSpecification ( ) ; org . aksw . limes . core . execution . planning . plan . NestedPlan plan = p . plan ( ls ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { org . aksw . limes . core . execution . planning . plan . Plan plan = new org . aksw . limes . core . execution . planning . plan . NestedPlan ( ) ; org . aksw . limes . core . execution . planning . plan . Instruction run1 = new org . aksw . limes . core . execution . planning . plan . Instruction ( org . aksw . limes . core . execution . planning . plan . Instruction . Command . RUN , "jaccard(x.surname,<sp>y.surname)" , "0.3" , ( - 1 ) , ( - 1 ) , 0 ) ; plan . addInstruction ( run1 ) ; org . junit . Assert . assertTrue ( ( ( plan . isEmpty ( ) ) == false ) ) ; plan . removeInstruction ( null ) ; org . junit . Assert . assertTrue ( ( ( plan . isEmpty ( ) ) == false ) ) ; plan . removeInstruction ( run1 ) ; org . junit . Assert . assertTrue ( ( ( plan . isEmpty ( ) ) == true ) ) ; } | org . junit . Assert . assertTrue ( ( ( plan . isEmpty ( ) ) == true ) ) |
getAllWithEmptyRegistryShouldReturnEmptySet ( ) { "<AssertPlaceHolder>" ; } getAll ( ) { io . cereebro . core . Snitch s1 = new io . cereebro . core . StaticSnitch ( java . net . URI . create ( "fake://1" ) ) ; io . cereebro . core . Snitch s2 = new io . cereebro . core . StaticSnitch ( java . net . URI . create ( "fake://2" ) ) ; java . util . ArrayList < io . cereebro . core . SnitchRegistry > registries = org . assertj . core . util . Lists . newArrayList ( io . cereebro . core . StaticSnitchRegistry . of ( s1 ) , io . cereebro . core . StaticSnitchRegistry . of ( s2 ) ) ; io . cereebro . core . SnitchRegistry composite = io . cereebro . core . CompositeSnitchRegistry . of ( registries ) ; java . util . List < io . cereebro . core . Snitch > expected = java . util . Arrays . asList ( s1 , s2 ) ; org . junit . Assert . assertEquals ( expected , composite . getAll ( ) ) ; } | org . junit . Assert . assertTrue ( io . cereebro . core . CompositeSnitchRegistry . of ( ) . getAll ( ) . isEmpty ( ) ) |
testFloatConversionNoTypeInfo ( ) { final float v_float = 3.1F ; final org . apache . felix . configurator . impl . json . TypeConverter converter = new org . apache . felix . configurator . impl . json . TypeConverter ( null ) ; final java . lang . Object result = converter . convert ( null , v_float , null ) ; "<AssertPlaceHolder>" ; } convert ( org . apache . felix . gogo . runtime . CommandSession , java . lang . Class , java . lang . Object ) { int [ ] cost = new int [ 1 ] ; java . lang . Object ret = org . apache . felix . gogo . runtime . Reflective . coerce ( session , desiredType , in , cost ) ; if ( ret == ( Reflective . NO_MATCH ) ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Cannot<sp>convert<sp>%s(%s)<sp>to<sp>%s" , in , ( in != null ? in . getClass ( ) : "null" ) , desiredType ) ) ; } return ret ; } | org . junit . Assert . assertTrue ( ( result instanceof java . lang . Double ) ) |
testNewDataWillAppendClientIp ( ) { java . lang . String logStore = "logstore-" + ( getNowTimestamp ( ) ) ; ensureLogStoreEnabled ( com . aliyun . openservices . log . functiontest . TEST_PROJECT , logStore , true ) ; int written = writeData ( logStore ) ; "<AssertPlaceHolder>" ; } countLogGroupWithClientIpTag ( java . lang . String , java . lang . String , int ) { com . aliyun . openservices . log . functiontest . BaseMetadataTest . Predicate predicate = new com . aliyun . openservices . log . functiontest . BaseMetadataTest . Predicate ( ) { @ com . aliyun . openservices . log . functiontest . Override public boolean test ( com . aliyun . openservices . log . common . Logs . LogGroup group ) { int clientIp = 0 ; int receiveTime = 0 ; System . out . println ( ( "Tag<sp>count:<sp>" + ( group . getLogTagsCount ( ) ) ) ) ; for ( com . aliyun . openservices . log . common . Logs . LogTag tag : group . getLogTagsList ( ) ) { System . out . println ( tag ) ; if ( "__client_ip__" . equals ( tag . getKey ( ) ) ) { ++ clientIp ; } if ( "__receive_time__" . equals ( tag . getKey ( ) ) ) { ++ receiveTime ; } } return ( clientIp == 1 ) && ( receiveTime == 1 ) ; } } ; return countAppended ( project , logStore , numShard , predicate ) ; } | org . junit . Assert . assertEquals ( written , countLogGroupWithClientIpTag ( com . aliyun . openservices . log . functiontest . TEST_PROJECT , logStore , 2 ) ) |
testAddUserToRequiredUserGroups ( ) { long [ ] requiredUserGroupIds = addRequiredUserGroups ( ) ; int initialUserGroupUsersCount = com . liferay . portal . kernel . service . UserLocalServiceUtil . getUserGroupUsersCount ( requiredUserGroupIds [ 0 ] ) ; com . liferay . portal . security . membership . policy . test . util . MembershipPolicyTestUtil . addUser ( null , null , null , new long [ ] { requiredUserGroupIds [ 0 ] } ) ; "<AssertPlaceHolder>" ; } getUserGroupUsersCount ( long ) { return com . liferay . portal . kernel . service . UserLocalServiceUtil . getService ( ) . getUserGroupUsersCount ( userGroupId ) ; } | org . junit . Assert . assertEquals ( ( initialUserGroupUsersCount + 1 ) , com . liferay . portal . kernel . service . UserLocalServiceUtil . getUserGroupUsersCount ( requiredUserGroupIds [ 0 ] ) ) |
testErrorProbabilitiesDoubleArray ( ) { double [ ] errorProbabilities = new double [ 4 ] ; org . biojava . nbio . genome . io . fastq . FastqTools . errorProbabilities ( builder . build ( ) , errorProbabilities ) ; for ( int i = 0 ; i < 0 ; i ++ ) { "<AssertPlaceHolder>" ; } } build ( ) { if ( ( description ) == null ) { throw new java . lang . IllegalStateException ( "description<sp>must<sp>not<sp>be<sp>null" ) ; } if ( ( sequence ) == null ) { throw new java . lang . IllegalStateException ( "sequence<sp>must<sp>not<sp>be<sp>null" ) ; } if ( ( quality ) == null ) { throw new java . lang . IllegalStateException ( "quality<sp>must<sp>not<sp>be<sp>null" ) ; } if ( ! ( sequenceAndQualityLengthsMatch ( ) ) ) { throw new java . lang . IllegalStateException ( "sequence<sp>and<sp>quality<sp>scores<sp>must<sp>be<sp>the<sp>same<sp>length" ) ; } org . biojava . nbio . genome . io . fastq . Fastq fastq = new org . biojava . nbio . genome . io . fastq . Fastq ( description , sequence . toString ( ) , quality . toString ( ) , variant ) ; return fastq ; } | org . junit . Assert . assertTrue ( ( ( errorProbabilities [ i ] ) > 0.0 ) ) |
listUnmergedCommitsWhenMasterIsSameAsBranch_shouldReturnEmptyList ( ) { writeSomethingToCache ( ) ; org . eclipse . jgit . revwalk . RevCommit masterFirst = commitToMaster ( ) ; com . beijunyi . parallelgit . utils . BranchUtils . createBranch ( "test_branch" , masterFirst , repo ) ; java . util . List < org . eclipse . jgit . revwalk . RevCommit > unmerged = com . beijunyi . parallelgit . utils . CommitUtils . listUnmergedCommits ( "test_branch" , com . beijunyi . parallelgit . utils . MASTER , repo ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( path . length ) == 0 ; } | org . junit . Assert . assertTrue ( unmerged . isEmpty ( ) ) |
windowsCommandBuilderDriverTest ( ) { org . apache . reef . runtime . common . client . api . JobSubmissionEvent event = mock ( org . apache . reef . runtime . common . client . api . JobSubmissionEvent . class ) ; org . apache . reef . util . Optional < java . lang . Integer > memory = org . apache . reef . util . Optional . of ( 100 ) ; when ( event . getDriverMemory ( ) ) . thenReturn ( memory ) ; java . lang . String actual = this . windowsCommandBuilder . buildDriverCommand ( event ) ; java . lang . String expected = "powershell.exe<sp>/c<sp>\"Add-Type<sp>-AssemblyName<sp>System.IO.Compression.FileSystem;<sp>" + ( ( ( ( "[System.IO.Compression.ZipFile]::ExtractToDirectory(\\\"$env:AZ_BATCH_TASK_WORKING_DIR\\local.jar\\\",<sp>" + "\\\"$env:AZ_BATCH_TASK_WORKING_DIR\\reef\\\");<sp>{{JAVA_HOME}}/bin/java<sp>-Xmx100m<sp>-XX:PermSize=128m<sp>" ) + "-XX:MaxPermSize=128m<sp>-ea<sp>-classpath<sp>" ) + "\'c:\\driverpath1;c:\\driverpath2;reef/local/*;reef/global/*;driverclasspathsuffix\'<sp>" ) + "-Dproc_reef<sp>org.apache.reef.runtime.common.REEFLauncher<sp>reef/local/driver.conf\";" ) ; "<AssertPlaceHolder>" ; } buildDriverCommand ( org . apache . reef . runtime . common . client . api . JobSubmissionEvent ) { java . util . List < java . lang . String > commandList = new org . apache . reef . runtime . common . launch . JavaLaunchCommandBuilder ( this . launcherClass , this . commandListPrefix ) . setJavaPath ( runtimePathProvider . getPath ( ) ) . setConfigurationFilePaths ( java . util . Collections . singletonList ( this . reefFileNames . getDriverConfigurationPath ( ) ) ) . setClassPath ( getDriverClasspath ( ) ) . setMemory ( jobSubmissionEvent . getDriverMemory ( ) . get ( ) ) . build ( ) ; return java . lang . String . format ( this . osCommandFormat , org . apache . commons . lang . StringUtils . join ( commandList , '<sp>' ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testWriteRead ( ) { org . apache . accumulo . core . data . Value v = new org . apache . accumulo . core . data . Value ( org . apache . accumulo . core . data . ValueTest . DATA ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . DataOutputStream dos = new java . io . DataOutputStream ( baos ) ; v . write ( dos ) ; dos . close ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ; java . io . DataInputStream dis = new java . io . DataInputStream ( bais ) ; org . apache . accumulo . core . data . Value v2 = new org . apache . accumulo . core . data . Value ( ) ; v2 . readFields ( dis ) ; dis . close ( ) ; "<AssertPlaceHolder>" ; } get ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertArrayEquals ( org . apache . accumulo . core . data . ValueTest . DATA , v2 . get ( ) ) |
testCleanForFlushedData ( ) { byte [ ] b = new byte [ 200 ] ; storage . retrieve ( new byte [ 8 ] ) ; for ( int i = 0 ; i < 5 ; i ++ ) { storage . store ( new com . datatorrent . netlet . util . Slice ( b , 0 , b . length ) ) ; storage . store ( new com . datatorrent . netlet . util . Slice ( b , 0 , b . length ) ) ; storage . flush ( ) ; } byte [ ] lastWrittenAddress = null ; for ( int i = 0 ; i < 5 ; i ++ ) { storage . store ( new com . datatorrent . netlet . util . Slice ( b , 0 , b . length ) ) ; lastWrittenAddress = storage . store ( new com . datatorrent . netlet . util . Slice ( b , 0 , b . length ) ) ; } storage . flush ( ) ; storage . clean ( lastWrittenAddress ) ; byte [ ] cleanedOffset = storage . readData ( new org . apache . hadoop . fs . Path ( ( ( STORAGE_DIRECTORY ) + "/1/cleanoffsetFile" ) ) ) ; "<AssertPlaceHolder>" ; } readData ( org . apache . hadoop . fs . Path ) { java . io . DataInputStream is = new java . io . DataInputStream ( fs . open ( path ) ) ; byte [ ] bytes = new byte [ is . available ( ) ] ; is . readFully ( bytes ) ; is . close ( ) ; return bytes ; } | org . junit . Assert . assertArrayEquals ( lastWrittenAddress , cleanedOffset ) |
shouldFindById ( ) { when ( plan . getType ( ) ) . thenReturn ( Plan . PlanType . API ) ; when ( plan . getValidation ( ) ) . thenReturn ( Plan . PlanValidationType . AUTO ) ; when ( planRepository . findById ( io . gravitee . management . service . PlanService_FindByIdTest . PLAN_ID ) ) . thenReturn ( java . util . Optional . of ( plan ) ) ; final io . gravitee . management . model . PlanEntity planEntity = planService . findById ( io . gravitee . management . service . PlanService_FindByIdTest . PLAN_ID ) ; "<AssertPlaceHolder>" ; } findById ( java . lang . String ) { return target . findById ( logId ) ; } | org . junit . Assert . assertNotNull ( planEntity ) |
testHomePageWithIFrameTool ( ) { context . checking ( new org . jmock . Expectations ( ) { { oneOf ( serverConfigurationService ) . getBoolean ( "legacyPageTitleCustom" , true ) ; will ( returnValue ( true ) ) ; one ( activeToolManager ) . getLocalizedToolProperty ( "sakai.home" , "title" ) ; will ( returnValue ( "Localized<sp>Home<sp>Title" ) ) ; } } ) ; page . getPropertiesEdit ( ) . addProperty ( SitePage . IS_HOME_PAGE , "true" ) ; page . addTool ( "sakai.iframe" ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return "(title<sp>unknown)" ; } | org . junit . Assert . assertEquals ( "Localized<sp>Home<sp>Title" , page . getTitle ( ) ) |
withClosedStart ( ) { net . time4j . PlainDate start = net . time4j . PlainDate . of ( 2014 , 2 , 27 ) ; net . time4j . PlainDate end = net . time4j . PlainDate . of ( 2014 , 5 , 14 ) ; net . time4j . range . DateInterval interval = net . time4j . range . DateInterval . between ( start , end ) ; "<AssertPlaceHolder>" ; } withClosedStart ( ) { if ( this . start . isInfinite ( ) ) { throw new java . lang . IllegalStateException ( "Infinite<sp>past<sp>cannot<sp>be<sp>included." ) ; } else if ( this . start . isClosed ( ) ) { return this . getContext ( ) ; } else { net . time4j . range . Boundary < T > b = net . time4j . range . Boundary . of ( IntervalEdge . CLOSED , this . start . getTemporal ( ) ) ; return this . getFactory ( ) . between ( b , this . end ) ; } } | org . junit . Assert . assertThat ( interval . withClosedStart ( ) , org . hamcrest . CoreMatchers . is ( interval ) ) |
testAutoMapOfNumberToLong ( ) { "<AssertPlaceHolder>" ; } autoMap ( java . sql . ResultSet , java . lang . Class ) { try { if ( cls . isInterface ( ) ) { return com . github . davidmoten . rx . jdbc . Util . autoMapInterface ( rs , cls ) ; } else { int n = rs . getMetaData ( ) . getColumnCount ( ) ; for ( java . lang . reflect . Constructor < ? > c : cls . getDeclaredConstructors ( ) ) { if ( n == ( c . getParameterTypes ( ) . length ) ) { return com . github . davidmoten . rx . jdbc . Util . autoMap ( rs , ( ( java . lang . reflect . Constructor < T > ) ( c ) ) ) ; } } throw new java . lang . RuntimeException ( ( ( ( "constructor<sp>with<sp>number<sp>of<sp>parameters=" + n ) + "<sp>not<sp>found<sp>in<sp>" ) + cls ) ) ; } } catch ( java . sql . SQLException e ) { throw new com . github . davidmoten . rx . jdbc . exceptions . SQLRuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( 1L , ( ( long ) ( ( java . lang . Long ) ( com . github . davidmoten . rx . jdbc . Util . autoMap ( 1 , com . github . davidmoten . rx . jdbc . Long . class ) ) ) ) ) |
testNull ( ) { "<AssertPlaceHolder>" ; } isValidModelPixelScale ( double [ ] ) { final double [ ] defaultValues = new double [ ] { 1 , 1 , 0 } ; return org . esa . beam . dataio . geotiff . Utils . isValidData ( modelTransformation , defaultValues ) ; } | org . junit . Assert . assertEquals ( false , org . esa . beam . dataio . geotiff . Utils . isValidModelPixelScale ( null ) ) |
testFocusControl_doesNotRenderBack ( ) { org . eclipse . rap . rwt . testfixture . internal . Fixture . markInitialized ( display ) ; org . eclipse . swt . widgets . Shell shell = new org . eclipse . swt . widgets . Shell ( display , org . eclipse . swt . SWT . NONE ) ; new org . eclipse . swt . widgets . Button ( shell , org . eclipse . swt . SWT . PUSH ) ; org . eclipse . swt . widgets . Control control = new org . eclipse . swt . widgets . Button ( shell , org . eclipse . swt . SWT . PUSH ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . fakeSetProperty ( getId ( display ) , "focusControl" , getId ( control ) ) ; org . eclipse . rap . rwt . testfixture . internal . Fixture . executeLifeCycleFromServerThread ( ) ; org . eclipse . rap . rwt . testfixture . internal . TestMessage message = org . eclipse . rap . rwt . testfixture . internal . Fixture . getProtocolMessage ( ) ; "<AssertPlaceHolder>" ; } findSetOperation ( java . lang . String , java . lang . String ) { org . eclipse . rap . rwt . internal . protocol . Operation . SetOperation result = null ; for ( org . eclipse . rap . rwt . internal . protocol . Operation operation : getOperations ( ) ) { if ( ( operation instanceof org . eclipse . rap . rwt . internal . protocol . Operation . SetOperation ) && ( operation . getTarget ( ) . equals ( target ) ) ) { org . eclipse . rap . rwt . internal . protocol . Operation . SetOperation setOperation = ( ( org . eclipse . rap . rwt . internal . protocol . Operation . SetOperation ) ( operation ) ) ; if ( ( property == null ) || ( ( setOperation . getProperties ( ) . get ( property ) ) != null ) ) { result = setOperation ; } } } return result ; } | org . junit . Assert . assertNull ( message . findSetOperation ( getId ( display ) , "focusControl" ) ) |
testNoError ( ) { boolean result = checkNoError ( "Social_Files_Get_My_Folders" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; } | org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result ) |
testCardinality ( ) { int size = 1033 ; edu . ucla . sspace . util . SparseDoubleArray arr = new edu . ucla . sspace . util . SparseDoubleArray ( ) ; for ( int i = 1 ; i < size ; ++ i ) { arr . set ( i , java . lang . Double . valueOf ( i ) ) ; "<AssertPlaceHolder>" ; } } cardinality ( ) { return indices . length ; } | org . junit . Assert . assertEquals ( i , arr . cardinality ( ) ) |
testReadWithPropLargerThanPredicate ( ) { org . gradoop . common . model . impl . properties . PropertyValue propertyValueVertexCount = org . gradoop . common . model . impl . properties . PropertyValue . create ( 3 ) ; org . gradoop . common . model . impl . properties . PropertyValue propertyValueSince = org . gradoop . common . model . impl . properties . PropertyValue . create ( 2014 ) ; org . gradoop . common . model . impl . properties . PropertyValue propertyValueAge = org . gradoop . common . model . impl . properties . PropertyValue . create ( 30 ) ; java . util . List < org . gradoop . common . model . impl . pojo . GraphHead > graphHeads = com . google . common . collect . Lists . newArrayList ( getSocialGraphHeads ( ) ) . stream ( ) . filter ( ( g ) -> g . hasProperty ( org . gradoop . storage . impl . hbase . io . PROP_VERTEX_COUNT ) ) . filter ( ( g ) -> ( g . getPropertyValue ( org . gradoop . storage . impl . hbase . io . PROP_VERTEX_COUNT ) . compareTo ( propertyValueVertexCount ) ) >= 0 ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < org . gradoop . common . model . impl . pojo . Edge > edges = com . google . common . collect . Lists . newArrayList ( getSocialEdges ( ) ) . stream ( ) . filter ( ( e ) -> e . hasProperty ( org . gradoop . storage . impl . hbase . io . PROP_SINCE ) ) . filter ( ( e ) -> ( e . getPropertyValue ( org . gradoop . storage . impl . hbase . io . PROP_SINCE ) . compareTo ( propertyValueSince ) ) > 0 ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . List < org . gradoop . common . model . impl . pojo . Vertex > vertices = com . google . common . collect . Lists . newArrayList ( getSocialVertices ( ) ) . stream ( ) . filter ( ( v ) -> v . hasProperty ( org . gradoop . storage . impl . hbase . io . PROP_AGE ) ) . filter ( ( v ) -> ( v . getPropertyValue ( org . gradoop . storage . impl . hbase . io . PROP_AGE ) . compareTo ( propertyValueAge ) ) > 0 ) . collect ( java . util . stream . Collectors . toList ( ) ) ; org . gradoop . storage . impl . hbase . io . HBaseDataSource hBaseDataSource = new org . gradoop . storage . impl . hbase . io . HBaseDataSource ( org . gradoop . storage . impl . hbase . io . HBaseDataSinkSourceTest . epgmStores [ storeIndex ] , getConfig ( ) ) ; hBaseDataSource = hBaseDataSource . applyGraphPredicate ( org . gradoop . storage . common . predicate . query . Query . elements ( ) . fromAll ( ) . where ( org . gradoop . storage . utils . HBaseFilters . propLargerThan ( org . gradoop . storage . impl . hbase . io . PROP_VERTEX_COUNT , propertyValueVertexCount , true ) ) ) ; hBaseDataSource = hBaseDataSource . applyEdgePredicate ( org . gradoop . storage . common . predicate . query . Query . elements ( ) . fromAll ( ) . where ( org . gradoop . storage . utils . HBaseFilters . propLargerThan ( org . gradoop . storage . impl . hbase . io . PROP_SINCE , propertyValueSince , false ) ) ) ; hBaseDataSource = hBaseDataSource . applyVertexPredicate ( org . gradoop . storage . common . predicate . query . Query . elements ( ) . fromAll ( ) . where ( org . gradoop . storage . utils . HBaseFilters . propLargerThan ( org . gradoop . storage . impl . hbase . io . PROP_AGE , propertyValueAge , false ) ) ) ; "<AssertPlaceHolder>" ; org . gradoop . flink . model . impl . epgm . GraphCollection graphCollection = hBaseDataSource . getGraphCollection ( ) ; java . util . Collection < org . gradoop . common . model . impl . pojo . GraphHead > loadedGraphHeads = graphCollection . getGraphHeads ( ) . collect ( ) ; java . util . Collection < org . gradoop . common . model . impl . pojo . Vertex > loadedVertices = graphCollection . getVertices ( ) . collect ( ) ; java . util . Collection < org . gradoop . common . model . impl . pojo . Edge > loadedEdges = graphCollection . getEdges ( ) . collect ( ) ; validateEPGMElementCollections ( graphHeads , loadedGraphHeads ) ; validateEPGMElementCollections ( vertices , loadedVertices ) ; validateEPGMGraphElementCollections ( vertices , loadedVertices ) ; validateEPGMElementCollections ( edges , loadedEdges ) ; validateEPGMGraphElementCollections ( edges , loadedEdges ) ; } isFilterPushedDown ( ) { return ( ( ( this . graphHeadQuery ) != null ) || ( ( this . vertexQuery ) != null ) ) || ( ( this . edgeQuery ) != null ) ; } | org . junit . Assert . assertTrue ( hBaseDataSource . isFilterPushedDown ( ) ) |
shouldFailIpCheckForIpWithTooManyPlayersOnline ( ) { org . bukkit . entity . Player player = fr . xephi . authme . process . login . AsynchronousLoginTest . mockPlayer ( "Ian" ) ; given ( commonService . getProperty ( RestrictionSettings . MAX_LOGIN_PER_IP ) ) . willReturn ( 2 ) ; given ( commonService . hasPermission ( player , PlayerStatePermission . ALLOW_MULTIPLE_ACCOUNTS ) ) . willReturn ( false ) ; mockOnlinePlayersInBukkitService ( ) ; boolean result = asynchronousLogin . hasReachedMaxLoggedInPlayersForIp ( player , "2.2.2.2" ) ; "<AssertPlaceHolder>" ; verify ( commonService ) . hasPermission ( player , PlayerStatePermission . ALLOW_MULTIPLE_ACCOUNTS ) ; verify ( bukkitService ) . getOnlinePlayers ( ) ; } hasReachedMaxLoggedInPlayersForIp ( org . bukkit . entity . Player , java . lang . String ) { if ( ( ( ( service . getProperty ( RestrictionSettings . MAX_LOGIN_PER_IP ) ) <= 0 ) || ( service . hasPermission ( player , PlayerStatePermission . ALLOW_MULTIPLE_ACCOUNTS ) ) ) || ( fr . xephi . authme . util . InternetProtocolUtils . isLoopbackAddress ( ip ) ) ) { return false ; } final java . lang . String name = player . getName ( ) ; int count = 0 ; for ( org . bukkit . entity . Player onlinePlayer : bukkitService . getOnlinePlayers ( ) ) { if ( ( ( ip . equalsIgnoreCase ( fr . xephi . authme . util . PlayerUtils . getPlayerIp ( onlinePlayer ) ) ) && ( ! ( onlinePlayer . getName ( ) . equals ( name ) ) ) ) && ( dataSource . isLogged ( onlinePlayer . getName ( ) . toLowerCase ( ) ) ) ) { ++ count ; } } return count >= ( service . getProperty ( RestrictionSettings . MAX_LOGIN_PER_IP ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( true ) ) |
test ( ) { int [ ] nums = new int [ ] { 4 , 14 , 2 } ; "<AssertPlaceHolder>" ; } totalHammingDistance ( int [ ] ) { int len = nums . length ; int [ ] countOfOnes = new int [ 32 ] ; for ( int i = 0 ; i < len ; i ++ ) { for ( int j = 0 ; j < 32 ; j ++ ) { countOfOnes [ j ] += ( ( nums [ i ] ) > > j ) & 1 ; } } int sum = 0 ; for ( int count : countOfOnes ) { sum += count * ( len - count ) ; } return sum ; } | org . junit . Assert . assertThat ( totalHammingDistance ( nums ) , org . hamcrest . Matchers . is ( 6 ) ) |
shouldSerizaliceAFullLoadedObjectToOriginalClass ( ) { java . lang . Object proxy = proxyFactory . createProxy ( author , new org . apache . ibatis . executor . loader . ResultLoaderMap ( ) , new org . apache . ibatis . session . Configuration ( ) , new org . apache . ibatis . reflection . factory . DefaultObjectFactory ( ) , new java . util . ArrayList < java . lang . Class < ? > > ( ) , new java . util . ArrayList < java . lang . Object > ( ) ) ; java . lang . Object proxy2 = deserialize ( serialize ( ( ( java . io . Serializable ) ( proxy ) ) ) ) ; "<AssertPlaceHolder>" ; } serialize ( java . io . Serializable ) { java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( bos ) ; oos . writeObject ( value ) ; oos . flush ( ) ; oos . close ( ) ; return bos . toByteArray ( ) ; } | org . junit . Assert . assertEquals ( author . getClass ( ) , proxy2 . getClass ( ) ) |
test8 ( ) { cc . redberry . rings . poly . MultivariateRing < cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > > ring = MultivariateRing ( 3 , cc . redberry . rings . poly . univar . Z ) ; cc . redberry . rings . io . Coder < cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > , ? , ? > coder = cc . redberry . rings . io . Coder . mkMultivariateCoder ( ring , "x" , "y" , "z" ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > a = coder . parse ( "(2*x<sp>+<sp>y<sp>+<sp>z)^11<sp>-<sp>1" ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > b = coder . parse ( "(x<sp>-<sp>3*y<sp>-<sp>z)^3<sp>+<sp>1" ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > > ua = a . asUnivariateEliminate ( 0 ) ; cc . redberry . rings . poly . univar . UnivariatePolynomial < cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > > ub = b . asUnivariateEliminate ( 0 ) ; for ( int i = 0 ; i < ( its ( 2 , 2 ) ) ; ++ i ) { long start ; start = java . lang . System . nanoTime ( ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > sr = SubresultantPRS ( ua , ub ) . resultant ( ) ; System . out . println ( ( "Subresultant<sp>PRS:<sp>" + ( cc . redberry . rings . util . TimeUnits . nanosecondsToString ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ) ) ) ; start = java . lang . System . nanoTime ( ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > rr = ReducedPRS ( ua , ub ) . resultant ( ) ; System . out . println ( ( "Reduced<sp>PRS:<sp>" + ( cc . redberry . rings . util . TimeUnits . nanosecondsToString ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ) ) ) ; System . out . println ( ) ; "<AssertPlaceHolder>" ; } } nanosecondsToString ( long ) { java . lang . String pf = "ns" ; if ( ( nano / 1000 ) > 1 ) { pf = "us" ; nano /= 1000 ; } if ( ( nano / 1000 ) > 1 ) { pf = "ms" ; nano /= 1000 ; } if ( ( nano / 1000 ) > 1 ) { pf = "s" ; nano /= 1000 ; } return nano + pf ; } | org . junit . Assert . assertEquals ( sr , rr ) |
shouldHandleStrangeClasspaths ( ) { org . infinitest . parser . ChangeDetector changeDetector = new org . infinitest . parser . FileChangeDetector ( ) ; changeDetector . setClasspathProvider ( new org . infinitest . parser . StandaloneClasspath ( new org . infinitest . parser . ArrayList < org . infinitest . parser . File > ( ) , "" ) ) ; "<AssertPlaceHolder>" ; } findChangedFiles ( ) { return findFiles ( classDirectories , false ) ; } | org . junit . Assert . assertTrue ( changeDetector . findChangedFiles ( ) . isEmpty ( ) ) |
testGemmStrides ( ) { final org . nd4j . linalg . api . ndarray . INDArray X = org . nd4j . linalg . factory . Nd4j . arange ( 20 ) . reshape ( 4 , 5 ) ; for ( int i = 0 ; i < 5 ; i ++ ) { final org . nd4j . linalg . api . ndarray . INDArray xi = X . get ( org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . point ( i ) ) ; lombok . val trans = xi . transpose ( ) ; final org . nd4j . linalg . api . ndarray . INDArray outerProduct = xi . mmul ( trans ) ; final org . nd4j . linalg . api . ndarray . INDArray outerProductDuped = xi . dup ( ) . mmul ( xi . transpose ( ) . dup ( ) ) ; "<AssertPlaceHolder>" ; } } dup ( ) { org . nd4j . linalg . api . ndarray . INDArray [ ] dupObservation = org . deeplearning4j . rl4j . learning . sync . Transition . dup ( observation ) ; org . nd4j . linalg . api . ndarray . INDArray nextObs = nextObservation . dup ( ) ; return new org . deeplearning4j . rl4j . learning . sync . Transition ( dupObservation , action , reward , isTerminal , nextObs ) ; } | org . junit . Assert . assertEquals ( outerProductDuped , outerProduct ) |
testBuscarPosicaoNegativa ( ) { br . com . senacrs . alp . aulas . MinhaLista < java . lang . String > obj = null ; obj = criarMinhaLista ( ) ; try { obj . buscar ( ( - 1 ) ) ; org . junit . Assert . fail ( java . lang . String . valueOf ( obj ) ) ; } catch ( java . lang . IndexOutOfBoundsException e ) { "<AssertPlaceHolder>" ; } } buscar ( int ) { return lista . get ( posicao ) ; } | org . junit . Assert . assertTrue ( true ) |
testInDateRangeBeforeMinDate ( ) { au . gov . ga . earthsci . core . temporal . BigTime t = new au . gov . ga . earthsci . core . temporal . BigTime ( java . math . BigInteger . valueOf ( Long . MIN_VALUE ) . multiply ( BigTime . NANOS_IN_MILLISECOND ) . subtract ( BigInteger . ONE ) ) ; "<AssertPlaceHolder>" ; } isInDateRange ( ) { return ( ( this . nansecondsSinceEpoch . compareTo ( au . gov . ga . earthsci . core . temporal . BigTime . EARLIEST_DATE_VALUE_IN_NANOS ) ) >= 0 ) && ( ( this . nansecondsSinceEpoch . compareTo ( au . gov . ga . earthsci . core . temporal . BigTime . LARGEST_DATE_VALUE_IN_NANOS ) ) <= 0 ) ; } | org . junit . Assert . assertFalse ( t . isInDateRange ( ) ) |
testAppendEscapedLuceneQuery ( ) { java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; java . lang . CharSequence text = "test<sp>encoding<sp>+<sp>-<sp>&<sp>|<sp>!<sp>(<sp>)<sp>{<sp>}<sp>[<sp>]<sp>^<sp>\"<sp>~<sp>*<sp>?<sp>:<sp>\\" ; java . lang . String expResult = "test<sp>encoding<sp>\\+<sp>\\-<sp>\\&<sp>\\|<sp>\\!<sp>\\(<sp>\\)<sp>\\{<sp>\\}<sp>\\[<sp>\\]<sp>\\^<sp>\\\"<sp>\\~<sp>\\*<sp>\\?<sp>\\:<sp>\\\\" ; org . owasp . dependencycheck . data . lucene . LuceneUtils . appendEscapedLuceneQuery ( buf , text ) ; "<AssertPlaceHolder>" ; } toString ( ) { return java . lang . String . format ( "new<sp>ArtifactScopeExcluded(%s,<sp>%s,<sp>%s,<sp>%s).passes(\"%s\")<sp>==<sp>%s;" , skipTestScope , skipProvidedScope , skipSystemScope , skipRuntimeScope , testString , expectedResult ) ; } | org . junit . Assert . assertEquals ( expResult , buf . toString ( ) ) |
testDeleteAttachments ( ) { org . eclipse . vorto . repository . core . IUserContext erle = org . eclipse . vorto . repository . core . impl . UserContext . user ( "erle" ) ; importModel ( "Color.type" , erle ) ; org . eclipse . vorto . model . ModelId modelId = new org . eclipse . vorto . model . ModelId ( "Color" , "org.eclipse.vorto.examples.type" , "1.0.0" ) ; modelRepository . attachFile ( modelId , new org . eclipse . vorto . repository . core . FileContent ( "backup1.xml" , org . apache . commons . io . IOUtils . toByteArray ( new org . springframework . core . io . ClassPathResource ( "sample_models/backup1.xml" ) . getInputStream ( ) ) ) , erle ) ; boolean deleteResult = modelRepository . deleteAttachment ( modelId , "backup1.xml" ) ; "<AssertPlaceHolder>" ; } deleteAttachment ( java . lang . String , java . lang . String ) { org . eclipse . vorto . model . ModelId modelIdObject = org . eclipse . vorto . model . ModelId . fromPrettyFormat ( modelId ) ; try { java . lang . String fileName = java . net . URLDecoder . decode ( filename , "UTF-8" ) ; if ( ! ( modelRepository . deleteAttachment ( modelIdObject , fileName ) ) ) { return new org . springframework . http . ResponseEntity ( org . springframework . http . HttpStatus . NOT_FOUND ) ; } return new org . springframework . http . ResponseEntity ( org . springframework . http . HttpStatus . OK ) ; } catch ( java . io . UnsupportedEncodingException e ) { return new org . springframework . http . ResponseEntity ( org . springframework . http . HttpStatus . NOT_FOUND ) ; } } | org . junit . Assert . assertTrue ( deleteResult ) |
getByCodeWithLowerCaseAlpha2CodeShouldReturnCountry ( ) { for ( org . iban4j . CountryCode code : org . iban4j . CountryCode . values ( ) ) { org . iban4j . CountryCode newCode = org . iban4j . CountryCode . getByCode ( code . getAlpha2 ( ) . toLowerCase ( ) ) ; "<AssertPlaceHolder>" ; } } getAlpha2 ( ) { return name ( ) ; } | org . junit . Assert . assertThat ( newCode , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( code ) ) ) |
createThingWithBridge ( ) { org . eclipse . smarthome . core . thing . ThingUID bridgeUID = new org . eclipse . smarthome . core . thing . ThingUID ( "binding:bridge:1" ) ; org . eclipse . smarthome . core . thing . type . ThingType thingType = org . eclipse . smarthome . core . thing . type . ThingTypeBuilder . instance ( "bindingId" , "thingTypeId" , "label" ) . build ( ) ; org . eclipse . smarthome . config . core . Configuration configuration = new org . eclipse . smarthome . config . core . Configuration ( ) ; org . eclipse . smarthome . core . thing . Thing thing = org . eclipse . smarthome . core . thing . binding . ThingFactory . createThing ( thingType , new org . eclipse . smarthome . core . thing . ThingUID ( thingType . getUID ( ) , "thingId" ) , configuration , bridgeUID ) ; "<AssertPlaceHolder>" ; } getBridgeUID ( ) { return this . bridgeUID ; } | org . junit . Assert . assertThat ( thing . getBridgeUID ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( bridgeUID ) ) ) |
testHandlerExecutor ( ) { org . webbitserver . stub . StubConnection target = new org . webbitserver . stub . StubConnection ( null ) ; java . util . concurrent . Executor actual = target . handlerExecutor ( ) ; "<AssertPlaceHolder>" ; } handlerExecutor ( ) { return this ; } | org . junit . Assert . assertEquals ( target , actual ) |
testGetUuidNull ( ) { com . adobe . cq . wcm . core . components . models . Image image = getImageUnderTest ( com . adobe . cq . wcm . core . components . internal . models . v2 . ImageImplTest . IMAGE22_PATH ) ; "<AssertPlaceHolder>" ; } getUuid ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertEquals ( null , image . getUuid ( ) ) |
testQueryUsersWithAccessToApplication ( ) { org . picketlink . idm . PartitionManager partitionManager = getPartitionManager ( ) ; org . picketlink . test . idm . identitymodel . saas . model . Realm acmeRealm = getAcmeRealm ( ) ; org . picketlink . idm . IdentityManager acmeIdentityManager = partitionManager . createIdentityManager ( acmeRealm ) ; org . picketlink . test . idm . identitymodel . saas . model . User user = new org . picketlink . test . idm . identitymodel . saas . model . User ( "mary" ) ; acmeIdentityManager . add ( user ) ; org . picketlink . idm . RelationshipManager relationshipManager = partitionManager . createRelationshipManager ( ) ; org . picketlink . test . idm . identitymodel . saas . model . Application salesApplication = getSalesApplication ( ) ; relationshipManager . add ( new org . picketlink . test . idm . identitymodel . saas . model . ApplicationAccess ( user , salesApplication ) ) ; org . picketlink . idm . query . RelationshipQuery < org . picketlink . test . idm . identitymodel . saas . model . ApplicationAccess > query = relationshipManager . createRelationshipQuery ( org . picketlink . test . idm . identitymodel . saas . model . ApplicationAccess . class ) ; query . setParameter ( ApplicationAccess . APPLICATION , salesApplication ) ; "<AssertPlaceHolder>" ; } getResultCount ( ) { int count = 0 ; java . util . Set < org . picketlink . idm . spi . IdentityStore < ? > > identityStores = this . storeSelector . getStoresForIdentityQuery ( this . context , this . getIdentityType ( ) ) ; for ( org . picketlink . idm . spi . IdentityStore < ? > store : identityStores ) { count = count + ( store . countQueryResults ( this . context , this ) ) ; } return count ; } | org . junit . Assert . assertEquals ( 1 , query . getResultCount ( ) ) |
testDirMoveAlreadyExists ( ) { java . nio . file . Path sourceDir = java . nio . file . Files . createDirectory ( root . resolve ( "sourceDir" ) ) ; java . nio . file . Files . createFile ( sourceDir . resolve ( "aFile" ) ) ; java . nio . file . Path targetDir = java . nio . file . Files . createDirectory ( root . resolve ( "targetDir" ) ) ; java . nio . file . Files . move ( sourceDir , targetDir , StandardCopyOption . REPLACE_EXISTING ) ; "<AssertPlaceHolder>" ; } resolve ( com . github . sbridges . ephemeralfs . EphemeralFsPath ) { return com . github . sbridges . ephemeralfs . ResolvedPath . resolve ( path , false ) ; } | org . junit . Assert . assertTrue ( java . nio . file . Files . exists ( targetDir . resolve ( "aFile" ) ) ) |
shouldValidateWhenEntity ( ) { final uk . gov . gchq . gaffer . data . element . Element element = new uk . gov . gchq . gaffer . data . element . Entity . Builder ( ) . group ( TestGroups . ENTITY ) . build ( ) ; final boolean valid = new uk . gov . gchq . gaffer . data . IsEntityValidator ( ) . validate ( element ) ; "<AssertPlaceHolder>" ; } validate ( uk . gov . gchq . gaffer . data . element . Edge ) { return ( ( ( ( null != edge ) && ( validateFlags ( edge ) ) ) && ( validatePreAggregationFilter ( edge ) ) ) && ( validatePostAggregationFilter ( edge ) ) ) && ( validatePostTransformFilter ( edge ) ) ; } | org . junit . Assert . assertTrue ( valid ) |
When_fluid_set_tag_Should_set_tag ( ) { class TestSystem extends com . artemis . BaseSystem { public com . artemis . managers . TagManager tagManager ; @ com . artemis . generator . strategy . e . Override protected void processSystem ( ) { com . artemis . Entity entity = com . artemis . E . E ( ) . tag ( "test" ) . entity ( ) ; "<AssertPlaceHolder>" ; } } runFluidWorld ( new TestSystem ( ) , new com . artemis . managers . TagManager ( ) ) ; } getTag ( int ) { return getTag ( world . getEntity ( entityId ) ) ; } | org . junit . Assert . assertEquals ( "test" , tagManager . getTag ( entity ) ) |
multiplyQuantityTest ( ) { tec . units . ri . quantity . ByteQuantity < javax . measure . quantity . ElectricResistance > quantity1 = new tec . units . ri . quantity . ByteQuantity ( java . lang . Byte . valueOf ( "3" ) . byteValue ( ) , tec . units . ri . unit . Units . OHM ) ; tec . units . ri . quantity . ByteQuantity < javax . measure . quantity . ElectricResistance > quantity2 = new tec . units . ri . quantity . ByteQuantity ( java . lang . Byte . valueOf ( "2" ) . byteValue ( ) , tec . units . ri . unit . Units . OHM ) ; javax . measure . Quantity < ? > result = quantity1 . multiply ( quantity2 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( 6 , result . getValue ( ) ) |
testSignaleerProcesNok ( ) { final org . jboss . soa . esb . message . Message message = org . mockito . Mockito . mock ( org . jboss . soa . esb . message . Message . class ) ; final org . jboss . soa . esb . message . Properties properties = org . mockito . Mockito . mock ( org . jboss . soa . esb . message . Properties . class ) ; final org . jboss . soa . esb . message . Body body = org . mockito . Mockito . mock ( org . jboss . soa . esb . message . Body . class ) ; org . mockito . Mockito . when ( message . getProperties ( ) ) . thenReturn ( properties ) ; org . mockito . Mockito . when ( properties . getProperty ( EsbConstants . PROPERTY_BERICHT ) ) . thenReturn ( 35L ) ; org . mockito . Mockito . when ( properties . getProperty ( EsbConstants . PROPERTY_CORRELATIE_ID ) ) . thenReturn ( "M00000000001" ) ; org . mockito . Mockito . when ( message . getBody ( ) ) . thenReturn ( body ) ; final nl . moderniseringgba . isc . esb . message . lo3 . impl . Ib01Bericht ib01Bericht = new nl . moderniseringgba . isc . esb . message . lo3 . impl . Ib01Bericht ( ) ; ib01Bericht . setLo3Persoonslijst ( nl . moderniseringgba . isc . esb . CorrelerenActionTest . maakLo3Persoonslijst ( ) ) ; org . mockito . Mockito . when ( message . getBody ( ) . get ( ) ) . thenReturn ( ib01Bericht ) ; org . mockito . Mockito . when ( processCorrelatieStore . zoekProcessCorrelatie ( "M00000000001" ) ) . thenReturn ( null ) ; final org . jboss . soa . esb . message . Message result = subject . process ( message ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( bpmFoutInvoker ) . deliverAsync ( message ) ; org . mockito . Mockito . verifyZeroInteractions ( bpmStartInvoker , bpmSignalInvoker ) ; } process ( nl . bzk . brp . levering . verzending . context . BerichtContext ) { nl . bzk . brp . levering . verzending . stappen . VerzendBRPStap . LOGGER . debug ( nl . bzk . brp . levering . verzending . stappen . VerzendBRPStap . VERZENDEN_IN_BRP_FORMAAT ) ; final long start = java . lang . System . currentTimeMillis ( ) ; final javax . xml . ws . Dispatch < javax . xml . transform . Source > webserviceClient = getCachedWebserviceClient ( berichtContext ) ; final nl . bzk . brp . model . operationeel . ber . BerichtModel berichtModel = berichtContext . getBerichtArchiefModel ( ) ; final java . util . Map < java . lang . String , java . lang . Object > requestContext = webserviceClient . getRequestContext ( ) ; requestContext . put ( ArchiveringBericht . BERICHT_ARCHIVERING_UIT_ID , berichtModel . getID ( ) ) ; final java . lang . String endpointUrl = berichtContext . getBrpAfleverURI ( ) ; requestContext . put ( BindingProvider . ENDPOINT_ADDRESS_PROPERTY , endpointUrl ) ; final nl . bzk . brp . model . internbericht . SynchronisatieBerichtGegevens berichtGegevens = berichtContext . getSynchronisatieBerichtGegevens ( ) ; final java . lang . String leveringBericht = berichtContext . getBerichtXML ( ) ; try { zetMDCMDCVeld ( berichtContext ) ; logSettings ( requestContext . entrySet ( ) ) ; if ( leveringBericht != null ) { nl . bzk . brp . levering . verzending . stappen . VerzendBRPStap . LOGGER . info ( nl . bzk . brp . levering . verzending . stappen . VerzendBRPStap . VERSTUUR_BERICHT_NAAR_ENDPOINT , endpointUrl ) ; final javax . xml . transform . Source request = new javax . xml . transform . stream . StreamSource ( new java . io . StringReader ( leveringBericht ) ) ; final java . lang . String tijdstipRegistratie = berichtGegevens . getAdministratieveHandelingTijdstipRegistratie ( ) . toString ( ) ; webserviceClient . invoke ( request ) ; nl . bzk . brp . levering . verzending . stappen . VerzendBRPStap . LOGGER . info ( "Bericht<sp>verstuurd<sp>naar<sp>endpoint<sp>'{}'<sp>voor<sp>administratieve<sp>handeling<sp>'{}'<sp>met<sp>tijdstip<sp>registratie<sp>{}" , endpointUrl , berichtGegevens . getAdministratieveHandelingId ( ) , tijdstipRegistratie ) ; nl . bzk . brp . logging . MDC . put ( MDCVeld . MDC_PERSONEN_GELEVERD , java . lang . String . valueOf ( berichtGegevens . getGeleverdePersoonsIds ( ) . size ( ) ) ) ; if ( ( berichtGegevens . getSoortDienst ( ) ) != null ) { nl . bzk . brp . logging . MDC . put ( MDCVeld . MDC_DIENST_CATEGORIE , berichtGegevens . getSoortDienst ( ) . getNaam ( ) ) ; } if ( ( berichtGegevens . getSoortSynchronisatie ( ) ) != null ) { nl . bzk . brp . logging . MDC . put ( MDCVeld . MDC_BERICHT_SOORT , berichtGegevens . getSoortSynchronisatie ( ) . getWaarde ( ) . getNaam ( ) ) ; } java . lang . String naamSynchronisatie = "" ; if ( ( berichtGegevens . getSoortSynchronisatie ( ) ) != null ) { naamSynchronisatie = berichtGegevens . getSoortSynchronisatie ( ) . getWaarde ( ) . getNaam ( ) ; } nl . bzk . brp . levering . verzending . stappen . VerzendBRPStap . LOGGER . info ( "Aantal<sp>geleverde<sp>personen<sp>in<sp>'{}'<sp>is<sp>[{}]" , naamSynchronisatie , berichtGegevens . getGeleverdePersoonsIds ( ) . size ( ) ) ; nl . bzk . brp . logging . MDC . remove ( MDCVeld . MDC_PERSONEN_GELEVERD ) ; nl . bzk . brp . logging . MDC . remove ( MDCVeld . MDC_BERICHT_SOORT ) ; berichtContext . getVerwerkContext ( ) . addVerzendTijd ( ( ( java . lang . System . currentTimeMillis ( ) ) - start ) ) ; } else { throw new nl . bzk . brp . levering . verzending . excepties . VerzendExceptie ( ( ( nl . bzk . brp . levering . verzending . | org . junit . Assert . assertSame ( message , result ) |
testInitializeFailureOnGetActiveRanges ( ) { org . apache . bookkeeper . clients . exceptions . ClientException cause = new org . apache . bookkeeper . clients . exceptions . ClientException ( "test-cause" ) ; when ( mockMetaRangeClient . getActiveDataRanges ( ) ) . thenReturn ( org . apache . bookkeeper . common . concurrent . FutureUtils . exception ( cause ) ) ; org . apache . bookkeeper . clients . impl . kv . PByteBufTableImpl table = new org . apache . bookkeeper . clients . impl . kv . PByteBufTableImpl ( runtime . getMethodName ( ) , streamProps , mockClientManager , scheduler . chooseThread ( 1 ) , org . apache . bookkeeper . clients . utils . ClientConstants . DEFAULT_INFINIT_BACKOFF_POLICY ) ; try { org . apache . bookkeeper . common . concurrent . FutureUtils . result ( table . initialize ( ) ) ; org . junit . Assert . fail ( ( "Should<sp>fail<sp>initializing<sp>the<sp>table<sp>with<sp>exception<sp>" + cause ) ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } fail ( java . lang . Throwable ) { closed = java . util . Optional . of ( exc ) ; for ( java . util . concurrent . CompletableFuture < org . apache . distributedlog . common . util . Permit > future : waitq ) { future . cancel ( true ) ; } waitq . clear ( ) ; } | org . junit . Assert . assertEquals ( cause , e ) |
testMaxRows ( ) { org . eclipse . birt . data . oda . pojo . querymodel . PojoQuery query = org . eclipse . birt . data . oda . pojo . testutil . PojoQueryCreator . createWithA1tonMap ( ) ; java . util . List < org . eclipse . birt . data . oda . pojo . input . pojos . Teacher > ts = org . eclipse . birt . data . oda . pojo . testutil . PojoInstancesUtil . createTeachers ( ) ; java . util . Map appContext = new java . util . HashMap ( ) ; appContext . put ( query . getAppContextKey ( ) , ts ) ; org . eclipse . birt . data . oda . pojo . impl . Connection conn = new org . eclipse . birt . data . oda . pojo . impl . Connection ( ) ; conn . open ( null ) ; org . eclipse . datatools . connectivity . oda . IQuery q = conn . newQuery ( null ) ; q . setAppContext ( appContext ) ; q . prepare ( org . eclipse . birt . data . oda . pojo . util . PojoQueryWriter . write ( query ) ) ; org . eclipse . birt . data . oda . pojo . impl . ResultSet rs = ( ( org . eclipse . birt . data . oda . pojo . impl . ResultSet ) ( q . executeQuery ( ) ) ) ; java . util . List < org . eclipse . birt . data . oda . pojo . input . pojos . TeacherStudent > studentCompound = org . eclipse . birt . data . oda . pojo . testutil . PojoInstancesUtil . getTeacherStudentCompound ( ts ) ; int maxRows = ( studentCompound . size ( ) ) - 2 ; rs . setMaxRows ( maxRows ) ; int rowCount = 0 ; while ( rs . next ( ) ) { rowCount ++ ; } "<AssertPlaceHolder>" ; rs . close ( ) ; } next ( ) { if ( ( entry ) == null ) { if ( beforeFirst ) { if ( first ( ) ) { return true ; } beforeFirst = false ; } return false ; } org . eclipse . birt . core . btree . LeafEntry < K , V > tgtEntry = getNextEntry ( entry ) ; if ( tgtEntry != null ) { btree . lockEntry ( tgtEntry ) ; btree . unlockEntry ( entry ) ; entry = tgtEntry ; return true ; } btree . unlockEntry ( entry ) ; entry = null ; beforeFirst = false ; return false ; } | org . junit . Assert . assertEquals ( maxRows , rowCount ) |
testVerifyWithInvalidKeyChooserFails ( ) { byte [ ] signature = signer . sign ( com . springcryptoutils . core . signature . SignerAndVerifierWithChoosersByAliasImplTest . keyStoreChooser , com . springcryptoutils . core . signature . SignerAndVerifierWithChoosersByAliasImplTest . privateKeyChooserByAlias , message ) ; "<AssertPlaceHolder>" ; verifier . verify ( com . springcryptoutils . core . signature . SignerAndVerifierWithChoosersByAliasImplTest . keyStoreChooser , com . springcryptoutils . core . signature . SignerAndVerifierWithChoosersByAliasImplTest . badPublicKeyChooserByAlias , message , signature ) ; } sign ( com . springcryptoutils . core . keystore . KeyStoreChooser , com . springcryptoutils . core . key . PrivateKeyChooserByAlias , byte [ ] ) { com . springcryptoutils . core . signature . Signer signer = cache . get ( com . springcryptoutils . core . signature . SignerWithChoosersByAliasImpl . cacheKey ( keyStoreChooser , privateKeyChooserByAlias ) ) ; if ( signer != null ) { return signer . sign ( message ) ; } com . springcryptoutils . core . signature . SignerImpl signerImpl = new com . springcryptoutils . core . signature . SignerImpl ( ) ; signerImpl . setAlgorithm ( algorithm ) ; signerImpl . setProvider ( provider ) ; java . security . PrivateKey privateKey = privateKeyRegistryByAlias . get ( keyStoreChooser , privateKeyChooserByAlias ) ; if ( privateKey == null ) { throw new com . springcryptoutils . core . signature . SignatureException ( ( ( ( "private<sp>key<sp>not<sp>found<sp>in<sp>registry:<sp>keyStoreName=" + ( keyStoreChooser . getKeyStoreName ( ) ) ) + ",<sp>alias=" ) + ( privateKeyChooserByAlias . getAlias ( ) ) ) ) ; } signerImpl . setPrivateKey ( privateKey ) ; cache . put ( com . springcryptoutils . core . signature . SignerWithChoosersByAliasImpl . cacheKey ( keyStoreChooser , privateKeyChooserByAlias ) , signerImpl ) ; return signerImpl . sign ( message ) ; } | org . junit . Assert . assertNotNull ( signature ) |
checkIsNetcoolTrue ( ) { "<AssertPlaceHolder>" ; } checkIsNetcool ( java . lang . String ) { return dbType . equalsIgnoreCase ( io . cloudslang . content . database . utils . NETCOOL_DB_TYPE ) ; } | org . junit . Assert . assertTrue ( checkIsNetcool ( io . cloudslang . content . database . utils . NETCOOL_DB_TYPE ) ) |
simple ( ) { com . asakusafw . workflow . model . basic . BasicJobflowInfo jobflow = new com . asakusafw . workflow . model . basic . BasicJobflowInfo ( context . getFlowId ( ) ) ; jobflow . addTask ( TaskInfo . Phase . MAIN , new com . asakusafw . workflow . executor . MockTaskInfo ( "A" ) ) ; com . asakusafw . workflow . executor . MockExecutor e0 = new com . asakusafw . workflow . executor . MockExecutor ( ( t ) -> true ) ; com . asakusafw . workflow . executor . JobflowExecutor executor = new com . asakusafw . workflow . executor . basic . BasicJobflowExecutor ( e0 ) ; executor . execute ( context , jobflow ) ; "<AssertPlaceHolder>" ; } getValues ( ) { return values ; } | org . junit . Assert . assertThat ( e0 . getValues ( ) , contains ( "A" ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.