input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testTopContainerLastChildOverride ( ) { final org . opendaylight . yangtools . yang . data . api . schema . ContainerNode expectedStructure = org . opendaylight . yangtools . yang . data . impl . schema . Builders . containerBuilder ( ) . withNodeIdentifier ( rootContainer ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . Builders . mapBuilder ( ) . withNodeIdentifier ( outerList ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . Builders . mapEntryBuilder ( ) . withNodeIdentifier ( outerListWithKey ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . Builders . leafBuilder ( ) . withNodeIdentifier ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( org . opendaylight . yangtools . yang . data . impl . schema . InstanceIdToNodesTest . ID ) ) . withValue ( 1 ) . build ( ) ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . Builders . choiceBuilder ( ) . withNodeIdentifier ( choice ) . withChild ( org . opendaylight . yangtools . yang . data . impl . schema . Builders . leafBuilder ( ) . withNodeIdentifier ( leafFromCase ) . withValue ( "" ) . build ( ) ) . build ( ) ) . build ( ) ) . build ( ) ) . build ( ) ; final org . opendaylight . yangtools . yang . data . api . schema . NormalizedNode < ? , ? > filter = org . opendaylight . yangtools . yang . data . impl . schema . ImmutableNodes . fromInstanceId ( org . opendaylight . yangtools . yang . data . impl . schema . InstanceIdToNodesTest . ctx , org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . create ( rootContainer ) , expectedStructure ) ; "<AssertPlaceHolder>" ; } create ( org . opendaylight . yangtools . yang . data . api . schema . tree . DataTreeModification ) { return new org . opendaylight . yangtools . yang . data . api . schema . tree . SynchronizedDataTreeModification ( delegate ) ; } | org . junit . Assert . assertEquals ( expectedStructure , filter ) |
testContainsRunContainer_ExcludeSuperSet ( ) { org . roaringbitmap . Container ac = new org . roaringbitmap . ArrayContainer ( ) . add ( 0 , 10 ) ; org . roaringbitmap . Container superset = new org . roaringbitmap . RunContainer ( ) . add ( 0 , 20 ) ; "<AssertPlaceHolder>" ; } contains ( int ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>in<sp>ImmutableConciseSet" ) ; } | org . junit . Assert . assertFalse ( ac . contains ( superset ) ) |
testSplitCapabilitiesStringEmpty ( ) { java . util . List < org . eurekastreams . server . domain . BackgroundItem > list = org . eurekastreams . server . domain . DomainFormatUtility . splitCapabilitiesString ( "" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { throw new java . lang . UnsupportedOperationException ( org . eurekastreams . server . service . utility . PropertyExposingServletContextPropertyPlaceholderConfigurer . PropertyAccessor . POOR_CORRESPONDENCE_MSG ) ; } | org . junit . Assert . assertTrue ( list . isEmpty ( ) ) |
combineSizeShouldDefaultToTen ( ) { java . util . Map < org . apache . blur . command . Shard , java . util . List < java . lang . String > > execResults = com . google . common . collect . Maps . newHashMap ( ) ; execResults . put ( new org . apache . blur . command . Shard ( "t1" , "s1" ) , com . google . common . collect . Lists . newArrayList ( "aa" , "cc" , "ee" , "gg" , "t1" 1 ) ) ; execResults . put ( new org . apache . blur . command . Shard ( "t1" , "s2" ) , com . google . common . collect . Lists . newArrayList ( "bb" , "t1" 0 , "ff" , "hh" , "t1" 2 ) ) ; java . util . List < java . lang . String > expected = com . google . common . collect . Lists . newArrayList ( "aa" , "bb" , "cc" , "t1" 0 , "ee" , "ff" , "gg" , "hh" , "t1" 1 , "t1" 2 ) ; org . apache . blur . command . TermsCommand cmd = new org . apache . blur . command . TermsCommand ( ) ; java . util . List < java . lang . String > returned = cmd . combine ( new org . apache . blur . command . TestCombiningContext ( ) , execResults ) ; "<AssertPlaceHolder>" ; } combine ( org . apache . blur . command . CombiningContext , java . util . Map ) { long total = 0 ; for ( java . lang . Long i : results . values ( ) ) { total += i ; } return total ; } | org . junit . Assert . assertEquals ( expected , returned ) |
testFramesWithSameNameAreNotCombined ( ) { final java . util . Collection < edu . cmu . cs . lti . ark . fn . parsing . RankedScoredRoleAssignment > roleAssignments = edu . cmu . cs . lti . ark . fn . evaluation . PrepareFullAnnotationJson . parseRoleAssignments ( java . util . Arrays . asList ( edu . cmu . cs . lti . ark . fn . evaluation . PrepareFullAnnotationJsonTest . morningArgResult . split ( "\n" ) ) ) . get ( 0 ) ; final java . util . List < java . lang . String > tokens = java . util . Arrays . asList ( edu . cmu . cs . lti . ark . fn . evaluation . PrepareFullAnnotationJsonTest . morningSentence . split ( "<sp>" ) ) ; final edu . cmu . cs . lti . ark . fn . parsing . SemaforParseResult semaforParseResult = edu . cmu . cs . lti . ark . fn . evaluation . PrepareFullAnnotationJson . getSemaforParse ( roleAssignments , tokens ) ; final java . util . Collection < edu . cmu . cs . lti . ark . fn . parsing . SemaforParseResult . Frame > calendricUnitFrames = filter ( semaforParseResult . frames , new com . google . common . base . Predicate < edu . cmu . cs . lti . ark . fn . parsing . SemaforParseResult . Frame > ( ) { @ edu . cmu . cs . lti . ark . fn . evaluation . Override public boolean apply ( edu . cmu . cs . lti . ark . fn . parsing . SemaforParseResult . Frame input ) { return input . target . name . equals ( "Calendric_unit" ) ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { return tokens . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , calendricUnitFrames . size ( ) ) |
testSaveCountryVats_delete ( ) { createDefaultVat ( BigDecimal . ZERO ) ; createCountryVat ( org . oscm . vatservice . bean . VatServiceBeanIT . TEN ) ; java . util . List < org . oscm . internal . vo . VOCountryVatRate > countryVatRates = vatService . getCountryVats ( ) ; countryVatRates . get ( 0 ) . setRate ( null ) ; vatService . saveCountryVats ( countryVatRates ) ; "<AssertPlaceHolder>" ; } getCountryVats ( ) { if ( ( countryVats ) == null ) { initCountryMembers ( ) ; } return countryVats ; } | org . junit . Assert . assertEquals ( 0 , vatService . getCountryVats ( ) . size ( ) ) |
evaluateWithObjectNotFoundWithDefaultLanguage ( ) { org . xwiki . bridge . DocumentAccessBridge documentBridge = this . mocker . getInstance ( org . xwiki . bridge . DocumentAccessBridge . class ) ; org . xwiki . model . reference . DocumentReference documentReference = new org . xwiki . model . reference . DocumentReference ( "wiki" , "space" , "page" ) ; when ( documentBridge . getObjectNumber ( any ( ) , any ( ) , eq ( "language" ) , eq ( "fr" ) ) ) . thenReturn ( ( - 1 ) ) ; when ( documentBridge . getObjectNumber ( any ( ) , any ( ) , eq ( "language" ) , eq ( "en" ) ) ) . thenReturn ( ( - 1 ) ) ; when ( documentBridge . getProperty ( any ( org . xwiki . model . reference . DocumentReference . class ) , any ( ) , eq ( 0 ) , eq ( "html" ) ) ) . thenReturn ( "Salut<sp><b>${name}</b><sp><br<sp>/>${email}" ) ; org . xwiki . velocity . VelocityEngine velocityEngine = mock ( org . xwiki . velocity . VelocityEngine . class ) ; org . xwiki . velocity . VelocityManager velocityManager = this . mocker . getInstance ( org . xwiki . velocity . VelocityManager . class ) ; when ( velocityManager . getVelocityEngine ( ) ) . thenReturn ( velocityEngine ) ; when ( velocityEvaluator . evaluateVelocity ( eq ( "Salut<sp><b>${name}</b><sp><br<sp>/>${email}" ) , any ( ) , any ( org . apache . velocity . VelocityContext . class ) ) ) . thenReturn ( "Salut<sp><b>John<sp>Doe</b><sp><br<sp>/>john@doe.com" ) ; java . lang . String result = this . mocker . getComponentUnderTest ( ) . evaluate ( documentReference , "html" , java . util . Collections . emptyMap ( ) , Locale . FRENCH ) ; verify ( documentBridge ) . getObjectNumber ( any ( ) , any ( ) , eq ( "language" ) , eq ( "fr" ) ) ; verify ( documentBridge ) . getObjectNumber ( any ( ) , any ( ) , eq ( "language" ) , eq ( "en" ) ) ; "<AssertPlaceHolder>" ; } eq ( org . xwiki . notifications . filters . expression . generics . AbstractValueNode ) { return new org . xwiki . notifications . filters . expression . EqualsNode ( this , node ) ; } | org . junit . Assert . assertEquals ( result , "Salut<sp><b>John<sp>Doe</b><sp><br<sp>/>john@doe.com" ) |
testLeidAfZonderExtraBijgehoudenPersonen ( ) { when ( partner . getID ( ) ) . thenReturn ( 1 ) ; model . leidAf ( ) ; "<AssertPlaceHolder>" ; } getExtraBijgehoudenPersonen ( ) { return this . extraBijgehoudenPersonen ; } | org . junit . Assert . assertThat ( model . getExtraBijgehoudenPersonen ( ) . size ( ) , org . hamcrest . core . Is . is ( 0 ) ) |
portSetToSomethingElseIsRespected ( ) { settings . setPort ( 1234 ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return ( ( java . lang . Integer ) ( options . get ( com . opera . core . systems . OperaSettings . Capability . PORT ) . getValue ( ) ) ) ; } | org . junit . Assert . assertThat ( settings . getPort ( ) , org . hamcrest . CoreMatchers . is ( 1234 ) ) |
registerDefaultDoesNotOverridePreviouslyRegisteredStrategy ( ) { com . avanza . astrix . modules . ModulesConfigurer modulesConfigurer = new com . avanza . astrix . modules . ModulesConfigurer ( ) ; modulesConfigurer . register ( new com . avanza . astrix . modules . Module ( ) { @ com . avanza . astrix . modules . test . Override public void prepare ( com . avanza . astrix . modules . ModuleContext moduleContext ) { moduleContext . bind ( com . avanza . astrix . modules . test . ModulesTest . Ping . class , com . avanza . astrix . modules . test . ModulesTest . PingWithImportedDriver . class ) ; moduleContext . importType ( com . avanza . astrix . modules . test . ModulesTest . PingDriver . class ) ; moduleContext . export ( com . avanza . astrix . modules . test . ModulesTest . Ping . class ) ; } } ) ; modulesConfigurer . register ( com . avanza . astrix . modules . StrategyProvider . create ( com . avanza . astrix . modules . test . ModulesTest . PingDriver . class , com . avanza . astrix . modules . test . ModulesTest . NormalPingDriver . class ) ) ; modulesConfigurer . registerDefault ( com . avanza . astrix . modules . StrategyProvider . create ( com . avanza . astrix . modules . test . ModulesTest . PingDriver . class , com . avanza . astrix . modules . test . ModulesTest . ReversePingDriver . class ) ) ; com . avanza . astrix . modules . Modules modules = modulesConfigurer . configure ( ) ; com . avanza . astrix . modules . test . ModulesTest . Ping ping = modules . getInstance ( com . avanza . astrix . modules . test . ModulesTest . Ping . class ) ; "<AssertPlaceHolder>" ; } ping ( java . lang . String ) { pingRequests . add ( msg ) ; java . util . concurrent . CompletableFuture < java . lang . String > result = new java . util . concurrent . CompletableFuture < java . lang . String > ( ) ; new java . lang . Thread ( ( ) -> { try { java . lang . String response = pingResponses . poll ( 1 , TimeUnit . SECONDS ) ; if ( response != null ) { result . complete ( response ) ; } else { result . completeExceptionally ( new java . lang . IllegalStateException ( "TIMEOUT" ) ) ; } } catch ( e ) { result . completeExceptionally ( new java . lang . IllegalStateException ( "TIMEOUT" ) ) ; } } ) . start ( ) ; return result ; } | org . junit . Assert . assertEquals ( "foo" , ping . ping ( "foo" ) ) |
testAppendToNonExistingHeader ( ) { message . appendHeader ( "foo" , "<sp>baz2" ) ; "<AssertPlaceHolder>" ; } getFirstHeaderValue ( java . lang . String ) { java . util . List < java . lang . String > values = headers . get ( name ) ; if ( values == null ) { return null ; } else { java . util . Iterator < java . lang . String > iterator = values . iterator ( ) ; return iterator . next ( ) ; } } | org . junit . Assert . assertEquals ( "<sp>baz2" , message . getFirstHeaderValue ( "foo" ) ) |
testSerializeDeserialize ( ) { org . apache . hadoop . nfs . NfsTime t1 = new org . apache . hadoop . nfs . NfsTime ( 1001 ) ; org . apache . hadoop . oncrpc . XDR xdr = new org . apache . hadoop . oncrpc . XDR ( ) ; t1 . serialize ( xdr ) ; org . apache . hadoop . nfs . NfsTime t2 = org . apache . hadoop . nfs . NfsTime . deserialize ( xdr . asReadOnlyWrap ( ) ) ; "<AssertPlaceHolder>" ; } asReadOnlyWrap ( ) { java . nio . ByteBuffer b = buf . asReadOnlyBuffer ( ) ; if ( ( state ) == ( org . apache . hadoop . oncrpc . XDR . State . WRITING ) ) { b . flip ( ) ; } org . apache . hadoop . oncrpc . XDR n = new org . apache . hadoop . oncrpc . XDR ( b , org . apache . hadoop . oncrpc . XDR . State . READING ) ; return n ; } | org . junit . Assert . assertEquals ( t1 , t2 ) |
convertFromTimeWithZoneId ( ) { java . util . Date date = io . atlasmap . converters . DateTimeHelper . convertSqlTimeToDate ( java . sql . Time . valueOf ( java . time . LocalTime . now ( ) ) , "America/New_York" ) ; "<AssertPlaceHolder>" ; } convertSqlTimeToDate ( java . sql . Time , java . lang . String ) { return io . atlasmap . converters . DateTimeHelper . convertLocalTimeToDate ( time . toLocalTime ( ) , timeZone ) ; } | org . junit . Assert . assertNotNull ( date ) |
roleExistEntryIsFoundExpectTrue ( ) { net . jforum . entities . Role role = new net . jforum . entities . Role ( ) ; role . setName ( "role1" ) ; net . jforum . entities . Group g = new net . jforum . entities . Group ( ) ; g . addRole ( role ) ; "<AssertPlaceHolder>" ; } roleExist ( java . lang . String ) { for ( net . jforum . entities . Role role : this . roles ) { if ( role . getName ( ) . equals ( roleName ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( g . roleExist ( "role1" ) ) |
test01_fromSpec ( ) { 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 ( "ordering/01" , facesConfigDescriptors , com . liferay . faces . util . xml . OrderingTest . META_INF_FACES_CONFIG_XML ) ; java . util . Collections . shuffle ( facesConfigDescriptors ) ; java . util . List < com . liferay . faces . util . config . internal . FacesConfigDescriptor > webInfFacesConfigDescriptors = new java . util . ArrayList < com . liferay . faces . util . config . internal . FacesConfigDescriptor > ( ) ; com . liferay . faces . util . xml . OrderingTest . parseConfigurationResources ( "ordering/01" , webInfFacesConfigDescriptors , com . liferay . faces . util . xml . OrderingTest . WEB_INF_FACES_CONFIG_XML ) ; com . liferay . faces . util . config . internal . FacesConfigDescriptor facesConfig = webInfFacesConfigDescriptors . get ( 0 ) ; java . util . List < java . lang . String > absoluteOrdering = facesConfig . getAbsoluteOrdering ( ) ; java . lang . String [ ] originalOrder = com . liferay . faces . util . xml . OrderingTest . extractNames ( facesConfigDescriptors ) ; java . util . List < com . liferay . faces . util . config . internal . FacesConfigDescriptor > order ; if ( absoluteOrdering == null ) { order = com . liferay . faces . util . config . internal . OrderingUtil . getOrder ( facesConfigDescriptors ) ; } else { org . junit . Assert . fail ( "test01_fromSpec:<sp>absoluteOrdering<sp>!=<sp>null.<sp>It<sp>should<sp>be<sp>null." ) ; order = com . liferay . faces . util . config . internal . OrderingUtil . getOrder ( facesConfigDescriptors , absoluteOrdering ) ; } order . add ( facesConfig ) ; java . lang . String [ ] orderedNames = com . liferay . faces . util . xml . OrderingTest . extractNames ( order ) ; 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 > expected = java . util . Arrays . asList ( "C" , "B" , "A" , "test01_fromSpec:<sp>beginning<sp>..." 1 ) ; java . lang . String message = ( ( ( ( ( "\n<sp>original:<sp>" + original ) + "\n<sp>expected:<sp>" ) + expected ) + "\n<sp>actually:<sp>" ) + actually ) + "\n" ; "<AssertPlaceHolder>" ; com . liferay . faces . util . xml . OrderingTest . logger . info ( ( "test01_fromSpec:<sp>beginning<sp>..." 0 + 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 , expected . equals ( actually ) ) |
MathML2Short_NormCons ( ) { java . lang . String xmlForm = "<math><mrow><mi>a</mi><mo>+</mo><sp><msup><sp><mi>b</mi><mn>2</mn></msup></mrow></math>" ; java . lang . String expect = "math(mrow(mi(a)mo(+)msup(mi(b)mn(con))))" ; gov . uspto . patent . mathml . MathML mathML = gov . uspto . patent . mathml . MathML . read ( new java . io . StringReader ( xmlForm ) ) ; java . lang . String stringForm = mathML . getStringForm ( ) ; stringForm = mathML . generalizeConstance ( stringForm ) ; "<AssertPlaceHolder>" ; } generalizeConstance ( java . lang . String ) { java . util . regex . Matcher mReplace = gov . uspto . patent . mathml . MathML . REPLACE_CONS . matcher ( mathMLString ) ; if ( mReplace . find ( ) ) { mathMLString = mReplace . replaceAll ( "mn(con)" ) ; } return mathMLString ; } | org . junit . Assert . assertEquals ( expect , stringForm ) |
testMeanAlongDim1BP ( ) { for ( boolean keepDims : new boolean [ ] { false , true } ) { org . nd4j . linalg . api . ndarray . INDArray preReduceInput = org . nd4j . linalg . factory . Nd4j . linspace ( 1 , 12 , 12 ) . reshape ( 3 , 4 ) ; long [ ] reducedShape_1 = ( keepDims ) ? new long [ ] { 3 , 1 } : new long [ ] { 3 } ; org . nd4j . linalg . api . ndarray . INDArray dLdOut_1 = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 2 , 3 } , reducedShape_1 ) ; org . nd4j . linalg . api . ndarray . INDArray dLdInExpected_1 = org . nd4j . linalg . factory . Nd4j . createUninitialized ( preReduceInput . shape ( ) ) ; for ( int i = 0 ; i < 4 ; i ++ ) { dLdInExpected_1 . putColumn ( i , dLdOut_1 . div ( 4 ) ) ; } org . nd4j . linalg . api . ndarray . INDArray dLdIn = org . nd4j . linalg . factory . Nd4j . createUninitialized ( 3 , 4 ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( new org . nd4j . autodiff . validation . OpTestCase ( new org . nd4j . autodiff . opvalidation . MeanBp ( preReduceInput , dLdOut_1 , dLdIn , keepDims , 1 ) ) . expectedOutput ( 0 , dLdInExpected_1 ) ) ; "<AssertPlaceHolder>" ; } } expectedOutput ( int , org . nd4j . linalg . api . ndarray . INDArray ) { testFns . put ( outputNum , new org . nd4j . autodiff . validation . functions . EqualityFn ( expected ) ) ; expShapes . put ( outputNum , expected . shapeDescriptor ( ) ) ; return this ; } | org . junit . Assert . assertNull ( err ) |
testMapJuisteStapelType ( ) { final java . util . Set < nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Stapel > stapels = new java . util . LinkedHashSet ( ) ; final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Stapel stapel = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Stapel ( new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Persoon ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . SoortPersoon . INGESCHREVENE ) , "02" , 0 ) ; final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . StapelVoorkomen stapelVoorkomen = new nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . StapelVoorkomen ( stapel , 0 , nl . bzk . migratiebrp . synchronisatie . dal . service . impl . mapper . BrpIstOuder1MapperTest . ADMINISTRATIEVE_HANDELING ) ; stapel . addStapelVoorkomen ( stapelVoorkomen ) ; stapels . add ( stapel ) ; "<AssertPlaceHolder>" ; } map ( java . util . Set ) { if ( ( persoonAdresSet == null ) || ( persoonAdresSet . isEmpty ( ) ) ) { return null ; } else { return mapper . map ( persoonAdresSet . iterator ( ) . next ( ) . getPersoonAdresHistorieSet ( ) ) ; } } | org . junit . Assert . assertNotNull ( mapper . map ( stapels ) ) |
testError ( ) { hu . elte . txtuml . api . model . execution . seqdiag . sequences . SequenceStateAssertErr diag = new hu . elte . txtuml . api . model . execution . seqdiag . sequences . SequenceStateAssertErr ( ) ; hu . elte . txtuml . api . model . execution . SequenceDiagramExecutor executor = hu . elte . txtuml . api . model . execution . SequenceDiagramExecutor . create ( ) ; executor . setDiagram ( diag ) . run ( ) ; "<AssertPlaceHolder>" ; } getErrors ( ) { synchronized ( this . errors ) { return com . google . common . collect . ImmutableList . copyOf ( this . errors ) ; } } | org . junit . Assert . assertEquals ( 3 , executor . getErrors ( ) . size ( ) ) |
shouldNotRemoveMoreCountersThanAvailable ( ) { counter . remove ( 10 ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return count ; } | org . junit . Assert . assertEquals ( 0 , counter . getCount ( ) ) |
convertsSmallOrdinalValues ( ) { com . sjl . dsl4xml . support . convert . DoubleStringConverter _c = new com . sjl . dsl4xml . support . convert . DoubleStringConverter ( ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { return ( aValue == null ) || ( "" . equals ( aValue ) ) ? 0 : new java . lang . Long ( aValue ) ; } | org . junit . Assert . assertEquals ( new java . lang . Double ( 1 ) , _c . convert ( "1" ) ) |
testBatchInitAndLearn ( ) { org . hawkular . datamining . forecast . ModelData rModel = org . hawkular . datamining . forecast . ModelReader . read ( "wnLowVariance" ) ; org . hawkular . datamining . forecast . models . DoubleExponentialSmoothing . DoubleExOptimizer optimizer = org . hawkular . datamining . forecast . models . DoubleExponentialSmoothing . optimizer ( ) ; org . hawkular . datamining . forecast . models . TimeSeriesModel modelInit = optimizer . minimizedMSE ( rModel . getData ( ) ) ; org . hawkular . datamining . forecast . models . TimeSeriesModel modelLearn = org . hawkular . datamining . forecast . models . DoubleExponentialSmoothing . createWithSmoothingParams ( optimizer . result ( ) [ 0 ] , optimizer . result ( ) [ 1 ] ) ; modelLearn . learn ( rModel . getData ( ) ) ; org . hawkular . datamining . forecast . stats . AccuracyStatistics batchInitStatistics = modelInit . initStatistics ( ) ; org . hawkular . datamining . forecast . stats . AccuracyStatistics batchLearnStatistics = modelLearn . runStatistics ( ) ; "<AssertPlaceHolder>" ; } runStatistics ( ) { if ( ! ( initialized ) ) { return null ; } return model . runStatistics ( ) ; } | org . junit . Assert . assertEquals ( batchInitStatistics , batchLearnStatistics ) |
testOptionalResourceInjectionWithNoDependencies ( ) { org . springframework . ide . eclipse . beans . core . internal . model . BeansConfig config = new org . springframework . ide . eclipse . beans . core . internal . model . BeansConfig ( beansProject , "src/org/springframework/beans/factory/annotation/testOptionalResourceInjectionWithNoDependencies-context.xml" , IBeansConfig . Type . MANUAL ) ; org . springframework . ide . eclipse . beans . core . autowire . internal . provider . AutowireDependencyProvider provider = new org . springframework . ide . eclipse . beans . core . autowire . internal . provider . AutowireDependencyProvider ( config , config ) ; java . util . Map < org . springframework . ide . eclipse . beans . core . model . IBean , java . util . Set < org . springframework . ide . eclipse . beans . core . model . IBeanReference > > references = provider . resolveAutowiredDependencies ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return orderedStorage . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , references . size ( ) ) |
addTwoListeners_jsIsExecutedOnce ( ) { page . addBrowserWindowResizeListener ( listener ) ; page . addBrowserWindowResizeListener ( ( event ) -> { } ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 1 , page . count ) |
testCleanEmptyAttributes ( ) { root . attributes = new java . util . HashMap ( ) ; root . cleanEmptyElements ( ) ; "<AssertPlaceHolder>" ; } cleanEmptyElements ( ) { if ( ( ( attributes ) != null ) && ( attributes . isEmpty ( ) ) ) { attributes = null ; } if ( ( elements ) != null ) { for ( com . effektif . workflow . api . bpmn . XmlElement childElement : elements ) { childElement . cleanEmptyElements ( ) ; } if ( elements . isEmpty ( ) ) { elements = null ; } } } | org . junit . Assert . assertNull ( root . attributes ) |
parseArguments_keyonly ( ) { java . util . Map < java . lang . String , java . lang . String > parsed = com . asakusafw . windgate . cli . CommandLineUtil . parseArguments ( "a,b=c" ) . getPairs ( ) ; java . util . Map < java . lang . String , java . lang . String > answer = new java . util . HashMap ( ) ; answer . put ( "b" , "c" ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; } | org . junit . Assert . assertThat ( parsed , is ( answer ) ) |
exportCancel ( ) { final java . lang . String TEST_PROCESS_NAME = "Test<sp>process<sp>name<sp>2" ; createProcessModel ( TEST_PROCESS_NAME ) ; try { clickProcessModel ( TEST_PROCESS_NAME ) ; clickMenuBar ( "File" ) ; clickMenuItem ( "Export" ) ; delay ( ) ; driver . findElement ( org . apromore . portal . uitest . By . xpath ( ( ( EXPORT_DIALOG_XPATH ) + "//button[text()='<sp>Cancel']" ) ) ) . click ( ) ; delay ( ) ; "<AssertPlaceHolder>" ; } finally { deleteProcessModel ( TEST_PROCESS_NAME ) ; } } isElementPresent ( org . apromore . portal . uitest . By ) { try { driver . findElement ( by ) ; return true ; } catch ( org . apromore . portal . uitest . NoSuchElementException e ) { return false ; } } | org . junit . Assert . assertFalse ( isElementPresent ( org . apromore . portal . uitest . By . xpath ( EXPORT_DIALOG_XPATH ) ) ) |
bug48325 ( ) { org . apache . poi . ss . usermodel . Workbook wb = _testDataProvider . createWorkbook ( ) ; org . apache . poi . ss . usermodel . Sheet sheet = wb . createSheet ( "Test" ) ; trackColumnsForAutoSizingIfSXSSF ( sheet ) ; org . apache . poi . ss . usermodel . CreationHelper factory = wb . getCreationHelper ( ) ; org . apache . poi . ss . usermodel . Row row = sheet . createRow ( 0 ) ; org . apache . poi . ss . usermodel . Cell cell = row . createCell ( 0 ) ; org . apache . poi . ss . usermodel . Font font = wb . createFont ( ) ; org . apache . poi . ss . usermodel . RichTextString rts = factory . createRichTextString ( "" ) ; rts . applyFont ( font ) ; cell . setCellValue ( rts ) ; sheet . autoSizeColumn ( 0 ) ; "<AssertPlaceHolder>" ; wb . close ( ) ; } writeOutAndReadBack ( org . apache . poi . poifs . filesystem . POIFSFileSystem ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; original . writeFilesystem ( baos ) ; return new org . apache . poi . poifs . filesystem . POIFSFileSystem ( new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ) ; } | org . junit . Assert . assertNotNull ( _testDataProvider . writeOutAndReadBack ( wb ) ) |
testGlobalEdgeUniqueConstraint ( ) { "<AssertPlaceHolder>" ; com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition < java . lang . String > definition = new com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition ( com . puresoltechnologies . ductiledb . core . graph . ElementType . EDGE , "property" , java . lang . String . class , UniqueConstraint . GLOBAL ) ; com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . schemaManager . defineProperty ( definition ) ; java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( "property" , "value" ) ; try { com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex1 = com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . addVertex ( ) ; com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex2 = com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . addVertex ( ) ; com . puresoltechnologies . ductiledb . core . graph . DuctileDBVertex vertex3 = com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . addVertex ( ) ; vertex1 . addEdge ( "type1" , vertex2 , properties ) ; vertex2 . addEdge ( "type2" , vertex3 , properties ) ; } finally { com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . graph . rollback ( ) ; } } getPropertyDefinition ( com . puresoltechnologies . ductiledb . core . graph . ElementType , java . lang . String ) { try { com . puresoltechnologies . ductiledb . bigtable . BigTable table = namespace . getTable ( DatabaseTable . PROPERTY_DEFINITIONS . getName ( ) ) ; com . puresoltechnologies . ductiledb . bigtable . Get get = new com . puresoltechnologies . ductiledb . bigtable . Get ( com . puresoltechnologies . ductiledb . logstore . Key . of ( propertyKey ) ) ; com . puresoltechnologies . ductiledb . logstore . Key columnFamily = null ; switch ( elementType ) { case VERTEX : columnFamily = DatabaseColumnFamily . VERTEX_DEFINITION . getKey ( ) ; break ; case EDGE : columnFamily = DatabaseColumnFamily . EDGE_DEFINITION . getKey ( ) ; break ; default : throw new com . puresoltechnologies . ductiledb . core . graph . manager . DuctileDBSchemaManagerException ( ( ( "Cannot<sp>read<sp>property<sp>for<sp>element<sp>'" + elementType ) + "'." ) ) ; } get . addFamily ( columnFamily ) ; com . puresoltechnologies . ductiledb . bigtable . Result result = table . get ( get ) ; if ( result == null ) { return null ; } java . util . NavigableMap < com . puresoltechnologies . ductiledb . logstore . Key , com . puresoltechnologies . ductiledb . columnfamily . ColumnValue > familyMap = result . getFamilyMap ( columnFamily ) ; if ( familyMap == null ) { return null ; } @ com . puresoltechnologies . ductiledb . core . graph . schema . SuppressWarnings ( "unchecked" ) java . lang . Class < T > type = ( ( java . lang . Class < T > ) ( java . lang . Class . forName ( familyMap . get ( GraphSchema . PROPERTY_TYPE_KEY ) . toString ( ) ) ) ) ; com . puresoltechnologies . ductiledb . core . graph . schema . UniqueConstraint unique = com . puresoltechnologies . ductiledb . core . graph . schema . UniqueConstraint . valueOf ( familyMap . get ( GraphSchema . UNIQUENESS_COLUMN_KEY ) . toString ( ) ) ; com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition < T > definition = new com . puresoltechnologies . ductiledb . core . graph . schema . PropertyDefinition ( elementType , propertyKey , type , unique ) ; return definition ; } catch ( java . lang . ClassNotFoundException e ) { throw new com . puresoltechnologies . ductiledb . core . graph . manager . DuctileDBSchemaManagerException ( "Could<sp>not<sp>read<sp>property<sp>names." , e ) ; } catch ( com . puresoltechnologies . ductiledb . storage . api . StorageException e ) { throw new com . puresoltechnologies . ductiledb . core . graph . manager . DuctileDBGraphManagerException ( "Could<sp>not<sp>read<sp>property<sp>definition." , e ) ; } } | org . junit . Assert . assertNull ( com . puresoltechnologies . ductiledb . core . graph . schema . DuctileDBSchemaManagerIT . schemaManager . getPropertyDefinition ( ElementType . EDGE , "property" ) ) |
testEmptyTargetedSequencingCompatibility ( ) { uk . ac . bbsrc . tgac . miso . core . data . impl . TargetedSequencing ts = new uk . ac . bbsrc . tgac . miso . core . data . impl . TargetedSequencing ( ) ; addTargetedSequencing ( ts , library ) ; "<AssertPlaceHolder>" ; } isTargetedSequencingCompatible ( uk . ac . bbsrc . tgac . miso . core . data . impl . TargetedSequencing , uk . ac . bbsrc . tgac . miso . core . data . Library ) { return library . getKitDescriptor ( ) . getTargetedSequencing ( ) . contains ( ts ) ; } | org . junit . Assert . assertTrue ( service . isTargetedSequencingCompatible ( ts , library ) ) |
asListWithNoArguments ( ) { java . util . List l = java . util . Arrays . asList ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return model . size ( ) ; } | org . junit . Assert . assertSame ( 0 , l . size ( ) ) |
testSetMappingName ( ) { org . pentaho . hbase . shim . api . HBaseValueMeta hbMeta = getHBaseValueMeta ( ) ; hbMeta . setMappingName ( "test" ) ; "<AssertPlaceHolder>" ; } setMappingName ( java . lang . String ) { m_mappingName = mappingName ; } | org . junit . Assert . assertEquals ( "test" , hbMeta . m_mappingName ) |
_ignoresEmptyExamplesDuringExampleRuns ( ) { final java . lang . String spec = "\r\n\t\t\tpackage<sp>bootstrap\r\n\r\n\t\t\timport<sp>org.junit.*\r\n\r\n\t\t\tdescribe<sp>\"Pending\"<sp>{\r\n\r\n\t\t\t\tfact<sp>\"has<sp>no<sp>implementation<sp>in<sp>block<sp>expression\"{\r\n\t\t\t\t}<sp>\r\n\t\t\t\t\r\n\t\t\t\tfact<sp>\"has<sp>no<sp>body\"\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t" ; org . junit . runner . Result _execute = this . _behaviorExecutor . execute ( spec ) ; org . hamcrest . Matcher < org . junit . runner . Result > _ignoreCountIs = org . jnario . jnario . test . util . ResultMatchers . ignoreCountIs ( 2 ) ; "<AssertPlaceHolder>" ; } ignoreCountIs ( int ) { return new org . junit . internal . matchers . TypeSafeMatcher < org . junit . runner . Result > ( ) { public void describeTo ( org . hamcrest . Description description ) { description . appendText ( ( ( "has<sp>" + count ) + "<sp>ignored<sp>tests" ) ) ; } @ org . jnario . jnario . test . util . Override public boolean matchesSafely ( org . junit . runner . Result item ) { return ( item . getIgnoreCount ( ) ) == count ; } } ; } | org . junit . Assert . < org . junit . runner . Result > assertThat ( _execute , _ignoreCountIs ) |
getEnd_nonEmptyPath_returnsLastElement ( ) { java . lang . String lastElement = "last" ; path = createPath ( "first" , "some" , lastElement ) ; java . util . Optional < java . lang . String > end = path . getEnd ( ) ; "<AssertPlaceHolder>" ; } getEnd ( ) { return java . util . Optional . ofNullable ( path . peek ( ) ) ; } | org . junit . Assert . assertSame ( lastElement , end . get ( ) ) |
testToString ( ) { org . finra . herd . tools . common . databridge . HttpErrorResponseException testHttpErrorResponseException = new org . finra . herd . tools . common . databridge . HttpErrorResponseException ( testMessage , testStatusCode , testStatusDescription , testResponseMessage ) ; java . lang . String expectedHttpErrorResponseExceptionString = java . lang . String . format ( "Message:<sp>%s,<sp>Status<sp>Code:<sp>%d,<sp>Status<sp>Description:<sp>%s,<sp>Response<sp>Message:<sp>%s" , testMessage , testStatusCode , testStatusDescription , testResponseMessage ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder stringBuilder = new java . lang . StringBuilder ( ) ; addTextToString ( ( "Message:<sp>" + ( getMessage ( ) ) ) , stringBuilder ) ; addTextToString ( ( "Status<sp>Code:<sp>" + ( statusCode ) ) , stringBuilder ) ; addTextToString ( ( "Status<sp>Description:<sp>" + ( statusDescription ) ) , stringBuilder ) ; addTextToString ( ( "Response<sp>Message:<sp>" + ( responseMessage ) ) , stringBuilder ) ; return stringBuilder . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedHttpErrorResponseExceptionString , testHttpErrorResponseException . toString ( ) ) |
testGoToLastEvent ( ) { fixture . goToLastEvent ( ) ; long ts1 = getTimestamp ( ) ; long ts2 = fixture . getEndTime ( ) ; "<AssertPlaceHolder>" ; } getEndTime ( ) { return fEnd ; } | org . junit . Assert . assertEquals ( ts1 , ts2 ) |
testFromEbXML ( ) { transformer . toEbXML ( query , ebXML ) ; org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindFoldersForMultiplePatientsQuery result = new org . openehealth . ipf . commons . ihe . xds . core . requests . query . FindFoldersForMultiplePatientsQuery ( ) ; transformer . fromEbXML ( result , ebXML ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . requests . query . GetAllQuery , org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLAdhocQueryRequest ) { if ( ( query == null ) || ( ebXML == null ) ) { return ; } org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper slots = new org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . QuerySlotHelper ( ebXML ) ; java . lang . String patientId = slots . toString ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . PATIENT_ID ) ; query . setPatientId ( org . openehealth . ipf . commons . ihe . xds . core . metadata . Hl7v2Based . parse ( patientId , org . openehealth . ipf . commons . ihe . xds . core . metadata . Identifiable . class ) ) ; query . setStatusDocuments ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_STATUS ) ) ; query . setStatusFolders ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . FOLDER_STATUS ) ) ; query . setStatusSubmissionSets ( slots . toStatus ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . SUBMISSION_SET_STATUS ) ) ; query . setConfidentialityCodes ( slots . toCodeQueryList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE , org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_CONFIDENTIALITY_CODE_SCHEME ) ) ; query . setFormatCodes ( slots . toCodeList ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_FORMAT_CODE ) ) ; query . setHomeCommunityId ( ebXML . getHome ( ) ) ; query . setDocumentEntryTypes ( slots . toDocumentEntryType ( org . openehealth . ipf . commons . ihe . xds . core . transform . requests . query . DOC_ENTRY_TYPE ) ) ; } | org . junit . Assert . assertEquals ( query , result ) |
resultShouldBeOneWhenOnlyOneActorAndNoInitiator ( ) { org . bonitasoft . engine . core . process . definition . model . SActorDefinition initiator = mock ( org . bonitasoft . engine . core . process . definition . model . SActorDefinition . class ) ; when ( org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . definition . getActorInitiator ( ) ) . thenReturn ( null ) ; when ( org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . definition . getActors ( ) ) . thenReturn ( java . util . Collections . singleton ( initiator ) ) ; org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . getNumberOfActors . execute ( ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return number ; } | org . junit . Assert . assertThat ( org . bonitasoft . engine . api . impl . transaction . GetNumberOfActorsTest . getNumberOfActors . getResult ( ) , org . hamcrest . core . Is . is ( 1 ) ) |
testForCorrectSeparatorBytes4 ( ) { java . lang . Object [ ] o1 = new java . lang . Object [ ] { "a" , "b" , null } ; java . lang . Object [ ] o2 = new java . lang . Object [ ] { null , "c" , "d" , "e" } ; org . apache . phoenix . schema . types . PDataType type = org . apache . phoenix . schema . types . PVarcharArray . INSTANCE ; org . apache . phoenix . schema . types . PDataType base = org . apache . phoenix . schema . types . PVarchar . INSTANCE ; org . apache . phoenix . schema . types . PhoenixArray arr1 = new org . apache . phoenix . schema . types . PhoenixArray ( base , o1 ) ; org . apache . phoenix . schema . types . PhoenixArray arr2 = new org . apache . phoenix . schema . types . PhoenixArray ( base , o2 ) ; org . apache . phoenix . expression . LiteralExpression array1Literal ; org . apache . phoenix . expression . LiteralExpression array2Literal ; array1Literal = org . apache . phoenix . expression . LiteralExpression . newConstant ( arr1 , type , null , null , SortOrder . ASC , Determinism . ALWAYS ) ; array2Literal = org . apache . phoenix . expression . LiteralExpression . newConstant ( arr2 , type , null , null , SortOrder . DESC , Determinism . ALWAYS ) ; java . util . List < org . apache . phoenix . expression . Expression > expressions = com . google . common . collect . Lists . newArrayList ( ( ( org . apache . phoenix . expression . Expression ) ( array1Literal ) ) ) ; expressions . add ( array2Literal ) ; org . apache . phoenix . expression . Expression arrayConcatFunction = new org . apache . phoenix . expression . function . ArrayConcatFunction ( expressions ) ; org . apache . hadoop . hbase . io . ImmutableBytesWritable ptr = new org . apache . hadoop . hbase . io . ImmutableBytesWritable ( ) ; arrayConcatFunction . evaluate ( null , ptr ) ; byte [ ] expected = new byte [ ] { 97 , 0 , 98 , 0 , 0 , - 2 , 99 , 0 , 100 , 0 , 101 , 0 , 0 , 0 , - 128 , 1 , - 128 , 3 , - 128 , 5 , - 128 , 5 , - 128 , 7 , - 128 , 9 , - 128 , 11 , 0 , 0 , 0 , 14 , 0 , 0 , 0 , 7 , 1 } ; "<AssertPlaceHolder>" ; } get ( ) { return this . tableName ; } | org . junit . Assert . assertArrayEquals ( expected , ptr . get ( ) ) |
testEnumBean ( ) { defaultContext ( ) ; org . apache . cxf . aegis . type . basic . BeanType type = new org . apache . cxf . aegis . type . basic . BeanType ( ) ; type . setTypeClass ( org . apache . cxf . aegis . type . basic . BeanTest . EnumBean . class ) ; type . setTypeMapping ( mapping ) ; type . setSchemaType ( new javax . xml . namespace . QName ( "urn:foo" , "EnumBean" ) ) ; "<AssertPlaceHolder>" ; } getDependencies ( ) { org . apache . cxf . aegis . type . AegisType stringType = getTypeMapping ( ) . getType ( java . lang . String . class ) ; return java . util . Collections . singleton ( stringType ) ; } | org . junit . Assert . assertTrue ( type . getDependencies ( ) . isEmpty ( ) ) |
testGetSecond ( ) { double recall = 0.2 ; gov . sandia . cognition . text . evaluation . DefaultPrecisionRecallPair instance = new gov . sandia . cognition . text . evaluation . DefaultPrecisionRecallPair ( ) ; instance . setRecall ( recall ) ; "<AssertPlaceHolder>" ; } getSecond ( ) { return this . getY ( ) ; } | org . junit . Assert . assertEquals ( recall , instance . getSecond ( ) , 0.0 ) |
validate_idTagInfoIsNotSetAndTransactionIdIsSet_returnFalse ( ) { confirmation . setTransactionId ( 42 ) ; boolean isValid = confirmation . validate ( ) ; "<AssertPlaceHolder>" ; } validate ( ) { return true ; } | org . junit . Assert . assertThat ( isValid , org . hamcrest . CoreMatchers . is ( false ) ) |
testGml2Wkt ( ) { java . lang . String queryStr = "PREFIX<sp>fn:<sp><http://jsa.aksw.org/fn/gml/><sp>SELECT<sp>?g<sp>{<sp>BIND(fn:gml2Wkt('<gml:LineString><gml:coordinates>6.8,5.3<sp>6.1,5.1</gml:coordinates></gml:LineString>')<sp>AS<sp>?g)<sp>}" ; java . lang . String [ ] tmpActual = new java . lang . String [ ] { null } ; org . apache . jena . query . QueryExecutionFactory . create ( queryStr , org . apache . jena . rdf . model . ModelFactory . createDefaultModel ( ) ) . execSelect ( ) . forEachRemaining ( ( qs ) -> tmpActual [ 0 ] = qs . get ( "g" ) . asNode ( ) . getLiteralLexicalForm ( ) ) ; java . lang . String actual = tmpActual [ 0 ] ; java . lang . String expected = "LINESTRING<sp>(6.8<sp>5.3,<sp>6.1<sp>5.1)" ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { java . lang . Object result = ( key instanceof java . lang . String ) ? ctx . get ( ( ( java . lang . String ) ( key ) ) ) : null ; return result ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testStart_Class_Not_Found_Binder_With_Parent ( ) { java . lang . String binder = "com.englishtown.INVALID_BINDER" ; config . put ( "guice_binder" , binder ) ; java . lang . String main = com . englishtown . vertx . guice . integration . DependencyInjectionVerticle . class . getName ( ) ; doTest ( main ) ; verifyZeroInteractions ( com . englishtown . vertx . guice . GuiceVerticleLoaderTest . logger ) ; "<AssertPlaceHolder>" ; } getModules ( ) { return com . google . common . collect . Lists . newArrayList ( modulesCaptor . getValue ( ) ) ; } | org . junit . Assert . assertEquals ( 1 , getModules ( ) . size ( ) ) |
testReturnVoid ( ) { runAllExcept ( "control/Return" , "returnVoid" , io . vertx . codetrans . lang . scala . ScalaLang . class , ( ) -> { "<AssertPlaceHolder>" ; io . vertx . codetrans . ControlTest . o = null ; } ) ; } runAllExcept ( java . lang . String , java . lang . String , java . lang . Class , java . lang . Runnable ) { runAll ( path , method , io . vertx . codetrans . Collections . emptyMap ( ) , io . vertx . codetrans . Collections . singletonList ( except ) , after ) ; } | org . junit . Assert . assertNull ( io . vertx . codetrans . ControlTest . o ) |
testToListFromList ( ) { com . orientechnologies . orient . core . metadata . schema . ArrayList < java . lang . Object > list = new com . orientechnologies . orient . core . metadata . schema . ArrayList < java . lang . Object > ( ) ; list . add ( 1 ) ; list . add ( "2" ) ; java . lang . Object result = com . orientechnologies . orient . core . metadata . schema . OType . convert ( list , com . orientechnologies . orient . core . metadata . schema . List . class ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . Object , java . lang . Class ) { if ( iValue == null ) return null ; if ( iTargetClass == null ) return iValue ; if ( iValue . getClass ( ) . equals ( iTargetClass ) ) return iValue ; if ( iTargetClass . isAssignableFrom ( iValue . getClass ( ) ) ) return iValue ; try { if ( ( iValue instanceof com . orientechnologies . common . types . OBinary ) && ( iTargetClass . isAssignableFrom ( byte [ ] . class ) ) ) return ( ( com . orientechnologies . common . types . OBinary ) ( iValue ) ) . toByteArray ( ) ; else if ( byte [ ] . class . isAssignableFrom ( iTargetClass ) ) { return com . orientechnologies . orient . core . serialization . serializer . OStringSerializerHelper . getBinaryContent ( iValue ) ; } else if ( byte [ ] . class . isAssignableFrom ( iValue . getClass ( ) ) ) { return iValue ; } else if ( iTargetClass . isEnum ( ) ) { if ( iValue instanceof java . lang . Number ) return ( ( java . lang . Class < java . lang . Enum > ) ( iTargetClass ) ) . getEnumConstants ( ) [ ( ( java . lang . Number ) ( iValue ) ) . intValue ( ) ] ; return java . lang . Enum . valueOf ( ( ( java . lang . Class < java . lang . Enum > ) ( iTargetClass ) ) , iValue . toString ( ) ) ; } else if ( ( iTargetClass . equals ( Byte . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Byte . class ) ) ) { if ( iValue instanceof java . lang . Byte ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Byte . parseByte ( ( ( java . lang . String ) ( iValue ) ) ) ; else return ( ( java . lang . Number ) ( iValue ) ) . byteValue ( ) ; } else if ( ( iTargetClass . equals ( Short . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Short . class ) ) ) { if ( iValue instanceof java . lang . Short ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Short . parseShort ( ( ( java . lang . String ) ( iValue ) ) ) ; else return ( ( java . lang . Number ) ( iValue ) ) . shortValue ( ) ; } else if ( ( iTargetClass . equals ( Integer . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Integer . class ) ) ) { if ( iValue instanceof java . lang . Integer ) return iValue ; else if ( iValue instanceof java . lang . String ) { if ( iValue . toString ( ) . equals ( "" ) ) { return null ; } return java . lang . Integer . parseInt ( ( ( java . lang . String ) ( iValue ) ) ) ; } else return ( ( java . lang . Number ) ( iValue ) ) . intValue ( ) ; } else if ( ( iTargetClass . equals ( Long . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Long . class ) ) ) { if ( iValue instanceof java . lang . Long ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Long . parseLong ( ( ( java . lang . String ) ( iValue ) ) ) ; else if ( iValue instanceof java . util . Date ) return ( ( java . util . Date ) ( iValue ) ) . getTime ( ) ; else return ( ( java . lang . Number ) ( iValue ) ) . longValue ( ) ; } else if ( ( iTargetClass . equals ( Float . TYPE ) ) || ( iTargetClass . equals ( com . orientechnologies . orient . core . metadata . schema . Float . class ) ) ) { if ( iValue instanceof java . lang . Float ) return iValue ; else if ( iValue instanceof java . lang . String ) return java . lang . Float . parseFloat ( ( ( java . lang . String ) ( iValue ) ) ) ; else return ( ( java . lang . Number ) ( iValue ) ) . floatValue ( ) ; } else if ( iTargetClass . equals ( java . math . BigDecimal . class ) ) { if ( iValue instanceof java . lang . String ) return new java . math . BigDecimal ( ( ( java . lang | org . junit . Assert . assertEquals ( result , list ) |
testAssociatePolicyGroupToDomain_unknownPolicyGroup_assertException ( ) { boolean exceptionOccured = false ; final javax . persistence . EntityManager mgr = mock ( javax . persistence . EntityManager . class ) ; final org . nhindirect . config . store . Domain domain = mock ( org . nhindirect . config . store . Domain . class ) ; final org . nhindirect . config . store . dao . DomainDao domainDao = mock ( org . nhindirect . config . store . dao . DomainDao . class ) ; when ( domainDao . getDomain ( new java . lang . Long ( 1234 ) ) ) . thenReturn ( domain ) ; final org . nhindirect . config . store . dao . impl . CertPolicyDaoImpl dao = new org . nhindirect . config . store . dao . impl . CertPolicyDaoImpl ( ) ; final javax . persistence . Query query = mock ( javax . persistence . Query . class ) ; doThrow ( new javax . persistence . NoResultException ( ) ) . when ( query ) . getSingleResult ( ) ; when ( mgr . createQuery ( "SELECT<sp>cpg<sp>from<sp>CertPolicyGroup<sp>cpg<sp>WHERE<sp>cpg.id<sp>=<sp>?1" ) ) . thenReturn ( query ) ; dao . setDomainDao ( domainDao ) ; dao . setEntityManager ( mgr ) ; final org . nhindirect . config . store . dao . impl . CertPolicyDaoImpl spyDao = spy ( dao ) ; try { spyDao . associatePolicyGroupToDomain ( 1234 , 5678 ) ; } catch ( org . nhindirect . config . store . ConfigurationStoreException e ) { exceptionOccured = true ; } "<AssertPlaceHolder>" ; verify ( domainDao , times ( 1 ) ) . getDomain ( new java . lang . Long ( 1234 ) ) ; verify ( spyDao , times ( 1 ) ) . getPolicyGroupById ( 5678 ) ; verify ( mgr , never ( ) ) . persist ( ( ( org . nhindirect . config . store . CertPolicyGroupDomainReltn ) ( any ( ) ) ) ) ; } | org . junit . Assert . assertTrue ( exceptionOccured ) |
testBadDbPath ( ) { try { new apps . provisioning . config . ConfigData ( "./test/bad-db-path.properties" ) ; org . junit . Assert . fail ( "An<sp>incorrect<sp>value<sp>was<sp>passed<sp>as<sp>valid." ) ; } catch ( java . io . FileNotFoundException e ) { "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( "An<sp>unexpected<sp>exception<sp>was<sp>thrown." ) ; } } | org . junit . Assert . assertTrue ( true ) |
beanBinder_nullRepresentationIsNotDisabled ( ) { com . vaadin . flow . data . binder . Binder < com . vaadin . flow . tests . data . bean . Person > binder = new com . vaadin . flow . data . binder . Binder ( com . vaadin . flow . tests . data . bean . Person . class ) ; binder . forField ( nameField ) . bind ( "firstName" ) ; com . vaadin . flow . tests . data . bean . Person person = new com . vaadin . flow . tests . data . bean . Person ( ) ; binder . setBean ( person ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( "" , nameField . getValue ( ) ) |
size ( ) { "<AssertPlaceHolder>" ; } size ( ) { int size = 0 ; for ( java . util . Enumeration < ? > e = request . getAttributeNames ( ) ; e . hasMoreElements ( ) ; e . nextElement ( ) ) { size ++ ; } return size ; } | org . junit . Assert . assertThat ( map . size ( ) , org . hamcrest . CoreMatchers . is ( 2 ) ) |
testShutdownInputThrowsIOException ( ) { io . sniffy . socket . IOException expected = new io . sniffy . socket . IOException ( ) ; when ( delegate , "shutdownInput" ) . thenThrow ( expected ) ; try { sniffySocket . shutdownInput ( ) ; org . junit . Assert . fail ( ) ; } catch ( io . sniffy . socket . IOException actual ) { "<AssertPlaceHolder>" ; } verifyPrivate ( delegate ) . invoke ( "shutdownInput" ) ; verifyNoMoreInteractions ( delegate ) ; } shutdownInput ( ) { copyToDelegate ( ) ; long start = java . lang . System . currentTimeMillis ( ) ; try { io . sniffy . socket . SnifferSocketImpl . method ( "shutdownInput" ) . invoke ( delegate ) ; } catch ( java . lang . Exception e ) { io . sniffy . util . ExceptionUtil . processException ( e ) ; } finally { logSocket ( ( ( java . lang . System . currentTimeMillis ( ) ) - start ) ) ; copyFromDelegate ( ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetCategoriesSync ( ) { try { java . lang . String jsonString = com . simplegeo . client . SimpleGeoPlacesClientTest . client . getCategories ( ) ; org . json . JSONArray json = new org . json . JSONArray ( jsonString ) ; "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } catch ( org . json . JSONException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getCategories ( ) { return this . execute ( this . getEndpoint ( "categories" ) , HttpRequestMethod . GET , null , "" ) ; } | org . junit . Assert . assertTrue ( ( ( json . length ( ) ) > 0 ) ) |
testUpdateUserNamespaceAuthorizationLowerCaseParameters ( ) { org . springframework . security . core . Authentication originalAuthentication = overrideSecurityContext ( ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey key = new org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ( USER_ID , NAMESPACE ) ; org . finra . herd . model . jpa . UserNamespaceAuthorizationEntity userNamespaceAuthorizationEntity = userNamespaceAuthorizationDaoTestHelper . createUserNamespaceAuthorizationEntity ( key , java . util . Arrays . asList ( NamespacePermissionEnum . READ , NamespacePermissionEnum . WRITE ) ) ; org . finra . herd . model . api . xml . UserNamespaceAuthorization resultUserNamespaceAuthorization = userNamespaceAuthorizationService . updateUserNamespaceAuthorization ( new org . finra . herd . model . api . xml . UserNamespaceAuthorizationKey ( key . getUserId ( ) . toLowerCase ( ) , key . getNamespace ( ) . toLowerCase ( ) ) , new org . finra . herd . model . api . xml . UserNamespaceAuthorizationUpdateRequest ( SUPPORTED_NAMESPACE_PERMISSIONS ) ) ; "<AssertPlaceHolder>" ; restoreSecurityContext ( originalAuthentication ) ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . UserNamespaceAuthorization ( userNamespaceAuthorizationEntity . getId ( ) , key , SUPPORTED_NAMESPACE_PERMISSIONS ) , resultUserNamespaceAuthorization ) |
allowStringAsBinaryResponseBody ( ) { final org . apache . oltu . oauth2 . client . response . OAuthResourceResponse resp = createBinaryResponse ( org . apache . oltu . oauth2 . client . response . OAuthResourceResponseTest . STRING_BYTES ) ; final byte [ ] bytes = org . apache . commons . io . IOUtils . toByteArray ( resp . getBodyAsInputStream ( ) ) ; "<AssertPlaceHolder>" ; } getBodyAsInputStream ( ) { if ( ( bodyRetrieved ) && ( ( inputStream ) == null ) ) { throw new java . lang . IllegalStateException ( "Cannot<sp>call<sp>getBodyAsInputStream()<sp>after<sp>getBody()" ) ; } bodyRetrieved = true ; return inputStream ; } | org . junit . Assert . assertArrayEquals ( org . apache . oltu . oauth2 . client . response . OAuthResourceResponseTest . STRING_BYTES , bytes ) |
testCtfIterator_noinit ( ) { try ( org . eclipse . tracecompass . internal . tmf . ctf . core . trace . iterator . CtfIterator result = ( ( org . eclipse . tracecompass . internal . tmf . ctf . core . trace . iterator . CtfIterator ) ( trace . createIterator ( ) ) ) ) { "<AssertPlaceHolder>" ; } } createIterator ( ) { try { return new org . eclipse . tracecompass . internal . tmf . ctf . core . trace . iterator . CtfIterator ( fTrace , this ) ; } catch ( org . eclipse . tracecompass . ctf . core . CTFException e ) { org . eclipse . tracecompass . internal . tmf . ctf . core . Activator . getDefault ( ) . logError ( e . getMessage ( ) , e ) ; } return null ; } | org . junit . Assert . assertNotNull ( result ) |
testDouble ( ) { int x = 10 ; double theValue ; if ( x > 10 ) { theValue = - 10 ; } else { theValue = - 20 ; } "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( ( - 20 ) , theValue , 0 ) |
get_Existing_NotSameKey ( ) { java . lang . Long existingKey = java . lang . System . currentTimeMillis ( ) ; java . lang . String existingValue = "value" + existingKey ; cache . put ( existingKey , existingValue ) ; "<AssertPlaceHolder>" ; } get ( K ) { return writtenKeys . get ( key ) ; } | org . junit . Assert . assertEquals ( existingValue , cache . get ( new java . lang . Long ( existingKey ) ) ) |
testBadKeyAlias ( ) { java . util . Map < java . lang . String , java . lang . String > overrides = getOverridesForEncryption ( ) ; overrides . put ( ( ( ( EncryptionConfiguration . ENCRYPTION_PREFIX ) + "." ) + ( EncryptionConfiguration . ACTIVE_KEY ) ) , "invalid" ) ; channel = org . apache . flume . channel . file . TestUtils . createFileChannel ( checkpointDir . getAbsolutePath ( ) , dataDir , overrides ) ; channel . start ( ) ; "<AssertPlaceHolder>" ; } isOpen ( ) { return open ; } | org . junit . Assert . assertFalse ( channel . isOpen ( ) ) |
whenCheckingListSize_ThenSizeEqualsToInit ( ) { com . baeldung . migration . junit4 . BeforeAndAfterAnnotationsUnitTest . LOG . info ( "executing<sp>test" ) ; "<AssertPlaceHolder>" ; list . add ( "another<sp>test" ) ; } size ( ) { return internal . length ; } | org . junit . Assert . assertEquals ( 2 , list . size ( ) ) |
testRemovesValue ( ) { com . eclipsesource . tabris . internal . ClientStoreImpl store = new com . eclipsesource . tabris . internal . ClientStoreImpl ( ) ; store . add ( "foo" , "bar" ) ; store . remove ( "foo" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { whenNull ( shortcut ) . throwIllegalArgument ( "shortcut<sp>must<sp>not<sp>be<sp>null" ) ; when ( shortcut . isEmpty ( ) ) . throwIllegalArgument ( "shortcut<sp>must<sp>not<sp>be<sp>empty" ) ; org . eclipse . rap . json . JsonValue jsonValue = data . get ( shortcut ) ; if ( jsonValue != null ) { return jsonValue . asString ( ) ; } return null ; } | org . junit . Assert . assertNull ( store . get ( "foo" ) ) |
getCreatorTest ( ) { org . w3c . dom . Document dom = documentBuilder . parse ( new org . xml . sax . InputSource ( new java . io . StringReader ( ( ( "<creator><creatorName>" + ( c2 . getCreatorName ( ) ) ) + "</creatorName></creator>" ) ) ) ) ; org . w3c . dom . Element creator = ( ( org . w3c . dom . Element ) ( dom . getElementsByTagName ( org . sagebionetworks . doi . datacite . DataciteMetadataConstants . CREATOR ) . item ( 0 ) ) ) ; "<AssertPlaceHolder>" ; } getCreator ( org . w3c . dom . Element ) { org . sagebionetworks . repo . model . doi . v2 . DoiCreator creator = new org . sagebionetworks . repo . model . doi . v2 . DoiCreator ( ) ; creator . setCreatorName ( creatorElement . getElementsByTagNameNS ( "*" , org . sagebionetworks . doi . datacite . DataciteMetadataConstants . CREATOR_NAME ) . item ( 0 ) . getTextContent ( ) ) ; org . w3c . dom . NodeList idNodes = creatorElement . getElementsByTagNameNS ( "*" , org . sagebionetworks . doi . datacite . DataciteMetadataConstants . NAME_IDENTIFIER ) ; if ( ( idNodes . getLength ( ) ) > 0 ) { java . util . List < org . sagebionetworks . repo . model . doi . v2 . DoiNameIdentifier > ids = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < ( idNodes . getLength ( ) ) ; i ++ ) { org . sagebionetworks . repo . model . doi . v2 . DoiNameIdentifier id = org . sagebionetworks . doi . datacite . DataciteXmlTranslatorImpl . getNameIdentifier ( ( ( org . w3c . dom . Element ) ( idNodes . item ( i ) ) ) ) ; ids . add ( id ) ; } creator . setNameIdentifiers ( ids ) ; } return creator ; } | org . junit . Assert . assertEquals ( c2 , org . sagebionetworks . doi . datacite . DataciteXmlTranslatorImpl . getCreator ( creator ) ) |
manageModificationProcess_VSYSTEM_CREATING ( ) { paramHandler . getIaasContext ( ) . setVSystemStatus ( org . oscm . app . iaas . VSystemProcessorBeanTest . NORMAL ) ; doReturn ( Boolean . TRUE ) . when ( vSystemProcessor . vsysComm ) . startAllEFMs ( paramHandler ) ; org . oscm . app . iaas . data . FlowState newState = vSystemProcessor . manageModificationProcess ( org . oscm . app . iaas . VSystemProcessorBeanTest . CONTROLLER_ID , org . oscm . app . iaas . VSystemProcessorBeanTest . INSTANCE_ID , paramHandler , FlowState . VSYSTEM_CREATING ) ; "<AssertPlaceHolder>" ; } manageModificationProcess ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState ) { boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; org . oscm . app . iaas . data . FlowState newState = null ; org . oscm . app . iaas . data . FlowState targetState = null ; boolean skipUpdateFW = false ; boolean skipWaitForUpdateFW = false ; switch ( flowState ) { case VSYSTEM_CREATION_REQUESTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSYSTEM_CREATING , paramHandler ) ) { vsysComm . createVSystem ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSYSTEM_CREATING ; } break ; case VSYSTEM_CREATING : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVERS_STARTING , paramHandler ) ) ) { if ( vsysComm . startAllEFMs ( paramHandler ) ) { vsysComm . startAllVServers ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVERS_STARTING ; } } break ; case VSERVERS_STARTING : if ( vsysComm . getCombinedVServerState ( paramHandler , VServerStatus . RUNNING ) ) { targetState = checkConfiguredServers ( controllerId , instanceId , paramHandler ) ; if ( targetState == null ) { targetState = checkNetworkSettings ( paramHandler ) ; } if ( targetState == null ) { targetState = determineScalingAndSizing ( paramHandler ) ; } if ( checkNextStatus ( controllerId , instanceId , targetState , paramHandler ) ) { newState = targetState ; } } break ; case VSYSTEM_MODIFICATION_REQUESTED : case VSYSTEM_SUBPROCESS_SERVERS : targetState = checkConfiguredServers ( controllerId , instanceId , paramHandler ) ; skipWaitForUpdateFW = true ; case VSYSTEM_UPDATE_FW_WAITING : if ( ! skipWaitForUpdateFW ) { if ( ! vSysInNormalState ) { break ; } skipUpdateFW = true ; } case VSYSTEM_UPDATE_FW : if ( ( targetState == null ) && ( ! skipUpdateFW ) ) { targetState = checkNetworkSettings ( paramHandler ) ; } if ( targetState == null ) { targetState = determineScalingAndSizing ( paramHandler ) ; } if ( checkNextStatus ( controllerId , instanceId , targetState , paramHandler ) ) { newState = targetState ; } break ; case VSYSTEM_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVSystemManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; default : } newState = manageScaling ( controllerId , instanceId , paramHandler , flowState , newState ) ; if ( FlowState . FINISHED . equals ( newState ) ) { paramHandler . resetTouchedVservers ( ) ; } return newState ; } | org . junit . Assert . assertEquals ( FlowState . VSERVERS_STARTING , newState ) |
testGetInOneWorkerWithConditionThatDoesNotMatch2 ( ) { System . out . println ( "===><sp>Test<sp>started<sp><===" ) ; org . ourgrid . system . units . BrokerUnit brokerUnit = new org . ourgrid . system . units . BrokerUnit ( org . ourgrid . system . units . BrokerUnit . BROKER_PROPERTIES_FILENAME , 1 ) ; unitManager . addUnit ( brokerUnit ) ; brokerUnit . setMaxFails ( 1 ) ; brokerUnit . setNumberOfReplicaExecutors ( 1 ) ; System . out . println ( "===><sp>WorkerUnit<sp>created<sp><===" 2 ) ; org . ourgrid . system . units . WorkerUnit workerUnit = unitManager . buildNewUnit ( org . ourgrid . system . units . WorkerUnit . class ) ; workerUnit . setPlaypenRootPath ( org . ourgrid . system . TEMP_TEST_DIR ) ; workerUnit . setStorageRootPath ( org . ourgrid . system . TEMP_TEST_DIR ) ; System . out . println ( "===><sp>WorkerUnit<sp>created<sp><===" ) ; org . ourgrid . system . units . PeerUnit peerUnit = unitManager . buildNewUnit ( org . ourgrid . system . units . PeerUnit . class ) ; System . out . println ( "===><sp>PeerUnit<sp>created<sp><===" ) ; brokerUnit . initKeys ( ) ; peerUnit . initKeys ( ) ; workerUnit . initKeys ( ) ; System . out . println ( "===><sp>Remote<sp>entities<sp>running<sp>(1<sp>worker,<sp>1<sp>peer,<sp>1<sp>broker)<sp><===" ) ; conditionExpecter . waitUntilConditionIsMet ( new org . ourgrid . system . condition . PeerHasTheWorkerInStateCondition ( peerUnit , workerUnit , org . ourgrid . common . interfaces . to . LocalWorkerState . IDLE ) ) ; System . out . println ( "===><sp>Set<sp>workers<sp><===" ) ; conditionExpecter . waitUntilConditionIsMet ( new org . ourgrid . system . condition . BrokerHasAPeerInTheState ( brokerUnit , peerUnit , PeerTestState . UP ) ) ; System . out . println ( "===><sp>Set<sp>peer<sp><===" ) ; java . io . File putSourceTempFile = org . ourgrid . common . util . TempFileManager . createTempFileWithBogusData ( getClass ( ) . getSimpleName ( ) , "" , tempFileDir , ( 4096 * 10 ) ) ; java . lang . String [ ] putSources = new java . lang . String [ ] { putSourceTempFile . getPath ( ) } ; java . lang . String [ ] playpenDests = new java . lang . String [ ] { putSourceTempFile . getName ( ) } ; java . lang . String [ ] getDests = new java . lang . String [ ] { ( putSourceTempFile . getPath ( ) ) + "_get" } ; java . lang . String [ ] putConditions = new java . lang . String [ ] { "" } ; java . lang . String [ ] getConditions = new java . lang . String [ ] { "os<sp>==<sp>linux" } ; int jobID = brokerUnit . addJob ( org . ourgrid . system . units . UnitUtil . buildASmallSleepJobWithPuts ( 1 , putConditions , putSources , playpenDests , getConditions , getDests ) ) ; System . out . println ( "===><sp>job<sp>added<sp><===" ) ; conditionExpecter . waitUntilConditionIsMet ( new org . ourgrid . system . condition . BrokerJobFinishedCondition ( brokerUnit , jobID ) ) ; System . out . println ( "===><sp>WorkerUnit<sp>created<sp><===" 0 ) ; java . io . File getFile = new java . io . File ( getDests [ 0 ] ) ; "<AssertPlaceHolder>" ; System . out . println ( "===><sp>WorkerUnit<sp>created<sp><===" 1 ) ; } buildASmallSleepJobWithPuts ( int , int , java . lang . String [ ] , java . lang . String [ ] , java . lang . String [ ] , java . lang . String [ ] ) { return org . ourgrid . system . units . UnitUtil . buildASleepJobWithPuts ( tasks , sleep , org . ourgrid . system . units . UnitUtil . createEmptyStringArray ( putSources . length ) , putSources , playpenDests , org . ourgrid . system . units . UnitUtil . createEmptyStringArray ( putSources . length ) , playpenGets , getDests ) ; } | org . junit . Assert . assertFalse ( getFile . exists ( ) ) |
loginFail ( ) { org . apache . activemq . artemis . spi . core . security . jaas . Krb5LoginModule underTest = new org . apache . activemq . artemis . spi . core . security . jaas . Krb5LoginModule ( ) ; final javax . security . auth . Subject subject = new javax . security . auth . Subject ( ) ; underTest . initialize ( subject , new javax . security . auth . callback . CallbackHandler ( ) { @ org . apache . activemq . artemis . spi . core . security . jaas . Override public void handle ( javax . security . auth . callback . Callback [ ] callbacks ) throws java . io . IOException , javax . security . auth . callback . UnsupportedCallbackException { } } , null , null ) ; "<AssertPlaceHolder>" ; } login ( ) { if ( ! ( authenticateUser ) ) { return false ; } javax . security . auth . callback . Callback [ ] callbacks = new javax . security . auth . callback . Callback [ 2 ] ; callbacks [ 0 ] = new javax . security . auth . callback . NameCallback ( "User<sp>name" ) ; callbacks [ 1 ] = new javax . security . auth . callback . PasswordCallback ( "Password" , false ) ; try { handler . handle ( callbacks ) ; } catch ( java . io . IOException | javax . security . auth . callback . UnsupportedCallbackException e ) { throw ( ( javax . security . auth . login . LoginException ) ( new javax . security . auth . login . LoginException ( ) . initCause ( e ) ) ) ; } java . lang . String password = null ; username = ( ( javax . security . auth . callback . NameCallback ) ( callbacks [ 0 ] ) ) . getName ( ) ; if ( ( username ) == null ) return false ; if ( ( ( ( javax . security . auth . callback . PasswordCallback ) ( callbacks [ 1 ] ) ) . getPassword ( ) ) != null ) password = new java . lang . String ( ( ( javax . security . auth . callback . PasswordCallback ) ( callbacks [ 1 ] ) ) . getPassword ( ) ) ; if ( ( password == null ) || ( ( password . length ( ) ) == 0 ) ) throw new javax . security . auth . login . FailedLoginException ( "Password<sp>cannot<sp>be<sp>null<sp>or<sp>empty" ) ; authenticate ( username , password ) ; userAuthenticated = true ; return true ; } | org . junit . Assert . assertFalse ( underTest . login ( ) ) |
sortAlreadyOrdered ( ) { final int [ ] values = new int [ 25000 ] ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { values [ i ] = i ; } final int comparisons = sortData ( values ) ; "<AssertPlaceHolder>" ; } sortData ( int [ ] ) { try ( final com . dremio . sabot . sort . TestSplayTree . SplayTreeImpl tree = new com . dremio . sabot . sort . TestSplayTree . SplayTreeImpl ( values ) ; org . apache . arrow . memory . BufferAllocator allocator = new org . apache . arrow . memory . RootAllocator ( Long . MAX_VALUE ) ; io . netty . buffer . ArrowBuf data = allocator . buffer ( ( ( ( values . length ) + 1 ) * ( com . dremio . sabot . op . sort . external . SplayTree . NODE_SIZE ) ) ) ) { data . setZero ( 0 , data . capacity ( ) ) ; tree . setData ( data ) ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { tree . put ( i ) ; } com . dremio . sabot . op . sort . external . SplayTree . SplayIterator iter = tree . iterator ( ) ; java . lang . Integer previous = null ; while ( iter . hasNext ( ) ) { int index = iter . next ( ) ; if ( previous != null ) { org . junit . Assert . assertTrue ( ( previous <= ( values [ index ] ) ) ) ; } } return tree . getComparisonCount ( ) ; } } | org . junit . Assert . assertTrue ( ( comparisons < ( values . length ) ) ) |
setStyleMultipleRemove ( ) { c . addStyleName ( "foo" ) ; c . setStyleName ( "foo" , false ) ; c . setStyleName ( "foo" , false ) ; "<AssertPlaceHolder>" ; } getStyleName ( ) { return styleName ; } | org . junit . Assert . assertEquals ( "" , c . getStyleName ( ) ) |
depsHaveStripAndDebugFlavorsPropagated ( ) { com . facebook . buck . core . model . BuildTarget bundleTargetWithStripFlavor = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:bundle#iphoneos-x86_64,strip-all,dwarf-and-dsym" ) ; com . facebook . buck . core . model . BuildTarget unflavoredDep = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep1" ) ; com . facebook . buck . core . model . BuildTarget unflavoredDepAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#otherflavor" 1 ) ; com . facebook . buck . core . model . BuildTarget flavoredDep = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep2#iphoneos-i386,strip-debug,dwarf" ) ; com . facebook . buck . core . model . BuildTarget flavoredDepNotInDomain = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#otherflavor" ) ; com . facebook . buck . core . model . BuildTarget flavoredDepNotInDomainAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#iphoneos-x86_64,strip-all,dwarf-and-dsym,otherflavor" ) ; com . facebook . buck . core . model . BuildTarget stripFlavorOnly = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep4#strip-debug" ) ; com . facebook . buck . core . model . BuildTarget stripFlavorOnlyAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep3#otherflavor" 2 ) ; com . facebook . buck . core . model . BuildTarget debugFlavorOnly = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep5#dwarf" ) ; com . facebook . buck . core . model . BuildTarget debugFlavorOnlyAfterPropagation = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:dep5#iphoneos-x86_64,strip-all,dwarf" ) ; com . facebook . buck . core . model . BuildTarget binary = com . facebook . buck . core . model . BuildTargetFactory . newInstance ( "//bar:binary" ) ; com . facebook . buck . apple . AppleBundleDescription desc = FakeAppleRuleDescriptions . BUNDLE_DESCRIPTION ; com . facebook . buck . apple . AppleBundleDescriptionArg constructorArg = com . facebook . buck . apple . AppleBundleDescriptionArg . builder ( ) . setName ( "//bar:dep3#otherflavor" 0 ) . setExtension ( com . facebook . buck . util . types . Either . ofLeft ( AppleBundleExtension . BUNDLE ) ) . setInfoPlist ( com . facebook . buck . core . sourcepath . FakeSourcePath . of ( "Info.plist" ) ) . setBinary ( binary ) . setDeps ( com . google . common . collect . ImmutableSortedSet . < com . facebook . buck . core . model . BuildTarget > naturalOrder ( ) . add ( binary ) . add ( unflavoredDep ) . add ( flavoredDep ) . add ( flavoredDepNotInDomain ) . add ( stripFlavorOnly ) . add ( debugFlavorOnly ) . build ( ) ) . build ( ) ; com . google . common . collect . ImmutableSortedSet . Builder < com . facebook . buck . core . model . BuildTarget > implicitDeps = com . google . common . collect . ImmutableSortedSet . naturalOrder ( ) ; desc . findDepsForTargetFromConstructorArgs ( bundleTargetWithStripFlavor , createCellRoots ( filesystem ) , constructorArg , implicitDeps , com . google . common . collect . ImmutableSortedSet . naturalOrder ( ) ) ; "<AssertPlaceHolder>" ; } add ( com . facebook . buck . android . MergeAndroidResourcesStepTest$RDotTxtFile ) { filesystem . writeLinesToPath ( entry . contents , entry . filePath ) ; filePathToPackageName . put ( entry . filePath , entry . packageName ) ; } | org . junit . Assert . assertEquals ( com . google . common . collect . ImmutableSortedSet . < com . facebook . buck . core . model . BuildTarget > naturalOrder ( ) . add ( unflavoredDepAfterPropagation ) . add ( flavoredDep ) . add ( flavoredDepNotInDomainAfterPropagation ) . add ( stripFlavorOnlyAfterPropagation ) . add ( debugFlavorOnlyAfterPropagation ) . build ( ) , implicitDeps . build ( ) ) |
testCreateAllergiesReactionsSectionBuilder ( ) { org . openhealthtools . mdht . uml . cda . builder . SectionBuilder < org . openhealthtools . mdht . uml . cda . hitsp . AllergiesReactionsSection > sectionBuilder = org . openhealthtools . mdht . uml . cda . hitsp . builder . HITSPBuilderFactory . createAllergiesReactionsSectionBuilder ( ) ; org . openhealthtools . mdht . uml . cda . hitsp . AllergiesReactionsSection section = sectionBuilder . buildSection ( ) ; "<AssertPlaceHolder>" ; Diagnostician . INSTANCE . validate ( section ) ; org . openhealthtools . mdht . uml . cda . util . CDAUtil . saveSnippet ( section , System . out ) ; } buildSection ( ) { org . openhealthtools . mdht . uml . cda . Section section = CDAFactory . eINSTANCE . createSection ( ) ; construct ( section ) ; return section ; } | org . junit . Assert . assertNotNull ( section ) |
testClassifier ( ) { com . navercorp . pinpoint . test . plugin . DependencyResolver resolver = com . navercorp . pinpoint . test . plugin . DependencyResolver . get ( ) ; java . util . Map < java . lang . String , java . util . List < org . eclipse . aether . artifact . Artifact > > sets = resolver . resolveDependencySets ( "net.sf.json-lib:json-lib:jar:jdk15:2.4" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return this . queue . isEmpty ( ) ; } | org . junit . Assert . assertFalse ( sets . isEmpty ( ) ) |
testPartitionPruningWithMetadataCache_3 ( ) { java . lang . String tableName = "orders_ctas_varchar" ; test ( "use<sp>dfs" ) ; test ( ( "create<sp>table<sp>%s<sp>(o_orderdate,<sp>o_orderpriority)<sp>partition<sp>by<sp>(o_orderpriority)<sp>" + "as<sp>select<sp>o_orderdate,<sp>o_orderpriority<sp>from<sp>dfs.`multilevel/parquet/1994/Q1`" ) , tableName ) ; test ( "refresh<sp>table<sp>metadata<sp>%s" , tableName ) ; checkForMetadataFile ( tableName ) ; java . lang . String query = java . lang . String . format ( "select<sp>*<sp>from<sp>%s<sp>where<sp>o_orderpriority<sp>=<sp>'1-URGENT'" , tableName ) ; int expectedRowCount = 3 ; int expectedNumFiles = 1 ; int actualRowCount = testSql ( query ) ; "<AssertPlaceHolder>" ; java . lang . String numFilesPattern = "numFiles=" + expectedNumFiles ; java . lang . String usedMetaPattern = "usedMetadataFile=true" ; testPlanMatchingPatterns ( query , new java . lang . String [ ] { numFilesPattern , usedMetaPattern } , new java . lang . String [ ] { } ) ; } testSql ( java . lang . String ) { return org . apache . drill . test . BaseTestQuery . testRunAndPrint ( QueryType . SQL , query ) ; } | org . junit . Assert . assertEquals ( expectedRowCount , actualRowCount ) |
testEqualsAndHashCode_1 ( ) { net . roboconf . core . model . beans . ApplicationTemplate app1 = new net . roboconf . core . model . beans . ApplicationTemplate ( ) ; app1 . setName ( "app" ) ; app1 . setVersion ( "snapshot" ) ; net . roboconf . core . model . beans . ApplicationTemplate app2 = new net . roboconf . core . model . beans . ApplicationTemplate ( ) ; app2 . setName ( "app" ) ; app2 . setVersion ( "snapshot" ) ; java . util . HashSet < net . roboconf . core . model . beans . ApplicationTemplate > set = new java . util . HashSet ( 2 ) ; set . add ( app1 ) ; set . add ( app2 ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . map . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , set . size ( ) ) |
fout ( ) { org . mockito . Mockito . reset ( lockService ) ; org . mockito . Mockito . when ( lockService . verkrijgLockVoorAnummers ( org . mockito . Matchers . anySetOf ( nl . bzk . migratiebrp . isc . jbpm . uc202 . Long . class ) , org . mockito . Matchers . anyLong ( ) ) ) . thenReturn ( 42L ) ; org . mockito . Mockito . doThrow ( nl . bzk . migratiebrp . isc . jbpm . common . locking . LockException . class ) . when ( lockService ) . verwijderLock ( 42L ) ; final java . lang . Long aNummer = 1231231234L ; startProcess ( maakLg01 ( aNummer , aNummer , null , null , "0599" , "0599" ) ) ; controleerBerichten ( 0 , 0 , 1 ) ; final nl . bzk . migratiebrp . bericht . model . sync . impl . BlokkeringInfoVerzoekBericht blokkeringInfoVerzoek = getBericht ( nl . bzk . migratiebrp . bericht . model . sync . impl . BlokkeringInfoVerzoekBericht . class ) ; signalSync ( maakBlokkeringInfoAntwoordBericht ( blokkeringInfoVerzoek , null , null , null ) ) ; controleerBerichten ( 0 , 0 , 1 ) ; final nl . bzk . migratiebrp . bericht . model . sync . impl . SynchroniseerNaarBrpVerzoekBericht synchroniseerNaarBrpVerzoek = getBericht ( nl . bzk . migratiebrp . bericht . model . sync . impl . SynchroniseerNaarBrpVerzoekBericht . class ) ; signalSync ( maakSynchroniseerNaarBrpAntwoordBericht ( synchroniseerNaarBrpVerzoek , StatusType . TOEGEVOEGD , null ) ) ; signalHumanTask ( "end" ) ; controleerBerichten ( 0 , 0 , 0 ) ; "<AssertPlaceHolder>" ; } processEnded ( ) { final org . jbpm . JbpmContext jbpmContext = org . jbpm . JbpmConfiguration . getInstance ( ) . createJbpmContext ( ) ; try { final org . jbpm . graph . exe . ProcessInstance processInstance = jbpmContext . loadProcessInstance ( processInstanceId ) ; return processInstance . hasEnded ( ) ; } finally { jbpmContext . close ( ) ; } } | org . junit . Assert . assertTrue ( processEnded ( ) ) |
testGetConnectionTypes ( ) { "<AssertPlaceHolder>" ; } getConnectionTypes ( ) { return connectionTypes ; } | org . junit . Assert . assertThat ( target . getConnectionTypes ( ) , org . hamcrest . CoreMatchers . is ( "" ) ) |
testAddTwoSavedDocumentsWithoutTx ( ) { com . orientechnologies . orient . core . record . impl . ODocument docOne = new com . orientechnologies . orient . core . record . impl . ODocument ( ) ; com . orientechnologies . orient . core . record . impl . ODocument docTwo = new com . orientechnologies . orient . core . record . impl . ODocument ( ) ; com . orientechnologies . orient . core . record . impl . ODocument rootDoc = new com . orientechnologies . orient . core . record . impl . ODocument ( ) ; com . orientechnologies . orient . core . db . record . ridbag . ORidBag ridBag = new com . orientechnologies . orient . core . db . record . ridbag . ORidBag ( ) ; rootDoc . field ( "ridBag" , ridBag ) ; rootDoc . save ( database . getClusterNameById ( database . getDefaultClusterId ( ) ) ) ; com . orientechnologies . orient . core . record . impl . ODocument staleRooDoc = database . load ( rootDoc . getIdentity ( ) ) ; com . orientechnologies . orient . core . db . record . ridbag . ORidBag staleRidBag = staleRooDoc . field ( "ridBag" ) ; staleRidBag . add ( docOne ) ; staleRidBag . add ( docTwo ) ; rootDoc . setDirty ( ) ; rootDoc . save ( database . getClusterNameById ( database . getDefaultClusterId ( ) ) ) ; try { staleRooDoc . save ( database . getClusterNameById ( database . getDefaultClusterId ( ) ) ) ; org . junit . Assert . fail ( ) ; } catch ( com . orientechnologies . orient . core . exception . OConcurrentModificationException e ) { } rootDoc = database . load ( rootDoc . getIdentity ( ) ) ; ridBag = rootDoc . field ( "ridBag" ) ; "<AssertPlaceHolder>" ; } size ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented<sp>yet" ) ; } | org . junit . Assert . assertEquals ( ridBag . size ( ) , 0 ) |
testFromArrayToGenericOrderPreservingSet ( ) { java . lang . String [ ] sa = new java . lang . String [ ] { "567" , "-765" , "0" , "-900" } ; java . util . Set < java . lang . Long > s = converter . convert ( sa ) . to ( new org . osgi . util . converter . TypeReference < java . util . Set < java . lang . Long > > ( ) { } ) ; java . util . List < java . lang . String > sl = new java . util . ArrayList ( java . util . Arrays . asList ( sa ) ) ; for ( long l : s ) { long expected = java . lang . Long . parseLong ( sl . remove ( 0 ) ) ; "<AssertPlaceHolder>" ; } } remove ( org . osgi . resource . Requirement ) { org . apache . felix . resolver . util . CandidateSelector candidates = m_candidateMap . remove ( req ) ; if ( candidates != null ) { for ( org . osgi . resource . Capability cap : candidates . getRemainingCandidates ( ) ) { org . apache . felix . resolver . Set < org . osgi . resource . Requirement > dependents = m_dependentMap . get ( cap ) ; if ( dependents != null ) { dependents . remove ( req ) ; } } } } | org . junit . Assert . assertEquals ( expected , l ) |
testCopyFromCsvToArrow ( ) { lombok . val recordsPair = records ( ) ; java . nio . file . Path p = java . nio . file . Files . createTempFile ( "csvwritetest" , ".csv" ) ; org . apache . commons . io . FileUtils . write ( p . toFile ( ) , recordsPair . getFirst ( ) ) ; p . toFile ( ) . deleteOnExit ( ) ; org . datavec . api . records . reader . impl . csv . CSVRecordReader recordReader = new org . datavec . api . records . reader . impl . csv . CSVRecordReader ( ) ; org . datavec . api . split . FileSplit fileSplit = new org . datavec . api . split . FileSplit ( p . toFile ( ) ) ; org . datavec . arrow . recordreader . ArrowRecordWriter arrowRecordWriter = new org . datavec . arrow . recordreader . ArrowRecordWriter ( recordsPair . getMiddle ( ) ) ; java . io . File outputFile = java . nio . file . Files . createTempFile ( "outputarrow" , "arrow" ) . toFile ( ) ; org . datavec . api . split . FileSplit outputFileSplit = new org . datavec . api . split . FileSplit ( outputFile ) ; org . datavec . api . records . mapper . RecordMapper mapper = org . datavec . api . records . mapper . RecordMapper . builder ( ) . batchSize ( 10 ) . inputUrl ( fileSplit ) . outputUrl ( outputFileSplit ) . partitioner ( new org . datavec . api . split . partition . NumberOfRecordsPartitioner ( ) ) . recordReader ( recordReader ) . recordWriter ( arrowRecordWriter ) . build ( ) ; mapper . copy ( ) ; org . datavec . arrow . recordreader . ArrowRecordReader arrowRecordReader = new org . datavec . arrow . recordreader . ArrowRecordReader ( ) ; arrowRecordReader . initialize ( outputFileSplit ) ; java . util . List < java . util . List < org . datavec . api . writable . Writable > > next = arrowRecordReader . next ( 10 ) ; System . out . println ( next ) ; "<AssertPlaceHolder>" ; } size ( ) { return objects . size ( ) ; } | org . junit . Assert . assertEquals ( 10 , next . size ( ) ) |
testExceptions3 ( ) { java . lang . String imei = "" ; try { imei = edu . columbia . cs . psl . test . phosphor . DroidBenchObjTagITCase . taintedString ( "abcde3" ) ; int [ ] arr = new int [ 42 ] ; if ( ( arr [ 32 ] ) > 0 ) imei = "" ; } catch ( java . lang . RuntimeException ex ) { "<AssertPlaceHolder>" ; } } getTaint ( java . lang . String ) { edu . columbia . cs . psl . phosphor . runtime . Taint taint = edu . columbia . cs . psl . phosphor . runtime . MultiTainter . getTaint ( description . toCharArray ( ) [ 0 ] ) ; return ( taint == null ) || ( ( ( taint . lbl ) == null ) && ( taint . hasNoDependencies ( ) ) ) ? 0 : 1 ; } | org . junit . Assert . assertTrue ( ( ( edu . columbia . cs . psl . test . phosphor . DroidBenchObjTagITCase . getTaint ( imei ) ) != 0 ) ) |
testRexQueryGeneration ( ) { java . lang . String QUERY = "rex<sp>field=_raw<sp>\"From:<sp>(?<from>.*)<sp>To:<sp>(?<to>.*)\"" ; org . araqne . logdb . query . parser . RexParser parser = new org . araqne . logdb . query . parser . RexParser ( ) ; parser . setQueryParserService ( queryParserService ) ; org . araqne . logdb . query . command . Rex rex = ( ( org . araqne . logdb . query . command . Rex ) ( parser . parse ( null , QUERY ) ) ) ; java . lang . String query = rex . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "(" + ( condition ) ) + "<sp>=><sp>" ) + ( value ) ) + ")" ; } | org . junit . Assert . assertEquals ( QUERY , query ) |
getSubscribedListenersInThreadOnlyTest ( ) { org . threadly . concurrent . event . ListenerHelper < org . threadly . concurrent . event . ListenerHelperTest . TestInterface > lh = makeListenerHelper ( org . threadly . concurrent . event . ListenerHelperTest . TestInterface . class ) ; org . threadly . concurrent . event . ListenerHelperTest . TestImp ti = new org . threadly . concurrent . event . ListenerHelperTest . TestImp ( ) ; lh . addListener ( ti ) ; "<AssertPlaceHolder>" ; } getSubscribedListeners ( ) { synchronized ( listenersLock ) { if ( ( ( inThreadListeners ) == null ) && ( ( executorListeners ) == null ) ) { return java . util . Collections . emptyList ( ) ; } else if ( ( inThreadListeners ) == null ) { return java . util . Collections . unmodifiableList ( org . threadly . util . Pair . collectLeft ( executorListeners ) ) ; } else if ( ( executorListeners ) == null ) { return java . util . Collections . unmodifiableList ( inThreadListeners ) ; } else { java . util . List < java . lang . Runnable > listeners = org . threadly . util . Pair . collectLeft ( executorListeners ) ; listeners . addAll ( inThreadListeners ) ; return java . util . Collections . unmodifiableList ( listeners ) ; } } } | org . junit . Assert . assertTrue ( lh . getSubscribedListeners ( ) . contains ( ti ) ) |
velocityTemplateTest ( ) { try { org . opennaas . extensions . router . junos . actionssets . actions . test . ip . RemoveIPv6ActionTest . action . prepareMessage ( ) ; java . lang . String expectedMessage = org . opennaas . core . resources . helpers . XmlHelper . formatXML ( textFileToString ( "/actions/ip/removeIPv6.xml" ) ) ; java . lang . String actionMessage = org . opennaas . core . resources . helpers . XmlHelper . formatXML ( org . opennaas . extensions . router . junos . actionssets . actions . test . ip . RemoveIPv6ActionTest . action . getVelocityMessage ( ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getVelocityMessage ( ) { return velocityMessage ; } | org . junit . Assert . assertEquals ( expectedMessage , actionMessage ) |
givenList_whenIndexOf_thenIndexZeroIsReturned ( ) { java . util . List < java . lang . Object > list = new com . baeldung . java . list . CustomList ( ) ; list . add ( "baeldung" ) ; "<AssertPlaceHolder>" ; } indexOf ( java . lang . Object ) { for ( int i = 0 ; i < ( internal . length ) ; i ++ ) { if ( object . equals ( internal [ i ] ) ) { return i ; } } return - 1 ; } | org . junit . Assert . assertEquals ( 0 , list . indexOf ( "baeldung" ) ) |
goAwayFrameShouldMatch ( ) { final java . lang . String text = "test" ; final io . netty . buffer . ByteBuf data = io . netty . handler . codec . http2 . Http2FrameRoundtripTest . buf ( text . getBytes ( ) ) ; writer . writeGoAway ( ctx , io . netty . handler . codec . http2 . Http2FrameRoundtripTest . STREAM_ID , io . netty . handler . codec . http2 . Http2FrameRoundtripTest . ERROR_CODE , data . slice ( ) , ctx . newPromise ( ) ) ; readFrames ( ) ; org . mockito . ArgumentCaptor < io . netty . buffer . ByteBuf > captor = org . mockito . ArgumentCaptor . forClass ( io . netty . buffer . ByteBuf . class ) ; verify ( listener ) . onGoAwayRead ( eq ( ctx ) , eq ( io . netty . handler . codec . http2 . Http2FrameRoundtripTest . STREAM_ID ) , eq ( io . netty . handler . codec . http2 . Http2FrameRoundtripTest . ERROR_CODE ) , captor . capture ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( data , captor . getValue ( ) ) |
testSerialization ( ) { org . jfree . chart . renderer . category . StatisticalBarRenderer r1 = new org . jfree . chart . renderer . category . StatisticalBarRenderer ( ) ; org . jfree . chart . renderer . category . StatisticalBarRenderer r2 = ( ( org . jfree . chart . renderer . category . StatisticalBarRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( r1 , r2 ) |
testServicesAnnotatedButNotImplements ( ) { @ com . liferay . portal . kernel . spring . osgi . OSGiBeanProperties ( service = java . io . Serializable . class ) class C { } java . util . Set < java . lang . String > interfaceNames = OSGiBeanProperties . Service . interfaceNames ( new C ( ) , C . class . getAnnotation ( com . liferay . portal . kernel . spring . osgi . OSGiBeanProperties . class ) , StringPool . EMPTY_ARRAY ) ; "<AssertPlaceHolder>" ; } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 23 ) ; sb . append ( ",<sp>width=" 1 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>width=" 0 ) ; sb . append ( amImageEntryId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>configurationUuid=" ) ; sb . append ( configurationUuid ) ; sb . append ( ",<sp>fileVersionId=" ) ; sb . append ( fileVersionId ) ; sb . append ( ",<sp>mimeType=" ) ; sb . append ( mimeType ) ; sb . append ( ",<sp>height=" ) ; sb . append ( height ) ; sb . append ( ",<sp>width=" ) ; sb . append ( width ) ; sb . append ( ",<sp>size=" ) ; sb . append ( size ) ; sb . append ( "}" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( interfaceNames . toString ( ) , 1 , interfaceNames . size ( ) ) |
shouldReturnFalseWhenCollectionDoesNotContainsAProvidedValue ( ) { final java . util . Collection collection = com . google . common . collect . Sets . newHashSet ( 10 , 20 , 30 ) ; final java . lang . Object [ ] values = new java . lang . Object [ ] { 1 , 2 , 3 } ; final boolean result = uk . gov . gchq . gaffer . commonutil . CollectionUtil . containsAny ( collection , values ) ; "<AssertPlaceHolder>" ; } containsAny ( java . util . Collection , java . lang . Object [ ] ) { boolean result = false ; if ( ( null != collection ) && ( null != objects ) ) { for ( final java . lang . Object object : objects ) { if ( collection . contains ( object ) ) { result = true ; break ; } } } return result ; } | org . junit . Assert . assertFalse ( result ) |
testSetArrayItemB ( ) { propertyUtilsBean . setIndexedProperty ( bean , "stringArray" , 1 , "modified-1" ) ; "<AssertPlaceHolder>" ; } getStringArray ( int ) { return stringArray [ index ] ; } | org . junit . Assert . assertEquals ( "modified-1" , bean . getStringArray ( 1 ) ) |
primitives ( ) { beanMap . put ( "id" , 5 ) ; "<AssertPlaceHolder>" ; } getBean ( ) { return bean ; } | org . junit . Assert . assertEquals ( 5 , ( ( com . querydsl . core . util . Entity ) ( beanMap . getBean ( ) ) ) . getId ( ) ) |
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . friendly . url . model . FriendlyURLEntryLocalization > friendlyURLEntryLocalizations = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( friendlyURLEntryLocalizations . isEmpty ( ) ) |
testRandomSimpleFF ( ) { long seed = 123456789 ; com . github . neuralnetworks . tensor . Tensor seqResult = testRandomSimpleFF ( Runtime . CPU_SEQ , seed ) ; com . github . neuralnetworks . tensor . Tensor openclResult = testRandomSimpleFF ( Runtime . OPENCL , seed ) ; "<AssertPlaceHolder>" ; } isEqual ( com . github . neuralnetworks . tensor . Tensor , com . github . neuralnetworks . tensor . Tensor ) { if ( ( t1 == null ) || ( t2 == null ) ) return false ; if ( t1 . equals ( t2 ) ) return true ; if ( ( t1 . getDimensions ( ) . length ) != ( t2 . getDimensions ( ) . length ) ) return false ; for ( int d = 0 ; d < ( t1 . getDimensions ( ) . length ) ; d ++ ) { if ( ( t1 . getDimensions ( ) [ d ] ) != ( t2 . getDimensions ( ) [ d ] ) ) return false ; } com . github . neuralnetworks . tensor . Tensor . TensorIterator it1 = t1 . iterator ( ) ; com . github . neuralnetworks . tensor . Tensor . TensorIterator it2 = t2 . iterator ( ) ; while ( ( it1 . hasNext ( ) ) && ( it2 . hasNext ( ) ) ) { float v1 = t1 . getElements ( ) [ it1 . next ( ) ] ; float v2 = t2 . getElements ( ) [ it2 . next ( ) ] ; if ( ( java . lang . Math . abs ( ( v1 - v2 ) ) ) > 1.0E-6 ) return false ; } return true ; } | org . junit . Assert . assertTrue ( isEqual ( seqResult , openclResult ) ) |
testExpiredAssertion ( ) { org . picketlink . identity . federation . saml . v2 . assertion . NameIDType nameIdType = new org . picketlink . identity . federation . saml . v2 . assertion . NameIDType ( ) ; nameIdType . setValue ( "somename" ) ; org . picketlink . identity . federation . saml . v2 . assertion . AssertionType assertion = new org . picketlink . identity . federation . saml . v2 . assertion . AssertionType ( "SomeID" , org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . getIssueInstant ( ) ) ; assertion . setIssuer ( nameIdType ) ; javax . xml . datatype . XMLGregorianCalendar now = org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . getIssueInstant ( ) ; javax . xml . datatype . XMLGregorianCalendar sometimeAgo = org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . subtract ( now , 55555 ) ; org . picketlink . identity . federation . saml . v2 . assertion . ConditionsType conditions = new org . picketlink . identity . federation . saml . v2 . assertion . ConditionsType ( ) ; conditions . setNotBefore ( org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . subtract ( now , 55575 ) ) ; conditions . setNotOnOrAfter ( sometimeAgo ) ; assertion . setConditions ( conditions ) ; "<AssertPlaceHolder>" ; } hasExpired ( org . picketlink . identity . federation . saml . v2 . assertion . AssertionType ) { boolean expiry = false ; org . picketlink . identity . federation . saml . v2 . assertion . ConditionsType conditionsType = assertion . getConditions ( ) ; if ( conditionsType != null ) { javax . xml . datatype . XMLGregorianCalendar now = org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . getIssueInstant ( ) ; javax . xml . datatype . XMLGregorianCalendar notBefore = conditionsType . getNotBefore ( ) ; javax . xml . datatype . XMLGregorianCalendar notOnOrAfter = conditionsType . getNotOnOrAfter ( ) ; org . picketlink . identity . federation . core . saml . v2 . util . AssertionUtil . logger . trace ( ( ( ( ( ( "Now=" + ( now . toXMLFormat ( ) ) ) + "<sp>::notBefore=" ) + ( notBefore . toXMLFormat ( ) ) ) + "<sp>::notOnOrAfter=" ) + notOnOrAfter ) ) ; expiry = ! ( org . picketlink . identity . federation . core . saml . v2 . util . XMLTimeUtil . isValid ( now , notBefore , notOnOrAfter ) ) ; if ( expiry ) { org . picketlink . identity . federation . core . saml . v2 . util . AssertionUtil . logger . samlAssertionExpired ( assertion . getID ( ) ) ; } } return expiry ; } | org . junit . Assert . assertTrue ( org . picketlink . identity . federation . core . saml . v2 . util . AssertionUtil . hasExpired ( assertion ) ) |
testAddInvitationProjectsWithEmpty ( ) { java . util . List < com . onboard . domain . model . Project > ret = invitationManager . addInvitationProjects ( invitation , projectListEmpty ) ; "<AssertPlaceHolder>" ; } addInvitationProjects ( com . onboard . domain . model . Invitation , java . util . List ) { if ( ( projects == null ) || ( projects . isEmpty ( ) ) ) { return projects ; } com . onboard . domain . model . InvitationProjects sample = new com . onboard . domain . model . InvitationProjects ( ) ; sample . setInvitationId ( invitation . getId ( ) ) ; java . util . List < com . onboard . domain . model . InvitationProjects > ips = invitationProjectsMapper . selectByExample ( new com . onboard . domain . mapper . model . InvitationProjectsExample ( sample ) ) ; java . util . List < com . onboard . domain . model . Project > ret = com . google . common . collect . Lists . newArrayList ( com . google . common . collect . Iterables . filter ( projects , new com . onboard . service . account . function . InvitationProjectFilter ( ips ) ) ) ; for ( com . onboard . domain . model . Project project : ret ) { insertInvitationProjects ( invitation . getId ( ) , project . getId ( ) ) ; } return ret ; } | org . junit . Assert . assertSame ( ret , projectListEmpty ) |
getServletURI_emptyStringServlet ( ) { final java . lang . String uri = "" ; final java . lang . String expected = "/" ; mock . checking ( new org . jmock . Expectations ( ) { { allowing ( req ) . getServletPath ( ) ; will ( returnValue ( uri ) ) ; allowing ( req ) . getPathInfo ( ) ; will ( returnValue ( null ) ) ; } } ) ; "<AssertPlaceHolder>" ; } getServletURI ( javax . servlet . http . HttpServletRequest ) { java . lang . String uriName = req . getServletPath ( ) ; java . lang . String pathInfo = req . getPathInfo ( ) ; if ( pathInfo != null ) uriName = uriName . concat ( pathInfo ) ; if ( ( uriName == null ) || ( ( uriName . length ( ) ) == 0 ) ) uriName = "/" ; uriName = com . ibm . ws . util . WSUtil . resolveURI ( uriName ) ; int sindex ; if ( ( sindex = uriName . indexOf ( ";" ) ) != ( - 1 ) ) { uriName = uriName . substring ( 0 , sindex ) ; } if ( ( uriName . indexOf ( ":" ) ) >= 0 ) { uriName = uriName . replaceAll ( ":" , "%3A" ) ; } return uriName ; } | org . junit . Assert . assertEquals ( expected , handler . getServletURI ( req ) ) |
chainedMultiSelectHashWithQuotedKeys ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = Object ( java . util . Arrays . asList ( new io . burt . jmespath . node . CreateObjectNode . Entry < java . lang . Object > ( "foo" , String ( "bar" ) ) , new io . burt . jmespath . node . CreateObjectNode . Entry < java . lang . Object > ( "baz" , Current ( ) ) ) ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "{\"foo\":<sp>\'bar\',<sp>\"baz\":<sp>@}" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) ) |
testIntegerField ( ) { org . lilyproject . hbaseindex . IndexDefinition indexDef = new org . lilyproject . hbaseindex . IndexDefinition ( "index" ) ; org . lilyproject . hbaseindex . IntegerIndexFieldDefinition field = indexDef . addIntegerField ( "intfield" ) ; org . codehaus . jackson . node . ObjectNode json = indexDef . toJson ( ) ; org . lilyproject . hbaseindex . IndexDefinition newIndexDef = new org . lilyproject . hbaseindex . IndexDefinition ( "index" , json ) ; org . lilyproject . hbaseindex . IntegerIndexFieldDefinition newField = ( ( org . lilyproject . hbaseindex . IntegerIndexFieldDefinition ) ( newIndexDef . getField ( "intfield" ) ) ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( field . getName ( ) , newField . getName ( ) ) |
testNoNullValuesParameterNull ( ) { com . twelvemonkeys . lang . Map < java . lang . String , ? > map = new com . twelvemonkeys . lang . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "foo" , 1 ) ; put ( "bar" , 2 ) ; put ( "baz" , 3 ) ; } } ; "<AssertPlaceHolder>" ; } noNullValues ( java . util . Map , java . lang . String ) { com . twelvemonkeys . lang . Validate . notNull ( pParameter , pParamName ) ; for ( V value : pParameter . values ( ) ) { if ( value == null ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "%s<sp>may<sp>not<sp>contain<sp>null<sp>values" , ( pParamName == null ? com . twelvemonkeys . lang . Validate . UNSPECIFIED_PARAM_NAME : pParamName ) ) ) ; } } return pParameter ; } | org . junit . Assert . assertSame ( map , com . twelvemonkeys . lang . Validate . noNullValues ( map , null ) ) |
createPCJ ( ) { final org . apache . accumulo . core . client . Connector connector = getClusterInstance ( ) . getConnector ( ) ; final java . lang . String ryaInstanceName = testInstance . getRyaInstanceName ( ) ; try ( final org . apache . rya . indexing . pcj . storage . PrecomputedJoinStorage pcjStorage = new org . apache . rya . indexing . pcj . storage . accumulo . AccumuloPcjStorage ( connector , ryaInstanceName ) ) { final java . lang . String pcjId = pcjStorage . createPcj ( "SELECT<sp>*<sp>WHERE<sp>{<sp>?a<sp><http://isA><sp>?b<sp>}<sp>" ) ; final org . apache . rya . api . instance . RyaDetailsRepository detailsRepo = new org . apache . rya . accumulo . instance . AccumuloRyaInstanceDetailsRepository ( connector , ryaInstanceName ) ; final com . google . common . collect . ImmutableMap < java . lang . String , org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails > detailsMap = detailsRepo . getRyaInstanceDetails ( ) . getPCJIndexDetails ( ) . getPCJDetails ( ) ; final org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails expectedDetails = org . apache . rya . api . instance . RyaDetails . PCJIndexDetails . PCJDetails . builder ( ) . setId ( pcjId ) . build ( ) ; "<AssertPlaceHolder>" ; } } get ( org . apache . rya . api . domain . RyaIRI ) { java . util . Objects . requireNonNull ( subject ) ; try { final org . bson . Document document = mongo . getDatabase ( ryaInstanceName ) . getCollection ( org . apache . rya . indexing . entity . storage . mongo . MongoEntityStorage . COLLECTION_NAME ) . find ( com . mongodb . client . model . Filters . eq ( EntityDocumentConverter . SUBJECT , subject . getData ( ) ) ) . first ( ) ; return document == null ? java . util . Optional . empty ( ) : java . util . Optional . of ( org . apache . rya . indexing . entity . storage . mongo . MongoEntityStorage . ENTITY_CONVERTER . fromDocument ( document ) ) ; } catch ( com . mongodb . MongoException | org . apache . rya . indexing . entity . storage . mongo . DocumentConverter . DocumentConverterException e ) { throw new org . apache . rya . indexing . entity . storage . mongo . EntityStorageException ( ( ( "Could<sp>not<sp>get<sp>the<sp>Entity<sp>with<sp>Subject<sp>'" + ( subject . getData ( ) ) ) + "'." ) , e ) ; } } | org . junit . Assert . assertEquals ( expectedDetails , detailsMap . get ( pcjId ) ) |
testFetchByPrimaryKeyExisting ( ) { com . liferay . document . library . file . rank . model . DLFileRank newDLFileRank = addDLFileRank ( ) ; com . liferay . document . library . file . rank . model . DLFileRank existingDLFileRank = _persistence . fetchByPrimaryKey ( newDLFileRank . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingDLFileRank , newDLFileRank ) |
testIsX ( ) { org . nd4j . autodiff . opvalidation . List < java . lang . String > failed = new org . nd4j . autodiff . opvalidation . ArrayList ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . SDVariable in = sd . var ( "in" , 4 ) ; org . nd4j . autodiff . samediff . SDVariable out ; org . nd4j . linalg . api . ndarray . INDArray exp ; org . nd4j . linalg . api . ndarray . INDArray inArr ; switch ( i ) { case 0 : inArr = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 10 , Double . POSITIVE_INFINITY , 0 , Double . NEGATIVE_INFINITY } ) ; exp = org . nd4j . linalg . factory . Nd4j . create ( new boolean [ ] { true , false , true , false } ) ; out = sd . math ( ) . isFinite ( in ) ; break ; case 1 : inArr = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 10 , Double . POSITIVE_INFINITY , 0 , Double . NEGATIVE_INFINITY } ) ; exp = org . nd4j . linalg . factory . Nd4j . create ( new boolean [ ] { false , true , false , true } ) ; out = sd . math ( ) . isInfinite ( in ) ; break ; case 2 : inArr = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { - 3 , 5 , 0 , 2 } ) ; exp = org . nd4j . linalg . factory . Nd4j . create ( new boolean [ ] { false , true , false , false } ) . castTo ( DataType . DOUBLE ) ; out = sd . math ( ) . isMax ( in ) ; break ; case 3 : inArr = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0 , Double . NaN , 10 , Double . NaN } ) ; exp = org . nd4j . linalg . factory . Nd4j . create ( new boolean [ ] { false , true , false , true } ) ; out = sd . math ( ) . isNaN ( in ) ; break ; default : throw new java . lang . RuntimeException ( ) ; } org . nd4j . autodiff . samediff . SDVariable other = sd . var ( "other" , org . nd4j . linalg . factory . Nd4j . rand ( DataType . DOUBLE , 4 ) ) ; org . nd4j . autodiff . samediff . SDVariable loss = out . castTo ( DataType . DOUBLE ) . add ( other ) . mean ( ) ; org . nd4j . autodiff . validation . TestCase tc = new org . nd4j . autodiff . validation . TestCase ( sd ) . gradientCheck ( false ) . expected ( out , exp ) ; in . setArray ( inArr ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( tc , true ) ; if ( err != null ) { failed . add ( err ) ; } } "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder buff = new java . lang . StringBuilder ( "[" ) ; int sz = objects . size ( ) ; int i ; for ( i = 0 ; i < sz ; i ++ ) { java . lang . Object e = objects . get ( i ) ; buff . append ( e ) ; if ( i < ( sz - 1 ) ) buff . append ( "<sp>,<sp>" ) ; } buff . append ( "]" ) ; return buff . toString ( ) ; } | org . junit . Assert . assertEquals ( failed . toString ( ) , 0 , failed . size ( ) ) |
testThatRunnerIsProperlyMarshalized ( ) { info . novatec . testit . livingdoc . server . domain . Runner runner = info . novatec . testit . livingdoc . server . domain . Runner . newInstance ( "RUNNER-1" ) ; runner . setServerName ( "SERVER_NAME" ) ; runner . setServerPort ( "SERVER_PORT" ) ; info . novatec . testit . livingdoc . server . domain . ClasspathSet classPaths = new info . novatec . testit . livingdoc . server . domain . ClasspathSet ( ) ; classPaths . add ( "CLASSPATH-1" ) ; classPaths . add ( "CLASSPATH-2" ) ; runner . setClasspaths ( classPaths ) ; runner . setSecured ( true ) ; java . util . List < java . lang . Object > params = new java . util . ArrayList < java . lang . Object > ( ) ; params . add ( XmlRpcDataMarshaller . RUNNER_NAME_IDX , "RUNNER-1" ) ; java . util . List < java . lang . Object > envType = new java . util . ArrayList < java . lang . Object > ( ) ; envType . add ( 0 , "ENVTYPE-1" ) ; params . add ( XmlRpcDataMarshaller . RUNNER_SERVER_NAME_IDX , "SERVER_NAME" ) ; params . add ( XmlRpcDataMarshaller . RUNNER_SERVER_PORT_IDX , "SERVER_PORT" ) ; java . util . List < java . lang . Object > cp = new java . util . ArrayList < java . lang . Object > ( ) ; cp . add ( 0 , "CLASSPATH-1" ) ; cp . add ( 1 , "CLASSPATH-2" ) ; params . add ( XmlRpcDataMarshaller . RUNNER_CLASSPATH_IDX , cp ) ; params . add ( XmlRpcDataMarshaller . RUNNER_SECURED_IDX , true ) ; "<AssertPlaceHolder>" ; } marshallize ( ) { java . util . List < java . lang . Object > myList = new java . util . ArrayList ( ) ; myList . add ( info . novatec . testit . livingdoc . server . domain . NODE_TITLE_INDEX , title ) ; myList . add ( info . novatec . testit . livingdoc . server . domain . NODE_EXECUTABLE_INDEX , executable ) ; myList . add ( info . novatec . testit . livingdoc . server . domain . NODE_CAN_BE_IMPLEMENTED_INDEX , canBeImplemented ) ; java . util . Hashtable < java . lang . String , java . lang . Object > hashtable = new java . util . Hashtable < java . lang . String , java . lang . Object > ( ) ; for ( info . novatec . testit . livingdoc . server . domain . DocumentNode node : children ) { hashtable . put ( node . getTitle ( ) , node . marshallize ( ) ) ; } myList . add ( info . novatec . testit . livingdoc . server . domain . NODE_CHILDREN_INDEX , hashtable ) ; return myList ; } | org . junit . Assert . assertEquals ( params , runner . marshallize ( ) ) |
findFeatureBasicWithOneResult_NotSameName_butScoreKO ( ) { java . lang . String lat = "adm1name" 1 ; java . lang . String lng = "44" ; com . vividsolutions . jts . geom . Point point = com . gisgraphy . helper . GeolocHelper . createPoint ( new java . lang . Float ( lng ) , new java . lang . Float ( lat ) ) ; java . lang . String accuracy = "5" ; java . lang . String placeName = "place<sp>name" ; java . lang . String countryCode = "FR" ; java . lang . String adm1Name = "adm1name" ; java . lang . String adm1Code = "adm1name" 0 ; java . lang . String adm2Name = "adm2name" ; java . lang . String adm2Code = "adm2code" ; java . lang . String adm3Name = "adm3name" ; java . lang . String adm3COde = "adm3code" ; com . gisgraphy . fulltext . FulltextQuery fulltextQuery = new com . gisgraphy . fulltext . FulltextQuery ( ( ( placeName + "<sp>" ) + adm1Name ) ) ; fulltextQuery . limitToCountryCode ( countryCode ) ; fulltextQuery . withPlaceTypes ( com . gisgraphy . fulltext . Constants . CITY_AND_CITYSUBDIVISION_PLACETYPE ) . around ( point ) ; com . gisgraphy . importer . GeonamesZipCodeSimpleImporter importer = new com . gisgraphy . importer . GeonamesZipCodeSimpleImporter ( ) { @ com . gisgraphy . importer . Override protected com . gisgraphy . fulltext . FulltextResultsDto doAFulltextSearch ( java . lang . String query , java . lang . String countryCode , com . vividsolutions . jts . geom . Point point ) { return dtoWithOneResultLowScore ; } } ; java . lang . String [ ] fields = new java . lang . String [ ] { countryCode , "adm1name" 2 , placeName , adm1Name , adm1Code , adm2Name , adm2Code , adm3Name , adm3COde , lat , lng , accuracy } ; int maxDistance = importer . getAccurateDistance ( new java . lang . Integer ( accuracy ) ) ; java . lang . Long actualFeatureId = importer . findFeature ( fields , point , maxDistance ) ; "<AssertPlaceHolder>" ; } findFeature ( java . lang . String [ ] , com . vividsolutions . jts . geom . Point , int ) { java . lang . String query ; boolean extendedsearch ; return null ; } else if ( ( results . getResults ( ) . size ( ) ) == 1 ) { com . gisgraphy . importer . GeonamesZipCodeSimpleImporter . logger . debug ( ( ( ( ( ( ( ( "score<sp>for<sp>" + ( fields [ 2 ] ) ) + "=<sp>" ) + ( results . getResults ( ) . get ( 0 ) . getScore ( ) ) ) + ",<sp>id=" ) + ( results . getResults ( ) . get ( 0 ) . getFeature_id ( ) ) ) + "<sp>and<sp>name=" ) + ( results . getResults ( ) . get ( 0 ) . getName ( ) ) ) ) ; if ( ( ( com . gisgraphy . helper . StringHelper . isSameName ( fields [ 2 ] , results . getResults ( ) . get ( 0 ) . getName ( ) ) ) || ( ( results . getResults ( ) . get ( 0 ) . getScore ( ) ) > ( com . gisgraphy . importer . GeonamesZipCodeSimpleImporter . MIN_SCORE ) ) ) || ( com . gisgraphy . helper . StringHelper . isSameAlternateNames ( fields [ 2 ] , results . getResults ( ) . get ( 0 ) . getName_alternates ( ) ) ) ) { return results . getResults ( ) . get ( 0 ) . getFeature_id ( ) ; } else { return null ; } } else { com . gisgraphy . importer . GeonamesZipCodeSimpleImporter . logger . debug ( ( ( ( ( ( ( ( "score<sp>for<sp>" + ( fields [ 2 ] ) ) + "=<sp>" ) + ( results . getResults ( ) . get ( 0 ) . getScore ( ) ) ) + ",<sp>id=" ) + ( results . getResults ( ) . get ( 0 ) . getFeature_id ( ) ) ) + "<sp>and<sp>name=" ) + ( results . getResults ( ) . get ( 0 ) . getName ( ) ) ) ) ; for ( com . gisgraphy . fulltext . SolrResponseDto result : results . getResults ( ) ) { if ( ( ( com . gisgraphy . helper . StringHelper . isSameName ( fields [ 2 ] , result . getName ( ) ) ) || ( ( result . getScore ( ) ) > ( com . gisgraphy . importer . GeonamesZipCodeSimpleImporter . MIN_SCORE ) ) ) || ( com . gisgraphy . helper . StringHelper . isSameAlternateNames ( fields [ 2 ] , result . getName_alternates ( ) ) ) ) { return result . getFeature_id ( ) ; } if ( ( result . getScore ( ) ) < ( com . gisgraphy . importer . GeonamesZipCodeSimpleImporter . MIN_SCORE ) ) { return null ; } } return null ; } } | org . junit . Assert . assertEquals ( null , actualFeatureId ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.