input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testEquals ( ) { ast . Variable reference = new ast . Variable ( "x" ) ; ast . Variable toTest = new ast . Variable ( "x" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( reference , toTest )
|
testDontSleepIfHasMoreData ( ) { int DEFAULT_SAMPLE_PERIOD_MS = 1000 * 2 ; org . apache . hadoop . chukwa . conf . ChukwaConfiguration cc = new org . apache . hadoop . chukwa . conf . ChukwaConfiguration ( ) ; cc . setInt ( "chukwaAgent.fileTailingAdaptor.maxReadSize" , 18 ) ; agent = org . apache . hadoop . chukwa . datacollection . agent . ChukwaAgent . getAgent ( cc ) ; agent . start ( ) ; org . apache . hadoop . chukwa . datacollection . connector . ChunkCatcherConnector chunks = new org . apache . hadoop . chukwa . datacollection . connector . ChunkCatcherConnector ( ) ; chunks . start ( ) ; java . io . File baseDir = new java . io . File ( java . lang . System . getProperty ( "test.build.data" , "/tmp" ) ) ; testFile = makeTestFile ( "testDontSleepIfHasMoreData" , 1 , baseDir ) ; long startTime = java . lang . System . currentTimeMillis ( ) ; adaptorId = agent . processAddCommand ( ( ( ( "add<sp>adaptor_test<sp>=" + "filetailer.FileTailingAdaptor<sp>testDontSleepIfHasMoreData<sp>" ) + ( testFile . getCanonicalPath ( ) ) ) + "<sp>0" ) ) ; chunks . waitForAChunk ( ) ; chunks . waitForAChunk ( ) ; long endTime = java . lang . System . currentTimeMillis ( ) ; "<AssertPlaceHolder>" ; } waitForAChunk ( ) { return this . waitForAChunk ( 0 ) ; }
|
org . junit . Assert . assertTrue ( ( ( endTime - startTime ) < DEFAULT_SAMPLE_PERIOD_MS ) )
|
testResize ( ) { canvas . addPaintListener ( new org . eclipse . swt . events . PaintListener ( ) { @ org . eclipse . swt . widgets . Override public void paintControl ( org . eclipse . swt . events . PaintEvent event ) { paintEventLog . add ( event ) ; } } ) ; canvas . setSize ( 100 , 100 ) ; "<AssertPlaceHolder>" ; } size ( ) { return new org . eclipse . jface . internal . databinding . swt . ControlSizeProperty ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , paintEventLog . size ( ) )
|
testDeleteAllTenantTableData ( ) { java . sql . Connection conn = nextConnection ( getUrl ( ) ) ; try { conn . setAutoCommit ( true ) ; conn . createStatement ( ) . executeUpdate ( ( "delete<sp>from<sp>" + ( PARENT_TABLE_NAME ) ) ) ; conn . close ( ) ; conn = nextConnection ( getUrl ( ) ) ; conn . setAutoCommit ( true ) ; conn . createStatement ( ) . executeUpdate ( ( ( "upsert<sp>into<sp>" + ( PARENT_TABLE_NAME ) ) + "<sp>(tenant_id,<sp>tenant_type_id,<sp>id,<sp>user)<sp>values<sp>('AC/DC',<sp>'abc',<sp>1,<sp>'Bon<sp>Scott')" ) ) ; conn . createStatement ( ) . executeUpdate ( ( ( ( ( ( ( "upsert<sp>into<sp>" + ( PARENT_TABLE_NAME ) ) + "<sp>(tenant_id,<sp>tenant_type_id,<sp>id,<sp>user)<sp>values<sp>('" ) + ( TENANT_ID ) ) + "',<sp>'" ) + ( TENANT_TYPE_ID ) ) + "',<sp>1,<sp>'Billy<sp>Gibbons')" ) ) ; conn . createStatement ( ) . executeUpdate ( ( ( ( ( "upsert<sp>into<sp>" + ( PARENT_TABLE_NAME ) ) + "<sp>(tenant_id,<sp>tenant_type_id,<sp>id,<sp>user)<sp>values<sp>('" ) + ( TENANT_ID ) ) + "',<sp>'def',<sp>1,<sp>'Billy<sp>Gibbons')" ) ) ; conn . close ( ) ; conn = nextConnection ( org . apache . phoenix . end2end . PHOENIX_JDBC_TENANT_SPECIFIC_URL ) ; analyzeTable ( conn , org . apache . phoenix . end2end . PARENT_TABLE_NAME ) ; conn = nextConnection ( org . apache . phoenix . end2end . PHOENIX_JDBC_TENANT_SPECIFIC_URL ) ; conn . createStatement ( ) . execute ( ( "delete<sp>from<sp>" + ( TENANT_TABLE_NAME ) ) ) ; conn . commit ( ) ; conn . close ( ) ; conn = nextConnection ( getUrl ( ) ) ; java . sql . ResultSet rs = conn . createStatement ( ) . executeQuery ( ( "select<sp>count(*)<sp>from<sp>" + ( PARENT_TABLE_NAME ) ) ) ; rs . next ( ) ; "<AssertPlaceHolder>" ; } finally { conn . close ( ) ; } } getInt ( java . lang . String ) { return getInt ( findColumn ( columnLabel ) ) ; }
|
org . junit . Assert . assertEquals ( 2 , rs . getInt ( 1 ) )
|
testGetNumberOfExecutionSlots ( ) { "<AssertPlaceHolder>" ; } getNumberOfExecutionSlots ( ) { return org . peerbox . app . config . PeerWaspConfig . NUMBER_OF_EXECUTE_SLOTS ; }
|
org . junit . Assert . assertTrue ( ( ( config . getNumberOfExecutionSlots ( ) ) >= 1 ) )
|
testGetTotalRecords ( ) { System . out . println ( "getTotalRecords" ) ; com . pearson . docussandra . domain . event . IndexCreatedEvent instance = com . pearson . docussandra . testhelper . Fixtures . createTestIndexCreationStatus ( ) ; long expResult = 1000L ; long result = instance . getTotalRecords ( ) ; "<AssertPlaceHolder>" ; } getTotalRecords ( ) { return totalRecords ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testGetParametersWithDefaultEntity ( ) { org . lnu . is . domain . specoffer . SpecOfferBenefit entity = new org . lnu . is . domain . specoffer . SpecOfferBenefit ( ) ; 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 )
|
testVoerStapUit ( ) { final nl . bzk . brp . model . operationeel . kern . AdministratieveHandelingModel administratieveHandeling = maakAdministratieveHandelingModel ( ) ; final java . util . List < nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView > personen = java . util . Collections . singletonList ( new nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView ( nl . bzk . brp . util . testpersoonbouwers . TestPersoonJohnnyJordaan . maak ( ) , nl . bzk . brp . model . hisvolledig . predikaat . HistorieVanafPredikaat . geldigOpEnNa ( nl . bzk . brp . model . algemeen . attribuuttype . kern . DatumAttribuut . vandaag ( ) ) ) ) ; final nl . bzk . brp . model . levering . VolledigBericht volledigBericht = new nl . bzk . brp . model . levering . VolledigBericht ( new nl . bzk . brp . model . levering . AdministratieveHandelingSynchronisatie ( administratieveHandeling ) ) ; volledigBericht . getAdministratieveHandeling ( ) . setBijgehoudenPersonen ( personen ) ; getBerichtContext ( ) . setVolledigBericht ( volledigBericht ) ; final boolean stapResultaat = voorkomenFilterStap . voerStapUit ( getOnderwerp ( ) , getBerichtContext ( ) , getResultaat ( ) ) ; "<AssertPlaceHolder>" ; verify ( voorkomenFilterService ) . voerVoorkomenFilterUit ( any ( nl . bzk . brp . model . hisvolledig . predikaatview . kern . PersoonHisVolledigView . class ) , any ( nl . bzk . brp . levering . afnemerindicaties . stappen . persoon . Dienst . class ) ) ; } getResultaat ( ) { return resultaat ; }
|
org . junit . Assert . assertThat ( stapResultaat , org . hamcrest . Matchers . is ( true ) )
|
testEncryptNullPassword ( ) { java . lang . String res = service . encrypt ( null ) ; "<AssertPlaceHolder>" ; } encrypt ( java . lang . String ) { try { javax . crypto . Cipher encCipher = javax . crypto . Cipher . getInstance ( secretKey . getAlgorithm ( ) ) ; encCipher . init ( Cipher . ENCRYPT_MODE , secretKey , paramSpec ) ; byte [ ] toEncryptBytes = clearPassword . getBytes ( org . pentaho . platform . util . messages . LocaleHelper . getSystemEncoding ( ) ) ; byte [ ] encBytes = encCipher . doFinal ( toEncryptBytes ) ; byte [ ] base64Bytes = org . apache . commons . codec . binary . Base64 . encodeBase64 ( encBytes ) ; return new java . lang . String ( base64Bytes ) ; } catch ( java . lang . Exception ex ) { throw new org . pentaho . platform . api . util . PasswordServiceException ( ex ) ; } }
|
org . junit . Assert . assertNull ( res )
|
givenDebugDisabled_whenIsEnabled_thenReturnsFalse ( ) { com . brandwatch . robots . util . LogLevel level = LogLevel . DEBUG ; when ( mockLogger . isDebugEnabled ( ) ) . thenReturn ( false ) ; boolean result = level . isEnabled ( mockLogger ) ; "<AssertPlaceHolder>" ; verify ( mockLogger , only ( ) ) . isDebugEnabled ( ) ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( false ) )
|
testGetIntValue ( ) { final com . allanbank . mongodb . bson . element . LongElement element = new com . allanbank . mongodb . bson . element . LongElement ( "foo" , 1010101 ) ; "<AssertPlaceHolder>" ; } getIntValue ( ) { return ( ( int ) ( myValue ) ) ; }
|
org . junit . Assert . assertEquals ( 1010101 , element . getIntValue ( ) )
|
testDDMFormRenderingContextLocaleIsThemeDisplayLocale ( ) { com . liferay . dynamic . data . mapping . form . web . internal . display . context . DDMFormDisplayContext ddmFormDisplayContext = createDDMFormDisplayContext ( ) ; java . util . Locale defaultLocale = com . liferay . portal . kernel . util . LocaleUtil . BRAZIL ; java . util . Set < java . util . Locale > availableLocales = new java . util . HashSet ( ) ; availableLocales . add ( defaultLocale ) ; availableLocales . add ( LocaleUtil . SPAIN ) ; com . liferay . dynamic . data . mapping . model . DDMForm ddmForm = createDDMForm ( availableLocales , defaultLocale ) ; _request . addParameter ( "languageId" , com . liferay . portal . kernel . util . LocaleUtil . toLanguageId ( LocaleUtil . SPAIN ) ) ; com . liferay . dynamic . data . mapping . form . renderer . DDMFormRenderingContext ddmFormRenderingContext = ddmFormDisplayContext . createDDMFormRenderingContext ( ddmForm ) ; "<AssertPlaceHolder>" ; } getLocale ( ) { com . liferay . portal . kernel . theme . ThemeDisplay themeDisplay = ( ( com . liferay . portal . kernel . theme . ThemeDisplay ) ( _portletRequest . getAttribute ( WebKeys . THEME_DISPLAY ) ) ) ; return themeDisplay . getLocale ( ) ; }
|
org . junit . Assert . assertEquals ( LocaleUtil . SPAIN , ddmFormRenderingContext . getLocale ( ) )
|
test_Zero_USDEquals_Negative_Zero_USD ( ) { com . ripple . core . coretypes . Amount a = com . ripple . core . AmountTest . amt ( "0/USD/rNDKeo9RrCiRdfsMG8AdoZvNZxHASGzbZL" ) ; com . ripple . core . coretypes . Amount b = com . ripple . core . AmountTest . amt ( "-0/USD/rNDKeo9RrCiRdfsMG8AdoZvNZxHASGzbZL" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( o instanceof org . ripple . bouncycastle . asn1 . eac . PackedDate ) ) { return false ; } org . ripple . bouncycastle . asn1 . eac . PackedDate other = ( ( org . ripple . bouncycastle . asn1 . eac . PackedDate ) ( o ) ) ; return org . ripple . bouncycastle . util . Arrays . areEqual ( time , other . time ) ; }
|
org . junit . Assert . assertTrue ( a . equals ( b ) )
|
textToTextConversion ( ) { java . lang . String source = "All<sp>those<sp>moments<sp>will<sp>be<sp>lost<sp>in<sp>time,<sp>like<sp>tears<sp>in<sp>rain." ; byte [ ] sourceAs8859 = source . getBytes ( org . infinispan . commons . dataconversion . ISO_8859_1 ) ; byte [ ] sourceAsASCII = source . getBytes ( org . infinispan . commons . dataconversion . US_ASCII ) ; java . lang . Object result = org . infinispan . commons . dataconversion . StandardConversions . convertTextToText ( sourceAs8859 , org . infinispan . commons . dataconversion . MediaType . TEXT_PLAIN . withCharset ( org . infinispan . commons . dataconversion . ISO_8859_1 ) , org . infinispan . commons . dataconversion . MediaType . TEXT_PLAIN . withCharset ( org . infinispan . commons . dataconversion . US_ASCII ) ) ; "<AssertPlaceHolder>" ; } withCharset ( java . nio . charset . Charset ) { return withParameter ( org . infinispan . commons . dataconversion . MediaType . CHARSET_PARAM_NAME , charset . toString ( ) ) ; }
|
org . junit . Assert . assertArrayEquals ( sourceAsASCII , ( ( byte [ ] ) ( result ) ) )
|
assertWaitUntilConnectionReleaseForTransaction ( ) { final java . util . concurrent . atomic . AtomicBoolean flag = new java . util . concurrent . atomic . AtomicBoolean ( true ) ; java . lang . Thread waitThread = new java . lang . Thread ( new java . lang . Runnable ( ) { @ org . apache . shardingsphere . shardingproxy . backend . communication . jdbc . connection . Override @ lombok . SneakyThrows public void run ( ) { connectionStateHandler . setStatus ( ConnectionStatus . TERMINATED ) ; connectionStateHandler . waitUntilConnectionReleasedIfNecessary ( ) ; if ( ( ConnectionStatus . RUNNING ) != ( connectionStateHandler . getStatus ( ) ) ) { flag . getAndSet ( false ) ; } } } ) ; java . lang . Thread notifyThread = new java . lang . Thread ( new java . lang . Runnable ( ) { @ org . apache . shardingsphere . shardingproxy . backend . communication . jdbc . connection . Override @ lombok . SneakyThrows public void run ( ) { java . lang . Thread . sleep ( 2000 ) ; connectionStateHandler . doNotifyIfNecessary ( ) ; } } ) ; waitThread . start ( ) ; notifyThread . start ( ) ; waitThread . join ( ) ; notifyThread . join ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return io . opentracing . util . GlobalTracer . get ( ) ; }
|
org . junit . Assert . assertTrue ( flag . get ( ) )
|
testAMQPSequence ( ) { org . fusesource . amqp . codec . AMQPSequence in = new org . fusesource . amqp . codec . AMQPSequence ( ) ; in . setValue ( new java . util . ArrayList ( ) ) ; in . getValue ( ) . add ( new org . fusesource . amqp . codec . AMQPString ( "Hello<sp>world!" ) ) ; in . getValue ( ) . add ( new org . fusesource . amqp . codec . AMQPString ( "and<sp>stuff" ) ) ; in . getValue ( ) . add ( new org . fusesource . amqp . codec . AMQPLong ( 123L ) ) ; org . fusesource . amqp . codec . AMQPSequence out = org . fusesource . amqp . codec . TestSupport . writeRead ( in ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( "Wrapper{" + "node=" ) + ( node ) ) + ",<sp>weight=" ) + ( weight ) ) + '}' ; }
|
org . junit . Assert . assertEquals ( in . toString ( ) , out . toString ( ) )
|
injectionContextWithEmptyContext ( ) { com . airhacks . afterburner . injection . PresenterWithField withField = com . airhacks . afterburner . injection . Injector . instantiatePresenter ( com . airhacks . afterburner . injection . PresenterWithField . class ) ; "<AssertPlaceHolder>" ; com . airhacks . afterburner . injection . Injector . forgetAll ( ) ; } getName ( ) { return name ; }
|
org . junit . Assert . assertNull ( withField . getName ( ) )
|
available_onPartiallyReadStream ( ) { final java . lang . String testString = "helloWorld" ; final byte [ ] testData = testString . getBytes ( ) ; java . io . InputStream is = new org . exist . util . io . FastByteArrayInputStream ( testData ) ; org . exist . util . io . CachingFilterInputStream cfis = new org . exist . util . io . CachingFilterInputStream ( getNewCache ( is ) ) ; cfis . read ( ) ; cfis . read ( ) ; "<AssertPlaceHolder>" ; } available ( ) { return bis . available ( ) ; }
|
org . junit . Assert . assertEquals ( ( ( testData . length ) - 2 ) , cfis . available ( ) )
|
testDatumIngangVandaagEnDatumEindeInDeToekomst ( ) { nl . bzk . brp . beheer . webapp . validatie . GenericValidator < nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij > partijValidator = new nl . bzk . brp . beheer . webapp . validatie . GenericValidator ( nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij . class ) ; final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "partij" ) ; final nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij partij = new nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij ( "testPartij" , "012345" ) ; partij . setDatumIngang ( nl . bzk . algemeenbrp . util . common . DatumUtil . vanDatumNaarInteger ( java . time . LocalDate . now ( ) ) ) ; partij . setDatumEinde ( 20991231 ) ; partijValidator . validate ( partij , errors ) ; "<AssertPlaceHolder>" ; } errorCount ( nl . bzk . brp . beheer . webapp . validatie . GenericValidator , nl . bzk . algemeenbrp . dal . domein . brp . entity . Afleidbaar ) { final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "afleidbareEntiteit" ) ; subject . validate ( afleidbareEntiteit , errors ) ; return errors . getErrorCount ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , errorCount ( partijValidator , partij ) )
|
testFindBetweenCondition ( ) { java . util . List < org . sculptor . framework . accessapi . ConditionalCriteria > conditionalCriteria = criteriaFor ( org . sculptor . examples . library . media . domain . Movie . class ) . withProperty ( org . sculptor . examples . library . media . domain . MovieProperties . playLength ( ) ) . between ( 70 ) . to ( 100 ) . build ( ) ; java . util . List < org . sculptor . examples . library . media . domain . Media > found = mediaRepository . findByCondition ( conditionalCriteria ) ; "<AssertPlaceHolder>" ; } build ( ) { assertBraceCount ( ) ; assertOperatorStack ( ) ; java . util . List < org . sculptor . framework . accessapi . ConditionalCriteria > critList = new java . util . ArrayList < org . sculptor . framework . accessapi . ConditionalCriteria > ( ) ; for ( org . sculptor . framework . accessapi . ConditionalCriteria singleCrit : criteriaStack . asList ( ) ) { if ( ( singleCrit . getOperator ( ) ) == ( org . sculptor . framework . accessapi . ConditionalCriteria . Operator . And ) ) { if ( ( singleCrit . getFirstOperant ( ) ) instanceof java . util . List ) { critList . addAll ( ( ( java . util . List < org . sculptor . framework . accessapi . ConditionalCriteria > ) ( singleCrit . getFirstOperant ( ) ) ) ) ; } else { critList . add ( ( ( org . sculptor . framework . accessapi . ConditionalCriteria ) ( singleCrit . getFirstOperant ( ) ) ) ) ; critList . add ( ( ( org . sculptor . framework . accessapi . ConditionalCriteria ) ( singleCrit . getSecondOperant ( ) ) ) ) ; } } else { critList . add ( singleCrit ) ; } } return critList ; }
|
org . junit . Assert . assertEquals ( 2 , found . size ( ) )
|
initEmptyPlatformProtocolMap ( ) { java . util . Set < java . lang . String > platformProtocols = java . util . Collections . emptySet ( ) ; "<AssertPlaceHolder>" ; } initPlatformProtocolMap ( java . util . Set ) { java . util . Map < java . lang . Integer , org . kaaproject . kaa . server . sync . platform . PlatformEncDec > platformEncDecMap = new java . util . HashMap ( ) ; for ( java . lang . String platformProtocol : platformProtocols ) { try { java . lang . Class < ? > clazz = java . lang . Class . forName ( platformProtocol ) ; org . kaaproject . kaa . server . sync . platform . PlatformEncDec protocol = ( ( org . kaaproject . kaa . server . sync . platform . PlatformEncDec ) ( clazz . newInstance ( ) ) ) ; platformEncDecMap . put ( protocol . getId ( ) , protocol ) ; org . kaaproject . kaa . server . sync . platform . PlatformLookup . LOG . info ( "Successfully<sp>initialized<sp>platform<sp>protocol<sp>{}" , platformProtocol ) ; } catch ( java . lang . ReflectiveOperationException exception ) { org . kaaproject . kaa . server . sync . platform . PlatformLookup . LOG . error ( "Error<sp>during<sp>instantiation<sp>of<sp>platform<sp>protocol" , exception ) ; } } return platformEncDecMap ; }
|
org . junit . Assert . assertTrue ( org . kaaproject . kaa . server . sync . platform . PlatformLookup . initPlatformProtocolMap ( platformProtocols ) . isEmpty ( ) )
|
testCompareIm2ColImpl ( ) { int [ ] miniBatches = new int [ ] { 1 , 3 , 5 } ; int [ ] depths = new int [ ] { 1 , 3 , 5 } ; int [ ] inHeights = new int [ ] { 5 , 21 } ; int [ ] inWidths = new int [ ] { 5 , 21 } ; int [ ] strideH = new int [ ] { 1 , 2 } ; int [ ] strideW = new int [ ] { 1 , 2 } ; int [ ] sizeW = new int [ ] { 1 , 2 , 3 } ; int [ ] sizeH = new int [ ] { 1 , 2 , 3 } ; int [ ] padH = new int [ ] { 0 , 1 , 2 } ; int [ ] padW = new int [ ] { 0 , 1 , 2 } ; boolean [ ] coverall = new boolean [ ] { false , true } ; org . nd4j . linalg . api . buffer . DataBuffer [ ] types = new org . nd4j . linalg . api . buffer . DataBuffer . Type [ ] { DataBuffer . Type . FLOAT , DataBuffer . Type . DOUBLE , DataBuffer . Type . FLOAT , DataBuffer . Type . DOUBLE } ; org . nd4j . linalg . api . buffer . DataBuffer [ ] modes = new org . nd4j . linalg . api . buffer . DataBuffer . AllocationMode [ ] { DataBuffer . AllocationMode . HEAP , DataBuffer . AllocationMode . HEAP , DataBuffer . AllocationMode . DIRECT , DataBuffer . AllocationMode . DIRECT } ; java . lang . String factoryClassName = org . nd4j . linalg . factory . Nd4j . factory ( ) . getClass ( ) . toString ( ) . toLowerCase ( ) ; if ( ( factoryClassName . contains ( "jcublas" ) ) || ( factoryClassName . contains ( "cuda" ) ) ) { types = new org . nd4j . linalg . api . buffer . DataBuffer . Type [ ] { DataBuffer . Type . FLOAT , DataBuffer . Type . DOUBLE } ; modes = new org . nd4j . linalg . api . buffer . DataBuffer . AllocationMode [ ] { DataBuffer . AllocationMode . DIRECT , DataBuffer . AllocationMode . DIRECT } ; } org . nd4j . linalg . api . buffer . DataBuffer . Type initialType = org . nd4j . linalg . factory . Nd4j . dataType ( ) ; for ( int i = 0 ; i < ( types . length ) ; i ++ ) { org . nd4j . linalg . api . buffer . DataBuffer . Type type = types [ i ] ; org . nd4j . linalg . api . buffer . DataBuffer . AllocationMode mode = modes [ i ] ; org . nd4j . linalg . api . buffer . util . DataTypeUtil . setDTypeForContext ( type ) ; org . nd4j . linalg . factory . Nd4j . alloc = mode ; org . nd4j . linalg . api . buffer . util . AllocUtil . setAllocationModeForContext ( mode ) ; for ( int m : miniBatches ) { for ( int d : depths ) { for ( int h : inHeights ) { for ( int w : inWidths ) { for ( int sh : strideH ) { for ( int sw : strideW ) { for ( int kh : sizeH ) { for ( int kw : sizeW ) { for ( int ph : padH ) { for ( int pw : padW ) { if ( ( ( ( ( w - kw ) + ( 2 * pw ) ) % sw ) != 0 ) || ( ( ( ( h - kh ) + ( 2 * ph ) ) % sh ) != 0 ) ) continue ; System . out . println ( ( ( ( ( ( ( ( "Running<sp>" + m ) + "<sp>" ) + d ) + "<sp>" ) + h ) + "<sp>" ) + w ) ) ; for ( boolean cAll : coverall ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { m , d , h , w } ) ; org . nd4j . linalg . api . ndarray . INDArray outOrig = org . nd4j . linalg . convolution . OldConvolution . im2col ( in , kh , kw , sh , sw , ph , pw , ( - 1 ) , cAll ) ; org . nd4j . linalg . api . ndarray . INDArray outNew = org . nd4j . linalg . convolution . Convolution . im2col ( in , kh , kw , sh , sw , ph , pw , cAll ) ; "<AssertPlaceHolder>" ; } } } } } } } } } } } } org . nd4j . linalg . api . buffer . util . DataTypeUtil . setDTypeForContext ( initialType ) ; } im2col ( org . nd4j . linalg . api . ndarray . INDArray , int , int , int , int , int , int , boolean ) { return org . nd4j . linalg . convolution . Convolution . im2col ( img , kh , kw , sy , sx , ph , pw , 1 , 1 , isSameMode ) ; }
|
org . junit . Assert . assertEquals ( outOrig , outNew )
|
testComputeIndexMapZero ( ) { int [ ] expectedIndexMap = new int [ ] { } ; org . apache . avro . Schema designSchema = org . apache . avro . SchemaBuilder . record ( "Record" ) . fields ( ) . endRecord ( ) ; org . talend . codegen . enforcer . IndexMapperByIndex indexMapper = new org . talend . codegen . enforcer . IndexMapperByIndex ( designSchema ) ; int [ ] actualIndexMap = indexMapper . computeIndexMap ( null ) ; "<AssertPlaceHolder>" ; } computeIndexMap ( org . apache . avro . Schema ) { int [ ] indexMap = new int [ ( designSchemaSize ) + 1 ] ; indexMap [ dynamicFieldPosition ] = DYNAMIC ; for ( int i = 0 ; i < ( designSchemaSize ) ; i ++ ) { org . apache . avro . Schema . Field designField = designFields . get ( i ) ; java . lang . String fieldName = designField . name ( ) ; org . apache . avro . Schema . Field runtimeField = runtimeSchema . getField ( fieldName ) ; if ( i < ( dynamicFieldPosition ) ) { indexMap [ i ] = ( runtimeField != null ) ? runtimeField . pos ( ) : MISSING_DESIGN_FIELD ; } else { indexMap [ ( i + 1 ) ] = ( runtimeField != null ) ? runtimeField . pos ( ) : MISSING_DESIGN_FIELD ; } } return indexMap ; }
|
org . junit . Assert . assertArrayEquals ( expectedIndexMap , actualIndexMap )
|
testToString ( ) { org . opencastproject . job . api . Job newJob = new org . opencastproject . job . api . JobImpl ( 3L , "test" , "test_org" , 0L , "simple" , "do" , null , DISPATCHING , "localhost" , "remotehost" , null , null , null , 100L , 200L , "result" , 3L , 1L , true , null , 1.5F ) ; org . opencastproject . job . jpa . JpaJob jpaJob = org . opencastproject . job . jpa . JpaJob . from ( newJob ) ; java . lang . String jobString = "Job<sp>{id:3,<sp>operation:do,<sp>status:DISPATCHING}" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( name ) + "<sp><" ) + ( address ) ) + ">" ; }
|
org . junit . Assert . assertEquals ( jpaJob . toString ( ) , jobString )
|
getAttributeCount ( ) { int expected = 10 ; when ( this . reader . getAttributeCount ( ) ) . thenReturn ( expected ) ; int result = this . filter . getAttributeCount ( ) ; "<AssertPlaceHolder>" ; } getAttributeCount ( ) { int expected = 10 ; when ( this . reader . getAttributeCount ( ) ) . thenReturn ( expected ) ; int result = this . filter . getAttributeCount ( ) ; org . junit . Assert . assertSame ( expected , result ) ; }
|
org . junit . Assert . assertSame ( expected , result )
|
testSoftmax ( ) { org . nd4j . linalg . api . ndarray . INDArray vec = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 18 , 18 ) ; org . nd4j . linalg . api . ndarray . INDArray matrix = vec . dup ( ) . reshape ( 3 , 6 ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . ops . OldSoftMax ( matrix ) ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0.0042697787 , 0.011606461 , 0.031549633 , 0.085760795 , 0.23312202 , 0.6336913 , 0.0042697787 , 0.011606461 , 0.031549633 , 0.085760795 , 0.23312202 , 0.6336913 , 0.0042697787 , 0.011606461 , 0.031549633 , 0.085760795 , 0.23312202 , 0.6336913 } , new int [ ] { 3 , 6 } , 'c' ) ; "<AssertPlaceHolder>" ; } exec ( org . nd4j . linalg . cpu . nativecpu . ops . Op ) { checkForCompression ( op ) ; if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp ) { org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp s = ( ( org . nd4j . linalg . cpu . nativecpu . ops . ScalarOp ) ( op ) ) ; exec ( s ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . GradientOp ) { op . exec ( ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . TransformOp ) { org . nd4j . linalg . cpu . nativecpu . ops . TransformOp t = ( ( org . nd4j . linalg . cpu . nativecpu . ops . TransformOp ) ( op ) ) ; exec ( t ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ) { org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ac = ( ( org . nd4j . linalg . cpu . nativecpu . ops . Accumulation ) ( op ) ) ; exec ( ac ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation ) { org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation iac = ( ( org . nd4j . linalg . cpu . nativecpu . ops . IndexAccumulation ) ( op ) ) ; exec ( iac ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp ) { org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp broadcastOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . BroadcastOp ) ( op ) ) ; exec ( broadcastOp , broadcastOp . getDimension ( ) ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp ) { org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp shapeOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . ShapeOp ) ( op ) ) ; exec ( shapeOp ) ; } else if ( op instanceof org . nd4j . linalg . cpu . nativecpu . ops . RandomOp ) { org . nd4j . linalg . cpu . nativecpu . ops . RandomOp rngOp = ( ( org . nd4j . linalg . cpu . nativecpu . ops . RandomOp ) ( op ) ) ; exec ( rngOp , org . nd4j . linalg . factory . Nd4j . getRandom ( ) ) ; } return op ; }
|
org . junit . Assert . assertEquals ( assertion , matrix )
|
testOrderedListSubitem ( ) { java . lang . String content = "\t\t1<sp>subitem" ; java . lang . String expected = "##<sp>subitem" ; java . lang . String actual = _translate ( content ) ; "<AssertPlaceHolder>" ; } _translate ( com . liferay . portal . kernel . exception . PortalException ) { if ( portalException instanceof com . liferay . dynamic . data . mapping . exception . StorageFieldRequiredException ) { return new com . liferay . dynamic . data . mapping . kernel . StorageFieldRequiredException ( portalException . getMessage ( ) , portalException . getCause ( ) ) ; } return portalException ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testClientkill ( ) { try { redis1 . clientkill ( io . craft . atom . redis . HOST , io . craft . atom . redis . PORT1 ) ; } catch ( io . craft . atom . redis . api . RedisException e ) { "<AssertPlaceHolder>" ; } System . out . println ( java . lang . String . format ( "[CRAFT-ATOM-REDIS]<sp>(^_^)<sp><%s><sp>Case<sp>-><sp>test<sp>clientkill.<sp>" , io . craft . atom . test . CaseCounter . incr ( 1 ) ) ) ; } clientkill ( java . lang . String , int ) { return master ( ) . clientkill ( ip , port ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testFindByAnswer ( ) { int cdsClientFormId = 10 ; java . lang . String answer = "Test<sp>answer" ; org . oscarehr . common . model . CdsClientFormData formData1 = new org . oscarehr . common . model . CdsClientFormData ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( formData1 ) ; formData1 . setCdsClientFormId ( 100 ) ; formData1 . setAnswer ( "Another<sp>answer" ) ; org . oscarehr . common . model . CdsClientFormData formData2 = new org . oscarehr . common . model . CdsClientFormData ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( formData2 ) ; formData2 . setCdsClientFormId ( cdsClientFormId ) ; formData2 . setAnswer ( answer ) ; dao . persist ( formData1 ) ; dao . persist ( formData2 ) ; org . oscarehr . common . model . CdsClientFormData result = dao . findByAnswer ( cdsClientFormId , answer ) ; org . oscarehr . common . model . CdsClientFormData expectedResult = formData2 ; "<AssertPlaceHolder>" ; } findByAnswer ( java . lang . Integer , java . lang . String ) { java . lang . String sqlCommand = "select<sp>x<sp>from<sp>OcanStaffFormData<sp>x<sp>where<sp>x.ocanStaffFormId=?1<sp>and<sp>x.answer=?2" ; javax . persistence . Query query = entityManager . createQuery ( sqlCommand ) ; query . setParameter ( 1 , ocanStaffFormId ) ; query . setParameter ( 2 , answer ) ; return getSingleResultOrNull ( query ) ; }
|
org . junit . Assert . assertEquals ( result , expectedResult )
|
testFindUser_empty_user ( ) { when ( jdbcTemplate . queryForObject ( anyString ( ) , ( ( org . springframework . jdbc . core . RowMapper ) ( anyObject ( ) ) ) , eq ( "" ) ) ) . thenReturn ( User . NULL_USER ) ; com . captaindebug . cargocult . User result = instance . findUser ( "" ) ; "<AssertPlaceHolder>" ; } findUser ( java . lang . String ) { com . captaindebug . cargocult . User user ; try { com . captaindebug . cargocult . ntier . FindUserMapper rowMapper = new com . captaindebug . cargocult . ntier . FindUserMapper ( ) ; user = jdbcTemplate . queryForObject ( com . captaindebug . cargocult . ntier . UserDaoImpl . FIND_USER_BY_NAME , rowMapper , name ) ; } catch ( org . springframework . dao . EmptyResultDataAccessException e ) { user = com . captaindebug . cargocult . User . NULL_USER ; } return user ; }
|
org . junit . Assert . assertEquals ( User . NULL_USER , result )
|
testGetImplicitHydrogenCount ( ) { java . lang . String rawMolSmiles = "[H]POOSC(Br)C(Cl)C(F)I" ; org . openscience . cdk . smiles . SmilesParser sp = new org . openscience . cdk . smiles . SmilesParser ( org . openscience . cdk . DefaultChemObjectBuilder . getInstance ( ) ) ; org . openscience . cdk . interfaces . IAtomContainer atomContainer = sp . parseSmiles ( rawMolSmiles ) ; org . openscience . cdk . interfaces . IAtom atom = null ; for ( org . openscience . cdk . interfaces . IAtom a : atomContainer . atoms ( ) ) { if ( a . getSymbol ( ) . equalsIgnoreCase ( "P" ) ) { atom = a ; break ; } } int expResult = 1 ; int result = org . openscience . cdk . smsd . tools . ExtAtomContainerManipulator . getImplicitHydrogenCount ( atom ) ; "<AssertPlaceHolder>" ; } getImplicitHydrogenCount ( org . openscience . cdk . interfaces . IAtom ) { return ( atom . getImplicitHydrogenCount ( ) ) == ( org . openscience . cdk . CDKConstants . UNSET ) ? 0 : atom . getImplicitHydrogenCount ( ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
lessThatEqualIsGreaterThan ( ) { when ( corc . getWritable ( com . hotels . corc . sarg . LessThanEvaluatorTest . COL0 ) ) . thenReturn ( com . hotels . corc . sarg . LessThanEvaluatorTest . TWO ) ; evaluator = new com . hotels . corc . sarg . LessThanEvaluator ( com . hotels . corc . sarg . LessThanEvaluatorTest . COL0 , com . hotels . corc . sarg . LessThanEvaluatorTest . ONE , org . apache . hadoop . hive . ql . io . sarg . PredicateLeaf . Operator . LESS_THAN_EQUALS ) ; "<AssertPlaceHolder>" ; } evaluate ( T extends org . apache . hadoop . io . WritableComparable ) { if ( value == null ) { return org . apache . hadoop . hive . ql . io . sarg . SearchArgument . TruthValue . NULL ; } if ( ( literal . compareTo ( value ) ) > ( threshold ) ) { return org . apache . hadoop . hive . ql . io . sarg . SearchArgument . TruthValue . YES ; } return org . apache . hadoop . hive . ql . io . sarg . SearchArgument . TruthValue . NO ; }
|
org . junit . Assert . assertThat ( evaluator . evaluate ( corc ) , org . hamcrest . CoreMatchers . is ( TruthValue . NO ) )
|
whenLoadingRolesFromCsvFile_thenLoaded ( ) { final java . util . List < org . baeldung . persistence . model . Role > roles = csvDataLoader . loadObjectList ( org . baeldung . persistence . model . Role . class , SetupData . ROLES_FILE ) ; "<AssertPlaceHolder>" ; } loadObjectList ( java . lang . Class , java . lang . String ) { try { final com . fasterxml . jackson . dataformat . csv . CsvSchema bootstrapSchema = com . fasterxml . jackson . dataformat . csv . CsvSchema . emptySchema ( ) . withHeader ( ) ; final com . fasterxml . jackson . dataformat . csv . CsvMapper mapper = new com . fasterxml . jackson . dataformat . csv . CsvMapper ( ) ; final java . io . File file = new org . springframework . core . io . ClassPathResource ( fileName ) . getFile ( ) ; final com . fasterxml . jackson . databind . MappingIterator < T > readValues = mapper . readerFor ( type ) . with ( bootstrapSchema ) . readValues ( file ) ; return readValues . readAll ( ) ; } catch ( final java . lang . Exception e ) { logger . error ( ( "Error<sp>ocurred<sp>while<sp>loading<sp>object<sp>list<sp>from<sp>file<sp>" + fileName ) , e ) ; return java . util . Collections . emptyList ( ) ; } }
|
org . junit . Assert . assertFalse ( roles . isEmpty ( ) )
|
getResponseStatusReturnsResponseStatus ( java . io . InputStream ) { final com . microsoft . azure . sdk . iot . deps . transport . http . HttpMethod httpsMethod = com . microsoft . azure . sdk . iot . deps . transport . http . HttpMethod . GET ; final int status = 204 ; int expectedStatus = status ; new mockit . NonStrictExpectations ( ) { { mockUrl . getProtocol ( ) ; result = "https" ; mockUrl . openConnection ( ) ; result = mockUrlConn ; mockUrlConn . getRequestMethod ( ) ; result = httpsMethod . name ( ) ; mockUrlConn . getResponseCode ( ) ; result = status ; } } ; com . microsoft . azure . sdk . iot . deps . transport . http . HttpConnection conn = new com . microsoft . azure . sdk . iot . deps . transport . http . HttpConnection ( mockUrl , httpsMethod ) ; conn . connect ( ) ; int testStatus = conn . getResponseStatus ( ) ; "<AssertPlaceHolder>" ; } getResponseStatus ( ) { return this . connection . getResponseCode ( ) ; }
|
org . junit . Assert . assertThat ( testStatus , org . hamcrest . CoreMatchers . is ( expectedStatus ) )
|
testAddsApplicationConfigurationsOnStart ( ) { org . osgi . framework . BundleContext context = mock ( org . osgi . framework . BundleContext . class ) ; com . eclipsesource . jaxrs . publisher . internal . ServiceContainer container = new com . eclipsesource . jaxrs . publisher . internal . ServiceContainer ( context ) ; org . osgi . framework . ServiceReference reference = mock ( org . osgi . framework . ServiceReference . class ) ; com . eclipsesource . jaxrs . publisher . ApplicationConfiguration appConfig = mock ( com . eclipsesource . jaxrs . publisher . ApplicationConfiguration . class ) ; java . util . Map < java . lang . String , java . lang . Object > map = new java . util . HashMap ( ) ; map . put ( "foo" , "bar" ) ; when ( appConfig . getProperties ( ) ) . thenReturn ( map ) ; when ( context . getService ( reference ) ) . thenReturn ( appConfig ) ; container . add ( reference ) ; com . eclipsesource . jaxrs . publisher . internal . Configuration configuration = createConfiguration ( "/test" , false , 23L ) ; com . eclipsesource . jaxrs . publisher . ServletConfiguration servletConfigurationService = mock ( com . eclipsesource . jaxrs . publisher . ServletConfiguration . class ) ; com . eclipsesource . jaxrs . publisher . internal . JerseyContext jerseyContext = new com . eclipsesource . jaxrs . publisher . internal . JerseyContext ( httpService , configuration , servletConfigurationService , container ) ; java . util . Map < java . lang . String , java . lang . Object > properties = jerseyContext . getRootApplication ( ) . getProperties ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return com . eclipsesource . jaxrs . connector . example . mvc . Static . class . getResourceAsStream ( ( "/" + path ) ) ; }
|
org . junit . Assert . assertEquals ( properties . get ( "foo" ) , "bar" )
|
testToString ( ) { org . onosproject . routing . bgp . BgpRouteEntry bgpRouteEntry = generateBgpRouteEntry ( ) ; java . lang . String expectedString = "BgpRouteEntry{prefix=1.2.3.0/24,<sp>nextHop=5.6.7.8,<sp>" + ( ( ( "bgpId=10.0.0.1,<sp>origin=IGP,<sp>asPath=AsPath{pathSegments=" + "[PathSegment{type=AS_SEQUENCE,<sp>segmentAsNumbers=[1,<sp>2,<sp>3]},<sp>" ) + "PathSegment{type=AS_SET,<sp>segmentAsNumbers=[4,<sp>5,<sp>6]}]},<sp>" ) + "localPref=100,<sp>multiExitDisc=20}" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . MoreObjects . toStringHelper ( getClass ( ) ) . omitNullValues ( ) . add ( "binNumber" , binNumber ) . add ( "listOfLsp" , listOfLsp ) . toString ( ) ; }
|
org . junit . Assert . assertThat ( bgpRouteEntry . toString ( ) , org . hamcrest . Matchers . is ( expectedString ) )
|
createTestInterface ( ) { com . google . inject . Injector injector = com . google . inject . Guice . createInjector ( de . devsurf . injection . guice . scanner . StartupModule . create ( de . devsurf . injection . guice . scanner . asm . ASMClasspathScanner . class , de . devsurf . injection . guice . scanner . PackageFilter . create ( de . devsurf . injection . guice . scanner . asm . tests . autobind . only . ImplementationOnlyTests . class ) ) ) ; "<AssertPlaceHolder>" ; try { de . devsurf . injection . guice . scanner . asm . tests . autobind . only . ImplementationOnlyTests . TestInterfaceImplementation testInstance = injector . getInstance ( com . google . inject . Key . get ( de . devsurf . injection . guice . scanner . asm . tests . autobind . only . ImplementationOnlyTests . TestInterfaceImplementation . class , de . devsurf . injection . guice . jsr330 . Names . named ( "testname" ) ) ) ; org . junit . Assert . fail ( ( "Named<sp>Bindings<sp>for<sp>Implementation<sp>only<sp>is<sp>not<sp>supported<sp>yet!<sp>" + ( testInstance != null ) ) ) ; } catch ( java . lang . Exception e ) { } } create ( java . lang . Class ) { return new de . devsurf . injection . guice . scanner . PackageFilter ( clazz . getPackage ( ) . getName ( ) , true ) ; }
|
org . junit . Assert . assertNotNull ( injector )
|
isFinite2 ( ) { org . diirt . util . stats . Range range1 = org . diirt . util . stats . Ranges . range ( 5.0 , 5.0 ) ; "<AssertPlaceHolder>" ; } isFinite ( ) { return ( ( ( ( ( min ) != ( max ) ) && ( ! ( java . lang . Double . isNaN ( min ) ) ) ) && ( ! ( java . lang . Double . isInfinite ( min ) ) ) ) && ( ! ( java . lang . Double . isNaN ( max ) ) ) ) && ( ! ( java . lang . Double . isInfinite ( max ) ) ) ; }
|
org . junit . Assert . assertThat ( range1 . isFinite ( ) , equalTo ( false ) )
|
testProfileFeedDataHandler ( ) { com . ibm . sbt . automation . core . test . pageobjects . JavaScriptPreviewPage previewPage = executeSnippet ( com . ibm . sbt . test . js . connections . profiles . api . ProfileFeedDataHandler . SNIPPET_ID ) ; java . util . List jsonList = previewPage . getJsonList ( ) ; "<AssertPlaceHolder>" ; com . ibm . commons . util . io . json . JsonJavaObject json = ( ( com . ibm . commons . util . io . json . JsonJavaObject ) ( jsonList . get ( 0 ) ) ) ; } size ( ) { return count ; }
|
org . junit . Assert . assertEquals ( 4 , jsonList . size ( ) )
|
testHasResources ( ) { java . lang . Object resource = mock ( java . lang . Object . class ) ; application . addResource ( resource ) ; "<AssertPlaceHolder>" ; } hasResources ( ) { return ! ( resources . isEmpty ( ) ) ; }
|
org . junit . Assert . assertTrue ( application . hasResources ( ) )
|
runInTransactionShouldCallFunctionAndRollbackOnPreCommitConflict ( ) { final com . spotify . styx . storage . DatastoreStorage storage = new com . spotify . styx . storage . DatastoreStorage ( datastore , java . time . Duration . ZERO , storageTransactionFactory , executor ) ; final com . spotify . styx . storage . CheckedDatastoreTransaction transaction = datastore . newTransaction ( ) ; final com . spotify . styx . storage . DatastoreStorageTransaction storageTransaction = spy ( new com . spotify . styx . storage . DatastoreStorageTransaction ( transaction ) ) ; when ( storageTransactionFactory . apply ( any ( ) ) ) . thenReturn ( storageTransaction ) ; final java . lang . Exception expectedException = new com . google . cloud . datastore . DatastoreException ( 10 , "" , "" ) ; when ( transactionFunction . apply ( any ( ) ) ) . thenThrow ( expectedException ) ; try { storage . runInTransaction ( transactionFunction ) ; org . junit . Assert . fail ( "Expected<sp>exception!" ) ; } catch ( com . spotify . styx . storage . TransactionException e ) { "<AssertPlaceHolder>" ; } verify ( transactionFunction ) . apply ( storageTransaction ) ; verify ( storageTransaction , never ( ) ) . commit ( ) ; verify ( storageTransaction ) . rollback ( ) ; } isConflict ( ) { if ( ( ( getCause ( ) ) != null ) && ( ( getCause ( ) ) instanceof com . google . cloud . datastore . DatastoreException ) ) { com . google . cloud . datastore . DatastoreException datastoreException = ( ( com . google . cloud . datastore . DatastoreException ) ( getCause ( ) ) ) ; return ( datastoreException . getCode ( ) ) == 10 ; } else { return false ; } }
|
org . junit . Assert . assertTrue ( e . isConflict ( ) )
|
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . mobile . device . rules . model . MDRAction . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "actionId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . mobile . device . rules . model . MDRAction > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testLocalDateTime ( ) { com . owlike . genson . ext . jodatime . LocalDateTime expected = new com . owlike . genson . ext . jodatime . LocalDateTime ( 2010 , 10 , 11 , 9 , 55 ) ; "<AssertPlaceHolder>" ; } deserialize ( com . owlike . genson . stream . ObjectReader , com . owlike . genson . Context ) { T obj ; if ( options . isAsTimestamp ( ) ) { switch ( options . getTimestampFormat ( ) ) { case ARRAY : obj = readArray ( reader ) ; break ; case OBJECT : obj = readObject ( reader ) ; break ; default : throw new java . lang . IllegalArgumentException ( "Unsupported<sp>timestamp<sp>format" ) ; } } else { obj = parseFunction . apply ( reader . valueAsString ( ) ) ; } return obj ; }
|
org . junit . Assert . assertEquals ( expected , genson . deserialize ( genson . serialize ( expected ) , com . owlike . genson . ext . jodatime . LocalDateTime . class ) )
|
testCookieSerializes ( ) { java . io . ByteArrayOutputStream byteArrayOutputStream = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream objectOutputStream = new java . io . ObjectOutputStream ( byteArrayOutputStream ) ; org . openqa . selenium . Cookie cookieToSerialize = new org . openqa . selenium . Cookie ( "Fish" , "cod" , "" , "" , null , false ) ; objectOutputStream . writeObject ( cookieToSerialize ) ; byte [ ] serializedCookie = byteArrayOutputStream . toByteArray ( ) ; java . io . ByteArrayInputStream byteArrayInputStream = new java . io . ByteArrayInputStream ( serializedCookie ) ; java . io . ObjectInputStream objectInputStream = new java . io . ObjectInputStream ( byteArrayInputStream ) ; org . openqa . selenium . Cookie deserializedCookie = ( ( org . openqa . selenium . Cookie ) ( objectInputStream . readObject ( ) ) ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertThat ( cookieToSerialize , org . hamcrest . Matchers . equalTo ( deserializedCookie ) )
|
symmetric_set_difference_java ( ) { java . util . Set < java . lang . String > yourFriendsOrMyFriends = new java . util . HashSet < java . lang . String > ( yourFriends ) ; yourFriendsOrMyFriends . addAll ( myFriends ) ; com . levelup . java . collections . SymmetricDifferenceOfTwoSets . logger . info ( yourFriendsOrMyFriends . size ( ) ) ; com . levelup . java . collections . SymmetricDifferenceOfTwoSets . logger . info ( yourFriendsOrMyFriends ) ; java . util . Set < java . lang . String > tmp = new java . util . HashSet < java . lang . String > ( yourFriends ) ; tmp . retainAll ( myFriends ) ; yourFriendsOrMyFriends . removeAll ( tmp ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 12 , yourFriendsOrMyFriends . size ( ) )
|
testClassifyNoThresholdsAndClassifier ( ) { org . geotools . process . vector . ClassifyByRangeProcess cp = new org . geotools . process . vector . ClassifyByRangeProcess ( ) ; boolean error = false ; try { cp . execute ( fc , "value" , null , new java . lang . String [ ] { "A" , "B" , "C" , "D" } , null , null , true , "class" , null ) ; } catch ( org . geotools . process . ProcessException e ) { error = true ; } "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( error )
|
testDupRangeNoEndKey_GetPrev ( ) { open ( ) ; insert ( 1 , 1 ) ; insert ( 2 , 2 ) ; insert ( 3 , 2 ) ; insert ( 4 , 4 ) ; startInserts ( 5 , 3 ) ; checkPKeyRange ( 2 , 2 , true , null , false , 3 , 2 ) ; "<AssertPlaceHolder>" ; close ( ) ; } stopInserts ( ) { if ( ( insertThread ) == null ) { return true ; } final java . lang . Thread t = insertThread ; insertThread = null ; start = java . lang . System . currentTimeMillis ( ) ; while ( ( ( java . lang . System . currentTimeMillis ( ) ) - start ) < ( 10 * 1000 ) ) { t . interrupt ( ) ; java . lang . Thread . sleep ( 10 ) ; if ( ! ( t . isAlive ( ) ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( stopInserts ( ) )
|
testDoWork_Unkonwn ( ) { final java . lang . String key = "foo:bar" ; final net . greghaines . jesque . meta . dao . impl . KeysDAORedisImpl . KeyDAOPoolWork work = new net . greghaines . jesque . meta . dao . impl . KeysDAORedisImpl . KeyDAOPoolWork ( key ) ; this . mockCtx . checking ( new org . jmock . Expectations ( ) { { oneOf ( jedis ) . type ( key ) ; will ( returnValue ( "?" ) ) ; } } ) ; final net . greghaines . jesque . meta . KeyInfo keyInfo = work . doWork ( this . jedis ) ; "<AssertPlaceHolder>" ; } doWork ( redis . clients . jedis . Jedis ) { doPublish ( jedis , getNamespace ( ) , channel , jobJson ) ; return null ; }
|
org . junit . Assert . assertNull ( keyInfo )
|
showLogs_withShowLogsMatchRandomImage ( ) { final io . fabric8 . maven . docker . config . ImageConfiguration imageConfig = new io . fabric8 . maven . docker . config . ImageConfiguration . Builder ( ) . name ( "name" ) . alias ( "alias" ) . build ( ) ; final io . fabric8 . maven . docker . service . helper . StartContainerExecutor executor = new io . fabric8 . maven . docker . service . helper . StartContainerExecutor . Builder ( ) . showLogs ( "some_random_string" ) . imageConfig ( imageConfig ) . build ( ) ; final boolean actual = executor . showLogs ( ) ; "<AssertPlaceHolder>" ; } showLogs ( ) { if ( ( showLogs ) != null ) { if ( showLogs . equalsIgnoreCase ( "true" ) ) { return true ; } else if ( showLogs . equalsIgnoreCase ( "false" ) ) { return false ; } else { return io . fabric8 . maven . docker . config . ConfigHelper . matchesConfiguredImages ( showLogs , imageConfig ) ; } } io . fabric8 . maven . docker . config . RunImageConfiguration runConfig = imageConfig . getRunConfiguration ( ) ; if ( runConfig != null ) { io . fabric8 . maven . docker . config . LogConfiguration logConfig = runConfig . getLogConfiguration ( ) ; if ( logConfig != null ) { return logConfig . isActivated ( ) ; } else { return follow ; } } return false ; }
|
org . junit . Assert . assertFalse ( actual )
|
tryAddClient ( ) { int newPort = org . threadly . litesockets . utils . PortUtils . findUDPPort ( ) ; org . threadly . litesockets . udp . FakeUDPServerClient newFC = new org . threadly . litesockets . udp . FakeUDPServerClient ( SE ) ; org . threadly . litesockets . UDPServer newServer = SE . createUDPServer ( "localhost" , newPort ) ; newFC . AddUDPServer ( newServer ) ; org . threadly . litesockets . UDPClient c = newServer . createUDPClient ( "127.0.0.1" , port ) ; newFC . accept ( c ) ; "<AssertPlaceHolder>" ; c . close ( ) ; newServer . close ( ) ; } getClientCount ( ) { return clients . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , SE . getClientCount ( ) )
|
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . blogs . model . BlogsEntry . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "entryId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . blogs . model . BlogsEntry > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testDirDownload ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . hadoop . fs . FileContext files = org . apache . hadoop . fs . FileContext . getLocalFSFileContext ( conf ) ; final org . apache . hadoop . fs . Path basedir = files . makeQualified ( new org . apache . hadoop . fs . Path ( "target" , org . apache . hadoop . yarn . util . TestFSDownload . class . getSimpleName ( ) ) ) ; files . mkdir ( basedir , null , true ) ; conf . setStrings ( org . apache . hadoop . yarn . util . TestFSDownload . class . getName ( ) , basedir . toString ( ) ) ; java . util . Map < org . apache . hadoop . yarn . api . records . LocalResource , org . apache . hadoop . yarn . api . records . LocalResourceVisibility > rsrcVis = new java . util . HashMap < org . apache . hadoop . yarn . api . records . LocalResource , org . apache . hadoop . yarn . api . records . LocalResourceVisibility > ( ) ; java . util . Random rand = new java . util . Random ( ) ; long sharedSeed = rand . nextLong ( ) ; rand . setSeed ( sharedSeed ) ; System . out . println ( ( "SEED:<sp>" + sharedSeed ) ) ; java . util . Map < org . apache . hadoop . yarn . api . records . LocalResource , java . util . concurrent . Future < org . apache . hadoop . fs . Path > > pending = new java . util . HashMap < org . apache . hadoop . yarn . api . records . LocalResource , java . util . concurrent . Future < org . apache . hadoop . fs . Path > > ( ) ; java . util . concurrent . ExecutorService exec = java . util . concurrent . Executors . newSingleThreadExecutor ( ) ; org . apache . hadoop . fs . LocalDirAllocator dirs = new org . apache . hadoop . fs . LocalDirAllocator ( org . apache . hadoop . yarn . util . TestFSDownload . class . getName ( ) ) ; for ( int i = 0 ; i < 5 ; ++ i ) { org . apache . hadoop . yarn . api . records . LocalResourceVisibility vis = org . apache . hadoop . yarn . api . records . LocalResourceVisibility . PRIVATE ; if ( ( i % 2 ) == 1 ) { vis = org . apache . hadoop . yarn . api . records . LocalResourceVisibility . APPLICATION ; } org . apache . hadoop . fs . Path p = new org . apache . hadoop . fs . Path ( basedir , ( ( "dir" + i ) + ".jar" ) ) ; org . apache . hadoop . yarn . api . records . LocalResource rsrc = org . apache . hadoop . yarn . util . TestFSDownload . createJar ( files , p , vis ) ; rsrcVis . put ( rsrc , vis ) ; org . apache . hadoop . fs . Path destPath = dirs . getLocalPathForWrite ( basedir . toString ( ) , conf ) ; destPath = new org . apache . hadoop . fs . Path ( destPath , java . lang . Long . toString ( org . apache . hadoop . yarn . util . TestFSDownload . uniqueNumberGenerator . incrementAndGet ( ) ) ) ; org . apache . hadoop . yarn . util . FSDownload fsd = new org . apache . hadoop . yarn . util . FSDownload ( files , org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) , conf , destPath , rsrc ) ; pending . put ( rsrc , exec . submit ( fsd ) ) ; } exec . shutdown ( ) ; while ( ! ( exec . awaitTermination ( 1000 , TimeUnit . MILLISECONDS ) ) ) ; for ( java . util . concurrent . Future < org . apache . hadoop . fs . Path > path : pending . values ( ) ) { "<AssertPlaceHolder>" ; } try { for ( Map . Entry < org . apache . hadoop . yarn . api . records . LocalResource , java . util . concurrent . Future < org . apache . hadoop . fs . Path > > p : pending . entrySet ( ) ) { org . apache . hadoop . fs . Path localized = p . getValue ( ) . get ( ) ; org . apache . hadoop . fs . FileStatus status = files . getFileStatus ( localized ) ; System . out . println ( ( "Testing<sp>path<sp>" + localized ) ) ; assert status . isDirectory ( ) ; assert rsrcVis . containsKey ( p . getKey ( ) ) ; verifyPermsRecursively ( localized . getFileSystem ( conf ) , files , localized , rsrcVis . get ( p . getKey ( ) ) ) ; } } catch ( java . util . concurrent . ExecutionException e ) { throw new java . io . IOException ( "Failed<sp>exec" , e ) ; } } isDone ( ) { return arr . isDone ( ) ; }
|
org . junit . Assert . assertTrue ( path . isDone ( ) )
|
testConstruct0 ( ) { boolean result = false ; java . lang . String queryString = "CONSTRUCT<sp>{?s<sp>?p<sp><http://www.semanticweb.org/ontologies/test/p1>}<sp>WHERE<sp>{?s<sp>?p<sp><http://www.semanticweb.org/ontologies/test/p1>}" ; try ( org . eclipse . rdf4j . repository . RepositoryConnection con = it . unibz . inf . ontop . rdf4j . repository . RDF4JConstructDescribeTest . REPOSITORY . getConnection ( ) ) { org . eclipse . rdf4j . query . GraphQuery graphQuery = con . prepareGraphQuery ( QueryLanguage . SPARQL , queryString ) ; org . eclipse . rdf4j . query . GraphQueryResult gresult = graphQuery . evaluate ( ) ; while ( gresult . hasNext ( ) ) { result = false ; it . unibz . inf . ontop . rdf4j . repository . Statement s = gresult . next ( ) ; System . out . println ( s . toString ( ) ) ; } "<AssertPlaceHolder>" ; } } toString ( ) { return ( ( ( ( head ) + "<sp><-<sp>" ) + ( databaseAtoms ) ) + "<sp>AND<sp>" ) + ( filterAtoms ) ; }
|
org . junit . Assert . assertFalse ( result )
|
testIsValidWithInvalidSessionInfo ( ) { org . openqa . selenium . server . BrowserSessionFactory . BrowserSessionInfo info = new org . openqa . selenium . server . BrowserSessionFactory . BrowserSessionInfo ( "id1" , "*firefox" , null , null , null ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( info )
|
equalsSameStringReturnsTrue ( ) { com . rackspacecloud . blueflood . types . Locator locator = com . rackspacecloud . blueflood . types . Locator . createLocatorFromDbKey ( "a.b.c" ) ; com . rackspacecloud . blueflood . types . Locator other = com . rackspacecloud . blueflood . types . Locator . createLocatorFromDbKey ( "a.b.c" ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( other instanceof com . rackspacecloud . blueflood . service . SlotState ) ) { return false ; } com . rackspacecloud . blueflood . service . SlotState that = ( ( com . rackspacecloud . blueflood . service . SlotState ) ( other ) ) ; return this . toString ( ) . equals ( that . toString ( ) ) ; }
|
org . junit . Assert . assertTrue ( locator . equals ( ( ( java . lang . Object ) ( other ) ) ) )
|
testRemove ( ) { com . liferay . portal . kernel . model . LayoutVersion newLayoutVersion = addLayoutVersion ( ) ; _persistence . remove ( newLayoutVersion ) ; com . liferay . portal . kernel . model . LayoutVersion existingLayoutVersion = _persistence . fetchByPrimaryKey ( newLayoutVersion . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; }
|
org . junit . Assert . assertNull ( existingLayoutVersion )
|
testGetParams ( ) { fr . inria . soctrace . lib . model . Annotation a1 = getNewAnnotation ( ) ; fr . inria . soctrace . lib . model . Annotation a2 = getNewAnnotation ( ) ; "<AssertPlaceHolder>" ; } getParams ( ) { return params ; }
|
org . junit . Assert . assertEquals ( a1 . getParams ( ) , a2 . getParams ( ) )
|
testIsIndexWorkRequiredNodeMissing ( ) { when ( mockNodeDao . isNodeAvailable ( tableIdLong ) ) . thenReturn ( false ) ; when ( mockTableIndexDAO . doesIndexStateMatch ( anyString ( ) , anyLong ( ) , anyString ( ) ) ) . thenReturn ( false ) ; org . sagebionetworks . repo . model . table . TableStatus status = new org . sagebionetworks . repo . model . table . TableStatus ( ) ; status . setState ( TableState . PROCESSING_FAILED ) ; when ( mockTableStatusDAO . getTableStatus ( tableId ) ) . thenReturn ( status ) ; boolean workRequired = manager . isIndexWorkRequired ( tableId ) ; "<AssertPlaceHolder>" ; } isIndexWorkRequired ( java . lang . String ) { if ( ! ( isTableAvailable ( tableId ) ) ) { return false ; } if ( ! ( isIndexSynchronizedWithTruth ( tableId ) ) ) { return true ; } org . sagebionetworks . repo . model . table . TableStatus status = tableStatusDAO . getTableStatus ( tableId ) ; return TableState . PROCESSING . equals ( status . getState ( ) ) ; }
|
org . junit . Assert . assertFalse ( workRequired )
|
testPathTo ( ) { com . epimorphics . lda . renderers . common . PropertyPath fooBar = new com . epimorphics . lda . renderers . common . PropertyPath ( "foo.bar" ) ; com . epimorphics . lda . renderers . common . DisplayHierarchyNode child = new com . epimorphics . lda . renderers . common . DisplayHierarchyNode ( fooBar , dhn , new com . epimorphics . lda . renderers . common . DisplayRdfNode ( rm . page ( ) , com . epimorphics . lda . renderers . common . ResourceFactory . createPlainLiteral ( "foo" ) ) , null ) ; "<AssertPlaceHolder>" ; } pathTo ( ) { return pathTo ; }
|
org . junit . Assert . assertSame ( fooBar , child . pathTo ( ) )
|
testDeleteUsernameAndPasswordForServiceURI ( ) { credentialManager . deleteUsernameAndPasswordForService ( org . apache . taverna . security . credentialmanager . impl . CredentialManagerImplTest . serviceURI ) ; credentialManager . addUsernameAndPasswordForService ( org . apache . taverna . security . credentialmanager . impl . CredentialManagerImplTest . usernamePassword , org . apache . taverna . security . credentialmanager . impl . CredentialManagerImplTest . serviceURI ) ; credentialManager . deleteUsernameAndPasswordForService ( org . apache . taverna . security . credentialmanager . impl . CredentialManagerImplTest . serviceURI ) ; "<AssertPlaceHolder>" ; } getUsernameAndPasswordForService ( java . net . URI , boolean , java . lang . String ) { initialize ( ) ; synchronized ( keystore ) { javax . crypto . spec . SecretKeySpec passwordKey = null ; java . util . LinkedHashSet < java . net . URI > possibleServiceURIsToLookup = getPossibleServiceURIsToLookup ( serviceURI , usePathRecursion ) ; java . util . Map < java . net . URI , java . net . URI > allServiceURIs = getFragmentMappedURIsForAllUsernameAndPasswordPairs ( ) ; try { for ( java . net . URI lookupURI : possibleServiceURIsToLookup ) { java . net . URI mappedURI = allServiceURIs . get ( lookupURI ) ; if ( mappedURI == null ) continue ; java . lang . String alias = null ; alias = "password#" + ( mappedURI . toASCIIString ( ) ) ; passwordKey = ( ( javax . crypto . spec . SecretKeySpec ) ( keystore . getKey ( alias , masterPassword . toCharArray ( ) ) ) ) ; if ( passwordKey == null ) { org . apache . taverna . security . credentialmanager . impl . CredentialManagerImpl . logger . warn ( ( ( ( ( "Could<sp>not<sp>find<sp>alias<sp>" + alias ) + "<sp>for<sp>known<sp>uri<sp>" ) + lookupURI ) + ",<sp>just<sp>deleted?" ) ) ; continue ; } java . lang . String unpasspair = new java . lang . String ( passwordKey . getEncoded ( ) , UTF_8 ) ; int separatorAt = unpasspair . indexOf ( org . apache . taverna . security . credentialmanager . impl . USERNAME_AND_PASSWORD_SEPARATOR_CHARACTER ) ; if ( separatorAt < 0 ) throw new org . apache . taverna . security . credentialmanager . CMException ( ( "Invalid<sp>credentials<sp>stored<sp>for<sp>" + lookupURI ) ) ; java . lang . String username = unpasspair . substring ( 0 , separatorAt ) ; java . lang . String password = unpasspair . substring ( ( separatorAt + 1 ) ) ; org . apache . taverna . security . credentialmanager . UsernamePassword usernamePassword = new org . apache . taverna . security . credentialmanager . UsernamePassword ( ) ; usernamePassword . setUsername ( username ) ; usernamePassword . setPassword ( password . toCharArray ( ) ) ; return usernamePassword ; } for ( org . apache . taverna . security . credentialmanager . ServiceUsernameAndPasswordProvider provider : serviceUsernameAndPasswordProviders ) { org . apache . taverna . security . credentialmanager . UsernamePassword usernamePassword = provider . getServiceUsernameAndPassword ( serviceURI , requestingMessage ) ; if ( usernamePassword == null ) continue ; if ( usernamePassword . isShouldSave ( ) ) { java . net . URI uri = serviceURI ; if ( usePathRecursion ) uri = normalizeServiceURI ( serviceURI ) ; addUsernameAndPasswordForService ( usernamePassword , uri ) ; } return usernamePassword ; } return null ; } catch ( java . lang . Exception ex ) { java . lang . String exMessage = ( "Failed<sp>to<sp>get<sp>the<sp>username<sp>and<sp>password<sp>pair<sp>for<sp>service<sp>" + serviceURI ) + "<sp>from<sp>the<sp>Keystore" ; org . apache . taverna . security . credentialmanager . impl . CredentialManagerImpl . logger . error ( exMessage , ex ) ; throw new org . apache . taverna . security . credentialmanager . CMException ( exMessage , ex ) ; } } }
|
org . junit . Assert . assertNull ( credentialManager . getUsernameAndPasswordForService ( org . apache . taverna . security . credentialmanager . impl . CredentialManagerImplTest . serviceURI , false , "" ) )
|
isUserInRole_SubscriptionManager ( ) { org . oscm . ui . model . User user = prepareUserWithRole ( UserRoleType . SUBSCRIPTION_MANAGER ) ; "<AssertPlaceHolder>" ; } isSubscriptionManager ( ) { return voUserDetails . getUserRoles ( ) . contains ( UserRoleType . SUBSCRIPTION_MANAGER ) ; }
|
org . junit . Assert . assertTrue ( user . isSubscriptionManager ( ) )
|
testName ( ) { "<AssertPlaceHolder>" ; } createSchema ( int ) { return createSchema ( createMap ( ) , expectedValidationIssues ) ; }
|
org . junit . Assert . assertEquals ( testName , createSchema ( 0 ) . convert ( ) . getName ( ) )
|
ignoreJavaTypes ( ) { com . github . mauricioaniche . ck . CKClassResult a = com . github . mauricioaniche . ck . metric . CBOTest . report . get ( "cbo.Coupling0" ) ; "<AssertPlaceHolder>" ; } getCbo ( ) { return cbo ; }
|
org . junit . Assert . assertEquals ( 0 , a . getCbo ( ) )
|
testInject_inject ( ) { org . evosuite . runtime . javaee . injection . InjectorTest . Foo foo = new org . evosuite . runtime . javaee . injection . InjectorTest . Foo ( ) ; org . evosuite . runtime . javaee . injection . Injector . inject ( foo , org . evosuite . runtime . javaee . injection . InjectorTest . Foo . class , "injectField" , new java . lang . Integer ( 1 ) ) ; "<AssertPlaceHolder>" ; } getInjectField ( ) { return injectField ; }
|
org . junit . Assert . assertNotNull ( foo . getInjectField ( ) )
|
whenArrayIsOfCustomTypeThenMaxUsesCustomComparator ( ) { final com . baeldung . java_8_features . Car porsche = new com . baeldung . java_8_features . Car ( "Porsche<sp>959" , 319 ) ; final com . baeldung . java_8_features . Car ferrari = new com . baeldung . java_8_features . Car ( "Ferrari<sp>288<sp>GTO" , 303 ) ; final com . baeldung . java_8_features . Car bugatti = new com . baeldung . java_8_features . Car ( "Bugatti<sp>Veyron<sp>16.4<sp>Super<sp>Sport" , 415 ) ; final com . baeldung . java_8_features . Car mcLaren = new com . baeldung . java_8_features . Car ( "McLaren<sp>F1" , 355 ) ; final com . baeldung . java_8_features . Car [ ] fastCars = new com . baeldung . java_8_features . Car [ ] { porsche , ferrari , bugatti , mcLaren } ; final com . baeldung . java_8_features . Car maxBySpeed = java . util . Arrays . stream ( fastCars ) . max ( java . util . Comparator . comparing ( Car :: getTopSpeed ) ) . orElseThrow ( NoSuchElementException :: new ) ; "<AssertPlaceHolder>" ; } max ( int [ ] ) { return java . util . stream . IntStream . of ( integers ) . max ( ) . getAsInt ( ) ; }
|
org . junit . Assert . assertEquals ( bugatti , maxBySpeed )
|
testRenderMany ( ) { java . time . Instant date = java . time . Instant . ofEpochMilli ( 987654321098L ) ; io . datakernel . http . HttpCookie cookie1 = io . datakernel . http . HttpCookie . of ( "name1" , "value1" ) . withExpirationDate ( date ) . withMaxAge ( 10 ) . withPath ( "/test" ) . withDomain ( "www.google.com" ) . withSecure ( true ) ; io . datakernel . http . HttpCookie cookie2 = io . datakernel . http . HttpCookie . of ( "name2" , "value2" ) . withHttpOnly ( true ) . withExtension ( "Alhambra<sp>site" ) ; io . datakernel . http . HttpCookie cookie3 = io . datakernel . http . HttpCookie . of ( "name3" ) ; java . lang . String expected = "name1=value1;<sp>name2=value2;<sp>name3" ; io . datakernel . bytebuf . ByteBuf buf = io . datakernel . bytebuf . ByteBuf . wrapForWriting ( new byte [ expected . length ( ) ] ) ; io . datakernel . http . HttpCookie . renderSimple ( java . util . Arrays . asList ( cookie1 , cookie2 , cookie3 ) , buf ) ; "<AssertPlaceHolder>" ; } asAscii ( io . datakernel . bytebuf . ByteBuf ) { java . lang . String str = io . datakernel . bytebuf . ByteBufStrings . decodeAscii ( buf . array ( ) , buf . head ( ) , buf . readRemaining ( ) , io . datakernel . util . ThreadLocalCharArray . ensure ( buf . readRemaining ( ) ) ) ; buf . recycle ( ) ; return str ; }
|
org . junit . Assert . assertEquals ( expected , io . datakernel . bytebuf . ByteBufStrings . asAscii ( buf ) )
|
testExpression6 ( ) { kendzi . kendzi3d . expressions . Context c = new kendzi . kendzi3d . expressions . Context ( ) ; c . registerFunction ( new kendzi . kendzi3d . expressions . functions . Vector3dFunction ( ) ) ; kendzi . kendzi3d . expressions . expression . Expression build = kendzi . kendzi3d . expressions . ExpressiongBuilder . build ( "vector()" ) ; java . lang . Object value = build . evaluate ( c ) ; "<AssertPlaceHolder>" ; } evaluate ( kendzi . kendzi3d . expressions . Context ) { return new javax . vecmath . Vector3d ( nodeModel . getTranslateX ( ) , nodeModel . getTranslateY ( ) , nodeModel . getTranslateZ ( ) ) ; }
|
org . junit . Assert . assertEquals ( new javax . vecmath . Vector3d ( 0 , 0 , 0 ) , value )
|
testLengthStripList ( ) { org . stringtemplate . v4 . ST e = new org . stringtemplate . v4 . ST ( "<length(strip(names))>" ) ; e . add ( "names" , java . util . Arrays . asList ( null , "Tom" , null , null , "Sriram" , null ) ) ; java . lang . String expecting = "2" ; "<AssertPlaceHolder>" ; } render ( ) { return render ( java . util . Locale . getDefault ( ) ) ; }
|
org . junit . Assert . assertEquals ( expecting , e . render ( ) )
|
whenUpdateModelThenGetUpdatedModel ( ) { nbc . add ( 1 , testModel ) ; vkaretko . Model updateModel = new vkaretko . Model ( "test2" ) ; try { nbc . update ( 1 , updateModel ) ; } catch ( vkaretko . OptimisticException e ) { e . printStackTrace ( ) ; } "<AssertPlaceHolder>" ; } get ( K ) { return this . cache . getOrDefault ( key , null ) ; }
|
org . junit . Assert . assertThat ( nbc . get ( 1 ) , org . hamcrest . core . Is . is ( updateModel ) )
|
testWrapUserException ( ) { com . dremio . common . exceptions . UserException uex = com . dremio . common . exceptions . UserException . dataReadError ( ) . message ( "this<sp>is<sp>a<sp>data<sp>read<sp>exception" ) . build ( com . dremio . common . exceptions . TestUserException . logger ) ; java . lang . Exception wrapped = wrap ( uex , 3 ) ; "<AssertPlaceHolder>" ; } systemError ( java . lang . Throwable ) { return com . dremio . common . exceptions . UserException . builder ( DremioPBError . ErrorType . SYSTEM , cause ) ; }
|
org . junit . Assert . assertEquals ( uex , com . dremio . common . exceptions . UserException . systemError ( wrapped ) . build ( com . dremio . common . exceptions . TestUserException . logger ) )
|
testQueryStringMatchesWithRegex ( ) { org . ocpsoft . rewrite . servlet . config . Query query = org . ocpsoft . rewrite . servlet . config . Query . valueExists ( "{*}ve{*}" ) ; query . setParameterStore ( store ) ; "<AssertPlaceHolder>" ; } evaluate ( org . ocpsoft . rewrite . event . Rewrite , org . ocpsoft . rewrite . context . EvaluationContext ) { if ( ( zone ) != null ) return condition . matches ( new org . joda . time . DateTime ( zone ) ) ; else return condition . matches ( new org . joda . time . DateTime ( ) ) ; }
|
org . junit . Assert . assertTrue ( query . evaluate ( rewrite , context ) )
|
getTestMethodSourceCode_A$TestMethodMeta_GivenWhenThen_JUnit3 ( ) { org . junithelper . core . config . Configuration config = new org . junithelper . core . config . Configuration ( ) ; config . junitVersion = org . junithelper . core . config . JUnitVersion . version3 ; config . testingPatternExplicitComment = org . junithelper . core . config . TestingPatternExplicitComment . GivenWhenThen ; org . junithelper . core . generator . TestMethodGeneratorImpl localGenerator = new org . junithelper . core . generator . TestMethodGeneratorImpl ( config , lineBreakProvider ) ; java . lang . String sourceCodeString = "package<sp>hoge.foo;<sp>import<sp>java.util.List;<sp>public<sp>class<sp>Sample<sp>{<sp>public<sp>Sample()<sp>{}\r\n<sp>public<sp>int<sp>doSomething(String<sp>str,<sp>long<sp>longValue)<sp>throws<sp>Throwable<sp>{<sp>System.out.println(\"aaaa\")<sp>}<sp>}" ; org . junithelper . core . meta . ClassMeta targetClassMeta = classMetaExtractor . extract ( sourceCodeString ) ; localGenerator . initialize ( targetClassMeta ) ; org . junithelper . core . meta . MethodMeta targetMethodMeta = targetClassMeta . methods . get ( 0 ) ; org . junithelper . core . meta . TestMethodMeta testMethodMeta = localGenerator . getTestMethodMeta ( targetMethodMeta ) ; java . lang . String actual = localGenerator . getTestMethodSourceCode ( testMethodMeta ) ; java . lang . String expected = "\tpublic<sp>void<sp>test_doSomething_A$String$long()<sp>throws<sp>Throwable<sp>{\r\n\t\t//<sp>TODO<sp>auto-generated<sp>by<sp>JUnit<sp>Helper.\r\n\t\t//<sp>Given\r\n\t\tSample<sp>target<sp>=<sp>new<sp>Sample();\r\n\t\tString<sp>str<sp>=<sp>null;\r\n\t\tlong<sp>longValue<sp>=<sp>0L;\r\n\t\t//<sp>When\r\n\t\tint<sp>actual<sp>=<sp>target.doSomething(str,<sp>longValue);\r\n\t\t//<sp>Then\r\n\t\tint<sp>expected<sp>=<sp>0;\r\n\t\tassertEquals(expected,<sp>actual);\r\n\t}\r\n" ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testFollowerPkHashcode ( ) { org . eurekastreams . server . domain . GroupFollower . GroupFollowerPk sut = new org . eurekastreams . server . domain . GroupFollower . GroupFollowerPk ( 1L , 2L ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int hashCode = 0 ; hashCode ^= new java . lang . Long ( getId ( ) ) . hashCode ( ) ; hashCode ^= shortName . hashCode ( ) ; return hashCode ; }
|
org . junit . Assert . assertNotNull ( sut . hashCode ( ) )
|
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . blade . samples . jndiservicebuilder . model . Region > regions = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKeys ( com . liferay . blade . samples . jndiservicebuilder . service . persistence . java . util . Set ) { return com . liferay . blade . samples . jndiservicebuilder . service . persistence . RegionUtil . getPersistence ( ) . fetchByPrimaryKeys ( primaryKeys ) ; }
|
org . junit . Assert . assertTrue ( regions . isEmpty ( ) )
|
testGetDrugs ( ) { org . drugis . addis . entities . Study s = org . drugis . addis . ExampleData . buildStudyDeWilde ( ) ; java . util . Set < org . drugis . addis . entities . treatment . TreatmentDefinition > expected = new java . util . HashSet < org . drugis . addis . entities . treatment . TreatmentDefinition > ( ) ; expected . add ( org . drugis . addis . entities . treatment . TreatmentDefinition . createTrivial ( org . drugis . addis . ExampleData . buildDrugFluoxetine ( ) ) ) ; expected . add ( org . drugis . addis . entities . treatment . TreatmentDefinition . createTrivial ( org . drugis . addis . ExampleData . buildDrugParoxetine ( ) ) ) ; "<AssertPlaceHolder>" ; } getTreatmentDefinitions ( ) { final java . util . Set < org . drugis . addis . entities . treatment . TreatmentDefinition > treatments = new java . util . HashSet < org . drugis . addis . entities . treatment . TreatmentDefinition > ( ) ; for ( final org . drugis . addis . entities . Arm a : getArms ( ) ) { treatments . add ( getTreatmentDefinition ( a ) ) ; } return treatments ; }
|
org . junit . Assert . assertEquals ( expected , s . getTreatmentDefinitions ( ) )
|
testGetCursorControl_withInvisibleNestedControl ( ) { org . eclipse . swt . widgets . Display_Test . setCursorLocation ( display , 234 , 345 ) ; org . eclipse . swt . widgets . Shell shell = new org . eclipse . swt . widgets . Shell ( display ) ; shell . setBounds ( 100 , 100 , 500 , 500 ) ; shell . setVisible ( true ) ; org . eclipse . swt . widgets . Composite composite = new org . eclipse . swt . widgets . Composite ( shell , org . eclipse . swt . SWT . NONE ) ; composite . setBounds ( 0 , 0 , 500 , 500 ) ; org . eclipse . swt . widgets . Button button = new org . eclipse . swt . widgets . Button ( composite , org . eclipse . swt . SWT . PUSH ) ; button . setBounds ( 130 , 240 , 10 , 10 ) ; button . setVisible ( false ) ; "<AssertPlaceHolder>" ; } getCursorControl ( ) { checkDevice ( ) ; org . eclipse . swt . widgets . Display . ControlFinder finder = new org . eclipse . swt . widgets . Display . ControlFinder ( this , getCursorLocation ( ) ) ; return finder . getControl ( ) ; }
|
org . junit . Assert . assertSame ( composite , display . getCursorControl ( ) )
|
testGetAccounts ( ) { com . google . gson . JsonObject account1 = org . restcomm . connect . testsuite . http . RestcommAccountsTool . getInstance ( ) . getAccount ( deploymentUrl . toString ( ) , adminUsername , adminAuthToken , childUsername ) ; com . google . gson . JsonObject account2 = org . restcomm . connect . testsuite . http . RestcommAccountsTool . getInstance ( ) . getAccount ( deploymentUrl . toString ( ) , adminAccountSid , adminAuthToken , account1 . get ( "sid" ) . getAsString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "PhoneNumberParameters<sp>[voiceUrl=" + ( voiceUrl ) ) + ",<sp>smsUrl=" 0 ) + ( voiceMethod ) ) + ",<sp>doVoiceCallerIdLookup=" ) + ( doVoiceCallerIdLookup ) ) + ",<sp>smsUrl=" ) + ( smsUrl ) ) + ",<sp>smsMethod=" ) + ( smsMethod ) ) + ",<sp>ussdUrl=" ) + ( ussdUrl ) ) + ",<sp>ussdMethod=" ) + ( ussdMethod ) ) + ",<sp>faxUrl=" ) + ( faxUrl ) ) + ",<sp>faxMethod=" ) + ( faxMethod ) ) + ",<sp>phoneNumberType=" ) + ( phoneNumberType ) ) + "]" ; }
|
org . junit . Assert . assertTrue ( account1 . toString ( ) . equals ( account2 . toString ( ) ) )
|
testPut ( ) { java . nio . ByteBuffer original = java . nio . ByteBuffer . wrap ( "Newport" . getBytes ( ) ) ; java . nio . ByteBuffer key = java . nio . ByteBuffer . wrap ( "Billy" . getBytes ( ) ) ; com . devwebsphere . TestAPIs . client . put ( "map" , key , original ) ; java . nio . ByteBuffer value = com . devwebsphere . TestAPIs . client . get ( "map" , key ) ; "<AssertPlaceHolder>" ; } get ( long , java . util . concurrent . TimeUnit ) { return result ; }
|
org . junit . Assert . assertArrayEquals ( original . array ( ) , value . array ( ) )
|
testS13ServerSessionStartsIdleState ( ) { org . jdiameter . api . s13 . ServerS13Session session = getAppSession ( org . jdiameter . api . s13 . ServerS13Session . class , new org . jdiameter . common . impl . app . s13 . S13SessionFactoryImpl ( org . mobicents . diameter . stack . sessions . SessionsWithAppIdTest . sessionFactory ) , org . mobicents . diameter . stack . sessions . SessionsWithAppIdTest . S13_APPID ) ; org . jdiameter . common . api . app . s13 . S13SessionState state = session . getState ( org . jdiameter . common . api . app . s13 . S13SessionState . class ) ; "<AssertPlaceHolder>" ; } getState ( java . lang . Class ) { switch ( stack . getState ( ) ) { case IDLE : return ( ( E ) ( org . jdiameter . api . PeerState . DOWN ) ) ; case CONFIGURED : return ( ( E ) ( org . jdiameter . api . PeerState . INITIAL ) ) ; case STARTED : return ( ( E ) ( org . jdiameter . api . PeerState . OKAY ) ) ; case STOPPED : return ( ( E ) ( org . jdiameter . api . PeerState . SUSPECT ) ) ; } return ( ( E ) ( org . jdiameter . api . PeerState . DOWN ) ) ; }
|
org . junit . Assert . assertEquals ( state . IDLE , state )
|
testGetOwnedOperation1 ( ) { if ( ! ( org . dresdenocl . metamodels . test . MetaModelTestServices . supportsNoOperations ) ) { java . util . List < org . dresdenocl . pivotmodel . Operation > operations ; boolean foundOperation1 ; boolean foundOperation2 ; java . lang . String msg ; msg = "The<sp>adaptation<sp>of<sp>Type.getOwnedOperation()<sp>seems<sp>to<sp>be<sp>wrong." ; operations = org . dresdenocl . metamodels . test . tests . TestType . class1 . getOwnedOperation ( ) ; "<AssertPlaceHolder>" ; } getOwnedOperation ( ) { return getOwnedOperationGen ( ) ; }
|
org . junit . Assert . assertFalse ( msg , foundOperation2 )
|
testWithoutSecurityManager ( ) { java . lang . System . setSecurityManager ( null ) ; "<AssertPlaceHolder>" ; } getRegistry ( ) { final java . lang . SecurityManager sm = java . lang . System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( new java . lang . RuntimePermission ( ( ( com . arjuna . webservices11 . ServiceRegistry . class . getName ( ) ) + ".getRegistry" ) ) ) ; } return com . arjuna . webservices11 . ServiceRegistry . REGISTRY ; }
|
org . junit . Assert . assertNotNull ( com . arjuna . webservices11 . ServiceRegistry . getRegistry ( ) )
|
shouldEvaluatorReadFilledSurveyForHisPublication ( ) { users . loginAsEvaluator ( ) ; final org . adaptiveplatform . surveys . acceptance . FilledSurveyDto survey = dao . getSurvey ( filledSurveyId ) ; "<AssertPlaceHolder>" ; } getSurvey ( java . lang . Long ) { org . adaptiveplatform . surveys . dto . FilledSurveyDto survey = ( ( org . adaptiveplatform . surveys . dto . FilledSurveyDto ) ( sf . getCurrentSession ( ) . getNamedQuery ( FilledSurveyDto . Query . GET_SURVEY ) . setParameter ( "surveyId" , surveyId ) . setParameter ( "userId" , authentication . getCurrentUser ( ) . getId ( ) ) . uniqueResult ( ) ) ) ; if ( survey == null ) { throw new org . adaptiveplatform . surveys . exception . FilledSurveyDoesNotExistException ( surveyId ) ; } return survey ; }
|
org . junit . Assert . assertNotNull ( survey )
|
testPersistirEmpresa ( ) { com . kazale . pontointeligente . api . entities . Empresa empresa = this . empresaService . persistir ( new com . kazale . pontointeligente . api . entities . Empresa ( ) ) ; "<AssertPlaceHolder>" ; } persistir ( com . kazale . pontointeligente . api . entities . Empresa ) { com . kazale . pontointeligente . api . services . impl . EmpresaServiceImpl . log . info ( "Persistindo<sp>empresa:<sp>{}" , empresa ) ; return this . empresaRepository . save ( empresa ) ; }
|
org . junit . Assert . assertNotNull ( empresa )
|
testLossFunction ( ) { weka . dl4j . lossfunctions . LossBinaryXENT loss = new weka . dl4j . lossfunctions . LossBinaryXENT ( ) ; wrapper . setLossFn ( loss ) ; "<AssertPlaceHolder>" ; } getLossFn ( ) { return weka . dl4j . lossfunctions . LossFunction . create ( backend . getLossFn ( ) ) ; }
|
org . junit . Assert . assertEquals ( loss , wrapper . getLossFn ( ) )
|
shouldThrowIllegalArgumentExceptionForEntity ( ) { final uk . gov . gchq . gaffer . operation . data . generator . EdgeIdExtractor extractor = new uk . gov . gchq . gaffer . operation . data . generator . EdgeIdExtractor ( ) ; final uk . gov . gchq . gaffer . data . element . Entity entity = new uk . gov . gchq . gaffer . data . element . Entity ( uk . gov . gchq . gaffer . commonutil . TestGroups . ENTITY , "identifier" ) ; try { extractor . _apply ( entity ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( final java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } _apply ( java . lang . String ) { final java . lang . String [ ] parts = domainObject . split ( "," ) ; return new uk . gov . gchq . gaffer . data . element . Entity ( parts [ 0 ] , parts [ 1 ] ) ; }
|
org . junit . Assert . assertNotNull ( e )
|
getUserDisplayName ( ) { java . lang . String user = "vmmtestuser" ; java . lang . String displayName = "vmmtestuser" ; com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_TDSLDAP_FailoverTest . c , "getUserDisplayName" , "Checking<sp>with<sp>a<sp>valid<sp>user." ) ; "<AssertPlaceHolder>" ; } getUserDisplayName ( java . lang . String ) { return userRegistry . getUserDisplayName ( securityName ) ; }
|
org . junit . Assert . assertEquals ( displayName , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_TDSLDAP_FailoverTest . servlet . getUserDisplayName ( user ) )
|
testSetPath ( ) { metadata . setPath ( "testname" ) ; "<AssertPlaceHolder>" ; } getPath ( ) { return ( file ) != null ? file . toString ( ) : null ; }
|
org . junit . Assert . assertEquals ( "testname" , metadata . getPath ( ) )
|
testCast ( ) { org . cyclopsgroup . jmxterm . utils . SizeAware s = org . cyclopsgroup . jmxterm . utils . WeakCastUtils . cast ( new java . util . ArrayList < java . lang . Integer > ( java . util . Arrays . asList ( 1 , 2 , 3 ) ) , org . cyclopsgroup . jmxterm . utils . SizeAware . class ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertEquals ( 3 , s . size ( ) )
|
testAddDateTimeProperty ( ) { java . net . URI test_object = java . net . URI . create ( "test:jimlunch" ) ; org . dataconservancy . packaging . tool . model . dprofile . PropertyType type = profile . getCreatedPropertyType ( ) ; org . dataconservancy . packaging . tool . model . dprofile . Property val = new org . dataconservancy . packaging . tool . model . dprofile . Property ( type ) ; val . setDateTimeValue ( new org . joda . time . DateTime ( 100000000 ) ) ; store . addProperty ( test_object , val ) ; "<AssertPlaceHolder>" ; } has_property ( java . net . URI , org . dataconservancy . packaging . tool . model . dprofile . Property ) { return store . getProperties ( id , val . getPropertyType ( ) ) . contains ( val ) ; }
|
org . junit . Assert . assertTrue ( has_property ( test_object , val ) )
|
getCompleted_nilResult ( ) { final java . util . concurrent . CompletableFuture < java . lang . Void > future = completedFuture ( null ) ; "<AssertPlaceHolder>" ; } getCompleted ( java . util . concurrent . CompletionStage ) { java . util . concurrent . CompletableFuture < T > future = stage . toCompletableFuture ( ) ; com . spotify . futures . CompletableFutures . checkCompleted ( future ) ; return future . join ( ) ; }
|
org . junit . Assert . assertNull ( com . spotify . futures . CompletableFutures . getCompleted ( future ) )
|
testDecrypt_1 ( ) { final org . apache . shindig . gadgets . oauth2 . persistence . sample . NoOpEncrypter fixture = new org . apache . shindig . gadgets . oauth2 . persistence . sample . NoOpEncrypter ( ) ; final java . lang . String encryptedSecret = "secretin" ; final byte [ ] bytes = fixture . decrypt ( encryptedSecret . getBytes ( "UTF-8" ) ) ; final java . lang . String result = new java . lang . String ( bytes , "UTF-8" ) ; "<AssertPlaceHolder>" ; } decrypt ( byte [ ] ) { return encryptedSecret ; }
|
org . junit . Assert . assertEquals ( "secretin" , result )
|
testFindAll ( ) { io . katharsis . resource . list . ResourceList < io . katharsis . meta . model . MetaElement > list = repository . findAll ( new io . katharsis . queryspec . QuerySpec ( io . katharsis . meta . model . MetaElement . class ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return map . isEmpty ( ) ; }
|
org . junit . Assert . assertFalse ( list . isEmpty ( ) )
|
testSelectLiveGroupAsParentSite ( ) { com . liferay . portal . kernel . model . Group group = com . liferay . portal . kernel . test . util . GroupTestUtil . addGroup ( ) ; com . liferay . portal . kernel . test . util . GroupTestUtil . enableLocalStaging ( group ) ; "<AssertPlaceHolder>" ; com . liferay . portal . kernel . model . Group stagingGroup = group . getStagingGroup ( ) ; try { com . liferay . portal . kernel . service . GroupLocalServiceUtil . updateGroup ( stagingGroup . getGroupId ( ) , group . getGroupId ( ) , stagingGroup . getNameMap ( ) , stagingGroup . getDescriptionMap ( ) , stagingGroup . getType ( ) , stagingGroup . isManualMembership ( ) , stagingGroup . getMembershipRestriction ( ) , stagingGroup . getFriendlyURL ( ) , stagingGroup . isInheritContent ( ) , stagingGroup . isActive ( ) , com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( ) ) ; } finally { com . liferay . portal . kernel . service . GroupLocalServiceUtil . deleteGroup ( group ) ; } } hasStagingGroup ( ) { return _group . hasStagingGroup ( ) ; }
|
org . junit . Assert . assertTrue ( group . hasStagingGroup ( ) )
|
testRowVectorGemm ( ) { org . nd4j . linalg . api . ndarray . INDArray linspace = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 4 , 4 , DataType . DOUBLE ) . reshape ( 1 , ( - 1 ) ) . castTo ( DataType . DOUBLE ) ; org . nd4j . linalg . api . ndarray . INDArray other = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 16 , 16 , DataType . DOUBLE ) . reshape ( 4 , 4 ) . castTo ( DataType . DOUBLE ) ; org . nd4j . linalg . api . ndarray . INDArray result = linspace . mmul ( other ) ; org . nd4j . linalg . api . ndarray . INDArray assertion = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 30.0 , 70.0 , 110.0 , 150.0 } ) ; "<AssertPlaceHolder>" ; } create ( double [ ] , int [ ] , int [ ] , long ) { if ( ( shape . length ) == 1 ) { if ( ( shape [ 0 ] ) != ( data . length ) ) throw new org . nd4j . linalg . exception . ND4JIllegalStateException ( ( ( ( "Shape<sp>of<sp>the<sp>new<sp>array<sp>" + ( org . nd4j . linalg . factory . Arrays . toString ( shape ) ) ) + "<sp>doesn't<sp>match<sp>data<sp>length:<sp>" ) + ( data . length ) ) ) ; } org . nd4j . linalg . factory . Nd4j . checkShapeValues ( data . length , shape ) ; org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . INSTANCE . create ( data , org . nd4j . linalg . util . ArrayUtil . toLongArray ( shape ) , org . nd4j . linalg . util . ArrayUtil . toLongArray ( stride ) , DataType . DOUBLE , org . nd4j . linalg . factory . Nd4j . getMemoryManager ( ) . getCurrentWorkspace ( ) ) ; org . nd4j . linalg . factory . Nd4j . logCreationIfNecessary ( ret ) ; return ret ; }
|
org . junit . Assert . assertEquals ( assertion , result )
|
shouldSingleLookupGetCountOnObject ( ) { com . couchbase . client . java . SubDocumentTest . ctx . ignoreIfClusterUnder ( new com . couchbase . client . java . util . features . Version ( 5 , 0 , 0 ) ) ; com . couchbase . client . java . subdoc . DocumentFragment < com . couchbase . client . core . message . kv . subdoc . multi . Lookup > result = com . couchbase . client . java . SubDocumentTest . ctx . bucket ( ) . lookupIn ( key ) . getCount ( "sub" ) . execute ( ) ; "<AssertPlaceHolder>" ; } content ( int ) { return this . content ( index , java . lang . Object . class ) ; }
|
org . junit . Assert . assertEquals ( 1L , result . content ( "sub" ) )
|
testInnerClass ( ) { io . netty . util . internal . TypeParameterMatcher m = io . netty . util . internal . TypeParameterMatcher . find ( new io . netty . util . internal . TypeParameterMatcherTest . V < java . lang . String > ( ) . u , io . netty . util . internal . TypeParameterMatcherTest . U . class , "E" ) ; "<AssertPlaceHolder>" ; } match ( java . lang . Object ) { return true ; }
|
org . junit . Assert . assertTrue ( m . match ( new java . lang . Object ( ) ) )
|
testGetSetNoSet ( ) { java . lang . reflect . Field [ ] fields = com . j256 . ormlite . field . FieldTypeTest . GetSetNoSet . class . getDeclaredFields ( ) ; "<AssertPlaceHolder>" ; java . lang . reflect . Field idField = fields [ 0 ] ; com . j256 . ormlite . field . FieldType . createFieldType ( databaseType , com . j256 . ormlite . field . FieldTypeTest . GetSetNoSet . class . getSimpleName ( ) , idField , com . j256 . ormlite . field . FieldTypeTest . GetSetNoSet . class ) ; }
|
org . junit . Assert . assertTrue ( ( ( fields . length ) >= 1 ) )
|
testClone_1 ( ) { lombok . val mesh1 = new org . nd4j . parameterserver . distributed . v2 . util . MeshOrganizer ( org . nd4j . parameterserver . distributed . v2 . enums . MeshBuildMode . MESH ) ; for ( int e = 0 ; e < 8192 ; e ++ ) mesh1 . addNode ( java . util . UUID . randomUUID ( ) . toString ( ) ) ; lombok . val mesh2 = mesh1 . clone ( ) ; "<AssertPlaceHolder>" ; } clone ( ) { java . math . BigInteger aclon = new java . math . BigInteger ( ( "" + ( a ) ) ) ; java . math . BigInteger bclon = new java . math . BigInteger ( ( "" + ( b ) ) ) ; return new org . nd4j . linalg . util . Rational ( aclon , bclon ) ; }
|
org . junit . Assert . assertEquals ( mesh1 , mesh2 )
|
setValidParameterName ( ) { org . springframework . integration . xquery . support . XQueryParameter param = new org . springframework . integration . xquery . support . XQueryParameter ( "testName" ) ; "<AssertPlaceHolder>" ; } getParameterName ( ) { return parameterName ; }
|
org . junit . Assert . assertEquals ( "testName" , param . getParameterName ( ) )
|
testCompareSetDefaults ( ) { com . ibm . ws . resource . internal . ResourceRefConfigImpl rrc1 = new com . ibm . ws . resource . internal . ResourceRefConfigImpl ( "name" , "type" ) ; com . ibm . ws . resource . internal . ResourceRefConfigImpl rrc2 = new com . ibm . ws . resource . internal . ResourceRefConfigImpl ( "name" , "type" ) ; rrc2 . setLoginConfigurationName ( null ) ; rrc2 . setIsolationLevel ( Connection . TRANSACTION_NONE ) ; rrc2 . setCommitPriority ( 0 ) ; java . util . List < com . ibm . ws . resource . ResourceRefConfig . MergeConflict > conflicts = rrc1 . compareBindingsAndExtensions ( rrc2 ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . toString ( "" ) ; }
|
org . junit . Assert . assertTrue ( conflicts . toString ( ) , conflicts . isEmpty ( ) )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.