input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testGetBillingErrorsListTrim ( ) { org . oscarehr . common . model . BillingONEAReport eaRpt = createReport ( 1 ) ; eaRpt . setClaimError ( "<sp>" ) ; eaRpt . setCodeError ( "<sp>error02<sp>" ) ; dao . persist ( eaRpt ) ; java . util . List < java . lang . String > eaReportErrors = dao . getBillingErrorList ( eaRpt . getBillingNo ( ) ) ; java . util . List < java . lang . String > expectedList = new java . util . ArrayList < java . lang . String > ( java . util . Arrays . asList ( "error02" ) ) ; "<AssertPlaceHolder>" ; } getBillingNo ( ) { return this . billingNo ; }
|
org . junit . Assert . assertEquals ( eaReportErrors , expectedList )
|
mustIgnoreMessagesComingInForActorsThatDontExist ( ) { fixture . store ( new com . offbynull . actors . shuttle . Message ( "actor:a:1:2:3" , "actor:b:2:3:4" , "payload" ) , new com . offbynull . actors . shuttle . Message ( "actor:a:1:2:3" , "actor:b:2:3:4" , "payload" ) , new com . offbynull . actors . shuttle . Message ( "actor:a:1:2:3" , "actor:b:2:3:4" , "payload" ) , new com . offbynull . actors . shuttle . Message ( "actor:a:1:2:3" , "actor:b:2:3:4" , "payload" ) ) ; "<AssertPlaceHolder>" ; } getStoredMessageCount ( ) { org . apache . commons . lang3 . Validate . validState ( ( ! ( closed ) ) , "Store<sp>closed" ) ; int ret = 0 ; for ( com . offbynull . actors . gateways . actor . stores . memory . MemoryStore . LockRegion lockRegion : lockRegions ) { synchronized ( lockRegion ) { ret += lockRegion . pendingMsgCount ; } } return ret ; }
|
org . junit . Assert . assertEquals ( 0 , fixture . getStoredMessageCount ( ) )
|
testBinsAccordingToPartitioner ( ) { final org . apache . nifi . controller . queue . clustered . partition . FlowFilePartitioner partitioner = new org . apache . nifi . controller . queue . clustered . TestSocketLoadBalancedFlowFileQueue . StaticFlowFilePartitioner ( 1 ) ; queue . setFlowFilePartitioner ( partitioner ) ; final org . apache . nifi . controller . queue . clustered . partition . QueuePartition desiredPartition = queue . getPartition ( 1 ) ; for ( int i = 0 ; i < 100 ; i ++ ) { final org . apache . nifi . controller . MockFlowFileRecord flowFile = new org . apache . nifi . controller . MockFlowFileRecord ( 0L ) ; final org . apache . nifi . controller . queue . clustered . partition . QueuePartition partition = queue . putAndGetPartition ( flowFile ) ; "<AssertPlaceHolder>" ; } } putAndGetPartition ( org . apache . nifi . controller . repository . FlowFileRecord ) { final org . apache . nifi . controller . queue . clustered . partition . QueuePartition partition ; partitionReadLock . lock ( ) ; try { adjustSize ( 1 , flowFile . getSize ( ) ) ; partition = getPartition ( flowFile ) ; partition . put ( flowFile ) ; } finally { partitionReadLock . unlock ( ) ; } eventListener . triggerDestinationEvent ( ) ; return partition ; }
|
org . junit . Assert . assertSame ( desiredPartition , partition )
|
testInvalidSpdyWindowUpdateFrameLength ( ) { short type = 9 ; byte flags = 0 ; int length = 12 ; int streamId = ( io . netty . handler . codec . spdy . SpdyFrameDecoderTest . RANDOM . nextInt ( ) ) & 2147483647 ; int deltaWindowSize = ( ( io . netty . handler . codec . spdy . SpdyFrameDecoderTest . RANDOM . nextInt ( ) ) & 2147483647 ) | 1 ; io . netty . buffer . ByteBuf buf = io . netty . buffer . Unpooled . buffer ( ( ( io . netty . handler . codec . spdy . SpdyCodecUtil . SPDY_HEADER_SIZE ) + length ) ) ; io . netty . handler . codec . spdy . SpdyFrameDecoderTest . encodeControlFrameHeader ( buf , type , flags , length ) ; buf . writeInt ( streamId ) ; buf . writeInt ( deltaWindowSize ) ; decoder . decode ( buf ) ; verify ( delegate ) . readFrameError ( anyString ( ) ) ; "<AssertPlaceHolder>" ; buf . release ( ) ; } isReadable ( ) { return ( writerIndex ) > ( readerIndex ) ; }
|
org . junit . Assert . assertFalse ( buf . isReadable ( ) )
|
testAllHMAC ( ) { final net . schmizz . sshj . DefaultConfig defaultConfig = new net . schmizz . sshj . DefaultConfig ( ) ; defaultConfig . setMACFactories ( new net . schmizz . sshj . transport . mac . HMACSHA2256 . Factory ( ) , new net . schmizz . sshj . transport . mac . HMACSHA2512 . Factory ( ) ) ; for ( net . schmizz . sshj . common . Factory . Named < net . schmizz . sshj . transport . mac . MAC > mac : defaultConfig . getMACFactories ( ) ) { final net . schmizz . sshj . DefaultConfig configuration = new net . schmizz . sshj . DefaultConfig ( ) ; configuration . setMACFactories ( java . util . Collections . singletonList ( mac ) ) ; final net . schmizz . sshj . SSHClient client = session . connect ( new ch . cyberduck . core . DisabledHostKeyCallback ( ) , configuration ) ; "<AssertPlaceHolder>" ; client . close ( ) ; } } isConnected ( ) { if ( super . isConnected ( ) ) { return client . isConnected ( ) ; } return false ; }
|
org . junit . Assert . assertTrue ( client . isConnected ( ) )
|
testDataAccessFinderFindsIt ( ) { java . util . Iterator < org . geotools . data . DataAccessFactory > allFactories = org . geotools . data . DataAccessFinder . getAllDataStores ( ) ; org . geotools . arcsde . ArcSDEJNDIDataStoreFactory sdeFac = null ; while ( allFactories . hasNext ( ) ) { org . geotools . data . DataAccessFactory next = allFactories . next ( ) ; if ( next instanceof org . geotools . arcsde . ArcSDEJNDIDataStoreFactory ) { sdeFac = ( ( org . geotools . arcsde . ArcSDEJNDIDataStoreFactory ) ( next ) ) ; break ; } } "<AssertPlaceHolder>" ; } next ( ) { if ( ! ( hasNext ( ) ) ) { throw new java . util . NoSuchElementException ( ) ; } java . lang . String cn = nextName ; nextName = null ; try { return java . lang . Class . forName ( cn , true , loader ) . newInstance ( ) ; } catch ( java . lang . ClassNotFoundException x ) { com . sun . media . jai . util . Service . fail ( service , ( ( "Provider<sp>" + cn ) + "<sp>not<sp>found" ) ) ; } catch ( java . lang . Exception x ) { com . sun . media . jai . util . Service . fail ( service , ( ( ( "Provider<sp>" + cn ) + "<sp>could<sp>not<sp>be<sp>instantiated:<sp>" ) + x ) ) ; } return null ; }
|
org . junit . Assert . assertNotNull ( sdeFac )
|
testFindUserDnWhenUserDnPositive ( ) { javax . naming . NamingEnumeration < javax . naming . directory . SearchResult > searchResult = mockNamingEnumeration ( "CN=User1,OU=org1,DC=foo,DC=bar" ) ; when ( ctx . search ( anyString ( ) , anyString ( ) , any ( javax . naming . directory . SearchControls . class ) ) ) . thenReturn ( searchResult ) . thenThrow ( javax . naming . NamingException . class ) ; search = new org . apache . hive . service . auth . ldap . LdapSearch ( conf , ctx ) ; java . lang . String expected = "CN=User1,OU=org1,DC=foo,DC=bar" ; java . lang . String actual = search . findUserDn ( "CN=User1,OU=org1" ) ; "<AssertPlaceHolder>" ; } findUserDn ( java . lang . String ) { java . util . List < java . lang . String > allLdapNames ; if ( org . apache . hive . service . auth . ldap . LdapUtils . isDn ( user ) ) { java . lang . String userBaseDn = org . apache . hive . service . auth . ldap . LdapUtils . extractBaseDn ( user ) ; java . lang . String userRdn = org . apache . hive . service . auth . ldap . LdapUtils . extractFirstRdn ( user ) ; allLdapNames = execute ( java . util . Collections . singletonList ( userBaseDn ) , queries . findUserDnByRdn ( userRdn ) ) . getAllLdapNames ( ) ; } else { allLdapNames = findDnByPattern ( userPatterns , user ) ; if ( allLdapNames . isEmpty ( ) ) { allLdapNames = execute ( userBases , queries . findUserDnByName ( user ) ) . getAllLdapNames ( ) ; } } if ( ( allLdapNames . size ( ) ) == 1 ) { return allLdapNames . get ( 0 ) ; } else { org . apache . hive . service . auth . ldap . LdapSearch . LOG . info ( "Expected<sp>exactly<sp>one<sp>user<sp>result<sp>for<sp>the<sp>user:<sp>{},<sp>but<sp>got<sp>{}.<sp>Returning<sp>null" , user , allLdapNames . size ( ) ) ; org . apache . hive . service . auth . ldap . LdapSearch . LOG . debug ( "Matched<sp>users:<sp>{}" , allLdapNames ) ; return null ; } }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testDeselectArrayWithWithIndicesOutsideSelection ( ) { org . eclipse . swt . widgets . Table table = createTable ( SWT . SINGLE , 1 ) ; org . eclipse . swt . widgets . Table_Test . createTableItems ( table , 2 ) ; table . setSelection ( 1 ) ; table . deselect ( new int [ ] { 1 , 777 } ) ; "<AssertPlaceHolder>" ; } getSelectionCount ( ) { checkWidget ( ) ; int result = 0 ; if ( cellSelectionEnabled ) { } else { result = selectedItems . size ( ) ; } return result ; }
|
org . junit . Assert . assertEquals ( 0 , table . getSelectionCount ( ) )
|
testSerialization ( ) { org . jfree . chart . axis . CyclicNumberAxis a1 = new org . jfree . chart . axis . CyclicNumberAxis ( 10 , 0 , "Test<sp>Axis" ) ; org . jfree . chart . axis . CyclicNumberAxis a2 = ( ( org . jfree . chart . axis . CyclicNumberAxis ) ( org . jfree . chart . TestUtils . serialised ( a1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
|
org . junit . Assert . assertEquals ( a1 , a2 )
|
toList3 ( ) { int [ ] ids = new int [ ] { 1 , 2 , 3 } ; java . util . List < java . lang . Object > objects = org . fastquery . util . TypeUtil . toList ( ids ) ; for ( int i = 0 ; i < ( ids . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } toList ( java . lang . Object ) { java . util . Objects . requireNonNull ( array ) ; if ( array . getClass ( ) . isArray ( ) ) { int len = java . lang . reflect . Array . getLength ( array ) ; java . util . List < java . lang . Object > objs = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < len ; i ++ ) { objs . add ( java . lang . reflect . Array . get ( array , i ) ) ; } return objs ; } else { throw new java . lang . ClassCastException ( "" ) ; } }
|
org . junit . Assert . assertThat ( ids [ i ] , is ( objects . get ( i ) ) )
|
canBeNull ( ) { toDoItem . setDueBy ( ( ( org . joda . time . LocalDate ) ( null ) ) ) ; "<AssertPlaceHolder>" ; } getDueBy ( ) { return dueBy ; }
|
org . junit . Assert . assertThat ( toDoItem . getDueBy ( ) , org . hamcrest . CoreMatchers . is ( ( ( org . joda . time . LocalDate ) ( null ) ) ) )
|
testFetchByPrimaryKeyExisting ( ) { com . liferay . asset . kernel . model . AssetLink newAssetLink = addAssetLink ( ) ; com . liferay . asset . kernel . model . AssetLink existingAssetLink = _persistence . fetchByPrimaryKey ( newAssetLink . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertEquals ( existingAssetLink , newAssetLink )
|
testBNonExpression ( ) { org . jboss . as . server . RuntimeExpressionResolver testee = new org . jboss . as . server . RuntimeExpressionResolver ( org . jboss . as . server . RuntimeExpressionResolverUnitTestCase . getVaultReader ( ) ) ; org . jboss . dmr . ModelNode value = new org . jboss . dmr . ModelNode ( org . jboss . as . server . RuntimeExpressionResolverUnitTestCase . NON_EXPRESSION ) ; "<AssertPlaceHolder>" ; } resolveExpressions ( org . jboss . dmr . ModelNode ) { return node ; }
|
org . junit . Assert . assertEquals ( value , testee . resolveExpressions ( value ) )
|
testFindByConnectorNamesWithEmpty ( ) { java . util . List < org . apache . griffin . core . measure . entity . DataConnector > connectors = dcRepo . findByConnectorNames ( new java . util . ArrayList ( ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( connectors . size ( ) , 0 )
|
testGet_InZK ( ) { org . apache . accumulo . core . conf . Property p = org . apache . accumulo . core . conf . Property . INSTANCE_SECRET ; expect ( zc . get ( ( ( ( ( ( ( ( org . apache . accumulo . fate . zookeeper . ZooUtil . getRoot ( iid ) ) + ( org . apache . accumulo . core . Constants . ZTABLES ) ) + "/" ) + ( org . apache . accumulo . server . conf . TableConfigurationTest . TID ) ) + ( org . apache . accumulo . core . Constants . ZTABLE_CONF ) ) + "/" ) + ( p . getKey ( ) ) ) ) ) . andReturn ( "sekrit" . getBytes ( org . apache . accumulo . server . conf . UTF_8 ) ) ; replay ( zc ) ; "<AssertPlaceHolder>" ; } get ( org . apache . accumulo . core . conf . Property ) { java . lang . String v = props . get ( property . getKey ( ) ) ; if ( ( v == null ) & ( ( parent ) != null ) ) { v = parent . get ( property ) ; } return v ; }
|
org . junit . Assert . assertEquals ( "sekrit" , c . get ( Property . INSTANCE_SECRET ) )
|
testSelectFileFromRepositoryTask ( ) { org . pentaho . reporting . designer . extensions . pentaho . repository . actions . SelectFileFromRepositoryTask task = new org . pentaho . reporting . designer . extensions . pentaho . repository . actions . SelectFileFromRepositoryTask ( uiContext ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( task )
|
test_getManifest_dir ( ) { java . util . jar . Manifest manifest = org . talend . commons . utils . resource . BundleFileUtil . getManifest ( tmpFolder ) ; "<AssertPlaceHolder>" ; } getManifest ( java . io . File ) { if ( ( ( ( f == null ) || ( ! ( f . exists ( ) ) ) ) || ( ! ( f . isFile ( ) ) ) ) || ( ! ( f . getName ( ) . endsWith ( FileExtensions . JAR_FILE_SUFFIX ) ) ) ) { return null ; } java . util . jar . JarFile jarFile = null ; try { jarFile = new java . util . jar . JarFile ( f ) ; return jarFile . getManifest ( ) ; } finally { if ( jarFile != null ) { try { jarFile . close ( ) ; } catch ( java . io . IOException e ) { } } } }
|
org . junit . Assert . assertNull ( manifest )
|
testUnmarshallMarshallXmlCompare ( ) { org . drugis . addis . entities . data . AddisData data = org . drugis . addis . util . jaxb . JAXBHandler . unmarshallAddisData ( org . drugis . addis . util . jaxb . JAXBConvertor . transformToLatest ( org . drugis . addis . util . jaxb . JAXBHandlerTest . class . getResourceAsStream ( "schema_test.xml" ) , 1 ) ) ; java . lang . String testFile = "jaxb_marshall_test.xml" ; org . drugis . addis . util . jaxb . JAXBHandler . marshallAddisData ( data , new java . io . FileOutputStream ( testFile ) ) ; org . drugis . addis . entities . data . AddisData data_clone = org . drugis . addis . util . jaxb . JAXBHandler . unmarshallAddisData ( new java . io . FileInputStream ( testFile ) ) ; "<AssertPlaceHolder>" ; java . io . File temp = new java . io . File ( testFile ) ; temp . delete ( ) ; } unmarshallAddisData ( java . io . InputStream ) { javax . xml . bind . Unmarshaller unmarshaller = org . drugis . addis . util . jaxb . JAXBHandler . JAXB . getInstance ( ) . createUnmarshaller ( ) ; unmarshaller . setEventHandler ( new org . drugis . addis . util . jaxb . JAXBHandler . AddisDataValidationEventHandler ( ) ) ; return ( ( org . drugis . addis . entities . data . AddisData ) ( unmarshaller . unmarshal ( is ) ) ) ; }
|
org . junit . Assert . assertEquals ( data , data_clone )
|
testComputationState ( ) { if ( runningInDistributedMode ( ) ) { System . out . println ( "testComputeContext:<sp>Ignore<sp>this<sp>test<sp>in<sp>distributed<sp>mode." ) ; return ; } org . apache . giraph . conf . GiraphConfiguration conf = new org . apache . giraph . conf . GiraphConfiguration ( ) ; conf . setComputationClass ( org . apache . giraph . examples . TestComputationStateComputation . class ) ; conf . setVertexInputFormatClass ( SimplePageRankComputation . SimplePageRankVertexInputFormat . class ) ; conf . setWorkerContextClass ( TestComputationStateComputation . TestComputationStateWorkerContext . class ) ; org . apache . giraph . job . GiraphJob job = prepareJob ( getCallingMethodName ( ) , conf ) ; job . getConfiguration ( ) . setNumComputeThreads ( TestComputationStateComputation . NUM_COMPUTE_THREADS ) ; GeneratedVertexReader . READER_VERTICES . set ( job . getConfiguration ( ) , TestComputationStateComputation . NUM_VERTICES ) ; GiraphConstants . USER_PARTITION_COUNT . set ( job . getConfiguration ( ) , TestComputationStateComputation . NUM_PARTITIONS ) ; "<AssertPlaceHolder>" ; } run ( boolean ) { setIntConfIfDefault ( "mapreduce.job.counters.limit" , 512 ) ; setIntConfIfDefault ( "mapred.job.map.memory.mb" , 1024 ) ; setIntConfIfDefault ( "mapred.job.reduce.memory.mb" , 0 ) ; giraphConfiguration . setBoolean ( "mapred.map.tasks.speculative.execution" , false ) ; org . apache . hadoop . ipc . Client . setPingInterval ( giraphConfiguration , ( 60000 * 5 ) ) ; giraphConfiguration . setBoolean ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 5 , true ) ; giraphConfiguration . setBoolean ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 1 , true ) ; if ( ( giraphConfiguration . getCheckpointFrequency ( ) ) == 0 ) { int oldMaxTaskAttempts = giraphConfiguration . getMaxTaskAttempts ( ) ; giraphConfiguration . setMaxTaskAttempts ( 1 ) ; if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( ( ( ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 0 + "do<sp>not<sp>allow<sp>any<sp>task<sp>retries<sp>(setting<sp>" ) + ( GiraphConstants . MAX_TASK_ATTEMPTS . getKey ( ) ) ) + "<sp>=<sp>1,<sp>" ) + "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 2 ) + oldMaxTaskAttempts ) + ")" ) ) ; } } org . apache . giraph . conf . ImmutableClassesGiraphConfiguration conf = new org . apache . giraph . conf . ImmutableClassesGiraphConfiguration ( giraphConfiguration ) ; org . apache . giraph . job . GiraphJob . checkLocalJobRunnerConfiguration ( conf ) ; int tryCount = 0 ; org . apache . giraph . job . GiraphJobRetryChecker retryChecker = conf . getJobRetryChecker ( ) ; while ( true ) { org . apache . giraph . job . GiraphJobObserver jobObserver = conf . getJobObserver ( ) ; org . apache . giraph . job . JobProgressTrackerService jobProgressTrackerService = org . apache . giraph . job . DefaultJobProgressTrackerService . createJobProgressTrackerService ( conf , jobObserver ) ; org . apache . giraph . job . ClientThriftServer clientThriftServer = null ; if ( jobProgressTrackerService != null ) { clientThriftServer = new org . apache . giraph . job . ClientThriftServer ( conf , com . google . common . collect . ImmutableList . of ( jobProgressTrackerService ) ) ; } tryCount ++ ; org . apache . hadoop . mapreduce . Job submittedJob = new org . apache . hadoop . mapreduce . Job ( conf , jobName ) ; if ( ( submittedJob . getJar ( ) ) == null ) { submittedJob . setJarByClass ( getClass ( ) ) ; } submittedJob . setNumReduceTasks ( 0 ) ; submittedJob . setMapperClass ( org . apache . giraph . graph . GraphMapper . class ) ; submittedJob . setInputFormatClass ( org . apache . giraph . bsp . BspInputFormat . class ) ; submittedJob . setOutputFormatClass ( GiraphConstants . HADOOP_OUTPUT_FORMAT_CLASS . get ( conf ) ) ; if ( jobProgressTrackerService != null ) { jobProgressTrackerService . setJob ( submittedJob ) ; } jobObserver . launchingJob ( submittedJob ) ; submittedJob . submit ( ) ; if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( "Tracking<sp>URL:<sp>" + ( submittedJob . getTrackingURL ( ) ) ) ) ; org . apache . giraph . job . GiraphJob . LOG . info ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" + ( ( conf . getMinWorkers ( ) ) + 1 ) ) + "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 3 ) ) ; } jobObserver . jobRunning ( submittedJob ) ; org . apache . giraph . job . HaltApplicationUtils . printHaltInfo ( submittedJob , conf ) ; boolean passed = submittedJob . waitForCompletion ( verbose ) ; if ( jobProgressTrackerService != null ) { jobProgressTrackerService . stop ( passed ) ; } if ( clientThriftServer != null ) { clientThriftServer . stopThriftServer ( ) ; } jobObserver . jobFinished ( submittedJob , passed ) ; if ( ! passed ) { java . lang . String restartFrom = retryChecker . shouldRestartCheckpoint ( submittedJob ) ; if ( restartFrom != null ) { GiraphConstants . RESTART_JOB_ID . set ( conf , restartFrom ) ; continue ; } } if ( passed || ( ! ( retryChecker . shouldRetry ( submittedJob , tryCount ) ) ) ) { return passed ; } if ( org . apache . giraph . job . GiraphJob . LOG . isInfoEnabled ( ) ) { org . apache . giraph . job . GiraphJob . LOG . info ( ( ( "Waiting<sp>for<sp>resources...<sp>Job<sp>will<sp>start<sp>only<sp>when<sp>it<sp>gets<sp>all<sp>" 4 + tryCount ) + "<sp>try" ) ) ; } } }
|
org . junit . Assert . assertTrue ( job . run ( true ) )
|
testSubsituteSqlMalicious ( ) { java . util . Map < java . lang . String , java . lang . String > variables = new java . util . HashMap ( ) ; variables . put ( "level" , ";<sp>delete<sp>from<sp>datavalue;" ) ; java . lang . String sql = "select<sp>*<sp>from<sp>datavalue<sp>where<sp>level=${level}" ; java . lang . String expected = "select<sp>*<sp>from<sp>datavalue<sp>where<sp>level=${level}" ; java . lang . String actual = org . hisp . dhis . sqlview . SqlViewUtils . substituteSqlVariables ( sql , variables ) ; "<AssertPlaceHolder>" ; } substituteSqlVariables ( java . lang . String , java . util . Map ) { java . lang . String sqlQuery = sql ; if ( variables != null ) { for ( java . lang . String param : variables . keySet ( ) ) { if ( ( param != null ) && ( org . hisp . dhis . sqlview . SqlView . isValidQueryParam ( param ) ) ) { final java . lang . String regex = ( "\\$\\{(" + param ) + ")\\}" ; final java . lang . String value = variables . get ( param ) ; if ( ( value != null ) && ( org . hisp . dhis . sqlview . SqlView . isValidQueryValue ( value ) ) ) { sqlQuery = sqlQuery . replaceAll ( regex , value ) ; } } } } return sqlQuery ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testExecuteRemoteOperation ( ) { akka . actor . ActorRef shardActorRef = getSystem ( ) . actorOf ( akka . actor . Props . create ( org . opendaylight . controller . cluster . raft . utils . EchoActor . class ) ) ; akka . actor . ActorRef shardManagerActorRef = getSystem ( ) . actorOf ( org . opendaylight . controller . cluster . datastore . utils . ActorUtilsTest . MockShardManager . props ( true , shardActorRef ) ) ; org . opendaylight . controller . cluster . datastore . utils . ActorUtils actorUtils = new org . opendaylight . controller . cluster . datastore . utils . ActorUtils ( getSystem ( ) , shardManagerActorRef , mock ( org . opendaylight . controller . cluster . datastore . ClusterWrapper . class ) , mock ( org . opendaylight . controller . cluster . datastore . config . Configuration . class ) ) ; akka . actor . ActorSelection actor = actorUtils . actorSelection ( shardActorRef . path ( ) ) ; java . lang . Object out = actorUtils . executeOperation ( actor , "hello" ) ; "<AssertPlaceHolder>" ; } executeOperation ( akka . actor . ActorSelection , java . lang . Object ) { scala . concurrent . Future < java . lang . Object > future = executeOperationAsync ( actor , message ) ; try { return scala . concurrent . Await . result ( future , operationDuration ) ; } catch ( java . lang . Exception e ) { throw new org . opendaylight . controller . cluster . datastore . exceptions . TimeoutException ( ( ( ( ( "Sending<sp>message<sp>" + ( message . getClass ( ) . toString ( ) ) ) + "<sp>to<sp>actor<sp>" ) + ( actor . toString ( ) ) ) + "<sp>failed.<sp>Try<sp>again<sp>later." ) , e ) ; } }
|
org . junit . Assert . assertEquals ( "hello" , out )
|
testTXDeletionInExonReverse ( ) { de . charite . compbio . jannovar . reference . GenomeVariant change = new de . charite . compbio . jannovar . reference . GenomeVariant ( new de . charite . compbio . jannovar . reference . GenomePosition ( de . charite . compbio . jannovar . reference . TranscriptSequenceChangeHelperTest . refDict , Strand . FWD , 1 , 23696354 , PositionType . ZERO_BASED ) , "TAT" , "" ) ; java . lang . String resultTranscript = helperReverse . getTranscriptWithChange ( change ) ; java . lang . StringBuilder expectedBuilder = new java . lang . StringBuilder ( infoReverse . getSequence ( ) ) ; expectedBuilder . delete ( 2 , 5 ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "LegacyDeletion<sp>[deletedSeq=" + ( deletedSeq . toHGVSString ( ) ) ) + ",<sp>location=" ) + ( location ) ) + "]" ; }
|
org . junit . Assert . assertEquals ( expectedBuilder . toString ( ) , resultTranscript )
|
testMvNotDestExists ( ) { java . io . File src = mock ( java . io . File . class ) ; java . io . File dest = mock ( java . io . File . class ) ; java . io . File parent = mock ( java . io . File . class ) ; expect ( src . exists ( ) ) . andReturn ( true ) . anyTimes ( ) ; expect ( src . isDirectory ( ) ) . andReturn ( false ) . anyTimes ( ) ; expect ( src . canRead ( ) ) . andReturn ( true ) ; expect ( src . renameTo ( dest ) ) . andReturn ( true ) ; replay ( src ) ; expect ( parent . exists ( ) ) . andReturn ( true ) ; expect ( parent . isDirectory ( ) ) . andReturn ( true ) ; expect ( parent . canRead ( ) ) . andReturn ( true ) ; expect ( parent . canExecute ( ) ) . andReturn ( true ) ; expect ( parent . canWrite ( ) ) . andReturn ( true ) ; replay ( parent ) ; expect ( dest . exists ( ) ) . andReturn ( false ) . anyTimes ( ) ; expect ( dest . isDirectory ( ) ) . andReturn ( false ) ; expect ( dest . getParentFile ( ) ) . andReturn ( parent ) ; expect ( dest . getPath ( ) ) . andReturn ( "" ) . anyTimes ( ) ; replay ( dest ) ; java . lang . String ret = datawave . common . io . Files . mv ( src , dest , true ) ; "<AssertPlaceHolder>" ; } mv ( java . lang . String , java . lang . String , boolean ) { if ( ( src == null ) || ( dest == null ) ) throw new java . lang . IllegalArgumentException ( datawave . common . io . Files . NULL_PARAMS ) ; return datawave . common . io . Files . mv ( new java . io . File ( src ) , new java . io . File ( dest ) , overwrite ) ; }
|
org . junit . Assert . assertNull ( ret )
|
testRegionTooBusyException ( ) { java . util . List < java . lang . Throwable > ts = new java . util . ArrayList ( 1 ) ; final java . lang . String regionName = this . name . getMethodName ( ) ; ts . add ( new org . apache . hadoop . hbase . RegionTooBusyException ( regionName ) ) ; java . util . List < org . apache . hadoop . hbase . client . Row > rows = new java . util . ArrayList ( 1 ) ; rows . add ( org . mockito . Mockito . mock ( org . apache . hadoop . hbase . client . Row . class ) ) ; java . util . List < java . lang . String > hostAndPorts = new java . util . ArrayList ( 1 ) ; hostAndPorts . add ( "example.com:1234" ) ; org . apache . hadoop . hbase . client . RetriesExhaustedException ree = new org . apache . hadoop . hbase . client . RetriesExhaustedWithDetailsException ( ts , rows , hostAndPorts ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "PreemptiveFastFailInterceptor" ; }
|
org . junit . Assert . assertTrue ( ree . toString ( ) . contains ( regionName ) )
|
completePasswordRecovery_SendMailFailed ( ) { doThrow ( new org . oscm . internal . types . exception . MailOperationException ( ) ) . when ( passwordRecoverybean ) . sendPasswordRecoveryMails ( any ( org . oscm . domobjects . PlatformUser . class ) , any ( org . oscm . types . enumtypes . EmailType . class ) , anyString ( ) , any ( java . lang . Object [ ] . class ) ) ; boolean result = passwordRecoverybean . completePasswordRecovery ( userId , password_6letter ) ; verify ( passwordRecoverybean . sessionCtx , times ( 1 ) ) . setRollbackOnly ( ) ; "<AssertPlaceHolder>" ; } setRollbackOnly ( ) { try { tm . setRollbackOnly ( ) ; } catch ( javax . transaction . SystemException e ) { throw new java . lang . IllegalStateException ( e ) ; } }
|
org . junit . Assert . assertEquals ( false , result )
|
shouldDeleteFoundFlowPath ( ) { org . openkilda . model . FlowPath flowPath = buildTestFlowPath ( org . openkilda . persistence . repositories . impl . Neo4jFlowPathRepositoryTest . TEST_FLOW_ID , switchA , switchB ) ; org . openkilda . persistence . repositories . impl . Neo4jFlowPathRepositoryTest . flowPathRepository . createOrUpdate ( flowPath ) ; java . util . Collection < org . openkilda . model . FlowPath > allPaths = org . openkilda . persistence . repositories . impl . Neo4jFlowPathRepositoryTest . flowPathRepository . findAll ( ) ; org . openkilda . model . FlowPath foundPath = allPaths . iterator ( ) . next ( ) ; org . openkilda . persistence . repositories . impl . Neo4jFlowPathRepositoryTest . flowPathRepository . delete ( foundPath ) ; "<AssertPlaceHolder>" ; } findAll ( ) { return super . findAll ( ) . stream ( ) . map ( this :: completeWithPaths ) . collect ( java . util . stream . Collectors . toList ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , org . openkilda . persistence . repositories . impl . Neo4jFlowPathRepositoryTest . flowPathRepository . findAll ( ) . size ( ) )
|
shouldDisableQuotaServiceBecausePropertyIsTrue ( ) { givenQuotaProperty ( "true" ) ; final boolean matches = service . matches ( context , null ) ; "<AssertPlaceHolder>" ; } matches ( org . springframework . context . annotation . ConditionContext , org . springframework . core . type . AnnotatedTypeMetadata ) { final java . lang . String property = context . getEnvironment ( ) . getProperty ( "dataset.quota.check.enabled" ) ; return ! ( org . apache . commons . lang3 . StringUtils . equals ( "true" , property ) ) ; }
|
org . junit . Assert . assertFalse ( matches )
|
testSpecificToFromByteBufferWithLogicalTypes ( ) { org . apache . avro . specific . TestRecordWithLogicalTypes record = new org . apache . avro . specific . TestRecordWithLogicalTypes ( true , 34 , 35L , 3.14F , 3019.34 , null , org . joda . time . LocalDate . now ( ) , org . joda . time . LocalTime . now ( ) , org . joda . time . DateTime . now ( ) . withZone ( DateTimeZone . UTC ) , new java . math . BigDecimal ( "123.45" ) ) ; java . nio . ByteBuffer b = record . toByteBuffer ( ) ; org . apache . avro . specific . TestRecordWithLogicalTypes copy = org . apache . avro . specific . TestRecordWithLogicalTypes . fromByteBuffer ( b ) ; "<AssertPlaceHolder>" ; } fromByteBuffer ( java . nio . ByteBuffer ) { return org . apache . avro . specific . TestRecordWithLogicalTypes . DECODER . decode ( b ) ; }
|
org . junit . Assert . assertEquals ( record , copy )
|
testSelectDrillTargetTask ( ) { org . pentaho . reporting . designer . extensions . pentaho . drilldown . SelectDrillTargetTask selectDrillTargetTask = new org . pentaho . reporting . designer . extensions . pentaho . drilldown . SelectDrillTargetTask ( wrapper , uiContext , triggerRefreshParameterTask , activeContext ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( selectDrillTargetTask )
|
setBothRemovedTest ( ) { org . threadly . concurrent . collections . ConcurrentArrayList . DataSet < java . lang . Integer > result = org . threadly . concurrent . collections . ConcurrentArrayListDataSetTest . removedFromBoth . set ( 8 , 100 ) . set ( 5 , 0 ) . set ( 0 , 10 ) ; java . lang . Integer [ ] expectedResult = new java . lang . Integer [ ] { 10 , 2 , 3 , 4 , 5 , 0 , 7 , 8 , 100 } ; "<AssertPlaceHolder>" ; } makeDataSet ( java . lang . Object [ ] , int , int ) { return new org . threadly . concurrent . collections . ConcurrentArrayList . DataSet ( dataArray , startPosition , endPosition , 0 , 0 ) ; }
|
org . junit . Assert . assertTrue ( result . equals ( org . threadly . concurrent . collections . ConcurrentArrayListDataSetTest . makeDataSet ( expectedResult , 0 , expectedResult . length ) ) )
|
createBranchFromBranchRef_theHeadsOfTheTwoBranchesShouldEqual ( ) { writeSomethingToCache ( ) ; commitToBranch ( "source_branch" ) ; com . beijunyi . parallelgit . utils . BranchUtils . createBranch ( "test_branch" , repo . findRef ( "source_branch" ) , repo ) ; "<AssertPlaceHolder>" ; } getHeadCommit ( java . lang . String , com . beijunyi . parallelgit . utils . Repository ) { com . beijunyi . parallelgit . utils . Ref ref = com . beijunyi . parallelgit . utils . RefUtils . getBranchRef ( name , repo ) ; return com . beijunyi . parallelgit . utils . CommitUtils . getCommit ( ref . getObjectId ( ) , repo ) ; }
|
org . junit . Assert . assertEquals ( com . beijunyi . parallelgit . utils . BranchUtils . getHeadCommit ( "source_branch" , repo ) , com . beijunyi . parallelgit . utils . BranchUtils . getHeadCommit ( "test_branch" , repo ) )
|
test ( ) { nl . bzk . brp . bevraging . domein . Land land = new nl . bzk . brp . bevraging . domein . Land ( "Test" ) ; "<AssertPlaceHolder>" ; } getNaam ( ) { return naam ; }
|
org . junit . Assert . assertEquals ( "Test" , land . getNaam ( ) )
|
testGetPriorityFromMessage ( ) { final short PRIORITY = 7 ; org . apache . qpid . proton . message . impl . MessageImpl protonMessage = ( ( org . apache . qpid . proton . message . impl . MessageImpl ) ( Message . Factory . create ( ) ) ) ; protonMessage . setHeader ( new org . apache . qpid . proton . amqp . messaging . Header ( ) ) ; protonMessage . setPriority ( PRIORITY ) ; org . apache . activemq . artemis . protocol . amqp . broker . AMQPMessage decoded = encodeAndDecodeMessage ( protonMessage ) ; "<AssertPlaceHolder>" ; } getPriority ( ) { return priority ; }
|
org . junit . Assert . assertEquals ( PRIORITY , decoded . getPriority ( ) )
|
useFullyInitializedSUTClassExtendingGenericBaseClass ( ) { mockit . TestedClassWithGenericsTest . AnotherDep anotherDep = sut2 . dep ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( anotherDep )
|
testGetEmptyNotificationsWhenHmsReturnsANullResponse ( ) { org . apache . sentry . provider . db . service . persistent . SentryStore store = org . mockito . Mockito . mock ( org . apache . sentry . provider . db . service . persistent . SentryStore . class ) ; org . apache . sentry . service . thrift . HiveConnectionFactory hmsConnection = org . mockito . Mockito . mock ( org . apache . sentry . service . thrift . HiveConnectionFactory . class ) ; org . apache . hadoop . hive . metastore . HiveMetaStoreClient hmsClient = org . mockito . Mockito . mock ( org . apache . hadoop . hive . metastore . HiveMetaStoreClient . class ) ; org . mockito . Mockito . when ( hmsConnection . connect ( ) ) . thenReturn ( new org . apache . sentry . service . thrift . HMSClient ( hmsClient ) ) ; try ( org . apache . sentry . service . thrift . HiveNotificationFetcher fetcher = new org . apache . sentry . service . thrift . HiveNotificationFetcher ( store , hmsConnection ) ) { java . util . List < org . apache . hadoop . hive . metastore . api . NotificationEvent > events ; org . mockito . Mockito . when ( hmsClient . getNextNotification ( 0 , Integer . MAX_VALUE , null ) ) . thenReturn ( null ) ; events = fetcher . fetchNotifications ( 0 ) ; "<AssertPlaceHolder>" ; } } isEmpty ( ) { return ( ( ( permUpdates ) == null ) || ( permUpdates . isEmpty ( ) ) ) && ( ( ( pathUpdates ) == null ) || ( pathUpdates . isEmpty ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( events . isEmpty ( ) )
|
shouldAcceptAlgorithm ( ) { lb = new org . openstack . atlas . api . validation . validators . LoadBalancer ( ) ; lb . setAlgorithm ( "RANDOM" ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( lb , org . openstack . atlas . api . validation . validators . PUT ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; }
|
org . junit . Assert . assertTrue ( result . passedValidation ( ) )
|
testGETWhenEnabled ( ) { edu . illinois . library . cantaloupe . config . Configuration config = edu . illinois . library . cantaloupe . config . Configuration . getInstance ( ) ; config . setProperty ( Key . ADMIN_ENABLED , true ) ; edu . illinois . library . cantaloupe . http . Response response = client . send ( ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; }
|
org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) )
|
getAnnotatedQuery_should_work_with_repetitive_field_in_select_statement ( ) { org . springframework . data . simpledb . query . SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest ( "selectTricky" , org . springframework . data . simpledb . query . SampleEntity . class ) ; java . lang . String expectedResult = "select<sp>item_id,<sp>item_id<sp>from<sp>`testDB.sampleEntity`<sp>where<sp>item_id<sp>>=<sp>`3`<sp>and<sp>item_id<sp><=<sp>`5`" ; "<AssertPlaceHolder>" ; } getAnnotatedQuery ( ) { java . lang . String valueParameter = getValueParameters ( ) ; java . lang . String whereParameters = getWhereParameters ( ) ; java . lang . String [ ] selectParameters = getSelectParameters ( ) ; java . lang . String result = org . springframework . data . simpledb . query . parser . QueryParserUtils . buildQueryFromQueryParameters ( valueParameter , selectParameters , whereParameters , simpleDbDomain . getDomain ( getDomainClass ( ) ) ) ; assertParameterNamesInAnnotatedQuery ( result ) ; return result ; }
|
org . junit . Assert . assertEquals ( expectedResult , repositoryMethod . getAnnotatedQuery ( ) )
|
testGetAndTagNoHits ( ) { when ( writer . getAndTag ( q1 , "tag" ) ) . thenReturn ( null ) ; when ( cache . getAndTag ( q1 , "tag" ) ) . thenReturn ( null ) ; "<AssertPlaceHolder>" ; verify ( cache , never ( ) ) . add ( any ( com . findwise . hydra . DatabaseDocument . class ) ) ; verify ( cache , atLeastOnce ( ) ) . getAndTag ( q1 , "tag" ) ; verify ( writer , atLeastOnce ( ) ) . getAndTag ( eq ( q1 ) , ( ( java . lang . String [ ] ) ( org . mockito . Mockito . anyVararg ( ) ) ) ) ; } getAndTag ( com . findwise . hydra . DatabaseQuery , java . lang . String [ ] ) { for ( java . lang . String t : tag ) { ( ( com . findwise . hydra . memorydb . MemoryQuery ) ( query ) ) . requireNotFetchedByStage ( t ) ; } com . findwise . hydra . memorydb . MemoryDocument d = getDocument ( query ) ; if ( d != null ) { for ( java . lang . String t : tag ) { d . tag ( Document . FETCHED_METADATA_TAG , t ) ; } } return d ; }
|
org . junit . Assert . assertNull ( io . getAndTag ( q1 , "tag" ) )
|
stripQueryUTF ( ) { java . lang . String jaString = "日本語文字列" ; "<AssertPlaceHolder>" ; } stripQuery ( java . lang . String ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; org . drizzle . jdbc . internal . common . Utils . ParsingState parsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . NORMAL ; org . drizzle . jdbc . internal . common . Utils . ParsingState nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . NORMAL ; for ( int i = 0 ; i < ( query . length ( ) ) ; i ++ ) { final char c = query . charAt ( i ) ; int nextCodePoint = 0 ; if ( i < ( ( query . length ( ) ) - 1 ) ) { nextCodePoint = query . codePointAt ( ( i + 1 ) ) ; } switch ( parsingState ) { case WITHIN_DOUBLE_QUOTES : if ( c == '"' ) { nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . NORMAL ; } break ; case WITHIN_QUOTES : if ( c == '\'' ) { nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . NORMAL ; } break ; case NORMAL : if ( c == '\'' ) { nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . WITHIN_QUOTES ; } else if ( c == '"' ) { nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . WITHIN_DOUBLE_QUOTES ; } else if ( ( c == '/' ) && ( nextCodePoint == '*' ) ) { nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . WITHIN_COMMENT ; parsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . WITHIN_COMMENT ; } else if ( c == '#' ) { return sb . toString ( ) ; } break ; case WITHIN_COMMENT : if ( ( c == '*' ) && ( nextCodePoint == '/' ) ) { nextParsingState = org . drizzle . jdbc . internal . common . Utils . ParsingState . NORMAL ; i ++ ; } break ; } if ( parsingState != ( org . drizzle . jdbc . internal . common . Utils . ParsingState . WITHIN_COMMENT ) ) { sb . append ( c ) ; } parsingState = nextParsingState ; } return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( jaString , org . drizzle . jdbc . internal . common . Utils . stripQuery ( jaString ) )
|
test_simpleBase_baseIsNotChanged ( ) { de . fesere . hypermedia . cj . model . builder . UriConstructor constructor = new de . fesere . hypermedia . cj . model . builder . UriConstructor ( base ) ; "<AssertPlaceHolder>" ; } getBase ( ) { return base ; }
|
org . junit . Assert . assertThat ( base , org . hamcrest . core . Is . is ( org . hamcrest . CoreMatchers . equalTo ( constructor . getBase ( ) ) ) )
|
testAddIsolatedRestriction ( ) { org . apache . jackrabbit . oak . util . NodeUtil node = getTestRoot ( ) ; org . apache . jackrabbit . oak . util . NodeUtil restriction = node . addChild ( "isolatedRestriction" , org . apache . jackrabbit . oak . security . authorization . accesscontrol . NT_REP_RESTRICTIONS ) ; try { root . commit ( ) ; org . junit . Assert . fail ( "Writing<sp>an<sp>isolated<sp>Restriction<sp>should<sp>fail." ) ; } catch ( org . apache . jackrabbit . oak . api . CommitFailedException e ) { "<AssertPlaceHolder>" ; } finally { restriction . getTree ( ) . remove ( ) ; } } isAccessControlViolation ( ) { return isOfType ( org . apache . jackrabbit . oak . api . CommitFailedException . ACCESS_CONTROL ) ; }
|
org . junit . Assert . assertTrue ( e . isAccessControlViolation ( ) )
|
testReadFileWithVar ( ) { java . lang . String str = org . onetwo . common . file . FileUtils . readAsStringWith ( "test.txt" , "startDate" , "2012-12-25" , "userName" , "way" ) ; System . out . println ( ( "test:" + str ) ) ; java . lang . String content = "2012-12-25wayway" ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( content , str )
|
whenSchemaVersionTableIsEmptyThenCurrentVersionShouldBe0 ( ) { expectRetrieveEmptyCurrentVersion ( ) ; int currentVersion = versioner . getCurrentVersion ( io . smartcat . migration . MigrationType . SCHEMA ) ; "<AssertPlaceHolder>" ; } getCurrentVersion ( io . smartcat . migration . MigrationType ) { final com . datastax . driver . core . Statement select = com . datastax . driver . core . querybuilder . QueryBuilder . select ( ) . all ( ) . from ( io . smartcat . migration . CassandraVersioner . SCHEMA_VERSION_CF ) . where ( com . datastax . driver . core . querybuilder . QueryBuilder . eq ( io . smartcat . migration . CassandraVersioner . TYPE , type . name ( ) ) ) . limit ( 1 ) . setConsistencyLevel ( ConsistencyLevel . ALL ) ; final com . datastax . driver . core . ResultSet result = session . execute ( select ) ; final com . datastax . driver . core . Row row = result . one ( ) ; return row == null ? 0 : row . getInt ( io . smartcat . migration . CassandraVersioner . VERSION ) ; }
|
org . junit . Assert . assertThat ( currentVersion , org . hamcrest . CoreMatchers . is ( 0 ) )
|
testGetMaxResonStruc ( ) { org . openscience . cdk . charges . Electronegativity pe = new org . openscience . cdk . charges . Electronegativity ( ) ; "<AssertPlaceHolder>" ; } getMaxResonStruc ( ) { return maxRS ; }
|
org . junit . Assert . assertSame ( 50 , pe . getMaxResonStruc ( ) )
|
nietValideGeenSoortDienst ( ) { final nl . bzk . brp . model . internbericht . ProtocolleringOpdracht protocolleringOpdracht = maakProtocolleringOpdracht ( null , datumMaterieelSelectie , datumAanvangMaterielePeriode , datumEindeMaterielePeriode , datumTijdAanvangFormelePeriode , datumTijdEindeFormelePeriode , null ) ; "<AssertPlaceHolder>" ; } isValide ( ) { boolean resultaat ; if ( ( levering ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "Levering<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( ( personen ) == null ) || ( personen . isEmpty ( ) ) ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "Personen<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( levering . getToegangLeveringsautorisatieId ( ) ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "ToegangAbonnementId<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( levering . getDienstId ( ) ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "DienstId<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( ( levering . getDatumTijdKlaarzettenLevering ( ) ) == null ) || ( levering . getDatumTijdKlaarzettenLevering ( ) . heeftGeenWaarde ( ) ) ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "DatumTijdKlaarzettenLevering<sp>dient<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( getSoortDienst ( ) ) == null ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "Soort<sp>dienst<sp>gevuld<sp>te<sp>zijn." ) ; } else if ( ( nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . SOORTDIENSTEN_MET_SOORT_SYNCHRONISATIE_VERPLICHT . contains ( getSoortDienst ( ) ) ) && ( ( ( levering . getSoortSynchronisatie ( ) ) == null ) || ( levering . getSoortSynchronisatie ( ) . heeftGeenWaarde ( ) ) ) ) { resultaat = false ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( "ToegangAbonnementId<sp>dient<sp>gevuld<sp>te<sp>zijn." 0 , getSoortDienst ( ) ) ; } else { switch ( soortDienst ) { case ATTENDERING : case MUTATIELEVERING_OP_BASIS_VAN_DOELBINDING : resultaat = isValideAttenderingOfMutatieLeveringDoelbinding ( ) ; break ; case GEEF_DETAILS_PERSOON : case GEEF_DETAILS_PERSOON_BULK : resultaat = isValideGeefDetailsPersoon ( getHistorievorm ( ) ) ; break ; case MUTATIELEVERING_OP_BASIS_VAN_AFNEMERINDICATIE : case PLAATSEN_AFNEMERINDICATIE : case VERWIJDEREN_AFNEMERINDICATIE : resultaat = isValideAfnemerindicatie ( ) ; break ; case SYNCHRONISATIE_PERSOON : resultaat = isValideSynchronisatiePersoon ( ) ; break ; case GEEF_MEDEBEWONERS_VAN_PERSOON : resultaat = isValideGeefMedebewonersVanPersoon ( ) ; break ; default : final java . lang . String foutmelding = "Voor<sp>deze<sp>catalogusoptie<sp>is<sp>geen<sp>protocollering<sp>validatie<sp>ingesteld:<sp>" + ( soortDienst ) ; nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . error ( foutmelding ) ; throw new java . lang . IllegalArgumentException ( foutmelding ) ; } if ( ! resultaat ) { nl . bzk . brp . model . internbericht . ProtocolleringOpdracht . LOGGER . debug ( ( "De<sp>protocollering<sp>is<sp>niet<sp>valide<sp>voor<sp>de<sp>catalogusoptie:<sp>{},<sp>" + ( ( "datum<sp>materieel<sp>selectie:<sp>{},<sp>datum<sp>aanvang<sp>materiele<sp>periode:<sp>{},<sp>" + "datum<sp>einde<sp>materiele<sp>periode:<sp>{},<sp>datum<sp>tijd<sp>aanv<sp>form<sp>periode:<sp>{},<sp>" ) + "ToegangAbonnementId<sp>dient<sp>gevuld<sp>te<sp>zijn." 1 ) ) , soortDienst , levering . getDatumMaterieelSelectie ( ) , levering . getDatumAanvangMaterielePeriodeResultaat ( ) , levering . getDatumEindeMaterielePeriodeResultaat ( ) , levering . getDatumTijdAanvangFormelePeriodeResultaat ( ) , levering . getDatumTijdEindeFormelePeriodeResultaat ( ) , historievorm ) ; } } return resultaat ; }
|
org . junit . Assert . assertFalse ( protocolleringOpdracht . isValide ( ) )
|
getWithParameters ( ) { final java . lang . String path = "/data" ; final org . sentilo . common . rest . RequestContext rc = new org . sentilo . common . rest . RequestContext ( path ) ; rc . setParameters ( requestParameters ) ; final java . lang . String responseContent = "Lorem<sp>ipsum" ; final org . apache . http . StatusLine statusLine = new org . apache . http . message . BasicStatusLine ( org . apache . http . HttpVersion . HTTP_1_0 , org . apache . http . HttpStatus . SC_OK , "" ) ; when ( httpClient . execute ( notNull ( org . apache . http . client . methods . HttpGet . class ) ) ) . thenReturn ( httpResponse ) ; when ( httpResponse . getStatusLine ( ) ) . thenReturn ( statusLine ) ; when ( httpResponse . getEntity ( ) ) . thenReturn ( new org . apache . http . entity . StringEntity ( responseContent ) ) ; final java . lang . String result = restClient . get ( rc ) ; verify ( httpClient ) . execute ( any ( org . apache . http . client . methods . HttpGet . class ) ) ; "<AssertPlaceHolder>" ; } execute ( org . sentilo . platform . service . dao . JedisCallback ) { org . springframework . util . Assert . notNull ( action , "Callback<sp>object<sp>must<sp>not<sp>be<sp>null" ) ; redis . clients . jedis . Jedis conn = null ; boolean broken = false ; try { conn = jedisPoolUtils . getResource ( ) ; return action . doInRedis ( conn ) ; } catch ( final java . lang . Exception e ) { if ( e instanceof redis . clients . jedis . exceptions . JedisConnectionException ) { broken = true ; } throw jedisPoolUtils . convertJedisAccessException ( e ) ; } finally { jedisPoolUtils . releaseConnection ( conn , broken ) ; } }
|
org . junit . Assert . assertEquals ( responseContent , result )
|
testWriteLoadProtoFromStream ( ) { java . io . FileOutputStream out = new java . io . FileOutputStream ( new java . io . File ( ( ( org . apache . tajo . util . TestFileUtils . TEST_PATH ) + "/file.bin" ) ) ) ; org . apache . tajo . util . FileUtil . writeProto ( out , proto ) ; java . io . FileInputStream in = new java . io . FileInputStream ( new java . io . File ( ( ( org . apache . tajo . util . TestFileUtils . TEST_PATH ) + "/file.bin" ) ) ) ; com . google . protobuf . Message defaultInstance = org . apache . tajo . util . TestProtos . TestMessageProto . getDefaultInstance ( ) ; org . apache . tajo . util . TestProtos . TestMessageProto message = ( ( org . apache . tajo . util . TestProtos . TestMessageProto ) ( org . apache . tajo . util . FileUtil . loadProto ( in , defaultInstance ) ) ) ; "<AssertPlaceHolder>" ; } loadProto ( org . apache . tajo . util . File , com . google . protobuf . Message ) { org . apache . tajo . util . FileInputStream in = null ; try { in = new org . apache . tajo . util . FileInputStream ( file ) ; com . google . protobuf . Message . Builder builder = proto . newBuilderForType ( ) . mergeFrom ( in ) ; return builder . build ( ) ; } finally { org . apache . hadoop . io . IOUtils . closeStream ( in ) ; } }
|
org . junit . Assert . assertEquals ( proto , message )
|
testSessionNotPropagated ( java . net . URL ) { final java . net . URL url = com . amadeus . session . servlet . it . Helpers . url ( baseURL , "TestServlet" , "testSessionNotPropagated" ) ; java . net . HttpURLConnection connection = ( ( java . net . HttpURLConnection ) ( url . openConnection ( ) ) ) ; java . util . List < java . lang . String > cookies = connection . getHeaderFields ( ) . get ( "Set-Cookie" ) ; java . lang . String originalCookie = cookies . get ( 0 ) ; connection = ( ( java . net . HttpURLConnection ) ( url . openConnection ( ) ) ) ; connection . connect ( ) ; cookies = connection . getHeaderFields ( ) . get ( "Set-Cookie" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } com . amadeus . session . SessionData other = ( ( com . amadeus . session . SessionData ) ( obj ) ) ; if ( ( id ) == null ) { if ( ( other . id ) != null ) { return false ; } } else if ( ! ( id . equals ( other . id ) ) ) { return false ; } if ( ( originalLastAccessed ) != ( other . originalLastAccessed ) ) { return false ; } return true ; }
|
org . junit . Assert . assertFalse ( originalCookie . equals ( cookies . get ( 0 ) ) )
|
401 ( ) { java . lang . String cellName1 = "passcell1" ; java . lang . String cellName2 = "passcell2" ; try { com . fujitsu . dc . test . utils . CellUtils . create ( cellName1 , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , 201 ) ; com . fujitsu . dc . test . utils . CellUtils . create ( cellName2 , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , 201 ) ; com . fujitsu . dc . test . utils . AccountUtils . create ( com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , cellName1 , "PasswordTest" , "password" , 201 ) ; com . fujitsu . dc . test . utils . AccountUtils . create ( com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , cellName2 , "PasswordTest" , "password" , 201 ) ; org . json . simple . JSONObject resBody = com . fujitsu . dc . test . utils . ResourceUtils . getLocalTokenByPassAuth ( cellName2 , "PasswordTest" , "password" , ( - 1 ) ) ; java . lang . String tokenStr = ( ( java . lang . String ) ( resBody . get ( OAuth2Helper . Key . ACCESS_TOKEN ) ) ) ; com . fujitsu . dc . test . jersey . DcResponse res = requesttoMypassword ( tokenStr , "password1" , cellName1 ) ; "<AssertPlaceHolder>" ; } finally { com . fujitsu . dc . test . utils . AccountUtils . delete ( cellName1 , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , "PasswordTest" , 204 ) ; com . fujitsu . dc . test . utils . AccountUtils . delete ( cellName2 , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , "PasswordTest" , 204 ) ; com . fujitsu . dc . test . utils . CellUtils . delete ( com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , cellName1 ) ; com . fujitsu . dc . test . utils . CellUtils . delete ( com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . MASTER_TOKEN , cellName2 ) ; } } getStatusCode ( ) { return this . statusCode ; }
|
org . junit . Assert . assertEquals ( 401 , res . getStatusCode ( ) )
|
constructor_BaseUrlHTTPS_empty ( ) { org . oscm . saml2 . api . SpMetadataGenerator mdGen = new org . oscm . saml2 . api . SpMetadataGenerator ( org . oscm . saml2 . api . SpMetadataGeneratorTest . ENTITY_ID , "<sp>" , org . oscm . saml2 . api . SpMetadataGeneratorTest . ACS1 ) ; org . w3c . dom . Document metadata = mdGen . generate ( ) ; java . lang . String location = extractAttribute ( metadata , "md:AssertionConsumerService" , 1 , "Location" ) ; "<AssertPlaceHolder>" ; } extractAttribute ( org . w3c . dom . Document , java . lang . String , int , java . lang . String ) { org . w3c . dom . Node node = extractNode ( doc , tagName , tagIndex ) ; if ( node == null ) { return null ; } return node . getAttributes ( ) . getNamedItem ( attributeName ) . getNodeValue ( ) ; }
|
org . junit . Assert . assertNull ( location )
|
testMemPipelineWriteSequenceFile_PTable ( ) { final org . apache . crunch . impl . mem . collect . MemTable < java . lang . Integer , java . lang . String > collection = new org . apache . crunch . impl . mem . collect . MemTable < java . lang . Integer , java . lang . String > ( org . apache . crunch . impl . mem . MemPipelineFileReadingWritingIT . EXPECTED_TABLE , org . apache . crunch . types . writable . Writables . tableOf ( org . apache . crunch . types . writable . Writables . ints ( ) , org . apache . crunch . types . writable . Writables . strings ( ) ) , "test<sp>input" ) ; final org . apache . crunch . Target target = org . apache . crunch . io . To . sequenceFile ( outputDir . toString ( ) ) ; org . apache . crunch . impl . mem . MemPipeline . getInstance ( ) . write ( collection , target ) ; final org . apache . hadoop . io . SequenceFile . Reader reader = new org . apache . hadoop . io . SequenceFile . Reader ( org . apache . hadoop . fs . FileSystem . getLocal ( baseTmpDir . getDefaultConfiguration ( ) ) , new org . apache . hadoop . fs . Path ( getOutputFile ( outputDir , "*.seq" ) . toString ( ) ) , baseTmpDir . getDefaultConfiguration ( ) ) ; final java . util . List < org . apache . crunch . Pair < java . lang . Integer , java . lang . String > > actual = com . google . common . collect . Lists . newArrayList ( ) ; final org . apache . hadoop . io . IntWritable key = new org . apache . hadoop . io . IntWritable ( ) ; final org . apache . hadoop . io . Text value = new org . apache . hadoop . io . Text ( ) ; while ( reader . next ( key , value ) ) { actual . add ( org . apache . crunch . Pair . of ( key . get ( ) , value . toString ( ) ) ) ; } reader . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { fileIn . close ( ) ; }
|
org . junit . Assert . assertEquals ( org . apache . crunch . impl . mem . MemPipelineFileReadingWritingIT . EXPECTED_TABLE , actual )
|
manageOperations_VSERVERS_STARTING_CombinedVServerStateNotNormal ( ) { paramHandler . getIaasContext ( ) . setVSystemStatus ( org . oscm . app . iaas . VSystemProcessorBeanTest . NORMAL ) ; org . oscm . app . iaas . data . FlowState newState = vSystemProcessor . manageOperations ( org . oscm . app . iaas . VSystemProcessorBeanTest . CONTROLLER_ID , org . oscm . app . iaas . VSystemProcessorBeanTest . INSTANCE_ID , paramHandler , FlowState . VSERVERS_STARTING ) ; "<AssertPlaceHolder>" ; } manageOperations ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState ) { boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; if ( ! vSysInNormalState ) { return null ; } org . oscm . app . iaas . data . FlowState newState = null ; switch ( flowState ) { case VSYSTEM_START_REQUESTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVERS_STARTING , paramHandler ) ) { if ( vsysComm . startAllEFMs ( paramHandler ) ) { vsysComm . startAllVServers ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVERS_STARTING ; } } break ; case VSERVERS_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( vsysComm . getCombinedVServerState ( paramHandler , VSystemStatus . RUNNING ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } } break ; case VSYSTEM_STOP_REQUESTED : if ( ( paramHandler . getControllerWaitTime ( ) ) != 0 ) { paramHandler . suspendProcessInstanceFor ( paramHandler . getControllerWaitTime ( ) ) ; newState = org . oscm . app . iaas . data . FlowState . WAITING_BEFORE_STOP ; break ; } case WAITING_BEFORE_STOP : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVERS_STOPPING , paramHandler ) ) { vsysComm . stopAllVServers ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVERS_STOPPING ; } break ; case VSERVERS_STOPPING : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( vsysComm . getCombinedVServerState ( paramHandler , VSystemStatus . STOPPED ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } } break ; default : } return newState ; }
|
org . junit . Assert . assertNull ( newState )
|
DeclarationVariableLocal_Initialized ( ) { java . lang . String fromClass = "Domain.Direct.Violating.DeclarationVariableLocal_Initialized" ; java . lang . String toClass = "Technology.Direct.Dao.ProfileDAO" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Declaration" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; }
|
org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , false ) )
|
shouldReturnFalseForCloseSquareBracket ( ) { boolean start = edu . stanford . bmir . protege . web . shared . entity . EntityNameUtils . isWordStart ( "]" , 0 ) ; "<AssertPlaceHolder>" ; } isWordStart ( java . lang . String , int ) { checkNotNull ( entityName ) ; int length = entityName . length ( ) ; checkElementIndex ( index , length ) ; edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType indexCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , index ) ; if ( ! ( indexCharType . isWordLetter ( ) ) ) { return false ; } if ( index == 0 ) { return true ; } edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType prevCharType = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index - 1 ) ) ; if ( prevCharType != indexCharType ) { return ! ( ( indexCharType == ( EntityNameCharType . LETTER ) ) && ( prevCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) ) ; } if ( indexCharType == ( EntityNameCharType . UPPER_CASE_LETTER ) ) { boolean hasFollowingCharacter = index < ( length - 1 ) ; return hasFollowingCharacter && ( ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( entityName , ( index + 1 ) ) ) == ( EntityNameCharType . LETTER ) ) ; } return false ; }
|
org . junit . Assert . assertEquals ( false , start )
|
testOnErrorWhenFileDoesNotExist ( ) { final org . jboss . errai . bus . client . api . messaging . Message message = mock ( org . jboss . errai . bus . client . api . messaging . Message . class ) ; final java . lang . Throwable throwable = mock ( java . lang . Throwable . class ) ; final org . uberfire . ext . editor . commons . client . menu . common . SaveAndRenameCommandBuilder . SaveAndRenameErrorCallback onSaveAndRenameError = builder . addErrorCallback ( onError ) . onError ( ) ; final org . uberfire . ext . editor . commons . client . menu . common . SaveAndRenameCommandBuilder . SaveAndRenameErrorCallback onErrorSpy = spy ( onSaveAndRenameError ) ; doReturn ( "" ) . when ( throwable ) . getMessage ( ) ; doReturn ( true ) . when ( onErrorSpy ) . callSuper ( message , throwable ) ; final boolean error = onErrorSpy . error ( message , throwable ) ; verify ( onError ) . execute ( ) ; verify ( builder ) . hideRenamePopup ( ) ; verify ( busyIndicatorView , never ( ) ) . hideBusyIndicator ( ) ; verify ( builder , never ( ) ) . handleDuplicatedFileName ( ) ; "<AssertPlaceHolder>" ; } handleDuplicatedFileName ( ) { showError ( translate ( Constants . CopyPopUpView_FileAlreadyExists , newNameTextBox . getValue ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( error )
|
testLoadAClass ( ) { org . glassfish . hk2 . api . HK2Loader loader = new org . glassfish . hk2 . utilities . HK2LoaderImpl ( ) ; java . lang . Class < ? > loaded = loader . loadClass ( "org.glassfish.hk2.tests.utilities.hk2loader.SimpleService" ) ; "<AssertPlaceHolder>" ; } loadClass ( java . lang . String ) { throw new java . lang . AssertionError ( "not<sp>called" ) ; }
|
org . junit . Assert . assertNotNull ( loaded )
|
testUncleInLawIsAssignableFromChild ( ) { final org . jboss . errai . codegen . meta . MetaClass metaChild = getMetaClass ( org . jboss . errai . codegen . test . model . tree . Child . class ) ; final org . jboss . errai . codegen . meta . MetaClass metaUncleInLaw = getMetaClass ( org . jboss . errai . codegen . test . model . tree . ParentSuperInterface1 . class ) ; "<AssertPlaceHolder>" ; } isAssignableFrom ( org . jboss . errai . codegen . meta . MetaParameterizedType ) { final org . jboss . errai . codegen . meta . MetaType [ ] compareFrom = org . jboss . errai . common . client . api . Assert . notNull ( fromType ) . getTypeParameters ( ) ; final org . jboss . errai . codegen . meta . MetaType [ ] compareTo = getTypeParameters ( ) ; if ( ( compareTo . length ) != ( compareFrom . length ) ) return false ; for ( int i = 0 ; i < ( compareTo . length ) ; i ++ ) { final org . jboss . errai . codegen . meta . MetaType from = compareFrom [ i ] ; final org . jboss . errai . codegen . meta . MetaType to = compareTo [ i ] ; if ( ( from instanceof org . jboss . errai . codegen . meta . MetaClass ) && ( to instanceof org . jboss . errai . codegen . meta . MetaClass ) ) { if ( ! ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( from ) ) . isAssignableTo ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( to ) ) ) ) ) { return false ; } } else if ( to instanceof org . jboss . errai . codegen . meta . MetaParameterizedType ) { return false ; } else if ( to instanceof org . jboss . errai . codegen . meta . MetaWildcardType ) { if ( from instanceof org . jboss . errai . codegen . meta . MetaClass ) { final org . jboss . errai . codegen . meta . MetaClass fromMC = ( ( org . jboss . errai . codegen . meta . MetaClass ) ( from ) ) ; final boolean violatesUpperBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaWildcardType ) ( to ) ) . getUpperBounds ( ) ) . filter ( ( bound ) -> ! ( fromMC . isAssignableTo ( bound ) ) ) . findAny ( ) . isPresent ( ) ; final boolean violatesLowerBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaWildcardType ) ( to ) ) . getLowerBounds ( ) ) . filter ( ( bound ) -> ! ( bound . isAssignableTo ( fromMC ) ) ) . findAny ( ) . isPresent ( ) ; if ( violatesLowerBound || violatesUpperBound ) { return false ; } } else { return false ; } } else if ( ( from instanceof org . jboss . errai . codegen . meta . MetaTypeVariable ) && ( to instanceof org . jboss . errai . codegen . meta . MetaClass ) ) { final boolean hasAssignableUpperBound = org . jboss . errai . codegen . meta . impl . AbstractMetaParameterizedType . getConcreteBounds ( ( ( org . jboss . errai . codegen . meta . MetaTypeVariable ) ( from ) ) . getBounds ( ) ) . filter ( ( fromBound ) -> fromBound . isAssignableFrom ( ( ( org . jboss . errai . codegen . meta . MetaClass ) ( to ) ) ) ) . findAny ( ) . isPresent ( ) ; if ( ! hasAssignableUpperBound ) { return false ; } } } return true ; }
|
org . junit . Assert . assertTrue ( metaUncleInLaw . isAssignableFrom ( metaChild ) )
|
testRetryOnce ( ) { org . easymock . EasyMock . expect ( mockService . makeRequest ( org . easymock . EasyMock . isNull ( ) , org . easymock . EasyMock . isNull ( ) ) ) . andThrow ( new java . io . IOException ( ) ) . once ( ) ; org . easymock . EasyMock . expect ( mockService . makeRequest ( org . easymock . EasyMock . isNull ( ) , org . easymock . EasyMock . isNull ( ) ) ) . andReturn ( null ) . once ( ) ; org . easymock . EasyMock . replay ( mockService ) ; try ( com . facebook . buck . slb . RetryingHttpService service = createRetryingService ( 1 ) ) { com . facebook . buck . slb . HttpResponse response = service . makeRequest ( null , null ) ; "<AssertPlaceHolder>" ; } org . easymock . EasyMock . verify ( mockService ) ; } makeRequest ( ThriftRequest extends org . apache . thrift . TBase , ThriftResponse extends org . apache . thrift . TBase ) { makeRequestSync ( com . facebook . buck . slb . HybridThriftRequestHandler . createWithoutPayloads ( thriftRequest ) , com . facebook . buck . slb . HybridThriftResponseHandler . createNoPayloadHandler ( thriftResponse ) ) ; }
|
org . junit . Assert . assertNull ( response )
|
autorisatieOngeldigStelselBrpDatumOvergangLeeg ( ) { toegangLeveringsAutorisatie . getLeveringsautorisatie ( ) . setStelsel ( Stelsel . BRP ) ; toegangLeveringsAutorisatie . getGeautoriseerde ( ) . getPartij ( ) . setDatumOvergangNaarBrp ( null ) ; final boolean isGeldig = service . isAutorisatieGeldig ( toegangLeveringsAutorisatie , dienst ) ; "<AssertPlaceHolder>" ; } isAutorisatieGeldig ( nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie , nl . bzk . algemeenbrp . dal . domein . brp . entity . Dienst ) { if ( prevalideer ( toegang , dienst ) ) { return false ; } final nl . bzk . algemeenbrp . dal . domein . brp . entity . Leveringsautorisatie leveringsautorisatie = toegang . getLeveringsautorisatie ( ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . PartijRol geautoriseerde = toegang . getGeautoriseerde ( ) ; try { nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertDienstNietGeblokkeerd ( dienst ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertDienstbundelNietGeblokkeerd ( dienst . getDienstbundel ( ) ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertToegangLeveringsAutorisatieNietGeblokkeerd ( toegang ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertLeveringsautorisieNietGeblokkeerd ( leveringsautorisatie ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertDienstGeldig ( dienst ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertDienstbundelGeldig ( dienst . getDienstbundel ( ) ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertToegangLeveringsAutorisatieGeldig ( toegang ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertLeveringsautorisieGeldig ( leveringsautorisatie ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertPartijRolGeldig ( geautoriseerde ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertPartijUitPartijRolGeldig ( geautoriseerde ) ; nl . bzk . brp . service . algemeen . autorisatie . AutorisatieUtil . assertStelselCorrect ( leveringsautorisatie , geautoriseerde . getPartij ( ) , ( ( leveringsautorisatie . getStelsel ( ) ) == ( nl . bzk . algemeenbrp . dal . domein . brp . enums . Stelsel . BRP ) ) ) ; } catch ( nl . bzk . brp . service . algemeen . autorisatie . AutorisatieException e ) { nl . bzk . brp . service . selectie . lezer . job . SelectieAutorisatieServiceImpl . LOGGER . info ( ( "Autorisatiefout<sp>voor<sp>toegang<sp>leveringsautorisatie<sp>{}<sp>en<sp>dienst<sp>{}:<sp>" + e ) , toegang . getId ( ) , dienst . getId ( ) ) ; return false ; } return true ; }
|
org . junit . Assert . assertFalse ( isGeldig )
|
testRenameValues4FunctionsExceptGlobalMap ( ) { java . lang . String testString = "\"Hello<sp>\"<sp>+<sp>context.getProperty(\"World\")<sp>+<sp>property.get(\"World\")<sp>+<sp>globalMap.get(\"World\")<sp>+<sp>context.getProperty(\"World2\")<sp>+<sp>property.get(\"World2\")<sp>+<sp>globalMap.get(\"World2\")" ; java . lang . String expectedValue = "\"Hello<sp>\"<sp>+<sp>context.getProperty(\"World1\")<sp>+<sp>property.get(\"World1\")<sp>+<sp>globalMap.get(\"World1\")<sp>+<sp>context.getProperty(\"World2\")<sp>+<sp>property.get(\"World2\")<sp>+<sp>globalMap.get(\"World2\")" ; java . lang . String resultValue = org . talend . core . model . utils . ParameterValueUtil . renameValues ( testString , "World" , "World1" , false ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org . talend . repository . items . importexport . handlers . model . ImportItem ) ) { return false ; } org . talend . repository . items . importexport . handlers . model . ImportItem other = ( ( org . talend . repository . items . importexport . handlers . model . ImportItem ) ( obj ) ) ; if ( ( this . path ) == null ) { if ( ( other . path ) != null ) { return false ; } } else if ( ! ( this . path . equals ( other . path ) ) ) { return false ; } return true ; }
|
org . junit . Assert . assertTrue ( expectedValue . equals ( resultValue ) )
|
saveRetrySaved ( ) { com . psddev . dari . h2 . WriteModel model = new com . psddev . dari . h2 . WriteModel ( ) ; model . save ( ) ; com . psddev . dari . db . Query . from ( com . psddev . dari . h2 . WriteModel . class ) . deleteAll ( ) ; model . save ( ) ; "<AssertPlaceHolder>" ; } from ( java . lang . Class ) { return new com . psddev . dari . db . Query < T > ( ( objectClass != null ? objectClass . getName ( ) : null ) , objectClass ) ; }
|
org . junit . Assert . assertThat ( com . psddev . dari . db . Query . from ( com . psddev . dari . h2 . WriteModel . class ) . first ( ) , is ( model ) )
|
shouldManageRecordWithNullMessage ( ) { java . util . logging . LogRecord record = fr . xephi . authme . output . ConsoleFilterTest . createRecord ( null ) ; boolean result = filter . isLoggable ( record ) ; "<AssertPlaceHolder>" ; verify ( record , never ( ) ) . setMessage ( "User<sp>issued<sp>an<sp>AuthMe<sp>command" ) ; } isLoggable ( java . util . logging . LogRecord ) { if ( ( record == null ) || ( ( record . getMessage ( ) ) == null ) ) { return true ; } if ( fr . xephi . authme . output . LogFilterHelper . isSensitiveAuthMeCommand ( record . getMessage ( ) ) ) { java . lang . String playerName = record . getMessage ( ) . split ( "<sp>" ) [ 0 ] ; record . setMessage ( ( playerName + "<sp>issued<sp>an<sp>AuthMe<sp>command" ) ) ; } return true ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( true ) )
|
testUndoTaskAssignmentByDocumentListAndUserId ( ) { java . util . List < qa . qcri . aidr . dbmanager . dto . DocumentDTO > documentDTOs = new java . util . ArrayList < qa . qcri . aidr . dbmanager . dto . DocumentDTO > ( ) ; documentDTOs . add ( qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestTaskAssignmentResourceFacadeImp . documentDTO ) ; qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestTaskAssignmentResourceFacadeImp . entityManager . getTransaction ( ) . begin ( ) ; int result = qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestTaskAssignmentResourceFacadeImp . taskAssignmentResourceFacadeImp . undoTaskAssignment ( documentDTOs , qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestTaskAssignmentResourceFacadeImp . user . getUserID ( ) ) ; qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestTaskAssignmentResourceFacadeImp . entityManager . getTransaction ( ) . commit ( ) ; "<AssertPlaceHolder>" ; qa . qcri . aidr . dbmanager . ejb . remote . facade . imp . TestTaskAssignmentResourceFacadeImp . taskAssignment = null ; } getUserID ( ) { return userID ; }
|
org . junit . Assert . assertEquals ( 1 , result )
|
testExplainTwice ( ) { com . splicemachine . derby . impl . sql . execute . operations . ResultSet rs = methodWatcher . executeQuery ( java . lang . String . format ( "--<sp>some<sp>comments<sp>\n<sp>explain\nupdate<sp>%s<sp>set<sp>i<sp>=<sp>0<sp>where<sp>i<sp>=<sp>1" , this . getTableReference ( com . splicemachine . derby . impl . sql . execute . operations . ExplainPlanIT . TABLE_NAME ) ) ) ; int count1 = 0 ; while ( rs . next ( ) ) { ++ count1 ; } rs . close ( ) ; rs = methodWatcher . executeQuery ( java . lang . String . format ( "--<sp>some<sp>comments<sp>\n<sp>explain\nupdate<sp>%s<sp>set<sp>i<sp>=<sp>0<sp>where<sp>i<sp>=<sp>1" , this . getTableReference ( com . splicemachine . derby . impl . sql . execute . operations . ExplainPlanIT . TABLE_NAME ) ) ) ; int count2 = 0 ; while ( rs . next ( ) ) { ++ count2 ; } "<AssertPlaceHolder>" ; } next ( ) { return stepNext ( true ) ; }
|
org . junit . Assert . assertTrue ( ( count1 == count2 ) )
|
uranus_should_have_quality_metrics ( ) { java . lang . String [ ] metrics = new java . lang . String [ ] { "coverage" , "ncloc" , "violations_density" , "it_coverage" } ; fr . norad . visuwall . api . domain . quality . QualityResult qualityResult = connection . analyzeQuality ( fr . norad . visuwall . plugin . demo . SoftwareProjectIds . uranus , metrics ) ; fr . norad . visuwall . api . domain . quality . QualityMeasure coverageMeasure = new fr . norad . visuwall . api . domain . quality . QualityMeasure ( ) ; coverageMeasure . setKey ( "coverage" ) ; coverageMeasure . setName ( "Coverage" ) ; coverageMeasure . setFormattedValue ( "76.5<sp>%" ) ; coverageMeasure . setValue ( 76.5 ) ; "<AssertPlaceHolder>" ; } getMeasure ( java . lang . String ) { return measures . get ( key ) ; }
|
org . junit . Assert . assertEquals ( coverageMeasure , qualityResult . getMeasure ( "coverage" ) )
|
CompareNumberOfDependenciesBetweenModules_Domain_Presentation ( ) { java . lang . String fromModule = "Domain" ; java . lang . String toModule = "Presentation" ; int numberOfDependencies = getNumberofDependenciesBetweenModulesInIntendedArchitecture ( fromModule , toModule ) ; "<AssertPlaceHolder>" ; } getNumberofDependenciesBetweenModulesInIntendedArchitecture ( java . lang . String , java . lang . String ) { husaccttest . define . DefineServicesTest_SRMA . analyseService = husacct . ServiceProvider . getInstance ( ) . getAnalyseService ( ) ; husaccttest . define . DefineServicesTest_SRMA . defineService = husacct . ServiceProvider . getInstance ( ) . getDefineService ( ) ; java . util . HashSet < java . lang . String > physicalFromClassPaths = husaccttest . define . DefineServicesTest_SRMA . defineService . getModule_AllPhysicalClassPathsOfModule ( fromModule ) ; java . util . HashSet < java . lang . String > physicalToClassPaths = husaccttest . define . DefineServicesTest_SRMA . defineService . getModule_AllPhysicalClassPathsOfModule ( toModule ) ; java . util . ArrayList < husacct . common . dto . DependencyDTO > allFoundDependencies = new java . util . ArrayList < husacct . common . dto . DependencyDTO > ( ) ; for ( java . lang . String fromPackages : physicalFromClassPaths ) { for ( java . lang . String toPackages : physicalToClassPaths ) { for ( husacct . common . dto . DependencyDTO dependency : husaccttest . define . DefineServicesTest_SRMA . analyseService . getDependenciesFromSoftwareUnitToSoftwareUnit ( fromPackages , toPackages ) ) { allFoundDependencies . add ( dependency ) ; } } } int numberOfDependencies = allFoundDependencies . size ( ) ; return numberOfDependencies ; }
|
org . junit . Assert . assertTrue ( ( numberOfDependencies == 16 ) )
|
testRemoveRaster ( ) { axisMapping . addRasterName ( "algal" , "algal_1" ) ; axisMapping . addRasterName ( "algal" , "algal2" ) ; axisMapping . removeRasterName ( "algal" , "algal2" ) ; final java . util . List < java . lang . String > rasterNames = axisMapping . getRasterNames ( "algal" ) ; final java . util . List < java . lang . String > expectedRasterNames = new java . util . ArrayList < java . lang . String > ( 1 ) ; expectedRasterNames . add ( "algal_1" ) ; "<AssertPlaceHolder>" ; } add ( org . esa . beam . binning . TemporalBin ) { if ( ( size ) >= ( numberOfBins ) ) { throw new java . lang . IllegalStateException ( "Number<sp>of<sp>add<sp>operation<sp>exceeds<sp>maximum<sp>number<sp>of<sp>bins" ) ; } synchronized ( currentBinList ) { try { int currentFileIndex = calculateFileIndex ( size ) ; if ( currentFileIndex != ( lastFileIndex ) ) { writeBinList ( lastFileIndex , currentBinList ) ; currentBinList . clear ( ) ; readBinList ( currentFileIndex , currentBinList ) ; lastFileIndex = currentFileIndex ; } currentBinList . add ( temporalBin ) ; } catch ( java . io . IOException e ) { org . esa . beam . binning . operator . TemporalBinList . logger . log ( Level . SEVERE , "Error<sp>adding<sp>temporal<sp>bins." , e ) ; return false ; } } ( size ) ++ ; return true ; }
|
org . junit . Assert . assertEquals ( expectedRasterNames , rasterNames )
|
testGetParametersWithDefaultEntity ( ) { org . lnu . is . domain . publicactivity . PublicActivity entity = new org . lnu . is . domain . publicactivity . PublicActivity ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; 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 )
|
testRendererWithFormatAndList ( ) { java . lang . String template = "The<sp>names:<sp><names;<sp>format=\"upper\">" ; org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroup ( ) ; group . registerRenderer ( java . lang . String . class , new org . stringtemplate . v4 . StringRenderer ( ) ) ; org . stringtemplate . v4 . ST st = new org . stringtemplate . v4 . ST ( group , template ) ; st . add ( "names" , "ter" ) ; st . add ( "names" , "tom" ) ; st . add ( "names" , "sriram" ) ; java . lang . String expecting = "The<sp>names:<sp>TERTOMSRIRAM" ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expecting , result )
|
testAlert_ios ( ) { cn . jpush . api . push . model . notification . Notification notification = cn . jpush . api . push . model . notification . Notification . newBuilder ( ) . addPlatformNotification ( cn . jpush . api . push . model . notification . IosNotification . alert ( "alert" ) ) . build ( ) ; com . google . gson . JsonObject json = new com . google . gson . JsonObject ( ) ; com . google . gson . JsonObject ios = new com . google . gson . JsonObject ( ) ; ios . add ( "alert" , new com . google . gson . JsonPrimitive ( "alert" ) ) ; ios . add ( "sound" , new com . google . gson . JsonPrimitive ( "" ) ) ; ios . add ( "badge" , new com . google . gson . JsonPrimitive ( "+1" ) ) ; json . add ( "ios" , ios ) ; "<AssertPlaceHolder>" ; } toJSON ( ) { com . google . gson . JsonObject json = super . toJSON ( ) . getAsJsonObject ( ) ; if ( ! ( badgeDisabled ) ) { if ( null != ( badge ) ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . BADGE , new com . google . gson . JsonPrimitive ( this . badge ) ) ; } else { json . add ( cn . jpush . api . push . model . notification . IosNotification . BADGE , new com . google . gson . JsonPrimitive ( cn . jpush . api . push . model . notification . IosNotification . DEFAULT_BADGE ) ) ; } } if ( ! ( soundDisabled ) ) { if ( null != ( sound ) ) { if ( ( sound ) instanceof java . lang . String ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . SOUND , new com . google . gson . JsonPrimitive ( ( ( java . lang . String ) ( sound ) ) ) ) ; } else if ( ( sound ) instanceof com . google . gson . JsonObject ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . SOUND , ( ( com . google . gson . JsonObject ) ( sound ) ) ) ; } } else { json . add ( cn . jpush . api . push . model . notification . IosNotification . SOUND , new com . google . gson . JsonPrimitive ( cn . jpush . api . push . model . notification . IosNotification . DEFAULT_SOUND ) ) ; } } if ( contentAvailable ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . CONTENT_AVAILABLE , new com . google . gson . JsonPrimitive ( true ) ) ; } if ( null != ( category ) ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . CATEGORY , new com . google . gson . JsonPrimitive ( category ) ) ; } if ( mutableContent ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . MUTABLE_CONTENT , new com . google . gson . JsonPrimitive ( true ) ) ; } if ( null != ( threadId ) ) { json . add ( cn . jpush . api . push . model . notification . IosNotification . THREAD_ID , new com . google . gson . JsonPrimitive ( threadId ) ) ; } return json ; }
|
org . junit . Assert . assertEquals ( "" , json , notification . toJSON ( ) )
|
testIsLogTableDefinedLogTableNotDefined ( ) { org . pentaho . di . core . database . DatabaseMeta databaseMeta = mock ( org . pentaho . di . core . database . DatabaseMeta . class ) ; doReturn ( databaseMeta ) . when ( transLogTable ) . getDatabaseMeta ( ) ; "<AssertPlaceHolder>" ; } isLogTableDefined ( org . pentaho . di . core . logging . TransLogTable ) { return ( ( logTable . getDatabaseMeta ( ) ) != null ) && ( ! ( org . pentaho . di . core . util . Utils . isEmpty ( logTable . getTableName ( ) ) ) ) ; }
|
org . junit . Assert . assertFalse ( delegate . isLogTableDefined ( transLogTable ) )
|
linksInvalid ( ) { "<AssertPlaceHolder>" ; } links ( java . lang . String ) { java . util . ArrayList < java . lang . String > $ = new java . util . ArrayList ( ) ; if ( == null ) return $ ; = com . bugquery . stacktrace . Extract . trace ( ) ; for ( final com . bugquery . stacktrace . Matcher m = com . bugquery . stacktrace . Extract . linkPattern . matcher ( ) ; m . find ( ) ; ) { java . lang . String tmp = m . group ( 0 ) ; $ . add ( tmp . substring ( 1 , ( ( tmp . length ( ) ) - 1 ) ) ) ; } return $ ; }
|
org . junit . Assert . assertEquals ( com . bugquery . stacktrace . Extract . links ( null ) . size ( ) , 0 )
|
testSafety ( ) { try { org . krakenapps . cron . Schedule . Builder safe_builder = new org . krakenapps . cron . Schedule . Builder ( "daily" ) ; org . krakenapps . cron . Schedule safe_test = safe_builder . build ( ) ; System . out . println ( ( "safe_test1" + safe_test ) ) ; safe_builder . set ( CronField . Type . HOUR , "3" ) ; System . out . println ( ( "safe_test2" + safe_test ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ) ; } } build ( ) { header = org . krakenapps . pcap . decoder . netbios . NetBiosNameHeader . makeNameHeader ( ) ; data = org . krakenapps . pcap . decoder . netbios . NetBiosNameData . makeNameData ( ) ; header . setTransactionId ( transactionId ) ; header . setOpcode ( opCode ) ; header . setQuestionCount ( questionCount ) ; header . setAnswerCount ( answerCount ) ; header . setAuthorityCount ( authorityCount ) ; header . setAdditionalCount ( additionalCount ) ; if ( ( questionCount ) > 0 ) { questions = new java . util . ArrayList < org . krakenapps . pcap . decoder . netbios . rr . QuestionResourceRecord > ( questionCount ) ; q = new org . krakenapps . pcap . decoder . netbios . rr . QuestionResourceRecord ( questionName , domainType ) ; q . setCls ( cls ) ; questions . add ( q ) ; data . setQuestions ( questions ) ; } if ( ( answerCount ) > 0 ) { answerResources = new java . util . ArrayList < org . krakenapps . pcap . decoder . netbios . rr . ResourceRecord > ( answerCount ) ; an = create ( anName , anType ) ; answerResources . add ( an ) ; data . setAnswerResources ( answerResources ) ; } if ( ( authorityCount ) > 0 ) { authorityResources = new java . util . ArrayList < org . krakenapps . pcap . decoder . netbios . rr . ResourceRecord > ( authorityCount ) ; au = create ( auName , auType ) ; authorityResources . add ( au ) ; data . setAuthorityResources ( authorityResources ) ; } if ( ( additionalCount ) > 0 ) { additionalResources = new java . util . ArrayList < org . krakenapps . pcap . decoder . netbios . rr . ResourceRecord > ( additionalCount ) ; ad = create ( adName , adType ) ; additionalResources . add ( ad ) ; data . setAdditionalResources ( additionalResources ) ; } org . krakenapps . pcap . decoder . netbios . NetBiosNamePacket p = new org . krakenapps . pcap . decoder . netbios . NetBiosNamePacket ( header , data ) ; return p ; }
|
org . junit . Assert . assertEquals ( safe_test , new org . krakenapps . cron . Schedule . Builder ( "daily" ) . build ( ) )
|
testExecuteWithNullDisplay ( ) { org . eclipse . rap . rwt . internal . lifecycle . PhaseId nextPhase = render . execute ( null ) ; "<AssertPlaceHolder>" ; } execute ( org . eclipse . core . commands . ExecutionEvent ) { java . lang . String cheatSheetId = event . getParameter ( org . eclipse . ui . internal . cheatsheets . handlers . OpenCheatSheetURLHandler . PARAM_ID_CHEAT_SHEET_ID ) ; if ( cheatSheetId == null ) { throw new org . eclipse . core . commands . ExecutionException ( "missing<sp>cheatSheetId<sp>parameter" ) ; } java . lang . String name = event . getParameter ( org . eclipse . ui . internal . cheatsheets . handlers . OpenCheatSheetURLHandler . PARAM_ID_NAME ) ; if ( name == null ) { throw new org . eclipse . core . commands . ExecutionException ( "missing<sp>name<sp>parameter" ) ; } java . lang . String urlText = event . getParameter ( org . eclipse . ui . internal . cheatsheets . handlers . OpenCheatSheetURLHandler . PARAM_ID_URL ) ; if ( urlText == null ) { throw new org . eclipse . core . commands . ExecutionException ( "missing<sp>url<sp>parameter" ) ; } java . net . URL url ; try { url = new java . net . URL ( urlText ) ; } catch ( java . net . MalformedURLException ex ) { throw new org . eclipse . core . commands . ExecutionException ( ( "malformed<sp>url:<sp>" + urlText ) , ex ) ; } org . eclipse . ui . cheatsheets . OpenCheatSheetAction action = new org . eclipse . ui . cheatsheets . OpenCheatSheetAction ( cheatSheetId , name , url ) ; action . run ( ) ; return null ; }
|
org . junit . Assert . assertNull ( nextPhase )
|
testMisconfiguredToolchain ( ) { org . apache . maven . execution . MavenSession session = mock ( org . apache . maven . execution . MavenSession . class ) ; org . apache . maven . execution . MavenExecutionRequest req = new org . apache . maven . execution . DefaultMavenExecutionRequest ( ) ; when ( session . getRequest ( ) ) . thenReturn ( req ) ; org . apache . maven . toolchain . ToolchainPrivate [ ] basics = toolchainManager . getToolchainsForType ( "basic" , session ) ; "<AssertPlaceHolder>" ; } getToolchainsForType ( java . lang . String , org . apache . maven . execution . MavenSession ) { java . util . List < org . apache . maven . toolchain . ToolchainPrivate > toRet = new java . util . ArrayList ( ) ; org . apache . maven . toolchain . ToolchainFactory fact = factories . get ( type ) ; if ( fact == null ) { logger . error ( ( ( "Missing<sp>toolchain<sp>factory<sp>for<sp>type:<sp>" + type ) + ".<sp>Possibly<sp>caused<sp>by<sp>misconfigured<sp>project." ) ) ; } else { java . util . List < org . apache . maven . toolchain . model . ToolchainModel > availableToolchains = context . getRequest ( ) . getToolchains ( ) . get ( type ) ; if ( availableToolchains != null ) { for ( org . apache . maven . toolchain . model . ToolchainModel toolchainModel : availableToolchains ) { toRet . add ( fact . createToolchain ( toolchainModel ) ) ; } } org . apache . maven . toolchain . ToolchainPrivate tool = fact . createDefaultToolchain ( ) ; if ( tool != null ) { toRet . add ( tool ) ; } } return toRet . toArray ( new org . apache . maven . toolchain . ToolchainPrivate [ 0 ] ) ; }
|
org . junit . Assert . assertEquals ( 0 , basics . length )
|
testNull ( ) { final java . lang . String [ ] res = org . eclipse . concierge . Utils . splitString ( null , ',' ) ; "<AssertPlaceHolder>" ; } splitString ( java . lang . String , char , int ) { if ( ( values == null ) || ( ( values . length ( ) ) == 0 ) ) { return org . eclipse . concierge . Utils . EMPTY_STRING_ARRAY ; } final java . util . List < java . lang . String > tokens = new java . util . ArrayList < java . lang . String > ( ( ( values . length ( ) ) / 10 ) ) ; final char [ ] chars = values . toCharArray ( ) ; final int len = chars . length ; int openingQuote = - 1 ; int pointer = 0 ; int curr = 0 ; int matches = 0 ; while ( java . lang . Character . isWhitespace ( chars [ curr ] ) ) { curr ++ ; } pointer = curr ; do { if ( ( chars [ curr ] ) == '\\' ) { curr += 2 ; continue ; } else if ( ( chars [ curr ] ) == '"' ) { if ( openingQuote < 0 ) { openingQuote = curr ; } else { openingQuote = - 1 ; } curr ++ ; continue ; } else if ( ( ( chars [ curr ] ) == delimiter ) && ( openingQuote < 0 ) ) { matches ++ ; if ( matches > limit ) { break ; } int endPointer = curr - 1 ; while ( ( endPointer > 0 ) && ( java . lang . Character . isWhitespace ( chars [ endPointer ] ) ) ) { endPointer -- ; } final int count = ( endPointer - pointer ) + 1 ; if ( count > 0 ) { tokens . add ( new java . lang . String ( chars , pointer , count ) ) ; } curr ++ ; while ( ( curr < len ) && ( java . lang . Character . isWhitespace ( chars [ curr ] ) ) ) { curr ++ ; } pointer = curr ; continue ; } curr ++ ; } while ( curr < len ) ; if ( openingQuote > ( - 1 ) ) { throw new java . lang . IllegalArgumentException ( ( "Unmatched<sp>quotation<sp>mark<sp>at<sp>position<sp>" + openingQuote ) ) ; } int endPointer = len - 1 ; while ( ( endPointer > 0 ) && ( java . lang . Character . isWhitespace ( chars [ endPointer ] ) ) ) { endPointer -- ; } final int count = ( endPointer - pointer ) + 1 ; if ( count > 0 ) { tokens . add ( new java . lang . String ( chars , pointer , count ) ) ; } return tokens . toArray ( new java . lang . String [ tokens . size ( ) ] ) ; }
|
org . junit . Assert . assertEquals ( res . length , 0 )
|
testConvert ( ) { java . lang . Long adminUnitId = 1L ; org . lnu . is . domain . admin . unit . AdminUnit adminUnit = new org . lnu . is . domain . admin . unit . AdminUnit ( ) ; adminUnit . setId ( adminUnitId ) ; java . lang . Long assetId = 2L ; org . lnu . is . domain . asset . Asset asset = new org . lnu . is . domain . asset . Asset ( ) ; asset . setId ( assetId ) ; java . lang . Long addressTypeId = 3L ; org . lnu . is . domain . address . type . AddressType addressType = new org . lnu . is . domain . address . type . AddressType ( ) ; addressType . setId ( addressTypeId ) ; java . lang . Long streetTypeId = 4L ; org . lnu . is . domain . street . type . StreetType streetType = new org . lnu . is . domain . street . type . StreetType ( ) ; streetType . setId ( streetTypeId ) ; java . lang . String zipCode = "zip<sp>code" ; java . lang . String street = "street" ; java . lang . String house = "house" ; java . lang . String apartment = "apartment" ; org . lnu . is . resource . asset . address . AssetAddressResource source = new org . lnu . is . resource . asset . address . AssetAddressResource ( ) ; source . setAdminUnitId ( adminUnitId ) ; source . setAssetId ( assetId ) ; source . setAddressTypeId ( addressTypeId ) ; source . setStreetTypeId ( streetTypeId ) ; source . setZipCode ( zipCode ) ; source . setStreet ( street ) ; source . setHouse ( house ) ; source . setApartment ( apartment ) ; org . lnu . is . domain . asset . address . AssetAddress expected = new org . lnu . is . domain . asset . address . AssetAddress ( ) ; expected . setAdminUnit ( adminUnit ) ; expected . setAsset ( asset ) ; expected . setAddressType ( addressType ) ; expected . setStreetType ( streetType ) ; expected . setZipCode ( zipCode ) ; expected . setStreet ( street ) ; expected . setHouse ( house ) ; expected . setApartment ( apartment ) ; org . lnu . is . domain . asset . address . AssetAddress actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testIsConstraintValuePredicateWhenConstraintValueIsPredicate ( ) { when ( plugin . constraintValue ( ) ) . thenReturn ( BaseSingleFieldConstraint . TYPE_PREDICATE ) ; "<AssertPlaceHolder>" ; } isConstraintValuePredicate ( ) { return ( plugin ( ) . constraintValue ( ) ) == ( org . drools . workbench . models . datamodel . rule . BaseSingleFieldConstraint . TYPE_PREDICATE ) ; }
|
org . junit . Assert . assertTrue ( page . isConstraintValuePredicate ( ) )
|
should_count_with_attributes ( ) { org . apache . deltaspike . data . test . domain . Simple simple = testData . createSimple ( "testFindAll1" , java . lang . Integer . valueOf ( 55 ) ) ; testData . createSimple ( "testFindAll2" , java . lang . Integer . valueOf ( 55 ) ) ; java . lang . Long result = repo . count ( simple , Simple_ . name , Simple_ . counter ) ; "<AssertPlaceHolder>" ; } valueOf ( java . lang . String ) { return org . apache . deltaspike . core . api . projectstage . ProjectStage . projectStages . get ( projectStageClassName ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Long . valueOf ( 1 ) , result )
|
canFormatListOfStrings ( ) { java . lang . String entity = json . assemble ( org . neo4j . server . rest . repr . ListRepresentation . strings ( "hello" , "world" ) ) ; java . lang . String expectedString = org . neo4j . server . rest . domain . JsonHelper . createJsonFrom ( java . util . Arrays . asList ( "hello" , "world" ) ) ; "<AssertPlaceHolder>" ; } asList ( U [ ] , java . util . function . Function ) { return ( ) -> new Iterator < org . neo4j . kernel . impl . util . V > ( ) { private int index ; @ java . lang . Override public boolean hasNext ( ) { return ( index ) < values . length ; } @ java . lang . Override public org . neo4j . kernel . impl . util . V next ( ) { return mapper . apply ( values [ ( ( index ) ++ ) ] ) ; } } ; }
|
org . junit . Assert . assertEquals ( expectedString , entity )
|
shouldReturnExpectedURLValidatorWhenDisabledSecureConnectionIsTrue ( ) { "<AssertPlaceHolder>" ; } urlValidatorValueOf ( boolean ) { return isDisabledSecureConnection ? uk . gov . pay . api . validation . URLValidator . SECURITY_DISABLED : uk . gov . pay . api . validation . URLValidator . SECURITY_ENABLED ; }
|
org . junit . Assert . assertThat ( uk . gov . pay . api . validation . URLValidator . urlValidatorValueOf ( true ) , org . hamcrest . core . Is . is ( uk . gov . pay . api . validation . URLValidator . SECURITY_DISABLED ) )
|
getAllObs_shouldGetBothChildAndParentObsAfterRemovingChildFromParentGrouping ( ) { org . openmrs . Encounter enc = new org . openmrs . Encounter ( ) ; org . openmrs . Obs parentObs = new org . openmrs . Obs ( ) ; enc . addObs ( parentObs ) ; org . openmrs . Obs childObs = new org . openmrs . Obs ( ) ; parentObs . addGroupMember ( childObs ) ; childObs . setEncounter ( enc ) ; enc . addObs ( childObs ) ; parentObs . removeGroupMember ( childObs ) ; "<AssertPlaceHolder>" ; } getAllObs ( boolean ) { if ( includeVoided && ( ( obs ) != null ) ) { return obs ; } java . util . Set < org . openmrs . Obs > ret = new java . util . LinkedHashSet ( ) ; if ( ( this . obs ) != null ) { ret = this . obs . stream ( ) . filter ( ( o ) -> includeVoided || ( ! ( o . getVoided ( ) ) ) ) . collect ( java . util . stream . Collectors . toSet ( ) ) ; } return ret ; }
|
org . junit . Assert . assertEquals ( 2 , enc . getAllObs ( true ) . size ( ) )
|
evaluateHold ( ) { org . alfresco . service . cmr . repository . NodeRef nodeRef = generateNodeRef ( ) ; when ( mockedHoldService . isHold ( nodeRef ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; verify ( mockedHoldService , times ( 1 ) ) . isHold ( nodeRef ) ; verify ( mockedFreezeService , never ( ) ) . isFrozen ( nodeRef ) ; verify ( mockedFreezeService , never ( ) ) . hasFrozenChildren ( nodeRef ) ; } evaluate ( org . alfresco . service . cmr . repository . NodeRef ) { return evaluateImpl ( nodeRef ) ; }
|
org . junit . Assert . assertTrue ( condition . evaluate ( nodeRef ) )
|
testExportImportBoolean ( ) { java . lang . String booleanKey = "booleanKey" ; _dictionary . put ( booleanKey , true ) ; exportImportProperties ( _dictionary ) ; java . util . Dictionary dictionary = _configuration . getProperties ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return com . liferay . journal . content . search . web . configuration . JournalContentSearchWebConfigurationUtil . _configuration . get ( key ) ; }
|
org . junit . Assert . assertTrue ( ( ( boolean ) ( dictionary . get ( booleanKey ) ) ) )
|
test_serialization ( ) { org . joda . money . CurrencyUnit cu = org . joda . money . CurrencyUnit . of ( "GBP" ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; try ( java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( baos ) ) { oos . writeObject ( cu ) ; oos . close ( ) ; java . io . ObjectInputStream ois = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ) ; org . joda . money . CurrencyUnit input = ( ( org . joda . money . CurrencyUnit ) ( ois . readObject ( ) ) ) ; "<AssertPlaceHolder>" ; } } of ( java . util . Currency ) { org . joda . money . MoneyUtils . checkNotNull ( currency , "Currency<sp>must<sp>not<sp>be<sp>null" ) ; return org . joda . money . CurrencyUnit . of ( currency . getCurrencyCode ( ) ) ; }
|
org . junit . Assert . assertEquals ( cu , input )
|
testDivide ( ) { java . math . BigDecimal valor1 = new java . math . BigDecimal ( "271.489" ) ; java . math . BigDecimal valor2 = new java . math . BigDecimal ( "7.33" ) ; java . math . BigDecimal expResult = new java . math . BigDecimal ( "37.03" ) ; java . math . BigDecimal result = com . chronos . calc . util . Biblioteca . divide ( valor1 , valor2 ) ; "<AssertPlaceHolder>" ; } divide ( java . math . BigDecimal , java . math . BigDecimal ) { java . math . BigDecimal resultado = valor1 . divide ( valor2 , MathContext . DECIMAL64 ) ; resultado = resultado . setScale ( 2 , RoundingMode . DOWN ) ; return resultado ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
test15 ( ) { long modulus = 17 ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 a = cc . redberry . rings . poly . univar . UnivariatePolynomialZ64 . create ( 0 , 6 , 2 , 1 , 10 , 15 , 16 , 15 , 2 , 11 , 13 , 0 , 1 , 15 , 5 , 13 , 8 , 14 , 13 , 14 , 15 , 1 , 1 ) . modulus ( modulus ) ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 b = cc . redberry . rings . poly . univar . UnivariatePolynomialZ64 . create ( 7 , 12 , 12 , 12 , 13 , 2 , 7 , 10 , 7 , 15 , 13 , 1 , 10 , 16 , 6 , 1 ) . modulus ( modulus ) ; cc . redberry . rings . poly . univar . UnivariateDivision . UnivariateDivision . InverseModMonomial invMod = cc . redberry . rings . poly . univar . UnivariateDivision . UnivariateDivision . fastDivisionPreConditioning ( b ) ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 [ ] fast = cc . redberry . rings . poly . univar . UnivariateDivision . UnivariateDivision . divideAndRemainderFast ( a , b , invMod , true ) ; cc . redberry . rings . poly . univar . UnivariatePolynomialZp64 [ ] plain = cc . redberry . rings . poly . univar . UnivariateDivision . UnivariateDivision . divideAndRemainderClassic ( a , b , true ) ; "<AssertPlaceHolder>" ; } divideAndRemainderClassic ( cc . redberry . rings . poly . univar . UnivariatePolynomial , cc . redberry . rings . poly . univar . UnivariatePolynomial , boolean ) { cc . redberry . rings . poly . univar . UnivariatePolynomial < E > [ ] r = cc . redberry . rings . poly . univar . UnivariateDivision . earlyDivideAndRemainderChecks ( dividend , divider , copy ) ; if ( r != null ) return r ; return cc . redberry . rings . poly . univar . UnivariateDivision . divideAndRemainderClassic0 ( dividend , divider , dividend . ring . getOne ( ) , copy ) ; }
|
org . junit . Assert . assertArrayEquals ( fast , plain )
|
shouldAnalyzeReturnsTrueForNonFileTypeAnalyzers ( ) { org . owasp . dependencycheck . AnalysisTask instance = new org . owasp . dependencycheck . AnalysisTask ( new org . owasp . dependencycheck . analyzer . HintAnalyzer ( ) , null , null , null ) ; boolean shouldAnalyze = instance . shouldAnalyze ( ) ; "<AssertPlaceHolder>" ; } shouldAnalyze ( ) { if ( ( analyzer ) instanceof org . owasp . dependencycheck . analyzer . FileTypeAnalyzer ) { final org . owasp . dependencycheck . analyzer . FileTypeAnalyzer fileTypeAnalyzer = ( ( org . owasp . dependencycheck . analyzer . FileTypeAnalyzer ) ( analyzer ) ) ; return fileTypeAnalyzer . accept ( dependency . getActualFile ( ) ) ; } return true ; }
|
org . junit . Assert . assertTrue ( shouldAnalyze )
|
shouldExportMatchNoneQueryWithAllOptions ( ) { com . couchbase . client . java . search . queries . MatchNoneQuery fts = com . couchbase . client . java . search . SearchQuery . matchNone ( ) . boost ( 1.5 ) ; com . couchbase . client . java . search . SearchQuery query = new com . couchbase . client . java . search . SearchQuery ( "foo" , fts ) . limit ( 10 ) ; com . couchbase . client . java . document . json . JsonObject expected = com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "query" , com . couchbase . client . java . document . json . JsonObject . create ( ) . put ( "match_none" , JsonNull . INSTANCE ) . put ( "boost" , 1.5 ) ) . put ( "size" , 10 ) ; "<AssertPlaceHolder>" ; } export ( ) { return "INSERT<sp>INTO<sp>" + ( bucket . toString ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , query . export ( ) )
|
testSplitReverseZoneNames ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; registryDNS = new org . apache . hadoop . registry . server . dns . RegistryDNS ( "TestRegistry" ) ; conf . set ( RegistryConstants . KEY_DNS_DOMAIN , "example.com" ) ; conf . set ( org . apache . hadoop . registry . server . dns . KEY_DNS_SPLIT_REVERSE_ZONE , "true" ) ; conf . set ( org . apache . hadoop . registry . server . dns . KEY_DNS_SPLIT_REVERSE_ZONE_RANGE , "256" ) ; conf . set ( org . apache . hadoop . registry . server . dns . KEY_DNS_ZONE_SUBNET , "172.26.32.0" ) ; conf . set ( org . apache . hadoop . registry . server . dns . KEY_DNS_ZONE_MASK , "172.26.32.0" 0 ) ; conf . setTimeDuration ( RegistryConstants . KEY_DNS_TTL , 30L , TimeUnit . SECONDS ) ; conf . set ( RegistryConstants . KEY_DNS_ZONES_DIR , getClass ( ) . getResource ( "172.26.32.0" 1 ) . getFile ( ) ) ; if ( isSecure ( ) ) { conf . setBoolean ( RegistryConstants . KEY_DNSSEC_ENABLED , true ) ; conf . set ( RegistryConstants . KEY_DNSSEC_PUBLIC_KEY , ( "AwEAAe1Jev0Az1khlQCvf0nud1/CNHQwwPEu8BNchZthdDxKPVn29yrD<sp>" + ( ( "CHoAWjwiGsOSw3SzIPrawSbHzyJsjn0oLBhGrH6QedFGnydoxjNsw3m/<sp>" + "SCmOjR/a7LGBAMDFKqFioi4gOyuN66svBeY+/5uw72+0ei9AQ20gqf6q<sp>" ) + "l9Ozs5bV" ) ) ) ; conf . set ( RegistryConstants . KEY_DNSSEC_PRIVATE_KEY_FILE , getClass ( ) . getResource ( "/test.private" ) . getFile ( ) ) ; } registryDNS . setDomainName ( conf ) ; registryDNS . setDNSSECEnabled ( conf ) ; registryDNS . addSplitReverseZones ( conf , 4 ) ; "<AssertPlaceHolder>" ; } getZoneCount ( ) { return zones . size ( ) ; }
|
org . junit . Assert . assertEquals ( 4 , registryDNS . getZoneCount ( ) )
|
TestGetConfIncludeCommand ( ) { org . apache . hadoop . hdfs . HdfsConfiguration conf = new org . apache . hadoop . hdfs . HdfsConfiguration ( ) ; localFileSys = org . apache . hadoop . fs . FileSystem . getLocal ( conf ) ; org . apache . hadoop . fs . Path workingDir = localFileSys . getWorkingDirectory ( ) ; org . apache . hadoop . fs . Path dir = new org . apache . hadoop . fs . Path ( workingDir , ( ( java . lang . System . getProperty ( "test.build.data" , "target/test/data" ) ) + "/Getconf/" ) ) ; org . apache . hadoop . fs . Path hostsFile = new org . apache . hadoop . fs . Path ( dir , "hosts" ) ; org . apache . hadoop . fs . Path excludeFile = new org . apache . hadoop . fs . Path ( dir , "exclude" ) ; conf . set ( DFSConfigKeys . DFS_HOSTS , hostsFile . toUri ( ) . getPath ( ) ) ; conf . set ( DFSConfigKeys . DFS_HOSTS_EXCLUDE , excludeFile . toUri ( ) . getPath ( ) ) ; writeConfigFile ( hostsFile , null ) ; writeConfigFile ( excludeFile , null ) ; java . lang . String [ ] args = new java . lang . String [ ] { "-includeFile" } ; java . lang . String ret = runTool ( conf , args , true ) ; "<AssertPlaceHolder>" ; cleanupFile ( localFileSys , excludeFile . getParent ( ) ) ; } toUri ( ) { return uri ; }
|
org . junit . Assert . assertEquals ( hostsFile . toUri ( ) . getPath ( ) , ret . trim ( ) )
|
uploadsFile ( ) { java . lang . String FILE_CONTENTS = "Uploaded<sp>file" ; java . io . File testFile = java . io . File . createTempFile ( "webdriver" , "tmp" ) ; testFile . deleteOnExit ( ) ; com . google . common . io . Files . write ( FILE_CONTENTS , testFile , Charsets . UTF_8 ) ; org . openqa . selenium . environment . webserver . AppServerTest . driver . get ( server . whereIs ( "upload.html" ) ) ; org . openqa . selenium . environment . webserver . AppServerTest . driver . findElement ( org . openqa . selenium . By . id ( "upload" ) ) . sendKeys ( testFile . getAbsolutePath ( ) ) ; org . openqa . selenium . environment . webserver . AppServerTest . driver . findElement ( org . openqa . selenium . By . id ( "go" ) ) . submit ( ) ; java . lang . Thread . sleep ( 50 ) ; org . openqa . selenium . environment . webserver . AppServerTest . driver . switchTo ( ) . frame ( "upload_target" ) ; org . openqa . selenium . WebElement body = org . openqa . selenium . environment . webserver . AppServerTest . driver . findElement ( org . openqa . selenium . By . xpath ( "//body" ) ) ; "<AssertPlaceHolder>" ; } getText ( ) { return stb . getText ( ) ; }
|
org . junit . Assert . assertEquals ( FILE_CONTENTS , body . getText ( ) )
|
testDoubleObj ( ) { java . lang . Class < com . j256 . ormlite . field . types . DoubleObjectTypeTest . LocalDoubleObj > clazz = com . j256 . ormlite . field . types . DoubleObjectTypeTest . LocalDoubleObj . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . DoubleObjectTypeTest . LocalDoubleObj , java . lang . Object > dao = createDao ( clazz , true ) ; java . lang . Double val = 1.3313323131221E10 ; java . lang . String valStr = val . toString ( ) ; com . j256 . ormlite . field . types . DoubleObjectTypeTest . LocalDoubleObj foo = new com . j256 . ormlite . field . types . DoubleObjectTypeTest . LocalDoubleObj ( ) ; foo . doubleField = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , val , val , valStr , DataType . DOUBLE_OBJ , com . j256 . ormlite . field . types . DoubleObjectTypeTest . DOUBLE_COLUMN , false , true , false , false , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
|
org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) )
|
testWithDuplicatesAndMinimimSet ( ) { java . util . Collection < org . apache . accumulo . core . security . Authorizations > toMinimize = com . google . common . collect . Lists . newArrayList ( new org . apache . accumulo . core . security . Authorizations ( "A" , "C" , "D" , "E" , "F" ) , new org . apache . accumulo . core . security . Authorizations ( "A" , "B" , "C" , "D" , "E" , "F" ) , new org . apache . accumulo . core . security . Authorizations ( "A" , "B" , "C" , "D" , "E" , "F" ) , new org . apache . accumulo . core . security . Authorizations ( "A" , "C" , "D" , "E" , "F" ) , new org . apache . accumulo . core . security . Authorizations ( "C" , "E" , "F" ) ) ; java . util . LinkedHashSet < org . apache . accumulo . core . security . Authorizations > expected = new java . util . LinkedHashSet ( java . util . Collections . singleton ( new org . apache . accumulo . core . security . Authorizations ( "C" , "E" , "F" ) ) ) ; java . util . Collection < org . apache . accumulo . core . security . Authorizations > actual = datawave . security . util . AuthorizationsMinimizer . minimize ( toMinimize ) ; "<AssertPlaceHolder>" ; } minimize ( java . util . Collection ) { if ( ( authorizations . size ( ) ) > 1 ) { final java . util . LinkedHashSet < java . util . Set < java . lang . String > > allAuths = authorizations . stream ( ) . map ( ( a ) -> a . getAuthorizations ( ) . stream ( ) . map ( java . lang . String :: new ) . collect ( java . util . stream . Collectors . toCollection ( java . util . HashSet :: new ) ) ) . collect ( java . util . stream . Collectors . toCollection ( LinkedHashSet :: new ) ) ; for ( java . util . Iterator < java . util . Set < java . lang . String > > it = allAuths . iterator ( ) ; it . hasNext ( ) ; ) { java . util . Set < java . lang . String > currentSet = it . next ( ) ; if ( allAuths . stream ( ) . filter ( ( a ) -> ( a != currentSet ) && ( ( a . size ( ) ) <= ( currentSet . size ( ) ) ) ) . anyMatch ( currentSet :: containsAll ) ) it . remove ( ) ; } if ( ( allAuths . size ( ) ) < ( authorizations . size ( ) ) ) { authorizations = allAuths . stream ( ) . map ( ( a ) -> new org . apache . accumulo . core . security . Authorizations ( a . toArray ( new java . lang . String [ 0 ] ) ) ) . collect ( java . util . stream . Collectors . toCollection ( LinkedHashSet :: new ) ) ; } } return authorizations ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
shouldRejectWhenTicketIsEmpty ( ) { suspension . getTicket ( ) . setTicketId ( "" ) ; suspension . getTicket ( ) . setComment ( "" ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = lbsvalidator . validate ( suspension , org . openstack . atlas . api . mgmt . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; }
|
org . junit . Assert . assertFalse ( resultMessage ( result , org . openstack . atlas . api . mgmt . validation . validators . POST ) , result . passedValidation ( ) )
|
testConstructorWithConfigurationAndNullCapabilities ( ) { org . openqa . grid . internal . utils . configuration . GridNodeConfiguration config = new org . openqa . grid . internal . utils . configuration . GridNodeConfiguration ( ) ; config . capabilities = null ; org . openqa . grid . common . RegistrationRequest req = new org . openqa . grid . common . RegistrationRequest ( config ) ; "<AssertPlaceHolder>" ; } getConfiguration ( ) { return configuration ; }
|
org . junit . Assert . assertNull ( req . getConfiguration ( ) . capabilities )
|
testReadAndWriteLargeString ( ) { org . gradoop . common . model . impl . properties . PropertyValue p = org . gradoop . common . model . impl . properties . PropertyValue . create ( new java . lang . String ( new byte [ PropertyValue . LARGE_PROPERTY_THRESHOLD ] ) ) ; "<AssertPlaceHolder>" ; } writeAndReadFields ( java . lang . Class , T extends org . apache . flink . types . Value ) { org . apache . commons . io . output . ByteArrayOutputStream outputStream = new org . apache . commons . io . output . ByteArrayOutputStream ( ) ; org . apache . flink . core . memory . DataOutputView outputView = new org . apache . flink . core . memory . DataOutputViewStreamWrapper ( outputStream ) ; in . write ( outputView ) ; outputStream . flush ( ) ; T out ; try { out = clazz . newInstance ( ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; throw new java . io . IOException ( ( "Cannot<sp>initialize<sp>the<sp>class:<sp>" + clazz ) ) ; } java . io . ByteArrayInputStream inputStream = new java . io . ByteArrayInputStream ( outputStream . toByteArray ( ) ) ; org . apache . flink . core . memory . DataInputView inputView = new org . apache . flink . core . memory . DataInputViewStreamWrapper ( inputStream ) ; out . read ( inputView ) ; return out ; }
|
org . junit . Assert . assertEquals ( p , writeAndReadFields ( org . gradoop . common . model . impl . properties . PropertyValue . class , p ) )
|
testParallelMapWith3Versus2Elements ( ) { org . stringtemplate . v4 . STGroup group = new org . stringtemplate . v4 . STGroup ( ) ; group . defineTemplate ( "test" , "names,phones" , "hi<sp><names,phones:{n,p<sp>|<sp><n>:<p>;}>" ) ; org . stringtemplate . v4 . ST st = group . getInstanceOf ( "test" ) ; st . add ( "names" , "Ter" ) ; st . add ( "names" , "Tom" ) ; st . add ( "names" , "Sumana" ) ; st . add ( "phones" , "x5001" ) ; st . add ( "phones" , "x5002" ) ; java . lang . String expected = "x5001" 0 ; java . lang . String result = st . render ( ) ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
subscribeForAnNotAuthenticatedUser ( ) { com . sun . jersey . api . client . WebResource resource = resource ( ) ; try { java . lang . String result = resource . path ( org . silverpeas . core . subscription . web . SubscriptionTestResources . UNSUBSCRIBE_RESOURCE_PATH ) . accept ( MediaType . APPLICATION_JSON ) . post ( java . lang . String . class ) ; org . junit . Assert . fail ( "A<sp>non<sp>authenticated<sp>user<sp>shouldn't<sp>access<sp>the<sp>comment" ) ; } catch ( com . sun . jersey . api . client . UniformInterfaceException ex ) { int recievedStatus = ex . getResponse ( ) . getStatus ( ) ; int unauthorized = Status . UNAUTHORIZED . getStatusCode ( ) ; "<AssertPlaceHolder>" ; } } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
|
org . junit . Assert . assertThat ( recievedStatus , org . hamcrest . Matchers . is ( unauthorized ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.