input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testGetObjectId ( ) { org . jinstagram . realtime . SubscriptionResponseData fixture = new org . jinstagram . realtime . SubscriptionResponseData ( ) ; fixture . setCallbackUrl ( "" ) ; fixture . setObject ( "" ) ; fixture . setAspect ( "" ) ; fixture . setObjectId ( "" ) ; fixture . setId ( "" ) ; fixture . setType ( "" ) ; java . lang . String result = fixture . getObjectId ( ) ; "<AssertPlaceHolder>" ; } getObjectId ( ) { return objectId ; } | org . junit . Assert . assertEquals ( "" , result ) |
shouldGetTimeOutWhenStatusDoneAndTimerMetricValueIsLifeTimeAndStatusDescriptorIsNew1 ( ) { when ( descriptor . getRunStats ( ) ) . thenReturn ( metricList ) ; when ( descriptor . getStatus ( ) ) . thenReturn ( org . eclipse . che . ide . ext . runner . client . models . NEW ) ; when ( stat . getName ( ) ) . thenReturn ( org . eclipse . che . ide . ext . runner . client . models . LIFETIME ) ; when ( stat . getValue ( ) ) . thenReturn ( org . eclipse . che . ide . ext . runner . client . models . ALWAYS_ON ) ; runner . setProcessDescriptor ( descriptor ) ; runner . setStatus ( Runner . Status . DONE ) ; "<AssertPlaceHolder>" ; verify ( descriptor , times ( 2 ) ) . getRunStats ( ) ; verify ( descriptor ) . getStatus ( ) ; verify ( stat , times ( 2 ) ) . getName ( ) ; verify ( stat ) . getValue ( ) ; } getTimeout ( ) { if ( appContext . getWorkspace ( ) . getAttributes ( ) . containsKey ( Constants . RUNNER_LIFETIME ) ) { java . lang . String value = appContext . getWorkspace ( ) . getAttributes ( ) . get ( Constants . RUNNER_LIFETIME ) ; org . eclipse . che . ide . ext . runner . client . tabs . properties . panel . common . Shutdown shutdown = org . eclipse . che . ide . ext . runner . client . tabs . properties . panel . common . Shutdown . detect ( java . lang . Integer . parseInt ( value ) ) ; return shutdown != null ? shutdown : org . eclipse . che . ide . ext . runner . client . tabs . properties . panel . common . Shutdown . BY_TIMEOUT_4 ; } else { return org . eclipse . che . ide . ext . runner . client . tabs . properties . panel . common . Shutdown . BY_TIMEOUT_4 ; } } | org . junit . Assert . assertThat ( runner . getTimeout ( ) , org . hamcrest . core . Is . is ( org . eclipse . che . ide . ext . runner . client . models . ALWAYS_ON ) ) |
getLastModifyTest ( ) { java . lang . String currentdir = com . att . aro . core . util . Util . getCurrentRunningDir ( ) ; long date = fileManager . getLastModified ( currentdir ) ; boolean ok = date > 0 ; "<AssertPlaceHolder>" ; } getLastModified ( java . lang . String ) { java . io . File file = new java . io . File ( filepath ) ; return file . lastModified ( ) ; } | org . junit . Assert . assertTrue ( ok ) |
testBestPathSelectionWithoutTieBreaking ( ) { _bestPathRib . mergeRoute ( _rb . build ( ) ) ; org . batfish . datamodel . BgpRoute bestPath = _rb . setLocalPreference ( 200 ) . build ( ) ; _bestPathRib . mergeRoute ( bestPath ) ; "<AssertPlaceHolder>" ; } getRoutes ( ) { return _routes ; } | org . junit . Assert . assertThat ( _bestPathRib . getRoutes ( ) , org . hamcrest . Matchers . contains ( bestPath ) ) |
testReverseArraySubsets ( ) { java . lang . Integer [ ] input = new java . lang . Integer [ ] { 1 , 2 , 3 , 4 , 5 } ; java . lang . Integer [ ] expected = new java . lang . Integer [ ] { 2 , 1 , 5 , 4 , 3 } ; com . killeent . Array . Array . reverse ( input , 0 , 1 ) ; com . killeent . Array . Array . reverse ( input , 2 , ( ( input . length ) - 1 ) ) ; "<AssertPlaceHolder>" ; } reverse ( T [ ] , int , int ) { if ( arr == null ) { throw new java . lang . IllegalArgumentException ( "arr<sp>is<sp>null" ) ; } if ( hi < lo ) { throw new java . lang . IllegalArgumentException ( "hi<sp><<sp>lo" ) ; } while ( lo < hi ) { com . killeent . Array . Array . swap ( arr , lo , hi ) ; lo ++ ; hi -- ; } } | org . junit . Assert . assertEquals ( expected , input ) |
testAvailableSinkBuilder ( ) { com . cloudera . flume . conf . FlumeConfiguration . get ( ) . setInt ( FlumeConfiguration . AGENT_FAILOVER_INITIAL_BACKOFF , 0 ) ; java . util . List < java . lang . String > names = java . util . Arrays . asList ( "first" , "second" , "third" , "fourth" , "fifth" ) ; java . lang . String body = "{<sp>lazyOpen<sp>=><sp>{<sp>intervalFlakeyAppend(2)<sp>=><sp>accumulator(\"%s\")}}" ; java . lang . String spec = com . cloudera . flume . master . availability . FailoverChainManager . genAvailableSinkSpec ( body , names ) ; System . out . println ( spec ) ; com . cloudera . flume . core . EventSink snk = new com . cloudera . flume . core . CompositeSink ( new com . cloudera . flume . conf . ReportTestingContext ( ) , spec ) ; com . cloudera . flume . master . availability . TestFailChainSink . LOG . info ( snk . getMetrics ( ) . toText ( ) ) ; snk . open ( ) ; com . cloudera . flume . core . EventSource src = com . cloudera . flume . handlers . debug . MemorySinkSource . cannedData ( "test<sp>is<sp>a<sp>test" , 31 ) ; src . open ( ) ; com . cloudera . flume . core . EventUtil . dumpAll ( src , snk ) ; int [ ] ans = new int [ ] { 16 , 8 , 4 , 2 , 1 } ; for ( int i = 0 ; i < ( ans . length ) ; i ++ ) { com . cloudera . flume . reporter . Reportable rptable = com . cloudera . flume . reporter . ReportManager . get ( ) . getReportable ( names . get ( i ) ) ; long val = rptable . getMetrics ( ) . getLongMetric ( names . get ( i ) ) ; System . out . println ( ( ( ( "report<sp>" + ( names . get ( i ) ) ) + "<sp>:<sp>" ) + val ) ) ; System . out . flush ( ) ; "<AssertPlaceHolder>" ; } } flush ( ) { if ( ( raf ) != null ) { try { raf . close ( ) ; } catch ( java . io . IOException e ) { com . cloudera . flume . handlers . text . Cursor . LOG . error ( ( "problem<sp>closing<sp>file<sp>" + ( e . getMessage ( ) ) ) , e ) ; } } buf . flip ( ) ; int remaining = buf . remaining ( ) ; if ( remaining > 0 ) { byte [ ] body = new byte [ remaining ] ; buf . get ( body , 0 , remaining ) ; com . cloudera . flume . core . Event e = new com . cloudera . flume . core . EventImpl ( body ) ; e . set ( TailSource . A_TAILSRCFILE , file . getName ( ) . getBytes ( ) ) ; try { sync . put ( e ) ; } catch ( java . lang . InterruptedException e1 ) { com . cloudera . flume . handlers . text . Cursor . LOG . error ( ( "interruptedException!<sp>" + ( e1 . getMessage ( ) ) ) , e1 ) ; throw e1 ; } } in = null ; buf . clear ( ) ; } | org . junit . Assert . assertEquals ( ans [ i ] , val ) |
inverseMatching4 ( ) { dakara . eclipse . plugin . kavi . picklist . InputCommand inputCommand = dakara . eclipse . plugin . kavi . picklist . InputCommand . parse ( "!two!four" ) ; java . util . List < dakara . eclipse . plugin . stringscore . RankedItem < dakara . eclipse . plugin . kavi . picklist . ListRankAndSelectorTest . TestItem > > listItems = rankSelectorMultiColumn . rankAndFilter ( inputCommand , itemList ) ; "<AssertPlaceHolder>" ; } rankAndFilter ( dakara . eclipse . plugin . kavi . picklist . InputCommand , java . util . List ) { if ( ( ! ( inputCommand . isColumnFiltering ) ) && ( ( inputCommand . getColumnFilterOptions ( 0 ) . rawInputText . length ( ) ) == 0 ) ) return makeRankedList ( items ) ; return items . parallelStream ( ) . map ( ( item ) -> new dakara . eclipse . plugin . stringscore . RankedItem < > ( item ) ) . map ( ( item ) -> setItemRank ( item , inputCommand ) ) . filter ( ( item ) -> ( item . totalScore ( ) ) > 0 ) . sorted ( java . util . Comparator . comparing ( ( dakara . eclipse . plugin . stringscore . RankedItem < T > item ) -> item . totalScore ( ) ) . reversed ( ) . thenComparing ( ( item ) -> sortFieldResolver . apply ( ( ( dakara . eclipse . plugin . stringscore . T ) ( item . dataItem ) ) ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; } | org . junit . Assert . assertEquals ( 8 , listItems . size ( ) ) |
test_PLP ( ) { cpu . stackPush ( 47 ) ; bus . loadProgram ( 40 ) ; cpu . step ( ) ; "<AssertPlaceHolder>" ; } getProcessorStatus ( ) { return state . getStatusFlag ( ) ; } | org . junit . Assert . assertEquals ( 47 , cpu . getProcessorStatus ( ) ) |
testEqualsWithNull ( ) { opennlp . tools . util . Span a = new opennlp . tools . util . Span ( 0 , 0 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj instanceof opennlp . tools . lemmatizer . LemmaSample ) { opennlp . tools . lemmatizer . LemmaSample a = ( ( opennlp . tools . lemmatizer . LemmaSample ) ( obj ) ) ; return ( ( java . util . Arrays . equals ( getTokens ( ) , a . getTokens ( ) ) ) && ( java . util . Arrays . equals ( getTags ( ) , a . getTags ( ) ) ) ) && ( java . util . Arrays . equals ( getLemmas ( ) , a . getLemmas ( ) ) ) ; } return false ; } | org . junit . Assert . assertEquals ( a . equals ( null ) , false ) |
testSaslXOauth2Connection ( ) { try ( org . apache . qpid . jms . test . testpeer . TestAmqpPeer testPeer = new org . apache . qpid . jms . test . testpeer . TestAmqpPeer ( ) ) { java . lang . String user = "user" ; java . lang . String pass = "eyB1c2VyPSJ1c2VyIiB9" ; testPeer . expectSaslXOauth2 ( user , pass ) ; testPeer . expectOpen ( ) ; testPeer . expectBegin ( ) ; javax . jms . ConnectionFactory factory = new org . apache . qpid . jms . JmsConnectionFactory ( ( "amqp://localhost:" + ( testPeer . getServerPort ( ) ) ) ) ; javax . jms . Connection connection = factory . createConnection ( user , pass ) ; connection . setClientID ( "clientName" ) ; testPeer . waitForAllHandlersToComplete ( 1000 ) ; "<AssertPlaceHolder>" ; testPeer . expectClose ( ) ; connection . close ( ) ; } } getThrowable ( ) { return _driverRunnable . getException ( ) ; } | org . junit . Assert . assertNull ( testPeer . getThrowable ( ) ) |
count ( ) { final java . lang . String sparql = "SELECT<sp>(count(?item)<sp>as<sp>?itemCount)<sp>{<sp>" + ( "?item<sp><urn:id><sp>?id<sp>.<sp>" + "}" ) ; final org . eclipse . rdf4j . model . ValueFactory vf = org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) ; final java . util . Collection < org . eclipse . rdf4j . model . Statement > statements = com . google . common . collect . Sets . newHashSet ( vf . createStatement ( vf . createIRI ( "urn:apple" ) , vf . createIRI ( "urn:id" ) , vf . createLiteral ( java . util . UUID . randomUUID ( ) . toString ( ) ) ) , vf . createStatement ( vf . createIRI ( "urn:gum" ) , vf . createIRI ( "urn:id" ) , vf . createLiteral ( java . util . UUID . randomUUID ( ) . toString ( ) ) ) , vf . createStatement ( vf . createIRI ( "urn:sandwich" ) , vf . createIRI ( "urn:id" ) , vf . createLiteral ( java . util . UUID . randomUUID ( ) . toString ( ) ) ) , vf . createStatement ( vf . createIRI ( "urn:sandwich" ) , vf . createIRI ( "urn:price" ) , vf . createLiteral ( 3.99 ) ) ) ; final java . lang . String pcjId = loadDataAndCreateQuery ( sparql , statements ) ; final org . eclipse . rdf4j . query . impl . MapBindingSet expectedResult = new org . eclipse . rdf4j . query . impl . MapBindingSet ( ) ; expectedResult . addBinding ( "itemCount" , vf . createLiteral ( "3" , XMLSchema . INTEGER ) ) ; final org . apache . rya . api . model . VisibilityBindingSet result = readLastResult ( pcjId ) ; "<AssertPlaceHolder>" ; } readLastResult ( java . lang . String ) { requireNonNull ( pcjId ) ; org . apache . rya . api . model . VisibilityBindingSet result = null ; try ( final org . apache . kafka . clients . consumer . KafkaConsumer < java . lang . String , org . apache . rya . api . model . VisibilityBindingSet > consumer = makeConsumer ( pcjId ) ) { final org . apache . kafka . clients . consumer . ConsumerRecords < java . lang . String , org . apache . rya . api . model . VisibilityBindingSet > records = consumer . poll ( 5000 ) ; final java . util . Iterator < org . apache . kafka . clients . consumer . ConsumerRecord < java . lang . String , org . apache . rya . api . model . VisibilityBindingSet > > recordIterator = records . iterator ( ) ; while ( recordIterator . hasNext ( ) ) { result = recordIterator . next ( ) . value ( ) ; } } return result ; } | org . junit . Assert . assertEquals ( expectedResult , result ) |
getIntentName ( ) { final io . klerch . alexa . tellask . model . AlexaOutput output = io . klerch . alexa . tellask . model . AlexaOutput . ask ( "intentName" ) . build ( ) ; "<AssertPlaceHolder>" ; } getIntentName ( ) { return intentName ; } | org . junit . Assert . assertThat ( output . getIntentName ( ) , org . hamcrest . core . Is . is ( "intentName" ) ) |
testGetService ( ) { java . lang . String id = "dummy-service" ; flex . messaging . services . MessageService expected = new flex . messaging . services . MessageService ( ) ; expected . setId ( id ) ; broker . addService ( expected ) ; flex . messaging . services . Service actual = broker . getService ( id ) ; "<AssertPlaceHolder>" ; } addService ( javax . management . ObjectName ) { services . add ( value ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testProvider ( ) { startServer ( com . sun . jersey . osgi . tests . grizzly . GrizzlyWebProviderLifecycleTest . FileReferenceWriter . class , com . sun . jersey . osgi . tests . grizzly . GrizzlyWebProviderLifecycleTest . FileTypeResource . class ) ; com . sun . jersey . api . client . WebResource r = com . sun . jersey . api . client . Client . create ( ) . resource ( getUri ( ) . path ( "/" ) . build ( ) ) ; java . lang . String s = r . get ( java . lang . String . class ) ; java . io . File f = new java . io . File ( s ) ; "<AssertPlaceHolder>" ; stopServer ( ) ; } get ( java . lang . Object ) { return core . get ( key ) ; } | org . junit . Assert . assertTrue ( f . exists ( ) ) |
shouldInstrumentStatementFunctionAssignment ( ) { java . lang . String source = "this.someFn()\n<sp>._renderItem<sp>=<sp>function()<sp>{};" ; java . lang . String instrumentedSource = sourceProcessor . instrumentSource ( source ) ; java . lang . String expectedSource = "_$jscoverage[\'test.js\'].lineData[1]++;\nthis.someFn()._renderItem<sp>=<sp>function()<sp>{\n<sp>_$jscoverage[\'test.js\'].functionData[0]++;\n};\n" ; "<AssertPlaceHolder>" ; } instrumentSource ( java . lang . String ) { return instrumentSource ( uri , source ) ; } | org . junit . Assert . assertEquals ( expectedSource , instrumentedSource ) |
testGetBusinessObjectDefinitionColumnsTrimParameters ( ) { businessObjectDefinitionColumnDaoTestHelper . createBusinessObjectDefinitionColumnEntity ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionColumnKey ( BDEF_NAMESPACE , BDEF_NAME , BDEF_COLUMN_NAME_2 ) , org . finra . herd . service . DESCRIPTION_2 ) ; businessObjectDefinitionColumnDaoTestHelper . createBusinessObjectDefinitionColumnEntity ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionColumnKey ( BDEF_NAMESPACE , BDEF_NAME , BDEF_COLUMN_NAME ) , org . finra . herd . service . DESCRIPTION ) ; org . finra . herd . model . api . xml . BusinessObjectDefinitionColumnKeys resultBusinessObjectDefinitionColumnKeys = businessObjectDefinitionColumnService . getBusinessObjectDefinitionColumns ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionKey ( addWhitespace ( org . finra . herd . service . BDEF_NAMESPACE ) , addWhitespace ( org . finra . herd . service . BDEF_NAME ) ) ) ; "<AssertPlaceHolder>" ; } addWhitespace ( java . lang . String ) { return java . lang . String . format ( "<sp>%s<sp>" , string ) ; } | org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionColumnKeys ( com . google . common . collect . Lists . newArrayList ( new org . finra . herd . model . api . xml . BusinessObjectDefinitionColumnKey ( BDEF_NAMESPACE , BDEF_NAME , BDEF_COLUMN_NAME ) , new org . finra . herd . model . api . xml . BusinessObjectDefinitionColumnKey ( BDEF_NAMESPACE , BDEF_NAME , BDEF_COLUMN_NAME_2 ) ) ) , resultBusinessObjectDefinitionColumnKeys ) |
get2DCoordinateCoverage_Full ( ) { org . openscience . cdk . interfaces . IAtomContainer container = new org . openscience . cdk . AtomContainer ( ) ; org . openscience . cdk . interfaces . IAtom atom1 = new org . openscience . cdk . Atom ( "C" ) ; org . openscience . cdk . interfaces . IAtom atom2 = new org . openscience . cdk . Atom ( "C" ) ; org . openscience . cdk . interfaces . IAtom atom3 = new org . openscience . cdk . Atom ( "C" ) ; atom1 . setPoint2d ( new javax . vecmath . Point2d ( 1 , 1 ) ) ; atom2 . setPoint2d ( new javax . vecmath . Point2d ( 2 , 1 ) ) ; atom3 . setPoint2d ( new javax . vecmath . Point2d ( 1 , 2 ) ) ; container . addAtom ( atom1 ) ; container . addAtom ( atom2 ) ; container . addAtom ( atom3 ) ; "<AssertPlaceHolder>" ; } get2DCoordinateCoverage ( org . openscience . cdk . interfaces . IAtomContainer ) { if ( ( container == null ) || ( ( container . getAtomCount ( ) ) == 0 ) ) return org . openscience . cdk . geometry . GeometryTools . CoordinateCoverage . NONE ; int count = 0 ; for ( org . openscience . cdk . interfaces . IAtom atom : container . atoms ( ) ) { count += ( ( atom != null ) && ( ( atom . getPoint2d ( ) ) != null ) ) ? 1 : 0 ; } return count == 0 ? org . openscience . cdk . geometry . GeometryTools . CoordinateCoverage . NONE : count == ( container . getAtomCount ( ) ) ? org . openscience . cdk . geometry . GeometryTools . CoordinateCoverage . FULL : org . openscience . cdk . geometry . GeometryTools . CoordinateCoverage . PARTIAL ; } | org . junit . Assert . assertEquals ( GeometryTools . CoordinateCoverage . FULL , org . openscience . cdk . geometry . GeometryTools . get2DCoordinateCoverage ( container ) ) |
init ( ) { com . asakusafw . runtime . value . DoubleOption option = new com . asakusafw . runtime . value . DoubleOption ( ) ; "<AssertPlaceHolder>" ; } isNull ( ) { return nullValue ; } | org . junit . Assert . assertThat ( option . isNull ( ) , is ( true ) ) |
testGetXmlRoot ( ) { java . io . File registryFile = new java . io . File ( "src/test/resources/invalid.xml" ) ; "<AssertPlaceHolder>" ; } getXmlRoot ( java . io . File ) { org . jboss . forge . parser . xml . Node installed = null ; try { installed = org . jboss . forge . parser . xml . XMLParser . parse ( registryFile ) ; } catch ( org . jboss . forge . parser . xml . XMLParserException e ) { org . jboss . forge . furnace . impl . addons . AddonRepositoryStateStrategyImpl . logger . log ( Level . WARNING , ( ( "Error<sp>occurred<sp>while<sp>parsing<sp>[" + registryFile ) + "]" ) , e ) ; throw e ; } return installed ; } | org . junit . Assert . assertNotNull ( org . jboss . forge . furnace . impl . addons . AddonRepositoryStateStrategyImpl . getXmlRoot ( registryFile ) ) |
testCtWithMultipleParams ( ) { final org . apache . deltaspike . core . util . metadata . builder . AnnotatedTypeBuilder < org . apache . deltaspike . test . api . metadata . AnnotatedTypeBuilderTest . TypeWithParamsInCt > builder = new org . apache . deltaspike . core . util . metadata . builder . AnnotatedTypeBuilder < org . apache . deltaspike . test . api . metadata . AnnotatedTypeBuilderTest . TypeWithParamsInCt > ( ) ; builder . readFromType ( org . apache . deltaspike . test . api . metadata . AnnotatedTypeBuilderTest . TypeWithParamsInCt . class ) ; builder . addToClass ( new javax . enterprise . util . AnnotationLiteral < javax . enterprise . inject . Default > ( ) { } ) ; javax . enterprise . inject . spi . AnnotatedType < org . apache . deltaspike . test . api . metadata . AnnotatedTypeBuilderTest . TypeWithParamsInCt > newAt = builder . create ( ) ; "<AssertPlaceHolder>" ; } create ( ) { java . util . Map < java . lang . reflect . Constructor < ? > , java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > > constructorParameterAnnotations = new java . util . HashMap < java . lang . reflect . Constructor < ? > , java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > > ( ) ; java . util . Map < java . lang . reflect . Constructor < ? > , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > constructorAnnotations = new java . util . HashMap < java . lang . reflect . Constructor < ? > , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > ( ) ; java . util . Map < java . lang . reflect . Method , java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > > methodParameterAnnotations = new java . util . HashMap < java . lang . reflect . Method , java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > > ( ) ; java . util . Map < java . lang . reflect . Method , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > methodAnnotations = new java . util . HashMap < java . lang . reflect . Method , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > ( ) ; java . util . Map < java . lang . reflect . Field , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > fieldAnnotations = new java . util . HashMap < java . lang . reflect . Field , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > ( ) ; for ( Map . Entry < java . lang . reflect . Field , org . apache . deltaspike . core . util . metadata . builder . AnnotationBuilder > field : fields . entrySet ( ) ) { fieldAnnotations . put ( field . getKey ( ) , field . getValue ( ) . create ( ) ) ; } for ( Map . Entry < java . lang . reflect . Method , org . apache . deltaspike . core . util . metadata . builder . AnnotationBuilder > method : methods . entrySet ( ) ) { methodAnnotations . put ( method . getKey ( ) , method . getValue ( ) . create ( ) ) ; } for ( Map . Entry < java . lang . reflect . Method , java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationBuilder > > parameters : methodParameters . entrySet ( ) ) { java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > parameterAnnotations = new java . util . HashMap < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationStore > ( ) ; methodParameterAnnotations . put ( parameters . getKey ( ) , parameterAnnotations ) ; for ( Map . Entry < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationBuilder > parameter : parameters . getValue ( ) . entrySet ( ) ) { parameterAnnotations . put ( parameter . getKey ( ) , parameter . getValue ( ) . create ( ) ) ; } } for ( Map . Entry < java . lang . reflect . Constructor < ? > , org . apache . deltaspike . core . util . metadata . builder . AnnotationBuilder > constructor : constructors . entrySet ( ) ) { constructorAnnotations . put ( constructor . getKey ( ) , constructor . getValue ( ) . create ( ) ) ; } for ( Map . Entry < java . lang . reflect . Constructor < ? > , java . util . Map < java . lang . Integer , org . apache . deltaspike . core . util . metadata . builder . AnnotationBuilder > > parameters : constructorParameters . entrySet ( ) ) { java . util . Map < java . | org . junit . Assert . assertNotNull ( newAt ) |
test ( ) { java . io . File file = new java . io . File ( ( ( ( ( net . openhft . chronicle . map . ChronicleMapImportExportTest . TMP ) + "/chronicle-map-" ) + ( java . lang . System . nanoTime ( ) ) ) + ".json" ) ) ; file . deleteOnExit ( ) ; net . openhft . chronicle . map . ChronicleMapBuilder < java . lang . String , java . lang . String > builder = net . openhft . chronicle . map . ChronicleMapBuilder . of ( java . lang . String . class , java . lang . String . class ) . averageKeySize ( 10 ) . averageValueSize ( 10 ) . entries ( 1000 ) ; try ( net . openhft . chronicle . map . ChronicleMap < java . lang . String , java . lang . String > expected = builder . create ( ) ) { expected . put ( "hello" , "world" ) ; expected . put ( "aKey" , "aValue" ) ; expected . getAll ( file ) ; try ( net . openhft . chronicle . map . ChronicleMap < java . lang . String , java . lang . String > actual = builder . create ( ) ) { actual . putAll ( file ) ; "<AssertPlaceHolder>" ; } } finally { file . delete ( ) ; } } putAll ( net . openhft . chronicle . map . Map ) { m . forEach ( this :: put ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
toString_Info ( ) { org . oscm . internal . components . response . ReturnCode returnCode = new org . oscm . internal . components . response . ReturnCode ( ReturnType . INFO , "KEY" ) ; "<AssertPlaceHolder>" ; } hasToString ( ) { org . junit . Assert . assertThat ( new org . oscm . test . matchers . JavaMatchersTest . TestWithToString ( ) , org . oscm . test . matchers . JavaMatchers . hasToString ( ) ) ; } | org . junit . Assert . assertThat ( returnCode , hasToString ( ) ) |
testAmp ( ) { java . lang . String markdown = "```\n&read_data\n```" ; java . lang . String html = "<pre><code<sp>class=\"hljs\">&read_data\n</code></pre>\n" ; java . lang . String result = org . support . project . knowledge . logic . MarkdownLogic . get ( ) . markdownToHtml ( markdown , MarkdownLogic . ENGINE_MARKEDJ ) . getHtml ( ) ; try { "<AssertPlaceHolder>" ; } catch ( java . lang . AssertionError e ) { org . support . project . knowledge . logic . MarkdownLogicTest . LOG . info ( "testMarkdJDel" ) ; org . support . project . knowledge . logic . MarkdownLogicTest . LOG . info ( ( "[Markdown]<sp>:<sp>" + markdown ) ) ; org . support . project . knowledge . logic . MarkdownLogicTest . LOG . info ( ( "[Html]<sp>:<sp>" + html ) ) ; org . support . project . knowledge . logic . MarkdownLogicTest . LOG . info ( ( "[Parsed]<sp>:<sp>" + result ) ) ; org . support . project . knowledge . logic . MarkdownLogicTest . LOG . info ( ( "[Indent]<sp>:<sp>" + ( org . support . project . web . logic . SanitizingLogic . get ( ) . indent ( result ) ) ) ) ; throw e ; } } getHtml ( ) { return html ; } | org . junit . Assert . assertEquals ( html , result ) |
testNewForeign ( ) { final org . graalvm . polyglot . Source src = org . graalvm . polyglot . Source . newBuilder ( "sl" , "function<sp>getValue(type)<sp>{o<sp>=<sp>new(type);<sp>o.a<sp>=<sp>10;<sp>return<sp>o.value;}" , "testObject.sl" ) . buildLiteral ( ) ; context . eval ( src ) ; org . graalvm . polyglot . Value getValue = context . getBindings ( "sl" ) . getMember ( "getValue" ) ; org . graalvm . polyglot . Value ret = getValue . execute ( new com . oracle . truffle . sl . test . SLInteropObjectTest . TestType ( ) ) ; "<AssertPlaceHolder>" ; } asLong ( ) { if ( fitsInLong ( ) ) { return value . longValue ( ) ; } else { throw com . oracle . truffle . api . interop . UnsupportedMessageException . create ( ) ; } } | org . junit . Assert . assertEquals ( 20 , ret . asLong ( ) ) |
runTest ( ) { boolean result = checkNoError ( "Social_Forums_Create_Topic" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; } | org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result ) |
implicitlyCastsByteToInt ( ) { org . teavm . flavour . expr . test . IntComputation c = parseExpr ( org . teavm . flavour . expr . test . IntComputation . class , "byteValue<sp>-<sp>3" ) ; vars . byteValue ( ( ( byte ) ( 8 ) ) ) ; "<AssertPlaceHolder>" ; } parseExpr ( java . lang . Class , java . lang . String ) { org . teavm . flavour . expr . EvaluatorBuilder builder = new org . teavm . flavour . expr . InterpretingEvaluatorBuilder ( ) . importPackage ( "java.lang" ) . importPackage ( "java.util" ) . importClass ( org . teavm . flavour . expr . test . EvaluatorTest . class . getName ( ) ) . importClass ( java . util . stream . Collectors . class . getName ( ) ) ; org . teavm . flavour . expr . Evaluator < T , org . teavm . flavour . expr . test . TestVars > e ; try { e = builder . build ( cls , org . teavm . flavour . expr . test . TestVars . class , str ) ; } catch ( org . teavm . flavour . expr . InvalidExpressionException ex ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "Errors<sp>occurred<sp>compiling<sp>expression:\n" ) ; sb . append ( str ) . append ( "\n" ) ; java . util . List < org . teavm . flavour . expr . Diagnostic > diagnostics = ex . getDiagnostics ( ) . stream ( ) . sorted ( java . util . Comparator . comparingInt ( ( d ) -> d . getStart ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; for ( org . teavm . flavour . expr . Diagnostic diagnostic : diagnostics ) { for ( int i = 0 ; i < ( diagnostic . getStart ( ) ) ; ++ i ) { sb . append ( '<sp>' ) ; } sb . append ( "^\n" ) ; sb . append ( diagnostic . getMessage ( ) ) . append ( "\n\n" ) ; } throw new java . lang . AssertionError ( sb . toString ( ) ) ; } vars = e . getVariables ( ) ; return e . getFunction ( ) ; } | org . junit . Assert . assertThat ( c . compute ( ) , org . hamcrest . Matchers . is ( 5 ) ) |
shouldRetryWhenEndOffsetsThrowsTimeoutException ( ) { final int retries = 2 ; final java . util . concurrent . atomic . AtomicInteger numberOfCalls = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; consumer = new org . apache . kafka . clients . consumer . MockConsumer < byte [ ] , byte [ ] > ( org . apache . kafka . clients . consumer . OffsetResetStrategy . EARLIEST ) { @ org . apache . kafka . streams . processor . internals . Override public synchronized java . util . Map < org . apache . kafka . common . TopicPartition , java . lang . Long > endOffsets ( final java . util . Collection < org . apache . kafka . common . TopicPartition > partitions ) { numberOfCalls . incrementAndGet ( ) ; throw new org . apache . kafka . common . errors . TimeoutException ( ) ; } } ; streamsConfig = new org . apache . kafka . streams . StreamsConfig ( new java . util . Properties ( ) { { put ( StreamsConfig . APPLICATION_ID_CONFIG , "appId" ) ; put ( StreamsConfig . BOOTSTRAP_SERVERS_CONFIG , "dummy:1234" ) ; put ( StreamsConfig . STATE_DIR_CONFIG , org . apache . kafka . test . TestUtils . tempDirectory ( ) . getPath ( ) ) ; put ( StreamsConfig . RETRIES_CONFIG , retries ) ; } } ) ; try { new org . apache . kafka . streams . processor . internals . GlobalStateManagerImpl ( new org . apache . kafka . common . utils . LogContext ( "mock" ) , topology , consumer , stateDirectory , stateRestoreListener , streamsConfig ) ; } catch ( final org . apache . kafka . streams . errors . StreamsException expected ) { "<AssertPlaceHolder>" ; } } get ( ) { return value ; } | org . junit . Assert . assertEquals ( numberOfCalls . get ( ) , retries ) |
testGetTweetWithGeolocation ( ) { twitter4j . Status st = twitterSearch . getTweet ( 18845491030L ) ; "<AssertPlaceHolder>" ; } getGeoLocation ( ) { return geoLocation ; } | org . junit . Assert . assertNotNull ( st . getGeoLocation ( ) ) |
testLldpToNodeConnectorRefNotLLDP ( ) { byte [ ] packetNotLLDP = new byte [ ] { 1 , 35 , 0 , 0 , 0 , 1 , ( ( byte ) ( 138 ) ) , ( ( byte ) ( 142 ) ) , ( ( byte ) ( 204 ) ) , ( ( byte ) ( 133 ) ) , ( ( byte ) ( 235 ) ) , 39 , ( ( byte ) ( 8 ) ) , ( ( byte ) ( 0 ) ) , 2 , 7 , 4 , 0 , 0 , 0 , 0 , 0 , 2 , 4 , 2 , 7 , 50 , 6 , 2 , 19 , 55 , 10 , 10 , 111 , 112 , 101 , 110 , 102 , 108 , 111 , 119 , 58 , 50 , ( ( byte ) ( 254 ) ) , 16 , 0 , 38 , ( ( byte ) ( 225 ) ) , 0 , 111 , 112 , 101 , 110 , 102 , 108 , 111 , 119 , 58 , 50 , 58 , 50 , ( ( byte ) ( 254 ) ) , 20 , 0 , 38 , ( ( byte ) ( 225 ) ) , 1 , 98 , ( ( byte ) ( 200 ) ) , 43 , 103 , ( ( byte ) ( 206 ) ) , ( ( byte ) ( 190 ) ) , 124 , 43 , 71 , ( ( byte ) ( 190 ) ) , 43 , ( ( byte ) ( 231 ) ) , ( ( byte ) ( 188 ) ) , ( ( byte ) ( 233 ) ) , 117 , 61 , 0 , 0 } ; org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeConnectorRef nodeConnectorRef = org . opendaylight . openflowplugin . applications . topology . lldp . utils . LLDPDiscoveryUtils . lldpToNodeConnectorRef ( packetNotLLDP , false ) ; "<AssertPlaceHolder>" ; } lldpToNodeConnectorRef ( byte [ ] , boolean ) { org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeConnectorRef nodeConnectorRef = null ; if ( org . opendaylight . openflowplugin . applications . topology . lldp . utils . LLDPDiscoveryUtils . isLLDP ( payload ) ) { org . opendaylight . openflowplugin . libraries . liblldp . Ethernet ethPkt = new org . opendaylight . openflowplugin . libraries . liblldp . Ethernet ( ) ; try { ethPkt . deserialize ( payload , 0 , ( ( payload . length ) * ( org . opendaylight . openflowplugin . libraries . liblldp . NetUtils . NUM_BITS_IN_A_BYTE ) ) ) ; } catch ( org . opendaylight . openflowplugin . libraries . liblldp . PacketException e ) { org . opendaylight . openflowplugin . applications . topology . lldp . utils . LLDPDiscoveryUtils . LOG . warn ( "Failed<sp>to<sp>decode<sp>LLDP<sp>packet" , e ) ; return nodeConnectorRef ; } org . opendaylight . openflowplugin . libraries . liblldp . LLDP lldp = ( ( org . opendaylight . openflowplugin . libraries . liblldp . LLDP ) ( ethPkt . getPayload ( ) ) ) ; try { org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeId srcNodeId = null ; org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeConnectorId srcNodeConnectorId = null ; final org . opendaylight . openflowplugin . libraries . liblldp . LLDPTLV systemIdTLV = lldp . getSystemNameId ( ) ; if ( systemIdTLV != null ) { java . lang . String srcNodeIdString = new java . lang . String ( systemIdTLV . getValue ( ) , java . nio . charset . Charset . defaultCharset ( ) ) ; srcNodeId = new org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeId ( srcNodeIdString ) ; } else { throw new java . lang . Exception ( "Node<sp>id<sp>wasn't<sp>specified<sp>via<sp>systemNameId<sp>in<sp>LLDP<sp>packet." ) ; } final org . opendaylight . openflowplugin . libraries . liblldp . LLDPTLV nodeConnectorIdLldptlv = lldp . getCustomTLV ( org . opendaylight . openflowplugin . libraries . liblldp . LLDPTLV . createPortSubTypeCustomTLVKey ( ) ) ; if ( nodeConnectorIdLldptlv != null ) { srcNodeConnectorId = new org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . NodeConnectorId ( org . opendaylight . openflowplugin . libraries . liblldp . LLDPTLV . getCustomString ( nodeConnectorIdLldptlv . getValue ( ) , nodeConnectorIdLldptlv . getLength ( ) ) ) ; } else { throw new java . lang . Exception ( "Node<sp>connector<sp>wasn't<sp>specified<sp>via<sp>Custom<sp>TLV<sp>in<sp>LLDP<sp>packet." ) ; } if ( useExtraAuthenticatorCheck ) { boolean secure = org . opendaylight . openflowplugin . applications . topology . lldp . utils . LLDPDiscoveryUtils . checkExtraAuthenticator ( lldp , srcNodeConnectorId ) ; if ( ! secure ) { org . opendaylight . openflowplugin . applications . topology . lldp . utils . LLDPDiscoveryUtils . LOG . warn ( "SECURITY<sp>ALERT:<sp>there<sp>is<sp>probably<sp>a<sp>LLDP<sp>spoofing<sp>attack<sp>in<sp>progress." ) ; throw new java . lang . Exception ( "Attack.<sp>LLDP<sp>packet<sp>with<sp>inconsistent<sp>extra<sp>authenticator<sp>field<sp>was<sp>received." ) ; } } org . opendaylight . yangtools . yang . binding . InstanceIdentifier < org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . node . NodeConnector > srcInstanceId = org . opendaylight . yangtools . yang . binding . InstanceIdentifier . builder ( org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . Nodes . class ) . child ( org . opendaylight . yang . gen . v1 . urn . opendaylight . inventory . rev130819 . nodes . Node . class , new org . opendaylight . yang . gen . v1 . urn | org . junit . Assert . assertNull ( nodeConnectorRef ) |
testRemove_firstElement ( ) { org . eclipse . rap . rwt . internal . remote . MessageFilter filter1 = createLoggingFilter ( "h1" ) ; org . eclipse . rap . rwt . internal . remote . MessageFilter filter2 = createLoggingFilter ( "h2" ) ; org . eclipse . rap . rwt . internal . remote . MessageChainElement element = org . eclipse . rap . rwt . internal . remote . MessageChainElement_Test . createFilterChain ( filter1 , filter2 ) ; org . eclipse . rap . rwt . internal . remote . MessageChainElement result = element . remove ( filter2 ) ; result . handleMessage ( message ) ; "<AssertPlaceHolder>" ; } handleMessage ( org . eclipse . rap . rwt . internal . protocol . RequestMessage ) { return filter . handleMessage ( request , nextElement ) ; } | org . junit . Assert . assertEquals ( asList ( "h1" ) , log ) |
testAddEntryNonExistingAT ( ) { org . apache . directory . ldap . client . api . LdapConnection connection = getAdminConnection ( getLdapServer ( ) ) ; org . apache . directory . api . ldap . model . name . Dn dn = new org . apache . directory . api . ldap . model . name . Dn ( ( "cn=Kate<sp>Bush," + ( org . apache . directory . server . operations . ldapsdk . AddIT . BASE ) ) ) ; org . apache . directory . api . ldap . model . entry . Entry personEntry = new org . apache . directory . api . ldap . model . entry . DefaultEntry ( ) ; personEntry . add ( SchemaConstants . OBJECT_CLASS_AT , "person" ) ; personEntry . add ( SchemaConstants . CN_AT , "Kate<sp>Bush" ) ; personEntry . add ( SchemaConstants . SN_AT , "Bush" ) ; personEntry . add ( "nonExistingAttribute" , "value" ) ; personEntry . setDn ( dn ) ; try { connection . add ( personEntry ) ; org . junit . Assert . fail ( "should<sp>throw<sp>LdapNoSuchAttributeException" ) ; } catch ( org . apache . directory . api . ldap . model . exception . LdapNoSuchAttributeException e ) { } org . apache . directory . api . ldap . model . entry . Entry entry = connection . lookup ( dn ) ; "<AssertPlaceHolder>" ; connection . close ( ) ; } lookup ( java . lang . String ) { return comparator ; } | org . junit . Assert . assertNull ( entry ) |
testGetCompositeModel ( ) { System . out . println ( "getCompositeModel" ) ; kg . apc . jmeter . vizualizers . CompositeResultCollector instance = new kg . apc . jmeter . vizualizers . CompositeResultCollector ( ) ; kg . apc . jmeter . vizualizers . CompositeModel expResult = null ; kg . apc . jmeter . vizualizers . CompositeModel result = instance . getCompositeModel ( ) ; "<AssertPlaceHolder>" ; } getCompositeModel ( ) { return compositeModel ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testCopyConstructor ( ) { com . intuit . wasabi . experimentobjects . Context con = com . intuit . wasabi . experimentobjects . Context . newInstance ( "a$123_a" ) . build ( ) ; com . intuit . wasabi . experimentobjects . Context con2 = com . intuit . wasabi . experimentobjects . Context . from ( con ) . build ( ) ; "<AssertPlaceHolder>" ; } getContext ( ) { return context ; } | org . junit . Assert . assertEquals ( con . getContext ( ) , con2 . getContext ( ) ) |
testGetImportsWhenDiagramIsNotPresent ( ) { stateProvider . withDiagram ( null ) ; final java . util . List < org . kie . workbench . common . dmn . api . definition . v1_1 . Import > actualImports = stateProvider . getImports ( ) ; final java . util . List < org . kie . workbench . common . dmn . api . definition . v1_1 . Import > expectedImports = emptyList ( ) ; "<AssertPlaceHolder>" ; } getImports ( ) { return getDiagram ( ) . map ( this :: getImports ) . orElse ( emptyList ( ) ) ; } | org . junit . Assert . assertEquals ( expectedImports , actualImports ) |
testStoragePolicyID ( ) { for ( byte i = 0 ; i < 16 ; i ++ ) { final org . apache . hadoop . hdfs . server . namenode . INodeFile f = org . apache . hadoop . hdfs . server . namenode . TestINodeFile . createINodeFile ( i ) ; "<AssertPlaceHolder>" ; } } getStoragePolicyID ( ) { byte id = getLocalStoragePolicyID ( ) ; if ( id == ( BLOCK_STORAGE_POLICY_ID_UNSPECIFIED ) ) { id = ( ( this . getParent ( ) ) != null ) ? this . getParent ( ) . getStoragePolicyID ( ) : id ; } if ( ( ( isStriped ( ) ) && ( id != ( BLOCK_STORAGE_POLICY_ID_UNSPECIFIED ) ) ) && ( ! ( org . apache . hadoop . hdfs . server . namenode . ErasureCodingPolicyManager . checkStoragePolicySuitableForECStripedMode ( id ) ) ) ) { id = org . apache . hadoop . hdfs . protocol . HdfsConstants . BLOCK_STORAGE_POLICY_ID_UNSPECIFIED ; if ( org . apache . hadoop . hdfs . server . namenode . LOG . isDebugEnabled ( ) ) { org . apache . hadoop . hdfs . server . namenode . LOG . debug ( ( ( ( ( "The<sp>current<sp>effective<sp>storage<sp>policy<sp>id<sp>:<sp>" + id ) + "<sp>is<sp>not<sp>suitable<sp>for<sp>striped<sp>mode<sp>EC<sp>file<sp>:<sp>" ) + ( getName ( ) ) ) + ".<sp>So,<sp>just<sp>returning<sp>unspecified<sp>storage<sp>policy<sp>id" ) ) ; } } return id ; } | org . junit . Assert . assertEquals ( i , f . getStoragePolicyID ( ) ) |
testGetPrivilegeManager ( ) { org . apache . jackrabbit . api . security . authorization . PrivilegeManager pMgr = configuration . getPrivilegeManager ( org . mockito . Mockito . mock ( org . apache . jackrabbit . oak . api . Root . class ) , NamePathMapper . DEFAULT ) ; "<AssertPlaceHolder>" ; } getPrivilegeManager ( org . apache . jackrabbit . oak . api . Root , org . apache . jackrabbit . oak . namepath . NamePathMapper ) { return new org . apache . jackrabbit . oak . security . privilege . PrivilegeManagerImpl ( root , namePathMapper ) ; } | org . junit . Assert . assertTrue ( ( pMgr instanceof org . apache . jackrabbit . oak . security . privilege . PrivilegeManagerImpl ) ) |
testSingleRelatedContentSearchRequestProcessorHandlerIsCreated ( ) { java . lang . System . setProperty ( ConfigurationConstants . PROPNAME_NUMBER_OF_SEARCHING_REQUEST_PROCESSORS , "1" ) ; org . greencheek . related . util . config . Configuration config = new org . greencheek . related . util . config . SystemPropertiesConfiguration ( ) ; org . greencheek . related . searching . disruptor . requestprocessing . RoundRobinRelatedContentSearchRequestProcessorHandlerFactory factory = new org . greencheek . related . searching . disruptor . requestprocessing . RoundRobinRelatedContentSearchRequestProcessorHandlerFactory ( ) ; org . greencheek . related . searching . disruptor . requestprocessing . RelatedContentSearchRequestProcessorHandler handler = factory . createHandler ( config , mock ( org . greencheek . related . searching . RelatedItemSearchResultsToResponseGateway . class ) , mock ( org . greencheek . related . searching . RelatedItemSearchExecutorFactory . class ) ) ; "<AssertPlaceHolder>" ; } createHandler ( org . greencheek . related . util . config . Configuration , org . greencheek . related . searching . RelatedItemSearchResultsToResponseGateway , org . greencheek . related . searching . RelatedItemSearchExecutorFactory ) { int numberOfSearchProcessors = config . getNumberOfSearchingRequestProcessors ( ) ; if ( numberOfSearchProcessors == 1 ) { org . greencheek . related . searching . disruptor . requestprocessing . RoundRobinRelatedContentSearchRequestProcessorHandlerFactory . log . debug ( "Creating<sp>Single<sp>Search<sp>Request<sp>Processor" ) ; org . greencheek . related . searching . RelatedItemSearchExecutor searchExecutor = searchExecutorFactory . createSearchExecutor ( gateway ) ; return new org . greencheek . related . searching . disruptor . requestprocessing . DisruptorBasedRelatedContentSearchRequestProcessorHandler ( gateway , searchExecutor ) ; } else { org . greencheek . related . searching . disruptor . requestprocessing . RoundRobinRelatedContentSearchRequestProcessorHandlerFactory . log . debug ( "Creating<sp>{}<sp>Search<sp>Request<sp>Processor" , numberOfSearchProcessors ) ; org . greencheek . related . searching . RelatedItemSearchExecutor [ ] searchExecutors = new org . greencheek . related . searching . RelatedItemSearchExecutor [ numberOfSearchProcessors ] ; int i = numberOfSearchProcessors ; while ( ( i -- ) != 0 ) { searchExecutors [ i ] = searchExecutorFactory . createSearchExecutor ( gateway ) ; } return new org . greencheek . related . searching . disruptor . requestprocessing . RoundRobinDisruptorBasedRelatedContentSearchRequestProcessorHandler ( gateway , searchExecutors ) ; } } | org . junit . Assert . assertTrue ( ( handler instanceof org . greencheek . related . searching . disruptor . requestprocessing . DisruptorBasedRelatedContentSearchRequestProcessorHandler ) ) |
shouldHashCodeReturnTheCorrectValue ( ) { int dimension = 5 ; org . uma . jmetal . util . point . Point point = new org . uma . jmetal . util . point . impl . ArrayPoint ( dimension ) ; point . setValue ( 0 , 1.0 ) ; point . setValue ( 1 , ( - 2.0 ) ) ; point . setValue ( 2 , 45.5 ) ; point . setValue ( 3 , ( - 323.234 ) ) ; point . setValue ( 4 , Double . MAX_VALUE ) ; double [ ] array = new double [ ] { 1.0 , - 2.0 , 45.5 , - 323.234 , Double . MAX_VALUE } ; "<AssertPlaceHolder>" ; } hashCode ( ) { return java . util . Arrays . hashCode ( point ) ; } | org . junit . Assert . assertEquals ( java . util . Arrays . hashCode ( array ) , point . hashCode ( ) ) |
testGetConnection ( ) { javax . net . SocketFactory socketFactory = createMock ( javax . net . SocketFactory . class ) ; java . net . Socket socket = createMock ( java . net . Socket . class ) ; expect ( socketFactory . createSocket ( isNull ( java . net . InetAddress . class ) , anyInt ( ) ) ) . andReturn ( socket ) ; replay ( socketFactory , socket ) ; net . holmes . core . business . streaming . airplay . device . AirplayDeviceFeatures features = new net . holmes . core . business . streaming . airplay . device . AirplayDeviceFeatures ( "0" ) ; net . holmes . core . business . streaming . airplay . device . AirplayDevice device = new net . holmes . core . business . streaming . airplay . device . AirplayDevice ( "id" , "name" , null , 8080 , features ) ; java . net . Socket aSocket = device . getConnection ( socketFactory ) ; "<AssertPlaceHolder>" ; verify ( socketFactory , socket ) ; } getConnection ( javax . net . SocketFactory ) { if ( ( ( socket ) == null ) || ( socket . isClosed ( ) ) ) { socket = socketFactory . createSocket ( getAddress ( ) , port ) ; } return socket ; } | org . junit . Assert . assertNotNull ( aSocket ) |
testMySQLDatabase ( ) { try { java . lang . String expectedSQL = ( org . pentaho . di . core . database . SelectCountIT . NonHiveSelect ) + ( org . pentaho . di . core . database . SelectCountIT . TableName ) ; org . pentaho . di . core . database . DatabaseMeta databaseMeta = new org . pentaho . di . core . database . DatabaseMeta ( org . pentaho . di . core . database . SelectCountIT . MySQLDatabaseXML ) ; java . lang . String sql = databaseMeta . getDatabaseInterface ( ) . getSelectCountStatement ( org . pentaho . di . core . database . SelectCountIT . TableName ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; } } getSelectCountStatement ( java . lang . String ) { if ( ( databaseDialect ) != null ) { return databaseDialect . getSelectCountStatement ( tableName ) ; } return super . getSelectCountStatement ( tableName ) ; } | org . junit . Assert . assertTrue ( sql . equalsIgnoreCase ( expectedSQL ) ) |
testDisabled ( ) { heapDump . setEnabled ( false ) ; "<AssertPlaceHolder>" ; } createDumpIfAppropriate ( long ) { if ( ! ( isEnabled ( ) ) ) { return false ; } synchronized ( this ) { if ( ( maxHeaps ) <= ( currentHeaps ) ) { return false ; } if ( ( currentTimeMillis - ( lastDumpMillis ) ) < ( quietPeriodMillis ) ) { return false ; } currentHeaps += 1 ; lastDumpMillis = currentTimeMillis ; } try { createHeapDump ( ) ; return true ; } catch ( java . lang . Exception e ) { com . j_spaces . core . HeapDump . logger . log ( Level . WARNING , ( ( ( "Cmd<sp>" + ( java . util . Arrays . asList ( cmd ) ) ) + "<sp>throws:<sp>" ) + e ) , e ) ; } return false ; } | org . junit . Assert . assertThat ( heapDump . createDumpIfAppropriate ( 1 ) , org . hamcrest . core . Is . is ( false ) ) |
testParseNegativeReal ( ) { java . lang . String source = ( ( ( "-1" + ( getDecimalCharacter ( ) ) ) + "2323<sp>+<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343i" ; org . apache . commons . math3 . complex . Complex expected = new org . apache . commons . math3 . complex . Complex ( ( - 1.2323 ) , 1.4343 ) ; org . apache . commons . math3 . complex . Complex actual = complexFormat . parse ( source ) ; "<AssertPlaceHolder>" ; } parse ( com . google . javascript . jscomp . AbstractCompiler ) { try { com . google . javascript . jscomp . JsAst . logger_ . fine ( ( "Parsing:<sp>" + ( sourceFile . getName ( ) ) ) ) ; com . google . javascript . jscomp . parsing . ParserRunner . ParseResult result = com . google . javascript . jscomp . parsing . ParserRunner . parse ( sourceFile , sourceFile . getCode ( ) , compiler . getParserConfig ( ) , compiler . getDefaultErrorReporter ( ) , com . google . javascript . jscomp . JsAst . logger_ ) ; root = result . ast ; compiler . setOldParseTree ( sourceFile . getName ( ) , result . oldAst ) ; } catch ( java . io . IOException e ) { compiler . report ( com . google . javascript . jscomp . JSError . make ( AbstractCompiler . READ_ERROR , sourceFile . getName ( ) ) ) ; } if ( ( ( root ) == null ) || ( compiler . hasHaltingErrors ( ) ) ) { root = com . google . javascript . rhino . IR . script ( ) ; } else { compiler . prepareAst ( root ) ; } root . setStaticSourceFile ( sourceFile ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
invalidProxyFails ( ) { boolean caught = false ; java . lang . String url = "https://jsoup.org" ; try { org . jsoup . nodes . Document doc = org . jsoup . Jsoup . connect ( url ) . proxy ( "localhost" , 8889 ) . get ( ) ; } catch ( java . io . IOException e ) { caught = e instanceof java . net . ConnectException ; } "<AssertPlaceHolder>" ; } get ( ) { return e ; } | org . junit . Assert . assertTrue ( caught ) |
writeToMmvShouldWriteTheCorrectContentToTheByteBuffer ( ) { io . pcp . parfait . dxm . InstanceDomain instanceDomain = mock ( io . pcp . parfait . dxm . InstanceDomain . class ) ; io . pcp . parfait . dxm . PcpString pcpString = mock ( io . pcp . parfait . dxm . PcpString . class ) ; java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . allocate ( io . pcp . parfait . dxm . InstanceV2Test . EXPECTED_BYTE_SIZE ) ; io . pcp . parfait . dxm . InstanceV2 instanceV2 = new io . pcp . parfait . dxm . InstanceV2 ( instanceDomain , io . pcp . parfait . dxm . InstanceV2Test . INSTANCE_NAME , io . pcp . parfait . dxm . InstanceV2Test . INSTANCE_DOMAIN_ID , pcpString ) ; when ( instanceDomain . getOffset ( ) ) . thenReturn ( io . pcp . parfait . dxm . InstanceV2Test . INSTANCE_DOMAIN_OFFSET ) ; when ( pcpString . getOffset ( ) ) . thenReturn ( io . pcp . parfait . dxm . InstanceV2Test . STRING_OFFSET ) ; instanceV2 . writeToMmv ( byteBuffer ) ; } ; "<AssertPlaceHolder>" ; } writeToMmv ( java . nio . ByteBuffer ) { byteBuffer . position ( offset ) ; int originalPosition = byteBuffer . position ( ) ; byteBuffer . put ( metricName . getBytes ( io . pcp . parfait . dxm . PcpMmvWriter . PCP_CHARSET ) ) ; byteBuffer . put ( ( ( byte ) ( 0 ) ) ) ; byteBuffer . position ( ( ( originalPosition + ( io . pcp . parfait . dxm . PcpMetricInfoV1 . METRIC_NAME_LIMIT ) ) + 1 ) ) ; byteBuffer . putInt ( getId ( ) ) ; byteBuffer . putInt ( typeHandler . getMetricType ( ) . getIdentifier ( ) ) ; byteBuffer . putInt ( getSemantics ( ) . getPcpValue ( ) ) ; byteBuffer . putInt ( io . pcp . parfait . dxm . semantics . UnitMapping . getDimensions ( getUnit ( ) , metricName ) ) ; if ( ( domain ) != null ) { byteBuffer . putInt ( domain . getId ( ) ) ; } else { byteBuffer . putInt ( io . pcp . parfait . dxm . DEFAULT_INSTANCE_DOMAIN_ID ) ; } byteBuffer . putInt ( 0 ) ; byteBuffer . putLong ( getStringOffset ( shortHelpText ) ) ; byteBuffer . putLong ( getStringOffset ( longHelpText ) ) ; } | org . junit . Assert . assertArrayEquals ( expected , byteBuffer . array ( ) ) |
createDatabase ( ) { try { final java . lang . Boolean result = arangoDB . createDatabase ( BaseTest . TEST_DB ) ; "<AssertPlaceHolder>" ; } finally { try { arangoDB . db ( BaseTest . TEST_DB ) . drop ( ) ; } catch ( final com . arangodb . ArangoDBException e ) { } } } createDatabase ( java . lang . String ) { return executor . execute ( createDatabaseRequest ( name ) , createDatabaseResponseDeserializer ( ) ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . is ( true ) ) |
testMoreThan64FieldsMultipleFirings ( ) { final java . lang . StringBuilder fields = new java . lang . StringBuilder ( ) ; for ( int i = 10 ; i < 100 ; i ++ ) { fields . append ( "<sp>a" ) . append ( i ) . append ( "<sp>:<sp>int\n" ) ; } final java . lang . String str = ( ( ( ( ( ( ( ( ( ( ( ( "<sp>list.add(1);\n" 2 + ( "global<sp>java.util.List<sp>list;\n" + "declare<sp>BigType<sp>@propertyReactive\n" ) ) + fields ) + "<sp>list.add(1);\n" 3 ) + "<sp>list.add(1);\n" 1 ) + "then\n" ) + "<sp>insert(<sp>new<sp>BigType()<sp>);" ) + "<sp>list.add(1);\n" 3 ) + "rule<sp>R<sp>when\n" ) + "<sp>$b<sp>:<sp>BigType(<sp>a11<sp>==<sp>0,<sp>a12<sp><<sp>10,<sp>a98<sp>==<sp>0<sp>)" ) + "then\n" ) + "<sp>modify($b)<sp>{<sp>setA12($b.getA12()+1),<sp>setA99(1)<sp>};\n" ) + "<sp>list.add(1);\n" ) + "<sp>list.add(1);\n" 3 ; final org . kie . api . runtime . KieSession ksession = new org . kie . internal . utils . KieHelper ( ) . addContent ( str , ResourceType . DRL ) . build ( ) . newKieSession ( ) ; final java . util . List < java . lang . Integer > list = new java . util . ArrayList < java . lang . Integer > ( ) ; ksession . setGlobal ( "<sp>list.add(1);\n" 0 , list ) ; ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return rulesFired . size ( ) ; } | org . junit . Assert . assertEquals ( 10 , list . size ( ) ) |
testFindLatestCompletedInitialOcan ( ) { int facilityId1 = 100 ; int clientId1 = 111 ; java . lang . String assessmentStatus1 = "Completed" ; java . lang . String reasonForAssessment1 = "IA" ; java . util . Date created1 = new java . util . Date ( dfm . parse ( "20120310" ) . getTime ( ) ) ; java . util . Date created2 = new java . util . Date ( dfm . parse ( "20131110" ) . getTime ( ) ) ; java . util . Date created3 = new java . util . Date ( dfm . parse ( "20120510" ) . getTime ( ) ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm1 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm1 ) ; ocanStaffForm1 . setFacilityId ( facilityId1 ) ; ocanStaffForm1 . setClientId ( clientId1 ) ; ocanStaffForm1 . setAssessmentStatus ( assessmentStatus1 ) ; ocanStaffForm1 . setReasonForAssessment ( reasonForAssessment1 ) ; ocanStaffForm1 . setCreated ( created1 ) ; dao . persist ( ocanStaffForm1 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm2 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm2 ) ; ocanStaffForm2 . setFacilityId ( facilityId1 ) ; ocanStaffForm2 . setClientId ( clientId1 ) ; ocanStaffForm2 . setAssessmentStatus ( assessmentStatus1 ) ; ocanStaffForm2 . setReasonForAssessment ( reasonForAssessment1 ) ; ocanStaffForm2 . setCreated ( created2 ) ; dao . persist ( ocanStaffForm2 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm3 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm3 ) ; ocanStaffForm3 . setFacilityId ( facilityId1 ) ; ocanStaffForm3 . setClientId ( clientId1 ) ; ocanStaffForm3 . setAssessmentStatus ( assessmentStatus1 ) ; ocanStaffForm3 . setReasonForAssessment ( reasonForAssessment1 ) ; ocanStaffForm3 . setCreated ( created3 ) ; dao . persist ( ocanStaffForm3 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm4 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm4 ) ; dao . persist ( ocanStaffForm4 ) ; org . oscarehr . common . model . OcanStaffForm ocanStaffForm5 = new org . oscarehr . common . model . OcanStaffForm ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( ocanStaffForm5 ) ; dao . persist ( ocanStaffForm5 ) ; org . oscarehr . common . model . OcanStaffForm expectedResult = ocanStaffForm2 ; org . oscarehr . common . model . OcanStaffForm result = dao . findLatestCompletedInitialOcan ( facilityId1 , clientId1 ) ; "<AssertPlaceHolder>" ; } findLatestCompletedInitialOcan ( java . lang . Integer , java . lang . Integer ) { java . lang . String sqlCommand = "select<sp>*<sp>from<sp>OcanStaffForm<sp>where<sp>facilityId=?1<sp>and<sp>clientId=?2<sp>and<sp>assessmentStatus=?3<sp>and<sp>reasonForAssessment=?4<sp>order<sp>by<sp>created<sp>desc" ; javax . persistence . Query query = entityManager . createNativeQuery ( sqlCommand , modelClass ) ; query . setParameter ( 1 , facilityId ) ; query . setParameter ( 2 , clientId ) ; query . setParameter ( 3 , "Completed" ) ; query . setParameter ( 4 , "IA" ) ; query . setMaxResults ( 1 ) ; return getSingleResultOrNull ( query ) ; } | org . junit . Assert . assertEquals ( expectedResult , result ) |
updateDesignation ( ) { sampleDesignation ( ) ; designation . setDescription ( "FORTESTING" ) ; designationService . updateDesignation ( designation ) ; "<AssertPlaceHolder>" ; } getDescription ( ) { return description ; } | org . junit . Assert . assertEquals ( "FORTESTING" , designation . getDescription ( ) ) |
dontDiscardOutline ( ) { org . sejda . model . parameter . ExtractPagesParameters parameters = defaultCommandLine ( ) . invokeSejdaConsole ( ) ; "<AssertPlaceHolder>" ; } discardOutline ( ) { return discardOutline ; } | org . junit . Assert . assertFalse ( parameters . discardOutline ( ) ) |
test_SingleFile ( ) { de . vandermeer . svg2vector . applications . is . Svg2Vector_IS app = new de . vandermeer . svg2vector . applications . is . Svg2Vector_IS ( ) ; java . lang . String [ ] args = org . apache . commons . lang3 . ArrayUtils . addAll ( de . vandermeer . svg2vector . applications . is . Test_Svg2Vector_IS_EMF . STD_OPTIONS , "-f" , "src/test/resources/svg-files/chomsky-hierarchy.svgz" , "-o" , ( ( de . vandermeer . svg2vector . applications . is . Test_Svg2Vector_IS_EMF . OUT_DIR_PREFIX ) + "chomsky2" ) ) ; "<AssertPlaceHolder>" ; } executeApplication ( java . lang . String [ ] ) { int ret = super . executeApplication ( args ) ; if ( ret != 0 ) { return ret ; } de . vandermeer . svg2vector . applications . base . SvgTargets target = this . getProps ( ) . getTarget ( ) ; java . lang . String fn = this . optionInkscapeExec . getValue ( ) ; if ( ( ret = this . checkIsExecutable ( fn ) ) < 0 ) { return ret ; } this . printDetailMessage ( ( "Inkscape<sp>exec:<sp>" + fn ) ) ; this . setWarnings ( target ) ; de . vandermeer . svg2vector . applications . is . IsCmd isCmd = new de . vandermeer . svg2vector . applications . is . IsCmd ( fn , target , this . getProps ( ) ) ; isCmd . appendTargetSettings ( target , this . optionExpDpi , this . optionExpPdfver , this . optionExpPslevel ) ; de . vandermeer . svg2vector . applications . is . IsCmd isTmpCmd = new de . vandermeer . svg2vector . applications . is . IsCmd ( fn , de . vandermeer . svg2vector . applications . base . SvgTargets . svg , this . getProps ( ) ) ; if ( this . optionSvgFirst . inCli ( ) ) { this . printProgressMessage ( "converting<sp>to<sp>temporary<sp>SVG<sp>first" ) ; this . printDetailMessage ( ( "Inkscape<sp>cmd<sp>tmp:<sp>" + isTmpCmd ) ) ; } else { this . printProgressMessage ( "converting<sp>directly<sp>to<sp>target" ) ; this . printDetailMessage ( ( "Inkscape<sp>cmd:<sp>" + isCmd ) ) ; } ret = this . createTempArtifacts ( isTmpCmd ) ; if ( ret < 0 ) { return ret ; } ret = this . convertInput ( isCmd , target ) ; if ( ret < 0 ) { return ret ; } this . removeTempArtifacts ( ) ; this . printProgressMessage ( "finished<sp>successfully" ) ; return 0 ; } | org . junit . Assert . assertEquals ( 0 , app . executeApplication ( args ) ) |
testLogErrorMessageWithException ( ) { java . lang . String message = ( testName . getMethodName ( ) ) + "<sp>Cleaned" ; org . mockito . Mockito . when ( mockHandler . isEnabled ( mockSlf4JLogger ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( mockScrubber . cleanMessage ( testName . getMethodName ( ) ) ) . thenReturn ( message ) ; bridge . log ( mockSlf4JLogger , Logger . ALL , Logger . EVENT_UNSPECIFIED , testName . getMethodName ( ) , testEx ) ; org . mockito . ArgumentCaptor < org . slf4j . Marker > markerCapture = org . mockito . ArgumentCaptor . forClass ( org . slf4j . Marker . class ) ; org . mockito . Mockito . verify ( mockScrubber , org . mockito . Mockito . times ( 1 ) ) . cleanMessage ( testName . getMethodName ( ) ) ; org . mockito . Mockito . verify ( mockHandler , org . mockito . Mockito . times ( 1 ) ) . isEnabled ( mockSlf4JLogger ) ; org . mockito . Mockito . verify ( mockHandler , org . mockito . Mockito . times ( 0 ) ) . log ( org . mockito . ArgumentMatchers . any ( org . owasp . esapi . Logger . class ) , org . mockito . ArgumentMatchers . any ( org . slf4j . Marker . class ) , org . mockito . ArgumentMatchers . any ( java . lang . String . class ) ) ; org . mockito . Mockito . verify ( mockHandler , org . mockito . Mockito . times ( 1 ) ) . log ( org . mockito . ArgumentMatchers . same ( mockSlf4JLogger ) , markerCapture . capture ( ) , org . mockito . ArgumentMatchers . matches ( message ) , org . mockito . ArgumentMatchers . same ( testEx ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . type ; } | org . junit . Assert . assertEquals ( Logger . EVENT_UNSPECIFIED . toString ( ) , markerCapture . getValue ( ) . getName ( ) ) |
testReset_String ( ) { fsb . reset ( "[%#04o]" ) . format ( ( ( long ) ( 10 ) ) ) ; fsb . reset ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( "IsotopeContainer{" + "mass=" ) + ( masOs ) ) + ",<sp>intensity=" ) + ( inte ) ) + ",<sp>MF=" ) + ( getFormulasString ( ) ) ) + '}' ; } | org . junit . Assert . assertEquals ( "[%#04o]" , fsb . toString ( ) ) |
runBuildIndex ( ) { org . apache . hadoop . conf . Configuration conf = ivory . integration . IntegrationUtils . getBespinConfiguration ( ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . fs . FileSystem . get ( conf ) ; "<AssertPlaceHolder>" ; fs . delete ( new org . apache . hadoop . fs . Path ( index ) , true ) ; java . util . List < java . lang . String > jars = com . google . common . collect . Lists . newArrayList ( ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "/queries.wt10g.501-550.xml" 1 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "data/wt10g/queries.wt10g.501-550.xml" 8 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "/queries.wt10g.501-550.xml" 2 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "data/wt10g/queries.wt10g.501-550.xml" 3 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "data/wt10g/queries.wt10g.501-550.xml" 9 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "-libjars=%s" 0 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "/queries.wt10g.501-550.xml" 4 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "data/wt10g/queries.wt10g.501-550.xml" 2 ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "/queries.wt10g.501-550.xml" 6 , "lintools-datatypes-1.0.0" ) ) ; jars . add ( ivory . integration . IntegrationUtils . getJar ( "data/wt10g/queries.wt10g.501-550.xml" 5 , "ivory" ) ) ; java . lang . String libjars = java . lang . String . format ( "-libjars=%s" , com . google . common . base . Joiner . on ( "-libjars=%s" 1 ) . join ( jars ) ) ; java . lang . String [ ] args = new java . lang . String [ ] { "data/wt10g/queries.wt10g.501-550.xml" 7 , ivory . integration . IntegrationUtils . getJar ( "data/wt10g/queries.wt10g.501-550.xml" 5 , "ivory" ) , ivory . app . PreprocessWt10g . class . getCanonicalName ( ) , libjars , "/queries.wt10g.501-550.xml" 5 + ( ivory . app . PreprocessCollection . COLLECTION_PATH ) , collectionPath . toString ( ) , "/queries.wt10g.501-550.xml" 5 + ( ivory . app . PreprocessCollection . INDEX_PATH ) , index } ; ivory . integration . IntegrationUtils . exec ( com . google . common . base . Joiner . on ( "data/wt10g/queries.wt10g.501-550.xml" 6 ) . join ( args ) ) ; args = new java . lang . String [ ] { "data/wt10g/queries.wt10g.501-550.xml" 7 , ivory . integration . IntegrationUtils . getJar ( "data/wt10g/queries.wt10g.501-550.xml" 5 , "ivory" ) , ivory . app . BuildIndex . class . getCanonicalName ( ) , libjars , "/queries.wt10g.501-550.xml" 5 + ( ivory . app . BuildIndex . POSITIONAL_INDEX_IP ) , "/queries.wt10g.501-550.xml" 5 + ( ivory . app . BuildIndex . INDEX_PATH ) , index , "/queries.wt10g.501-550.xml" 5 + ( ivory . app . BuildIndex . INDEX_PARTITIONS ) , "/queries.wt10g.501-550.xml" 0 } ; ivory . integration . IntegrationUtils . exec ( com . google . common . base . Joiner . on ( "data/wt10g/queries.wt10g.501-550.xml" 6 ) . join ( args ) ) ; fs . copyFromLocalFile ( false , true , new org . apache . hadoop . fs . Path ( "data/wt10g/run.wt10g.basic.xml" ) , new org . apache . hadoop . fs . Path ( ( ( ( index ) + "/queries.wt10g.501-550.xml" 9 ) + "/queries.wt10g.501-550.xml" 3 ) ) ) ; fs . copyFromLocalFile ( false , true , new org . apache . hadoop . fs . Path ( "/queries.wt10g.501-550.xml" 8 ) , new org . apache . hadoop . fs . Path ( ( ( ( index ) + "/queries.wt10g.501-550.xml" 9 ) + "queries.wt10g.451-500.xml" ) ) ) ; fs . copyFromLocalFile ( false , true , new org . apache . hadoop . fs . Path ( "data/wt10g/queries.wt10g.501-550.xml" ) , new org . apache . hadoop . fs . Path ( ( ( ( index ) + "/queries.wt10g.501-550.xml" 9 ) + "queries.wt10g.501-550.xml" ) ) ) ; java . lang . String [ ] params = new java . lang . String [ ] { ( index ) + "data/wt10g/queries.wt10g.501-550.xml" 0 , ( index ) + "/queries.wt10g.451-500.xml" , ( index ) + "/queries.wt10g.501-550.xml" } ; ivory . smrf . retrieval . BatchQueryRunner qr = new ivory . smrf . retrieval . BatchQueryRunner ( params , fs , index ) ; long start = java . lang . System . currentTimeMillis ( ) ; qr . runQueries ( ) ; long end = java . lang . System . currentTimeMillis ( ) ; ivory . integration . adhoc . VerifyWt10gPositionalIndexIP . LOG . info ( ( ( "/queries.wt10g.501-550.xml" 7 + ( end - start ) ) + "data/wt10g/queries.wt10g.501-550.xml" 1 ) ) ; ivory . regression . basic . Wt10g_Basic . verifyAllResults ( qr . getModels ( ) , qr . getAllResults ( ) , qr . getDocnoMapping ( ) , new ivory . core . eval . Qrels ( "data/wt10g/queries.wt10g.501-550.xml" 4 ) ) ; ivory . integration . adhoc . VerifyWt10gPositionalIndexIP . LOG . info ( "Done!" ) ; } get ( int ) { return ( ( ( getBits ( ) [ ( i / 8 ) ] ) > > ( 7 - ( i % 8 ) ) ) & 1 ) == 1 ; } | org . junit . Assert . assertTrue ( fs . exists ( collectionPath ) ) |
testConvertBlank ( ) { java . lang . Short result = underTest . convert ( "<sp>" ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { if ( "S" . equalsIgnoreCase ( value ) ) { return Size . TINY ; } else if ( "M" . equalsIgnoreCase ( value ) ) { return Size . NORMAL ; } else if ( "L" . equalsIgnoreCase ( value ) ) { return Size . HUGE ; } else { return null ; } } | org . junit . Assert . assertNull ( result ) |
testURLEncodedKey ( ) { java . lang . String urlKey = "http://example.com/foo" ; java . lang . StringBuilder path = new java . lang . StringBuilder ( ) ; path . append ( '/' ) ; path . append ( org . apache . hadoop . hbase . rest . TABLE ) ; path . append ( '/' ) ; path . append ( java . net . URLEncoder . encode ( urlKey , HConstants . UTF8_ENCODING ) ) ; path . append ( '/' ) ; path . append ( org . apache . hadoop . hbase . rest . COLUMN_1 ) ; org . apache . hadoop . hbase . rest . client . Response response ; response = putValueXML ( path . toString ( ) , org . apache . hadoop . hbase . rest . TABLE , urlKey , org . apache . hadoop . hbase . rest . COLUMN_1 , org . apache . hadoop . hbase . rest . VALUE_1 ) ; "<AssertPlaceHolder>" ; checkValueXML ( path . toString ( ) , org . apache . hadoop . hbase . rest . TABLE , urlKey , org . apache . hadoop . hbase . rest . COLUMN_1 , org . apache . hadoop . hbase . rest . VALUE_1 ) ; } getCode ( ) { return code ; } | org . junit . Assert . assertEquals ( 200 , response . getCode ( ) ) |
testRemoveApplicationContextListener_returnsFalseWhenInActive ( ) { applicationContext = org . eclipse . rap . rwt . internal . application . ApplicationContextImpl_Test . createApplicationContextSpy ( ) ; applicationContext . addApplicationContextListener ( appContextListener ) ; boolean result = applicationContext . removeApplicationContextListener ( appContextListener ) ; "<AssertPlaceHolder>" ; } removeApplicationContextListener ( org . eclipse . rap . rwt . service . ApplicationContextListener ) { org . eclipse . rap . rwt . internal . util . ParamCheck . notNull ( listener , "listener" ) ; boolean result = false ; synchronized ( listenersLock ) { if ( state . get ( ) . equals ( org . eclipse . rap . rwt . internal . application . ApplicationContextImpl . State . ACTIVE ) ) { result = true ; appContextListeners . remove ( listener ) ; } } return result ; } | org . junit . Assert . assertFalse ( result ) |
testValidateStructure ( ) { com . bwssystems . domoticz . test . DomoticzDeviceConstructor aTestService = new com . bwssystems . domoticz . test . DomoticzDeviceConstructor ( ) ; "<AssertPlaceHolder>" ; } validateStructure ( ) { com . google . gson . Gson aGson ; com . bwssystems . HABridge . NamedIP anAddress = new com . bwssystems . HABridge . NamedIP ( ) ; anAddress . setName ( "<sp>" 0 ) ; anAddress . setIp ( "10.0.0.1" ) ; com . bwssystems . HABridge . plugins . fhem . FHEMInstance anInstance = new com . bwssystems . HABridge . plugins . fhem . FHEMInstance ( anAddress ) ; com . bwssystems . HABridge . plugins . http . HttpTestHandler theHttpTestClient = new com . bwssystems . HABridge . plugins . http . HttpTestHandler ( ) ; java . util . List < com . bwssystems . HABridge . plugins . fhem . Result > services = null ; java . util . List < com . bwssystems . HABridge . plugins . fhem . FHEMDevice > deviceList = null ; java . lang . String decodeData = null ; java . lang . String theTestData = null ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( i == 0 ) theTestData = com . bwssystems . HABridge . plugins . fhem . FHEMTestData . TestData ; else if ( i == 1 ) { theTestData = com . bwssystems . HABridge . plugins . fhem . FHEMTestData . TestData2 ; anAddress . setName ( anAddress . getName ( ) . replace ( "1" , "2" ) ) ; anInstance = new com . bwssystems . HABridge . plugins . fhem . FHEMInstance ( anAddress ) ; } else { anAddress . setName ( anAddress . getName ( ) . replace ( "2" , "3" ) ) ; theTestData = com . bwssystems . HABridge . plugins . fhem . FHEMTestData . TestData3 ; } decodeData = anInstance . getJSONData ( theTestData ) ; try { aGson = new com . google . gson . GsonBuilder ( ) . create ( ) ; com . bwssystems . HABridge . plugins . fhem . FHEMItem aService = aGson . fromJson ( decodeData , com . bwssystems . HABridge . plugins . fhem . FHEMItem . class ) ; services = aService . getResults ( ) ; for ( com . bwssystems . HABridge . plugins . fhem . Result aResult : services ) { System . out . println ( ( ( anAddress . getName ( ) ) + "<sp>-<sp>Json<sp>Test:" ) ) ; System . out . println ( ( "<sp>" + ( aResult . getName ( ) ) ) ) ; System . out . println ( ( "<sp>" + ( aResult . getPossibleSets ( ) ) ) ) ; } } catch ( java . lang . Exception e ) { return false ; } System . out . println ( "----------------------------------" ) ; try { theHttpTestClient . updateTheData ( "jsonlist2" , theTestData ) ; deviceList = anInstance . getDevices ( theHttpTestClient ) ; if ( deviceList == null ) return false ; for ( com . bwssystems . HABridge . plugins . fhem . FHEMDevice aDevice : deviceList ) { System . out . println ( ( ( aDevice . getName ( ) ) + "<sp>-<sp>FHEMDevice<sp>Class<sp>Test:" ) ) ; System . out . println ( ( "<sp>" + ( aDevice . getItem ( ) . getName ( ) ) ) ) ; System . out . println ( ( "<sp>" + ( aDevice . getItem ( ) . getPossibleSets ( ) ) ) ) ; } } catch ( java . lang . Exception e ) { return false ; } System . out . println ( "----------------------------------" ) ; } return true ; } | org . junit . Assert . assertEquals ( aTestService . validateStructure ( ) , true ) |
testDiscrete ( ) { int rows = 10 ; int cols = 5 ; java . util . List < edu . cmu . tetrad . graph . Node > variables = new java . util . LinkedList ( ) ; for ( int i = 0 ; i < cols ; i ++ ) { edu . cmu . tetrad . test . DiscreteVariable variable = new edu . cmu . tetrad . test . DiscreteVariable ( ( "X" + ( i + 1 ) ) , 3 ) ; variables . add ( variable ) ; } edu . cmu . tetrad . test . DataSet dataSet = new edu . cmu . tetrad . test . BoxDataSet ( new edu . cmu . tetrad . test . DoubleDataBox ( rows , variables . size ( ) ) , variables ) ; edu . cmu . tetrad . util . RandomUtil randomUtil = edu . cmu . tetrad . util . RandomUtil . getInstance ( ) ; for ( int i = 0 ; i < rows ; i ++ ) { for ( int j = 0 ; j < cols ; j ++ ) { dataSet . setInt ( i , j , randomUtil . nextInt ( 3 ) ) ; } } edu . cmu . tetrad . test . BoxDataSet _dataSet = new edu . cmu . tetrad . test . BoxDataSet ( ( ( edu . cmu . tetrad . test . BoxDataSet ) ( dataSet ) ) ) ; "<AssertPlaceHolder>" ; } nextInt ( int ) { return randomGenerator . nextInt ( n ) ; } | org . junit . Assert . assertEquals ( dataSet , _dataSet ) |
test19_FbeforeD_EbeforeDafterOthers_DbeforeCafterE_BbeforeC ( ) { java . util . List < com . liferay . faces . util . config . internal . FacesConfigDescriptor > facesConfigDescriptors = new java . util . ArrayList < com . liferay . faces . util . config . internal . FacesConfigDescriptor > ( ) ; com . liferay . faces . util . xml . OrderingTest . parseConfigurationResources ( "c" 1 , facesConfigDescriptors , com . liferay . faces . util . xml . OrderingTest . META_INF_FACES_CONFIG_XML ) ; java . util . Collections . shuffle ( facesConfigDescriptors ) ; java . util . Map < java . lang . String , com . liferay . faces . util . config . internal . FacesConfigDescriptor > configMap = com . liferay . faces . util . config . internal . OrderingUtil . getConfigMap ( facesConfigDescriptors ) ; java . util . List < com . liferay . faces . util . config . internal . FacesConfigDescriptor > temp = new java . util . ArrayList < com . liferay . faces . util . config . internal . FacesConfigDescriptor > ( ) ; temp . add ( configMap . get ( "e" ) ) ; temp . add ( configMap . get ( "a" ) ) ; temp . add ( configMap . get ( "c" 2 ) ) ; temp . add ( configMap . get ( "b" ) ) ; temp . add ( configMap . get ( "d" ) ) ; temp . add ( configMap . get ( "c" ) ) ; facesConfigDescriptors = temp ; java . lang . String [ ] originalOrder = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; facesConfigDescriptors = com . liferay . faces . util . config . internal . OrderingUtil . getOrder ( facesConfigDescriptors ) ; java . lang . String [ ] orderedNames = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; java . util . List < java . lang . String > original = java . util . Arrays . asList ( originalOrder ) ; java . util . List < java . lang . String > actually = java . util . Arrays . asList ( orderedNames ) ; java . util . List < java . lang . String > possibility1 = java . util . Arrays . asList ( "c" 2 , "e" , "d" , "b" , "a" , "c" ) ; java . util . List < java . lang . String > possibility2 = java . util . Arrays . asList ( "c" 2 , "e" , "d" , "b" , "c" , "a" ) ; java . util . List < java . lang . String > possibility3 = java . util . Arrays . asList ( "a" , "b" , "c" 2 , "e" , "d" , "c" ) ; boolean assertion = ( ( actually . equals ( possibility1 ) ) || ( actually . equals ( possibility2 ) ) ) || ( actually . equals ( possibility3 ) ) ; java . lang . String message = ( ( ( ( ( ( ( ( ( "\n<sp>original:<sp>" + original ) + "c" 0 ) + possibility1 ) + "\n<sp>or:<sp>" ) + possibility2 ) + "\n<sp>or:<sp>" ) + possibility3 ) + "\n<sp>actually:<sp>" ) + actually ) + "\n" ; "<AssertPlaceHolder>" ; com . liferay . faces . util . xml . OrderingTest . logger . info ( ( "test19_FbeforeD_EbeforeDafterOthers_DbeforeCafterE_BbeforeC:<sp>Passed" + message ) ) ; } equals ( java . lang . Object ) { boolean flag = false ; if ( ( obj != null ) && ( obj instanceof java . util . List < ? > ) ) { java . util . List < ? > objList = ( ( java . util . List < ? > ) ( obj ) ) ; if ( ( objList . size ( ) ) == ( this . size ( ) ) ) { flag = true ; int index = 0 ; for ( java . lang . Object listEntry : objList ) { if ( listEntry instanceof java . lang . String ) { java . lang . String listEntryAsString = ( ( java . lang . String ) ( listEntry ) ) ; java . lang . String thisEntry = this . get ( index ) ; if ( thisEntry . equals ( listEntryAsString ) ) { index ++ ; } else { flag = false ; break ; } } else { flag = false ; break ; } } } } return flag ; } | org . junit . Assert . assertTrue ( message , assertion ) |
testRead ( ) { @ org . jetbrains . annotations . NotNull net . openhft . chronicle . wire . Wire wire = createWire ( ) ; wire . write ( ) ; wire . write ( net . openhft . chronicle . wire . BinaryWireTest . BWKey . field1 ) ; wire . write ( ( ) -> "Test" ) ; checkAsText ( wire , "\"\":<sp>field1:<sp>Test:<sp>" , "\"\":<sp>\"1\":<sp>\"2603186\":<sp>" , "" ) ; wire . read ( ) ; wire . read ( ) ; wire . read ( ) ; "<AssertPlaceHolder>" ; wire . read ( ) ; } read ( ) { readField ( acquireStringBuilder ( ) , null , net . openhft . chronicle . wire . BinaryWire . AnyCodeMatch . ANY_CODE_MATCH . code ( ) ) ; return ( bytes . readRemaining ( ) ) <= 0 ? acquireDefaultValueIn ( ) : valueIn ; } | org . junit . Assert . assertEquals ( 0 , bytes . readRemaining ( ) ) |
testDetermineDestinationOffsets_f1_BT_in ( ) { int [ ] [ ] expected_f1_BT_in_DestinationOffsets = new int [ ] [ ] { new int [ ] { 0 } , new int [ ] { 3000000 } , new int [ ] { 6000000 } } ; int [ ] rowOffsets = new int [ ] { 0 , 2000 , 4000 } ; int [ ] numberOfRows = new int [ ] { 2000 , 2000 , 2000 } ; int [ ] sectionSizes_f1_BT_in = new int [ ] { 3000000 , 3000000 , 3000000 } ; int [ ] [ ] sourceOffsets = new int [ ] [ ] { new int [ ] { 0 } , new int [ ] { 0 } , new int [ ] { 0 } } ; final int [ ] [ ] actual_f1_BT_in_DestinationOffsets = org . esa . s3tbx . slstr . pdu . stitching . NcFileStitcher . determineDestinationOffsets ( rowOffsets , numberOfRows , sectionSizes_f1_BT_in , sourceOffsets ) ; for ( int i = 0 ; i < ( expected_f1_BT_in_DestinationOffsets . length ) ; i ++ ) { "<AssertPlaceHolder>" ; } } determineDestinationOffsets ( int [ ] , int [ ] , int [ ] , int [ ] [ ] ) { int [ ] [ ] destinationOffsets = new int [ sectionSizes . length ] [ ] ; int allSectionsSize = 0 ; for ( int sectionSize : sectionSizes ) { allSectionsSize += sectionSize ; } for ( int i = 0 ; i < ( sectionSizes . length ) ; i ++ ) { final int fileOffset = ( rowOffsets [ i ] ) * ( ( sectionSizes [ i ] ) / ( numberOfRows [ i ] ) ) ; destinationOffsets [ i ] = new int [ sourceOffsets [ i ] . length ] ; for ( int j = 0 ; j < ( sourceOffsets [ i ] . length ) ; j ++ ) { destinationOffsets [ i ] [ j ] = fileOffset + ( j * allSectionsSize ) ; } } return destinationOffsets ; } | org . junit . Assert . assertArrayEquals ( expected_f1_BT_in_DestinationOffsets [ i ] , actual_f1_BT_in_DestinationOffsets [ i ] ) |
legacy_testIsReadOnlyWhenTwoDescriptionProvidersHigherRankingIsNotReadOnly ( ) { org . eclipse . smarthome . core . types . StateDescription stateDescription1 = new org . eclipse . smarthome . core . types . StateDescription ( null , null , null , null , false , null ) ; org . eclipse . smarthome . core . types . StateDescription stateDescription2 = new org . eclipse . smarthome . core . types . StateDescription ( null , null , null , null , true , null ) ; registerStateDescriptionProvider ( stateDescription1 , ( - 1 ) ) ; registerStateDescriptionProvider ( stateDescription2 , ( - 2 ) ) ; org . eclipse . smarthome . core . types . StateDescription finalStateDescription = item . getStateDescription ( ) ; "<AssertPlaceHolder>" ; } isReadOnly ( ) { return readOnly ; } | org . junit . Assert . assertThat ( finalStateDescription . isReadOnly ( ) , org . hamcrest . CoreMatchers . is ( stateDescription1 . isReadOnly ( ) ) ) |
injectIntoInt ( ) { org . eclipse . collections . api . map . MapIterable < java . lang . String , java . lang . Integer > map = this . newMapWithKeysValues ( "1" , 1 , "2" , 2 , "3" , 3 , "4" , 4 ) ; int actual = map . injectInto ( 0 , AddFunction . INTEGER_TO_INT ) ; "<AssertPlaceHolder>" ; } injectInto ( IV , org . eclipse . collections . api . block . function . Function2 ) { return this . getMutableMap ( ) . injectInto ( injectedValue , function ) ; } | org . junit . Assert . assertEquals ( 10 , actual ) |
testGetRealSourceNode ( ) { org . talend . designer . core . ui . editor . cmd . ChangeValuesFromRepository changeValuesFromRepository = new org . talend . designer . core . ui . editor . cmd . ChangeValuesFromRepository ( elem , org . talend . designer . core . ui . editor . cmd . ChangeValuesFromRepositoryTest . connection , "PROPERTY:PROPERTY_TYPE" , "REPOSITORY" ) ; "<AssertPlaceHolder>" ; } getRealSourceNode ( org . talend . core . model . process . INode ) { org . talend . designer . core . ui . editor . nodes . Node sourceNode = null ; org . talend . core . model . components . IODataComponent input = null ; java . util . List < org . talend . designer . core . ui . editor . connections . Connection > incomingConnections = null ; incomingConnections = ( ( java . util . List < org . talend . designer . core . ui . editor . connections . Connection > ) ( target . getIncomingConnections ( ) ) ) ; for ( org . talend . designer . core . ui . editor . connections . Connection connec : incomingConnections ) { if ( ( connec . isActivate ( ) ) && ( connec . getLineStyle ( ) . hasConnectionCategory ( IConnectionCategory . DATA ) ) ) { input = new org . talend . core . model . components . IODataComponent ( connec ) ; } } if ( input != null ) { org . talend . core . model . process . INode source = input . getSource ( ) ; if ( source instanceof org . talend . designer . core . ui . editor . nodes . Node ) { sourceNode = ( ( org . talend . designer . core . ui . editor . nodes . Node ) ( source ) ) ; } } return sourceNode ; } | org . junit . Assert . assertEquals ( changeValuesFromRepository . getRealSourceNode ( target ) , elem ) |
testShouldExecuteListenerExactlyOncePerEvent ( ) { java . util . concurrent . atomic . AtomicInteger count = com . liferay . repository . registry . test . RepositoryEventTestUtil . registerCounterRepositoryEventListener ( _defaultRepositoryEventRegistry , RepositoryEventType . Add . class , com . liferay . portal . kernel . repository . model . FileEntry . class ) ; int randomInt = java . lang . Math . abs ( com . liferay . portal . kernel . test . util . RandomTestUtil . nextInt ( ) ) ; for ( int i = 0 ; i < randomInt ; i ++ ) { _defaultRepositoryEventRegistry . trigger ( RepositoryEventType . Add . class , com . liferay . portal . kernel . repository . model . FileEntry . class , null ) ; } "<AssertPlaceHolder>" ; } get ( ) { return _byteBuffer . get ( ) ; } | org . junit . Assert . assertEquals ( randomInt , count . get ( ) ) |
getBeanofSameTypeTest ( ) { factory . method . ClientServiceFactoryMethod factory = ( ( factory . method . ClientServiceFactoryMethod ) ( applicationContext . getBean ( "clientServiceFactoryMethod" ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( factory ) |
intervalAsArray ( ) { "<AssertPlaceHolder>" ; } toArray ( int , int ) { return com . gs . collections . impl . list . Interval . fromTo ( from , to ) . toArray ( ) ; } | org . junit . Assert . assertArrayEquals ( new java . lang . Integer [ ] { 1 , 2 , 3 , 4 , 5 } , com . gs . collections . impl . list . Interval . toArray ( 1 , 5 ) ) |
addDaysToDt ( ) { java . util . Calendar c = java . util . Calendar . getInstance ( ) ; c . setTime ( new java . util . Date ( ) ) ; c . add ( Calendar . DAY_OF_MONTH , 10 ) ; int future = c . get ( Calendar . DAY_OF_MONTH ) ; c . setTime ( org . candlepin . util . Util . addDaysToDt ( 10 ) ) ; "<AssertPlaceHolder>" ; } get ( int ) { return ( ( java . util . List < E > ) ( this . collection ) ) . get ( index ) ; } | org . junit . Assert . assertEquals ( future , c . get ( Calendar . DAY_OF_MONTH ) ) |
testUpgradeOnlyAppliedOnce ( ) { upgradeService . start ( ) ; java . util . Map < java . lang . String , java . lang . String > upgradedVersions = com . google . common . collect . ImmutableMap . of ( "foo" , "1.2" , "bar" , "1.1" , "wibble" , "2.0" ) ; "<AssertPlaceHolder>" ; upgradeService . stop ( ) ; when ( modelVersionStore . load ( ) ) . thenReturn ( new java . util . HashMap ( upgradedVersions ) ) ; upgradeService . start ( ) ; upgradeService . stop ( ) ; upgradeService . start ( ) ; org . mockito . InOrder order = inOrder ( checkpointFoo , checkpointBar , checkpointWibble , upgradeFoo_1_1 , upgradeFoo_1_2 , upgradeBar_1_1 , upgradeWibble_2_0 ) ; order . verify ( checkpointFoo ) . begin ( "1.0" ) ; order . verify ( checkpointBar ) . begin ( "1.0" ) ; order . verify ( checkpointWibble ) . begin ( "1.0" ) ; order . verify ( upgradeFoo_1_1 ) . apply ( ) ; order . verify ( upgradeBar_1_1 ) . apply ( ) ; order . verify ( upgradeFoo_1_2 ) . apply ( ) ; order . verify ( upgradeWibble_2_0 ) . apply ( ) ; order . verify ( checkpointFoo ) . commit ( ) ; order . verify ( checkpointBar ) . commit ( ) ; order . verify ( checkpointWibble ) . commit ( ) ; order . verify ( checkpointFoo ) . end ( ) ; order . verify ( checkpointBar ) . end ( ) ; order . verify ( checkpointWibble ) . end ( ) ; verifyNoMoreInteractions ( checkpointFoo , checkpointBar , checkpointWibble , upgradeFoo_1_1 , upgradeFoo_1_2 , upgradeBar_1_1 , upgradeWibble_2_0 ) ; } verifyModelVersionsSaved ( ) { org . mockito . ArgumentCaptor < java . util . Map > modelVersionsCaptor = org . mockito . ArgumentCaptor . forClass ( java . util . Map . class ) ; verify ( modelVersionStore ) . save ( modelVersionsCaptor . capture ( ) ) ; return modelVersionsCaptor . getValue ( ) ; } | org . junit . Assert . assertThat ( verifyModelVersionsSaved ( ) , org . hamcrest . Matchers . is ( upgradedVersions ) ) |
testAttributeNotificationDisabled ( ) { org . apache . aries . jmx . framework . StateConfig stateConfig = new org . apache . aries . jmx . framework . StateConfig ( ) ; stateConfig . setAttributeChangeNotificationEnabled ( false ) ; java . util . List < javax . management . AttributeChangeNotification > attributeChanges = new java . util . LinkedList < javax . management . AttributeChangeNotification > ( ) ; createBundle ( stateConfig , new java . util . LinkedList < javax . management . Notification > ( ) , attributeChanges ) ; "<AssertPlaceHolder>" ; } size ( ) { return internalMap . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , attributeChanges . size ( ) ) |
mustProperlyParsePacketIfItHasExtraData ( ) { com . offbynull . portmapper . mappers . pcp . externalmessages . PreferFailurePcpOption origOpt = new com . offbynull . portmapper . mappers . pcp . externalmessages . PreferFailurePcpOption ( ) ; byte [ ] buffer = origOpt . dump ( ) ; buffer = java . util . Arrays . copyOf ( buffer , ( ( buffer . length ) + 1 ) ) ; com . offbynull . portmapper . mappers . pcp . externalmessages . PreferFailurePcpOption parsedOpt = new com . offbynull . portmapper . mappers . pcp . externalmessages . PreferFailurePcpOption ( buffer , 0 ) ; "<AssertPlaceHolder>" ; } getCode ( ) { return code ; } | org . junit . Assert . assertEquals ( 2 , parsedOpt . getCode ( ) ) |
instancePrimitivesAreEligible ( ) { java . util . List < java . lang . reflect . Field > field = net . openhft . lang . io . serialization . direct . DirectSerializationFilterTest . fieldsNamed ( "intField" ) ; "<AssertPlaceHolder>" ; } stopAtFirstIneligibleField ( java . util . List ) { java . util . ArrayList < java . lang . reflect . Field > eligibleFields = new java . util . ArrayList < java . lang . reflect . Field > ( ) ; for ( java . lang . reflect . Field f : fields ) { if ( net . openhft . lang . io . serialization . direct . DirectSerializationFilter . checkEligible ( f ) ) { eligibleFields . add ( f ) ; } else { break ; } } return eligibleFields . isEmpty ( ) ? java . util . Collections . < java . lang . reflect . Field > emptyList ( ) : eligibleFields ; } | org . junit . Assert . assertEquals ( field , net . openhft . lang . io . serialization . direct . DirectSerializationFilter . stopAtFirstIneligibleField ( field ) ) |
testUnion ( ) { org . apache . hadoop . hive . conf . HiveConf conf = new org . apache . hadoop . hive . conf . HiveConf ( ) ; org . apache . hadoop . hive . ql . session . SessionState ss = org . mockito . Mockito . spy ( org . apache . hadoop . hive . ql . session . SessionState . start ( conf ) . get ( ) ) ; org . apache . hadoop . hive . ql . session . SessionState . ResourceType t = org . apache . hadoop . hive . ql . session . SessionState . ResourceType . JAR ; java . lang . String query1 = "testQuery1" ; java . lang . String query2 = "testQuery2" ; java . util . List < java . lang . String > addList = new java . util . LinkedList < java . lang . String > ( ) ; java . util . List < java . net . URI > list1 = new java . util . LinkedList < java . net . URI > ( ) ; java . util . List < java . net . URI > list2 = new java . util . LinkedList < java . net . URI > ( ) ; list1 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar1.jar" ) ) ) ; list1 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar2.jar" ) ) ) ; list1 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar3.jar" ) ) ) ; list1 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar4.jar" ) ) ) ; list2 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar5.jar" ) ) ) ; list2 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar3.jar" ) ) ) ; list2 . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( ( ( org . apache . hadoop . hive . ql . session . TestAddResource . TEST_JAR_DIR ) + "testjar4.jar" ) ) ) ; org . mockito . Mockito . when ( ss . resolveAndDownload ( t , query1 , false ) ) . thenReturn ( list1 ) ; org . mockito . Mockito . when ( ss . resolveAndDownload ( t , query2 , false ) ) . thenReturn ( list2 ) ; addList . add ( query1 ) ; addList . add ( query2 ) ; ss . add_resources ( t , addList ) ; java . util . Set < java . lang . String > dependencies = ss . list_resource ( t , null ) ; java . util . LinkedList < java . net . URI > actual = new java . util . LinkedList < java . net . URI > ( ) ; for ( java . lang . String dependency : dependencies ) { actual . add ( org . apache . hadoop . hive . ql . session . TestAddResource . createURI ( dependency ) ) ; } java . util . List < java . net . URI > expected = union ( list1 , list2 ) ; java . util . Collections . sort ( expected ) ; java . util . Collections . sort ( actual ) ; "<AssertPlaceHolder>" ; ss . close ( ) ; } sort ( java . lang . Object [ ] [ ] ) { org . apache . hadoop . hive . serde2 . SerdeRandomRowSource . sort ( rows , rowStructObjectInspector ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testToOriginal ( ) { java . lang . String originalId = "064c292e02db027c22g" ; org . hawkular . apm . server . api . model . zipkin . Span span = new org . hawkular . apm . server . api . model . zipkin . Span ( null , clientAnnotations ( ) ) ; span . setId ( originalId ) ; span . setId ( ( ( span . getId ( ) ) + ( SpanUniqueIdGenerator . CLIENT_ID_SUFFIX ) ) ) ; "<AssertPlaceHolder>" ; } toOriginal ( org . hawkular . apm . server . api . model . zipkin . Span ) { java . lang . String id = span . getId ( ) ; if ( span . clientSpan ( ) ) { int suffixIndex = id . lastIndexOf ( org . hawkular . apm . server . api . utils . zipkin . SpanUniqueIdGenerator . CLIENT_ID_SUFFIX ) ; if ( suffixIndex > 0 ) { id = id . substring ( 0 , suffixIndex ) ; } } return id ; } | org . junit . Assert . assertEquals ( originalId , org . hawkular . apm . server . api . utils . zipkin . SpanUniqueIdGenerator . toOriginal ( span ) ) |
testNextValueBeforeStart ( ) { org . roaringbitmap . buffer . MappeableArrayContainer container = new org . roaringbitmap . buffer . MappeableArrayContainer ( java . nio . ShortBuffer . wrap ( new short [ ] { 10 , 20 , 30 } ) , 3 ) ; "<AssertPlaceHolder>" ; } nextValue ( int ) { short key = highbits ( fromValue ) ; int containerIndex = highLowContainer . advanceUntil ( key , ( - 1 ) ) ; long nextSetBit = - 1L ; while ( ( containerIndex < ( highLowContainer . size ( ) ) ) && ( nextSetBit == ( - 1L ) ) ) { short containerKey = highLowContainer . getKeyAtIndex ( containerIndex ) ; org . roaringbitmap . buffer . MappeableContainer container = highLowContainer . getContainerAtIndex ( containerIndex ) ; int bit = ( ( compareUnsigned ( containerKey , key ) ) > 0 ) ? container . first ( ) : container . nextValue ( lowbits ( fromValue ) ) ; nextSetBit = ( bit == ( - 1 ) ) ? - 1L : org . roaringbitmap . Util . toUnsignedLong ( ( ( containerKey << 16 ) | bit ) ) ; ++ containerIndex ; } assert nextSetBit <= 4294967295L ; assert ( nextSetBit == ( - 1L ) ) || ( nextSetBit >= ( org . roaringbitmap . Util . toUnsignedLong ( fromValue ) ) ) ; return nextSetBit ; } | org . junit . Assert . assertEquals ( 10 , container . nextValue ( ( ( short ) ( 5 ) ) ) ) |
testNoSuchProduct ( ) { final net . violet . platform . datamodel . Lang frLang = getSiteFrLang ( ) ; final net . violet . platform . datamodel . Product doramichanProduct = new net . violet . platform . datamodel . mock . ProductMock ( 1 , "Doramichan<sp>et<sp>Anpainman" ) ; final java . util . List < net . violet . platform . datamodel . Press > pressList = new java . util . ArrayList < net . violet . platform . datamodel . Press > ( ) ; final net . violet . platform . datamodel . Files inFile = new net . violet . platform . datamodel . mock . FilesMock ( "../mocks/file1" , MimeType . MIME_TYPES . JPEG ) ; pressList . add ( new net . violet . platform . datamodel . mock . PressMock ( 1L , frLang , "des<sp>milliards<sp>des<sp>mondes" 1 , "dorami<sp>press" , inFile , "http://mathworld.wolfram.com/CellularAutomaton.html" , doramichanProduct ) ) ; pressList . add ( new net . violet . platform . datamodel . mock . PressMock ( 2L , frLang , "Fractals" , "des<sp>milliards<sp>des<sp>mondes" , inFile , "http://www.syti.net/Fractals.html" , doramichanProduct ) ) ; final net . violet . platform . dataobjects . PressData pressdata1 = net . violet . platform . dataobjects . PressData . getData ( pressList . get ( 0 ) ) ; final net . violet . platform . api . actions . Action theAction = new net . violet . platform . api . actions . press . Update ( ) ; final net . violet . platform . api . callers . APICaller inCaller = getPublicApplicationAPICaller ( ) ; final java . util . HashMap < java . lang . String , java . lang . Object > thePressMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; thePressMap . put ( PressInformationMap . LANGUAGE , frLang . getIsoCode ( ) ) ; thePressMap . put ( PressInformationMap . PRODUCT , "inexisting<sp>product" ) ; thePressMap . put ( PressInformationMap . TITLE , "inTitle<sp>updated" ) ; thePressMap . put ( PressInformationMap . URL , "des<sp>milliards<sp>des<sp>mondes" 0 ) ; thePressMap . put ( PressInformationMap . ABSTRACT , "inAbstract<sp>updated" ) ; final java . util . Map < java . lang . String , java . lang . Object > theParams = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; theParams . put ( ActionParam . MAIN_PARAM_KEY , pressdata1 . getApiId ( inCaller ) ) ; theParams . put ( Update . PRESS_PARAM , thePressMap ) ; final net . violet . platform . api . actions . ActionParam theActionParam = new net . violet . platform . api . actions . ActionParam ( inCaller , theParams ) ; final java . lang . Object theResult = theAction . processRequest ( theActionParam ) ; "<AssertPlaceHolder>" ; } put ( K , T ) { this . mMap . put ( theRef , new net . violet . db . cache . CacheReference < K , T > ( theRef , theRecord , this . mReferenceQueue ) ) ; this . mLinkedMap . put ( theRef , theRecord ) ; } | org . junit . Assert . assertNotNull ( theResult ) |
testNullFieldShouldNotMatch ( ) { final java . lang . String fieldName = "nullfield" ; final org . graylog2 . plugin . streams . StreamRule rule = getSampleRule ( ) ; rule . setField ( fieldName ) ; rule . setValue ( "^foo" ) ; final org . graylog2 . plugin . Message msg = getSampleMessage ( ) ; msg . addField ( fieldName , null ) ; final org . graylog2 . streams . matchers . StreamRuleMatcher matcher = getMatcher ( rule ) ; "<AssertPlaceHolder>" ; } match ( org . graylog2 . plugin . Message , org . graylog2 . plugin . streams . StreamRule ) { java . lang . Double msgVal = getDouble ( msg . getField ( rule . getField ( ) ) ) ; if ( msgVal == null ) { return false ; } java . lang . Double ruleVal = getDouble ( rule . getValue ( ) ) ; if ( ruleVal == null ) { return false ; } return ( rule . getInverted ( ) ) ^ ( msgVal > ruleVal ) ; } | org . junit . Assert . assertFalse ( matcher . match ( msg , rule ) ) |
testWithHtmlStylesheetOption ( ) { java . nio . file . Path stylesheetPath = java . nio . file . Paths . get ( java . lang . System . getProperty ( "user.dir" ) , "target" , ( ( japicmp . output . xml . XmlOutputGeneratorTest . class . getSimpleName ( ) ) + "_with.css" ) ) ; java . nio . file . Path htmlReportPath = java . nio . file . Paths . get ( java . lang . System . getProperty ( "user.dir" ) , "target" , ( ( japicmp . output . xml . XmlOutputGeneratorTest . class . getSimpleName ( ) ) + "_with.html" ) ) ; java . lang . String stylesheetContent = "body<sp>{font-family:<sp>Monospace;}" ; japicmp . config . Options options = japicmp . config . Options . newDefault ( ) ; options . setHtmlStylesheet ( japicmp . util . Optional . of ( stylesheetPath . toString ( ) ) ) ; options . setHtmlOutputFile ( japicmp . util . Optional . of ( htmlReportPath . toString ( ) ) ) ; java . nio . file . Files . write ( stylesheetPath , java . util . Collections . singletonList ( stylesheetContent ) , java . nio . charset . Charset . forName ( "UTF-8" ) ) ; generateHtmlReport ( options ) ; boolean foundStyleSheet = false ; java . util . List < java . lang . String > lines = java . nio . file . Files . readAllLines ( htmlReportPath , java . nio . charset . Charset . forName ( "UTF-8" ) ) ; for ( java . lang . String line : lines ) { if ( line . contains ( stylesheetContent ) ) { foundStyleSheet = true ; } } "<AssertPlaceHolder>" ; } generateHtmlReport ( japicmp . config . Options ) { java . util . List < japicmp . model . JApiClass > jApiClasses = new java . util . ArrayList ( ) ; japicmp . cmp . JarArchiveComparatorOptions jarArchiveComparatorOptions = japicmp . cmp . JarArchiveComparatorOptions . of ( options ) ; japicmp . model . JApiClassType classType = new japicmp . model . JApiClassType ( japicmp . util . Optional . < japicmp . model . JApiClassType . ClassType > absent ( ) , japicmp . util . Optional . < japicmp . model . JApiClassType . ClassType > absent ( ) , japicmp . model . JApiChangeStatus . REMOVED ) ; jApiClasses . add ( new japicmp . model . JApiClass ( new japicmp . cmp . JarArchiveComparator ( jarArchiveComparatorOptions ) , "japicmp.Test" , japicmp . util . Optional . < javassist . CtClass > absent ( ) , japicmp . util . Optional . < javassist . CtClass > absent ( ) , japicmp . model . JApiChangeStatus . NEW , classType ) ) ; japicmp . output . xml . XmlOutputGeneratorOptions xmlOutputGeneratorOptions = new japicmp . output . xml . XmlOutputGeneratorOptions ( ) ; xmlOutputGeneratorOptions . setCreateSchemaFile ( true ) ; japicmp . output . xml . XmlOutputGenerator generator = new japicmp . output . xml . XmlOutputGenerator ( jApiClasses , options , xmlOutputGeneratorOptions ) ; japicmp . output . xml . XmlOutput xmlOutput = generator . generate ( ) ; japicmp . output . xml . XmlOutputGenerator . writeToFiles ( options , xmlOutput ) ; } | org . junit . Assert . assertThat ( foundStyleSheet , org . hamcrest . core . Is . is ( true ) ) |
rulesSyncResultTest ( ) { org . openkilda . northbound . dto . v1 . switches . RulesSyncResult dto = new org . openkilda . northbound . dto . v1 . switches . RulesSyncResult ( java . util . Collections . singletonList ( 0L ) , java . util . Collections . singletonList ( 1L ) , java . util . Collections . singletonList ( 2L ) , java . util . Collections . singletonList ( 3L ) ) ; "<AssertPlaceHolder>" ; } pass ( T , java . lang . Class ) { return mapper . readValue ( mapper . writeValueAsString ( entity ) , clazz ) ; } | org . junit . Assert . assertEquals ( dto , pass ( dto , org . openkilda . northbound . dto . v1 . switches . RulesSyncResult . class ) ) |
testPrepareFile ( ) { final java . util . HashMap < ch . cyberduck . core . Path , ch . cyberduck . core . Path > files = new java . util . HashMap < ch . cyberduck . core . Path , ch . cyberduck . core . Path > ( ) ; final ch . cyberduck . core . Path source = new ch . cyberduck . core . Path ( "a" , java . util . EnumSet . of ( Path . Type . file ) ) ; source . attributes ( ) . setSize ( 1L ) ; files . put ( source , new ch . cyberduck . core . Path ( "a" , java . util . EnumSet . of ( Path . Type . file ) ) ) ; ch . cyberduck . core . transfer . copy . OverwriteFilter f = new ch . cyberduck . core . transfer . copy . OverwriteFilter ( new ch . cyberduck . core . NullSession ( new ch . cyberduck . core . Host ( new ch . cyberduck . core . TestProtocol ( ) ) ) , new ch . cyberduck . core . NullSession ( new ch . cyberduck . core . Host ( new ch . cyberduck . core . TestProtocol ( ) ) ) , files ) ; final ch . cyberduck . core . transfer . TransferStatus status = f . prepare ( source , null , new ch . cyberduck . core . transfer . TransferStatus ( ) , new ch . cyberduck . core . DisabledProgressListener ( ) ) ; "<AssertPlaceHolder>" ; } getLength ( ) { return length ; } | org . junit . Assert . assertEquals ( 1L , status . getLength ( ) ) |
testRemediationFunctionlinearWithOffset ( ) { remediation . func = "somethingElse" ; remediation . linearFactor = "2<sp>mn" ; remediation . linearOffset = "2<sp>mn" ; org . sonar . api . server . rule . RulesDefinition . DebtRemediationFunctions functions = mock ( org . sonar . api . server . rule . RulesDefinition . DebtRemediationFunctions . class ) ; org . sonar . api . server . debt . DebtRemediationFunction function = mock ( org . sonar . api . server . debt . DebtRemediationFunction . class ) ; when ( functions . linearWithOffset ( eq ( remediation . linearFactor ) , eq ( remediation . linearOffset ) ) ) . thenReturn ( function ) ; when ( function . coefficient ( ) ) . thenReturn ( "2<sp>min" ) ; remediation . remediationFunction ( functions ) ; verify ( functions ) . linearWithOffset ( "2<sp>min" , "2<sp>min" ) ; "<AssertPlaceHolder>" ; } remediationFunction ( org . sonar . api . server . rule . RulesDefinition . DebtRemediationFunctions ) { if ( func . startsWith ( "Constant" ) ) { return debt . constantPerIssue ( constantCost . replace ( "mn" , "min" ) ) ; } if ( "Linear" . equals ( func ) ) { return debt . linear ( linearFactor . replace ( "mn" , "min" ) ) ; } return debt . linearWithOffset ( linearFactor . replace ( "mn" , "min" ) , linearOffset . replace ( "mn" , "min" ) ) ; } | org . junit . Assert . assertEquals ( "2<sp>min" , function . coefficient ( ) ) |
testValidateLimits13 ( ) { java . lang . String string = new java . lang . String ( new int [ ] { 91 } , 0 , 1 ) ; boolean result = org . oscm . validator . ADMValidator . containsOnlyValidIdChars ( string ) ; "<AssertPlaceHolder>" ; } containsOnlyValidIdChars ( java . lang . String ) { if ( value == null ) { return true ; } java . util . regex . Matcher matcher = org . oscm . validator . ADMValidator . INVALID_ID_CHARS . matcher ( value ) ; return ! ( matcher . find ( ) ) ; } | org . junit . Assert . assertTrue ( result ) |
passesFilter_valueIsInRange_shouldBeTrue ( ) { com . vaadin . v7 . data . Item item = itemWithPropertyValue ( "foo" , 15 ) ; com . vaadin . v7 . data . util . filter . Between between = new com . vaadin . v7 . data . util . filter . Between ( "foo" , 1 , 30 ) ; "<AssertPlaceHolder>" ; } passesFilter ( java . lang . Object , com . vaadin . v7 . data . Item ) { java . lang . Object value = item . getItemProperty ( getPropertyId ( ) ) . getValue ( ) ; if ( value instanceof java . lang . Comparable ) { java . lang . Comparable comparable = ( ( java . lang . Comparable ) ( value ) ) ; return ( isAfterStartValue ( comparable ) ) && ( isBeforeEndValue ( comparable ) ) ; } else if ( value == null ) { return ( ( getStartValue ( ) ) == null ) && ( ( getEndValue ( ) ) == null ) ; } return false ; } | org . junit . Assert . assertTrue ( between . passesFilter ( "foo" , item ) ) |
testDetachDisk_Operation ( ) { org . easymock . EasyMock . expect ( computeRpcMock . detachDisk ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getZone ( ) , com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID . getInstance ( ) , "device" , com . google . cloud . compute . deprecated . ComputeImplTest . EMPTY_RPC_OPTIONS ) ) . andReturn ( zoneOperation . toPb ( ) ) ; org . easymock . EasyMock . replay ( computeRpcMock ) ; compute = options . getService ( ) ; "<AssertPlaceHolder>" ; } detachDisk ( java . lang . String , com . google . cloud . compute . deprecated . Compute . OperationOption [ ] ) { return compute . detachDisk ( getInstanceId ( ) , deviceName , options ) ; } | org . junit . Assert . assertEquals ( zoneOperation , compute . detachDisk ( com . google . cloud . compute . deprecated . ComputeImplTest . INSTANCE_ID , "device" ) ) |
convertJsonToObject ( ) { customer = com . baeldung . utility . SimpleDataGeneration . generateData ( ) ; dataJson = xstream . toXML ( customer ) ; customer = ( ( com . baeldung . pojo . Customer ) ( xstream . fromXML ( dataJson ) ) ) ; System . out . println ( customer ) ; "<AssertPlaceHolder>" ; } generateData ( ) { com . baeldung . pojo . Customer customer = new com . baeldung . pojo . Customer ( ) ; java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . set ( 1986 , 1 , 14 ) ; customer . setDob ( cal . getTime ( ) ) ; customer . setFirstName ( "XStream" ) ; customer . setLastName ( "Java" ) ; java . util . List < com . baeldung . pojo . ContactDetails > contactDetailsList = new java . util . ArrayList < com . baeldung . pojo . ContactDetails > ( ) ; com . baeldung . pojo . ContactDetails contactDetails1 = new com . baeldung . pojo . ContactDetails ( ) ; contactDetails1 . setLandline ( "0124-2460311" ) ; contactDetails1 . setMobile ( "6673543265" ) ; com . baeldung . pojo . ContactDetails contactDetails2 = new com . baeldung . pojo . ContactDetails ( ) ; contactDetails2 . setLandline ( "0120-223312" ) ; contactDetails2 . setMobile ( "4676543565" ) ; contactDetailsList . add ( contactDetails1 ) ; contactDetailsList . add ( contactDetails2 ) ; customer . setContactDetailsList ( contactDetailsList ) ; return customer ; } | org . junit . Assert . assertNotNull ( customer ) |
testReshape2 ( ) { org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; int [ ] origShape = new int [ ] { 3 , 4 , 5 } ; org . nd4j . linalg . api . ndarray . INDArray inArr = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 60 , 60 ) . reshape ( origShape ) ; for ( int [ ] toShape : new int [ ] [ ] { new int [ ] { 3 , 4 * 5 } , new int [ ] { 3 * 4 , 5 } , new int [ ] { 1 , ( 3 * 4 ) * 5 } , new int [ ] { ( 3 * 4 ) * 5 , 1 } } ) { org . nd4j . linalg . api . ndarray . INDArray exp = inArr . reshape ( toShape ) ; org . nd4j . linalg . api . ndarray . INDArray out = org . nd4j . linalg . factory . Nd4j . create ( toShape ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( org . nd4j . linalg . api . ops . DynamicCustomOp . builder ( "reshape" ) . addInputs ( inArr ) . addOutputs ( out ) . addIntegerArguments ( ( - 'c' ) ) . addIntegerArguments ( toShape ) . build ( ) ) ; "<AssertPlaceHolder>" ; } } build ( ) { return new org . datavec . api . records . reader . impl . jackson . FieldSelection ( this ) ; } | org . junit . Assert . assertEquals ( exp , out ) |
testGetTypeInfoOfGuid ( ) { com . sun . jna . platform . win32 . COM . ITypeLib shellTypeLib = loadShellTypeLib ( ) ; com . sun . jna . platform . win32 . Guid . GUID iFolderViewOC = new com . sun . jna . platform . win32 . Guid . GUID ( "{9BA05970-F6A8-11CF-A442-00A0C90A8F39}" ) ; com . sun . jna . ptr . PointerByReference pbr = new com . sun . jna . ptr . PointerByReference ( ) ; com . sun . jna . platform . win32 . WinNT . HRESULT hr = shellTypeLib . GetTypeInfoOfGuid ( iFolderViewOC , pbr ) ; "<AssertPlaceHolder>" ; } SUCCEEDED ( com . sun . jna . platform . win32 . WinNT . HRESULT ) { return com . sun . jna . platform . win32 . COM . COMUtils . SUCCEEDED ( hr . intValue ( ) ) ; } | org . junit . Assert . assertTrue ( com . sun . jna . platform . win32 . COM . COMUtils . SUCCEEDED ( hr ) ) |
shouldReturnProperOffsetWhenParametersAreNormal ( ) { java . lang . Integer originalOffset = 10 ; java . lang . Integer originalLimit = 100 ; java . lang . Integer newOffset = org . openstack . atlas . api . helpers . PaginationHelper . calculateNextOffset ( originalOffset , originalLimit ) ; final java . lang . Integer expectedOffset = originalOffset + originalLimit ; "<AssertPlaceHolder>" ; } calculateNextOffset ( java . lang . Integer , java . lang . Integer ) { limit = org . openstack . atlas . api . helpers . PaginationHelper . determinePageLimit ( limit ) ; offset = org . openstack . atlas . api . helpers . PaginationHelper . determinePageOffset ( offset ) ; return offset + limit ; } | org . junit . Assert . assertEquals ( expectedOffset , newOffset ) |
testSimpleCondition ( ) { java . util . Set < io . cdap . cdap . etl . proto . Connection > connections = com . google . common . collect . ImmutableSet . of ( new io . cdap . cdap . etl . proto . Connection ( "file" , "csv" ) , new io . cdap . cdap . etl . proto . Connection ( "csv" , "condition" ) , new io . cdap . cdap . etl . proto . Connection ( "condition" , "sink1" ) , new io . cdap . cdap . etl . proto . Connection ( "condition" , "sink2" ) ) ; java . util . Set < java . lang . String > conditions = java . util . Collections . singleton ( "condition" ) ; java . util . Set < java . lang . String > reduceNodes = new java . util . HashSet ( ) ; java . util . Set < java . lang . String > isolationNodes = new java . util . HashSet ( ) ; java . util . Set < java . lang . String > multiPortNodes = new java . util . HashSet ( ) ; java . util . Set < io . cdap . cdap . etl . planner . Dag > actual = io . cdap . cdap . etl . planner . PipelinePlanner . split ( connections , conditions , reduceNodes , isolationNodes , io . cdap . cdap . etl . planner . ConnectorDagTest . EMPTY_ACTIONS , multiPortNodes , io . cdap . cdap . etl . planner . ConnectorDagTest . EMPTY_CONNECTORS ) ; io . cdap . cdap . etl . planner . Dag dag1 = new io . cdap . cdap . etl . planner . Dag ( com . google . common . collect . ImmutableSet . of ( new io . cdap . cdap . etl . proto . Connection ( "file" , "csv" ) , new io . cdap . cdap . etl . proto . Connection ( "csv" , "condition" ) ) ) ; io . cdap . cdap . etl . planner . Dag dag2 = new io . cdap . cdap . etl . planner . Dag ( com . google . common . collect . ImmutableSet . of ( new io . cdap . cdap . etl . proto . Connection ( "condition" , "sink1" ) ) ) ; io . cdap . cdap . etl . planner . Dag dag3 = new io . cdap . cdap . etl . planner . Dag ( com . google . common . collect . ImmutableSet . of ( new io . cdap . cdap . etl . proto . Connection ( "condition" , "sink2" ) ) ) ; java . util . Set < io . cdap . cdap . etl . planner . Dag > expected = com . google . common . collect . ImmutableSet . of ( dag1 , dag2 , dag3 ) ; "<AssertPlaceHolder>" ; } of ( java . net . URL , java . lang . String , java . lang . ClassLoader ) { if ( resourceName . endsWith ( io . cdap . cdap . common . internal . guava . ClassPath . CLASS_FILE_NAME_EXTENSION ) ) { return new io . cdap . cdap . common . internal . guava . ClassPath . ClassInfo ( baseURL , resourceName , loader ) ; } else { return new io . cdap . cdap . common . internal . guava . ClassPath . ResourceInfo ( baseURL , resourceName , loader ) ; } } | org . junit . Assert . assertEquals ( actual , expected ) |
testSleepSwitchesNoTime ( ) { final java . util . List < net . violet . platform . util . SleepTime . SleepSwitch > theSwitches = testSleepSwitches ( StringShop . EMPTY_STRING , StringShop . EMPTY_STRING , StringShop . EMPTY_STRING , StringShop . EMPTY_STRING , 0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . mSet . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , theSwitches . size ( ) ) |
testToStringWithEmptyWpaSecurity ( ) { org . eclipse . kura . core . net . WifiAccessPointImpl ap = new org . eclipse . kura . core . net . WifiAccessPointImpl ( "ssid" ) ; ap . setWpaSecurity ( java . util . EnumSet . noneOf ( org . eclipse . kura . net . wifi . WifiSecurity . class ) ) ; java . lang . String expected = "ssid=ssid<sp>::<sp>frequency=0<sp>::<sp>mode=null<sp>::<sp>strength=0" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( "]" 1 ) . append ( this . id ) . append ( "]" 0 ) . append ( this . topic ) . append ( ",<sp>qos=" ) . append ( this . qos ) . append ( ",<sp>retain=" ) . append ( this . retain ) . append ( ",<sp>createdOn=" ) . append ( this . createdOn ) . append ( ",<sp>publishedOn=" ) . append ( this . publishedOn ) . append ( ",<sp>publishedMessageId=" ) . append ( this . publishedMessageId ) . append ( ",<sp>confirmedOn=" ) . append ( this . confirmedOn ) . append ( ",<sp>payload=" ) . append ( java . util . Arrays . toString ( this . payload ) ) . append ( ",<sp>priority=" ) . append ( this . priority ) . append ( ",<sp>sessionId=" ) . append ( this . sessionId ) . append ( "]" 2 ) . append ( this . droppedOn ) . append ( "]" ) ; return builder . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , ap . toString ( ) ) |
testGetExpectedDatasetbyId ( ) { final org . esa . beam . dataio . ExpectedDataset expectedDataset = new org . esa . beam . dataio . ExpectedDataset ( ) ; expectedDataset . setId ( "identifier" ) ; definition . addExpectedDataset ( expectedDataset ) ; final org . esa . beam . dataio . ExpectedDataset dataset = definition . getExpectedDataset ( "identifier" ) ; "<AssertPlaceHolder>" ; } getExpectedDataset ( java . lang . String ) { return expectedDatasetsMap . get ( id ) ; } | org . junit . Assert . assertNotNull ( dataset ) |
testFilterByOne ( ) { io . katharsis . queryspec . QuerySpec expectedSpec = new io . katharsis . queryspec . QuerySpec ( io . katharsis . resource . mock . models . Task . class ) ; expectedSpec . addFilter ( new io . katharsis . queryspec . FilterSpec ( java . util . Arrays . asList ( "name" ) , io . katharsis . queryspec . FilterOperator . EQ , "value" ) ) ; java . util . Map < java . lang . String , java . util . Set < java . lang . String > > params = new java . util . HashMap ( ) ; add ( params , "filter[tasks][name][EQ]" , "value" ) ; io . katharsis . queryspec . QuerySpec actualSpec = deserializer . deserialize ( taskInformation , params ) ; "<AssertPlaceHolder>" ; } deserialize ( io . katharsis . resource . information . ResourceInformation , java . util . Map ) { io . katharsis . queryspec . QuerySpec rootQuerySpec = new io . katharsis . queryspec . QuerySpec ( resourceInformation . getResourceClass ( ) ) ; setupDefaults ( rootQuerySpec ) ; java . util . List < io . katharsis . queryspec . DefaultQuerySpecDeserializer . Parameter > parameters = parseParameters ( parameterMap , resourceInformation ) ; for ( io . katharsis . queryspec . DefaultQuerySpecDeserializer . Parameter parameter : parameters ) { io . katharsis . queryspec . QuerySpec querySpec = rootQuerySpec . getQuerySpec ( parameter . resourceInformation ) ; if ( querySpec == null ) { querySpec = rootQuerySpec . getOrCreateQuerySpec ( parameter . resourceInformation ) ; setupDefaults ( querySpec ) ; } switch ( parameter . paramType ) { case sort : deserializeSort ( querySpec , parameter ) ; break ; case filter : deserializeFilter ( querySpec , parameter ) ; break ; case include : deserializeIncludes ( querySpec , parameter ) ; break ; case fields : deserializeFields ( querySpec , parameter ) ; break ; case page : deserializePage ( querySpec , parameter ) ; break ; default : throw new java . lang . IllegalStateException ( parameter . paramType . toString ( ) ) ; } } return rootQuerySpec ; } | org . junit . Assert . assertEquals ( expectedSpec , actualSpec ) |
testBuildWithParameters ( ) { org . lnu . is . domain . department . Department parent = new org . lnu . is . domain . department . Department ( ) ; org . lnu . is . domain . department . type . DepartmentType departmentType = new org . lnu . is . domain . department . type . DepartmentType ( ) ; org . lnu . is . domain . order . Order order = new org . lnu . is . domain . order . Order ( ) ; java . lang . String name = "name" ; java . lang . String abbrName = "abbr<sp>name" ; java . lang . String manager = "manager" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date endDate = new java . util . Date ( ) ; java . lang . String indetifir = "s" ; org . lnu . is . domain . department . Department context = new org . lnu . is . domain . department . Department ( ) ; context . setName ( name ) ; context . setParent ( parent ) ; context . setDepartmentType ( departmentType ) ; context . setOrder ( order ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; context . setManager ( manager ) ; context . setBegDate ( begDate ) ; context . setEndDate ( endDate ) ; context . setIdentifir ( indetifir ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Department<sp>e<sp>WHERE<sp>(<sp>e.parent<sp>=<sp>:parent<sp>AND<sp>e.departmentType<sp>=<sp>:departmentType<sp>AND<sp>e.order<sp>=<sp>:order<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.manager<sp>LIKE<sp>CONCAT('%',:manager,'%')<sp>AND<sp>e.identifir<sp>LIKE<sp>CONCAT('%',:identifir,'%')<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . department . Department > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
keyRecoveryWithEncryptedKey ( ) { com . google . dogecoin . core . ECKey unencryptedKey = new com . google . dogecoin . core . ECKey ( ) ; org . spongycastle . crypto . params . KeyParameter aesKey = keyCrypter . deriveKey ( com . google . dogecoin . core . ECKeyTest . PASSWORD1 ) ; com . google . dogecoin . core . ECKey encryptedKey = unencryptedKey . encrypt ( keyCrypter , aesKey ) ; java . lang . String message = "Goodbye<sp>Jupiter!" ; com . google . dogecoin . core . Sha256Hash hash = com . google . dogecoin . core . Sha256Hash . create ( message . getBytes ( ) ) ; com . google . dogecoin . core . ECKey . ECDSASignature sig = encryptedKey . sign ( hash , aesKey ) ; unencryptedKey = new com . google . dogecoin . core . ECKey ( null , unencryptedKey . getPubKey ( ) ) ; boolean found = false ; for ( int i = 0 ; i < 4 ; i ++ ) { com . google . dogecoin . core . ECKey key2 = com . google . dogecoin . core . ECKey . recoverFromSignature ( i , sig , hash , true ) ; if ( unencryptedKey . equals ( key2 ) ) { found = true ; break ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( obj instanceof org . wowdoge . AddressBook ) { org . wowdoge . AddressBook addressBook = ( ( org . wowdoge . AddressBook ) ( obj ) ) ; return name . equals ( addressBook . getName ( ) ) ; } return false ; } | org . junit . Assert . assertTrue ( found ) |
hasSubscriptionOwnerRole_BROKER_MANAGER ( ) { org . oscm . domobjects . PlatformUser user = createUserWithRole ( UserRoleType . BROKER_MANAGER ) ; "<AssertPlaceHolder>" ; } hasSubscriptionOwnerRole ( ) { for ( org . oscm . domobjects . RoleAssignment roleAssignment : assignedRoles ) { if ( ( ( ( roleAssignment . getRole ( ) . getRoleName ( ) ) == ( org . oscm . internal . types . enumtypes . UserRoleType . ORGANIZATION_ADMIN ) ) || ( ( roleAssignment . getRole ( ) . getRoleName ( ) ) == ( org . oscm . internal . types . enumtypes . UserRoleType . SUBSCRIPTION_MANAGER ) ) ) || ( ( roleAssignment . getRole ( ) . getRoleName ( ) ) == ( org . oscm . internal . types . enumtypes . UserRoleType . UNIT_ADMINISTRATOR ) ) ) return true ; } return false ; } | org . junit . Assert . assertFalse ( user . hasSubscriptionOwnerRole ( ) ) |
test ( ) { boolean passed = true ; java . lang . String cacheSize = "20480" ; int threads = 10 ; java . lang . Thread [ ] t = new java . lang . Thread [ threads ] ; java . lang . System . setProperty ( "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size" , cacheSize ) ; com . arjuna . ats . arjuna . objectstore . ParticipantStore store = new com . arjuna . ats . internal . arjuna . objectstore . CacheStore ( new com . arjuna . ats . arjuna . common . ObjectStoreEnvironmentBean ( ) ) ; long stime = java . util . Calendar . getInstance ( ) . getTime ( ) . getTime ( ) ; for ( int i = 0 ; ( i < threads ) && passed ; i ++ ) { try { t [ i ] = new com . hp . mwtests . ts . arjuna . objectstore . WriterThread ( store ) ; t [ i ] . start ( ) ; } catch ( java . lang . Exception ex ) { ex . printStackTrace ( ) ; passed = false ; } } for ( int j = 0 ; j < threads ; j ++ ) { try { t [ j ] . join ( ) ; passed = passed && ( ( ( com . hp . mwtests . ts . arjuna . objectstore . WriterThread ) ( t [ j ] ) ) . passed ) ; } catch ( java . lang . Exception ex ) { } } long ftime = java . util . Calendar . getInstance ( ) . getTime ( ) . getTime ( ) ; long timeTaken = ftime - stime ; System . out . println ( ( ( ( "time<sp>for<sp>" + threads ) + "<sp>users<sp>is<sp>" ) + timeTaken ) ) ; try { store . sync ( ) ; } catch ( java . lang . Exception ex ) { } "<AssertPlaceHolder>" ; } sync ( ) { } | org . junit . Assert . assertTrue ( passed ) |
testDeleteRecordSetDeletesRecordSetVersions ( ) { com . liferay . dynamic . data . mapping . model . DDMForm ddmStructureDDMForm = com . liferay . dynamic . data . mapping . test . util . DDMFormTestUtil . createDDMForm ( "Field" ) ; com . liferay . dynamic . data . lists . model . DDLRecordSet ddlRecordSet = addRecordSet ( ddmStructureDDMForm , StorageType . JSON . toString ( ) ) ; com . liferay . dynamic . data . lists . service . DDLRecordSetLocalServiceUtil . deleteRecordSet ( ddlRecordSet . getRecordSetId ( ) ) ; int actualCount = com . liferay . dynamic . data . lists . service . DDLRecordSetVersionLocalServiceUtil . getRecordSetVersionsCount ( ddlRecordSet . getRecordSetId ( ) ) ; "<AssertPlaceHolder>" ; } getRecordSetId ( ) { return com . liferay . portal . kernel . util . PrefsParamUtil . getLong ( _ddlRequestHelper . getPortletPreferences ( ) , _ddlRequestHelper . getRenderRequest ( ) , "recordSetId" ) ; } | org . junit . Assert . assertEquals ( 0 , actualCount ) |
testETLSplitStrategyForACID ( ) { hiveConf . setVar ( HiveConf . ConfVars . HIVE_ORC_SPLIT_STRATEGY , "ETL" ) ; hiveConf . setBoolVar ( HiveConf . ConfVars . HIVEOPTINDEXFILTER , true ) ; runStatementOnDriver ( ( ( "insert<sp>into<sp>" + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . Table . ACIDTBL ) ) + "<sp>values(1,2)" ) ) ; runStatementOnDriver ( ( ( "alter<sp>table<sp>" + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . Table . ACIDTBL ) ) + "<sp>compact<sp>'MAJOR'" ) ) ; org . apache . hadoop . hive . ql . TestTxnCommands2 . runWorker ( hiveConf ) ; java . util . List < java . lang . String > rs = runStatementOnDriver ( ( ( "select<sp>*<sp>from<sp>" + ( org . apache . hadoop . hive . ql . TestTxnCommands2 . Table . ACIDTBL ) ) + "<sp>where<sp>a<sp>=<sp>1" ) ) ; int [ ] [ ] resultData = new int [ ] [ ] { new int [ ] { 1 , 2 } } ; "<AssertPlaceHolder>" ; } stringifyValues ( int [ ] [ ] ) { assert ( rowsIn . length ) > 0 ; int [ ] [ ] rows = rowsIn . clone ( ) ; java . util . Arrays . sort ( rows , new org . apache . hadoop . hive . ql . TestTxnCommands2 . RowComp ( ) ) ; java . util . List < java . lang . String > rs = new java . util . ArrayList < java . lang . String > ( ) ; for ( int [ ] row : rows ) { assert ( row . length ) > 0 ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; for ( int value : row ) { sb . append ( value ) . append ( "\t" ) ; } sb . setLength ( ( ( sb . length ( ) ) - 1 ) ) ; rs . add ( sb . toString ( ) ) ; } return rs ; } | org . junit . Assert . assertEquals ( org . apache . hadoop . hive . ql . TestTxnCommands2 . stringifyValues ( resultData ) , rs ) |
testHashCode ( ) { java . io . File harFile = new java . io . File ( "src/test/resources/sstoehr.har" ) ; de . sstoehr . harreader . model . Har har1 = harReader . readFromFile ( harFile ) ; de . sstoehr . harreader . model . Har har2 = harReader . readFromFile ( harFile ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { return java . util . Objects . hash ( mimeType , params , text , comment ) ; } | org . junit . Assert . assertEquals ( har1 . hashCode ( ) , har2 . hashCode ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.