input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testSingleImageSparkTransform ( ) { int seed = 12345 ; java . io . File f1 = new org . nd4j . linalg . io . ClassPathResource ( "datavec-spark-inference/testimages/class1/A.jpg" ) . getFile ( ) ; org . datavec . spark . transform . model . SingleImageRecord imgRecord = new org . datavec . spark . transform . model . SingleImageRecord ( f1 . toURI ( ) ) ; org . datavec . image . transform . ImageTransformProcess imgTransformProcess = new org . datavec . image . transform . ImageTransformProcess . Builder ( ) . seed ( seed ) . scaleImageTransform ( 10 ) . cropImageTransform ( 5 ) . build ( ) ; org . datavec . spark . transform . ImageSparkTransform imgSparkTransform = new org . datavec . spark . transform . ImageSparkTransform ( imgTransformProcess ) ; org . datavec . spark . transform . model . Base64NDArrayBody body = imgSparkTransform . toArray ( imgRecord ) ; org . nd4j . linalg . api . ndarray . INDArray fromBase64 = org . nd4j . serde . base64 . Nd4jBase64 . fromBase64 ( body . getNdarray ( ) ) ; System . out . println ( ( "Base<sp>64ed<sp>array<sp>" + fromBase64 ) ) ; "<AssertPlaceHolder>" ; } size ( org . nd4j . autodiff . samediff . SDVariable ) { return new org . nd4j . autodiff . functions . Size ( sameDiff ( ) , in ) . outputVariable ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , fromBase64 . size ( 0 ) )
|
shouldUseCollectionConverterWhenItExists ( ) { br . com . caelum . vraptor . serialization . gson . GsonJSONSerialization serialization = serializationWithAdapter ( new br . com . caelum . vraptor . serialization . gson . GsonJSONSerializationTest . CollectionSerializer ( ) ) ; java . lang . String expectedResult = "[\"testing\"]" ; serialization . withoutRoot ( ) . from ( new br . com . caelum . vraptor . serialization . gson . GsonJSONSerializationTest . MyCollection ( ) ) . serialize ( ) ; "<AssertPlaceHolder>" ; } result ( ) { return new java . lang . String ( stream . toByteArray ( ) ) ; }
|
org . junit . Assert . assertThat ( result ( ) , org . hamcrest . Matchers . is ( org . hamcrest . Matchers . equalTo ( expectedResult ) ) )
|
testGetEjbHome ( ) { java . lang . Object home = org . jboss . additional . testsuite . jdkall . present . management . deploy . runtime . StatelessEJBRemoteHomeRuntimeNameTestCase . context . lookup ( getEJBHomeJNDIBinding ( ) ) ; "<AssertPlaceHolder>" ; } getEJBHomeJNDIBinding ( ) { final java . lang . String appName = org . jboss . additional . testsuite . jdkall . present . management . deploy . runtime . StatelessEJBRemoteHomeRuntimeNameTestCase . RT_MODULE_NAME ; final java . lang . String moduleName = org . jboss . additional . testsuite . jdkall . present . management . deploy . runtime . StatelessEJBRemoteHomeRuntimeNameTestCase . SUB_DEPLOYMENT_MODULE_NAME ; final java . lang . String distinctName = "" ; final java . lang . String beanName = org . jboss . additional . testsuite . jdkall . present . management . deploy . runtime . StatelessEJBRemoteHomeRuntimeNameTestCase . BEAN_CLASS . getSimpleName ( ) ; final java . lang . String viewClassName = org . jboss . additional . testsuite . jdkall . present . management . deploy . runtime . SimpleHome . class . getName ( ) ; return ( ( ( ( ( ( ( ( "ejb:" + appName ) + "/" ) + moduleName ) + "/" ) + distinctName ) + "/" ) + beanName ) + "!" ) + viewClassName ; }
|
org . junit . Assert . assertTrue ( ( home instanceof org . jboss . additional . testsuite . jdkall . present . management . deploy . runtime . SimpleHome ) )
|
testSingleConditionPassenger ( ) { gov . gtas . model . udr . json . QueryTerm cond = gov . gtas . rule . builder . RuleBuilderTestUtils . createQueryTerm ( EntityEnum . PASSENGER , PassengerMapping . DOB , CriteriaOperatorEnum . BETWEEN , new java . lang . String [ ] { "1990-01-01" , "1998-12-31" } , TypeEnum . DATE ) ; testTarget . addRuleCondition ( cond ) ; java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; testTarget . buildConditionsAndApppend ( result ) ; "<AssertPlaceHolder>" ; } buildConditionsAndApppend ( java . lang . StringBuilder ) { generateLinkConditions ( ) ; boolean isPassengerConditionCreated = ( ! ( passengerConditionBuilder . isEmpty ( ) ) ) | ( ! ( flightConditionBuilder . isEmpty ( ) ) ) ; pnrRuleConditionBuilder . buildConditionsAndApppend ( parentStringBuilder ) ; for ( gov . gtas . rule . builder . BagConditionBuilder bcb : bagConditionBuilder ) { parentStringBuilder . append ( bcb . build ( ) ) ; } parentStringBuilder . append ( flightPaxConditionBuilder . build ( ) ) . append ( apisSeatConditionBuilder . build ( ) ) . append ( detailsConditionBuilder . build ( ) ) . append ( tripDetailsConditionBuilder . build ( ) ) ; for ( gov . gtas . rule . builder . DocumentConditionBuilder dcb : documentConditionBuilder ) { parentStringBuilder . append ( dcb . build ( ) ) ; } parentStringBuilder . append ( paymentFormConditionBuilder . build ( ) ) ; if ( isPassengerConditionCreated ) { parentStringBuilder . append ( passengerConditionBuilder . build ( ) ) . append ( flightConditionBuilder . build ( ) ) . append ( mutableFlightDetailsConditionBuilder . build ( ) ) ; } pnrRuleConditionBuilder . addPnrLinkConditions ( parentStringBuilder , isPassengerConditionCreated , passengerConditionBuilder ) ; pnrRuleConditionBuilder . reset ( ) ; tripDetailsConditionBuilder . reset ( ) ; detailsConditionBuilder . reset ( ) ; passengerConditionBuilder . reset ( ) ; documentConditionBuilder = new gov . gtas . rule . builder . ArrayList ( ) ; flightConditionBuilder . reset ( ) ; flightPaxConditionBuilder . reset ( ) ; pnrSeatConditionBuilder . reset ( ) ; apisSeatConditionBuilder . reset ( ) ; bagConditionBuilder = new gov . gtas . rule . builder . ArrayList ( ) ; paymentFormConditionBuilder . reset ( ) ; flightConditionBuilder . reset ( ) ; mutableFlightDetailsConditionBuilder . reset ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( result . length ( ) ) > 0 ) )
|
testNextHopSelf ( ) { org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . routing . policy . rev151009 . routing . policy . top . routing . policy . policy . definitions . policy . definition . statements . Statement statement = this . basicStatements . stream ( ) . filter ( ( st ) -> st . getName ( ) . equals ( "next-hop-self-append-test" ) ) . findFirst ( ) . get ( ) ; final org . opendaylight . protocol . bgp . openconfig . routing . policy . spi . registry . RouteAttributeContainer attributeContainer = routeAttributeContainerFalse ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . message . rev180329 . path . attributes . AttributesBuilder ( ) . build ( ) ) ; org . opendaylight . protocol . bgp . openconfig . routing . policy . spi . registry . RouteAttributeContainer result = this . statementRegistry . applyExportStatement ( this . baseAttributes , org . opendaylight . yang . gen . v1 . http . openconfig . net . yang . bgp . types . rev151009 . IPV4UNICAST . class , this . exportParameters , attributeContainer , statement ) ; final org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . message . rev180329 . path . attributes . Attributes expected = new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . message . rev180329 . path . attributes . AttributesBuilder ( ) . setCNextHop ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . types . rev180329 . next . hop . c . next . hop . Ipv4NextHopCaseBuilder ( ) . setIpv4NextHop ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . params . xml . ns . yang . bgp . types . rev180329 . next . hop . c . next . hop . ipv4 . next . hop . _case . Ipv4NextHopBuilder ( ) . setGlobal ( org . opendaylight . protocol . bgp . openconfig . routing . policy . spi . IPV4 ) . build ( ) ) . build ( ) ) . build ( ) ; "<AssertPlaceHolder>" ; } getAttributes ( ) { return attributes ; }
|
org . junit . Assert . assertEquals ( expected , result . getAttributes ( ) )
|
spatialQueries ( ) { java . util . Set < java . lang . Integer > actual = new java . util . HashSet ( ) ; java . util . Set < java . lang . Integer > expected = new java . util . HashSet ( ) ; java . lang . String selectSQL = "select<sp>id<sp>from<sp>boxes<sp>where<sp>geo_overlaps(geo_wkt(box),<sp>geo_wkt(?))" ; java . lang . String addIndexSQL = "create<sp>index<sp>idx_box<sp>ON<sp>boxes(GEO_WKT(box))" ; java . lang . String analyzeSQL = "alter<sp>table<sp>boxes<sp>all<sp>update<sp>statistics" ; java . sql . PreparedStatement query = null ; java . sql . Statement indexing = null ; try { query = connection . prepareStatement ( selectSQL ) ; indexing = connection . createStatement ( ) ; for ( int q = 0 ; q < ( com . foundationdb . server . test . it . qp . SpatialQueryDT . N_QUERIES ) ; q ++ ) { java . lang . String queryBox = randomBox ( com . foundationdb . server . test . it . qp . SpatialQueryDT . MAX_QUERY_X , com . foundationdb . server . test . it . qp . SpatialQueryDT . MAX_QUERY_Y ) ; "<AssertPlaceHolder>" ; } } finally { if ( query != null ) { query . close ( ) ; } if ( indexing != null ) { indexing . close ( ) ; } } } randomBox ( double , double ) { double x = ( ( random . nextDouble ( ) ) * ( com . foundationdb . server . test . it . qp . SpatialQueryDT . LAT_SIZE ) ) + ( com . foundationdb . server . test . it . qp . SpatialQueryDT . LAT_MIN ) ; double y = ( ( random . nextDouble ( ) ) * ( com . foundationdb . server . test . it . qp . SpatialQueryDT . LON_SIZE ) ) + ( com . foundationdb . server . test . it . qp . SpatialQueryDT . LON_MIN ) ; double xSize = ( random . nextDouble ( ) ) * maxX ; double ySize = ( random . nextDouble ( ) ) * maxY ; double xLo = java . lang . Math . max ( ( x - ( xSize / 2 ) ) , com . foundationdb . server . test . it . qp . SpatialQueryDT . LAT_MIN ) ; double xHi = java . lang . Math . min ( ( x + ( xSize / 2 ) ) , com . foundationdb . server . test . it . qp . SpatialQueryDT . LAT_MAX ) ; double yLo = java . lang . Math . max ( ( y - ( ySize / 2 ) ) , com . foundationdb . server . test . it . qp . SpatialQueryDT . LON_MIN ) ; double yHi = java . lang . Math . min ( ( y + ( ySize / 2 ) ) , com . foundationdb . server . test . it . qp . SpatialQueryDT . LON_MAX ) ; java . lang . String wkt = java . lang . String . format ( "POLYGON((%f<sp>%f,%f<sp>%f,%f<sp>%f,%f<sp>%f,%f<sp>%f))" , xLo , yLo , xLo , yHi , xHi , yHi , xHi , yLo , xLo , yLo ) ; return wkt ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testEmpty ( ) { activeToolManager . register ( getClass ( ) . getResourceAsStream ( "empty.xml" ) ) ; "<AssertPlaceHolder>" ; } findTools ( java . util . Set , java . util . Set ) { org . sakaiproject . tool . api . ActiveToolManager manager = org . sakaiproject . tool . cover . ActiveToolManager . getInstance ( ) ; if ( manager == null ) return null ; return manager . findTools ( param0 , param1 ) ; }
|
org . junit . Assert . assertTrue ( activeToolManager . findTools ( null , null ) . isEmpty ( ) )
|
testVersionBytes ( ) { final com . yoghurt . crypto . transactions . shared . domain . Transaction parsedTransaction = com . yoghurt . crypto . transactions . client . util . transaction . TransactionParseUtil . parseTransactionBytes ( com . googlecode . gwt . crypto . bouncycastle . util . encoders . Hex . decode ( com . yoghurt . crypto . transactions . client . util . transaction . TransactionParseUtilTest . TX_NORMAL_HEX ) ) ; "<AssertPlaceHolder>" ; } getVersion ( ) { return version ; }
|
org . junit . Assert . assertEquals ( 1 , parsedTransaction . getVersion ( ) )
|
uploadVideo ( ) { java . io . InputStream is = new java . io . FileInputStream ( "/Users/jy/Downloads/test.mp4" ) ; java . lang . String fileName = "" ; java . lang . String title = "" ; java . lang . String description = "" ; com . foxinmy . weixin4j . tuple . MpVideo mpVideo = mediaApi . uploadVideo ( is , fileName , title , description ) ; "<AssertPlaceHolder>" ; System . err . println ( mpVideo . getMediaId ( ) ) ; } getMediaId ( ) { return mediaId ; }
|
org . junit . Assert . assertTrue ( ( ( mpVideo . getMediaId ( ) ) != null ) )
|
testMultiplicationWithVector ( ) { com . hackoeur . jglm . Mat4 m1 = new com . hackoeur . jglm . Mat4 ( 49.0F , 50.0F , 29.0F , 12.0F , 23.0F , 90.0F , 45.0F , 32.0F , 5.0F , 47.0F , 46.0F , 89.0F , 86.0F , 88.0F , 20.0F , 58.0F ) ; com . hackoeur . jglm . Vec4 v1 = new com . hackoeur . jglm . Vec4 ( 54.0F , 43.0F , 28.0F , 64.0F ) ; com . hackoeur . jglm . Vec4 expectedMul = new com . hackoeur . jglm . Vec4 ( 9279.0F , 13518.0F , 6069.0F , 8228.0F ) ; com . hackoeur . jglm . Vec4 multiplied = m1 . multiply ( v1 ) ; "<AssertPlaceHolder>" ; } multiply ( com . hackoeur . jglm . Vec3 ) { return new com . hackoeur . jglm . Vec3 ( ( ( ( ( m00 ) * ( vec . x ) ) + ( ( m10 ) * ( vec . y ) ) ) + ( ( m20 ) * ( vec . z ) ) ) , ( ( ( ( m01 ) * ( vec . x ) ) + ( ( m11 ) * ( vec . y ) ) ) + ( ( m21 ) * ( vec . z ) ) ) , ( ( ( ( m02 ) * ( vec . x ) ) + ( ( m12 ) * ( vec . y ) ) ) + ( ( m22 ) * ( vec . z ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( expectedMul , multiplied )
|
testEdgeIndexViaRootGetEdges ( ) { com . tinkerpop . blueprints . impls . orient . OrientGraph g = com . gentics . mesh . graphdb . orientdb . EdgeIndexPerformanceTest . factory . getTx ( ) ; try { long start = java . lang . System . currentTimeMillis ( ) ; for ( int i = 0 ; i < ( com . gentics . mesh . graphdb . orientdb . EdgeIndexPerformanceTest . nChecks ) ; i ++ ) { com . tinkerpop . blueprints . impls . orient . OrientVertex randomDocument = com . gentics . mesh . graphdb . orientdb . EdgeIndexPerformanceTest . items . get ( ( ( int ) ( ( java . lang . Math . random ( ) ) * ( com . gentics . mesh . graphdb . orientdb . EdgeIndexPerformanceTest . items . size ( ) ) ) ) ) ; java . lang . Iterable < com . tinkerpop . blueprints . Edge > edges = com . gentics . mesh . graphdb . orientdb . EdgeIndexPerformanceTest . root . getEdges ( randomDocument , Direction . OUT , "HAS_ITEM" ) ; "<AssertPlaceHolder>" ; } long dur = ( java . lang . System . currentTimeMillis ( ) ) - start ; System . out . println ( ( "[root.getEdges]<sp>Duration:<sp>" + dur ) ) ; System . out . println ( ( "[root.getEdges]<sp>Duration<sp>per<sp>lookup:<sp>" + ( ( ( double ) ( dur ) ) / ( ( double ) ( com . gentics . mesh . graphdb . orientdb . EdgeIndexPerformanceTest . nChecks ) ) ) ) ) ; } finally { g . shutdown ( ) ; } } iterator ( ) { return ( ( java . util . Iterator < T > ) ( wrappedList . iterator ( ) ) ) ; }
|
org . junit . Assert . assertTrue ( edges . iterator ( ) . hasNext ( ) )
|
toString_containsFields ( ) { com . google . auth . oauth2 . ComputeEngineCredentialsTest . MockMetadataServerTransportFactory serverTransportFactory = new com . google . auth . oauth2 . ComputeEngineCredentialsTest . MockMetadataServerTransportFactory ( ) ; java . lang . String expectedToString = java . lang . String . format ( "ComputeEngineCredentials{transportFactoryClassName=%s}" , com . google . auth . oauth2 . ComputeEngineCredentialsTest . MockMetadataServerTransportFactory . class . getName ( ) ) ; com . google . auth . oauth2 . ComputeEngineCredentials credentials = com . google . auth . oauth2 . ComputeEngineCredentials . newBuilder ( ) . setHttpTransportFactory ( serverTransportFactory ) . build ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . MoreObjects . toStringHelper ( this ) . add ( "sourceCredentials" , sourceCredentials ) . add ( "targetPrincipal" , targetPrincipal ) . add ( "delegates" , delegates ) . add ( "scopes" , scopes ) . add ( "lifetime" , lifetime ) . add ( "transportFactoryClassName" , transportFactoryClassName ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expectedToString , credentials . toString ( ) )
|
usesLogicalInterfacesLegacySff ( ) { when ( sff . getSffDataPlaneLocator ( ) ) . thenReturn ( new java . util . ArrayList ( ) ) ; "<AssertPlaceHolder>" ; } usesLogicalInterfaces ( org . opendaylight . yang . gen . v1 . urn . cisco . params . xml . ns . yang . sfc . sff . rev140701 . service . function . forwarders . ServiceFunctionForwarder ) { return ( theSff . getSffDataPlaneLocator ( ) ) == null ; }
|
org . junit . Assert . assertFalse ( handler . usesLogicalInterfaces ( sff ) )
|
testLoadAllOntologies ( ) { owltools . io . ParserWrapper pw = new owltools . io . ParserWrapper ( ) ; pw . addIRIMapper ( new owltools . io . CatalogXmlIRIMapper ( owltools . solrj . AllOntologyLoaderIntegrationRunner . catalogXml ) ) ; final owltools . graph . OWLGraphWrapper g = pw . parseToOWLGraph ( owltools . solrj . AllOntologyLoaderIntegrationRunner . goFile ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . clFile ) ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . uberonFile ) ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . poFile ) ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . soFile ) ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . prFile ) ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . chebiFile ) ) ; g . mergeOntology ( pw . parse ( owltools . solrj . AllOntologyLoaderIntegrationRunner . taxonFile ) ) ; g . setEdgesAdvancedCacheSize ( 1000 ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . printMemoryStats ( ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . gc ( ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . printMemoryStats ( ) ; owltools . yaml . golrconfig . ConfigManager configManager = new owltools . yaml . golrconfig . ConfigManager ( ) ; configManager . add ( "src/test/resources/test-ont-config.yaml" ) ; owltools . flex . FlexCollection c = new owltools . flex . FlexCollection ( configManager , g ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . printMemoryStats ( ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . gc ( ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . printMemoryStats ( ) ; org . apache . commons . lang3 . time . StopWatch watch = new org . apache . commons . lang3 . time . StopWatch ( ) ; watch . start ( ) ; owltools . solrj . FlexSolrDocumentLoader loader = new owltools . solrj . FlexSolrDocumentLoader ( ( ( org . apache . solr . client . solrj . SolrServer ) ( null ) ) , c ) { @ owltools . solrj . Override protected void addToServer ( java . util . Collection < org . apache . solr . common . SolrInputDocument > docs ) throws java . io . IOException , org . apache . solr . client . solrj . SolrServerException { owltools . solrj . AllOntologyLoaderIntegrationRunner . solrCounter += docs . size ( ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . printMemoryStats ( ) ; System . out . println ( ( "Cache<sp>size:<sp>" + ( g . getCurrentEdgesAdvancedCacheSize ( ) ) ) ) ; } } ; loader . load ( ) ; watch . stop ( ) ; owltools . solrj . GafSolrDocumentLoaderIntegrationRunner . printMemoryStats ( ) ; System . out . println ( ( ( ( "Loaded<sp>" + ( owltools . solrj . AllOntologyLoaderIntegrationRunner . solrCounter ) ) + "<sp>Solr<sp>docs<sp>in<sp>" ) + watch ) ) ; "<AssertPlaceHolder>" ; } printMemoryStats ( ) { int mb = 1024 * 1024 ; java . lang . Runtime runtime = java . lang . Runtime . getRuntime ( ) ; System . out . println ( ( ( ( ( "Heap<sp>Used<sp>Memory:" + ( ( ( runtime . totalMemory ( ) ) - ( runtime . freeMemory ( ) ) ) / mb ) ) + "<sp>of<sp>max<sp>" ) + ( ( runtime . maxMemory ( ) ) / mb ) ) + "<sp>[MB]" ) ) ; }
|
org . junit . Assert . assertTrue ( ( ( owltools . solrj . AllOntologyLoaderIntegrationRunner . solrCounter ) > 0 ) )
|
indexOfId_tableNewlyAddedItem_returnsFour ( ) { java . lang . Object id = container . addItem ( ) ; "<AssertPlaceHolder>" ; } indexOfId ( java . lang . Object ) { for ( int ix = 0 ; ix < ( addedItems . size ( ) ) ; ix ++ ) { com . vaadin . v7 . data . util . sqlcontainer . RowItem item = addedItems . get ( ix ) ; if ( item . getId ( ) . equals ( itemId ) ) { if ( itemPassesFilters ( item ) ) { updateCount ( ) ; return ( size ) + ix ; } else { return - 1 ; } } } if ( ! ( containsId ( itemId ) ) ) { return - 1 ; } if ( cachedItems . isEmpty ( ) ) { getPage ( ) ; } int counter = 0 ; int oldIndex ; while ( counter < ( size ) ) { if ( itemIndexes . containsValue ( itemId ) ) { for ( java . lang . Integer idx : itemIndexes . keySet ( ) ) { if ( itemIndexes . get ( idx ) . equals ( itemId ) ) { return idx ; } } } oldIndex = currentOffset ; int nextIndex = ( ( currentOffset ) + ( ( pageLength ) * ( com . vaadin . v7 . data . util . sqlcontainer . SQLContainer . CACHE_RATIO ) ) ) + ( cacheOverlap ) ; if ( nextIndex >= ( size ) ) { nextIndex = 0 ; } updateOffsetAndCache ( nextIndex ) ; if ( ( currentOffset ) > oldIndex ) { counter += ( currentOffset ) - oldIndex ; } else { counter += ( size ) - oldIndex ; } } return - 1 ; }
|
org . junit . Assert . assertEquals ( 4 , container . indexOfId ( id ) )
|
testGetAvgCharWidthUsesStorageForKnownStrings ( ) { org . eclipse . rap . rwt . internal . textsize . ProbeResultStore probeStore = org . eclipse . rap . rwt . internal . textsize . ProbeResultStore . getInstance ( ) ; org . eclipse . swt . graphics . Point probeSize = new org . eclipse . swt . graphics . Point ( ( ( Probe . DEFAULT_PROBE_STRING . length ( ) ) * 4 ) , 10 ) ; probeStore . createProbeResult ( new org . eclipse . rap . rwt . internal . textsize . Probe ( org . eclipse . rap . rwt . internal . textsize . TextSizeUtil_Test . FONT_DATA ) , probeSize ) ; float determined = org . eclipse . rap . rwt . internal . textsize . TextSizeUtil . getAvgCharWidth ( getFont ( ) ) ; "<AssertPlaceHolder>" ; } getFont ( ) { return new org . eclipse . swt . graphics . Font ( display , org . eclipse . rap . rwt . internal . textsize . TextSizeUtil_Test . FONT_DATA ) ; }
|
org . junit . Assert . assertEquals ( 4 , determined , 0 )
|
testBuildWithParametersWithDisabledDefaultConstraints ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . String docNum = "doc<sp>num" ; java . lang . String email = "email@email.com" ; java . util . Date begDate = new java . util . Date ( ) ; java . util . Date birthDate = new java . util . Date ( ) ; java . lang . String docSeries = "doc<sp>series" ; java . lang . String surname = "surname" ; java . lang . Double rate = 1.0 ; java . lang . String phone = "phone" ; java . lang . String name = "name" ; java . lang . Integer isPlurality = 11 ; java . lang . Integer isPensioner = 12 ; java . lang . String invNum = "invNum" ; java . lang . String firstName = "first<sp>name" ; java . lang . String fatherName = "father<sp>name" ; java . util . Date endDate = new java . util . Date ( ) ; org . lnu . is . domain . department . Department department = new org . lnu . is . domain . department . Department ( ) ; department . setId ( 1L ) ; org . lnu . is . domain . employee . Employee context = new org . lnu . is . domain . employee . Employee ( ) ; org . lnu . is . domain . employee . status . EmployeeStatus employeeStatus = new org . lnu . is . domain . employee . status . EmployeeStatus ( ) ; employeeStatus . setId ( 4L ) ; org . lnu . is . domain . employee . type . EmployeeType employeeType = new org . lnu . is . domain . employee . type . EmployeeType ( ) ; employeeType . setId ( 5L ) ; org . lnu . is . domain . post . Post post = new org . lnu . is . domain . post . Post ( ) ; post . setId ( 7L ) ; org . lnu . is . domain . person . Person person = new org . lnu . is . domain . person . Person ( ) ; person . setId ( 9L ) ; org . lnu . is . domain . employee . Employee parent = new org . lnu . is . domain . employee . Employee ( ) ; parent . setId ( 11L ) ; org . lnu . is . domain . order . Order order = new org . lnu . is . domain . order . Order ( ) ; order . setId ( 12L ) ; org . lnu . is . domain . job . type . JobType jobType = new org . lnu . is . domain . job . type . JobType ( ) ; jobType . setId ( 13L ) ; org . lnu . is . domain . gender . type . GenderType genderType = new org . lnu . is . domain . gender . type . GenderType ( ) ; genderType . setId ( 15L ) ; context . setPost ( post ) ; context . setPerson ( person ) ; context . setParent ( parent ) ; context . setOrder ( order ) ; context . setJobType ( jobType ) ; context . setGenderType ( genderType ) ; context . setEmployeeType ( employeeType ) ; context . setEmployeeStatus ( employeeStatus ) ; context . setDepartment ( department ) ; context . setSurname ( surname ) ; context . setRate ( rate ) ; context . setPhone ( phone ) ; context . setName ( name ) ; context . setIsPlurality ( isPlurality ) ; context . setIsPensioner ( isPensioner ) ; context . setInvNum ( invNum ) ; context . setFirstName ( firstName ) ; context . setFatherName ( fatherName ) ; context . setEndDate ( endDate ) ; context . setDocSeries ( docSeries ) ; context . setDocNum ( docNum ) ; context . setBegDate ( begDate ) ; context . setBirthDate ( birthDate ) ; context . setEmail ( email ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>Employee<sp>e<sp>WHERE<sp>(<sp>e.employeeType<sp>=<sp>:employeeType<sp>AND<sp>e.person<sp>=<sp>:person<sp>AND<sp>e.genderType<sp>=<sp>:genderType<sp>AND<sp>e.department<sp>=<sp>:department<sp>AND<sp>e.post<sp>=:post<sp>AND<sp>e.jobType<sp>=<sp>:jobType<sp>AND<sp>e.employeeStatus<sp>=<sp>:employeeStatus<sp>AND<sp>e.order<sp>=:order<sp>AND<sp>e.parent<sp>=<sp>:parent<sp>AND<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.firstName<sp>LIKE<sp>CONCAT('%',:firstName,'%')<sp>AND<sp>e.fatherName<sp>LIKE<sp>CONCAT('%',:fatherName,'%')<sp>AND<sp>e.surname<sp>LIKE<sp>CONCAT('%',:surname,'%')<sp>AND<sp>e.birthDate<sp>=<sp>:birthDate<sp>AND<sp>e.invNum<sp>=<sp>:invNum<sp>AND<sp>e.rate<sp>=<sp>:rate<sp>AND<sp>e.isPlurality<sp>=:isPlurality<sp>AND<sp>e.isPensioner<sp>=:isPensioner<sp>AND<sp>e.begDate<sp><=<sp>:begDate<sp>AND<sp>e.endDate<sp>>=<sp>:endDate<sp>AND<sp>e.docSeries<sp>LIKE<sp>CONCAT('%',:docSeries,'%')<sp>AND<sp>e.docNum<sp>LIKE<sp>CONCAT('%',:docNum,'%')<sp>AND<sp>e.phone<sp>LIKE<sp>CONCAT('%',:phone,'%')<sp>AND<sp>e.email<sp>LIKE<sp>CONCAT('%',:email,'%')<sp>)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . employee . Employee > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
testLookupSuccessfull ( ) { org . opengis . referencing . crs . CoordinateReferenceSystem crs = org . geotools . referencing . CRS . decode ( "EPSG:42101" ) ; java . lang . String code = org . geotools . referencing . CRS . lookupIdentifier ( crs , true ) ; "<AssertPlaceHolder>" ; } lookupIdentifier ( org . opengis . referencing . IdentifiedObject , boolean ) { final org . geotools . referencing . factory . AbstractAuthorityFactory xyFactory = ( ( org . geotools . referencing . factory . AbstractAuthorityFactory ) ( org . geotools . referencing . CRS . getAuthorityFactory ( true ) ) ) ; final org . geotools . referencing . factory . IdentifiedObjectFinder finder = xyFactory . getIdentifiedObjectFinder ( object . getClass ( ) ) ; finder . setFullScanAllowed ( fullScan ) ; return finder . findIdentifier ( object ) ; }
|
org . junit . Assert . assertEquals ( "EPSG:42101" , code )
|
testSingleFilePath ( ) { buildRule . executeTarget ( "test_single_file_path" ) ; java . io . File file = new java . io . File ( buildRule . getProject ( ) . getProperty ( "output" ) , "copytest_single_file_path.tmp" ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return super . getProject ( ) . getProperty ( property ) ; }
|
org . junit . Assert . assertTrue ( file . exists ( ) )
|
testSessionDestroyedIsDebugEnabledFalse ( ) { org . terasoluna . gfw . web . logback . LogLevelChangeUtil . setLogLevel ( LogLevelChangeUtil . LogLevel . INFO ) ; listener . sessionDestroyed ( httpSessionEvent ) ; "<AssertPlaceHolder>" ; } sessionDestroyed ( javax . servlet . http . HttpSessionEvent ) { if ( org . terasoluna . gfw . web . logging . HttpSessionEventLoggingListener . logger . isDebugEnabled ( ) ) { javax . servlet . http . HttpSession session = se . getSession ( ) ; org . terasoluna . gfw . web . logging . HttpSessionEventLoggingListener . logger . debug ( "SESSIONID#{}<sp>sessionDestroyed<sp>:<sp>{}" , session . getId ( ) , se . getSource ( ) ) ; } }
|
org . junit . Assert . assertThat ( logger . isDebugEnabled ( ) , org . hamcrest . CoreMatchers . is ( false ) )
|
completeCircuitCollectionSerializationDeserializationTest ( ) { org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . LOG . info ( "CircuitCollection<sp>Serialization<sp>Test" ) ; org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection circuitCollection = generateSampleCircuitCollection ( ) ; circuitCollection . getCircuits ( ) . add ( org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . generateCircuit ( ) ) ; java . lang . String xml = org . opennaas . core . resources . ObjectSerializer . toXml ( circuitCollection ) ; org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . LOG . debug ( xml ) ; org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection generatedCircuitCollection = ( ( org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection ) ( org . opennaas . core . resources . ObjectSerializer . fromXml ( xml , org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection . class ) ) ) ; "<AssertPlaceHolder>" ; } fromXml ( java . lang . String , java . lang . String ) { java . io . StringReader in = new java . io . StringReader ( xml ) ; try { javax . xml . bind . JAXBContext context = javax . xml . bind . JAXBContext . newInstance ( packageName ) ; java . lang . Object obj = context . createUnmarshaller ( ) . unmarshal ( in ) ; return obj ; } catch ( javax . xml . bind . JAXBException e ) { throw new org . opennaas . core . resources . SerializationException ( e ) ; } }
|
org . junit . Assert . assertEquals ( circuitCollection , generatedCircuitCollection )
|
run ( ) { net . openhft . chronicle . wire . TextMethodTester test = new net . openhft . chronicle . wire . TextMethodTester ( "methods-in.yaml" , net . openhft . chronicle . wire . MockMethodsImpl :: new , net . openhft . chronicle . wire . MockMethods . class , "methods-in.yaml" ) . setup ( "methods-in.yaml" ) . run ( ) ; "<AssertPlaceHolder>" ; } expected ( ) { return expected ; }
|
org . junit . Assert . assertEquals ( test . expected ( ) , test . actual ( ) )
|
should_follow_indentation_policy_of_indented_tables_and_values ( ) { java . lang . String output = new com . moandjiezana . toml . TomlWriter . Builder ( ) . indentValuesBy ( 2 ) . indentTablesBy ( 2 ) . build ( ) . write ( buildNestedMap ( ) ) ; java . lang . String expected = "aBoolean<sp>=<sp>true\n\n" + ( ( ( ( ( ( ( "[aMap]\n" + "<sp>foo<sp>=<sp>1\n" ) + "<sp>bar<sp>=<sp>\"value1\"\n" ) + "<sp>\"baz.x\"<sp>=<sp>true\n\n" ) + "[child]\n" ) + "<sp>anInt<sp>=<sp>2\n\n" ) + "[aMap]\n" 0 ) + "<sp>anInt<sp>=<sp>4\n" ) ; "<AssertPlaceHolder>" ; } buildNestedMap ( ) { com . moandjiezana . toml . TomlWriterTest . Parent parent = new com . moandjiezana . toml . TomlWriterTest . Parent ( ) ; parent . aMap = new java . util . LinkedHashMap < java . lang . String , java . lang . Object > ( ) ; parent . aMap . put ( "foo" , 1 ) ; parent . aMap . put ( "bar" , "value1" ) ; parent . aMap . put ( "baz.x" , true ) ; parent . child = new com . moandjiezana . toml . TomlWriterTest . Child ( ) ; parent . child . anInt = 2 ; parent . child . subChild = new com . moandjiezana . toml . TomlWriterTest . SubChild ( ) ; parent . child . subChild . anInt = 4 ; parent . aBoolean = true ; return parent ; }
|
org . junit . Assert . assertEquals ( expected , output )
|
testInvariantNotCalled ( ) { de . vksi . c4j . systemtest . config . purebehaviorskiponly . PureBehaviorSkipOnlySystemTest . ContractClass . invariantCalled = false ; target . pureMethod ( ) ; "<AssertPlaceHolder>" ; } pureMethod ( ) { }
|
org . junit . Assert . assertFalse ( de . vksi . c4j . systemtest . config . purebehaviorskiponly . PureBehaviorSkipOnlySystemTest . ContractClass . invariantCalled )
|
testTrainC_ClassificationDataSet ( ) { System . out . println ( "trainC" ) ; for ( jsat . classifiers . trees . TreePruner . PruningMethod pruneMethod : TreePruner . PruningMethod . values ( ) ) for ( jsat . classifiers . trees . ImpurityScore . ImpurityMeasure gainMethod : ImpurityScore . ImpurityMeasure . values ( ) ) for ( boolean useCatFeatures : new boolean [ ] { true , false } ) { jsat . classifiers . trees . DecisionTree instance = new jsat . classifiers . trees . DecisionTree ( ) ; instance . setGainMethod ( gainMethod ) ; instance . setTestProportion ( 0.3 ) ; instance . setPruningMethod ( pruneMethod ) ; int attempts = 3 ; do { jsat . classifiers . ClassificationDataSet train = jsat . FixedProblems . getCircles ( 5000 , 1.0 , 10.0 , 100.0 ) ; jsat . classifiers . ClassificationDataSet test = jsat . FixedProblems . getCircles ( 200 , 1.0 , 10.0 , 100.0 ) ; jsat . classifiers . ClassificationModelEvaluation cme = new jsat . classifiers . ClassificationModelEvaluation ( instance , train ) ; if ( useCatFeatures ) cme . setDataTransformProcess ( new jsat . datatransform . DataTransformProcess ( new jsat . datatransform . NumericalToHistogram ( 50 ) ) ) ; cme . evaluateTestSet ( test ) ; if ( ( cme . getErrorRate ( ) ) < 0.075 ) break ; } while ( ( attempts -- ) > 0 ) ; "<AssertPlaceHolder>" ; } } getErrorRate ( ) { return 1.0 - ( ( getCorrectWeights ( ) ) / ( sumOfWeights ) ) ; }
|
org . junit . Assert . assertTrue ( ( attempts > 0 ) )
|
testNextSelectionDistanceWithSmallerRecentSpan ( ) { org . eclipse . jgit . internal . storage . pack . PackWriterBitmapPreparer preparer = newPeparer ( org . eclipse . jgit . internal . storage . pack . DEFAULT_BITMAP_RECENT_COMMIT_COUNT , 10 , org . eclipse . jgit . internal . storage . pack . DEFAULT_BITMAP_DISTANT_COMMIT_SPAN ) ; int [ ] [ ] distancesAndSpans = new int [ ] [ ] { new int [ ] { 0 , 10 } , new int [ ] { 100 , 10 } , new int [ ] { 10000 , 10 } , new int [ ] { 20000 , 10 } , new int [ ] { 20010 , 10 } , new int [ ] { 20012 , 12 } , new int [ ] { 20050 , 50 } , new int [ ] { 20200 , 200 } , new int [ ] { 22200 , 2200 } , new int [ ] { 24999 , 4999 } , new int [ ] { 25000 , 5000 } , new int [ ] { 50000 , 5000 } , new int [ ] { 1000000 , 5000 } } ; for ( int [ ] pair : distancesAndSpans ) { "<AssertPlaceHolder>" ; } } nextSpan ( int ) { if ( distanceFromTip < 0 ) { throw new java . lang . IllegalArgumentException ( ) ; } if ( distanceFromTip <= ( recentCommitCount ) ) { return recentCommitSpan ; } int next = java . lang . Math . min ( ( distanceFromTip - ( recentCommitCount ) ) , distantCommitSpan ) ; return java . lang . Math . max ( next , recentCommitSpan ) ; }
|
org . junit . Assert . assertEquals ( pair [ 1 ] , preparer . nextSpan ( pair [ 0 ] ) )
|
test_CaptureEnPassantLeftFalse ( ) { classUnderTest = addBlackPawn ( GenericPosition . e4 ) ; pl . add ( new eubos . board . pieces . Knight ( eubos . board . pieces . Piece . Colour . white , GenericPosition . f2 ) ) ; pm = new eubos . position . PositionManager ( new eubos . board . Board ( pl ) , eubos . board . pieces . Piece . Colour . black ) ; pm . performMove ( new eubos . board . pieces . GenericMove ( GenericPosition . f2 , GenericPosition . f4 ) ) ; ml = classUnderTest . generateMoves ( pm . getTheBoard ( ) ) ; expectedMove = new eubos . board . pieces . GenericMove ( GenericPosition . e4 , GenericPosition . f3 ) ; "<AssertPlaceHolder>" ; } getTheBoard ( ) { return theBoard ; }
|
org . junit . Assert . assertFalse ( ml . contains ( expectedMove ) )
|
testSelectInvalidSubclassOnOptional ( ) { java . lang . Number number = 42 ; com . annimon . stream . Optional < java . lang . String > result = com . annimon . stream . Optional . of ( number ) . select ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return new com . annimon . stream . test . hamcrest . OptionalIntMatcher . IsEmptyMatcher ( ) ; }
|
org . junit . Assert . assertThat ( result , isEmpty ( ) )
|
testreadBytes ( ) { @ org . jetbrains . annotations . NotNull net . openhft . chronicle . wire . Wire wire = new net . openhft . chronicle . wire . BinaryWire ( nativeBytes ( ) ) ; wire . write ( "a" ) . typePrefix ( net . openhft . chronicle . wire . BinaryWire2Test . BytesHolder . class ) . marshallable ( ( w ) -> w . write ( "bytes" ) . text ( "Hello<sp>World" ) ) ; net . openhft . chronicle . wire . BinaryWire2Test . BytesHolder bh2 = new net . openhft . chronicle . wire . BinaryWire2Test . BytesHolder ( ) ; wire . read ( "a" ) . object ( bh2 , net . openhft . chronicle . wire . BinaryWire2Test . BytesHolder . class ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( "ScalarStrategy<" + ( type . getName ( ) ) ) + ">" ; }
|
org . junit . Assert . assertEquals ( "Hello<sp>World" , bh2 . bytes . toString ( ) )
|
shouldRetrieveOfficeName ( ) { java . lang . Short officeId = java . lang . Short . valueOf ( "3" ) ; org . mifos . customers . office . business . OfficeBO office = new org . mifos . domain . builders . OfficeBuilder ( ) . withName ( "officeTestName" ) . build ( ) ; when ( officeDao . findOfficeById ( officeId ) ) . thenReturn ( office ) ; org . mifos . dto . screen . DefinePersonnelDto personnelDto = this . personnelServiceFacade . retrieveInfoForNewUserDefinition ( officeId ) ; "<AssertPlaceHolder>" ; } getOfficeName ( ) { return getTextIfNotEmpty ( "bulkEntryPreview.text.officeName" ) ; }
|
org . junit . Assert . assertThat ( personnelDto . getOfficeName ( ) , org . hamcrest . Matchers . is ( "officeTestName" ) )
|
extraOptionsAreNotAppended_WhenTheyAreEmpty ( ) { java . util . Map < java . lang . String , java . lang . String > extraOptions = generateExtraOptions ( org . pentaho . di . core . database . DatabaseMeta_AppendExtraParamsTest . CONN_TYPE_MSSQL , 0 ) ; final java . lang . String validKey = ( ( org . pentaho . di . core . database . DatabaseMeta_AppendExtraParamsTest . CONN_TYPE_MSSQL ) + "." ) + "key" ; extraOptions . put ( validKey , StringUtil . EMPTY_STRING ) ; extraOptions . put ( validKey , DatabaseMeta . EMPTY_OPTIONS_STRING ) ; java . lang . String connUrlWithExtraOptions = meta . appendExtraOptions ( CONN_URL_NO_EXTRA_OPTIONS , extraOptions ) ; "<AssertPlaceHolder>" ; } appendExtraOptions ( java . lang . String , java . util . Map ) { if ( extraOptions . isEmpty ( ) ) { return url ; } java . lang . StringBuilder urlBuilder = new java . lang . StringBuilder ( url ) ; final java . lang . String optionIndicator = getExtraOptionIndicator ( ) ; final java . lang . String optionSeparator = getExtraOptionSeparator ( ) ; final java . lang . String valueSeparator = getExtraOptionValueSeparator ( ) ; java . util . Iterator < java . lang . String > iterator = extraOptions . keySet ( ) . iterator ( ) ; boolean first = true ; while ( iterator . hasNext ( ) ) { java . lang . String typedParameter = iterator . next ( ) ; int dotIndex = typedParameter . indexOf ( '.' ) ; if ( dotIndex == ( - 1 ) ) { continue ; } final java . lang . String value = extraOptions . get ( typedParameter ) ; if ( ( org . pentaho . di . core . util . Utils . isEmpty ( value ) ) || ( value . equals ( org . pentaho . di . core . database . DatabaseMeta . EMPTY_OPTIONS_STRING ) ) ) { continue ; } final java . lang . String typeCode = typedParameter . substring ( 0 , dotIndex ) ; final java . lang . String parameter = typedParameter . substring ( ( dotIndex + 1 ) ) ; boolean dbForBothDbInterfacesIsSame = false ; try { org . pentaho . di . core . database . DatabaseInterface primaryDb = getDbInterface ( typeCode ) ; dbForBothDbInterfacesIsSame = databaseForBothDbInterfacesIsTheSame ( primaryDb , getDatabaseInterface ( ) ) ; } catch ( org . pentaho . di . core . exception . KettleDatabaseException e ) { getGeneralLogger ( ) . logError ( ( ( ( ( "DatabaseInterface<sp>with<sp>" + typeCode ) + "<sp>database<sp>type<sp>is<sp>not<sp>found!<sp>Parameter<sp>" ) + parameter ) + "won't<sp>be<sp>appended<sp>to<sp>URL" ) ) ; } if ( dbForBothDbInterfacesIsSame ) { if ( first && ( ( url . indexOf ( valueSeparator ) ) == ( - 1 ) ) ) { urlBuilder . append ( optionIndicator ) ; } else { urlBuilder . append ( optionSeparator ) ; } urlBuilder . append ( environmentSubstitute ( parameter ) ) . append ( valueSeparator ) . append ( environmentSubstitute ( value ) ) ; first = false ; } } return urlBuilder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( CONN_URL_NO_EXTRA_OPTIONS , connUrlWithExtraOptions )
|
testBatchedUpdate ( ) { org . teiid . language . Insert command = ( ( org . teiid . language . Insert ) ( org . teiid . translator . jdbc . TranslationHelper . helpTranslate ( TranslationHelper . BQT_VDB , "insert<sp>into<sp>BQT1.SmallA<sp>(IntKey)<sp>values<sp>(1)" ) ) ) ; org . teiid . language . Insert command1 = ( ( org . teiid . language . Insert ) ( org . teiid . translator . jdbc . TranslationHelper . helpTranslate ( TranslationHelper . BQT_VDB , "insert<sp>into<sp>BQT1.SmallA<sp>(StringKey)<sp>values<sp>('1')" ) ) ) ; java . sql . Connection connection = org . mockito . Mockito . mock ( java . sql . Connection . class ) ; java . sql . Statement s = org . mockito . Mockito . mock ( java . sql . Statement . class ) ; org . mockito . Mockito . stub ( s . executeBatch ( ) ) . toReturn ( new int [ ] { 1 , 1 } ) ; org . mockito . Mockito . stub ( connection . createStatement ( ) ) . toReturn ( s ) ; org . teiid . translator . jdbc . JDBCExecutionFactory config = new org . teiid . translator . jdbc . JDBCExecutionFactory ( ) ; java . sql . ResultSet r = org . mockito . Mockito . mock ( java . sql . ResultSet . class ) ; java . sql . ResultSetMetaData rs = org . mockito . Mockito . mock ( java . sql . ResultSetMetaData . class ) ; org . mockito . Mockito . stub ( r . getMetaData ( ) ) . toReturn ( rs ) ; org . mockito . Mockito . stub ( s . getGeneratedKeys ( ) ) . toReturn ( r ) ; org . teiid . dqp . internal . datamgr . FakeExecutionContextImpl context = new org . teiid . dqp . internal . datamgr . FakeExecutionContextImpl ( ) ; ( ( org . teiid . query . util . CommandContext ) ( context . getCommandContext ( ) ) ) . setReturnAutoGeneratedKeys ( Collections . EMPTY_LIST ) ; org . teiid . translator . jdbc . JDBCUpdateExecution updateExecution = new org . teiid . translator . jdbc . JDBCUpdateExecution ( new org . teiid . language . BatchedUpdates ( java . util . Arrays . asList ( ( ( org . teiid . language . Command ) ( command ) ) , command1 ) ) , connection , context , config ) ; updateExecution . execute ( ) ; "<AssertPlaceHolder>" ; } getUpdateCounts ( ) { if ( batchOrBulk ) { if ( returnSingleUpdate ) { return new int [ ] { 2 } ; } return new int [ ] { 1 , 1 } ; } return new int [ ] { 1 } ; }
|
org . junit . Assert . assertArrayEquals ( new int [ ] { 1 , 1 } , updateExecution . getUpdateCounts ( ) )
|
shouldCreateOrder ( ) { net . chrisrichardson . ftgo . orderservice . domain . Order order = new net . chrisrichardson . ftgo . orderservice . domain . Order ( 1 , 2 , java . util . Collections . emptyList ( ) ) ; order . setId ( 101L ) ; when ( orderService . createOrder ( 1 , 2 , java . util . Collections . emptyList ( ) ) ) . thenReturn ( order ) ; net . chrisrichardson . ftgo . orderservice . grpc . OrderServiceClient client = new net . chrisrichardson . ftgo . orderservice . grpc . OrderServiceClient ( "localhost" , 50051 ) ; long orderId = client . createOrder ( 1 , 2 , java . util . Collections . emptyList ( ) ) ; "<AssertPlaceHolder>" ; } createOrder ( long , long , java . util . List ) { net . chrisrichardson . ftgo . orderservice . domain . Restaurant restaurant = restaurantRepository . findById ( restaurantId ) . orElseThrow ( ( ) -> new net . chrisrichardson . ftgo . orderservice . domain . RestaurantNotFoundException ( restaurantId ) ) ; java . util . List < net . chrisrichardson . ftgo . orderservice . api . events . OrderLineItem > orderLineItems = makeOrderLineItems ( lineItems , restaurant ) ; io . eventuate . tram . events . aggregates . ResultWithDomainEvents < net . chrisrichardson . ftgo . orderservice . domain . Order , net . chrisrichardson . ftgo . orderservice . api . events . OrderDomainEvent > orderAndEvents = net . chrisrichardson . ftgo . orderservice . domain . Order . createOrder ( consumerId , restaurant , orderLineItems ) ; net . chrisrichardson . ftgo . orderservice . domain . Order order = orderAndEvents . result ; orderRepository . save ( order ) ; orderAggregateEventPublisher . publish ( order , orderAndEvents . events ) ; net . chrisrichardson . ftgo . orderservice . api . events . OrderDetails orderDetails = new net . chrisrichardson . ftgo . orderservice . api . events . OrderDetails ( consumerId , restaurantId , orderLineItems , order . getOrderTotal ( ) ) ; net . chrisrichardson . ftgo . orderservice . sagas . createorder . CreateOrderSagaState data = new net . chrisrichardson . ftgo . orderservice . sagas . createorder . CreateOrderSagaState ( order . getId ( ) , orderDetails ) ; createOrderSagaManager . create ( data , net . chrisrichardson . ftgo . orderservice . domain . Order . class , order . getId ( ) ) ; meterRegistry . ifPresent ( ( mr ) -> mr . counter ( "placed_orders" ) . increment ( ) ) ; return order ; }
|
org . junit . Assert . assertEquals ( 101L , orderId )
|
testIterableSetEmpty ( ) { try ( org . jboss . windup . graph . GraphContext context = factory . create ( true ) ) { java . util . List < org . jboss . windup . graph . model . WindupVertexFrame > models = fillInTestDataAndReturn ( context ) ; org . jboss . windup . graph . iterables . FramesSetIterable iterable = new org . jboss . windup . graph . iterables . FramesSetIterable ( new java . util . ArrayList ( ) ) ; checkForDuplicates ( iterable ) ; "<AssertPlaceHolder>" ; } } getIterableSize ( java . lang . Iterable ) { int size = 0 ; for ( org . jboss . windup . graph . model . WindupVertexFrame frame : iterable ) { size ++ ; } return size ; }
|
org . junit . Assert . assertEquals ( 0 , getIterableSize ( iterable ) )
|
testImageCoordinatePairDefaultConstructor ( ) { org . codice . imaging . nitf . core . image . ImageCoordinatePair coord = new org . codice . imaging . nitf . core . image . impl . ImageCoordinatePairImpl ( ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertNotNull ( coord )
|
rfc6979 ( ) { org . json . JSONArray tests = readArray ( com . bitsofproof . supernode . api . RFC6979Test . TESTS ) ; for ( int i = 0 ; i < ( tests . length ( ) ) ; ++ i ) { org . json . JSONObject test = tests . getJSONObject ( i ) ; com . bitsofproof . supernode . common . ECKeyPair key = com . bitsofproof . supernode . common . ECKeyPair . parseWIF ( test . getString ( "key" ) ) ; byte [ ] message = test . getString ( "message" ) . getBytes ( ) ; byte [ ] expectedSignature = com . bitsofproof . supernode . common . ByteUtils . fromHex ( test . getString ( "expectedSignature" ) ) ; byte [ ] signature = key . sign ( message ) ; "<AssertPlaceHolder>" ; } } sign ( byte [ ] ) { throw new com . bitsofproof . supernode . common . ValidationException ( "Can<sp>not<sp>sign<sp>with<sp>public<sp>key" ) ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( expectedSignature , signature ) )
|
testDistinctUnionOrderByInt ( ) { com . splicemachine . derby . impl . sql . execute . operations . List < java . lang . Object [ ] > expected = com . splicemachine . derby . impl . sql . execute . operations . Arrays . asList ( o ( 1 ) , o ( 2 ) , o ( 4 ) , o ( 5 ) , o ( 7 ) , o ( 10 ) , o ( 20 ) , o ( 40 ) , o ( 50 ) , o ( 70 ) , o ( 90 ) ) ; java . sql . ResultSet rs = methodWatcher . executeQuery ( format ( "select<sp>id<sp>from<sp>%s<sp>union<sp>select<sp>id<sp>from<sp>%s<sp>order<sp>by<sp>id" , com . splicemachine . derby . impl . sql . execute . operations . SortOperationIT . TABLE_NAME_5 , com . splicemachine . derby . impl . sql . execute . operations . SortOperationIT . TABLE_NAME_6 ) ) ; com . splicemachine . derby . impl . sql . execute . operations . List result = com . splicemachine . homeless . TestUtils . resultSetToArrays ( rs ) ; "<AssertPlaceHolder>" ; } toArray ( ) { return java . util . Arrays . copyOf ( buffer , size ) ; }
|
org . junit . Assert . assertArrayEquals ( expected . toArray ( ) , result . toArray ( ) )
|
hasManagerRole_MARKETPLACE_OWNER ( ) { org . oscm . domobjects . PlatformUser user = createUserWithRole ( UserRoleType . MARKETPLACE_OWNER ) ; "<AssertPlaceHolder>" ; } hasManagerRole ( ) { for ( org . oscm . domobjects . RoleAssignment roleAssignment : assignedRoles ) { if ( roleAssignment . getRole ( ) . getRoleName ( ) . isManagerRole ( ) ) return true ; } return false ; }
|
org . junit . Assert . assertTrue ( user . hasManagerRole ( ) )
|
testLotsOfConcurrentConnections ( ) { java . util . concurrent . ExecutorService executor = java . util . concurrent . Executors . newCachedThreadPool ( ) ; final javax . jms . ConnectionFactory factory = createConnectionFactory ( ) ; int connectionCount = 400 ; final java . util . concurrent . atomic . AtomicInteger threadId = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; for ( int i = 0 ; i < connectionCount ; i ++ ) { executor . execute ( new java . lang . Runnable ( ) { @ org . apache . activemq . broker . Override public void run ( ) { final int innerId = threadId . incrementAndGet ( ) ; try { javax . jms . ExceptionListener listener = new org . apache . activemq . broker . NioQueueSubscriptionTestListener ( innerId , exceptions , org . apache . activemq . broker . NioQueueSubscriptionTest . LOG ) ; org . apache . activemq . ActiveMQConnection connection = ( ( org . apache . activemq . ActiveMQConnection ) ( factory . createConnection ( ) ) ) ; connection . setExceptionListener ( listener ) ; connection . start ( ) ; "<AssertPlaceHolder>" ; connections . add ( connection ) ; } catch ( java . lang . Exception e ) { org . apache . activemq . broker . NioQueueSubscriptionTest . LOG . error ( ( ">>>><sp>Exception<sp>in<sp>run()<sp>on<sp>thread<sp>" + innerId ) , e ) ; exceptions . put ( java . lang . Thread . currentThread ( ) , e ) ; } } } ) ; } executor . shutdown ( ) ; executor . awaitTermination ( 30 , TimeUnit . SECONDS ) ; if ( ! ( exceptions . isEmpty ( ) ) ) { org . apache . activemq . broker . NioQueueSubscriptionTest . LOG . error ( ( ( ">>>><sp>" + ( exceptions . size ( ) ) ) + "<sp>exceptions<sp>like" ) , exceptions . values ( ) . iterator ( ) . next ( ) ) ; org . junit . Assert . fail ( ( "unexpected<sp>exceptions<sp>in<sp>worker<sp>threads:<sp>" + ( exceptions . values ( ) . iterator ( ) . next ( ) ) ) ) ; } org . apache . activemq . broker . NioQueueSubscriptionTest . LOG . info ( ( ( "created<sp>" + connectionCount ) + "<sp>connections" ) ) ; } getBrokerName ( ) { return "Artemis<sp>Broker" ; }
|
org . junit . Assert . assertNotNull ( connection . getBrokerName ( ) )
|
testCircularDeclarationWithExtension ( ) { java . lang . String drl = "package<sp>org.drools.compiler.test\n" + ( ( ( ( ( ( ( ( "declare<sp>FactA\n" + "<sp>fieldB:<sp>FactB\n" ) + "package<sp>org.drools.compiler.test\n" 3 ) + "declare<sp>FactB<sp>extends<sp>FactA<sp>end\n" ) + "rule<sp>R1<sp>when\n" ) + "package<sp>org.drools.compiler.test\n" 1 ) + "<sp>$b<sp>:<sp>FactB(<sp>this<sp>==<sp>$a.fieldB<sp>)\n" ) + "then\n" ) + "package<sp>org.drools.compiler.test\n" 0 ) ; org . kie . api . KieBase kbase = new org . kie . internal . utils . KieHelper ( ) . addContent ( drl , ResourceType . DRL ) . build ( ) ; org . kie . api . runtime . KieSession ksession = kbase . newKieSession ( ) ; org . kie . api . definition . type . FactType aType = kbase . getFactType ( "org.drools.compiler.test" , "FactA" ) ; org . kie . api . definition . type . FactType bType = kbase . getFactType ( "org.drools.compiler.test" , "FactB" ) ; java . lang . Object a = aType . newInstance ( ) ; java . lang . Object b = bType . newInstance ( ) ; aType . set ( a , "package<sp>org.drools.compiler.test\n" 2 , b ) ; ksession . insert ( a ) ; ksession . insert ( b ) ; int rules = ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } fireAllRules ( ) { return 0 ; }
|
org . junit . Assert . assertEquals ( 1 , rules )
|
staticConfigShouldWork ( ) { final com . spotify . apollo . Environment environment = sut . withStaticConfig ( configNode ) . build ( ) . create ( com . spotify . apollo . environment . EnvironmentFactoryTest . SERVICE_NAME , routingContext ) ; "<AssertPlaceHolder>" ; } config ( ) { return configResolver . getConfig ( serviceName ) ; }
|
org . junit . Assert . assertEquals ( configNode , environment . config ( ) )
|
testEncryptSignatureConfig ( ) { org . apache . cxf . service . Service service = createService ( ) ; java . util . Map < java . lang . String , java . lang . Object > inConfig = new java . util . HashMap ( ) ; inConfig . put ( ConfigurationConstants . PW_CALLBACK_REF , new org . apache . cxf . ws . security . wss4j . TestPwdCallback ( ) ) ; inConfig . put ( ConfigurationConstants . SIG_VER_PROP_FILE , "insecurity.properties" ) ; inConfig . put ( ConfigurationConstants . DEC_PROP_FILE , "insecurity.properties" ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor inhandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxInInterceptor ( inConfig ) ; service . getInInterceptors ( ) . add ( inhandler ) ; org . apache . cxf . ws . security . wss4j . Echo echo = createClientProxy ( ) ; org . apache . cxf . endpoint . Client client = org . apache . cxf . frontend . ClientProxy . getClient ( echo ) ; client . getInInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingInInterceptor ( ) ) ; client . getOutInterceptors ( ) . add ( new org . apache . cxf . ext . logging . LoggingOutInterceptor ( ) ) ; java . util . Map < java . lang . String , java . lang . Object > outConfig = new java . util . HashMap ( ) ; outConfig . put ( ConfigurationConstants . ACTION , ( ( ( org . apache . wss4j . common . ConfigurationConstants . ENCRYPT ) + "<sp>" ) + ( org . apache . wss4j . common . ConfigurationConstants . SIGNATURE ) ) ) ; outConfig . put ( ConfigurationConstants . SIGNATURE_USER , "myalias" ) ; outConfig . put ( ConfigurationConstants . ENCRYPTION_USER , "myalias" ) ; outConfig . put ( ConfigurationConstants . PW_CALLBACK_REF , new org . apache . cxf . ws . security . wss4j . TestPwdCallback ( ) ) ; outConfig . put ( ConfigurationConstants . SIG_PROP_FILE , "outsecurity.properties" ) ; outConfig . put ( ConfigurationConstants . ENC_PROP_FILE , "outsecurity.properties" ) ; outConfig . put ( ConfigurationConstants . ENC_SYM_ALGO , XMLSecurityConstants . NS_XENC_AES128 ) ; org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ohandler = new org . apache . cxf . ws . security . wss4j . WSS4JStaxOutInterceptor ( outConfig ) ; client . getOutInterceptors ( ) . add ( ohandler ) ; "<AssertPlaceHolder>" ; } echo ( int ) { return i ; }
|
org . junit . Assert . assertEquals ( "test" , echo . echo ( "test" ) )
|
testBuildAndSearchBinaryPermutationIndex ( ) { int peterRank = positionalBuildSearchGetRank ( "-dimension<sp>1024<sp>-vectortype<sp>binary<sp>-seedlength<sp>512<sp>-positionalmethod<sp>permutation<sp>-luceneindexpath<sp>positional_index" , "-searchtype<sp>permutation<sp>-queryvectorfile<sp>elementalvectors.bin<sp>-searchvectorfile<sp>permtermvectors.bin<sp>simon<sp>?" , new java . lang . String [ ] { "elementalvectors.bin" , "permtermvectors.bin" , "docvectors.bin" } , "peter" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ( 3 >= peterRank ) )
|
testSetAndGetCombinationType ( ) { doCallRealMethod ( ) . when ( condition ) . setCombinationType ( anyString ( ) ) ; when ( condition . getCombinationType ( ) ) . thenCallRealMethod ( ) ; condition . setCombinationType ( comboName ) ; "<AssertPlaceHolder>" ; } getCombinationType ( ) { return this . comboType ; }
|
org . junit . Assert . assertEquals ( condition . getCombinationType ( ) , comboName )
|
conversations ( ) { "<AssertPlaceHolder>" ; } conversations ( ) { org . junit . Assert . assertThat ( facebook . conversations ( ) , org . hamcrest . CoreMatchers . instanceOf ( facebook4j . ConversationMethods . class ) ) ; }
|
org . junit . Assert . assertThat ( facebook . conversations ( ) , org . hamcrest . CoreMatchers . instanceOf ( facebook4j . ConversationMethods . class ) )
|
testSerialization ( ) { org . jfree . data . time . TimeSeriesCollection c1 = new org . jfree . data . time . TimeSeriesCollection ( createSeries ( ) ) ; org . jfree . data . time . TimeSeriesCollection c2 = ( ( org . jfree . data . time . TimeSeriesCollection ) ( org . jfree . chart . TestUtils . serialised ( c1 ) ) ) ; "<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 ( c1 , c2 )
|
treeScoringTest_Iris_1 ( ) { org . apache . pig . impl . logicalLayer . schema . Schema inputSchema = buildIrisInputSchema ( ) ; org . apache . pig . data . Tuple inputTuple = tf . newTuple ( ) ; org . apache . pig . data . Tuple expected = tf . newTuple ( ) ; { inputTuple = this . buildIrisInputEvent ( 5.1 , 3.5 , 1.4 , 0.2 , "Iris-setosa" ) ; expected = this . buildIrisOutputEvent ( "Iris-setosa" ) ; } org . surus . pig . ScorePMML evalPMML = new org . surus . pig . ScorePMML ( this . treeIrisModelPath ) ; org . apache . pig . impl . logicalLayer . schema . Schema outputScheam = evalPMML . outputSchema ( inputSchema ) ; org . apache . pig . data . Tuple observed = evalPMML . exec ( inputTuple ) ; if ( expected . equals ( observed ) ) { System . out . println ( "treeScoringTest_Iris_1:<sp>PASS" ) ; } else { System . out . println ( "----------<sp>EPIC<sp>FAIL:<sp>treeScoringTest_Iris_1<sp>----------" ) ; System . out . println ( ( "Expected:<sp>" + ( expected . toString ( ) ) ) ) ; System . out . println ( ( "Observed:<sp>" + ( observed . toString ( ) ) ) ) ; System . out . println ( "--------<sp>END<sp>EPIC<sp>FAIL<sp>--------" ) ; } "<AssertPlaceHolder>" ; } exec ( org . apache . pig . data . Tuple ) { if ( ( this . dataBagSchema ) == null ) { this . dataBagSchema = getInputSchema ( ) . getField ( 0 ) . schema . getField ( 0 ) . schema ; } if ( ! ( ( ( ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . LONG ) ) || ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . INTEGER ) ) ) || ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . DOUBLE ) ) ) || ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . FLOAT ) ) ) ) { throw new java . lang . RuntimeException ( java . lang . String . format ( "Data<sp>type<sp>of<sp>%s<sp>(%s)<sp>is<sp>not<sp>supported," , this . colName , org . apache . pig . data . DataType . findTypeName ( this . dataBagSchema . getField ( this . colName ) . type ) ) ) ; } org . apache . pig . data . DataBag inputBag = ( ( org . apache . pig . data . DataBag ) ( input . get ( 0 ) ) ) ; org . apache . pig . data . TupleFactory tupleFactory = org . apache . pig . data . TupleFactory . getInstance ( ) ; org . apache . pig . data . BagFactory bagFactory = org . apache . pig . data . BagFactory . getInstance ( ) ; java . util . List < org . apache . pig . data . Tuple > tupleList = new java . util . ArrayList < org . apache . pig . data . Tuple > ( ) ; java . util . Iterator < org . apache . pig . data . Tuple > bagIter = inputBag . iterator ( ) ; while ( bagIter . hasNext ( ) ) { org . apache . pig . data . Tuple tuple = bagIter . next ( ) ; tupleList . add ( tuple ) ; } if ( ( tupleList . size ( ) ) != ( ( this . nRows ) * ( this . nCols ) ) ) { throw new java . lang . RuntimeException ( "ERROR:<sp>this.nRows<sp>*<sp>this.nCols<sp>!=<sp>tupleList.size()" ) ; } double [ ] inputArray = new double [ ( this . nRows ) * ( this . nCols ) ] ; java . lang . Integer numNonZeroRecords = 0 ; for ( int n = 0 ; n < ( inputArray . length ) ; n ++ ) { if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . DOUBLE ) ) { inputArray [ n ] = ( ( java . lang . Double ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition ( this . colName ) ) ) ) ; } else if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . FLOAT ) ) { inputArray [ n ] = ( ( java . lang . Float ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition ( this . colName ) ) ) ) ; } else if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . LONG ) ) { inputArray [ n ] = ( ( java . lang . Long ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition ( this . colName ) ) ) ) ; } else if ( ( this . dataBagSchema . getField ( this . colName ) . type ) == ( org . apache . pig . data . DataType . INTEGER ) ) { inputArray [ n ] = ( ( java . lang . Integer ) ( tupleList . get ( n ) . get ( this . dataBagSchema . getPosition
|
org . junit . Assert . assertEquals ( expected , observed )
|
testTest ( ) { org . apache . commons . functor . NullaryPredicate p = new org . apache . commons . functor . adapter . FullyBoundNullaryPredicate ( new org . apache . commons . functor . adapter . BinaryFunctionBinaryPredicate < java . lang . Object , java . lang . Boolean > ( org . apache . commons . functor . core . RightIdentity . < java . lang . Object , java . lang . Boolean > function ( ) ) , "foo" , Boolean . TRUE ) ; "<AssertPlaceHolder>" ; } test ( ) { return ( ( count ) -- ) > 0 ; }
|
org . junit . Assert . assertTrue ( p . test ( ) )
|
testOrganizationsWithMoreThanOneSubscription_invisibleSubscriptions ( ) { final org . oscm . domobjects . TechnicalProduct tProd = runTX ( new java . util . concurrent . Callable < org . oscm . domobjects . TechnicalProduct > ( ) { @ org . oscm . domobjects . Override public org . oscm . domobjects . TechnicalProduct call ( ) throws org . oscm . domobjects . Exception { supplier = org . oscm . test . data . Organizations . createOrganization ( mgr , OrganizationRoleType . SUPPLIER ) ; org . oscm . domobjects . TechnicalProduct tProd = org . oscm . test . data . TechnicalProducts . createTechnicalProduct ( mgr , supplier , "service" , false , ServiceAccessType . LOGIN ) ; org . oscm . domobjects . Product prod = createProduct ( tProd , "prod1" ) ; createInvisibleSubscription ( prod , "sub1" , supplier ) ; createInvisibleSubscription ( prod , "sub2" , supplier ) ; return tProd ; } } ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . domobjects . Override public org . oscm . domobjects . Void call ( ) throws org . oscm . domobjects . Exception { javax . persistence . Query query = mgr . createNamedQuery ( "Subscription.organizationsWithMoreThanOneVisibleSubscription" ) ; query . setParameter ( "productKey" , java . lang . Long . valueOf ( tProd . getKey ( ) ) ) ; java . lang . Object result = query . getSingleResult ( ) ; "<AssertPlaceHolder>" ; return null ; } } ) ; } getSingleResult ( ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( java . lang . Long . valueOf ( 0 ) , result )
|
testDataAccessFinderFindsIt ( ) { java . util . Iterator < org . geotools . data . DataAccessFactory > allFactories = org . geotools . data . DataAccessFinder . getAllDataStores ( ) ; org . geotools . arcsde . ArcSDEDataStoreFactory sdeFac = null ; while ( allFactories . hasNext ( ) ) { org . geotools . data . DataAccessFactory next = allFactories . next ( ) ; if ( next instanceof org . geotools . arcsde . ArcSDEDataStoreFactory ) { sdeFac = ( ( org . geotools . arcsde . ArcSDEDataStoreFactory ) ( next ) ) ; break ; } } "<AssertPlaceHolder>" ; } next ( ) { if ( ! ( hasNext ( ) ) ) { throw new java . util . NoSuchElementException ( ) ; } org . geotools . image . palette . ColorMap . ColorEntry result = current ; current = result . next ; return result ; }
|
org . junit . Assert . assertNotNull ( sdeFac )
|
shouldBeAbleToAddJobsByName ( ) { org . knowm . sundial . SundialJobScheduler . addJob ( "jobByName" , "org.knowm.sundial.jobs.SampleJob1" ) ; "<AssertPlaceHolder>" ; } getAllJobNames ( ) { java . util . List < java . lang . String > allJobNames = new java . util . ArrayList < java . lang . String > ( ) ; try { java . util . Set < java . lang . String > allJobKeys = org . knowm . sundial . SundialJobScheduler . getScheduler ( ) . getJobKeys ( ) ; for ( java . lang . String jobKey : allJobKeys ) { allJobNames . add ( jobKey ) ; } } catch ( org . quartz . exceptions . SchedulerException e ) { throw new org . knowm . sundial . exceptions . SundialSchedulerException ( "COULD<sp>NOT<sp>GET<sp>JOB<sp>NAMES!!!" , e ) ; } java . util . Collections . sort ( allJobNames ) ; return allJobNames ; }
|
org . junit . Assert . assertTrue ( org . knowm . sundial . SundialJobScheduler . getAllJobNames ( ) . contains ( "jobByName" ) )
|
testFindURLSetter ( ) { final java . lang . String url = "www.google.com" ; org . supercsv . util . ReflectionUtils . findSetter ( bean , "URL" , java . lang . String . class ) . invoke ( bean , url ) ; "<AssertPlaceHolder>" ; } getURL ( ) { return URL ; }
|
org . junit . Assert . assertEquals ( url , bean . getURL ( ) )
|
validInputShouldPass ( ) { eu . inmite . android . lib . validations . RegExpValidatorTest . ModelWithValidation model = eu . inmite . android . lib . validations . RegExpValidatorTest . initModel ( ) ; model . txtNotNumber . setText ( "absd,/.';" ) ; model . editNumber . setText ( "0123456789" ) ; final boolean valid = eu . inmite . android . lib . validations . form . FormValidator . validate ( Robolectric . application , model , null ) ; "<AssertPlaceHolder>" ; } validate ( android . content . Context , java . lang . Object , eu . inmite . android . lib . validations . form . iface . IValidationCallback ) { if ( context == null ) { throw new java . lang . IllegalArgumentException ( "context<sp>cannot<sp>ben<sp>null" ) ; } if ( target == null ) { throw new java . lang . IllegalArgumentException ( "target<sp>cannot<sp>be<sp>null" ) ; } final java . util . List < eu . inmite . android . lib . validations . form . FormValidator . ValidationFail > failedValidations = new java . util . ArrayList ( ) ; final java . util . List < android . view . View > passedValidations = new java . util . ArrayList ( ) ; boolean result = true ; final java . util . Map < android . view . View , eu . inmite . android . lib . validations . form . FormValidator . FieldInfo > infoMap = eu . inmite . android . lib . validations . form . FieldFinder . getFieldsForTarget ( target ) ; for ( Map . Entry < android . view . View , eu . inmite . android . lib . validations . form . FormValidator . FieldInfo > entry : infoMap . entrySet ( ) ) { final eu . inmite . android . lib . validations . form . FormValidator . FieldInfo fieldInfo = entry . getValue ( ) ; final android . view . View view = entry . getKey ( ) ; if ( ( ( view . getVisibility ( ) ) == ( android . view . View . GONE ) ) || ( ( view . getVisibility ( ) ) == ( android . view . View . INVISIBLE ) ) ) { continue ; } eu . inmite . android . lib . validations . form . FormValidator . ValidationFail fieldResult = eu . inmite . android . lib . validations . form . FormValidator . performFieldValidations ( context , fieldInfo , view ) ; if ( fieldResult != null ) { failedValidations . add ( fieldResult ) ; result = false ; } else { passedValidations . add ( view ) ; } } if ( callback != null ) { java . util . Collections . sort ( failedValidations , new java . util . Comparator < eu . inmite . android . lib . validations . form . FormValidator . ValidationFail > ( ) { @ eu . inmite . android . lib . validations . form . Override public int compare ( eu . inmite . android . lib . validations . form . FormValidator . ValidationFail lhs , eu . inmite . android . lib . validations . form . FormValidator . ValidationFail rhs ) { return ( lhs . order ) < ( rhs . order ) ? - 1 : ( lhs . order ) == ( rhs . order ) ? 0 : 1 ; } } ) ; callback . validationComplete ( result , java . util . Collections . unmodifiableList ( failedValidations ) , java . util . Collections . unmodifiableList ( passedValidations ) ) ; } return result ; }
|
org . junit . Assert . assertTrue ( valid )
|
test_plus_longPeriodUnit_zero ( ) { java . time . LocalDate t = TEST_2007_07_15 . plus ( 0 , ChronoUnit . DAYS ) ; "<AssertPlaceHolder>" ; } plus ( long , java . time . temporal . TemporalUnit ) { if ( unit instanceof java . time . temporal . ChronoUnit ) { java . time . temporal . ChronoUnit f = ( ( java . time . temporal . ChronoUnit ) ( unit ) ) ; switch ( f ) { case DAYS : return plusDays ( amountToAdd ) ; case WEEKS : return plusWeeks ( amountToAdd ) ; case MONTHS : return plusMonths ( amountToAdd ) ; case YEARS : return plusYears ( amountToAdd ) ; case DECADES : return plusYears ( java . lang . Math . multiplyExact ( amountToAdd , 10 ) ) ; case CENTURIES : return plusYears ( java . lang . Math . multiplyExact ( amountToAdd , 100 ) ) ; case MILLENNIA : return plusYears ( java . lang . Math . multiplyExact ( amountToAdd , 1000 ) ) ; case ERAS : return with ( java . time . temporal . ChronoField . ERA , java . lang . Math . addExact ( getLong ( java . time . temporal . ChronoField . ERA ) , amountToAdd ) ) ; } throw new java . time . temporal . UnsupportedTemporalTypeException ( ( "Unsupported<sp>unit:<sp>" + unit ) ) ; } return unit . addTo ( this , amountToAdd ) ; }
|
org . junit . Assert . assertSame ( t , TEST_2007_07_15 )
|
testIntValue ( ) { "<AssertPlaceHolder>" ; } intValue ( ) { return sun . util . logging . PlatformLogger . Level . LEVEL_VALUES [ this . ordinal ( ) ] ; }
|
org . junit . Assert . assertEquals ( 10 , new java . lang . Integer ( ( ( int ) ( 10 ) ) ) . intValue ( ) , 0 )
|
succeedsWhenInnerMatcherSucceeds ( ) { "<AssertPlaceHolder>" ; } isThrowable ( org . hamcrest . Matcher ) { return new org . junit . internal . matchers . StacktracePrintingMatcher < T > ( throwableMatcher ) ; }
|
org . junit . Assert . assertTrue ( org . junit . internal . matchers . StacktracePrintingMatcher . isThrowable ( org . hamcrest . CoreMatchers . any ( java . lang . Throwable . class ) ) . matches ( new java . lang . Exception ( ) ) )
|
testGetFeatureInfoRemoteWmsCachedGmlOutputValid ( ) { java . io . InputStream response = doGetFeatureInfo ( "remotewms_dominant_vegetation_cached" , "utah" , "57142.857142857145" , "application/gml+xml;<sp>version=3.1" ) ; java . lang . String [ ] schemaUrls = new java . lang . String [ 2 ] ; schemaUrls [ 0 ] = org . deegree . protocol . wfs . WFSConstants . WFS_110_SCHEMA_URL ; schemaUrls [ 1 ] = org . deegree . services . wmts . WmtsIT . class . getResource ( "dominant_vegetation.xsd" ) . toExternalForm ( ) ; java . util . List < org . deegree . commons . xml . schema . SchemaValidationEvent > errors = org . deegree . commons . xml . schema . SchemaValidator . validate ( response , schemaUrls ) ; "<AssertPlaceHolder>" ; } size ( ) { return fragment . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , errors . size ( ) )
|
datumAanvangVerledenR1872 ( ) { final nl . bzk . brp . bijhouding . bericht . model . RelatieGroepElement relatie = new nl . bzk . brp . bijhouding . bericht . model . RelatieGroepElement ( nl . bzk . brp . bijhouding . bericht . model . RelatieGroepElementTest . ATTRIBUTEN , new nl . bzk . brp . bijhouding . bericht . model . DatumElement ( nl . bzk . brp . bijhouding . bericht . model . RelatieGroepElementTest . PEIL_DATUM ) , nl . bzk . brp . bijhouding . bericht . model . RelatieGroepElementTest . GEMEENTE_BKND , new nl . bzk . brp . bijhouding . bericht . model . StringElement ( nl . bzk . brp . bijhouding . bericht . model . RelatieGroepElementTest . AMSTERDAM ) , null , null , null , null , null , null , null , null , null , null , null , null ) ; relatie . setVerzoekBericht ( getBerichtPrevalidatie ( ) ) ; "<AssertPlaceHolder>" ; } valideerInhoud ( ) { return java . util . Collections . emptyList ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , relatie . valideerInhoud ( ) . size ( ) )
|
testGetMessageAnnotationWhenMessageHasAnnotationsMap ( ) { java . util . Map < org . apache . qpid . proton . amqp . Symbol , java . lang . Object > messageAnnotationsMap = new java . util . HashMap ( ) ; messageAnnotationsMap . put ( org . apache . qpid . proton . amqp . Symbol . valueOf ( "x-opt-test" ) , Boolean . TRUE ) ; org . apache . qpid . proton . message . Message message = org . apache . qpid . proton . Proton . message ( ) ; message . setMessageAnnotations ( new org . apache . qpid . proton . amqp . messaging . MessageAnnotations ( messageAnnotationsMap ) ) ; "<AssertPlaceHolder>" ; } getMessageAnnotation ( java . lang . String , org . apache . qpid . proton . message . Message ) { if ( ( message != null ) && ( ( message . getMessageAnnotations ( ) ) != null ) ) { java . util . Map < org . apache . qpid . proton . amqp . Symbol , java . lang . Object > annotations = message . getMessageAnnotations ( ) . getValue ( ) ; return annotations . get ( org . apache . activemq . artemis . protocol . amqp . converter . AMQPMessageSupport . getSymbol ( key ) ) ; } return null ; }
|
org . junit . Assert . assertNotNull ( org . apache . activemq . artemis . protocol . amqp . converter . AMQPMessageSupport . getMessageAnnotation ( "x-opt-test" , message ) )
|
randomTest02 ( ) { long seed = java . lang . System . currentTimeMillis ( ) ; com . github . neuralnetworks . tensor . Matrix openClResult = randomTest ( Runtime . OPENCL , seed , 100000 , 1 , 10 , 10 ) ; com . github . neuralnetworks . tensor . Matrix seqResult = randomTest ( Runtime . CPU_SEQ , seed , 100000 , 1 , 10 , 10 ) ; System . out . println ( ( "Use<sp>seed:<sp>" + seed ) ) ; "<AssertPlaceHolder>" ; } isEqual ( com . github . neuralnetworks . tensor . Tensor , com . github . neuralnetworks . tensor . Tensor ) { if ( ( t1 == null ) || ( t2 == null ) ) return false ; if ( t1 . equals ( t2 ) ) return true ; if ( ( t1 . getDimensions ( ) . length ) != ( t2 . getDimensions ( ) . length ) ) return false ; for ( int d = 0 ; d < ( t1 . getDimensions ( ) . length ) ; d ++ ) { if ( ( t1 . getDimensions ( ) [ d ] ) != ( t2 . getDimensions ( ) [ d ] ) ) return false ; } com . github . neuralnetworks . tensor . Tensor . TensorIterator it1 = t1 . iterator ( ) ; com . github . neuralnetworks . tensor . Tensor . TensorIterator it2 = t2 . iterator ( ) ; while ( ( it1 . hasNext ( ) ) && ( it2 . hasNext ( ) ) ) { float v1 = t1 . getElements ( ) [ it1 . next ( ) ] ; float v2 = t2 . getElements ( ) [ it2 . next ( ) ] ; if ( ( java . lang . Math . abs ( ( v1 - v2 ) ) ) > 1.0E-6 ) return false ; } return true ; }
|
org . junit . Assert . assertTrue ( isEqual ( openClResult , seqResult ) )
|
cancelButtonDiscardsChanges ( ) { java . lang . String firstCellText = $ ( com . vaadin . testbench . elements . GridElement . class ) . first ( ) . getCell ( 0 , 0 ) . getText ( ) ; getRows ( ) . get ( 0 ) . findElement ( org . openqa . selenium . By . tagName ( "td" ) ) . click ( ) ; org . openqa . selenium . WebElement form = findElement ( org . openqa . selenium . By . id ( "contactform" ) ) ; org . openqa . selenium . WebElement firstName = form . findElement ( org . openqa . selenium . By . className ( "firstName" ) ) ; firstName . clear ( ) ; firstName . sendKeys ( "Updated<sp>Name" ) ; com . vaadin . testbench . elements . ButtonElement cancelButton = $ ( com . vaadin . testbench . elements . ButtonElement . class ) . get ( 2 ) ; cancelButton . click ( ) ; "<AssertPlaceHolder>" ; } getText ( ) { return text ; }
|
org . junit . Assert . assertEquals ( $ ( com . vaadin . testbench . elements . GridElement . class ) . first ( ) . getCell ( 0 , 0 ) . getText ( ) , firstCellText )
|
testFillTransform_EmptyMetricsList ( ) { com . salesforce . dva . argus . service . metric . transform . Transform fillTransform = new com . salesforce . dva . argus . service . metric . transform . FillTransform ( ) ; java . util . List < java . lang . String > constants = new java . util . ArrayList ( ) ; constants . add ( "100s" ) ; constants . add ( "1s" ) ; constants . add ( "100.0" ) ; constants . add ( ( ( java . lang . System . currentTimeMillis ( ) ) + "" ) ) ; constants . add ( "false" ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > metrics = fillTransform . transform ( null , java . util . Arrays . asList ( ) , constants ) ; "<AssertPlaceHolder>" ; } transform ( com . salesforce . dva . argus . util . QueryContext , java . util . List , java . util . List ) { com . salesforce . dva . argus . system . SystemAssert . requireArgument ( ( metrics != null ) , "Cannot<sp>transform<sp>null<sp>metrics" ) ; com . salesforce . dva . argus . system . SystemAssert . requireArgument ( ( ( constants != null ) && ( ( constants . size ( ) ) >= 2 ) ) , "Constants<sp>list<sp>cannot<sp>be<sp>null<sp>and<sp>its<sp>size<sp>must<sp>be<sp>2<sp>or<sp>more." ) ; com . salesforce . dva . argus . service . metric . transform . TransformFactory . Function functionName = null ; int functionElementId = - 1 ; for ( int i = ( constants . size ( ) ) - 1 ; i >= 0 ; i -- ) { java . lang . String constant = constants . get ( i ) ; try { functionName = TransformFactory . Function . valueOf ( constant ) ; functionElementId = i ; break ; } catch ( java . lang . IllegalArgumentException ex ) { } } if ( functionName == null ) { throw new java . lang . UnsupportedOperationException ( "GroupByTag<sp>needs<sp>a<sp>function<sp>name<sp>to<sp>be<sp>provided" ) ; } java . util . List < java . lang . String > tags = constants . subList ( 0 , functionElementId ) ; if ( tags . isEmpty ( ) ) { throw new java . lang . UnsupportedOperationException ( "GroupByTag<sp>needs<sp>at<sp>least<sp>one<sp>tag<sp>to<sp>be<sp>provided" ) ; } java . util . List < java . lang . String > transformConstants = ( functionElementId == ( ( constants . size ( ) ) - 1 ) ) ? new java . util . ArrayList ( ) : constants . subList ( ( functionElementId + 1 ) , constants . size ( ) ) ; java . util . Map < java . lang . String , java . util . List < com . salesforce . dva . argus . entity . Metric > > groups = new java . util . HashMap ( ) ; for ( com . salesforce . dva . argus . entity . Metric metric : metrics ) { java . lang . String key = tags . stream ( ) . map ( metric :: getTag ) . filter ( Objects :: nonNull ) . collect ( java . util . stream . Collectors . joining ( "," ) ) ; groups . putIfAbsent ( key , new java . util . ArrayList ( ) ) ; groups . get ( key ) . add ( metric ) ; } com . salesforce . dva . argus . service . metric . transform . Transform transform = _factory . getTransform ( functionName . getName ( ) ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > result = new java . util . ArrayList ( ) ; for ( java . util . Map . Entry < java . lang . String , java . util . List < com . salesforce . dva . argus . entity . Metric > > entry : groups . entrySet ( ) ) { java . util . List < com . salesforce . dva . argus . entity . Metric > metricsInThisGroup = entry . getValue ( ) ; java . util . List < com . salesforce . dva . argus . entity . Metric > reducedMetrics = ( transformConstants . isEmpty ( ) ) ? transform . transform ( null , metricsInThisGroup ) : transform . transform ( null , metricsInThisGroup , transformConstants ) ; for ( com . salesforce . dva . argus . entity . Metric reducedMetric : reducedMetrics ) { reducedMetric . setScope ( ( ( ( entry . getKey ( ) ) != null ) && ( ! ( entry . getKey ( ) . trim ( ) . isEmpty ( ) ) ) ? entry . getKey ( ) : "uncaptured-group" ) ) ; } result . addAll ( reducedMetrics ) ; } return result ; }
|
org . junit . Assert . assertEquals ( metrics . size ( ) , 0 )
|
a_loadQueryRestrictionStrategyAsContainsTest ( ) { org . geosdi . geoplatform . connector . server . request . v110 . query . repository . QueryRestrictionStrategy < org . geosdi . geoplatform . xml . filter . v110 . ComparisonOpsType > containsStrategy = org . geosdi . geoplatform . connector . wfs . services . WFSQueryRestrictionRepositoryTest . store . getQueryRestrictionStrategy ( org . geosdi . geoplatform . connector . wfs . services . CONTAINS ) ; "<AssertPlaceHolder>" ; org . geosdi . geoplatform . connector . wfs . services . WFSQueryRestrictionRepositoryTest . logger . info ( "################################CONTAINS_STRATEGY<sp>:<sp>{}\n" , containsStrategy ) ; } getQueryRestrictionStrategy ( org . geosdi . geoplatform . gui . shared . wfs . WFSOperatorType ) { checkArgument ( ( operatorType != null ) , "The<sp>Parameter<sp>operatorType<sp>must<sp>not<sp>be<sp>null." ) ; org . geosdi . geoplatform . connector . server . request . v110 . query . repository . QueryRestrictionRepository . logger . trace ( "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Try<sp>to<sp>find<sp>QueryRestrictionStrategy<sp>with<sp>Key<sp>:<sp>{}\n" , operatorType ) ; return org . geosdi . geoplatform . connector . server . request . v110 . query . repository . QueryRestrictionRepository . queryRestrictionStrategies . get ( operatorType ) ; }
|
org . junit . Assert . assertNotNull ( containsStrategy )
|
validateServiceImp4 ( ) { java . util . List < org . ebayopensource . turmeric . tools . codegen . validator . MessageObject > errMsgList = null ; try { org . ebayopensource . turmeric . tools . codegen . validator . SourceValidator . validateServiceImpl ( org . ebayopensource . turmeric . tools . codegen . SimpleServiceImpl . class , null ) ; } catch ( org . ebayopensource . turmeric . tools . codegen . exception . PreValidationFailedException ex ) { } catch ( java . lang . Exception ex ) { errMsgList = new java . util . ArrayList < org . ebayopensource . turmeric . tools . codegen . validator . MessageObject > ( ) ; } "<AssertPlaceHolder>" ; } validateServiceImpl ( java . lang . String , java . lang . String ) { if ( org . ebayopensource . turmeric . tools . codegen . util . CodeGenUtil . isEmptyString ( qualifiedSvcImplName ) ) { throw new org . ebayopensource . turmeric . tools . codegen . exception . PreValidationFailedException ( "Service<sp>Impl<sp>class<sp>name<sp>is<sp>empty." ) ; } else if ( org . ebayopensource . turmeric . tools . codegen . util . CodeGenUtil . isEmptyString ( qualifiedSvcInterfaceName ) ) { throw new org . ebayopensource . turmeric . tools . codegen . exception . PreValidationFailedException ( "Service<sp>Interface<sp>class<sp>name<sp>is<sp>empty." ) ; } java . lang . Class svcImplClass = null ; java . lang . Class svcInterfaceClass = null ; try { svcImplClass = org . ebayopensource . turmeric . tools . codegen . util . IntrospectUtil . loadClass ( qualifiedSvcImplName ) ; } catch ( java . lang . ClassNotFoundException clsNotFound ) { throw new org . ebayopensource . turmeric . tools . codegen . exception . PreValidationFailedException ( ( "Unable<sp>to<sp>load<sp>:<sp>" + qualifiedSvcImplName ) , clsNotFound ) ; } try { svcInterfaceClass = org . ebayopensource . turmeric . tools . codegen . util . IntrospectUtil . loadClass ( qualifiedSvcInterfaceName ) ; } catch ( java . lang . ClassNotFoundException clsNotFound ) { throw new org . ebayopensource . turmeric . tools . codegen . exception . PreValidationFailedException ( ( "Unable<sp>to<sp>load<sp>:<sp>" + qualifiedSvcInterfaceName ) , clsNotFound ) ; } return org . ebayopensource . turmeric . tools . codegen . validator . SourceValidator . validateServiceImpl ( svcImplClass , svcInterfaceClass ) ; }
|
org . junit . Assert . assertNull ( errMsgList )
|
testUsesHandlerAuthenticationScheme ( ) { java . security . Principal principal = mock ( java . security . Principal . class ) ; when ( authenticationHandler . getAuthenticationScheme ( ) ) . thenReturn ( SecurityContext . BASIC_AUTH ) ; when ( authenticationHandler . authenticate ( any ( javax . ws . rs . container . ContainerRequestContext . class ) ) ) . thenReturn ( principal ) ; com . eclipsesource . jaxrs . provider . security . impl . SecurityAdmin securityAdmin = new com . eclipsesource . jaxrs . provider . security . impl . SecurityAdmin ( ) ; javax . ws . rs . container . ContainerRequestContext requestContext = mockContainerRequest ( "https://foo.bar" ) ; javax . ws . rs . core . SecurityContext context = securityAdmin . getSecurityContext ( requestContext ) ; "<AssertPlaceHolder>" ; } getAuthenticationScheme ( ) { return authenticationScheme ; }
|
org . junit . Assert . assertEquals ( SecurityContext . BASIC_AUTH , context . getAuthenticationScheme ( ) )
|
executeAndExtractWithMultipleResults ( ) { java . util . List < java . lang . String > results = java . util . Arrays . asList ( "one" , "two" , "three" ) ; org . springframework . data . gemfire . function . execution . AbstractFunctionExecution functionExecution = new org . springframework . data . gemfire . function . execution . AbstractFunctionExecution ( ) { @ org . springframework . data . gemfire . function . execution . Override protected org . apache . geode . cache . execute . Execution getExecution ( ) { return mockExecution ; } @ org . springframework . data . gemfire . function . execution . SuppressWarnings ( "unchecked" ) @ org . springframework . data . gemfire . function . execution . Override < T > java . lang . Iterable < T > execute ( ) { return ( ( java . lang . Iterable < T > ) ( results ) ) ; } } ; "<AssertPlaceHolder>" ; } executeAndExtract ( ) { java . lang . Iterable < T > results = execute ( ) ; if ( ( results == null ) || ( ! ( results . iterator ( ) . hasNext ( ) ) ) ) { return null ; } java . lang . Object result = results . iterator ( ) . next ( ) ; if ( result instanceof java . lang . Throwable ) { throw new org . apache . geode . cache . execute . FunctionException ( java . lang . String . format ( "Execution<sp>of<sp>Function<sp>%s<sp>failed" , ( ( this . function ) != null ? this . function . getClass ( ) . getName ( ) : java . lang . String . format ( "with<sp>ID<sp>[%s]" , this . functionId ) ) ) , ( ( java . lang . Throwable ) ( result ) ) ) ; } return ( ( T ) ( result ) ) ; }
|
org . junit . Assert . assertThat ( functionExecution . executeAndExtract ( ) , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( "one" ) ) )
|
testShort1 ( ) { short [ ] target = new short [ ] { 2 , 1 , 0 } ; "<AssertPlaceHolder>" ; } quickSortP ( int [ ] ) { int [ ] permutation = new int [ target . length ] ; for ( int i = 1 ; i < ( target . length ) ; ++ i ) permutation [ i ] = i ; cc . redberry . rings . util . ArraysUtil . quickSort ( target , 0 , target . length , permutation ) ; return permutation ; }
|
org . junit . Assert . assertArrayEquals ( new int [ ] { 2 , 1 , 0 } , cc . redberry . rings . util . ArraysUtil . quickSortP ( target ) )
|
testCreteEmbeddedServerFromConfig ( ) { org . apache . jackrabbit . oak . plugins . index . solr . configuration . SolrServerConfiguration < org . apache . jackrabbit . oak . plugins . index . solr . server . EmbeddedSolrServerProvider > embeddedSolrServerSolrServerConfiguration = new org . apache . jackrabbit . oak . plugins . index . solr . configuration . EmbeddedSolrServerConfiguration ( null , null ) ; org . apache . jackrabbit . oak . plugins . index . solr . server . EmbeddedSolrServerProvider embeddedSolrServerProvider = embeddedSolrServerSolrServerConfiguration . getProvider ( ) ; "<AssertPlaceHolder>" ; } getProvider ( ) { if ( ( constructor ) == null ) { java . lang . Class < ? > rawType = ( ( type ) instanceof java . lang . Class < ? > ) ? ( ( java . lang . Class < ? > ) ( type ) ) : ( ( java . lang . Class < ? > ) ( ( ( java . lang . reflect . ParameterizedType ) ( type ) ) . getRawType ( ) ) ) ; java . lang . reflect . Constructor < ? > [ ] constructors = rawType . getConstructors ( ) ; for ( java . lang . reflect . Constructor < ? > c : constructors ) { if ( ( ( c . getParameterTypes ( ) . length ) == 1 ) && ( c . getParameterTypes ( ) [ 0 ] . equals ( this . getClass ( ) ) ) ) { constructor = c ; } } if ( ( constructor ) == null ) { throw new java . lang . InstantiationException ( ( "missing<sp>constructor<sp>SolrServerProvider(SolrServerConfiguration)<sp>for<sp>type<sp>" + rawType ) ) ; } } return ( ( S ) ( constructor . newInstance ( this ) ) ) ; }
|
org . junit . Assert . assertNotNull ( embeddedSolrServerProvider )
|
testDeleteDeletedProperty ( ) { theirRoot . getTree ( "/" ) . removeProperty ( "a" ) ; ourRoot . getTree ( "/" ) . removeProperty ( "a" ) ; theirRoot . commit ( ) ; ourRoot . commit ( ) ; org . apache . jackrabbit . oak . api . PropertyState p = ourRoot . getTree ( "/" ) . getProperty ( "a" ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return getWrappedNodeBuilder ( ) . getProperty ( name ) ; }
|
org . junit . Assert . assertNull ( p )
|
testIsEmptyOnNullValue ( ) { "<AssertPlaceHolder>" ; } isEmpty ( ) { return new com . annimon . stream . test . hamcrest . OptionalMatcher . IsEmptyMatcher ( ) ; }
|
org . junit . Assert . assertThat ( null , com . annimon . stream . test . hamcrest . OptionalMatcher . isEmpty ( ) )
|
testSetServiceRequestType ( ) { empty . setServiceRequestType ( "test" ) ; "<AssertPlaceHolder>" ; } getServiceRequestType ( ) { return this . serviceRequestType ; }
|
org . junit . Assert . assertEquals ( "test" , empty . getServiceRequestType ( ) )
|
testCollect ( ) { java . util . List < java . lang . String > strings = java . util . Arrays . asList ( "this" , "is" , "a" , "test" ) ; java . util . List < edu . jhu . pacaya . sch . util . Indexed < java . lang . String > > collected = new java . util . ArrayList ( edu . jhu . pacaya . sch . util . Indexed . collect ( edu . jhu . pacaya . sch . util . Indexed . enumerate ( strings ) ) ) ; java . util . List < edu . jhu . pacaya . sch . util . Indexed < java . lang . String > > expected = java . util . Arrays . asList ( new edu . jhu . pacaya . sch . util . Indexed < java . lang . String > ( "this" , 0 ) , new edu . jhu . pacaya . sch . util . Indexed < java . lang . String > ( "is" , 1 ) , new edu . jhu . pacaya . sch . util . Indexed < java . lang . String > ( "a" , 2 ) , new edu . jhu . pacaya . sch . util . Indexed < java . lang . String > ( "test" , 3 ) ) ; "<AssertPlaceHolder>" ; } enumerate ( java . lang . Iterable ) { return new java . lang . Iterable < edu . jhu . pacaya . sch . util . Indexed < T > > ( ) { @ edu . jhu . pacaya . sch . util . Override public java . util . Iterator < edu . jhu . pacaya . sch . util . Indexed < T > > iterator ( ) { java . util . Iterator < T > itr = stream . iterator ( ) ; return new java . util . Iterator < edu . jhu . pacaya . sch . util . Indexed < T > > ( ) { private int i = 0 ; @ edu . jhu . pacaya . sch . util . Override public boolean hasNext ( ) { return itr . hasNext ( ) ; } @ edu . jhu . pacaya . sch . util . Override public edu . jhu . pacaya . sch . util . Indexed < T > next ( ) { edu . jhu . pacaya . sch . util . Indexed < T > nextPair = new edu . jhu . pacaya . sch . util . Indexed < T > ( itr . next ( ) , i ) ; ( i ) ++ ; return nextPair ; } } ; } } ; }
|
org . junit . Assert . assertEquals ( expected , collected )
|
testGetSubVector ( ) { org . apache . commons . math4 . linear . RealVector u = createVector ( ) ; org . apache . commons . math4 . linear . RealVector v = org . apache . commons . math4 . linear . RealVector . unmodifiableRealVector ( u ) ; for ( int i = 0 ; i < ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . DIM ) ; i ++ ) { for ( int n = 1 ; n < ( ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . DIM ) - i ) ; n ++ ) { org . apache . commons . math4 . linear . RealVector exp = u . getSubVector ( i , n ) ; org . apache . commons . math4 . linear . RealVector act = v . getSubVector ( i , n ) ; "<AssertPlaceHolder>" ; } } } equals ( double , double ) { if ( x == y ) { return true ; } else if ( ( org . apache . commons . math4 . util . FastMath . abs ( x ) ) <= ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . EPS ) ) { return ( org . apache . commons . math4 . util . FastMath . abs ( y ) ) <= ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . EPS ) ; } else if ( ( org . apache . commons . math4 . util . FastMath . abs ( y ) ) <= ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . EPS ) ) { return ( org . apache . commons . math4 . util . FastMath . abs ( x ) ) <= ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . EPS ) ; } else { return ( org . apache . commons . math4 . util . FastMath . abs ( ( x - y ) ) ) <= ( ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . EPS ) * ( org . apache . commons . math4 . util . FastMath . min ( org . apache . commons . math4 . util . FastMath . abs ( x ) , org . apache . commons . math4 . util . FastMath . abs ( y ) ) ) ) ; } }
|
org . junit . Assert . assertTrue ( org . apache . commons . math4 . linear . UnmodifiableRealVectorAbstractTest . equals ( exp , act ) )
|
test_withZone_same ( ) { java . time . Clock test = java . time . Clock . tick ( java . time . Clock . system ( test . java . time . TestClock_Tick . PARIS ) , java . time . Duration . ofMillis ( 500 ) ) ; java . time . Clock changed = test . withZone ( test . java . time . TestClock_Tick . PARIS ) ; "<AssertPlaceHolder>" ; } withZone ( java . time . ZoneId ) { if ( java . util . Objects . equals ( this . zone , zone ) ) { return this ; } return new java . time . format . DateTimeFormatter ( printerParser , locale , decimalStyle , resolverStyle , resolverFields , chrono , zone ) ; }
|
org . junit . Assert . assertSame ( test , changed )
|
testJAXBElement ( ) { com . sun . jersey . api . client . WebResource webResource = resource ( ) ; com . sun . jersey . api . client . GenericType < javax . xml . bind . JAXBElement < com . sun . jersey . samples . jaxb . JAXBXmlType > > genericType = new com . sun . jersey . api . client . GenericType < javax . xml . bind . JAXBElement < com . sun . jersey . samples . jaxb . JAXBXmlType > > ( ) { } ; javax . xml . bind . JAXBElement < com . sun . jersey . samples . jaxb . JAXBXmlType > e1 = webResource . path ( "jaxb/JAXBElement" ) . get ( genericType ) ; javax . xml . bind . JAXBElement < com . sun . jersey . samples . jaxb . JAXBXmlType > e2 = webResource . path ( "jaxb/JAXBElement" ) . type ( "application/xml" ) . post ( genericType , e1 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return p ; }
|
org . junit . Assert . assertEquals ( e1 . getValue ( ) , e2 . getValue ( ) )
|
testVersionRangeIntersectionSimpleNoOverlap ( ) { org . jboss . forge . furnace . versions . VersionRange versionRange1 = org . jboss . forge . furnace . versions . Versions . parseVersionRange ( "(10,20)" ) ; org . jboss . forge . furnace . versions . VersionRange versionRange2 = org . jboss . forge . furnace . versions . Versions . parseVersionRange ( "(8,9]" ) ; org . jboss . windup . config . metadata . TechnologyReference technologyReference = new org . jboss . windup . config . metadata . TechnologyReference ( "tech" , versionRange1 ) ; boolean overlap = technologyReference . versionRangesOverlap ( versionRange2 ) ; "<AssertPlaceHolder>" ; } versionRangesOverlap ( org . jboss . forge . furnace . versions . VersionRange ) { if ( ( ( this . getVersionRange ( ) ) == null ) || ( otherRange == null ) ) return true ; org . jboss . forge . furnace . versions . MultipleVersionRange range1Multiple ; if ( ( getVersionRange ( ) ) instanceof org . jboss . forge . furnace . versions . MultipleVersionRange ) range1Multiple = ( ( org . jboss . forge . furnace . versions . MultipleVersionRange ) ( getVersionRange ( ) ) ) ; else range1Multiple = new org . jboss . forge . furnace . versions . MultipleVersionRange ( getVersionRange ( ) ) ; try { org . jboss . forge . furnace . versions . VersionRange intersection = range1Multiple . getIntersection ( otherRange ) ; return ( intersection != null ) && ( ! ( intersection . isEmpty ( ) ) ) ; } catch ( java . lang . Throwable t ) { return false ; } }
|
org . junit . Assert . assertFalse ( overlap )
|
whenHasFacetNoSuperType ( ) { @ javax . jdo . annotations . Version class Child { } context . checking ( new org . jmock . Expectations ( ) { { oneOf ( mockChildType ) . getCorrespondingClass ( ) ; inSequence ( sequence ) ; will ( returnValue ( Child . class ) ) ; oneOf ( mockChildType ) . superclass ( ) ; inSequence ( sequence ) ; will ( returnValue ( null ) ) ; } } ) ; newValidatorVisitor . visit ( mockChildType , validationFailures ) ; "<AssertPlaceHolder>" ; } getNumberOfMessages ( ) { return messages . size ( ) ; }
|
org . junit . Assert . assertThat ( validationFailures . getNumberOfMessages ( ) , org . hamcrest . CoreMatchers . is ( 0 ) )
|
testObservation ( ) { org . hl7 . fhir . instance . model . Observation o = new org . hl7 . fhir . instance . model . Observation ( ) ; o . addIdentifier ( ) . setSystem ( "http://acme.org" ) . setValue ( "1234" ) ; o . setStatus ( Observation . ObservationStatus . FINAL ) ; o . getCode ( ) . addCoding ( ) . setSystem ( "http://loinc.org" ) . setCode ( "12345" ) ; o . getEncounter ( ) . setReference ( "Encounter/1234" ) ; ca . uhn . fhir . validation . FhirValidator val = ourCtxHl7OrgDstu2 . newValidator ( ) ; val . registerValidatorModule ( ourValidator ) ; ca . uhn . fhir . validation . ValidationResult result = val . validateWithResult ( o ) ; java . lang . String encoded = ourCtxHl7OrgDstu2 . newJsonParser ( ) . setPrettyPrint ( true ) . encodeResourceToString ( result . toOperationOutcome ( ) ) ; ourLog . info ( encoded ) ; "<AssertPlaceHolder>" ; } isSuccessful ( ) { return myIsSuccessful ; }
|
org . junit . Assert . assertTrue ( result . isSuccessful ( ) )
|
testInitOutBuffer ( ) { org . hawkular . apm . client . collector . internal . FragmentBuilder builder = new org . hawkular . apm . client . collector . internal . FragmentBuilder ( ) ; builder . initOutBuffer ( 1 ) ; "<AssertPlaceHolder>" ; } isOutBufferActive ( java . lang . Object ) { return collector ( ) . isOutBufferActive ( getRuleName ( ) , obj ) ; }
|
org . junit . Assert . assertTrue ( builder . isOutBufferActive ( 1 ) )
|
test3 ( ) { com . creactiviti . piper . core . task . SpelTaskEvaluator evaluator = new com . creactiviti . piper . core . task . SpelTaskEvaluator ( ) ; com . creactiviti . piper . core . task . TaskExecution jt = com . creactiviti . piper . core . task . SimpleTaskExecution . createFrom ( "hello" , "${name}" ) ; com . creactiviti . piper . core . task . TaskExecution evaluated = evaluator . evaluate ( jt , new com . creactiviti . piper . core . context . MapContext ( java . util . Collections . singletonMap ( "name" , "arik" ) ) ) ; "<AssertPlaceHolder>" ; } getString ( java . lang . Object ) { java . lang . Object value = get ( aKey ) ; return org . apache . commons . beanutils . ConvertUtils . convert ( value ) ; }
|
org . junit . Assert . assertEquals ( "arik" , evaluated . getString ( "hello" ) )
|
testBug56568b ( ) { getTomcatInstanceTestWebapp ( false , true ) ; int rc = methodUrl ( ( ( "http://localhost:" + ( getPort ( ) ) ) + "/test/jsp/error.jsp" ) , new org . apache . tomcat . util . buf . ByteChunk ( ) , 500000 , null , null , "PUT" ) ; "<AssertPlaceHolder>" ; } getPort ( ) { return tomcat . getConnector ( ) . getLocalPort ( ) ; }
|
org . junit . Assert . assertEquals ( 200 , rc )
|
emptyTopNodesShouldProduceEmptyList ( ) { com . graphaware . module . noderank . TopRankedNodes topNodes = new com . graphaware . module . noderank . TopRankedNodes ( ) ; topNodes . initializeIfNeeded ( null , getDatabase ( ) , com . graphaware . module . noderank . NodeRankModuleConfiguration . defaultConfiguration ( ) . withMaxTopRankNodes ( 3 ) ) ; "<AssertPlaceHolder>" ; } getTopNodes ( ) { return topNodes ; }
|
org . junit . Assert . assertTrue ( topNodes . getTopNodes ( ) . isEmpty ( ) )
|
extract ( ) { oasis . names . tc . ebxml_regrep . xsd . rim . _3 . ExtrinsicObjectType extrinsicObject = createExtrinsicObject ( "size" , "value" ) ; javax . xml . bind . JAXBElement < oasis . names . tc . ebxml_regrep . xsd . rim . _3 . ExtrinsicObjectType > jaxbWrapper = wrapExtrinsicObject ( extrinsicObject ) ; gov . hhs . fha . nhinc . event . builder . PayloadSizeExtractor extractor = new gov . hhs . fha . nhinc . event . builder . PayloadSizeExtractor ( ) ; com . google . common . base . Optional < java . lang . String > payloadSize = extractor . apply ( jaxbWrapper ) ; "<AssertPlaceHolder>" ; } apply ( org . hl7 . v3 . MCCIMT000200UV01Acknowledgement ) { org . hl7 . v3 . CS typeCode = acknowledgement . getTypeCode ( ) ; if ( typeCodeHasCode ( typeCode ) ) { return com . google . common . base . Optional . of ( typeCode . getCode ( ) ) ; } return com . google . common . base . Optional . absent ( ) ; }
|
org . junit . Assert . assertEquals ( "value" , payloadSize . get ( ) )
|
testSaveUnicode ( ) { net . runelite . cache . script . Instructions instructions = new net . runelite . cache . script . Instructions ( ) ; instructions . init ( ) ; net . runelite . cache . definitions . ScriptDefinition script = new net . runelite . cache . script . assembler . Assembler ( instructions ) . assemble ( getClass ( ) . getResourceAsStream ( net . runelite . cache . definitions . savers . ScriptSaverTest . SCRIPT_RESOURCE_UNICODE ) ) ; byte [ ] saved = new net . runelite . cache . definitions . savers . ScriptSaver ( ) . save ( script ) ; net . runelite . cache . definitions . ScriptDefinition loadedScripot = new net . runelite . cache . definitions . loaders . ScriptLoader ( ) . load ( 1001 , saved ) ; "<AssertPlaceHolder>" ; } load ( int , byte [ ] ) { net . runelite . cache . definitions . ItemDefinition def = new net . runelite . cache . definitions . ItemDefinition ( id ) ; net . runelite . cache . io . InputStream is = new net . runelite . cache . io . InputStream ( b ) ; while ( true ) { int opcode = is . readUnsignedByte ( ) ; if ( opcode == 0 ) { break ; } this . decodeValues ( opcode , def , is ) ; } return def ; }
|
org . junit . Assert . assertEquals ( script , loadedScripot )
|
testFind ( ) { prepareForQuery ( ) ; java . util . List < in . cubestack . apps . android . storm . entitites . TestEntity > response = baseService . findAll ( in . cubestack . apps . android . storm . entitites . TestEntity . class , in . cubestack . android . lib . storm . criteria . Order . orderFor ( in . cubestack . apps . android . storm . entitites . TestEntity . class , new java . lang . String [ ] { "id" } , SortOrder . DESC ) ) ; "<AssertPlaceHolder>" ; } orderFor ( java . lang . Class , java . lang . String [ ] , in . cubestack . android . lib . storm . SortOrder ) { try { in . cubestack . android . lib . storm . core . TableInformation information = in . cubestack . android . lib . storm . core . EntityMetaDataCache . getMetaData ( entity ) ; in . cubestack . android . lib . storm . criteria . Order order = new in . cubestack . android . lib . storm . criteria . Order ( sortOrder , information ) ; in . cubestack . android . lib . storm . criteria . Order . validate ( props , information ) ; order . addProperty ( props ) ; return order ; } catch ( java . lang . Exception e ) { throw new in . cubestack . android . lib . storm . core . StormRuntimeException ( ( "Invalid<sp>entity,<sp>please<sp>check<sp>your<sp>mapppings<sp>for<sp>" + entity ) , e ) ; } }
|
org . junit . Assert . assertNotNull ( response )
|
ifNextProgrammeIsSelectedWhenCurrentIsEmptyReturnsNextProgrammeIterable ( ) { com . google . common . collect . ImmutableList . Builder < com . metabroadcast . atlas . glycerin . model . Programme > programmesList = com . google . common . collect . ImmutableList . builder ( ) ; org . atlasapi . remotesite . bbc . nitro . PaginatedProgrammeRequest paginatedProgrammeRequest = new org . atlasapi . remotesite . bbc . nitro . PaginatedProgrammeRequest ( client , com . google . common . collect . ImmutableList . of ( programmesQuery , programmesQuery ) ) ; when ( client . execute ( any ( com . metabroadcast . atlas . glycerin . queries . ProgrammesQuery . class ) ) ) . thenReturn ( glycerinResponse ) ; when ( glycerinResponse . getNext ( ) ) . thenReturn ( glycerinResponse ) ; when ( glycerinResponse . getResults ( ) ) . thenReturn ( programmesList . build ( ) ) ; when ( glycerinResponse . getNext ( ) ) . thenReturn ( glycerinResponse ) ; when ( glycerinResponse . getResults ( ) ) . thenReturn ( com . google . common . collect . ImmutableList . of ( programme ) ) ; when ( client . execute ( any ( com . metabroadcast . atlas . glycerin . queries . ProgrammesQuery . class ) ) ) . thenReturn ( glycerinResponse ) ; when ( glycerinResponse . hasNext ( ) ) . thenReturn ( true ) ; java . util . Iterator < java . util . List < com . metabroadcast . atlas . glycerin . model . Programme > > programmes = paginatedProgrammeRequest . iterator ( ) ; programmes . hasNext ( ) ; programmes . next ( ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { if ( ( currentResponse ) == null ) { return executeRequest ( ) ; } else { return currentResponse . hasNext ( ) ; } }
|
org . junit . Assert . assertTrue ( programmes . hasNext ( ) )
|
setBasePathWithDash ( ) { javax . servlet . ServletContext servletContext = createMock ( javax . servlet . ServletContext . class ) ; expectGetResource ( servletContext , "src/test/resources/mustache/specs/" ) ; replay ( servletContext ) ; com . github . jknack . handlebars . io . TemplateSource source = new com . github . jknack . handlebars . io . ServletContextTemplateLoader ( servletContext , "/" , ".yml" ) . sourceAt ( "comments" ) ; "<AssertPlaceHolder>" ; verify ( servletContext ) ; } sourceAt ( java . lang . String ) { try { return cache . get ( location , ( ) -> delegate . sourceAt ( location ) ) ; } catch ( java . util . concurrent . ExecutionException e ) { com . google . common . base . Throwables . propagateIfPossible ( e . getCause ( ) , java . io . IOException . class ) ; throw com . google . common . base . Throwables . propagate ( e . getCause ( ) ) ; } }
|
org . junit . Assert . assertNotNull ( source )
|
getLookupColumnName ( ) { "<AssertPlaceHolder>" ; } getLookupColumnName ( ) { return null ; }
|
org . junit . Assert . assertNull ( subject . getLookupColumnName ( ) )
|
testTotalEntriesWithMultipleRatingsEntries ( ) { java . lang . String className = com . liferay . portal . kernel . util . StringUtil . randomString ( ) ; long classPK = com . liferay . portal . kernel . test . util . RandomTestUtil . randomLong ( ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group . getGroupId ( ) ) ; com . liferay . ratings . kernel . service . RatingsEntryLocalServiceUtil . updateEntry ( _user1 . getUserId ( ) , className , classPK , 1 , serviceContext ) ; com . liferay . ratings . kernel . service . RatingsEntryLocalServiceUtil . updateEntry ( _user2 . getUserId ( ) , className , classPK , 0.4 , serviceContext ) ; com . liferay . ratings . kernel . model . RatingsStats ratingsStats = com . liferay . ratings . kernel . service . RatingsStatsLocalServiceUtil . getStats ( className , classPK ) ; "<AssertPlaceHolder>" ; } getTotalEntries ( ) { return _totalEntries ; }
|
org . junit . Assert . assertEquals ( 2 , ratingsStats . getTotalEntries ( ) )
|
testNullAddsAreIgnored ( ) { final com . github . rnewson . couchdb . lucene . DocumentConverter converter = new com . github . rnewson . couchdb . lucene . DocumentConverter ( context , view ( "function(doc)<sp>{var<sp>ret=new<sp>Document();<sp>ret.add(doc.nope);<sp>return<sp>ret;}" ) ) ; final java . util . Collection < org . apache . lucene . document . Document > result = converter . convert ( doc ( "{_id:\"hello\"}" ) , settings ( ) , null ) ; "<AssertPlaceHolder>" ; } settings ( ) { return com . github . rnewson . couchdb . lucene . couchdb . ViewSettings . getDefaultSettings ( ) ; }
|
org . junit . Assert . assertThat ( result . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
|
testPrepareExecution ( ) { org . teiid . language . Command command = org . teiid . translator . jdbc . TranslationHelper . helpTranslate ( TranslationHelper . BQT_VDB , "call<sp>native('select<sp>*<sp>from<sp>Source<sp>where<sp>e1<sp>=<sp>?',<sp>2)" ) ; java . sql . Connection connection = org . mockito . Mockito . mock ( java . sql . Connection . class ) ; java . sql . PreparedStatement stmt = org . mockito . Mockito . mock ( java . sql . PreparedStatement . class ) ; java . sql . ResultSet rs = org . mockito . Mockito . mock ( java . sql . ResultSet . class ) ; java . sql . ResultSetMetaData rsm = org . mockito . Mockito . mock ( java . sql . ResultSetMetaData . class ) ; org . mockito . Mockito . stub ( stmt . getUpdateCount ( ) ) . toReturn ( ( - 1 ) ) ; org . mockito . Mockito . stub ( stmt . getResultSet ( ) ) . toReturn ( rs ) ; org . mockito . Mockito . stub ( stmt . execute ( ) ) . toReturn ( true ) ; org . mockito . Mockito . stub ( rs . getMetaData ( ) ) . toReturn ( rsm ) ; org . mockito . Mockito . stub ( rsm . getColumnCount ( ) ) . toReturn ( 2 ) ; org . mockito . Mockito . stub ( connection . prepareStatement ( "select<sp>*<sp>from<sp>Source<sp>where<sp>e1<sp>=<sp>?" ) ) . toReturn ( stmt ) ; org . mockito . Mockito . stub ( rs . next ( ) ) . toReturn ( true ) ; org . mockito . Mockito . stub ( rs . getObject ( 1 ) ) . toReturn ( 5 ) ; org . mockito . Mockito . stub ( rs . getObject ( 2 ) ) . toReturn ( "five" ) ; java . sql . DatabaseMetaData dbmd = org . mockito . Mockito . mock ( java . sql . DatabaseMetaData . class ) ; org . mockito . Mockito . stub ( connection . getMetaData ( ) ) . toReturn ( dbmd ) ; org . teiid . translator . jdbc . JDBCExecutionFactory ef = new org . teiid . translator . jdbc . JDBCExecutionFactory ( ) ; ef . setSupportsDirectQueryProcedure ( true ) ; org . teiid . translator . ResultSetExecution execution = ( ( org . teiid . translator . ResultSetExecution ) ( ef . createExecution ( command , new org . teiid . dqp . internal . datamgr . FakeExecutionContextImpl ( ) , org . mockito . Mockito . mock ( org . teiid . metadata . RuntimeMetadata . class ) , connection ) ) ) ; execution . execute ( ) ; org . mockito . Mockito . verify ( stmt ) . setObject ( 1 , 2 ) ; "<AssertPlaceHolder>" ; } next ( ) { return execution . next ( ) ; }
|
org . junit . Assert . assertArrayEquals ( new java . lang . Object [ ] { 5 , "five" } , ( ( java . lang . Object [ ] ) ( execution . next ( ) . get ( 0 ) ) ) )
|
testPostPublicMessageWithEmptyMessage ( ) { org . xwiki . eventstream . Event postedMessage = setupForPublicMessage ( ) ; this . stream . postPublicMessage ( "" ) ; "<AssertPlaceHolder>" ; } getBody ( ) { return this . body ; }
|
org . junit . Assert . assertEquals ( "" , postedMessage . getBody ( ) )
|
testGetWriteOpration ( ) { "<AssertPlaceHolder>" ; } getWriteOperation ( ) { return writeOperation ; }
|
org . junit . Assert . assertEquals ( operation , writer . getWriteOperation ( ) )
|
testLessThanRecordThresholdCount ( ) { int thresholdCount = 5 ; org . kaaproject . kaa . client . logging . LogStorageStatus logStorageStatus = org . mockito . Mockito . mock ( org . kaaproject . kaa . client . logging . LogStorageStatus . class ) ; org . mockito . Mockito . when ( logStorageStatus . getRecordCount ( ) ) . thenReturn ( ( ( long ) ( thresholdCount - 1 ) ) ) ; org . kaaproject . kaa . client . logging . strategies . RecordCountLogUploadStrategy strategy = new org . kaaproject . kaa . client . logging . strategies . RecordCountLogUploadStrategy ( thresholdCount ) ; "<AssertPlaceHolder>" ; } checkUploadNeeded ( org . kaaproject . kaa . client . logging . LogStorageStatus ) { org . kaaproject . kaa . client . logging . LogUploadStrategyDecision decision = LogUploadStrategyDecision . NOOP ; if ( ( status . getConsumedVolume ( ) ) >= ( volumeThreshold ) ) { org . kaaproject . kaa . client . logging . DefaultLogUploadStrategy . LOG . info ( "Need<sp>to<sp>upload<sp>logs<sp>-<sp>current<sp>size:<sp>{},<sp>threshold:<sp>{}" , status . getConsumedVolume ( ) , volumeThreshold ) ; decision = LogUploadStrategyDecision . UPLOAD ; } else if ( ( status . getRecordCount ( ) ) >= ( countThreshold ) ) { org . kaaproject . kaa . client . logging . DefaultLogUploadStrategy . LOG . info ( "Need<sp>to<sp>upload<sp>logs<sp>-<sp>current<sp>count:<sp>{},<sp>threshold:<sp>{}" , status . getRecordCount ( ) , countThreshold ) ; decision = LogUploadStrategyDecision . UPLOAD ; } return decision ; }
|
org . junit . Assert . assertEquals ( strategy . checkUploadNeeded ( logStorageStatus ) , LogUploadStrategyDecision . NOOP )
|
testReadWronglyEncodedDatasetByChangingDefaultCharacterSet ( ) { org . dcm4che3 . data . Attributes a = new org . dcm4che3 . data . Attributes ( ) ; a . setString ( Tag . SpecificCharacterSet , VR . CS , "ISO<sp>2022<sp>IR<sp>6" ) ; java . lang . String NAME = "Äneas^Rüdiger" ; a . setBytes ( Tag . PatientName , VR . PN , NAME . getBytes ( "ISO-8859-1" ) ) ; org . dcm4che3 . data . SpecificCharacterSet . setDefaultCharacterSet ( "ISO_IR<sp>100" ) ; try { "<AssertPlaceHolder>" ; } finally { org . dcm4che3 . data . SpecificCharacterSet . setDefaultCharacterSet ( null ) ; } } getString ( int ) { if ( ( ( pos ) + len ) > ( ( pdulen ) + 6 ) ) throw new java . lang . IndexOutOfBoundsException ( ) ; java . lang . String s ; int len0 = len ; while ( ( len0 > 0 ) && ( ( buf [ ( ( ( pos ) + len0 ) - 1 ) ] ) == 0 ) ) { len0 -- ; } s = new java . lang . String ( buf , 0 , pos , len0 ) ; pos += len ; return s ; }
|
org . junit . Assert . assertEquals ( NAME , a . getString ( Tag . PatientName ) )
|
verifySimpleGraphGeneration ( ) { final org . opennms . features . topology . plugins . topo . asset . NodeProvider nodeProvider = new org . opennms . features . topology . plugins . topo . asset . NodeProvider ( ) { @ org . opennms . features . topology . plugins . topo . asset . Override public java . util . List < org . opennms . netmgt . model . OnmsNode > getNodes ( java . util . List < org . opennms . features . topology . plugins . topo . asset . layers . LayerDefinition > definitions ) { java . util . List < org . opennms . netmgt . model . OnmsNode > nodes = new java . util . ArrayList ( ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 1 ) . withLabel ( "Node<sp>1" ) . withAssets ( ) . withRegion ( "Stuttgart" ) . withBuilding ( "Node<sp>5" 5 ) . done ( ) . getNode ( ) ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 2 ) . withLabel ( "Node<sp>2" ) . withAssets ( ) . withRegion ( "Stuttgart" ) . withBuilding ( "S2" ) . done ( ) . getNode ( ) ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 3 ) . withLabel ( "Node<sp>3" ) . withAssets ( ) . withRegion ( "Fulda" ) . withBuilding ( "Node<sp>5" 3 ) . done ( ) . getNode ( ) ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 4 ) . withLabel ( "Node<sp>4" ) . withAssets ( ) . withRegion ( "Node<sp>5" 0 ) . withBuilding ( "Node<sp>5" 3 ) . done ( ) . getNode ( ) ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 5 ) . withLabel ( "Node<sp>5" ) . withAssets ( ) . withRegion ( "Node<sp>5" 0 ) . withBuilding ( "Node<sp>5" 4 ) . done ( ) . getNode ( ) ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 6 ) . withLabel ( "Node<sp>6" ) . withAssets ( ) . withRegion ( "Node<sp>5" 0 ) . done ( ) . getNode ( ) ) ; nodes . add ( new org . opennms . features . topology . plugins . topo . asset . util . NodeBuilder ( ) . withId ( 7 ) . withLabel ( "Node<sp>5" 2 ) . withAssets ( ) . withBuilding ( "Node<sp>5" 4 ) . done ( ) . getNode ( ) ) ; return nodes ; } } ; final org . opennms . features . topology . plugins . topo . asset . GeneratorConfig config = new org . opennms . features . topology . plugins . topo . asset . GeneratorConfig ( ) ; config . setLayerHierarchies ( com . google . common . collect . Lists . newArrayList ( NodeParamLabels . ASSET_REGION , NodeParamLabels . ASSET_BUILDING ) ) ; config . setFilters ( new java . util . ArrayList ( ) ) ; final org . opennms . features . graphml . model . GraphML generatedGraphML = new org . opennms . features . topology . plugins . topo . asset . AssetGraphGenerator ( nodeProvider ) . generateGraphs ( config ) ; final org . opennms . features . graphml . model . GraphML expectedGraphML = org . opennms . features . graphml . model . GraphMLReader . read ( getClass ( ) . getResourceAsStream ( "Node<sp>5" 1 ) ) ; org . opennms . features . graphml . model . GraphMLWriter . write ( generatedGraphML , new java . io . File ( "target/verifySimpleGraphGenerationGenerated.graphml" ) ) ; "<AssertPlaceHolder>" ; } write ( byte [ ] , java . io . OutputStream ) { java . io . ByteArrayInputStream inputStream = new java . io . ByteArrayInputStream ( input ) ; com . google . common . io . ByteStreams . copy ( inputStream , outputStream ) ; }
|
org . junit . Assert . assertEquals ( generatedGraphML , expectedGraphML )
|
testStartsWithName002 ( ) { java . lang . String test = "t=test,cn=test" ; javax . naming . ldap . LdapName ln = new javax . naming . ldap . LdapName ( test ) ; javax . naming . ldap . LdapName n = new javax . naming . ldap . LdapName ( "cn=test" ) ; "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( ln . startsWith ( n ) )
|
testMockRun ( ) { if ( ( isCassandraRunning ( ) ) == false ) return ; java . net . URL url = getResource ( "etc/test-run.xml" ) ; "<AssertPlaceHolder>" ; org . jgroups . JChannel channel = new org . jgroups . JChannel ( url ) ; channel . setReceiver ( new org . jgroups . ReceiverAdapter ( ) { public void receive ( org . jgroups . Message msg ) { System . out . println ( ( ( ( "received<sp>msg<sp>from<sp>" + ( msg . getSrc ( ) ) ) + ":<sp>" ) + ( msg . getObject ( ) ) ) ) ; } } ) ; channel . connect ( "MyCluster" ) ; try { channel . send ( new org . jgroups . Message ( null , null , "hello<sp>world" ) ) ; } finally { channel . close ( ) ; } } getResource ( java . lang . String ) { return getClass ( ) . getClassLoader ( ) . getResource ( name ) ; }
|
org . junit . Assert . assertNotNull ( url )
|
403 ( ) { try { com . fujitsu . dc . test . utils . CellUtils . create ( com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . UNIT_USER_CELL , AbstractCase . MASTER_TOKEN_NAME , HttpStatus . SC_CREATED ) ; com . fujitsu . dc . test . utils . AccountUtils . create ( AbstractCase . MASTER_TOKEN_NAME , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . UNIT_USER_CELL , "Account" , "AccountPass" , HttpStatus . SC_CREATED ) ; com . fujitsu . dc . test . utils . TResponse res = com . fujitsu . dc . test . utils . Http . request ( "authn/password-tc-c0.txt" ) . with ( "remoteCell" , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . UNIT_USER_CELL ) . with ( "username" , "Account" ) . with ( "password" , "AccountPass" ) . with ( "dc_target" , com . fujitsu . dc . test . unit . core . UrlUtils . unitRoot ( ) ) . returns ( ) . statusCode ( HttpStatus . SC_OK ) ; org . json . simple . JSONObject json = res . bodyAsJson ( ) ; java . lang . String unitUserToken = ( ( java . lang . String ) ( json . get ( OAuth2Helper . Key . ACCESS_TOKEN ) ) ) ; com . fujitsu . dc . test . jersey . DcResponse response = requesttoMypassword ( unitUserToken , "newPassword" , Setup . TEST_CELL1 ) ; "<AssertPlaceHolder>" ; } finally { com . fujitsu . dc . test . utils . AccountUtils . delete ( com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . UNIT_USER_CELL , AbstractCase . MASTER_TOKEN_NAME , "Account" , ( - 1 ) ) ; com . fujitsu . dc . test . utils . CellUtils . delete ( AbstractCase . MASTER_TOKEN_NAME , com . fujitsu . dc . test . jersey . cell . auth . MyPasswordTest . UNIT_USER_CELL , ( - 1 ) ) ; } } getStatusCode ( ) { return this . statusCode ; }
|
org . junit . Assert . assertEquals ( 403 , response . getStatusCode ( ) )
|
testGetUGIFromKerberosSubject ( ) { java . lang . String user1keyTabFilepath = ( java . lang . System . getProperty ( "kdc.resource.dir" ) ) + "/keytabs/user1.keytab" ; org . apache . hadoop . security . UserGroupInformation ugi = org . apache . hadoop . security . UserGroupInformation . loginUserFromKeytabAndReturnUGI ( "user1@EXAMPLE.COM" , user1keyTabFilepath ) ; java . util . Set < javax . security . auth . kerberos . KerberosPrincipal > principals = ugi . getSubject ( ) . getPrincipals ( javax . security . auth . kerberos . KerberosPrincipal . class ) ; if ( principals . isEmpty ( ) ) { org . junit . Assert . fail ( "There<sp>should<sp>be<sp>a<sp>kerberos<sp>principal<sp>in<sp>the<sp>subject." ) ; } else { org . apache . hadoop . security . UserGroupInformation ugi2 = org . apache . hadoop . security . UserGroupInformation . getUGIFromSubject ( ugi . getSubject ( ) ) ; if ( ugi2 != null ) { ugi2 . doAs ( new java . security . PrivilegedAction < java . lang . Object > ( ) { @ org . apache . hadoop . security . Override public java . lang . Object run ( ) { try { org . apache . hadoop . security . UserGroupInformation ugi3 = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) ; java . lang . String doAsUserName = ugi3 . getUserName ( ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "DO<sp>AS<sp>USERNAME:<sp>" + doAsUserName ) ) ; } catch ( java . io . IOException e ) { e . printStackTrace ( ) ; } return null ; } } ) ; } } } getUserName ( ) { return java . lang . System . getProperty ( "user.name" ) ; }
|
org . junit . Assert . assertEquals ( doAsUserName , "user1@EXAMPLE.COM" )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.