input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testOpschonenSchoon ( ) { nl . bzk . migratiebrp . conversie . regels . proces . logging . Logging . initContext ( ) ; final nl . bzk . migratiebrp . conversie . regels . proces . preconditie . Lo3PersoonslijstOpschoner opschoner = new nl . bzk . migratiebrp . conversie . regels . proces . preconditie . Lo3PersoonslijstOpschoner ( ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Persoonslijst pl = nl . bzk . migratiebrp . conversie . regels . proces . preconditie . Lo3PersoonslijstOpschonerTest . buildLo3Persoonslijst ( false ) ; final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Persoonslijst schoonPl = opschoner . opschonen ( pl ) ; "<AssertPlaceHolder>" ; nl . bzk . migratiebrp . conversie . regels . proces . logging . Logging . destroyContext ( ) ; } opschonen ( nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel ) { final java . util . List < nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Categorie < nl . bzk . migratiebrp . conversie . model . lo3 . autorisatie . Lo3AutorisatieInhoud > > result = new java . util . ArrayList ( ) ; for ( final nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Categorie < nl . bzk . migratiebrp . conversie . model . lo3 . autorisatie . Lo3AutorisatieInhoud > autorisatieRegel : autorisatieStapel ) { if ( ! ( regelOpschonen ( autorisatieRegel ) ) ) { result . add ( autorisatieRegel ) ; } } return result . isEmpty ( ) ? null : new nl . bzk . migratiebrp . conversie . model . lo3 . Lo3Stapel ( result ) ; }
org . junit . Assert . assertEquals ( pl , schoonPl )
testAddJPAEdmRefConstraintView ( ) { localView = new org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmAssociationTest ( ) ; objAssociation = new org . apache . olingo . odata2 . jpa . processor . core . model . JPAEdmAssociation ( localView , localView , localView , 1 ) ; try { objAssociation . getBuilder ( ) . build ( ) ; } catch ( org . apache . olingo . odata2 . jpa . processor . api . exception . ODataJPAModelException e ) { org . junit . Assert . fail ( ( ( ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } catch ( org . apache . olingo . odata2 . jpa . processor . api . exception . ODataJPARuntimeException e ) { org . junit . Assert . fail ( ( ( ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_1 ) + ( e . getMessage ( ) ) ) + ( org . apache . olingo . odata2 . jpa . processor . core . common . ODataJPATestConstants . EXCEPTION_MSG_PART_2 ) ) ) ; } objAssociation . addJPAEdmRefConstraintView ( localView ) ; "<AssertPlaceHolder>" ; } getConsistentEdmAssociationList ( ) { return consistentAssociatonList ; }
org . junit . Assert . assertTrue ( ( ( objAssociation . getConsistentEdmAssociationList ( ) . size ( ) ) > 0 ) )
duplicateStructuresButDifferentElementNames ( ) { puck . thrifty . Converter c = new puck . thrifty . Converter ( ) ; puck . thrifty . datatype . ObjectElement obj = c . parse ( "{<sp>\"person1\"<sp>:<sp>{<sp>\"fName\"<sp>:<sp>\"text\",<sp>\"lName\"<sp>:<sp>\"text\"<sp>},<sp>\"person2\"<sp>:<sp>{<sp>\"fName\"<sp>:<sp>\"text\",<sp>\"lName\"<sp>:<sp>\"text\"<sp>}<sp>}" ) ; java . util . Map < java . lang . String , puck . thrifty . datatype . Element > elemMap = obj . getElements ( ) ; "<AssertPlaceHolder>" ; } getElements ( ) { return this . elements ; }
org . junit . Assert . assertEquals ( 2 , elemMap . size ( ) )
testInit ( ) { presenter . init ( ) ; "<AssertPlaceHolder>" ; } getView ( ) { return viewer . getView ( ) ; }
org . junit . Assert . assertEquals ( view , presenter . getView ( ) )
testTimeOut ( ) { org . apache . flume . sink . hbase . TestAsyncHBaseSink . testUtility . createTable ( org . apache . flume . sink . hbase . TestAsyncHBaseSink . tableName . getBytes ( ) , org . apache . flume . sink . hbase . TestAsyncHBaseSink . columnFamily . getBytes ( ) ) ; deleteTable = true ; org . apache . flume . sink . hbase . AsyncHBaseSink sink = new org . apache . flume . sink . hbase . AsyncHBaseSink ( org . apache . flume . sink . hbase . TestAsyncHBaseSink . testUtility . getConfiguration ( ) , true , false ) ; org . apache . flume . conf . Configurables . configure ( sink , org . apache . flume . sink . hbase . TestAsyncHBaseSink . ctx ) ; org . apache . flume . Channel channel = new org . apache . flume . channel . MemoryChannel ( ) ; org . apache . flume . conf . Configurables . configure ( channel , org . apache . flume . sink . hbase . TestAsyncHBaseSink . ctx ) ; sink . setChannel ( channel ) ; channel . start ( ) ; sink . start ( ) ; org . apache . flume . Transaction tx = channel . getTransaction ( ) ; tx . begin ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { org . apache . flume . Event e = org . apache . flume . event . EventBuilder . withBody ( org . apache . hadoop . hbase . util . Bytes . toBytes ( ( ( ( org . apache . flume . sink . hbase . TestAsyncHBaseSink . valBase ) + "-" ) + i ) ) ) ; channel . put ( e ) ; } tx . commit ( ) ; tx . close ( ) ; "<AssertPlaceHolder>" ; sink . process ( ) ; org . junit . Assert . fail ( ) ; } isConfNull ( ) { return ( conf ) == null ; }
org . junit . Assert . assertFalse ( sink . isConfNull ( ) )
testEvaluationAdjacencySameTermFailureTest ( ) { java . lang . String query = buildFunction ( ContentFunctions . CONTENT_WITHIN_FUNCTION_NAME , "2" , Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , "'cat'" , "'cat'" ) ; org . apache . commons . jexl2 . Expression expr = datawave . query . jexl . functions . ContentFunctionsTest . engine . createExpression ( query ) ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list1 ; list1 = asList ( 1 , 4 ) ; termOffSetMap . put ( "cat" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , true , eventId ) , list1 ) ) ) ; context . set ( Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , termOffSetMap ) ; java . lang . Object o = expr . evaluate ( context ) ; "<AssertPlaceHolder>" ; } expect ( java . lang . Object , java . lang . Boolean ) { if ( null == result ) { return Boolean . FALSE . equals ( expected ) ; } if ( result instanceof java . lang . Boolean ) { return result . equals ( expected ) ; } return false ; }
org . junit . Assert . assertTrue ( datawave . query . jexl . functions . ContentFunctionsTest . expect ( o , false ) )
testChild ( ) { org . antlr . runtime . tree . CommonTree sink = com . cloudera . flume . conf . FlumeBuilder . parseSink ( com . cloudera . flume . conf . TestPatternMatch . simple ) ; com . cloudera . flume . conf . PatternMatch pp = com . cloudera . flume . conf . PatternMatch . kind ( "DECO" ) . child ( com . cloudera . flume . conf . PatternMatch . kind ( "SINK" ) . child ( com . cloudera . flume . conf . PatternMatch . var ( "node" , com . cloudera . flume . conf . PatternMatch . kind ( "batch" ) ) ) ) ; java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > m = pp . match ( sink ) ; "<AssertPlaceHolder>" ; dumpMatches ( m ) ; com . cloudera . flume . conf . TestPatternMatch . LOG . info ( m ) ; } match ( org . antlr . runtime . tree . CommonTree ) { switch ( pt ) { case WILD : return new java . util . HashMap < java . lang . String , org . antlr . runtime . tree . CommonTree > ( ) ; case VAR : { java . lang . String x = ( ( java . lang . String ) ( args [ 0 ] ) ) ; com . cloudera . flume . conf . PatternMatch pv = ( ( com . cloudera . flume . conf . PatternMatch ) ( args [ 1 ] ) ) ; java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > m = pv . match ( ct ) ; if ( m == null ) { return null ; } m . put ( x , ct ) ; return m ; } case KIND : java . lang . String k = ( ( java . lang . String ) ( args [ 0 ] ) ) ; if ( ( ct != null ) && ( k . equals ( ct . getText ( ) ) ) ) { return new java . util . HashMap < java . lang . String , org . antlr . runtime . tree . CommonTree > ( ) ; } return null ; case TUPLE : { com . cloudera . flume . conf . PatternMatch parent = ( ( com . cloudera . flume . conf . PatternMatch ) ( args [ 0 ] ) ) ; if ( ct == null ) { return null ; } java . util . List < org . antlr . runtime . tree . CommonTree > ch = ct . getChildren ( ) ; if ( ch == null ) { return null ; } if ( ( ( ch . size ( ) ) + 1 ) != ( args . length ) ) { return null ; } java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > mps = parent . match ( ct ) ; if ( mps == null ) return null ; java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > ret = new java . util . HashMap < java . lang . String , org . antlr . runtime . tree . CommonTree > ( ) ; for ( int i = ch . size ( ) ; i >= 1 ; i -- ) { org . antlr . runtime . tree . CommonTree e = ch . get ( ( i - 1 ) ) ; com . cloudera . flume . conf . PatternMatch p = ( ( com . cloudera . flume . conf . PatternMatch ) ( args [ i ] ) ) ; java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > match = p . match ( e ) ; if ( match != null ) { ret . putAll ( match ) ; } else { return null ; } } ret . putAll ( mps ) ; return ret ; } case PARENT : { com . cloudera . flume . conf . PatternMatch parent = ( ( com . cloudera . flume . conf . PatternMatch ) ( args [ 0 ] ) ) ; com . cloudera . flume . conf . PatternMatch child = ( ( com . cloudera . flume . conf . PatternMatch ) ( args [ 1 ] ) ) ; if ( ct == null ) { return null ; } java . util . List < org . antlr . runtime . tree . CommonTree > ch = ct . getChildren ( ) ; if ( ch == null ) { return null ; } java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > ret = parent . match ( ct ) ; if ( ret == null ) return null ; for ( org . antlr . runtime . tree . CommonTree e : ch ) { java . util . Map < java . lang . String , org . antlr . runtime . tree . CommonTree > match = child . match ( e ) ; if ( match != null ) { match . putAll ( ret ) ; return match ; } } return null ; } case PARENT_NTH : { com . cloudera . flume . conf . PatternMatch parent = ( ( com . cloudera . flume . conf . PatternMatch ) ( args [ 0 ] )
org . junit . Assert . assertNotNull ( m )
partialMessage ( ) { encodeApplicationMessage ( buffer , 0 , messages [ ( ( messageCount ) - 1 ) ] ) ; buffer . limit ( ( ( buffer . position ( ) ) - 1 ) ) ; buffer . flip ( ) ; spliterator = new io . fixprotocol . silverflash . frame . sofh . SofhFrameSpliterator ( buffer ) ; "<AssertPlaceHolder>" ; } tryAdvance ( java . util . function . Consumer ) { java . util . Objects . requireNonNull ( action ) ; int messageOffset = ( offset ) + ( SofhFrameDecoder . HEADER_LENGTH ) ; if ( messageOffset > ( buffer . limit ( ) ) ) { return false ; } decoder . wrap ( buffer ) ; decoder . decodeFrameHeader ( ) ; final int messageLength = decoder . getMessageLength ( ) ; int messageLimit = ( ( offset ) + ( SofhFrameDecoder . HEADER_LENGTH ) ) + messageLength ; if ( ( messageLength <= 0 ) || ( messageLimit > ( buffer . limit ( ) ) ) ) { return false ; } java . nio . ByteBuffer message = buffer . duplicate ( ) ; message . order ( originalByteOrder ) ; message . limit ( messageLimit ) ; action . accept ( message ) ; buffer . position ( messageLimit ) ; offset = messageLimit ; buffer . order ( originalByteOrder ) ; return true ; }
org . junit . Assert . assertFalse ( spliterator . tryAdvance ( new java . util . function . Consumer < java . nio . ByteBuffer > ( ) { public void accept ( java . nio . ByteBuffer message ) { } } ) )
getUnknownProvider_shouldGetTheUnknownProviderAccount ( ) { org . openmrs . Provider provider = new org . openmrs . Provider ( ) ; provider . setPerson ( newPerson ( "Unknown<sp>Provider" ) ) ; provider . setIdentifier ( "Test<sp>Unknown<sp>Provider" ) ; provider = service . saveProvider ( provider ) ; org . openmrs . GlobalProperty gp = new org . openmrs . GlobalProperty ( org . openmrs . util . OpenmrsConstants . GP_UNKNOWN_PROVIDER_UUID , provider . getUuid ( ) , null ) ; org . openmrs . api . context . Context . getAdministrationService ( ) . saveGlobalProperty ( gp ) ; "<AssertPlaceHolder>" ; } getUnknownProvider ( ) { return getProviderByUuid ( org . openmrs . api . context . Context . getAdministrationService ( ) . getGlobalProperty ( OpenmrsConstants . GP_UNKNOWN_PROVIDER_UUID ) ) ; }
org . junit . Assert . assertEquals ( provider , service . getUnknownProvider ( ) )
testTransformCycleDetection ( ) { org . revapi . Revapi r = org . revapi . Revapi . builder ( ) . withAnalyzers ( org . revapi . AnalysisTest . DummyAnalyzer . class ) . withTransforms ( org . revapi . AnalysisTest . CloningDifferenceTransform . class ) . withReporters ( org . revapi . AnalysisTest . DummyReporter . class ) . build ( ) ; org . revapi . AnalysisContext ctx = org . revapi . AnalysisContext . builder ( r ) . withNewAPI ( org . revapi . API . of ( ) . build ( ) ) . withOldAPI ( org . revapi . API . of ( ) . build ( ) ) . build ( ) ; try ( org . revapi . AnalysisResult res = r . analyze ( ctx ) ) { "<AssertPlaceHolder>" ; } } isSuccess ( ) { return ( failure ) == null ; }
org . junit . Assert . assertTrue ( res . isSuccess ( ) )
assertFindJobRunningStatisticsWhenRdbIsNotConfigured ( ) { org . unitils . util . ReflectionUtils . setFieldValue ( statisticManager , "rdbRepository" , null ) ; "<AssertPlaceHolder>" ; } findJobRunningStatisticsWeekly ( ) { if ( ! ( isRdbConfigured ( ) ) ) { return java . util . Collections . emptyList ( ) ; } return rdbRepository . findJobRunningStatistics ( io . elasticjob . cloud . scheduler . statistics . util . StatisticTimeUtils . getStatisticTime ( StatisticInterval . DAY , ( - 7 ) ) ) ; }
org . junit . Assert . assertTrue ( statisticManager . findJobRunningStatisticsWeekly ( ) . isEmpty ( ) )
testCorrectReferenceType ( ) { org . eclipse . xtext . testlanguages . actionLang2 . ORing oRing = ActionLang2Factory . eINSTANCE . createORing ( ) ; org . eclipse . xtext . testlanguages . actionLang2 . ORing oRing2 = ActionLang2Factory . eINSTANCE . createORing ( ) ; oRing . getDisjuncts ( ) . add ( oRing2 ) ; "<AssertPlaceHolder>" ; } getDisjuncts ( ) { if ( ( disjuncts ) == null ) { disjuncts = new org . eclipse . emf . ecore . util . EObjectContainmentEList < org . eclipse . xtext . testlanguages . actionLang2 . ORing > ( org . eclipse . xtext . testlanguages . actionLang2 . ORing . class , this , org . eclipse . xtext . testlanguages . actionLang2 . ActionLang2Package . ORING__DISJUNCTS ) ; } return disjuncts ; }
org . junit . Assert . assertSame ( oRing2 , oRing . getDisjuncts ( ) . get ( 0 ) )
testSwallowNPEInValidation ( ) { org . eclipse . xtext . validation . AbstractDeclarativeValidator test = new org . eclipse . xtext . validation . AbstractDeclarativeValidator ( ) { @ org . eclipse . xtext . validation . Check public void foo ( java . lang . Object x ) { throw new java . lang . NullPointerException ( ) ; } } ; org . eclipse . emf . common . util . BasicDiagnostic chain = new org . eclipse . emf . common . util . BasicDiagnostic ( ) ; org . eclipse . emf . ecore . resource . Resource r = new org . eclipse . emf . ecore . resource . impl . ResourceImpl ( org . eclipse . emf . common . util . URI . createURI ( "http://foo" ) ) ; org . eclipse . emf . ecore . EObject x = EcoreFactory . eINSTANCE . createEAttribute ( ) ; r . getContents ( ) . add ( x ) ; test . validate ( x , chain , java . util . Collections . emptyMap ( ) ) ; "<AssertPlaceHolder>" ; } getChildren ( ) { return runners ; }
org . junit . Assert . assertTrue ( chain . getChildren ( ) . isEmpty ( ) )
shouldTimeoutWhileTryingToBruteForce ( ) { byte [ ] seed = network . thunder . core . etc . Tools . hexStringToByteArray ( "010649653115246623551233652115421336a8b6" ) ; network . thunder . core . communication . layer . high . RevocationHash masterHash = network . thunder . core . helper . HashDerivation . calculateRevocationHash ( seed , 0 , 0 ) ; network . thunder . core . communication . layer . high . RevocationHash targetHash = network . thunder . core . helper . HashDerivation . calculateRevocationHash ( seed , 250 , 250 ) ; network . thunder . core . communication . layer . high . RevocationHash foundHash = network . thunder . core . helper . HashDerivation . bruteForceHash ( masterHash . getSecret ( ) , targetHash . getSecretHash ( ) , 100 , 100 ) ; "<AssertPlaceHolder>" ; } getSecretHash ( ) { return secretHash ; }
org . junit . Assert . assertNull ( foundHash )
shouldCountCustomMethodWithWithinGeoPoint ( ) { java . lang . String documentId = randomNumeric ( 5 ) ; org . springframework . data . elasticsearch . entities . SampleEntity sampleEntity = new org . springframework . data . elasticsearch . entities . SampleEntity ( ) ; sampleEntity . setId ( documentId ) ; sampleEntity . setType ( "test" ) ; sampleEntity . setRate ( 10 ) ; sampleEntity . setMessage ( "foo" ) ; sampleEntity . setLocation ( new org . springframework . data . elasticsearch . core . geo . GeoPoint ( 45.7806 , 3.0875 ) ) ; repository . save ( sampleEntity ) ; documentId = randomNumeric ( 5 ) ; org . springframework . data . elasticsearch . entities . SampleEntity sampleEntity2 = new org . springframework . data . elasticsearch . entities . SampleEntity ( ) ; sampleEntity2 . setId ( documentId ) ; sampleEntity2 . setType ( "test" ) ; sampleEntity2 . setRate ( 10 ) ; sampleEntity2 . setMessage ( "foo" ) ; sampleEntity2 . setLocation ( new org . springframework . data . elasticsearch . core . geo . GeoPoint ( 30.7806 , 0.0875 ) ) ; repository . save ( sampleEntity2 ) ; long count = repository . countByLocationWithin ( new org . springframework . data . elasticsearch . core . geo . GeoPoint ( 45.7806 , 3.0875 ) , "2km" ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Object ) { queryCriteria . add ( new org . springframework . data . elasticsearch . core . query . Criteria . CriteriaEntry ( org . springframework . data . elasticsearch . core . query . Criteria . OperationKey . EQUALS , o ) ) ; return this ; }
org . junit . Assert . assertThat ( count , is ( equalTo ( 1L ) ) )
testNotNullWithParameter ( ) { "<AssertPlaceHolder>" ; } notNull ( T , java . lang . String ) { if ( pParameter == null ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "%s<sp>may<sp>not<sp>be<sp>null" , ( pParamName == null ? com . twelvemonkeys . lang . Validate . UNSPECIFIED_PARAM_NAME : pParamName ) ) ) ; } return pParameter ; }
org . junit . Assert . assertEquals ( "foo" , com . twelvemonkeys . lang . Validate . notNull ( "foo" , "bar" ) )
ping ( ) { com . baeldung . thrift . CrossPlatformServiceClient client = new com . baeldung . thrift . CrossPlatformServiceClient ( ) ; "<AssertPlaceHolder>" ; } ping ( ) { return "pong" ; }
org . junit . Assert . assertTrue ( client . ping ( ) )
testgetByLabelExistingTypeWithCreation ( ) { java . lang . String label = "test-label" ; org . candlepin . model . ConsumerType ctype = this . createConsumerType ( label , false ) ; org . candlepin . model . ConsumerType test = this . consumerTypeCurator . getByLabel ( label , true ) ; "<AssertPlaceHolder>" ; } getByLabel ( java . lang . String , boolean ) { if ( ( label == null ) || ( label . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "label<sp>is<sp>null<sp>or<sp>empty" ) ; } java . lang . String jpql = "SELECT<sp>t<sp>FROM<sp>ConsumerType<sp>t<sp>WHERE<sp>t.label<sp>=<sp>:label" ; org . candlepin . model . ConsumerType ctype = null ; try { ctype = this . getEntityManager ( ) . createQuery ( jpql , org . candlepin . model . ConsumerType . class ) . setParameter ( "label" , label ) . getSingleResult ( ) ; } catch ( javax . persistence . NoResultException e ) { if ( createIfAbsent ) { try { ctype = new org . candlepin . model . ConsumerType ( org . candlepin . model . ConsumerType . ConsumerTypeEnum . valueOf ( label ) ) ; } catch ( java . lang . IllegalArgumentException e2 ) { ctype = new org . candlepin . model . ConsumerType ( label ) ; } ctype = this . create ( ctype ) ; } } return ctype ; }
org . junit . Assert . assertSame ( ctype , test )
deleteTag ( ) { logger . debug ( "----------------deleteTag<sp>-----------------" ) ; java . lang . Integer tagId = 1 ; tagService . deleteTag ( tagId ) ; com . packtpub . techbuzz . entities . Tag tag = tagService . findTagById ( tagId ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNull ( tag )
testDoesNotModifyInputString ( ) { java . lang . String input = "The<sp>Quick<sp>Brown<sp>Fox<sp>Jumps<sp>Over<sp>The<sp>Lazy<sp>Dog" ; com . edlio . emailreplyparser . Email email = new com . edlio . emailreplyparser . EmailParser ( ) . parse ( input ) ; java . util . List < com . edlio . emailreplyparser . Fragment > fragments = email . getFragments ( ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return content ; }
org . junit . Assert . assertEquals ( "The<sp>Quick<sp>Brown<sp>Fox<sp>Jumps<sp>Over<sp>The<sp>Lazy<sp>Dog" , fragments . get ( 0 ) . getContent ( ) )
parallel_should_assemble_parallel_of_2 ( ) { net . mostlyoriginal . api . operation . common . OperationFlow operation = parallel ( new net . mostlyoriginal . api . operation . common . TestOperation ( ) , new net . mostlyoriginal . api . operation . common . TestOperation ( ) ) ; "<AssertPlaceHolder>" ; } parallel ( net . mostlyoriginal . api . operation . common . Operation , net . mostlyoriginal . api . operation . common . Operation ) { final net . mostlyoriginal . api . operation . flow . ParallelOperation operation = net . mostlyoriginal . api . operation . common . Operation . prepare ( net . mostlyoriginal . api . operation . flow . ParallelOperation . class ) ; operation . addAll ( o1 , o2 ) ; return operation ; }
org . junit . Assert . assertEquals ( 2 , operation . operations . size )
testContainsKeyEmptySet ( ) { it . unimi . dsi . fastutil . ints . Int2IntMap m = new it . unimi . dsi . fastutil . ints . AbstractInt2IntMap ( ) { private static final long serialVersionUID = 0L ; @ it . unimi . dsi . fastutil . ints . Override public int size ( ) { return 0 ; } @ it . unimi . dsi . fastutil . ints . Override public int get ( int key ) { return - 1 ; } @ it . unimi . dsi . fastutil . ints . SuppressWarnings ( "unchecked" ) @ it . unimi . dsi . fastutil . ints . Override public it . unimi . dsi . fastutil . objects . ObjectSet < it . unimi . dsi . fastutil . ints . Entry > int2IntEntrySet ( ) { return it . unimi . dsi . fastutil . objects . ObjectSets . EMPTY_SET ; } } ; "<AssertPlaceHolder>" ; } containsKey ( int ) { return delegate . containsKey ( key ) ; }
org . junit . Assert . assertFalse ( m . containsKey ( 0 ) )
testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist ( ) { long pk1 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; long pk2 = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; primaryKeys . add ( pk1 ) ; primaryKeys . add ( pk2 ) ; java . util . Map < java . io . Serializable , com . liferay . portal . security . service . access . policy . model . SAPEntry > sapEntries = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( sapEntries . isEmpty ( ) )
testCampaignName ( ) { request . setCampaignName ( "name" ) ; "<AssertPlaceHolder>" ; } getCampaignName ( ) { return ( ( java . lang . String ) ( getParameter ( org . piwik . java . tracking . PiwikRequest . CAMPAIGN_NAME ) ) ) ; }
org . junit . Assert . assertEquals ( "name" , request . getCampaignName ( ) )
testSystemIdPlus ( ) { result1 = org . onosproject . isis . io . util . IsisUtil . systemIdPlus ( com . google . common . primitives . Bytes . toArray ( org . onosproject . isis . io . util . IsisUtil . sourceAndLanIdToBytes ( lanId ) ) ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Class ) { return true ; }
org . junit . Assert . assertThat ( result1 , org . hamcrest . CoreMatchers . is ( lanId ) )
testToBuilder ( ) { com . google . cloud . datastore . ListValue value = com . google . cloud . datastore . ListValue . of ( com . google . cloud . datastore . ListValueTest . CONTENT ) ; "<AssertPlaceHolder>" ; } toBuilder ( ) { return ( this ) == ( com . google . firestore . admin . v1 . DeleteIndexRequest . DEFAULT_INSTANCE ) ? new com . google . firestore . admin . v1 . DeleteIndexRequest . Builder ( ) : new com . google . firestore . admin . v1 . DeleteIndexRequest . Builder ( ) . mergeFrom ( this ) ; }
org . junit . Assert . assertEquals ( value , value . toBuilder ( ) . build ( ) )
testNonMetaInfNotAccessible ( ) { java . lang . ClassLoader cl = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; java . net . URL nonManifestResource = cl . getResource ( "example2.txt" ) ; "<AssertPlaceHolder>" ; } getResource ( java . lang . Object ) { return org . wildfly . transaction . client . ContextTransactionSynchronizationRegistry . getInstance ( ) . getResource ( key ) ; }
org . junit . Assert . assertNull ( nonManifestResource )
shouldSetFlushListenerOnWrappedCachingStore ( ) { final org . apache . kafka . streams . state . internals . MeteredTimestampedKeyValueStoreTest . CachedKeyValueStore cachedKeyValueStore = mock ( org . apache . kafka . streams . state . internals . MeteredTimestampedKeyValueStoreTest . CachedKeyValueStore . class ) ; expect ( cachedKeyValueStore . setFlushListener ( anyObject ( org . apache . kafka . streams . state . internals . CacheFlushListener . class ) , eq ( false ) ) ) . andReturn ( true ) ; replay ( cachedKeyValueStore ) ; metered = new org . apache . kafka . streams . state . internals . MeteredTimestampedKeyValueStore ( cachedKeyValueStore , "scope" , new org . apache . kafka . common . utils . MockTime ( ) , org . apache . kafka . common . serialization . Serdes . String ( ) , new org . apache . kafka . streams . state . internals . ValueAndTimestampSerde ( org . apache . kafka . common . serialization . Serdes . String ( ) ) ) ; "<AssertPlaceHolder>" ; verify ( cachedKeyValueStore ) ; } setFlushListener ( org . apache . kafka . streams . state . internals . CacheFlushListener , boolean ) { final org . apache . kafka . streams . state . WindowStore < org . apache . kafka . common . utils . Bytes , byte [ ] > wrapped = org . apache . kafka . streams . state . internals . MeteredWindowStore . wrapped ( ) ; if ( wrapped instanceof org . apache . kafka . streams . state . internals . CachedStateStore ) { return ( ( org . apache . kafka . streams . state . internals . CachedStateStore < byte [ ] , byte [ ] > ) ( wrapped ) ) . setFlushListener ( ( key , newValue , oldValue , timestamp ) -> listener . apply ( org . apache . kafka . streams . state . internals . WindowKeySchema . fromStoreKey ( key , windowSizeMs , serdes . keyDeserializer ( ) , serdes . topic ( ) ) , ( newValue != null ? serdes . valueFrom ( newValue ) : null ) , ( oldValue != null ? serdes . valueFrom ( oldValue ) : null ) , timestamp ) , sendOldValues ) ; } return false ; }
org . junit . Assert . assertTrue ( metered . setFlushListener ( null , false ) )
authenticateOnetimePassword ( ) { org . openengsb . core . api . security . model . Authentication authenticate = onetimeAuthenticator . authenticate ( "testuser" , new org . openengsb . core . services . OneTimeValue ( ( 90489 * 2 ) ) ) ; "<AssertPlaceHolder>" ; } getUsername ( ) { return username ; }
org . junit . Assert . assertThat ( authenticate . getUsername ( ) , org . hamcrest . Matchers . is ( "testuser" ) )
shouldRetrieveCurrentSessionWhenSessionWasOpened ( ) { "<AssertPlaceHolder>" ; } currentSession ( ) { if ( ( org . jstryker . database . HibernateHelper . session ) == null ) { org . jstryker . database . HibernateHelper . session = org . jstryker . database . HibernateHelper . sessionFactory ( ) . openSession ( ) ; org . jstryker . database . HibernateHelper . session . beginTransaction ( ) ; } return org . jstryker . database . HibernateHelper . session ; }
org . junit . Assert . assertSame ( org . jstryker . database . HibernateHelper . currentSession ( ) , org . jstryker . database . HibernateHelper . currentSession ( ) )
testDivideWrapped ( ) { int length = 4 ; byte [ ] targetA = new byte [ length ] ; byte [ ] targetB = new byte [ length ] ; byte [ ] targetC = new byte [ length ] ; com . ociweb . pronghorn . util . math . PMath . factors ( 120 , targetA , 2 , length , 3 ) ; com . ociweb . pronghorn . util . math . PMath . factors ( 12 , targetB , 2 , length , 3 ) ; com . ociweb . pronghorn . util . math . PMath . removeFactors ( targetA , 2 , length , 3 , targetB , 2 , length , 3 , targetC , 2 , length , 3 ) ; "<AssertPlaceHolder>" ; } factorsToInt ( byte [ ] , int , int , int ) { int value = 1 ; while ( ( -- length ) >= 0 ) { int j = target [ ( ( offset + length ) & mask ) ] ; if ( j < 0 ) { throw new java . lang . UnsupportedOperationException ( "This<sp>rational<sp>number<sp>can<sp>not<sp>be<sp>expressed<sp>as<sp>an<sp>integer" ) ; } while ( ( -- j ) >= 0 ) { value = value * ( com . ociweb . pronghorn . util . math . PMath . primeAtIdx ( length ) ) ; } } return value ; }
org . junit . Assert . assertEquals ( ( 120 / 12 ) , com . ociweb . pronghorn . util . math . PMath . factorsToInt ( targetC , 2 , length , 3 ) )
itShouldUsePathIfPathIsAbsoluteAndExisting ( ) { fileSupport = new jdk . tools . jaotc . test . collect . FakeFileSupport ( jdk . tools . jaotc . test . collect . Utils . mkpaths ( "/foo" ) , jdk . tools . jaotc . test . collect . Utils . set ( ) ) ; jdk . tools . jaotc . collect . SearchPath target = new jdk . tools . jaotc . collect . SearchPath ( fileSupport ) ; java . nio . file . Path foo = java . nio . file . Paths . get ( jdk . tools . jaotc . test . collect . Utils . mkpath ( "/foo" ) ) ; java . nio . file . Path result = target . find ( fs , foo ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertSame ( result , foo )
testKieBase ( ) { org . kie . api . KieBase kbase = ( ( org . kie . api . KieBase ) ( org . kie . aries . blueprint . tests . KieBlueprintKModuleBasicTest . container . getComponentInstance ( "drl_kiesample2" ) ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( kbase )
saveAuthorValidIDs ( ) { author . setAuthorFirstName ( "Marion" ) ; author . setAuthorLastName ( "Smith" ) ; book . setBookId ( 46 ) ; "<AssertPlaceHolder>" ; } saveAuthor ( ) { java . lang . String sql = "insert<sp>into<sp>author(First_Name,Last_Name)<sp>values(?,?)" ; int result = 0 ; if ( ( ( author . getAuthorFirstName ( ) ) != null ) || ( ! ( author . getAuthorFirstName ( ) . trim ( ) . equals ( "" ) ) ) ) { try { result = adao . saveAuthor ( sql , author . getAuthorFirstName ( ) , author . getAuthorLastName ( ) ) ; } catch ( java . sql . SQLException e ) { log . error ( e . getMessage ( ) ) ; } } else { try { result = adao . saveAuthor ( sql , author . getAuthorLastName ( ) ) ; } catch ( java . sql . SQLException e ) { log . error ( e . getMessage ( ) ) ; } } if ( result == 0 ) { javax . faces . context . FacesContext . getCurrentInstance ( ) . addMessage ( null , new javax . faces . application . FacesMessage ( strings . getString ( "createAuthorFail" ) ) ) ; return null ; } try { author . setAuthorId ( adao . getLastAuthor ( "select<sp>Max(AuthorId)<sp>as<sp>AuthorId<sp>from<sp>author" ) ) ; } catch ( java . sql . SQLException e ) { log . error ( e . getMessage ( ) ) ; } saveBAuthor ( ) ; return null ; }
org . junit . Assert . assertTrue ( ( ( manager . saveAuthor ( ) ) == null ) )
test_intersectionBad ( ) { org . threeten . extra . LocalDateRange test1 = org . threeten . extra . LocalDateRange . of ( org . threeten . extra . TestLocalDateRange . DATE_2012_07_01 , org . threeten . extra . TestLocalDateRange . DATE_2012_07_28 ) ; org . threeten . extra . LocalDateRange test2 = org . threeten . extra . LocalDateRange . of ( org . threeten . extra . TestLocalDateRange . DATE_2012_07_29 , org . threeten . extra . TestLocalDateRange . DATE_2012_07_30 ) ; "<AssertPlaceHolder>" ; test1 . intersection ( test2 ) ; } isConnected ( org . threeten . extra . LocalDateRange ) { java . util . Objects . requireNonNull ( other , "other" ) ; return ( this . equals ( other ) ) || ( ( ( start . compareTo ( other . end ) ) <= 0 ) && ( ( other . start . compareTo ( end ) ) <= 0 ) ) ; }
org . junit . Assert . assertEquals ( false , test1 . isConnected ( test2 ) )
shouldParseExportForcedSubtitlesOnly ( ) { subject . parse ( "--forced-only" ) ; "<AssertPlaceHolder>" ; } isExportForcedSubtitlesOnly ( ) { return exportForcedSubtitlesOnly ; }
org . junit . Assert . assertTrue ( subject . isExportForcedSubtitlesOnly ( ) . get ( ) )
testCopyDynAny ( ) { java . lang . String msg ; org . omg . CORBA . TypeCode tc = null ; org . omg . DynamicAny . DynEnum dynAny = null ; org . omg . DynamicAny . DynEnum dynAny2 = null ; tc = org . jacorb . test . EnumTypeHelper . type ( ) ; dynAny = createDynAnyFromTypeCode ( tc ) ; dynAny2 = ( ( org . omg . DynamicAny . DynEnum ) ( dynAny . copy ( ) ) ) ; msg = "The<sp>DynAny<sp>object<sp>created<sp>with<sp>the<sp>DynAny::copy<sp>operation<sp>" ; msg += "is<sp>not<sp>equal<sp>to<sp>the<sp>DynAny<sp>object<sp>it<sp>was<sp>copied<sp>from" ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
org . junit . Assert . assertTrue ( msg , dynAny . equal ( dynAny2 ) )
testWriteRowToStringArrayWihtoutRowId ( ) { org . sagebionetworks . repo . model . table . Row row = new org . sagebionetworks . repo . model . table . Row ( ) ; row . setRowId ( 123L ) ; row . setVersionNumber ( 2L ) ; row . setValues ( java . util . Arrays . asList ( "a" , "b" , "c" ) ) ; boolean includeRowIdAndVersion = false ; boolean includeRowEtag = true ; java . lang . String [ ] results = org . sagebionetworks . table . cluster . utils . TableModelUtils . writeRowToStringArray ( row , includeRowIdAndVersion , includeRowEtag ) ; java . lang . String [ ] expected = new java . lang . String [ ] { "a" , "b" , "c" } ; "<AssertPlaceHolder>" ; } toString ( java . lang . Long ) { if ( input == null ) { return null ; } return input . toString ( ) ; }
org . junit . Assert . assertEquals ( java . util . Arrays . toString ( expected ) , java . util . Arrays . toString ( results ) )
testCountConceptsWoNotes ( ) { java . lang . String thesaurusId = "http://www.culturecommunication.gouv.fr/th1" ; java . lang . Long nbConceptsWoNotes = thesaurusConceptDAO . countConceptsWoNotes ( thesaurusId ) ; "<AssertPlaceHolder>" ; } countConceptsWoNotes ( java . lang . String ) { org . hibernate . Query query = getCurrentSession ( ) . createSQLQuery ( ( "select<sp>count(*)<sp>" + ( ( ( "from<sp>thesaurus_concept<sp>c<sp>" + "left<sp>join<sp>note<sp>n<sp>on<sp>c.identifier<sp>=<sp>n.conceptid<sp>" ) + "where<sp>c.thesaurusid=:pthesaurusid" ) + "<sp>and<sp>n.identifier<sp>is<sp>null" ) ) ) ; query . setParameter ( "pthesaurusid" , idThesaurus ) ; return ( ( java . math . BigInteger ) ( query . list ( ) . get ( 0 ) ) ) . longValue ( ) ; }
org . junit . Assert . assertEquals ( 4 , nbConceptsWoNotes . longValue ( ) )
propertyValueCanBeRetrievedByReflection ( ) { org . alfresco . util . schemacomp . DbPropertyTest . DbObjectWithIndexedProp dbo = org . mockito . Mockito . mock ( org . alfresco . util . schemacomp . DbPropertyTest . DbObjectWithIndexedProp . class ) ; org . mockito . Mockito . when ( dbo . getTheProperty ( ) ) . thenReturn ( "This<sp>is<sp>the<sp>property<sp>value" ) ; org . alfresco . util . schemacomp . DbProperty dbProperty = new org . alfresco . util . schemacomp . DbProperty ( dbo , "theProperty" ) ; "<AssertPlaceHolder>" ; } getPropertyValue ( ) { return propertyValue ; }
org . junit . Assert . assertEquals ( "This<sp>is<sp>the<sp>property<sp>value" , dbProperty . getPropertyValue ( ) )
calendarUtils_getEndOfDay_calendarAsEndOfDayReturned ( ) { java . util . Calendar testInput = java . util . Calendar . getInstance ( ) ; testInput . set ( 2014 , Calendar . MARCH , 10 ) ; java . util . Calendar expResult = ( ( java . util . Calendar ) ( testInput . clone ( ) ) ) ; expResult . set ( Calendar . HOUR_OF_DAY , 23 ) ; expResult . set ( Calendar . MINUTE , 59 ) ; expResult . set ( Calendar . SECOND , 59 ) ; expResult . set ( Calendar . MILLISECOND , 999 ) ; java . util . Calendar result = dk . i2m . converge . core . utils . CalendarUtils . getEndOfDay ( testInput ) ; "<AssertPlaceHolder>" ; } getEndOfDay ( java . util . Calendar ) { java . util . Calendar result = ( ( java . util . Calendar ) ( c . clone ( ) ) ) ; result . set ( Calendar . HOUR_OF_DAY , 23 ) ; result . set ( Calendar . MINUTE , 59 ) ; result . set ( Calendar . SECOND , 59 ) ; result . set ( Calendar . MILLISECOND , 999 ) ; return result ; }
org . junit . Assert . assertEquals ( expResult , result )
shouldDenyForNonOpPlayer ( ) { fr . xephi . authme . permission . PermissionNode node = TestPermissions . DELETE_USER ; org . bukkit . entity . Player player = mock ( org . bukkit . entity . Player . class ) ; boolean result = permissionsManager . hasPermission ( player , node ) ; "<AssertPlaceHolder>" ; } hasPermission ( fr . xephi . authme . listener . JoiningPlayer , fr . xephi . authme . permission . PermissionNode ) { return joiningPlayer . getPermissionLookupFunction ( ) . apply ( this , permissionNode ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( false ) )
popupButton_cellHasAPopupButtonAndFreezePaneIsAdded_theCellStillHasAPopupButton ( ) { headerPage . loadTestFixture ( TestFixtures . PopupButton ) ; com . vaadin . addon . spreadsheet . elements . SpreadsheetElement spreadsheetElement = $ ( com . vaadin . addon . spreadsheet . elements . SpreadsheetElement . class ) . first ( ) ; final com . vaadin . addon . spreadsheet . elements . SheetCellElement d1 = spreadsheetElement . getCellAt ( "D1" ) ; d1 . click ( ) ; waitUntil ( new org . openqa . selenium . support . ui . ExpectedCondition < java . lang . Boolean > ( ) { @ com . vaadin . addon . spreadsheet . test . Override public com . vaadin . addon . spreadsheet . test . Boolean apply ( org . openqa . selenium . WebDriver webDriver ) { return d1 . hasPopupButton ( ) ; } } ) ; headerPage . addFreezePane ( ) ; "<AssertPlaceHolder>" ; } getCellAt ( java . lang . String ) { org . openqa . selenium . Point point = com . vaadin . addon . spreadsheet . elements . AddressUtil . addressToPoint ( cellAddress ) ; return getCellAt ( point . getY ( ) , point . getX ( ) ) ; }
org . junit . Assert . assertTrue ( spreadsheetElement . getCellAt ( "D1" ) . hasPopupButton ( ) )
deveObterDataInicioAtividadeComHoraComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . cadastro . NFRetornoConsultaCadastroSituacaoCadastral retorno = new com . fincatto . documentofiscal . nfe400 . classes . cadastro . NFRetornoConsultaCadastroSituacaoCadastral ( ) ; final java . time . LocalDate dataInicioAtividade = java . time . LocalDate . from ( java . time . format . DateTimeFormatter . ofPattern ( "dd/MM/yyyy'<sp>'HH:mm:ss" ) . parse ( "20/10/2010<sp>10:20:10" ) ) ; retorno . setDataInicioAtividade ( dataInicioAtividade ) ; "<AssertPlaceHolder>" ; } getDataInicioAtividade ( ) { return this . dataInicioAtividade ; }
org . junit . Assert . assertEquals ( dataInicioAtividade , retorno . getDataInicioAtividade ( ) )
testListQualityForm ( ) { int previous = qualityFormDAO . list ( org . libreplan . business . qualityforms . entities . QualityForm . class ) . size ( ) ; org . libreplan . business . qualityforms . entities . QualityForm qualityForm = createValidQualityForm ( ) ; qualityFormDAO . save ( qualityForm ) ; java . util . List < org . libreplan . business . qualityforms . entities . QualityForm > list = qualityFormDAO . list ( org . libreplan . business . qualityforms . entities . QualityForm . class ) ; "<AssertPlaceHolder>" ; } list ( java . lang . Class ) { return getSession ( ) . createCriteria ( klass ) . list ( ) ; }
org . junit . Assert . assertEquals ( ( previous + 1 ) , list . size ( ) )
sum ( ) { org . apache . beam . sdk . util . MovingFunction f = newFunc ( ) ; for ( int i = 0 ; i < ( org . apache . beam . sdk . util . MovingFunctionTest . SAMPLE_PERIOD ) ; i ++ ) { f . add ( i , i ) ; "<AssertPlaceHolder>" ; } } get ( org . apache . beam . sdk . values . TupleTag ) { return org . apache . beam . sdk . transforms . DoFnOutputReceivers . windowedReceiver ( context , tag ) ; }
org . junit . Assert . assertEquals ( ( ( ( i + 1 ) * i ) / 2 ) , f . get ( i ) )
testCanIRI5 ( ) { java . lang . String query = "PREFIX<sp>:<sp><http://ontop.inf.unibz.it/test/wellbore#><sp>Select<sp>*<sp>WHERE{\n" + ( "?x<sp>:inWell<sp>?y<sp>.\n" + "}\n" ) ; java . util . ArrayList < java . lang . String > results = runTests ( query ) ; "<AssertPlaceHolder>" ; } size ( ) { return ontopBindingSet . getBindingNames ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 20 , results . size ( ) )
checkStatusFileCorrectlyUpdated ( ) { when ( context . getString ( "status.file.path" ) ) . thenReturn ( "/var/lib/flume" ) ; when ( context . getString ( "hibernate.connection.url" ) ) . thenReturn ( "jdbc:mysql://host:3306/database" ) ; when ( context . getString ( "table" ) ) . thenReturn ( "table" ) ; when ( context . getString ( "status.file.name" ) ) . thenReturn ( "statusFileName" ) ; org . keedio . flume . source . SQLSourceHelper sqlSourceHelper = new org . keedio . flume . source . SQLSourceHelper ( context , "Source<sp>Name" ) ; sqlSourceHelper . createStatusFile ( ) ; sqlSourceHelper . setCurrentIndex ( "10" ) ; sqlSourceHelper . updateStatusFile ( ) ; org . keedio . flume . source . SQLSourceHelper sqlSourceHelper2 = new org . keedio . flume . source . SQLSourceHelper ( context , "Source<sp>Name" ) ; "<AssertPlaceHolder>" ; } getCurrentIndex ( ) { return currentIndex ; }
org . junit . Assert . assertEquals ( "10" , sqlSourceHelper2 . getCurrentIndex ( ) )
testReadPlace ( ) { one . nio . serial . StreamsTest . Place place = new one . nio . serial . StreamsTest . Place ( "blah" , "" , "" ) ; one . nio . serial . Serializer < one . nio . serial . StreamsTest . Place > serializer = one . nio . serial . Repository . get ( one . nio . serial . StreamsTest . Place . class ) ; one . nio . serial . CalcSizeStream css = new one . nio . serial . CalcSizeStream ( ) ; serializer . calcSize ( place , css ) ; int length = css . count ( ) ; byte [ ] buf = new byte [ length ] ; one . nio . serial . SerializeStream out = new one . nio . serial . SerializeStream ( buf ) ; serializer . write ( place , out ) ; one . nio . serial . DeserializeStream in = new one . nio . serial . DeserializeStream ( buf ) ; one . nio . serial . StreamsTest . Place place2 = serializer . read ( in ) ; "<AssertPlaceHolder>" ; } read ( one . nio . serial . DataStream ) { int length = in . readInt ( ) ; java . util . ArrayList < java . lang . Object > result = new java . util . ArrayList ( length ) ; in . register ( result ) ; for ( int i = 0 ; i < length ; i ++ ) { result . add ( in . readObject ( ) ) ; } return result ; }
org . junit . Assert . assertEquals ( place , place2 )
nullMappedDatabases ( ) { metaStore . setMappedDatabases ( null ) ; java . util . Set < javax . validation . ConstraintViolation < com . hotels . bdp . waggledance . api . model . FederatedMetaStore > > violations = validator . validate ( metaStore ) ; "<AssertPlaceHolder>" ; } size ( ) { return whiteList . size ( ) ; }
org . junit . Assert . assertThat ( violations . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) )
testGetGeolayerPixelSize ( ) { "<AssertPlaceHolder>" ; } getGeolayerPixelSize ( ) { int value = 8 ; org . esa . snap . core . datamodel . MetadataElement currentElement ; if ( ( currentElement = rootElement . getElement ( SpotConstants . TAG_GEOLAYER ) ) != null ) { value = java . lang . Integer . parseInt ( currentElement . getAttributeString ( SpotConstants . TAG_BITS_PER_PIXEL ) ) ; } return value / 8 ; }
org . junit . Assert . assertEquals ( 4 , metadata . getGeolayerPixelSize ( ) )
testGetBusinessObjectDataEntitiesByPartitionValue ( ) { businessObjectDataDaoTestHelper . createBusinessObjectDataEntity ( org . finra . herd . dao . NAMESPACE , org . finra . herd . dao . BDEF_NAME , org . finra . herd . dao . FORMAT_USAGE_CODE , org . finra . herd . dao . FORMAT_FILE_TYPE_CODE , org . finra . herd . dao . FORMAT_VERSION , org . finra . herd . dao . PARTITION_VALUE , null , org . finra . herd . dao . DATA_VERSION , true , "VALID" ) ; businessObjectDataDaoTestHelper . createBusinessObjectDataEntity ( org . finra . herd . dao . NAMESPACE_2 , org . finra . herd . dao . BDEF_NAME , org . finra . herd . dao . FORMAT_USAGE_CODE , org . finra . herd . dao . FORMAT_FILE_TYPE_CODE , org . finra . herd . dao . FORMAT_VERSION , org . finra . herd . dao . PARTITION_VALUE , null , org . finra . herd . dao . DATA_VERSION , true , "VALID" ) ; java . util . List < org . finra . herd . model . jpa . BusinessObjectDataEntity > businessObjectDataEntities = businessObjectDataDao . getBusinessObjectDataEntitiesByPartitionValue ( org . finra . herd . dao . PARTITION_VALUE ) ; "<AssertPlaceHolder>" ; } size ( ) { return org . finra . herd . service . helper . NotificationMessageInMemoryQueue . QUEUE . get ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 2 , businessObjectDataEntities . size ( ) )
shouldResetClassLoader ( ) { final org . apache . tinkerpop . gremlin . groovy . jsr223 . GremlinGroovyScriptEngine scriptEngine = new org . apache . tinkerpop . gremlin . groovy . jsr223 . GremlinGroovyScriptEngine ( ) ; try { scriptEngine . eval ( "addOne(1)" ) ; org . junit . Assert . fail ( "Should<sp>have<sp>tossed<sp>ScriptException<sp>since<sp>addOne<sp>is<sp>not<sp>yet<sp>defined." ) ; } catch ( javax . script . ScriptException se ) { } scriptEngine . eval ( "addOne<sp>=<sp>{<sp>y-><sp>y<sp>+<sp>1}" ) ; "<AssertPlaceHolder>" ; scriptEngine . reset ( ) ; try { scriptEngine . eval ( "addOne(1)" ) ; org . junit . Assert . fail ( "Should<sp>have<sp>tossed<sp>ScriptException<sp>since<sp>addOne<sp>is<sp>no<sp>longer<sp>defined<sp>after<sp>reset." ) ; } catch ( javax . script . ScriptException se ) { } } eval ( java . io . Reader ) { return this . pyScriptEngine . eval ( reader ) ; }
org . junit . Assert . assertEquals ( 2 , scriptEngine . eval ( "addOne(1)" ) )
testGetTableName ( ) { com . stratelia . silverpeas . silverstatistics . model . TypeStatistics instance = new com . stratelia . silverpeas . silverstatistics . model . TypeStatistics ( ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getTableName ( ) ; "<AssertPlaceHolder>" ; } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
org . junit . Assert . assertThat ( result , is ( expResult ) )
buildInNullObjSql ( ) { com . blinkfox . zealot . bean . SqlInfo sqlInfo = com . blinkfox . zealot . core . builder . XmlSqlInfoBuilder . newInstace ( new com . blinkfox . zealot . bean . BuildSource ( com . blinkfox . zealot . bean . SqlInfo . newInstance ( ) ) ) . buildInSql ( "a.name" , "" ) ; "<AssertPlaceHolder>" ; } getJoin ( ) { return join ; }
org . junit . Assert . assertEquals ( "" , sqlInfo . getJoin ( ) . toString ( ) )
testGetElementBooleanAbs ( ) { int [ ] values = new int [ ] { 0 , 1 , 2 , 3 } ; boolean [ ] value = new boolean [ ] { true , true , true , false } ; org . eclipse . january . dataset . Dataset input = org . eclipse . january . dataset . DatasetFactory . createFromObject ( org . eclipse . january . dataset . BooleanDataset . class , value ) ; for ( int val : values ) { boolean actualResult = input . getElementBooleanAbs ( val ) ; boolean result = value [ val ] ; "<AssertPlaceHolder>" ; } } getElementBooleanAbs ( int ) { return ( data [ index ] ) != 0 ; }
org . junit . Assert . assertEquals ( result , actualResult )
testShowHideMeasureFormattedMeasure ( ) { org . pentaho . agilebi . modeler . models . annotations . util . MondrianSchemaHandler mondrianSchemaHandler = new org . pentaho . agilebi . modeler . models . annotations . util . MondrianSchemaHandler ( schemaDocument ) ; boolean result = mondrianSchemaHandler . showHideMeasure ( org . pentaho . agilebi . modeler . models . annotations . util . MondrianSchemaHandlerTest . TEST_CUBE_NAME , org . pentaho . agilebi . modeler . models . annotations . util . MondrianSchemaHandlerTest . TEST_EXISTING_MEASURE_DIMENSION_STRING , Boolean . FALSE ) ; "<AssertPlaceHolder>" ; } showHideMeasure ( java . lang . String , java . lang . String , boolean ) { org . w3c . dom . Element measureNode = ( ( org . w3c . dom . Element ) ( getMeasureNode ( cubeName , measureName ) ) ) ; if ( measureNode == null ) { measureNode = getCalculatedMeasureNode ( cubeName , measureName ) ; } if ( measureNode != null ) { showHideElement ( measureNode , visible ) ; return true ; } else { return false ; } }
org . junit . Assert . assertTrue ( result )
escape_null_leading ( ) { java . lang . String [ ] [ ] result = read ( "a\\N" ) ; "<AssertPlaceHolder>" ; } is ( java . lang . String ) { com . asakusafw . dmdl . java . util . JavaName jn = com . asakusafw . dmdl . java . util . JavaName . of ( new com . asakusafw . dmdl . model . AstSimpleName ( null , name ) ) ; jn . addFirst ( "is" ) ; java . lang . Object result = invoke ( jn . toMemberName ( ) ) ; return ( ( java . lang . Boolean ) ( result ) ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( new java . lang . String [ ] [ ] { new java . lang . String [ ] { "a\\N" } } ) )
expectExactlyFoundExactly_success ( ) { model . add ( typeStatement ( edu . cornell . mannlib . vitro . webapp . utils . configuration . GENERIC_INSTANCE_URI , edu . cornell . mannlib . vitro . webapp . utils . configuration . ConfigurationBeanLoader . toJavaUri ( edu . cornell . mannlib . vitro . webapp . utils . configuration . ConfigurationBeanLoader_Cardinality_Test . ExpectTwo . class ) ) ) ; model . add ( edu . cornell . mannlib . vitro . webapp . utils . configuration . ConfigurationBeanLoader_Cardinality_Test . FOUND_TWO ) ; java . util . Set < edu . cornell . mannlib . vitro . webapp . utils . configuration . ConfigurationBeanLoader_Cardinality_Test . ExpectTwo > instances = loader . loadAll ( edu . cornell . mannlib . vitro . webapp . utils . configuration . ConfigurationBeanLoader_Cardinality_Test . ExpectTwo . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return m . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , instances . size ( ) )
testIsPrimitive_TruePrimitiveValue ( ) { org . apache . crunch . types . avro . AvroType truePrimitiveAvroType = new org . apache . crunch . types . avro . AvroType ( int . class , org . apache . avro . Schema . create ( Type . INT ) , org . apache . crunch . types . NoOpDeepCopier . create ( ) ) ; "<AssertPlaceHolder>" ; } isPrimitive ( org . apache . crunch . types . avro . AvroType ) { return ( avroType . getTypeClass ( ) . isPrimitive ( ) ) || ( org . apache . crunch . types . avro . Avros . PRIMITIVES . containsKey ( avroType . getTypeClass ( ) ) ) ; }
org . junit . Assert . assertTrue ( org . apache . crunch . types . avro . Avros . isPrimitive ( truePrimitiveAvroType ) )
test_createdTimestamp_utilDate ( ) { io . ebeaninternal . server . deploy . meta . DeployBeanProperty prop = new io . ebeaninternal . server . deploy . meta . DeployBeanProperty ( null , java . util . Date . class , null , null ) ; io . ebeaninternal . server . deploy . generatedproperty . GeneratedProperty insertTimestamp = factory . createInsertTimestamp ( prop ) ; java . lang . Object value = insertTimestamp . getInsertValue ( null , null , java . lang . System . currentTimeMillis ( ) ) ; "<AssertPlaceHolder>" ; } getInsertValue ( io . ebeaninternal . server . deploy . BeanProperty , io . ebean . bean . EntityBean , long ) { return new java . sql . Timestamp ( now ) ; }
org . junit . Assert . assertTrue ( ( value instanceof java . util . Date ) )
isSupportedShouldBeTrueIfTheClientSupportTemplates ( ) { "<AssertPlaceHolder>" ; } isSupported ( ) { if ( ( mapper ) != null ) { try { return mapper . getEndpointFor ( resource . getApiVersion ( ) , resource . getKind ( ) ) . isSupported ( capability ) ; } catch ( com . openshift . restclient . UnsupportedEndpointException e ) { } } return false ; }
org . junit . Assert . assertTrue ( capability . isSupported ( ) )
testAssertValidForCpnj ( ) { br . com . caelum . stella . validation . Validator < java . lang . String > validator = new br . com . caelum . stella . validation . AcceptAnyValidator ( br . com . caelum . stella . validation . AcceptAnyValidator . Documento . CNPJ ) ; java . lang . String cnpj = "26.637.142/0001-58" ; "<AssertPlaceHolder>" ; } invalidMessagesFor ( java . lang . String ) { return getInvalidValues ( renavam ) ; }
org . junit . Assert . assertTrue ( validator . invalidMessagesFor ( cnpj ) . isEmpty ( ) )
unzipFileBytesTest ( ) { byte [ ] fileBytes = cn . hutool . core . util . ZipUtil . unzipFileBytes ( cn . hutool . core . io . FileUtil . file ( "e:/02<sp>2-241-.zip" ) , CharsetUtil . CHARSET_GBK , "images/CE-EP-HY-MH01-ES-0001.jpg" ) ; "<AssertPlaceHolder>" ; } file ( java . lang . String ) { if ( cn . hutool . core . util . StrUtil . isBlank ( path ) ) { throw new java . lang . NullPointerException ( "File<sp>path<sp>is<sp>blank!" ) ; } return new java . io . File ( cn . hutool . core . io . FileUtil . getAbsolutePath ( path ) ) ; }
org . junit . Assert . assertNotNull ( fileBytes )
getsEndpointFromConf ( ) { conf . set ( DynamoDBConstants . ENDPOINT , TEST_ENDPOINT ) ; "<AssertPlaceHolder>" ; verify ( region , never ( ) ) . getServiceEndpoint ( ServiceAbbreviations . Dynamodb ) ; } getDynamoDBEndpoint ( org . apache . hadoop . conf . Configuration , java . lang . String ) { java . lang . String endpoint = org . apache . hadoop . dynamodb . DynamoDBUtil . getValueFromConf ( conf , DynamoDBConstants . ENDPOINT ) ; if ( com . google . common . base . Strings . isNullOrEmpty ( endpoint ) ) { if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { region = org . apache . hadoop . dynamodb . DynamoDBUtil . getValueFromConf ( conf , DynamoDBConstants . REGION ) ; } if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { region = org . apache . hadoop . dynamodb . DynamoDBUtil . getValueFromConf ( conf , DynamoDBConstants . REGION_ID ) ; } if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { try { region = com . amazonaws . util . EC2MetadataUtils . getEC2InstanceRegion ( ) ; } catch ( java . lang . Exception e ) { org . apache . hadoop . dynamodb . DynamoDBUtil . log . warn ( java . lang . String . format ( ( "Exception<sp>when<sp>attempting<sp>to<sp>get<sp>AWS<sp>region<sp>information.<sp>Will<sp>" + ( "ignore<sp>and<sp>default<sp>" + "to<sp>%s" ) ) , DynamoDBConstants . DEFAULT_AWS_REGION ) , e ) ; } } if ( com . google . common . base . Strings . isNullOrEmpty ( region ) ) { region = DynamoDBConstants . DEFAULT_AWS_REGION ; } endpoint = com . amazonaws . regions . RegionUtils . getRegion ( region ) . getServiceEndpoint ( ServiceAbbreviations . Dynamodb ) ; } org . apache . hadoop . dynamodb . DynamoDBUtil . log . info ( ( "Using<sp>endpoint<sp>for<sp>DynamoDB:<sp>" + endpoint ) ) ; return endpoint ; }
org . junit . Assert . assertEquals ( TEST_ENDPOINT , org . apache . hadoop . dynamodb . DynamoDBUtil . getDynamoDBEndpoint ( conf , null ) )
test_getBlockSelectionlundsInBlockSelection ( ) { text . setText ( blockSelectionTestText ( ) ) ; text . setSize ( 1000 , 1000 ) ; text . setBlockSelection ( true ) ; org . eclipse . swt . graphics . Point lowerRight = text . getLocationAtOffset ( ( ( ( blockSelectionTestTextOneLine ( ) . length ( ) ) * 2 ) + 6 ) ) ; text . setBlockSelectionBounds ( 0 , 0 , lowerRight . x , lowerRight . y ) ; "<AssertPlaceHolder>" ; } getBlockSelectionBounds ( ) { org . eclipse . swt . custom . Rectangle rect ; if ( ( blockSelection ) && ( ( blockXLocation ) != ( - 1 ) ) ) { rect = getBlockSelectionRectangle ( ) ; } else { org . eclipse . swt . custom . Point startPoint = getPointAtOffset ( selection . x ) ; org . eclipse . swt . custom . Point endPoint = getPointAtOffset ( selection . y ) ; int height = getLineHeight ( selection . y ) ; rect = new org . eclipse . swt . custom . Rectangle ( startPoint . x , startPoint . y , ( ( endPoint . x ) - ( startPoint . x ) ) , ( ( ( endPoint . y ) + height ) - ( startPoint . y ) ) ) ; if ( ( selection . x ) == ( selection . y ) ) { rect . width = getCaretWidth ( ) ; } } rect . x += horizontalScrollOffset ; rect . y += getVerticalScrollOffset ( ) ; return rect ; }
org . junit . Assert . assertEquals ( new org . eclipse . swt . graphics . Rectangle ( 0 , 0 , lowerRight . x , lowerRight . y ) , text . getBlockSelectionBounds ( ) )
testPreviousAbsentValueEmpty ( ) { org . roaringbitmap . RunContainer container = new org . roaringbitmap . RunContainer ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { "<AssertPlaceHolder>" ; } } previousAbsentValue ( int ) { long prevAbsentBit = computePreviousAbsentValue ( fromValue ) ; assert prevAbsentBit <= 4294967295L ; assert prevAbsentBit <= ( org . roaringbitmap . buffer . Util . toUnsignedLong ( fromValue ) ) ; assert ! ( contains ( ( ( int ) ( prevAbsentBit ) ) ) ) ; return prevAbsentBit ; }
org . junit . Assert . assertEquals ( i , container . previousAbsentValue ( ( ( short ) ( i ) ) ) )
testChemFile ( ) { org . openscience . cdk . interfaces . IChemFile cs = new org . openscience . cdk . ChemFile ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( cs )
test2 ( ) { org . apache . servicecomb . swagger . invocation . response . Headers headers = new org . apache . servicecomb . swagger . invocation . response . Headers ( ) ; headers . addHeader ( "h1" , "h1v1" ) ; headers . addHeader ( "h1" , "h1v2" ) ; "<AssertPlaceHolder>" ; } getFirst ( java . lang . String ) { java . util . List < java . lang . String > values = querys . get ( key ) ; if ( values == null ) { return null ; } return values . get ( 0 ) ; }
org . junit . Assert . assertEquals ( "h1v1" , headers . getFirst ( "h1" ) )
testAttrScope ( ) { java . lang . String expectedJavascript = "$(\'div\').attr(\'click\',<sp>function()<sp>{\n\talert(\'click<sp>done\');\n});" ; java . lang . String generatedJavascript = new org . odlabs . wiquery . core . javascript . JsStatement ( ) . $ ( null , "div" ) . chain ( org . odlabs . wiquery . core . javascript . helper . AttributesHelper . attr ( "click" , org . odlabs . wiquery . core . javascript . JsScope . quickScope ( "alert('click<sp>done');" ) ) ) . render ( ) . toString ( ) ; org . odlabs . wiquery . core . javascript . helper . AttributesHelperTestCase . log . info ( expectedJavascript ) ; org . odlabs . wiquery . core . javascript . helper . AttributesHelperTestCase . log . info ( generatedJavascript ) ; "<AssertPlaceHolder>" ; } toString ( ) { return super . toString ( ) . toLowerCase ( ) ; }
org . junit . Assert . assertEquals ( generatedJavascript , expectedJavascript )
testCustomizeInvalidLongPollQPS ( ) { java . lang . String someInvalidQPS = "a" ; java . lang . System . setProperty ( "apollo.longPollQPS" , someInvalidQPS ) ; com . ctrip . framework . apollo . util . ConfigUtil configUtil = new com . ctrip . framework . apollo . util . ConfigUtil ( ) ; "<AssertPlaceHolder>" ; } getLongPollQPS ( ) { return longPollQPS ; }
org . junit . Assert . assertTrue ( ( ( configUtil . getLongPollQPS ( ) ) > 0 ) )
isTopicReadWhenLoggedLastVisitAndReadTimeOlderThanTopicShouldReturnFalse ( ) { when ( httpSession . getAttribute ( ConfigKeys . LOGGED ) ) . thenReturn ( "1" ) ; net . jforum . entities . Topic topic = new net . jforum . entities . Topic ( ) ; topic . setLastPost ( new net . jforum . entities . Post ( ) ) ; topic . getLastPost ( ) . setDate ( new java . util . Date ( 10 ) ) ; userSession . setLastVisit ( 1 ) ; topicsReadTime . put ( topic . getId ( ) , 8L ) ; "<AssertPlaceHolder>" ; } isTopicRead ( net . jforum . entities . Topic ) { if ( ! ( this . isLogged ( ) ) ) { return true ; } long lastVisit = this . getLastVisit ( ) ; long postTime = topic . getLastPost ( ) . getDate ( ) . getTime ( ) ; if ( postTime <= lastVisit ) { return true ; } java . lang . Long readTime = this . topicReadTime . get ( topic . getId ( ) ) ; return ( readTime != null ) && ( postTime <= readTime ) ; }
org . junit . Assert . assertFalse ( userSession . isTopicRead ( topic ) )
stream_to_list ( ) { java . util . List < java . lang . String > abc = java . util . stream . Stream . of ( "a" , "b" , "c" ) . collect ( toList ( ) ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertTrue ( ( ( abc . size ( ) ) == 3 ) )
testConcatenateByte_LowestAndHighestByte ( ) { short actual = de . persosim . simulator . utils . Utils . concatenate ( ( ( byte ) ( 0 ) ) , ( ( byte ) ( 255 ) ) ) ; short expected = ( ( short ) ( 255 ) ) ; "<AssertPlaceHolder>" ; } concatenate ( byte , byte ) { short concatenation ; concatenation = de . persosim . simulator . utils . Utils . maskUnsignedByteToShort ( byte1 ) ; concatenation <<= 8 ; concatenation |= de . persosim . simulator . utils . Utils . maskUnsignedByteToShort ( byte2 ) ; return concatenation ; }
org . junit . Assert . assertEquals ( expected , actual )
shouldRaiseConstraintViolationCauseCreditCardIsNull ( ) { org . agoncal . book . javaee7 . chapter03 . ex04 . CardValidator04 cardValidator = new org . agoncal . book . javaee7 . chapter03 . ex04 . CardValidator04 ( ) ; javax . validation . executable . ExecutableValidator methodValidator = org . agoncal . book . javaee7 . chapter03 . ex04 . CardValidator04Test . validator . forExecutables ( ) ; java . lang . reflect . Method method = org . agoncal . book . javaee7 . chapter03 . ex04 . CardValidator04 . class . getMethod ( "validate" , org . agoncal . book . javaee7 . chapter03 . ex04 . CreditCard04 . class ) ; java . util . Set < org . agoncal . book . javaee7 . chapter03 . ex04 . ConstraintViolation < org . agoncal . book . javaee7 . chapter03 . ex04 . CardValidator04 > > violations = methodValidator . validateParameters ( cardValidator , method , new java . lang . Object [ ] { null } ) ; displayContraintViolations ( violations ) ; "<AssertPlaceHolder>" ; } displayContraintViolations ( java . util . Set ) { for ( org . agoncal . book . javaee7 . chapter03 . ex12 . ConstraintViolation constraintViolation : constraintViolations ) { System . out . println ( ( ( ( ( ( ( ( "###<sp>" + ( constraintViolation . getRootBeanClass ( ) . getSimpleName ( ) ) ) + "." ) + ( constraintViolation . getPropertyPath ( ) ) ) + "<sp>-<sp>Invalid<sp>Value<sp>=<sp>" ) + ( constraintViolation . getInvalidValue ( ) ) ) + "<sp>-<sp>Error<sp>Msg<sp>=<sp>" ) + ( constraintViolation . getMessage ( ) ) ) ) ; } }
org . junit . Assert . assertEquals ( 1 , violations . size ( ) )
delete ( ) { personRepository . delete ( this . person . getId ( ) ) ; "<AssertPlaceHolder>" ; } findOne ( ID extends java . io . Serializable ) { return restClient . getForObject ( entityInformation , id ) ; }
org . junit . Assert . assertNull ( personRepository . findOne ( this . person . getId ( ) ) )
testExecution ( ) { final int sampleSize = 3 ; org . qcri . rheem . spark . channels . RddChannel . Instance input = this . createRddChannelInstance ( java . util . Arrays . asList ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) ) ; org . qcri . rheem . java . channels . CollectionChannel . Instance output = this . createCollectionChannelInstance ( ) ; org . qcri . rheem . spark . operators . SparkRandomPartitionSampleOperator < java . lang . Integer > sampleOperator = new org . qcri . rheem . spark . operators . SparkRandomPartitionSampleOperator ( ( iterationNumber ) -> sampleSize , org . qcri . rheem . core . types . DataSetType . createDefaultUnchecked ( org . qcri . rheem . spark . operators . Integer . class ) , ( iterationNumber ) -> 42L ) ; final org . qcri . rheem . core . platform . ChannelInstance [ ] inputs = new org . qcri . rheem . core . platform . ChannelInstance [ ] { input } ; final org . qcri . rheem . core . platform . ChannelInstance [ ] outputs = new org . qcri . rheem . core . platform . ChannelInstance [ ] { output } ; this . evaluate ( sampleOperator , inputs , outputs ) ; final java . util . List < java . lang . Integer > result = org . qcri . rheem . core . util . RheemCollections . asList ( output . provideCollection ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . entries . size ( ) ; }
org . junit . Assert . assertEquals ( sampleSize , result . size ( ) )
shouldAllowDefaultCharsetToBeSet ( ) { org . apache . ibatis . io . Resources . setCharset ( java . nio . charset . Charset . defaultCharset ( ) ) ; "<AssertPlaceHolder>" ; } getCharset ( ) { return org . apache . ibatis . io . Resources . charset ; }
org . junit . Assert . assertEquals ( java . nio . charset . Charset . defaultCharset ( ) , org . apache . ibatis . io . Resources . getCharset ( ) )
testFindFirstWithoutTypeNoMatch ( ) { final com . allanbank . mongodb . bson . element . BinaryElement element = new com . allanbank . mongodb . bson . element . BinaryElement ( "foo" , ( ( byte ) ( 1 ) ) , new byte [ ] { 1 , 2 , 3 } ) ; final com . allanbank . mongodb . bson . Element found = element . findFirst ( "anything" ) ; "<AssertPlaceHolder>" ; } findFirst ( java . lang . String [ ] ) { return findFirst ( com . allanbank . mongodb . bson . element . AbstractElement . ELEMENT_TYPE , nameRegexs ) ; }
org . junit . Assert . assertNull ( found )
testValidateInterpolate3 ( ) { org . orbisgis . legend . analyzer . symbolizers . PointSymbolizerAnalyzer psa = new org . orbisgis . legend . analyzer . symbolizers . PointSymbolizerAnalyzer ( new org . orbisgis . coremap . renderer . se . PointSymbolizer ( ) ) ; org . orbisgis . legend . analyzer . Interpolate2Real ir = new org . orbisgis . legend . analyzer . Interpolate2Real ( new org . orbisgis . legend . analyzer . RealLiteral ( 0 ) ) ; org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ip = new org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ( ) ; ip . setData ( 0 ) ; ip . setValue ( new org . orbisgis . legend . analyzer . RealLiteral ( 0 ) ) ; ir . addInterpolationPoint ( ip ) ; org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ip2 = new org . orbisgis . coremap . renderer . se . parameter . InterpolationPoint < org . orbisgis . legend . analyzer . RealParameter > ( ) ; ip2 . setData ( 1 ) ; ip2 . setValue ( new org . orbisgis . legend . analyzer . RealLiteral ( 1 ) ) ; ir . addInterpolationPoint ( ip2 ) ; org . orbisgis . legend . analyzer . RealFunction rf = new org . orbisgis . legend . analyzer . RealFunction ( RealFunction . Operators . LOG ) ; try { rf . addOperand ( new org . orbisgis . legend . analyzer . RealAttribute ( ) ) ; } catch ( org . orbisgis . coremap . renderer . se . parameter . ParameterException pe ) { throw new java . lang . IllegalStateException ( ( "We've<sp>just<sp>failed<sp>at<sp>giving" + "an<sp>operand<sp>to<sp>a<sp>log.<sp>Something<sp>must<sp>be<sp>going<sp>REALLY<sp>wrong..." ) , pe ) ; } ir . setLookupValue ( rf ) ; "<AssertPlaceHolder>" ; } validateInterpolateForProportionalPoint ( org . orbisgis . coremap . renderer . se . parameter . real . RealParameter ) { if ( rp instanceof org . orbisgis . coremap . renderer . se . parameter . real . Interpolate2Real ) { org . orbisgis . coremap . renderer . se . parameter . real . RealParameter look = ( ( org . orbisgis . coremap . renderer . se . parameter . real . Interpolate2Real ) ( rp ) ) . getLookupValue ( ) ; if ( look instanceof org . orbisgis . coremap . renderer . se . parameter . real . RealFunction ) { org . orbisgis . coremap . renderer . se . parameter . real . RealFunction rf = ( ( org . orbisgis . coremap . renderer . se . parameter . real . RealFunction ) ( look ) ) ; java . util . List < org . orbisgis . coremap . renderer . se . parameter . real . RealParameter > ops = rf . getOperands ( ) ; if ( ( ( ( ! ( ops . isEmpty ( ) ) ) && ( rf . getOperator ( ) . equals ( RealFunction . Operators . SQRT ) ) ) && ( ( ops . size ( ) ) == 1 ) ) && ( ( ops . get ( 0 ) ) instanceof org . orbisgis . coremap . renderer . se . parameter . real . RealAttribute ) ) { return true ; } } } return false ; }
org . junit . Assert . assertFalse ( psa . validateInterpolateForProportionalPoint ( ir ) )
isJSONValidTrue ( ) { final java . lang . String json = "{\"id\":12345,\"name\":\"The<sp>name\"}" ; final boolean expected = true ; final boolean result = org . sentilo . web . catalog . utils . CatalogUtils . isJSONValid ( json ) ; "<AssertPlaceHolder>" ; } isJSONValid ( java . lang . String ) { final com . fasterxml . jackson . databind . ObjectMapper mapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; try { mapper . readTree ( value ) ; return true ; } catch ( final java . lang . Exception e ) { return false ; } }
org . junit . Assert . assertEquals ( expected , result )
shouldGetConnectionWithCredentials ( ) { when ( xaDataSource . getXAConnection ( eq ( "testName" ) , eq ( "testPass" ) ) ) . thenReturn ( xaConnection ) ; com . arjuna . ats . internal . jdbc . ProvidedXADataSourceConnection connection = new com . arjuna . ats . internal . jdbc . ProvidedXADataSourceConnection ( "testDb" , "testName" , "testPass" , xaDataSource , connectionImple ) ; "<AssertPlaceHolder>" ; verify ( xaDataSource ) . getXAConnection ( eq ( "testName" ) , eq ( "testPass" ) ) ; } getConnection ( ) { org . jboss . narayana . blacktie . jatmibroker . xatmi . impl . ConnectionImpl connection = org . jboss . narayana . blacktie . jatmibroker . xatmi . ConnectionFactory . connections . get ( ) ; if ( connection == null ) { connection = new org . jboss . narayana . blacktie . jatmibroker . xatmi . impl . ConnectionImpl ( this , properties ) ; org . jboss . narayana . blacktie . jatmibroker . xatmi . ConnectionFactory . connections . set ( connection ) ; org . jboss . narayana . blacktie . jatmibroker . xatmi . ConnectionFactory . log . debug ( ( "Returning<sp>connection:<sp>" + connection ) ) ; } return connection ; }
org . junit . Assert . assertEquals ( xaConnection , connection . getConnection ( ) )
testRoleAuthorizationPolicyNoBoundLogicalRoles ( ) { loginAsSysTenantAdmin ( ) ; org . pentaho . platform . api . mt . ITenant tenantAcme = tenantManager . createTenant ( systemTenant , org . pentaho . platform . repository2 . unified . TENANT_ID_ACME , tenantAdminRoleName , tenantAuthenticatedRoleName , org . pentaho . platform . repository2 . unified . ANONYMOUS_ROLE_NAME ) ; userRoleDao . createUser ( tenantAcme , org . pentaho . platform . repository2 . unified . USERNAME_ADMIN , org . pentaho . platform . repository2 . unified . PASSWORD , "" , new java . lang . String [ ] { tenantAdminRoleName } ) ; login ( org . pentaho . platform . repository2 . unified . USERNAME_ADMIN , tenantAcme , new java . lang . String [ ] { tenantAdminRoleName , tenantAuthenticatedRoleName } ) ; java . util . List < java . lang . String > list = roleBindingDao . getBoundLogicalRoleNames ( java . util . Arrays . asList ( org . pentaho . platform . repository2 . unified . AUTHENTICATED_ROLE_NAME , "ceo" ) ) ; "<AssertPlaceHolder>" ; findInList ( RepositoryReadAction . NAME , list ) ; findInList ( SchedulerAction . NAME , list ) ; findInList ( RepositoryCreateAction . NAME , list ) ; } size ( ) { return getRecurrences ( ) . size ( ) ; }
org . junit . Assert . assertEquals ( 3 , list . size ( ) )
getProcessID ( ) { "<AssertPlaceHolder>" ; } getApplicationId ( ) { if ( null == ( io . sniffy . util . IOUtil . applicationId ) ) { synchronized ( io . sniffy . util . IOUtil . class ) { if ( null == ( io . sniffy . util . IOUtil . applicationId ) ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; java . lang . String mainClassName = java . lang . System . getProperty ( io . sniffy . util . IOUtil . MAIN_CLASS_PROPERTY_NAME ) ; if ( null == mainClassName ) { mainClassName = "SniffyApplication" ; } else { if ( mainClassName . contains ( "<sp>" ) ) { mainClassName = mainClassName . substring ( 0 , mainClassName . indexOf ( "<sp>" ) ) ; } if ( mainClassName . contains ( "/" ) ) { mainClassName = mainClassName . substring ( mainClassName . lastIndexOf ( "/" ) ) ; } if ( mainClassName . contains ( "\\" ) ) { mainClassName = mainClassName . substring ( mainClassName . lastIndexOf ( "\\" ) ) ; } } sb . append ( mainClassName ) . append ( '.' ) ; java . lang . String workingDir = java . lang . System . getProperty ( io . sniffy . util . IOUtil . WORKING_DIRECTORY_PROPERTY_NAME ) ; java . lang . String classPath = java . lang . System . getProperty ( io . sniffy . util . IOUtil . JAVA_CLASS_PATH_PROPERTY_NAME ) ; int hashCode = ( workingDir != null ) ? workingDir . hashCode ( ) : 0 ; hashCode = ( 31 * hashCode ) + ( classPath != null ? classPath . hashCode ( ) : 0 ) ; sb . append ( java . lang . Integer . toString ( hashCode ) ) ; io . sniffy . util . IOUtil . applicationId = sb . toString ( ) ; } } } return io . sniffy . util . IOUtil . applicationId ; }
org . junit . Assert . assertNotNull ( io . sniffy . util . IOUtil . getApplicationId ( ) )
getAttributeAsIntList_should_allow_int_list ( ) { au . edu . wehi . idsv . IdsvVariantContextTest . TestIdsvVariantContext vc = new au . edu . wehi . idsv . IdsvVariantContextTest . TestIdsvVariantContext ( minimalVariant ( ) . attribute ( "intlist" , L ( 1 , 2 ) ) . make ( ) ) ; "<AssertPlaceHolder>" ; } getAttributeAsIntList ( java . lang . String ) { return au . edu . wehi . idsv . AttributeConverter . asIntList ( getAttribute ( attrName ) ) ; }
org . junit . Assert . assertEquals ( 2 , vc . getAttributeAsIntList ( "intlist" ) . size ( ) )
invalidRepresentationTest ( ) { org . apache . cxf . ws . transfer . validationtransformation . XSDResourceValidator validator = new org . apache . cxf . ws . transfer . validationtransformation . XSDResourceValidator ( new javax . xml . transform . stream . StreamSource ( getClass ( ) . getResourceAsStream ( "/xml/xsdresourcevalidator/schema.xsd" ) ) ) ; boolean result = validator . validate ( loadRepresentation ( getClass ( ) . getResourceAsStream ( "/xml/xsdresourcevalidator/invalidRepresentation.xml" ) ) , null ) ; "<AssertPlaceHolder>" ; } getResourceAsStream ( java . lang . String ) { return org . apache . cxf . tools . wsdlto . WSDLToJavaContainer . class . getResourceAsStream ( file ) ; }
org . junit . Assert . assertFalse ( result )
testEnviarAsientoRegistral ( ) { es . ieci . tecdoc . fwktd . sir . core . vo . AsientoRegistralFormVO asientoForm = new es . ieci . tecdoc . fwktd . sir . core . vo . AsientoRegistralFormVO ( ) ; asientoForm . setCodigoEntidadRegistral ( "O00002061" ) ; asientoForm . setCodigoEntidadRegistralOrigen ( "O00002061" ) ; asientoForm . setDescripcionEntidadRegistralOrigen ( "REGISTRO<sp>GENERAL<sp>DE<sp>LA<sp>DIPUTACIN<sp>PROVINCIAL<sp>DE<sp>SORIA" ) ; asientoForm . setCodigoUnidadTramitacionOrigen ( "L01390232" ) ; asientoForm . setDescripcionUnidadTramitacionOrigen ( "O00002061_13_00002078_01_0002.xsig" 0 ) ; asientoForm . setNumeroRegistro ( "O00002061_13_00002078_01_0002.xsig" 2 ) ; asientoForm . setFechaRegistro ( new java . util . Date ( ) ) ; asientoForm . setCodigoEntidadRegistralDestino ( "O00002061_13_00002078_01_0002.xsig" 3 ) ; asientoForm . setDescripcionEntidadRegistralDestino ( "MUTUALIDAD<sp>GENERAL<sp>DE<sp>FUNCIONARIOS<sp>CIVILES<sp>DEL<sp>ESTADO<sp>(MUFACE)" ) ; asientoForm . setCodigoUnidadTramitacionDestino ( "O00002061_13_00002078_01_0002.xsig" 7 ) ; asientoForm . setDescripcionUnidadTramitacionDestino ( "MUTUALIDAD<sp>GENERAL<sp>DE<sp>FUNCIONARIOS<sp>CIVILES<sp>DEL<sp>ESTADO<sp>(MUFACE)" ) ; asientoForm . setResumen ( "O00002061_13_00002078_01_0002.xsig" 1 ) ; es . ieci . tecdoc . fwktd . sir . core . vo . AnexoFormVO anexoForm = new es . ieci . tecdoc . fwktd . sir . core . vo . AnexoFormVO ( ) ; anexoForm . setNombreFichero ( "O00002061_13_00002078_01_0002.xsig" 5 ) ; anexoForm . setCodigoFichero ( "O00002061_13_00002078_01_0001.pdf" ) ; anexoForm . setTipoDocumento ( TipoDocumentoEnum . DOCUMENTO_ADJUNTO ) ; anexoForm . setTipoMIME ( "application/pdf" ) ; anexoForm . setContenido ( "Contenido<sp>del<sp>anexo" . getBytes ( ) ) ; asientoForm . getAnexos ( ) . add ( anexoForm ) ; anexoForm = new es . ieci . tecdoc . fwktd . sir . core . vo . AnexoFormVO ( ) ; anexoForm . setNombreFichero ( "img_1359536569935.xsig" ) ; anexoForm . setCodigoFichero ( "O00002061_13_00002078_01_0002.xsig" ) ; anexoForm . setTipoDocumento ( TipoDocumentoEnum . FICHERO_TECNICO_INTERNO ) ; anexoForm . setCertificado ( org . apache . commons . codec . binary . Base64 . decodeBase64 ( "O00002061_13_00002078_01_0002.xsig" 8 ) ) ; anexoForm . setCodigoFicheroFirmado ( "O00002061_13_00002078_01_0001.pdf" ) ; anexoForm . setContenido ( "Contenido<sp>del<sp>anexo" . getBytes ( ) ) ; asientoForm . getAnexos ( ) . add ( anexoForm ) ; anexoForm = new es . ieci . tecdoc . fwktd . sir . core . vo . AnexoFormVO ( ) ; anexoForm . setNombreFichero ( "img_1359536569935_LOC.pdf" ) ; anexoForm . setCodigoFichero ( "O00002061_13_00002078_01_0002.xsig" 4 ) ; anexoForm . setTipoDocumento ( TipoDocumentoEnum . DOCUMENTO_ADJUNTO ) ; anexoForm . setTipoMIME ( "application/pdf" ) ; anexoForm . setContenido ( "Contenido<sp>del<sp>anexo" . getBytes ( ) ) ; asientoForm . getAnexos ( ) . add ( anexoForm ) ; asientoForm . setTipoRegistro ( TipoRegistroEnum . ENTRADA ) ; asientoForm . setDocumentacionFisica ( DocumentacionFisicaEnum . SIN_DOCUMENTACION_FISICA ) ; asientoForm . setIndicadorPrueba ( IndicadorPruebaEnum . PRUEBA ) ; asientoForm . setCodigoEntidadRegistralInicio ( asientoForm . getCodigoEntidadRegistralOrigen ( ) ) ; asientoForm . setDescripcionEntidadRegistralInicio ( asientoForm . getDescripcionEntidadRegistralOrigen ( ) ) ; es . ieci . tecdoc . fwktd . sir . core . vo . AsientoRegistralVO asiento = getServicioIntercambioRegistral ( ) . enviarAsientoRegistral ( asientoForm ) ; "<AssertPlaceHolder>" ; } enviarAsientoRegistral ( es . ieci . tecdoc . fwktd . sir . ws . service . AsientoRegistralFormDTO ) { return es . ieci . tecdoc . fwktd . sir . ws . manager . impl . IntercambioRegistralManagerImpl . getAsientoRegistralDTO ( getServicioIntercambioRegistral ( ) . enviarAsientoRegistral ( es . ieci . tecdoc . fwktd . sir . ws . manager . impl . IntercambioRegistralManagerImpl . getAsientoRegistralFormVO ( asientoForm ) ) ) ; }
org . junit . Assert . assertNotNull ( asiento )
testBuildWithOrderBy ( ) { org . lnu . is . domain . degree . Degree context = new org . lnu . is . domain . degree . Degree ( ) ; org . lnu . is . pagination . OrderBy orderBy1 = new org . lnu . is . pagination . OrderBy ( "person" , org . lnu . is . pagination . OrderByType . ASC ) ; org . lnu . is . pagination . OrderBy orderBy2 = new org . lnu . is . pagination . OrderBy ( "degreeType" , org . lnu . is . pagination . OrderByType . DESC ) ; java . util . List < org . lnu . is . pagination . OrderBy > orders = java . util . Arrays . asList ( orderBy1 , orderBy2 ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Degree<sp>e<sp>WHERE<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>ORDER<sp>BY<sp>e.person<sp>ASC,<sp>e.degreeType<sp>DESC" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . degree . Degree > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; pagedSearch . setOrders ( orders ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setOrders ( java . util . List ) { this . orders = orders ; }
org . junit . Assert . assertEquals ( expectedQuery , actualQuery )
givenUsingJava5_whenConvertingAnInputStreamToAString_thenCorrect ( ) { java . lang . String originalString = org . apache . commons . lang3 . RandomStringUtils . randomAlphabetic ( 8 ) ; com . github . mysite . common . guava . InputStream inputStream = new com . github . mysite . common . guava . ByteArrayInputStream ( originalString . getBytes ( ) ) ; java . lang . StringBuilder textBuilder = new java . lang . StringBuilder ( ) ; try ( com . github . mysite . common . guava . Reader reader = new com . github . mysite . common . guava . BufferedReader ( new com . github . mysite . common . guava . InputStreamReader ( inputStream , java . nio . charset . Charset . forName ( StandardCharsets . UTF_8 . name ( ) ) ) ) ) { int c = 0 ; while ( ( c = reader . read ( ) ) != ( - 1 ) ) { textBuilder . append ( ( ( char ) ( c ) ) ) ; } } "<AssertPlaceHolder>" ; } toString ( ) { return com . google . common . base . MoreObjects . toStringHelper ( this ) . omitNullValues ( ) . add ( "maxCode" , maxCode ) . add ( "bussinessType" , bussinessType ) . toString ( ) ; }
org . junit . Assert . assertEquals ( textBuilder . toString ( ) , originalString )
shouldClearOldInfoWhenSetNew ( ) { collector . linesRemoved ( 10 ) ; collector . linesRemoved ( 10 ) ; collector . setInfo ( "qwe" ) ; "<AssertPlaceHolder>" ; } getMessage ( ) { return info . getMessage ( ) ; }
org . junit . Assert . assertEquals ( "qwe" , collector . getMessage ( ) )
copyTo ( ) { java . util . Random rand = new java . util . Random ( java . lang . System . currentTimeMillis ( ) ) ; int valuesWritten = 0 ; int dataLen = 0 ; org . exist . storage . io . VariableByteOutputStream os = new org . exist . storage . io . VariableByteOutputStream ( ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { int count = rand . nextInt ( 4095 ) ; os . writeShort ( ( ( short ) ( count ) ) ) ; dataLen += 2 ; for ( int j = 0 ; j < count ; j ++ ) { int next = rand . nextInt ( 255 ) ; os . writeShort ( ( ( short ) ( next ) ) ) ; valuesWritten ++ ; dataLen += 2 ; } } byte [ ] data = os . toByteArray ( ) ; int valuesCopied = 0 ; dataLen = 0 ; org . exist . storage . io . VariableByteArrayInput is = new org . exist . storage . io . VariableByteArrayInput ( data ) ; os = new org . exist . storage . io . VariableByteOutputStream ( ) ; while ( ( is . available ( ) ) > 0 ) { int count = is . readShort ( ) ; boolean skip = rand . nextBoolean ( ) ; if ( skip ) is . skip ( count ) ; else { os . writeShort ( count ) ; is . copyTo ( os , count ) ; valuesCopied += count ; dataLen += ( 2 * count ) + 2 ; } } data = os . toByteArray ( ) ; int valuesRead = 0 ; is = new org . exist . storage . io . VariableByteArrayInput ( data ) ; while ( ( is . available ( ) ) > 0 ) { int count = is . readShort ( ) ; for ( int i = 0 ; i < count ; i ++ ) { is . readShort ( ) ; valuesRead ++ ; } } "<AssertPlaceHolder>" ; } readShort ( ) { if ( ( position ) == ( end ) ) { throw new java . io . EOFException ( ) ; } byte b = data [ ( ( position ) ++ ) ] ; short i = ( ( short ) ( b & 127 ) ) ; for ( int shift = 7 ; ( b & 128 ) != 0 ; shift += 7 ) { if ( ( position ) == ( end ) ) { throw new java . io . EOFException ( ) ; } b = data [ ( ( position ) ++ ) ] ; i |= ( b & 127 ) << shift ; } return i ; }
org . junit . Assert . assertEquals ( valuesRead , valuesCopied )
manualNestedJexlNodeOrderEquality ( ) { org . apache . commons . jexl2 . parser . ASTJexlScript one = datawave . query . jexl . JexlASTHelper . parseJexlQuery ( "(FOO<sp>==<sp>'1'<sp>&&<sp>(BAR<sp>==<sp>'bar'<sp>||<sp>BAR<sp>==<sp>'baz'))" ) ; org . apache . commons . jexl2 . parser . JexlNode or = datawave . query . jexl . JexlNodeFactory . createNodeTreeFromFieldValues ( ContainerType . OR_NODE , new org . apache . commons . jexl2 . parser . ASTEQNode ( org . apache . commons . jexl2 . parser . ParserTreeConstants . JJTEQNODE ) , new org . apache . commons . jexl2 . parser . ASTEQNode ( org . apache . commons . jexl2 . parser . ParserTreeConstants . JJTEQNODE ) , "BAR" , com . google . common . collect . Lists . newArrayList ( "bar" , "baz" ) ) ; org . apache . commons . jexl2 . parser . JexlNode and = datawave . query . jexl . JexlNodeFactory . createAndNode ( com . google . common . collect . Lists . newArrayList ( datawave . query . jexl . JexlNodeFactory . buildEQNode ( "FOO" , "1" ) , or ) ) ; org . apache . commons . jexl2 . parser . ASTJexlScript two = datawave . query . jexl . JexlNodeFactory . createScript ( and ) ; "<AssertPlaceHolder>" ; } equals ( org . apache . commons . jexl2 . parser . JexlNode , org . apache . commons . jexl2 . parser . JexlNode ) { if ( one == two ) { return true ; } if ( ( null == one ) || ( null == two ) ) { return false ; } if ( ! ( one . getClass ( ) . equals ( two . getClass ( ) ) ) ) { return false ; } if ( ( one . jjtGetNumChildren ( ) ) != ( two . jjtGetNumChildren ( ) ) ) { return false ; } for ( int i = 0 ; i < ( one . jjtGetNumChildren ( ) ) ; i ++ ) { if ( ! ( datawave . query . jexl . JexlASTHelper . equals ( one . jjtGetChild ( i ) , two . jjtGetChild ( i ) ) ) ) { return false ; } } if ( one instanceof org . apache . commons . jexl2 . parser . ASTNumberLiteral ) { org . apache . commons . jexl2 . parser . ASTNumberLiteral oneLit = ( ( org . apache . commons . jexl2 . parser . ASTNumberLiteral ) ( one ) ) ; org . apache . commons . jexl2 . parser . ASTNumberLiteral twoLit = ( ( org . apache . commons . jexl2 . parser . ASTNumberLiteral ) ( two ) ) ; if ( ( ! ( oneLit . getLiteralClass ( ) . equals ( twoLit . getLiteralClass ( ) ) ) ) || ( ! ( oneLit . getLiteral ( ) . equals ( twoLit . getLiteral ( ) ) ) ) ) { return false ; } } else if ( one instanceof org . apache . commons . jexl2 . parser . JexlNode . Literal ) { org . apache . commons . jexl2 . parser . JexlNode . Literal < ? > oneLit = ( ( org . apache . commons . jexl2 . parser . JexlNode . Literal < ? > ) ( one ) ) ; org . apache . commons . jexl2 . parser . JexlNode . Literal < ? > twoLit = ( ( org . apache . commons . jexl2 . parser . JexlNode . Literal < ? > ) ( two ) ) ; if ( ! ( oneLit . getLiteral ( ) . equals ( twoLit . getLiteral ( ) ) ) ) { return false ; } } else if ( one instanceof org . apache . commons . jexl2 . parser . ASTIdentifier ) { if ( ! ( one . image . equals ( two . image ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertTrue ( datawave . query . jexl . JexlASTHelper . equals ( one , two ) )
testEqualsSelf ( ) { org . jfree . data . time . TimeSeriesDataItem item = new org . jfree . data . time . TimeSeriesDataItem ( new org . jfree . data . time . Day ( 23 , 9 , 2001 ) , 99.7 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( o instanceof com . mysql . fabric . Server ) ) { return false ; } com . mysql . fabric . Server s = ( ( com . mysql . fabric . Server ) ( o ) ) ; return s . getUuid ( ) . equals ( getUuid ( ) ) ; }
org . junit . Assert . assertTrue ( item . equals ( item ) )
testGetEventsWithStartOffsetAndCountWithNothingAuthorized ( ) { final org . apache . nifi . provenance . RepositoryConfiguration config = createConfig ( ) ; final org . apache . nifi . provenance . store . PartitionedWriteAheadEventStore store = new org . apache . nifi . provenance . store . PartitionedWriteAheadEventStore ( config , org . apache . nifi . provenance . store . TestPartitionedWriteAheadEventStore . writerFactory , org . apache . nifi . provenance . store . TestPartitionedWriteAheadEventStore . readerFactory , org . apache . nifi . events . EventReporter . NO_OP , new org . apache . nifi . provenance . store . EventFileManager ( ) ) ; store . initialize ( ) ; final int numEvents = 20 ; final java . util . List < org . apache . nifi . provenance . ProvenanceEventRecord > events = new java . util . ArrayList ( numEvents ) ; for ( int i = 0 ; i < numEvents ; i ++ ) { final org . apache . nifi . provenance . ProvenanceEventRecord event = createEvent ( ) ; store . addEvents ( java . util . Collections . singleton ( event ) ) ; events . add ( event ) ; } final org . apache . nifi . provenance . authorization . EventAuthorizer allowEventNumberedEventIds = org . apache . nifi . provenance . authorization . EventAuthorizer . DENY_ALL ; final java . util . List < org . apache . nifi . provenance . ProvenanceEventRecord > storedEvents = store . getEvents ( 0 , 20 , allowEventNumberedEventIds , EventTransformer . EMPTY_TRANSFORMER ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { for ( final java . util . Map < java . lang . String , java . lang . String > map : maps ) { if ( ! ( map . isEmpty ( ) ) ) { return false ; } } return registry . getVariableMap ( ) . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( storedEvents . isEmpty ( ) )
testCreateCustomDdl ( ) { org . finra . herd . model . api . xml . CustomDdlCreateRequest request = customDdlServiceTestHelper . createCustomDdlCreateRequest ( org . finra . herd . rest . NAMESPACE , org . finra . herd . rest . BDEF_NAME , org . finra . herd . rest . FORMAT_USAGE_CODE , org . finra . herd . rest . FORMAT_FILE_TYPE_CODE , org . finra . herd . rest . FORMAT_VERSION , org . finra . herd . rest . CUSTOM_DDL_NAME , org . finra . herd . rest . TEST_DDL ) ; org . finra . herd . model . api . xml . CustomDdl customDdl = new org . finra . herd . model . api . xml . CustomDdl ( ID , new org . finra . herd . model . api . xml . CustomDdlKey ( NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , FORMAT_FILE_TYPE_CODE , FORMAT_VERSION , CUSTOM_DDL_NAME ) , TEST_DDL ) ; when ( customDdlService . createCustomDdl ( request ) ) . thenReturn ( customDdl ) ; org . finra . herd . model . api . xml . CustomDdl resultCustomDdl = customDdlRestController . createCustomDdl ( request ) ; customDdlServiceTestHelper . validateCustomDdl ( null , org . finra . herd . rest . NAMESPACE , org . finra . herd . rest . BDEF_NAME , org . finra . herd . rest . FORMAT_USAGE_CODE , org . finra . herd . rest . FORMAT_FILE_TYPE_CODE , org . finra . herd . rest . FORMAT_VERSION , org . finra . herd . rest . CUSTOM_DDL_NAME , org . finra . herd . rest . TEST_DDL , resultCustomDdl ) ; verify ( customDdlService ) . createCustomDdl ( request ) ; verifyNoMoreInteractions ( customDdlService ) ; "<AssertPlaceHolder>" ; } createCustomDdl ( org . finra . herd . model . api . xml . CustomDdlCreateRequest ) { customDdlHelper . validateCustomDdlKey ( request . getCustomDdlKey ( ) ) ; org . springframework . util . Assert . hasText ( request . getDdl ( ) , "DDL<sp>must<sp>be<sp>specified." ) ; request . setDdl ( request . getDdl ( ) . trim ( ) ) ; org . finra . herd . model . jpa . BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoHelper . getBusinessObjectFormatEntity ( new org . finra . herd . model . api . xml . BusinessObjectFormatKey ( request . getCustomDdlKey ( ) . getNamespace ( ) , request . getCustomDdlKey ( ) . getBusinessObjectDefinitionName ( ) , request . getCustomDdlKey ( ) . getBusinessObjectFormatUsage ( ) , request . getCustomDdlKey ( ) . getBusinessObjectFormatFileType ( ) , request . getCustomDdlKey ( ) . getBusinessObjectFormatVersion ( ) ) ) ; org . finra . herd . model . jpa . CustomDdlEntity customDdlEntity = customDdlDao . getCustomDdlByKey ( request . getCustomDdlKey ( ) ) ; if ( customDdlEntity != null ) { throw new org . finra . herd . model . AlreadyExistsException ( java . lang . String . format ( "Unable<sp>to<sp>create<sp>custom<sp>DDL<sp>with<sp>name<sp>\"%s\"<sp>because<sp>it<sp>already<sp>exists<sp>for<sp>the<sp>business<sp>object<sp>format<sp>{%s}." , request . getCustomDdlKey ( ) . getCustomDdlName ( ) , businessObjectFormatHelper . businessObjectFormatEntityAltKeyToString ( businessObjectFormatEntity ) ) ) ; } customDdlEntity = createCustomDdlEntity ( businessObjectFormatEntity , request ) ; customDdlEntity = customDdlDao . saveAndRefresh ( customDdlEntity ) ; return createCustomDdlFromEntity ( customDdlEntity ) ; }
org . junit . Assert . assertEquals ( customDdl , resultCustomDdl )
testSparkMetrics ( ) { io . cdap . cdap . test . ApplicationManager applicationManager = deployApplication ( io . cdap . cdap . spark . metrics . TestSparkMetricsIntegrationApp . class ) ; io . cdap . cdap . test . SparkManager sparkManager = applicationManager . getSparkManager ( TestSparkMetricsIntegrationApp . APP_SPARK_NAME ) . start ( ) ; sparkManager . waitForRun ( ProgramRunStatus . COMPLETED , 120 , TimeUnit . SECONDS ) ; java . util . List < io . cdap . cdap . proto . RunRecord > history = sparkManager . getHistory ( ProgramRunStatus . COMPLETED ) ; "<AssertPlaceHolder>" ; io . cdap . cdap . common . utils . Tasks . waitFor ( true , new java . util . concurrent . Callable < java . lang . Boolean > ( ) { @ io . cdap . cdap . spark . metrics . Override public io . cdap . cdap . spark . metrics . Boolean call ( ) throws io . cdap . cdap . spark . metrics . Exception { return ( getSparkMetric ( TestSparkMetricsIntegrationApp . APP_NAME , TestSparkMetricsIntegrationApp . APP_SPARK_NAME , "system.driver.BlockManager.memory.remainingMem_MB" ) ) > 0 ; } } , 10 , TimeUnit . SECONDS , 100 , TimeUnit . MILLISECONDS ) ; io . cdap . cdap . common . utils . Tasks . waitFor ( 2L , new java . util . concurrent . Callable < java . lang . Long > ( ) { @ io . cdap . cdap . spark . metrics . Override public io . cdap . cdap . spark . metrics . Long call ( ) throws io . cdap . cdap . spark . metrics . Exception { return getSparkMetric ( TestSparkMetricsIntegrationApp . APP_NAME , TestSparkMetricsIntegrationApp . APP_SPARK_NAME , "user.more.than.30" ) ; } } , 10 , TimeUnit . SECONDS , 100 , TimeUnit . MILLISECONDS ) ; } size ( ) { return instantiatorInfoMap . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , history . size ( ) )
testXBeeDiscoveryStatusStaticAccess ( ) { for ( com . digi . xbee . api . models . XBeeDiscoveryStatus status : com . digi . xbee . api . models . XBeeDiscoveryStatusTest . discoveryStatusValues ) "<AssertPlaceHolder>" ; } get ( int ) { com . digi . xbee . api . models . XBeeDiscoveryStatus status = com . digi . xbee . api . models . XBeeDiscoveryStatus . lookupTable . get ( id ) ; if ( status != null ) return status ; return com . digi . xbee . api . models . XBeeDiscoveryStatus . DISCOVERY_STATUS_UNKNOWN ; }
org . junit . Assert . assertEquals ( status , com . digi . xbee . api . models . XBeeDiscoveryStatus . get ( status . getId ( ) ) )
hasEffectWithArguments ( ) { edu . illinois . library . cantaloupe . image . Dimension fullSize = new edu . illinois . library . cantaloupe . image . Dimension ( 600 , 400 ) ; edu . illinois . library . cantaloupe . operation . OperationList opList = new edu . illinois . library . cantaloupe . operation . OperationList ( new edu . illinois . library . cantaloupe . operation . CropByPixels ( 0 , 0 , 300 , 200 ) ) ; "<AssertPlaceHolder>" ; } hasEffect ( edu . illinois . library . cantaloupe . image . Dimension , edu . illinois . library . cantaloupe . operation . OperationList ) { return hasEffect ( ) ; }
org . junit . Assert . assertTrue ( instance . hasEffect ( fullSize , opList ) )
invokeSigningForCustomContainer ( ) { org . digidoc4j . ContainerBuilder . setContainerImplementation ( "TEST-FORMAT" , org . digidoc4j . test . CustomContainer . class ) ; org . digidoc4j . SignatureBuilder . setSignatureBuilderForContainerType ( "TEST-FORMAT" , org . digidoc4j . test . MockSignatureBuilder . class ) ; org . digidoc4j . Container container = org . digidoc4j . test . util . TestDataBuilderUtil . createContainerWithFile ( this . testFolder , "TEST-FORMAT" ) ; org . digidoc4j . Signature signature = org . digidoc4j . SignatureBuilder . aSignature ( container ) . withSignatureToken ( this . pkcs12SignatureToken ) . invokeSigning ( ) ; "<AssertPlaceHolder>" ; } invokeSigning ( ) { if ( ( signatureToken ) == null ) { org . digidoc4j . DetachedXadesSignatureBuilder . logger . error ( "Cannot<sp>invoke<sp>signing<sp>without<sp>signature<sp>token.<sp>Add<sp>'withSignatureToken()'<sp>method<sp>call<sp>or<sp>call<sp>'buildDataToSign()<sp>instead.'" ) ; throw new org . digidoc4j . exceptions . SignatureTokenMissingException ( ) ; } return invokeSigningProcess ( ) ; }
org . junit . Assert . assertNotNull ( signature )
testMetEnkelePersoonSynchrPers ( ) { final nl . bzk . brp . domain . leveringmodel . persoon . Persoonslijst persoon = maakPersoon ( 1 , 20160906 ) ; final nl . bzk . brp . service . algemeen . BepaalGeleverdePersonenService . Resultaat resultaat = service . bepaal ( SoortDienst . SYNCHRONISATIE_PERSOON , 1 , singletonList ( persoon ) , null ) ; "<AssertPlaceHolder>" ; } getDatumAanvangMaterielePeriodeResultaat ( ) { return datumAanvangMaterielePeriodeResultaat ; }
org . junit . Assert . assertThat ( resultaat . getDatumAanvangMaterielePeriodeResultaat ( ) , org . hamcrest . core . Is . is ( 20160906 ) )