input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
getTenantByTenantId ( ) { runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . tenant . dao . Override public org . oscm . tenant . dao . Void call ( ) throws org . oscm . tenant . dao . Exception { bean . addTenant ( org . oscm . tenant . assembler . TenantAssembler . toVOTenant ( tenant1 ) ) ; return null ; } } ) ; final org . oscm . domobjects . Tenant returnedTenant = runTX ( new java . util . concurrent . Callable < org . oscm . domobjects . Tenant > ( ) { @ org . oscm . tenant . dao . Override public org . oscm . domobjects . Tenant call ( ) throws org . oscm . internal . types . exception . NonUniqueBusinessKeyException , org . oscm . internal . types . exception . ObjectNotFoundException { return tenantDao . getTenantByTenantId ( "tenantID1" ) ; } } ) ; "<AssertPlaceHolder>" ; } getTenantByTenantId ( java . lang . String ) { return new org . oscm . internal . tenant . POTenant ( tenantService . getTenantByTenantId ( tenantId ) ) ; }
org . junit . Assert . assertTrue ( ( returnedTenant != null ) )
testPartials ( ) { org . trimou . engine . parser . Template template = ( ( org . trimou . engine . parser . Template ) ( engine . compileMustache ( "parse_partial" , "START{{>partial}}END" ) ) ) ; java . util . List < org . trimou . engine . segment . Segment > segments = template . getRootSegment ( ) . getSegments ( ) ; "<AssertPlaceHolder>" ; org . trimou . engine . parser . ParsingTest . validateSegment ( segments , 0 , SegmentType . TEXT , "START" ) ; org . trimou . engine . parser . ParsingTest . validateSegment ( segments , 1 , SegmentType . PARTIAL , "partial" ) ; org . trimou . engine . parser . ParsingTest . validateSegment ( segments , 2 , SegmentType . TEXT , "END" ) ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , segments . size ( ) )
testNotifySuccess ( ) { "<AssertPlaceHolder>" ; BatchResult . Callback < java . lang . Boolean , com . google . cloud . storage . StorageException > callback = org . easymock . EasyMock . createStrictMock ( BatchResult . Callback . class ) ; callback . success ( true ) ; org . easymock . EasyMock . replay ( callback ) ; result . notify ( callback ) ; result . success ( true ) ; try { result . notify ( callback ) ; org . junit . Assert . fail ( "The<sp>batch<sp>has<sp>been<sp>completed." ) ; } catch ( java . lang . IllegalStateException exception ) { } org . easymock . EasyMock . verify ( callback ) ; } completed ( ) { return completed ; }
org . junit . Assert . assertFalse ( result . completed ( ) )
testCommentsIgnored2 ( ) { tokenizer . tokenize ( toSourceCode ( "class<sp>Foo<sp>{<sp>//<sp>class<sp>X<sp>/*<sp>aaa<sp>*/<sp>\n<sp>}" ) , tokens ) ; "<AssertPlaceHolder>" ; } size ( ) { return rules . size ( ) ; }
org . junit . Assert . assertEquals ( 5 , tokens . size ( ) )
readSend2StreamHuge_FileBased ( ) { folder . delete ( ) ; try ( final java . sql . Connection con = createConnection ( folder . getRoot ( ) . getAbsolutePath ( ) ) ) { org . apache . nifi . util . db . TestJdbcHugeStream . loadTestData2Database ( con , 100 , 100 , 100 ) ; try ( final java . sql . Statement st = con . createStatement ( ) ) { final java . sql . ResultSet resultSet = st . executeQuery ( ( "select<sp>" + ( ( ( ( "<sp>PER.ID<sp>as<sp>PersonId,<sp>PER.NAME<sp>as<sp>PersonName,<sp>PER.CODE<sp>as<sp>PersonCode" + ",<sp>PRD.ID<sp>as<sp>ProductId,PRD.NAME<sp>as<sp>ProductName,PRD.CODE<sp>as<sp>ProductCode" ) + ",<sp>REL.ID<sp>as<sp>RelId,<sp>REL.NAME<sp>as<sp>RelName,<sp>REL.CODE<sp>as<sp>RelCode" ) + ",<sp>ROW_NUMBER()<sp>OVER<sp>()<sp>as<sp>rownr<sp>" ) + "<sp>from<sp>persons<sp>PER,<sp>products<sp>PRD,<sp>relationships<sp>REL" ) ) ) ; final java . io . OutputStream outStream = new java . io . FileOutputStream ( "target/data.avro" ) ; final long nrOfRows = org . apache . nifi . util . db . JdbcCommon . convertToAvroStream ( resultSet , outStream , false ) ; final java . io . InputStream instream = new java . io . FileInputStream ( "target/data.avro" ) ; final org . apache . avro . io . DatumReader < org . apache . avro . generic . GenericRecord > datumReader = new org . apache . avro . generic . GenericDatumReader ( ) ; try ( final org . apache . avro . file . DataFileStream < org . apache . avro . generic . GenericRecord > dataFileReader = new org . apache . avro . file . DataFileStream ( instream , datumReader ) ) { org . apache . avro . generic . GenericRecord record = null ; long recordsFromStream = 0 ; while ( dataFileReader . hasNext ( ) ) { record = dataFileReader . next ( record ) ; recordsFromStream += 1 ; } System . out . println ( ( "total<sp>nr<sp>of<sp>records<sp>from<sp>stream:<sp>" + recordsFromStream ) ) ; "<AssertPlaceHolder>" ; } } } } println ( java . lang . String ) { output . println ( val ) ; }
org . junit . Assert . assertEquals ( nrOfRows , recordsFromStream )
testSetLiteralWithStrings ( ) { org . apache . commons . jexl3 . JexlExpression e = org . apache . commons . jexl3 . JEXL . createExpression ( "{<sp>'foo'<sp>,<sp>'bar'<sp>}" ) ; org . apache . commons . jexl3 . JexlContext jc = new org . apache . commons . jexl3 . MapContext ( ) ; java . lang . Object o = e . evaluate ( jc ) ; java . util . Set < ? > check = org . apache . commons . jexl3 . SetLiteralTest . createSet ( "foo" , "bar" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final org . apache . commons . jexl3 . internal . Script other = ( ( org . apache . commons . jexl3 . internal . Script ) ( obj ) ) ; if ( ( this . jexl ) != ( other . jexl ) ) { return false ; } if ( ( this . source ) == null ? ( other . source ) != null : ! ( this . source . equals ( other . source ) ) ) { return false ; } return true ; }
org . junit . Assert . assertTrue ( check . equals ( o ) )
testOwnersActions ( ) { final io . dockstore . webservice . permissions . Permission permission = new io . dockstore . webservice . permissions . Permission ( "jane" , Role . OWNER ) ; inMemoryPermissions . setPermission ( johnDoeUser , fooWorkflow , permission ) ; final java . util . List < io . dockstore . webservice . permissions . Role . Action > actions = inMemoryPermissions . getActionsForWorkflow ( janeDoeUser , fooWorkflow ) ; "<AssertPlaceHolder>" ; } getActionsForWorkflow ( io . dockstore . webservice . core . User , io . dockstore . webservice . core . Workflow ) { if ( workflow . getUsers ( ) . contains ( user ) ) { return java . util . Arrays . asList ( Role . Action . values ( ) ) ; } return java . util . Collections . emptyList ( ) ; }
org . junit . Assert . assertEquals ( Role . Action . values ( ) . length , actions . size ( ) )
getMySubscriptionDetailsTest ( ) { bean = spy ( bean ) ; org . oscm . i18nservice . bean . LocalizerFacade facade = getLocalizerFacadeMock ( ) ; doReturn ( facade ) . when ( bean ) . getLocalizerFacade ( ) ; org . oscm . internal . subscriptions . Subscription sub = createSubscription ( ) ; sub = spy ( sub ) ; when ( subscriptionServiceLocal . getMySubscriptionDetails ( 1L ) ) . thenReturn ( sub ) ; bean . dm = mock ( org . oscm . dataservice . local . DataService . class ) ; when ( bean . dm . getCurrentUser ( ) ) . thenReturn ( new org . oscm . internal . subscriptions . PlatformUser ( ) ) ; org . oscm . internal . subscriptions . POSubscription mySubscriptionDetails = bean . getMySubscriptionDetails ( 1L ) ; "<AssertPlaceHolder>" ; } getMySubscriptionDetails ( long ) { return getSubscriptionDao ( ) . getMySubscriptionDetails ( key ) ; }
org . junit . Assert . assertNotNull ( mySubscriptionDetails )
testParseRouteMonitMessage ( ) { final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bmp . message . rev180329 . RouteMonitoringMessage parsedInitMsg = ( ( org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bmp . message . rev180329 . RouteMonitoringMessage ) ( getBmpMessageRegistry ( ) . parseMessage ( io . netty . buffer . Unpooled . copiedBuffer ( org . opendaylight . protocol . bmp . parser . message . RouteMonitoringMessageHandlerTest . ROUTE_MONIT_MSG ) ) ) ) ; "<AssertPlaceHolder>" ; } createRouteMonitMsg ( boolean ) { return org . opendaylight . protocol . bmp . parser . message . TestUtil . createRouteMonitMsg ( withNormalizedIpv4Prefixes , org . opendaylight . protocol . bmp . parser . message . TestUtil . IPV4_ADDRESS_10 , AdjRibInType . PrePolicy ) ; }
org . junit . Assert . assertEquals ( org . opendaylight . protocol . bmp . parser . message . TestUtil . createRouteMonitMsg ( true ) , parsedInitMsg )
startSlave ( ) { java . util . Map < java . lang . String , java . lang . Object > config = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; config . put ( "node:name" , "test" ) ; config . put ( ViConf . SPI_CONTROL_CONSOLE , console ) ; config . put ( ViConf . SPI_REMOTING_SESSION , session ) ; config . put ( ViConf . JVM_EXEC_CMD , new java . io . File ( new java . io . File ( java . lang . System . getProperty ( "java.home" ) , "bin" ) , "java" ) . getPath ( ) ) ; config . put ( ViConf . SPI_SLAVE_ARGS , new java . util . ArrayList < java . lang . String > ( ) ) ; config . put ( ViConf . SPI_SLAVE_CLASSPATH , org . gridkit . vicluster . telecontrol . Classpath . getClasspath ( java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ) ) ; config . put ( ViConf . SPI_STREAM_COPY_SERVICE , BackgroundStreamDumper . SINGLETON ) ; @ org . gridkit . nanocloud . telecontrol . SuppressWarnings ( "deprecation" ) org . gridkit . nanocloud . telecontrol . ProcessSporeLauncher launcher = new org . gridkit . nanocloud . telecontrol . ProcessSporeLauncher ( ) ; org . gridkit . vicluster . telecontrol . ManagedProcess slave = launcher . createProcess ( config ) ; slave . bindStdOut ( System . out ) ; slave . bindStdErr ( System . err ) ; slave . bindStdIn ( new java . io . ByteArrayInputStream ( "Ping" . getBytes ( ) ) ) ; slave . getExecutionService ( ) . submit ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . gridkit . nanocloud . telecontrol . Override public org . gridkit . nanocloud . telecontrol . Void call ( ) throws org . gridkit . nanocloud . telecontrol . Exception { System . out . println ( "Ping<sp>check<sp>skipped" ) ; return null ; } } ) . get ( ) ; try { slave . destroy ( ) ; } catch ( java . lang . Exception e ) { } "<AssertPlaceHolder>" ; } getExitCodeFuture ( ) { org . gridkit . util . concurrent . FutureBox < java . lang . Integer > fb = new org . gridkit . util . concurrent . FutureBox < java . lang . Integer > ( ) ; return fb ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 0 ) ) , slave . getExitCodeFuture ( ) . get ( ) )
testNoBatchWriteWithSync ( ) { java . nio . ByteBuffer data = java . nio . ByteBuffer . wrap ( "DATA" . getBytes ( ) ) ; final int iterations = 10 ; for ( int i = 0 ; i < iterations ; i ++ ) { journal . write ( data , true ) ; "<AssertPlaceHolder>" ; } } getInflightWrites ( ) { return inflightWrites ; }
org . junit . Assert . assertTrue ( journal . getInflightWrites ( ) . isEmpty ( ) )
backhaulViolationAtAct4_shouldWork ( ) { buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore ( ) ; com . graphhopper . jsprit . core . analysis . SolutionAnalyser analyser = new com . graphhopper . jsprit . core . analysis . SolutionAnalyser ( vrp , solution , vrp . getTransportCosts ( ) ) ; com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute route = solution . getRoutes ( ) . iterator ( ) . next ( ) ; java . lang . Boolean violation = analyser . hasBackhaulConstraintViolationAtActivity ( route . getActivities ( ) . get ( 3 ) , route ) ; "<AssertPlaceHolder>" ; } get ( com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute ) { com . graphhopper . jsprit . core . problem . constraint . List < com . graphhopper . jsprit . core . problem . constraint . Vehicle > vehicles = new com . graphhopper . jsprit . core . problem . constraint . ArrayList < com . graphhopper . jsprit . core . problem . constraint . Vehicle > ( ) ; vehicles . add ( route . getVehicle ( ) ) ; vehicles . addAll ( fleetManager . getAvailableVehicles ( route . getVehicle ( ) ) ) ; return vehicles ; }
org . junit . Assert . assertTrue ( violation )
testAvroToDiLong ( ) { java . lang . String expectedType = "id_Long" ; org . apache . avro . Schema fieldSchema = org . talend . daikon . avro . AvroUtils . _long ( ) ; "<AssertPlaceHolder>" ; } avroToDi ( org . apache . avro . Schema ) { org . apache . avro . Schema typeSchema = org . talend . daikon . avro . AvroUtils . unwrapIfNullable ( fieldSchema ) ; java . lang . String logicalType = org . talend . daikon . avro . LogicalTypeUtils . getLogicalTypeName ( typeSchema ) ; if ( logicalType != null ) { return org . talend . codegen . converter . TypeConverter . getDiByLogicalType ( logicalType ) ; } java . lang . String javaClass = typeSchema . getProp ( SchemaConstants . JAVA_CLASS_FLAG ) ; if ( javaClass != null ) { return org . talend . codegen . converter . TypeConverter . getDiByJavaClass ( javaClass ) ; } return org . talend . codegen . converter . TypeConverter . getDiByAvroType ( typeSchema . getType ( ) ) ; }
org . junit . Assert . assertEquals ( expectedType , org . talend . codegen . converter . TypeConverter . avroToDi ( fieldSchema ) )
shouldFindAll ( ) { java . util . List < net . rrm . ehour . persistence . project . dao . ProjectAssignment > pas = projectAssignmentDAO . findAll ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return nodes . size ( ) ; }
org . junit . Assert . assertEquals ( 12 , pas . size ( ) )
uncontendedFlushLockMustBeAvailableAfterWriteLock ( ) { pageList . unlockExclusive ( pageRef ) ; pageList . tryWriteLock ( pageRef ) ; pageList . unlockWrite ( pageRef ) ; "<AssertPlaceHolder>" ; } tryFlushLock ( long ) { long s = org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . getState ( address ) ; if ( ( s & ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . FAE_MASK ) ) == 0 ) { long n = s + ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . FLS_MASK ) ; boolean res = org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . compareAndSetState ( address , s , n ) ; org . neo4j . unsafe . impl . internal . dragons . UnsafeUtil . storeFence ( ) ; return res ? n : 0 ; } return 0 ; }
org . junit . Assert . assertTrue ( ( ( pageList . tryFlushLock ( pageRef ) ) != 0 ) )
ACLproncipalfalse ( ) { java . lang . String aclString = "<D:acl<sp>xmlns:D='DAV:'<sp>xml:base='https://fqdn/aclTest/__role/__/'>" + ( ( ( ( ( ( ( ( ( "<D:ace>" + "<D:principal>" ) + "</D:principal>" ) + "</D:privilege>" 0 ) + "<D:privilege>" ) + "<D:all/>" ) + "</D:privilege>" ) + "</D:grant>" ) + "</D:ace>" ) + "</D:acl>" ) ; com . fujitsu . dc . core . model . jaxb . Acl aclToSet = null ; java . io . Reader reader = new java . io . StringReader ( aclString ) ; aclToSet = com . fujitsu . dc . core . model . jaxb . ObjectIo . unmarshal ( reader , com . fujitsu . dc . core . model . jaxb . Acl . class ) ; "<AssertPlaceHolder>" ; } validateAcl ( boolean ) { if ( ( aces ) == null ) { return true ; } for ( com . fujitsu . dc . core . model . jaxb . Ace ace : aces ) { if ( ( ( ace . grant ) == null ) || ( ( ace . principal ) == null ) ) { return false ; } if ( ( ace . grant . privileges ) == null ) { return false ; } java . util . Map < java . lang . String , com . fujitsu . dc . core . auth . CellPrivilege > cellPrivilegeMap = com . fujitsu . dc . core . auth . CellPrivilege . getPrivilegeMap ( ) ; java . util . Map < java . lang . String , com . fujitsu . dc . core . auth . BoxPrivilege > boxPrivilegeMap = com . fujitsu . dc . core . auth . BoxPrivilege . getPrivilegeMap ( ) ; for ( com . fujitsu . dc . core . auth . com . fujitsu . dc . core . model . jaxb . Privilege privilege : ace . grant . privileges ) { if ( ( privilege . body ) == null ) { return false ; } if ( isCellLevel ) { if ( ! ( cellPrivilegeMap . containsKey ( privilege . body . getLocalName ( ) ) ) ) { return false ; } } else { if ( ! ( boxPrivilegeMap . containsKey ( privilege . body . getLocalName ( ) ) ) ) { return false ; } } } if ( ( ( ace . principal . all ) == null ) && ( ( ( ace . principal . href ) == null ) || ( ace . principal . href . equals ( "" ) ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertFalse ( aclToSet . validateAcl ( true ) )
shouldGetGafferVersion ( ) { final javax . ws . rs . core . Response response = client . getProperty ( SystemProperty . GAFFER_VERSION ) ; final java . lang . String propertyValue = response . readEntity ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { final boolean isCore = uk . gov . gchq . gaffer . rest . service . v2 . PropertiesServiceV2 . CORE_EXPOSED_PROPERTIES . containsKey ( propertyName ) ; boolean isExposed = isCore ; if ( ! isExposed ) { final java . lang . String propertiesList = java . lang . System . getProperty ( uk . gov . gchq . gaffer . rest . service . v2 . PropertiesServiceV2 . EXPOSED_PROPERTIES ) ; if ( null != propertiesList ) { final java . lang . String [ ] props = propertiesList . split ( "," ) ; isExposed = org . apache . commons . lang3 . ArrayUtils . contains ( props , propertyName ) ; } } java . lang . String prop ; if ( isExposed ) { prop = java . lang . System . getProperty ( propertyName ) ; if ( ( null == prop ) && isCore ) { prop = uk . gov . gchq . gaffer . rest . service . v2 . PropertiesServiceV2 . CORE_EXPOSED_PROPERTIES . get ( propertyName ) ; } } else { prop = null ; } final javax . ws . rs . core . Response . ResponseBuilder builder = ( null == prop ) ? javax . ws . rs . core . Response . status ( 404 ) . entity ( new uk . gov . gchq . gaffer . core . exception . Error . ErrorBuilder ( ) . status ( Status . NOT_FOUND ) . statusCode ( 404 ) . simpleMessage ( ( ( "Property:<sp>" + propertyName ) + "<sp>could<sp>not<sp>be<sp>found." ) ) . build ( ) ) . type ( MediaType . APPLICATION_JSON_TYPE ) : javax . ws . rs . core . Response . ok ( prop ) . type ( MediaType . TEXT_PLAIN_TYPE ) ; return builder . header ( ServiceConstants . GAFFER_MEDIA_TYPE_HEADER , ServiceConstants . GAFFER_MEDIA_TYPE ) . build ( ) ; }
org . junit . Assert . assertNotNull ( propertyValue )
testSetupShutdown ( ) { checkNodeState ( ) ; org . apache . apex . common . util . JarHelper jarHelper = new org . apache . apex . common . util . JarHelper ( ) ; com . datatorrent . stram . StramMiniClusterTest . LOG . info ( "Initializing<sp>Client" 3 , jarHelper . getJar ( com . datatorrent . stram . StreamingAppMaster . class ) ) ; com . datatorrent . stram . StramMiniClusterTest . LOG . info ( "Client<sp>run<sp>completed.<sp>Result=" 1 , jarHelper . getJar ( com . datatorrent . stram . StramMiniClusterTest . class ) ) ; java . util . Properties dagProps = new java . util . Properties ( ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Initializing<sp>Client" 0 ) , com . datatorrent . stram . engine . TestGeneratorInputOperator . class . getName ( ) ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Initializing<sp>Client" 2 ) , "Client<sp>run<sp>completed.<sp>Result=" 7 ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Initializing<sp>Client" 4 ) , com . datatorrent . stram . engine . GenericTestOperator . class . getName ( ) ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "operator.module2.classname" ) , com . datatorrent . stram . engine . GenericTestOperator . class . getName ( ) ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Client<sp>run<sp>completed.<sp>Result=" 0 ) , "Client<sp>run<sp>completed.<sp>Result=" 3 ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Client<sp>run<sp>completed.<sp>Result=" 4 ) , "module1.inport1" ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Client<sp>run<sp>completed.<sp>Result=" 5 ) , "Client<sp>run<sp>completed.<sp>Result=" 9 ) ; dagProps . put ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "stream.n1n2.sinks" ) , "module2.inport1" ) ; dagProps . setProperty ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + ( LogicalPlan . MASTER_MEMORY_MB . getName ( ) ) ) , "Initializing<sp>Client" 1 ) ; dagProps . setProperty ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + ( LogicalPlan . CONTAINER_JVM_OPTIONS . getName ( ) ) ) , "Client<sp>run<sp>completed.<sp>Result=" 8 ) ; dagProps . setProperty ( ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "operator.*." ) + ( OperatorContext . MEMORY_MB . getName ( ) ) ) , "64" ) ; dagProps . setProperty ( ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "operator.*." ) + ( OperatorContext . VCORES . getName ( ) ) ) , "Client<sp>run<sp>completed.<sp>Result=" 7 ) ; dagProps . setProperty ( ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + "Initializing<sp>Client" 5 ) + ( Context . PortContext . BUFFER_MEMORY_MB . getName ( ) ) ) , "32" ) ; dagProps . setProperty ( ( ( com . datatorrent . api . StreamingApplication . APEX_PREFIX ) + ( LogicalPlan . DEBUG . getName ( ) ) ) , "Client<sp>run<sp>completed.<sp>Result=" 6 ) ; com . datatorrent . stram . StramMiniClusterTest . LOG . info ( "dag<sp>properties:<sp>{}" , dagProps ) ; com . datatorrent . stram . StramMiniClusterTest . LOG . info ( "Initializing<sp>Client" ) ; com . datatorrent . stram . plan . logical . LogicalPlanConfiguration tb = new com . datatorrent . stram . plan . logical . LogicalPlanConfiguration ( com . datatorrent . stram . StramMiniClusterTest . conf ) ; tb . addFromProperties ( dagProps , null ) ; com . datatorrent . stram . plan . logical . LogicalPlan dag = createDAG ( tb ) ; org . apache . hadoop . conf . Configuration yarnConf = new org . apache . hadoop . conf . Configuration ( com . datatorrent . stram . StramMiniClusterTest . yarnCluster . getConfig ( ) ) ; com . datatorrent . stram . StramClient client = new com . datatorrent . stram . StramClient ( yarnConf , dag ) ; try { client . start ( ) ; com . datatorrent . stram . StramMiniClusterTest . LOG . info ( "Client<sp>run<sp>completed.<sp>Result=" 2 ) ; client . startApplication ( ) ; boolean result = client . monitorApplication ( ) ; com . datatorrent . stram . StramMiniClusterTest . LOG . info ( ( "Client<sp>run<sp>completed.<sp>Result=" + result ) ) ; "<AssertPlaceHolder>" ; } finally { client . stop ( ) ; } } monitorApplication ( ) { com . datatorrent . stram . client . StramClientUtils . ClientRMHelper . AppStatusCallback callback = new com . datatorrent . stram . client . StramClientUtils . ClientRMHelper . AppStatusCallback ( ) { @ com . datatorrent . stram . Override public boolean exitLoop ( org . apache . hadoop . yarn . api . records . ApplicationReport report ) { com . datatorrent . stram . StramClient . LOG . info ( ( "Got<sp>application<sp>report<sp>from<sp>ASM<sp>for,<sp>appId={},<sp>clientToken={},<sp>appDiagnostics={},<sp>appMasterHost={}," + ( "appQueue={},<sp>appMasterRpcPort={},<sp>appStartTime={},<sp>yarnAppState={},<sp>distributedFinalState={},<sp>" + "appTrackingUrl={},<sp>appUser={}" ) ) , appId . getId ( ) , report . getClientToAMToken ( ) , report . getDiagnostics ( ) , report . getHost ( ) , report . getQueue ( ) , report . getRpcPort ( ) , report . getStartTime ( ) , report . getYarnApplicationState ( ) , report . getFinalApplicationStatus ( ) , report . getTrackingUrl ( ) , report . getUser ( ) ) ; return false ; } } ; com . datatorrent . stram . client . StramClientUtils . ClientRMHelper rmClient = new com . datatorrent . stram . client . StramClientUtils . ClientRMHelper ( yarnClient , conf ) ; return rmClient . waitForCompletion ( appId , callback , clientTimeout ) ; }
org . junit . Assert . assertTrue ( result )
testPutSequence ( ) { java . util . Map < java . lang . String , java . lang . String > spec = org . mockito . Mockito . mock ( org . o3project . odenos . remoteobject . message . MessageBodyUnpacker . StringMap . class ) ; doReturn ( new org . o3project . odenos . remoteobject . message . Response ( org . o3project . odenos . remoteobject . message . Response . OK , spec ) ) . when ( target ) . putObjectToSystemMng ( "sequence/offset" , spec ) ; org . o3project . odenos . remoteobject . message . Response resp = org . powermock . reflect . Whitebox . invokeMethod ( target , "putSequence" , "offset" , spec ) ; "<AssertPlaceHolder>" ; } putObjectToSystemMng ( java . lang . String , java . lang . Object ) { org . o3project . odenos . core . component . SystemManagerInterface . log . debug ( "" ) ; try { org . o3project . odenos . remoteobject . message . Response resp = sendRequest ( Request . Method . PUT , path , body ) ; if ( resp . isError ( "PUT" ) ) { org . o3project . odenos . core . component . SystemManagerInterface . log . warn ( "invalid<sp>PUT:{}" , resp . statusCode ) ; } return resp ; } catch ( java . lang . Exception e ) { org . o3project . odenos . core . component . SystemManagerInterface . log . error ( "Recieved<sp>Message<sp>Exception." , e ) ; return new org . o3project . odenos . remoteobject . message . Response ( org . o3project . odenos . remoteobject . message . Response . INTERNAL_SERVER_ERROR , null ) ; } }
org . junit . Assert . assertThat ( resp . statusCode , org . hamcrest . CoreMatchers . is ( Response . OK ) )
testValidSubPropertyOf ( ) { com . github . anno4j . Anno4j anno4j = new com . github . anno4j . Anno4j ( ) ; com . github . anno4j . ValidatedTransaction transaction = anno4j . createValidatedTransaction ( ) ; transaction . begin ( ) ; com . github . anno4j . transaction . ValidatedTransactionTest . SpecialTestResource resource = transaction . createObject ( com . github . anno4j . transaction . ValidatedTransactionTest . SpecialTestResource . class ) ; resource . setSuperproperty1 ( com . google . common . collect . Sets . newHashSet ( 1 , 2 , 3 ) ) ; resource . setSuperproperty2 ( com . google . common . collect . Sets . newHashSet ( 1 , 2 ) ) ; resource . setSubpropertyOf ( com . google . common . collect . Sets . newHashSet ( 1 , 2 ) ) ; setValidCardinalities ( resource ) ; boolean exceptionThrown = false ; try { transaction . commit ( ) ; } catch ( com . github . anno4j . ValidatedTransaction e ) { exceptionThrown = true ; } "<AssertPlaceHolder>" ; } commit ( ) { connection . commit ( ) ; }
org . junit . Assert . assertFalse ( exceptionThrown )
testExampleConfigurationLeavesExistingFileAlone ( ) { final java . io . File existingFile = tempDir . newFile ( ) ; final com . sap . hana . cloud . samples . jenkins . common . ConfigurationFileManager subject = getTestJenkinsConfiguration ( ) ; subject . initConfiguration ( ) ; "<AssertPlaceHolder>" ; } initConfiguration ( ) { if ( new java . io . File ( rootDirectoryAsFile , com . sap . hana . cloud . samples . jenkins . common . ConfigurationFileManager . MARKER_FILE_NAME ) . exists ( ) ) { return ; } restoreConfiguration ( ) ; }
org . junit . Assert . assertTrue ( existingFile . exists ( ) )
testCalculateTagName_not_initial_release2_Major_rule ( ) { org . bsc . maven . reporting . renderer . GitLogJiraIssuesRenderer renderer = org . bsc . maven . reporting . renderer . GitLogJiraIssuesRendererTest . createRendererWithParams ( "12.1.1" , org . bsc . maven . reporting . renderer . CURRENT_MAJOR_VERSION ) ; java . lang . String result = org . bsc . maven . reporting . renderer . GitLogJiraIssuesRendererTest . calculateSinceTagName ( renderer ) ; "<AssertPlaceHolder>" ; } calculateSinceTagName ( org . bsc . maven . reporting . renderer . GitLogJiraIssuesRenderer ) { java . util . List < java . lang . String > list = asList ( "10.0.0" , "10.1.9" , "11.0.0" , "11.0.1" , "11.1.10" , "12.0.0" ) ; renderer . overrideGitLogSinceTagNameIfNeeded ( list ) ; return renderer . getGitLogSinceTagName ( ) ; }
org . junit . Assert . assertEquals ( "11.1.10" , result )
testNeighborMacAddress ( ) { isisNeighbor . setNeighborMacAddress ( macAddress ) ; result3 = isisNeighbor . neighborMacAddress ( ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
org . junit . Assert . assertThat ( result3 , org . hamcrest . CoreMatchers . is ( macAddress ) )
testCombinedCommand ( ) { java . lang . String grammar = "lexer<sp>grammar<sp>L;\n" + ( "I<sp>:<sp>\'0\'..\'9\'+<sp>{System.out.println(\"I\");}<sp>;\n" + "HASH<sp>:<sp>'#'<sp>-><sp>type(100),<sp>skip,<sp>more<sp>;" ) ; java . lang . String found = execLexer ( "L.g4" , grammar , "L" , "34#11" ) ; java . lang . String expecting = "I\n" + ( ( ( "I\n" + "[@0,0:1=\'34\',<1>,1:0]\n" ) + "[@1,2:4=\'#11\',<1>,1:2]\n" ) + "[@1,2:4=\'#11\',<1>,1:2]\n" 0 ) ; "<AssertPlaceHolder>" ; } execLexer ( java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { return execLexer ( grammarFileName , grammarStr , lexerName , input , false ) ; }
org . junit . Assert . assertEquals ( expecting , found )
testVoerStapUit ( ) { final nl . bzk . brp . levering . afnemerindicaties . service . OnderhoudAfnemerindicatiesResultaat resultaat = new nl . bzk . brp . levering . afnemerindicaties . service . OnderhoudAfnemerindicatiesResultaat ( new java . util . ArrayList < nl . bzk . brp . model . validatie . Melding > ( ) ) ; final boolean stapResultaat = voorbereidVerwerkingStap . voerStapUit ( null , context , resultaat ) ; "<AssertPlaceHolder>" ; } voerStapUit ( nl . bzk . brp . model . basis . BrpObject , nl . bzk . brp . business . stappen . StappenContext , nl . bzk . brp . business . stappen . StappenResultaat ) { verwerkingsResultaat = new nl . bzk . brp . webservice . business . stappen . BerichtVerwerkingsResultaatImpl ( ) ; valideer ( onderwerp , verwerkingsResultaat ) ; return true ; }
org . junit . Assert . assertTrue ( stapResultaat )
testEasyrecDataModel_getMinPreference ( ) { org . apache . mahout . cf . taste . model . DataModel easyrecDataModel = new org . easyrec . mahout . model . EasyrecDataModel ( org . easyrec . mahout . EasyrecInMemoryDataModelTest . TENANT_ID , org . easyrec . mahout . EasyrecInMemoryDataModelTest . RATE_ACTION_TYPE_ID , org . easyrec . mahout . EasyrecInMemoryDataModelTest . HAS_RATING_VALUES , mahoutDataModelMappingDAO ) ; easyrecDataModel = new org . easyrec . mahout . model . EasyrecInMemoryDataModel ( easyrecDataModel ) ; java . lang . Float minPreference = easyrecDataModel . getMinPreference ( ) ; "<AssertPlaceHolder>" ; } getMinPreference ( ) { return mahoutDataModelMappingDAO . getMinPreference ( tenantId , cutoffDate , actionTypeId ) ; }
org . junit . Assert . assertEquals ( new java . lang . Float ( 0 ) , minPreference )
testInputRepartition ( ) { java . util . Map < java . lang . String , java . lang . Object > configMap = com . google . common . collect . Maps . newHashMap ( ) ; configMap . put ( ( ( ( DataStep . INPUT_TYPE ) + "." ) + ( com . cloudera . labs . envelope . input . InputFactory . TYPE_CONFIG_NAME ) ) , com . cloudera . labs . envelope . run . DummyInput . class . getName ( ) ) ; configMap . put ( ( ( ( DataStep . INPUT_TYPE ) + "." ) + "starting.partitions" ) , 5 ) ; configMap . put ( BatchStep . REPARTITION_NUM_PARTITIONS_PROPERTY , 10 ) ; com . typesafe . config . Config config = com . typesafe . config . ConfigFactory . parseMap ( configMap ) ; com . cloudera . labs . envelope . run . BatchStep batchStep = new com . cloudera . labs . envelope . run . BatchStep ( "test" ) ; batchStep . configure ( config ) ; batchStep . submit ( com . google . common . collect . Sets . < com . cloudera . labs . envelope . run . Step > newHashSet ( ) ) ; org . apache . spark . sql . Dataset < org . apache . spark . sql . Row > df = batchStep . getData ( ) ; int numPartitions = df . javaRDD ( ) . getNumPartitions ( ) ; "<AssertPlaceHolder>" ; } getData ( ) { return data ; }
org . junit . Assert . assertEquals ( numPartitions , 10 )
testRulesSize ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( 3 , rules . size ( ) )
testGetInstance_returnsInstance ( ) { org . eclipse . rap . fileupload . internal . FileUploadHandlerStore instance = org . eclipse . rap . fileupload . internal . FileUploadHandlerStore . getInstance ( ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { return getUniqueInstance ( org . eclipse . rap . fileupload . internal . FileUploadHandlerStore . class , org . eclipse . rap . rwt . RWT . getApplicationContext ( ) ) ; }
org . junit . Assert . assertNotNull ( instance )
isActive_shouldReturnFalseIfStartDateIsAfterAsOfDate ( ) { org . openmrs . CohortMembership newMember = new org . openmrs . CohortMembership ( 4 ) ; java . text . SimpleDateFormat dateFormat = new java . text . SimpleDateFormat ( "yyyy-MM-dd<sp>HH:mm:ss" ) ; java . util . Date startDate = dateFormat . parse ( "2017-01-01<sp>00:00:00" ) ; newMember . setStartDate ( startDate ) ; java . util . Date dateToTest = dateFormat . parse ( "2016-12-01<sp>00:00:00" ) ; "<AssertPlaceHolder>" ; } isActive ( java . util . Date ) { java . util . Date date = ( asOfDate == null ) ? new java . util . Date ( ) : asOfDate ; return ( ( ! ( this . getVoided ( ) ) ) && ( ( org . openmrs . util . OpenmrsUtil . compare ( startDate , date ) ) <= 0 ) ) && ( ( org . openmrs . util . OpenmrsUtil . compareWithNullAsLatest ( date , endDate ) ) <= 0 ) ; }
org . junit . Assert . assertFalse ( newMember . isActive ( dateToTest ) )
testGetTasksAssignedAsTaskStakeholderWithUserLangOneTask ( ) { java . lang . String str = "(with<sp>(new<sp>Task())<sp>{<sp>priority<sp>=<sp>55,<sp>taskData<sp>=<sp>(with(<sp>new<sp>TaskData())<sp>{<sp>}<sp>),<sp>" ; str += "peopleAssignments<sp>=<sp>(with<sp>(<sp>new<sp>PeopleAssignments()<sp>)<sp>{<sp>taskStakeholders<sp>=<sp>[new<sp>User('Bobba<sp>Fet')],businessAdministrators<sp>=<sp>[<sp>new<sp>User('Administrator')<sp>],<sp>})," ; str += "name<sp>=<sp>'This<sp>is<sp>my<sp>task<sp>name'<sp>})" ; org . kie . api . task . model . Task task = org . jbpm . services . task . impl . factories . TaskFactory . evalTask ( new java . io . StringReader ( str ) ) ; taskService . addTask ( task , new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ) ; java . util . List < org . kie . api . task . model . TaskSummary > tasks = taskService . getTasksAssignedAsTaskStakeholder ( "Bobba<sp>Fet" ) ; "<AssertPlaceHolder>" ; } size ( ) { return data . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , tasks . size ( ) )
testGetTest1 ( ) { io . vertx . core . MultiMap mmap = newMultiMap ( ) ; java . lang . CharSequence name = java . lang . String . valueOf ( new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } get ( int ) { switch ( id ) { case 1 : return headerTableSize ; case 2 : return pushEnabled ? 1L : 0L ; case 3 : return maxConcurrentStreams ; case 4 : return ( ( long ) ( initialWindowSize ) ) ; case 5 : return ( ( long ) ( maxFrameSize ) ) ; case 6 : return ( ( long ) ( maxHeaderListSize ) ) ; default : return ( extraSettings ) != null ? extraSettings . get ( id ) : null ; } }
org . junit . Assert . assertNull ( mmap . get ( name ) )
testGetParameters ( ) { java . lang . String name = "AssetStateN" ; org . lnu . is . domain . asset . state . AssetState entity = new org . lnu . is . domain . asset . state . AssetState ( ) ; entity . setName ( name ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "name" , name ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; expected . put ( "userGroups" , groups ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; }
org . junit . Assert . assertEquals ( expected , actual )
testAvg ( ) { java . lang . String sqlText = java . lang . String . format ( ( "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 6 + ( "avg(salary)<sp>over<sp>(Partition<sp>by<sp>dept<sp>ORDER<sp>BY<sp>salary)<sp>as<sp>avgsal<sp>" + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" ) ) , this . getTableReference ( com . splicemachine . derby . impl . sql . execute . operations . WindowFunctionIT . EMPTAB ) , useSpark ) ; java . sql . ResultSet rs = com . splicemachine . derby . impl . sql . execute . operations . WindowFunctionIT . methodWatcher . executeQuery ( sqlText ) ; java . lang . String expected = "EMPNUM<sp>|DEPT<sp>|SALARY<sp>|AVGSAL<sp>|\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "------------------------------\n" + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 1 ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 0 ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 4 ) + "<sp>90<sp>|<sp>2<sp>|<sp>51000<sp>|<sp>51000<sp>|\n" 0 ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 5 ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 8 ) + "<sp>110<sp>|<sp>1<sp>|<sp>53000<sp>|<sp>51750<sp>|\n" ) + "<sp>40<sp>|<sp>2<sp>|<sp>52000<sp>|<sp>51666<sp>|\n" ) + "<sp>44<sp>|<sp>2<sp>|<sp>52000<sp>|<sp>51666<sp>|\n" ) + "<sp>49<sp>|<sp>2<sp>|<sp>53000<sp>|<sp>52000<sp>|\n" ) + "<sp>90<sp>|<sp>2<sp>|<sp>51000<sp>|<sp>51000<sp>|\n" ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 7 ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 3 ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 2 ) + "<sp>120<sp>|<sp>3<sp>|<sp>75000<sp>|<sp>65000<sp>|" ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; }
org . junit . Assert . assertEquals ( ( ( "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 9 + sqlText ) + "from<sp>%s<sp>--SPLICE-PROPERTIES<sp>useSpark<sp>=<sp>%s<sp>\n<sp>order<sp>by<sp>dept,<sp>empnum" 9 ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) )
testEOFInSet ( ) { org . antlr . v4 . tool . Grammar g = new org . antlr . v4 . tool . Grammar ( ( "parser<sp>grammar<sp>T;\n" + "a<sp>:<sp>(A|EOF)<sp>;" ) ) ; java . lang . String expecting = "max<sp>type<sp>1\n" + ( ( ( ( ( ( ( ( ( "max<sp>type<sp>1\n" 2 + "1:RULE_STOP<sp>0\n" ) + "2:BASIC<sp>0\n" ) + "3:BASIC<sp>0\n" ) + "4:BASIC<sp>0\n" ) + "max<sp>type<sp>1\n" 0 ) + "max<sp>type<sp>1\n" 1 ) + "0->2<sp>EPSILON<sp>0,0,0\n" ) + "2->3<sp>SET<sp>0,0,0\n" ) + "3->1<sp>EPSILON<sp>0,0,0\n" ) ; org . antlr . v4 . runtime . atn . ATN atn = createATN ( g , true ) ; java . lang . String result = org . antlr . v4 . runtime . atn . ATNSerializer . getDecoded ( atn , java . util . Arrays . asList ( g . getTokenNames ( ) ) ) ; "<AssertPlaceHolder>" ; } getTokenNames ( ) { return org . antlr . v4 . runtime . tree . xpath . XPathLexer . tokenNames ; }
org . junit . Assert . assertEquals ( expecting , result )
testGetSpeakUrl ( ) { java . lang . String text = "Hello<sp>World!" ; com . memetix . mst . language . SpokenDialect language = com . memetix . mst . language . SpokenDialect . ENGLISH_INDIA ; java . lang . String expResult = "http://api.microsofttranslator.com/V2/http.svc/Speak" ; java . lang . String result = com . memetix . mst . speak . Speak . execute ( text , language ) ; "<AssertPlaceHolder>" ; } execute ( java . lang . String , com . memetix . mst . language . SpokenDialect ) { com . memetix . mst . speak . Speak . validateServiceState ( text ) ; final java . net . URL url = new java . net . URL ( ( ( ( ( ( ( com . memetix . mst . speak . Speak . SERVICE_URL ) + ( ( apiKey ) != null ? ( PARAM_APP_ID ) + ( java . net . URLEncoder . encode ( apiKey , com . memetix . mst . speak . ENCODING ) ) : "" ) ) + ( PARAM_SPOKEN_LANGUAGE ) ) + ( java . net . URLEncoder . encode ( language . toString ( ) , com . memetix . mst . speak . ENCODING ) ) ) + ( PARAM_TEXT_SINGLE ) ) + ( java . net . URLEncoder . encode ( text , com . memetix . mst . speak . ENCODING ) ) ) ) ; final java . lang . String response = retrieveString ( url ) ; return response ; }
org . junit . Assert . assertEquals ( true , result . contains ( expResult ) )
noMatchWithCaptureOK ( ) { org . kaazing . k3po . driver . internal . behavior . handler . codec . MessageDecoder decoder = new org . kaazing . k3po . driver . internal . behavior . handler . codec . ReadByteArrayBytesDecoder ( 3 , environment , "var" ) ; org . jboss . netty . buffer . ChannelBuffer remainingBuffer = decoder . decode ( copiedBuffer ( new byte [ ] { 1 , 2 } ) ) ; "<AssertPlaceHolder>" ; javax . el . ValueExpression expression = expressionFactory . createValueExpression ( environment , "${var}" , byte [ ] . class ) ; thrown . expect ( javax . el . PropertyNotFoundException . class ) ; expression . getValue ( environment ) ; }
org . junit . Assert . assertNull ( remainingBuffer )
testWriteBoolean ( ) { org . omg . CORBA . portable . OutputStream oStream = org . apache . cxf . binding . corba . runtime . CorbaObjectWriterTest . orb . create_output_stream ( ) ; org . apache . cxf . binding . corba . runtime . CorbaObjectWriter writer = new org . apache . cxf . binding . corba . runtime . CorbaObjectWriter ( oStream ) ; java . lang . Boolean boolValue = Boolean . TRUE ; writer . writeBoolean ( boolValue ) ; org . omg . CORBA . portable . InputStream iStream = oStream . create_input_stream ( ) ; boolean b = iStream . read_boolean ( ) ; "<AssertPlaceHolder>" ; } writeBoolean ( java . lang . Boolean ) { if ( b == null ) { stream . write_boolean ( false ) ; } else { stream . write_boolean ( b . booleanValue ( ) ) ; } }
org . junit . Assert . assertTrue ( ( b == ( boolValue . booleanValue ( ) ) ) )
containsKeyReturnsFalseOnNonexistentKey ( ) { com . thinkaurelius . titan . diskstorage . StaticBuffer key1 = com . thinkaurelius . titan . diskstorage . KeyColumnValueStoreUtil . longToByteBuffer ( 1 ) ; "<AssertPlaceHolder>" ; } containsKey ( com . thinkaurelius . titan . diskstorage . keycolumnvalue . KeyColumnValueStore , com . thinkaurelius . titan . diskstorage . StaticBuffer , com . thinkaurelius . titan . diskstorage . keycolumnvalue . StoreTransaction ) { return com . thinkaurelius . titan . diskstorage . keycolumnvalue . KCVSUtil . containsKey ( store , key , 32 , txh ) ; }
org . junit . Assert . assertFalse ( com . thinkaurelius . titan . diskstorage . KCVSUtil . containsKey ( store , key1 , tx ) )
test_DCONST0_DRETURN ( ) { final com . igormaznitsa . jjjvm . impl . JJJVMClassImpl test = prepareTestClass ( new com . igormaznitsa . jjjvm . utils . TestProviderImpl ( ) , Type . DOUBLE , new com . igormaznitsa . jjjvm . DCONST ( 0.0 ) , new com . igormaznitsa . jjjvm . DRETURN ( ) ) ; "<AssertPlaceHolder>" ; } executeTestMethod ( com . igormaznitsa . jjjvm . model . JJJVMClass , java . lang . Class , java . lang . Object [ ] , java . lang . Object [ ] ) { final com . igormaznitsa . jjjvm . model . JJJVMObject obj = clazz . newInstance ( true ) ; final com . igormaznitsa . jjjvm . utils . Type bceltype ; if ( type == ( com . igormaznitsa . jjjvm . utils . Integer . class ) ) { bceltype = Type . INT ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Byte . class ) ) { bceltype = Type . BYTE ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Short . class ) ) { bceltype = Type . SHORT ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Character . class ) ) { bceltype = Type . CHAR ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Long . class ) ) { bceltype = Type . LONG ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Float . class ) ) { bceltype = Type . FLOAT ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Double . class ) ) { bceltype = Type . DOUBLE ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Boolean . class ) ) { bceltype = Type . BOOLEAN ; } else { bceltype = com . igormaznitsa . jjjvm . utils . Type . getType ( type ) ; } final com . igormaznitsa . jjjvm . model . JJJVMMethod method = clazz . findDeclaredMethod ( "test" , ( ( ( "(" + ( bceltype . getSignature ( ) ) ) + ")" ) + ( bceltype . getSignature ( ) ) ) ) ; org . junit . Assert . assertNotNull ( "Method<sp>not<sp>found" , method ) ; java . lang . Object result = com . igormaznitsa . jjjvm . JJJVMInterpreter . invoke ( clazz , obj , method , args , stack , null ) ; if ( type == ( com . igormaznitsa . jjjvm . utils . Byte . class ) ) { result = ( ( java . lang . Integer ) ( result ) ) . byteValue ( ) ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Short . class ) ) { result = ( ( java . lang . Integer ) ( result ) ) . shortValue ( ) ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Character . class ) ) { result = ( ( char ) ( ( ( java . lang . Integer ) ( result ) ) . shortValue ( ) ) ) ; } else if ( type == ( com . igormaznitsa . jjjvm . utils . Boolean . class ) ) { result = ( ( ( java . lang . Integer ) ( result ) ) . byteValue ( ) ) != 0 ; } return type . cast ( result ) ; }
org . junit . Assert . assertEquals ( 0.0 , executeTestMethod ( test , com . igormaznitsa . jjjvm . Double . class , null , 0.0 ) , 0.0 )
testHasTestMethodKeywordEmptyChildrenListOfModifiers ( ) { com . sonar . sslr . api . AstNode parentNode = mock ( com . sonar . sslr . api . AstNode . class ) ; java . util . List < com . sonar . sslr . api . AstNode > modifiers = new java . util . LinkedList ( ) ; com . sonar . sslr . api . AstNode modifier = mock ( com . sonar . sslr . api . AstNode . class ) ; when ( modifier . getChildren ( ) ) . thenReturn ( new java . util . LinkedList ( ) ) ; modifiers . add ( modifier ) ; when ( parentNode . getChildren ( ) ) . thenReturn ( modifiers ) ; "<AssertPlaceHolder>" ; } hasTestMethodKeyword ( com . sonar . sslr . api . AstNode ) { boolean hasAnnotation = false ; java . util . List < com . sonar . sslr . api . AstNode > modifiersChildren = astNode . getChildren ( org . fundacionjala . enforce . sonarqube . apex . utils . MODIFIERS ) ; for ( com . sonar . sslr . api . AstNode modifier : modifiersChildren ) { for ( com . sonar . sslr . api . AstNode modifierChild : modifier . getChildren ( ) ) { if ( modifierChild . getTokenOriginalValue ( ) . matches ( org . fundacionjala . enforce . sonarqube . apex . utils . MethodChecksUtils . TEST_METHOD_PATTERN ) ) { hasAnnotation = true ; break ; } } } return hasAnnotation ; }
org . junit . Assert . assertFalse ( org . fundacionjala . enforce . sonarqube . apex . utils . MethodChecksUtils . hasTestMethodKeyword ( parentNode ) )
testGetPropertyElements ( ) { org . dom4j . Element e = elementLoader . getBeanElement ( "test6" ) ; java . util . List < org . dom4j . Element > elements = parser . getPropertyElements ( e ) ; "<AssertPlaceHolder>" ; } getPropertyElements ( org . dom4j . Element ) { java . util . List < org . dom4j . Element > children = element . elements ( ) ; java . util . List < org . dom4j . Element > result = new java . util . ArrayList < org . dom4j . Element > ( ) ; for ( org . dom4j . Element e : children ) { if ( "property" . equals ( e . getName ( ) ) ) { result . add ( e ) ; } } return result ; }
org . junit . Assert . assertEquals ( elements . size ( ) , 2 )
checkHandlesMoveColumnsToWithEmptyMetadata ( ) { final org . drools . workbench . screens . guided . dtable . client . widget . table . model . synchronizers . impl . MetaDataColumnSynchronizer synchronizer = new org . drools . workbench . screens . guided . dtable . client . widget . table . model . synchronizers . impl . MetaDataColumnSynchronizer ( ) ; "<AssertPlaceHolder>" ; } handlesMoveColumnsTo ( java . util . List ) { return isBRLFragment ( metaData ) ; }
org . junit . Assert . assertFalse ( synchronizer . handlesMoveColumnsTo ( java . util . Collections . emptyList ( ) ) )
testQueueInfoPrinting ( ) { org . apache . hadoop . mapred . JobQueueInfo root = new org . apache . hadoop . mapred . JobQueueInfo ( "q1" , "q1<sp>scheduling<sp>info" ) ; java . util . List < org . apache . hadoop . mapred . JobQueueInfo > children = new java . util . ArrayList < org . apache . hadoop . mapred . JobQueueInfo > ( ) ; children . add ( new org . apache . hadoop . mapred . JobQueueInfo ( "q1:1" , null ) ) ; children . add ( new org . apache . hadoop . mapred . JobQueueInfo ( "q1:2" , null ) ) ; root . setChildren ( children ) ; org . apache . hadoop . mapred . JobQueueClient client = new org . apache . hadoop . mapred . JobQueueClient ( new org . apache . hadoop . mapred . JobConf ( ) ) ; java . io . StringWriter writer = new java . io . StringWriter ( ) ; client . printJobQueueInfo ( root , writer ) ; java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; sb . append ( "Queue<sp>Name<sp>:<sp>q1<sp>\n" ) ; sb . append ( "Queue<sp>State<sp>:<sp>running<sp>\n" ) ; sb . append ( "Scheduling<sp>Info<sp>:<sp>q1<sp>scheduling<sp>info<sp>\n" ) ; sb . append ( "Child<sp>Queues<sp>:<sp>q1:1,<sp>q1:2\n" ) ; sb . append ( "======================\n" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( "packet<sp>seqno:" + ( this . seqno ) ) + "<sp>offsetInBlock:" ) + ( this . offsetInBlock ) ) + "<sp>lastPacketInBlock:" ) + ( this . lastPacketInBlock ) ) + "<sp>lastByteOffsetInBlock:<sp>" ) + ( this . getLastByteOffsetBlock ( ) ) ; }
org . junit . Assert . assertEquals ( sb . toString ( ) , writer . toString ( ) )
testIntValueParsingNegativeHexa ( ) { net . sourceforge . pmd . lang . java . ast . ASTLiteral literal = new net . sourceforge . pmd . lang . java . ast . ASTLiteral ( 1 ) ; literal . setIntLiteral ( ) ; literal . setImage ( "-0X0000_000f" ) ; literal . testingOnlySetBeginColumn ( 1 ) ; literal . testingOnlySetEndColumn ( 7 ) ; "<AssertPlaceHolder>" ; } getValueAsInt ( ) { if ( isInt ) { return ( ( int ) ( getValueAsLong ( ) ) ) ; } return 0 ; }
org . junit . Assert . assertEquals ( ( - 15 ) , literal . getValueAsInt ( ) )
testSerde ( ) { final java . util . List < org . apache . druid . server . coordinator . rules . Rule > rules = java . util . Collections . singletonList ( testRule ) ; final java . lang . String json = org . apache . druid . server . coordinator . rules . BroadcastDistributionRuleSerdeTest . MAPPER . writeValueAsString ( rules ) ; final java . util . List < org . apache . druid . server . coordinator . rules . Rule > fromJson = org . apache . druid . server . coordinator . rules . BroadcastDistributionRuleSerdeTest . MAPPER . readValue ( json , new com . fasterxml . jackson . core . type . TypeReference < java . util . List < org . apache . druid . server . coordinator . rules . Rule > > ( ) { } ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( rules , fromJson )
average ( ) { final java . lang . String sparql = "SELECT<sp>(avg(?price)<sp>as<sp>?averagePrice)<sp>{<sp>" + ( "?item<sp><urn:price><sp>?price<sp>.<sp>" + "}" ) ; final org . eclipse . rdf4j . model . ValueFactory vf = org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) ; final java . util . Collection < org . eclipse . rdf4j . model . Statement > statements = com . google . common . collect . Sets . newHashSet ( vf . createStatement ( vf . createIRI ( "urn:apple" ) , vf . createIRI ( "urn:price" ) , vf . createLiteral ( 3 ) ) , vf . createStatement ( vf . createIRI ( "urn:gum" ) , vf . createIRI ( "urn:price" ) , vf . createLiteral ( 4 ) ) , vf . createStatement ( vf . createIRI ( "urn:sandwich" ) , vf . createIRI ( "urn:price" ) , vf . createLiteral ( 8 ) ) ) ; final java . lang . String pcjId = loadDataAndCreateQuery ( sparql , statements ) ; final org . eclipse . rdf4j . query . impl . MapBindingSet expectedResult = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; expectedResult . addBinding ( "averagePrice" , vf . createLiteral ( "5" , XMLSchema . DECIMAL ) ) ; final org . apache . rya . api . model . VisibilityBindingSet result = readLastResult ( pcjId ) ; "<AssertPlaceHolder>" ; } readLastResult ( java . lang . String ) { requireNonNull ( pcjId ) ; org . apache . rya . api . model . VisibilityBindingSet result = null ; try ( final org . apache . kafka . clients . consumer . KafkaConsumer < java . lang . String , org . apache . rya . api . model . VisibilityBindingSet > consumer = makeConsumer ( pcjId ) ) { final org . apache . kafka . clients . consumer . ConsumerRecords < java . lang . String , org . apache . rya . api . model . VisibilityBindingSet > records = consumer . poll ( 5000 ) ; final java . util . Iterator < org . apache . kafka . clients . consumer . ConsumerRecord < java . lang . String , org . apache . rya . api . model . VisibilityBindingSet > > recordIterator = records . iterator ( ) ; while ( recordIterator . hasNext ( ) ) { result = recordIterator . next ( ) . value ( ) ; } } return result ; }
org . junit . Assert . assertEquals ( expectedResult , result )
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 . CTCollection > ctCollections = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( ctCollections . isEmpty ( ) )
testGenerateGUID ( ) { for ( int i = 0 ; i < 1000 ; ++ i ) { "<AssertPlaceHolder>" ; } } generateGuid ( ) { byte [ ] encodedBytes = org . mozilla . apache . commons . codec . binary . Base64 . encodeBase64 ( org . mozilla . gecko . sync . Utils . generateRandomBytes ( 9 ) , false ) ; return new java . lang . String ( encodedBytes ) . replace ( "+" , "-" ) . replace ( "/" , "_" ) ; }
org . junit . Assert . assertEquals ( 12 , org . mozilla . gecko . sync . Utils . generateGuid ( ) . length ( ) )
testCassandraRowAtLeastOnceSink ( ) { org . apache . flink . streaming . connectors . cassandra . CassandraRowSink sink = new org . apache . flink . streaming . connectors . cassandra . CassandraRowSink ( org . apache . flink . streaming . connectors . cassandra . CassandraConnectorITCase . FIELD_TYPES . length , injectTableName ( org . apache . flink . streaming . connectors . cassandra . CassandraConnectorITCase . INSERT_DATA_QUERY ) , org . apache . flink . streaming . connectors . cassandra . CassandraConnectorITCase . builder ) ; try { sink . open ( new org . apache . flink . configuration . Configuration ( ) ) ; for ( org . apache . flink . types . Row value : org . apache . flink . streaming . connectors . cassandra . CassandraConnectorITCase . rowCollection ) { sink . send ( value ) ; } } finally { sink . close ( ) ; } com . datastax . driver . core . ResultSet rs = org . apache . flink . streaming . connectors . cassandra . CassandraConnectorITCase . session . execute ( injectTableName ( org . apache . flink . streaming . connectors . cassandra . CassandraConnectorITCase . SELECT_DATA_QUERY ) ) ; "<AssertPlaceHolder>" ; } all ( ) { return new com . twitter . chill . java . IterableRegistrar ( com . twitter . chill . java . ArraysAsListSerializer . registrar ( ) , com . twitter . chill . java . BitSetSerializer . registrar ( ) , org . apache . flink . runtime . types . PriorityQueueSerializer . registrar ( ) , com . twitter . chill . java . RegexSerializer . registrar ( ) , com . twitter . chill . java . SqlDateSerializer . registrar ( ) , com . twitter . chill . java . SqlTimeSerializer . registrar ( ) , com . twitter . chill . java . TimestampSerializer . registrar ( ) , com . twitter . chill . java . URISerializer . registrar ( ) , com . twitter . chill . java . InetSocketAddressSerializer . registrar ( ) , com . twitter . chill . java . UUIDSerializer . registrar ( ) , com . twitter . chill . java . LocaleSerializer . registrar ( ) , com . twitter . chill . java . SimpleDateFormatSerializer . registrar ( ) ) ; }
org . junit . Assert . assertEquals ( 20 , rs . all ( ) . size ( ) )
canConvertBetweenFieldNameAndOID ( ) { final java . lang . String ecrfFieldName = "cat.fldName" ; final java . lang . String OID = com . hartwig . hmftools . common . ecrf . reader . OIDFunctions . toOID ( ecrfFieldName ) ; "<AssertPlaceHolder>" ; } toEcrfFieldName ( java . lang . String ) { final java . lang . String [ ] fields = OID . split ( ( "\\" + ( com . hartwig . hmftools . common . ecrf . reader . OIDFunctions . OID_SEPARATOR ) ) ) ; final java . lang . String name = fields [ ( ( fields . length ) - 1 ) ] ; if ( ( fields . length ) == 2 ) { return ( ( com . hartwig . hmftools . common . ecrf . reader . OIDFunctions . NO_CATEGORY ) + ( com . hartwig . hmftools . common . ecrf . reader . OIDFunctions . OID_SEPARATOR ) ) + name ; } else { assert ( fields . length ) == 3 ; return ( ( fields [ 1 ] ) + ( com . hartwig . hmftools . common . ecrf . reader . OIDFunctions . OID_SEPARATOR ) ) + name ; } }
org . junit . Assert . assertEquals ( ecrfFieldName , com . hartwig . hmftools . common . ecrf . reader . OIDFunctions . toEcrfFieldName ( OID ) )
validVersionDefaultShouldNotCreateViolations ( ) { java . util . Set < javax . validation . ConstraintViolation < org . alien4cloud . tosca . model . definitions . PropertyDefinition > > violations = validator . validate ( createDefinitions ( ToscaTypes . VERSION , "1.3.15" ) ) ; "<AssertPlaceHolder>" ; } createDefinitions ( java . lang . String , org . alien4cloud . tosca . model . definitions . PropertyConstraint ) { org . alien4cloud . tosca . model . definitions . PropertyDefinition propertyDefinition = new org . alien4cloud . tosca . model . definitions . PropertyDefinition ( ) ; propertyDefinition . setType ( propertyType ) ; propertyDefinition . setConstraints ( com . google . common . collect . Lists . newArrayList ( constraint ) ) ; return propertyDefinition ; }
org . junit . Assert . assertEquals ( 0 , violations . size ( ) )
testMemPipelineWithGenericRecord ( ) { org . apache . crunch . types . PType < org . apache . avro . generic . GenericData . Record > ptype = org . apache . crunch . types . avro . Avros . generics ( Person . SCHEMA . ) ; org . apache . avro . generic . GenericData . Record writeRecord = createGenericRecord ( "John<sp>Doe" ) ; final org . apache . crunch . PCollection < org . apache . avro . generic . GenericData . Record > writeCollection = org . apache . crunch . impl . mem . MemPipeline . typedCollectionOf ( ptype , writeRecord ) ; writeCollection . write ( org . apache . crunch . io . To . avroFile ( avroFile . getAbsolutePath ( ) ) ) ; org . apache . crunch . PCollection < org . apache . avro . generic . GenericData . Record > readCollection = org . apache . crunch . impl . mem . MemPipeline . getInstance ( ) . read ( org . apache . crunch . io . At . avroFile ( avroFile . getAbsolutePath ( ) , org . apache . crunch . types . avro . Avros . generics ( writeRecord . getSchema ( ) ) ) ) ; org . apache . avro . generic . GenericData . Record readRecord = readCollection . materialize ( ) . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } next ( ) { org . apache . crunch . impl . spark . ByteArray nextKey = null ; java . util . List < byte [ ] > next = null ; while ( iter . hasNext ( ) ) { scala . Tuple2 < org . apache . crunch . impl . spark . ByteArray , java . util . List < byte [ ] > > t = iter . next ( ) ; if ( ( key ) == null ) { key = t . _1 ( ) ; bytes . addAll ( t . _2 ( ) ) ; } else if ( ( cmp . compare ( key . value , 0 , key . value . length , t . _1 ( ) . value , 0 , t . _1 ( ) . value . length ) ) == 0 ) { bytes . addAll ( t . _2 ( ) ) ; } else { nextKey = t . _1 ( ) ; next = com . google . common . collect . Lists . newArrayList ( t . _2 ( ) ) ; break ; } } scala . Tuple2 < org . apache . crunch . impl . spark . ByteArray , java . util . List < byte [ ] > > ret = new scala . Tuple2 < org . apache . crunch . impl . spark . ByteArray , java . util . List < byte [ ] > > ( key , bytes ) ; key = nextKey ; bytes = next ; return ret ; }
org . junit . Assert . assertEquals ( writeRecord , readRecord )
test_get_rowlistdata ( ) { "<AssertPlaceHolder>" ; } getData ( ) { org . jacorb . test . orb . value . RowListData ret = new org . jacorb . test . orb . value . RowListDataImpl ( ) ; org . jacorb . test . orb . value . ColumnData [ ] cols = new org . jacorb . test . orb . value . ColumnDataImpl [ 2 ] ; ret . columns = cols ; for ( int i = 0 ; i < 2 ; i ++ ) { cols [ i ] = createColumnData ( ) ; } return ret ; }
org . junit . Assert . assertNotNull ( server . getData ( ) )
shouldRejectTypeIfIdIsSet ( ) { lb = new org . openstack . atlas . api . validation . validators . LoadBalancer ( ) ; org . openstack . atlas . api . validation . validators . VirtualIp vipper = new org . openstack . atlas . api . validation . validators . VirtualIp ( ) ; vipper . setId ( 23 ) ; vipper . setType ( VipType . SERVICENET ) ; lb . getVirtualIps ( ) . add ( vipper ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( lb , org . openstack . atlas . api . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; }
org . junit . Assert . assertFalse ( result . passedValidation ( ) )
salernoBolognaDistanceTest ( ) { org . geosdi . geoplatform . support . google . services . DistanceMatrix distanceMatrix = this . gpDistanceMatrixService . getDistanceMatrix ( new java . lang . String [ ] { "Salerno" } , new java . lang . String [ ] { "Bologna" } ) . mode ( TravelMode . DRIVING ) . language ( "it" ) . await ( ) ; "<AssertPlaceHolder>" ; org . geosdi . geoplatform . support . google . services . DistanceMatrixRow distanceMatrixRow = distanceMatrix . rows [ 0 ] ; for ( org . geosdi . geoplatform . support . google . services . DistanceMatrixElement element : distanceMatrixRow . elements ) { org . geosdi . geoplatform . support . google . services . GPDistanceMatrixServiceTest . logger . info ( "######################Salerno<sp>-<sp>Bologna<sp>:<sp>KM<sp>:<sp>{}<sp>-<sp>Duration<sp>:<sp>{}<sp>-<sp>Fare<sp>:<sp>{}\n" , element . distance , element . duration , element . fare ) ; } } getDistanceMatrix ( java . lang . String [ ] , java . lang . String [ ] ) { return com . google . maps . DistanceMatrixApi . getDistanceMatrix ( this . geoApiContext , origins , destinations ) ; }
org . junit . Assert . assertNotNull ( distanceMatrix )
testHandleTimerErrorDuringDeletion ( ) { createServiceInstance ( ProvisioningStatus . WAITING_FOR_SYSTEM_DELETION ) ; org . oscm . app . v2_0 . exceptions . APPlatformException e = new org . oscm . app . v2_0 . exceptions . APPlatformException ( "error" ) ; when ( controller . getInstanceStatus ( matches ( "appInstanceId" ) , any ( org . oscm . app . v2_0 . data . ProvisioningSettings . class ) ) ) . thenThrow ( e ) ; org . oscm . vo . VOUserDetails admin = new org . oscm . vo . VOUserDetails ( ) ; admin . setEMail ( "sss" ) ; doReturn ( java . util . Arrays . asList ( admin ) ) . when ( besDAOMock ) . getBESTechnologyManagers ( any ( org . oscm . app . domain . ServiceInstance . class ) ) ; handleTimer ( ) ; "<AssertPlaceHolder>" ; verify ( mailService ) . sendMail ( anyListOf ( java . lang . String . class ) , anyString ( ) , anyString ( ) ) ; } getServiceInstance ( ) { return serviceInstance ; }
org . junit . Assert . assertNull ( getServiceInstance ( ) )
testGetIntegerNullValue ( ) { org . finra . herd . core . ArgumentParser argParser = new org . finra . herd . core . ArgumentParser ( "" ) ; org . apache . commons . cli . Option option = argParser . addArgument ( "a" , "some_required_parameter" , false , "Some<sp>required<sp>parameter<sp>with<sp>an<sp>argument" , false ) ; argParser . parseArguments ( new java . lang . String [ ] { } ) ; java . lang . Integer value = argParser . getIntegerValue ( option , null , 0 , 100 ) ; "<AssertPlaceHolder>" ; } getIntegerValue ( org . apache . commons . cli . Option , java . lang . Integer , java . lang . Integer , java . lang . Integer ) { java . lang . Integer answer = getIntegerValue ( option , defaultValue ) ; if ( answer != null ) { org . springframework . util . Assert . isTrue ( ( ( answer . compareTo ( minValue ) ) >= 0 ) , java . lang . String . format ( "The<sp>%s<sp>option<sp>value<sp>%d<sp>is<sp>less<sp>than<sp>the<sp>minimum<sp>allowed<sp>value<sp>of<sp>%d." , option . getLongOpt ( ) , answer , minValue ) ) ; org . springframework . util . Assert . isTrue ( ( ( answer . compareTo ( maxValue ) ) <= 0 ) , java . lang . String . format ( "The<sp>%s<sp>option<sp>value<sp>%d<sp>is<sp>bigger<sp>than<sp>maximum<sp>allowed<sp>value<sp>of<sp>%d." , option . getLongOpt ( ) , answer , maxValue ) ) ; } return answer ; }
org . junit . Assert . assertNull ( value )
stringToStatementPattern ( ) { final java . lang . String patternString = ( "x:::" + ( prependConstant ( "http://worksAt<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::" ) ) ) + ( prependConstant ( "http://Chipotle<<~>>http://www.w3.org/2001/XMLSchema#anyURI" ) ) ; final org . eclipse . rdf4j . query . algebra . StatementPattern statementPattern = org . apache . rya . indexing . pcj . fluo . app . FluoStringConverter . toStatementPattern ( patternString ) ; final org . eclipse . rdf4j . query . algebra . Var subject = new org . eclipse . rdf4j . query . algebra . Var ( "x" ) ; final org . eclipse . rdf4j . query . algebra . Var predicate = new org . eclipse . rdf4j . query . algebra . Var ( prependConstant ( "http://worksAt" ) , org . apache . rya . indexing . pcj . fluo . app . FluoStringConverterTest . VF . createIRI ( "http://worksAt" ) ) ; predicate . setConstant ( true ) ; final org . eclipse . rdf4j . query . algebra . Var object = new org . eclipse . rdf4j . query . algebra . Var ( prependConstant ( "http://Chipotle" ) , org . apache . rya . indexing . pcj . fluo . app . FluoStringConverterTest . VF . createIRI ( "http://Chipotle" ) ) ; object . setConstant ( true ) ; final org . eclipse . rdf4j . query . algebra . StatementPattern expected = new org . eclipse . rdf4j . query . algebra . StatementPattern ( subject , predicate , object ) ; "<AssertPlaceHolder>" ; } prependConstant ( java . lang . String ) { if ( value != null ) { return ( org . apache . rya . api . domain . VarNameUtils . CONSTANT_PREFIX ) + value ; } return null ; }
org . junit . Assert . assertEquals ( expected , statementPattern )
testGetHeavyElements_IMolecularFormula ( ) { org . openscience . cdk . interfaces . IMolecularFormula formula = new org . openscience . cdk . formula . MolecularFormula ( ) ; formula . addIsotope ( org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IIsotope . class , "C" ) , 10 ) ; formula . addIsotope ( org . openscience . cdk . tools . manipulator . MolecularFormulaManipulatorTest . builder . newInstance ( org . openscience . cdk . interfaces . IIsotope . class , "H" ) , 16 ) ; "<AssertPlaceHolder>" ; } getHeavyElements ( org . openscience . cdk . interfaces . IMolecularFormula ) { java . util . List < org . openscience . cdk . interfaces . IElement > newEle = new java . util . ArrayList < org . openscience . cdk . interfaces . IElement > ( ) ; for ( org . openscience . cdk . interfaces . IElement element : org . openscience . cdk . tools . manipulator . MolecularFormulaManipulator . elements ( formula ) ) { if ( ! ( element . getSymbol ( ) . equals ( "H" ) ) ) { newEle . add ( element ) ; } } return newEle ; }
org . junit . Assert . assertEquals ( 1 , org . openscience . cdk . tools . manipulator . MolecularFormulaManipulator . getHeavyElements ( formula ) . size ( ) )
shouldReturnFalseWhenTheEntityIsOutOfArea ( ) { boolean didRuleSucceed = rule . apply ( new org . ei . drishti . util . SafeMap ( mapOf ( "isOutOfArea" , "true" ) ) ) ; "<AssertPlaceHolder>" ; } mapOf ( Key , Value ) { java . util . HashMap < Key , Value > normalMap = new java . util . HashMap ( ) ; normalMap . put ( key , value ) ; return normalMap ; }
org . junit . Assert . assertFalse ( didRuleSucceed )
testModifySubclass2 ( ) { java . lang . String drl = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "import<sp>" + ( org . drools . compiler . integrationtests . PolymorphismTest . A . class . getCanonicalName ( ) ) ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 5 ) + "import<sp>" ) + ( org . drools . compiler . integrationtests . PolymorphismTest . B . class . getCanonicalName ( ) ) ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 5 ) + "import<sp>" ) + ( org . drools . compiler . integrationtests . PolymorphismTest . C . class . getCanonicalName ( ) ) ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 5 ) + "import<sp>" ) + ( org . drools . compiler . integrationtests . PolymorphismTest . D . class . getCanonicalName ( ) ) ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 5 ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 8 ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 7 ) + "<sp>$a:<sp>D(id<sp>==<sp>0)\n" ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 0 ) + "then\n" ) + "<sp>modify($d)<sp>{<sp>setId($id+1)<sp>};\n" ) + "end\n" ) + "rule<sp>Rc<sp>when\n" ) + "rule<sp>Rb<sp>when\n" 0 ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 4 ) + "then\n" ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" ) + "end\n" ) + "rule<sp>Rb<sp>when\n" ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 1 ) + "<sp>$b:<sp>A($id<sp>:<sp>id<sp>==<sp>2)\n" ) + "then\n" ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 2 ) + "end\n" ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 6 ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 3 ) + "then\n" ) + "<sp>delete($a);\n" ) + "<sp>modify($c)<sp>{<sp>setId($id+1)<sp>};\n" 9 ; org . kie . api . runtime . KieSession ksession = new org . kie . internal . utils . KieHelper ( ) . addContent ( drl , ResourceType . DRL ) . build ( EventProcessingOption . STREAM ) . newKieSession ( ) ; org . kie . api . runtime . rule . FactHandle fh = ksession . insert ( new org . drools . compiler . integrationtests . PolymorphismTest . D ( 0 ) ) ; ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; System . out . println ( fh ) ; } getObjects ( ) { return null ; }
org . junit . Assert . assertEquals ( 0 , ksession . getObjects ( ) . size ( ) )
testObjectDetection ( ) { java . lang . String folderName = "target/output/" ; java . lang . String fileName = ( ( folderName + "townshoes-objects" ) + ( java . lang . Math . random ( ) ) ) + ".png" ; try { com . crawljax . plugins . testcasegenerator . visualdiff . ObjectDetection . directoryCheck ( folderName ) ; org . opencv . imgcodecs . Imgcodecs . imwrite ( fileName , detection . getAnnotated ( ) ) ; java . io . File created = new java . io . File ( fileName ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } exists ( ) { return new com . crawljax . test . matchers . FileMatcher ( ) ; }
org . junit . Assert . assertTrue ( created . exists ( ) )
writeProperty_null_value ( ) { java . io . StringWriter sw = new java . io . StringWriter ( ) ; ezvcard . io . json . JCardRawWriter writer = new ezvcard . io . json . JCardRawWriter ( sw , false ) ; writer . writeStartVCard ( ) ; writer . writeProperty ( "prop" , VCardDataType . TEXT , ezvcard . io . json . JCardValue . single ( null ) ) ; writer . close ( ) ; java . lang . String actual = sw . toString ( ) ; java . lang . String expected = "[\"vcard\"," + ( ( ( "[" + "[\"prop\",{},\"text\",null]" ) + "]" ) + "]" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return value ; }
org . junit . Assert . assertEquals ( expected , actual )
testFromEbXML ( ) { transformer . toEbXML ( query , ebXML ) ; org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetFolderAndContentsQuery result = new org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetFolderAndContentsQuery ( ) ; transformer . fromEbXML ( result , ebXML ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetAllQuery , org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLAdhocQueryRequest ) { if ( ( query == null ) || ( ebXML == null ) ) { return ; } org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper slots = new org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper ( ebXML ) ; java . lang . String patientId = slots . toString ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . PATIENT_ID ) ; query . setPatientId ( org . openehealth . ipf . commons . ihe . xds . core . metadata . Hl7v2Based . parse ( patientId , org . openehealth . ipf . commons . ihe . xds . core . metadata . Identifiable . class ) ) ; query . setStatusDocuments ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_STATUS ) ) ; query . setStatusFolders ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . FOLDER_STATUS ) ) ; query . setStatusSubmissionSets ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . SUBMISSION_SET_STATUS ) ) ; query . setConfidentialityCodes ( slots . toCodeQueryList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE , org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE_SCHEME ) ) ; query . setFormatCodes ( slots . toCodeList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_FORMAT_CODE ) ) ; query . setHomeCommunityId ( ebXML . getHome ( ) ) ; query . setDocumentEntryTypes ( slots . toDocumentEntryType ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_TYPE ) ) ; }
org . junit . Assert . assertEquals ( query , result )
bigDecimals ( ) { com . querydsl . core . types . dsl . NumberPath < java . math . BigDecimal > a = com . querydsl . core . types . dsl . Expressions . numberPath ( java . math . BigDecimal . class , "cost" ) ; java . util . List < java . math . BigDecimal > nums = com . querydsl . collections . CollQueryFactory . from ( a , new java . math . BigDecimal ( "2.1" ) , new java . math . BigDecimal ( "20.21" ) , new java . math . BigDecimal ( "44.4" ) ) . where ( a . lt ( new java . math . BigDecimal ( "35.1" ) ) ) . select ( a ) . fetch ( ) ; "<AssertPlaceHolder>" ; } fetch ( ) { return innerList ( ) ; }
org . junit . Assert . assertEquals ( java . util . Arrays . asList ( new java . math . BigDecimal ( "2.1" ) , new java . math . BigDecimal ( "20.21" ) ) , nums )
nameShouldBeAssigned ( ) { com . graphhopper . jsprit . core . problem . job . Service s = Service . Builder . newInstance ( "s" ) . setLocation ( com . graphhopper . jsprit . core . problem . Location . newInstance ( "loc" ) ) . setName ( "name" ) . build ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return null ; }
org . junit . Assert . assertEquals ( "name" , s . getName ( ) )
whenInsertPairsInBookThenTheyAddInAnyBasket ( ) { ru . szhernovoy . map . PhoneBook < java . lang . String , java . lang . String > tinyBook = new ru . szhernovoy . map . PhoneBook ( ) ; boolean result = tinyBook . insert ( "89053758569" , "Julia" ) ; tinyBook . insert ( "89053758569" , "Julia" ) ; tinyBook . insert ( "89053758569" , "Julia" ) ; tinyBook . insert ( "89053758569" , "Julia" ) ; "<AssertPlaceHolder>" ; } insert ( T , V ) { if ( ( ( ( this . table . length ) == 0 ) || ( ( this . table ) == null ) ) || ( ( size ) > ( ( this . table . length ) - 1 ) ) ) { this . table = this . resize ( ) ; } return ( addValue ( hash ( key ) , key , value ) ) == null ; }
org . junit . Assert . assertThat ( true , org . hamcrest . core . Is . is ( result ) )
getLinkTypeEN10MB ( ) { "<AssertPlaceHolder>" ; } getLinkType ( long ) { switch ( ( ( int ) ( linkTypeVal ) ) ) { case 0 : return net . ripe . hadoop . pcap . PcapReader . LinkType . NULL ; case 1 : return net . ripe . hadoop . pcap . PcapReader . LinkType . EN10MB ; case 101 : return net . ripe . hadoop . pcap . PcapReader . LinkType . RAW ; case 108 : return net . ripe . hadoop . pcap . PcapReader . LinkType . LOOP ; case 113 : return net . ripe . hadoop . pcap . PcapReader . LinkType . LINUX_SLL ; } return null ; }
org . junit . Assert . assertEquals ( PcapReader . LinkType . EN10MB , reader . getLinkType ( 1 ) )
testMetaCharsetUpdateCleanup ( ) { final org . jsoup . nodes . Document doc = createHtmlDocument ( "dontTouch" ) ; doc . updateMetaCharsetElement ( true ) ; doc . charset ( java . nio . charset . Charset . forName ( org . jsoup . nodes . DocumentTest . charsetUtf8 ) ) ; final java . lang . String htmlCharsetUTF8 = ( ( ( ( ( "<html>\n" + ( "<sp><head>\n" + "<sp><meta<sp>charset=\"" ) ) + ( org . jsoup . nodes . DocumentTest . charsetUtf8 ) ) + "\">\n" ) + "<sp></head>\n" ) + "<sp><body></body>\n" ) + "</html>" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . String repst = "OP_INSTANCE:\n" ; repst += ( ( ( ( ( ( this . getOperationApplied ( ) ) + ":(" ) + ( this . original . getClass ( ) . getCanonicalName ( ) ) ) + ")<sp>`" ) + ( fr . inria . astor . util . StringUtil . trunc ( this . original ) ) ) + "<sp>`<sp>-topatch--><sp>`" ) + ( fr . inria . astor . util . StringUtil . trunc ( modified ) ) ; repst += ( "`<sp>(" + ( ( this . modified ) != null ? this . modified . getClass ( ) . getCanonicalName ( ) : "null" ) ) + ")<sp>" ; return repst ; }
org . junit . Assert . assertEquals ( htmlCharsetUTF8 , doc . toString ( ) )
testReadByteArray2 ( ) { byte [ ] readBytes = com . predic8 . membrane . core . util . ByteUtil . readByteArray ( in2 , com . predic8 . membrane . core . util . ByteUtilTest . message2 . length ( ) ) ; "<AssertPlaceHolder>" ; } readByteArray ( java . io . InputStream , int ) { if ( length < 0 ) return com . predic8 . membrane . core . util . ByteUtil . getByteArrayData ( in ) ; byte [ ] content = new byte [ length ] ; int offset = 0 ; int count = 0 ; while ( ( offset < length ) && ( ( count = in . read ( content , offset , ( length - offset ) ) ) >= 0 ) ) { offset += count ; } return content ; }
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( readBytes , com . predic8 . membrane . core . util . ByteUtilTest . message2 . getBytes ( ) ) )
testGetSetBaseUri ( ) { java . lang . String expectedBaseUri = "testBaseUri" ; com . microsoft . windowsazure . services . media . models . LocatorInfo locatorInfo = new com . microsoft . windowsazure . services . media . models . LocatorInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . LocatorRestType ( ) . setBaseUri ( expectedBaseUri ) ) ; java . lang . String actualBaseUri = locatorInfo . getBaseUri ( ) ; "<AssertPlaceHolder>" ; } getBaseUri ( ) { return this . baseUri ; }
org . junit . Assert . assertEquals ( expectedBaseUri , actualBaseUri )
testCreateMessageFormatExceptionFillsMessageFromMCauseessageParamToString ( ) { javax . jms . JMSException result = org . apache . qpid . jms . exceptions . JmsExceptionSupport . createMessageFormatException ( NO_MESSAGE_CAUSE ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( "JmsConnectionConsumer<sp>{<sp>id=" + ( consumerInfo . getId ( ) ) ) + "<sp>}" ; }
org . junit . Assert . assertEquals ( NO_MESSAGE_CAUSE . toString ( ) , result . getMessage ( ) )
testSearchFileNotFound ( ) { org . junit . Assume . assumeTrue ( session . getClient ( ) . existsAndIsAccessible ( testPathPrefix . getAbsolute ( ) ) ) ; final java . lang . String emptyDirectoryName = new ch . cyberduck . core . AlphanumericRandomStringService ( ) . random ( ) ; final ch . cyberduck . core . Path emptyDirectory = new ch . cyberduck . core . Path ( testPathPrefix , emptyDirectoryName , java . util . EnumSet . of ( AbstractPath . Type . directory ) ) ; new ch . cyberduck . core . manta . MantaDirectoryFeature ( session ) . mkdir ( emptyDirectory , null , null ) ; final ch . cyberduck . core . manta . MantaSearchFeature s = new ch . cyberduck . core . manta . MantaSearchFeature ( session ) ; final ch . cyberduck . core . AttributedList < ch . cyberduck . core . Path > search = s . search ( emptyDirectory , new ch . cyberduck . core . NullFilter ( ) , new ch . cyberduck . core . DisabledListProgressListener ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( size ( ) ) == 0 ; }
org . junit . Assert . assertTrue ( search . isEmpty ( ) )
REG_MULTI_SZ_getData ( ) { final byte [ ] data = new byte [ ] { '?' , 0 , 0 , 0 } ; final com . rapid7 . client . dcerpc . msrrp . dto . RegistryValue value = new com . rapid7 . client . dcerpc . msrrp . dto . RegistryValue ( "test" , com . rapid7 . client . dcerpc . msrrp . dto . RegistryValueType . REG_MULTI_SZ , data ) ; "<AssertPlaceHolder>" ; } getData ( ) { return data ; }
org . junit . Assert . assertArrayEquals ( data , value . getData ( ) )
equalToSelf ( ) { com . googlecode . javaewah . EWAHCompressedBitmap ewahBitmap = com . googlecode . javaewah . EWAHCompressedBitmap . bitmapOf ( 0 , 2 , 55 , 64 , ( 1 << 30 ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( o instanceof com . googlecode . javaewah . EWAHCompressedBitmap ) { try { this . xorToContainer ( ( ( com . googlecode . javaewah . EWAHCompressedBitmap ) ( o ) ) , new com . googlecode . javaewah . NonEmptyVirtualStorage ( ) ) ; return true ; } catch ( com . googlecode . javaewah . NonEmptyVirtualStorage e ) { return false ; } } return false ; }
org . junit . Assert . assertTrue ( ewahBitmap . equals ( ewahBitmap ) )
shouldReturnFalseIfCallerHasDelegationPermissionButNotSimilarRestriction ( ) { when ( sessionContext . isCallerInRole ( ch . puzzle . itc . mobiliar . business . security . control . PermissionServiceTest . CONFIG_ADMIN ) ) . thenReturn ( true ) ; when ( sessionContext . getCallerPrincipal ( ) ) . thenReturn ( principal ) ; ch . puzzle . itc . mobiliar . business . security . control . RestrictionEntity res = new ch . puzzle . itc . mobiliar . business . security . control . RestrictionEntity ( ) ; res . setAction ( Action . ALL ) ; ch . puzzle . itc . mobiliar . business . security . control . PermissionEntity perm = new ch . puzzle . itc . mobiliar . business . security . control . PermissionEntity ( ) ; perm . setValue ( Permission . PERMISSION_DELEGATION . name ( ) ) ; res . setPermission ( perm ) ; myRoles = new ch . puzzle . itc . mobiliar . business . security . control . HashMap ( ) ; permissionService . rolesWithRestrictions = myRoles ; when ( permissionRepository . getUserWithRestrictions ( anyString ( ) ) ) . thenReturn ( ch . puzzle . itc . mobiliar . business . security . control . Arrays . asList ( res ) ) ; boolean result = permissionService . hasPermissionToDelegatePermission ( Permission . RESOURCE_PROPERTY_DECRYPT , null , null , null , Action . CREATE ) ; "<AssertPlaceHolder>" ; } hasPermissionToDelegatePermission ( ch . puzzle . itc . mobiliar . business . security . control . Permission , ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceGroupEntity , ch . puzzle . itc . mobiliar . business . resourcegroup . entity . ResourceTypeEntity , ch . puzzle . itc . mobiliar . business . environment . entity . ContextEntity , ch . puzzle . itc . mobiliar . business . security . control . Action ) { if ( hasPermission ( Permission . PERMISSION_DELEGATION ) ) { if ( ( ( context != null ) && ( action != null ) ) && ( ( resourceGroup != null ) || ( resourceType != null ) ) ) { return hasPermission ( permission , context , action , resourceGroup , resourceType ) ; } else { ch . puzzle . itc . mobiliar . business . security . control . List < ch . puzzle . itc . mobiliar . business . security . control . RestrictionEntity > callerRestrictions = getAllCallerRestrictions ( ) ; for ( ch . puzzle . itc . mobiliar . business . security . control . RestrictionEntity restriction : callerRestrictions ) { if ( restriction . getPermission ( ) . getValue ( ) . equals ( permission . name ( ) ) ) { int score = 0 ; if ( hasPermissionForContextOrForParent ( restriction , context ) ) { ++ score ; } if ( ( restriction . getAction ( ) . equals ( Action . ALL ) ) || ( restriction . getAction ( ) . equals ( action ) ) ) { ++ score ; } if ( ( ( restriction . getResourceGroup ( ) ) == null ) || ( restriction . getResourceGroup ( ) . equals ( resourceGroup ) ) ) { ++ score ; } if ( ( ( restriction . getResourceType ( ) ) == null ) || ( restriction . getResourceType ( ) . equals ( resourceType ) ) ) { ++ score ; } if ( score == 4 ) { return true ; } } } } } return false ; }
org . junit . Assert . assertFalse ( result )
testExceptionInValidateDuringUnBindDoesNotThrow ( ) { org . glassfish . hk2 . api . ServiceLocator locator = org . glassfish . hk2 . tests . locator . utilities . LocatorHelper . getServiceLocator ( org . glassfish . hk2 . tests . locator . negative . validation . ValidationServiceImpl . class ) ; org . glassfish . hk2 . tests . locator . negative . validation . ValidationServiceImpl vsi = locator . getService ( org . glassfish . hk2 . tests . locator . negative . validation . ValidationServiceImpl . class ) ; org . glassfish . hk2 . api . ActiveDescriptor < ? > disposeMe = org . glassfish . hk2 . utilities . ServiceLocatorUtilities . addClasses ( locator , org . glassfish . hk2 . tests . locator . negative . validation . SimpleService . class ) . get ( 0 ) ; vsi . setThrowFromValidate ( true ) ; try { org . glassfish . hk2 . utilities . ServiceLocatorUtilities . removeOneDescriptor ( locator , disposeMe ) ; org . junit . Assert . fail ( "Should<sp>have<sp>failed<sp>with<sp>MultiException" ) ; } catch ( org . glassfish . hk2 . api . MultiException me ) { } catch ( java . lang . Throwable th ) { if ( th instanceof java . lang . RuntimeException ) { throw ( ( java . lang . RuntimeException ) ( th ) ) ; } throw new java . lang . RuntimeException ( th ) ; } vsi . setThrowFromValidate ( false ) ; org . glassfish . hk2 . tests . locator . negative . validation . SimpleService ss = locator . getService ( org . glassfish . hk2 . tests . locator . negative . validation . SimpleService . class ) ; "<AssertPlaceHolder>" ; } getService ( org . glassfish . hk2 . api . ServiceHandle ) { if ( ( root ) instanceof org . jvnet . hk2 . internal . Closeable ) { org . jvnet . hk2 . internal . Closeable closeable = ( ( org . jvnet . hk2 . internal . Closeable ) ( root ) ) ; if ( closeable . isClosed ( ) ) { throw new java . lang . IllegalStateException ( ( "This<sp>service<sp>has<sp>been<sp>unbound:<sp>" + ( root ) ) ) ; } } synchronized ( lock ) { if ( serviceDestroyed ) throw new java . lang . IllegalStateException ( "Service<sp>has<sp>been<sp>disposed" ) ; if ( serviceSet ) return service ; org . glassfish . hk2 . api . Injectee injectee = getLastInjectee ( ) ; java . lang . Class < ? > requiredClass = ( injectee == null ) ? null : org . glassfish . hk2 . utilities . reflection . ReflectionHelper . getRawClass ( injectee . getRequiredType ( ) ) ; service = org . jvnet . hk2 . internal . Utilities . createService ( root , injectee , locator , handle , requiredClass ) ; serviceSet = true ; return service ; } }
org . junit . Assert . assertNotNull ( ss )
testWriteToWriter ( ) { ConnectionsRegistry . INSTANCE . setDataSourceStatus ( "dataSource" , "userName" , 0 ) ; ConnectionsRegistry . INSTANCE . setSocketAddressStatus ( "localhost" , 6666 , ( - 1 ) ) ; java . io . StringWriter sw = new java . io . StringWriter ( ) ; ConnectionsRegistry . INSTANCE . writeTo ( sw ) ; java . lang . String persistedConnectionsRegistry = sw . getBuffer ( ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { copyToDelegate ( ) ; long start = java . lang . System . currentTimeMillis ( ) ; try { return delegate . toString ( ) ; } finally { logSocket ( ( ( java . lang . System . currentTimeMillis ( ) ) - start ) ) ; copyFromDelegate ( ) ; } }
org . junit . Assert . assertNotNull ( persistedConnectionsRegistry )
testSetMetricsScopeDuringCheckpointing ( ) { software . amazon . kinesis . checkpoint . ShardRecordProcessorCheckpointer processingCheckpointer = new software . amazon . kinesis . checkpoint . ShardRecordProcessorCheckpointer ( shardInfo , checkpoint ) ; software . amazon . kinesis . retrieval . kpl . ExtendedSequenceNumber sequenceNumber = new software . amazon . kinesis . retrieval . kpl . ExtendedSequenceNumber ( "5019" ) ; processingCheckpointer . largestPermittedCheckpointValue ( sequenceNumber ) ; processingCheckpointer . checkpoint ( ) ; "<AssertPlaceHolder>" ; } getCheckpoint ( java . lang . String ) { software . amazon . kinesis . retrieval . kpl . ExtendedSequenceNumber checkpoint = flushpoints . get ( shardId ) ; log . debug ( "checkpoint<sp>shardId:<sp>{}<sp>checkpoint:<sp>{}" , shardId , checkpoint ) ; return checkpoint ; }
org . junit . Assert . assertThat ( checkpoint . getCheckpoint ( shardId ) , org . hamcrest . Matchers . equalTo ( sequenceNumber ) )
testGetBody ( ) { "<AssertPlaceHolder>" ; } getBody ( ) { return body ; }
org . junit . Assert . assertEquals ( "test" , request . getBody ( ) )
setNameShouldNotSetEmptyName ( ) { java . lang . String name = "" ; entity = new ch . puzzle . itc . mobiliar . business . function . entity . AmwFunctionEntity ( ) ; entity . setName ( name ) ; "<AssertPlaceHolder>" ; } getName ( ) { return getEntity ( ) . getName ( ) ; }
org . junit . Assert . assertNull ( entity . getName ( ) )
testBytes ( ) { org . apache . avro . Schema . Type type = Schema . Type . BYTES ; org . apache . avro . Schema simple = org . apache . avro . SchemaBuilder . builder ( ) . bytesType ( ) ; org . apache . avro . Schema expected = primitive ( type , simple ) ; org . apache . avro . Schema built1 = org . apache . avro . SchemaBuilder . builder ( ) . bytesBuilder ( ) . prop ( "p" , "v" ) . endBytes ( ) ; "<AssertPlaceHolder>" ; } prop ( java . lang . String , java . lang . String ) { return prop ( name , com . fasterxml . jackson . databind . node . TextNode . valueOf ( val ) ) ; }
org . junit . Assert . assertEquals ( expected , built1 )
testCanCompleteWhenSomePageIsNotCompleted ( ) { when ( page1 . isCompleted ( ) ) . thenReturn ( true ) ; when ( page2 . isCompleted ( ) ) . thenReturn ( false ) ; wizard . addPage ( page1 ) ; wizard . addPage ( page2 ) ; "<AssertPlaceHolder>" ; } canComplete ( ) { for ( org . eclipse . che . ide . api . wizard . WizardPage < T > page : wizardPages ) { if ( ! ( page . isCompleted ( ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertEquals ( false , wizard . canComplete ( ) )
testCompletion1 ( ) { org . nd4j . parameterserver . distributed . logic . completion . FrameCompletionHandler handler = new org . nd4j . parameterserver . distributed . logic . completion . FrameCompletionHandler ( ) ; long [ ] frames = new long [ ] { 15L , 17L } ; long [ ] originators = new long [ ] { 123L , 183L } ; for ( java . lang . Long originator : originators ) { for ( java . lang . Long frame : frames ) { for ( int e = 1 ; e <= 512 ; e ++ ) { handler . addHook ( originator , frame , ( ( long ) ( e ) ) ) ; } } for ( java . lang . Long frame : frames ) { for ( int e = 1 ; e <= 512 ; e ++ ) { handler . notifyFrame ( originator , frame , ( ( long ) ( e ) ) ) ; } } } for ( java . lang . Long originator : originators ) { for ( java . lang . Long frame : frames ) { "<AssertPlaceHolder>" ; } } } isCompleted ( long , long ) { org . nd4j . parameterserver . distributed . logic . completion . RequestDescriptor descriptor = org . nd4j . parameterserver . distributed . logic . completion . RequestDescriptor . createDescriptor ( originatorId , frameId ) ; return isCompleted ( descriptor ) ; }
org . junit . Assert . assertEquals ( true , handler . isCompleted ( originator , frame ) )
testGetDataDefinitions ( ) { final org . opendaylight . yangtools . yang . model . api . Module moduleConfig = org . opendaylight . yangtools . yang . model . util . SchemaContextProxyTest . mockModule ( org . opendaylight . yangtools . yang . model . util . SchemaContextProxyTest . CONFIG_NAME ) ; final org . opendaylight . yangtools . yang . model . api . SchemaContext schemaContext = org . opendaylight . yangtools . yang . model . util . SchemaContextProxyTest . mockSchema ( moduleConfig ) ; final org . opendaylight . yangtools . yang . model . util . FilteringSchemaContextProxy filteringSchemaContextProxy = org . opendaylight . yangtools . yang . model . util . SchemaContextProxyTest . createProxySchemaCtx ( schemaContext , new java . util . HashSet ( ) , moduleConfig ) ; final org . opendaylight . yangtools . yang . model . api . ContainerSchemaNode mockedContainer = mock ( org . opendaylight . yangtools . yang . model . api . ContainerSchemaNode . class ) ; final java . util . Set < org . opendaylight . yangtools . yang . model . api . DataSchemaNode > childNodes = java . util . Collections . singleton ( mockedContainer ) ; doReturn ( childNodes ) . when ( moduleConfig ) . getChildNodes ( ) ; final java . util . Set < org . opendaylight . yangtools . yang . model . api . DataSchemaNode > dataDefinitions = filteringSchemaContextProxy . getDataDefinitions ( ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return delegate . contains ( o ) ; }
org . junit . Assert . assertTrue ( dataDefinitions . contains ( mockedContainer ) )
spaceContributorCanNotDeployProjectTest ( ) { final org . guvnor . common . services . project . model . WorkspaceProject project = getProject ( ) ; doReturn ( false ) . when ( libraryPermissions ) . userIsAtLeast ( eq ( ContributorType . ADMIN ) , any ( ) ) ; "<AssertPlaceHolder>" ; } userCanDeployProject ( org . guvnor . common . services . project . model . WorkspaceProject ) { return ( ( ( userIsAtLeast ( ContributorType . ADMIN , project . getRepository ( ) . getContributors ( ) ) ) || ( userIsAtLeast ( ContributorType . ADMIN , project . getOrganizationalUnit ( ) . getContributors ( ) ) ) ) || ( projectController . canBuildProject ( project ) ) ) && ( ( project . getMainModule ( ) ) != null ) ; }
org . junit . Assert . assertFalse ( libraryPermissions . userCanDeployProject ( project ) )
testSwapNullDoubleArray ( ) { final double [ ] array = null ; org . apache . commons . lang3 . ArrayUtils . swap ( array , 0 , 2 ) ; "<AssertPlaceHolder>" ; } swap ( java . lang . Object [ ] , int , int ) { if ( ( array == null ) || ( ( array . length ) == 0 ) ) { return ; } org . apache . commons . lang3 . ArrayUtils . swap ( array , offset1 , offset2 , 1 ) ; }
org . junit . Assert . assertNull ( array )
testGetLabelResource ( ) { System . out . println ( "getLabelResource" ) ; kg . apc . jmeter . vizualizers . ThroughputVsThreadsGui instance = new kg . apc . jmeter . vizualizers . ThroughputVsThreadsGui ( ) ; java . lang . String expResult = "ThroughputVsThreadsGui" ; java . lang . String result = instance . getLabelResource ( ) ; "<AssertPlaceHolder>" ; } getLabelResource ( ) { return this . getClass ( ) . getSimpleName ( ) ; }
org . junit . Assert . assertEquals ( expResult , result )
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . fragment . model . FragmentEntryLink > fragmentEntryLinks = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( fragmentEntryLinks . isEmpty ( ) )
testValidationExceptionNonNested ( ) { java . lang . Exception exIn = new org . eurekastreams . commons . exceptions . ValidationException ( ) ; java . lang . Exception exOut = coreForbidNestingExceptionTest ( exIn ) ; "<AssertPlaceHolder>" ; } coreForbidNestingExceptionTest ( java . lang . Exception ) { org . eurekastreams . server . persistence . mappers . cache . Transformer < java . lang . Exception , java . lang . Exception > sut = new org . eurekastreams . commons . server . ExceptionSanitizer ( ) ; java . lang . Exception outputException = sut . transform ( inputException ) ; org . junit . Assert . assertNull ( outputException . getCause ( ) ) ; return outputException ; }
org . junit . Assert . assertSame ( exIn , exOut )
testExceptionThrown ( ) { boolean thrown = false ; try { _timeBoundedExecuter . perform ( new com . verigreen . timeboundedexecuter . TestTimeBoundedExecuter . ExceptionThrowingPerformer ( ) , com . verigreen . timeboundedexecuter . TestTimeBoundedExecuter . LONG_TIMEOUT , new com . verigreen . common . concurrency . timeboundedexecuter . KeepWaitingPolicy < java . lang . Void > ( ) ) ; } catch ( java . lang . Exception e ) { thrown = true ; } "<AssertPlaceHolder>" ; } perform ( com . verigreen . common . utils . Action , long , com . verigreen . common . concurrency . timeboundedexecuter . TimeBoundedPolicy ) { return executeWorkInSeparateThread ( actionDelegate , timeBoundInMillis , policy ) ; }
org . junit . Assert . assertTrue ( thrown )
deleteBothTest ( ) { me . xiezefan . easyim . server . model . User friend1 = userDao . findById ( Contact . USER_ID2 ) ; me . xiezefan . easyim . server . model . Friendship friendship1 = new me . xiezefan . easyim . server . model . Friendship ( ) ; friendship1 . setId ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; friendship1 . setUserId ( Contact . USER_ID ) ; friendship1 . setFriend ( friend1 ) ; friendshipDao . insert ( friendship1 ) ; friendshipDao . deleteBoth ( Contact . USER_ID , Contact . USER_ID2 ) ; java . lang . Long count = friendshipDao . validateExist ( Contact . USER_ID , Contact . USER_ID2 ) ; "<AssertPlaceHolder>" ; } setFriend ( me . xiezefan . easyim . server . model . User ) { this . friend = friend ; }
org . junit . Assert . assertTrue ( ( count == 0 ) )
testSimpleBooking ( ) { java . lang . String hotelName = "Grand<sp>Hyatt" ; int bookingCount = selenium . getCount ( org . jboss . seam . examples . booking . ftest . BookingTest . COUNT_BOOKING ) ; bookHotel ( hotelName , org . jboss . seam . examples . booking . ftest . BookingTest . CreditCardType . VISA ) ; "<AssertPlaceHolder>" ; } bookHotel ( java . lang . String , org . jboss . seam . examples . booking . ftest . BookingTest$CreditCardType ) { if ( ! ( isLoggedIn ( ) ) ) { org . junit . Assert . fail ( ) ; } if ( ! ( selenium . isElementPresent ( org . jboss . seam . examples . booking . ftest . SEARCH_QUERY ) ) ) { selenium . open ( contextPath ) ; selenium . waitForPageToLoad ( ) ; selenium . click ( org . jboss . seam . examples . booking . ftest . MENU_FIND ) ; selenium . waitForPageToLoad ( ) ; } enterSearchQuery ( hotelName ) ; selenium . click ( org . jboss . seam . examples . booking . ftest . SEARCH_RESULT_TABLE_FIRST_ROW_LINK ) ; selenium . waitForPageToLoad ( ) ; selenium . click ( org . jboss . seam . examples . booking . ftest . BookingTest . BUTTON_BOOK ) ; selenium . waitForPageToLoad ( ) ; populateBookingFields ( creditCardType ) ; selenium . click ( org . jboss . seam . examples . booking . ftest . BookingTest . BUTTON_PROCEED ) ; selenium . waitForPageToLoad ( ) ; selenium . click ( org . jboss . seam . examples . booking . ftest . BookingTest . BUTTON_CONFIRM ) ; selenium . waitForPageToLoad ( ) ; org . junit . Assert . assertTrue ( "Booking<sp>failed." , selenium . isTextPresent ( org . jboss . seam . examples . booking . ftest . BookingTest . BOOKING_MESSAGE ) ) ; }
org . junit . Assert . assertEquals ( ( ++ bookingCount ) , selenium . getCount ( org . jboss . seam . examples . booking . ftest . BookingTest . COUNT_BOOKING ) )
test24updateRoles ( ) { setup ( ) ; java . util . Collection < java . lang . String > rolesList = new java . util . ArrayList < java . lang . String > ( ) ; rolesList . add ( "ROLE_USER" ) ; rolesList . add ( "ROLE_SYS_ADMIN" ) ; org . apache . ranger . entity . XXPortalUserRole XXPortalUserRole = new org . apache . ranger . entity . XXPortalUserRole ( ) ; XXPortalUserRole . setId ( org . apache . ranger . biz . TestUserMgr . userId ) ; XXPortalUserRole . setUserRole ( "ROLE_USER" ) ; java . util . List < org . apache . ranger . entity . XXPortalUserRole > list = new java . util . ArrayList < org . apache . ranger . entity . XXPortalUserRole > ( ) ; list . add ( XXPortalUserRole ) ; org . apache . ranger . db . XXPortalUserRoleDao userDao = org . mockito . Mockito . mock ( org . apache . ranger . db . XXPortalUserRoleDao . class ) ; org . mockito . Mockito . when ( daoManager . getXXPortalUserRole ( ) ) . thenReturn ( userDao ) ; org . mockito . Mockito . when ( userDao . findByUserId ( org . apache . ranger . biz . TestUserMgr . userId ) ) . thenReturn ( list ) ; boolean isFound = userMgr . updateRoles ( org . apache . ranger . biz . TestUserMgr . userId , rolesList ) ; "<AssertPlaceHolder>" ; } updateRoles ( java . lang . Long , java . util . Collection ) { boolean rolesUpdated = false ; if ( ( rolesList == null ) || ( ( rolesList . size ( ) ) == 0 ) ) { return false ; } java . util . List < java . lang . String > stringRolesList = new java . util . ArrayList < java . lang . String > ( ) ; for ( java . lang . String userRole : rolesList ) { if ( ! ( org . apache . ranger . biz . UserMgr . VALID_ROLE_LIST . contains ( userRole . toUpperCase ( ) ) ) ) { throw restErrorUtil . createRESTException ( "Invalid<sp>user<sp>role,<sp>please<sp>provide<sp>valid<sp>user<sp>role." , MessageEnums . INVALID_INPUT_DATA ) ; } stringRolesList . add ( userRole ) ; } xUserMgr . checkAccessRoles ( stringRolesList ) ; rangerBizUtil . blockAuditorRoleUser ( ) ; java . util . List < org . apache . ranger . entity . XXPortalUserRole > gjUserRoles = daoManager . getXXPortalUserRole ( ) . findByUserId ( userId ) ; for ( org . apache . ranger . entity . XXPortalUserRole gjUserRole : gjUserRoles ) { boolean found = false ; for ( java . lang . String userRole : rolesList ) { if ( gjUserRole . getUserRole ( ) . equalsIgnoreCase ( userRole ) ) { found = true ; break ; } } if ( ! found ) { if ( deleteUserRole ( userId , gjUserRole ) ) { rolesUpdated = true ; } } } for ( java . lang . String userRole : rolesList ) { boolean found = false ; for ( org . apache . ranger . entity . XXPortalUserRole gjUserRole : gjUserRoles ) { if ( gjUserRole . getUserRole ( ) . equalsIgnoreCase ( userRole ) ) { found = true ; break ; } } if ( ! found ) { if ( ( addUserRole ( userId , userRole ) ) != null ) { rolesUpdated = true ; } } } return rolesUpdated ; }
org . junit . Assert . assertFalse ( isFound )
testCombineInsertOnLeftWithReplace ( ) { org . antlr . tool . Grammar g = new org . antlr . tool . Grammar ( ( "lexer<sp>grammar<sp>t;\n" + ( ( "A<sp>:<sp>\'a\';\n" + "B<sp>:<sp>\'b\';\n" ) + "C<sp>:<sp>\'c\';\n" ) ) ) ; org . antlr . runtime . CharStream input = new org . antlr . runtime . ANTLRStringStream ( "abc" ) ; org . antlr . tool . Interpreter lexEngine = new org . antlr . tool . Interpreter ( g , input ) ; org . antlr . runtime . TokenRewriteStream tokens = new org . antlr . runtime . TokenRewriteStream ( lexEngine ) ; tokens . fill ( ) ; tokens . replace ( 0 , 2 , "foo" ) ; tokens . insertBefore ( 0 , "z" ) ; java . lang . String result = tokens . toString ( ) ; java . lang . String expecting = "zfoo" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( "[" + ( grammar . name ) ) + "." ) + ( name ) ) + ",index=" ) + ( index ) ) + ",line=" ) + ( tree . getToken ( ) . getLine ( ) ) ) + "]" ; }
org . junit . Assert . assertEquals ( expecting , result )
testCache ( ) { standardData ( ) ; cache . create ( ) ; org . geoserver . jdbcstore . internal . JDBCResourceStoreProperties config = getConfig ( true , false ) ; org . geoserver . platform . resource . ResourceStore fileStore = new org . geoserver . platform . resource . FileSystemResourceStore ( cache . getRoot ( ) ) ; org . geoserver . platform . resource . ResourceStore jdbcStore = new org . geoserver . jdbcstore . JDBCResourceStore ( support . getDataSource ( ) , config , fileStore ) ; ( ( org . geoserver . jdbcstore . JDBCResourceStore ) ( jdbcStore ) ) . setCache ( new org . geoserver . jdbcstore . cache . SimpleResourceCache ( cache . getRoot ( ) ) ) ; org . geoserver . platform . resource . Resource jdbcResource = jdbcStore . get ( "FileA" ) ; jdbcResource . file ( ) ; java . lang . Thread . sleep ( 2 ) ; byte [ ] expected = "FileA<sp>Updated<sp>Contents" . getBytes ( ) ; java . io . OutputStream out = jdbcResource . out ( ) ; try { out . write ( expected ) ; } finally { out . close ( ) ; } jdbcResource . file ( ) ; org . geoserver . platform . resource . Resource fileResource = fileStore . get ( "FileA" ) ; java . io . InputStream in = fileResource . in ( ) ; try { byte [ ] result = new byte [ expected . length ] ; in . read ( result ) ; "<AssertPlaceHolder>" ; } finally { in . close ( ) ; } } read ( org . opengis . parameter . GeneralParameterValue [ ] ) { return reader . read ( parameters ) ; }
org . junit . Assert . assertThat ( result , equalTo ( expected ) )
toStringWithNoErrorCode ( ) { org . digidoc4j . exceptions . DigiDoc4JException error = new org . digidoc4j . exceptions . DigiDoc4JException ( "Error" ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . String str = null ; try { str = new java . lang . String ( toXML ( ) , "UTF-8" ) ; } catch ( java . lang . Exception ex ) { } return str ; }
org . junit . Assert . assertEquals ( "Error" , error . toString ( ) )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . portal . kernel . model . LayoutVersion missingLayoutVersion = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingLayoutVersion )
testReportAvailability ( ) { System . out . println ( "ZZZ" ) ; final com . net2plan . interfaces . networkDesign . IReport report = new com . net2plan . examples . ocnbook . reports . Report_availability ( ) ; java . util . List < java . lang . String > ipOverWdmEvProcessorRecoveryTypes = java . util . Arrays . asList ( "static-lps-OSPF-rerouting" , "1+1-lps-OSPF-rerouting" , "provisioningAlgorithm_parameters" 8 ) ; for ( java . lang . String ipOverWdmEvProcessorRecoveryType : ipOverWdmEvProcessorRecoveryTypes ) { java . util . Map < java . lang . String , java . util . List < java . lang . String > > testingParameters = new java . util . HashMap ( ) ; final java . lang . String evProcClassRelativePath = "target/classes/com/net2plan/examples/general/onlineSim/Online_evProc_ipOverWdm.class" ; final java . lang . String evProcClassQualifiedName = "provisioningAlgorithm_parameters" 3 ; testingParameters . put ( "provisioningAlgorithm_file" , java . util . Arrays . asList ( evProcClassRelativePath ) ) ; testingParameters . put ( "provisioningAlgorithm_classname" , java . util . Arrays . asList ( evProcClassQualifiedName ) ) ; testingParameters . put ( "provisioningAlgorithm_parameters" , java . util . Arrays . asList ( com . net2plan . utils . StringUtils . mapToString ( provAlgorithmParam ) ) ) ; testingParameters . put ( "provisioningAlgorithm_parameters" 0 , java . util . Arrays . asList ( "false" ) ) ; testingParameters . put ( "provisioningAlgorithm_parameters" 1 , java . util . Arrays . asList ( "perBidirectionalLinkBundle" , "provisioningAlgorithm_parameters" 7 ) ) ; testingParameters . put ( "provisioningAlgorithm_parameters" 6 , java . util . Arrays . asList ( "provisioningAlgorithm_parameters" 4 ) ) ; java . util . List < java . util . Map < java . lang . String , java . lang . String > > testsParam = com . net2plan . utils . InputParameter . getCartesianProductOfParameters ( testingParameters ) ; if ( testsParam . isEmpty ( ) ) testsParam = java . util . Arrays . asList ( com . net2plan . utils . InputParameter . getDefaultParameters ( report . getParameters ( ) ) ) ; for ( java . util . Map < java . lang . String , java . lang . String > params : testsParam ) { java . util . Map < java . lang . String , java . lang . String > paramsUsedToCall = com . net2plan . utils . InputParameter . getDefaultParameters ( report . getParameters ( ) ) ; paramsUsedToCall . putAll ( params ) ; System . out . println ( params ) ; java . lang . String result = report . executeReport ( np , paramsUsedToCall , com . google . common . collect . ImmutableMap . of ( "provisioningAlgorithm_parameters" 5 , "0.0001" ) ) ; System . out . println ( "provisioningAlgorithm_parameters" 2 ) ; "<AssertPlaceHolder>" ; } } } of ( T , java . lang . String ) { return new com . net2plan . gui . utils . StringLabeller < T > ( object , label , true ) ; }
org . junit . Assert . assertTrue ( ( ( result . length ( ) ) > 100 ) )