input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testShutdownRequestException ( ) { final java . net . ServerSocket server = new java . net . ServerSocket ( ) ; server . bind ( null ) ; final com . spotify . folsom . guava . HostAndPort address = com . spotify . folsom . guava . HostAndPort . fromParts ( "127.0.0.1" , server . getLocalPort ( ) ) ; com . spotify . folsom . RawMemcacheClient rawClient = com . spotify . folsom . client . DefaultRawMemcacheClient . connect ( address , 1 , com . spotify . folsom . client . DefaultRawMemcacheClientTest . BATCH_SIZE , false , null , 1000 , Charsets . UTF_8 , new com . spotify . folsom . client . NoopMetrics ( ) , ( 1024 * 1024 ) , null , null ) . toCompletableFuture ( ) . get ( ) ; rawClient . shutdown ( ) ; rawClient . awaitDisconnected ( 10 , TimeUnit . SECONDS ) ; "<AssertPlaceHolder>" ; try { rawClient . send ( new com . spotify . folsom . client . ascii . GetRequest ( "key" . getBytes ( Charsets . UTF_8 ) , false ) ) . toCompletableFuture ( ) . get ( ) ; } catch ( java . util . concurrent . ExecutionException e ) { throw e . getCause ( ) ; } } isConnected ( ) { return ( disconnectReason . get ( ) ) == null ; }
org . junit . Assert . assertFalse ( rawClient . isConnected ( ) )
testGetType ( ) { classUnderTest = new net . sourceforge . squirrel_sql . client . update . gui . installer . event . InstallStatusEvent ( net . sourceforge . squirrel_sql . client . update . gui . installer . event . InstallEventType . BACKUP_COMPLETE ) ; "<AssertPlaceHolder>" ; } getType ( ) { return _type ; }
org . junit . Assert . assertEquals ( net . sourceforge . squirrel_sql . client . update . gui . installer . event . InstallEventType . BACKUP_COMPLETE , classUnderTest . getType ( ) )
testOskariJSONParsing ( ) { fi . nls . oskari . domain . map . userlayer . UserLayerStyle style = getStyle ( ) ; org . json . JSONObject json = style . parseUserLayerStyleToOskariJSON ( ) ; fi . nls . oskari . domain . map . userlayer . UserLayerStyle style2 = new fi . nls . oskari . domain . map . userlayer . UserLayerStyle ( ) ; try { style2 . populateFromOskariJSON ( json ) ; } catch ( org . json . JSONException e ) { e . printStackTrace ( ) ; } "<AssertPlaceHolder>" ; } isEqual ( org . json . JSONObject , org . json . JSONObject ) { if ( ( jsonObject1 == null ) || ( ( org . json . JSONObject . getNames ( jsonObject1 ) ) == null ) ) { return ( jsonObject2 == null ) || ( ( org . json . JSONObject . getNames ( jsonObject2 ) ) == null ) ; } else if ( ( jsonObject2 == null ) || ( ( org . json . JSONObject . getNames ( jsonObject2 ) ) == null ) ) { return false ; } final fi . nls . oskari . util . List < java . lang . String > objectProperties1 = fi . nls . oskari . util . Arrays . asList ( org . json . JSONObject . getNames ( jsonObject1 ) ) ; fi . nls . oskari . util . Collections . sort ( objectProperties1 ) ; final fi . nls . oskari . util . List < java . lang . String > objectProperties2 = fi . nls . oskari . util . Arrays . asList ( org . json . JSONObject . getNames ( jsonObject2 ) ) ; fi . nls . oskari . util . Collections . sort ( objectProperties2 ) ; if ( ! ( objectProperties1 . equals ( objectProperties2 ) ) ) { fi . nls . oskari . util . JSONHelper . log . debug ( "Object:\n" , objectProperties1 , "didn\'t<sp>have<sp>same<sp>properties<sp>as:\n" , objectProperties2 ) ; return false ; } try { for ( java . lang . String key : objectProperties1 ) { final java . lang . Object value1 = jsonObject1 . get ( key ) ; final java . lang . Object value2 = jsonObject2 . get ( key ) ; if ( value1 instanceof org . json . JSONObject ) { if ( ! ( value2 instanceof org . json . JSONObject ) ) { fi . nls . oskari . util . JSONHelper . log . debug ( value1 , "was<sp>a<sp>JSONObject<sp>unlike" , value2 ) ; return false ; } else if ( ! ( fi . nls . oskari . util . JSONHelper . isEqual ( ( ( org . json . JSONObject ) ( value1 ) ) , ( ( org . json . JSONObject ) ( value2 ) ) ) ) ) { fi . nls . oskari . util . JSONHelper . log . debug ( "JSONObject<sp>recursion<sp>was<sp>not<sp>equal" ) ; return false ; } } else if ( value1 instanceof org . json . JSONArray ) { if ( ! ( value2 instanceof org . json . JSONArray ) ) { fi . nls . oskari . util . JSONHelper . log . debug ( value1 , "was<sp>a<sp>JSONArray<sp>unlike" , value2 ) ; return false ; } if ( ! ( fi . nls . oskari . util . JSONHelper . isEqual ( ( ( org . json . JSONArray ) ( value1 ) ) , ( ( org . json . JSONArray ) ( value2 ) ) ) ) ) { fi . nls . oskari . util . JSONHelper . log . debug ( "JSONArrays<sp>were<sp>not<sp>equal" ) ; return false ; } } else if ( value1 == null ) { if ( value2 != null ) { fi . nls . oskari . util . JSONHelper . log . debug ( ( "value1<sp>was<sp><null>,<sp>but<sp>value2<sp>was:" + value2 ) ) ; return false ; } } else if ( ( value1 instanceof java . lang . Number ) && ( value2 instanceof java . lang . Number ) ) { double v1 = ( ( java . lang . Number ) ( value1 ) ) . doubleValue ( ) ; double v2 = ( ( java . lang . Number ) ( value2 ) ) . doubleValue ( ) ; if ( ( java . lang . Math . abs ( ( v1 - v2 ) ) ) > 1.0E-6 ) { fi . nls . oskari . util . JSONHelper . log . debug ( "Values<sp>were<sp>not<sp>equal:" , value1 , "!=" , value2 ) ; return false ; } } else if ( ! ( value1 . equals ( value2 ) ) ) { fi . nls . oskari . util . JSONHelper . log . debug ( "Values<sp>were<sp>not<sp>equal:" , value1 , "!=" , value2 ) ; return false ; } } } catch ( java . lang . Exception ex ) { fi . nls . oskari . util . JSONHelper . log . warn ( ex , "Error<sp>comparing<sp>JSONObjects" ) ; return false ; } return true ; }
org . junit . Assert . assertTrue ( fi . nls . oskari . util . JSONHelper . isEqual ( json , style2 . parseUserLayerStyleToOskariJSON ( ) ) )
shouldReturnOriginalValueIfInputIsAnEdge ( ) { final uk . gov . gchq . gaffer . data . element . Edge input = new uk . gov . gchq . gaffer . data . element . Edge ( "group" ) ; final uk . gov . gchq . gaffer . operation . function . FromElementId function = new uk . gov . gchq . gaffer . operation . function . FromElementId ( ) ; final java . lang . Object output = function . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . Object ) { if ( null == value ) { return null ; } if ( value instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( value ) ) . intValue ( ) ; } if ( value instanceof java . lang . String ) { return java . lang . Integer . valueOf ( ( ( java . lang . String ) ( value ) ) ) ; } throw new java . lang . IllegalArgumentException ( ( "Could<sp>not<sp>convert<sp>value<sp>to<sp>Integer:<sp>" + value ) ) ; }
org . junit . Assert . assertSame ( input , output )
testDescendantsCreatedSinceUntil ( ) { long start = java . lang . System . currentTimeMillis ( ) ; activity = createActivity ( ( "ActivityDescendantsCreatedSinceUntil-" + start ) ) ; java . util . List < com . ibm . sbt . services . client . connections . activities . ActivityNode > nodes = createActivityDescendants ( activity ) ; com . ibm . sbt . services . client . connections . activities . ActivityNode sinceNode = nodes . get ( 3 ) ; com . ibm . sbt . services . client . connections . activities . ActivityNode untilNode = nodes . get ( 1 ) ; java . util . Map < java . lang . String , java . lang . String > params = new java . util . HashMap < java . lang . String , java . lang . String > ( ) ; params . put ( "ActivityDescendantsCreatedSinceUntil-" 0 , ( "" + ( sinceNode . getPublished ( ) . getTime ( ) ) ) ) ; params . put ( "until" , ( "" + ( untilNode . getPublished ( ) . getTime ( ) ) ) ) ; params . put ( "rangeId" , "created" ) ; System . out . println ( ( "since=" + ( sinceNode . getPublished ( ) . getTime ( ) ) ) ) ; System . out . println ( ( "until=" + ( untilNode . getPublished ( ) . getTime ( ) ) ) ) ; com . ibm . sbt . services . client . base . datahandlers . EntityList < com . ibm . sbt . services . client . connections . activities . ActivityNode > activityNodes = activityService . getActivityDescendants ( activity . getActivityUuid ( ) , params ) ; System . out . println ( ( ( ( ( ( "Nodes:" + ( activityNodes . size ( ) ) ) + "<sp>created<sp>since:<sp>" ) + ( com . ibm . sbt . services . client . connections . activities . ActivityDescendantsSinceTest . dateFormat . format ( sinceNode . getPublished ( ) ) ) ) + "<sp>until:<sp>" ) + ( com . ibm . sbt . services . client . connections . activities . ActivityDescendantsSinceTest . dateFormat . format ( untilNode . getPublished ( ) ) ) ) ) ; dumpNodes ( activityNodes ) ; activity = null ; "<AssertPlaceHolder>" ; } size ( ) { return count ; }
org . junit . Assert . assertEquals ( 2 , activityNodes . size ( ) )
shouldExcludeEverythingIfExcludeRangeIsBiggerThanOriginal ( ) { java . util . HashSet < com . github . jgonian . ipmath . Ipv4Range > excludeRanges = new java . util . HashSet < com . github . jgonian . ipmath . Ipv4Range > ( ) ; excludeRanges . addAll ( java . util . Arrays . asList ( com . github . jgonian . ipmath . Ipv4Range . parse ( "0.0.0.0/30" ) ) ) ; final java . util . SortedSet < com . github . jgonian . ipmath . Ipv4Range > actual = com . github . jgonian . ipmath . PrefixUtils . PrefixUtils . excludeFromRangeAndSplitIntoPrefixes ( com . github . jgonian . ipmath . Ipv4Range . parse ( "0.0.0.0/31" ) , excludeRanges ) ; java . util . HashSet < com . github . jgonian . ipmath . Ipv4Range > expectedPrefixes = new java . util . HashSet < com . github . jgonian . ipmath . Ipv4Range > ( ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { int idx = range . indexOf ( com . github . jgonian . ipmath . DASH ) ; if ( idx != ( - 1 ) ) { com . github . jgonian . ipmath . Ipv4 start = com . github . jgonian . ipmath . Ipv4 . parse ( range . substring ( 0 , idx ) ) ; com . github . jgonian . ipmath . Ipv4 end = com . github . jgonian . ipmath . Ipv4 . parse ( range . substring ( ( idx + 1 ) , range . length ( ) ) ) ; return new com . github . jgonian . ipmath . Ipv4Range ( start , end ) ; } else { return com . github . jgonian . ipmath . Ipv4Range . parseCidr ( range ) ; } }
org . junit . Assert . assertEquals ( expectedPrefixes , actual )
scopeForV4Tokens ( ) { org . eclipse . emf . common . util . EList < com . github . jknack . antlr4ide . lang . V4Token > tokenList = new org . eclipse . emf . common . util . BasicEList < com . github . jknack . antlr4ide . lang . V4Token > ( ) ; com . github . jknack . antlr4ide . lang . V4Tokens tokens = createMock ( com . github . jknack . antlr4ide . lang . V4Tokens . class ) ; com . github . jknack . antlr4ide . lang . V4Token token = createMock ( com . github . jknack . antlr4ide . lang . V4Token . class ) ; expect ( tokens . getTokens ( ) ) . andReturn ( tokenList ) ; tokenList . add ( token ) ; java . lang . Object [ ] mocks = new java . lang . Object [ ] { tokens , token } ; replay ( mocks ) ; java . util . List < org . eclipse . emf . ecore . EObject > scopes = com . google . common . collect . Lists . newArrayList ( ) ; new com . github . jknack . antlr4ide . scoping . Antlr4ScopeProvider ( ) . scopeFor ( tokens , scopes , com . github . jknack . antlr4ide . lang . Rule . class ) ; "<AssertPlaceHolder>" ; verify ( mocks ) ; }
org . junit . Assert . assertEquals ( com . google . common . collect . Lists . newArrayList ( token ) , scopes )
testDataMap ( ) { java . lang . Object src = new java . lang . Object ( ) ; org . apache . cayenne . map . DataMap d = new org . apache . cayenne . map . DataMap ( "abc" ) ; org . apache . cayenne . configuration . event . DataMapEvent e = new org . apache . cayenne . configuration . event . DataMapEvent ( src , null ) ; e . setDataMap ( d ) ; "<AssertPlaceHolder>" ; } getDataMap ( ) { return null ; }
org . junit . Assert . assertSame ( d , e . getDataMap ( ) )
escapesInRawStringsArePreserved ( ) { io . burt . jmespath . Expression < java . lang . Object > expected = String ( "\\u03a6hello\\nworld\\t" ) ; io . burt . jmespath . Expression < java . lang . Object > actual = compile ( "\'\\u03a6hello\\nworld\\t\'" ) ; "<AssertPlaceHolder>" ; } compile ( java . lang . String ) { return runtime . compile ( str ) ; }
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) )
test_SoortDienstPlaatsingAfnemerIndicatie ( ) { final nl . bzk . brp . domain . algemeen . Autorisatiebundel autorisatiebundel = maakAutorisatiebundel ( SoortDienst . PLAATSING_AFNEMERINDICATIE ) ; final nl . bzk . brp . service . bevraging . gba . generiek . ZoekPersoonGeneriekGbaVerzoek verzoek = new nl . bzk . brp . service . bevraging . gba . generiek . ZoekPersoonGbaVerzoek ( ) ; verzoek . getGevraagdeRubrieken ( ) . add ( nl . bzk . brp . service . bevraging . gba . ValideerGbaAutorisatieServiceTest . BSN ) ; java . util . Set < nl . bzk . brp . domain . algemeen . Melding > meldingen = subject . valideer ( verzoek , autorisatiebundel ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( meldingen . isEmpty ( ) )
testCreateBusinessObjectDataStorageUnit ( ) { org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey = new org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitKey ( BDEF_NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , FORMAT_FILE_TYPE_CODE , FORMAT_VERSION , PARTITION_VALUE , SUBPARTITION_VALUES , DATA_VERSION , STORAGE_NAME ) ; org . finra . herd . model . api . xml . StorageDirectory storageDirectory = new org . finra . herd . model . api . xml . StorageDirectory ( STORAGE_DIRECTORY_PATH ) ; java . util . List < org . finra . herd . model . api . xml . StorageFile > storageFiles = java . util . Collections . singletonList ( new org . finra . herd . model . api . xml . StorageFile ( FILE_NAME , FILE_SIZE , ROW_COUNT ) ) ; org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitCreateRequest request = new org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitCreateRequest ( businessObjectDataStorageUnitKey , storageDirectory , storageFiles , DISCOVER_STORAGE_FILES ) ; org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitCreateResponse response = new org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitCreateResponse ( businessObjectDataStorageUnitKey , storageDirectory , storageFiles ) ; when ( businessObjectDataStorageUnitService . createBusinessObjectDataStorageUnit ( request ) ) . thenReturn ( response ) ; org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitCreateResponse result = businessObjectDataStorageUnitRestController . createBusinessObjectDataStorageUnit ( request ) ; verify ( businessObjectDataStorageUnitService ) . createBusinessObjectDataStorageUnit ( request ) ; verifyNoMoreInteractions ( businessObjectDataStorageUnitService ) ; "<AssertPlaceHolder>" ; } createBusinessObjectDataStorageUnit ( org . finra . herd . model . api . xml . BusinessObjectDataStorageUnitCreateRequest ) { return createBusinessObjectDataStorageUnitImpl ( request ) ; }
org . junit . Assert . assertEquals ( response , result )
setDuration_anInteger_durationIsSet ( ) { java . lang . Integer anInteger = 42 ; chargingSchedule . setDuration ( anInteger ) ; "<AssertPlaceHolder>" ; } getDuration ( ) { return duration ; }
org . junit . Assert . assertThat ( chargingSchedule . getDuration ( ) , org . hamcrest . CoreMatchers . equalTo ( anInteger ) )
init_enabled_default ( ) { javax . xml . ws . Holder < java . lang . Boolean > registered = new javax . xml . ws . Holder ( false ) ; new mockit . MockUp < com . google . common . eventbus . EventBus > ( eventBus ) { @ mockit . Mock void register ( java . lang . Object object ) { registered . value = true ; } } ; publisher . init ( globalRegistry , eventBus , new org . apache . servicecomb . foundation . metrics . MetricsBootstrapConfig ( ) ) ; "<AssertPlaceHolder>" ; } init ( javassist . CtClass , boolean , java . lang . String ) { if ( ( ctClass . isPrimitive ( ) ) && ( ! ( void . class . getName ( ) . equals ( ctClass . getName ( ) ) ) ) ) { try { ctClass = org . apache . servicecomb . common . javassist . CtType . PRIMITIVE_CLASSPOOL . get ( ( ( javassist . CtPrimitiveType ) ( ctClass ) ) . getWrapperName ( ) ) ; } catch ( javassist . NotFoundException e ) { throw new java . lang . IllegalStateException ( "Impossible<sp>exception." , e ) ; } } this . ctClass = ctClass ; this . genericSignature = genericSignature . replace ( "[B;>" , "[B>" ) ; this . hasGenericTypes = hasGenericTypes ; }
org . junit . Assert . assertFalse ( registered . value )
add_for_inetnum ( ) { final net . ripe . db . whois . common . rpsl . RpslObject rpslObject = net . ripe . db . whois . common . rpsl . RpslObject . parse ( ( "" + ( ( "inetnum:10.0.0.129<sp>-<sp>10.0.0.0\n" + "netname:netname\n" ) + "mnt-routes:<sp>DEV-MNT<sp>ANY\n" ) ) ) ; final net . ripe . db . whois . common . dao . RpslObjectInfo rpslObjectInfo = new net . ripe . db . whois . common . dao . RpslObjectInfo ( 2 , rpslObject . getType ( ) , rpslObject . getKey ( ) ) ; subject . addToIndex ( whoisTemplate , rpslObjectInfo , rpslObject , rpslObject . getValueForAttribute ( AttributeType . MNT_ROUTES ) ) ; "<AssertPlaceHolder>" ; } getNrMntRoutes ( ) { return whoisTemplate . queryForObject ( "select<sp>count(*)<sp>from<sp>mnt_routes" , net . ripe . db . whois . common . dao . jdbc . index . Integer . class ) ; }
org . junit . Assert . assertThat ( getNrMntRoutes ( ) , org . hamcrest . core . Is . is ( 1 ) )
WeblogicOperatorNamespaceIsGettableStringValue ( ) { operatorValues . namespace ( stringValue ) ; "<AssertPlaceHolder>" ; } getNamespace ( ) { return namespace ; }
org . junit . Assert . assertThat ( operatorValues . getNamespace ( ) , org . hamcrest . Matchers . equalTo ( stringValue ) )
hasClass_classLoader ( ) { java . lang . Class < ? > testClass = java . lang . String . class ; com . navercorp . pinpoint . profiler . instrument . scanner . Scanner scanner = com . navercorp . pinpoint . profiler . instrument . scanner . ClassScannerFactory . newScanner ( testClass . getProtectionDomain ( ) , this . getClass ( ) . getClassLoader ( ) ) ; java . lang . String fileName = com . navercorp . pinpoint . profiler . util . JavaAssistUtils . javaClassNameToJvmResourceName ( testClass . getName ( ) ) ; boolean exist = scanner . exist ( fileName ) ; scanner . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { }
org . junit . Assert . assertTrue ( exist )
testGetWeight ( ) { org . neuroph . core . Connection instance = new org . neuroph . core . Connection ( fromNeuron , toNeuron , 0.777 ) ; double expResult = 0.777 ; double result = instance . getWeight ( ) . value ; "<AssertPlaceHolder>" ; } getWeight ( ) { return this . weight ; }
org . junit . Assert . assertEquals ( expResult , result , 0.0 )
defaultStateMachine ( ) { org . jboss . hal . ballroom . form . StateMachine stateMachine = new org . jboss . hal . core . mbui . form . ModelNodeForm . Builder ( "defaultStateMachine" , metadata ( new org . jboss . hal . core . mbui . ResourceDescriptionBuilder ( ) . attributes ( ) ) ) . stateMachine ( ) ; "<AssertPlaceHolder>" ; } stateMachine ( ) { if ( addOnly ) { return new org . jboss . hal . ballroom . form . AddOnlyStateMachine ( ) ; } else if ( readOnly ) { return new org . jboss . hal . ballroom . form . ReadOnlyStateMachine ( ) ; } else if ( singleton ) { java . util . EnumSet < org . jboss . hal . core . mbui . form . Operation > operations = java . util . EnumSet . allOf ( org . jboss . hal . core . mbui . form . Operation . class ) ; if ( ( prepareReset ) == null ) { operations . remove ( Operation . RESET ) ; } if ( ( prepareRemove ) == null ) { operations . remove ( Operation . REMOVE ) ; } return new org . jboss . hal . ballroom . form . SingletonStateMachine ( operations ) ; } else { return new org . jboss . hal . ballroom . form . ExistingStateMachine ( ( ( prepareReset ) != null ) ) ; } }
org . junit . Assert . assertTrue ( ( stateMachine instanceof org . jboss . hal . ballroom . form . ExistingStateMachine ) )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . security . audit . storage . model . AuditEvent > auditEvents = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( auditEvents . isEmpty ( ) )
shouldReturnFalseForUnknownUser ( ) { org . togglz . core . user . FeatureUser user = null ; org . togglz . core . repository . FeatureState state = new org . togglz . core . repository . FeatureState ( org . togglz . core . activation . UsernameActivationStrategyTest . MyFeature . FEATURE ) . enable ( ) . setStrategyId ( UsernameActivationStrategy . ID ) . setParameter ( UsernameActivationStrategy . PARAM_USERS , "person1,ck,person2" ) ; boolean active = strategy . isActive ( state , user ) ; "<AssertPlaceHolder>" ; } isActive ( org . togglz . core . repository . FeatureState , org . togglz . core . user . FeatureUser ) { return true ; }
org . junit . Assert . assertEquals ( false , active )
testGetNextOfDictionaryItem ( ) { java . util . ArrayList < java . lang . String > expectedStrings = new java . util . ArrayList < java . lang . String > ( java . util . Arrays . asList ( "george" , "lee" , "bruce" ) ) ; edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary dictionary = new edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary ( expectedStrings ) ; java . lang . String dictionaryItem ; java . util . ArrayList < java . lang . String > returnedStrings = new java . util . ArrayList < java . lang . String > ( ) ; while ( ( dictionaryItem = dictionary . getNextEntry ( ) ) != null ) { returnedStrings . add ( dictionaryItem ) ; } "<AssertPlaceHolder>" ; } add ( edu . uci . ics . texera . api . schema . Schema ) { checkNotNull ( schema ) ; this . add ( schema . getAttributes ( ) ) ; return this ; }
org . junit . Assert . assertEquals ( expectedStrings , returnedStrings )
testGeenOverlapTweeActiesAndersom ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtIdentificeerbaar > overtreders = brby0024 . voerRegelUit ( maakBericht ( 2007 , 2009 , 2001 , 2005 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , overtreders . size ( ) )
shouldGetAttributeReturnTheAttributeValue ( ) { org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttribute < org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttributeTest . MockedDoubleSolution , java . lang . Integer > genericSolutionAttribute ; genericSolutionAttribute = new org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttribute ( ) ; java . lang . Object value = new java . lang . Double ( 5 ) ; org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttributeTest . MockedDoubleSolution solution = mock ( org . uma . jmetal . util . solutionattribute . impl . GenericSolutionAttributeTest . MockedDoubleSolution . class ) ; when ( solution . getAttribute ( genericSolutionAttribute . getAttributeIdentifier ( ) ) ) . thenReturn ( value ) ; "<AssertPlaceHolder>" ; } getAttribute ( S extends org . uma . jmetal . solution . Solution ) { return ( ( java . util . List < java . lang . Double > ) ( solution . getAttribute ( getAttributeIdentifier ( ) ) ) ) ; }
org . junit . Assert . assertEquals ( value , genericSolutionAttribute . getAttribute ( solution ) )
should_create_new_folder ( ) { java . io . File f = null ; try { f = org . fest . util . Files . newFolder ( "folder" ) ; "<AssertPlaceHolder>" ; } finally { if ( f != null ) f . delete ( ) ; } } newFolder ( java . lang . String ) { org . fest . util . File file = new org . fest . util . File ( path ) ; if ( ( file . isDirectory ( ) ) && ( ! ( org . fest . util . Arrays . isNullOrEmpty ( file . list ( ) ) ) ) ) { throw org . fest . util . Files . cannotCreateNewFile ( path , "a<sp>non-empty<sp>directory<sp>was<sp>found<sp>with<sp>the<sp>same<sp>path" ) ; } if ( ! ( file . mkdir ( ) ) ) { throw org . fest . util . Files . cannotCreateNewFile ( path , "a<sp>file<sp>was<sp>found<sp>with<sp>the<sp>same<sp>path" ) ; } return file ; }
org . junit . Assert . assertTrue ( f . isDirectory ( ) )
testQueryWithNamedParametersInWhereClauseWithDoc ( ) { org . nuxeo . ecm . automation . OperationContext ctx = new org . nuxeo . ecm . automation . OperationContext ( session ) ; java . util . Map < java . lang . String , java . lang . Object > params = getNamedParamsProps ( "np:title" , "WS1" ) ; params . put ( "query" , "SELECT<sp>*<sp>FROM<sp>Document<sp>where<sp>dc:title=:np:title<sp>ORDER<sp>BY<sp>dc:title" ) ; org . nuxeo . ecm . core . api . DocumentModelList list = ( ( org . nuxeo . ecm . core . api . DocumentModelList ) ( service . run ( ctx , DocumentPaginatedQuery . ID , params ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return rows . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , list . size ( ) )
testUnGetAfterUninstall ( ) { org . osgi . framework . Bundle bundle = installBundle ( getBundleArchiveA ( ) ) ; bundle . start ( ) ; org . osgi . framework . BundleContext context = bundle . getBundleContext ( ) ; org . osgi . framework . ServiceRegistration sreg = context . registerService ( org . jboss . test . osgi . framework . service . GetUnGetServiceTestCase . OBJCLASS , context , null ) ; org . osgi . framework . ServiceReference sref = sreg . getReference ( ) ; java . lang . Object actual = context . getService ( sref ) ; "<AssertPlaceHolder>" ; bundle . uninstall ( ) ; try { context . ungetService ( sref ) ; org . junit . Assert . fail ( "IllegalStateException<sp>expected" ) ; } catch ( java . lang . IllegalStateException e ) { } } getService ( org . jboss . msc . service . ServiceName ) { org . jboss . msc . service . ServiceContainer serviceContainer = getServiceContainer ( ) ; return serviceContainer . getService ( serviceName ) ; }
org . junit . Assert . assertEquals ( context , actual )
testEmptyText ( ) { try { resolver . resolve ( 0 , "" , null ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } resolve ( long , java . lang . String , java . util . List ) { java . util . Map < java . lang . Integer , com . ctrip . framework . apollo . common . dto . ItemDTO > oldLineNumMapItem = com . ctrip . framework . apollo . common . utils . BeanUtils . mapByKey ( "lineNum" , baseItems ) ; java . util . Map < java . lang . String , com . ctrip . framework . apollo . common . dto . ItemDTO > oldKeyMapItem = com . ctrip . framework . apollo . common . utils . BeanUtils . mapByKey ( "key" , baseItems ) ; oldKeyMapItem . remove ( "" ) ; java . lang . String [ ] newItems = configText . split ( com . ctrip . framework . apollo . portal . component . txtresolver . PropertyResolver . ITEM_SEPARATOR ) ; if ( isHasRepeatKey ( newItems ) ) { throw new com . ctrip . framework . apollo . common . exception . BadRequestException ( "config<sp>text<sp>has<sp>repeat<sp>key<sp>please<sp>check." ) ; } com . ctrip . framework . apollo . common . dto . ItemChangeSets changeSets = new com . ctrip . framework . apollo . common . dto . ItemChangeSets ( ) ; java . util . Map < java . lang . Integer , java . lang . String > newLineNumMapItem = new java . util . HashMap ( ) ; int lineCounter = 1 ; for ( java . lang . String newItem : newItems ) { newItem = newItem . trim ( ) ; newLineNumMapItem . put ( lineCounter , newItem ) ; com . ctrip . framework . apollo . common . dto . ItemDTO oldItemByLine = oldLineNumMapItem . get ( lineCounter ) ; if ( isCommentItem ( newItem ) ) { handleCommentLine ( namespaceId , oldItemByLine , newItem , lineCounter , changeSets ) ; } else if ( isBlankItem ( newItem ) ) { handleBlankLine ( namespaceId , oldItemByLine , lineCounter , changeSets ) ; } else { handleNormalLine ( namespaceId , oldKeyMapItem , newItem , lineCounter , changeSets ) ; } lineCounter ++ ; } deleteCommentAndBlankItem ( oldLineNumMapItem , newLineNumMapItem , changeSets ) ; deleteNormalKVItem ( oldKeyMapItem , changeSets ) ; return changeSets ; }
org . junit . Assert . assertTrue ( ( e instanceof com . ctrip . framework . apollo . common . exception . BadRequestException ) )
deveObterMotivoComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . NFInfoEventoRetorno eventoRetorno = new com . fincatto . documentofiscal . nfe400 . classes . evento . NFInfoEventoRetorno ( ) ; final java . lang . String motivo = "motivo<sp>de<sp>teste" ; eventoRetorno . setMotivo ( motivo ) ; "<AssertPlaceHolder>" ; } getMotivo ( ) { return this . motivo ; }
org . junit . Assert . assertEquals ( motivo , eventoRetorno . getMotivo ( ) )
simpleCheckOfBeansInPackage ( ) { org . apache . deltaspike . test . core . api . exclude . AlwaysActiveBean testBean = org . apache . deltaspike . core . api . provider . BeanProvider . getContextualReference ( org . apache . deltaspike . test . core . api . exclude . AlwaysActiveBean . class , true ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertNotNull ( testBean )
crossesTest ( ) { double [ ] min1 = new double [ ] { - 10 , - 20 } ; double [ ] max1 = new double [ ] { 20 , 5 } ; org . apache . sis . geometry . GeneralEnvelope bbox = new org . apache . sis . geometry . GeneralEnvelope ( min1 , max1 ) ; bbox . setCoordinateReferenceSystem ( org . apache . sis . referencing . CommonCRS . defaultGeographic ( ) ) ; filter = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . FF . crosses ( org . geotoolkit . lucene . GEOMETRY_PROPERTY , org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . FF . literal ( bbox ) ) ; spatialQuery = new org . geotoolkit . lucene . filter . SpatialQuery ( wrap ( filter ) ) ; docs = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . searcher . search ( org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . simpleQuery , spatialQuery . getSpatialFilter ( ) , 15 ) ; nbResults = docs . totalHits ; org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . LOGGER . log ( Level . FINER , "box<sp>2<sp>projected" 1 , nbResults ) ; results = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < nbResults ; i ++ ) { org . apache . lucene . document . Document doc = org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . searcher . doc ( docs . scoreDocs [ i ] . doc ) ; java . lang . String name = doc . get ( "box<sp>2<sp>projected" 3 ) ; results . add ( name ) ; org . geotoolkit . lucene . LuceneEnvelopeOnlyTest . LOGGER . log ( Level . FINER , "box<sp>2<sp>projected" 7 , name ) ; } "<AssertPlaceHolder>" ; } log ( java . util . logging . Level , java . lang . String , java . lang . String ) { final java . util . logging . LogRecord record = new java . util . logging . LogRecord ( level , message ) ; record . setSourceClassName ( org . geotoolkit . internal . sql . Synchronizer . class . getName ( ) ) ; record . setSourceMethodName ( method ) ; org . apache . sis . util . logging . Logging . getLogger ( "org.geotoolkit.sql" ) . log ( record ) ; }
org . junit . Assert . assertEquals ( nbResults , 0 )
testConfigureAttrPersistence ( ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.configure]" ) ) + "--------<sp>attr_persistence<sp>can<sp>only<sp>be<sp>'row'<sp>or<sp>'column'" ) ) ; java . lang . String attrPersistence = "fila" ; java . lang . String batchSize = null ; java . lang . String batchTime = null ; java . lang . String batchTTL = null ; java . lang . String dataModel = null ; java . lang . String enableEncoding = null ; java . lang . String enableGrouping = null ; java . lang . String enableLowercase = null ; java . lang . String host = null ; java . lang . String password = null ; java . lang . String port = null ; java . lang . String username = null ; java . lang . String cache = null ; com . telefonica . iot . cygnus . sinks . NGSIPostgreSQLSink sink = new com . telefonica . iot . cygnus . sinks . NGSIPostgreSQLSink ( ) ; sink . configure ( createContext ( attrPersistence , batchSize , batchTime , batchTTL , dataModel , enableEncoding , enableGrouping , enableLowercase , host , password , port , username , cache ) ) ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.configure]" ) ) + "-<sp>OK<sp>-<sp>'attr_persistence=fila'<sp>was<sp>detected" ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( getTestTraceHead ( "[NGSIPostgreSQLSink.configure]" ) ) + "-<sp>FAIL<sp>-<sp>'attr_persistence=fila'<sp>was<sp>not<sp>detected" ) ) ; throw e ; } getInvalidConfiguration ( ) { return invalidConfiguration ; }
org . junit . Assert . assertTrue ( sink . getInvalidConfiguration ( ) )
testToStringNullConfig ( ) { org . eclipse . kura . core . net . modem . ModemInterfaceAddressConfigImpl value = createConfig ( ) ; java . util . ArrayList < org . eclipse . kura . net . NetConfig > configs = new java . util . ArrayList ( ) ; configs . add ( null ) ; value . setNetConfigs ( configs ) ; java . lang . String expected = "NetConfig:<sp>null<sp>-<sp>" ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( "]" 1 ) . append ( this . id ) . append ( "]" 0 ) . append ( this . topic ) . append ( ",<sp>qos=" ) . append ( this . qos ) . append ( ",<sp>retain=" ) . append ( this . retain ) . append ( ",<sp>createdOn=" ) . append ( this . createdOn ) . append ( ",<sp>publishedOn=" ) . append ( this . publishedOn ) . append ( ",<sp>publishedMessageId=" ) . append ( this . publishedMessageId ) . append ( ",<sp>confirmedOn=" ) . append ( this . confirmedOn ) . append ( ",<sp>payload=" ) . append ( java . util . Arrays . toString ( this . payload ) ) . append ( ",<sp>priority=" ) . append ( this . priority ) . append ( ",<sp>sessionId=" ) . append ( this . sessionId ) . append ( "]" 2 ) . append ( this . droppedOn ) . append ( "]" ) ; return builder . toString ( ) ; }
org . junit . Assert . assertEquals ( expected , value . toString ( ) )
testOnCreateUser ( ) { action . onCreate ( getTestUser ( ) , "pw" , root , NamePathMapper . DEFAULT ) ; "<AssertPlaceHolder>" ; } hasPendingChanges ( ) { return base . hasPendingChanges ( ) ; }
org . junit . Assert . assertFalse ( root . hasPendingChanges ( ) )
WhenElephantDoStepItCanMovInNewBox ( ) { ru . szhernovoy . model . Elephant eleph = new ru . szhernovoy . model . Elephant ( Color . Black ) ; ru . szhernovoy . model . Point a = new ru . szhernovoy . model . Point ( 0 , 0 ) ; ru . szhernovoy . model . Point b = new ru . szhernovoy . model . Point ( 1 , 1 ) ; boolean message = true ; boolean result = eleph . chekMove ( a , b ) ; "<AssertPlaceHolder>" ; } chekMove ( ru . szhernovoy . model . Point , ru . szhernovoy . model . Point ) { boolean chek = false ; int subX = ( ( ( B . getX ( ) ) - ( A . getX ( ) ) ) > 0 ) ? ( B . getX ( ) ) - ( A . getX ( ) ) : ( A . getX ( ) ) - ( B . getX ( ) ) ; int subY = ( ( ( B . getY ( ) ) - ( A . getY ( ) ) ) > 0 ) ? ( B . getY ( ) ) - ( A . getY ( ) ) : ( B . getY ( ) ) - ( A . getY ( ) ) ; if ( ( subY == 0 ) && ( subX == 1 ) ) { chek = true ; } if ( ! chek ) { System . out . println ( "Uncorrect<sp>move<sp>for<sp>this<sp>figure" ) ; } return chek ; }
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( message ) )
shouldIsEmptyReturnFalseForLongValue ( ) { java . lang . Long id = 1L ; when ( dataDefinition . get ( id ) ) . thenReturn ( entity ) ; lookup . setFieldValue ( id ) ; boolean result = lookup . isEmpty ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( org . apache . commons . lang3 . StringUtils . isEmpty ( autocompleteCode ) ) && ( ! ( hasSelectedEntity ( ) ) ) ; }
org . junit . Assert . assertFalse ( result )
testInMany ( ) { com . j256 . ormlite . stmt . Where < com . j256 . ormlite . stmt . Foo , java . lang . String > where = new com . j256 . ormlite . stmt . Where < com . j256 . ormlite . stmt . Foo , java . lang . String > ( createTableInfo ( ) , null , databaseType ) ; int [ ] vals = new int [ ] { 112 , 123 , 61 } ; where . in ( Foo . VAL_COLUMN_NAME , vals [ 0 ] , vals [ 1 ] , vals [ 2 ] ) ; java . lang . StringBuilder whereSb = new java . lang . StringBuilder ( ) ; where . appendSql ( null , whereSb , new java . util . ArrayList < com . j256 . ormlite . stmt . ArgumentHolder > ( ) ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; databaseType . appendEscapedEntityName ( sb , Foo . VAL_COLUMN_NAME ) ; sb . append ( "<sp>IN<sp>(" ) ; for ( int valC = 0 ; valC < ( vals . length ) ; valC ++ ) { if ( valC > 0 ) { sb . append ( ',' ) ; } sb . append ( vals [ valC ] ) . append ( '<sp>' ) ; } sb . append ( ")<sp>" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( getClass ( ) . getSimpleName ( ) ) + ":name=" ) + ( field . getName ( ) ) ) + ",class=" ) + ( field . getDeclaringClass ( ) . getSimpleName ( ) ) ; }
org . junit . Assert . assertEquals ( sb . toString ( ) , whereSb . toString ( ) )
testBrpPersoonslijstGetterZonderVerzoekType ( ) { final nl . moderniseringgba . isc . esb . message . brp . impl . GeslachtsnaamwijzigingVerzoekBericht geslachtsnaamwijzigingVerzoekBericht = new nl . moderniseringgba . isc . esb . message . brp . impl . GeslachtsnaamwijzigingVerzoekBericht ( null ) ; "<AssertPlaceHolder>" ; } getBrpPersoonslijst ( ) { return asBrpPersoonslijst ( leesUitBrpAntwoordType . getBrpPl ( ) ) ; }
org . junit . Assert . assertNull ( geslachtsnaamwijzigingVerzoekBericht . getBrpPersoonslijst ( ) )
testFetchByPrimaryKeysWithNoPrimaryKeys ( ) { java . util . Set < java . io . Serializable > primaryKeys = new java . util . HashSet < java . io . Serializable > ( ) ; java . util . Map < java . io . Serializable , com . liferay . portal . kernel . model . SystemEvent > systemEvents = _persistence . fetchByPrimaryKeys ( primaryKeys ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return _portalCacheListeners . isEmpty ( ) ; }
org . junit . Assert . assertTrue ( systemEvents . isEmpty ( ) )
testRewriteModeChainRuleTree2 ( ) { java . lang . String grammar = "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 7 + ( ( ( ( "options<sp>{output=AST;}\n" + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 6 ) + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" ) + "WS<sp>:<sp>(\'<sp>\'|\'\\n\')<sp>{$channel=HIDDEN;}<sp>;\n" 0 ) + "WS<sp>:<sp>(\'<sp>\'|\'\\n\')<sp>{$channel=HIDDEN;}<sp>;\n" ) ; java . lang . String treeGrammar = "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 9 + ( ( ( ( ( "options<sp>{output=AST;<sp>ASTLabelType=CommonTree;<sp>tokenVocab=T;<sp>rewrite=true;}\n" + "tokens<sp>{<sp>X;<sp>}\n" ) + "s<sp>:<sp>a*<sp>b<sp>;\n" ) + "a<sp>:<sp>X<sp>;\n" ) + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 1 ) + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 8 ) ; java . lang . String found = execTreeParser ( "WS<sp>:<sp>(\'<sp>\'|\'\\n\')<sp>{$channel=HIDDEN;}<sp>;\n" 1 , grammar , "TParser" , "TP.g" , treeGrammar , "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 3 , "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 0 , "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 2 , "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 5 , "abc<sp>34" ) ; "<AssertPlaceHolder>" ; } execTreeParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { return execTreeParser ( parserGrammarFileName , parserGrammarStr , parserName , treeParserGrammarFileName , treeParserGrammarStr , treeParserName , lexerName , parserStartRuleName , treeParserStartRuleName , input , false ) ; }
org . junit . Assert . assertEquals ( "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" 4 , found )
testSerialization ( ) { org . jfree . chart . labels . IntervalCategoryItemLabelGenerator g1 = new org . jfree . chart . labels . IntervalCategoryItemLabelGenerator ( "{3}<sp>-<sp>{4}" , java . text . DateFormat . getInstance ( ) ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( g1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . labels . IntervalCategoryItemLabelGenerator g2 = ( ( org . jfree . chart . labels . IntervalCategoryItemLabelGenerator ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
org . junit . Assert . assertEquals ( g1 , g2 )
testRequiredProperties ( ) { com . google . firebase . auth . UserProvider provider = com . google . firebase . auth . UserProvider . builder ( ) . setUid ( "testuid" ) . setProviderId ( "google.com" ) . build ( ) ; java . lang . String json = com . google . firebase . auth . UserProviderTest . JSON_FACTORY . toString ( provider ) ; java . util . Map < java . lang . String , java . lang . Object > parsed = new java . util . HashMap ( ) ; com . google . firebase . auth . UserProviderTest . JSON_FACTORY . createJsonParser ( json ) . parse ( parsed ) ; java . util . Map < java . lang . String , java . lang . Object > expected = com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( "rawId" , "testuid" , "providerId" , "google.com" ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { checkArgument ( ( ! ( com . google . common . base . Strings . isNullOrEmpty ( line ) ) ) ) ; java . lang . String [ ] segments = line . split ( "," ) ; return new com . google . firebase . CodeCoverageReporter . CoverageInfo ( segments [ 1 ] , java . lang . Long . parseLong ( segments [ 4 ] ) , ( ( java . lang . Long . parseLong ( segments [ 3 ] ) ) + ( java . lang . Long . parseLong ( segments [ 4 ] ) ) ) ) ; }
org . junit . Assert . assertEquals ( expected , parsed )
cancelWithInterruptTest ( ) { org . threadly . BlockingTestRunnable btr = new org . threadly . BlockingTestRunnable ( ) ; java . lang . Thread runningThread = new java . lang . Thread ( btr ) ; try { runningThread . start ( ) ; slf . setRunningThread ( runningThread ) ; btr . blockTillStarted ( ) ; "<AssertPlaceHolder>" ; btr . blockTillFinished ( ) ; } finally { btr . unblock ( ) ; } } cancel ( boolean ) { return futureImp . cancel ( mayInterruptIfRunning ) ; }
org . junit . Assert . assertTrue ( slf . cancel ( true ) )
findAllVerliesNLNationaliteit ( ) { final java . util . Collection < nl . bzk . algemeenbrp . dal . domein . brp . entity . RedenVerliesNLNationaliteit > result = redenVerliesNLNationaliteitRepository . findAll ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return elementen . isEmpty ( ) ; }
org . junit . Assert . assertFalse ( result . isEmpty ( ) )
get ( ) { java . lang . String key = randomString ( ) ; org . springframework . data . redis . core . ValueOperations ops = mock ( org . springframework . data . redis . core . ValueOperations . class ) ; when ( template . opsForValue ( ) ) . thenReturn ( ops ) ; serviceUnderTest . get ( key ) ; verify ( template ) . opsForValue ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return jediService . get ( key ) ; }
org . junit . Assert . assertTrue ( true )
header_force ( ) { com . asakusafw . runtime . io . text . driver . RecordDefinition < java . lang . String [ ] > def = com . asakusafw . runtime . io . text . driver . RecordDefinition . builder ( java . lang . String [ ] . class ) . withHeaderType ( HeaderType . FORCE ) . withField ( self ( ) , field ( 0 ) . build ( ) ) . withField ( self ( ) , field ( 1 ) . build ( ) ) . build ( ) ; java . lang . String [ ] [ ] results = collect ( def , new java . lang . String [ ] [ ] { new java . lang . String [ ] { "A" , "B" } , new java . lang . String [ ] { "C" , "D" } } ) ; "<AssertPlaceHolder>" ; } build ( ) { if ( ( row ) != null ) { entity . add ( row ) ; row = null ; } return new com . asakusafw . iterative . common . basic . BasicParameterTable ( entity ) ; }
org . junit . Assert . assertThat ( results , is ( new java . lang . String [ ] [ ] { new java . lang . String [ ] { "C" , "D" } } ) )
injectIntoWithIndex ( ) { com . gs . collections . api . list . primitive . ImmutableBooleanList list = this . newWith ( true , false , true ) ; com . gs . collections . impl . math . MutableInteger result = list . injectIntoWithIndex ( new com . gs . collections . impl . math . MutableInteger ( 0 ) , ( object , value , index ) -> object . add ( ( ( value ? 1 : 0 ) + index ) ) ) ; "<AssertPlaceHolder>" ; } add ( int ) { return new com . gs . collections . impl . block . factory . primitive . IntToIntFunctions . AddIntToIntFunction ( intToAdd ) ; }
org . junit . Assert . assertEquals ( new com . gs . collections . impl . math . MutableInteger ( 5 ) , result )
testJUnitHamcrestMatcherFailureWorks ( ) { try { "<AssertPlaceHolder>" ; } catch ( java . lang . NoSuchMethodError e ) { org . junit . Assert . fail ( ( ( "Class<sp>search<sp>path<sp>seems<sp>broken<sp>re<sp>new<sp>JUnit<sp>and<sp>old<sp>Hamcrest." + "<sp>Got<sp>NoSuchMethodError;<sp>e:<sp>" ) + e ) ) ; } catch ( java . lang . AssertionError e ) { org . apache . drill . hbase . test . Drill2130StorageHBaseHamcrestConfigurationTest . logger . info ( ( "Class<sp>path<sp>seems<sp>fine<sp>re<sp>new<sp>JUnit<sp>vs.<sp>old<sp>Hamcrest." + "<sp>(Got<sp>AssertionError,<sp>not<sp>NoSuchMethodError.)" ) ) ; } }
org . junit . Assert . assertThat ( 1 , org . hamcrest . CoreMatchers . equalTo ( 2 ) )
testSerialization ( ) { org . jfree . chart . renderer . category . LevelRenderer r1 = new org . jfree . chart . renderer . category . LevelRenderer ( ) ; org . jfree . chart . renderer . category . LevelRenderer r2 = ( ( org . jfree . chart . renderer . category . LevelRenderer ) ( org . jfree . chart . TestUtilities . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( r1 , r2 )
getOneAssignedUserTaskInstanceOfProcessInstance ( ) { final org . bonitasoft . engine . bpm . process . DesignProcessDefinition processDef = createProcessWithActorAndHumanTaskAndStringData ( ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition processDefinition = deployAndEnableProcessWithActor ( processDef , org . bonitasoft . engine . process . ACTOR_NAME , user ) ; final org . bonitasoft . engine . bpm . flownode . ActivityInstance activityInstance = createProcessAndAssignUserTask ( user , processDefinition ) ; final long userTaskId = getProcessAPI ( ) . getOneAssignedUserTaskInstanceOfProcessInstance ( activityInstance . getParentContainerId ( ) , user . getId ( ) ) ; "<AssertPlaceHolder>" ; disableAndDeleteProcess ( processDefinition ) ; } getId ( ) { return id ; }
org . junit . Assert . assertEquals ( activityInstance . getId ( ) , userTaskId )
testDecoratingComponentAdapterDelegatesToMonitorThatDoesSupportStrategy ( ) { com . picocontainer . behaviors . AbstractBehavior . AbstractChangedBehavior adapter = new com . picocontainer . behaviors . BehaviorAdapterTestCase . FooAbstractChangedBehavior ( mockComponentAdapterThatDoesSupportStrategy ( ) ) ; adapter . changeMonitor ( mockMonitorWithNoExpectedMethods ( ) ) ; "<AssertPlaceHolder>" ; } currentMonitor ( ) { return monitor ; }
org . junit . Assert . assertNotNull ( adapter . currentMonitor ( ) )
test_empty ( ) { final java . util . List < java . util . List < java . lang . String > > expected = com . google . common . collect . ImmutableList . of ( ) ; final java . util . List < java . util . List < java . lang . String > > actual = de . metas . util . GuavaCollectors . groupByAndStream ( java . util . stream . Stream . < java . lang . String > empty ( ) , ( value ) -> value ) . collect ( com . google . common . collect . ImmutableList . toImmutableList ( ) ) ; "<AssertPlaceHolder>" ; } toImmutableList ( ) { return com . google . common . collect . ImmutableList . toImmutableList ( ) ; }
org . junit . Assert . assertEquals ( expected , actual )
testTrimRouterVersion ( java . lang . String , java . lang . String ) { "<AssertPlaceHolder>" ; } trimRouterVersion ( java . lang . String ) { final java . lang . String [ ] tokens = version . split ( "<sp>" ) ; if ( ( ( tokens . length ) >= 3 ) && ( org . apache . cloudstack . utils . CloudStackVersion . FULL_VERSION_FORMAT . matcher ( tokens [ 2 ] ) . matches ( ) ) ) { return tokens [ 2 ] ; } return "0" ; }
org . junit . Assert . assertEquals ( expected , org . apache . cloudstack . utils . CloudStackVersion . trimRouterVersion ( value ) )
getStereoACWTest ( ) { org . openscience . cdk . interfaces . IAtom closestAtomToViewer = new org . openscience . cdk . Atom ( "F" , new javax . vecmath . Point3d ( 1 , 1 , 1 ) ) ; org . openscience . cdk . interfaces . IAtom highestCIPPriority = new org . openscience . cdk . Atom ( "I" , new javax . vecmath . Point3d ( 0 , 1 , 2 ) ) ; org . openscience . cdk . interfaces . IAtom middleCIPPriority = new org . openscience . cdk . Atom ( "Br" , new javax . vecmath . Point3d ( 0 , 0 , 0 ) ) ; org . openscience . cdk . interfaces . IAtom nearlylowestCIPPriority = new org . openscience . cdk . Atom ( "Cl" , new javax . vecmath . Point3d ( 0 , 2 , 0 ) ) ; "<AssertPlaceHolder>" ; } getStereo ( org . openscience . cdk . interfaces . IAtom , org . openscience . cdk . interfaces . IAtom , org . openscience . cdk . interfaces . IAtom , org . openscience . cdk . interfaces . IAtom ) { org . openscience . cdk . stereo . StereoTool . TetrahedralSign sign = org . openscience . cdk . stereo . StereoTool . getHandedness ( atom2 , atom3 , atom4 , atom1 ) ; if ( sign == ( org . openscience . cdk . stereo . StereoTool . TetrahedralSign . PLUS ) ) { return org . openscience . cdk . interfaces . ITetrahedralChirality . Stereo . ANTI_CLOCKWISE ; } else { return org . openscience . cdk . interfaces . ITetrahedralChirality . Stereo . CLOCKWISE ; } }
org . junit . Assert . assertEquals ( Stereo . ANTI_CLOCKWISE , org . openscience . cdk . stereo . StereoTool . getStereo ( closestAtomToViewer , highestCIPPriority , middleCIPPriority , nearlylowestCIPPriority ) )
refreshApolloConfig ( ) { org . apache . servicecomb . config . client . ApolloConfig apolloConfig = ApolloConfig . INSTANCE ; org . springframework . web . client . RestTemplate rest = org . mockito . Mockito . mock ( org . springframework . web . client . RestTemplate . class ) ; org . springframework . http . ResponseEntity < java . lang . String > responseEntity = new org . springframework . http . ResponseEntity ( "{\"apollo\":\"mocked\",<sp>\"configurations\":{\"timeout\":1000}}" , org . springframework . http . HttpStatus . OK ) ; org . mockito . Mockito . when ( rest . exchange ( org . mockito . Matchers . anyString ( ) , org . mockito . Matchers . any ( org . springframework . http . HttpMethod . class ) , org . mockito . Matchers . < org . springframework . http . HttpEntity < java . lang . String > > any ( ) , org . mockito . Matchers . < java . lang . Class < java . lang . String > > any ( ) ) ) . thenReturn ( responseEntity ) ; org . apache . servicecomb . config . archaius . sources . ApolloConfigurationSourceImpl impl = new org . apache . servicecomb . config . archaius . sources . ApolloConfigurationSourceImpl ( ) ; org . apache . servicecomb . config . archaius . sources . ApolloConfigurationSourceImpl . UpdateHandler updateHandler = impl . new org . apache . servicecomb . config . archaius . sources . ApolloConfigurationSourceImpl . UpdateHandler ( ) ; org . apache . servicecomb . config . client . ApolloClient apolloClient = new org . apache . servicecomb . config . client . ApolloClient ( updateHandler ) ; mockit . Deencapsulation . setField ( apolloClient , "rest" , rest ) ; org . apache . servicecomb . config . client . ApolloClient . ConfigRefresh cr = apolloClient . new org . apache . servicecomb . config . client . ApolloClient . ConfigRefresh ( apolloConfig . getServerUri ( ) ) ; cr . run ( ) ; java . util . Map < java . lang . String , java . lang . Object > originMap = mockit . Deencapsulation . getField ( apolloClient , "originalConfigMap" ) ; "<AssertPlaceHolder>" ; } getField ( java . lang . reflect . Field , java . lang . Object ) { org . apache . servicecomb . swagger . invocation . Response response = org . apache . servicecomb . swagger . invocation . Response . ok ( 200 ) ; return new org . apache . servicecomb . provider . springmvc . reference . CseClientHttpResponse ( response ) ; }
org . junit . Assert . assertEquals ( 1 , originMap . size ( ) )
shouldRaiseWrongMusicCompany ( ) { org . agoncal . book . javaee7 . chapter03 . ex10 . CD10 cd = new org . agoncal . book . javaee7 . chapter03 . ex10 . CD10 ( "St<sp>Pepper" , 12.8F , "Beatles<sp>master<sp>piece" , "apple" , 1 , 53.32F , "Pop" ) ; java . util . Set < javax . validation . ConstraintViolation < org . agoncal . book . javaee7 . chapter03 . ex10 . CD10 > > violations = org . agoncal . book . javaee7 . chapter03 . ex10 . CD10Test . validator . validate ( cd ) ; 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 ( ) )
testSetGlobalValues ( ) { System . out . println ( "<sp>setGlobalValues" ) ; final java . util . Map < java . lang . String , java . lang . Object > table = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; table . put ( "foo" , 1 ) ; table . put ( "bar" , 2 ) ; org . geotools . filter . function . EnvFunction . setGlobalValues ( table ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 2 ) ; class Task implements java . lang . Runnable { final java . lang . String key ; Task ( java . lang . String key ) { if ( ! ( table . containsKey ( key ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Invalid<sp>arg<sp>" + key ) ) ; } this . key = key ; } public void run ( ) { org . geotools . filter . function . EnvFunction . setGlobalValue ( key , table . get ( key ) ) ; latch . countDown ( ) ; try { latch . await ( ) ; } catch ( java . lang . InterruptedException ex ) { throw new java . lang . IllegalStateException ( ex ) ; } for ( java . lang . String name : table . keySet ( ) ) { java . lang . Object result = ff . function ( "env" , ff . literal ( name ) ) . evaluate ( null ) ; int value = ( ( java . lang . Number ) ( result ) ) . intValue ( ) ; "<AssertPlaceHolder>" ; } } } java . util . concurrent . Future f1 = executor . submit ( new Task ( "foo" ) ) ; java . util . concurrent . Future f2 = executor . submit ( new Task ( "bar" ) ) ; f1 . get ( ) ; f2 . get ( ) ; } get ( int ) { switch ( value ) { case net . opengis . wcs10 . InterpolationMethodType . NEAREST_NEIGHBOR : return net . opengis . wcs10 . InterpolationMethodType . NEAREST_NEIGHBOR_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BILINEAR : return net . opengis . wcs10 . InterpolationMethodType . BILINEAR_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BICUBIC : return net . opengis . wcs10 . InterpolationMethodType . BICUBIC_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . LOST_AREA : return net . opengis . wcs10 . InterpolationMethodType . LOST_AREA_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . BARYCENTRIC : return net . opengis . wcs10 . InterpolationMethodType . BARYCENTRIC_LITERAL ; case net . opengis . wcs10 . InterpolationMethodType . NONE : return net . opengis . wcs10 . InterpolationMethodType . NONE_LITERAL ; } return null ; }
org . junit . Assert . assertEquals ( table . get ( name ) , value )
testCorrectnessOfMissingParent ( ) { org . apache . taverna . scufl2 . api . core . Workflow w = new org . apache . taverna . scufl2 . api . core . Workflow ( ) ; w . setName ( "fred" ) ; org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator cv = new org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator ( ) ; org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener rcvl = new org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener ( ) ; cv . checkCorrectness ( w , false , rcvl ) ; java . util . Set < org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem > nullFieldProblems = rcvl . getNullFieldProblems ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return namedMap . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , nullFieldProblems . size ( ) )
shouldNotHaveNextIfEmptyIteratorIsAdded ( ) { final org . apache . tinkerpop . gremlin . util . iterator . MultiIterator < java . lang . String > itty = new org . apache . tinkerpop . gremlin . util . iterator . MultiIterator ( ) ; itty . addIterator ( org . apache . tinkerpop . gremlin . util . iterator . EmptyIterator . instance ( ) ) ; "<AssertPlaceHolder>" ; } hasNext ( ) { if ( ! ( this . queue . isEmpty ( ) ) ) return true ; else if ( ! ( this . inputIterator . hasNext ( ) ) ) { this . mapReduce . workerEnd ( MapReduce . Stage . REDUCE ) ; return false ; } else { this . processNext ( ) ; return this . hasNext ( ) ; } }
org . junit . Assert . assertFalse ( itty . hasNext ( ) )
purgeOrderType_shouldNotAllowDeletingAnOrderTypeThatIsInUse ( ) { org . openmrs . OrderType orderType = orderService . getOrderType ( 1 ) ; "<AssertPlaceHolder>" ; expectedException . expect ( org . openmrs . api . CannotDeleteObjectInUseException . class ) ; expectedException . expectMessage ( mss . getMessage ( "Order.type.cannot.delete" ) ) ; orderService . purgeOrderType ( orderType ) ; } getOrderType ( java . lang . Integer ) { org . hibernate . Criteria criteria = sessionFactory . getCurrentSession ( ) . createCriteria ( org . openmrs . OrderType . class ) ; criteria . add ( org . hibernate . criterion . Restrictions . eq ( "orderTypeId" , orderTypeId ) ) ; return ( ( org . openmrs . OrderType ) ( criteria . uniqueResult ( ) ) ) ; }
org . junit . Assert . assertNotNull ( orderType )
testImmutableMapSerialization ( ) { java . util . Map original = com . google . common . collect . ImmutableMap . of ( "x" , "y" , "y" , "z" ) ; java . util . Map copy = org . apache . giraph . writable . kryo . KryoWritableWrapperTest . kryoSerDeser ( original ) ; "<AssertPlaceHolder>" ; } kryoSerDeser ( T ) { org . apache . giraph . writable . kryo . KryoWritableWrapper < T > wrapped = new org . apache . giraph . writable . kryo . KryoWritableWrapper ( t ) ; org . apache . giraph . writable . kryo . KryoWritableWrapper < T > deser = new org . apache . giraph . writable . kryo . KryoWritableWrapper ( ) ; org . apache . giraph . utils . WritableUtils . copyInto ( wrapped , deser , true ) ; return deser . get ( ) ; }
org . junit . Assert . assertEquals ( original , copy )
sendAndRollbackIgnoreJTA ( ) { sender . send ( true , true ) ; latch . await ( org . jboss . as . test . smoke . jms . SendToQueueIgnoreJTATest . MAX_WAIT_IN_SECONDS , org . jboss . as . test . smoke . jms . SECONDS ) ; "<AssertPlaceHolder>" ; } getCount ( ) { return count ; }
org . junit . Assert . assertEquals ( 0 , latch . getCount ( ) )
testSetupTaskReportsWithNullJob ( ) { org . apache . hadoop . mapred . JobClientUnitTest . TestJobClient client = new org . apache . hadoop . mapred . JobClientUnitTest . TestJobClient ( new org . apache . hadoop . mapred . JobConf ( ) ) ; org . apache . hadoop . mapreduce . Cluster mockCluster = mock ( org . apache . hadoop . mapreduce . Cluster . class ) ; client . setCluster ( mockCluster ) ; org . apache . hadoop . mapred . JobID id = new org . apache . hadoop . mapred . JobID ( "test" , 0 ) ; when ( mockCluster . getJob ( id ) ) . thenReturn ( null ) ; org . apache . hadoop . mapreduce . TaskReport [ ] result = client . getSetupTaskReports ( id ) ; "<AssertPlaceHolder>" ; verify ( mockCluster ) . getJob ( id ) ; } getSetupTaskReports ( org . apache . hadoop . mapred . JobID ) { return getTaskReports ( jobId , TaskType . JOB_SETUP ) ; }
org . junit . Assert . assertEquals ( 0 , result . length )
testSetOutboundStandardMode ( ) { gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry registry = gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . getInstance ( ) ; gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum serviceName = gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum . RetrieveDocuments ; gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum direction = gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum . Outbound ; boolean status = true ; gov . hhs . fha . nhinc . docretrieve . configuration . jmx . DocumentRetrieve20WebServices docretrieve20 = mock ( gov . hhs . fha . nhinc . docretrieve . configuration . jmx . DocumentRetrieve20WebServices . class ) ; when ( docretrieve20 . getServiceName ( ) ) . thenReturn ( serviceEnum . RetrieveDocuments ) ; when ( docretrieve20 . isOutboundStandard ( ) ) . thenReturn ( status ) ; registry . registerWebServiceMXBean ( docretrieve20 ) ; boolean standard = registry . isStandard ( serviceName , direction ) ; "<AssertPlaceHolder>" ; } isStandard ( gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum , gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum ) { boolean standardMode = false ; for ( gov . hhs . fha . nhinc . configuration . jmx . WebServicesMXBean b : registeredBeans ) { if ( ( ( gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . isOutbound ( direction ) ) && ( b . getServiceName ( ) . equals ( serviceName ) ) ) && ( b . isOutboundStandard ( ) ) ) { standardMode = true ; } if ( ( ( gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . isInbound ( direction ) ) && ( b . getServiceName ( ) . equals ( serviceName ) ) ) && ( b . isInboundStandard ( ) ) ) { standardMode = true ; } } return standardMode ; }
org . junit . Assert . assertEquals ( true , standard )
givenClass_whenGetsFieldsByName_thenCorrect ( ) { final java . lang . Class < ? > birdClass = java . lang . Class . forName ( "com.baeldung.java.reflection.Bird" ) ; final java . lang . reflect . Field field = birdClass . getDeclaredField ( "walks" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
org . junit . Assert . assertEquals ( "walks" , field . getName ( ) )
testManageSimpleApplicationGateway ( ) { "<AssertPlaceHolder>" ; } runSample ( com . microsoft . azure . management . Azure ) { final java . lang . String rgName = com . microsoft . azure . management . resources . fluentcore . utils . SdkContext . randomResourceName ( "rgNEAGS" , 15 ) ; try { System . out . println ( "myFirstAppGateway" 7 ) ; System . out . println ( "myFirstAppGateway" 8 ) ; long t1 = java . lang . System . currentTimeMillis ( ) ; com . microsoft . azure . management . network . ApplicationGateway applicationGateway = azure . applicationGateways ( ) . define ( "myFirstAppGateway" ) . withRegion ( Region . US_EAST ) . withNewResourceGroup ( rgName ) . defineRequestRoutingRule ( "HTTP-80-to-8080" ) . fromPublicFrontend ( ) . fromFrontendHttpPort ( 80 ) . toBackendHttpPort ( 8080 ) . toBackendIPAddress ( "11.1.1.1" ) . toBackendIPAddress ( "11.1.1.2" ) . toBackendIPAddress ( "11.1.1.3" ) . toBackendIPAddress ( "myFirstAppGateway" 5 ) . attach ( ) . withNewPublicIPAddress ( ) . create ( ) ; long t2 = java . lang . System . currentTimeMillis ( ) ; System . out . println ( ( ( "myFirstAppGateway" 2 + ( ( t2 - t1 ) / 1000 ) ) + "myFirstAppGateway" 1 ) ) ; com . microsoft . azure . management . samples . Utils . print ( applicationGateway ) ; System . out . println ( "myFirstAppGateway" 3 ) ; System . out . println ( "Updating<sp>the<sp>application<sp>gateway" ) ; t1 = java . lang . System . currentTimeMillis ( ) ; applicationGateway . update ( ) . withoutRequestRoutingRule ( "HTTP-80-to-8080" ) . defineRequestRoutingRule ( "myFirstAppGateway" 6 ) . fromPublicFrontend ( ) . fromFrontendHttpsPort ( 1443 ) . withSslCertificateFromPfxFile ( new java . io . File ( com . microsoft . azure . management . network . samples . ManageSimpleApplicationGateway . class . getClassLoader ( ) . getResource ( "myTest.pfx" ) . getPath ( ) ) ) . withSslCertificatePassword ( "11.1.1.1" 0 ) . toBackendHttpPort ( 8080 ) . toBackendIPAddress ( "11.1.1.1" ) . toBackendIPAddress ( "11.1.1.2" ) . toBackendIPAddress ( "11.1.1.3" ) . toBackendIPAddress ( "myFirstAppGateway" 5 ) . withHostName ( "www.contoso.com" ) . withCookieBasedAffinity ( ) . attach ( ) . apply ( ) ; t2 = java . lang . System . currentTimeMillis ( ) ; System . out . println ( ( ( "myFirstAppGateway" 0 + ( ( t2 - t1 ) / 1000 ) ) + "myFirstAppGateway" 1 ) ) ; com . microsoft . azure . management . samples . Utils . print ( applicationGateway ) ; return true ; } catch ( java . lang . Exception f ) { System . out . println ( f . getMessage ( ) ) ; f . printStackTrace ( ) ; } finally { try { System . out . println ( ( "Deleting<sp>Resource<sp>Group:<sp>" + rgName ) ) ; azure . resourceGroups ( ) . deleteByName ( rgName ) ; System . out . println ( ( "myFirstAppGateway" 4 + rgName ) ) ; } catch ( java . lang . NullPointerException npe ) { System . out . println ( "myFirstAppGateway" 9 ) ; } catch ( java . lang . Exception g ) { g . printStackTrace ( ) ; } } return false ; }
org . junit . Assert . assertTrue ( com . microsoft . azure . management . samples . ManageSimpleApplicationGateway . runSample ( azure ) )
testGeneration ( ) { zemberek . lm . compression . SmoothLm lm = getTinyLm ( ) ; "<AssertPlaceHolder>" ; } getOrder ( ) { return order ; }
org . junit . Assert . assertEquals ( 3 , lm . getOrder ( ) )
testListIterator ( ) { java . util . List < java . lang . String > list = org . jboss . weld . util . collections . ImmutableList . of ( "foo" , "bar" , "buu" ) ; java . util . List < java . lang . String > expected = new java . util . ArrayList ( list ) ; java . util . Collections . reverse ( expected ) ; java . util . List < java . lang . String > result = new java . util . ArrayList ( ) ; for ( java . util . ListIterator < java . lang . String > iterator = list . listIterator ( list . size ( ) ) ; iterator . hasPrevious ( ) ; ) { result . add ( iterator . previous ( ) ) ; } "<AssertPlaceHolder>" ; } previous ( ) { if ( ! ( hasPrevious ( ) ) ) { throw new java . util . NoSuchElementException ( ) ; } return getElement ( ( -- ( position ) ) ) ; }
org . junit . Assert . assertEquals ( expected , result )
testMultipleConsumersFalse ( ) { org . hawkular . apm . api . model . trace . Consumer node = new org . hawkular . apm . api . model . trace . Consumer ( ) ; "<AssertPlaceHolder>" ; } multipleConsumers ( ) { java . util . Set < org . hawkular . apm . api . model . Property > props = getProperties ( Producer . PROPERTY_PUBLISH ) ; return ( ! ( props . isEmpty ( ) ) ) && ( props . iterator ( ) . next ( ) . getValue ( ) . equalsIgnoreCase ( Boolean . TRUE . toString ( ) ) ) ; }
org . junit . Assert . assertFalse ( node . multipleConsumers ( ) )
testNewInstance ( ) { "<AssertPlaceHolder>" ; }
org . junit . Assert . assertEquals ( control , control )
deveGerarXMLDeAcordoComOPadraoEstabelecido ( ) { final java . lang . String xmlEsperado = "<NFNotaInfoItem<sp>nItem=\"990\"><prod><cProd>ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq</cProd><cEAN>36811963532505</cEAN><xProd>OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP</xProd><NCM>99999999</NCM><NVE>AZ0123</NVE><CEST>9999999</CEST><EXTIPI>999</EXTIPI><CFOP>1302</CFOP><uCom>Bta64y</uCom><qCom>9999999999.9999</qCom><vUnCom>9999999999.9999999999</vUnCom><vProd>999999999999.99</vProd><cEANTrib>36811963532505</cEANTrib><uTrib>7wqG4h</uTrib><qTrib>9999999999.9999</qTrib><vUnTrib>9999999999.9999999999</vUnTrib><vFrete>999999999999.99</vFrete><vSeg>999999999999.99</vSeg><vDesc>999999999999.99</vDesc><vOutro>999999999999.99</vOutro><indTot>1</indTot><DI><nDI>ZRJihqWLyHnb</nDI><dDI>2014-02-02</dDI><xLocDesemb>kiVfWKB94ggsrWND0XBXwEjJkoiTXhkmX9qKGKzjpnEHHp852bDkYeEUkzpU</xLocDesemb><UFDesemb>RS</UFDesemb><dDesemb>2014-01-01</dDesemb><tpViaTransp>4</tpViaTransp><vAFRMM>999999999999.99</vAFRMM><tpIntermedio>3</tpIntermedio><CNPJ>12345678901234</CNPJ><UFTerceiro>RS</UFTerceiro><cExportador>E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU</cExportador><adi><nAdicao>999</nAdicao><nSeqAdic>999</nSeqAdic><cFabricante>sA2FBRFMMNgF1AKRDDXYOlc3zGvzEc69l6zQ5O5uAUe82XZ3szQfw01DW0Ki</cFabricante><vDescDI>999999999999.99</vDescDI><nDraw>99999999999</nDraw></adi></DI><xPed>NNxQ9nrQ3HCe5Mc</xPed><nItemPed>999999</nItemPed><med><nLote>yq50jVDZsvQVNuWoS45U</nLote><qLote>9999999.999</qLote><dFab>2014-01-01</dFab><dVal>2015-01-01</dVal><vPMC>999999999999.99</vPMC></med></prod><imposto><vTotTrib>999999999999.99</vTotTrib><ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>1</modBC><vBC>999999999999.99</vBC><pICMS>99.99</pICMS><vICMS>999999999999.99</vICMS></ICMS00></ICMS><IPI><clEnq>157br</clEnq><CNPJProd>12345678901234</CNPJProd><cSelo>iNEFifS1jexTxcCvgjlQ186nR6JAwM2koyjbWKA1DJSLmZy432GoSwoygXc5</cSelo><qSelo>999999999999</qSelo><cEnq>aT2</cEnq><IPITrib><CST>49</CST><vBC>999999999999.99</vBC><pIPI>99.99</pIPI><vIPI>999999999999.99</vIPI></IPITrib></IPI><II><vBC>999999999999.99</vBC><vDespAdu>999999999999.99</vDespAdu><vII>999999999999.99</vII><vIOF>999999999999.99</vIOF></II><PIS><PISAliq><CST>01</CST><vBC>999999999999.99</vBC><pPIS>99.99</pPIS><vPIS>999999999999.99</vPIS></PISAliq></PIS><PISST><qBCProd>99999999999.9999</qBCProd><vAliqProd>9999999999.9999</vAliqProd><vPIS>999999999999.99</vPIS></PISST><COFINS><COFINSAliq><CST>01</CST><vBC>999999999999.99</vBC><pCOFINS>99.99</pCOFINS><vCOFINS>999999999999.99</vCOFINS></COFINSAliq></COFINS><COFINSST><vBC>999999999999.99</vBC><pCOFINS>99.99</pCOFINS><vCOFINS>999999999999.00</vCOFINS></COFINSST><ICMSUFDest><vBCUFDest>9999999999999.99</vBCUFDest><pFCPUFDest>999.9999</pFCPUFDest><pICMSUFDest>999.9999</pICMSUFDest><pICMSInter>7.00</pICMSInter><pICMSInterPart>999.9999</pICMSInterPart><vFCPUFDest>9999999999999.99</vFCPUFDest><vICMSUFDest>9999999999999.99</vICMSUFDest><vICMSUFRemet>9999999999999.99</vICMSUFRemet></ICMSUFDest></imposto><impostoDevol><pDevol>100.00</pDevol><IPI><vIPIDevol>9999999999999.99</vIPIDevol></IPI></impostoDevol><infAdProd>R3s36BVI9k15xOe3hnlEpZRpPHEom9inv4hE1oo8hzHYG8X6D9sQjt6oLYiH6yToSFM95zueMhE4s270GB7iLUKcQTRHWLcHb1TU2fSYx2NAz5ZflI3hoTnN8zmqJtGzneaNpDRA5gJW7wxMg9IXIuUCxg25MlIQ46AbDQNc3HLl82g3awWKigBMli0bUEWIMf8C2GG2sB2Y9w1GnsfiDvw7RUuU5vATfWWvYFRCehm2UpDhBlrBjjXcWKYzXsT3x2PNtCC82JqY1nkKrgt2AHCPUjM0tCQk5EHFcssb8I0Rkc4s8aNcARXtFrBzmWqXDQPmCpLIGaAo7LlypOKKaqUNqkRkf8c930p8HaRDvQJealZsVnpwJn3Ev7yEaBZ9INe5PXFwkTQEfpNE3B8IokFMh0aUbu8mfzjKLBazSKW2qA4faIo2Wp5FmOmTzCMiPqznOq3Bl0zM4wmuo0rOXbswjaCUzPB0KpM8Yaze9TArOEDrV6Li</infAdProd></NFNotaInfoItem>" ; "<AssertPlaceHolder>" ; } getNFNotaInfoItem ( ) { final com . fincatto . documentofiscal . nfe310 . NFNotaInfoItem item = new com . fincatto . documentofiscal . nfe310 . NFNotaInfoItem ( ) ; item . setImposto ( com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItemImposto ( ) ) ; item . setInformacoesAdicionais ( "R3s36BVI9k15xOe3hnlEpZRpPHEom9inv4hE1oo8hzHYG8X6D9sQjt6oLYiH6yToSFM95zueMhE4s270GB7iLUKcQTRHWLcHb1TU2fSYx2NAz5ZflI3hoTnN8zmqJtGzneaNpDRA5gJW7wxMg9IXIuUCxg25MlIQ46AbDQNc3HLl82g3awWKigBMli0bUEWIMf8C2GG2sB2Y9w1GnsfiDvw7RUuU5vATfWWvYFRCehm2UpDhBlrBjjXcWKYzXsT3x2PNtCC82JqY1nkKrgt2AHCPUjM0tCQk5EHFcssb8I0Rkc4s8aNcARXtFrBzmWqXDQPmCpLIGaAo7LlypOKKaqUNqkRkf8c930p8HaRDvQJealZsVnpwJn3Ev7yEaBZ9INe5PXFwkTQEfpNE3B8IokFMh0aUbu8mfzjKLBazSKW2qA4faIo2Wp5FmOmTzCMiPqznOq3Bl0zM4wmuo0rOXbswjaCUzPB0KpM8Yaze9TArOEDrV6Li" ) ; item . setNumeroItem ( 990 ) ; item . setProduto ( com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItemProduto ( ) ) ; item . setImpostoDevolvido ( com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFImpostoDevolvido ( ) ) ; return item ; }
org . junit . Assert . assertEquals ( xmlEsperado , com . fincatto . documentofiscal . nfe310 . FabricaDeObjetosFake . getNFNotaInfoItem ( ) . toString ( ) )
testArgParsing ( ) { java . lang . String [ ] args = readCommandLine ( ) ; if ( args != null ) { org . apache . ranger . policyengine . CommandLineParser commandLineParser = new org . apache . ranger . policyengine . CommandLineParser ( ) ; org . apache . ranger . policyengine . PerfTestOptions parseResult = commandLineParser . parse ( args ) ; "<AssertPlaceHolder>" ; } } parse ( java . lang . String [ ] ) { org . apache . ranger . policyengine . PerfTestOptions ret = null ; if ( ( parseArguments ( args ) ) && ( validateInputFiles ( ) ) ) { ret = new org . apache . ranger . policyengine . PerfTestOptions ( servicePoliciesFileURL , requestFileURLs , statCollectionFileURL , concurrentClientCount , iterationsCount , isDynamicReorderingDisabled , isTrieLookupPrefixDisabled , isLazyTriePostSetupDisabled , configurationFileURL ) ; } else { showUsage ( ) ; } return ret ; }
org . junit . Assert . assertNotNull ( parseResult )
test_count_with_entity ( ) { insertRecords ( 8 ) ; int re = dao . count ( org . nutz . dao . test . meta . Pet . class , new org . nutz . dao . Condition ( ) { public java . lang . String toSql ( org . nutz . dao . entity . Entity < ? > entity ) { return ( entity . getField ( "nickName" ) . getColumnName ( ) ) + "<sp>IN<sp>('alias_5','alias_6')" ; } } ) ; "<AssertPlaceHolder>" ; } getColumnName ( ) { return columnName ; }
org . junit . Assert . assertEquals ( 2 , re )
testMap ( ) { org . sonatype . nexus . selector . Selector selector = buildSelector ( "someMap['a']<sp>==<sp>'alfa'" ) ; "<AssertPlaceHolder>" ; } evaluate ( org . sonatype . nexus . selector . VariableSource ) { return java . lang . Boolean . TRUE . equals ( expression . evaluate ( org . sonatype . nexus . selector . JexlSelector . asJexlContext ( source ) ) ) ; }
org . junit . Assert . assertTrue ( selector . evaluate ( source ) )
shouldFindChildButtonByClass ( ) { openStartActivity ( ) ; org . openqa . selenium . WebElement rootElement = driver ( ) . findElement ( org . openqa . selenium . By . id ( "l10n" ) ) ; java . lang . String buttonText = "EN<sp>Button" ; org . openqa . selenium . WebElement clickMe = rootElement . findElement ( org . openqa . selenium . By . className ( "android.widget.Button" ) ) ; "<AssertPlaceHolder>" ; } getText ( ) { throw new java . lang . RuntimeException ( io . selendroid . server . model . AndroidRElement . NOT_IMPLEMENTED_ERROR_MSG ) ; }
org . junit . Assert . assertEquals ( clickMe . getText ( ) , buttonText )
givenSystem_whenCalledClearProperties_thenDeleteAllPropertiesasResult ( ) { java . lang . System . getProperties ( ) . clear ( ) ; "<AssertPlaceHolder>" ; } getProperties ( ) { java . util . Properties properties = new java . util . Properties ( ) ; java . net . URL propertiesURL = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( "hibernate.properties" ) ; try ( java . io . FileInputStream inputStream = new java . io . FileInputStream ( propertiesURL . getFile ( ) ) ) { properties . load ( inputStream ) ; } return properties ; }
org . junit . Assert . assertTrue ( java . lang . System . getProperties ( ) . isEmpty ( ) )
testRoundTrip ( ) { com . stratio . ingestion . sink . elasticsearch . ElasticSearchDynamicSerializer fixture = new com . stratio . ingestion . sink . elasticsearch . ElasticSearchDynamicSerializer ( ) ; org . apache . flume . Context context = new org . apache . flume . Context ( ) ; fixture . configure ( context ) ; java . lang . String message = "test<sp>body" ; java . util . Map < java . lang . String , java . lang . String > headers = org . elasticsearch . common . collect . Maps . newHashMap ( ) ; headers . put ( "headerNameOne" , "headerValueOne" ) ; headers . put ( "headerNameTwo" , "headerValueTwo" ) ; headers . put ( "headerNameThree" , "headerValueThree" ) ; org . apache . flume . Event event = org . apache . flume . event . EventBuilder . withBody ( message . getBytes ( com . stratio . ingestion . sink . elasticsearch . ElasticSearchEventSerializer . charset ) ) ; event . setHeaders ( headers ) ; org . elasticsearch . common . xcontent . XContentBuilder expected = jsonBuilder ( ) . startObject ( ) ; expected . field ( "body" , new java . lang . String ( message . getBytes ( ) , com . stratio . ingestion . sink . elasticsearch . ElasticSearchEventSerializer . charset ) ) ; for ( java . lang . String headerName : headers . keySet ( ) ) { expected . field ( headerName , new java . lang . String ( headers . get ( headerName ) . getBytes ( ) , com . stratio . ingestion . sink . elasticsearch . ElasticSearchEventSerializer . charset ) ) ; } expected . endObject ( ) ; org . elasticsearch . common . xcontent . XContentBuilder actual = fixture . getContentBuilder ( event ) ; "<AssertPlaceHolder>" ; } getContentBuilder ( org . apache . flume . Event ) { org . elasticsearch . common . xcontent . XContentBuilder builder = jsonBuilder ( ) . startObject ( ) ; appendBody ( builder , event ) ; appendHeaders ( builder , event ) ; return builder ; }
org . junit . Assert . assertEquals ( new java . lang . String ( expected . bytes ( ) . array ( ) ) , new java . lang . String ( actual . bytes ( ) . array ( ) ) )
testSerialization ( ) { org . jfree . chart . renderer . xy . HighLowRenderer r1 = new org . jfree . chart . renderer . xy . HighLowRenderer ( ) ; r1 . setCloseTickPaint ( Color . green ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( r1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . renderer . xy . HighLowRenderer r2 = ( ( org . jfree . chart . renderer . xy . HighLowRenderer ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } }
org . junit . Assert . assertEquals ( r1 , r2 )
testMaximumTimeMillisecondsDefault ( ) { final com . allanbank . mongodb . builder . MapReduce . Builder b = com . allanbank . mongodb . builder . MapReduce . builder ( ) ; b . setMapFunction ( "map" ) ; b . setReduceFunction ( "reduce" ) ; b . setOutputType ( MapReduce . OutputType . INLINE ) ; final com . allanbank . mongodb . builder . MapReduce command = b . build ( ) ; "<AssertPlaceHolder>" ; } getMaximumTimeMilliseconds ( ) { return myMaximumTimeMilliseconds ; }
org . junit . Assert . assertThat ( command . getMaximumTimeMilliseconds ( ) , org . hamcrest . Matchers . is ( 0L ) )
testBucketSort ( ) { "<AssertPlaceHolder>" ; testSpeed ( "BucketSort" , new kanzi . util . sort . BucketSort ( 16 ) , 50000 , 65535 ) ; } testCorrectness ( java . lang . String , kanzi . IntSorter , int ) { System . out . println ( ( "\n\nTest" + sortName ) ) ; for ( int ii = 1 ; ii <= iters ; ii ++ ) { System . out . println ( ( "\n\nCorrectness<sp>test<sp>" + ii ) ) ; final int [ ] array = new int [ 64 ] ; java . util . Random random = new java . util . Random ( ) ; for ( int i = ii ; i < ( array . length ) ; i ++ ) array [ i ] = 64 + ( random . nextInt ( ( ii * 8 ) ) ) ; byte [ ] b = new byte [ array . length ] ; for ( int i = ii ; i < ( b . length ) ; i ++ ) b [ i ] = ( ( byte ) ( array [ i ] ) ) ; System . out . println ( new java . lang . String ( b ) ) ; for ( int i = ii ; i < ( array . length ) ; i ++ ) System . out . print ( ( ( array [ i ] ) + "<sp>" ) ) ; System . out . println ( ) ; sorter . sort ( array , ii , ( ( array . length ) - ii ) ) ; for ( int i = ii ; i < ( b . length ) ; i ++ ) b [ i ] = ( ( byte ) ( ( array [ i ] ) & 255 ) ) ; System . out . println ( new java . lang . String ( b ) ) ; for ( int i = ii ; i < ( array . length ) ; i ++ ) { System . out . print ( ( ( array [ i ] ) + "<sp>" ) ) ; if ( ( i > 0 ) && ( ( array [ i ] ) < ( array [ ( i - 1 ) ] ) ) ) { System . err . println ( ( "Error<sp>at<sp>position<sp>" + ( i - ii ) ) ) ; return false ; } } } return true ; }
org . junit . Assert . assertTrue ( testCorrectness ( "BucketSort" , new kanzi . util . sort . BucketSort ( 8 ) , 20 ) )
testIsIdle ( ) { final com . allanbank . mongodb . MongoClientConfiguration config = new com . allanbank . mongodb . MongoClientConfiguration ( ) ; final com . allanbank . mongodb . client . state . Cluster cluster = new com . allanbank . mongodb . client . state . Cluster ( config , com . allanbank . mongodb . client . ClusterType . SHARDED ) ; final com . allanbank . mongodb . client . state . Server server = cluster . add ( "localhost:27017" ) ; final com . allanbank . mongodb . client . connection . Connection mockConnection = createMock ( com . allanbank . mongodb . client . connection . Connection . class ) ; final com . allanbank . mongodb . client . state . ServerSelector mockSelector = createMock ( com . allanbank . mongodb . client . state . ServerSelector . class ) ; final com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory mockFactory = createMock ( com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory . class ) ; final org . easymock . Capture < java . beans . PropertyChangeListener > listener = new org . easymock . Capture < java . beans . PropertyChangeListener > ( ) ; mockConnection . addPropertyChangeListener ( capture ( listener ) ) ; expectLastCall ( ) ; expect ( mockConnection . isIdle ( ) ) . andReturn ( false ) ; replay ( mockConnection , mockSelector , mockFactory ) ; final com . allanbank . mongodb . client . connection . sharded . ShardedConnection conn = new com . allanbank . mongodb . client . connection . sharded . ShardedConnection ( mockConnection , server , cluster , mockSelector , mockFactory , config ) ; "<AssertPlaceHolder>" ; verify ( mockConnection , mockSelector , mockFactory ) ; reset ( mockConnection , mockSelector , mockFactory ) ; mockConnection . removePropertyChangeListener ( listener . getValue ( ) ) ; expectLastCall ( ) ; mockConnection . close ( ) ; replay ( mockConnection , mockSelector , mockFactory ) ; conn . close ( ) ; verify ( mockConnection , mockSelector , mockFactory ) ; } isIdle ( ) { return myLastUsedConnection . get ( ) . isIdle ( ) ; }
org . junit . Assert . assertThat ( conn . isIdle ( ) , org . hamcrest . Matchers . is ( false ) )
testIntrospector ( ) { com . ibm . ws . threading . internal . PolicyExecutorImpl exec = ( ( com . ibm . ws . threading . internal . PolicyExecutorImpl ) ( provider . create ( "<sp>withheldConcurrency<sp>=<sp>0" 8 ) . expedite ( 5 ) . maxConcurrency ( 10 ) . maxQueueSize ( 3 ) . maxWaitForEnqueue ( 30 ) . startTimeout ( 10 ) . runIfQueueFull ( true ) ) ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; java . io . PrintWriter pw = new java . io . PrintWriter ( out ) ; exec . introspect ( pw ) ; pw . flush ( ) ; java . lang . String output = new java . lang . String ( out . toByteArray ( ) ) ; java . lang . String EOL = java . lang . System . getProperty ( "<sp>withheldConcurrency<sp>=<sp>0" 6 ) ; java . lang . String expectedoutput = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "PolicyExecutorProvider-testIntrospector" + EOL ) + "<sp>expedite<sp>=<sp>5" ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 1 ) + EOL ) + "<sp>maxQueueSize<sp>=<sp>3" ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 4 ) + EOL ) + "<sp>runIfQueueFull<sp>=<sp>true" ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 5 ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 3 ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 7 ) + EOL ) + "<sp>state<sp>=<sp>ACTIVE" ) + EOL ) + "<sp>concurrency<sp>callback<sp>=<sp>null" ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 2 ) + EOL ) + "<sp>withheldConcurrency<sp>=<sp>0" 9 ) + EOL ) + "<sp>Running<sp>Task<sp>Count<sp>=<sp>0" ) + EOL ) + "<sp>None" 0 ) + EOL ) + "<sp>None" ) + EOL ) + "<sp>Queued<sp>Task<sp>Futures<sp>(up<sp>to<sp>first<sp>50):" ) + EOL ) + "<sp>None" ) + EOL ) + EOL ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return properties . get ( name ) ; }
org . junit . Assert . assertEquals ( "<sp>withheldConcurrency<sp>=<sp>0" 0 , expectedoutput , output )
testDdl_TYPE_INT ( ) { java . lang . String ddl = ( "CREATE<sp>FOREIGN<sp>TABLE<sp>ONE_TYPE<sp>(" + ( org . teiid . designer . vdb . dynamic . TestModelToDdlGenerator . BQT2_TYPE_DDL . TYPE_INT ) ) + ")<sp>OPTIONS(UPDATABLE<sp>'TRUE');" ; java . lang . String expectedDdl = ( "CREATE<sp>FOREIGN<sp>TABLE<sp>ONE_TYPE<sp>(" + ( org . teiid . designer . vdb . dynamic . TestModelToDdlGenerator . EXPECTED_BQT2_TYPE_DDL . TYPE_INT ) ) + ")<sp>OPTIONS(UPDATABLE<sp>'TRUE');" ; java . lang . String generatedDdl = roundTrip ( ddl , false ) ; "<AssertPlaceHolder>" ; } roundTrip ( java . lang . String , boolean ) { org . teiid . designer . core . workspace . ModelResource modelResource = createModelResource ( ddl , isVirtual ) ; java . lang . String generatedDdl = generator . generate ( modelResource ) ; generatedDdl = removeWhitespace ( generatedDdl ) ; return generatedDdl ; }
org . junit . Assert . assertEquals ( expectedDdl , generatedDdl )
getWorkerNoneEligible ( ) { alluxio . client . block . policy . RoundRobinPolicy policy = new alluxio . client . block . policy . RoundRobinPolicy ( alluxio . ConfigurationTestUtils . defaults ( ) ) ; alluxio . client . block . policy . options . GetWorkerOptions options = alluxio . client . block . policy . options . GetWorkerOptions . defaults ( ) . setBlockWorkerInfos ( new java . util . ArrayList ( ) ) . setBlockInfo ( new alluxio . wire . BlockInfo ( ) . setLength ( ( 2 * ( ( long ) ( alluxio . Constants . GB ) ) ) ) ) ; "<AssertPlaceHolder>" ; } getWorker ( alluxio . client . block . policy . options . GetWorkerOptions ) { java . util . Set < alluxio . wire . WorkerNetAddress > eligibleAddresses = new java . util . HashSet ( ) ; for ( alluxio . client . block . BlockWorkerInfo info : options . getBlockWorkerInfos ( ) ) { eligibleAddresses . add ( info . getNetAddress ( ) ) ; } alluxio . wire . WorkerNetAddress address = mBlockLocationCache . get ( options . getBlockInfo ( ) . getBlockId ( ) ) ; if ( ( address != null ) && ( eligibleAddresses . contains ( address ) ) ) { return address ; } else { address = null ; } if ( ! ( mInitialized ) ) { mWorkerInfoList = com . google . common . collect . Lists . newArrayList ( options . getBlockWorkerInfos ( ) ) ; java . util . Collections . shuffle ( mWorkerInfoList ) ; mIndex = 0 ; mInitialized = true ; } for ( int i = 0 ; i < ( mWorkerInfoList . size ( ) ) ; i ++ ) { alluxio . wire . WorkerNetAddress candidate = mWorkerInfoList . get ( mIndex ) . getNetAddress ( ) ; alluxio . client . block . BlockWorkerInfo workerInfo = findBlockWorkerInfo ( options . getBlockWorkerInfos ( ) , candidate ) ; mIndex = ( ( mIndex ) + 1 ) % ( mWorkerInfoList . size ( ) ) ; if ( ( ( workerInfo != null ) && ( ( workerInfo . getCapacityBytes ( ) ) >= ( options . getBlockInfo ( ) . getLength ( ) ) ) ) && ( eligibleAddresses . contains ( candidate ) ) ) { address = candidate ; break ; } } mBlockLocationCache . put ( options . getBlockInfo ( ) . getBlockId ( ) , address ) ; return address ; }
org . junit . Assert . assertNull ( policy . getWorker ( options ) )
testSetIPv4 ( ) { org . opennaas . extensions . router . capability . ip . IIPCapability ipCapability = ( ( org . opennaas . extensions . router . capability . ip . IIPCapability ) ( routerResource . getCapability ( org . opennaas . itests . helpers . InitializerTestHelper . getCapabilityInformation ( TestsConstants . IP_CAPABILITY_TYPE ) ) ) ) ; ipCapability . setIPv4 ( org . opennaas . itests . router . helpers . ParamCreationHelper . getLogicalPort ( ) , org . opennaas . itests . router . helpers . ParamCreationHelper . getIPProtocolEndPoint ( ) ) ; org . opennaas . extensions . queuemanager . IQueueManagerCapability queueCapability = ( ( org . opennaas . extensions . queuemanager . IQueueManagerCapability ) ( routerResource . getCapability ( org . opennaas . itests . helpers . InitializerTestHelper . getCapabilityInformation ( TestsConstants . QUEUE_CAPABILIY_TYPE ) ) ) ) ; org . opennaas . core . resources . queue . QueueResponse queueResponse = ( ( org . opennaas . core . resources . queue . QueueResponse ) ( queueCapability . execute ( ) ) ) ; "<AssertPlaceHolder>" ; } isOk ( ) { for ( org . opennaas . core . resources . action . ActionResponse action : responses ) { if ( ( action . getStatus ( ) ) == ( org . opennaas . core . resources . action . ActionResponse . STATUS . ERROR ) ) return false ; } return ( getConfirmResponse ( ) . getStatus ( ) . equals ( STATUS . OK ) ) && ( getRefreshResponse ( ) . getStatus ( ) . equals ( STATUS . OK ) ) ; }
org . junit . Assert . assertTrue ( queueResponse . isOk ( ) )
testSerialization ( ) { org . jfree . chart . renderer . GrayPaintScale g1 = new org . jfree . chart . renderer . GrayPaintScale ( ) ; org . jfree . chart . renderer . GrayPaintScale g2 = ( ( org . jfree . chart . renderer . GrayPaintScale ) ( org . jfree . chart . TestUtilities . serialised ( g1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; }
org . junit . Assert . assertEquals ( g1 , g2 )
testClassToModel ( ) { java . lang . Object outmodel = null ; try { outmodel = com . qingstor . sdk . utils . QSParamInvokeUtil . getOutputModel ( Bucket . PutBucketACLOutput . class ) ; } catch ( com . qingstor . sdk . exception . QSException e ) { e . printStackTrace ( ) ; } "<AssertPlaceHolder>" ; } getOutputModel ( java . lang . Class ) { try { return className . newInstance ( ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; throw new com . qingstor . sdk . exception . QSException ( e . getMessage ( ) ) ; } }
org . junit . Assert . assertEquals ( outmodel . getClass ( ) . getName ( ) , Bucket . PutBucketACLOutput . class . getName ( ) )
testGetCustomFileExtensionsToMimeTypesMap ( ) { ddf . mime . custom . CustomMimeTypeResolver resolver = new ddf . mime . custom . CustomMimeTypeResolver ( ) ; java . util . Map < java . lang . String , java . lang . String > fileExtensionsToMimeTypes = resolver . getCustomFileExtensionsToMimeTypesMap ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( fileExtensionsToMimeTypes . size ( ) ) == 0 ) )
given_a_persisted_order_when_find_by_id_multiple_times_then_found_orders_equals ( ) { org . aggregateframework . sample . complexmodel . command . domain . entity . BookingOrder bookingOrder = buildOrder ( ) ; orderRepository . save ( bookingOrder ) ; orderRepository . flush ( ) ; org . aggregateframework . sample . complexmodel . command . domain . entity . BookingOrder foundOneBookingOrder = orderRepository . findOne ( bookingOrder . getId ( ) ) ; org . aggregateframework . sample . complexmodel . command . domain . entity . BookingOrder foundOtherBookingOrder = orderRepository . findOne ( bookingOrder . getId ( ) ) ; "<AssertPlaceHolder>" ; } equal ( E extends org . aggregateframework . entity . DomainObject , E extends org . aggregateframework . entity . DomainObject ) { if ( ( entity == null ) || ( originalEntity == null ) ) { return false ; } if ( ! ( entity . getClass ( ) . equals ( originalEntity . getClass ( ) ) ) ) { return false ; } org . aggregateframework . utils . List < java . lang . reflect . Field > oneToOneFields = org . aggregateframework . utils . DomainObjectUtils . getOneToOneFields ( entity . getClass ( ) ) ; org . aggregateframework . utils . List < java . lang . reflect . Field > oneToManyFields = org . aggregateframework . utils . DomainObjectUtils . getOneToManyFields ( entity . getClass ( ) ) ; final org . aggregateframework . utils . Set < java . lang . reflect . Field > excludeFields = new org . aggregateframework . utils . HashSet < java . lang . reflect . Field > ( ) ; excludeFields . addAll ( oneToOneFields ) ; excludeFields . addAll ( oneToManyFields ) ; final org . aggregateframework . utils . List < java . lang . reflect . Field > comparedFields = new org . aggregateframework . utils . ArrayList < java . lang . reflect . Field > ( ) ; org . aggregateframework . utils . ReflectionUtils . doWithFields ( entity . getClass ( ) , new org . aggregateframework . utils . ReflectionUtils . FieldCallback ( ) { @ org . aggregateframework . utils . Override public void doWith ( java . lang . reflect . Field field ) throws org . aggregateframework . utils . IllegalAccessException , org . aggregateframework . utils . IllegalArgumentException { comparedFields . add ( field ) ; } } , new org . aggregateframework . utils . ReflectionUtils . FieldFilter ( ) { @ org . aggregateframework . utils . Override public boolean matches ( java . lang . reflect . Field field ) { if ( excludeFields . contains ( field ) ) { return false ; } else if ( ( field . getAnnotation ( org . aggregateframework . entity . Transient . class ) ) != null ) { return false ; } else { return true ; } } } ) ; for ( java . lang . reflect . Field field : comparedFields ) { org . aggregateframework . utils . ReflectionUtils . makeAccessible ( field ) ; java . lang . Object value = org . aggregateframework . utils . ReflectionUtils . getField ( field , entity ) ; java . lang . Object originalValue = org . aggregateframework . utils . ReflectionUtils . getField ( field , originalEntity ) ; if ( ! ( org . aggregateframework . utils . ObjectUtils . nullSafeEquals ( value , originalValue ) ) ) { return false ; } } return true ; }
org . junit . Assert . assertTrue ( org . aggregateframework . utils . DomainObjectUtils . equal ( foundOneBookingOrder , foundOtherBookingOrder ) )
getInstanceEquals ( ) { "<AssertPlaceHolder>" ; } getInstance ( ) { for ( java . nio . file . spi . FileSystemProvider provider : java . nio . file . spi . FileSystemProvider . installedProviders ( ) ) { if ( provider instanceof org . apache . taverna . robundle . fs . BundleFileSystemProvider ) { return ( ( org . apache . taverna . robundle . fs . BundleFileSystemProvider ) ( provider ) ) ; } } return org . apache . taverna . robundle . fs . BundleFileSystemProvider . Singleton . INSTANCE ; }
org . junit . Assert . assertEquals ( org . apache . taverna . robundle . fs . BundleFileSystemProvider . getInstance ( ) , new org . apache . taverna . robundle . fs . BundleFileSystemProvider ( ) )
singleNack ( ) { java . lang . String q = channel . queueDeclare ( "" , false , true , false , null ) . getQueue ( ) ; byte [ ] m1 = "1" . getBytes ( ) ; byte [ ] m2 = "2" . getBytes ( ) ; basicPublishVolatile ( m1 , q ) ; basicPublishVolatile ( m2 , q ) ; long tag1 = checkDelivery ( channel . basicGet ( q , false ) , m1 , false ) ; long tag2 = checkDelivery ( channel . basicGet ( q , false ) , m2 , false ) ; com . rabbitmq . client . QueueingConsumer c = new com . rabbitmq . client . QueueingConsumer ( secondaryChannel ) ; java . lang . String consumerTag = secondaryChannel . basicConsume ( q , false , c ) ; channel . basicNack ( tag2 , false , true ) ; long tag3 = checkDelivery ( c . nextDelivery ( ) , m2 , true ) ; secondaryChannel . basicCancel ( consumerTag ) ; secondaryChannel . basicNack ( tag3 , false , false ) ; "<AssertPlaceHolder>" ; channel . basicAck ( tag1 , false ) ; channel . basicNack ( tag3 , false , true ) ; expectError ( AMQP . PRECONDITION_FAILED ) ; } basicGet ( java . lang . String , boolean ) { return delegate . basicGet ( queue , autoAck ) ; }
org . junit . Assert . assertNull ( channel . basicGet ( q , false ) )
testStart ( ) { java . lang . String status = "state" ; doReturn ( status ) . when ( schedulerResource . schedulerService ) . start ( ) ; javax . ws . rs . core . Response mockResponse = mock ( javax . ws . rs . core . Response . class ) ; doReturn ( mockResponse ) . when ( schedulerResource ) . buildPlainTextOkResponse ( status ) ; javax . ws . rs . core . Response testResult = schedulerResource . start ( ) ; "<AssertPlaceHolder>" ; verify ( schedulerResource . schedulerService , times ( 1 ) ) . start ( ) ; verify ( schedulerResource , times ( 1 ) ) . buildPlainTextOkResponse ( status ) ; } start ( ) { if ( getPolicy ( ) . isAllowed ( SchedulerAction . NAME ) ) { getScheduler ( ) . start ( ) ; } return getScheduler ( ) . getStatus ( ) . name ( ) ; }
org . junit . Assert . assertEquals ( mockResponse , testResult )
testGetLogRecordCount ( ) { long count = java . lang . System . currentTimeMillis ( ) ; when ( impl . getLogRecordCount ( ) ) . thenReturn ( count ) ; "<AssertPlaceHolder>" ; verify ( impl , times ( 1 ) ) . getLogRecordCount ( ) ; } getLogRecordCount ( ) { checkClosedOrInError ( "getLogRecordCount" ) ; return org . apache . distributedlog . util . Utils . ioResult ( getLogRecordCountAsync ( DLSN . InitialDLSN ) ) ; }
org . junit . Assert . assertEquals ( count , manager . getLogRecordCount ( ) )
testHandleSequenceFileAddedEventMultipleReturn ( ) { java . lang . Class < ? extends ca . corefacility . bioinformatics . irida . model . event . ProjectEvent > clazz = ca . corefacility . bioinformatics . irida . model . event . DataAddedToSampleProjectEvent . class ; ca . corefacility . bioinformatics . irida . model . project . Project project = new ca . corefacility . bioinformatics . irida . model . project . Project ( ) ; ca . corefacility . bioinformatics . irida . model . sample . Sample sample = new ca . corefacility . bioinformatics . irida . model . sample . Sample ( ) ; ca . corefacility . bioinformatics . irida . model . sequenceFile . SequenceFile file = new ca . corefacility . bioinformatics . irida . model . sequenceFile . SequenceFile ( ) ; ca . corefacility . bioinformatics . irida . model . sequenceFile . SingleEndSequenceFile seqObj1 = new ca . corefacility . bioinformatics . irida . model . sequenceFile . SingleEndSequenceFile ( file ) ; ca . corefacility . bioinformatics . irida . model . sequenceFile . SingleEndSequenceFile seqObj2 = new ca . corefacility . bioinformatics . irida . model . sequenceFile . SingleEndSequenceFile ( file ) ; ca . corefacility . bioinformatics . irida . model . sample . SampleSequencingObjectJoin join1 = new ca . corefacility . bioinformatics . irida . model . sample . SampleSequencingObjectJoin ( sample , seqObj1 ) ; ca . corefacility . bioinformatics . irida . model . sample . SampleSequencingObjectJoin join2 = new ca . corefacility . bioinformatics . irida . model . sample . SampleSequencingObjectJoin ( sample , seqObj2 ) ; when ( psjRepository . getProjectForSample ( sample ) ) . thenReturn ( com . google . common . collect . Lists . newArrayList ( new ca . corefacility . bioinformatics . irida . model . joins . impl . ProjectSampleJoin ( project , sample , true ) ) ) ; when ( eventRepository . save ( any ( ca . corefacility . bioinformatics . irida . model . event . ProjectEvent . class ) ) ) . thenReturn ( new ca . corefacility . bioinformatics . irida . model . event . DataAddedToSampleProjectEvent ( project , sample ) ) ; java . lang . Object [ ] args = new java . lang . Object [ ] { } ; ca . corefacility . bioinformatics . irida . events . MethodEvent methodEvent = new ca . corefacility . bioinformatics . irida . events . MethodEvent ( clazz , com . google . common . collect . Lists . newArrayList ( join1 , join2 ) , args ) ; handler . delegate ( methodEvent ) ; org . mockito . ArgumentCaptor < ca . corefacility . bioinformatics . irida . model . event . ProjectEvent > captor = org . mockito . ArgumentCaptor . forClass ( ca . corefacility . bioinformatics . irida . model . event . ProjectEvent . class ) ; verify ( eventRepository ) . save ( captor . capture ( ) ) ; ca . corefacility . bioinformatics . irida . model . event . ProjectEvent event = captor . getValue ( ) ; "<AssertPlaceHolder>" ; verify ( projectRepository ) . save ( any ( ca . corefacility . bioinformatics . irida . model . project . Project . class ) ) ; verify ( sampleRepository ) . save ( any ( ca . corefacility . bioinformatics . irida . model . sample . Sample . class ) ) ; } getValue ( ) { return value ; }
org . junit . Assert . assertTrue ( ( event instanceof ca . corefacility . bioinformatics . irida . model . event . DataAddedToSampleProjectEvent ) )
shouldHashCodesForWrapperAndWrappedEntityBeEquals ( ) { final com . qcadoo . model . api . Entity secondEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; final com . qcadoo . model . api . Entity firstEntity = new com . qcadoo . model . internal . DefaultEntity ( dataDefinition ) ; firstEntity . setId ( 1L ) ; firstEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . STRING_FIELD_NAME , "maku" ) ; firstEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BOOLEAN_FIELD_NAME , true ) ; secondEntity . setId ( 2L ) ; secondEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . STRING_FIELD_NAME , "rocks" ) ; secondEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BOOLEAN_FIELD_NAME , true ) ; when ( dataDefinition . get ( firstEntity . getId ( ) ) ) . thenReturn ( firstEntity ) ; when ( dataDefinition . get ( secondEntity . getId ( ) ) ) . thenReturn ( secondEntity ) ; final com . qcadoo . model . api . Entity firstWrappedEntity = buildEntityWrapper ( firstEntity ) ; final com . qcadoo . model . api . Entity secondWrappedEntity = buildEntityWrapper ( secondEntity ) ; firstWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , secondWrappedEntity ) ; secondWrappedEntity . setField ( com . qcadoo . model . internal . AbstractEntityWrapperTest . BELONGS_TO_FIELD_NAME , firstWrappedEntity ) ; try { "<AssertPlaceHolder>" ; } catch ( java . lang . StackOverflowError e ) { org . junit . Assert . fail ( ) ; } } hashCode ( ) { return org . apache . commons . lang3 . ObjectUtils . hashCode ( contents ) ; }
org . junit . Assert . assertTrue ( ( ( firstWrappedEntity . hashCode ( ) ) == ( firstEntity . hashCode ( ) ) ) )
testDetectApplicationEnviHdr ( ) { java . io . InputStream iStream = org . apache . tika . detect . MagicDetectorTest . class . getResourceAsStream ( "/test-documents/ang20150420t182050_corr_v1e_img.hdr" ) ; byte [ ] data = org . apache . tika . io . IOUtils . toByteArray ( iStream ) ; org . apache . tika . mime . MediaType testMT = new org . apache . tika . mime . MediaType ( "application" , "envi.hdr" ) ; org . apache . tika . detect . Detector detector = new org . apache . tika . detect . MagicDetector ( testMT , data , null , false , 0 , 0 ) ; java . io . InputStream stream = new org . apache . tika . detect . MagicDetectorTest . RestrictiveInputStream ( data ) ; "<AssertPlaceHolder>" ; } detect ( java . io . InputStream , org . apache . tika . metadata . Metadata ) { int limit = getMarkLimit ( ) ; input . mark ( limit ) ; java . io . InputStream limitedStream = new org . apache . commons . io . input . BoundedInputStream ( input , limit ) ; org . apache . tika . parser . html . charsetdetector . PreScanner preScanner = new org . apache . tika . parser . html . charsetdetector . PreScanner ( limitedStream ) ; java . nio . charset . Charset detectedCharset = preScanner . detectBOM ( ) ; if ( detectedCharset == null ) detectedCharset = org . apache . tika . parser . html . charsetdetector . StandardHtmlEncodingDetector . charsetFromContentType ( metadata ) ; if ( detectedCharset == null ) detectedCharset = preScanner . scan ( ) ; input . reset ( ) ; return detectedCharset ; }
org . junit . Assert . assertEquals ( testMT , detector . detect ( stream , new org . apache . tika . metadata . Metadata ( ) ) )
attributeIsUniqueWithinTheSystem ( ) { when ( trackedEntityAttributeStore . getTrackedEntityInstanceUidWithUniqueAttributeValue ( any ( org . hisp . dhis . trackedentity . TrackedEntityInstanceQueryParams . class ) ) ) . thenReturn ( java . util . Optional . empty ( ) ) ; java . lang . String teaValue = "Firstname" ; java . lang . String result = trackedEntityAttributeService . validateAttributeUniquenessWithinScope ( tea , teaValue , teiPassedInPayload , orgUnit ) ; "<AssertPlaceHolder>" ; } validateAttributeUniquenessWithinScope ( org . hisp . dhis . trackedentity . TrackedEntityAttribute , java . lang . String , org . hisp . dhis . trackedentity . TrackedEntityInstance , org . hisp . dhis . organisationunit . OrganisationUnit ) { org . springframework . util . Assert . notNull ( trackedEntityAttribute , "tracked<sp>entity<sp>attribute<sp>is<sp>required." ) ; org . springframework . util . Assert . notNull ( value , "tracked<sp>entity<sp>attribute<sp>value<sp>is<sp>required." ) ; org . hisp . dhis . trackedentity . TrackedEntityInstanceQueryParams params = new org . hisp . dhis . trackedentity . TrackedEntityInstanceQueryParams ( ) ; params . addAttribute ( new org . hisp . dhis . common . QueryItem ( trackedEntityAttribute , org . hisp . dhis . common . QueryOperator . EQ , value , trackedEntityAttribute . getValueType ( ) , trackedEntityAttribute . getAggregationType ( ) , trackedEntityAttribute . getOptionSet ( ) ) ) ; if ( trackedEntityAttribute . getOrgunitScope ( ) ) { org . springframework . util . Assert . notNull ( organisationUnit , "organisation<sp>unit<sp>is<sp>required<sp>for<sp>org<sp>unit<sp>scope" ) ; params . addOrganisationUnit ( organisationUnit ) ; } java . util . Optional < java . lang . String > fetchedTeiUid = trackedEntityAttributeStore . getTrackedEntityInstanceUidWithUniqueAttributeValue ( params ) ; if ( ( fetchedTeiUid . isPresent ( ) ) && ( ( trackedEntityInstance == null ) || ( ! ( fetchedTeiUid . get ( ) . equals ( trackedEntityInstance . getUid ( ) ) ) ) ) ) { return ( ( "Non-unique<sp>attribute<sp>value<sp>'" + value ) + "'<sp>for<sp>attribute<sp>" ) + ( trackedEntityAttribute . getUid ( ) ) ; } return null ; }
org . junit . Assert . assertNull ( result )
testSGInference1 ( ) { org . nd4j . linalg . api . ndarray . INDArray syn0 = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 0.01F ) ; org . nd4j . linalg . api . ndarray . INDArray syn1 = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 0.02F ) ; org . nd4j . linalg . api . ndarray . INDArray syn1Neg = org . nd4j . linalg . factory . Nd4j . create ( 10 , 10 ) . assign ( 0.03F ) ; org . nd4j . linalg . api . ndarray . INDArray expTable = org . nd4j . linalg . factory . Nd4j . create ( 10000 ) . assign ( 0.5F ) ; org . nd4j . linalg . api . ndarray . INDArray table = org . nd4j . linalg . factory . Nd4j . create ( 100000 ) ; double lr = 0.025 ; org . nd4j . linalg . api . ndarray . INDArray syn0dup = syn0 . dup ( ) ; org . nd4j . linalg . api . ndarray . INDArray syn1dup = syn1 . dup ( ) ; org . nd4j . linalg . api . ndarray . INDArray syn1NegDup = syn1Neg . dup ( ) ; org . nd4j . linalg . api . ndarray . INDArray inference = org . nd4j . linalg . factory . Nd4j . create ( 10 ) . assign ( 0.04F ) ; org . nd4j . linalg . api . ndarray . INDArray dup = inference . dup ( ) ; org . nd4j . linalg . api . ndarray . INDArray expInference = org . nd4j . linalg . factory . Nd4j . create ( 10 ) . assign ( 0.0395F ) ; org . nd4j . linalg . api . ops . aggregates . impl . AggregateSkipGram op = new org . nd4j . linalg . api . ops . aggregates . impl . AggregateSkipGram ( syn0 , syn1 , syn1Neg , expTable , null , 0 , new int [ ] { 1 , 2 } , new int [ ] { 1 , 1 } , 0 , 0 , 10 , lr , 1L , 10 , inference ) ; org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( op ) ; "<AssertPlaceHolder>" ; } exec ( java . lang . String ) { code = org . datavec . python . PythonExecutioner . getFunctionalCode ( ( "__f_" + ( java . lang . Thread . currentThread ( ) . getId ( ) ) ) , code ) ; org . datavec . python . PythonExecutioner . acquireGIL ( ) ; log . info ( "CPython:<sp>PyRun_SimpleStringFlag()" ) ; log . info ( code ) ; int result = PyRun_SimpleStringFlags ( code , null ) ; if ( result != 0 ) { PyErr_Print ( ) ; throw new java . lang . RuntimeException ( "exec<sp>failed" ) ; } log . info ( "Exec<sp>done" ) ; org . datavec . python . PythonExecutioner . releaseGIL ( ) ; }
org . junit . Assert . assertEquals ( expInference , inference )
invalidRepositoryFormatVersion ( ) { org . eclipse . jgit . lib . Repository r = createWorkRepository ( ) ; org . eclipse . jgit . lib . StoredConfig config = r . getConfig ( ) ; config . setString ( ConfigConstants . CONFIG_CORE_SECTION , null , ConfigConstants . CONFIG_KEY_REPO_FORMAT_VERSION , "notanumber" ) ; config . save ( ) ; try ( org . eclipse . jgit . internal . storage . file . FileRepository repo = new org . eclipse . jgit . internal . storage . file . FileRepository ( r . getDirectory ( ) ) ) { org . junit . Assert . fail ( "IllegalArgumentException<sp>not<sp>thrown" ) ; } catch ( java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return message ; }
org . junit . Assert . assertNotNull ( e . getMessage ( ) )
testTierPriceProductCreate ( ) { final net . magja . model . product . Product product = net . magja . util . ObjectFactory . generateProduct ( ) ; final java . util . List < net . magja . model . product . ProductTierPrice > tierPrices = com . google . common . collect . Lists . newArrayList ( ) ; final net . magja . model . product . ProductTierPrice tierPrice = new net . magja . model . product . ProductTierPrice ( ) ; tierPrice . setPrice ( 10.01 ) ; tierPrice . setQuantity ( 12.0 ) ; tierPrices . add ( tierPrice ) ; final net . magja . model . product . ProductTierPrice tierPrice2 = new net . magja . model . product . ProductTierPrice ( ) ; tierPrice2 . setPrice ( 9.01 ) ; tierPrice2 . setQuantity ( 24.0 ) ; tierPrices . add ( tierPrice2 ) ; product . setTierPrices ( tierPrices ) ; service . add ( product ) ; "<AssertPlaceHolder>" ; service . delete ( product . getId ( ) ) ; } getId ( ) { return id ; }
org . junit . Assert . assertNotNull ( product . getId ( ) )
testCustomTokenWithIAM ( ) { com . google . firebase . FirebaseApp masterApp = com . google . firebase . testing . IntegrationTestUtils . ensureDefaultApp ( ) ; com . google . auth . oauth2 . GoogleCredentials credentials = com . google . firebase . ImplFirebaseTrampolines . getCredentials ( masterApp ) ; com . google . auth . oauth2 . AccessToken token = credentials . getAccessToken ( ) ; if ( token == null ) { token = credentials . refreshAccessToken ( ) ; } com . google . firebase . FirebaseOptions options = new com . google . firebase . FirebaseOptions . Builder ( ) . setCredentials ( com . google . auth . oauth2 . GoogleCredentials . create ( token ) ) . setServiceAccountId ( ( ( com . google . auth . ServiceAccountSigner ) ( credentials ) ) . getAccount ( ) ) . setProjectId ( com . google . firebase . testing . IntegrationTestUtils . getProjectId ( ) ) . build ( ) ; com . google . firebase . FirebaseApp customApp = com . google . firebase . FirebaseApp . initializeApp ( options , "tempApp" ) ; try { com . google . firebase . auth . FirebaseAuth auth = com . google . firebase . auth . FirebaseAuth . getInstance ( customApp ) ; java . lang . String customToken = auth . createCustomTokenAsync ( "user1" ) . get ( ) ; java . lang . String idToken = signInWithCustomToken ( customToken ) ; com . google . firebase . auth . FirebaseToken decoded = auth . verifyIdTokenAsync ( idToken ) . get ( ) ; "<AssertPlaceHolder>" ; } finally { customApp . delete ( ) ; } } getUid ( ) { return ( ( java . lang . String ) ( claims . get ( "sub" ) ) ) ; }
org . junit . Assert . assertEquals ( "user1" , decoded . getUid ( ) )