input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
shouldHandleManyGroups ( ) { int size = 256 ; for ( int i = 0 ; i < size ; i ++ ) { groups . getOrCreate ( ( "" + i ) ) ; } org . neo4j . unsafe . impl . batchimport . cache . idmapping . IdMapper mapper = mapper ( new org . neo4j . unsafe . impl . batchimport . cache . idmapping . string . LongEncoder ( ) , Radix . LONG , org . neo4j . unsafe . impl . batchimport . cache . idmapping . string . EncodingIdMapper . NO_MONITOR ) ; for ( int i = 0 ; i < size ; i ++ ) { mapper . put ( i , i , groups . get ( ( "" + i ) ) ) ; } mapper . prepare ( null , mock ( org . neo4j . unsafe . impl . batchimport . input . Collector . class ) , org . neo4j . unsafe . impl . batchimport . cache . idmapping . string . NONE ) ; for ( int i = 0 ; i < size ; i ++ ) { "<AssertPlaceHolder>" ; } } get ( org . neo4j . unsafe . impl . batchimport . cache . ByteArray , long ) { if ( ( bitCount ) == 1 ) { int field = ( array . getByte ( index , byteOffset ) ) & 255 ; boolean bitIsSet = ( field & ( fbMask ) ) != 0 ; return bitIsSet ? - 1 : 0 ; } else { long field = array . get5ByteLong ( index , byteOffset ) ; long raw = field & ( mask ) ; return raw == ( mask ) ? - 1 : raw ; } }
org . junit . Assert . assertEquals ( i , mapper . get ( i , groups . get ( ( "" + i ) ) ) )
createBareRepository_theResultRepositoryDirectoryShouldEqualToTheInputDirectory ( ) { repo = com . beijunyi . parallelgit . utils . RepositoryUtils . createRepository ( repoDir , true ) ; "<AssertPlaceHolder>" ; } getDirectory ( ) { return directory ; }
org . junit . Assert . assertEquals ( repoDir , repo . getDirectory ( ) )
testGetReportManifest ( ) { System . out . println ( "getReportManifest" ) ; com . intel . mtwilson . as . business . Hostname hostName = null ; com . intel . mtwilson . as . business . ReportsBO instance = new com . intel . mtwilson . as . business . ReportsBO ( ) ; com . intel . mountwilson . as . hostmanifestreport . data . HostManifestReportType expResult = null ; com . intel . mountwilson . as . hostmanifestreport . data . HostManifestReportType result = instance . getReportManifest ( hostName ) ; "<AssertPlaceHolder>" ; org . junit . Assert . fail ( "The<sp>test<sp>case<sp>is<sp>a<sp>prototype." ) ; } getReportManifest ( com . intel . mtwilson . model . Hostname ) { com . intel . mountwilson . as . hostmanifestreport . data . HostManifestReportType hostManifestReportType = new com . intel . mountwilson . as . hostmanifestreport . data . HostManifestReportType ( ) ; com . intel . mtwilson . as . data . TblHosts tblHosts ; try { tblHosts = com . intel . mtwilson . My . jpa ( ) . mwHosts ( ) . findByName ( hostName . toString ( ) ) ; if ( tblHosts == null ) { throw new com . intel . mountwilson . as . common . ASException ( com . intel . mtwilson . i18n . ErrorCode . AS_HOST_NOT_FOUND , hostName . toString ( ) ) ; } java . util . Date lastStatusTs = com . intel . mtwilson . My . jpa ( ) . mwTaLog ( ) . findLastStatusTs ( tblHosts . getId ( ) ) ; if ( lastStatusTs != null ) { com . intel . mtwilson . as . business . List < com . intel . mtwilson . as . data . TblTaLog > logs = com . intel . mtwilson . My . jpa ( ) . mwTaLog ( ) . findLogsByHostId ( tblHosts . getId ( ) , lastStatusTs ) ; com . intel . mountwilson . as . hostmanifestreport . data . HostType hostType = new com . intel . mountwilson . as . hostmanifestreport . data . HostType ( ) ; hostType . setName ( hostName . toString ( ) ) ; if ( logs != null ) { for ( com . intel . mtwilson . as . data . TblTaLog log : logs ) { com . intel . mountwilson . as . hostmanifestreport . data . ManifestType manifest = new com . intel . mountwilson . as . hostmanifestreport . data . ManifestType ( ) ; manifest . setName ( java . lang . Integer . parseInt ( log . getManifestName ( ) ) ) ; manifest . setValue ( log . getManifestValue ( ) ) ; manifest . setVerifiedOn ( com . intel . mtwilson . as . business . trust . Util . getCalendar ( log . getUpdatedOn ( ) ) ) ; manifest . setTrustStatus ( getTrustStatus ( log . getTrustStatus ( ) ) ) ; hostType . getManifest ( ) . add ( manifest ) ; } } hostManifestReportType . setHost ( hostType ) ; } return hostManifestReportType ; } catch ( java . lang . Exception e ) { com . intel . mtwilson . as . business . ReportsBO . logger . error ( "Error<sp>during<sp>retrieval<sp>of<sp>host<sp>trust<sp>report." , e ) ; throw new com . intel . mountwilson . as . common . ASException ( com . intel . mtwilson . i18n . ErrorCode . AS_HOST_REPORT_ERROR , e . getClass ( ) . getSimpleName ( ) ) ; } }
org . junit . Assert . assertEquals ( expResult , result )
testAbortedTransactionPutAndGet ( ) { transactionContext . start ( ) ; org . apache . hadoop . hbase . client . Put put = new org . apache . hadoop . hbase . client . Put ( co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . row ) ; put . add ( co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . family , co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . qualifier , co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . value ) ; transactionAwareHTable . put ( put ) ; transactionContext . abort ( ) ; transactionContext . start ( ) ; org . apache . hadoop . hbase . client . Result result = transactionAwareHTable . get ( new org . apache . hadoop . hbase . client . Get ( co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . row ) ) ; transactionContext . finish ( ) ; byte [ ] value = result . getValue ( co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . family , co . cask . tephra . hbase96 . TransactionAwareHTableTest . TestBytes . qualifier ) ; "<AssertPlaceHolder>" ; } finish ( ) { com . google . common . base . Preconditions . checkState ( ( ( currentTx ) != null ) , "Cannot<sp>finish<sp>tx<sp>that<sp>has<sp>not<sp>been<sp>started" ) ; checkForConflicts ( ) ; persist ( ) ; commit ( ) ; postCommit ( ) ; currentTx = null ; }
org . junit . Assert . assertArrayEquals ( value , null )
testExplicitProvider ( ) { javax . net . ssl . KeyManagerFactory factory = javax . net . ssl . KeyManagerFactory . getInstance ( javax . net . ssl . KeyManagerFactory . getDefaultAlgorithm ( ) ) ; factoryBean . setProvider ( factory . getProvider ( ) . getName ( ) ) ; "<AssertPlaceHolder>" ; } createKeyManagerFactory ( ) { return ( getProvider ( ) ) != null ? javax . net . ssl . KeyManagerFactory . getInstance ( getAlgorithm ( ) , getProvider ( ) ) : javax . net . ssl . KeyManagerFactory . getInstance ( getAlgorithm ( ) ) ; }
org . junit . Assert . assertNotNull ( factoryBean . createKeyManagerFactory ( ) )
testMultiCoverage ( ) { java . io . File testDir = tempFolder . newFolder ( "multi-coverage" ) ; java . net . URL testUrl = org . geotools . util . URLs . fileToUrl ( testDir ) ; org . apache . commons . io . FileUtils . copyDirectory ( org . geotools . test . TestData . file ( this , "multi-coverage" ) , testDir ) ; org . geotools . gce . imagemosaic . ImageMosaicReader reader = null ; try { reader = new org . geotools . gce . imagemosaic . ImageMosaicReader ( testUrl ) ; "<AssertPlaceHolder>" ; checkMultiCoverage ( reader , "air_temperature" , ( - 85 ) , 26 , "2017-02-06T00:00:00.000" , 295 ) ; checkMultiCoverage ( reader , "sea_surface_temperature" , ( - 85 ) , 26 , "2017-02-06T00:00:00.000" , 296 ) ; checkMultiCoverage ( reader , "air_temperature" , ( - 85 ) , 26 , "2017-02-06T12:00:00.000" , 296 ) ; checkMultiCoverage ( reader , "sea_surface_temperature" , ( - 85 ) , 26 , "2017-02-06T12:00:00.000" , 295 ) ; } finally { if ( reader != null ) { reader . dispose ( ) ; } } } file ( java . lang . Object , java . lang . String ) { final java . net . URL url = org . geotools . test . TestData . url ( caller , path ) ; final java . io . File file = new java . io . File ( java . net . URLDecoder . decode ( url . getPath ( ) , org . geotools . test . TestData . ENCODING ) ) ; if ( ! ( file . exists ( ) ) ) { throw new java . io . FileNotFoundException ( ( ( "Can<sp>not<sp>locate<sp>test-data<sp>for<sp>\"" + path ) + '"' ) ) ; } return file ; }
org . junit . Assert . assertNotNull ( reader )
contains_should_return_true_when_doc_exists ( ) { doReturn ( Boolean . TRUE ) . when ( db ) . contains ( "doc_id" ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return db . contains ( docId ) ; }
org . junit . Assert . assertTrue ( repo . contains ( "doc_id" ) )
testMemCopy_fullblock ( ) { a = create ( 2 , 5 , 0 , null ) ; int [ ] data = new int [ ] { 1 , 2 , 3 , 4 , 5 } ; int [ ] out = new int [ 5 ] ; int p1 = a . malloc ( ) ; int p2 = a . malloc ( ) ; a . setInts ( p1 , 0 , data , 0 , a . blockSize ( ) ) ; a . memCopy ( p1 , 0 , p2 , 0 , a . blockSize ( ) ) ; a . getInts ( p2 , 0 , out , 0 , a . blockSize ( ) ) ; "<AssertPlaceHolder>" ; a . free ( p1 ) ; a . free ( p2 ) ; } blockSize ( ) { return m_blocks . blockSize ( ) ; }
org . junit . Assert . assertArrayEquals ( data , out )
testInnerSingleRelativeInheritance ( ) { java . lang . String MANIFEST_LOCATION = "testData/manifestTest/inheritance/04" ; java . lang . String manifestName = "prod-manifest.yml" ; java . net . URL entry = org . eclipse . orion . server . tests . ServerTestsActivator . getContext ( ) . getBundle ( ) . getEntry ( MANIFEST_LOCATION ) ; org . eclipse . core . filesystem . IFileStore fs = org . eclipse . core . filesystem . EFS . getStore ( org . eclipse . core . filesystem . URIUtil . toURI ( org . eclipse . core . runtime . FileLocator . toFileURL ( entry ) . getPath ( ) . concat ( manifestName ) ) ) ; org . eclipse . orion . server . cf . manifest . v2 . ManifestParseTree manifest = org . eclipse . orion . server . cf . manifest . v2 . utils . ManifestUtils . parse ( fs . getParent ( ) , fs ) ; org . eclipse . orion . server . cf . manifest . v2 . ManifestParseTree applications = manifest . get ( "applications" ) ; "<AssertPlaceHolder>" ; } getChildren ( ) { return ( ( org . eclipse . core . runtime . IStatus [ ] ) ( statuses . toArray ( ) ) ) ; }
org . junit . Assert . assertEquals ( 2 , applications . getChildren ( ) . size ( ) )
test ( ) { com . arjuna . orbportability . ORB myORB = null ; com . arjuna . orbportability . RootOA myOA = null ; myORB = com . arjuna . orbportability . ORB . getInstance ( "test" ) ; myOA = com . arjuna . orbportability . OA . getRootOA ( myORB ) ; myORB . initORB ( new java . lang . String [ ] { } , null ) ; myOA . initOA ( ) ; com . arjuna . ats . internal . jts . ORBManager . setORB ( myORB ) ; com . arjuna . ats . internal . jts . ORBManager . setPOA ( myOA ) ; org . omg . CosTransactions . TransactionFactory theOTS = null ; org . omg . CosTransactions . Control topLevelControl = null ; org . omg . CosTransactions . Control nestedControl = null ; java . lang . String server = "/tmp/hammer1.ref" ; boolean slave = false ; if ( java . lang . System . getProperty ( "os.name" ) . startsWith ( "Windows" ) ) { server = "Windows" 1 ; } com . arjuna . orbportability . Services serv = new com . arjuna . orbportability . Services ( myORB ) ; int resolver = com . arjuna . orbportability . Services . getResolver ( ) ; try { java . lang . String [ ] params = new java . lang . String [ 1 ] ; params [ 0 ] = com . arjuna . orbportability . Services . otsKind ; org . omg . CORBA . Object obj = serv . getService ( Services . transactionService , params , resolver ) ; params = null ; theOTS = org . omg . CosTransactions . TransactionFactoryHelper . narrow ( obj ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Windows" 0 + e ) ) ; e . printStackTrace ( System . err ) ; } System . out . println ( "Creating<sp>transaction." ) ; try { topLevelControl = theOTS . create ( 0 ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Create<sp>call<sp>failed:<sp>" + e ) ) ; e . printStackTrace ( System . err ) ; } System . out . println ( "Windows" 3 ) ; try { nestedControl = topLevelControl . get_coordinator ( ) . create_subtransaction ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( ( "Windows" 2 + e ) ) ; try { topLevelControl . get_terminator ( ) . rollback ( ) ; } catch ( java . lang . Exception ex ) { } e . printStackTrace ( System . err ) ; org . junit . Assert . fail ( ) ; } try { com . hp . mwtests . ts . jts . orbspecific . resources . DistributedHammerWorker1 . hammerObject_1 = com . hp . mwtests . ts . jts . TestModule . HammerHelper . narrow ( serv . getService ( server , null , Services . FILE ) ) ; if ( ! ( DistributedHammerWorker1 . hammerObject_1 . incr ( 1 , nestedControl ) ) ) System . out . println ( "Could<sp>not<sp>increment!" ) ; else System . out . println ( "incremented." ) ; System . out . println ( "sleeping." ) ; java . lang . Thread . sleep ( 20000 ) ; nestedControl . get_terminator ( ) . rollback ( ) ; if ( ! slave ) { System . out . println ( "master<sp>sleeping<sp>again." ) ; java . lang . Thread . sleep ( 20000 ) ; } org . omg . CORBA . IntHolder value = new org . omg . CORBA . IntHolder ( 0 ) ; org . omg . CosTransactions . PropagationContext ctx = topLevelControl . get_coordinator ( ) . get_txcontext ( ) ; "<AssertPlaceHolder>" ; topLevelControl . get_terminator ( ) . rollback ( ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ( "Windows" 4 + e ) ) ; e . printStackTrace ( System . err ) ; } myOA . destroy ( ) ; myORB . shutdown ( ) ; } get ( javax . enterprise . context . spi . Contextual , javax . enterprise . context . spi . CreationalContext ) { if ( ! ( isActive ( ) ) ) { throw new javax . enterprise . context . ContextNotActiveException ( ) ; } if ( contextual == null ) { throw new java . lang . RuntimeException ( "contextual<sp>is<sp>null" ) ; } javax . enterprise . inject . spi . PassivationCapable bean = ( ( javax . enterprise . inject . spi . PassivationCapable ) ( contextual ) ) ; java . util . Map beans = getBeansForThisTransaction ( ) ; java . lang . Object resource = beans . get ( bean . getId ( ) ) ; if ( resource != null ) { return ( ( T ) ( resource ) ) ; } else if ( creationalContext != null ) { T t = contextual . create ( creationalContext ) ; beans . put ( bean . getId ( ) , t ) ; return t ; } else { return null ; } }
org . junit . Assert . assertTrue ( DistributedHammerWorker1 . hammerObject_1 . get ( value , topLevelControl ) )
testObtainArtifactResolverService ( ) { io . fabric8 . maven . core . service . Fabric8ServiceHub hub = new io . fabric8 . maven . core . service . Fabric8ServiceHub . Builder ( ) . clusterAccess ( clusterAccess ) . log ( logger ) . platformMode ( RuntimeMode . kubernetes ) . mavenProject ( mavenProject ) . repositorySystem ( repositorySystem ) . build ( ) ; "<AssertPlaceHolder>" ; } getArtifactResolverService ( ) { return ( ( io . fabric8 . maven . core . service . ArtifactResolverService ) ( this . services . get ( io . fabric8 . maven . core . service . ArtifactResolverService . class ) . get ( ) ) ) ; }
org . junit . Assert . assertNotNull ( hub . getArtifactResolverService ( ) )
testName ( ) { org . kefirsf . bb . conf . Code code = new org . kefirsf . bb . conf . Code ( ) ; code . setName ( org . kefirsf . bb . conf . CodeTest . CODE_NAME ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( org . kefirsf . bb . conf . CodeTest . CODE_NAME , code . getName ( ) )
testNullParamListItem ( ) { final java . lang . Object result = simpleKeyIndexDefinition . createValue ( java . util . Arrays . asList ( "2" , null ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( result )
exactUrlOnly ( ) { io . kubernetes . client . ApiClient client = new io . kubernetes . client . ApiClient ( ) ; client . setBasePath ( ( "http://localhost:" + ( io . kubernetes . client . examples . ExampleTest . PORT ) ) ) ; io . kubernetes . client . Configuration . setDefaultApiClient ( client ) ; io . kubernetes . client . models . V1Namespace ns1 = new io . kubernetes . client . models . V1Namespace ( ) . metadata ( new io . kubernetes . client . models . V1ObjectMeta ( ) . name ( "name" ) ) ; stubFor ( get ( urlEqualTo ( "/api/v1/namespaces/name" ) ) . willReturn ( aResponse ( ) . withHeader ( "Content-Type" , "application/json" ) . withBody ( client . getJSON ( ) . serialize ( ns1 ) ) ) ) ; io . kubernetes . client . apis . CoreV1Api api = new io . kubernetes . client . apis . CoreV1Api ( ) ; io . kubernetes . client . models . V1Namespace ns2 = api . readNamespace ( "name" , null , null , null ) ; "<AssertPlaceHolder>" ; } readNamespace ( java . lang . String , java . lang . String , java . lang . Boolean , java . lang . Boolean ) { io . kubernetes . client . ApiResponse < io . kubernetes . client . models . V1Namespace > resp = readNamespaceWithHttpInfo ( name , pretty , exact , export ) ; return resp . getData ( ) ; }
org . junit . Assert . assertEquals ( ns1 , ns2 )
testPackFloatDoubleEquivalent ( ) { for ( int i = 0 ; i <= 65536 ; i += com . jogamp . opengl . test . junit . jogl . math . TestBinary16NOUI . stepping ) { final float f_in = i ; final double d_in = i ; final char pf = com . jogamp . opengl . math . Binary16 . packFloat ( f_in ) ; final char pd = com . jogamp . opengl . math . Binary16 . packDouble ( d_in ) ; if ( com . jogamp . opengl . test . junit . jogl . math . TestBinary16NOUI . verbose ) { System . out . println ( ( "i:<sp>" + i ) ) ; System . out . println ( java . lang . String . format ( "pack_f:<sp>0x%04x<sp>0b%s" , ( ( int ) ( pf ) ) , com . jogamp . opengl . math . Binary16 . toRawBinaryString ( pf ) ) ) ; System . out . println ( java . lang . String . format ( "pack_d:<sp>0x%04x<sp>0b%s" , ( ( int ) ( pd ) ) , com . jogamp . opengl . math . Binary16 . toRawBinaryString ( pd ) ) ) ; } "<AssertPlaceHolder>" ; } } toRawBinaryString ( char ) { final java . lang . StringBuilder b = new java . lang . StringBuilder ( ) ; int z = k ; for ( int i = 0 ; i < 16 ; ++ i ) { if ( ( z & 1 ) == 1 ) { b . insert ( 0 , "1" ) ; } else { b . insert ( 0 , "0" ) ; } z >>= 1 ; } return b . toString ( ) ; }
org . junit . Assert . assertEquals ( pf , pd )
testAdaptNull ( ) { "<AssertPlaceHolder>" ; } adapt ( org . apache . commons . functor . BinaryPredicate ) { return null == predicate ? null : new org . apache . commons . functor . adapter . BinaryPredicatePredicate < A > ( predicate ) ; }
org . junit . Assert . assertNull ( org . apache . commons . functor . adapter . BinaryPredicatePredicate . adapt ( null ) )
testValideerCorrectieInhoud ( ) { final nl . bzk . brp . bijhouding . bericht . model . CorrectieVervalGeboorteGerelateerde actie = maakBasisActie ( new nl . bzk . brp . bijhouding . bericht . model . ElementBuilder . PersoonParameters ( ) ) ; "<AssertPlaceHolder>" ; } valideerCorrectieInhoud ( ) { return VALIDATIE_OK ; }
org . junit . Assert . assertEquals ( 0 , actie . valideerCorrectieInhoud ( ) . size ( ) )
applySerialSuffixWithPadding_SimpleSuffixProperty ( ) { final java . util . Properties props = new java . util . Properties ( ) ; final java . lang . String s = "foo" ; props . setProperty ( VersioningState . INCREMENT_SERIAL_SUFFIX_SYSPROP . getCurrent ( ) , s ) ; props . setProperty ( VersioningState . INCREMENT_SERIAL_SUFFIX_PADDING_SYSPROP . getCurrent ( ) , "3" ) ; setupSession ( props ) ; final java . lang . String originalVersion = "1.0.0.Final" ; final java . lang . String calcdVersion = "1.0.0.Final-foo-001" ; final java . lang . String result = calculate ( originalVersion ) ; "<AssertPlaceHolder>" ; } calculate ( java . lang . String ) { return modder . calculate ( org . commonjava . maven . ext . core . impl . VersioningCalculatorTest . GROUP_ID , org . commonjava . maven . ext . core . impl . VersioningCalculatorTest . ARTIFACT_ID , version , session ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . equalTo ( calcdVersion ) )
canResolveAllImports ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( true )
shouldExportWildcardQueryWithAllOptions ( ) { com . couchbase . client . java . search . queries . WildcardQuery fts = com . couchbase . client . java . search . SearchQuery . wildcard ( "some*term?" ) . boost ( 1.5 ) . field ( "field" ) ; com . couchbase . client . java . search . SearchQuery query = new com . couchbase . client . java . search . SearchQuery ( "foo" , fts ) . limit ( 10 ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "query" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "wildcard" , "some*term?" ) . put ( "boost" , 1.5 ) . put ( "field" , "field" ) ) . put ( "size" , 10 ) ; "<AssertPlaceHolder>" ; } export ( ) { return "INSERT<sp>INTO<sp>" + ( bucket . toString ( ) ) ; }
org . junit . Assert . assertEquals ( expected , query . export ( ) )
testAtomicBoolean ( ) { java . util . concurrent . atomic . AtomicBoolean a = new java . util . concurrent . atomic . AtomicBoolean ( ) ; com . github . davidmoten . rx . Actions . setAtomic ( a ) . call ( true ) ; "<AssertPlaceHolder>" ; } get ( ) { if ( present ) return value ; else throw new com . github . davidmoten . util . Optional . NotPresentException ( ) ; }
org . junit . Assert . assertTrue ( a . get ( ) )
checkMeanVarianceEstimateCNNCompareModes ( ) { org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; org . deeplearning4j . nn . conf . MultiLayerConfiguration conf = new org . deeplearning4j . nn . conf . NeuralNetConfiguration . Builder ( ) . optimizationAlgo ( OptimizationAlgorithm . STOCHASTIC_GRADIENT_DESCENT ) . updater ( Updater . RMSPROP ) . seed ( 12345 ) . list ( ) . layer ( 0 , new org . deeplearning4j . nn . conf . layers . BatchNormalization . Builder ( ) . nIn ( 3 ) . nOut ( 3 ) . eps ( 1.0E-5 ) . decay ( 0.95 ) . useLogStd ( false ) . build ( ) ) . layer ( 1 , new org . deeplearning4j . nn . layers . normalization . OutputLayer . Builder ( LossFunctions . LossFunction . MSE ) . weightInit ( WeightInit . XAVIER ) . activation ( Activation . IDENTITY ) . nOut ( 10 ) . build ( ) ) . setInputType ( org . deeplearning4j . nn . conf . inputs . InputType . convolutional ( 5 , 5 , 3 ) ) . build ( ) ; org . deeplearning4j . nn . multilayer . MultiLayerNetwork net = new org . deeplearning4j . nn . multilayer . MultiLayerNetwork ( conf ) ; net . init ( ) ; org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; org . deeplearning4j . nn . conf . MultiLayerConfiguration conf2 = new org . deeplearning4j . nn . conf . NeuralNetConfiguration . Builder ( ) . optimizationAlgo ( OptimizationAlgorithm . STOCHASTIC_GRADIENT_DESCENT ) . updater ( Updater . RMSPROP ) . seed ( 12345 ) . list ( ) . layer ( 0 , new org . deeplearning4j . nn . conf . layers . BatchNormalization . Builder ( ) . nIn ( 3 ) . nOut ( 3 ) . eps ( 1.0E-5 ) . decay ( 0.95 ) . useLogStd ( true ) . build ( ) ) . layer ( 1 , new org . deeplearning4j . nn . layers . normalization . OutputLayer . Builder ( LossFunctions . LossFunction . MSE ) . weightInit ( WeightInit . XAVIER ) . activation ( Activation . IDENTITY ) . nOut ( 10 ) . build ( ) ) . setInputType ( org . deeplearning4j . nn . conf . inputs . InputType . convolutional ( 5 , 5 , 3 ) ) . build ( ) ; org . deeplearning4j . nn . multilayer . MultiLayerNetwork net2 = new org . deeplearning4j . nn . multilayer . MultiLayerNetwork ( conf2 ) ; net2 . init ( ) ; int minibatch = 32 ; for ( int i = 0 ; i < 10 ; i ++ ) { org . nd4j . linalg . dataset . DataSet ds = new org . nd4j . linalg . dataset . DataSet ( org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { minibatch , 3 , 5 , 5 } ) , org . nd4j . linalg . factory . Nd4j . rand ( minibatch , 10 ) ) ; net . fit ( ds ) ; net2 . fit ( ds ) ; org . nd4j . linalg . api . ndarray . INDArray globalVar = net . getParam ( ( "0_" + ( org . deeplearning4j . nn . params . BatchNormalizationParamInitializer . GLOBAL_VAR ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray log10std = net2 . getParam ( ( "0_" + ( org . deeplearning4j . nn . params . BatchNormalizationParamInitializer . GLOBAL_LOG_STD ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray globalVar2 = org . nd4j . linalg . factory . Nd4j . valueArrayOf ( log10std . shape ( ) , 10.0 ) ; org . nd4j . linalg . ops . transforms . Transforms . pow ( globalVar2 , log10std , false ) ; globalVar2 . muli ( globalVar2 ) ; "<AssertPlaceHolder>" ; } } muli ( org . nd4j . autodiff . samediff . SDVariable ) { return muli ( sameDiff . generateNewVarName ( MulOp . OP_NAME , 0 ) , sameDiffVariable ) ; }
org . junit . Assert . assertEquals ( globalVar , globalVar2 )
unwrapp ( ) { "<AssertPlaceHolder>" ; org . mariadb . jdbc . MariaDbConnection cc = sharedConnection . unwrap ( org . mariadb . jdbc . MariaDbConnection . class ) ; } isWrapperFor ( java . lang . Class ) { return interfaceOrWrapper . isInstance ( this ) ; }
org . junit . Assert . assertTrue ( sharedConnection . isWrapperFor ( org . mariadb . jdbc . MariaDbConnection . class ) )
testSerialization ( ) { org . jfree . chart . plot . PolarPlot p1 = new org . jfree . chart . plot . PolarPlot ( ) ; p1 . setAngleGridlinePaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; p1 . setAngleLabelPaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; p1 . setRadiusGridlinePaint ( new java . awt . GradientPaint ( 1.0F , 2.0F , java . awt . Color . red , 3.0F , 4.0F , java . awt . Color . blue ) ) ; org . jfree . chart . plot . PolarPlot p2 = ( ( org . jfree . chart . plot . PolarPlot ) ( org . jfree . chart . TestUtilities . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( p1 , p2 )
operationProjectAllWithAdminPermission ( ) { for ( org . apache . kylin . metadata . project . ProjectInstance project : org . apache . ranger . authorization . kylin . authorizer . RangerKylinAuthorizerTest . uuid2Projects . values ( ) ) { boolean result = aclEvaluate . hasProjectOperationPermission ( project ) ; "<AssertPlaceHolder>" ; } }
org . junit . Assert . assertTrue ( result )
testGetFacetsResponseIncludingTagWithNoAssociatedBdefsNewTagType ( ) { org . finra . herd . model . dto . ElasticsearchResponseDto elasticsearchResponseDto = new org . finra . herd . model . dto . ElasticsearchResponseDto ( ) ; java . util . List < org . finra . herd . model . dto . TagTypeIndexSearchResponseDto > nestTagTypeIndexSearchResponseDtos = new java . util . ArrayList ( ) ; org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagType1 = new org . finra . herd . model . dto . TagTypeIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE , null , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME ) ; org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagType2 = new org . finra . herd . model . dto . TagTypeIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_2 , java . util . Collections . singletonList ( new org . finra . herd . model . dto . TagIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE , 1 , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME ) ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_2 ) ; nestTagTypeIndexSearchResponseDtos . add ( tagType1 ) ; nestTagTypeIndexSearchResponseDtos . add ( tagType2 ) ; elasticsearchResponseDto . setNestTagTypeIndexSearchResponseDtos ( nestTagTypeIndexSearchResponseDtos ) ; org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagType3 = new org . finra . herd . model . dto . TagTypeIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_3 , java . util . Collections . singletonList ( new org . finra . herd . model . dto . TagIndexSearchResponseDto ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_2 , 1 , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME_2 ) ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_3 ) ; java . util . List < org . finra . herd . model . dto . TagTypeIndexSearchResponseDto > tagTypeIndexSearchResponseDtos = new java . util . ArrayList ( ) ; tagTypeIndexSearchResponseDtos . add ( tagType3 ) ; elasticsearchResponseDto . setTagTypeIndexSearchResponseDtos ( tagTypeIndexSearchResponseDtos ) ; java . util . List < org . finra . herd . model . api . xml . Facet > facets = elasticsearchHelper . getFacetsResponse ( elasticsearchResponseDto , org . finra . herd . dao . helper . BUSINESS_OBJECT_DEFINITION_SEARCH_INDEX_NAME , org . finra . herd . dao . helper . TAG_SEARCH_INDEX_NAME ) ; java . util . List < org . finra . herd . model . api . xml . Facet > expectedFacets = new java . util . ArrayList ( ) ; expectedFacets . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME , null , FacetTypeEnum . TAG_TYPE . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE , new java . util . ArrayList ( ) ) ) ; java . util . List < org . finra . herd . model . api . xml . Facet > tagFacet = new java . util . ArrayList ( ) ; tagFacet . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME , 1L , FacetTypeEnum . TAG . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE , null ) ) ; java . util . List < org . finra . herd . model . api . xml . Facet > newTagFacet = new java . util . ArrayList ( ) ; newTagFacet . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_DISPLAY_NAME_2 , 1L , FacetTypeEnum . TAG . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_CODE_2 , null ) ) ; expectedFacets . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_2 , null , FacetTypeEnum . TAG_TYPE . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_2 , tagFacet ) ) ; expectedFacets . add ( new org . finra . herd . model . api . xml . Facet ( org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_DISPLAY_NAME_3 , null , FacetTypeEnum . TAG_TYPE . value ( ) , org . finra . herd . dao . helper . ElasticSearchHelperTest . TAG_TYPE_CODE_3 , newTagFacet ) ) ; "<AssertPlaceHolder>" ; } getFacetsResponse ( org . finra . herd . model . dto . ElasticsearchResponseDto , java . lang . String , java . lang . String ) { java . util . List < org . finra . herd . model . api . xml . Facet > facets = new java . util . ArrayList ( ) ; java . util . List < org . finra . herd . model . api . xml . Facet > tagTypeFacets ; if ( ( elasticsearchResponseDto . getNestTagTypeIndexSearchResponseDtos ( ) ) != null ) { tagTypeFacets = new java . util . ArrayList ( ) ; for ( org . finra . herd . model . dto . TagTypeIndexSearchResponseDto tagTypeIndexSearchResponseDto : elasticsearchResponseDto . getNestTagTypeIndexSearchResponseDtos ( ) ) { tagTypeFacets . add ( createTagTypeFacet ( tagTypeIndexSearchResponseDto ) ) ; } facets . addAll (
org . junit . Assert . assertEquals ( expectedFacets , facets )
testBug1014 ( ) { java . util . List < com . graphhopper . routing . util . TestAlgoCollector . OneRun > list = new java . util . ArrayList ( ) ; com . graphhopper . routing . util . TestAlgoCollector . OneRun run = new com . graphhopper . routing . util . TestAlgoCollector . OneRun ( ) ; run . add ( 50.015861 , 11.51041 , 0 , 0 ) ; run . add ( 50.019129 , 11.500325 , 0 , 0 ) ; run . add ( 50.023623 , 11.56929 , 6777 , 175 ) ; list . add ( run ) ; runAlgo ( testCollector , ( ( com . graphhopper . GraphHopperIT . DIR ) + "/north-bayreuth.osm.gz" ) , "target/north-bayreuth-gh" , list , "bike" , true , "bike" , "fastest" , false ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "OSM<sp>File<sp>header:" + ( super . toString ( ) ) ; }
org . junit . Assert . assertEquals ( testCollector . toString ( ) , 0 , testCollector . errors . size ( ) )
add_subwordLast ( ) { dawgBuilder . add ( "JIM" ) ; org . junit . Assume . assumeThat ( dawgBuilder . wordCount ( ) , org . hamcrest . Matchers . is ( 1 ) ) ; dawgBuilder . add ( "JIMMY" ) ; "<AssertPlaceHolder>" ; } wordCount ( ) { return wordCount ; }
org . junit . Assert . assertThat ( dawgBuilder . wordCount ( ) , org . hamcrest . Matchers . is ( 2 ) )
testAnalyzeStringString ( ) { java . lang . String c1 = "" + ( ( ( ( "class<sp>X<sp>{" + "public<sp>void<sp>foo0()<sp>{" ) + "<sp>int<sp>x<sp>=<sp>0;" ) + "}" ) + "};" ) ; java . lang . String c2 = "" + ( ( ( ( "class<sp>X<sp>{" + "public<sp>void<sp>foo1()<sp>{" ) + "<sp>int<sp>x<sp>=<sp>0;" ) + "}" ) + "};" ) ; gumtree . spoon . AstComparator diff = new gumtree . spoon . AstComparator ( ) ; gumtree . spoon . diff . Diff editScript = diff . compare ( c1 , c2 ) ; "<AssertPlaceHolder>" ; } getRootOperations ( ) { return java . util . Collections . unmodifiableList ( rootOperations ) ; }
org . junit . Assert . assertTrue ( ( ( editScript . getRootOperations ( ) . size ( ) ) == 1 ) )
testListEvents ( ) { org . candlepin . resource . EventResource er = new org . candlepin . resource . EventResource ( ec , null , injector . getInstance ( org . candlepin . audit . EventAdapter . class ) , translator ) ; org . candlepin . model . CandlepinQuery cpQueryMock = mock ( org . candlepin . model . CandlepinQuery . class ) ; java . util . List < org . candlepin . audit . Event > events = new java . util . ArrayList ( ) ; events . add ( getEvent ( ) ) ; java . util . List < org . candlepin . dto . api . v1 . EventDTO > eventDTOs = new java . util . ArrayList ( ) ; eventDTOs . add ( getEventDTO ( ) ) ; when ( ec . listAll ( ) ) . thenReturn ( cpQueryMock ) ; when ( cpQueryMock . list ( ) ) . thenReturn ( events ) ; when ( translator . translate ( any ( org . candlepin . audit . Event . class ) , any ( java . lang . Class . class ) ) ) . thenReturn ( getEventDTO ( ) ) ; "<AssertPlaceHolder>" ; } listEvents ( ) { java . util . List < org . candlepin . audit . Event > events = eventCurator . listAll ( ) . list ( ) ; java . util . List < org . candlepin . dto . api . v1 . EventDTO > eventDTOs = null ; if ( events != null ) { eventAdapter . addMessageText ( events ) ; eventDTOs = new java . util . ArrayList ( ) ; for ( org . candlepin . audit . Event event : events ) { eventDTOs . add ( this . translator . translate ( event , org . candlepin . dto . api . v1 . EventDTO . class ) ) ; } } return eventDTOs ; }
org . junit . Assert . assertEquals ( eventDTOs , er . listEvents ( ) )
spaceMergesOntologies ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( true )
validate_statusIsNotSet_returnsFalse ( ) { boolean result = request . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
testCompileWithNullDependencies ( ) { io . cloudslang . lang . compiler . SlangSource tempFile = createTempFile ( ) ; org . mockito . Mockito . when ( compiler . compile ( any ( io . cloudslang . lang . compiler . SlangSource . class ) , anySetOf ( io . cloudslang . lang . compiler . SlangSource . class ) , any ( io . cloudslang . lang . compiler . PrecompileStrategy . class ) ) ) . thenReturn ( io . cloudslang . lang . api . SlangImplTest . emptyCompilationArtifact ) ; io . cloudslang . lang . entities . CompilationArtifact compilationArtifact = slang . compile ( tempFile , null ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( compiler ) . compile ( eq ( tempFile ) , eq ( new java . util . HashSet < io . cloudslang . lang . compiler . SlangSource > ( ) ) , eq ( PrecompileStrategy . WITHOUT_CACHE ) ) ; } compile ( java . lang . String , java . util . List ) { java . io . File file = slangCompilationService . getFile ( filePath ) ; try { return slang . compile ( io . cloudslang . lang . compiler . SlangSource . fromFile ( file ) , getDependencySources ( dependencies , file ) ) ; } catch ( java . lang . Exception e ) { handleException ( file , e ) ; return null ; } }
org . junit . Assert . assertNotNull ( compilationArtifact )
testLinkedMapPropertyLinkedClass ( ) { com . orientechnologies . orient . core . metadata . schema . OSchema schema = db . getMetadata ( ) . getSchema ( ) ; com . orientechnologies . orient . core . metadata . schema . OClass classA = schema . createClass ( "TestMapProperty" ) ; com . orientechnologies . orient . core . metadata . schema . OClass classLinked = schema . createClass ( "LinkedClass" ) ; try { classA . createProperty ( "propertyString" , OType . STRING , classLinked ) ; org . junit . Assert . fail ( "create<sp>linkmap<sp>property<sp>should<sp>not<sp>allow<sp>linked<sp>type" ) ; } catch ( com . orientechnologies . orient . core . exception . OSchemaException e ) { } com . orientechnologies . orient . core . metadata . schema . OProperty prop = classA . getProperty ( "propertyString" ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { setCurrentGraphInThreadLocal ( ) ; if ( ( rawElement ) == null ) return null ; return super . getProperty ( key ) ; }
org . junit . Assert . assertNull ( prop )
createAttributeValueList ( ) { org . finra . herd . model . api . xml . AttributeValueListKey attributeValueListKey = new org . finra . herd . model . api . xml . AttributeValueListKey ( ATTRIBUTE_VALUE_LIST_NAMESPACE , ATTRIBUTE_VALUE_LIST_NAME ) ; org . finra . herd . model . api . xml . AttributeValueListCreateRequest request = new org . finra . herd . model . api . xml . AttributeValueListCreateRequest ( attributeValueListKey ) ; org . finra . herd . model . jpa . NamespaceEntity namespaceEntity = new org . finra . herd . model . jpa . NamespaceEntity ( ) ; namespaceEntity . setCode ( org . finra . herd . service . ATTRIBUTE_VALUE_LIST_NAMESPACE ) ; org . finra . herd . model . jpa . AttributeValueListEntity attributeValueListEntity = new org . finra . herd . model . jpa . AttributeValueListEntity ( ) ; attributeValueListEntity . setId ( org . finra . herd . service . ATTRIBUTE_VALUE_LIST_ID ) ; attributeValueListEntity . setNamespace ( namespaceEntity ) ; attributeValueListEntity . setName ( org . finra . herd . service . ATTRIBUTE_VALUE_LIST_NAME ) ; when ( namespaceDaoHelper . getNamespaceEntity ( org . finra . herd . service . ATTRIBUTE_VALUE_LIST_NAMESPACE ) ) . thenReturn ( namespaceEntity ) ; when ( attributeValueListDao . getAttributeValueListByKey ( attributeValueListKey ) ) . thenReturn ( null ) ; when ( attributeValueListDao . saveAndRefresh ( any ( org . finra . herd . model . jpa . AttributeValueListEntity . class ) ) ) . thenReturn ( attributeValueListEntity ) ; when ( attributeValueListDaoHelper . createAttributeValueListFromEntity ( attributeValueListEntity ) ) . thenCallRealMethod ( ) ; org . finra . herd . model . api . xml . AttributeValueList result = attributeValueListService . createAttributeValueList ( request ) ; verify ( attributeValueListHelper ) . validateAttributeValueListCreateRequest ( request ) ; verify ( namespaceDaoHelper ) . getNamespaceEntity ( org . finra . herd . service . ATTRIBUTE_VALUE_LIST_NAMESPACE ) ; verify ( attributeValueListDao ) . getAttributeValueListByKey ( attributeValueListKey ) ; verify ( attributeValueListDao ) . saveAndRefresh ( any ( org . finra . herd . model . jpa . AttributeValueListEntity . class ) ) ; verify ( attributeValueListDaoHelper ) . createAttributeValueListFromEntity ( attributeValueListEntity ) ; verifyNoMoreInteractionsHelper ( ) ; "<AssertPlaceHolder>" ; } verifyNoMoreInteractionsHelper ( ) { verifyNoMoreInteractions ( awsHelper , javaPropertiesHelper , retryPolicyFactory , s3Operations ) ; }
org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . AttributeValueList ( ATTRIBUTE_VALUE_LIST_ID , attributeValueListKey ) , result )
testEmptyFolderCommitted ( ) { org . eclipse . jgit . revwalk . RevCommit commit = createEmptyFolderAndCommit ( ) ; org . eclipse . jgit . treewalk . TreeWalk treeWalk = createTreeWalk ( commit ) ; "<AssertPlaceHolder>" ; } next ( ) { org . eclipse . jgit . treewalk . CanonicalTreeParser p = this ; for ( ; ; ) { if ( ( p . nextPtr ) == ( p . raw . length ) ) { if ( ( p . parent ) == null ) { p . currPtr = p . nextPtr ; return p ; } p = ( ( org . eclipse . jgit . treewalk . CanonicalTreeParser ) ( p . parent ) ) ; continue ; } p . prevPtr = p . currPtr ; p . currPtr = p . nextPtr ; p . parseEntry ( ) ; return p ; } }
org . junit . Assert . assertFalse ( treeWalk . next ( ) )
testIntersectionOfTwoLists_NoDuplicates_NoDuplicates_Test2 ( ) { java . util . List < java . lang . Integer > listOne = new java . util . ArrayList < java . lang . Integer > ( ) ; listOne . add ( 1000 ) ; listOne . add ( 2000 ) ; listOne . add ( 3000 ) ; listOne . add ( 4000 ) ; listOne . add ( 5000 ) ; listOne . add ( 6000 ) ; java . util . List < java . lang . Integer > listTwo = new java . util . ArrayList < java . lang . Integer > ( ) ; listTwo . add ( 3000 ) ; listTwo . add ( 4000 ) ; listTwo . add ( 5000 ) ; listTwo . add ( 7000 ) ; listTwo . add ( 8000 ) ; listTwo . add ( 9000 ) ; java . util . List < java . lang . Integer > expected = new java . util . ArrayList < java . lang . Integer > ( ) ; expected . add ( 3000 ) ; expected . add ( 4000 ) ; expected . add ( 5000 ) ; java . util . Collection < java . lang . Integer > actual = info . michaelkohler . helpertools . collections . CollectionHelper . intersect ( listOne , listTwo ) ; for ( java . lang . Integer expectedItem : expected ) "<AssertPlaceHolder>" ; } intersect ( java . util . Collection , java . util . Collection ) { if ( groupOne == null ) return groupTwo ; else if ( groupTwo == null ) return groupOne ; else { java . util . Collection < T > results = new java . util . HashSet < T > ( ) ; for ( T listOneItem : groupOne ) if ( groupTwo . contains ( listOneItem ) ) results . add ( listOneItem ) ; return results ; } }
org . junit . Assert . assertTrue ( actual . contains ( expectedItem ) )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . dynamic . data . mapping . model . DDMStructureLink missingDDMStructureLink = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingDDMStructureLink )
testMatchHivePolicy_NoUserId ( ) { java . util . List < org . apache . ranger . entity . XXResource > xResourceList = new java . util . ArrayList < org . apache . ranger . entity . XXResource > ( ) ; org . apache . ranger . entity . XXResource xXResource = new org . apache . ranger . entity . XXResource ( ) ; xXResource . setId ( id ) ; xXResource . setName ( resourceName ) ; xXResource . setIsRecursive ( AppConstants . BOOL_TRUE ) ; xXResource . setResourceStatus ( AppConstants . STATUS_ENABLED ) ; xResourceList . add ( xXResource ) ; boolean bnlChk = rangerBizUtil . matchHivePolicy ( resourceName , xResourceList , null , 0 ) ; "<AssertPlaceHolder>" ; } matchHivePolicy ( java . lang . String , java . util . List , java . lang . Long , int ) { return matchHivePolicy ( resourceName , xResourceList , xUserId , permission , 0 , 0 , true ) ; }
org . junit . Assert . assertFalse ( bnlChk )
testCreateEntityAndSpecifyType ( ) { org . springframework . data . neo4j . support . IndexingRelationshipTypeRepresentationStrategyTest . Link newLink = relationshipTypeRepresentationStrategy . createEntity ( org . springframework . data . neo4j . support . IndexingRelationshipTypeRepresentationStrategyTest . rel ( link ) , org . springframework . data . neo4j . support . IndexingRelationshipTypeRepresentationStrategyTest . Link . class ) ; "<AssertPlaceHolder>" ; } rel ( org . springframework . data . neo4j . support . IndexingRelationshipTypeRepresentationStrategyTest$Link ) { return link . getPersistentState ( ) ; }
org . junit . Assert . assertEquals ( link , newLink )
testSearchCity ( ) { customer . setCity ( "Montreal" ) ; data = manager . search ( ) ; "<AssertPlaceHolder>" ; } search ( ) { java . lang . String selectStatement = "select<sp>*<sp>from<sp>users<sp>where<sp>" ; int size = selectStatement . length ( ) ; values = new java . util . ArrayList < java . lang . Object > ( ) ; if ( ( user . getUserId ( ) ) > 0 ) { selectStatement = selectStatement + "UserId=?,<sp>" ; values . add ( user . getUserId ( ) ) ; } if ( ! ( user . getUsername ( ) . trim ( ) . equals ( "" ) ) ) { selectStatement = selectStatement + "Username=?,<sp>" ; values . add ( user . getUsername ( ) ) ; } if ( ( selectStatement . length ( ) ) > size ) { selectStatement = selectStatement . substring ( 0 , ( ( selectStatement . length ( ) ) - 2 ) ) ; try { allUsers = ( ( java . util . ArrayList < g7w14 . data . UserBean > ) ( ud . select ( selectStatement , values ) ) ) ; } catch ( java . sql . SQLException e ) { log . error ( "Error<sp>in<sp>searching<sp>a<sp>record<sp>in<sp>user<sp>table" , e ) ; } } return allUsers ; }
org . junit . Assert . assertTrue ( ( ( data . size ( ) ) > 0 ) )
testFindIsTurkishSetter ( ) { final boolean value = true ; org . supercsv . util . ReflectionUtils . findSetter ( bean , "isTurkish" , org . supercsv . util . Boolean . class ) . invoke ( bean , value ) ; "<AssertPlaceHolder>" ; } getIsTurkish ( ) { return isTurkish ; }
org . junit . Assert . assertEquals ( value , bean . getIsTurkish ( ) )
testValidate_7 ( ) { java . lang . String line = "rename<sp>/tomcat-vm/tomcat-server<sp>as<sp>tomcat-server-copy" ; net . roboconf . core . commands . RenameCommandInstruction instr = new net . roboconf . core . commands . RenameCommandInstruction ( this . context , line , 1 ) ; java . util . List < net . roboconf . core . model . ParsingError > errors = instr . validate ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . map . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , errors . size ( ) )
testUpdateThroughFromSubquery ( ) { setProjectionPruningProperty ( projectionPruningDisabled ) ; com . splicemachine . derby . test . framework . TestConnection conn = methodWatcher . getOrCreateConnection ( ) ; boolean oldAutoCommit = conn . getAutoCommit ( ) ; conn . setAutoCommit ( false ) ; try ( java . sql . Statement statement = conn . createStatement ( ) ) { expected = "A6<sp>|B6<sp>|<sp>C6<sp>|D6<sp>|\n" + ( ( ( "update<sp>target<sp>set<sp>(b6)=(select<sp>\'WWW\'<sp>from<sp>(select<sp>*<sp>from<sp>t5<sp>--splice-properties<sp>index=idx_t5\n)<sp>dt<sp>where<sp>a6=a5+10<sp>and<sp>a5=1)" 1 + "update<sp>target<sp>set<sp>(b6)=(select<sp>\'WWW\'<sp>from<sp>(select<sp>*<sp>from<sp>t5<sp>--splice-properties<sp>index=idx_t5\n)<sp>dt<sp>where<sp>a6=a5+10<sp>and<sp>a5=1)" 3 ) + "12<sp>|VVV<sp>|2018-04-23<sp>|2.0<sp>|\n" ) + "13<sp>|zzz<sp>|2018-04-24<sp>|3.0<sp>|" ) ; sqlText = "select<sp>*<sp>from<sp>target" ; rs = statement . executeQuery ( sqlText ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; } finally { conn . rollback ( ) ; conn . setAutoCommit ( oldAutoCommit ) ; } } toString ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs ) . toString ( ) . trim ( ) ; }
org . junit . Assert . assertEquals ( ( ( "update<sp>target<sp>set<sp>(b6)=(select<sp>\'WWW\'<sp>from<sp>(select<sp>*<sp>from<sp>t5<sp>--splice-properties<sp>index=idx_t5\n)<sp>dt<sp>where<sp>a6=a5+10<sp>and<sp>a5=1)" 0 + sqlText ) + "update<sp>target<sp>set<sp>(b6)=(select<sp>\'WWW\'<sp>from<sp>(select<sp>*<sp>from<sp>t5<sp>--splice-properties<sp>index=idx_t5\n)<sp>dt<sp>where<sp>a6=a5+10<sp>and<sp>a5=1)" 0 ) , expected , TestUtils . FormattedResult . ResultFactory . toString ( rs ) )
testBucketLockAfterVolumeLock ( ) { org . apache . hadoop . ozone . om . OzoneManagerLock lock = new org . apache . hadoop . ozone . om . OzoneManagerLock ( new org . apache . hadoop . hdds . conf . OzoneConfiguration ( ) ) ; lock . acquireVolumeLock ( "volOne" ) ; lock . acquireBucketLock ( "volOne" , "bucketOne" ) ; lock . releaseBucketLock ( "volOne" , "bucketOne" ) ; lock . releaseVolumeLock ( "volOne" ) ; "<AssertPlaceHolder>" ; } releaseVolumeLock ( java . lang . String ) { manager . unlock ( ( ( org . apache . hadoop . ozone . OzoneConsts . OM_KEY_PREFIX ) + volume ) ) ; myLocks . get ( ) . get ( org . apache . hadoop . ozone . om . OzoneManagerLock . VOLUME_LOCK ) . decrementAndGet ( ) ; }
org . junit . Assert . assertTrue ( true )
createResetRequest_withType_returnsValidResetRequest ( ) { eu . chargetime . ocpp . model . core . ResetType type = eu . chargetime . ocpp . model . core . ResetType . Hard ; eu . chargetime . ocpp . model . core . ResetRequest result = core . createResetRequest ( type ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; }
org . junit . Assert . assertThat ( result . validate ( ) , org . hamcrest . CoreMatchers . is ( true ) )
useIndexOf ( ) { com . buschmais . xo . api . XOManager xoManager = getXOManager ( ) ; xoManager . currentTransaction ( ) . begin ( ) ; com . buschmais . xo . neo4j . test . mapping . composite . A a1 = xoManager . create ( com . buschmais . xo . neo4j . test . mapping . composite . D . class ) ; a1 . setIndex ( "1" ) ; xoManager . currentTransaction ( ) . commit ( ) ; xoManager . currentTransaction ( ) . begin ( ) ; "<AssertPlaceHolder>" ; xoManager . currentTransaction ( ) . commit ( ) ; } find ( java . lang . Class , java . lang . Object ) { this . xoSession . flush ( ) ; com . buschmais . xo . spi . metadata . type . EntityTypeMetadata < com . buschmais . xo . neo4j . spi . metadata . NodeMetadata < Label > > entityMetadata = xoSession . getEntityMetadata ( type ) ; Label label = entityMetadata . getDatastoreMetadata ( ) . getDiscriminator ( ) ; com . buschmais . xo . spi . metadata . method . PrimitivePropertyMethodMetadata < com . buschmais . xo . neo4j . spi . metadata . PropertyMetadata > propertyMethodMetadata = entityMetadata . getIndexedProperty ( ) . getPropertyMethodMetadata ( ) ; com . buschmais . xo . neo4j . spi . metadata . PropertyMetadata datastoreMetadata = propertyMethodMetadata . getDatastoreMetadata ( ) ; java . lang . Object datastoreValue = xoSession . toDatastore ( value ) ; return find ( label , datastoreMetadata , datastoreValue ) ; }
org . junit . Assert . assertThat ( xoManager . find ( com . buschmais . xo . neo4j . test . mapping . composite . D . class , "1" ) . iterator ( ) . next ( ) , org . hamcrest . Matchers . equalTo ( a1 ) )
testSetCalendarDate ( ) { int [ ] result = calendarDate1 . getCalendarDate ( ) ; int [ ] caldate = new int [ ] { 1995 , 5 , 5 } ; ( ( org . geotools . temporal . object . DefaultCalendarDate ) ( calendarDate1 ) ) . setCalendarDate ( caldate ) ; "<AssertPlaceHolder>" ; } getCalendarDate ( ) { return calendarDate ; }
org . junit . Assert . assertFalse ( calendarDate1 . getCalendarDate ( ) . equals ( result ) )
retainsOrderWhenChangingLocation ( ) { java . lang . String originalName = "secondParameter" ; parametersHolder . addProperty ( originalName ) ; parametersHolder . setParameterLocation ( parametersHolder . getProperty ( com . eviware . soapui . impl . rest . support . RestRequestParamsPropertyHolderTest . FIRST_PARAMETER_NAME ) , NewRestResourceActionBase . ParamLocation . METHOD ) ; "<AssertPlaceHolder>" ; } getPropertyIndex ( java . lang . String ) { for ( int c = 0 ; c < ( properties . size ( ) ) ; c ++ ) { if ( properties . get ( c ) . getName ( ) . equals ( name ) ) { return c ; } } return - 1 ; }
org . junit . Assert . assertThat ( parametersHolder . getPropertyIndex ( com . eviware . soapui . impl . rest . support . RestRequestParamsPropertyHolderTest . FIRST_PARAMETER_NAME ) , org . hamcrest . CoreMatchers . is ( 0 ) )
testReadRandom ( ) { java . util . Random r = new java . util . Random ( 0 ) ; for ( int i = 0 ; i < 1000000 ; i ++ ) { int LEN = ( r . nextInt ( 4 ) ) + 2 ; long [ ] s = newBaPattern ( LEN , r ) ; int start = r . nextInt ( ( ( LEN - 1 ) * ( ch . ethz . globis . phtree . bits . TestBitsLongWrite . BITS ) ) ) ; int len = r . nextInt ( ( ( ch . ethz . globis . phtree . bits . TestBitsLongWrite . BITS ) + 1 ) ) ; long v1 = ch . ethz . globis . phtree . util . BitsLong . readArray ( s , start , len ) ; long v2 = readArraySlow ( s , start , len ) ; "<AssertPlaceHolder>" ; } } readArraySlow ( long [ ] , int , int ) { long r = 0 ; for ( int i = 0 ; i < len ; i ++ ) { int trgBit = ( ( ch . ethz . globis . phtree . bits . TestBitsLongWrite . BITS ) - len ) + i ; int srcBit = posTrg + i ; r = ch . ethz . globis . phtree . bits . TestBitsLongWrite . setBit ( r , trgBit , ch . ethz . globis . phtree . util . BitsLong . getBit ( ba , srcBit ) ) ; } return r ; }
org . junit . Assert . assertEquals ( v2 , v1 )
testSetter ( ) { org . apache . james . mime4j . storage . StorageProvider instance = new org . apache . james . mime4j . storage . MemoryStorageProvider ( ) ; org . apache . james . mime4j . storage . DefaultStorageProvider . setInstance ( instance ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { return org . apache . james . mime4j . storage . DefaultStorageProvider . instance ; }
org . junit . Assert . assertSame ( instance , org . apache . james . mime4j . storage . DefaultStorageProvider . getInstance ( ) )
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . Portlet newPortlet = addPortlet ( ) ; com . liferay . portal . kernel . model . Portlet existingPortlet = _persistence . findByPrimaryKey ( newPortlet . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
org . junit . Assert . assertEquals ( existingPortlet , newPortlet )
testPutSubprojectionToAttribute ( ) { org . xmlbeam . types . XBAutoMap < org . xmlbeam . tests . binding . TestBindAnnotation . Projection > map = org . xmlbeam . tests . binding . TestBindAnnotation . projector . autoMapEmptyDocument ( org . xmlbeam . tests . binding . TestBindAnnotation . Projection . class ) ; "<AssertPlaceHolder>" ; map . put ( "root/@a" , org . xmlbeam . tests . binding . TestBindAnnotation . projector . projectEmptyElement ( "x" , org . xmlbeam . tests . binding . TestBindAnnotation . Projection . class ) ) ; System . out . println ( org . xmlbeam . tests . binding . TestBindAnnotation . projector . asString ( map ) ) ; } autoMapEmptyDocument ( java . lang . Class ) { org . w3c . dom . Document document = xMLFactoriesConfig . createDocumentBuilder ( ) . newDocument ( ) ; return createAutoMapForDocument ( valueType , document ) ; }
org . junit . Assert . assertTrue ( map . isEmpty ( ) )
testHLLSparseMoreRegisterBits ( ) { com . github . prasanthj . hll . HyperLogLog hll = com . github . prasanthj . hll . HyperLogLog . builder ( ) . setEncoding ( EncodingType . SPARSE ) . setNumRegisterIndexBits ( 16 ) . build ( ) ; int size = 1000 ; for ( int i = 0 ; i < size ; i ++ ) { hll . addLong ( i ) ; } double threshold = ( size > 40000 ) ? longRangeTolerance : shortRangeTolerance ; double delta = ( threshold * size ) / 100 ; "<AssertPlaceHolder>" ; } count ( ) { if ( ( invalidateCount ) || ( ( cachedCount ) < 0 ) ) { if ( encoding . equals ( com . github . prasanthj . hll . HyperLogLog . EncodingType . SPARSE ) ) { int mPrime = 1 << ( sparseRegister . getPPrime ( ) ) ; cachedCount = linearCount ( mPrime , ( mPrime - ( sparseRegister . getSparseMap ( ) . size ( ) ) ) ) ; } else { double sum = denseRegister . getSumInversePow2 ( ) ; long numZeros = denseRegister . getNumZeroes ( ) ; cachedCount = ( ( long ) ( ( alphaMM ) * ( 1.0 / sum ) ) ) ; long pow = ( ( long ) ( java . lang . Math . pow ( 2 , chosenHashBits ) ) ) ; if ( noBias ) { cachedCount = ( ( cachedCount ) <= ( 5 * ( m ) ) ) ? ( cachedCount ) - ( estimateBias ( cachedCount ) ) : cachedCount ; long h = cachedCount ; if ( numZeros != 0 ) { h = linearCount ( m , numZeros ) ; } if ( h < ( getThreshold ( ) ) ) { cachedCount = h ; } } else { if ( ( cachedCount ) <= ( 2.5 * ( m ) ) ) { if ( numZeros != 0 ) { cachedCount = linearCount ( m , numZeros ) ; } } else if ( ( ( chosenHashBits ) < 64 ) && ( ( cachedCount ) > ( 0.033333 * pow ) ) ) { if ( ( cachedCount ) > ( ( 1 / 30 ) * pow ) ) { cachedCount = ( ( long ) ( ( - pow ) * ( java . lang . Math . log ( ( 1.0 - ( ( ( double ) ( cachedCount ) ) / ( ( double ) ( pow ) ) ) ) ) ) ) ) ; } } } } invalidateCount = false ; } return cachedCount ; }
org . junit . Assert . assertEquals ( ( ( double ) ( size ) ) , ( ( double ) ( hll . count ( ) ) ) , delta )
testHasQueryEmptyQueryTest ( ) { java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; map . put ( "testKey" , "testVal" ) ; RequestParser < String > . ParsedRequest parsed = target . new org . o3project . odenos . remoteobject . ParsedRequest ( new org . o3project . odenos . remoteobject . message . Request ( "testID" , org . o3project . odenos . remoteobject . message . Request . Method . GET , "testPath" , "txid" , "testBody" ) , "testResult" , map , "" ) ; "<AssertPlaceHolder>" ; } hasQuery ( ) { return ( this . queriesString ) != null ; }
org . junit . Assert . assertTrue ( parsed . hasQuery ( ) )
testGetInstanceRequest ( ) { try { com . fit2cloud . aliyun . ecs . model . request . GetInstanceRequest r = new com . fit2cloud . aliyun . ecs . model . request . GetInstanceRequest ( "i-25uh6z38k" ) ; com . fit2cloud . aliyun . ecs . model . response . GetInstanceResponse response = client . getInstance ( r ) ; System . out . println ( ( "testGetInstanceRequest<sp>::<sp>" + response ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getInstance ( com . fit2cloud . aliyun . ecs . model . request . GetInstanceRequest ) { return gson . fromJson ( request . execute ( "DescribeInstanceAttribute" , getInstanceRequest . toMap ( ) ) , com . fit2cloud . aliyun . ecs . model . response . GetInstanceResponse . class ) ; }
org . junit . Assert . assertTrue ( true )
testNewAttribute ( ) { org . rapla . facade . RaplaFacade facade = getServerFacade ( ) ; org . rapla . entities . dynamictype . DynamicType roomType = facade . edit ( facade . getDynamicType ( "room" ) ) ; org . rapla . entities . dynamictype . Attribute attribute = facade . newAttribute ( AttributeType . STRING ) ; attribute . setKey ( "color" ) ; attribute . setAnnotation ( AttributeAnnotations . KEY_EDIT_VIEW , AttributeAnnotations . VALUE_EDIT_VIEW_NO_VIEW ) ; roomType . addAttribute ( attribute ) ; facade . store ( roomType ) ; roomType = facade . getPersistant ( roomType ) ; org . rapla . entities . domain . Allocatable [ ] allocatables = facade . getAllocatablesWithFilter ( new org . rapla . entities . dynamictype . ClassificationFilter [ ] { roomType . newClassificationFilter ( ) } ) ; org . rapla . entities . domain . Allocatable allocatable = facade . edit ( allocatables [ 0 ] ) ; allocatable . getClassification ( ) . setValue ( "color" , "665532" ) ; java . lang . String name = ( ( java . lang . String ) ( allocatable . getClassification ( ) . getValue ( "name" ) ) ) ; facade . store ( allocatable ) ; org . rapla . storage . CachableStorageOperator operator = getRapladb ( ) ; operator . disconnect ( ) ; operator . connect ( ) ; allocatables = facade . getAllocatablesWithFilter ( new org . rapla . entities . dynamictype . ClassificationFilter [ ] { roomType . newClassificationFilter ( ) } ) ; allocatable = facade . edit ( allocatables [ 0 ] ) ; "<AssertPlaceHolder>" ; } getClassification ( ) { return classification ; }
org . junit . Assert . assertEquals ( name , allocatable . getClassification ( ) . getValue ( "name" ) )
testGetDoublePropetry ( ) { javax . jms . JMSProducer producer = context . createProducer ( ) ; producer . setProperty ( DOUBLE_PROPERTY_NAME , DOUBLE_PROPERTY_VALUE ) ; "<AssertPlaceHolder>" ; } getDoubleProperty ( java . lang . String ) { try { return convertPropertyTo ( name , messageProperties . get ( name ) , org . apache . qpid . jms . Double . class ) ; } catch ( javax . jms . JMSException jmse ) { throw org . apache . qpid . jms . exceptions . JmsExceptionSupport . createRuntimeException ( jmse ) ; } }
org . junit . Assert . assertEquals ( DOUBLE_PROPERTY_VALUE , producer . getDoubleProperty ( DOUBLE_PROPERTY_NAME ) , 0.0 )
testDate ( ) { final java . util . Date d = new java . util . Date ( ) ; np . setCurrentDate ( d ) ; "<AssertPlaceHolder>" ; } getCurrentDate ( ) { return currentDate ; }
org . junit . Assert . assertEquals ( np . getCurrentDate ( ) , d )
testStreamOnEmptyOptional ( ) { long count = com . annimon . stream . OptionalInt . empty ( ) . stream ( ) . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { long count = 0 ; while ( iterator . hasNext ( ) ) { iterator . nextLong ( ) ; count ++ ; } return count ; }
org . junit . Assert . assertThat ( count , org . hamcrest . Matchers . is ( 0L ) )
testCancel ( ) { int numElementsBefore = org . peerbox . filerecovery . FileVersionSelectorTest . root . list ( ) . length ; org . peerbox . filerecovery . FileVersionSelectorTest . FileVersionSelectorListener versionSelectorListener = new org . peerbox . filerecovery . FileVersionSelectorTest . FileVersionSelectorListener ( org . peerbox . filerecovery . FileVersionSelectorTest . file . toPath ( ) , ( - 1 ) ) ; try { org . peerbox . filerecovery . FileVersionSelectorTest . client . getFileManager ( ) . createRecoverProcess ( org . peerbox . filerecovery . FileVersionSelectorTest . file , versionSelectorListener . getFileVersionSelector ( ) ) . execute ( ) ; org . junit . Assert . fail ( "Expected<sp>exception<sp>was<sp>not<sp>thrown." ) ; } catch ( org . hive2hive . processframework . exceptions . ProcessExecutionException pex ) { org . peerbox . filerecovery . FileVersionSelectorTest . logger . info ( "Exception:<sp>{}" , pex . getMessage ( ) ) ; } int numElementsAfter = org . peerbox . filerecovery . FileVersionSelectorTest . root . list ( ) . length ; "<AssertPlaceHolder>" ; } getMessage ( ) { return message ; }
org . junit . Assert . assertEquals ( numElementsBefore , numElementsAfter )
testgetNumberEndpoints ( ) { int numEndpoints = d_wizard . getEndpointSelectModel ( ) . getSlots ( ) . size ( ) ; d_wizard . getEndpointSelectModel ( ) . addSlot ( ) ; d_wizard . getEndpointSelectModel ( ) . addSlot ( ) ; "<AssertPlaceHolder>" ; } getSlots ( ) { java . util . List < org . drugis . addis . presentation . ModifiableHolder < T > > slots = new java . util . ArrayList < org . drugis . addis . presentation . ModifiableHolder < T > > ( ) ; for ( org . drugis . addis . entities . StudyOutcomeMeasure < T > slot : d_slots ) { slots . add ( slot ) ; } return slots ; }
org . junit . Assert . assertEquals ( ( numEndpoints + 2 ) , d_wizard . getEndpointSelectModel ( ) . getSlots ( ) . size ( ) )
testGetByModelNull ( ) { uk . ac . bbsrc . tgac . miso . core . data . InstrumentModel platform = dao . getByAlias ( null ) ; "<AssertPlaceHolder>" ; } getByAlias ( java . lang . String ) { org . hibernate . Criteria criteria = currentSession ( ) . createCriteria ( uk . ac . bbsrc . tgac . miso . core . data . ArrayRun . class ) ; criteria . add ( org . hibernate . criterion . Restrictions . eq ( "alias" , alias ) ) ; return ( ( uk . ac . bbsrc . tgac . miso . core . data . ArrayRun ) ( criteria . uniqueResult ( ) ) ) ; }
org . junit . Assert . assertNull ( platform )
testConnectToWrongBlock ( ) { try { byte [ ] blockID = org . apache . commons . codec . binary . Hex . decodeHex ( "00000000000030775c9b2103f61b2a0c429a34b41b628daae9774cb9b5ff1059" . toCharArray ( ) ) ; byte [ ] transactionID = org . apache . commons . codec . binary . Hex . decodeHex ( "b6b3ff7b4d004a788c751f3f8fc881f96c7b647ae06eb9a720bddc924e6f9147" . toCharArray ( ) ) ; org . provebit . proof . TransactionMerkleSerializer tm = new org . provebit . proof . TransactionMerkleSerializer ( ) ; byte [ ] serial = tm . SerializedPathUpMerkle ( transactionID , blockID ) ; "<AssertPlaceHolder>" ; } catch ( org . apache . commons . codec . DecoderException e ) { org . junit . Assert . fail ( ) ; } } SerializedPathUpMerkle ( byte [ ] , byte [ ] ) { try { org . bitcoinj . core . Block targetBlock = peer . getBlock ( new org . bitcoinj . core . Sha256Hash ( blockHeader ) ) . get ( 10 , TimeUnit . SECONDS ) ; java . util . List < org . bitcoinj . core . Transaction > transactions = targetBlock . getTransactions ( ) ; java . util . List < byte [ ] > transHashes = new java . util . ArrayList < byte [ ] > ( ) ; boolean foundHash = false ; for ( org . bitcoinj . core . Transaction trans : transactions ) { org . bitcoinj . core . Sha256Hash hash = trans . getHash ( ) ; transHashes . add ( org . bitcoinj . core . Utils . reverseBytes ( hash . getBytes ( ) ) ) ; if ( hash . equals ( new org . bitcoinj . core . Sha256Hash ( transactionID ) ) ) { foundHash = true ; } } if ( ! foundHash ) { return null ; } org . provebit . merkle . Merkle blockMerkle = new org . provebit . merkle . Merkle ( org . provebit . merkle . HashType . DOUBLE_SHA256 ) ; blockMerkle . makeTree ( transHashes ) ; return org . provebit . merkle . MerkleStepSerializer . serialize ( blockMerkle . findPath ( org . bitcoinj . core . Utils . reverseBytes ( transactionID ) ) ) ; } catch ( java . lang . InterruptedException | java . util . concurrent . ExecutionException e ) { e . printStackTrace ( ) ; return null ; } catch ( java . util . concurrent . TimeoutException t ) { System . out . println ( "PEER<sp>TIMED<sp>OUT!!" ) ; return null ; } }
org . junit . Assert . assertTrue ( ( serial == null ) )
mergeAlreadyStagedFileTest ( ) { org . opencb . opencga . storage . core . metadata . StudyConfiguration studyConfiguration = createStudyConfiguration ( ) ; org . opencb . opencga . storage . core . StoragePipelineResult storagePipelineResult = runDefaultETL ( smallInputUri , variantStorageEngine , studyConfiguration , new org . opencb . commons . datastore . core . ObjectMap ( ) . append ( MongoDBVariantOptions . STAGE . key ( ) , true ) . append ( MongoDBVariantOptions . MERGE . key ( ) , false ) ) ; runETL ( variantStorageEngine , storagePipelineResult . getTransformResult ( ) , outputUri , new org . opencb . commons . datastore . core . ObjectMap ( ) . append ( VariantStorageEngine . Options . ANNOTATE . key ( ) , false ) . append ( MongoDBVariantOptions . STAGE . key ( ) , false ) . append ( MongoDBVariantOptions . MERGE . key ( ) , true ) , false , false , true ) ; java . lang . Long count = variantStorageEngine . getDBAdaptor ( ) . count ( null ) . first ( ) ; "<AssertPlaceHolder>" ; } count ( org . opencb . commons . datastore . core . Query ) { org . bson . conversions . Bson bson = parseQuery ( query , false ) ; return studyCollection . count ( bson ) ; }
org . junit . Assert . assertTrue ( ( count > 0 ) )
testDetermineMatchShouldReturnMatchWhenResultsMatch ( ) { com . ticketmaster . exp . TrialResult < java . lang . String > controlTrialResult = new com . ticketmaster . exp . TrialResult ( TrialType . CONTROL , java . time . Duration . ofMillis ( 1 ) , null , "foo" ) ; com . ticketmaster . exp . TrialResult < java . lang . String > candidateTrialResult = new com . ticketmaster . exp . TrialResult ( TrialType . CANDIDATE , java . time . Duration . ofMillis ( 1 ) , null , "foo" ) ; com . ticketmaster . exp . Result < java . lang . String > result = new com . ticketmaster . exp . Result ( "exp" , java . time . Instant . now ( ) , controlTrialResult , candidateTrialResult ) ; com . ticketmaster . exp . MatchType matchType = result . determineMatch ( Object :: equals , Objects :: equals ) ; "<AssertPlaceHolder>" ; } determineMatch ( java . util . function . BiFunction , java . util . function . BiFunction ) { com . ticketmaster . exp . MatchType matchType ; if ( bothReturnedValues ( ) ) { matchType = ( valuesMatch ( sameWhen ) ) ? com . ticketmaster . exp . MatchType . MATCH : com . ticketmaster . exp . MatchType . MISMATCH ; } else if ( bothThrewExceptions ( ) ) { matchType = ( exceptionsMatch ( exceptionsSameWhen ) ) ? com . ticketmaster . exp . MatchType . EXCEPTION_MATCH : com . ticketmaster . exp . MatchType . EXCEPTION_MISMATCH ; } else { matchType = ( controlThrewException ( ) ) ? com . ticketmaster . exp . MatchType . CONTROL_EXCEPTION : com . ticketmaster . exp . MatchType . CANDIDATE_EXCEPTION ; } return matchType ; }
org . junit . Assert . assertEquals ( MatchType . MATCH , matchType )
getStatisticsForPartitionReturnsNullIfEmptyStats ( ) { java . util . List < org . apache . hadoop . hive . metastore . api . FieldSchema > partitionKeys = com . google . common . collect . Lists . newArrayList ( newFieldSchema ( "a" ) ) ; org . apache . hadoop . hive . metastore . api . Table table = newTable ( "t1" , "db1" , partitionKeys , newStorageDescriptor ( new java . io . File ( "bla" ) , "col1" ) ) ; java . util . List < org . apache . hadoop . hive . metastore . api . Partition > partitions = com . google . common . collect . Lists . newArrayList ( newPartition ( table , "b" ) ) ; statisticsPerPartitionName . put ( "a=b" , java . util . Collections . < org . apache . hadoop . hive . metastore . api . ColumnStatisticsObj > emptyList ( ) ) ; com . hotels . bdp . circustrain . core . PartitionsAndStatistics partitionsAndStatistics = new com . hotels . bdp . circustrain . core . PartitionsAndStatistics ( partitionKeys , partitions , statisticsPerPartitionName ) ; "<AssertPlaceHolder>" ; } getStatisticsForPartition ( org . apache . hadoop . hive . metastore . api . Partition ) { if ( partition == null ) { throw new java . lang . IllegalArgumentException ( "partition<sp>==<sp>null" ) ; } return statisticsByPartition . get ( partition ) ; }
org . junit . Assert . assertNull ( partitionsAndStatistics . getStatisticsForPartition ( partitions . get ( 0 ) ) )
oneIsOne ( ) { "<AssertPlaceHolder>" ; } vec ( T [ ] ) { if ( ( items == null ) || ( ( items . length ) < 1 ) ) { return org . organicdesign . fp . collections . PersistentVector . empty ( ) ; } return org . organicdesign . fp . StaticImports . mutableVec ( items ) . immutable ( ) ; }
org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 1 ) , org . organicdesign . fp . StaticImports . vec ( 1 ) . get ( 0 ) )
testLo3 ( ) { final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3PersoonslijstBuilder builder = new nl . bzk . migratiebrp . conversie . model . lo3 . Lo3PersoonslijstBuilder ( ) ; builder . persoonStapel ( nl . bzk . migratiebrp . conversie . model . testutils . VerplichteStapel . createPersoonStapel ( ) ) ; builder . inschrijvingStapel ( nl . bzk . migratiebrp . conversie . model . testutils . VerplichteStapel . createInschrijvingStapel ( ) ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Persoonslijst persoonslijst = builder . build ( ) ; final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; final java . io . Writer writer = new java . io . OutputStreamWriter ( baos ) ; nl . bzk . migratiebrp . conversie . model . serialize . MigratieXml . encode ( persoonslijst , writer ) ; writer . close ( ) ; final byte [ ] data = baos . toByteArray ( ) ; final java . lang . String xml = new java . lang . String ( data , java . nio . charset . Charset . defaultCharset ( ) ) ; System . out . println ( ( "Xml:<sp>" + xml ) ) ; final java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( data ) ; final java . io . Reader reader = new java . io . InputStreamReader ( bais ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Persoonslijst decodedPl = nl . bzk . migratiebrp . conversie . model . serialize . MigratieXml . decode ( nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Persoonslijst . class , reader ) ; reader . close ( ) ; final java . lang . StringBuilder log = new java . lang . StringBuilder ( ) ; final boolean result = nl . bzk . migratiebrp . conversie . model . proces . brpnaarlo3 . Lo3StapelHelper . vergelijkPersoonslijst ( log , persoonslijst , decodedPl ) ; "<AssertPlaceHolder>" ; } close ( ) { }
org . junit . Assert . assertTrue ( result )
shouldReturnNotEqualForBlobAndCommit ( ) { org . eclipse . egit . ui . internal . synchronize . model . GitModelObject left = createGitModelBlob ( ) ; org . eclipse . egit . ui . internal . synchronize . model . GitModelObject right = new org . eclipse . egit . ui . internal . synchronize . model . GitModelCommit ( createModelRepository ( ) , lookupRepository ( leftRepoFile ) , getCommit ( leftRepoFile , org . eclipse . egit . ui . internal . synchronize . model . HEAD ) , null ) ; boolean actual = left . equals ( right ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } org . eclipse . egit . ui . CommitMessageWithCaretPosition other = ( ( org . eclipse . egit . ui . CommitMessageWithCaretPosition ) ( obj ) ) ; return ( ( caretPosition ) == ( other . caretPosition ) ) && ( java . util . Objects . equals ( message , other . message ) ) ; }
org . junit . Assert . assertFalse ( actual )
testPut ( ) { com . liferay . portal . template . soy . internal . SoyTemplate soyTemplate = _soyTestHelper . getSoyTemplate ( "ijdata.soy" ) ; soyTemplate . put ( "key" , "value" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return com . liferay . journal . content . search . web . configuration . JournalContentSearchWebConfigurationUtil . _configuration . get ( key ) ; }
org . junit . Assert . assertEquals ( "value" , soyTemplate . get ( "key" ) )
shouldNotHandleRequest_wrongCriteria ( ) { io . gravitee . gateway . api . Request request = mock ( io . gravitee . gateway . api . Request . class ) ; io . gravitee . common . http . HttpHeaders headers = new io . gravitee . common . http . HttpHeaders ( ) ; headers . set ( "X-Gravitee-Api-Key" , "xxxxx-xxxx-xxxxx" ) ; when ( request . headers ( ) ) . thenReturn ( headers ) ; io . gravitee . gateway . security . core . AuthenticationContext authenticationContext = mock ( io . gravitee . gateway . security . core . AuthenticationContext . class ) ; when ( authenticationContext . getId ( ) ) . thenReturn ( "wrong-plan-id" ) ; io . gravitee . repository . management . model . ApiKey apiKey = mock ( io . gravitee . repository . management . model . ApiKey . class ) ; when ( apiKey . getPlan ( ) ) . thenReturn ( "plan-id" ) ; when ( apiKeyRepository . findById ( "xxxxx-xxxx-xxxxx" ) ) . thenReturn ( java . util . Optional . of ( apiKey ) ) ; boolean handle = authenticationHandler . canHandle ( request , authenticationContext ) ; "<AssertPlaceHolder>" ; } canHandle ( io . gravitee . gateway . api . Request , io . gravitee . gateway . security . core . AuthenticationContext ) { return true ; }
org . junit . Assert . assertFalse ( handle )
testDumpColorSpace ( ) { final org . apache . commons . imaging . ImageDump imageDump = new org . apache . commons . imaging . ImageDump ( ) ; final java . awt . color . ColorSpace colorSpace = java . awt . color . ColorSpace . getInstance ( 1004 ) ; imageDump . dumpColorSpace ( "Ku&]N>!4'C#Jzn+" , colorSpace ) ; "<AssertPlaceHolder>" ; } getNumComponents ( ) { return 1 ; }
org . junit . Assert . assertEquals ( 3 , colorSpace . getNumComponents ( ) )
testReleaseClosedConnectionShouldNotAddBackTheConnectionToThePool ( ) { io . reactiverse . pgclient . pool . ConnectionQueue queue = new io . reactiverse . pgclient . pool . ConnectionQueue ( ) ; io . reactiverse . pgclient . impl . ConnectionPool pool = new io . reactiverse . pgclient . impl . ConnectionPool ( queue , 1 ) ; io . reactiverse . pgclient . pool . SimpleHolder holder1 = new io . reactiverse . pgclient . pool . SimpleHolder ( ) ; pool . acquire ( holder1 ) ; io . reactiverse . pgclient . pool . SimpleConnection conn1 = new io . reactiverse . pgclient . pool . SimpleConnection ( ) ; queue . connect ( conn1 ) ; holder1 . init ( ) ; conn1 . close ( ) ; holder1 . close ( ) ; "<AssertPlaceHolder>" ; } available ( ) { return available . size ( ) ; }
org . junit . Assert . assertEquals ( pool . available ( ) , 0 )
currentDateTest ( ) { org . apache . cayenne . exp . Expression exp = org . apache . cayenne . exp . FunctionExpressionFactory . currentDate ( ) ; "<AssertPlaceHolder>" ; } currentDate ( ) { return new org . apache . cayenne . exp . parser . ASTCurrentDate ( ) ; }
org . junit . Assert . assertTrue ( ( exp instanceof org . apache . cayenne . exp . parser . ASTCurrentDate ) )
mergeWithInteger ( ) { puck . thrifty . datatype . LongElement elem = new puck . thrifty . datatype . LongElement ( "test" ) ; puck . thrifty . datatype . Element mergeElem = elem . merge ( new puck . thrifty . datatype . IntegerElement ( "test" ) ) ; "<AssertPlaceHolder>" ; } merge ( puck . thrifty . datatype . Element ) { if ( ( ( ( element == null ) || ( ( this ) == element ) ) || ( element . isUnknown ( ) ) ) || ( this . getClass ( ) . equals ( element . getClass ( ) ) ) ) { return this ; } else if ( element instanceof puck . thrifty . datatype . NumberElement ) { return element ; } throw new puck . thrifty . MergerException ( this , element ) ; }
org . junit . Assert . assertSame ( elem , mergeElem )
shouldOptionallyExcludeFields ( ) { java . lang . String expectedResult = "<order>\n<sp><comments>pack<sp>it<sp>nicely,<sp>please</comments>\n</order>" ; br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Order order = new br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Order ( new br . com . caelum . vraptor . serialization . xstream . XStreamXMLSerializationTest . Client ( "guilherme<sp>silveira" ) , 15.0 , "pack<sp>it<sp>nicely,<sp>please" ) ; serialization . from ( order ) . exclude ( "price" ) . serialize ( ) ; "<AssertPlaceHolder>" ; } result ( ) { return new java . lang . String ( stream . toByteArray ( ) ) ; }
org . junit . Assert . assertThat ( result ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( expectedResult ) ) )
testSerialization ( ) { org . jfree . chart . plot . dial . StandardDialRange r1 = new org . jfree . chart . plot . dial . StandardDialRange ( ) ; org . jfree . chart . plot . dial . StandardDialRange r2 = ( ( org . jfree . chart . plot . dial . StandardDialRange ) ( org . jfree . chart . TestUtilities . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( r1 , r2 )
shouldNotResolveSimpleTypes ( ) { this . model . put ( "k" , "v" ) ; org . springframework . core . MethodParameter parameter = mockMethodParameter ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } supportsParameter ( org . springframework . core . MethodParameter ) { try { for ( org . springframework . springfaces . mvc . method . support . ImplicitObjectMethodArgumentResolver . ImplicitObject < ? > implicitObject : this . implicitObjects ) { if ( ( parameter . getParameterType ( ) . isAssignableFrom ( implicitObject . getType ( ) ) ) && ( Boolean . TRUE . equals ( implicitObject . getCondition ( ) . call ( ) ) ) ) { return true ; } } } catch ( java . lang . Exception e ) { org . springframework . util . ReflectionUtils . rethrowRuntimeException ( e ) ; } return false ; }
org . junit . Assert . assertThat ( this . resolver . supportsParameter ( parameter ) , org . hamcrest . Matchers . is ( false ) )
testTaskDone ( ) { org . apache . hadoop . hbase . master . TestSplitLogManager . LOG . info ( "TestTaskDone<sp>-<sp>cleanup<sp>task<sp>node<sp>once<sp>in<sp>DONE<sp>state" ) ; slm = new org . apache . hadoop . hbase . master . SplitLogManager ( zkw , conf , org . apache . hadoop . hbase . master . TestSplitLogManager . stopper , "dummy-master" , null ) ; slm . finishInitialization ( ) ; org . apache . hadoop . hbase . master . SplitLogManager . TaskBatch batch = new org . apache . hadoop . hbase . master . SplitLogManager . TaskBatch ( ) ; java . lang . String tasknode = submitTaskAndWait ( batch , "foo/1" ) ; org . apache . hadoop . hbase . zookeeper . ZKUtil . setData ( zkw , tasknode , TaskState . TASK_DONE . get ( "worker" ) ) ; synchronized ( batch ) { while ( ( batch . installed ) != ( batch . done ) ) { batch . wait ( ) ; } } waitForCounter ( tot_mgr_task_deleted , 0 , 1 , 1000 ) ; "<AssertPlaceHolder>" ; } checkExists ( org . apache . hadoop . hbase . zookeeper . ZooKeeperWatcher , java . lang . String ) { try { org . apache . zookeeper . data . Stat s = zkw . getRecoverableZooKeeper ( ) . exists ( znode , null ) ; return s != null ? s . getVersion ( ) : - 1 ; } catch ( org . apache . zookeeper . KeeperException e ) { org . apache . hadoop . hbase . zookeeper . ZKUtil . LOG . warn ( zkw . prefix ( ( ( "Unable<sp>to<sp>set<sp>watcher<sp>on<sp>znode<sp>(" + znode ) + ")" ) ) , e ) ; zkw . keeperException ( e ) ; return - 1 ; } catch ( java . lang . InterruptedException e ) { org . apache . hadoop . hbase . zookeeper . ZKUtil . LOG . warn ( zkw . prefix ( ( ( "Unable<sp>to<sp>set<sp>watcher<sp>on<sp>znode<sp>(" + znode ) + ")" ) ) , e ) ; zkw . interruptedException ( e ) ; return - 1 ; } }
org . junit . Assert . assertTrue ( ( ( org . apache . hadoop . hbase . zookeeper . ZKUtil . checkExists ( zkw , tasknode ) ) == ( - 1 ) ) )
testPricesOthersGets ( ) { int id = 0 ; try { id = _setupTestPricesOthers ( false ) ; _checkPricesOthersIntoDb ( id ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } return ; } _checkPricesOthersIntoDb ( int ) { org . isf . pricesothers . model . PricesOthers foundPricesOthers ; foundPricesOthers = ( ( org . isf . pricesothers . model . PricesOthers ) ( org . isf . pricesothers . test . Tests . jpa . find ( org . isf . pricesothers . model . PricesOthers . class , id ) ) ) ; org . isf . pricesothers . test . Tests . testPricesOthers . check ( foundPricesOthers ) ; return ; }
org . junit . Assert . assertEquals ( true , false )
test_plusMinor_zero ( ) { org . joda . money . BigMoney test = org . joda . money . TestBigMoney . GBP_2_34 . plusMinor ( 0 ) ; "<AssertPlaceHolder>" ; } plusMinor ( long ) { return with ( money . plusMinor ( amountToAdd ) ) ; }
org . junit . Assert . assertSame ( org . joda . money . TestBigMoney . GBP_2_34 , test )
setRawValueForNull ( ) { optionalSubject . setRawValue ( null ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
org . junit . Assert . assertEquals ( null , optionalSubject . getValue ( ) )
testNonComplexNameScriptBased ( ) { final java . lang . String cfcSrc = "component<sp>{\r\n" + ( ( ( ( ( ( ( ( "function<sp>functionThree()<sp>{\r\n" + "if<sp>(a<sp>==<sp>1)<sp>{" ) + "b<sp>=<sp>1;\r\n" ) + "}\r\n" ) + "else<sp>{\r\n" ) + "b<sp>=<sp>2;\r\n" ) + "}\r\n" ) + "}\r\n" ) + "}" ) ; com . cflint . api . CFLintResult lintresult = cfBugs . scan ( cfcSrc , "test" ) ; java . util . Collection < java . util . List < com . cflint . BugInfo > > result = lintresult . getIssues ( ) . values ( ) ; "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( final java . util . List < ? > list : bugs . values ( ) ) { size += list . size ( ) ; } return size ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
serialyse_then_parse_with_severals_attributes ( ) { java . util . HashMap < java . lang . String , java . lang . Object > attributesObj1 = new java . util . HashMap ( ) ; attributesObj1 . put ( "number1" , 1 ) ; attributesObj1 . put ( "number2" , 1 ) ; attributesObj1 . put ( "string1" , "stringval1" ) ; org . eclipse . leshan . Link obj1 = new org . eclipse . leshan . Link ( "/1/0" , attributesObj1 ) ; java . util . HashMap < java . lang . String , java . lang . Object > attributesObj2 = new java . util . HashMap ( ) ; attributesObj2 . put ( "number3" , 3 ) ; org . eclipse . leshan . Link obj2 = new org . eclipse . leshan . Link ( "/2" , attributesObj2 ) ; org . eclipse . leshan . Link [ ] input = new org . eclipse . leshan . Link [ ] { obj1 , obj2 } ; java . lang . String strObjs = org . eclipse . leshan . Link . serialize ( input ) ; org . eclipse . leshan . Link [ ] output = org . eclipse . leshan . Link . parse ( strObjs . getBytes ( ) ) ; "<AssertPlaceHolder>" ; } parse ( byte [ ] ) { if ( content == null ) { return new org . eclipse . leshan . Link [ ] { } ; } java . lang . String s = new java . lang . String ( content , java . nio . charset . StandardCharsets . UTF_8 ) ; java . lang . String [ ] links = s . split ( "," ) ; org . eclipse . leshan . Link [ ] linksResult = new org . eclipse . leshan . Link [ links . length ] ; int index = 0 ; for ( java . lang . String link : links ) { java . lang . String [ ] linkParts = link . split ( ";" ) ; java . lang . String url = org . eclipse . leshan . util . StringUtils . trim ( linkParts [ 0 ] ) ; url = org . eclipse . leshan . util . StringUtils . removeStart ( org . eclipse . leshan . util . StringUtils . removeEnd ( url , ">" ) , "<" ) ; java . util . Map < java . lang . String , java . lang . Object > attributes = new java . util . HashMap ( ) ; if ( ( linkParts . length ) > 1 ) { for ( int i = 1 ; i < ( linkParts . length ) ; i ++ ) { java . lang . String [ ] attParts = linkParts [ i ] . split ( "=" ) ; if ( ( attParts . length ) > 0 ) { java . lang . String key = attParts [ 0 ] ; java . lang . Object value = null ; if ( ( attParts . length ) > 1 ) { java . lang . String rawvalue = attParts [ 1 ] ; try { value = java . lang . Integer . valueOf ( rawvalue ) ; } catch ( java . lang . NumberFormatException e ) { value = rawvalue . replaceFirst ( "^\"(.*)\"$" , "$1" ) ; } } attributes . put ( key , value ) ; } } } linksResult [ index ] = new org . eclipse . leshan . Link ( url , attributes ) ; index ++ ; } return linksResult ; }
org . junit . Assert . assertArrayEquals ( input , output )
horizontalTest ( ) { org . eclipse . swt . graphics . Rectangle bounds = new org . eclipse . swt . graphics . Rectangle ( 0 , 0 , 1000 , 1000 ) ; int x0 = 10000 ; int y0 = 100 ; int x1 = - 100 ; int y1 = 100 ; org . eclipse . swt . graphics . Rectangle rect = org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . clip ( bounds , x0 , y0 , x1 , y1 ) ; "<AssertPlaceHolder>" ; } clip ( org . eclipse . swt . graphics . Rectangle , int , int , int , int ) { int maxLoops = 3 ; int quadrant0 = org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . computeQuadrant ( x0 , y0 , bounds ) ; int quadrant1 = org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . computeQuadrant ( x1 , y1 , bounds ) ; if ( ( quadrant0 == 0 ) && ( quadrant1 == 0 ) ) { return new org . eclipse . swt . graphics . Rectangle ( x0 , y0 , ( x1 - x0 ) , ( y1 - y0 ) ) ; } if ( ( ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . guaranteedOut ( quadrant0 , quadrant1 ) ) || ( ( bounds . width ) == 0 ) ) || ( ( bounds . height ) == 0 ) ) { return null ; } long deltaY = ( ( long ) ( y1 ) ) - ( ( long ) ( y0 ) ) ; long deltaX = ( ( long ) ( x1 ) ) - ( ( long ) ( x0 ) ) ; double slope = deltaY / ( ( double ) ( deltaX ) ) ; double antiSlope = deltaX / ( ( double ) ( deltaY ) ) ; int newX0 = x0 ; int newY0 = y0 ; int newX1 = x1 ; int newY1 = y1 ; for ( int i = 0 ; ( i < maxLoops ) && ( quadrant0 != 0 ) ; i ++ ) { if ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . guaranteedOut ( quadrant0 , quadrant1 ) ) { return null ; } if ( ( quadrant0 & ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . UP ) ) != 0 ) { newX0 = ( ( int ) ( newX0 + ( antiSlope * ( ( ( bounds . y ) + ( bounds . height ) ) - newY0 ) ) ) ) ; newY0 = ( bounds . height ) + ( bounds . y ) ; } else if ( ( quadrant0 & ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . DOWN ) ) != 0 ) { newX0 = ( ( int ) ( newX0 + ( antiSlope * ( ( bounds . y ) - newY0 ) ) ) ) ; newY0 = bounds . y ; } else if ( ( quadrant0 & ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . RIGHT ) ) != 0 ) { newY0 = ( ( int ) ( newY0 + ( slope * ( ( ( bounds . x ) + ( bounds . width ) ) - newX0 ) ) ) ) ; newX0 = ( bounds . x ) + ( bounds . width ) ; } else { newY0 = ( ( int ) ( newY0 + ( slope * ( ( bounds . x ) - newX0 ) ) ) ) ; newX0 = bounds . x ; } quadrant0 = org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . computeQuadrant ( newX0 , newY0 , bounds ) ; } for ( int i = 0 ; ( i < maxLoops ) && ( quadrant1 != 0 ) ; i ++ ) { if ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . guaranteedOut ( quadrant0 , quadrant1 ) ) { return null ; } if ( ( quadrant1 & ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . UP ) ) != 0 ) { newX1 = ( ( int ) ( newX1 + ( antiSlope * ( ( ( bounds . y ) + ( bounds . height ) ) - newY1 ) ) ) ) ; newY1 = ( bounds . height ) + ( bounds . y ) ; } else if ( ( quadrant1 & ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . DOWN ) ) != 0 ) { newX1 = ( ( int ) ( newX1 + ( antiSlope * ( ( bounds . y ) - newY1 ) ) ) ) ; newY1 = bounds . y ; } else if ( ( quadrant1 & ( org . eclipse . tracecompass . internal . tmf . ui . util . LineClipper . RIGHT ) ) != 0 ) { newY1 = ( ( int ) ( newY1 + ( slope * ( ( ( bounds . x ) + ( bounds . width ) ) - newX1 ) ) ) ) ; newX1 = ( bounds . x ) + ( bounds . width ) ; } else { newY1 = ( ( int ) ( newY1 + ( slope * ( ( bounds . x ) - newX1 ) ) ) ) ; newX1
org . junit . Assert . assertEquals ( new org . eclipse . swt . graphics . Rectangle ( 1000 , 100 , ( - 1000 ) , 0 ) , rect )
testInvalidPEMWithHeaderAndFooter ( ) { java . lang . String pem = "jQAwgYkCgYEAwpfpLdi7dWTHNzETt+L7618/dWUQFb/C7o1jIxFgbKOVIB6d5YmvUbJck5PYxFkz" 3 + ( ( ( ( ( ( ( ( ( ( ( "MIICOjCCAaOgAwIBAgIJANXi/oWxvJNzMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNVBAYTAlVTMQ0w" + "jQAwgYkCgYEAwpfpLdi7dWTHNzETt+L7618/dWUQFb/C7o1jIxFgbKOVIB6d5YmvUbJck5PYxFkz" 4 ) + "jQAwgYkCgYEAwpfpLdi7dWTHNzETt+L7618/dWUQFb/C7o1jIxFgbKOVIB6d5YmvUbJck5PYxFkz" 0 ) + "CzAJBgNVBAYTAlVTMQ0wCwYDVQQIEwRUZXN0MQ0wCwYDVQQHEwRUZXN0MQ8wDQYDVQQKEwZIYWRv" ) + "b3AxDTALBgNVBAsTBFRlc3QxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOB" ) + "jQAwgYkCgYEAwpfpLdi7dWTHNzETt+L7618/dWUQFb/C7o1jIxFgbKOVIB6d5YmvUbJck5PYxFkz" ) + "C25fmU5H71WGOI1Kle5TFDmIo+hqh5xqu1YNRZz9i6D94g+2AyYr9BpvH4ZfdHs7r9AU7c3kq68V" ) + "7OPuuaHb25J8isiOyA3RiWuJGQlXTdkCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAdRUyCUqE9sdim" ) + "Fbll9BuZDKV16WXeWGq+kTd7ETe7l0fqXjq5EnrifOai0L/pXwVvS2jrFkKQRlRxRGUNaeEBZ2Wy" ) + "9aTyR+HGHCfvwoCegc9rAVw/DLaRriSO/jnEXzYK6XLVKH+hx5UXrJ7Oyc7JjZUc3g9kCWORThCX" ) + "Mzc1xA==" ) + "\n-----END<sp>CERTIFICATE-----" ) ; try { org . apache . hadoop . security . authentication . util . CertificateUtil . parseRSAPublicKey ( pem ) ; org . junit . Assert . fail ( "jQAwgYkCgYEAwpfpLdi7dWTHNzETt+L7618/dWUQFb/C7o1jIxFgbKOVIB6d5YmvUbJck5PYxFkz" 2 ) ; } catch ( javax . servlet . ServletException se ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
org . junit . Assert . assertTrue ( se . getMessage ( ) . contains ( "jQAwgYkCgYEAwpfpLdi7dWTHNzETt+L7618/dWUQFb/C7o1jIxFgbKOVIB6d5YmvUbJck5PYxFkz" 1 ) )
shouldReturnMergedRecordsWithOneEventNoUsage ( ) { org . openstack . atlas . usagerefactor . List < org . openstack . atlas . service . domain . usage . entities . LoadBalancerMergedHostUsage > mergedUsages = usagePollerHelper . processExistingEvents ( lbHostMap ) ; "<AssertPlaceHolder>" ; org . openstack . atlas . usagerefactor . junit . AssertLoadBalancerMergedHostUsage . hasValues ( 1234 , 124 , 0L , 0L , 0L , 0L , 0 , 0 , 1 , 3 , UsageEvent . SSL_ONLY_ON , "2013-04-10<sp>20:03:00" , mergedUsages . get ( 0 ) ) ; org . openstack . atlas . usagerefactor . junit . AssertLoadBalancerMergedHostUsage . hasValues ( 1234 , 123 , 0L , 0L , 0L , 0L , 0 , 0 , 1 , 5 , UsageEvent . SSL_MIXED_ON , "2013-04-10<sp>20:02:00" , mergedUsages . get ( 1 ) ) ; } size ( ) { return size ; }
org . junit . Assert . assertEquals ( 2 , mergedUsages . size ( ) )
testEmptyStringConstructor ( ) { java . io . Reader reader = new com . twelvemonkeys . io . StringArrayReader ( new java . lang . String [ ] { "" } ) ; "<AssertPlaceHolder>" ; } read ( ) { if ( ! ( ensureBuffer ( ) ) ) { return - 1 ; } return ( buffer . get ( ) ) & 255 ; }
org . junit . Assert . assertEquals ( ( - 1 ) , reader . read ( ) )
testTemporaryTrue ( ) { org . apache . activemq . artemis . api . core . client . ClientSession session = createSessionFactory ( locator ) . createSession ( false , true , true ) ; session . createTemporaryQueue ( address , queueName ) ; org . apache . activemq . artemis . core . postoffice . Binding binding = server . getPostOffice ( ) . getBinding ( queueName ) ; org . apache . activemq . artemis . core . server . Queue q = ( ( org . apache . activemq . artemis . core . server . Queue ) ( binding . getBindable ( ) ) ) ; "<AssertPlaceHolder>" ; session . close ( ) ; } isTemporary ( ) { return temporary ; }
org . junit . Assert . assertTrue ( q . isTemporary ( ) )
test8With4 ( ) { final java . util . Random r = new java . util . Random ( 3434 ) ; for ( int i = 0 ; i < 8 ; i ++ ) { final org . opengis . feature . simple . SimpleFeature feature = createTestFeature ( ( "f" + i ) , new org . locationtech . jts . geom . Coordinate ( round ( ( 30.0 + ( ( r . nextGaussian ( ) ) * 1.0E-5 ) ) ) , round ( ( 30.0 + ( ( r . nextGaussian ( ) ) * 1.0E-5 ) ) ) ) ) ; mapDriver . addInput ( new org . locationtech . geowave . mapreduce . input . GeoWaveInputKey ( adapterId , new org . locationtech . geowave . core . index . ByteArray ( feature . getID ( ) ) ) , feature ) ; } final java . util . List < org . apache . hadoop . mrunit . types . Pair < org . locationtech . geowave . analytic . mapreduce . nn . NNMapReduce . PartitionDataWritable , org . locationtech . geowave . analytic . AdapterWithObjectWritable > > mapperResults = mapDriver . run ( ) ; final java . util . List < org . apache . hadoop . mrunit . types . Pair < org . locationtech . geowave . analytic . mapreduce . nn . NNMapReduce . PartitionDataWritable , java . util . List < org . locationtech . geowave . analytic . AdapterWithObjectWritable > > > partitions = getReducerDataFromMapperInput ( mapperResults ) ; reduceDriver . addAll ( partitions ) ; reduceDriver . getConfiguration ( ) . setInt ( org . locationtech . geowave . mapreduce . GeoWaveConfiguratorBase . enumToConfKey ( org . locationtech . geowave . analytic . mapreduce . nn . NNMapReduce . class , ClusteringParameters . Clustering . MINIMUM_SIZE ) , 4 ) ; final java . util . List < org . apache . hadoop . mrunit . types . Pair < org . locationtech . geowave . mapreduce . input . GeoWaveInputKey , org . apache . hadoop . io . ObjectWritable > > reduceResults = reduceDriver . run ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return getCluster ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , reduceResults . size ( ) )
testConcurrentEvaluationWithDifferingLocals ( ) { final com . mitchellbosecke . pebble . PebbleEngine engine = new com . mitchellbosecke . pebble . PebbleEngine . Builder ( ) . loader ( new com . mitchellbosecke . pebble . loader . StringLoader ( ) ) . strictVariables ( false ) . build ( ) ; java . lang . String templateSource = "{{<sp>2000.234<sp>|<sp>numberformat<sp>}}" ; final com . mitchellbosecke . pebble . template . PebbleTemplate template = engine . getTemplate ( templateSource ) ; java . util . concurrent . ExecutorService es = java . util . concurrent . Executors . newCachedThreadPool ( ) ; final java . util . concurrent . atomic . AtomicInteger totalFailed = new java . util . concurrent . atomic . AtomicInteger ( ) ; int numOfConcurrentEvaluations = java . lang . Math . min ( 4 , java . lang . Runtime . getRuntime ( ) . availableProcessors ( ) ) ; final java . util . concurrent . Semaphore semaphore = new java . util . concurrent . Semaphore ( numOfConcurrentEvaluations ) ; final java . lang . String germanResult = "2.000,234" ; final java . lang . String canadianResult = "2,000.234" ; for ( int i = 0 ; i < 1000 ; i ++ ) { semaphore . acquire ( ) ; es . submit ( ( ) -> { try { final boolean isGerman = com . mitchellbosecke . pebble . ConcurrencyTest . r . nextBoolean ( ) ; final java . util . Locale locale = ( isGerman ) ? Locale . GERMANY : Locale . CANADA ; final java . io . StringWriter writer = new java . io . StringWriter ( ) ; template . evaluate ( writer , locale ) ; final java . lang . String expectedResult = ( isGerman ) ? germanResult : canadianResult ; final java . lang . String actualResult = writer . toString ( ) ; if ( ! ( expectedResult . equals ( actualResult ) ) ) { System . out . println ( java . lang . String . format ( "Locale:<sp>%s\nExpected:<sp>%s\nActual:<sp>%s\n" , locale . toString ( ) , expectedResult , actualResult ) ) ; totalFailed . incrementAndGet ( ) ; } } catch ( java . io . IOException | com . mitchellbosecke . pebble . error . PebbleException e ) { com . mitchellbosecke . pebble . e . printStackTrace ( ) ; totalFailed . incrementAndGet ( ) ; } finally { semaphore . release ( ) ; } } ) ; if ( ( totalFailed . intValue ( ) ) > 0 ) { break ; } } semaphore . acquire ( numOfConcurrentEvaluations ) ; es . shutdown ( ) ; "<AssertPlaceHolder>" ; } intValue ( ) { return this . getValue ( ) ; }
org . junit . Assert . assertEquals ( 0 , totalFailed . intValue ( ) )
test_equals_incorrectType ( ) { org . threeten . extra . DayOfMonth test = org . threeten . extra . DayOfMonth . of ( 1 ) ; java . lang . Object obj = "Incorrect<sp>type" ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == otherAmount ) { return true ; } if ( otherAmount instanceof org . threeten . extra . Seconds ) { org . threeten . extra . Seconds other = ( ( org . threeten . extra . Seconds ) ( otherAmount ) ) ; return ( this . seconds ) == ( other . seconds ) ; } return false ; }
org . junit . Assert . assertEquals ( false , test . equals ( obj ) )
testStringQuery ( ) { com . liferay . portal . search . query . StringQuery stringQuery = com . liferay . portal . search . query . test . QueriesInstantiationTest . _queries . string ( "query" ) ; "<AssertPlaceHolder>" ; } string ( java . lang . String ) { return new com . liferay . portal . search . internal . query . StringQueryImpl ( query ) ; }
org . junit . Assert . assertNotNull ( stringQuery )
compareInsertPerformance ( ) { System . out . println ( "compareInsertPerformance()" ) ; int repeats = 10 ; int dataSize = 100000 ; int minValue = 1 ; int maxValue = 8000000 ; final com . google . common . base . Stopwatch sw = new com . google . common . base . Stopwatch ( ) ; double [ ] [ ] times = new double [ uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS . length ] [ repeats ] ; double [ ] [ ] mem = new double [ uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS . length ] [ repeats ] ; for ( int r = 0 ; r < repeats ; r ++ ) { uk . ac . susx . mlcl . lib . collect . IntIterator gen = new uk . ac . susx . mlcl . lib . UniformIntGenerator ( newRandom ( ) , dataSize , minValue , maxValue ) ; final int [ ] data = new uk . ac . susx . mlcl . lib . collect . IntOpenHashSet ( gen ) . toIntArray ( ) ; uk . ac . susx . mlcl . lib . collect . IntSet [ ] sets = new uk . ac . susx . mlcl . lib . collect . IntSet [ uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS . length ] ; System . out . printf ( "Repeat<sp>%d<sp>of<sp>%d.%n" , r , repeats ) ; for ( int i = 0 ; i < ( uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS . length ) ; i ++ ) { final uk . ac . susx . mlcl . lib . collect . IntSet intSet = uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS [ i ] . newInstance ( ) ; sw . reset ( ) ; sw . start ( ) ; for ( int aData : data ) { intSet . add ( aData ) ; } sw . stop ( ) ; times [ i ] [ r ] = sw . elapsedMillis ( ) ; uk . ac . susx . mlcl . lib . collect . IntSetsTest . attemptToTrim ( intSet ) ; sets [ i ] = new uk . ac . susx . mlcl . lib . collect . IntOpenHashSet ( intSet ) ; uk . ac . susx . mlcl . lib . MemoryUsage mu = new uk . ac . susx . mlcl . lib . MemoryUsage ( ) ; mu . add ( intSet ) ; mem [ i ] [ r ] = mu . getInstanceSizeBytes ( ) ; System . out . printf ( "%20s<sp>%6.2f<sp>seconds<sp>%s%n" , uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS [ i ] . getSimpleName ( ) , ( ( sw . elapsedMillis ( ) ) / 1000.0 ) , uk . ac . susx . mlcl . lib . MiscUtil . humanReadableBytes ( mu . getInstanceSizeBytes ( ) ) ) ; } for ( int i = 0 ; i < ( ( sets . length ) - 1 ) ; i ++ ) { "<AssertPlaceHolder>" ; } } System . out . printf ( "Results:%n" ) ; for ( int i = 0 ; i < ( uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS . length ) ; i ++ ) { double avTime = ( uk . ac . susx . mlcl . lib . collect . ArrayMath . mean ( times [ i ] ) ) / 1000.0 ; double seTime = ( uk . ac . susx . mlcl . lib . collect . ArrayMath . sampleStddev ( times [ i ] ) ) / 1000.0 ; long avMem = ( ( long ) ( uk . ac . susx . mlcl . lib . collect . ArrayMath . mean ( mem [ i ] ) ) ) ; long seMem = ( ( long ) ( uk . ac . susx . mlcl . lib . collect . ArrayMath . sampleStddev ( mem [ i ] ) ) ) ; System . out . printf ( "%20s<sp>%6.3f<sp>~%-6.3f<sp>seconds<sp>%-8s<sp>~%-8s<sp>%n" , uk . ac . susx . mlcl . lib . collect . IntSetsTest . INT_SET_IMPLEMENTATIONS [ i ] . getSimpleName ( ) , avTime , seTime , uk . ac . susx . mlcl . lib . MiscUtil . humanReadableBytes ( avMem ) , uk . ac . susx . mlcl . lib . MiscUtil . humanReadableBytes ( seMem ) ) ; } } getInstanceSizeBytes ( ) { return ( ( getInstanceSizeBits ( ) ) / 8 ) + ( ( ( getInstanceSizeBits ( ) ) % 8 ) > 0 ? 1 : 0 ) ; }
org . junit . Assert . assertEquals ( sets [ i ] , sets [ ( i + 1 ) ] )
testSharingMetricAddSuccess ( ) { com . alibaba . craftsman . dto . SharingMetricAddCmd sharingMetricAddCmd = new com . alibaba . craftsman . dto . SharingMetricAddCmd ( ) ; com . alibaba . craftsman . dto . clientobject . SharingMetricCO sharingMetricCO = new com . alibaba . craftsman . dto . clientobject . SharingMetricCO ( ) ; sharingMetricCO . setOwnerId ( "testSharingMetricAddSuccess_089765" ) ; sharingMetricCO . setSharingName ( "Structured<sp>thinking" ) ; sharingMetricCO . setSharingDate ( "2018-09-09" ) ; sharingMetricCO . setSharingLink ( "sharing.com" ) ; sharingMetricCO . setSharingScope ( sharingMetricCO . TEAM_SCOPE ) ; sharingMetricAddCmd . setSharingMetricCO ( sharingMetricCO ) ; com . alibaba . cola . dto . Response response = metricsService . addSharingMetric ( sharingMetricAddCmd ) ; "<AssertPlaceHolder>" ; } isSuccess ( ) { return isSuccess ; }
org . junit . Assert . assertTrue ( response . isSuccess ( ) )
testBadCertZip ( ) { boolean result = zipValidator . validateZipFile ( org . codice . ddf . catalog . transformer . zip . ZipValidatorTest . BAD_CERT_ZIP_PATH ) ; "<AssertPlaceHolder>" ; } validateZipFile ( java . lang . String ) { try ( java . util . jar . JarFile jarFile = new java . util . jar . JarFile ( filePath ) ) { java . util . jar . Manifest man = jarFile . getManifest ( ) ; if ( man == null ) { throw new org . codice . ddf . catalog . transformer . zip . ZipValidationException ( "Zip<sp>validation<sp>failed,<sp>missing<sp>manifest<sp>file." ) ; } java . util . List < java . util . jar . JarEntry > entriesVec = new java . util . ArrayList ( ) ; byte [ ] buffer = new byte [ ZipDecompression . BUFFER_SIZE ] ; java . util . Enumeration entries = jarFile . entries ( ) ; while ( entries . hasMoreElements ( ) ) { java . util . jar . JarEntry je = ( ( java . util . jar . JarEntry ) ( entries . nextElement ( ) ) ) ; if ( je . isDirectory ( ) ) { continue ; } entriesVec . add ( je ) ; try ( java . io . InputStream is = jarFile . getInputStream ( je ) ) { while ( ( is . read ( buffer , 0 , buffer . length ) ) != ( - 1 ) ) { } is . close ( ) ; } catch ( java . io . IOException e ) { throw new org . codice . ddf . catalog . transformer . zip . ZipValidationException ( java . lang . String . format ( "Zip<sp>validation<sp>failed,<sp>unable<sp>to<sp>get<sp>input<sp>stream<sp>for<sp>entry<sp>%s" , je . getName ( ) ) ) ; } } java . util . Iterator < java . util . jar . JarEntry > iter = entriesVec . iterator ( ) ; while ( iter . hasNext ( ) ) { java . util . jar . JarEntry je = iter . next ( ) ; java . security . cert . Certificate [ ] certs = je . getCertificates ( ) ; if ( ( certs == null ) || ( ( certs . length ) == 0 ) ) { if ( ! ( je . getName ( ) . startsWith ( "META-INF" ) ) ) { throw new org . codice . ddf . catalog . transformer . zip . ZipValidationException ( java . lang . String . format ( "Zip<sp>validation<sp>failed,<sp>unable<sp>to<sp>get<sp>certificates<sp>for<sp>entry<sp>%s" , je . getName ( ) ) ) ; } } else { int startIndex = 0 ; java . security . cert . X509Certificate [ ] certChain ; while ( ( certChain = getAChain ( certs , startIndex ) ) != null ) { try { merlin . verifyTrust ( certChain [ 0 ] . getPublicKey ( ) ) ; } catch ( org . apache . wss4j . common . ext . WSSecurityException e1 ) { throw new org . codice . ddf . catalog . transformer . zip . ZipValidationException ( java . lang . String . format ( "Zip<sp>validation<sp>failed,<sp>untrusted<sp>certificates<sp>for<sp>entry<sp>%s" , je . getName ( ) ) ) ; } startIndex += certChain . length ; } } } } catch ( java . io . IOException e ) { throw new org . codice . ddf . catalog . transformer . zip . ZipValidationException ( java . lang . String . format ( "Zip<sp>validation<sp>failed<sp>for<sp>file<sp>:<sp>%s" , filePath ) ) ; } return true ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
contentTypeCharset ( ) { final java . lang . String contentType = ( ( org . apache . olingo . server . core . deserializer . batch . BatchParserCommonTest . MULTIPART_MIXED ) + ";<sp>charset=UTF-8;boundary=" ) + ( BatchParserCommon . BOUNDARY ) ; final java . lang . String boundary = org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . getBoundary ( contentType , 0 ) ; "<AssertPlaceHolder>" ; } getBoundary ( java . lang . String , int ) { final org . apache . olingo . commons . api . format . ContentType type = org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . parseContentType ( contentType , ContentType . MULTIPART_MIXED , line ) ; final java . lang . String boundary = type . getParameter ( org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . BOUNDARY ) ; if ( boundary == null ) { throw new org . apache . olingo . server . api . deserializer . batch . BatchDeserializerException ( "Missing<sp>boundary." , BatchDeserializerException . MessageKeys . MISSING_BOUNDARY_DELIMITER , java . lang . Integer . toString ( line ) ) ; } final java . util . regex . Matcher matcher = org . apache . olingo . server . core . deserializer . batch . BatchParserCommon . PATTERN_BOUNDARY . matcher ( boundary ) ; if ( matcher . matches ( ) ) { return ( matcher . group ( 1 ) ) == null ? matcher . group ( 2 ) : matcher . group ( 1 ) ; } else { throw new org . apache . olingo . server . api . deserializer . batch . BatchDeserializerException ( "Invalid<sp>boundary<sp>format" , BatchDeserializerException . MessageKeys . INVALID_BOUNDARY , java . lang . Integer . toString ( line ) ) ; } }
org . junit . Assert . assertEquals ( BatchParserCommon . BOUNDARY , boundary )
isCurrentUserAuthenticatedShouldNotBeAuthenticatedWhenUserIsAuthenticatedByAnonymousAuthentication ( ) { org . springframework . security . core . context . SecurityContextHolder . getContext ( ) . setAuthentication ( new org . springframework . security . authentication . AnonymousAuthenticationToken ( com . epam . rft . atsy . service . security . SpringSecurityAuthenticationServiceTest . USER_NAME , com . epam . rft . atsy . service . security . SpringSecurityAuthenticationServiceTest . USER_NAME , org . springframework . security . core . authority . AuthorityUtils . createAuthorityList ( com . epam . rft . atsy . service . security . SpringSecurityAuthenticationServiceTest . USER_NAME ) ) ) ; boolean result = springSecurityAuthenticationService . isCurrentUserAuthenticated ( ) ; "<AssertPlaceHolder>" ; } isCurrentUserAuthenticated ( ) { return ( ( ( org . springframework . security . core . context . SecurityContextHolder . getContext ( ) . getAuthentication ( ) ) != null ) && ( org . springframework . security . core . context . SecurityContextHolder . getContext ( ) . getAuthentication ( ) . isAuthenticated ( ) ) ) && ( ! ( ( org . springframework . security . core . context . SecurityContextHolder . getContext ( ) . getAuthentication ( ) ) instanceof org . springframework . security . authentication . AnonymousAuthenticationToken ) ) ; }
org . junit . Assert . assertFalse ( result )
testDeleteBusinessObjectDefinitionSubjectMatterExpert ( ) { org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpertKey key = new org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpertKey ( BDEF_NAMESPACE , BDEF_NAME , USER_ID ) ; org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpert businessObjectDefinitionSubjectMatterExpert = new org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpert ( ID , key ) ; when ( businessObjectDefinitionSubjectMatterExpertService . deleteBusinessObjectDefinitionSubjectMatterExpert ( key ) ) . thenReturn ( businessObjectDefinitionSubjectMatterExpert ) ; org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpert deletedBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertRestController . deleteBusinessObjectDefinitionSubjectMatterExpert ( org . finra . herd . rest . BDEF_NAMESPACE , org . finra . herd . rest . BDEF_NAME , org . finra . herd . rest . USER_ID ) ; verify ( businessObjectDefinitionSubjectMatterExpertService ) . deleteBusinessObjectDefinitionSubjectMatterExpert ( key ) ; verifyNoMoreInteractions ( businessObjectDefinitionSubjectMatterExpertService ) ; "<AssertPlaceHolder>" ; } deleteBusinessObjectDefinitionSubjectMatterExpert ( org . finra . herd . model . api . xml . BusinessObjectDefinitionSubjectMatterExpertKey ) { validateBusinessObjectDefinitionSubjectMatterExpertKey ( key ) ; org . finra . herd . model . jpa . BusinessObjectDefinitionSubjectMatterExpertEntity businessObjectDefinitionSubjectMatterExpertEntity = businessObjectDefinitionSubjectMatterExpertDaoHelper . getBusinessObjectDefinitionSubjectMatterExpertEntity ( key ) ; org . finra . herd . model . jpa . BusinessObjectDefinitionEntity businessObjectDefinitionEntity = businessObjectDefinitionSubjectMatterExpertEntity . getBusinessObjectDefinition ( ) ; businessObjectDefinitionEntity . getSubjectMatterExperts ( ) . remove ( businessObjectDefinitionSubjectMatterExpertEntity ) ; businessObjectDefinitionDao . saveAndRefresh ( businessObjectDefinitionEntity ) ; org . finra . herd . service . impl . BusinessObjectDefinitionSubjectMatterExpertServiceImpl . LOGGER . info ( ( "Modify<sp>the<sp>business<sp>object<sp>definition<sp>in<sp>the<sp>search<sp>index<sp>associated<sp>with<sp>the<sp>business<sp>object<sp>definition<sp>subject<sp>matter<sp>expert<sp>being<sp>deleted." + "<sp>businessObjectDefinitionId=\"{}\",<sp>searchIndexUpdateType=\"{}\"" ) , businessObjectDefinitionEntity . getId ( ) , org . finra . herd . service . impl . SEARCH_INDEX_UPDATE_TYPE_UPDATE ) ; searchIndexUpdateHelper . modifyBusinessObjectDefinitionInSearchIndex ( businessObjectDefinitionEntity , org . finra . herd . service . impl . SEARCH_INDEX_UPDATE_TYPE_UPDATE ) ; return createBusinessObjectDefinitionSubjectMatterExpertFromEntity ( businessObjectDefinitionSubjectMatterExpertEntity ) ; }
org . junit . Assert . assertEquals ( businessObjectDefinitionSubjectMatterExpert , deletedBusinessObjectDefinitionSubjectMatterExpert )