input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
getBooleanFalse0 ( ) { final java . lang . Character value = '0' ; final io . trane . ndbc . value . CharacterValue wrapper = new io . trane . ndbc . value . CharacterValue ( value ) ; "<AssertPlaceHolder>" ; } getBoolean ( ) { return ( get ( ) ) == 1 ; }
|
org . junit . Assert . assertEquals ( false , wrapper . getBoolean ( ) )
|
testSetRange ( ) { K key = keyFactory . instance ( ) ; V value1 = valueFactory . instance ( ) ; V value2 = valueFactory . instance ( ) ; org . junit . Assume . assumeTrue ( ( value1 instanceof java . lang . String ) ) ; valueOps . set ( key , value1 ) ; valueOps . set ( key , value2 , 0 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { return delegate . get ( key ) ; }
|
org . junit . Assert . assertEquals ( value2 , valueOps . get ( key ) )
|
melPrefixIsValidDw ( ) { disableMel ( ) ; "<AssertPlaceHolder>" ; expressionManager . evaluate ( "#[mel:1]" ) ; } isValid ( java . lang . String ) { return validate ( expression ) . isSuccess ( ) ; }
|
org . junit . Assert . assertThat ( expressionManager . isValid ( "#[mel:1]" ) , org . hamcrest . Matchers . is ( true ) )
|
testWarningsAreCleared ( ) { java . sql . Statement stmt = con . createStatement ( ) ; stmt . execute ( "CREATE<sp>TEMP<sp>TABLE<sp>unused<sp>(a<sp>int<sp>primary<sp>key)" ) ; stmt . executeQuery ( "SELECT<sp>1" ) ; "<AssertPlaceHolder>" ; stmt . close ( ) ; } getWarnings ( ) { checkClosed ( ) ; return warnings ; }
|
org . junit . Assert . assertNull ( stmt . getWarnings ( ) )
|
testGetColumns ( ) { org . nd4j . linalg . api . ndarray . INDArray matrix = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 6 , 6 ) . reshape ( 2 , 3 ) ; log . info ( "Original:<sp>{}" , matrix ) ; org . nd4j . linalg . api . ndarray . INDArray matrixGet = matrix . getColumns ( new int [ ] { 1 , 2 } ) ; org . nd4j . linalg . api . ndarray . INDArray matrixAssertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] [ ] { new double [ ] { 3 , 5 } , new double [ ] { 4 , 6 } } ) ; log . info ( "order<sp>A:<sp>{}" , java . util . Arrays . toString ( matrixAssertion . shapeInfoDataBuffer ( ) . asInt ( ) ) ) ; log . info ( "order<sp>B:<sp>{}" , java . util . Arrays . toString ( matrixGet . shapeInfoDataBuffer ( ) . asInt ( ) ) ) ; log . info ( "data<sp>A:<sp>{}" , java . util . Arrays . toString ( matrixAssertion . data ( ) . asFloat ( ) ) ) ; log . info ( "data<sp>B:<sp>{}" , java . util . Arrays . toString ( matrixGet . data ( ) . asFloat ( ) ) ) ; "<AssertPlaceHolder>" ; } asFloat ( ) { return new org . nd4j . linalg . cpu . nativecpu . complex . ComplexFloat ( ( ( float ) ( real ) ) , ( ( float ) ( imag ) ) ) ; }
|
org . junit . Assert . assertEquals ( matrixAssertion , matrixGet )
|
testToMap ( ) { org . apache . ambari . server . collections . Predicate mockPredicate1 = createStrictMock ( org . apache . ambari . server . collections . Predicate . class ) ; expect ( mockPredicate1 . toMap ( ) ) . andReturn ( java . util . Collections . singletonMap ( "nop" , "foo" ) ) . times ( 1 ) ; org . apache . ambari . server . collections . Predicate mockPredicate2 = createStrictMock ( org . apache . ambari . server . collections . Predicate . class ) ; expect ( mockPredicate2 . toMap ( ) ) . andReturn ( java . util . Collections . singletonMap ( "nop" , "baz" ) ) . times ( 1 ) ; replayAll ( ) ; org . apache . ambari . server . collections . functors . OrPredicate predicate = new org . apache . ambari . server . collections . functors . OrPredicate ( mockPredicate1 , mockPredicate2 ) ; java . util . Map < java . lang . String , java . lang . Object > actualMap = predicate . toMap ( ) ; verifyAll ( ) ; java . util . Map < java . lang . String , java . lang . Object > expectedMap = new java . util . HashMap ( ) ; expectedMap . put ( "or" , new java . util . ArrayList ( java . util . Arrays . asList ( java . util . Collections . < java . lang . String , java . lang . Object > singletonMap ( "nop" , "foo" ) , java . util . Collections . < java . lang . String , java . lang . Object > singletonMap ( "nop" , "baz" ) ) ) ) ; "<AssertPlaceHolder>" ; } verifyAll ( ) { verify ( org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . request , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . topologyManager , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . topologyFactory , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . topologyRequest , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . blueprintFactory , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . securityFactory , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . requestStatusResponse , org . apache . ambari . server . controller . internal . ClusterResourceProviderTest . blueprint ) ; }
|
org . junit . Assert . assertEquals ( expectedMap , actualMap )
|
testParameter ( ) { final net . violet . platform . api . actions . Action theAction = new net . violet . platform . api . actions . press . Get ( ) ; final net . violet . platform . api . callers . APICaller caller = getPublicApplicationAPICaller ( ) ; final java . util . Map < java . lang . String , java . lang . Object > theParams = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; theParams . put ( "language" , "JPFR" ) ; final net . violet . platform . api . actions . ActionParam theActionParam = new net . violet . platform . api . actions . ActionParam ( caller , theParams ) ; final java . lang . Object theResult = theAction . processRequest ( theActionParam ) ; "<AssertPlaceHolder>" ; } put ( K , T ) { this . mMap . put ( theRef , new net . violet . db . cache . CacheReference < K , T > ( theRef , theRecord , this . mReferenceQueue ) ) ; this . mLinkedMap . put ( theRef , theRecord ) ; }
|
org . junit . Assert . assertNotNull ( theResult )
|
bigDataInMap ( ) { final byte [ ] data = new byte [ ( 16 * 1024 ) * 1024 ] ; rnd . nextBytes ( data ) ; data [ 1 ] = 0 ; data [ 3 ] = 0 ; data [ 5 ] = 0 ; org . apache . flink . test . streaming . runtime . BigUserProgramJobSubmitITCase . CollectingSink resultSink = new org . apache . flink . test . streaming . runtime . BigUserProgramJobSubmitITCase . CollectingSink ( ) ; org . apache . flink . streaming . api . environment . StreamExecutionEnvironment env = org . apache . flink . streaming . api . environment . StreamExecutionEnvironment . getExecutionEnvironment ( ) ; env . setParallelism ( 1 ) ; org . apache . flink . streaming . api . datastream . DataStream < java . lang . Integer > src = env . fromElements ( 1 , 3 , 5 ) ; src . map ( new org . apache . flink . api . common . functions . MapFunction < java . lang . Integer , java . lang . String > ( ) { private static final long serialVersionUID = 1L ; @ org . apache . flink . test . streaming . runtime . Override public java . lang . String map ( java . lang . Integer value ) throws org . apache . flink . test . streaming . runtime . Exception { return ( ( "x<sp>" + value ) + "<sp>" ) + ( data [ value ] ) ; } } ) . addSink ( resultSink ) ; org . apache . flink . runtime . jobgraph . JobGraph jobGraph = org . apache . flink . streaming . api . graph . StreamingJobGraphGenerator . createJobGraph ( env . getStreamGraph ( ) ) ; final org . apache . flink . client . program . rest . RestClusterClient < org . apache . flink . client . deployment . StandaloneClusterId > restClusterClient = new org . apache . flink . client . program . rest . RestClusterClient ( org . apache . flink . test . streaming . runtime . BigUserProgramJobSubmitITCase . MINI_CLUSTER_RESOURCE . getClientConfiguration ( ) , org . apache . flink . client . deployment . StandaloneClusterId . getInstance ( ) ) ; try { restClusterClient . setDetached ( false ) ; restClusterClient . submitJob ( jobGraph , org . apache . flink . test . streaming . runtime . BigUserProgramJobSubmitITCase . class . getClassLoader ( ) ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "x<sp>1<sp>0" , "x<sp>3<sp>0" , "x<sp>5<sp>0" ) ; java . util . List < java . lang . String > result = org . apache . flink . test . streaming . runtime . BigUserProgramJobSubmitITCase . CollectingSink . result ; java . util . Collections . sort ( expected ) ; java . util . Collections . sort ( result ) ; "<AssertPlaceHolder>" ; } finally { restClusterClient . shutdown ( ) ; } } sort ( org . apache . flink . runtime . operators . sort . IndexedSortable ) { sort ( s , 0 , s . size ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
convertList ( ) { com . fasterxml . jackson . databind . node . ArrayNode jsonNodes = new com . fasterxml . jackson . databind . node . ArrayNode ( factory ) ; com . fasterxml . jackson . databind . node . ObjectNode objectNode = new com . fasterxml . jackson . databind . node . ObjectNode ( factory ) ; objectNode . put ( "value" , "data" ) ; jsonNodes . add ( objectNode ) ; java . util . List < java . lang . Object > objects = expressionEvaluatorMock . createAndFillList ( jsonNodes , new java . util . ArrayList ( ) , java . util . List . class . getCanonicalName ( ) , java . util . Collections . singletonList ( java . lang . String . class . getCanonicalName ( ) ) ) ; "<AssertPlaceHolder>" ; } get ( org . drools . workbench . screens . scenariosimulation . client . factories . ScenarioHeaderTextBoxSingletonDOMElementFactory ) { return new org . drools . workbench . screens . scenariosimulation . client . utils . ScenarioSimulationBuilders . HeaderBuilder ( factory ) ; }
|
org . junit . Assert . assertEquals ( "data" , objects . get ( 0 ) )
|
testCompositeDatasetReconfigure ( ) { io . cdap . cdap . api . dataset . lib . CompositeDatasetDefinition composite = new io . cdap . cdap . api . dataset . lib . CompositeDatasetDefinition ( "composite" , "pedantic" , new io . cdap . cdap . api . dataset . lib . PedanticDatasetDefinition ( "pedantic" ) ) { @ io . cdap . cdap . api . dataset . lib . Override public io . cdap . cdap . api . dataset . Dataset getDataset ( io . cdap . cdap . api . dataset . DatasetContext datasetContext , io . cdap . cdap . api . dataset . DatasetSpecification spec , java . util . Map arguments , java . lang . ClassLoader classLoader ) { return null ; } } ; io . cdap . cdap . api . dataset . DatasetSpecification spec = composite . configure ( "nn" , DatasetProperties . EMPTY ) ; io . cdap . cdap . api . dataset . DatasetSpecification respec = composite . reconfigure ( "nn" , DatasetProperties . EMPTY , spec ) ; "<AssertPlaceHolder>" ; try { composite . reconfigure ( "nn" , io . cdap . cdap . api . dataset . DatasetProperties . builder ( ) . add ( "immutable" , "x" ) . build ( ) , spec ) ; org . junit . Assert . fail ( "reconfigure<sp>should<sp>have<sp>thrown<sp>exception" ) ; } catch ( io . cdap . cdap . api . dataset . IncompatibleUpdateException e ) { } } reconfigure ( java . lang . String , io . cdap . cdap . api . dataset . DatasetProperties , io . cdap . cdap . api . dataset . DatasetSpecification ) { if ( ! ( currentSpec . getProperties ( ) . get ( "schema" ) . equals ( getSchemaString ( newProperties ) ) ) ) { throw new io . cdap . cdap . api . dataset . IncompatibleUpdateException ( "Attempt<sp>to<sp>alter<sp>schema" ) ; } return configure ( instanceName , newProperties ) ; }
|
org . junit . Assert . assertEquals ( spec , respec )
|
restGetShouldTimeout ( ) { java . lang . String uri = java . lang . String . format ( "http://localhost:%d/get" , mockServerRule . getPort ( ) ) ; mockServerClient . when ( request ( ) . withMethod ( "GET" ) . withPath ( "/get" ) ) . respond ( response ( ) . withBody ( "{\"get\":\"success\"}" ) ) ; java . util . Map < java . lang . String , java . lang . Object > globalConfig = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( org . apache . metron . stellar . dsl . functions . RestConfig . STELLAR_REST_SETTINGS , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( org . apache . metron . stellar . dsl . functions . RestConfig . TIMEOUT , 1 ) ; } } ) ; } } ; context . addCapability ( Context . Capabilities . GLOBAL_CONFIG , ( ) -> globalConfig ) ; java . util . Map < java . lang . String , java . lang . Object > actual = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( run ( java . lang . String . format ( "REST_GET('%s')" , uri ) , context ) ) ) ; "<AssertPlaceHolder>" ; } run ( org . apache . metron . stellar . common . benchmark . Microbenchmark$StellarStatement , int , int ) { org . apache . metron . stellar . common . benchmark . Microbenchmark . run ( warmupRounds , statement , ( ts ) -> { } ) ; final org . apache . commons . math3 . stat . descriptive . DescriptiveStatistics stats = new org . apache . commons . math3 . stat . descriptive . DescriptiveStatistics ( ) ; org . apache . metron . stellar . common . benchmark . Microbenchmark . run ( benchmarkRounds , statement , ( ts ) -> { stats . addValue ( ts ) ; } ) ; return stats ; }
|
org . junit . Assert . assertNull ( actual )
|
execute ( ) { net . simon987 . server . assembly . Status status = new net . simon987 . server . assembly . Status ( ) ; status . clear ( ) ; net . simon987 . server . assembly . instruction . BrkInstruction brkInstruction = new net . simon987 . server . assembly . instruction . BrkInstruction ( ) ; brkInstruction . execute ( status ) ; "<AssertPlaceHolder>" ; } isBreakFlag ( ) { return breakFlag ; }
|
org . junit . Assert . assertEquals ( true , status . isBreakFlag ( ) )
|
two_$parent_field_comparison_returns_false_when_expression_false ( ) { com . redhat . lightblue . query . QueryExpression q = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'field':'field6.nf1.$parent.$parent.field4','op':'<','rfield':'field6.nf1.$parent.$parent.field3'}" ) ; com . redhat . lightblue . eval . QueryEvaluator qe = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( q , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext ctx = qe . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
|
org . junit . Assert . assertFalse ( ctx . getResult ( ) )
|
testParseISODateInArray ( ) { final java . text . SimpleDateFormat format = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) ; final java . lang . Object doc = com . allanbank . mongodb . bson . json . Json . parse ( "{<sp>a<sp>:<sp>[ISODate('2012-07-14T01:00:00.000'),ISODate('2012-07-14')]<sp>}" ) ; final com . allanbank . mongodb . bson . builder . DocumentBuilder b = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) ; b . pushArray ( "a" ) . add ( format . parse ( "2012-07-14T01:00:00.000UTC" ) ) . add ( format . parse ( "2012-07-14T00:00:00.000UTC" ) ) ; "<AssertPlaceHolder>" ; } build ( ) { final java . util . List < com . allanbank . mongodb . bson . Element > elements = subElements ( ) ; return elements . toArray ( new com . allanbank . mongodb . bson . Element [ elements . size ( ) ] ) ; }
|
org . junit . Assert . assertEquals ( b . build ( ) , doc )
|
testQueryCollection3 ( ) { java . util . List < org . apache . cxf . jaxrs . ext . search . jpa . Book > books = queryBooks ( "reviews.book.ownerInfo.name<sp>eq<sp>'Barry'" ) ; "<AssertPlaceHolder>" ; } size ( ) { return cache . getSize ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , books . size ( ) )
|
non_range_annotation_returns_null ( ) { org . junit . Before beforeAnnotation = getBeforeAnnotation ( ) ; java . lang . Object enrichedRequest = this . enricher . enrich ( this . originalRequest , beforeAnnotation ) ; "<AssertPlaceHolder>" ; } enrich ( java . lang . Object , java . lang . annotation . Annotation ) { if ( ! ( annotation instanceof com . flextrade . jfixture . annotations . Range ) ) { return null ; } com . flextrade . jfixture . annotations . Range rangeAnnotation = ( ( com . flextrade . jfixture . annotations . Range ) ( annotation ) ) ; return new com . flextrade . jfixture . requests . RangeRequest < java . lang . Long > ( request , rangeAnnotation . min ( ) , rangeAnnotation . max ( ) ) ; }
|
org . junit . Assert . assertNull ( enrichedRequest )
|
testGetJobs ( ) { org . pentaho . platform . api . engine . IPentahoSession mockPentahoSession = mock ( org . pentaho . platform . api . engine . IPentahoSession . class ) ; doReturn ( mockPentahoSession ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService ) . getSession ( ) ; doReturn ( "admin" ) . when ( mockPentahoSession ) . getName ( ) ; doReturn ( true ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService ) . canAdminister ( mockPentahoSession ) ; java . util . List < org . pentaho . platform . api . scheduler2 . Job > mockJobs = new java . util . ArrayList ( ) ; mockJobs . add ( mock ( org . pentaho . platform . api . scheduler2 . Job . class ) ) ; doReturn ( mockJobs ) . when ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . scheduler ) . getJobs ( any ( org . pentaho . platform . api . scheduler2 . IJobFilter . class ) ) ; java . util . List < org . pentaho . platform . api . scheduler2 . Job > jobs = org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . getJobs ( ) ; "<AssertPlaceHolder>" ; verify ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService , times ( 1 ) ) . getSession ( ) ; verify ( mockPentahoSession , times ( 1 ) ) . getName ( ) ; verify ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService , times ( 1 ) ) . canAdminister ( mockPentahoSession ) ; verify ( org . pentaho . platform . web . http . api . resources . services . SchedulerServiceTest . schedulerService . scheduler , times ( 1 ) ) . getJobs ( any ( org . pentaho . platform . api . scheduler2 . IJobFilter . class ) ) ; } getJobs ( ) { org . pentaho . platform . api . engine . IPentahoSession session = getSession ( ) ; final java . lang . String principalName = session . getName ( ) ; final java . lang . Boolean canAdminister = canAdminister ( session ) ; java . util . List < org . pentaho . platform . api . scheduler2 . Job > jobs = getScheduler ( ) . getJobs ( new org . pentaho . platform . api . scheduler2 . IJobFilter ( ) { @ org . pentaho . platform . web . http . api . resources . services . Override public boolean accept ( org . pentaho . platform . api . scheduler2 . Job job ) { if ( canAdminister ) { return ! ( IBlockoutManager . BLOCK_OUT_JOB_NAME . equals ( job . getJobName ( ) ) ) ; } return principalName . equals ( job . getUserName ( ) ) ; } } ) ; return jobs ; }
|
org . junit . Assert . assertEquals ( mockJobs , jobs )
|
getToOutputBody ( ) { just . niubi . httprequest . HttpRequestTest . handler = new just . niubi . httprequest . RequestHandler ( ) { @ just . niubi . httprequest . Override public void handle ( org . eclipse . jetty . server . Request request , javax . servlet . http . HttpServletResponse response ) { response . setStatus ( just . niubi . httprequest . HTTP_OK ) ; try { response . getWriter ( ) . print ( "hello<sp>world" ) ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( ) ; } } } ; java . util . concurrent . atomic . AtomicReference < java . lang . String > body = new java . util . concurrent . atomic . AtomicReference < java . lang . String > ( null ) ; get ( just . niubi . httprequest . HttpRequestTest . url ) . body ( body ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { just . niubi . cache . MapCache . CacheObject cacheObject = cachePool . get ( key ) ; if ( null != cacheObject ) { long cur = ( java . lang . System . currentTimeMillis ( ) ) / 1000 ; if ( ( ( cacheObject . getExpired ( ) ) <= 0 ) || ( ( cacheObject . getExpired ( ) ) > cur ) ) { java . lang . Object result = cacheObject . getValue ( ) ; return ( ( T ) ( result ) ) ; } } return null ; }
|
org . junit . Assert . assertEquals ( "hello<sp>world" , body . get ( ) )
|
shouldGetResourceAsPropertiesWithClassloader ( ) { java . util . Properties file = org . apache . ibatis . io . Resources . getResourceAsProperties ( org . apache . ibatis . io . ResourcesTest . CLASS_LOADER , org . apache . ibatis . io . JPETSTORE_PROPERTIES ) ; "<AssertPlaceHolder>" ; } getResourceAsProperties ( java . lang . ClassLoader , java . lang . String ) { java . util . Properties props = new java . util . Properties ( ) ; java . io . InputStream in = org . apache . ibatis . io . Resources . getResourceAsStream ( loader , resource ) ; props . load ( in ) ; in . close ( ) ; return props ; }
|
org . junit . Assert . assertNotNull ( file )
|
testVoerRegelUitPersoonZonderIndicaties ( ) { final nl . bzk . brp . model . hisvolledig . impl . kern . PersoonHisVolledigImpl huidigeSituatie = new nl . bzk . brp . model . hisvolledig . impl . kern . PersoonHisVolledigImpl ( new nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortPersoonAttribuut ( nl . bzk . brp . model . algemeen . stamgegeven . kern . SoortPersoon . INGESCHREVENE ) ) ; final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > berichtEntiteits = new nl . bzk . brp . bijhouding . business . regels . impl . gegevenset . persoon . reisdocument . BRBY0040 ( ) . voerRegelUit ( new nl . bzk . brp . model . hisvolledig . momentview . kern . PersoonView ( huidigeSituatie ) , null , null , null ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( berichtEntiteits . isEmpty ( ) )
|
testReadComponentType ( ) { java . io . InputStream is = getClass ( ) . getResourceAsStream ( "CalculatorImpl.componentType" ) ; javax . xml . stream . XMLStreamReader reader = org . apache . tuscany . sca . interfacedef . wsdl . xml . ReadTestCase . inputFactory . createXMLStreamReader ( is ) ; org . apache . tuscany . sca . assembly . ComponentType componentType = ( ( org . apache . tuscany . sca . assembly . ComponentType ) ( org . apache . tuscany . sca . interfacedef . wsdl . xml . ReadTestCase . staxProcessor . read ( reader , org . apache . tuscany . sca . interfacedef . wsdl . xml . ReadTestCase . context ) ) ) ; "<AssertPlaceHolder>" ; } read ( javax . xml . stream . XMLStreamReader , org . apache . tuscany . sca . contribution . processor . ProcessorContext ) { org . apache . tuscany . sca . interfacedef . wsdl . WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory . createWSDLInterfaceContract ( ) ; org . apache . tuscany . sca . monitor . Monitor monitor = context . getMonitor ( ) ; java . lang . String location = reader . getAttributeValue ( org . apache . tuscany . sca . interfacedef . wsdl . xml . WSDLI_NS , org . apache . tuscany . sca . interfacedef . wsdl . xml . WSDL_LOCATION ) ; wsdlInterfaceContract . setLocation ( location ) ; java . lang . String uri = getURIString ( reader , org . apache . tuscany . sca . interfacedef . wsdl . xml . INTERFACE ) ; if ( uri != null ) { org . apache . tuscany . sca . interfacedef . wsdl . WSDLInterface wsdlInterface = createWSDLInterface ( uri , monitor ) ; if ( wsdlInterface != null ) wsdlInterfaceContract . setInterface ( wsdlInterface ) ; } uri = getURIString ( reader , org . apache . tuscany . sca . interfacedef . wsdl . xml . CALLBACK_INTERFACE ) ; if ( uri != null ) { org . apache . tuscany . sca . interfacedef . wsdl . WSDLInterface wsdlCallbackInterface = createWSDLInterface ( uri , monitor ) ; if ( wsdlCallbackInterface != null ) wsdlInterfaceContract . setCallbackInterface ( wsdlCallbackInterface ) ; } java . lang . String remotable = reader . getAttributeValue ( null , org . apache . tuscany . sca . interfacedef . wsdl . xml . REMOTABLE ) ; if ( ( remotable != null ) && ( ! ( remotable . equals ( "true" ) ) ) ) { org . apache . tuscany . sca . monitor . Monitor . error ( monitor , this , "interface-wsdlxml-validation-messages" , "InvalidRemotableValue" , ( ( org . apache . tuscany . sca . interfacedef . wsdl . WSDLInterface ) ( wsdlInterfaceContract . getInterface ( ) ) ) . getName ( ) . toString ( ) , remotable ) ; } policyProcessor . readPolicies ( wsdlInterfaceContract . getInterface ( ) , reader ) ; while ( reader . hasNext ( ) ) { if ( ( ( reader . next ( ) ) == ( END_ELEMENT ) ) && ( org . apache . tuscany . sca . interfacedef . wsdl . xml . INTERFACE_WSDL_QNAME . equals ( reader . getName ( ) ) ) ) { break ; } } return wsdlInterfaceContract ; }
|
org . junit . Assert . assertNotNull ( componentType )
|
whenServiceRegistryAndMetadata_thenSessionFactory ( ) { org . hibernate . boot . registry . BootstrapServiceRegistry bootstrapRegistry = new org . hibernate . boot . registry . BootstrapServiceRegistryBuilder ( ) . build ( ) ; org . hibernate . service . ServiceRegistry standardRegistry = new org . hibernate . boot . registry . StandardServiceRegistryBuilder ( bootstrapRegistry ) . build ( ) ; org . hibernate . boot . MetadataSources metadataSources = new org . hibernate . boot . MetadataSources ( standardRegistry ) ; metadataSources . addAnnotatedClass ( com . baeldung . hibernate . pojo . Movie . class ) ; org . hibernate . boot . Metadata metadata = metadataSources . getMetadataBuilder ( ) . build ( ) ; sessionFactory = metadata . buildSessionFactory ( ) ; "<AssertPlaceHolder>" ; sessionFactory . close ( ) ; } buildSessionFactory ( ) { try { org . hibernate . service . ServiceRegistry serviceRegistry = com . baeldung . hibernate . criteriaquery . HibernateUtil . configureServiceRegistry ( ) ; org . hibernate . boot . MetadataSources metadataSources = new org . hibernate . boot . MetadataSources ( serviceRegistry ) ; metadataSources . addAnnotatedClass ( com . baeldung . hibernate . criteriaquery . Student . class ) ; org . hibernate . boot . Metadata metadata = metadataSources . getMetadataBuilder ( ) . applyBasicType ( LocalDateStringType . INSTANCE ) . build ( ) ; return metadata . getSessionFactoryBuilder ( ) . build ( ) ; } catch ( java . io . IOException ex ) { throw new java . lang . ExceptionInInitializerError ( ex ) ; } }
|
org . junit . Assert . assertNotNull ( sessionFactory )
|
renderConfluencePage_asciiDocWithImageWithTitle_returnsConfluencePageContentWithImageWithTitle ( ) { java . lang . String adocContent = ".A<sp>beautiful<sp>sunset\n" + "image::sunset.jpg[]" ; org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage asciidocConfluencePage = org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePage . newAsciidocConfluencePage ( asciidocPage ( org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . prependTitle ( adocContent ) ) , org . sahli . asciidoc . confluence . publisher . converter . UTF_8 , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . TEMPLATES_FOLDER , org . sahli . asciidoc . confluence . publisher . converter . AsciidocConfluencePageTest . dummyAssetsTargetPath ( ) ) ; java . lang . String expectedContent = "<ac:image<sp>ac:title=\"A<sp>beautiful<sp>sunset\"<sp>ac:alt=\"A<sp>beautiful<sp>sunset\"><ri:attachment<sp>ri:filename=\"sunset.jpg\"></ri:attachment></ac:image><div<sp>class=\"cp-image-title\"><em>Figure<sp>1.<sp>A<sp>beautiful<sp>sunset</em></div>" ; "<AssertPlaceHolder>" ; } content ( ) { return this . htmlContent ; }
|
org . junit . Assert . assertThat ( asciidocConfluencePage . content ( ) , org . hamcrest . Matchers . is ( expectedContent ) )
|
extractTypeFromLoraUnknownMessage ( ) { final io . vertx . core . json . JsonObject loraMessage = org . eclipse . hono . adapter . lora . providers . LoraTestUtil . loadTestFile ( "objenious.uplink" ) ; loraMessage . put ( "type" , "bumlux" ) ; final org . eclipse . hono . adapter . lora . LoraMessageType type = provider . extractMessageType ( loraMessage ) ; "<AssertPlaceHolder>" ; } extractMessageType ( io . vertx . core . json . JsonObject ) { final java . lang . String type = loraMessage . getString ( org . eclipse . hono . adapter . lora . providers . EverynetProvider . FIELD_EVERYNET_TYPE , LoraConstants . EMPTY ) ; return "uplink" . equals ( type ) ? org . eclipse . hono . adapter . lora . LoraMessageType . UPLINK : org . eclipse . hono . adapter . lora . LoraMessageType . UNKNOWN ; }
|
org . junit . Assert . assertEquals ( LoraMessageType . UNKNOWN , type )
|
firstTest ( ) { com . microsoft . azure . management . iotcentral . v2017_07_01_privatepreview . IoTCentralTest . rgName = com . microsoft . azure . arm . utils . SdkContext . randomResourceName ( "rg" , 20 ) ; com . microsoft . azure . management . resources . ResourceGroup group = com . microsoft . azure . management . iotcentral . v2017_07_01_privatepreview . IoTCentralTest . resourceManager . resourceGroups ( ) . define ( com . microsoft . azure . management . iotcentral . v2017_07_01_privatepreview . IoTCentralTest . rgName ) . withRegion ( Region . US_WEST . toString ( ) ) . create ( ) ; "<AssertPlaceHolder>" ; } create ( ) { return this . create ( null , null , null , null ) ; }
|
org . junit . Assert . assertNotNull ( group )
|
testAC15CABAC ( ) { int [ ] bits = new int [ ] { 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 } ; int [ ] m = new int [ ] { 152 , 213 , 153 , 154 , 155 , 216 , 156 , 157 , 158 , 219 , 159 , 220 , 160 , 161 , 162 , 223 , 163 , 224 , 164 , 225 , 267 , - 1 , 268 , - 1 , 269 , - 1 , 270 , - 1 , 270 , - 1 , 270 , - 1 , 270 , - 1 } ; int [ ] coeffs = new int [ ] { 0 , 0 , 0 , 0 , 1 , - 1 , 1 , 0 , 0 , - 1 , 1 , 0 , 0 , - 1 , - 1 , 0 } ; int [ ] actual = new int [ 16 ] ; org . jcodec . codecs . common . biari . MDecoder decoder = new org . jcodec . codecs . h264 . MockMDecoder ( bits , m ) ; new org . jcodec . codecs . h264 . io . CABAC ( 1 ) . readCoeffs ( decoder , CABAC . BlockType . CHROMA_AC , actual , 1 , 15 , new int [ ] { 0 , 4 , 1 , 2 , 5 , 8 , 12 , 9 , 6 , 3 , 7 , 10 , 13 , 14 , 11 , 15 } , H264Const . identityMapping16 , H264Const . identityMapping16 ) ; "<AssertPlaceHolder>" ; org . jcodec . codecs . common . biari . MEncoder encoder = new org . jcodec . codecs . h264 . MockMEncoder ( bits , m ) ; new org . jcodec . codecs . h264 . io . CABAC ( 1 ) . writeCoeffs ( encoder , CABAC . BlockType . CHROMA_AC , actual , 1 , 15 , new int [ ] { 0 , 4 , 1 , 2 , 5 , 8 , 12 , 9 , 6 , 3 , 7 , 10 , 13 , 14 , 11 , 15 } ) ; }
|
org . junit . Assert . assertArrayEquals ( coeffs , actual )
|
leavingAfterStartShouldTriggerRed ( ) { exam . setStart ( java . lang . System . currentTimeMillis ( ) ) ; exam . windowLeft ( ) ; "<AssertPlaceHolder>" ; } isCheating ( ) { return ! ( cheatingEvents . isEmpty ( ) ) ; }
|
org . junit . Assert . assertTrue ( exam . isCheating ( ) )
|
shouldLoadEmptyModel ( ) { final ro . isdc . wro . model . WroModel model = loadModelFromLocation ( "emptyModel.xml" ) ; "<AssertPlaceHolder>" ; } getGroups ( ) { return java . util . Collections . unmodifiableSet ( groups ) ; }
|
org . junit . Assert . assertEquals ( 0 , model . getGroups ( ) . size ( ) )
|
testHashCode ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( new java . lang . Long ( ( ( int ) ( 10 ) ) ) , new java . lang . Long ( ( ( int ) ( 10 ) ) ) )
|
testBuildWithOrderBy ( ) { org . lnu . is . domain . department . contact . DepartmentContact context = new org . lnu . is . domain . department . contact . DepartmentContact ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "department" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "contactType" , org . lnu . is . pagination . OrderByType . DESC ) ; org . lnu . is . pagination . OrderBy orderBy3 = new org . lnu . is . pagination . OrderBy ( "value" , org . lnu . is . pagination . OrderByType . ASC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 , orderBy3 ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>DepartmentContact<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>ORDER<sp>BY<sp>e.department<sp>ASC,<sp>e.contactType<sp>DESC,<sp>e.value<sp>ASC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . department . contact . DepartmentContact > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
|
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
|
testGenericListMap_rt ( ) { org . apache . servicecomb . it . schema . Generic < java . util . Map < java . lang . String , java . util . List < java . lang . String > > > mapListGeneric = new org . apache . servicecomb . it . schema . Generic ( ) ; java . util . Map < java . lang . String , java . util . List < java . lang . String > > map = new java . util . HashMap ( ) ; java . util . List < java . lang . String > list = new java . util . ArrayList ( ) ; list . add ( "hello" ) ; map . put ( "test" , list ) ; mapListGeneric . value = map ; @ org . apache . servicecomb . it . testcase . base . SuppressWarnings ( "unchecked" ) org . apache . servicecomb . it . schema . Generic < java . util . Map < java . lang . String , java . util . List < java . lang . String > > > result = org . apache . servicecomb . it . testcase . base . TestGeneric . consumers . getSCBRestTemplate ( ) . postForObject ( "/genericMapList" , mapListGeneric , org . apache . servicecomb . it . schema . Generic . class ) ; java . lang . String test = result . value . get ( "test" ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( T [ ] ) { return instance [ idx ] ; }
|
org . junit . Assert . assertEquals ( test , "hello" )
|
validPid ( ) { if ( jnr . ffi . Platform . getNativePlatform ( ) . isUnix ( ) ) { long pid = - 1 ; try { pid = jnr . posix . SpawnTest . posix . posix_spawnp ( "true" , jnr . posix . SpawnTest . emptyActions , java . util . Arrays . asList ( "true" ) , jnr . posix . SpawnTest . emptyEnv ) ; "<AssertPlaceHolder>" ; } finally { if ( pid != ( - 1 ) ) jnr . posix . SpawnTest . posix . libc ( ) . waitpid ( ( ( int ) ( pid ) ) , null , 0 ) ; } } } posix_spawnp ( java . lang . String , java . util . Collection , java . util . Collection , java . util . Collection ) { return posix_spawnp ( path , fileActions , null , argv , envp ) ; }
|
org . junit . Assert . assertTrue ( ( pid != ( - 1 ) ) )
|
should_self_traverse_node ( ) { int k = 4 ; java . util . List < au . edu . wehi . idsv . debruijn . positional . KmerPathNode > input = new java . util . ArrayList < au . edu . wehi . idsv . debruijn . positional . KmerPathNode > ( ) ; input . add ( KPN ( k , "AAAA" , 1 , 11 , false ) ) ; au . edu . wehi . idsv . debruijn . positional . KmerPathNode . addEdge ( input . get ( 0 ) , input . get ( 0 ) ) ; au . edu . wehi . idsv . debruijn . positional . ContigCaller caller = getCaller ( input , 3 ) ; java . util . ArrayDeque < au . edu . wehi . idsv . debruijn . positional . KmerPathSubnode > best = caller . bestContig ( Integer . MAX_VALUE ) ; "<AssertPlaceHolder>" ; } size ( ) { return kmers . size ( ) ; }
|
org . junit . Assert . assertEquals ( 11 , best . size ( ) )
|
testLogBadTimeslot ( ) { com . hp . application . automation . tools . sse . sdk . Client client = new com . hp . application . automation . tools . sse . sdk . TestEventLogHandler . MockRestClientBadTimeslot ( URL , DOMAIN , PROJECT , USER ) ; com . hp . application . automation . tools . sse . sdk . handler . EventLogHandler eventLogHandler = new com . hp . application . automation . tools . sse . sdk . handler . EventLogHandler ( client , "" ) ; boolean isOk = eventLogHandler . log ( new com . hp . application . automation . tools . sse . sdk . ConsoleLogger ( ) ) ; "<AssertPlaceHolder>" ; } log ( java . lang . String ) { printStreamLogger . println ( message ) ; }
|
org . junit . Assert . assertTrue ( isOk )
|
testBookKeeperCommonShade ( ) { java . lang . Class . forName ( "dlshade.org.apache.bookkeeper.common.util.OrderedExecutor" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testSearchMCS ( ) { try { org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer target = null ; target = sp . parseSmiles ( "C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C" ) ; org . openscience . cdk . interfaces . IAtomContainer queryac = null ; queryac = sp . parseSmiles ( "Nc1ccccc1" ) ; org . openscience . cdk . smsd . algorithm . rgraph . CDKMCSHandler smsd1 = new org . openscience . cdk . smsd . algorithm . rgraph . CDKMCSHandler ( ) ; org . openscience . cdk . smsd . tools . MolHandler mol1 = new org . openscience . cdk . smsd . tools . MolHandler ( queryac , true , true ) ; org . openscience . cdk . smsd . tools . MolHandler mol2 = new org . openscience . cdk . smsd . tools . MolHandler ( target , true , true ) ; smsd1 . set ( mol1 , mol2 ) ; smsd1 . searchMCS ( true ) ; "<AssertPlaceHolder>" ; } catch ( org . openscience . cdk . exception . InvalidSmilesException ex ) { java . util . logging . Logger . getLogger ( org . openscience . cdk . smsd . algorithm . rgraph . CDKMCSHandlerTest . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } getFirstMapping ( ) { return firstSolution . isEmpty ( ) ? null : firstSolution ; }
|
org . junit . Assert . assertNotNull ( smsd1 . getFirstMapping ( ) )
|
testFromEbXMLLeafClass ( ) { org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLQueryResponse ebXML = transformer . toEbXML ( responseLeafClass ) ; org . openehealth . ipf . commons . ihe . xds . core . responses . QueryResponse result = transformer . fromEbXML ( ebXML ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLRetrieveDocumentSetRequest ) { if ( ebXML == null ) { return null ; } org . openehealth . ipf . commons . ihe . xds . core . requests . RetrieveDocumentSet request = new org . openehealth . ipf . commons . ihe . xds . core . requests . RetrieveDocumentSet ( ) ; request . getDocuments ( ) . addAll ( ebXML . getDocuments ( ) ) ; return request ; }
|
org . junit . Assert . assertEquals ( responseLeafClass , result )
|
testGetAllDocuments ( ) { gov . hhs . fha . nhinc . docrepository . adapter . service . DocumentService documentService = getDocumentServiceWithMockDaos ( ) ; java . util . List < gov . hhs . fha . nhinc . docrepository . adapter . model . DocumentMetadata > documents = new java . util . ArrayList ( ) ; when ( DOCUMENT_DAO . findAll ( ) ) . thenReturn ( documents ) ; java . util . List < gov . hhs . fha . nhinc . docrepository . adapter . model . DocumentMetadata > results = documentService . getAllDocuments ( ) ; verify ( DOCUMENT_DAO ) . findAll ( ) ; "<AssertPlaceHolder>" ; } findAll ( ) { return gov . hhs . fha . nhinc . util . GenericDBUtils . findAll ( getSession ( ) , gov . hhs . fha . nhinc . docrepository . adapter . model . DocumentMetadata . class ) ; }
|
org . junit . Assert . assertEquals ( documents , results )
|
testGetMissingPathsFailure ( ) { org . apache . zookeeper . ZooKeeper mockZk = mock ( org . apache . zookeeper . ZooKeeper . class ) ; org . apache . distributedlog . ZooKeeperClient mockZkc = mock ( org . apache . distributedlog . ZooKeeperClient . class ) ; when ( mockZkc . get ( ) ) . thenReturn ( mockZk ) ; doAnswer ( ( invocationOnMock ) -> { java . lang . String path = ( ( java . lang . String ) ( invocationOnMock . getArguments ( ) [ 0 ] ) ) ; org . apache . zookeeper . AsyncCallback . StatCallback callback = ( ( org . apache . zookeeper . AsyncCallback . StatCallback ) ( invocationOnMock . getArguments ( ) [ 2 ] ) ) ; callback . processResult ( Code . BADVERSION . intValue ( ) , path , null , null ) ; return null ; } ) . when ( mockZk ) . exists ( anyString ( ) , anyBoolean ( ) , any ( org . apache . zookeeper . AsyncCallback . StatCallback . class ) , any ( ) ) ; try { org . apache . bookkeeper . common . concurrent . FutureUtils . result ( org . apache . distributedlog . impl . metadata . ZKLogStreamMetadataStore . getMissingPaths ( mockZkc , uri , "path_failure/to/log_failure" ) ) ; org . junit . Assert . fail ( "Should<sp>fail<sp>on<sp>getting<sp>missing<sp>paths<sp>on<sp>zookeeper<sp>exceptions." ) ; } catch ( org . apache . distributedlog . exceptions . ZKException zke ) { "<AssertPlaceHolder>" ; } } getKeeperExceptionCode ( ) { return this . code ; }
|
org . junit . Assert . assertEquals ( Code . BADVERSION , zke . getKeeperExceptionCode ( ) )
|
testOperator_lessEqualsThanNumberNull ( ) { java . lang . Number x = 12 ; java . lang . Number y = null ; boolean resutl = org . eclipse . smarthome . model . script . lib . NumberExtensions . operator_lessEqualsThan ( x , y ) ; "<AssertPlaceHolder>" ; } operator_lessEqualsThan ( java . lang . Number , java . lang . Number ) { java . math . BigDecimal leftValue = org . eclipse . smarthome . model . script . lib . NumberExtensions . numberToBigDecimal ( left ) ; java . math . BigDecimal rightValue = org . eclipse . smarthome . model . script . lib . NumberExtensions . numberToBigDecimal ( right ) ; if ( leftValue == null ) { return true ; } else if ( rightValue == null ) { return false ; } else { return ( leftValue . compareTo ( rightValue ) ) <= 0 ; } }
|
org . junit . Assert . assertFalse ( resutl )
|
testAnd3 ( ) { org . infinispan . query . dsl . QueryFactory qf = org . infinispan . all . embeddedquery . QueryDslConditionsTest . getQueryFactory ( ) ; org . infinispan . query . dsl . Query q = qf . from ( org . infinispan . all . embeddedquery . QueryDslConditionsTest . getModelFactory ( ) . getUserImplClass ( ) ) . having ( "gender" ) . eq ( User . Gender . MALE ) . and ( ) . having ( "gender" ) . eq ( User . Gender . FEMALE ) . build ( ) ; java . util . List < org . infinispan . all . embeddedquery . testdomain . User > list = q . list ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return cache . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , list . size ( ) )
|
test02WindowSimple ( ) { final com . jogamp . opengl . test . junit . newt . GLCapabilities caps = new com . jogamp . opengl . test . junit . newt . GLCapabilities ( com . jogamp . opengl . test . junit . newt . TestGLWindows01NEWT . glp ) ; "<AssertPlaceHolder>" ; final com . jogamp . opengl . test . junit . newt . GLWindow window = com . jogamp . opengl . test . junit . newt . TestGLWindows01NEWT . createWindow ( null , caps , com . jogamp . opengl . test . junit . newt . TestGLWindows01NEWT . width , com . jogamp . opengl . test . junit . newt . TestGLWindows01NEWT . height , true , true ) ; System . out . println ( ( "Created:<sp>" + window ) ) ; int state ; for ( state = 0 ; ( state * 100 ) < ( com . jogamp . opengl . test . junit . newt . TestGLWindows01NEWT . durationPerTest ) ; state ++ ) { java . lang . Thread . sleep ( 100 ) ; } System . out . println ( ( "duration:<sp>" + ( window . getTotalFPSDuration ( ) ) ) ) ; com . jogamp . opengl . test . junit . newt . TestGLWindows01NEWT . destroyWindow ( window ) ; }
|
org . junit . Assert . assertNotNull ( caps )
|
Test37 ( ) { cc . iqa . iquery . iQueryParser parser = iQueryIdeParser . createParser ( ">><sp>:button" ) ; java . util . List < cc . iqa . iquery . ITreeNode > candidates = getRoot ( ) ; java . util . List < cc . iqa . iquery . ITreeNode > outTreeNodeList = parser . query ( candidates ) ; "<AssertPlaceHolder>" ; } getRoot ( ) { hierarchyviewerlib . models . LogFileModel model = hierarchyviewerlib . models . LogFileModel . getModel ( ) ; model . loadLogFile ( hierarchyviewerlib . test . AllTests . sLogPath ) ; hierarchyviewerlib . common . ViewNode viewNode = model . getViewNodeByLogName ( hierarchyviewerlib . test . AllTests . sNodeName ) ; java . util . List < cc . iqa . iquery . ITreeNode > candidates = new java . util . ArrayList < cc . iqa . iquery . ITreeNode > ( ) ; candidates . add ( viewNode ) ; return candidates ; }
|
org . junit . Assert . assertTrue ( ( ( outTreeNodeList . size ( ) ) == 6 ) )
|
testGetNumberOfIfExpressions01 ( ) { java . lang . StringBuffer file = new java . lang . StringBuffer ( ) ; file . append ( "context<sp>Type1<sp>inv:<sp>if<sp>true<sp>then<sp>false<sp>else<sp>true<sp>endif\n" ) ; file . append ( "context<sp>Type1<sp>inv:<sp>if<sp>false<sp>then<sp>true<sp>else<sp>false<sp>endif\n" ) ; constraintsUnderTest = Ocl22Parser . INSTANCE . parseOclString ( file . toString ( ) , modelUnderTest ) ; org . dresdenocl . metrics . metric . ConstraintMetrics metric = org . dresdenocl . metrics . OclMetrics . computeMetric ( constraintsUnderTest ) ; "<AssertPlaceHolder>" ; } getNumberOfIfExpressions ( ) { return numberOfIfExpressions ; }
|
org . junit . Assert . assertEquals ( 2 , metric . getNumberOfIfExpressions ( ) )
|
testGetDatabaseConnectionWithIncorrectId ( ) { de . metanome . backend . results_db . HibernateUtil . clear ( ) ; de . metanome . backend . results_db . DatabaseConnection actualDbConnection = dbResource . get ( 2 ) ; "<AssertPlaceHolder>" ; de . metanome . backend . results_db . HibernateUtil . clear ( ) ; } get ( long ) { try { return ( ( de . metanome . backend . results_db . Algorithm ) ( de . metanome . backend . results_db . HibernateUtil . retrieve ( de . metanome . backend . results_db . Algorithm . class , id ) ) ) ; } catch ( java . lang . Exception e ) { throw new de . metanome . backend . resources . WebException ( e , Response . Status . BAD_REQUEST ) ; } }
|
org . junit . Assert . assertEquals ( null , actualDbConnection )
|
checkDisable ( ) { org . mariadb . jdbc . UrlParser jdbc = org . mariadb . jdbc . UrlParser . parse ( "jdbc:mysql://localhost/test?disableMariaDbDriver" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { return org . mariadb . jdbc . UrlParser . parse ( url , new java . util . Properties ( ) ) ; }
|
org . junit . Assert . assertTrue ( ( jdbc == null ) )
|
testDiToAvroFloat ( ) { org . apache . avro . Schema expectedSchema = org . talend . daikon . avro . AvroUtils . _float ( ) ; org . apache . avro . Schema designSchema = org . apache . avro . SchemaBuilder . builder ( ) . record ( "Record" ) . fields ( ) . name ( "booleanField" ) . type ( ) . booleanType ( ) . noDefault ( ) . endRecord ( ) ; org . talend . codegen . enforcer . IncomingSchemaEnforcer enforcer = new org . talend . codegen . enforcer . IncomingSchemaEnforcer ( designSchema ) ; org . apache . avro . Schema actualSchema = enforcer . diToAvro ( "id_Float" , null ) ; "<AssertPlaceHolder>" ; } diToAvro ( java . lang . String , java . lang . String ) { org . apache . avro . Schema fieldSchema = org . talend . daikon . avro . LogicalTypeUtils . getSchemaByLogicalType ( logicalType ) ; if ( fieldSchema != null ) { return fieldSchema ; } if ( "id_String" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . STRING ) ; } else if ( "id_Boolean" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . BOOLEAN ) ; } else if ( "id_Byte" 0.e quals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . INT ) ; } else if ( "id_Byte" 1.e quals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . LONG ) ; } else if ( "id_Double" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . DOUBLE ) ; } else if ( "id_Float" . equals ( diType ) ) { fieldSchema = org . apache . avro . Schema . create ( Schema . Type . FLOAT ) ; } else if ( "id_Byte" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _byte ( ) ; } else if ( "id_Short" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _short ( ) ; } else if ( "id_Character" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _character ( ) ; } else if ( "id_BigDecimal" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _decimal ( ) ; } else if ( "id_Date" . equals ( diType ) ) { fieldSchema = org . talend . daikon . avro . AvroUtils . _date ( ) ; } else { throw new java . lang . UnsupportedOperationException ( ( "Unrecognized<sp>type<sp>" + diType ) ) ; } return fieldSchema ; }
|
org . junit . Assert . assertEquals ( expectedSchema , actualSchema )
|
behaves_as_if_it_were_the_underlying_key ( ) { com . noodlesandwich . rekord . Rekord < com . noodlesandwich . rekord . keys . CopiedKeyTest . Bratwurst > bratwurst = com . noodlesandwich . rekord . keys . CopiedKeyTest . Bratwurst . rekord . with ( com . noodlesandwich . rekord . keys . CopiedKeyTest . Bratwurst . curvature , 0.7 ) . with ( com . noodlesandwich . rekord . keys . CopiedKeyTest . Bratwurst . style , com . noodlesandwich . rekord . keys . CopiedKeyTest . Bratwurst . Style . Chopped ) ; "<AssertPlaceHolder>" ; } get ( com . noodlesandwich . rekord . keys . Key ) { return delegate . get ( key ) ; }
|
org . junit . Assert . assertThat ( bratwurst . get ( com . noodlesandwich . rekord . keys . CopiedKeyTest . Bratwurst . curvature ) , org . hamcrest . Matchers . is ( 0.7 ) )
|
testGetServicesByCriteria_Tagging_TagDefinedForUserLocale ( ) { container . login ( org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . customerUserKey , org . oscm . serviceprovisioningservice . bean . ROLE_ORGANIZATION_ADMIN ) ; org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . setLocaleCurrentUser ( "en" , org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . customerUserKey ) ; org . oscm . serviceprovisioningservice . bean . ListCriteria crit = org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . getCriteria ( ( - 1 ) , ( - 1 ) , org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . TAG4 , null ) ; org . oscm . serviceprovisioningservice . bean . VOServiceListResult servicesByCriteria = org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . search . getServicesByCriteria ( org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . supplier . getOrganizationId ( ) , "de" , crit ) ; org . oscm . serviceprovisioningservice . bean . List < org . oscm . serviceprovisioningservice . bean . VOService > products = servicesByCriteria . getServices ( ) ; "<AssertPlaceHolder>" ; org . oscm . serviceprovisioningservice . bean . SearchServiceBeanListIT . checkResultSet ( servicesByCriteria , 57 , 65 , 67 ) ; } size ( ) { return categoriesForMarketplace . size ( ) ; }
|
org . junit . Assert . assertEquals ( 3 , products . size ( ) )
|
testFindActivityDetails ( ) { javax . ws . rs . core . Response response = serviceDelegator . viewActivities ( ORCID ) ; "<AssertPlaceHolder>" ; org . orcid . jaxb . model . v3 . rc2 . record . summary . ActivitiesSummary summary = ( ( org . orcid . jaxb . model . v3 . rc2 . record . summary . ActivitiesSummary ) ( response . getEntity ( ) ) ) ; validateActivities ( summary ) ; } viewActivities ( java . lang . String ) { checkProfileStatus ( orcid ) ; org . orcid . jaxb . model . v3 . release . record . summary . ActivitiesSummary as = activitiesSummaryManagerReadOnly . getPublicActivitiesSummary ( orcid , filterVersionOfIdentifiers ) ; publicAPISecurityManagerV3 . filter ( as ) ; org . orcid . api . common . util . v3 . ActivityUtils . cleanEmptyFields ( as ) ; org . orcid . api . common . util . v3 . ActivityUtils . setPathToActivity ( as , orcid ) ; org . orcid . core . version . impl . Api3_0LastModifiedDatesHelper . calculateLastModified ( as ) ; sourceUtilsReadOnly . setSourceName ( as ) ; return javax . ws . rs . core . Response . ok ( as ) . build ( ) ; }
|
org . junit . Assert . assertNotNull ( response )
|
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . change . tracking . model . CTEntryAggregate > ctEntryAggregates = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( ctEntryAggregates . isEmpty ( ) )
|
shouldRejectNullLbLimitName ( ) { lbLimitGroup . setName ( null ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = lbLimitGroupValidator . validate ( lbLimitGroup , HttpRequestType . PUT ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; }
|
org . junit . Assert . assertFalse ( resultMessage ( result , HttpRequestType . PUT ) , result . passedValidation ( ) )
|
testNoChange ( ) { final org . bff . javampd . server . ConnectionChangeEvent [ ] changeEvent = new org . bff . javampd . server . ConnectionChangeEvent [ 1 ] ; connectionMonitor . addConnectionChangeListener ( ( event ) -> changeEvent [ 0 ] = event ) ; when ( server . isConnected ( ) ) . thenReturn ( true ) ; connectionMonitor . checkStatus ( ) ; "<AssertPlaceHolder>" ; } checkStatus ( ) { super . checkStatus ( ) ; org . bff . javampd . monitor . PlayerStatus . PlayerStatus newStatus = null ; if ( state . startsWith ( StandAloneMonitor . PlayerResponse . PLAY . getPrefix ( ) ) ) { newStatus = STATUS_PLAYING ; } else if ( state . startsWith ( StandAloneMonitor . PlayerResponse . PAUSE . getPrefix ( ) ) ) { newStatus = STATUS_PAUSED ; } else if ( state . startsWith ( StandAloneMonitor . PlayerResponse . STOP . getPrefix ( ) ) ) { newStatus = org . bff . javampd . monitor . PlayerStatus . PlayerStatus . STATUS_STOPPED ; } if ( ! ( status . equals ( newStatus ) ) ) { processNewStatus ( newStatus ) ; status = newStatus ; } }
|
org . junit . Assert . assertNull ( changeEvent [ 0 ] )
|
testFindFirstWithEmptyPathNonMatchingType ( ) { final com . allanbank . mongodb . bson . element . DocumentElement element = new com . allanbank . mongodb . bson . element . DocumentElement ( "foo" , new com . allanbank . mongodb . bson . element . BooleanElement ( "1" , false ) ) ; final com . allanbank . mongodb . bson . Element found = element . findFirst ( com . allanbank . mongodb . bson . element . BooleanElement . class ) ; "<AssertPlaceHolder>" ; } findFirst ( java . lang . String [ ] ) { return findFirst ( com . allanbank . mongodb . bson . element . AbstractElement . ELEMENT_TYPE , nameRegexs ) ; }
|
org . junit . Assert . assertNull ( found )
|
javaAPIIteratorTest ( ) { java . util . Set < java . lang . String > simpsons = new java . util . HashSet ( ) ; simpsons . add ( "Homer" ) ; simpsons . add ( "Bart" ) ; simpsons . add ( "Margie" ) ; java . util . Iterator < java . lang . String > simpsonsItr = simpsons . iterator ( ) ; while ( simpsonsItr . hasNext ( ) ) { java . lang . String name = simpsonsItr . next ( ) ; System . out . println ( name ) ; simpsonsItr . remove ( ) ; } "<AssertPlaceHolder>" ; } remove ( ) { java . lang . System . arraycopy ( products , ( ( currentIndex ) + 1 ) , products , currentIndex , ( ( products . length ) - 1 ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , simpsons . size ( ) )
|
testThrowCheckedException ( ) { java . io . IOException expected = new java . io . IOException ( "EXPECTED<sp>ERROR" ) ; java . io . IOException actual = null ; try { org . slieb . throwables . BiConsumerWithThrowable . aBiConsumerThatUnsafelyThrowsUnchecked ( ( v1 , v2 ) -> { throw expected ; } ) . accept ( null , null ) ; org . junit . Assert . fail ( "Exception<sp>should<sp>have<sp>been<sp>thrown" ) ; } catch ( java . io . IOException e ) { actual = e ; } "<AssertPlaceHolder>" ; } accept ( T , long ) { try { acceptWithThrowable ( v1 , v2 ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
shouldGetFirstColumn ( ) { double [ ] values = new double [ ] { 1 , 2 , 3 , 4 } ; int [ ] [ ] indices = new int [ ] [ ] { new int [ ] { 0 , 3 } , new int [ ] { 1 , 2 } , new int [ ] { 2 , 1 } , new int [ ] { 3 , 4 } } ; org . nd4j . linalg . api . ndarray . INDArray sparseNDArray = org . nd4j . linalg . factory . Nd4j . createSparseCOO ( values , indices , new long [ ] { 5 , 5 } ) ; org . nd4j . linalg . api . ndarray . BaseSparseNDArrayCOO sparseView = ( ( org . nd4j . linalg . api . ndarray . BaseSparseNDArrayCOO ) ( sparseNDArray . get ( org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . point ( 0 ) ) ) ) ; "<AssertPlaceHolder>" ; System . out . println ( sparseView . sparseInfoDataBuffer ( ) ) ; } nnz ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>a<sp>sparse<sp>ndarray" ) ; }
|
org . junit . Assert . assertEquals ( 0 , sparseView . nnz ( ) )
|
testPlatformIdNamesAreAllLowerCase ( ) { for ( com . bc . ceres . core . runtime . internal . Platform . ID platformId : Platform . ID . values ( ) ) { "<AssertPlaceHolder>" ; } } toString ( ) { return languageName ; }
|
org . junit . Assert . assertEquals ( platformId . toString ( ) . toLowerCase ( ) , platformId . toString ( ) )
|
testListVersionUpdateForAuthorizationListChangedReceivedEvent ( ) { listener . handle ( new io . motown . operatorapi . viewmodel . AuthorizationListChangedEvent ( CHARGING_STATION_ID , LIST_VERSION , AuthorizationListUpdateType . FULL , IDENTIFYING_TOKENS , IDENTITY_CONTEXT ) ) ; io . motown . operatorapi . viewmodel . persistence . entities . ChargingStation cs = repository . findOne ( io . motown . operatorapi . viewmodel . CHARGING_STATION_ID . getId ( ) ) ; "<AssertPlaceHolder>" ; } getLocalAuthorizationListVersion ( ) { return localAuthorizationListVersion ; }
|
org . junit . Assert . assertTrue ( ( ( cs . getLocalAuthorizationListVersion ( ) ) == ( LIST_VERSION ) ) )
|
shouldNotEqualsEventsWhenLessThanTotalCountLinesRemovedInWithoutOverflownLinesRemovedEventType ( ) { com . codenjoy . dojo . tetris . model . GlassEvent event = new com . codenjoy . dojo . tetris . model . GlassEvent ( WITHOUT_OVERFLOWN_LINES_REMOVED , 10 ) ; "<AssertPlaceHolder>" ; } equals ( com . codenjoy . dojo . services . Game , com . codenjoy . dojo . services . Game ) { if ( game1 instanceof com . codenjoy . dojo . services . lock . LockedGame ) { game1 = ( ( com . codenjoy . dojo . services . lock . LockedGame ) ( game1 ) ) . getWrapped ( ) ; } if ( game2 instanceof com . codenjoy . dojo . services . lock . LockedGame ) { game2 = ( ( com . codenjoy . dojo . services . lock . LockedGame ) ( game2 ) ) . getWrapped ( ) ; } return game1 == game2 ; }
|
org . junit . Assert . assertFalse ( event . equals ( new com . codenjoy . dojo . tetris . model . GlassEvent ( WITHOUT_OVERFLOWN_LINES_REMOVED , 9 ) ) )
|
testParseSimpleNoDecimals ( ) { java . lang . String source = "{1;<sp>1;<sp>1}" ; org . apache . commons . math4 . geometry . euclidean . threed . Vector3D expected = new org . apache . commons . math4 . geometry . euclidean . threed . Cartesian3D ( 1 , 1 , 1 ) ; org . apache . commons . math4 . geometry . euclidean . threed . Vector3D actual = vector3DFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . text . ParsePosition parsePosition = new java . text . ParsePosition ( 0 ) ; org . apache . commons . math4 . geometry . euclidean . twod . Vector2D result = parse ( source , parsePosition ) ; if ( ( parsePosition . getIndex ( ) ) == 0 ) { throw new org . apache . commons . math4 . exception . MathParseException ( source , parsePosition . getErrorIndex ( ) , org . apache . commons . math4 . geometry . euclidean . twod . Vector2D . class ) ; } return result ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
removesJobs_WhenDisabled ( ) { final java . lang . String jobId = "jobId" ; org . pentaho . platform . api . scheduler2 . Job job = new org . pentaho . platform . api . scheduler2 . Job ( ) ; job . setJobId ( jobId ) ; when ( scheduler . getJobs ( any ( org . pentaho . platform . api . scheduler2 . IJobFilter . class ) ) ) . thenReturn ( java . util . Collections . singletonList ( job ) ) ; prepareMp ( ) ; listener . setGcEnabled ( false ) ; "<AssertPlaceHolder>" ; verifyJobRemoved ( jobId ) ; } startup ( org . pentaho . platform . api . engine . IPentahoSession ) { org . pentaho . di . job . JobMeta jobMeta = null ; java . lang . String jobFileFullPath = getJobFileFullPath ( ) ; try { jobMeta = new org . pentaho . di . job . JobMeta ( jobFileFullPath , null ) ; } catch ( org . pentaho . di . core . exception . KettleXMLException kxe ) { org . pentaho . platform . util . logging . Logger . error ( ( "Error<sp>opening<sp>" + jobFileFullPath ) , kxe . getMessage ( ) ) ; return false ; } return executeJob ( jobMeta , jobFileFullPath ) ; }
|
org . junit . Assert . assertTrue ( listener . startup ( null ) )
|
testMsgSendSummaryMonthly ( ) { java . util . List < me . hao0 . wechat . model . data . msg . MsgSendSummary > summaries = wechat . data ( ) . msgSendSummaryMonthly ( accessToken , "2015-10-01" , "2015-10-30" ) ; "<AssertPlaceHolder>" ; for ( me . hao0 . wechat . model . data . msg . MsgSendSummary summary : summaries ) { System . out . println ( summary ) ; } } msgSendSummaryMonthly ( java . lang . String , java . lang . String , me . hao0 . wechat . core . Callback ) { msgSendSummaryMonthly ( loadAccessToken ( ) , startDate , endDate , cb ) ; }
|
org . junit . Assert . assertNotNull ( summaries )
|
testGetUserId16 ( ) { com . liferay . portal . kernel . model . PortletInstance portletInstance = com . liferay . portal . kernel . model . PortletInstance . fromPortletInstanceKey ( getPortletInstanceKey ( getPortletInstanceKey ( ) , 1234 , "5678" ) ) ; "<AssertPlaceHolder>" ; } hasUserId ( ) { return true ; }
|
org . junit . Assert . assertTrue ( portletInstance . hasUserId ( ) )
|
testChangeUS2Winter ( ) { java . util . Calendar start = new java . util . GregorianCalendar ( java . util . TimeZone . getTimeZone ( "America/Los_Angeles" ) ) ; start . clear ( ) ; start . set ( 2017 , Calendar . NOVEMBER , 5 , 0 , 30 , 0 ) ; javax . ejb . ScheduleExpression schedule = new javax . ejb . ScheduleExpression ( ) ; schedule . hour ( "*" ) . minute ( "0/15" ) . second ( "0" ) . timezone ( "America/Los_Angeles" ) . start ( start . getTime ( ) ) ; org . jboss . as . ejb3 . timerservice . schedule . CalendarBasedTimeout calendarTimeout = new org . jboss . as . ejb3 . timerservice . schedule . CalendarBasedTimeout ( schedule ) ; java . util . Calendar firstTimeout = calendarTimeout . getFirstTimeout ( ) ; "<AssertPlaceHolder>" ; if ( ( ( ( ( ( ( ( firstTimeout . get ( Calendar . YEAR ) ) != 2017 ) || ( ( firstTimeout . get ( Calendar . MONTH ) ) != ( java . util . Calendar . NOVEMBER ) ) ) || ( ( firstTimeout . get ( Calendar . DAY_OF_MONTH ) ) != 5 ) ) || ( ( firstTimeout . get ( Calendar . HOUR_OF_DAY ) ) != 0 ) ) || ( ( firstTimeout . get ( Calendar . MINUTE ) ) != 30 ) ) || ( ( firstTimeout . get ( Calendar . SECOND ) ) != 0 ) ) || ( ( firstTimeout . get ( Calendar . DST_OFFSET ) ) != 3600000 ) ) { org . junit . Assert . fail ( ( "Start<sp>time<sp>unexpected<sp>:<sp>" + ( firstTimeout . toString ( ) ) ) ) ; } java . util . Calendar current = firstTimeout ; for ( int i = 0 ; i < 7 ; i ++ ) { java . util . Calendar next = calendarTimeout . getNextTimeout ( current ) ; if ( ( current . getTimeInMillis ( ) ) != ( ( next . getTimeInMillis ( ) ) - 900000 ) ) { org . junit . Assert . fail ( ( ( ( "Schedule<sp>is<sp>more<sp>than<sp>15<sp>minutes<sp>from<sp>" + ( current . getTime ( ) ) ) + "<sp>to<sp>" ) + ( next . getTime ( ) ) ) ) ; } current = next ; } if ( ( ( ( ( ( ( current . get ( Calendar . YEAR ) ) != 2017 ) || ( ( current . get ( Calendar . MONTH ) ) != ( java . util . Calendar . NOVEMBER ) ) ) || ( ( current . get ( Calendar . DAY_OF_MONTH ) ) != 5 ) ) || ( ( current . get ( Calendar . HOUR_OF_DAY ) ) != 1 ) ) || ( ( current . get ( Calendar . MINUTE ) ) != 15 ) ) || ( ( current . get ( Calendar . DST_OFFSET ) ) != 0 ) ) { org . junit . Assert . fail ( ( "End<sp>time<sp>unexpected<sp>:<sp>" + ( current . toString ( ) ) ) ) ; } } start ( org . jboss . msc . service . StartContext ) { if ( ! ( started . compareAndSet ( false , true ) ) ) { throw new org . jboss . msc . service . StartException ( "The<sp>service<sp>is<sp>still<sp>started!" ) ; } org . jboss . metrics . HATimerService2 . LOGGER . info ( ( ( "Start<sp>HASingleton<sp>timer<sp>service<sp>2<sp>'" + ( this . getClass ( ) . getName ( ) ) ) + "'" ) ) ; final java . lang . String node = java . lang . System . getProperty ( "jboss.node.name" ) ; try { javax . naming . InitialContext ic = new javax . naming . InitialContext ( ) ; } catch ( javax . naming . NamingException e ) { throw new org . jboss . msc . service . StartException ( "Could<sp>not<sp>initialize<sp>timer" , e ) ; } }
|
org . junit . Assert . assertNotNull ( firstTimeout )
|
whenAddingFourVehiclesAllAtOnce_vrpShouldContainTheCorrectNuOfVehicles ( ) { com . graphhopper . jsprit . core . problem . VehicleRoutingProblem . Builder builder = VehicleRoutingProblem . Builder . newInstance ( ) ; com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl v1 = VehicleImpl . Builder . newInstance ( "v1" ) . setStartLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "start" ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl v2 = VehicleImpl . Builder . newInstance ( "v2" ) . setStartLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "start" ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl v3 = VehicleImpl . Builder . newInstance ( "v3" ) . setStartLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "start" ) ) . build ( ) ; com . graphhopper . jsprit . core . problem . vehicle . VehicleImpl v4 = VehicleImpl . Builder . newInstance ( "v4" ) . setStartLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "start" ) ) . build ( ) ; builder . addAllVehicles ( java . util . Arrays . asList ( v1 , v2 , v3 , v4 ) ) ; com . graphhopper . jsprit . core . problem . VehicleRoutingProblem vrp = builder . build ( ) ; "<AssertPlaceHolder>" ; } getVehicles ( ) { return com . graphhopper . jsprit . core . problem . Collections . unmodifiableCollection ( vehicles ) ; }
|
org . junit . Assert . assertEquals ( 4 , vrp . getVehicles ( ) . size ( ) )
|
testBuildWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . order . type . OrderType context = new org . lnu . is . domain . order . type . OrderType ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>OrderType<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . order . type . OrderType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
testCreateRawHandler ( ) { "<AssertPlaceHolder>" ; } createRawHandler ( org . apache . olingo . server . api . ServiceMetadata ) { return org . apache . olingo . netty . server . core . ODataNettyImpl . odata . createRawHandler ( serviceMetadata ) ; }
|
org . junit . Assert . assertNotNull ( odata . createRawHandler ( metadata ) )
|
testWithCustomSerde ( ) { hiveShell . start ( ) ; java . util . List < java . lang . String > actual = hiveShell . executeQuery ( java . lang . String . format ( "select<sp>*<sp>from<sp>customSerdeTable" ) ) ; java . util . List < java . lang . String > expected = java . util . Arrays . asList ( "Q\tW\tE" , "R\tT\tY" , "U\tI\tO" , "A\tB\tC" , "F\tG\tH" , "T\tJ\tK" ) ; java . util . Collections . sort ( actual ) ; java . util . Collections . sort ( expected ) ; "<AssertPlaceHolder>" ; } executeQuery ( java . nio . file . Path ) { return executeQuery ( java . nio . charset . Charset . defaultCharset ( ) , script ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testKeyBuildingFromRowFamily ( ) { org . apache . accumulo . core . data . Key keyBuilt = org . apache . accumulo . core . data . Key . builder ( ) . row ( "foo" ) . family ( "bar" ) . build ( ) ; org . apache . accumulo . core . data . Key keyExpected = new org . apache . accumulo . core . data . Key ( "foo" , "bar" ) ; "<AssertPlaceHolder>" ; } build ( ) { return builderFunction . apply ( this ) ; }
|
org . junit . Assert . assertEquals ( keyExpected , keyBuilt )
|
skip_negativeBytes ( ) { final java . lang . String testString = "helloWorld" ; final byte [ ] testData = testString . getBytes ( ) ; final java . io . InputStream is = new org . exist . util . io . FastByteArrayInputStream ( testData ) ; final org . exist . util . io . CachingFilterInputStream cfis = new org . exist . util . io . CachingFilterInputStream ( getNewCache ( is ) ) ; final long skipped = cfis . skip ( ( - 1 ) ) ; "<AssertPlaceHolder>" ; } skip ( long ) { return bis . skip ( n ) ; }
|
org . junit . Assert . assertEquals ( 0 , skipped )
|
testSetupProperties ( ) { properties . connection . setupProperties ( ) ; properties . module . main . setupProperties ( ) ; properties . module . setupProperties ( ) ; properties . setupProperties ( ) ; "<AssertPlaceHolder>" ; } getConnectionProperties ( ) { return connection . getEffectiveConnectionProperties ( ) ; }
|
org . junit . Assert . assertNotNull ( properties . getConnectionProperties ( ) )
|
testConnection ( ) { java . lang . String baseUrl = java . lang . System . getProperty ( "service.url" ) ; java . net . URL serviceUrl = new java . net . URL ( ( baseUrl + "v1/restaurants/1" ) ) ; java . net . HttpURLConnection connection = ( ( java . net . HttpURLConnection ) ( serviceUrl . openConnection ( ) ) ) ; int responseCode = connection . getResponseCode ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 200 , responseCode )
|
testSend ( ) { waitForTopology ( getServer ( 0 ) , 3 ) ; waitForTopology ( getServer ( 1 ) , 3 ) ; waitForTopology ( getServer ( 2 ) , 3 ) ; org . apache . activemq . artemis . api . core . SimpleString expiryQueue = org . apache . activemq . artemis . api . core . SimpleString . toSimpleString ( "expiryQueue" ) ; org . apache . activemq . artemis . core . settings . impl . AddressSettings as = new org . apache . activemq . artemis . core . settings . impl . AddressSettings ( ) ; as . setDeadLetterAddress ( expiryQueue ) ; as . setExpiryAddress ( expiryQueue ) ; for ( int i = 0 ; i <= 2 ; i ++ ) { createQueue ( i , "queues.testaddress" , "queue0" , null , true ) ; getServer ( i ) . createQueue ( expiryQueue , RoutingType . ANYCAST , expiryQueue , null , true , false ) ; getServer ( i ) . getAddressSettingsRepository ( ) . addMatch ( "#" , as ) ; } for ( org . apache . activemq . artemis . core . server . cluster . ClusterConnection clusterConnection : getServer ( 0 ) . getClusterManager ( ) . getClusterConnections ( ) ) { for ( org . apache . activemq . artemis . core . server . cluster . MessageFlowRecord record : ( ( org . apache . activemq . artemis . core . server . cluster . impl . ClusterConnectionImpl ) ( clusterConnection ) ) . getRecords ( ) . values ( ) ) { record . getBridge ( ) . pause ( ) ; } } org . apache . activemq . artemis . api . core . client . ClientSessionFactory sf = sfs [ 0 ] ; org . apache . activemq . artemis . api . core . client . ClientSession session = sf . createSession ( false , false ) ; org . apache . activemq . artemis . api . core . client . ClientProducer producer = session . createProducer ( "queues.testaddress" ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { org . apache . activemq . artemis . api . core . client . ClientMessage message = session . createMessage ( true ) ; message . setExpiration ( 500 ) ; producer . send ( message ) ; } session . commit ( ) ; session . start ( ) ; org . apache . activemq . artemis . api . core . client . ClientConsumer consumer = session . createConsumer ( "expiryQueue" ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { org . apache . activemq . artemis . api . core . client . ClientMessage message = consumer . receive ( 2000 ) ; "<AssertPlaceHolder>" ; message . acknowledge ( ) ; } session . commit ( ) ; session . close ( ) ; } receive ( long ) { session . lock ( ) ; try { if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( ( "receive<sp>" + ( this ) ) + "<sp>timeout=" ) + timeout ) ) ; } checkState ( ) ; javax . jms . Message message = consumer . receive ( timeout ) ; if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( ( "received<sp>" + ( this ) ) + "<sp>result=" ) + message ) ) ; } if ( message == null ) { return null ; } else { return wrapMessage ( message ) ; } } finally { session . unlock ( ) ; } }
|
org . junit . Assert . assertNotNull ( message )
|
testGetMaxBondOrderImplH ( ) { org . openscience . cdk . interfaces . IAtomContainer container = ( ( org . openscience . cdk . interfaces . IAtomContainer ) ( newChemObject ( ) ) ) ; org . openscience . cdk . interfaces . IChemObjectBuilder builder = container . getBuilder ( ) ; org . openscience . cdk . interfaces . IAtom a = builder . newAtom ( ) ; a . setImplicitHydrogenCount ( 1 ) ; container . addAtom ( a ) ; "<AssertPlaceHolder>" ; } getMaximumBondOrder ( org . openscience . cdk . interfaces . IAtom ) { org . openscience . cdk . interfaces . IBond . Order max = null ; for ( org . openscience . cdk . interfaces . IBond bond : bonds ( ) ) { if ( ! ( bond . contains ( atom ) ) ) continue ; if ( ( max == null ) || ( ( bond . getOrder ( ) . numeric ( ) ) > ( max . numeric ( ) ) ) ) { max = bond . getOrder ( ) ; } } if ( max == null ) { if ( ! ( contains ( atom ) ) ) throw new org . openscience . cdk . exception . NoSuchAtomException ( "Atom<sp>does<sp>not<sp>belong<sp>to<sp>this<sp>container!" ) ; if ( ( ( atom . getImplicitHydrogenCount ( ) ) != null ) && ( ( atom . getImplicitHydrogenCount ( ) ) > 0 ) ) max = org . openscience . cdk . interfaces . IBond . Order . SINGLE ; else max = org . openscience . cdk . interfaces . IBond . Order . UNSET ; } return max ; }
|
org . junit . Assert . assertThat ( container . getMaximumBondOrder ( a ) , org . hamcrest . CoreMatchers . is ( IBond . Order . SINGLE ) )
|
testValidateAndTrimSecurityRoleFunctionCreateRequest ( ) { org . finra . herd . model . api . xml . SecurityRoleFunctionKey securityRoleFunctionKey = new org . finra . herd . model . api . xml . SecurityRoleFunctionKey ( SECURITY_ROLE , SECURITY_FUNCTION ) ; org . finra . herd . model . api . xml . SecurityRoleFunctionCreateRequest securityRoleFunctionCreateRequest = new org . finra . herd . model . api . xml . SecurityRoleFunctionCreateRequest ( securityRoleFunctionKey ) ; when ( alternateKeyHelper . validateStringParameter ( "security<sp>role<sp>name" , org . finra . herd . service . helper . SECURITY_ROLE ) ) . thenReturn ( org . finra . herd . service . helper . SECURITY_ROLE_2 ) ; when ( alternateKeyHelper . validateStringParameter ( "security<sp>function<sp>name" , org . finra . herd . service . helper . SECURITY_FUNCTION ) ) . thenReturn ( org . finra . herd . service . helper . SECURITY_FUNCTION_2 ) ; securityRoleFunctionHelper . validateAndTrimSecurityRoleFunctionCreateRequest ( securityRoleFunctionCreateRequest ) ; "<AssertPlaceHolder>" ; verify ( alternateKeyHelper ) . validateStringParameter ( "security<sp>role<sp>name" , org . finra . herd . service . helper . SECURITY_ROLE ) ; verify ( alternateKeyHelper ) . validateStringParameter ( "security<sp>function<sp>name" , org . finra . herd . service . helper . SECURITY_FUNCTION ) ; verifyNoMoreInteractions ( alternateKeyHelper ) ; } validateAndTrimSecurityRoleFunctionCreateRequest ( org . finra . herd . model . api . xml . SecurityRoleFunctionCreateRequest ) { org . springframework . util . Assert . notNull ( securityRoleFunctionCreateRequest , "A<sp>security<sp>role<sp>to<sp>function<sp>mapping<sp>create<sp>request<sp>must<sp>be<sp>specified." ) ; validateAndTrimSecurityRoleFunctionKey ( securityRoleFunctionCreateRequest . getSecurityRoleFunctionKey ( ) ) ; }
|
org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . SecurityRoleFunctionCreateRequest ( new org . finra . herd . model . api . xml . SecurityRoleFunctionKey ( SECURITY_ROLE_2 , SECURITY_FUNCTION_2 ) ) , securityRoleFunctionCreateRequest )
|
GetAuthorizationUrl_ReturnsCorrectUrl_WithEmptyState ( ) { try { com . microsoft . bingads . OAuthWebAuthCodeGrant auth = com . microsoft . bingads . OAuthTest . CreateWebAuth ( "test_id" , "test_secret" ) ; auth . setState ( "" ) ; java . net . URL authorizationUrl = auth . getAuthorizationEndpoint ( ) ; java . net . URL expectedUrl = new java . net . URL ( ( "https://login.live.com/oauth20_authorize.srf?" + ( ( ( "scope=bingads.manage&" + "response_type=code&" ) + "redirect_uri=https%3A%2F%2Ftest.com%2Flogin&" ) + "client_id=test_id" ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . net . MalformedURLException e ) { org . junit . Assert . fail ( "Malformed<sp>Test<sp>URL" ) ; } } getAuthorizationEndpoint ( ) { return com . microsoft . bingads . internal . UriOAuthService . getAuthorizationEndpoint ( new com . microsoft . bingads . internal . OAuthUrlParameters ( this . clientId , com . microsoft . bingads . internal . OAuthWithAuthorizationCode . CODE , this . redirectionUri , this . state ) , this . getEnvironment ( ) ) ; }
|
org . junit . Assert . assertEquals ( expectedUrl , authorizationUrl )
|
getByCodeWithUpperCaseAlpha2CodeShouldReturnCountry ( ) { for ( org . iban4j . CountryCode code : org . iban4j . CountryCode . values ( ) ) { org . iban4j . CountryCode newCode = org . iban4j . CountryCode . getByCode ( code . getAlpha2 ( ) . toUpperCase ( ) ) ; "<AssertPlaceHolder>" ; } } getAlpha2 ( ) { return name ( ) ; }
|
org . junit . Assert . assertThat ( newCode , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( code ) ) )
|
testSemEvidence ( ) { edu . cmu . tetrad . graph . Graph graph = constructGraph1 ( ) ; edu . cmu . tetrad . sem . SemPm semPm = new edu . cmu . tetrad . sem . SemPm ( graph ) ; edu . cmu . tetrad . sem . SemIm semIm = new edu . cmu . tetrad . sem . SemIm ( semPm ) ; edu . cmu . tetrad . sem . SemEvidence evidence = new edu . cmu . tetrad . sem . SemEvidence ( semIm ) ; evidence . setManipulated ( 1 , true ) ; "<AssertPlaceHolder>" ; } isManipulated ( int ) { return manipulation . isManipulated ( nodeIndex ) ; }
|
org . junit . Assert . assertTrue ( evidence . isManipulated ( 1 ) )
|
testSetGetViewName ( ) { org . apache . ambari . server . orm . entities . ViewEntityEntity viewEntityEntity = new org . apache . ambari . server . orm . entities . ViewEntityEntity ( ) ; viewEntityEntity . setViewName ( "foo" ) ; "<AssertPlaceHolder>" ; } getViewName ( ) { return viewName ; }
|
org . junit . Assert . assertEquals ( "foo" , viewEntityEntity . getViewName ( ) )
|
testRSubi ( ) { org . nd4j . linalg . api . ndarray . INDArray n2 = org . nd4j . linalg . factory . Nd4j . ones ( 2 ) ; org . nd4j . linalg . api . ndarray . INDArray n2Assertion = org . nd4j . linalg . factory . Nd4j . zeros ( 2 ) ; org . nd4j . linalg . api . ndarray . INDArray nRsubi = n2 . rsubi ( 1 ) ; "<AssertPlaceHolder>" ; } rsubi ( java . lang . Number ) { return rsubi ( a , this ) ; }
|
org . junit . Assert . assertEquals ( n2Assertion , nRsubi )
|
getMonth_A$Calendar_jun12 ( ) { java . lang . Integer expected = 1 ; java . util . Calendar arg0 = java . util . Calendar . getInstance ( ) ; arg0 . set ( Calendar . MONTH , 12 ) ; java . lang . Integer actual = com . github . seratch . taskun . util . CalendarUtil . getMonth ( arg0 ) ; "<AssertPlaceHolder>" ; } getMonth ( java . util . Calendar ) { java . lang . Integer month = ( calendar . get ( Calendar . MONTH ) ) + 1 ; return month ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testGetBiServerBaseUrl_fromInvalidWebXmlLocation ( ) { doReturn ( consoleConfig ) . when ( spyAppConfigProperties ) . getConsoleConfig ( ) ; when ( consoleConfig . getBaseUrl ( ) ) . thenReturn ( null ) ; when ( spyAppConfigProperties . getWarPath ( ) ) . thenReturn ( "test-res" ) ; java . lang . String baseUrl = spyAppConfigProperties . getBiServerBaseUrl ( ) ; "<AssertPlaceHolder>" ; } getBiServerBaseUrl ( ) { java . lang . String baseUrl = org . pentaho . platform . config . AppConfigProperties . DEFAULT_BISERVER_BASE_URL ; java . lang . String consoleXmlBaseUrl = getConsoleConfig ( ) . getBaseUrl ( ) ; if ( consoleXmlBaseUrl != null ) { return consoleXmlBaseUrl ; } try { org . pentaho . platform . config . WebXml webXml = new org . pentaho . platform . config . WebXml ( new java . io . File ( ( ( getWarPath ( ) ) + ( org . pentaho . platform . config . AppConfigProperties . WEB_XML_PATH ) ) ) ) ; baseUrl = webXml . getBaseUrl ( ) ; if ( ! ( ( baseUrl != null ) && ( ( baseUrl . length ( ) ) > 0 ) ) ) { baseUrl = org . pentaho . platform . config . AppConfigProperties . DEFAULT_BISERVER_BASE_URL ; } } catch ( java . lang . Exception e ) { } return baseUrl ; }
|
org . junit . Assert . assertEquals ( AppConfigProperties . DEFAULT_BISERVER_BASE_URL , baseUrl )
|
testSerialization ( ) { org . jfree . data . time . ohlc . OHLCSeriesCollection c1 = new org . jfree . data . time . ohlc . OHLCSeriesCollection ( ) ; org . jfree . data . time . ohlc . OHLCSeries s1 = new org . jfree . data . time . ohlc . OHLCSeries ( "Series" ) ; s1 . add ( new org . jfree . data . time . Year ( 2006 ) , 1.0 , 1.1 , 1.2 , 1.3 ) ; c1 . addSeries ( s1 ) ; org . jfree . data . time . ohlc . OHLCSeriesCollection c2 = ( ( org . jfree . data . time . ohlc . OHLCSeriesCollection ) ( org . jfree . chart . TestUtilities . serialised ( c1 ) ) ) ; "<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 ( c1 , c2 )
|
isSubQueryWithLongAndLowerCaseWorking ( ) { if ( isBatoo ( ) ) { return ; } final java . lang . String query = "select<sp>r<sp>from<sp>RegularEntityTwo<sp>r<sp>" + "<sp>where<sp>r.id<sp>in<sp>(select<sp>sub.id<sp>from<sp>RegularEntityOne<sp>sub<sp>where<sp>lower(sub.stringAttribute)<sp>=<sp>lower('Just<sp>a<sp>String<sp>02'))" ; final java . util . List < com . uaihebert . model . test . RegularEntityTwo > resultFromJPQL = jpqlHelper . getListFromJPQL ( query , com . uaihebert . model . test . RegularEntityTwo . class ) ; "<AssertPlaceHolder>" ; final com . uaihebert . uaicriteria . UaiCriteria < com . uaihebert . model . test . RegularEntityTwo > uaiCriteria = createCriteria ( com . uaihebert . model . test . RegularEntityTwo . class ) ; final com . uaihebert . uaicriteria . UaiCriteria < com . uaihebert . model . test . RegularEntityOne > subQuery = uaiCriteria . subQuery ( "id" , com . uaihebert . model . test . RegularEntityOne . class ) ; subQuery . andEquals ( true , "stringAttribute" , "Just<sp>a<sp>String<sp>02" ) ; uaiCriteria . andAttributeIn ( "id" , subQuery ) ; validateTestLists ( resultFromJPQL , uaiCriteria . getResultList ( ) ) ; } getListFromJPQL ( java . lang . String , java . lang . Class ) { return getListFromJPQL ( query , classToUse , null ) ; }
|
org . junit . Assert . assertTrue ( ( ( resultFromJPQL . size ( ) ) == 1 ) )
|
whenSaturatedSubstractTwoIntegerValues_shouldSubstractThemAndReturnTheResult ( ) { int result = com . google . common . math . IntMath . saturatedSubtract ( 6 , 2 ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 4 , result )
|
testConstructor ( ) { org . onosproject . routing . bgp . BgpRouteEntry bgpRouteEntry = generateBgpRouteEntry ( ) ; java . lang . String expectedString = "BgpRouteEntry{prefix=1.2.3.0/24,<sp>nextHop=5.6.7.8,<sp>" + ( ( ( "bgpId=10.0.0.1,<sp>origin=IGP,<sp>asPath=AsPath{pathSegments=" + "[PathSegment{type=AS_SEQUENCE,<sp>segmentAsNumbers=[1,<sp>2,<sp>3]},<sp>" ) + "PathSegment{type=AS_SET,<sp>segmentAsNumbers=[4,<sp>5,<sp>6]}]},<sp>" ) + "localPref=100,<sp>multiExitDisc=20}" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . MoreObjects . toStringHelper ( getClass ( ) ) . omitNullValues ( ) . add ( "binNumber" , binNumber ) . add ( "listOfLsp" , listOfLsp ) . toString ( ) ; }
|
org . junit . Assert . assertThat ( bgpRouteEntry . toString ( ) , org . hamcrest . Matchers . is ( expectedString ) )
|
testInsertRetrieveEmbeddedObject ( ) { net . vz . mongodb . jackson . mock . MockObject object = new net . vz . mongodb . jackson . mock . MockObject ( ) ; object . object = new net . vz . mongodb . jackson . mock . MockEmbeddedObject ( ) ; object . object . value = "blah" ; coll . insert ( object ) ; net . vz . mongodb . jackson . mock . MockObject result = coll . findOne ( ) ; "<AssertPlaceHolder>" ; } findOne ( ) { return findOne ( new net . vz . mongodb . jackson . BasicDBObject ( ) ) ; }
|
org . junit . Assert . assertEquals ( object . object , result . object )
|
test_no_schematype ( ) { try { getValidator ( "sw-config-no-schematype.xml" ) ; } catch ( java . lang . RuntimeException e ) { boolean exceptionText = e . getMessage ( ) . contains ( "SWITCHYARD017219" ) ; "<AssertPlaceHolder>" ; } } getMessage ( ) { return _message ; }
|
org . junit . Assert . assertTrue ( exceptionText )
|
setInvalidDataSourceAndExecutorConfigurationTest ( ) { java . lang . String [ ] origEntries = getConfigurationData ( null ) ; org . glassfish . javaee7 . batch . test . util . CommandUtil cmd = org . glassfish . javaee7 . batch . test . util . CommandUtil . getInstance ( ) . executeCommandAndGetAsList ( "asadmin" , org . glassfish . javaee7 . batch . test . BatchCommandsTest . SET_BATCH_RUNTIME_COMMAND , "-x" , org . glassfish . javaee7 . batch . test . BatchCommandsTest . VALID_DEFAULT_DATA_SOURCE_NAME , "-d" , org . glassfish . javaee7 . batch . test . BatchCommandsTest . VALID_EXECUTOR_NAME ) ; java . lang . String [ ] newEntries = getConfigurationData ( null ) ; "<AssertPlaceHolder>" ; } ranOK ( ) { return ( ( cause ) == null ) && ( ( exitCode ) == 0 ) ; }
|
org . junit . Assert . assertTrue ( ( ( ( ! ( cmd . ranOK ( ) ) ) && ( newEntries [ 0 ] . equals ( origEntries [ 0 ] ) ) ) && ( newEntries [ 1 ] . equals ( origEntries [ 1 ] ) ) ) )
|
shouldTruncatePropertyBytes ( ) { final uk . gov . gchq . gaffer . data . element . Properties properties = new uk . gov . gchq . gaffer . data . element . Properties ( ) { { put ( HBasePropertyNames . COLUMN_QUALIFIER , 1 ) ; put ( HBasePropertyNames . COLUMN_QUALIFIER_2 , 2 ) ; put ( HBasePropertyNames . COLUMN_QUALIFIER_3 , 3 ) ; put ( HBasePropertyNames . COLUMN_QUALIFIER_4 , 4 ) ; } } ; final byte [ ] bytes = serialisation . getColumnQualifier ( TestGroups . EDGE , properties ) ; final byte [ ] truncatedPropertyBytes = serialisation . getPropertiesAsBytesFromColumnQualifier ( TestGroups . EDGE , bytes , 2 ) ; final uk . gov . gchq . gaffer . data . element . Properties truncatedProperties = new uk . gov . gchq . gaffer . data . element . Properties ( ) { { put ( HBasePropertyNames . COLUMN_QUALIFIER , 1 ) ; put ( HBasePropertyNames . COLUMN_QUALIFIER_2 , 2 ) ; } } ; final byte [ ] expectedBytes = serialisation . getColumnQualifier ( TestGroups . EDGE , truncatedProperties ) ; final byte [ ] expectedTruncatedPropertyBytes = serialisation . getPropertiesAsBytesFromColumnQualifier ( TestGroups . EDGE , expectedBytes , 2 ) ; "<AssertPlaceHolder>" ; } getPropertiesAsBytesFromColumnQualifier ( java . lang . String , byte [ ] , int ) { if ( ( ( numProps == 0 ) || ( null == bytes ) ) || ( ( bytes . length ) == 0 ) ) { return uk . gov . gchq . gaffer . hbasestore . utils . HBaseStoreConstants . EMPTY_BYTES ; } final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition elementDefinition = schema . getElement ( group ) ; if ( null == elementDefinition ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( ( ( "No<sp>SchemaElementDefinition<sp>found<sp>for<sp>group<sp>" + group ) + ",<sp>is<sp>this<sp>group<sp>in<sp>your<sp>schema<sp>or<sp>do<sp>your<sp>table<sp>iterators<sp>need<sp>updating?" ) ) ; } final int firstDelimiter = ( uk . gov . gchq . gaffer . serialisation . implementation . raw . CompactRawSerialisationUtils . decodeVIntSize ( bytes [ 0 ] ) ) + ( org . apache . hadoop . hbase . util . Bytes . toBytes ( group ) . length ) ; if ( numProps == ( elementDefinition . getProperties ( ) . size ( ) ) ) { final int length = ( bytes . length ) - firstDelimiter ; final byte [ ] propertyBytes = new byte [ length ] ; java . lang . System . arraycopy ( bytes , firstDelimiter , propertyBytes , 0 , length ) ; return propertyBytes ; } int lastDelimiter = firstDelimiter ; final int arrayLength = bytes . length ; long currentPropLength ; int propIndex = 0 ; while ( ( propIndex < numProps ) && ( lastDelimiter < arrayLength ) ) { final int numBytesForLength = uk . gov . gchq . gaffer . serialisation . implementation . raw . CompactRawSerialisationUtils . decodeVIntSize ( bytes [ lastDelimiter ] ) ; final byte [ ] length = new byte [ numBytesForLength ] ; java . lang . System . arraycopy ( bytes , lastDelimiter , length , 0 , numBytesForLength ) ; try { currentPropLength = uk . gov . gchq . gaffer . serialisation . implementation . raw . CompactRawSerialisationUtils . readLong ( length ) ; } catch ( final uk . gov . gchq . gaffer . exception . SerialisationException e ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( "Exception<sp>reading<sp>length<sp>of<sp>property" ) ; } lastDelimiter += numBytesForLength ; if ( currentPropLength > 0 ) { lastDelimiter += currentPropLength ; } propIndex ++ ; } final int length = lastDelimiter - firstDelimiter ; final byte [ ] propertyBytes = new byte [ length ] ; java . lang . System . arraycopy ( bytes , firstDelimiter , propertyBytes , 0 , length ) ; return propertyBytes ; }
|
org . junit . Assert . assertArrayEquals ( expectedTruncatedPropertyBytes , truncatedPropertyBytes )
|
testOnFlowUpdatePreSrcFlowErr ( ) { java . lang . String networkId = org . o3project . odenos . component . aggregator . AggregatorTest . AGGREGATED_NW_ID ; org . o3project . odenos . core . component . network . flow . Flow prev = new org . o3project . odenos . core . component . network . flow . Flow ( ) ; prev . setFlowId ( "flow_id" ) ; org . o3project . odenos . core . component . network . flow . Flow curr = new org . o3project . odenos . core . component . network . flow . Flow ( ) ; curr . setFlowId ( "flow_id" ) ; org . o3project . odenos . core . component . ConversionTable conversionTable = org . powermock . api . mockito . PowerMockito . spy ( new org . o3project . odenos . core . component . ConversionTable ( ) ) ; org . powermock . api . mockito . PowerMockito . doReturn ( "aggregated" ) . when ( conversionTable , "getConnectionType" , networkId ) ; org . powermock . api . mockito . PowerMockito . doReturn ( conversionTable ) . when ( target , "conversionTable" ) ; org . o3project . odenos . core . component . NetworkInterface srcNwIf = org . powermock . api . mockito . PowerMockito . spy ( new org . o3project . odenos . core . component . NetworkInterface ( dispatcher , org . o3project . odenos . component . aggregator . AggregatorTest . AGGREGATED_NW_ID ) ) ; org . o3project . odenos . core . component . NetworkInterface dstNwIf = org . powermock . api . mockito . PowerMockito . spy ( new org . o3project . odenos . core . component . NetworkInterface ( dispatcher , org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID ) ) ; java . util . HashMap < java . lang . String , org . o3project . odenos . core . component . NetworkInterface > nwifs = new java . util . HashMap < java . lang . String , org . o3project . odenos . core . component . NetworkInterface > ( ) ; nwifs . put ( org . o3project . odenos . component . aggregator . AggregatorTest . AGGREGATED_NW_ID , srcNwIf ) ; nwifs . put ( org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID , dstNwIf ) ; org . powermock . api . mockito . PowerMockito . doReturn ( org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID ) . when ( target , "getConvNetworkId" , eq ( org . o3project . odenos . component . aggregator . AggregatorTest . AGGREGATED_NW_ID ) ) ; org . powermock . api . mockito . PowerMockito . doReturn ( nwifs ) . when ( target , "networkInterfaces" ) ; org . o3project . odenos . core . component . network . flow . basic . BasicFlow srcFlow = null ; org . powermock . api . mockito . PowerMockito . doReturn ( srcFlow ) . when ( target , "getFlow" , anyObject ( ) , eq ( "flow_id" ) ) ; java . util . ArrayList < java . lang . String > attributesList = new java . util . ArrayList < java . lang . String > ( ) ; boolean result = target . onFlowUpdatePre ( networkId , prev , curr , attributesList ) ; "<AssertPlaceHolder>" ; org . powermock . api . mockito . PowerMockito . verifyPrivate ( target , never ( ) ) . invoke ( "getConvFlowId" , anyString ( ) , anyString ( ) ) ; } onFlowUpdatePre ( java . lang . String , org . o3project . odenos . core . component . network . flow . Flow , org . o3project . odenos . core . component . network . flow . Flow , java . util . ArrayList ) { org . o3project . odenos . component . linklayerizer . LinkLayerizer . log . debug ( "" ) ; org . o3project . odenos . core . component . network . flow . basic . BasicFlow basicFlow = getFlow ( networkId , curr ) ; if ( basicFlow == null ) { return false ; } if ( isLowerNetwork ( networkId ) ) { linkLayerizerOnFlow . flowUpdateLowerNw ( networkId , basicFlow , attributesList ) ; return false ; } if ( ( ( basicFlow . getPath ( ) ) != null ) && ( ( basicFlow . getPath ( ) . size ( ) ) > 0 ) ) { if ( isUpperNetwork ( networkId ) ) { linkLayerizerOnFlow . flowUpdateUpperNwExistPath ( networkId , basicFlow , attributesList ) ; return false ; } } return true ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
|
testSpecExample1_01 ( ) { org . apache . tomcat . websocket . server . UriTemplate t = new org . apache . tomcat . websocket . server . UriTemplate ( "/a/b" ) ; java . util . Map < java . lang . String , java . lang . String > result = t . match ( new org . apache . tomcat . websocket . server . UriTemplate ( "/a/b" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return items . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testUserJSInjectionIsFalseByDefault ( ) { "<AssertPlaceHolder>" ; } userJSInjection ( ) { return userJSInjection ; }
|
org . junit . Assert . assertFalse ( configuration . userJSInjection ( ) )
|
testIsIncluded_enabled_invalidHttpHeaders ( ) { final com . adobe . acs . commons . replication . dispatcher . DispatcherFlushFilter filter = new com . adobe . acs . commons . replication . dispatcher . DispatcherFlushFilter ( ) ; when ( agent . isEnabled ( ) ) . thenReturn ( true ) ; when ( agentConfig . getTransportURI ( ) ) . thenReturn ( "http://localhost:80/dispatcher/invalidate.cache" ) ; when ( agentConfig . getProperties ( ) ) . thenReturn ( invalidProperties ) ; when ( agentConfig . getSerializationType ( ) ) . thenReturn ( "flush" ) ; final boolean expected = false ; final boolean actual = filter . isIncluded ( agent ) ; "<AssertPlaceHolder>" ; } isIncluded ( com . day . cq . replication . Agent ) { final com . day . cq . replication . AgentConfig agentConfig = agent . getConfiguration ( ) ; return ( ( ( agentConfig . isEnabled ( ) ) && ( ! ( agentConfig . usedForReverseReplication ( ) ) ) ) && ( com . adobe . acs . commons . replication . AemPublishAgentFilter . SERIALIZATION_TYPE . equalsIgnoreCase ( agentConfig . getSerializationType ( ) ) ) ) && ( org . apache . commons . lang3 . StringUtils . contains ( agentConfig . getTransportURI ( ) , com . adobe . acs . commons . replication . AemPublishAgentFilter . TRANSPORT_PATH ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testEnsureCapacityUnknown2 ( ) { final org . jacoco . core . internal . analysis . SourceNodeImpl node = new org . jacoco . core . internal . analysis . SourceNodeImpl ( org . jacoco . core . analysis . ICoverageNode . ElementType . CLASS , "Foo" ) ; node . ensureCapacity ( ISourceNode . UNKNOWN_LINE , 10 ) ; "<AssertPlaceHolder>" ; } getLine ( int ) { if ( ( ( ( lines ) == null ) || ( nr < ( getFirstLine ( ) ) ) ) || ( nr > ( getLastLine ( ) ) ) ) { return LineImpl . EMPTY ; } final org . jacoco . core . internal . analysis . LineImpl line = lines [ ( nr - ( offset ) ) ] ; return line == null ? LineImpl . EMPTY : line ; }
|
org . junit . Assert . assertEquals ( LineImpl . EMPTY , node . getLine ( 10 ) )
|
getQueryParts_shouldProcessSimpleSpaceAsSeparator ( ) { java . lang . String [ ] actual = patientSearchCriteria . getQueryParts ( "Anton<sp>Bert<sp>Charles" ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "Anton" , "Bert" , "Charles" } ; "<AssertPlaceHolder>" ; } getQueryParts ( java . lang . String ) { if ( query == null ) { throw new java . lang . IllegalArgumentException ( "query<sp>must<sp>not<sp>be<sp>null" ) ; } query = query . replace ( "," , "<sp>" ) ; java . lang . String [ ] queryPartArray = query . split ( "<sp>" ) ; java . util . List < java . lang . String > queryPartList = new java . util . ArrayList ( ) ; for ( java . lang . String queryPart : queryPartArray ) { if ( ( queryPart . trim ( ) . length ( ) ) > 0 ) { queryPartList . add ( queryPart ) ; } } return queryPartList . toArray ( new java . lang . String [ 0 ] ) ; }
|
org . junit . Assert . assertArrayEquals ( expected , actual )
|
testIsLightWeight ( ) { final com . allanbank . mongodb . client . FutureCallback < java . lang . Boolean > future = new com . allanbank . mongodb . client . FutureCallback < java . lang . Boolean > ( ) ; final com . allanbank . mongodb . client . connection . auth . X509ResponseCallback cb = new com . allanbank . mongodb . client . connection . auth . X509ResponseCallback ( future ) ; "<AssertPlaceHolder>" ; } isLightWeight ( ) { return ( ( myForwardCallback ) instanceof com . allanbank . mongodb . client . FutureCallback ) || ( ( ( myForwardCallback ) instanceof com . allanbank . mongodb . client . callback . ReplyCallback ) && ( ( ( com . allanbank . mongodb . client . callback . ReplyCallback ) ( myForwardCallback ) ) . isLightWeight ( ) ) ) ; }
|
org . junit . Assert . assertThat ( cb . isLightWeight ( ) , org . hamcrest . Matchers . is ( true ) )
|
testRoleBFailAuthorized ( ) { "<AssertPlaceHolder>" ; securedEjb . roleB ( ) ; }
|
org . junit . Assert . assertNotNull ( securedEjb )
|
testGetNodeAsElement ( ) { java . io . InputStream is = new java . io . ByteArrayInputStream ( "<foo><bar/></foo>" . getBytes ( ) ) ; org . apache . cxf . jaxrs . ext . xml . XMLSource xp = new org . apache . cxf . jaxrs . ext . xml . XMLSource ( is ) ; xp . setBuffering ( ) ; org . w3c . dom . Element element = xp . getNode ( "/foo/bar" , org . w3c . dom . Element . class ) ; "<AssertPlaceHolder>" ; } getNode ( java . lang . String , java . lang . Class ) { return getNode ( expression , org . apache . cxf . helpers . CastUtils . cast ( java . util . Collections . emptyMap ( ) , java . lang . String . class , java . lang . String . class ) , cls ) ; }
|
org . junit . Assert . assertNotNull ( element )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.