input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
getMaximumLatency ( ) { org . gstreamer . query . LatencyQuery query = new org . gstreamer . query . LatencyQuery ( ) ; final org . gstreamer . ClockTime MAX = org . gstreamer . ClockTime . fromMillis ( 123000 ) ; query . setLatency ( false , ClockTime . ZERO , MAX ) ; "<AssertPlaceHolder>" ; } getMaximumLatency ( ) { org . gstreamer . query . LatencyQuery query = new org . gstreamer . query . LatencyQuery ( ) ; final org . gstreamer . ClockTime MAX = org . gstreamer . ClockTime . fromMillis ( 123000 ) ; query . setLatency ( false , ClockTime . ZERO , MAX ) ; org . junit . Assert . assertEquals ( "Min<sp>latency<sp>not<sp>set" , MAX , query . getMaximumLatency ( ) ) ; } | org . junit . Assert . assertEquals ( "Min<sp>latency<sp>not<sp>set" , MAX , query . getMaximumLatency ( ) ) |
packageHasAssetsInsideTestSrcPathTest ( ) { doReturn ( false ) . when ( helper ) . hasAssets ( srcPath ) ; doReturn ( false ) . when ( helper ) . hasAssets ( srcResourcesPath ) ; doReturn ( true ) . when ( helper ) . hasAssets ( srcTestPath ) ; doReturn ( false ) . when ( helper ) . hasAssets ( testResourcesPath ) ; doReturn ( new java . util . HashSet < org . guvnor . common . services . project . model . Package > ( ) { { add ( childPkg ) ; } } ) . when ( moduleService ) . resolvePackages ( pkg ) ; doReturn ( false ) . when ( helper ) . hasAssets ( childPkg ) ; "<AssertPlaceHolder>" ; } hasAssets ( org . uberfire . backend . vfs . Path ) { final org . uberfire . java . nio . file . Path nioPackagePath = org . uberfire . backend . server . util . Paths . convert ( packagePath ) ; if ( org . uberfire . java . nio . file . Files . exists ( nioPackagePath ) ) { final org . uberfire . java . nio . file . DirectoryStream < org . uberfire . java . nio . file . Path > nioPaths = ioService . newDirectoryStream ( nioPackagePath , regularFileFilter ) ; for ( org . uberfire . java . nio . file . Path nioPath : nioPaths ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( helper . hasAssets ( pkg ) ) |
testApiMisuse18 ( ) { "<AssertPlaceHolder>" ; } getUnit ( java . lang . Class ) { if ( unitType == null ) return null ; for ( org . ocpsoft . prettytime . TimeUnit unit : units . keySet ( ) ) { if ( unitType . isAssignableFrom ( unit . getClass ( ) ) ) { return ( ( UNIT ) ( unit ) ) ; } } return null ; } | org . junit . Assert . assertNull ( t . getUnit ( null ) ) |
testComplexGlobalFunctionWithShortEvalOnJoin ( ) { java . lang . String str = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "package<sp>org.mypkg;" + ",<sp>(short)40})<sp>)<sp>)\n" 0 ) + ( org . drools . modelcompiler . GlobalTest . Family . class . getCanonicalName ( ) ) ) + ";" ) + ",<sp>(short)40})<sp>)<sp>)\n" 0 ) + ( org . drools . modelcompiler . domain . Person . class . getCanonicalName ( ) ) ) + ";" ) + ",<sp>(short)40})<sp>)<sp>)\n" 0 ) + ( org . drools . modelcompiler . GlobalTest . Functions . class . getCanonicalName ( ) ) ) + ";" ) + "global<sp>Functions<sp>functions;" ) + "rule<sp>X<sp>when\n" ) + ",<sp>(short)40})<sp>)<sp>)\n" 1 ) + "<sp>$s<sp>:<sp>String(<sp>eval(<sp>true<sp>==<sp>functions.arrayContainsInstanceWithParameters((Object[])$f.getPersons(),\n" ) + "<sp>new<sp>Object[]{\"getAgeAsShort\",<sp>(short)40})<sp>)<sp>)\n" ) + "then\n" ) + "end" ; org . kie . api . runtime . KieSession ksession = getKieSession ( str ) ; ksession . setGlobal ( ",<sp>(short)40})<sp>)<sp>)\n" 2 , new org . drools . modelcompiler . GlobalTest . Functions ( ) ) ; ksession . insert ( new org . drools . modelcompiler . GlobalTest . Family ( ) ) ; ksession . insert ( "test" ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 1 , ksession . fireAllRules ( ) ) |
testCompareToZeroPos ( ) { byte [ ] bBytes = new byte [ ] { 12 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 , - 15 , 35 , 26 , 3 , 91 } ; int bSign = 1 ; java . math . BigInteger aNumber = java . math . BigInteger . ZERO ; java . math . BigInteger bNumber = new java . math . BigInteger ( bSign , bBytes ) ; "<AssertPlaceHolder>" ; } compareTo ( org . teavm . classlib . java . lang . TBoolean ) { return org . teavm . classlib . java . lang . TBoolean . compare ( value , other . value ) ; } | org . junit . Assert . assertEquals ( ( - 1 ) , aNumber . compareTo ( bNumber ) ) |
createLocalCacheStorageWithAbsolutePath ( ) { java . nio . file . Path absPath = filesystem . getBuckPaths ( ) . getBuckOut ( ) . resolve ( "/foo/bar" ) . toAbsolutePath ( ) ; com . facebook . buck . parser . cache . impl . LocalCacheStorage . of ( getParserCacheConfig ( true , absPath ) , filesystem ) ; "<AssertPlaceHolder>" ; } exists ( java . nio . file . Path ) { return ( data . containsKey ( path ) ) || ( dirs . contains ( path ) ) ; } | org . junit . Assert . assertTrue ( filesystem . exists ( filesystem . getPath ( "/foo/bar" ) ) ) |
onCreationWithDbResult_whenGreenplumVersionIsBelowSix_thenExecutionLocationIsNull ( ) { withGreenplumVersionLessThan6 ( ( ) -> { org . jkiss . dbeaver . ext . greenplum . model . GreenplumFunction function = new org . jkiss . dbeaver . ext . greenplum . model . GreenplumFunction ( mockMonitor , mockSchema , mockResults ) ; "<AssertPlaceHolder>" ; } ) ; org . mockito . Mockito . verify ( mockResults , org . mockito . Mockito . times ( 0 ) ) . getString ( "proexeclocation" ) ; } getExecutionLocation ( ) { return executionLocation ; } | org . junit . Assert . assertNull ( function . getExecutionLocation ( ) ) |
testSet_IMolecule_IMolecule ( ) { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer target = sp . parseSmiles ( "C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C" ) ; org . openscience . cdk . interfaces . IAtomContainer query = sp . parseSmiles ( "Nc1ccccc1" ) ; org . openscience . smsd . Isomorphism smsd1 = new org . openscience . smsd . Isomorphism ( query , target , org . openscience . smsd . interfaces . Algorithm . DEFAULT , true , false , false ) ; smsd1 . setChemFilters ( true , true , true ) ; "<AssertPlaceHolder>" ; } getFirstAtomMapping ( ) { if ( allAtomMCS . iterator ( ) . hasNext ( ) ) { return allAtomMCS . iterator ( ) . next ( ) ; } return new org . openscience . smsd . AtomAtomMapping ( source , target ) ; } | org . junit . Assert . assertNotNull ( smsd1 . getFirstAtomMapping ( ) ) |
check_contextKey_failed ( ) { com . alibaba . citrus . turbine . util . CsrfToken . setContextTokenConfiguration ( "contextKey" , ( - 1 ) ) ; expect ( request . getParameter ( "contextKey" ) ) . andReturn ( null ) ; replay ( request ) ; "<AssertPlaceHolder>" ; com . alibaba . citrus . turbine . util . CsrfToken . resetContextTokenConfiguration ( ) ; verify ( request ) ; } check ( javax . servlet . http . HttpServletRequest ) { java . lang . String key = com . alibaba . citrus . turbine . util . CsrfToken . getKey ( ) ; java . lang . String fromRequest = trimToNull ( request . getParameter ( key ) ) ; return fromRequest != null ; } | org . junit . Assert . assertFalse ( com . alibaba . citrus . turbine . util . CsrfToken . check ( request ) ) |
testSimpleOk ( ) { com . lrn . nettymysqlprotocol . protocol . impl . InitialHandshakePacket initialHandshake = new com . lrn . nettymysqlprotocol . protocol . impl . InitialHandshakePacket ( ) ; capabilities . setCapabilities ( - 2139097089 ) ; serverStatus . setStatus ( 2 ) ; System . out . println ( capabilities . toPrettyString ( true ) ) ; System . out . println ( serverStatus . toPrettyString ( false ) ) ; initialHandshake . setSequenceNumber ( 0 ) ; initialHandshake . setProtocolVersion ( 10 ) ; initialHandshake . setConnectionId ( 11 ) ; initialHandshake . setServerName ( InitialHandshakePacketTest . FAKE_MY_SQL_SERVER_VERSION ) ; initialHandshake . setAuthPluginName ( "mysql_native_password" ) ; initialHandshake . setScramble ( "e'1^hnqkHc<@jx=c])Q>" . getBytes ( ) ) ; initialHandshake . setCharacterSet ( MysqlConstants . CharsetConstants . LATIN1_SWEDISH_CI ) ; initialHandshake . setCapabilities ( capabilities ) ; initialHandshake . setStatus ( serverStatus ) ; io . netty . buffer . ByteBuf buffer = io . netty . buffer . Unpooled . buffer ( ) ; transcoder . encode ( initialHandshake , buffer ) ; java . lang . String expected = "5b0000000a352e362e32382d30756275" + ( ( ( ( "6e7475302e31352e30342e31000b0000" + "006527315e686e716b00fff70802007f" ) + "80150000000000000000000048633c40" ) + "6a783d635d29513e006d7973716c5f6e" ) + "61746976655f70617373776f726400" ) ; java . lang . String hexBuf = io . netty . buffer . ByteBufUtil . hexDump ( buffer ) ; "<AssertPlaceHolder>" ; } setStatus ( com . lrn . nettymysqlprotocol . protocol . ServerStatusEnum [ ] ) { this . status = status ; } | org . junit . Assert . assertEquals ( expected . toLowerCase ( ) , hexBuf . toLowerCase ( ) ) |
testGetLocalPort ( io . vertx . core . net . SocketAddress ) { new mockit . Expectations ( ) { { sa . port ( ) ; result = 1234 ; vertxRequest . localAddress ( ) ; result = sa ; } } ; "<AssertPlaceHolder>" ; } getLocalPort ( ) { return this . vertxRequest . localAddress ( ) . port ( ) ; } | org . junit . Assert . assertEquals ( 1234 , request . getLocalPort ( ) ) |
testBuildWithDisabledSecurityConstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . person . language . PersonLanguage context = new org . lnu . is . domain . person . language . PersonLanguage ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>PersonLanguage<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . person . language . PersonLanguage > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
empty ( ) { "<AssertPlaceHolder>" ; } of ( ) { org . junit . Assert . assertEquals ( new com . spotify . heroic . common . FeatureSet ( com . google . common . collect . ImmutableSet . of ( Feature . DISTRIBUTED_AGGREGATIONS ) , com . google . common . collect . ImmutableSet . of ( ) ) , com . spotify . heroic . common . FeatureSet . of ( Feature . DISTRIBUTED_AGGREGATIONS ) ) ; } | org . junit . Assert . assertEquals ( new com . spotify . heroic . common . FeatureSet ( com . google . common . collect . ImmutableSet . of ( ) , com . google . common . collect . ImmutableSet . of ( ) ) , com . spotify . heroic . common . FeatureSet . empty ( ) ) |
testMain ( ) { fr . inria . corese . core . GraphStore gs = fr . inria . corese . core . GraphStore . create ( ) ; fr . inria . corese . core . query . QueryProcess exec = fr . inria . corese . core . query . QueryProcess . create ( gs ) ; java . lang . String i = "insert<sp>data<sp>{" + ( "kg:display(?x);<sp>kg:display(?s);" 1 + "}" ) ; java . lang . String q = "kg:display(?x);<sp>kg:display(?s);" 0 + ( ( ( ( ( ( ( ( ( "us:test()" + "}" ) + "function<sp>us:test(){" ) + "let<sp>(select<sp>?x<sp>(us:surface(?x)<sp>as<sp>?s)<sp>where<sp>{?x<sp>a<sp>?t}<sp>)<sp>{" ) + "?s" ) + "}}" ) + "function<sp>us:surface(?x){" ) + "let<sp>(select<sp>*<sp>where<sp>{?x<sp>us:length<sp>?l<sp>;<sp>us:width<sp>?w<sp>}){" ) + "kg:display(?x);<sp>kg:display(?s);" 2 ) + "}" ) ; exec . query ( i ) ; gs . init ( ) ; fr . inria . corese . sparql . api . IDatatype dt = exec . eval ( q ) ; "<AssertPlaceHolder>" ; } intValue ( ) { return ( ( int ) ( lvalue ) ) ; } | org . junit . Assert . assertEquals ( 6 , dt . intValue ( ) ) |
toWorkTest ( ) { org . orcid . pojo . ajaxForm . WorkForm form = getWorkForm ( ) ; org . orcid . jaxb . model . v3 . rc2 . record . Work work = form . toWork ( ) ; "<AssertPlaceHolder>" ; } getWork ( ) { return work ; } | org . junit . Assert . assertEquals ( getWork ( ) , work ) |
testGetOrElse_IndexCheck_Valid ( ) { org . la4j . matrix . SparseMatrix a = m ( org . la4j . matrix . sparse . SparseMatrixTest . a ( 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ) , org . la4j . matrix . sparse . SparseMatrixTest . a ( 0.0 , 0.0 , 3.0 , 0.0 , 0.0 ) ) ; "<AssertPlaceHolder>" ; } getOrElse ( int , int , double ) { ensureIndexesAreInBounds ( i , j ) ; int k = searchForRowIndex ( i , columnPointers [ j ] , columnPointers [ ( j + 1 ) ] ) ; if ( ( k < ( columnPointers [ ( j + 1 ) ] ) ) && ( ( rowIndices [ k ] ) == i ) ) { return values [ k ] ; } return defaultValue ; } | org . junit . Assert . assertEquals ( 0.0 , a . getOrElse ( 1 , 1 , 0.0 ) , 0.0 ) |
testAcceptWithMatchingInclusionPattern ( ) { com . codeaffine . osgi . testuite . internal . ClassnameFilter filter = new com . codeaffine . osgi . testuite . internal . ClassnameFilter ( ".*Foo" ) ; boolean actual = filter . accept ( "com.codeaffine.Foo" ) ; "<AssertPlaceHolder>" ; } accept ( java . lang . String ) { boolean result = false ; if ( ( ! ( matchesNegationFilters ( className ) ) ) && ( matchesPositiveFilters ( className ) ) ) { result = true ; } return result ; } | org . junit . Assert . assertTrue ( actual ) |
connectionTimeout ( ) { final io . trane . ndbc . Config c = io . trane . ndbc . Config . create ( dataSourceSupplierClass , host , port , user ) ; final java . time . Duration connectionTimeout = java . time . Duration . ofSeconds ( 100 ) ; "<AssertPlaceHolder>" ; } connectionTimeout ( java . time . Duration ) { return connectionTimeout ( java . util . Optional . of ( connectionTimeout ) ) ; } | org . junit . Assert . assertEquals ( java . util . Optional . of ( connectionTimeout ) , c . connectionTimeout ( connectionTimeout ) . connectionTimeout ( ) ) |
whenDumpACustomType_thenGenerateCorrectYAML ( ) { com . baeldung . snakeyaml . Customer customer = new com . baeldung . snakeyaml . Customer ( ) ; customer . setAge ( 45 ) ; customer . setFirstName ( "Greg" ) ; customer . setLastName ( "McDowell" ) ; org . yaml . snakeyaml . Yaml yaml = new org . yaml . snakeyaml . Yaml ( ) ; java . io . StringWriter writer = new java . io . StringWriter ( ) ; yaml . dump ( customer , writer ) ; java . lang . String expectedYaml = "!!com.baeldung.snakeyaml.Customer<sp>{age:<sp>45,<sp>contactDetails:<sp>null,<sp>firstName:<sp>Greg,\n<sp>homeAddress:<sp>null,<sp>lastName:<sp>McDowell}\n" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( "Movie<sp>[imdbId=" + ( imdbId ) ) + ",<sp>director=" ) + ( director ) ) + ",<sp>actors=" ) + ( actors ) ) + "]" ; } | org . junit . Assert . assertEquals ( expectedYaml , writer . toString ( ) ) |
testIsolation ( ) { com . gargoylesoftware . htmlunit . WebClient client = new com . gargoylesoftware . htmlunit . WebClient ( ) ; java . lang . String result1 = client . getPage ( ( ( contextPath1 ) + "servlet1" ) ) . getWebResponse ( ) . getContentAsString ( ) ; java . lang . String result2 = client . getPage ( ( ( contextPath2 ) + "servlet2" ) ) . getWebResponse ( ) . getContentAsString ( ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( other instanceof org . jboss . weld . module . web . el . Namespace ) { org . jboss . weld . module . web . el . Namespace that = ( ( org . jboss . weld . module . web . el . Namespace ) ( other ) ) ; return this . getQualifiedName ( ) . equals ( that . getQualifiedName ( ) ) ; } else { return false ; } } | org . junit . Assert . assertFalse ( result1 . equals ( result2 ) ) |
testEffect6 ( ) { java . lang . String words = segW . segWords ( "" , "|" ) ; "<AssertPlaceHolder>" ; } segWords ( java . lang . String , java . lang . String ) { return segWords ( new java . io . StringReader ( txt ) , wordSpilt ) ; } | org . junit . Assert . assertEquals ( "|" , words ) |
testProxyingUtils ( ) { org . jboss . capedwarf . jpa . ProxyingFactory factory = new org . jboss . capedwarf . jpa . ProxyingEntityManagerFactory ( new org . jboss . test . capedwarf . jpa . support . MockEMF ( ) ) ; org . jboss . capedwarf . jpa . ProxyingUtils . disable ( ) ; try { org . jboss . test . capedwarf . jpa . support . Food food = factory . createProxy ( org . jboss . test . capedwarf . jpa . support . Food . class ) ; "<AssertPlaceHolder>" ; } finally { org . jboss . capedwarf . jpa . ProxyingUtils . enable ( ) ; } } isProxy ( org . jboss . capedwarf . jpa . Entity ) { return factory . isProxy ( entity ) ; } | org . junit . Assert . assertFalse ( factory . isProxy ( food ) ) |
isPathHelperConstructorWorking ( ) { final java . lang . reflect . Constructor < com . uaihebert . uaicriteria . path . PathHelper > constructor = com . uaihebert . uaicriteria . path . PathHelper . class . getDeclaredConstructor ( new java . lang . Class [ 0 ] ) ; constructor . setAccessible ( true ) ; final com . uaihebert . uaicriteria . path . PathHelper object = constructor . newInstance ( new java . lang . Object [ 0 ] ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( object ) |
inotTest2 ( ) { final short [ ] content = new short [ ] { 1 , 3 , 5 , 7 , 9 } ; org . roaringbitmap . Container c = org . roaringbitmap . TestContainer . makeContainer ( content ) ; c = c . inot ( 0 , 65535 ) ; c = c . inot ( 0 , 65535 ) ; "<AssertPlaceHolder>" ; } checkContent ( org . roaringbitmap . Container , short [ ] ) { org . roaringbitmap . ShortIterator si = c . getShortIterator ( ) ; int ctr = 0 ; boolean fail = false ; while ( si . hasNext ( ) ) { if ( ctr == ( s . length ) ) { fail = true ; break ; } if ( ( si . next ( ) ) != ( s [ ctr ] ) ) { fail = true ; break ; } ++ ctr ; } if ( ctr != ( s . length ) ) { fail = true ; } if ( fail ) { System . out . print ( "fail,<sp>found<sp>" ) ; si = c . getShortIterator ( ) ; while ( si . hasNext ( ) ) { System . out . print ( ( "<sp>" + ( si . next ( ) ) ) ) ; } System . out . print ( "\n<sp>expected<sp>" ) ; for ( final short s1 : s ) { System . out . print ( ( "<sp>" + s1 ) ) ; } System . out . println ( ) ; } return ! fail ; } | org . junit . Assert . assertTrue ( org . roaringbitmap . TestContainer . checkContent ( c , content ) ) |
testOperatorConstructorWithProperValueReturnsCorrectValue ( ) { org . dspace . app . rest . model . SearchConfigurationRest . Filter . Operator operator = new org . dspace . app . rest . model . SearchConfigurationRest . Filter . Operator ( "operator" ) ; "<AssertPlaceHolder>" ; } getOperator ( ) { if ( ( operator ) == ( org . dspace . xoai . filter . data . DSpaceMetadataFilterOperator . UNDEF ) ) { operator = org . dspace . xoai . filter . data . DSpaceMetadataFilterOperator . valueOf ( getConfiguration ( ) . get ( "operator" ) . asSimpleType ( ) . asString ( ) . toUpperCase ( ) ) ; } return operator ; } | org . junit . Assert . assertEquals ( "operator" , operator . getOperator ( ) ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . workflow . kaleo . model . KaleoTask > kaleoTasks = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( kaleoTasks . isEmpty ( ) ) |
testHandleCompose ( ) { final java . util . concurrent . CompletionStage < java . lang . String > future = com . spotify . futures . CompletableFuturesExtra . exceptionallyCompletedFuture ( new java . lang . IllegalArgumentException ( ) ) ; final java . util . concurrent . CompletionStage < java . lang . String > composed = com . spotify . futures . CompletableFuturesExtra . handleCompose ( future , ( s , throwable ) -> java . util . concurrent . CompletableFuture . completedFuture ( "hello" ) ) ; "<AssertPlaceHolder>" ; } getCompleted ( java . util . concurrent . CompletionStage ) { java . util . concurrent . CompletableFuture < T > future = stage . toCompletableFuture ( ) ; com . spotify . futures . CompletableFuturesExtra . checkCompleted ( future ) ; return future . join ( ) ; } | org . junit . Assert . assertEquals ( "hello" , com . spotify . futures . CompletableFuturesExtra . getCompleted ( composed ) ) |
testRun_2 ( ) { org . apache . hadoop . conf . Configuration conf = org . trend . hgraph . util . test . TEST_UTIL . getConfiguration ( ) ; conf . set ( HBaseGraphConstants . HBASE_GRAPH_TABLE_VERTEX_NAME_KEY , org . trend . hgraph . util . test . GetGeneratedGraphDataTest . TEST_VERTEX_2 ) ; conf . set ( HBaseGraphConstants . HBASE_GRAPH_TABLE_EDGE_NAME_KEY , org . trend . hgraph . util . test . GetGeneratedGraphDataTest . TEST_EDGE_2 ) ; org . trend . hgraph . util . test . GenerateTestData genTestData = new org . trend . hgraph . util . test . GenerateTestData ( ) ; genTestData . setConf ( conf ) ; genTestData . run ( new java . lang . String [ ] { "-v" , "100" , "-d" , "-ev" , "1,2,3,4,5" , "-p" , "0.2,0.2,0.2,0.2,0.2" , org . trend . hgraph . util . test . GetGeneratedGraphDataTest . TEST_VERTEX_2 , org . trend . hgraph . util . test . GetGeneratedGraphDataTest . TEST_EDGE_2 } ) ; java . util . List < java . lang . String > firstVertices = genTestData . getFirstVertices ( ) ; "<AssertPlaceHolder>" ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; for ( java . lang . String rowKey : firstVertices ) { if ( ( sb . length ( ) ) == 0 ) { sb . append ( rowKey ) ; } else { sb . append ( ( "," + rowKey ) ) ; } } org . trend . hgraph . util . test . GetGeneratedGraphData getData = new org . trend . hgraph . util . test . GetGeneratedGraphData ( ) ; getData . setConf ( conf ) ; getData . run ( new java . lang . String [ ] { "-i" , sb . toString ( ) , org . trend . hgraph . util . test . GetGeneratedGraphDataTest . TEST_VERTEX_2 , org . trend . hgraph . util . test . GetGeneratedGraphDataTest . TEST_EDGE_2 } ) ; } getFirstVertices ( ) { return firstVertices ; } | org . junit . Assert . assertEquals ( 5 , firstVertices . size ( ) ) |
testReadMissingChunkSizeOnly ( ) { final com . allanbank . mongodb . bson . builder . DocumentBuilder fileResult = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; fileResult . addString ( "_id" , "id" ) . add ( GridFs . LENGTH_FIELD , 4 ) ; final com . allanbank . mongodb . bson . builder . DocumentBuilder chunkResult = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; chunkResult . addBinary ( "data" , new byte [ ] { 1 , 2 , 3 , 4 } ) . add ( GridFs . CHUNK_NUMBER_FIELD , 0 ) ; final com . allanbank . mongodb . MongoDatabase mockDb = createMock ( com . allanbank . mongodb . MongoDatabase . class ) ; final com . allanbank . mongodb . MongoCollection mockFiles = createMock ( com . allanbank . mongodb . MongoCollection . class ) ; final com . allanbank . mongodb . MongoCollection mockChunks = createMock ( com . allanbank . mongodb . MongoCollection . class ) ; final com . allanbank . mongodb . MongoIterator < com . allanbank . mongodb . bson . Document > mockIterator = createMock ( com . allanbank . mongodb . MongoIterator . class ) ; expect ( mockDb . getCollection ( ( "fs" + ( GridFs . FILES_SUFFIX ) ) ) ) . andReturn ( mockFiles ) ; expect ( mockDb . getCollection ( ( "fs" + ( GridFs . CHUNKS_SUFFIX ) ) ) ) . andReturn ( mockChunks ) ; expect ( mockFiles . findOne ( anyObject ( com . allanbank . mongodb . bson . DocumentAssignable . class ) ) ) . andReturn ( fileResult . build ( ) ) ; expect ( mockChunks . find ( anyObject ( com . allanbank . mongodb . builder . Find . class ) ) ) . andReturn ( mockIterator ) ; expect ( mockIterator . iterator ( ) ) . andReturn ( mockIterator ) ; expect ( mockIterator . hasNext ( ) ) . andReturn ( Boolean . TRUE ) ; expect ( mockIterator . next ( ) ) . andReturn ( chunkResult . build ( ) ) ; expect ( mockIterator . hasNext ( ) ) . andReturn ( Boolean . FALSE ) ; mockIterator . close ( ) ; expectLastCall ( ) ; replay ( mockDb , mockFiles , mockChunks , mockIterator ) ; final com . allanbank . mongodb . gridfs . GridFs fs = new com . allanbank . mongodb . gridfs . GridFs ( mockDb ) ; final java . io . ByteArrayOutputStream sink = new java . io . ByteArrayOutputStream ( 4 ) ; fs . read ( "foo" , sink ) ; "<AssertPlaceHolder>" ; verify ( mockDb , mockFiles , mockChunks , mockIterator ) ; } read ( com . allanbank . mongodb . bson . element . ObjectId , java . io . OutputStream ) { final com . allanbank . mongodb . bson . Document fileDoc = myFilesCollection . findOne ( where ( com . allanbank . mongodb . gridfs . GridFs . ID_FIELD ) . equals ( id ) ) ; if ( fileDoc == null ) { throw new java . io . FileNotFoundException ( id . toString ( ) ) ; } doRead ( fileDoc , sink ) ; } | org . junit . Assert . assertArrayEquals ( new byte [ ] { 1 , 2 , 3 , 4 } , sink . toByteArray ( ) ) |
saveAndGetSynonym ( ) { java . util . List < java . lang . String > a = new java . util . ArrayList < java . lang . String > ( ) ; a . add ( "San<sp>Francisco" ) ; a . add ( "SF" ) ; org . json . JSONObject res = index . saveSynonym ( "synonym1" , new org . json . JSONObject ( ) . put ( "type" , "synonym" ) . put ( "synonyms" , a ) ) ; index . waitTask ( res . getLong ( "taskID" ) ) ; res = index . getSynonym ( "synonym1" ) ; "<AssertPlaceHolder>" ; } getSynonym ( java . lang . String ) { return this . getSynonym ( objectID , RequestOptions . empty ) ; } | org . junit . Assert . assertEquals ( "synonym" , res . getString ( "type" ) ) |
getSelectedUserGroups ( ) { java . util . List < org . oscm . ui . dialog . mp . createuser . UserGroup > groups = new java . util . ArrayList < org . oscm . ui . dialog . mp . createuser . UserGroup > ( ) ; groups . add ( prepareUserGroup ( true ) ) ; groups . add ( prepareUserGroup ( false ) ) ; java . util . List < org . oscm . internal . usergroupmgmt . POUserGroup > poUserGroups = ctrl . getSelectedUserGroups ( groups ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , poUserGroups . size ( ) ) |
cipherEncryptDecrypt ( ) { org . ccnx . ccn . impl . support . Log . info ( Log . FAC_TEST , "Starting<sp>cipherEncryptDecrypt" ) ; javax . crypto . Cipher c = org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . keys . getSegmentEncryptionCipher ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . name , org . ccnx . ccn . io . CCNSecureInputStreamTest . outputLibrary . getDefaultPublisher ( ) , 0 ) ; byte [ ] d = c . doFinal ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . encrData ) ; c = org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . keys . getSegmentDecryptionCipher ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . name , org . ccnx . ccn . io . CCNSecureInputStreamTest . outputLibrary . getDefaultPublisher ( ) , 0 ) ; d = c . doFinal ( d ) ; "<AssertPlaceHolder>" ; org . ccnx . ccn . impl . support . Log . info ( Log . FAC_TEST , "Completed<sp>cipherEncryptDecrypt" ) ; } getDefaultPublisher ( ) { return keyManager ( ) . getDefaultKeyID ( ) ; } | org . junit . Assert . assertArrayEquals ( org . ccnx . ccn . io . CCNSecureInputStreamTest . basic . encrData , d ) |
test_Double ( ) { com . alibaba . dubbo . common . serialize . ObjectOutput objectOutput = serialization . serialize ( url , byteArrayOutputStream ) ; objectOutput . writeDouble ( 1.28 ) ; objectOutput . flushBuffer ( ) ; java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( byteArrayOutputStream . toByteArray ( ) ) ; com . alibaba . dubbo . common . serialize . ObjectInput deserialize = serialization . deserialize ( url , byteArrayInputStream ) ; "<AssertPlaceHolder>" ; try { deserialize . readDouble ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException expected ) { } } readDouble ( ) { return input . readDouble ( ) ; } | org . junit . Assert . assertTrue ( ( 1.28 == ( deserialize . readDouble ( ) ) ) ) |
shouldChangeEndTime ( ) { java . time . LocalTime time = entry . getEndTime ( ) . plusHours ( 1 ) ; entry . changeEndTime ( time ) ; "<AssertPlaceHolder>" ; } getEndTime ( ) { return ( endTime ) == null ? _endTime : endTime . get ( ) ; } | org . junit . Assert . assertThat ( entry . getEndTime ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( time ) ) ) |
testRuleUp ( ) { manager . ruleUp ( forwardBlz ) ; "<AssertPlaceHolder>" ; } getRules ( ) { return rules ; } | org . junit . Assert . assertEquals ( forwardBlz , manager . getRules ( ) . get ( 0 ) ) |
getAlbumReturnsV1TagsAlbumIfV2TagsAlbumIsEmpty ( ) { com . mpatric . mp3agic . ID3v1 id3v1Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v1TagForTesting ( ) ; id3v1Tag . setAlbum ( "V1<sp>Album" ) ; com . mpatric . mp3agic . ID3v2 id3v2Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v2TagForTesting ( ) ; id3v2Tag . setAlbum ( "" ) ; com . mpatric . mp3agic . ID3Wrapper wrapper = new com . mpatric . mp3agic . ID3Wrapper ( id3v1Tag , id3v2Tag ) ; "<AssertPlaceHolder>" ; } getAlbum ( ) { if ( ( ( ( id3v2Tag ) != null ) && ( ( id3v2Tag . getAlbum ( ) ) != null ) ) && ( ( id3v2Tag . getAlbum ( ) . length ( ) ) > 0 ) ) { return id3v2Tag . getAlbum ( ) ; } else if ( ( id3v1Tag ) != null ) { return id3v1Tag . getAlbum ( ) ; } else { return null ; } } | org . junit . Assert . assertEquals ( "V1<sp>Album" , wrapper . getAlbum ( ) ) |
testDeleteFalse ( ) { initializeExpectedSink ( 1 ) ; expect ( logging . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( logging . deleteSink ( com . google . cloud . logging . SinkTest . NAME ) ) . andReturn ( false ) ; replay ( logging ) ; initializeSink ( ) ; "<AssertPlaceHolder>" ; } delete ( ) { boolean deleted = sink . delete ( ) ; if ( deleted ) { } else { } return deleted ; } | org . junit . Assert . assertFalse ( sink . delete ( ) ) |
getModule_AllPhysicalClassPathsOfModule ( ) { husaccttest . define . DefineServicesTest_SRMA . defineService = husacct . ServiceProvider . getInstance ( ) . getDefineService ( ) ; java . util . Set < java . lang . String > assignedSUs = husaccttest . define . DefineServicesTest_SRMA . defineService . getModule_AllPhysicalClassPathsOfModule ( "Domain.RelationRules.IsNotAllowedToUse" ) ; boolean su1A = false ; boolean su11A = false ; boolean su111A = false ; boolean noOtherSUs = false ; if ( ( assignedSUs . size ( ) ) == 10 ) { noOtherSUs = true ; for ( java . lang . String assignedSU : assignedSUs ) { if ( assignedSU . equals ( "domain.relationrules.is_not_allowed_to_use.Access_2" ) ) su1A = true ; if ( assignedSU . equals ( "domain.relationrules.is_not_allowed_to_use.violating.ViolatingAccess_2" ) ) su11A = true ; if ( assignedSU . equals ( "domain.relationrules.is_not_allowed_to_use.violating.exception.ViolatingAccess_2Exc" ) ) su111A = true ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( this . getClass ( ) ) != ( obj . getClass ( ) ) ) return false ; husacct . graphics . domain . figures . BaseFigure other = ( ( husacct . graphics . domain . figures . BaseFigure ) ( obj ) ) ; if ( ( uniqueName ) == null ) { if ( ( other . uniqueName ) != null ) return false ; } else if ( ! ( uniqueName . equals ( other . uniqueName ) ) ) return false ; return true ; } | org . junit . Assert . assertTrue ( ( ( ( su1A && su11A ) && su111A ) && noOtherSUs ) ) |
testToObjectImpl ( ) { java . util . Date expected = java . text . DateFormat . getDateInstance ( DateFormat . MEDIUM , Locale . US ) . parse ( "Mar<sp>1,<sp>1954" ) ; java . util . Date actual = ( ( java . util . Date ) ( new com . planet57 . gshell . util . converter . basic . DateConverter ( ) . convertToObject ( "locale=en_US<sp>format=MEDIUM<sp>Mar<sp>1,<sp>1954" ) ) ) ; "<AssertPlaceHolder>" ; } convertToObject ( java . lang . String ) { return java . lang . Long . valueOf ( text ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testValidateAction_connectionAction ( ) { mdxBaseComponent . setActionDefinition ( connAction ) ; when ( connAction . getOutputConnection ( ) ) . thenReturn ( outputResultSet ) ; boolean action = mdxBaseComponent . validateAction ( ) ; "<AssertPlaceHolder>" ; verify ( mdxBaseComponent , never ( ) ) . error ( anyString ( ) , any ( java . lang . Throwable . class ) ) ; } validateAction ( ) { boolean result = true ; if ( ! ( ( getActionDefinition ( ) ) instanceof org . pentaho . actionsequence . dom . actions . SqlExecuteAction ) ) { error ( org . pentaho . platform . plugin . action . messages . Messages . getInstance ( ) . getErrorString ( "ComponentBase.ERROR_0001_UNKNOWN_ACTION_TYPE" , getActionDefinition ( ) . getElement ( ) . asXML ( ) ) ) ; result = false ; } else { result = super . validateAction ( ) ; } return result ; } | org . junit . Assert . assertTrue ( action ) |
testDeleteDocumentsMultipleIds ( ) { java . lang . String id1 = "syn123" ; java . lang . String id2 = "syn456" ; org . sagebionetworks . repo . model . search . Document expectedDoc1 = new org . sagebionetworks . repo . model . search . Document ( ) ; expectedDoc1 . setId ( id1 ) ; expectedDoc1 . setType ( DocumentTypeNames . delete ) ; org . sagebionetworks . repo . model . search . Document expectedDoc2 = new org . sagebionetworks . repo . model . search . Document ( ) ; expectedDoc2 . setId ( id2 ) ; expectedDoc2 . setType ( DocumentTypeNames . delete ) ; dao . deleteDocuments ( new java . util . LinkedHashSet ( java . util . Arrays . asList ( id1 , id2 ) ) ) ; verify ( dao , times ( 1 ) ) . sendDocuments ( iteratorArgumentCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( expectedDoc1 , expectedDoc2 ) , com . google . common . collect . Lists . newArrayList ( iteratorArgumentCaptor . getValue ( ) ) ) |
givenOutputStream_whenWriteSingleByteCalled_thenOutputCreated ( ) { final java . io . File file = new java . io . File ( filePath . toString ( ) ) ; com . baeldung . stream . OutputStreamExamples examples = new com . baeldung . stream . OutputStreamExamples ( ) ; examples . fileOutputStreamByteSingle ( filePath . toString ( ) , "Hello<sp>World!" ) ; "<AssertPlaceHolder>" ; file . delete ( ) ; } toString ( ) { return ( ( ( ( ( "Movie<sp>[imdbId=" + ( imdbId ) ) + ",<sp>director=" ) + ( director ) ) + ",<sp>actors=" ) + ( actors ) ) + "]" ; } | org . junit . Assert . assertTrue ( file . exists ( ) ) |
givenIdenticalCharSequences_whenCastToString_thenEqual ( ) { java . lang . CharSequence charSequence1 = "baeldung_1" ; java . lang . CharSequence charSequence2 = "baeldung_2" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( "Movie<sp>[imdbId=" + ( imdbId ) ) + ",<sp>director=" ) + ( director ) ) + ",<sp>actors=" ) + ( actors ) ) + "]" ; } | org . junit . Assert . assertTrue ( ( ( charSequence1 . toString ( ) . compareTo ( charSequence2 . toString ( ) ) ) < 0 ) ) |
shouldRejectOperationChainWhenUserDoesntHaveAllOpAuthsForAllOperations ( ) { final uk . gov . gchq . gaffer . graph . hook . OperationAuthoriser hook = fromJson ( uk . gov . gchq . gaffer . graph . hook . OperationAuthoriserTest . OP_AUTHS_PATH ) ; final uk . gov . gchq . gaffer . operation . OperationChain opChain = new uk . gov . gchq . gaffer . operation . OperationChain . Builder ( ) . first ( new uk . gov . gchq . gaffer . operation . impl . get . GetAdjacentIds ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . user . User user = new uk . gov . gchq . gaffer . user . User . Builder ( ) . opAuths ( "WriteUser" , "ReadUser" , "User" ) . build ( ) ; try { hook . preExecute ( opChain , new uk . gov . gchq . gaffer . store . Context ( user ) ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( final uk . gov . gchq . gaffer . commonutil . exception . UnauthorisedException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( ( ( super . getMessage ( ) ) + "<sp>in<sp>string<sp>\'" ) + ( this . visibility ) ) + "\'<sp>at<sp>position<sp>" ) + ( super . getErrorOffset ( ) ) ; } | org . junit . Assert . assertNotNull ( e . getMessage ( ) ) |
testNextLabel3 ( ) { java . util . List < java . lang . String > list = java . util . Arrays . asList ( "LABEL0" , "LABEL1" , "LABEL2" ) ; org . deeplearning4j . text . documentiterator . LabelsSource generator = new org . deeplearning4j . text . documentiterator . LabelsSource ( list ) ; "<AssertPlaceHolder>" ; } nextLabel ( ) { if ( ( labels ) != null ) { return labels . get ( ( ( java . lang . Long ) ( counter . getAndIncrement ( ) ) ) . intValue ( ) ) ; } else { maxCount = counter . getAndIncrement ( ) ; return formatLabel ( maxCount ) ; } } | org . junit . Assert . assertEquals ( "LABEL0" , generator . nextLabel ( ) ) |
test_boolArray ( ) { boolean [ ] data = new boolean [ ] { true , false , true } ; com . alibaba . dubbo . common . serialize . ObjectOutput objectOutput = serialization . serialize ( url , byteArrayOutputStream ) ; objectOutput . writeObject ( data ) ; objectOutput . flushBuffer ( ) ; java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( byteArrayOutputStream . toByteArray ( ) ) ; com . alibaba . dubbo . common . serialize . ObjectInput deserialize = serialization . deserialize ( url , byteArrayInputStream ) ; "<AssertPlaceHolder>" ; try { deserialize . readObject ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . io . IOException expected ) { } } equals ( com . alibaba . dubbo . remoting . buffer . ChannelBuffer , com . alibaba . dubbo . remoting . buffer . ChannelBuffer ) { final int aLen = bufferA . readableBytes ( ) ; if ( aLen != ( bufferB . readableBytes ( ) ) ) { return false ; } final int byteCount = aLen & 7 ; int aIndex = bufferA . readerIndex ( ) ; int bIndex = bufferB . readerIndex ( ) ; for ( int i = byteCount ; i > 0 ; i -- ) { if ( ( bufferA . getByte ( aIndex ) ) != ( bufferB . getByte ( bIndex ) ) ) { return false ; } aIndex ++ ; bIndex ++ ; } return true ; } | org . junit . Assert . assertTrue ( java . util . Arrays . equals ( data , ( ( boolean [ ] ) ( deserialize . readObject ( ) ) ) ) ) |
testErrorsWithAttemptsIsBoundedByErrors ( ) { rx . Observable < java . lang . Throwable > errors = rx . Observable . < java . lang . Throwable > just ( new com . couchbase . client . java . error . CannotRetryException ( "" ) ) . repeat ( 10 ) ; rx . Observable < com . couchbase . client . core . lang . Tuple2 < java . lang . Integer , java . lang . Throwable > > errorsWithAttempts = com . couchbase . client . java . util . retry . Retry . errorsWithAttempts ( errors , 100 ) ; java . util . List < com . couchbase . client . core . lang . Tuple2 < java . lang . Integer , java . lang . Throwable > > list = errorsWithAttempts . toList ( ) . toBlocking ( ) . first ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return resultList . size ( ) ; } | org . junit . Assert . assertEquals ( 10 , list . size ( ) ) |
testValuesIterator ( ) { com . sun . sgs . test . app . util . TestScalableHashMap . txnScheduler . runTask ( new com . sun . sgs . test . util . TestAbstractKernelRunnable ( ) { public void run ( ) throws com . sun . sgs . test . app . util . Exception { java . util . Map < java . lang . Integer , java . lang . Integer > test = new com . sun . sgs . app . util . ScalableHashMap < java . lang . Integer , java . lang . Integer > ( ) ; java . util . Set < java . lang . Integer > control = new java . util . HashSet < java . lang . Integer > ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { test . put ( i , i ) ; control . add ( i ) ; } for ( java . lang . Integer i : test . values ( ) ) { control . remove ( i ) ; } "<AssertPlaceHolder>" ; } } , com . sun . sgs . test . app . util . TestScalableHashMap . taskOwner ) ; } size ( ) { int size = 0 ; com . sun . sgs . app . util . ScalableDeque . Element < E > n = headElement ( ) ; while ( n != null ) { size ++ ; n = n . next ( ) ; } return size ; } | org . junit . Assert . assertEquals ( 0 , control . size ( ) ) |
testCheckMapExactly_EmptyKeys ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) ) |
countMutationsAll ( ) { org . optaplanner . core . impl . domain . solution . descriptor . SolutionDescriptor < org . optaplanner . core . impl . testdata . domain . TestdataSolution > solutionDescriptor = org . optaplanner . core . impl . testdata . domain . TestdataSolution . buildSolutionDescriptor ( ) ; org . optaplanner . core . impl . domain . solution . mutation . MutationCounter < org . optaplanner . core . impl . testdata . domain . TestdataSolution > mutationCounter = new org . optaplanner . core . impl . domain . solution . mutation . MutationCounter ( solutionDescriptor ) ; org . optaplanner . core . impl . testdata . domain . TestdataValue val1 = new org . optaplanner . core . impl . testdata . domain . TestdataValue ( "1" ) ; org . optaplanner . core . impl . testdata . domain . TestdataValue val2 = new org . optaplanner . core . impl . testdata . domain . TestdataValue ( "2" ) ; org . optaplanner . core . impl . testdata . domain . TestdataValue val3 = new org . optaplanner . core . impl . testdata . domain . TestdataValue ( "3" ) ; java . util . List < org . optaplanner . core . impl . testdata . domain . TestdataValue > valueList = java . util . Arrays . asList ( val1 , val2 , val3 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity a_a = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "a" , val1 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity a_b = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "b" , val1 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity a_c = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "c" , val3 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity a_d = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "d" , val3 ) ; java . util . List < org . optaplanner . core . impl . testdata . domain . TestdataEntity > aEntityList = java . util . Arrays . asList ( a_a , a_b , a_c , a_d ) ; org . optaplanner . core . impl . testdata . domain . TestdataSolution a = new org . optaplanner . core . impl . testdata . domain . TestdataSolution ( "solution" ) ; a . setValueList ( valueList ) ; a . setEntityList ( aEntityList ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity b_a = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "a" , val2 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity b_b = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "b" , val2 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity b_c = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "c" , val2 ) ; org . optaplanner . core . impl . testdata . domain . TestdataEntity b_d = new org . optaplanner . core . impl . testdata . domain . TestdataEntity ( "d" , val2 ) ; java . util . List < org . optaplanner . core . impl . testdata . domain . TestdataEntity > bEntityList = java . util . Arrays . asList ( b_a , b_b , b_c , b_d ) ; org . optaplanner . core . impl . testdata . domain . TestdataSolution b = new org . optaplanner . core . impl . testdata . domain . TestdataSolution ( "solution" ) ; b . setValueList ( valueList ) ; b . setEntityList ( bEntityList ) ; "<AssertPlaceHolder>" ; } countMutations ( Solution_ , Solution_ ) { int mutationCount = 0 ; for ( org . optaplanner . core . impl . domain . entity . descriptor . EntityDescriptor < Solution_ > entityDescriptor : solutionDescriptor . getGenuineEntityDescriptors ( ) ) { java . util . List < java . lang . Object > aEntities = entityDescriptor . extractEntities ( a ) ; java . util . List < java . lang . Object > bEntities = entityDescriptor . extractEntities ( b ) ; for ( java . util . Iterator < java . lang . Object > aIt = aEntities . iterator ( ) , bIt = bEntities . iterator ( ) ; ( aIt . hasNext ( ) ) && ( bIt . hasNext ( ) ) ; ) { java . lang . Object aEntity = aIt . next ( ) ; java . lang . Object bEntity = bIt . next ( ) ; for ( org . optaplanner . core . impl . domain . variable . descriptor . GenuineVariableDescriptor < Solution_ > variableDescriptor : entityDescriptor . getGenuineVariableDescriptors ( ) ) { if ( ( variableDescriptor . getValue ( aEntity ) ) != ( variableDescriptor . getValue ( bEntity ) ) ) { mutationCount ++ ; } } } if ( ( aEntities . size ( ) ) != ( bEntities . size ( ) ) ) { mutationCount += ( java . lang . Math . abs ( ( ( aEntities . size ( ) ) - ( bEntities . size ( ) ) ) ) ) * ( entityDescriptor . getGenuineVariableDescriptors ( ) . size ( ) ) ; } } return mutationCount ; } | org . junit . Assert . assertEquals ( 4 , mutationCounter . countMutations ( a , b ) ) |
stackIsNotCompliant ( ) { org . candlepin . model . Consumer c = mockConsumer ( PRODUCT_1 ) ; c . setFact ( "cpu.cpu_socket(s)" , "4" ) ; java . util . List < org . candlepin . model . Entitlement > ents = new java . util . LinkedList ( ) ; ents . add ( mockStackedEntitlement ( c , org . candlepin . policy . js . compliance . ComplianceRulesTest . STACK_ID_1 , org . candlepin . test . TestUtil . createProduct ( "Awesome<sp>Product" ) , PRODUCT_1 ) ) ; ents . add ( mockEntitlement ( c , org . candlepin . test . TestUtil . createProduct ( "Another<sp>Product" ) , PRODUCT_3 ) ) ; "<AssertPlaceHolder>" ; } isStackCompliant ( org . candlepin . model . Consumer , java . lang . String , java . util . List ) { java . util . stream . Stream < org . candlepin . dto . rules . v1 . EntitlementDTO > entStream = ( entsToConsider == null ) ? java . util . stream . Stream . empty ( ) : entsToConsider . stream ( ) . map ( this . translator . getStreamMapper ( org . candlepin . model . Entitlement . class , org . candlepin . dto . rules . v1 . EntitlementDTO . class ) ) ; java . util . stream . Stream < org . candlepin . dto . rules . v1 . GuestIdDTO > guestIdStream = ( ( consumer . getGuestIds ( ) ) == null ) ? java . util . stream . Stream . empty ( ) : consumer . getGuestIds ( ) . stream ( ) . map ( this . translator . getStreamMapper ( org . candlepin . model . GuestId . class , org . candlepin . dto . rules . v1 . GuestIdDTO . class ) ) ; org . candlepin . policy . js . JsonJsContext args = new org . candlepin . policy . js . JsonJsContext ( mapper ) ; args . put ( "stack_id" , stackId ) ; args . put ( "consumer" , this . translator . translate ( consumer , org . candlepin . dto . rules . v1 . ConsumerDTO . class ) ) ; args . put ( "entitlements" , entStream ) ; args . put ( "log" , org . candlepin . policy . js . compliance . ComplianceRules . log , false ) ; args . put ( "guestIds" , guestIdStream ) ; return jsRules . runJsFunction ( org . candlepin . policy . js . compliance . Boolean . class , "is_stack_compliant" , args ) ; } | org . junit . Assert . assertFalse ( compliance . isStackCompliant ( c , org . candlepin . policy . js . compliance . ComplianceRulesTest . STACK_ID_1 , ents ) ) |
testLinearRegression ( ) { final double [ ] [ ] xt = new double [ ] [ ] { new double [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } } ; final double m = 2 ; final double c = - 2 ; final double [ ] [ ] perfectyt = new double [ 1 ] [ xt [ 0 ] . length ] ; for ( int i = 0 ; i < ( perfectyt [ 0 ] . length ) ; i ++ ) { perfectyt [ 0 ] [ i ] = ( ( xt [ 0 ] [ i ] ) * m ) + c ; } final Jama . Matrix x = new Jama . Matrix ( xt ) . transpose ( ) ; final Jama . Matrix perfecty = new Jama . Matrix ( perfectyt ) . transpose ( ) ; final Jama . Matrix noise = new Jama . Matrix ( org . openimaj . data . RandomData . getRandomDoubleArray ( perfecty . getRowDimension ( ) , 1 , ( - 1 ) , 1 , 1 ) ) ; final Jama . Matrix y = perfecty . plus ( noise ) ; final java . util . List < org . openimaj . util . pair . IndependentPair < double [ ] , double [ ] > > ipairs = aspairs ( x , y ) ; final org . openimaj . ml . regression . LinearRegression lr = new org . openimaj . ml . regression . LinearRegression ( ) ; lr . estimate ( y , x ) ; final org . openimaj . ml . regression . LinearRegression lr2 = new org . openimaj . ml . regression . LinearRegression ( ) ; lr2 . estimate ( ipairs ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( obj instanceof ch . akuhn . matrix . SparseMatrix ) && ( rows . equals ( ( ( ch . akuhn . matrix . SparseMatrix ) ( obj ) ) . rows ) ) ; } | org . junit . Assert . assertTrue ( lr . equals ( lr2 ) ) |
testGetRunningExecutionsNoTran ( ) { final javax . batch . operations . JobOperator mockJobOperator = mockery . mock ( javax . batch . operations . JobOperator . class ) ; final javax . transaction . TransactionManager mockTranMgr = mockery . mock ( javax . transaction . TransactionManager . class ) ; final java . util . List < java . lang . Long > retMe = new java . util . ArrayList < java . lang . Long > ( ) ; mockery . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockTranMgr ) . suspend ( ) ; will ( returnValue ( null ) ) ; oneOf ( mockJobOperator ) . getRunningExecutions ( null ) ; will ( returnValue ( retMe ) ) ; } } ) ; "<AssertPlaceHolder>" ; } buildJobOperator ( javax . batch . operations . JobOperator , javax . transaction . TransactionManager ) { com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran retMe = new com . ibm . jbatch . container . api . impl . JobOperatorImplSuspendTran ( ) ; retMe . setTransactionManager ( mockTranMgr ) ; retMe . setJobOperator ( mockJobOperator ) ; return retMe ; } | org . junit . Assert . assertEquals ( retMe , buildJobOperator ( mockJobOperator , mockTranMgr ) . getRunningExecutions ( null ) ) |
testSavePlasmapheresis ( ) { org . patientview . radar . model . Plasmapheresis plasmapheresis = new org . patientview . radar . model . Plasmapheresis ( ) ; plasmapheresisDao . savePlasmapheresis ( plasmapheresis ) ; "<AssertPlaceHolder>" ; org . patientview . radar . model . Plasmapheresis plasmapheresisUpdate = new org . patientview . radar . model . Plasmapheresis ( ) ; plasmapheresisUpdate . setId ( new java . lang . Long ( 1 ) ) ; plasmapheresisDao . savePlasmapheresis ( plasmapheresisUpdate ) ; } getId ( ) { return id ; } | org . junit . Assert . assertNotNull ( plasmapheresis . getId ( ) ) |
setVariableTransientForCase ( ) { testRule . deploy ( "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" ) ; engineRule . getCaseService ( ) . withCaseDefinitionByKey ( "oneTaskCase" ) . setVariable ( "foo" , org . camunda . bpm . engine . variable . Variables . stringValue ( "bar" , true ) ) . create ( ) ; java . util . List < org . camunda . bpm . engine . history . HistoricVariableInstance > variables = historyService . createHistoricVariableInstanceQuery ( ) . list ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( ( ( historicProcessInstanceIds . size ( ) ) + ( historicDecisionInstanceIds . size ( ) ) ) + ( historicCaseInstanceIds . size ( ) ) ) + ( historicBatchIds . size ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , variables . size ( ) ) |
testTimeStampDiffWithTimestamp ( ) { java . lang . String sqlText = ( "select<sp>{fn<sp>TIMESTAMPDIFF(SQL_TSI_DAY,<sp>date('2012-12-26'),<sp>col3)},<sp>date(col3),<sp>date('2012-12-26')<sp>from<sp>" + ( com . splicemachine . derby . utils . SpliceDateFunctionsIT . tableWatcherG ) ) + "<sp>order<sp>by<sp>col3" ; try ( com . splicemachine . derby . utils . ResultSet rs = methodWatcher . executeQuery ( sqlText ) ) { java . lang . String expected = "1<sp>|<sp>2<sp>|<sp>3<sp>|\n" + ( ( ( ( ( ( ( ( "<sp>order<sp>by<sp>col3" 0 + "<sp>order<sp>by<sp>col3" 2 ) + "-360<sp>|2012-01-01<sp>|2012-12-26<sp>|\n" ) + "<sp>order<sp>by<sp>col3" 1 ) + "<sp>-86<sp>|2012-10-01<sp>|2012-12-26<sp>|\n" ) + "<sp>-25<sp>|2012-12-01<sp>|2012-12-26<sp>|\n" ) + "<sp>4<sp>|2012-12-30<sp>|2012-12-26<sp>|\n" ) + "<sp>5<sp>|2012-12-31<sp>|2012-12-26<sp>|\n" ) + "<sp>5<sp>|2012-12-31<sp>|2012-12-26<sp>|" ) ; "<AssertPlaceHolder>" ; } } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; } | org . junit . Assert . assertEquals ( ( ( "\n" + sqlText ) + "\n" ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) ) |
constructorWithSettingsBinary ( ) { settings . setBinary ( com . opera . core . systems . OperaBinary . find ( ) ) ; runner = new com . opera . core . systems . OperaLauncherRunnerTest . TestOperaLauncherRunner ( settings ) ; "<AssertPlaceHolder>" ; } find ( ) { return com . opera . core . systems . OperaBinary . find ( OperaProduct . DESKTOP ) ; } | org . junit . Assert . assertNotNull ( runner ) |
format_mongo ( ) { java . util . TimeZone . setDefault ( java . util . TimeZone . getTimeZone ( "America/New_York" ) ) ; final org . apache . rya . api . instance . RyaDetails details = . setGeoIndexDetails ( new GeoIndexDetails ( true ) ) org . apache . rya . api . instance . RyaDetails . builder ( ) . setRyaInstanceName ( "test_instance" ) . setRyaVersion ( "test_instance" 2 ) . setEntityCentricIndexDetails ( new org . apache . rya . api . instance . RyaDetails . EntityCentricIndexDetails ( false ) ) . setTemporalIndexDetails ( new org . apache . rya . api . instance . RyaDetails . TemporalIndexDetails ( true ) ) . setFreeTextDetails ( new org . apache . rya . api . instance . RyaDetails . FreeTextIndexDetails ( true ) ) . setPCJIndexDetails ( org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . builder ( ) . setEnabled ( true ) ) . setProspectorDetails ( new org . apache . rya . api . instance . RyaDetails . ProspectorDetails ( com . google . common . base . Optional . absent ( ) ) ) . setJoinSelectivityDetails ( new org . apache . rya . api . instance . RyaDetails . JoinSelectivityDetails ( com . google . common . base . Optional . absent ( ) ) ) . build ( ) ; final java . lang . String formatted = new org . apache . rya . shell . util . RyaDetailsFormatter ( ) . format ( StorageType . MONGO , details ) ; final java . lang . String expected = "General<sp>Metadata:\n" + ( ( ( ( ( ( ( ( ( ( "test_instance" 1 + "test_instance" 0 ) + "Secondary<sp>Indicies:\n" ) + "<sp>Geospatial<sp>Index:\n" + "<sp>Enabled:<sp>true\n" + "<sp>Free<sp>Text<sp>Index:\n" ) + "<sp>Enabled:<sp>true\n" ) + "<sp>Temporal<sp>Index:\n" ) + "<sp>Enabled:<sp>true\n" ) + "test_instance" 3 ) + "<sp>Enabled:<sp>true\n" ) + "<sp>PCJs:\n" ) + "<sp>No<sp>PCJs<sp>have<sp>been<sp>added<sp>yet.\n" ) ; "<AssertPlaceHolder>" ; } format ( org . apache . rya . shell . SharedShellState . StorageType , org . apache . rya . api . instance . RyaDetails ) { requireNonNull ( details ) ; final java . lang . StringBuilder report = new java . lang . StringBuilder ( ) ; report . append ( "General<sp>Metadata:\n" ) ; report . append ( "Secondary<sp>Indicies:\n" 4 ) . append ( details . getRyaInstanceName ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; report . append ( "General<sp>Metadata:\n" 2 ) . append ( details . getRyaVersion ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; if ( storageType == ( org . apache . rya . shell . SharedShellState . StorageType . ACCUMULO ) ) { report . append ( "Secondary<sp>Indicies:\n" 0 ) . append ( com . google . common . base . Joiner . on ( ",<sp>" ) . join ( details . getUsers ( ) ) ) . append ( "General<sp>Metadata:\n" 1 ) ; } report . append ( "Secondary<sp>Indicies:\n" ) ; if ( storageType == ( org . apache . rya . shell . SharedShellState . StorageType . ACCUMULO ) ) { report . append ( "Secondary<sp>Indicies:\n" 9 ) ; report . append ( "General<sp>Metadata:\n" 5 ) . append ( details . getEntityCentricIndexDetails ( ) . isEnabled ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; } report . append ( "<sp>Geospatial<sp>Index:\n" ) ; report . append ( "General<sp>Metadata:\n" 5 ) . append ( details . getGeoIndexDetails ( ) . isEnabled ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; report . append ( "General<sp>Metadata:\n" 0 ) ; report . append ( "General<sp>Metadata:\n" 5 ) . append ( details . getFreeTextIndexDetails ( ) . isEnabled ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; report . append ( "<sp>Temporal<sp>Index:\n" ) ; report . append ( "General<sp>Metadata:\n" 5 ) . append ( details . getTemporalIndexDetails ( ) . isEnabled ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; report . append ( "Secondary<sp>Indicies:\n" 3 ) ; final org . apache . rya . api . instance . RyaDetails . PCJIndexDetails pcjDetails = details . getPCJIndexDetails ( ) ; report . append ( "General<sp>Metadata:\n" 5 ) . append ( pcjDetails . isEnabled ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; if ( pcjDetails . isEnabled ( ) ) { if ( pcjDetails . getFluoDetails ( ) . isPresent ( ) ) { final java . lang . String fluoAppName = pcjDetails . getFluoDetails ( ) . get ( ) . getUpdateAppName ( ) ; report . append ( "Secondary<sp>Indicies:\n" 8 ) . append ( fluoAppName ) . append ( "General<sp>Metadata:\n" 1 ) ; } final com . google . common . collect . ImmutableMap < java . lang . String , org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails > pcjs = pcjDetails . getPCJDetails ( ) ; report . append ( "Secondary<sp>Indicies:\n" 1 ) ; if ( pcjs . isEmpty ( ) ) { report . append ( "Secondary<sp>Indicies:\n" 5 ) ; } else { for ( final org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails pcj : pcjs . values ( ) ) { report . append ( "<sp>ID:<sp>" ) . append ( pcj . getId ( ) ) . append ( "General<sp>Metadata:\n" 1 ) ; final java . lang . String updateStrategy = format ( pcj . getUpdateStrategy ( ) , "Secondary<sp>Indicies:\n" 7 ) ; report . append ( "<sp>Update<sp>Strategy:<sp>" ) . append ( updateStrategy ) . append ( "General<sp>Metadata:\n" 1 ) ; final java . lang . String lastUpdateTime = format ( pcj . getLastUpdateTime ( ) , "General<sp>Metadata:\n" 4 ) ; report . append ( "General<sp>Metadata:\n" 3 ) . append ( lastUpdateTime ) . append ( "General<sp>Metadata:\n" 1 ) ; } } if ( storageType == ( org . apache . rya . shell . SharedShellState . StorageType . ACCUMULO ) ) { report . append ( "Statistics:\n" ) | org . junit . Assert . assertEquals ( expected , formatted ) |
getByNameReturnsNullWhenDocumentIsNew ( ) { when ( this . getByNameQuery . execute ( ) ) . thenReturn ( java . util . Collections . singletonList ( org . phenotips . entities . spi . AbstractPrimaryEntityManagerTest . PERSON_DOCNAME ) ) ; when ( this . dab . getDocument ( org . phenotips . entities . spi . AbstractPrimaryEntityManagerTest . PERSON_REFERENCE ) ) . thenReturn ( this . doc ) ; when ( this . doc . isNew ( ) ) . thenReturn ( true ) ; org . phenotips . entities . spi . Person result = this . manager . getByName ( org . phenotips . entities . spi . AbstractPrimaryEntityManagerTest . PERSON_NAME ) ; "<AssertPlaceHolder>" ; } getByName ( java . lang . String ) { try { org . xwiki . query . Query q = this . qm . createQuery ( ( ( "select<sp>doc.fullName<sp>from<sp>Document<sp>doc,<sp>doc.object(" + ( this . localSerializer . serialize ( getEntityXClassReference ( ) ) ) ) + ")<sp>as<sp>entity<sp>where<sp>doc.space<sp>=<sp>:space<sp>and<sp>doc.title<sp>=<sp>:name" ) , Query . XWQL ) . bindValue ( "space" , this . getDataSpace ( ) . getName ( ) ) . bindValue ( "name" , name ) ; java . util . List < java . lang . String > docNames = q . execute ( ) ; for ( java . lang . String docName : docNames ) { return get ( docName ) ; } } catch ( org . xwiki . query . QueryException ex ) { this . logger . warn ( "Failed<sp>to<sp>retrieve<sp>the<sp>entity<sp>named<sp>[{}]:<sp>{}" , name , ex . getMessage ( ) ) ; } return null ; } | org . junit . Assert . assertNull ( result ) |
testCompareEqual ( ) { java . util . List < com . ibm . ws . resource . internal . ResourceRefConfigImpl > rrcs = new java . util . ArrayList < com . ibm . ws . resource . internal . ResourceRefConfigImpl > ( ) ; for ( int i = 0 ; i < 2 ; i ++ ) { com . ibm . ws . resource . internal . ResourceRefConfigImpl rrc = new com . ibm . ws . resource . internal . ResourceRefConfigImpl ( "name" , "type" ) ; rrc . setLoginConfigurationName ( "lcn" ) ; rrc . addLoginProperty ( "name1" , "value1" ) ; rrc . addLoginProperty ( "name2" , "value2" ) ; rrc . setIsolationLevel ( Connection . TRANSACTION_REPEATABLE_READ ) ; rrc . setCommitPriority ( 1 ) ; rrc . setBranchCoupling ( ResourceRefConfig . BRANCH_COUPLING_LOOSE ) ; rrcs . add ( rrc ) ; } java . util . List < com . ibm . ws . resource . ResourceRefConfig . MergeConflict > conflicts = rrcs . get ( 0 ) . compareBindingsAndExtensions ( rrcs . get ( 1 ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . toString ( "" ) ; } | org . junit . Assert . assertTrue ( conflicts . toString ( ) , conflicts . isEmpty ( ) ) |
testParseReviewListInvalid ( ) { org . mewx . wenku8 . global . api . ReviewList reviewList = new org . mewx . wenku8 . global . api . ReviewList ( ) ; org . mewx . wenku8 . global . api . Wenku8Parser . parseReviewList ( reviewList , "1324" ) ; "<AssertPlaceHolder>" ; } getList ( ) { return list ; } | org . junit . Assert . assertTrue ( reviewList . getList ( ) . isEmpty ( ) ) |
testSetSqlStatementSeparator ( ) { classUnderTest . setSqlStatementSeparator ( "\n" ) ; "<AssertPlaceHolder>" ; } getSqlStatementSeparator ( ) { return sqlStatementSeparator ; } | org . junit . Assert . assertEquals ( "\n" , classUnderTest . getSqlStatementSeparator ( ) ) |
deveObterIcmsUfDestinoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemImposto imposto = new com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemImposto ( ) ; final com . fincatto . documentofiscal . nfe310 . classes . nota . NFNotaInfoItemImpostoICMSUFDestino icmsUfDestino = com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaaInfoItemImpostoICMSUFDestino ( ) ; imposto . setIcmsUfDestino ( icmsUfDestino ) ; "<AssertPlaceHolder>" ; } getIcmsUfDestino ( ) { return this . icmsUfDestino ; } | org . junit . Assert . assertEquals ( icmsUfDestino , imposto . getIcmsUfDestino ( ) ) |
testHeaderOkNewName ( ) { final org . pac4j . core . context . WebContext context = org . pac4j . core . context . MockWebContext . create ( ) . addRequestHeader ( org . pac4j . core . authorization . authorizer . csrf . NAME , org . pac4j . core . authorization . authorizer . csrf . VALUE ) . addSessionAttribute ( Pac4jConstants . CSRF_TOKEN , org . pac4j . core . authorization . authorizer . csrf . VALUE ) ; authorizer . setHeaderName ( org . pac4j . core . authorization . authorizer . csrf . NAME ) ; "<AssertPlaceHolder>" ; } isAuthorized ( org . pac4j . core . context . WebContext , java . util . List ) { org . pac4j . core . util . CommonHelper . assertNotNull ( "pattern" , pattern ) ; final java . lang . String ip = context . getRemoteAddr ( ) ; return this . pattern . matcher ( ip ) . matches ( ) ; } | org . junit . Assert . assertTrue ( authorizer . isAuthorized ( context , null ) ) |
testBootstrapThrowsMongoError ( ) { final com . allanbank . mongodb . MongoClientConfiguration config = new com . allanbank . mongodb . MongoClientConfiguration ( ) ; config . addServer ( "localhost:6547" ) ; final com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory mockFactory = createMock ( com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory . class ) ; final com . allanbank . mongodb . client . connection . Connection mockConnection = createMock ( com . allanbank . mongodb . client . connection . Connection . class ) ; expect ( mockFactory . connect ( anyObject ( com . allanbank . mongodb . client . state . Server . class ) , eq ( config ) ) ) . andReturn ( mockConnection ) . times ( 2 ) ; mockConnection . send ( anyObject ( com . allanbank . mongodb . client . message . IsMaster . class ) , com . allanbank . mongodb . client . connection . CallbackReply . cb ( ) ) ; expectLastCall ( ) . andThrow ( new com . allanbank . mongodb . MongoDbException ( "This<sp>is<sp>a<sp>test" ) ) . times ( 2 ) ; mockConnection . shutdown ( false ) ; expectLastCall ( ) ; mockConnection . close ( ) ; expectLastCall ( ) ; mockConnection . close ( ) ; expectLastCall ( ) ; replay ( mockFactory , mockConnection ) ; myTestFactory = new com . allanbank . mongodb . client . connection . sharded . ShardedConnectionFactory ( mockFactory , config ) ; "<AssertPlaceHolder>" ; verify ( mockFactory , mockConnection ) ; reset ( mockFactory , mockConnection ) ; } close ( ) { synchronized ( myForwardCallback ) { myClosed = true ; sendKill ( ) ; } } | org . junit . Assert . assertNotNull ( myTestFactory ) |
testReadUint16AsInt ( ) { byte [ ] buf = new byte [ 2 ] ; for ( int i = 0 ; i < 65535 ; i ++ ) { org . jitsi . util . RTPUtils . writeShort ( buf , 0 , ( ( short ) ( i ) ) ) ; int j = org . jitsi . util . RTPUtils . readUint16AsInt ( buf , 0 ) ; "<AssertPlaceHolder>" ; } } readUint16AsInt ( byte [ ] , int ) { int b1 = 255 & ( buf [ ( off + 0 ) ] ) ; int b2 = 255 & ( buf [ ( off + 1 ) ] ) ; int val = ( b1 << 8 ) | b2 ; return val ; } | org . junit . Assert . assertEquals ( i , j ) |
testGetDb ( ) { "<AssertPlaceHolder>" ; } getDb ( ) { return db ; } | org . junit . Assert . assertSame ( db , factory . getDb ( ) ) |
test_wksc_fen_unavaill ( ) { classUnderTest = new eubos . position . PositionManager ( "8/8/8/8/8/8/8/4K2R<sp>w<sp>k<sp>-<sp>-<sp>-" ) . castling ; classUnderTest . addCastlingMoves ( ml ) ; "<AssertPlaceHolder>" ; } addCastlingMoves ( java . util . List ) { eubos . board . pieces . Piece . Colour onMove = pm . getOnMove ( ) ; if ( ! ( castlingAvaillable ( onMove ) ) ) return ; eubos . board . pieces . King ownKing = pm . getKing ( onMove ) ; if ( ownKing != null ) { if ( ( ownKing . hasEverMoved ( ) ) || ( ! ( ownKing . isOnInitialSquare ( ) ) ) ) { return ; } } com . fluxchess . jcpi . models . GenericMove ksc = null ; if ( onMove == ( eubos . board . pieces . Piece . Colour . white ) ) { ksc = getWhiteKingsideCastleMove ( ) ; } else { ksc = getBlackKingsideCastleMove ( ) ; } if ( ksc != null ) ml . add ( ksc ) ; com . fluxchess . jcpi . models . GenericMove qsc = null ; if ( onMove == ( eubos . board . pieces . Piece . Colour . white ) ) { qsc = getWhiteQueensideCastleMove ( ) ; } else { qsc = getBlackQueensideCastleMove ( ) ; } if ( qsc != null ) ml . add ( qsc ) ; } | org . junit . Assert . assertTrue ( ml . isEmpty ( ) ) |
testNoBatchWriteWithSync ( ) { byte [ ] data = "DATA" . getBytes ( ) ; final int iterations = 10 ; for ( int i = 0 ; i < iterations ; i ++ ) { journal . write ( data , Journal . WriteType . SYNC ) ; "<AssertPlaceHolder>" ; } } getInflightWrites ( ) { return inflightWrites ; } | org . junit . Assert . assertTrue ( journal . getInflightWrites ( ) . isEmpty ( ) ) |
testSetIntermediateSystemName ( ) { defaultIsisInterface . setIntermediateSystemName ( intSysName ) ; resultStr = defaultIsisInterface . intermediateSystemName ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; } | org . junit . Assert . assertThat ( resultStr , org . hamcrest . CoreMatchers . is ( intSysName ) ) |
isSendMail ( ) { "<AssertPlaceHolder>" ; } isSendMail ( ) { java . lang . Boolean b = org . oscm . identityservice . control . SendMailControl . SEND_MAIL . get ( ) ; if ( b != null ) { return b . booleanValue ( ) ; } return true ; } | org . junit . Assert . assertTrue ( org . oscm . identityservice . control . SendMailControl . isSendMail ( ) ) |
stringsFromJSONArrayTest ( ) { java . util . List < java . lang . String > expected = com . google . common . collect . Lists . newArrayList ( "a" , "b" , "c" ) ; org . codehaus . jettison . json . JSONArray ja = new org . codehaus . jettison . json . JSONArray ( ) ; ja . put ( "a" ) . put ( "b" ) . put ( "c" ) ; java . util . List < java . lang . String > result = org . apache . apex . malhar . lib . appdata . schemas . SchemaUtils . getStringsFromJSONArray ( ja ) ; "<AssertPlaceHolder>" ; } getStringsFromJSONArray ( org . codehaus . jettison . json . JSONArray ) { java . util . List < java . lang . String > stringArray = com . google . common . collect . Lists . newArrayListWithCapacity ( jsonStringArray . length ( ) ) ; for ( int stringIndex = 0 ; stringIndex < ( jsonStringArray . length ( ) ) ; stringIndex ++ ) { stringArray . add ( jsonStringArray . getString ( stringIndex ) ) ; } return stringArray ; } | org . junit . Assert . assertEquals ( expected , result ) |
testNoIn ( ) { org . eclipse . microprofile . openapi . models . security . SecurityScheme . Type type = org . eclipse . microprofile . openapi . models . security . SecurityScheme . Type . APIKEY ; com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl noIn = new com . ibm . ws . microprofile . openapi . impl . model . security . SecuritySchemeImpl ( ) ; noIn . setType ( type ) ; noIn . setName ( "noIn" ) ; com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper vh = new com . ibm . ws . microprofile . openapi . test . utils . TestValidationHelper ( ) ; com . ibm . ws . microprofile . openapi . impl . validation . SecuritySchemeValidator validator = com . ibm . ws . microprofile . openapi . impl . validation . SecuritySchemeValidator . getInstance ( ) ; validator . validate ( vh , context , key , noIn ) ; "<AssertPlaceHolder>" ; } getEventsSize ( ) { return result . getEvents ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , vh . getEventsSize ( ) ) |
distinctWithHashingStrategy ( ) { org . eclipse . collections . api . list . ListIterable < java . lang . String > list = this . newWith ( "a" , "A" , "b" , "C" , "b" , "D" , "E" , "e" ) ; org . eclipse . collections . api . list . ListIterable < java . lang . String > actual = list . distinct ( org . eclipse . collections . impl . block . factory . HashingStrategies . fromFunction ( String :: toLowerCase ) ) ; "<AssertPlaceHolder>" ; } with ( org . eclipse . collections . api . block . HashingStrategy , K , V , K , V ) { return org . eclipse . collections . impl . map . strategy . mutable . UnifiedMapWithHashingStrategy . newWithKeysValues ( hashingStrategy , key1 , value1 , key2 , value2 ) ; } | org . junit . Assert . assertEquals ( Lists . mutable . with ( "a" , "b" , "C" , "D" , "E" ) , actual ) |
shouldBeReadSuspendedAfterThreadRealignment ( ) { org . kaazing . mina . core . session . DummySessionEx session = executor . submit ( new org . kaazing . mina . core . session . DummySessionExTest . DummySessionExFactory ( ) ) . get ( ) ; session . setHandler ( new org . apache . mina . core . service . IoHandlerAdapter ( ) { @ org . kaazing . mina . core . session . Override public void messageReceived ( org . apache . mina . core . session . IoSession session , java . lang . Object message ) throws org . kaazing . mina . core . session . Exception { session . suspendRead ( ) ; } } ) ; org . apache . mina . core . filterchain . IoFilterChain filterChain = session . getFilterChain ( ) ; filterChain . fireMessageReceived ( new java . lang . Object ( ) ) ; executor . shutdown ( ) ; executor . awaitTermination ( 1 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; } isReadSuspended ( ) { return channel . isReadable ( ) ; } | org . junit . Assert . assertTrue ( session . isReadSuspended ( ) ) |
testValidAddressSocketServerChannel ( ) { lombok . val testPort = 123 ; lombok . val testAddress = "192.168.0.1" ; lombok . val inetSocketAddress = new java . net . InetSocketAddress ( testAddress , testPort ) ; lombok . val expectedResult = ( testAddress + ":" ) + ( java . lang . String . valueOf ( testPort ) ) ; when ( serverSocketChannel . remoteAddress ( ) ) . thenReturn ( inetSocketAddress ) ; lombok . val result = subject . extractRemoteAddressAndPort ( serverSocketChannel ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( o instanceof com . xjeffrose . xio . http . internal . Http2HeadersWrapper ) && ( delegate . equals ( ( ( com . xjeffrose . xio . http . internal . Http2HeadersWrapper ) ( o ) ) . delegate ) ) ; } | org . junit . Assert . assertTrue ( result . equals ( expectedResult ) ) |
testUpdatePackageResourceThatDoesNotUpdateTheCache ( ) { final org . uberfire . backend . vfs . Path path = path ( ) ; buildHelper . build ( moduleService . resolveModule ( path ) ) ; buildHelper . updatePackageResource ( path ) ; "<AssertPlaceHolder>" ; } cachedFileSystemDoesNotChange ( ) { final org . kie . workbench . common . services . backend . builder . core . Builder builder = cache . assertBuilder ( moduleService . resolveModule ( path ( ) ) ) ; final org . kie . api . builder . KieFileSystem fileSystem = builder . getKieFileSystem ( ) ; final java . lang . String fileContent = new java . lang . String ( fileSystem . read ( "src/main/resources/rule2.drl" ) , com . google . common . base . Charsets . UTF_8 ) ; return fileContent . contains ( "Bean" ) ; } | org . junit . Assert . assertTrue ( cachedFileSystemDoesNotChange ( ) ) |
testRowCountingIterator ( ) { org . apache . accumulo . core . client . Connector conn = tester . getConnector ( ) ; final java . lang . String tA ; { java . lang . String [ ] names = getUniqueNames ( 1 ) ; tA = names [ 0 ] ; } { java . util . Map < org . apache . accumulo . core . data . Key , org . apache . accumulo . core . data . Value > input = new java . util . HashMap ( ) ; input . put ( new org . apache . accumulo . core . data . Key ( "v0" , "" , "v1" ) , new org . apache . accumulo . core . data . Value ( "5" . getBytes ( StandardCharsets . UTF_8 ) ) ) ; input . put ( new org . apache . accumulo . core . data . Key ( "v1" , "" , "v2" ) , new org . apache . accumulo . core . data . Value ( "2" . getBytes ( StandardCharsets . UTF_8 ) ) ) ; input . put ( new org . apache . accumulo . core . data . Key ( "v2" , "" , "v0" ) , new org . apache . accumulo . core . data . Value ( "4" . getBytes ( StandardCharsets . UTF_8 ) ) ) ; input . put ( new org . apache . accumulo . core . data . Key ( "v0" , "" , "vBig" ) , new org . apache . accumulo . core . data . Value ( "7" . getBytes ( StandardCharsets . UTF_8 ) ) ) ; input . put ( new org . apache . accumulo . core . data . Key ( "v1" , "" , "vBig" ) , new org . apache . accumulo . core . data . Value ( "7" . getBytes ( StandardCharsets . UTF_8 ) ) ) ; input . put ( new org . apache . accumulo . core . data . Key ( "v2" , "" , "vBig" ) , new org . apache . accumulo . core . data . Value ( "7" . getBytes ( StandardCharsets . UTF_8 ) ) ) ; java . util . SortedSet < org . apache . hadoop . io . Text > splits = new java . util . TreeSet ( ) ; splits . add ( new org . apache . hadoop . io . Text ( "v15" ) ) ; edu . mit . ll . graphulo . util . TestUtil . createTestTable ( conn , tA , splits , input ) ; } org . apache . accumulo . core . client . BatchScanner scanner = conn . createBatchScanner ( tA , Authorizations . EMPTY , 2 ) ; scanner . setRanges ( java . util . Collections . singleton ( new org . apache . accumulo . core . data . Range ( ) ) ) ; scanner . addScanIterator ( new org . apache . accumulo . core . client . IteratorSetting ( 25 , edu . mit . ll . graphulo . skvi . RowCountingIterator . class ) ) ; long cnt = 0 ; for ( Map . Entry < org . apache . accumulo . core . data . Key , org . apache . accumulo . core . data . Value > entry : scanner ) { cnt += LongCombiner . STRING_ENCODER . decode ( entry . getValue ( ) . get ( ) ) ; } scanner . close ( ) ; long expect = 3 ; "<AssertPlaceHolder>" ; conn . tableOperations ( ) . delete ( tA ) ; } close ( ) { this . scannerIter = null ; if ( ( this . bscanner ) != null ) { this . bscanner . close ( ) ; this . bscanner = null ; } if ( ( this . scanner ) != null ) { this . scanner = null ; } } | org . junit . Assert . assertEquals ( expect , cnt ) |
testOverwrittenDefaultGlobalConfiguration ( ) { final kieker . common . configuration . Configuration globalConfiguration = new kieker . common . configuration . Configuration ( ) ; globalConfiguration . setProperty ( IProjectContext . CONFIG_PROPERTY_NAME_RECORDS_TIME_UNIT , "SECONDS" ) ; final kieker . analysis . IAnalysisController analysisController = new kieker . analysis . AnalysisController ( globalConfiguration ) ; final kieker . test . analysis . junit . plugin . TestGlobalConfiguration . PropertyFilter filter = new kieker . test . analysis . junit . plugin . TestGlobalConfiguration . PropertyFilter ( new kieker . common . configuration . Configuration ( ) , analysisController ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return ( ( T ) ( this . properties . get ( key ) ) ) ; } | org . junit . Assert . assertEquals ( "SECONDS" , filter . getProperty ( IProjectContext . CONFIG_PROPERTY_NAME_RECORDS_TIME_UNIT ) ) |
testBadColumnMapping ( ) { java . util . List < com . streamsets . pipeline . stage . processor . jdbctee . JdbcFieldColumnParamMapping > fieldMappings = com . google . common . collect . ImmutableList . of ( new com . streamsets . pipeline . stage . processor . jdbctee . JdbcFieldColumnParamMapping ( "[2]" 7 , "[2]" 2 ) , new com . streamsets . pipeline . stage . processor . jdbctee . JdbcFieldColumnParamMapping ( "[1]" , "[2]" 5 ) , new com . streamsets . pipeline . stage . processor . jdbctee . JdbcFieldColumnParamMapping ( "[2]" , "TS" ) ) ; java . util . List < com . streamsets . pipeline . stage . processor . jdbctee . JdbcFieldColumnMapping > generatedColumnMappings = com . google . common . collect . ImmutableList . of ( new com . streamsets . pipeline . stage . processor . jdbctee . JdbcFieldColumnMapping ( "[2]" 1 , "[2]" 9 ) ) ; com . streamsets . pipeline . stage . processor . jdbctee . JdbcTeeDProcessor processor = new com . streamsets . pipeline . stage . processor . jdbctee . JdbcTeeDProcessor ( ) ; processor . hikariConfigBean = createConfigBean ( h2ConnectionString , username , password ) ; com . streamsets . pipeline . sdk . ProcessorRunner processorRunner = new com . streamsets . pipeline . sdk . ProcessorRunner . Builder ( com . streamsets . pipeline . stage . processor . jdbctee . JdbcTeeDProcessor . class , processor ) . addConfiguration ( "schema" , database ) . addConfiguration ( "[2]" 6 , tableName ) . addConfiguration ( "[2]" 8 , fieldMappings ) . addConfiguration ( "[2]" 4 , encloseTableName ) . addConfiguration ( "rollbackOnError" , false ) . addConfiguration ( "useMultiRowOp" , false ) . addConfiguration ( "maxPrepStmtParameters" , JdbcMultiRowRecordWriter . UNLIMITED_PARAMETERS ) . addConfiguration ( "[2]" 0 , ChangeLogFormat . NONE ) . addConfiguration ( "[2]" 3 , UnsupportedOperationAction . DISCARD ) . addConfiguration ( "defaultOperation" , JDBCOperationType . INSERT ) . addConfiguration ( "generatedColumnMappings" , generatedColumnMappings ) . addOutputLane ( "lane" ) . setOnRecordError ( OnRecordError . TO_ERROR ) . build ( ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = processorRunner . runValidateConfigs ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return delegate . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , issues . size ( ) ) |
testCreateObjectWithHierarchy ( ) { when ( mockNode . getParent ( ) ) . thenReturn ( mockParent ) ; when ( mockParent . getParent ( ) ) . thenReturn ( mockRoot ) ; when ( mockParent . isNew ( ) ) . thenReturn ( true ) ; when ( mockRoot . getNode ( "foo/bar" ) ) . thenReturn ( mockNode ) ; when ( mockNode . getDepth ( ) ) . thenReturn ( 1 ) ; when ( mockNode . isNew ( ) ) . thenReturn ( true ) ; final javax . jcr . Node actual = getJcrNode ( testObj . findOrCreate ( testSession , "/foo/bar" ) ) ; "<AssertPlaceHolder>" ; verify ( mockParent ) . addMixin ( FedoraTypes . FEDORA_PAIRTREE ) ; } findOrCreate ( org . fcrepo . kernel . api . FedoraSession , java . lang . String ) { try { final org . fcrepo . kernel . api . models . FedoraBinary binary = findOrCreateBinary ( session , path ) ; final javax . jcr . Node dsNode = getJcrNode ( binary ) ; if ( dsNode . isNew ( ) ) { final java . lang . String descPath = ( ( dsNode . getPath ( ) ) + "/" ) + ( FEDORA_DESCRIPTION ) ; findOrCreateDescription ( session , descPath ) ; } return binary ; } catch ( final javax . jcr . RepositoryException e ) { throw new org . fcrepo . kernel . api . exception . RepositoryRuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( mockNode , actual ) |
noImplicitFormForTextAreas ( ) { com . itextpdf . styledxmlparser . jsoup . nodes . Document doc = com . itextpdf . styledxmlparser . jsoup . Jsoup . parse ( "<textarea>One</textarea>" ) ; "<AssertPlaceHolder>" ; } body ( ) { return findFirstElementByTagName ( "body" , this ) ; } | org . junit . Assert . assertEquals ( "<textarea>One</textarea>" , doc . body ( ) . html ( ) ) |
quickFixNotFoundExceptionString ( ) { fix = new org . eclipse . swtbot . eclipse . finder . exceptions . QuickFixNotFoundException ( "Message" ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; } | org . junit . Assert . assertEquals ( "Message" , fix . getMessage ( ) ) |
testByteOrder ( ) { "<AssertPlaceHolder>" ; } byteOrder ( ) { return java . nio . ByteOrder . nativeOrder ( ) ; } | org . junit . Assert . assertEquals ( java . nio . ByteOrder . nativeOrder ( ) , bytes . byteOrder ( ) ) |
testFindMoreThanLocalProperties ( ) { int count = 0 ; for ( final org . apache . commons . dbutils . PropertyHandler handler : properties ) { count ++ ; } "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( ( count > 1 ) ) |
shouldDealWithNoRecords ( ) { final org . talend . dataprep . api . dataset . json . InputStream input = this . getClass ( ) . getResourceAsStream ( "no_records.json" ) ; org . talend . dataprep . api . dataset . DataSet dataSet = from ( input ) ; final org . talend . dataprep . api . dataset . json . List < org . talend . dataprep . api . dataset . row . DataSetRow > records = dataSet . getRecords ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( ( org . apache . commons . lang3 . StringUtils . isEmpty ( title ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( mail ) ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( severity ) ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( type ) ) ) && ( org . apache . commons . lang3 . StringUtils . isEmpty ( description ) ) ; } | org . junit . Assert . assertTrue ( records . isEmpty ( ) ) |
testGetLongitudeHemisphere ( ) { "<AssertPlaceHolder>" ; } getLongitudeHemisphere ( ) { return isLongitudeEast ( ) ? CompassPoint . EAST : CompassPoint . WEST ; } | org . junit . Assert . assertEquals ( CompassPoint . EAST , instance . getLongitudeHemisphere ( ) ) |
addUserTwice ( ) { final java . lang . String user = testInstance . createUniqueUser ( ) ; final org . apache . accumulo . core . client . admin . SecurityOperations secOps = super . getConnector ( ) . securityOperations ( ) ; final org . apache . rya . api . client . RyaClient userAClient = org . apache . rya . api . client . accumulo . AccumuloRyaClientFactory . build ( new org . apache . rya . api . client . accumulo . AccumuloConnectionDetails ( ADMIN_USER , ADMIN_USER . toCharArray ( ) , getInstanceName ( ) , getZookeepers ( ) ) , super . getClusterInstance ( ) . getCluster ( ) . getConnector ( ADMIN_USER , ADMIN_USER ) ) ; secOps . createLocalUser ( user , new org . apache . accumulo . core . client . security . tokens . PasswordToken ( user ) ) ; userAClient . getInstall ( ) . install ( getRyaInstanceName ( ) , org . apache . rya . api . client . Install . InstallConfiguration . builder ( ) . build ( ) ) ; userAClient . getAddUser ( ) . get ( ) . addUser ( getRyaInstanceName ( ) , user ) ; userAClient . getAddUser ( ) . get ( ) . addUser ( getRyaInstanceName ( ) , user ) ; final com . google . common . collect . ImmutableList < java . lang . String > expectedUsers = com . google . common . collect . ImmutableList . < java . lang . String > builder ( ) . add ( ADMIN_USER ) . add ( user ) . build ( ) ; final org . apache . rya . api . instance . RyaDetails details = userAClient . getGetInstanceDetails ( ) . getDetails ( getRyaInstanceName ( ) ) . get ( ) ; "<AssertPlaceHolder>" ; } getUsers ( ) { return users ; } | org . junit . Assert . assertEquals ( expectedUsers , details . getUsers ( ) ) |
shouldThrowExceptionIfSchemaIsInvalid ( ) { final uk . gov . gchq . gaffer . store . StoreProperties storeProperties = new uk . gov . gchq . gaffer . store . StoreProperties ( ) ; storeProperties . setStoreClass ( uk . gov . gchq . gaffer . graph . GraphTest . TestStoreImpl . class . getName ( ) ) ; try { new uk . gov . gchq . gaffer . graph . Graph . Builder ( ) . config ( new uk . gov . gchq . gaffer . graph . GraphConfig . Builder ( ) . graphId ( uk . gov . gchq . gaffer . graph . GraphTest . GRAPH_ID ) . build ( ) ) . addSchema ( new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . type ( "int" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . clazz ( java . lang . Integer . class ) . aggregateFunction ( new uk . gov . gchq . koryphe . impl . binaryoperator . Sum ( ) ) . serialiser ( new uk . gov . gchq . gaffer . serialisation . implementation . raw . RawDoubleSerialiser ( ) ) . build ( ) ) . type ( "string" , new uk . gov . gchq . gaffer . store . schema . TypeDefinition . Builder ( ) . clazz ( java . lang . String . class ) . aggregateFunction ( new uk . gov . gchq . koryphe . impl . binaryoperator . StringConcat ( ) ) . build ( ) ) . type ( "boolean" , uk . gov . gchq . gaffer . graph . Boolean . class ) . edge ( "EDGE" , new uk . gov . gchq . gaffer . store . schema . SchemaEdgeDefinition . Builder ( ) . source ( "string" ) . destination ( "string" ) . directed ( "boolean" ) . build ( ) ) . entity ( "ENTITY" , new uk . gov . gchq . gaffer . store . schema . SchemaEntityDefinition . Builder ( ) . vertex ( "string" ) . property ( "p2" , "int" ) . build ( ) ) . build ( ) ) . storeProperties ( storeProperties ) . build ( ) ; org . junit . Assert . fail ( "exception<sp>expected" ) ; } catch ( final uk . gov . gchq . gaffer . data . elementdefinition . exception . SchemaException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return ( ( ( ( super . getMessage ( ) ) + "<sp>in<sp>string<sp>\'" ) + ( this . visibility ) ) + "\'<sp>at<sp>position<sp>" ) + ( super . getErrorOffset ( ) ) ; } | org . junit . Assert . assertNotNull ( e . getMessage ( ) ) |
getTypeOfEPFD ( ) { "<AssertPlaceHolder>" ; } getTypeOfEPFD ( ) { return fTypeOfEPFD ; } | org . junit . Assert . assertEquals ( 0 , msg . getTypeOfEPFD ( ) ) |
testBadSave ( ) { java . lang . String fileName = "unknown_file" ; java . lang . String appName = "unknown_app" ; long lifetime = 3600L ; java . lang . String queue = "default" ; try { int result = org . apache . hadoop . yarn . service . client . TestApiServiceClient . badAsc . actionSave ( fileName , appName , lifetime , queue ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException | org . apache . hadoop . yarn . exceptions . YarnException e ) { org . junit . Assert . fail ( ) ; } } actionSave ( java . lang . String , java . lang . String , java . lang . Long , java . lang . String ) { int result = EXIT_SUCCESS ; try { org . apache . hadoop . yarn . service . api . records . Service service = loadAppJsonFromLocalFS ( fileName , appName , lifetime , queue ) ; service . setState ( ServiceState . STOPPED ) ; java . lang . String buffer = jsonSerDeser . toJson ( service ) ; com . sun . jersey . api . client . ClientResponse response = getApiClient ( ) . post ( com . sun . jersey . api . client . ClientResponse . class , buffer ) ; result = processResponse ( response ) ; } catch ( java . lang . Exception e ) { org . apache . hadoop . yarn . service . client . ApiServiceClient . LOG . error ( "Fail<sp>to<sp>save<sp>application:<sp>" , e ) ; result = EXIT_EXCEPTION_THROWN ; } return result ; } | org . junit . Assert . assertEquals ( org . apache . hadoop . yarn . service . client . EXIT_EXCEPTION_THROWN , result ) |
testDynamicQuery ( ) { com . github . emailtohl . building . common . jpa . Pager < com . github . emailtohl . building . site . entities . user . User > p = userRepository . dynamicQuery ( PersistenceData . foo , pageable ) ; com . github . emailtohl . building . site . dao . user . UserRepositoryTest . logger . debug ( p . getContent ( ) ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return content ; } | org . junit . Assert . assertNotNull ( p . getContent ( ) ) |
testDoRestore ( ) { java . lang . String params = "params" ; doNothing ( ) . when ( fileResource . fileService ) . doRestoreFiles ( eq ( params ) ) ; javax . ws . rs . core . Response mockResponse = mock ( javax . ws . rs . core . Response . class ) ; doReturn ( mockResponse ) . when ( fileResource ) . buildOkResponse ( ) ; javax . ws . rs . core . Response testResponse = fileResource . doRestore ( params , null ) ; verify ( fileResource , times ( 1 ) ) . buildOkResponse ( ) ; verify ( fileResource . fileService , times ( 1 ) ) . doRestoreFiles ( params ) ; "<AssertPlaceHolder>" ; } doRestoreFiles ( java . lang . String ) { java . lang . String [ ] sourceFileIds = org . pentaho . platform . web . http . api . resources . utils . FileUtils . convertCommaSeparatedStringToArray ( params ) ; try { for ( int i = 0 ; i < ( sourceFileIds . length ) ; i ++ ) { getRepoWs ( ) . undeleteFile ( sourceFileIds [ i ] , null ) ; } } catch ( java . lang . Exception e ) { if ( e instanceof org . pentaho . platform . api . repository2 . unified . UnifiedRepositoryAccessDeniedException ) { throw ( ( org . pentaho . platform . api . repository2 . unified . UnifiedRepositoryAccessDeniedException ) ( e ) ) ; } org . pentaho . platform . web . http . api . resources . services . FileService . logger . error ( org . pentaho . platform . web . http . messages . Messages . getInstance ( ) . getString ( "SystemResource.FILE_RESTORE_FAILED" ) , e ) ; throw new java . lang . InternalError ( ) ; } } | org . junit . Assert . assertEquals ( testResponse , mockResponse ) |
deleteNonRecursiveOnServiceException ( ) { org . mockito . Mockito . when ( mClient . listObjects ( org . mockito . Matchers . any ( com . aliyun . oss . model . ListObjectsRequest . class ) ) ) . thenThrow ( com . aliyun . oss . ServiceException . class ) ; boolean result = mOSSUnderFileSystem . deleteDirectory ( alluxio . underfs . oss . OSSUnderFileSystemTest . PATH , alluxio . underfs . options . DeleteOptions . defaults ( ) . setRecursive ( false ) ) ; "<AssertPlaceHolder>" ; } setRecursive ( boolean ) { bitField0_ |= 2 ; recursive_ = value ; onChanged ( ) ; return this ; } | org . junit . Assert . assertFalse ( result ) |
numberOfElementsTest ( ) { org . openscience . cdk . group . Partition p = new org . openscience . cdk . group . Partition ( ) ; p . addCell ( 0 , 1 ) ; p . addCell ( 2 , 3 ) ; "<AssertPlaceHolder>" ; } numberOfElements ( ) { return this . elements . size ( ) ; } | org . junit . Assert . assertEquals ( 4 , p . numberOfElements ( ) ) |
testDistributedLogProto ( ) { java . lang . Class . forName ( "org.apache.distributedlog.DLSN" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( true ) |
givenObservable_whenError_shouldExecuteTheHook ( ) { io . reactivex . plugins . RxJavaPlugins . setErrorHandler ( ( throwable ) -> { hookCalled = true ; } ) ; io . reactivex . Observable . error ( new java . lang . IllegalStateException ( ) ) . subscribe ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( hookCalled ) |
testGetLicense3 ( ) { org . eclipse . sw360 . licenses . License license = handler . getByID ( todos . values ( ) . iterator ( ) . next ( ) . getId ( ) , user . getDepartment ( ) ) ; "<AssertPlaceHolder>" ; } getDepartment ( ) { return department ; } | org . junit . Assert . assertNull ( license ) |
buildTextSqlParams ( ) { com . blinkfox . zealot . bean . SqlInfo sqlInfo = com . blinkfox . zealot . core . builder . XmlSqlInfoBuilder . newInstace ( new com . blinkfox . zealot . bean . BuildSource ( com . blinkfox . zealot . bean . SqlInfo . newInstance ( ) ) ) . buildTextSqlParams ( "" ) ; "<AssertPlaceHolder>" ; } getJoin ( ) { return join ; } | org . junit . Assert . assertEquals ( "" , sqlInfo . getJoin ( ) . toString ( ) ) |
testPublish_SubscribedQoSZero_MessageQoSZero_MessageNotAddedToQueue ( ) { net . xenqtt . message . PubMessage message = new net . xenqtt . message . PubMessage ( net . xenqtt . message . QoS . AT_MOST_ONCE , false , "grand/foo/bar" , 7 , new byte [ ] { 97 , 98 , 99 } ) ; clientById . put ( "clientId" , client ) ; subscription . publish ( message , clientById ) ; verify ( channel ) . send ( message , null ) ; "<AssertPlaceHolder>" ; } getMessageQueueSize ( ) { try { java . lang . reflect . Field field = net . xenqtt . mockbroker . Subscription . class . getDeclaredField ( "messageQueue" ) ; field . setAccessible ( true ) ; @ net . xenqtt . mockbroker . SuppressWarnings ( "unchecked" ) java . util . Queue < net . xenqtt . message . PubMessage > messageQueue = ( ( java . util . Queue < net . xenqtt . message . PubMessage > ) ( field . get ( subscription ) ) ) ; return messageQueue . size ( ) ; } catch ( java . lang . Exception ex ) { throw new java . lang . RuntimeException ( ex ) ; } } | org . junit . Assert . assertEquals ( 0 , getMessageQueueSize ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.