input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
numberProcedure ( ) { org . eclipse . collections . api . block . procedure . Procedure < java . lang . Integer > procedure = new org . eclipse . collections . impl . block . procedure . checked . CheckedProcedure < java . lang . Integer > ( ) { @ org . eclipse . collections . impl . block . procedure . checked . Override public void safeValue ( java . lang . Integer integer ) { "<AssertPlaceHolder>" ; } } ; procedure . value ( 1 ) ; } valueOf ( K ) { return this . multimap . get ( subject ) ; } | org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 1 ) , integer ) |
testSerialization ( ) { org . jfree . chart . labels . BoxAndWhiskerXYToolTipGenerator g1 = new org . jfree . chart . labels . BoxAndWhiskerXYToolTipGenerator ( ) ; org . jfree . chart . labels . BoxAndWhiskerXYToolTipGenerator g2 = ( ( org . jfree . chart . labels . BoxAndWhiskerXYToolTipGenerator ) ( org . jfree . chart . TestUtilities . serialised ( g1 ) ) ) ; "<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 ( g1 , g2 ) |
testTransform ( ) { final org . drools . core . spi . ObjectType type = new org . drools . core . base . ClassObjectType ( java . lang . String . class ) ; final org . drools . core . rule . Pattern a = new org . drools . core . rule . Pattern ( 0 , type , "a" ) ; final org . drools . core . rule . Pattern b = new org . drools . core . rule . Pattern ( 1 , type , "b" ) ; final org . drools . core . rule . Pattern c = new org . drools . core . rule . Pattern ( 2 , type , "c" ) ; final org . drools . core . rule . Pattern d = new org . drools . core . rule . Pattern ( 3 , type , "d" ) ; final org . drools . core . rule . Pattern e = new org . drools . core . rule . Pattern ( 4 , type , "e" ) ; final org . drools . core . rule . Pattern f = new org . drools . core . rule . Pattern ( 5 , type , "f" ) ; final org . drools . core . rule . Pattern g = new org . drools . core . rule . Pattern ( 6 , type , "g" ) ; final org . drools . core . rule . Pattern h = new org . drools . core . rule . Pattern ( 7 , type , "h" ) ; final org . drools . core . rule . GroupElement and = org . drools . core . rule . GroupElementFactory . newAndInstance ( ) ; final org . drools . core . rule . GroupElement and1 = org . drools . core . rule . GroupElementFactory . newAndInstance ( ) ; and1 . addChild ( a ) ; final org . drools . core . rule . GroupElement or1 = org . drools . core . rule . GroupElementFactory . newOrInstance ( ) ; or1 . addChild ( b ) ; or1 . addChild ( c ) ; and1 . addChild ( or1 ) ; and . addChild ( and1 ) ; final org . drools . core . rule . GroupElement or2 = org . drools . core . rule . GroupElementFactory . newOrInstance ( ) ; or2 . addChild ( d ) ; or2 . addChild ( e ) ; and . addChild ( or2 ) ; final org . drools . core . rule . GroupElement and2 = org . drools . core . rule . GroupElementFactory . newAndInstance ( ) ; final org . drools . core . rule . GroupElement not1 = org . drools . core . rule . GroupElementFactory . newNotInstance ( ) ; not1 . addChild ( f ) ; final org . drools . core . rule . GroupElement or3 = org . drools . core . rule . GroupElementFactory . newOrInstance ( ) ; or3 . addChild ( g ) ; final org . drools . core . rule . GroupElement not2 = org . drools . core . rule . GroupElementFactory . newNotInstance ( ) ; not2 . addChild ( h ) ; or3 . addChild ( not2 ) ; and2 . addChild ( not1 ) ; and2 . addChild ( or3 ) ; and . addChild ( and2 ) ; final org . drools . core . rule . GroupElement [ ] ands = org . drools . core . rule . LogicTransformer . getInstance ( ) . transform ( and , Collections . EMPTY_MAP ) ; final java . io . File testFile = new java . io . File ( "target/test/LogicTransformerTest_correct_transform1.dat" ) ; testFile . getParentFile ( ) . mkdirs ( ) ; org . drools . core . util . DroolsStreamUtils . streamOut ( new java . io . FileOutputStream ( testFile ) , ands ) ; final org . drools . core . rule . GroupElement [ ] correctResultAnds = ( ( org . drools . core . rule . GroupElement [ ] ) ( org . drools . core . util . DroolsStreamUtils . streamIn ( new java . io . FileInputStream ( testFile ) ) ) ) ; for ( int j = 0 ; j < ( ands . length ) ; j ++ ) { "<AssertPlaceHolder>" ; } } streamIn ( byte [ ] ) { return org . drools . core . util . DroolsStreamUtils . streamIn ( bytes , null ) ; } | org . junit . Assert . assertEquals ( correctResultAnds [ j ] , ands [ j ] ) |
getPortSuffix_SAML_SP ( ) { java . util . Map < java . lang . String , org . oscm . app . v2_0 . data . Setting > settings = getSettingsForMode ( "SAML_SP" ) ; java . lang . String actual = besDAO . getPortSuffix ( settings ) ; "<AssertPlaceHolder>" ; } getPortSuffix ( java . util . Map ) { if ( isSsoMode ( settings ) ) { return "PortSTS" ; } else { return "PortBASIC" ; } } | org . junit . Assert . assertEquals ( "PortSTS" , actual ) |
testGetHystrixFailureType ( ) { com . liferay . dynamic . data . mapping . data . provider . internal . DDMDataProviderInvokerImpl ddmDataProviderInvoker = new com . liferay . dynamic . data . mapping . data . provider . internal . DDMDataProviderInvokerImpl ( ) ; com . netflix . hystrix . exception . HystrixRuntimeException hystrixRuntimeException = new com . netflix . hystrix . exception . HystrixRuntimeException ( HystrixRuntimeException . FailureType . TIMEOUT , null , null , null , null ) ; com . netflix . hystrix . exception . HystrixRuntimeException . FailureType failureType = ddmDataProviderInvoker . getHystrixFailureType ( hystrixRuntimeException ) ; "<AssertPlaceHolder>" ; } getHystrixFailureType ( java . lang . Exception ) { com . netflix . hystrix . exception . HystrixRuntimeException hystrixRuntimeException = ( ( com . netflix . hystrix . exception . HystrixRuntimeException ) ( e ) ) ; return hystrixRuntimeException . getFailureType ( ) ; } | org . junit . Assert . assertEquals ( HystrixRuntimeException . FailureType . TIMEOUT , failureType ) |
foldRight ( ) { com . jnape . palatable . lambda . semigroup . Semigroup < java . lang . Integer > sum = ( x , y ) -> x + y ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 6 ) ) , sum . foldRight ( 0 , asList ( 1 , 2 , 3 ) ) ) |
test_createPomCreator_nullWinCP ( ) { java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( IBuildPomCreatorParameters . PROCESSOR , new org . talend . designer . core . build . TestProcessor ( ) ) ; org . talend . core . runtime . process . ITalendProcessJavaProject talendProcessJavaProject = org . talend . repository . RepositoryPlugin . getDefault ( ) . getRunProcessService ( ) . getTempJavaProject ( ) ; parameters . put ( IBuildPomCreatorParameters . FILE_POM , talendProcessJavaProject . getProject ( ) . getFile ( "pom_abc.xml" ) ) ; parameters . put ( IBuildParametes . ITEM , PropertiesFactory . eINSTANCE . createProcessItem ( ) ) ; parameters . put ( IBuildPomCreatorParameters . FILE_ASSEMBLY , talendProcessJavaProject . getProject ( ) . getFile ( "pom_abc.xml" ) ) ; org . talend . core . runtime . repository . build . RepositoryObjectTypeBuildProvider provider = createTestBuildProvider ( ) ; "<AssertPlaceHolder>" ; } createPomCreator ( java . util . Map ) { if ( ( parameters == null ) || ( parameters . isEmpty ( ) ) ) { return null ; } final java . lang . Object processor = parameters . get ( org . talend . designer . core . build . PROCESSOR ) ; if ( ( processor == null ) || ( ! ( processor instanceof org . talend . designer . runprocess . IProcessor ) ) ) { return null ; } final java . lang . Object pomFile = parameters . get ( org . talend . designer . core . build . FILE_POM ) ; if ( ( pomFile == null ) || ( ! ( pomFile instanceof org . eclipse . core . resources . IFile ) ) ) { return null ; } final java . lang . Object item = parameters . get ( org . talend . designer . core . build . ITEM ) ; if ( ( item == null ) || ( ! ( item instanceof org . talend . core . model . properties . Item ) ) ) { return null ; } java . lang . Object argumentsMap = parameters . get ( org . talend . designer . core . build . ARGUMENTS_MAP ) ; if ( argumentsMap == null ) { argumentsMap = java . util . Collections . emptyMap ( ) ; } if ( ! ( argumentsMap instanceof java . util . Map ) ) { return null ; } java . lang . Object overwrite = parameters . get ( org . talend . designer . core . build . OVERWRITE_POM ) ; if ( overwrite == null ) { overwrite = Boolean . FALSE ; } java . lang . Object assemblyFile = parameters . get ( org . talend . designer . core . build . FILE_ASSEMBLY ) ; org . talend . designer . maven . tools . creator . CreateMavenStandardJobOSGiPom osgiPomCreator = new org . talend . designer . maven . tools . creator . CreateMavenStandardJobOSGiPom ( ( ( org . talend . designer . runprocess . IProcessor ) ( processor ) ) , ( ( org . eclipse . core . resources . IFile ) ( pomFile ) ) ) ; osgiPomCreator . setArgumentsMap ( ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( argumentsMap ) ) ) ; osgiPomCreator . setOverwrite ( java . lang . Boolean . parseBoolean ( overwrite . toString ( ) ) ) ; osgiPomCreator . setAssemblyFile ( ( ( org . eclipse . core . resources . IFile ) ( assemblyFile ) ) ) ; final org . talend . core . model . properties . Property itemProperty = ( ( org . talend . core . model . properties . Item ) ( item ) ) . getProperty ( ) ; org . eclipse . core . runtime . IPath itemLocationPath = org . talend . core . repository . utils . ItemResourceUtil . getItemLocationPath ( itemProperty ) ; org . eclipse . core . resources . IFolder objectTypeFolder = org . talend . core . repository . utils . ItemResourceUtil . getObjectTypeFolder ( itemProperty ) ; if ( ( itemLocationPath != null ) && ( objectTypeFolder != null ) ) { org . eclipse . core . runtime . IPath itemRelativePath = itemLocationPath . removeLastSegments ( 1 ) . makeRelativeTo ( objectTypeFolder . getLocation ( ) ) ; osgiPomCreator . setObjectTypeFolder ( objectTypeFolder ) ; osgiPomCreator . setItemRelativePath ( itemRelativePath ) ; } return osgiPomCreator ; } | org . junit . Assert . assertNull ( provider . createPomCreator ( parameters ) ) |
testGetReaderSchemaForReflect ( ) { java . lang . Class < java . lang . String > type = java . lang . String . class ; org . apache . avro . Schema writerSchema = org . apache . avro . reflect . ReflectData . get ( ) . getSchema ( java . lang . String . class ) ; org . apache . avro . Schema expResult = writerSchema ; org . apache . avro . Schema result = org . kitesdk . data . spi . DataModelUtil . getReaderSchema ( type , writerSchema ) ; "<AssertPlaceHolder>" ; } getReaderSchema ( java . lang . Class , org . apache . avro . Schema ) { org . apache . avro . Schema readerSchema = schema ; org . apache . avro . generic . GenericData dataModel = org . kitesdk . data . spi . DataModelUtil . getDataModelForType ( type ) ; if ( dataModel instanceof org . apache . avro . specific . SpecificData ) { readerSchema = ( ( org . apache . avro . specific . SpecificData ) ( dataModel ) ) . getSchema ( type ) ; } return readerSchema ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testCommandHelp ( ) { int rc = run ( "test" , "--help" ) ; verify ( console ) . info ( "\nUsage:<sp>{}<sp>[general<sp>options]<sp>{}<sp>{}<sp>[command<sp>options]" , new java . lang . Object [ ] { Main . DEFAULT_PROGRAM_NAME , "test" , "<test<sp>dataset<sp>names>" } ) ; verify ( console ) . info ( contains ( "Description" ) ) ; verify ( console ) . info ( anyString ( ) , contains ( "Test<sp>description" ) ) ; verify ( console ) . info ( contains ( "Command<sp>options" ) ) ; verify ( console ) . info ( contains ( "Examples" ) ) ; verify ( console ) . info ( anyString ( ) , contains ( "this<sp>is<sp>a<sp>comment" ) ) ; verify ( console ) . info ( anyString ( ) , eq ( new java . lang . Object [ ] { Main . DEFAULT_PROGRAM_NAME , "test" , "test<sp>dataset-name" } ) ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . String ) { return new org . kitesdk . data . spi . predicates . TestRegisteredPredicateToFromString . Contains < java . lang . String > ( contained ) ; } | org . junit . Assert . assertEquals ( 0 , rc ) |
test ( ) { org . zkoss . zats . mimic . DesktopAgent desktop = connect ( ) ; org . zkoss . zats . mimic . ComponentAgent listbox = desktop . query ( "listbox" ) ; "<AssertPlaceHolder>" ; } query ( java . lang . String ) { final java . util . Iterator < org . zkoss . zk . ui . Component > found = org . zkoss . zk . ui . select . Selectors . iterable ( this , selector ) . iterator ( ) ; return found . hasNext ( ) ? found . next ( ) : null ; } | org . junit . Assert . assertTrue ( ( listbox != null ) ) |
metadataDocument ( ) { final org . apache . http . HttpResponse response = callUri ( "$metadata" ) ; checkMediaType ( response , HttpContentType . APPLICATION_XML_UTF8 ) ; "<AssertPlaceHolder>" ; notFound ( "$invalid" ) ; badRequest ( "$metadata?$format=atom" ) ; } getBody ( org . apache . http . HttpResponse ) { org . junit . Assert . assertNotNull ( response ) ; org . junit . Assert . assertNotNull ( response . getEntity ( ) ) ; org . junit . Assert . assertNotNull ( response . getEntity ( ) . getContent ( ) ) ; return com . sap . core . odata . testutil . helper . StringHelper . inputStreamToString ( response . getEntity ( ) . getContent ( ) ) ; } | org . junit . Assert . assertFalse ( getBody ( response ) . isEmpty ( ) ) |
responseShouldHaveCachedValueSet ( ) { org . codehaus . httpcache4j . Headers headers = new org . codehaus . httpcache4j . Headers ( ) . add ( org . codehaus . httpcache4j . CacheHeaderBuilder . getBuilder ( ) . createHITXCacheHeader ( ) ) ; org . codehaus . httpcache4j . HTTPResponse response = new org . codehaus . httpcache4j . HTTPResponse ( Status . OK , headers ) ; "<AssertPlaceHolder>" ; } isCached ( ) { return cached ; } | org . junit . Assert . assertTrue ( response . isCached ( ) ) |
testIsSSLNoPrivateHeadersTrue ( ) { mock . checking ( new org . jmock . Expectations ( ) { { one ( conn ) . getRequest ( ) ; will ( returnValue ( request ) ) ; one ( conn ) . useTrustedHeaders ( ) ; will ( returnValue ( false ) ) ; one ( conn ) . getTrustedHeader ( "$WSSC" ) ; will ( returnValue ( "https" ) ) ; one ( conn ) . getTrustedHeader ( "$WSIS" ) ; will ( returnValue ( "true" ) ) ; one ( conn ) . getTrustedHeader ( "X-Forwarded-Proto" ) ; will ( returnValue ( "wss" ) ) ; one ( conn ) . getSSLContext ( ) ; will ( returnValue ( sslCtx ) ) ; } } ) ; java . util . Map < java . lang . String , java . lang . Object > config = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; config . put ( "httpsIndicatorHeader" , "" ) ; com . ibm . wsspi . webcontainer . WCCustomProperties . setCustomProperties ( config ) ; com . ibm . ws . webcontainer . osgi . request . IRequestImpl iRequestImpl = new com . ibm . ws . webcontainer . osgi . request . IRequestImpl ( conn ) ; java . lang . Boolean ssl = iRequestImpl . isSSL ( ) ; "<AssertPlaceHolder>" ; } isSSL ( ) { boolean ssl = false ; boolean useForwarded = false ; if ( ( conn ) instanceof com . ibm . wsspi . http . ee7 . HttpInboundConnectionExtended ) { com . ibm . wsspi . http . ee7 . HttpInboundConnectionExtended ice = ( ( com . ibm . wsspi . http . ee7 . HttpInboundConnectionExtended ) ( conn ) ) ; if ( ice . useForwardedHeaders ( ) ) { useForwarded = true ; java . lang . String forwardedProto = ice . getRemoteProto ( ) ; if ( ( "https" . equalsIgnoreCase ( forwardedProto ) ) || ( "wss" . equalsIgnoreCase ( forwardedProto ) ) ) { ssl = true ; if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc . isDebugEnabled ( ) ) ) { com . ibm . websphere . ras . Tr . debug ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc , ( ( ( "<sp>isTrusted<sp>--><sp>true<sp>--><sp>containsHeader<sp>--><sp>X-Forwarded-Proto<sp>or<sp>Forwarded<sp>proto<sp>parameter<sp>--><sp>" + forwardedProto ) + "<sp>ssl<sp>--><sp>" ) + ssl ) ) ; } return ssl ; } } } if ( this . conn . useTrustedHeaders ( ) ) { if ( isHttpsIndicatorSecure ( ) ) { if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc . isDebugEnabled ( ) ) ) com . ibm . websphere . ras . Tr . debug ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc , "<sp>isTrusted<sp>--><sp>true,<sp>isHttpsIndicatorSecure<sp>--><sp>true<sp>ssl<sp>--><sp>true" ) ; return true ; } java . lang . String WSIS_header = this . conn . getTrustedHeader ( HttpHeaderKeys . HDR_ . WSIS . getName ( ) ) ; if ( WSIS_header != null ) { ssl = WSIS_header . equalsIgnoreCase ( "true" ) ; if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc . isDebugEnabled ( ) ) ) com . ibm . websphere . ras . Tr . debug ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc , ( "<sp>isTrusted<sp>--><sp>true<sp>ssl<sp>--><sp>" + ssl ) ) ; return ssl ; } java . lang . String FORWARDED_PROTO_header = this . conn . getTrustedHeader ( HttpHeaderKeys . HDR_X_FORWARDED_PROTO . getName ( ) ) ; if ( ( FORWARDED_PROTO_header != null ) && ( ! useForwarded ) ) { if ( ( FORWARDED_PROTO_header . equalsIgnoreCase ( "https" ) ) || ( FORWARDED_PROTO_header . equalsIgnoreCase ( "wss" ) ) ) { ssl = true ; if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc . isDebugEnabled ( ) ) ) com . ibm . websphere . ras . Tr . debug ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc , ( ( ( "<sp>isTrusted<sp>--><sp>true<sp>--><sp>containsHeader<sp>--><sp>X-Forwarded-Proto<sp>--><sp>" + FORWARDED_PROTO_header ) + "<sp>ssl<sp>--><sp>" ) + ssl ) ) ; return ssl ; } } } ssl = null != ( this . conn . getSSLContext ( ) ) ; if ( ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ) && ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc . isDebugEnabled ( ) ) ) com . ibm . websphere . ras . Tr . debug ( com . ibm . ws . webcontainer . osgi . request . IRequestImpl . tc , ( "<sp>ssl<sp>--><sp>" + ssl ) ) ; return ssl ; } | org . junit . Assert . assertTrue ( ssl ) |
shouldIgnoreUnknownBucketCapabilities ( ) { java . lang . String raw = com . couchbase . client . core . util . Resources . read ( "config_with_invalid_capability.json" , getClass ( ) ) ; com . couchbase . client . core . config . BucketConfig config = com . couchbase . client . core . config . parser . BucketConfigParser . parse ( raw , mock ( com . couchbase . client . core . env . CoreEnvironment . class ) , null ) ; "<AssertPlaceHolder>" ; } nodes ( ) { return nodeInfo ; } | org . junit . Assert . assertEquals ( 1 , config . nodes ( ) . size ( ) ) |
testSerialization ( ) { org . jfree . chart . axis . MonthDateFormat mf1 = new org . jfree . chart . axis . MonthDateFormat ( ) ; org . jfree . chart . axis . MonthDateFormat mf2 = ( ( org . jfree . chart . axis . MonthDateFormat ) ( org . jfree . chart . TestUtilities . serialised ( mf1 ) ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org . jfree . base . modules . PackageState ) ) { return false ; } final org . jfree . base . modules . PackageState packageState = ( ( org . jfree . base . modules . PackageState ) ( o ) ) ; if ( ! ( this . module . getModuleClass ( ) . equals ( packageState . module . getModuleClass ( ) ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( mf1 . equals ( mf2 ) ) |
testShiftRangeNullFloat ( ) { final float [ ] array = null ; org . apache . commons . lang3 . ArrayUtils . shift ( array , 1 , 1 , 1 ) ; "<AssertPlaceHolder>" ; } shift ( boolean [ ] , int , int , int ) { if ( array == null ) { return ; } if ( ( startIndexInclusive >= ( ( array . length ) - 1 ) ) || ( endIndexExclusive <= 0 ) ) { return ; } if ( startIndexInclusive < 0 ) { startIndexInclusive = 0 ; } if ( endIndexExclusive >= ( array . length ) ) { endIndexExclusive = array . length ; } int n = endIndexExclusive - startIndexInclusive ; if ( n <= 1 ) { return ; } offset %= n ; if ( offset < 0 ) { offset += n ; } while ( ( n > 1 ) && ( offset > 0 ) ) { final int n_offset = n - offset ; if ( offset > n_offset ) { org . apache . commons . lang3 . ArrayUtils . swap ( array , startIndexInclusive , ( ( startIndexInclusive + n ) - n_offset ) , n_offset ) ; n = offset ; offset -= n_offset ; } else if ( offset < n_offset ) { org . apache . commons . lang3 . ArrayUtils . swap ( array , startIndexInclusive , ( startIndexInclusive + n_offset ) , offset ) ; startIndexInclusive += offset ; n = n_offset ; } else { org . apache . commons . lang3 . ArrayUtils . swap ( array , startIndexInclusive , ( startIndexInclusive + n_offset ) , offset ) ; break ; } } } | org . junit . Assert . assertNull ( array ) |
deleteIndexVertexItem ( ) { final java . util . HashMap < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( "key" , "name" ) ; parameters . put ( "value" , "0" ) ; parameters . put ( "id" , "1" ) ; final com . tinkerpop . rexster . IndexResource resource = constructIndexResource ( true , parameters ) . getResource ( ) ; resource . deleteIndex ( graphName , "index-name-0" ) ; final com . tinkerpop . blueprints . Index < com . tinkerpop . blueprints . Vertex > idx = ( ( com . tinkerpop . blueprints . IndexableGraph ) ( this . toyGraph ) ) . getIndex ( "index-name-9" , com . tinkerpop . blueprints . Vertex . class ) ; final java . lang . Iterable < com . tinkerpop . blueprints . Vertex > vertices = idx . get ( "name" , "marko" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String , java . lang . Object ) { return null ; } | org . junit . Assert . assertFalse ( vertices . iterator ( ) . hasNext ( ) ) |
getParentVariableScope ( ) { "<AssertPlaceHolder>" ; } getVariableScope ( java . lang . String ) { switch ( codeOfScope ) { case "s" : return org . pentaho . di . trans . steps . scriptvalues_mod . ScriptValuesAddedFunctions . VariableScope . SYSTEM ; case "r" : return org . pentaho . di . trans . steps . scriptvalues_mod . ScriptValuesAddedFunctions . VariableScope . ROOT ; case "p" : return org . pentaho . di . trans . steps . scriptvalues_mod . ScriptValuesAddedFunctions . VariableScope . PARENT ; case "g" : return org . pentaho . di . trans . steps . scriptvalues_mod . ScriptValuesAddedFunctions . VariableScope . GRAND_PARENT ; default : throw org . mozilla . javascript . Context . reportRuntimeError ( ( "The<sp>argument<sp>type<sp>of<sp>function<sp>call<sp>" + "setVariable<sp>should<sp>either<sp>be<sp>\"s\",<sp>\"r\",<sp>\"p\",<sp>or<sp>\"g\"." ) ) ; } } | org . junit . Assert . assertEquals ( org . pentaho . di . trans . steps . scriptvalues_mod . ScriptValuesAddedFunctions . getVariableScope ( "p" ) , ScriptValuesAddedFunctions . VariableScope . PARENT ) |
testPOF ( ) { final java . lang . String query = "SELECT<sp>*<sp>{<sp>?s<sp><<sp>[<sp><name><sp>?n<sp>]<sp>}" ; final org . openrdf . sindice . query . parser . sparql . ast . ASTQueryContainer ast = org . openrdf . sindice . query . parser . sparql . ast . SyntaxTreeBuilder . parseQuery ( query ) ; final java . lang . String [ ] expectedVars = new java . lang . String [ ] { "?" + ( org . openrdf . sindice . query . parser . sparql . ast . SyntaxTreeBuilder . PointOfFocus ) , "n" , "s" } ; final java . lang . String [ ] actualVars = org . sindice . analytics . queryProcessor . ASTVarProcessor . process ( ast ) . toArray ( new java . lang . String [ 0 ] ) ; java . util . Arrays . sort ( actualVars ) ; "<AssertPlaceHolder>" ; } process ( org . openrdf . sindice . query . parser . sparql . ast . ASTQueryContainer ) { final java . util . Set < java . lang . String > vars = new java . util . HashSet < java . lang . String > ( ) ; final org . sindice . analytics . queryProcessor . ASTVarProcessor . ASTVarProcessorVisitor v = new org . sindice . analytics . queryProcessor . ASTVarProcessor . ASTVarProcessorVisitor ( ) ; v . visit ( ast , vars ) ; return vars ; } | org . junit . Assert . assertArrayEquals ( expectedVars , actualVars ) |
cascadeOnMethodReturningAParameterizedClassWithAGenericMethod ( mockit . CascadingWithGenericsTest$A ) { new mockit . Expectations ( ) { { a . getB ( ) . getValue ( ) ; result = "test" ; } } ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( "test" , a . getB ( ) . getValue ( ) ) |
testProcessNoOptions4 ( ) { java . util . List < java . lang . String > nonOptions = op . process ( com . google . common . collect . Lists . newArrayList ( "command" , "arg" , "arg" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( first ) != null ? first . count ( ) : 0 ; } | org . junit . Assert . assertEquals ( nonOptions . size ( ) , 2 ) |
countConsumerOnlyOnceIfMoreContractsMatchToSameConsumer ( ) { org . candlepin . model . Consumer c = createConsumer ( owner ) ; java . lang . String contr1 = "contract-1" ; java . lang . String contr2 = "contract-2" ; createProductAndBindItToConsumer ( owner , c , contr1 ) ; createProductAndBindItToConsumer ( owner , c , contr2 ) ; java . util . List < java . lang . String > contracts = new java . util . ArrayList ( ) ; contracts . add ( contr1 ) ; contracts . add ( contr2 ) ; int count = consumerCurator . countConsumers ( owner . getKey ( ) , typeLabels , skus , subscriptionIds , contracts ) ; "<AssertPlaceHolder>" ; } getKey ( ) { return key ; } | org . junit . Assert . assertEquals ( 1 , count ) |
testMisc ( ) { "<AssertPlaceHolder>" ; new com . liferay . portal . kernel . portlet . PortletIdCodec ( ) ; } generateInstanceId ( ) { return com . liferay . portal . kernel . util . StringUtil . randomString ( 12 ) ; } | org . junit . Assert . assertNotNull ( com . liferay . portal . kernel . portlet . PortletIdCodec . generateInstanceId ( ) ) |
test_min ( ) { "<AssertPlaceHolder>" ; } min ( int [ ] ) { return org . nutz . lang . Maths . takeOne ( new org . nutz . lang . Maths . CompareSomeThing ( ) { public boolean compare ( int arg0 , int arg1 ) { return arg0 < arg1 ; } } , nums ) ; } | org . junit . Assert . assertEquals ( org . nutz . lang . Maths . min ( nums ) , ( - 4 ) ) |
testContentTypeEvaluationNullOperation ( ) { java . lang . String methodName = "testContentTypeEvaluationNullOperation" ; ddf . catalog . pubsub . PredicateTest . LOGGER . debug ( ( ( "***************<sp>START:<sp>" + methodName ) + "<sp>*****************" ) ) ; ddf . catalog . data . impl . MetacardImpl metacard = new ddf . catalog . data . impl . MetacardImpl ( ) ; metacard . setMetadata ( ddf . catalog . pubsub . TestDataLibrary . getCatAndDogEntry ( ) ) ; ddf . catalog . pubsub . predicate . ContentTypePredicate ctp = new ddf . catalog . pubsub . predicate . ContentTypePredicate ( "type1" , "version1" ) ; java . util . HashMap < java . lang . String , java . lang . Object > properties = new java . util . HashMap ( ) ; properties . put ( PubSubConstants . HEADER_CONTENT_TYPE_KEY , "type1,version1" ) ; properties . put ( PubSubConstants . HEADER_OPERATION_KEY , null ) ; java . util . Map < java . lang . String , java . lang . Object > contextualMap = constructContextualMap ( metacard ) ; properties . put ( PubSubConstants . HEADER_CONTEXTUAL_KEY , contextualMap ) ; org . osgi . service . event . Event testEvent = new org . osgi . service . event . Event ( "topic" , properties ) ; "<AssertPlaceHolder>" ; ddf . catalog . pubsub . PredicateTest . LOGGER . debug ( ( ( "***************<sp>END:<sp>" + methodName ) + "<sp>*****************" ) ) ; } matches ( org . osgi . service . event . Event ) { java . lang . String methodName = "IO<sp>exception<sp>during<sp>context<sp>evaluation" 2 ; ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" 3 , methodName ) ; ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" 0 , properties ) ; ddf . catalog . pubsub . criteria . contextual . ContextualEvaluationCriteria cec = null ; java . util . Map < java . lang . String , java . lang . Object > contextualMap = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( properties . getProperty ( PubSubConstants . HEADER_CONTEXTUAL_KEY ) ) ) ; if ( contextualMap == null ) { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "No<sp>contextual<sp>metadata<sp>to<sp>search<sp>against." ) ; return false ; } java . lang . String operation = ( ( java . lang . String ) ( properties . getProperty ( PubSubConstants . HEADER_OPERATION_KEY ) ) ) ; ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "operation<sp>=<sp>{}" , operation ) ; java . lang . String metadata = ( ( java . lang . String ) ( contextualMap . get ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" 1 ) ) ) ; ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" 5 , metadata ) ; if ( ( operation . equals ( PubSubConstants . DELETE ) ) && ( metadata . equals ( PubSubConstants . METADATA_DELETED ) ) ) { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" 4 ) ; return true ; } if ( ( ( this . textPaths ) != null ) && ( ! ( this . textPaths . isEmpty ( ) ) ) ) { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "creating<sp>criteria<sp>with<sp>textPaths<sp>and<sp>metadata<sp>document" ) ; try { cec = new ddf . catalog . pubsub . criteria . contextual . ContextualEvaluationCriteriaImpl ( searchPhrase , fuzzy , caseSensitiveSearch , this . textPaths . toArray ( new java . lang . String [ this . textPaths . size ( ) ] ) , ( ( java . lang . String ) ( contextualMap . get ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" 1 ) ) ) ) ; } catch ( java . io . IOException e ) { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . error ( "IO<sp>exception<sp>during<sp>context<sp>evaluation" , e ) ; return false ; } } else { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "using<sp>default<sp>Lucene<sp>search<sp>index<sp>for<sp>metadata" ) ; cec = new ddf . catalog . pubsub . criteria . contextual . ContextualEvaluationCriteriaImpl ( searchPhrase , fuzzy , caseSensitiveSearch , ( ( org . apache . lucene . store . Directory ) ( contextualMap . get ( "DEFAULT_INDEX" ) ) ) ) ; } try { return ddf . catalog . pubsub . criteria . contextual . ContextualEvaluator . evaluate ( cec ) ; } catch ( java . io . IOException e ) { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . error ( "IO<sp>Exception<sp>evaluating<sp>context<sp>criteria" , e ) ; } catch ( org . apache . lucene . queryParser . ParseException e ) { ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . error ( "Parse<sp>Exception<sp>evaluating<sp>context<sp>criteria" , e ) ; } ddf . catalog . pubsub . predicate . ContextualPredicate . LOGGER . debug ( "EXITING:<sp>{}" , methodName ) ; return false ; } | org . junit . Assert . assertTrue ( ctp . matches ( testEvent ) ) |
interfaceNamesNull ( ) { com . navercorp . pinpoint . profiler . instrument . classreading . DefaultInternalClassMetadata classMetadata = new com . navercorp . pinpoint . profiler . instrument . classreading . DefaultInternalClassMetadata ( "java/lang/String" , "java/lang/Object" , null , java . util . Collections . < java . lang . String > emptyList ( ) , false , false , false , false ) ; "<AssertPlaceHolder>" ; } getInterfaceInternalNames ( ) { return java . util . Arrays . asList ( this . classReader . getInterfaces ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , classMetadata . getInterfaceInternalNames ( ) . size ( ) ) |
testGetMappingByNullIdReturnsNull ( ) { com . ocpsoft . pretty . faces . config . mapping . UrlMapping mapping2 = com . ocpsoft . pretty . faces . config . PrettyConfigTest . config . getMappingById ( null ) ; "<AssertPlaceHolder>" ; } getMappingById ( java . lang . String ) { if ( id != null ) { if ( id . startsWith ( PrettyContext . PRETTY_PREFIX ) ) { id = id . substring ( PrettyContext . PRETTY_PREFIX . length ( ) ) ; } for ( com . ocpsoft . pretty . faces . config . mapping . UrlMapping mapping : getMappings ( ) ) { if ( mapping . getId ( ) . equals ( id ) ) { return mapping ; } } } return null ; } | org . junit . Assert . assertEquals ( null , mapping2 ) |
removeIfTest ( ) { java . util . Collection < part2 . point . ColoredPoint > collection = new java . util . ArrayList ( ) ; collection . add ( new part2 . point . ColoredPoint ( 1.0 , 2.0 , 16711680 ) ) ; collection . add ( new part2 . point . ColoredPoint ( ( - 1.0 ) , ( - 2.0 ) , 255 ) ) ; collection . removeIf ( new java . util . function . Predicate < part2 . point . Point > ( ) { @ part2 . point . Override public boolean test ( part2 . point . Point point ) { return ( point . getX ( ) ) > 0.0 ; } } ) ; "<AssertPlaceHolder>" ; } size ( ) { part1 . SinglyLinkedList . Node current = start ; int result = 0 ; while ( current != null ) { current = current . next ; result ++ ; } return result ; } | org . junit . Assert . assertEquals ( 1 , collection . size ( ) ) |
testHybridisationSp3d1T ( ) { org . openscience . cdk . isomorphism . matchers . Expr expr = new org . openscience . cdk . isomorphism . matchers . Expr ( HYBRIDISATION_NUMBER , 4 ) ; org . openscience . cdk . interfaces . IAtom atom = mock ( org . openscience . cdk . interfaces . IAtom . class ) ; when ( atom . getHybridization ( ) ) . thenReturn ( IAtomType . Hybridization . SP3D1 ) ; "<AssertPlaceHolder>" ; } matches ( org . openscience . cdk . interfaces . IAtomContainer ) { return matches ( atomContainer , true ) ; } | org . junit . Assert . assertTrue ( expr . matches ( atom ) ) |
testDisableCache ( ) { org . jboss . forge . addon . projects . Projects . disableCache ( ) ; "<AssertPlaceHolder>" ; } isCacheDisabled ( ) { return org . jboss . forge . addon . projects . Projects . cacheDisabledFlag ; } | org . junit . Assert . assertTrue ( org . jboss . forge . addon . projects . Projects . isCacheDisabled ( ) ) |
queue ( ) { final ru . lessons . lesson_12 . BlockQueue < ru . lessons . lesson_10 . User > queue = new ru . lessons . lesson_12 . BlockQueue < ru . lessons . lesson_10 . User > ( ) ; final java . util . List < ru . lessons . lesson_12 . BlockQueueTest . Customer > customers = java . util . Arrays . asList ( new ru . lessons . lesson_12 . BlockQueueTest . Customer ( queue ) , new ru . lessons . lesson_12 . BlockQueueTest . Customer ( queue ) ) ; for ( ru . lessons . lesson_12 . BlockQueueTest . Customer customer : customers ) { customer . start ( ) ; } ru . lessons . lesson_12 . BlockQueueTest . Producer producer = new ru . lessons . lesson_12 . BlockQueueTest . Producer ( queue , java . util . Arrays . asList ( new ru . lessons . lesson_10 . User ( "1" , "1" ) , new ru . lessons . lesson_10 . User ( "2" , "2" ) , new ru . lessons . lesson_10 . User ( "3" , "3" ) , new ru . lessons . lesson_10 . User ( "4" , "4" ) ) ) ; producer . start ( ) ; producer . join ( ) ; java . lang . Thread . sleep ( 10L ) ; int count = 0 ; for ( ru . lessons . lesson_12 . BlockQueueTest . Customer customer : customers ) { count += customer . size ( ) ; } "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( count , producer . size ( ) ) |
testGetColor ( ) { System . out . println ( "getColor" ) ; java . awt . Color expResult = java . awt . Color . CYAN ; mudmap2 . backend . PlaceGroup instance = new mudmap2 . backend . PlaceGroup ( "myGroup" , expResult ) ; java . awt . Color result = instance . getColor ( ) ; "<AssertPlaceHolder>" ; } getColor ( ) { return color ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testSerialization ( ) { org . jfree . chart . labels . IntervalCategoryToolTipGenerator g1 = new org . jfree . chart . labels . IntervalCategoryToolTipGenerator ( "{3}<sp>-<sp>{4}" , java . text . DateFormat . getInstance ( ) ) ; org . jfree . chart . labels . IntervalCategoryToolTipGenerator g2 = ( ( org . jfree . chart . labels . IntervalCategoryToolTipGenerator ) ( org . jfree . chart . TestUtils . serialised ( g1 ) ) ) ; "<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 ( g1 , g2 ) |
CallFromInnerClass ( ) { java . lang . String fromClass = "Domain.Direct.Violating.CallFromInnerClass.CallingInnerClass" ; java . lang . String toClass = "Technology.Direct.Dao.CallInstanceOuterClassDAO.CallInstanceInnerClassDAO" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Call" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; } | org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , false ) ) |
testGridWithZeroLengthANDEmptyDelimiter_fail ( ) { expected = "Length<sp>should<sp>not<sp>be<sp>zero<sp>or<sp>negative" ; mixedSchemeGridRule . validate ( getSchema ( "0" , "" ) , "schema" ) ; "<AssertPlaceHolder>" ; } getErrorMessage ( ) { return errorMessage ; } | org . junit . Assert . assertEquals ( expected , mixedSchemeGridRule . getErrorMessage ( ) ) |
testGetFragmentSortColumnAllTypes ( ) { for ( org . sagebionetworks . repo . model . entity . SortBy sort : org . sagebionetworks . repo . model . entity . SortBy . values ( ) ) { java . lang . String result = org . sagebionetworks . repo . model . dbo . dao . NodeDAOImpl . getFragmentSortColumn ( sort ) ; "<AssertPlaceHolder>" ; } } getFragmentSortColumn ( org . sagebionetworks . repo . model . entity . SortBy ) { org . sagebionetworks . util . ValidateArgument . required ( sortBy , "sortBy" ) ; switch ( sortBy ) { case NAME : return org . sagebionetworks . repo . model . dbo . dao . NodeDAOImpl . N_NAME ; case CREATED_ON : return org . sagebionetworks . repo . model . dbo . dao . NodeDAOImpl . N_CREATED_ON ; default : throw new java . lang . IllegalArgumentException ( ( "Unknown<sp>SortBy:<sp>" + sortBy ) ) ; } } | org . junit . Assert . assertNotNull ( result ) |
testBind ( ) { control . bind ( session ) ; "<AssertPlaceHolder>" ; verify ( editor ) . bind ( session ) ; verify ( canvasHandler ) . addDomainObjectListener ( any ( org . kie . workbench . common . stunner . core . client . canvas . listener . CanvasDomainObjectListener . class ) ) ; } getExpressionEditor ( ) { return ( ( org . kie . workbench . common . dmn . client . editors . expressions . ExpressionEditorControl ) ( getSession ( ) . getCanvasControl ( org . kie . workbench . common . dmn . client . editors . expressions . ExpressionEditorControl . class ) ) ) . getExpressionEditor ( ) ; } | org . junit . Assert . assertNotNull ( control . getExpressionEditor ( ) ) |
testSelect3 ( ) { org . la4j . matrix . Matrix a = matrixA ( ) ; int [ ] rowInd = new int [ ] { 1 , 3 , 4 } ; int [ ] colInd = new int [ ] { 0 , 1 , 2 , 3 , 4 , 5 } ; org . la4j . matrix . Matrix b = m ( org . la4j . matrix . MatrixTest . a ( 3.96 , 8.26 , 2.51 , 9.61 , 4.63 , 6.12 ) , org . la4j . matrix . MatrixTest . a ( 3.43 , 9.08 , 1.16 , 2.3 , 3.66 , 4.93 ) , org . la4j . matrix . MatrixTest . a ( 7.05 , 7.75 , 8.11 , 2.93 , 9.04 , 6.72 ) ) ; "<AssertPlaceHolder>" ; } select ( int [ ] , int [ ] ) { int newRows = rowIndices . length ; int newCols = columnIndices . length ; if ( ( newRows == 0 ) || ( newCols == 0 ) ) { fail ( "No<sp>rows<sp>or<sp>columns<sp>selected." ) ; } int newCardinality = 0 ; for ( int i = 0 ; i < newRows ; i ++ ) { for ( int j = 0 ; j < newCols ; j ++ ) { if ( ( get ( rowIndices [ i ] , columnIndices [ j ] ) ) != 0.0 ) { newCardinality ++ ; } } } double [ ] newValues = new double [ newCardinality ] ; int [ ] newRowIndices = new int [ newCardinality ] ; int [ ] newColumnPointers = new int [ newCols + 1 ] ; newColumnPointers [ 0 ] = 0 ; int endPtr = 0 ; for ( int j = 0 ; j < newCols ; j ++ ) { newColumnPointers [ ( j + 1 ) ] = newColumnPointers [ j ] ; for ( int i = 0 ; i < newRows ; i ++ ) { double val = get ( rowIndices [ i ] , columnIndices [ j ] ) ; if ( val != 0.0 ) { newValues [ endPtr ] = val ; newRowIndices [ endPtr ] = i ; endPtr ++ ; ( newColumnPointers [ ( j + 1 ) ] ) ++ ; } } } return new org . la4j . matrix . sparse . CCSMatrix ( newRows , newCols , newCardinality , newValues , newRowIndices , newColumnPointers ) ; } | org . junit . Assert . assertEquals ( b , a . select ( rowInd , colInd ) ) |
testValidateClassImplementingCloneable ( ) { java . util . Set < javax . validation . ConstraintViolation < org . apache . bval . jsr . ValidationTest . TestCloneableClass > > errors = validator . validate ( new org . apache . bval . jsr . ValidationTest . TestCloneableClass ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return true ; } | org . junit . Assert . assertTrue ( errors . isEmpty ( ) ) |
testRegisterCustomerForSupplierMailServerNotAvailable ( ) { container . login ( java . lang . String . valueOf ( supplier1User . getKey ( ) ) , org . oscm . accountservice . bean . ROLE_SERVICE_MANAGER ) ; org . oscm . internal . vo . VOOrganization org = new org . oscm . internal . vo . VOOrganization ( ) ; org . setLocale ( Locale . ENGLISH . toString ( ) ) ; org . setDomicileCountry ( Locale . GERMANY . getCountry ( ) ) ; org . oscm . internal . vo . VOUserDetails user = new org . oscm . internal . vo . VOUserDetails ( ) ; user . setEMail ( org . oscm . accountservice . bean . TEST_MAIL_ADDRESS ) ; user . setLocale ( org . getLocale ( ) ) ; user . setUserId ( "AUser" ) ; try { throwMailOperationException = true ; int customersBefore = accountMgmt . getMyCustomers ( ) . size ( ) ; try { accountMgmt . registerKnownCustomer ( org , user , null , marketplaceId ) ; org . junit . Assert . fail ( "MailOperationException<sp>expected" ) ; } catch ( org . oscm . internal . types . exception . MailOperationException e ) { int customersAfter = accountMgmt . getMyCustomers ( ) . size ( ) ; "<AssertPlaceHolder>" ; } } finally { throwMailOperationException = false ; } } size ( ) { return ( fallBackObjKeys . size ( ) ) + 1 ; } | org . junit . Assert . assertEquals ( customersBefore , customersAfter ) |
testGetPolicyTransformer ( ) { gov . hhs . fha . nhinc . orchestration . Orchestratable instance = new gov . hhs . fha . nhinc . orchestration . OrchestratableTest . OrchestratableImpl ( ) ; gov . hhs . fha . nhinc . orchestration . PolicyTransformer expResult = null ; gov . hhs . fha . nhinc . orchestration . PolicyTransformer result = instance . getPolicyTransformer ( ) ; "<AssertPlaceHolder>" ; } getPolicyTransformer ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>supported<sp>yet." ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testChannelDescriptor ( ) { org . eclipse . kura . internal . driver . eddystone . EddystoneDriver svc = new org . eclipse . kura . internal . driver . eddystone . EddystoneDriver ( ) ; @ org . eclipse . kura . internal . driver . eddystone . SuppressWarnings ( "unchecked" ) java . util . List < org . eclipse . kura . core . configuration . metatype . Tad > elements = ( ( java . util . List < org . eclipse . kura . core . configuration . metatype . Tad > ) ( svc . getChannelDescriptor ( ) . getDescriptor ( ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return data . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , elements . size ( ) ) |
nary_in_int_array_returns_true_when_field_value_matches_expression ( ) { com . redhat . lightblue . query . QueryExpression q = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'field':'field6.nf3','op':'$in','values':[1,2,3,4]}" ) ; com . redhat . lightblue . eval . QueryEvaluator qe = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( q , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext ctx = qe . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; } | org . junit . Assert . assertTrue ( ctx . getResult ( ) ) |
testAssertionGroupsRequestWithInternalArtifact_Negative ( ) { System . out . println ( "\n***Starting<sp>testAssertionGroupsRequestWithInternalArtifact_Negative" ) ; org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionGroupsRequest request = new org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionGroupsRequest ( ) ; org . ebayopensource . turmeric . services . assertionsservice . junit . AssertionGroupAsset reference = createAssertionGroup ( ) ; request . getAssertionGroups ( ) . add ( reference ) ; org . ebayopensource . turmeric . services . assertionsservice . junit . AssertableArtifact artifact = createInternalArtifactWithFailingContent ( ) ; request . getArtifacts ( ) . add ( artifact ) ; java . lang . String result = processRequest ( request , org . ebayopensource . turmeric . services . assertionsservice . junit . NEGATIVE_CASE ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "testAssertionGroupsRequestWithInternalArtifact_Negative<sp>:<sp>" + result ) ) ; } processRequest ( org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionsRequest , java . lang . String ) { java . lang . String result = org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . FAIL ; try { org . ebayopensource . turmeric . services . assertionsservice . junit . ApplyAssertionsResponse response = consumer . applyAssertions ( request ) ; if ( response == null ) { throw new org . ebayopensource . turmeric . runtime . common . exceptions . ServiceException ( null , "Response<sp>object<sp>can<sp>not<sp>be<sp>null" , null ) ; } if ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . validateServiceResponse ( response , criteria ) . equalsIgnoreCase ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . SUCCESS ) ) { result = org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . PASS ; } if ( ( result != ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . PASS ) ) || ( ! ( criteria . equals ( org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . POSITIVE_CASE ) ) ) ) { displayResponse ( response ) ; } } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; result = org . ebayopensource . turmeric . services . assertionsservice . junit . BaseAssertionsServiceTest . FAIL ; } return result ; } | org . junit . Assert . assertEquals ( org . ebayopensource . turmeric . services . assertionsservice . junit . PASS , result ) |
missingAnnotationTest ( ) { when ( identity . isLoggedIn ( ) ) . thenReturn ( true ) ; when ( authenticatorInstance . isUnsatisfied ( ) ) . thenReturn ( false ) ; when ( authenticatorInstance . get ( ) ) . thenReturn ( mock ( org . picketlink . authentication . Authenticator . class ) ) ; "<AssertPlaceHolder>" ; } resolve ( ) { try { java . lang . String level = resolveLevel ( ) ; return levelFactoryResolver . resolve ( ) . createLevel ( level ) ; } catch ( org . picketlink . common . exceptions . PicketLinkException e ) { return null ; } } | org . junit . Assert . assertTrue ( ( ( resolver . resolve ( ) ) == null ) ) |
testSetLifecyclePaused ( ) { status . pauseMessageProcessing ( false ) ; "<AssertPlaceHolder>" ; verify ( eventBus ) . post ( Lifecycle . PAUSED ) ; } isProcessing ( ) { return isProcessing . get ( ) ; } | org . junit . Assert . assertFalse ( status . isProcessing ( ) ) |
testHandlesExtensions ( ) { java . io . File crlToChange = writeCRL ( createCRL ( ) ) ; org . candlepin . util . X509CRLStreamWriter stream = fileConstructor . newInstance ( crlToChange , ( ( java . security . interfaces . RSAPrivateKey ) ( keyPair . getPrivate ( ) ) ) , ( ( java . security . interfaces . RSAPublicKey ) ( keyPair . getPublic ( ) ) ) ) ; stream . preScan ( crlToChange ) . lock ( ) ; java . io . OutputStream o = new java . io . BufferedOutputStream ( new java . io . FileOutputStream ( outfile ) ) ; stream . write ( o ) ; o . close ( ) ; java . security . cert . X509CRL changedCrl = readCRL ( ) ; java . util . Set < java . math . BigInteger > discoveredSerials = new java . util . HashSet ( ) ; for ( java . security . cert . X509CRLEntry entry : changedCrl . getRevokedCertificates ( ) ) { discoveredSerials . add ( entry . getSerialNumber ( ) ) ; } java . util . Set < java . math . BigInteger > expected = new java . util . HashSet ( ) ; expected . add ( new java . math . BigInteger ( "100" ) ) ; "<AssertPlaceHolder>" ; } add ( org . candlepin . policy . ValidationResult ) { errors . addAll ( result . getErrors ( ) ) ; warnings . addAll ( result . getWarnings ( ) ) ; } | org . junit . Assert . assertEquals ( expected , discoveredSerials ) |
shouldGenerateAlternateElementsDueToGivenFunction ( ) { final com . google . common . base . Function < org . joda . time . LocalDate , org . joda . time . LocalDate > NEXT_WORKING_DAY = new com . google . common . base . Function < org . joda . time . LocalDate , org . joda . time . LocalDate > ( ) { @ com . qcadoo . commons . functional . Override public org . joda . time . LocalDate apply ( final org . joda . time . LocalDate prevDate ) { int prevDateDayOfWeek = prevDate . getDayOfWeek ( ) ; if ( prevDateDayOfWeek == 5 ) { return prevDate . plusDays ( 3 ) ; } if ( prevDateDayOfWeek == 6 ) { return prevDate . plusDays ( 2 ) ; } return prevDate . plusDays ( 1 ) ; } } ; org . joda . time . LocalDate thursday = new org . joda . time . LocalDate ( 2014 , 8 , 14 ) ; com . qcadoo . commons . functional . LazyStream < org . joda . time . LocalDate > stream = com . qcadoo . commons . functional . LazyStream . create ( thursday , NEXT_WORKING_DAY ) ; java . util . List < org . joda . time . LocalDate > nextFourDays = com . google . common . collect . FluentIterable . from ( stream ) . limit ( 4 ) . toList ( ) ; org . joda . time . LocalDate friday = thursday . plusDays ( 1 ) ; org . joda . time . LocalDate monday = friday . plusDays ( 3 ) ; org . joda . time . LocalDate tuesday = monday . plusDays ( 1 ) ; "<AssertPlaceHolder>" ; } create ( U , com . google . common . base . Function ) { return new com . qcadoo . commons . functional . LazyStream < U > ( firstElement , inductionStep ) ; } | org . junit . Assert . assertEquals ( com . google . common . collect . Lists . newArrayList ( thursday , friday , monday , tuesday ) , nextFourDays ) |
testCopyForAtPre ( ) { org . dresdenocl . modelinstancetype . test . tests . TestModelInstanceString . msg = org . dresdenocl . modelinstancetype . test . msg . ModelInstanceTypeTestSuiteMessages . TestModelInstanceString_CopyForAtPreIsWrong ; for ( org . dresdenocl . modelinstancetype . types . IModelInstanceString aString : org . dresdenocl . modelinstancetype . test . tests . TestModelInstanceString . instances_string ) { try { "<AssertPlaceHolder>" ; } catch ( org . dresdenocl . modelinstancetype . exception . CopyForAtPreException e ) { org . junit . Assert . fail ( org . dresdenocl . modelinstancetype . test . tests . TestModelInstanceString . msg ) ; } } copyForAtPre ( ) { org . dresdenocl . modelinstancetype . types . IModelInstanceElement result ; result = null ; if ( result == null ) { copyForAtPreWithReflections ( ) ; } return result ; } | org . junit . Assert . assertNotNull ( org . dresdenocl . modelinstancetype . test . tests . TestModelInstanceString . msg , aString . copyForAtPre ( ) ) |
testRemoveDisambiguation ( ) { java . lang . String content = "{{OtherTopics|Upgrade<sp>Instructions}}\ntest" ; java . lang . String expected = "\ntest" ; java . lang . String actual = _translate ( content ) ; "<AssertPlaceHolder>" ; } _translate ( com . liferay . portal . kernel . exception . PortalException ) { if ( portalException instanceof com . liferay . dynamic . data . mapping . exception . StorageFieldRequiredException ) { return new com . liferay . dynamic . data . mapping . kernel . StorageFieldRequiredException ( portalException . getMessage ( ) , portalException . getCause ( ) ) ; } return portalException ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testDateFunction ( ) { java . lang . String startDateString = "Tue<sp>Apr<sp>8<sp>10:30:57<sp>GMT<sp>2014" ; java . lang . String endDateString = "Wed<sp>Apr<sp>9<sp>10:30:57<sp>GMT<sp>2014" ; java . lang . String UPTIME = "UPTIME." ; java . lang . String dateFormat = "%a<sp>%b<sp>%e<sp>%H:%i:%s<sp>GMT<sp>%Y" ; java . lang . String colName = ( ( ( "STR_TO_DATE(`" + UPTIME ) + "`,<sp>'" ) + dateFormat ) + "Tue<sp>Apr<sp>8<sp>10:30:57<sp>GMT<sp>2014" 0 ; java . lang . String conditions = ( ( ( ( colName + "<sp>BETWEEN<sp>STR_TO_DATE('" ) + startDateString ) + "Tue<sp>Apr<sp>8<sp>10:30:57<sp>GMT<sp>2014" 1 ) + endDateString ) + "',<sp>'%a<sp>%b<sp>%e<sp>%H:%i:%s<sp>GMT<sp>%Y')" ; java . lang . String order = null ; java . lang . String sql = crq . generateSql ( "v" , null , conditions , null , order , "me" , null ) ; "<AssertPlaceHolder>" ; } generateSql ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . sql . Connection ) { datawave . webservice . results . cached . CachedResultsParameters . validate ( view ) ; java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; if ( org . apache . commons . lang . StringUtils . isEmpty ( org . apache . commons . lang . StringUtils . trimToNull ( fields ) ) ) fields = "*" ; if ( org . apache . commons . lang . StringUtils . isEmpty ( org . apache . commons . lang . StringUtils . trimToNull ( conditions ) ) ) conditions = null ; if ( org . apache . commons . lang . StringUtils . isEmpty ( org . apache . commons . lang . StringUtils . trimToNull ( order ) ) ) order = null ; if ( org . apache . commons . lang . StringUtils . isEmpty ( org . apache . commons . lang . StringUtils . trimToNull ( grouping ) ) ) grouping = null ; if ( null == ( this . viewColumnNames ) ) this . viewColumnNames = this . getViewColumnNames ( connection , view ) ; if ( ! ( fields . equals ( "*" ) ) ) { java . util . LinkedHashSet < java . lang . String > fieldSet = new java . util . LinkedHashSet ( ) ; java . lang . String [ ] result = datawave . webservice . results . cached . CachedRunningQuery . tokenizeOutsideParens ( fields , ',' ) ; java . util . LinkedHashSet < java . lang . String > requestedFieldSet = new java . util . LinkedHashSet ( ) ; for ( java . lang . String s : result ) { s = s . replace ( "`" , "" ) . trim ( ) ; s = quoteField ( s ) ; requestedFieldSet . add ( s ) ; } if ( ( requestedFieldSet . contains ( "*" ) ) == true ) { requestedFieldSet . remove ( "*" ) ; fieldSet . add ( "*" ) ; } else { fieldSet . addAll ( datawave . webservice . query . cachedresults . CacheableQueryRow . getFixedColumnSet ( ) ) ; } fieldSet . addAll ( requestedFieldSet ) ; fields = org . apache . commons . lang . StringUtils . join ( fieldSet , "'<sp>AND<sp>(" 4 ) ; } if ( null != conditions ) { java . lang . StringBuilder newConditions = new java . lang . StringBuilder ( ) ; java . lang . String [ ] conditionsSplit = conditions . split ( "<sp>" ) ; for ( java . lang . String s : conditionsSplit ) { java . lang . String field = s . replace ( "`" , "" ) . trim ( ) ; if ( ( variableFields . contains ( field ) ) || ( isFunction ( field ) ) ) { newConditions . append ( quoteField ( field ) ) . append ( datawave . webservice . results . cached . CachedRunningQuery . SPACE ) ; } else { newConditions . append ( s ) . append ( datawave . webservice . results . cached . CachedRunningQuery . SPACE ) ; } } if ( newConditions . toString ( ) . trim ( ) . isEmpty ( ) ) { conditions = null ; } else { conditions = newConditions . toString ( ) . trim ( ) ; } } order = buildOrderClause ( order ) ; if ( null != grouping ) { java . util . List < java . lang . String > newGroup = new java . util . ArrayList ( ) ; java . lang . String [ ] groupSplit = grouping . split ( "'<sp>AND<sp>(" 4 ) ; for ( java . lang . String s : groupSplit ) { s = s . replace ( "`" , "" ) . trim ( ) ; newGroup . add ( quoteField ( s ) ) ; } if ( newGroup . isEmpty ( ) ) { grouping = null ; } else { grouping = org . apache . commons . lang . StringUtils . join ( newGroup , "'<sp>AND<sp>(" 4 ) ; } } if ( ( conditions == null ) || ( conditions . isEmpty ( ) ) ) { conditions = ( "'<sp>AND<sp>(" 3 + user ) + "'" ; } else { conditions = ( ( ( "'<sp>AND<sp>(" 3 + user ) + "'<sp>AND<sp>(" ) + conditions ) + ")" ; } buf . append ( "'<sp>AND<sp>(" 2 ) . append ( fields ) . append ( "'<sp>AND<sp>(" 5 ) . append ( view ) ; if ( null != conditions ) buf . append ( "<sp>WHERE<sp>" ) . append ( conditions ) ; if ( null != grouping ) buf . append ( "<sp>GROUP<sp>BY<sp>" ) . append ( grouping ) ; if ( null != order ) buf . | org . junit . Assert . assertEquals ( "Tue<sp>Apr<sp>8<sp>10:30:57<sp>GMT<sp>2014" 2 , sql ) |
test_api_keys_get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "api_keys" ) ; request . addQueryParam ( "limit" , "1" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; } | org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) ) |
testReturnOriginalStateOne ( ) { final com . orientechnologies . orient . core . record . impl . ODocument doc = new com . orientechnologies . orient . core . record . impl . ODocument ( ) ; final com . orientechnologies . orient . core . db . record . OTrackedList < java . lang . String > trackedList = new com . orientechnologies . orient . core . db . record . OTrackedList < java . lang . String > ( doc ) ; trackedList . add ( "value10" 0 ) ; trackedList . add ( "value2" ) ; trackedList . add ( "value3" ) ; trackedList . add ( "value4" ) ; trackedList . add ( "value5" ) ; final java . util . List < java . lang . String > original = new java . util . ArrayList < java . lang . String > ( trackedList ) ; final java . util . List < com . orientechnologies . orient . core . db . record . OMultiValueChangeEvent < java . lang . Integer , java . lang . String > > firedEvents = new java . util . ArrayList < com . orientechnologies . orient . core . db . record . OMultiValueChangeEvent < java . lang . Integer , java . lang . String > > ( ) ; trackedList . addChangeListener ( new com . orientechnologies . orient . core . db . record . OMultiValueChangeListener < java . lang . Integer , java . lang . String > ( ) { public void onAfterRecordChanged ( final com . orientechnologies . orient . core . db . record . OMultiValueChangeEvent < java . lang . Integer , java . lang . String > event ) { firedEvents . add ( event ) ; } } ) ; trackedList . add ( "value6" ) ; trackedList . add ( "value7" ) ; trackedList . set ( 2 , "value10" ) ; trackedList . add ( 1 , "value8" ) ; trackedList . add ( 1 , "value8" ) ; trackedList . remove ( 3 ) ; trackedList . remove ( "value7" ) ; trackedList . add ( 0 , "value9" ) ; trackedList . add ( 0 , "value9" ) ; trackedList . add ( 0 , "value9" ) ; trackedList . add ( 0 , "value9" ) ; trackedList . remove ( "value9" ) ; trackedList . remove ( "value9" ) ; trackedList . add ( 4 , "value11" ) ; "<AssertPlaceHolder>" ; } returnOriginalState ( com . orientechnologies . orient . core . db . record . List ) { final com . orientechnologies . orient . core . db . record . Set < com . orientechnologies . orient . core . db . record . OIdentifiable > reverted = new com . orientechnologies . orient . core . db . record . HashSet < com . orientechnologies . orient . core . db . record . OIdentifiable > ( this ) ; final com . orientechnologies . orient . core . db . record . ListIterator < com . orientechnologies . orient . core . db . record . OMultiValueChangeEvent < com . orientechnologies . orient . core . db . record . OIdentifiable , com . orientechnologies . orient . core . db . record . OIdentifiable > > listIterator = events . listIterator ( events . size ( ) ) ; while ( listIterator . hasPrevious ( ) ) { final com . orientechnologies . orient . core . db . record . OMultiValueChangeEvent < com . orientechnologies . orient . core . db . record . OIdentifiable , com . orientechnologies . orient . core . db . record . OIdentifiable > event = listIterator . previous ( ) ; switch ( event . getChangeType ( ) ) { case ADD : reverted . remove ( event . getKey ( ) ) ; break ; case REMOVE : reverted . add ( event . getOldValue ( ) ) ; break ; default : throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>change<sp>type<sp>:<sp>" + ( event . getChangeType ( ) ) ) ) ; } } return reverted ; } | org . junit . Assert . assertEquals ( original , trackedList . returnOriginalState ( firedEvents ) ) |
getBijhoudingsaardTestOK ( ) { final nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpBijhoudingsaardCode baCode = nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpBijhoudingsaardCode . INGEZETENE ; final nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Bijhoudingsaard expectedBa = nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Bijhoudingsaard . INGEZETENE ; final java . lang . String expected = java . lang . String . format ( nl . bzk . migratiebrp . ggo . viewer . service . impl . BrpStamtabelServiceTest . STRING_FORMAT , expectedBa . getCode ( ) , expectedBa . getNaam ( ) ) ; final java . lang . String resultAt = brpStamtabelService . getBijhoudingsaard ( baCode . getWaarde ( ) ) ; "<AssertPlaceHolder>" ; } getWaarde ( ) { return waarde ; } | org . junit . Assert . assertEquals ( expected , resultAt ) |
interceptCall_restoresIfListenerThrows ( ) { io . grpc . Context origContext = io . grpc . Context . current ( ) ; final io . grpc . ServerCall . Listener < java . lang . Object > listener = new io . grpc . ServerCall . Listener < java . lang . Object > ( ) { @ java . lang . Override public void onMessage ( java . lang . Object messageIn ) { throw new java . lang . RuntimeException ( ) ; } @ java . lang . Override public void onHalfClose ( ) { throw new java . lang . RuntimeException ( ) ; } @ java . lang . Override public void onCancel ( ) { throw new java . lang . RuntimeException ( ) ; } @ java . lang . Override public void onComplete ( ) { throw new java . lang . RuntimeException ( ) ; } @ java . lang . Override public void onReady ( ) { throw new java . lang . RuntimeException ( ) ; } } ; io . grpc . ServerCall . Listener < java . lang . Object > wrapped = io . grpc . Contexts . interceptCall ( uniqueContext , call , headers , new io . grpc . ServerCallHandler < java . lang . Object , java . lang . Object > ( ) { @ io . grpc . Override public io . grpc . ServerCall . Listener < java . lang . Object > startCall ( io . grpc . ServerCall < java . lang . Object , java . lang . Object > call , io . grpc . Metadata headers ) { return listener ; } } ) ; try { wrapped . onMessage ( new java . lang . Object ( ) ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( java . lang . RuntimeException expected ) { } try { wrapped . onHalfClose ( ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( java . lang . RuntimeException expected ) { } try { wrapped . onCancel ( ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( java . lang . RuntimeException expected ) { } try { wrapped . onComplete ( ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( java . lang . RuntimeException expected ) { } try { wrapped . onReady ( ) ; org . junit . Assert . fail ( "Exception<sp>expected" ) ; } catch ( java . lang . RuntimeException expected ) { } "<AssertPlaceHolder>" ; } current ( ) { return null ; } | org . junit . Assert . assertSame ( origContext , io . grpc . Context . current ( ) ) |
step5_testUpdateMetadata ( ) { java . util . concurrent . ConcurrentHashMap < java . lang . String , org . apache . vxquery . runtime . functions . index . update . XmlMetadata > fromFileMap = org . apache . vxquery . indexing . MetaFileUtilTest . metaFileUtil . getMetadata ( ) ; org . apache . vxquery . runtime . functions . index . update . XmlMetadata modified = fromFileMap . get ( TestConstants . XML_FILE ) ; java . io . File xml = new java . io . File ( TestConstants . XML_FILE ) ; modified . setMd5 ( org . apache . vxquery . indexing . MetaFileUtilTest . metaFileUtil . generateMD5 ( xml ) ) ; fromFileMap . replace ( TestConstants . XML_FILE , modified ) ; org . apache . vxquery . indexing . MetaFileUtilTest . metaFileUtil . updateMetadataMap ( fromFileMap , TestConstants . INDEX_DIR ) ; "<AssertPlaceHolder>" ; } getMetadata ( ) { return this . indexMap ; } | org . junit . Assert . assertNotNull ( org . apache . vxquery . indexing . MetaFileUtilTest . metaFileUtil . getMetadata ( ) ) |
executeJarExitException ( ) { int [ ] exitCode = new int [ ] { - 1 } ; org . spincast . plugins . processutils . JarExecutionHandlerDefault handler = new org . spincast . plugins . processutils . JarExecutionHandlerDefault ( ) { @ org . spincast . plugins . processutils . tests . Override public void onExit ( int exitVal ) { exitCode [ 0 ] = exitVal ; } } ; getSpincastProcessUtils ( ) . executeJar ( getMavenProjectJarFile ( ) . getAbsolutePath ( ) , com . google . common . collect . Lists . newArrayList ( "100" ) , handler ) ; try { org . spincast . testing . core . utils . SpincastTestingUtils . waitForTrue ( new org . spincast . testing . core . utils . TrueChecker ( ) { @ org . spincast . plugins . processutils . tests . Override public boolean check ( ) { return ( exitCode [ 0 ] ) > ( - 1 ) ; } } , 5000 ) ; "<AssertPlaceHolder>" ; } finally { handler . killJarProcess ( ) ; } } check ( ) { return ( getServer ( ) . getWebsocketEndpointManager ( "endpoint1" ) . getPeersIds ( ) . size ( ) ) == 1 ; } | org . junit . Assert . assertEquals ( 1 , exitCode [ 0 ] ) |
testGetVertex ( ) { System . out . println ( "--<sp>testGetVertex" ) ; com . tinkerpop . blueprints . Vertex v_1 = com . couchbase . graph . CBGraphTest . graph . addVertex ( "tgv_1" ) ; System . out . println ( ( "v_1<sp>=<sp>" + ( v_1 . toString ( ) ) ) ) ; com . tinkerpop . blueprints . Vertex v_1_2 = com . couchbase . graph . CBGraphTest . graph . getVertex ( "tgv_1" ) ; System . out . println ( ( "v_1_2<sp>=<sp>" + ( v_1_2 . toString ( ) ) ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( "Could<sp>not<sp>connect<sp>to<sp>the<sp>Couchbase<sp>cluster<sp>by<sp>using<sp>the<sp>following<sp>hosts<sp>" + ( java . util . Arrays . toString ( cfg . getHosts ( ) ) ) ) + ":" ) + ( inner . getMessage ( ) ) ; } | org . junit . Assert . assertEquals ( v_1 . toString ( ) , v_1_2 . toString ( ) ) |
roundTripOfCustomModelWithNegativeDomPattern ( ) { java . lang . Object model = net . time4j . tz . threeten . NegativeDayOfMonthPatternTest . createModel ( ) ; java . lang . Object copy = net . time4j . tz . threeten . NegativeDayOfMonthPatternTest . roundtrip ( model ) ; "<AssertPlaceHolder>" ; } roundtrip ( java . lang . Object ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( baos ) ; oos . writeObject ( obj ) ; byte [ ] data = baos . toByteArray ( ) ; oos . close ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( data ) ; java . io . ObjectInputStream ois = new java . io . ObjectInputStream ( bais ) ; java . lang . Object ser = ois . readObject ( ) ; ois . close ( ) ; return ser ; } | org . junit . Assert . assertThat ( model , org . hamcrest . CoreMatchers . is ( copy ) ) |
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . TeamDomainChangeEvent event = new com . github . seratch . jslack . api . model . event . TeamDomainChangeEvent ( ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"team_domain_change\"}" ; "<AssertPlaceHolder>" ; } createSnakeCase ( ) { return new com . google . gson . GsonBuilder ( ) . setFieldNamingPolicy ( FieldNamingPolicy . LOWER_CASE_WITH_UNDERSCORES ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . LayoutBlock . class , new com . github . seratch . jslack . common . json . GsonLayoutBlockFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . composition . TextObject . class , new com . github . seratch . jslack . common . json . GsonTextObjectFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . ContextBlockElement . class , new com . github . seratch . jslack . common . json . GsonContextBlockElementFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . element . BlockElement . class , new com . github . seratch . jslack . common . json . GsonBlockElementFactory ( ) ) . create ( ) ; } | org . junit . Assert . assertThat ( generatedJson , org . hamcrest . CoreMatchers . is ( expectedJson ) ) |
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . sync . model . SyncDevice . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "syncDeviceId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . sync . model . SyncDevice > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testJoinElementsNull ( ) { java . util . Set < java . lang . String > elements = null ; java . lang . String separator = "," ; java . lang . String join = com . erudika . para . utils . filters . CORSFilter . join ( elements , separator ) ; "<AssertPlaceHolder>" ; } join ( java . util . Collection , java . lang . String ) { java . lang . String separator = "," ; if ( elements == null ) { return null ; } if ( joinSeparator != null ) { separator = joinSeparator ; } java . lang . StringBuilder buffer = new java . lang . StringBuilder ( ) ; boolean isFirst = true ; for ( java . lang . String element : elements ) { if ( ! isFirst ) { buffer . append ( separator ) ; } else { isFirst = false ; } if ( element != null ) { buffer . append ( element ) ; } } return buffer . toString ( ) ; } | org . junit . Assert . assertNull ( join ) |
testBadInit15 ( ) { thrown . expect ( org . apache . kylin . cube . IllegalStateException . class ) ; org . apache . kylin . cube . model . CubeDesc cubeDesc = org . apache . kylin . cube . CubeDescManager . getInstance ( getTestConfig ( ) ) . getCubeDesc ( org . apache . kylin . cube . CubeDescTest . CUBE_WITH_SLR_DESC ) ; org . apache . kylin . metadata . model . MeasureDesc measureForTransCnt = cubeDesc . getMeasures ( ) . get ( 3 ) ; "<AssertPlaceHolder>" ; thrown . expectMessage ( ( ( "measure<sp>(" + ( measureForTransCnt . getName ( ) ) ) + ")<sp>duplicates" ) ) ; org . apache . kylin . cube . model . HBaseColumnDesc colDesc = new org . apache . kylin . cube . model . HBaseColumnDesc ( ) ; colDesc . setQualifier ( "M" ) ; colDesc . setMeasureRefs ( new java . lang . String [ ] { "GMV_SUM" , "GMV_MIN" , "GMV_MAX" , "TRANS_CNT" , "TRANS_CNT" , "ITEM_COUNT_SUM" } ) ; cubeDesc . getHbaseMapping ( ) . getColumnFamily ( ) [ 0 ] . getColumns ( ) [ 0 ] = colDesc ; cubeDesc . initMeasureReferenceToColumnFamily ( ) ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( measureForTransCnt . getName ( ) , "TRANS_CNT" ) |
testJavaPathCmd ( ) { org . junit . Assume . assumeTrue ( com . dslplatform . compiler . client . Utils . isWindows ( ) ) ; context . put ( JavaPath . INSTANCE , ( ( com . dslplatform . compiler . client . parameters . JavaPathTest . fakeJavaPath ) + "/cmd" ) ) ; "<AssertPlaceHolder>" ; } check ( com . dslplatform . compiler . client . parameters . Context ) { if ( context . contains ( com . dslplatform . compiler . client . parameters . JavaPath . INSTANCE ) ) { final java . lang . String path = context . get ( com . dslplatform . compiler . client . parameters . JavaPath . INSTANCE ) ; final com . dslplatform . compiler . client . parameters . Either < java . lang . String > javac = com . dslplatform . compiler . client . parameters . Utils . findCommand ( context , path , "javac" , "Usage:<sp>javac" ) ; if ( ! ( javac . isSuccess ( ) ) ) { context . error ( "java<sp>parameter<sp>is<sp>set,<sp>but<sp>Java<sp>compiler<sp>not<sp>found/doesn't<sp>work.<sp>Please<sp>check<sp>specified<sp>java<sp>parameter." ) ; context . error ( ( "Trying<sp>to<sp>find<sp>javac<sp>in<sp>" + path ) ) ; return false ; } final com . dslplatform . compiler . client . parameters . Either < java . lang . String > jar = com . dslplatform . compiler . client . parameters . Utils . findCommand ( context , path , "jar" , "Usage:<sp>jar" ) ; if ( ! ( jar . isSuccess ( ) ) ) { context . error ( "java<sp>parameter<sp>is<sp>set,<sp>but<sp>Java<sp>archive<sp>tool<sp>not<sp>found/doesn't<sp>work.<sp>Please<sp>check<sp>specified<sp>java<sp>parameter." ) ; context . error ( ( "Trying<sp>to<sp>find<sp>jar<sp>in<sp>" + path ) ) ; return false ; } context . cache ( ( ( com . dslplatform . compiler . client . parameters . JavaPath . CACHE_FILE_PREFIX ) + "javac" ) , javac . get ( ) ) ; context . cache ( ( ( com . dslplatform . compiler . client . parameters . JavaPath . CACHE_FILE_PREFIX ) + "jar" ) , jar . get ( ) ) ; } return true ; } | org . junit . Assert . assertTrue ( JavaPath . INSTANCE . check ( context ) ) |
testCount ( ) { int total = dao . count ( ) ; "<AssertPlaceHolder>" ; } count ( ) { long c = ( ( java . lang . Long ) ( currentSession ( ) . createCriteria ( uk . ac . bbsrc . tgac . miso . core . data . ArrayRun . class ) . setProjection ( org . hibernate . criterion . Projections . rowCount ( ) ) . uniqueResult ( ) ) ) ; return ( ( int ) ( c ) ) ; } | org . junit . Assert . assertEquals ( 3 , total ) |
testGetGreetingCorrectActionCapital ( ) { when ( mockEditor . composeEmail ( ) ) . thenReturn ( "test<sp>email" ) ; java . lang . String reply = emailController . getGreeting ( "COMPOSE" ) ; "<AssertPlaceHolder>" ; } composeEmail ( ) { return "hola<sp>mundo" ; } | org . junit . Assert . assertEquals ( "test<sp>email" , reply ) |
testInvalidAssociationEnd ( ) { when ( plugin . isAssociationEnd ( org . mockito . Mockito . any ( org . slc . sli . modeling . tools . xmigen . ClassType . class ) , org . mockito . Mockito . any ( org . slc . sli . modeling . tools . xmigen . Attribute . class ) , org . mockito . Mockito . any ( org . slc . sli . modeling . tools . xmigen . Xsd2UmlPluginHost . class ) ) ) . thenReturn ( true ) ; when ( plugin . getAssociationEndTypeName ( org . mockito . Mockito . any ( org . slc . sli . modeling . tools . xmigen . ClassType . class ) , org . mockito . Mockito . any ( org . slc . sli . modeling . tools . xmigen . Attribute . class ) , org . mockito . Mockito . any ( org . slc . sli . modeling . tools . xmigen . Xsd2UmlPluginHost . class ) ) ) . thenReturn ( "test" ) ; "<AssertPlaceHolder>" ; } link ( org . slc . sli . modeling . uml . Model , org . slc . sli . modeling . tools . xmigen . Xsd2UmlHostedPlugin ) { final org . slc . sli . modeling . uml . index . ModelIndex indexedModel = new org . slc . sli . modeling . uml . index . DefaultModelIndex ( model ) ; final java . util . Map < java . lang . String , org . slc . sli . modeling . uml . Identifier > nameToClassTypeId = org . slc . sli . modeling . tools . xmigen . Xsd2UmlLinker . makeNameToClassTypeId ( indexedModel . getClassTypes ( ) . values ( ) ) ; final java . util . Map < org . slc . sli . modeling . uml . Type , java . util . Map < java . lang . String , org . slc . sli . modeling . uml . AssociationEnd > > navigations = new java . util . HashMap < org . slc . sli . modeling . uml . Type , java . util . Map < java . lang . String , org . slc . sli . modeling . uml . AssociationEnd > > ( ) ; final java . util . List < org . slc . sli . modeling . uml . NamespaceOwnedElement > ownedElements = new java . util . LinkedList < org . slc . sli . modeling . uml . NamespaceOwnedElement > ( ) ; for ( final org . slc . sli . modeling . uml . NamespaceOwnedElement ownedElement : model . getOwnedElements ( ) ) { if ( ownedElement instanceof org . slc . sli . modeling . uml . ClassType ) { final org . slc . sli . modeling . uml . ClassType classType = ( ( org . slc . sli . modeling . uml . ClassType ) ( ownedElement ) ) ; ownedElements . add ( org . slc . sli . modeling . tools . xmigen . Xsd2UmlLinker . cleanUpClassType ( classType , plugin , indexedModel , nameToClassTypeId , navigations ) ) ; } else { ownedElements . add ( ownedElement ) ; } } final org . slc . sli . modeling . tools . xmigen . Xsd2UmlPluginHost host = new org . slc . sli . modeling . tools . xmigen . Xsd2UmlPluginHostAdapter ( indexedModel ) ; ownedElements . addAll ( org . slc . sli . modeling . tools . xmigen . Xsd2UmlLinker . makeAssociations ( navigations , indexedModel , plugin , host ) ) ; return new org . slc . sli . modeling . uml . Model ( org . slc . sli . modeling . uml . Identifier . random ( ) , model . getName ( ) , model . getTaggedValues ( ) , ownedElements ) ; } | org . junit . Assert . assertNotNull ( org . slc . sli . modeling . tools . xmigen . Xsd2UmlLinker . link ( model , plugin ) ) |
testDuplicateTestResults ( ) { hudson . tasks . Maven . MavenInstallation mavenInstallation = configureMaven3x ( ) ; hudson . maven . MavenModuleSet m = j . jenkins . createProject ( hudson . maven . MavenModuleSet . class , "p" ) ; m . setMaven ( mavenInstallation . getName ( ) ) ; m . getReporters ( ) . add ( new hudson . maven . AbstractMaven3xBuildTest . TestReporter ( ) ) ; m . setScm ( new org . jvnet . hudson . test . ExtractResourceSCM ( getClass ( ) . getResource ( "JENKINS-1557.zip" ) ) ) ; m . setGoals ( "verify" ) ; j . buildAndAssertSuccess ( m ) ; int totalCount = m . getModules ( ) . iterator ( ) . next ( ) . getAction ( hudson . tasks . test . TestResultProjectAction . class ) . getLastTestResultAction ( ) . getTotalCount ( ) ; "<AssertPlaceHolder>" ; } iterator ( ) { return master . iterator ( ) ; } | org . junit . Assert . assertEquals ( 4 , totalCount ) |
returnsFalseWhenLockingNullPatient ( ) { org . mockito . Mockito . doReturn ( null ) . when ( this . patientDocument ) . getXObject ( org . mockito . Matchers . < org . xwiki . model . reference . EntityReference > any ( ) ) ; org . mockito . Mockito . doReturn ( true ) . when ( this . entityAccess ) . hasAccessLevel ( this . manageAccessLevel ) ; org . phenotips . recordLocking . PatientRecordLockManager mockedLockManager = this . mocker . getComponentUnderTest ( ) ; "<AssertPlaceHolder>" ; } lockPatientRecord ( org . phenotips . data . Patient ) { try { com . xpn . xwiki . doc . XWikiDocument patientDocument = patient . getXDocument ( ) ; if ( ( ! ( this . isDocumentLocked ( patientDocument ) ) ) && ( this . hasLockingPermission ( patient ) ) ) { com . xpn . xwiki . XWikiContext context = this . contextProvider . get ( ) ; com . xpn . xwiki . XWiki xwiki = context . getWiki ( ) ; patientDocument . createXObject ( this . lockClassReference , context ) ; xwiki . saveDocument ( patientDocument , "Locked<sp>patient<sp>record" , true , context ) ; return true ; } else { return false ; } } catch ( com . xpn . xwiki . XWikiException | java . lang . NullPointerException e ) { return false ; } } | org . junit . Assert . assertFalse ( mockedLockManager . lockPatientRecord ( null ) ) |
testWhereClauseWithParenthesis ( ) { org . nuxeo . ecm . core . query . sql . model . SQLQuery query = org . nuxeo . ecm . core . query . sql . SQLQueryParser . parse ( "SELECT<sp>p1,<sp>p2<sp>FROM<sp>t<sp>WHERE<sp>(title<sp>=<sp>\"test\"<sp>OR<sp>p2<sp>>=<sp>10.2)<sp>AND<sp>p1<sp>+<sp>p2<sp><<sp>5" ) ; org . nuxeo . ecm . core . query . sql . model . Predicate expr1 = new org . nuxeo . ecm . core . query . sql . model . Predicate ( new org . nuxeo . ecm . core . query . sql . model . Reference ( "title" ) , org . nuxeo . ecm . core . query . sql . model . Operator . EQ , new org . nuxeo . ecm . core . query . sql . model . StringLiteral ( "test" ) ) ; org . nuxeo . ecm . core . query . sql . model . Expression expr2 = new org . nuxeo . ecm . core . query . sql . model . Expression ( new org . nuxeo . ecm . core . query . sql . model . Reference ( "p2" ) , org . nuxeo . ecm . core . query . sql . model . Operator . GTEQ , new org . nuxeo . ecm . core . query . sql . model . DoubleLiteral ( 10.2 ) ) ; expr1 = new org . nuxeo . ecm . core . query . sql . model . Predicate ( expr1 , org . nuxeo . ecm . core . query . sql . model . Operator . OR , expr2 ) ; expr2 = new org . nuxeo . ecm . core . query . sql . model . Expression ( new org . nuxeo . ecm . core . query . sql . model . Reference ( "p1" ) , org . nuxeo . ecm . core . query . sql . model . Operator . SUM , new org . nuxeo . ecm . core . query . sql . model . Reference ( "p2" ) ) ; expr2 = new org . nuxeo . ecm . core . query . sql . model . Expression ( expr2 , org . nuxeo . ecm . core . query . sql . model . Operator . LT , new org . nuxeo . ecm . core . query . sql . model . IntegerLiteral ( 5 ) ) ; org . nuxeo . ecm . core . query . sql . model . Predicate pred = new org . nuxeo . ecm . core . query . sql . model . Predicate ( expr1 , org . nuxeo . ecm . core . query . sql . model . Operator . AND , expr2 ) ; org . nuxeo . ecm . core . query . sql . model . SQLQuery myquery = new org . nuxeo . ecm . core . query . sql . model . SQLQuery ( new org . nuxeo . ecm . core . query . sql . model . SelectClause ( ) , new org . nuxeo . ecm . core . query . sql . model . FromClause ( ) , new org . nuxeo . ecm . core . query . sql . model . WhereClause ( pred ) ) ; myquery . getSelectClause ( ) . add ( new org . nuxeo . ecm . core . query . sql . model . Reference ( "p1" ) ) ; myquery . getSelectClause ( ) . add ( new org . nuxeo . ecm . core . query . sql . model . Reference ( "p2" ) ) ; myquery . getFromClause ( ) . add ( "t" ) ; "<AssertPlaceHolder>" ; } add ( org . nuxeo . runtime . pubsub . SerializableAccumulableInvalidations ) { org . nuxeo . ecm . core . storage . sql . Invalidations other = ( ( org . nuxeo . ecm . core . storage . sql . Invalidations ) ( o ) ) ; if ( other == null ) { return ; } if ( all ) { return ; } if ( other . all ) { setAll ( ) ; return ; } if ( ( other . modified ) != null ) { if ( ( modified ) == null ) { modified = new java . util . HashSet ( ) ; } modified . addAll ( other . modified ) ; } if ( ( other . deleted ) != null ) { if ( ( deleted ) == null ) { deleted = new java . util . HashSet ( ) ; } deleted . addAll ( other . deleted ) ; } checkMaxSize ( ) ; } | org . junit . Assert . assertEquals ( myquery , query ) |
testDangelchevCentralityStream ( ) { org . neo4j . graphdb . Result result = org . neo4j . graphalgo . algo . EmptyGraphIntegrationTest . db . execute ( ( ( "CALL<sp>algo.closeness.dangalchev.stream('',<sp>'',<sp>{graph:'" + ( graphImpl ) ) + "'})" ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { return ( offset ) < ( nodeCount ) ; } | org . junit . Assert . assertFalse ( result . hasNext ( ) ) |
testMapWrapper ( ) { try ( net . openhft . chronicle . queue . impl . single . ChronicleQueue syncQ = builder ( getTmpDir ( ) , this . wireType ) . build ( ) ) { net . openhft . chronicle . queue . impl . single . File name2 = net . openhft . chronicle . queue . impl . single . DirectoryUtils . tempDir ( testName . getMethodName ( ) ) ; try ( net . openhft . chronicle . queue . impl . single . ChronicleQueue chronicle = builder ( name2 , this . wireType ) . build ( ) ) { net . openhft . chronicle . queue . impl . single . ExcerptAppender appender = chronicle . acquireAppender ( ) ; net . openhft . chronicle . queue . impl . single . SingleChronicleQueueTest . MapWrapper myMap = new net . openhft . chronicle . queue . impl . single . SingleChronicleQueueTest . MapWrapper ( ) ; myMap . map . put ( "hello" , 1.2 ) ; appender . writeDocument ( ( w ) -> w . write ( ) . object ( myMap ) ) ; net . openhft . chronicle . queue . impl . single . ExcerptTailer tailer = chronicle . createTailer ( ) ; try ( net . openhft . chronicle . queue . impl . single . DocumentContext documentContext = tailer . readingDocument ( ) ) { net . openhft . chronicle . queue . impl . single . SingleChronicleQueueTest . MapWrapper object = documentContext . wire ( ) . read ( ) . object ( net . openhft . chronicle . queue . impl . single . SingleChronicleQueueTest . MapWrapper . class ) ; "<AssertPlaceHolder>" ; } } } } get ( K ) { cache . entrySet ( ) . removeIf ( ( entry ) -> ( entry . getValue ( ) . refCount ( ) ) == 0 ) ; @ org . jetbrains . annotations . Nullable T value = cache . get ( key ) ; if ( ( value == null ) || ( ! ( value . tryReserve ( ) ) ) ) { value = creator . apply ( key ) ; cache . put ( key , value ) ; } try { return transformer . apply ( value ) ; } finally { value . release ( ) ; } } | org . junit . Assert . assertEquals ( 1.2 , object . map . get ( "hello" ) , 0.0 ) |
testDestMicroservice ( ) { requestHeader . setDestMicroservice ( "test" ) ; "<AssertPlaceHolder>" ; } getDestMicroservice ( ) { return destMicroservice ; } | org . junit . Assert . assertEquals ( "test" , requestHeader . getDestMicroservice ( ) ) |
testToString ( ) { java . lang . StringBuilder expectedString = new java . lang . StringBuilder ( ) ; int size = this . classUnderTest ( ) . size ( ) ; for ( char each = 0 ; each < size ; each ++ ) { expectedString . append ( ( ( char ) ( each + ( ( char ) ( 1 ) ) ) ) ) ; } "<AssertPlaceHolder>" ; } toString ( ) { return this . appendable . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedString . toString ( ) , this . classUnderTest ( ) . toString ( ) ) |
testLookupFilter ( ) { org . pentaho . di . connections . vfs . VFSLookupFilter vfsLookupFilter = new org . pentaho . di . connections . vfs . VFSLookupFilter ( ) ; vfsLookupFilter . addKeyLookup ( org . pentaho . di . connections . ConnectionManagerTest . EXAMPLE , org . pentaho . di . connections . ConnectionManagerTest . TestConnectionProvider . SCHEME ) ; connectionManager . addLookupFilter ( vfsLookupFilter ) ; "<AssertPlaceHolder>" ; } getLookupKey ( java . lang . String ) { for ( org . pentaho . di . connections . LookupFilter lookupFilter : lookupFilters ) { java . lang . String filterValue = lookupFilter . filter ( value ) ; if ( filterValue != null ) { return filterValue ; } } return value ; } | org . junit . Assert . assertEquals ( org . pentaho . di . connections . ConnectionManagerTest . TestConnectionProvider . SCHEME , connectionManager . getLookupKey ( org . pentaho . di . connections . ConnectionManagerTest . EXAMPLE ) ) |
test_getIntersections_Line ( ) { org . eclipse . gef . geometry . planar . Line l = new org . eclipse . gef . geometry . planar . Line ( 100.0 , 150.0 , 550.0 , 150.0 ) ; org . eclipse . gef . geometry . planar . CubicCurve c = new org . eclipse . gef . geometry . planar . CubicCurve ( 504.0 , 225.0 , 504.0 , 150.94119100209343 , 418.68233259706915 , 90.0 , 315.0 , 90.0 ) ; org . eclipse . gef . geometry . planar . Point [ ] inters = c . getIntersections ( l ) ; "<AssertPlaceHolder>" ; } getIntersections ( org . eclipse . gef . geometry . planar . Ellipse ) { if ( equals ( e2 ) ) { return new org . eclipse . gef . geometry . planar . Point [ ] { } ; } java . util . HashSet < org . eclipse . gef . geometry . planar . Point > intersections = new java . util . HashSet ( ) ; for ( org . eclipse . gef . geometry . planar . CubicCurve seg : getOutlineSegments ( ) ) { intersections . addAll ( java . util . Arrays . asList ( e2 . getIntersections ( seg ) ) ) ; } return intersections . toArray ( new org . eclipse . gef . geometry . planar . Point [ ] { } ) ; } | org . junit . Assert . assertEquals ( 1 , inters . length ) |
parseJsonString_NoValues ( ) { org . oscm . json . JsonObject jsonObj = jsonConverter . parseJsonString ( org . oscm . json . JsonConverterTest . JSON_STRING_PARAMS_ID_NULLVALUE ) ; java . util . List < org . oscm . json . JsonParameter > params = jsonObj . getParameters ( ) ; for ( org . oscm . json . JsonParameter p : params ) { "<AssertPlaceHolder>" ; } } getValue ( ) { return value ; } | org . junit . Assert . assertNull ( p . getValue ( ) ) |
testParseValid ( ) { for ( final java . lang . String url : org . mycore . datamodel . common . MCRDataURLTest . VALID ) { try { org . mycore . datamodel . common . MCRDataURL dataURL = org . mycore . datamodel . common . MCRDataURL . parse ( url ) ; "<AssertPlaceHolder>" ; } catch ( java . nio . charset . IllegalCharsetNameException | java . net . MalformedURLException e ) { org . junit . Assert . fail ( ( ( url + ":<sp>" ) + ( e . getMessage ( ) ) ) ) ; } } } parse ( java . lang . String ) { final java . lang . String url = dataURL . trim ( ) ; if ( url . startsWith ( org . mycore . datamodel . common . MCRDataURL . SCHEME ) ) { java . lang . String [ ] parts = url . substring ( org . mycore . datamodel . common . MCRDataURL . SCHEME . length ( ) ) . split ( org . mycore . datamodel . common . MCRDataURL . DATA_SEPARATOR , 2 ) ; if ( ( parts . length ) == 2 ) { java . lang . String [ ] tokens = parts [ 0 ] . split ( org . mycore . datamodel . common . MCRDataURL . TOKEN_SEPARATOR ) ; java . util . List < java . lang . String > token = java . util . Arrays . stream ( tokens ) . filter ( ( s ) -> ! ( s . contains ( org . mycore . datamodel . common . MCRDataURL . PARAM_SEPARATOR ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; java . util . Map < java . lang . String , java . lang . String > params = java . util . Arrays . stream ( tokens ) . filter ( ( s ) -> s . contains ( org . mycore . datamodel . common . MCRDataURL . PARAM_SEPARATOR ) ) . map ( ( s ) -> s . split ( org . mycore . datamodel . common . MCRDataURL . PARAM_SEPARATOR , 2 ) ) . collect ( java . util . stream . Collectors . toMap ( ( sl ) -> sl [ 0 ] , ( sl ) -> { try { return decode ( sl [ 1 ] , StandardCharsets . UTF_8 ) ; } catch ( e ) { throw new java . lang . RuntimeException ( ( ( ( "Error<sp>encoding<sp>the<sp>parameter<sp>value<sp>\"" + ( sl [ 1 ] ) ) + "\".<sp>Error:<sp>" ) + ( org . mycore . datamodel . common . e . getMessage ( ) ) ) ) ; } } ) ) ; final java . lang . String mimeType = ( ! ( token . isEmpty ( ) ) ) ? token . get ( 0 ) : null ; if ( ( ( mimeType != null ) && ( ! ( mimeType . isEmpty ( ) ) ) ) && ( ! ( org . mycore . datamodel . common . MCRDataURL . PATTERN_MIMETYPE . matcher ( mimeType ) . matches ( ) ) ) ) { throw new java . net . MalformedURLException ( "Unknown<sp>mime<sp>type." ) ; } final org . mycore . datamodel . common . MCRDataURLEncoding encoding ; try { encoding = ( ( ! ( token . isEmpty ( ) ) ) && ( ( token . size ( ) ) > 1 ) ) ? org . mycore . datamodel . common . MCRDataURLEncoding . fromValue ( token . get ( 1 ) ) : MCRDataURLEncoding . URL ; } catch ( java . lang . IllegalArgumentException e ) { throw new java . net . MalformedURLException ( "Unknown<sp>encoding." ) ; } java . nio . charset . Charset charset = ( params . containsKey ( org . mycore . datamodel . common . MCRDataURL . CHARSET_PARAM ) ) ? java . nio . charset . Charset . forName ( params . get ( org . mycore . datamodel . common . MCRDataURL . CHARSET_PARAM ) ) : java . nio . charset . StandardCharsets . US_ASCII ; byte [ ] data ; try { data = ( encoding == ( MCRDataURLEncoding . BASE64 ) ) ? java . util . Base64 . getDecoder ( ) . decode ( parts [ 1 ] ) : org . mycore . datamodel . common . MCRDataURL . decode ( parts [ 1 ] , charset ) . getBytes ( StandardCharsets . UTF_8 ) ; } catch ( java . lang . IllegalArgumentException | java . io . UnsupportedEncodingException e ) { throw new java . net . MalformedURLException ( ( "Error<sp>decoding<sp>the<sp>data.<sp>" + ( e . getMessage ( ) ) ) ) ; } return new org . mycore . datamodel . common . MCRDataURL ( data , encoding , mimeType , params ) ; } else { throw new java . net . MalformedURLException ( ( "Error<sp>parse<sp>data<sp>url:<sp>" + url ) ) ; } } else { throw new java . net . MalformedURLException ( "Wrong<sp>protocol" ) ; } } | org . junit . Assert . assertNotNull ( dataURL ) |
testContextWorkspaceName ( ) { final java . lang . String user = "hendrix" ; org . uberfire . workspace . WorkspaceContext . set ( user ) ; java . lang . String name = this . resolver . getWorkspaceName ( ) ; "<AssertPlaceHolder>" ; } getWorkspaceName ( ) { try { org . uberfire . rpc . SessionInfo sessionInfo = getSessionInfo ( ) ; return sessionInfo . getIdentity ( ) . getIdentifier ( ) ; } catch ( java . lang . Exception e ) { java . lang . String name = org . uberfire . workspace . WorkspaceContext . get ( ) ; if ( ( name == null ) || ( name . isEmpty ( ) ) ) { return org . uberfire . backend . server . cdi . workspace . WorkspaceNameResolver . GLOBAL_WORKSPACE_NAME ; } else { return name ; } } } | org . junit . Assert . assertEquals ( user , name ) |
testGetNoValueSnak ( ) { org . wikidata . wdtk . datamodel . helpers . NoValueSnak o1 = org . wikidata . wdtk . datamodel . helpers . Datamodel . makeNoValueSnak ( factory . getPropertyIdValue ( "P42" , "foo" ) ) ; org . wikidata . wdtk . datamodel . helpers . NoValueSnak o2 = factory . getNoValueSnak ( factory . getPropertyIdValue ( "P42" , "foo" ) ) ; "<AssertPlaceHolder>" ; } getPropertyIdValue ( java . lang . String , java . lang . String ) { return new org . wikidata . wdtk . datamodel . implementation . PropertyIdValueImpl ( id , siteIri ) ; } | org . junit . Assert . assertEquals ( o1 , o2 ) |
testStubbingSpiedInstance ( org . jukito . BindSpyTest$SimpleClass ) { doReturn ( "Mocked<sp>string" ) . when ( simpleClass ) . callTestMethodOnMock ( ) ; java . lang . String result = simpleClass . callTestMethodOnMock ( ) ; "<AssertPlaceHolder>" ; verify ( mockA , never ( ) ) . test ( ) ; verify ( mockB , never ( ) ) . test ( ) ; } | org . junit . Assert . assertEquals ( "Mocked<sp>string" , result ) |
testSearchQualifiedWithCustomReferenceParam ( ) { ca . uhn . fhir . jpa . provider . r4 . SearchParameter fooSp = new ca . uhn . fhir . jpa . provider . r4 . SearchParameter ( ) ; fooSp . addBase ( "Observation" ) ; fooSp . setCode ( "foo" ) ; fooSp . setType ( org . hl7 . fhir . r4 . model . Enumerations . SearchParamType . REFERENCE ) ; fooSp . setTitle ( "FOO<sp>SP" ) ; fooSp . setExpression ( "Observation.subject" ) ; fooSp . setXpathUsage ( org . hl7 . fhir . r4 . model . SearchParameter . XPathUsageType . NORMAL ) ; fooSp . setStatus ( org . hl7 . fhir . r4 . model . Enumerations . PublicationStatus . ACTIVE ) ; mySearchParameterDao . create ( fooSp , mySrd ) ; mySearchParamRegistry . forceRefresh ( ) ; ca . uhn . fhir . jpa . provider . r4 . Patient pat = new ca . uhn . fhir . jpa . provider . r4 . Patient ( ) ; pat . setGender ( AdministrativeGender . MALE ) ; org . hl7 . fhir . instance . model . api . IIdType patId = myPatientDao . create ( pat , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . provider . r4 . Observation obs1 = new ca . uhn . fhir . jpa . provider . r4 . Observation ( ) ; obs1 . getSubject ( ) . setReferenceElement ( patId ) ; org . hl7 . fhir . instance . model . api . IIdType obsId1 = myObservationDao . create ( obs1 , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . provider . r4 . Observation obs2 = new ca . uhn . fhir . jpa . provider . r4 . Observation ( ) ; obs2 . setStatus ( org . hl7 . fhir . r4 . model . Observation . ObservationStatus . FINAL ) ; org . hl7 . fhir . instance . model . api . IIdType obsId2 = myObservationDao . create ( obs2 , mySrd ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . searchparam . SearchParameterMap map ; ca . uhn . fhir . rest . api . server . IBundleProvider results ; java . util . List < java . lang . String > foundResources ; ca . uhn . fhir . jpa . provider . r4 . Bundle result ; result = ourClient . search ( ) . forResource ( ca . uhn . fhir . jpa . provider . r4 . Observation . class ) . where ( new ca . uhn . fhir . rest . gclient . ReferenceClientParam ( "foo" ) . hasChainedProperty ( Patient . GENDER . exactly ( ) . code ( "male" ) ) ) . returnBundle ( ca . uhn . fhir . jpa . provider . r4 . Bundle . class ) . execute ( ) ; foundResources = toUnqualifiedVersionlessIdValues ( result ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return myTagSet . contains ( theO ) ; } | org . junit . Assert . assertThat ( foundResources , org . hamcrest . Matchers . contains ( obsId1 . getValue ( ) ) ) |
testListPlaceholderTilde ( ) { final ch . cyberduck . core . s3 . Path container = new ch . cyberduck . core . s3 . Path ( "test-us-east-1-cyberduck" , java . util . EnumSet . of ( Path . Type . directory , Path . Type . volume ) ) ; container . attributes ( ) . setRegion ( "us-east-1" ) ; final ch . cyberduck . core . s3 . Path placeholder = new ch . cyberduck . core . s3 . S3DirectoryFeature ( session , new ch . cyberduck . core . s3 . S3WriteFeature ( session , new ch . cyberduck . core . s3 . S3DisabledMultipartService ( ) ) ) . mkdir ( new ch . cyberduck . core . s3 . Path ( container , java . lang . String . format ( "%s~" , java . util . UUID . randomUUID ( ) . toString ( ) ) , java . util . EnumSet . of ( Path . Type . directory ) ) , null , new ch . cyberduck . core . transfer . TransferStatus ( ) ) ; final ch . cyberduck . core . s3 . AttributedList < ch . cyberduck . core . s3 . Path > list = new ch . cyberduck . core . s3 . S3ObjectListService ( session ) . list ( placeholder , new ch . cyberduck . core . s3 . DisabledListProgressListener ( ) ) ; "<AssertPlaceHolder>" ; new ch . cyberduck . core . s3 . S3DefaultDeleteFeature ( session ) . delete ( java . util . Collections . singletonList ( placeholder ) , new ch . cyberduck . core . s3 . DisabledLoginCallback ( ) , new ch . cyberduck . core . features . Delete . DisabledCallback ( ) ) ; } isEmpty ( ) { return ( size ( ) ) == 0 ; } | org . junit . Assert . assertTrue ( list . isEmpty ( ) ) |
testHour ( ) { edu . ucla . sspace . util . TimeSpan ts = new edu . ucla . sspace . util . TimeSpan ( "1h" ) ; java . util . Calendar now = java . util . Calendar . getInstance ( ) ; java . util . Calendar lessThanHourFromNow = java . util . Calendar . getInstance ( ) ; lessThanHourFromNow . add ( Calendar . MINUTE , 1 ) ; "<AssertPlaceHolder>" ; } insideRange ( long , long ) { java . util . Calendar c1 = java . util . Calendar . getInstance ( ) ; java . util . Calendar c2 = java . util . Calendar . getInstance ( ) ; c1 . setTimeInMillis ( startDate ) ; c2 . setTimeInMillis ( endDate ) ; return isInRange ( c1 , c2 ) ; } | org . junit . Assert . assertTrue ( ts . insideRange ( now , lessThanHourFromNow ) ) |
testEmail ( ) { for ( int i = 0 ; i < ( lorem . LoremTest . LOOP_TIMES ) ; i ++ ) { java . lang . String s = lorem . getEmail ( ) ; notBlank ( s ) ; "<AssertPlaceHolder>" ; } } notBlank ( java . lang . String ) { org . junit . Assert . assertNotNull ( s ) ; assertNotEquals ( "" , s . trim ( ) ) ; } | org . junit . Assert . assertFalse ( s , s . contains ( "<sp>" ) ) |
testDdl_TYPE_MONEY ( ) { java . lang . String ddl = ( "CREATE<sp>FOREIGN<sp>TABLE<sp>ONE_TYPE<sp>(" + ( org . teiid . designer . vdb . dynamic . TestModelToDdlGenerator . BQT2_TYPE_DDL . TYPE_MONEY ) ) + ")<sp>OPTIONS(UPDATABLE<sp>'TRUE');" ; java . lang . String expectedDdl = ( "CREATE<sp>FOREIGN<sp>TABLE<sp>ONE_TYPE<sp>(" + ( org . teiid . designer . vdb . dynamic . TestModelToDdlGenerator . EXPECTED_BQT2_TYPE_DDL . TYPE_MONEY ) ) + ")<sp>OPTIONS(UPDATABLE<sp>'TRUE');" ; java . lang . String generatedDdl = roundTrip ( ddl , false ) ; "<AssertPlaceHolder>" ; } roundTrip ( java . lang . String , boolean ) { org . teiid . designer . core . workspace . ModelResource modelResource = createModelResource ( ddl , isVirtual ) ; java . lang . String generatedDdl = generator . generate ( modelResource ) ; generatedDdl = removeWhitespace ( generatedDdl ) ; return generatedDdl ; } | org . junit . Assert . assertEquals ( expectedDdl , generatedDdl ) |
testSerialization ( ) { org . jfree . data . KeyedObject ko1 = new org . jfree . data . KeyedObject ( "Test" , "Object" ) ; org . jfree . data . KeyedObject ko2 = ( ( org . jfree . data . KeyedObject ) ( org . jfree . chart . TestUtils . serialised ( ko1 ) ) ) ; "<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 ( ko1 , ko2 ) |
testFindByJob ( ) { com . salesforce . dva . argus . service . HistoryService historyService = system . getServiceFactory ( ) . getHistoryService ( ) ; com . salesforce . dva . argus . service . UserService userService = system . getServiceFactory ( ) . getUserService ( ) ; com . salesforce . dva . argus . service . AlertService alertService = system . getServiceFactory ( ) . getAlertService ( ) ; com . salesforce . dva . argus . entity . Alert job = new com . salesforce . dva . argus . entity . Alert ( userService . findAdminUser ( ) , userService . findAdminUser ( ) , "alert-name" , com . salesforce . dva . argus . service . HistoryServiceIT . expression , "*<sp>*<sp>*<sp>*<sp>*" ) ; job = alertService . updateAlert ( job ) ; com . salesforce . dva . argus . entity . History expected = historyService . createHistory ( job , "test" , JobStatus . SUCCESS , 0 ) ; com . salesforce . dva . argus . entity . History actual = historyService . findByJob ( job . getId ( ) , 1 ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { V returnValue = null ; try { returnValue = ( ( V ) ( _jedisClusterClient . get ( key ) ) ) ; } catch ( java . lang . Exception ex ) { _logger . error ( "Exception<sp>in<sp>cache<sp>service:<sp>{}<sp>" , ex . getMessage ( ) ) ; } return returnValue ; } | org . junit . Assert . assertEquals ( expected , actual ) |
writeBeanInvalidValue_hasBindings_singleEvent ( ) { binder . forField ( nameField ) . withValidator ( ( name ) -> false , "" ) . bind ( Person :: getFirstName , Person :: setFirstName ) ; binder . readBean ( item ) ; binder . addStatusChangeListener ( this :: statusChanged ) ; "<AssertPlaceHolder>" ; try { binder . writeBean ( item ) ; } catch ( com . vaadin . data . ValidationException ignore ) { } verifyEvent ( true ) ; } get ( ) { return com . vaadin . event . dd . acceptcriteria . SourceIsTarget . INSTANCE ; } | org . junit . Assert . assertNull ( event . get ( ) ) |
emptyPatientExportTest ( ) { org . oscarehr . e2e . model . PatientExport patientExport = new org . oscarehr . e2e . model . PatientExport ( Constants . Runtime . EMPTY_DEMOGRAPHIC ) ; "<AssertPlaceHolder>" ; } isLoaded ( ) { return loaded ; } | org . junit . Assert . assertTrue ( patientExport . isLoaded ( ) ) |
getBestLocaleNotSupported ( ) { org . pdfsam . i18n . DefaultI18nContext victim = new org . pdfsam . i18n . DefaultI18nContext ( ) ; java . util . Locale . setDefault ( Locale . CANADA ) ; "<AssertPlaceHolder>" ; } getBestLocale ( ) { if ( org . pdfsam . i18n . DefaultI18nContext . SUPPORTED_LOCALES . contains ( java . util . Locale . getDefault ( ) ) ) { return java . util . Locale . getDefault ( ) ; } java . util . Locale onlyLanguage = new java . util . Locale ( java . util . Locale . getDefault ( ) . getLanguage ( ) ) ; if ( org . pdfsam . i18n . DefaultI18nContext . SUPPORTED_LOCALES . contains ( onlyLanguage ) ) { org . pdfsam . i18n . DefaultI18nContext . LOG . trace ( "Using<sp>supported<sp>locale<sp>closest<sp>to<sp>default<sp>{}" , onlyLanguage ) ; return onlyLanguage ; } org . pdfsam . i18n . DefaultI18nContext . LOG . trace ( "Using<sp>fallback<sp>locale" ) ; return java . util . Locale . UK ; } | org . junit . Assert . assertEquals ( Locale . UK , victim . getBestLocale ( ) ) |
patch_A$int$Seq$int ( ) { com . m3 . scalaflavor4j . Nil < java . lang . String > nil = com . m3 . scalaflavor4j . Nil . < java . lang . String > apply ( ) ; int from = 2 ; com . m3 . scalaflavor4j . Seq < java . lang . String > patch = com . m3 . scalaflavor4j . Seq . apply ( "a" , "b" , "c" ) ; int replaced = 3 ; com . m3 . scalaflavor4j . Seq < java . lang . String > actual = nil . patch ( from , patch , replaced ) ; "<AssertPlaceHolder>" ; } size ( ) { return 0 ; } | org . junit . Assert . assertThat ( actual . size ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( 3 ) ) ) |
testEncodeDecodeModQ ( ) { int [ ] coeffs = net . sf . ntru . polynomial . PolynomialGeneratorForTesting . generateRandomPositive ( 1000 , 2048 ) . coeffs ; byte [ ] data = net . sf . ntru . util . ArrayEncoder . encodeModQ ( coeffs , 2048 ) ; int [ ] coeffs2 = net . sf . ntru . util . ArrayEncoder . decodeModQ ( data , 1000 , 2048 ) ; "<AssertPlaceHolder>" ; } decodeModQ ( byte [ ] , int , int ) { int [ ] coeffs = new int [ N ] ; int bitsPerCoeff = 31 - ( java . lang . Integer . numberOfLeadingZeros ( q ) ) ; int mask = ( - 1 ) > > > ( 32 - bitsPerCoeff ) ; int byteIndex = 0 ; int bitIndex = 0 ; int coeffBuf = 0 ; int coeffBits = 0 ; int coeffIndex = 0 ; while ( coeffIndex < N ) { while ( coeffBits < bitsPerCoeff ) { coeffBuf += ( ( data [ byteIndex ] ) & 255 ) << coeffBits ; coeffBits += 8 - bitIndex ; byteIndex ++ ; bitIndex = 0 ; } coeffs [ coeffIndex ] = coeffBuf & mask ; coeffIndex ++ ; coeffBuf >>>= bitsPerCoeff ; coeffBits -= bitsPerCoeff ; } return coeffs ; } | org . junit . Assert . assertArrayEquals ( coeffs , coeffs2 ) |
testFindActive ( ) { int active1 = 1 ; int active2 = 2 ; org . oscarehr . common . model . ReportTemplates reportTemp1 = new org . oscarehr . common . model . ReportTemplates ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( reportTemp1 ) ; reportTemp1 . setActive ( active1 ) ; dao . persist ( reportTemp1 ) ; org . oscarehr . common . model . ReportTemplates reportTemp2 = new org . oscarehr . common . model . ReportTemplates ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( reportTemp2 ) ; reportTemp2 . setActive ( active2 ) ; dao . persist ( reportTemp2 ) ; org . oscarehr . common . model . ReportTemplates reportTemp3 = new org . oscarehr . common . model . ReportTemplates ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( reportTemp3 ) ; reportTemp3 . setActive ( active1 ) ; dao . persist ( reportTemp3 ) ; org . oscarehr . common . model . ReportTemplates reportTemp4 = new org . oscarehr . common . model . ReportTemplates ( ) ; org . oscarehr . common . dao . utils . EntityDataGenerator . generateTestDataForModelClass ( reportTemp4 ) ; reportTemp4 . setActive ( active1 ) ; dao . persist ( reportTemp4 ) ; java . util . List < org . oscarehr . common . model . ReportTemplates > expectedResult = new java . util . ArrayList < org . oscarehr . common . model . ReportTemplates > ( java . util . Arrays . asList ( reportTemp1 , reportTemp3 , reportTemp4 ) ) ; java . util . List < org . oscarehr . common . model . ReportTemplates > result = dao . findActive ( ) ; org . apache . log4j . Logger logger = org . oscarehr . util . MiscUtils . getLogger ( ) ; if ( ( result . size ( ) ) != ( expectedResult . size ( ) ) ) { logger . warn ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Array<sp>sizes<sp>do<sp>not<sp>match." ) ; } for ( int i = 0 ; i < ( expectedResult . size ( ) ) ; i ++ ) { if ( ! ( expectedResult . get ( i ) . equals ( result . get ( i ) ) ) ) { logger . warn ( "Items<sp>do<sp>not<sp>match." ) ; org . junit . Assert . fail ( "Items<sp>do<sp>not<sp>match." ) ; } } "<AssertPlaceHolder>" ; } get ( java . lang . String ) { try { return terser . get ( path ) ; } catch ( ca . uhn . hl7v2 . HL7Exception e ) { oscar . oscarLab . ca . all . parsers . CLSHandler . logger . warn ( ( "Unable<sp>to<sp>get<sp>field<sp>at<sp>" + path ) , e ) ; return null ; } } | org . junit . Assert . assertTrue ( true ) |
testWaitForDependenciesUnfilled ( ) { com . liferay . registry . Registry registry = com . liferay . registry . RegistryUtil . getRegistry ( ) ; final com . liferay . registry . dependency . ServiceDependencyManager serviceDependencyManager = new com . liferay . registry . dependency . ServiceDependencyManager ( ) ; final java . util . concurrent . atomic . AtomicBoolean dependenciesSatisfied = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; serviceDependencyManager . addServiceDependencyListener ( new com . liferay . registry . dependency . ServiceDependencyListener ( ) { @ com . liferay . registry . dependency . Override public void dependenciesFulfilled ( ) { dependenciesSatisfied . set ( true ) ; } @ com . liferay . registry . dependency . Override public void destroy ( ) { } } ) ; com . liferay . registry . Filter filter1 = registry . getFilter ( ( ( "(objectClass=" + ( com . liferay . registry . internal . TrackedOne . class . getName ( ) ) ) + ")" ) ) ; com . liferay . registry . Filter filter2 = registry . getFilter ( ( ( "(objectClass=" + ( com . liferay . registry . internal . TrackedTwo . class . getName ( ) ) ) + ")" ) ) ; serviceDependencyManager . registerDependencies ( filter1 , filter2 ) ; registry . registerService ( com . liferay . registry . internal . TrackedOne . class , new com . liferay . registry . internal . TrackedOne ( ) ) ; java . lang . Thread dependencyWaiter = new java . lang . Thread ( new java . lang . Runnable ( ) { @ com . liferay . registry . dependency . Override public void run ( ) { serviceDependencyManager . waitForDependencies ( 100 ) ; } } ) ; dependencyWaiter . setDaemon ( true ) ; dependencyWaiter . start ( ) ; try { java . lang . Thread . sleep ( 250 ) ; if ( ! ( dependencyWaiter . isAlive ( ) ) ) { "<AssertPlaceHolder>" ; return ; } org . junit . Assert . fail ( "Dependencies<sp>should<sp>have<sp>timed<sp>out" ) ; } catch ( java . lang . InterruptedException ie ) { } } get ( ) { return _byteBuffer . get ( ) ; } | org . junit . Assert . assertFalse ( dependenciesSatisfied . get ( ) ) |
testContainsReturnsFalseWhenLessThanMinX ( ) { com . github . davidmoten . rtree . geometry . Rectangle r = com . github . davidmoten . rtree . geometry . Geometries . rectangle ( 10 , 20 , 30 , 40 ) ; "<AssertPlaceHolder>" ; } contains ( double , double ) { return ( ( this . x ) == x ) && ( ( this . y ) == y ) ; } | org . junit . Assert . assertFalse ( r . contains ( 9 , 30 ) ) |
menuSizeForUnitAdmin ( ) { doReturn ( Boolean . FALSE ) . when ( ctrl ) . isLoggedInAndAdmin ( ) ; doReturn ( Boolean . FALSE ) . when ( ctrl ) . isLoggedInAndSubscriptionManager ( ) ; doReturn ( Boolean . TRUE ) . when ( ctrl ) . isLoggedInAndUnitAdmin ( ) ; ctrl . getModel ( ) ; int visibleLinks = 0 ; for ( int i = 0 ; i < ( ctrl . getLink ( ) . size ( ) ) ; i ++ ) { if ( ctrl . isLinkVisible ( i ) ) { visibleLinks ++ ; } } "<AssertPlaceHolder>" ; } isLinkVisible ( int ) { if ( ( index < 1 ) || ( index > ( getLink ( ) . size ( ) ) ) ) { return false ; } java . lang . String hiddenElement = getHiddenElement ( ) . get ( ( index - 1 ) ) ; if ( HiddenUIConstants . MARKETPLACE_MENU_ITEM_ACCOUNT_REPORTS . equals ( hiddenElement ) ) { return isReportingAvailable ( ) ; } else if ( HiddenUIConstants . MARKETPLACE_MENU_ITEM_ACCOUNT_USERS . equals ( hiddenElement ) ) { return ( isLoggedInAndAdmin ( ) ) && ( ! ( applicationBean . isUIElementHidden ( hiddenElement ) ) ) ; } else if ( HiddenUIConstants . MARKETPLACE_MENU_ITEM_ACCOUNT_PAYMENT . equals ( hiddenElement ) ) { return isPaymentAvailable ( ) ; } else if ( HiddenUIConstants . MARKETPLACE_MENU_ITEM_ACCOUNT_SUBSCRIPTIONS . equals ( hiddenElement ) ) { return ( ( ( isLoggedInAndAdmin ( ) ) || ( isLoggedInAndSubscriptionManager ( ) ) ) || ( isLoggedInAndUnitAdmin ( ) ) ) && ( ! ( applicationBean . isUIElementHidden ( hiddenElement ) ) ) ; } else if ( HiddenUIConstants . MARKETPLACE_MENU_ITEM_ACCOUNT_UNITS . equals ( hiddenElement ) ) { return ( isLoggedInAndUnitAdmin ( ) ) && ( ! ( applicationBean . isUIElementHidden ( hiddenElement ) ) ) ; } else if ( HiddenUIConstants . MARKETPLACE_MENU_ITEM_ACCOUNT_ADMINISTRATION . equals ( hiddenElement ) ) { return ( isAdministrationAccess ( ) ) && ( ! ( applicationBean . isUIElementHidden ( hiddenElement ) ) ) ; } return ! ( applicationBean . isUIElementHidden ( hiddenElement ) ) ; } | org . junit . Assert . assertEquals ( 6 , visibleLinks ) |
testGetDatasetLookupEmpty ( ) { metadata . setDataset ( true ) ; org . mockito . Mockito . when ( fieldBean . getFields ( metadata ) ) . thenReturn ( fields ) ; org . mockito . Mockito . when ( chunkBean . get ( metadata , 1 ) ) . thenReturn ( result ) ; org . mockito . Mockito . when ( parameterMap . containsKey ( "field2" ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( parameterMap . getFirst ( "field2" ) ) . thenReturn ( "" ) ; javax . ws . rs . core . Response response = browseResource . getDataset ( "xml" , metadata . getLocation ( ) ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; } | org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) ) |
testNormalOperation ( ) { boolean expected = true ; boolean result = org . slieb . throwables . BooleanSupplierWithThrowable . castBooleanSupplierWithThrowable ( ( ) -> expected ) . thatReturnsOnCatch ( false ) . getAsBoolean ( ) ; "<AssertPlaceHolder>" ; } getAsBoolean ( ) { try { return getAsBooleanWithThrowable ( ) ; } catch ( java . lang . RuntimeException | java . lang . Error exception ) { throw exception ; } catch ( final java . lang . Throwable throwable ) { throw new org . slieb . throwables . SuppressedException ( throwable ) ; } } | org . junit . Assert . assertEquals ( expected , result ) |
testJiraAwareFailureContains ( ) { JiraAwareFailureUtils . jiraMatches . put ( "TEST<sp>UNIQUE<sp>TEST" , "KULRICE-TEST2" ) ; org . kuali . rice . testtools . common . JiraAwareFailureUtils . failOnMatchedJira ( "TEST<sp>UNIQUE<sp>TEST" , this ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Class ) { return ( getMetadata ( type ) ) != null ; } | org . junit . Assert . assertTrue ( message . contains ( "KULRICE-TEST2" ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.