input
stringlengths
28
18.7k
output
stringlengths
39
1.69k
testNotEmptyPredicate ( ) { java . lang . String str = ( ( ( ( ( ( ( ( ( "import<sp>" + ( org . drools . modelcompiler . domain . Person . class . getCanonicalName ( ) ) ) + ";" ) + "import<sp>" ) + ( org . drools . modelcompiler . domain . Result . class . getCanonicalName ( ) ) ) + ";" ) + "rule<sp>R<sp>when\n" ) + "<sp>not(<sp>Person(<sp>)<sp>)\n" ) + "then\n" ) + "<sp>insert(new<sp>Result(\"ok\"));\n" ) + "end" ; org . kie . api . runtime . KieSession ksession = getKieSession ( str ) ; org . drools . modelcompiler . domain . Person mario = new org . drools . modelcompiler . domain . Person ( "Mario" , 40 ) ; ksession . insert ( mario ) ; ksession . fireAllRules ( ) ; java . util . Collection < org . drools . modelcompiler . domain . Result > results = getObjectsIntoList ( ksession , org . drools . modelcompiler . domain . Result . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , results . size ( ) )
newsItem_atTrashState_returnIsEndState ( ) { dk . i2m . converge . core . content . NewsItem newsItem = getNewsItemAtEndState ( ) ; boolean endState = newsItem . isEndState ( ) ; "<AssertPlaceHolder>" ; } isEndState ( ) { if ( ( ( ( ( getCurrentState ( ) ) == null ) || ( ( getOutlet ( ) ) == null ) ) || ( ( getOutlet ( ) . getWorkflow ( ) ) == null ) ) || ( ( getOutlet ( ) . getWorkflow ( ) . getEndState ( ) ) == null ) ) { return false ; } return getCurrentState ( ) . equals ( getOutlet ( ) . getWorkflow ( ) . getEndState ( ) ) ; }
org . junit . Assert . assertTrue ( endState )
valuesCanBeWaitedOn ( ) { final java . lang . String result = com . spotify . flo . context . FloRunner . runTask ( FOO_TASK ) . value ( ) ; "<AssertPlaceHolder>" ; } value ( ) { return future . get ( ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( "foo" ) )
testDelete ( ) { com . github . sardine . Sardine sardine = com . github . sardine . SardineFactory . begin ( ) ; final java . lang . String url = java . lang . String . format ( "http://test.cyberduck.ch/dav/anon/sardine/%s" , java . util . UUID . randomUUID ( ) . toString ( ) ) ; sardine . put ( url , new java . io . ByteArrayInputStream ( "Test" . getBytes ( ) ) ) ; sardine . delete ( url ) ; "<AssertPlaceHolder>" ; } exists ( java . lang . String ) { org . apache . http . client . methods . HttpHead head = new org . apache . http . client . methods . HttpHead ( url ) ; return this . execute ( head , new com . github . sardine . impl . handler . ExistsResponseHandler ( ) ) ; }
org . junit . Assert . assertFalse ( sardine . exists ( url ) )
testToTokens ( ) { java . lang . String [ ] [ ] testStrings = new java . lang . String [ ] [ ] { new java . lang . String [ ] { "http://yacy.net?&test" , "yacy<sp>net<sp>test" } , new java . lang . String [ ] { "http://yacy.net?&test" 3 , "example<sp>net<sp>camelCased<sp>subpath1<sp>PATH<sp>EXAMPLE<sp>camel<sp>Cased<sp>subpath<sp>1" } , new java . lang . String [ ] { "https://example.net?query=:/?[]@!$'()*,;=" , "http://yacy.net?&test" 1 } } ; for ( int i = 0 ; i < ( testStrings . length ) ; i ++ ) { java . lang . String [ ] testString = testStrings [ i ] ; net . yacy . cora . document . id . MultiProtocolURL resultUrl = new net . yacy . cora . document . id . MultiProtocolURL ( testString [ 0 ] ) ; java . lang . String tokens = resultUrl . toTokens ( ) ; "<AssertPlaceHolder>" ; } } toTokens ( ) { return net . yacy . cora . document . id . MultiProtocolURL . toTokens ( net . yacy . cora . document . id . MultiProtocolURL . unescape ( this . urlstub ( true , true ) ) ) ; }
org . junit . Assert . assertEquals ( ( "http://yacy.net?&test" 5 + i ) , testString [ 1 ] , tokens )
getTheContactsOfAGivenUser ( ) { com . stratelia . webactiv . beans . admin . UserDetail aUser = getTestResources ( ) . anExistingUser ( ) ; com . stratelia . webactiv . beans . admin . UserDetail [ ] expectedContacts = getTestResources ( ) . getRelationShipsOfUser ( aUser . getId ( ) ) ; getTestResources ( ) . whenSearchUsersByCriteriaThenReturn ( new com . stratelia . webactiv . beans . admin . UserDetailsSearchCriteria ( ) . onUserIds ( getTestResources ( ) . getUserIds ( expectedContacts ) ) , expectedContacts ) ; com . silverpeas . profile . web . UserProfileEntity [ ] actualContacts = getAt ( ( ( ( ( aResourceURI ( ) ) + "/" ) + ( aUser . getId ( ) ) ) + "/contacts" ) , getWebEntityClass ( ) ) ; "<AssertPlaceHolder>" ; } is ( T ) { return java . util . Objects . equals ( this . value , value ) ; }
org . junit . Assert . assertThat ( actualContacts . length , org . hamcrest . Matchers . is ( expectedContacts . length ) )
testGetLocalHomeCommunityId ( ) { javax . xml . bind . JAXBElement < org . hl7 . v3 . PRPAMT201301UV02Person > person = gov . hhs . fha . nhinc . transform . subdisc . HL7PatientTransforms . create201301PatientPerson ( "Joe" , "Smith" , "M" , null , null ) ; org . hl7 . v3 . PRPAMT201301UV02Patient patient = gov . hhs . fha . nhinc . transform . subdisc . HL7PatientTransforms . create201301Patient ( person , "1234" , "1.1.1" ) ; org . hl7 . v3 . PRPAIN201305UV02 request = gov . hhs . fha . nhinc . transform . subdisc . HL7PRPA201305Transforms . createPRPA201305 ( patient , "1.1" , "2.2" , "1.1.1" ) ; org . hl7 . v3 . PRPAIN201306UV02 response = gov . hhs . fha . nhinc . transform . subdisc . HL7PRPA201306Transforms . createPRPA201306 ( patient , "2.2" , "1.1.1" , "1.1" , "2.2.2" , request ) ; gov . hhs . fha . nhinc . patientdiscovery . response . VerifyMode verifyMode = new gov . hhs . fha . nhinc . patientdiscovery . response . VerifyMode ( ) ; java . lang . String senderCommunityId = verifyMode . getSenderCommunityId ( response ) ; "<AssertPlaceHolder>" ; } getSenderCommunityId ( org . hl7 . v3 . PRPAIN201306UV02 ) { java . lang . String hcid = null ; if ( ( ( ( ( ( ( ( ( ( response != null ) && ( ( response . getSender ( ) ) != null ) ) && ( ( response . getSender ( ) . getDevice ( ) ) != null ) ) && ( ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) ) != null ) ) && ( ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) ) != null ) ) && ( ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) . getRepresentedOrganization ( ) ) != null ) ) && ( ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) . getRepresentedOrganization ( ) . getValue ( ) ) != null ) ) && ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNotNullish ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) . getRepresentedOrganization ( ) . getValue ( ) . getId ( ) ) ) ) && ( ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) . getRepresentedOrganization ( ) . getValue ( ) . getId ( ) . get ( 0 ) ) != null ) ) && ( gov . hhs . fha . nhinc . nhinclib . NullChecker . isNotNullish ( response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) . getRepresentedOrganization ( ) . getValue ( ) . getId ( ) . get ( 0 ) . getRoot ( ) ) ) ) { hcid = response . getSender ( ) . getDevice ( ) . getAsAgent ( ) . getValue ( ) . getRepresentedOrganization ( ) . getValue ( ) . getId ( ) . get ( 0 ) . getRoot ( ) ; } return hcid ; }
org . junit . Assert . assertEquals ( "2.2" , senderCommunityId )
testRegisterComponent ( ) { com . picocontainer . ComponentAdapter componentAdapter = createComponentAdapter ( ) ; picoContainer . addAdapter ( componentAdapter ) ; "<AssertPlaceHolder>" ; } getComponentAdapters ( ) { return null ; }
org . junit . Assert . assertTrue ( picoContainer . getComponentAdapters ( ) . contains ( componentAdapter ) )
shouldNotBeEqualWithDifferentTimeUnitAndAmount ( ) { javax . cache . expiry . Duration duration1 = new javax . cache . expiry . Duration ( java . util . concurrent . TimeUnit . DAYS , 2 ) ; javax . cache . expiry . Duration duration2 = new javax . cache . expiry . Duration ( java . util . concurrent . TimeUnit . MINUTES , 2 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof domain . Identifier2 ) ) return false ; domain . Identifier2 that = ( ( domain . Identifier2 ) ( o ) ) ; if ( ( name ) != null ? ! ( name . equals ( that . name ) ) : ( that . name ) != null ) return false ; return true ; }
org . junit . Assert . assertThat ( duration1 . equals ( duration2 ) , org . hamcrest . CoreMatchers . is ( false ) )
shouldNextGivenIteratorHasNoMoreElements ( ) { java . util . SortedSet < java . lang . Boolean > set = new uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . Boolean > ( ) ; set . add ( Boolean . TRUE ) ; java . util . Iterator < java . lang . Boolean > iterator = set . iterator ( ) ; iterator . next ( ) ; assert ( iterator . hasNext ( ) ) == false ; try { iterator . next ( ) ; org . junit . Assert . fail ( ) ; } catch ( java . util . NoSuchElementException e ) { "<AssertPlaceHolder>" ; } } iterator ( ) { return collection . iterator ( ) ; }
org . junit . Assert . assertNull ( e . getMessage ( ) )
testTargetBuilder574 ( ) { org . simpleflatmapper . reflect . test . meta . ClassMeta < org . simpleflatmapper . reflect . test . meta . ImmutableFoobarValue . Builder > classMeta = org . simpleflatmapper . reflect . ReflectionService . newInstance ( ) . getClassMeta ( ImmutableFoobarValue . Builder . class ) ; java . util . List < org . simpleflatmapper . reflect . InstantiatorDefinition > instantiatorDefinitions = classMeta . getInstantiatorDefinitions ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return false ; }
org . junit . Assert . assertFalse ( instantiatorDefinitions . isEmpty ( ) )
testNoError ( ) { boolean result = checkNoError ( "Authentication_OAuth1_SmartCloud_Get_My_Profile" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; }
org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result )
testAbortedTransactionPutAndGet ( ) { transactionContext . start ( ) ; org . apache . hadoop . hbase . client . Put put = new org . apache . hadoop . hbase . client . Put ( co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . row ) ; put . add ( co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . family , co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . qualifier , co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . value ) ; transactionAwareHTable . put ( put ) ; transactionContext . abort ( ) ; transactionContext . start ( ) ; org . apache . hadoop . hbase . client . Result result = transactionAwareHTable . get ( new org . apache . hadoop . hbase . client . Get ( co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . row ) ) ; transactionContext . finish ( ) ; byte [ ] value = result . getValue ( co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . family , co . cask . tephra . hbase11 . TransactionAwareHTableTest . TestBytes . qualifier ) ; "<AssertPlaceHolder>" ; } finish ( ) { com . google . common . base . Preconditions . checkState ( ( ( currentTx ) != null ) , "Cannot<sp>finish<sp>tx<sp>that<sp>has<sp>not<sp>been<sp>started" ) ; checkForConflicts ( ) ; persist ( ) ; commit ( ) ; postCommit ( ) ; currentTx = null ; }
org . junit . Assert . assertArrayEquals ( value , null )
testDynamicQueryByPrimaryKeyMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . kernel . model . Address . class , _dynamicQueryClassLoader ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . eq ( "addressId" , com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ) ) ; java . util . List < com . liferay . portal . kernel . model . Address > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
testValidateWithAValidDRLFile ( ) { final org . uberfire . backend . vfs . Path path = path ( "/GuvnorM2RepoDependencyExample1/src/main/resources/rule2.drl" ) ; final java . lang . String content = "package<sp>org.kie.workbench.common.services.builder.tests.test1\n" + ( ( ( ( ( "\n" + "rule<sp>R2\n" ) + "when\n" ) + "Bean()\n" ) + "then\n" ) + "end" ) ; java . util . List < org . guvnor . common . services . shared . validation . model . ValidationMessage > errors = validator . validate ( path , content ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return dayTimeValues ( ) . allMatch ( this :: isNone ) ; }
org . junit . Assert . assertTrue ( errors . isEmpty ( ) )
testGetStorageCluster ( ) { System . out . println ( "getStorageCluster" ) ; de . waldheinz . fs . fat . Fat16RootDirectory dir = de . waldheinz . fs . fat . Fat16RootDirectory . create ( bs ) ; "<AssertPlaceHolder>" ; } getStorageCluster ( ) { return isRoot ( ) ? 0 : chain . getStartCluster ( ) ; }
org . junit . Assert . assertEquals ( 0 , dir . getStorageCluster ( ) )
testExtractVersion2 ( ) { java . lang . String extractedVersion = org . sbolstandard . core2 . URIcompliance . extractVersion ( uri6 ) ; "<AssertPlaceHolder>" ; } extractVersion ( java . net . URI ) { java . lang . String URIstr = objURI . toString ( ) ; java . util . regex . Matcher m = org . sbolstandard . core2 . URIcompliance . genericURIpattern1Pat . matcher ( URIstr ) ; if ( ( m . matches ( ) ) && ( ( m . groupCount ( ) ) >= 6 ) ) return m . group ( 6 ) ; else return null ; }
org . junit . Assert . assertNull ( extractedVersion )
testStartKeyStopKey ( ) { java . util . Properties props = new java . util . Properties ( ) ; java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) , props ) ; java . lang . String tableName = generateUniqueName ( ) ; conn . createStatement ( ) . execute ( ( ( "CREATE<sp>TABLE<sp>" + tableName ) + "<sp>(pk<sp>char(2)<sp>not<sp>null<sp>primary<sp>key)<sp>SPLIT<sp>ON<sp>('EA','EZ')" ) ) ; conn . close ( ) ; java . lang . String query = ( "select<sp>count(*)<sp>from<sp>" + tableName ) + "<sp>where<sp>pk<sp>>=<sp>'EA'<sp>and<sp>pk<sp><<sp>'EZ'" ; conn = java . sql . DriverManager . getConnection ( getUrl ( ) , props ) ; java . sql . Statement statement = conn . createStatement ( ) ; statement . execute ( query ) ; org . apache . phoenix . jdbc . PhoenixStatement pstatement = statement . unwrap ( org . apache . phoenix . jdbc . PhoenixStatement . class ) ; java . util . List < org . apache . phoenix . query . KeyRange > splits = pstatement . getQueryPlan ( ) . getSplits ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . delegatee . size ( ) ; }
org . junit . Assert . assertTrue ( ( ( splits . size ( ) ) > 0 ) )
testHDFSBlobStoreConnection ( ) { expect ( mockStore . getFilesystem ( ) ) . andReturn ( mockFs ) ; expect ( mockStore . getId ( ) ) . andReturn ( mockId ) ; replay ( mockStore , mockFs ) ; de . fiz . akubra . hdfs . HDFSBlobStoreConnection connection = createTestConnection ( ) ; "<AssertPlaceHolder>" ; } createTestConnection ( ) { de . fiz . akubra . hdfs . HDFSBlobStoreConnection connection = new de . fiz . akubra . hdfs . HDFSBlobStoreConnection ( mockStore ) ; java . lang . reflect . Field f = de . fiz . akubra . hdfs . HDFSBlobStoreConnection . class . getDeclaredField ( "hdfs" ) ; f . setAccessible ( true ) ; f . set ( connection , mockFs ) ; return connection ; }
org . junit . Assert . assertNotNull ( connection )
parseWithHostAndPortAndTwoQueryParameters ( ) { final com . azure . common . implementation . http . UrlBuilder builder = com . azure . common . implementation . http . UrlBuilder . parse ( "www.bing.com:123?a=1&b=2" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return this . value ; }
org . junit . Assert . assertEquals ( "www.bing.com:123?a=1&b=2" , builder . toString ( ) )
testBasicWrite2 ( ) { org . apache . edgent . topology . Topology t = newTopology ( "testBasicWrite2" ) ; truncatePersonsTable ( ) ; java . util . List < java . lang . String > expected = expectedPersons ( ( person ) -> true , getPersonList ( ) ) ; org . apache . edgent . connectors . jdbc . JdbcStreams db = new org . apache . edgent . connectors . jdbc . JdbcStreams ( t , ( ) -> getDataSource ( org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . DB_NAME ) , ( dataSource ) -> connect ( dataSource ) ) ; org . apache . edgent . topology . TStream < org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . Person > s = t . collection ( getPersonList ( ) ) ; org . apache . edgent . topology . TSink < org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . Person > sink = db . executeStatement ( s , ( cn ) -> cn . prepareStatement ( "INSERT<sp>into<sp>PERSONS<sp>values(?,?,?,?,?)" ) , ( tuple , stmt ) -> { stmt . setInt ( 1 , tuple . id ) ; stmt . setString ( 2 , tuple . firstName ) ; stmt . setString ( 3 , tuple . lastName ) ; stmt . setString ( 4 , tuple . gender ) ; stmt . setInt ( 5 , tuple . age ) ; } ) ; "<AssertPlaceHolder>" ; org . apache . edgent . topology . TStream < org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . Person > rcvdPerson = readPersonsTable ( t , db , getPersonIdList ( ) , 3000 ) ; org . apache . edgent . topology . TStream < java . lang . String > rcvd = rcvdPerson . map ( ( person ) -> person . toString ( ) ) ; rcvd . sink ( ( tuple ) -> System . out . println ( java . lang . String . format ( "%s<sp>rcvd:<sp>%s" , t . getName ( ) , tuple ) ) ) ; completeAndValidate ( "" , t , rcvd , org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . SEC_TIMEOUT , expected . toArray ( new java . lang . String [ 0 ] ) ) ; } getPersonList ( ) { return org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . personList ; }
org . junit . Assert . assertNotNull ( sink )
shouldSupportRemovingAListOfPaths ( ) { model . addPath ( "/a/b/c" ) ; model . addPath ( "/d/e/f" ) ; model . addPath ( "/g/h/i" ) ; model . addPath ( "/j/k/l" ) ; model . removePathsAt ( 1 , 3 ) ; "<AssertPlaceHolder>" ; } getPaths ( ) { return new java . util . ArrayList ( paths ) ; }
org . junit . Assert . assertThat ( model . getPaths ( ) , org . hamcrest . Matchers . is ( asList ( "/a/b/c" , "/g/h/i" ) ) )
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . exportimport . kernel . model . ExportImportConfiguration missingExportImportConfiguration = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
org . junit . Assert . assertNull ( missingExportImportConfiguration )
testSerialization ( ) { org . jfree . chart . renderer . xy . XYDotRenderer r1 = new org . jfree . chart . renderer . xy . XYDotRenderer ( ) ; org . jfree . chart . renderer . xy . XYDotRenderer r2 = ( ( org . jfree . chart . renderer . xy . XYDotRenderer ) ( 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 )
testAnchorFilterFalse ( ) { com . digitalpebble . stormcrawler . filtering . URLFilter allAllowed = createFilter ( false , false ) ; java . net . URL url = new java . net . URL ( "http://www.sourcedomain.com/#0" ) ; com . digitalpebble . stormcrawler . Metadata metadata = new com . digitalpebble . stormcrawler . Metadata ( ) ; java . lang . String filterResult = allAllowed . filter ( url , metadata , url . toExternalForm ( ) ) ; "<AssertPlaceHolder>" ; } filter ( java . net . URL , com . digitalpebble . stormcrawler . Metadata , java . lang . String ) { return delegatedURLFilter . filter ( sourceUrl , sourceMetadata , urlToFilter ) ; }
org . junit . Assert . assertEquals ( url . toExternalForm ( ) , filterResult )
shouldReturnFalseOnMatchingConditionGivenCurrentDateIsLesserThanCutoffDate ( ) { org . flips . model . FeatureContext featureContext = mock ( org . flips . model . FeatureContext . class ) ; org . flips . model . FlipAnnotationAttributes flipAnnotationAttributes = mock ( org . flips . model . FlipAnnotationAttributes . class ) ; java . lang . String cutoffDateTimeProperty = "feature.dev.disabled.date" ; org . powermock . api . mockito . PowerMockito . mockStatic ( org . flips . utils . DateTimeUtils . class ) ; when ( flipAnnotationAttributes . getAttributeValue ( "cutoffDateTimeProperty" , "" ) ) . thenReturn ( cutoffDateTimeProperty ) ; when ( featureContext . getPropertyValueOrDefault ( cutoffDateTimeProperty , java . lang . String . class , "" ) ) . thenReturn ( java . time . ZonedDateTime . now ( ) . plusDays ( 2 ) . toInstant ( ) . toString ( ) ) ; org . powermock . api . mockito . PowerMockito . when ( org . flips . utils . DateTimeUtils . getCurrentTime ( ) ) . thenReturn ( java . time . ZonedDateTime . now ( org . flips . condition . UTC ) ) ; org . flips . condition . DateTimeFlipCondition condition = new org . flips . condition . DateTimeFlipCondition ( ) ; boolean result = condition . evaluateCondition ( featureContext , flipAnnotationAttributes ) ; "<AssertPlaceHolder>" ; verify ( flipAnnotationAttributes ) . getAttributeValue ( "cutoffDateTimeProperty" , "" ) ; verify ( featureContext ) . getPropertyValueOrDefault ( cutoffDateTimeProperty , java . lang . String . class , "" ) ; org . powermock . api . mockito . PowerMockito . verifyStatic ( ) ; org . flips . utils . DateTimeUtils . getCurrentTime ( ) ; } evaluateCondition ( org . flips . model . FeatureContext , org . flips . model . FlipAnnotationAttributes ) { java . lang . String expression = flipAnnotationAttributes . getAttributeValue ( "expression" , "" ) ; org . flips . utils . ValidationUtils . requireNonEmpty ( expression , "expression<sp>element<sp>can<sp>not<sp>be<sp>NULL<sp>or<sp>EMPTY<sp>when<sp>using<sp>@FlipOnSpringExpression" ) ; return evaluateExpression ( featureContext , expression ) ; }
org . junit . Assert . assertEquals ( false , result )
testSetValue ( ) { org . kie . workbench . common . forms . fields . shared . fieldTypes . basic . selectors . DecimalSelectorOption opt = new org . kie . workbench . common . forms . fields . shared . fieldTypes . basic . selectors . DecimalSelectorOption ( ) ; opt . setValue ( valueB ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return rootPath ; }
org . junit . Assert . assertSame ( valueB , opt . getValue ( ) )
canConvertDoubles ( ) { java . util . List < java . lang . Double > doubles = java . util . Arrays . asList ( Double . MAX_VALUE , Double . MIN_VALUE , Double . MIN_NORMAL ) ; for ( java . lang . Double original : doubles ) { java . lang . String jsonString = com . google . firebase . database . util . JsonMapper . serializeJson ( original ) ; double converted = ( ( java . lang . Double ) ( com . google . firebase . database . util . JsonMapper . parseJsonValue ( jsonString ) ) ) ; "<AssertPlaceHolder>" ; } } parseJsonValue ( java . lang . String ) { try { com . google . gson . stream . JsonReader jsonReader = new com . google . gson . stream . JsonReader ( new java . io . StringReader ( json ) ) ; jsonReader . setLenient ( true ) ; return com . google . firebase . database . util . JsonMapper . unwrapJson ( jsonReader ) ; } catch ( java . lang . IllegalStateException | com . google . gson . JsonSyntaxException e ) { throw new java . io . IOException ( e ) ; } }
org . junit . Assert . assertEquals ( original , converted , 0 )
firstTest ( ) { com . microsoft . azure . management . storage . v2016_01_01 . StorageTest . rgName = com . microsoft . azure . arm . utils . SdkContext . randomResourceName ( "rg" , 20 ) ; com . microsoft . azure . management . resources . ResourceGroup group = com . microsoft . azure . management . storage . v2016_01_01 . StorageTest . resourceManager . resourceGroups ( ) . define ( com . microsoft . azure . management . storage . v2016_01_01 . StorageTest . rgName ) . withRegion ( Region . US_WEST . toString ( ) ) . create ( ) ; "<AssertPlaceHolder>" ; } create ( ) { return this . create ( null , null , null , null ) ; }
org . junit . Assert . assertNotNull ( group )
marshalApplications ( ) { final java . lang . String jsonExpected = "{\"applications\":[{\"entityId\":\"application_client1\"}]}" ; final org . sentilo . web . catalog . domain . PlatformAdminInputMessage message = new org . sentilo . web . catalog . domain . PlatformAdminInputMessage ( buildMockApplications ( ) ) ; "<AssertPlaceHolder>" ; } marshal ( java . lang . Object ) { return writeInternalAndReturnString ( message ) ; }
org . junit . Assert . assertEquals ( jsonExpected , converter . marshal ( message ) )
testNow ( ) { java . lang . String result = testDialect . getSqlFrom ( org . alfasoftware . morf . sql . element . Function . now ( ) ) ; "<AssertPlaceHolder>" ; } expectedNow ( ) { return "CURRENT_TIMESTAMP()" ; }
org . junit . Assert . assertEquals ( expectedNow ( ) , result )
testReplaceSingleMiddleThenOverlappingSuperset ( ) { org . antlr . tool . Grammar g = new org . antlr . tool . Grammar ( ( "lexer<sp>grammar<sp>t;\n" + ( ( "A<sp>:<sp>\'a\';\n" + "B<sp>:<sp>\'b\';\n" ) + "C<sp>:<sp>\'c\';\n" ) ) ) ; org . antlr . runtime . CharStream input = new org . antlr . runtime . ANTLRStringStream ( "abcba" ) ; org . antlr . tool . Interpreter lexEngine = new org . antlr . tool . Interpreter ( g , input ) ; org . antlr . runtime . TokenRewriteStream tokens = new org . antlr . runtime . TokenRewriteStream ( lexEngine ) ; tokens . fill ( ) ; tokens . replace ( 2 , 2 , "xyz" ) ; tokens . replace ( 0 , 3 , "foo" ) ; java . lang . String result = tokens . toString ( ) ; java . lang . String expecting = "fooa" ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( "[" + ( grammar . name ) ) + "." ) + ( name ) ) + ",index=" ) + ( index ) ) + ",line=" ) + ( tree . getToken ( ) . getLine ( ) ) ) + "]" ; }
org . junit . Assert . assertEquals ( expecting , result )
testReadDataThrowException ( ) { org . mockito . Mockito . when ( fileReader . fileExist ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( true ) ; org . mockito . Mockito . when ( fileReader . readAllLine ( org . mockito . Mockito . anyString ( ) ) ) . thenReturn ( new java . lang . String [ ] { "DLT<sp>,<sp>12288<sp>,<sp>1488927413524" } ) ; java . util . List < com . att . aro . core . peripheral . pojo . SpeedThrottleEvent > throttleInfos = speedThrottleReader . readData ( traceFolder ) ; "<AssertPlaceHolder>" ; } readData ( java . lang . String ) { java . util . List < com . att . aro . core . peripheral . pojo . PrivateDataInfo > privateDataInfos = new java . util . LinkedList < com . att . aro . core . peripheral . pojo . PrivateDataInfo > ( ) ; java . lang . String filePath = ( directory + ( com . att . aro . core . util . Util . FILE_SEPARATOR ) ) + ( TraceDataConst . FileName . PRIVATE_DATA_FILE ) ; if ( ! ( filereader . fileExist ( filePath ) ) ) { return privateDataInfos ; } java . lang . String [ ] lines = null ; try { lines = filereader . readAllLine ( filePath ) ; } catch ( java . lang . Exception e ) { com . att . aro . core . peripheral . impl . PrivateDataReaderImpl . LOGGER . error ( ( "failed<sp>to<sp>read<sp>private<sp>data<sp>info<sp>file:<sp>" + filePath ) ) ; } if ( ( lines != null ) && ( ( lines . length ) != 0 ) ) { for ( java . lang . String line : lines ) { com . att . aro . core . peripheral . pojo . PrivateDataInfo privateDataInfo = processLine ( line ) ; if ( privateDataInfo != null ) { privateDataInfos . add ( privateDataInfo ) ; } } } return privateDataInfos ; }
org . junit . Assert . assertNotNull ( throttleInfos )
isPresentAfterCreatingAllStores ( ) { org . neo4j . io . fs . FileSystemAbstraction fileSystem = fs . get ( ) ; fileSystem . deleteRecursively ( databaseLayout . databaseDirectory ( ) ) ; org . neo4j . kernel . impl . store . id . DefaultIdGeneratorFactory idFactory = new org . neo4j . kernel . impl . store . id . DefaultIdGeneratorFactory ( fileSystem ) ; org . neo4j . kernel . impl . store . StoreFactory factory = new org . neo4j . kernel . impl . store . StoreFactory ( databaseLayout , org . neo4j . kernel . configuration . Config . defaults ( ) , idFactory , pageCache , fileSystem , org . neo4j . kernel . impl . store . NeoStoresTest . LOG_PROVIDER , org . neo4j . io . pagecache . tracing . cursor . context . EmptyVersionContextSupplier . EMPTY ) ; try ( org . neo4j . kernel . impl . store . NeoStores ignore = factory . openAllNeoStores ( true ) ) { "<AssertPlaceHolder>" ; } } isStorePresent ( org . neo4j . io . pagecache . PageCache , org . neo4j . io . layout . DatabaseLayout ) { java . io . File metaDataStore = databaseLayout . metadataStore ( ) ; try ( org . neo4j . io . pagecache . PagedFile ignore = pageCache . map ( metaDataStore , org . neo4j . kernel . impl . store . MetaDataStore . getPageSize ( pageCache ) ) ) { return true ; } catch ( java . io . IOException e ) { return false ; } }
org . junit . Assert . assertTrue ( org . neo4j . kernel . impl . store . NeoStores . isStorePresent ( pageCache , databaseLayout ) )
createBeginOutboundMessage ( ) { gov . hhs . fha . nhinc . event . Event event = eventFactory . createBeginOutboundMessage ( ) ; "<AssertPlaceHolder>" ; } createBeginOutboundMessage ( ) { return new gov . hhs . fha . nhinc . event . initiator . BeginOutboundMessageEvent ( ) ; }
org . junit . Assert . assertTrue ( ( event instanceof gov . hhs . fha . nhinc . event . initiator . BeginOutboundMessageEvent ) )
testThrowOnEmptyQueue ( ) { try ( io . nats . client . NatsTestServer ts = new io . nats . client . NatsTestServer ( false ) ; io . nats . client . Connection nc = io . nats . client . Nats . connect ( ts . getURI ( ) ) ) { io . nats . client . Dispatcher d = nc . createDispatcher ( ( msg ) -> { } ) ; d . subscribe ( "subject" , "" ) ; "<AssertPlaceHolder>" ; } } subscribe ( java . lang . String , java . lang . String ) { if ( ( subject == null ) || ( ( subject . length ( ) ) == 0 ) ) { throw new java . lang . IllegalArgumentException ( "Subject<sp>is<sp>required<sp>in<sp>subscribe" ) ; } if ( ( queueName == null ) || ( ( queueName . length ( ) ) == 0 ) ) { throw new java . lang . IllegalArgumentException ( "QueueName<sp>is<sp>required<sp>in<sp>subscribe" ) ; } return createSubscription ( subject , queueName , null ) ; }
org . junit . Assert . assertFalse ( true )
testDecodeUnixSeconds ( ) { long testTimestamp = 140694727L ; long expectedTimestamp = 140694727000L ; java . util . Properties testProperties = new java . util . Properties ( ) ; testProperties . setProperty ( "camus.message.timestamp.format" , "unix_seconds" ) ; com . linkedin . camus . etl . kafka . coders . JsonStringMessageDecoder testDecoder = new com . linkedin . camus . etl . kafka . coders . JsonStringMessageDecoder ( ) ; testDecoder . init ( testProperties , "testTopic" ) ; java . lang . String payload = ( "{\"timestamp\":<sp>" + testTimestamp ) + ",<sp>\"myData\":<sp>\"myValue\"}" ; byte [ ] bytePayload = payload . getBytes ( ) ; com . linkedin . camus . coders . CamusWrapper actualResult = testDecoder . decode ( new com . linkedin . camus . etl . kafka . coders . TestMessage ( ) . setPayload ( bytePayload ) ) ; long actualTimestamp = actualResult . getTimestamp ( ) ; "<AssertPlaceHolder>" ; } getTimestamp ( ) { org . apache . avro . generic . GenericData . Record header = ( ( org . apache . avro . generic . GenericData . Record ) ( super . getRecord ( ) . get ( "header" ) ) ) ; if ( ( header != null ) && ( ( header . get ( "time" ) ) != null ) ) { return ( ( java . lang . Long ) ( header . get ( "time" ) ) ) ; } else if ( ( super . getRecord ( ) . get ( "timestamp" ) ) != null ) { return ( ( java . lang . Long ) ( super . getRecord ( ) . get ( "timestamp" ) ) ) ; } else { return java . lang . System . currentTimeMillis ( ) ; } }
org . junit . Assert . assertEquals ( expectedTimestamp , actualTimestamp )
serverGroup ( ) { org . jboss . hal . meta . AddressTemplate input = org . jboss . hal . meta . AddressTemplate . of ( "/server-group=main-server-group" ) ; org . jboss . hal . meta . AddressTemplate expected = org . jboss . hal . meta . AddressTemplate . of ( "/server-group=*" ) ; org . jboss . hal . meta . AddressTemplate result = processor . apply ( input ) ; "<AssertPlaceHolder>" ; } apply ( org . jboss . hal . meta . AddressTemplate ) { org . jboss . hal . meta . AddressTemplate modified = org . jboss . hal . meta . AddressTemplate . ROOT ; if ( ( template != null ) && ( ! ( AddressTemplate . ROOT . equals ( template ) ) ) ) { java . util . List < java . lang . String [ ] > segments = stream ( template . spliterator ( ) , false ) . map ( ( segment ) -> { if ( segment . contains ( "=" ) ) { return com . google . common . base . Splitter . on ( '=' ) . omitEmptyStrings ( ) . trimResults ( ) . limit ( 2 ) . splitToList ( segment ) . toArray ( new java . lang . String [ 2 ] ) ; } return new java . lang . String [ ] { segment , null } ; } ) . collect ( toList ( ) ) ; java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; org . jboss . hal . meta . description . SegmentProcessor . process ( segments , ( segment ) -> { builder . append ( "/" ) . append ( segment [ 0 ] ) ; if ( ( segment [ 1 ] ) != null ) { builder . append ( "=" ) . append ( segment [ 1 ] ) ; } } ) ; modified = org . jboss . hal . meta . AddressTemplate . of ( builder . toString ( ) ) ; } org . jboss . hal . meta . description . ResourceDescriptionTemplateProcessor . logger . debug ( "{}<sp>-><sp>{}" , template , modified ) ; return modified ; }
org . junit . Assert . assertEquals ( expected , result )
testDrill4530_2 ( ) { test ( "refresh<sp>table<sp>metadata<sp>dfs.`%s`" , org . apache . drill . exec . store . parquet . TestParquetMetadataCache . TABLE_NAME_2 ) ; checkForMetadataFile ( org . apache . drill . exec . store . parquet . TestParquetMetadataCache . TABLE_NAME_2 ) ; java . lang . String query1 = java . lang . String . format ( ( "select<sp>dir0,<sp>dir1,<sp>o_custkey,<sp>o_orderdate<sp>from<sp>dfs.`%s`<sp>" + "<sp>where<sp>dir0=1995" ) , org . apache . drill . exec . store . parquet . TestParquetMetadataCache . TABLE_NAME_2 ) ; int expectedRowCount = 80 ; int expectedNumFiles = 8 ; int actualRowCount = testSql ( query1 ) ; "<AssertPlaceHolder>" ; java . lang . String numFilesPattern = "numFiles=" + expectedNumFiles ; java . lang . String usedMetaPattern = "usedMetadataFile=true" ; java . lang . String cacheFileRootPattern = java . lang . String . format ( "cacheFileRoot=%s/%s/1995" , dirTestWatcher . getRootDir ( ) . getCanonicalPath ( ) , org . apache . drill . exec . store . parquet . TestParquetMetadataCache . TABLE_NAME_2 ) ; org . apache . drill . PlanTestBase . testPlanMatchingPatterns ( query1 , new java . lang . String [ ] { numFilesPattern , usedMetaPattern , cacheFileRootPattern } , new java . lang . String [ ] { "Filter" } ) ; } testSql ( java . lang . String ) { return org . apache . drill . test . BaseTestQuery . testRunAndPrint ( QueryType . SQL , query ) ; }
org . junit . Assert . assertEquals ( expectedRowCount , actualRowCount )
testSetNullClassifier ( ) { com . google . cloud . tools . eclipse . appengine . libraries . model . MavenCoordinates mavenCoordinates = new com . google . cloud . tools . eclipse . appengine . libraries . model . MavenCoordinates . Builder ( ) . setGroupId ( "g" ) . setArtifactId ( "a" ) . setClassifier ( null ) . build ( ) ; "<AssertPlaceHolder>" ; } getClassifier ( ) { return classifier ; }
org . junit . Assert . assertNull ( mavenCoordinates . getClassifier ( ) )
testXPathMultiProperty ( ) { rule . setXPath ( "//VariableDeclaratorId[@Image=$forbiddenNames]" ) ; rule . setMessage ( "Avoid<sp>vars" ) ; rule . setVersion ( XPathRuleQuery . XPATH_2_0 ) ; net . sourceforge . pmd . properties . StringMultiProperty varDescriptor = net . sourceforge . pmd . properties . StringMultiProperty . named ( "forbiddenNames" ) . desc ( "Forbidden<sp>names" ) . defaultValues ( "forbid1" , "forbid2" ) . delim ( '$' ) . build ( ) ; rule . definePropertyDescriptor ( varDescriptor ) ; net . sourceforge . pmd . Report report = net . sourceforge . pmd . lang . java . rule . XPathRuleTest . getReportForTestString ( rule , net . sourceforge . pmd . lang . java . rule . XPathRuleTest . TEST3 ) ; java . util . Iterator < net . sourceforge . pmd . RuleViolation > rv = report . iterator ( ) ; int i = 0 ; for ( ; rv . hasNext ( ) ; ++ i ) { rv . next ( ) ; } "<AssertPlaceHolder>" ; } next ( ) { org . w3c . dom . Node attributeNode = attributes . item ( ( ( index ) ++ ) ) ; return new net . sourceforge . pmd . lang . ast . xpath . Attribute ( this , attributeNode . getNodeName ( ) , attributeNode . getNodeValue ( ) ) ; }
org . junit . Assert . assertEquals ( 2 , i )
testCreateReplyAuthorized ( ) { java . lang . String message = "messageMarkdown" ; org . sagebionetworks . repo . model . discussion . CreateDiscussionReply createReply = new org . sagebionetworks . repo . model . discussion . CreateDiscussionReply ( ) ; createReply . setThreadId ( threadId ) ; createReply . setMessageMarkdown ( message ) ; when ( mockUploadDao . uploadReplyMessage ( message , forumId , threadId , replyId . toString ( ) ) ) . thenReturn ( messageKey ) ; when ( mockReplyDao . createReply ( threadId , replyId . toString ( ) , messageKey , userInfo . getId ( ) ) ) . thenReturn ( bundle ) ; org . sagebionetworks . repo . model . discussion . DiscussionReplyBundle reply = replyManager . createReply ( userInfo , createReply ) ; "<AssertPlaceHolder>" ; verify ( mockSubscriptionDao ) . create ( eq ( userId . toString ( ) ) , eq ( reply . getThreadId ( ) ) , eq ( SubscriptionObjectType . THREAD ) ) ; verify ( mockTransactionalMessenger ) . sendMessageAfterCommit ( replyId . toString ( ) , ObjectType . REPLY , bundle . getEtag ( ) , ChangeType . CREATE , userInfo . getId ( ) ) ; verify ( mockThreadDao ) . insertEntityReference ( any ( java . util . List . class ) ) ; verify ( mockTransactionalMessenger ) . sendMessageAfterCommit ( eq ( threadId ) , eq ( ObjectType . THREAD ) , anyString ( ) , eq ( ChangeType . UPDATE ) , eq ( userInfo . getId ( ) ) ) ; } createReply ( org . sagebionetworks . repo . model . UserInfo , org . sagebionetworks . repo . model . discussion . CreateDiscussionReply ) { org . sagebionetworks . repo . model . UserInfo . validateUserInfo ( userInfo ) ; org . sagebionetworks . util . ValidateArgument . required ( createReply , "createReply" ) ; java . lang . String threadId = createReply . getThreadId ( ) ; org . sagebionetworks . util . ValidateArgument . required ( threadId , "CreateDiscussionReply.threadId" ) ; org . sagebionetworks . util . ValidateArgument . required ( createReply . getMessageMarkdown ( ) , "CreateDiscussionReply.messageMarkdown" ) ; if ( authorizationManager . isAnonymousUser ( userInfo ) ) { throw new org . sagebionetworks . repo . model . UnauthorizedException ( org . sagebionetworks . repo . manager . AuthorizationManagerImpl . ANONYMOUS_ACCESS_DENIED_REASON ) ; } org . sagebionetworks . repo . model . discussion . DiscussionThreadBundle thread = threadManager . getThread ( userInfo , threadId ) ; java . lang . String replyId = idGenerator . generateNewId ( IdType . DISCUSSION_REPLY_ID ) . toString ( ) ; java . lang . String messageKey = uploadDao . uploadReplyMessage ( createReply . getMessageMarkdown ( ) , thread . getForumId ( ) , threadId , replyId ) ; org . sagebionetworks . repo . model . discussion . DiscussionReplyBundle reply = replyDao . createReply ( threadId , replyId , messageKey , userInfo . getId ( ) ) ; subscriptionDao . create ( userInfo . getId ( ) . toString ( ) , threadId , SubscriptionObjectType . THREAD ) ; transactionalMessenger . sendMessageAfterCommit ( replyId , ObjectType . REPLY , reply . getEtag ( ) , ChangeType . CREATE , userInfo . getId ( ) ) ; threadDao . insertEntityReference ( org . sagebionetworks . repo . manager . discussion . DiscussionUtils . getEntityReferences ( createReply . getMessageMarkdown ( ) , threadId ) ) ; transactionalMessenger . sendMessageAfterCommit ( threadId , ObjectType . THREAD , java . util . UUID . randomUUID ( ) . toString ( ) , ChangeType . UPDATE , userInfo . getId ( ) ) ; return reply ; }
org . junit . Assert . assertEquals ( bundle , reply )
whenHaving2Vehicle_calcInsertionOfCheapest2 ( ) { com . graphhopper . jsprit . core . algorithm . recreate . JobInsertionCostsCalculator calc = mock ( com . graphhopper . jsprit . core . algorithm . recreate . JobInsertionCostsCalculator . class ) ; com . graphhopper . jsprit . core . algorithm . recreate . InsertionData iDataVeh1 = new com . graphhopper . jsprit . core . algorithm . recreate . InsertionData ( 20.0 , InsertionData . NO_INDEX , 1 , veh1 , null ) ; com . graphhopper . jsprit . core . algorithm . recreate . InsertionData iDataVeh2 = new com . graphhopper . jsprit . core . algorithm . recreate . InsertionData ( 10.0 , InsertionData . NO_INDEX , 1 , veh2 , null ) ; when ( calc . getInsertionData ( vehicleRoute , service , veh1 , veh1 . getEarliestDeparture ( ) , null , Double . MAX_VALUE ) ) . thenReturn ( iDataVeh1 ) ; when ( calc . getInsertionData ( vehicleRoute , service , veh2 , veh2 . getEarliestDeparture ( ) , null , Double . MAX_VALUE ) ) . thenReturn ( iDataVeh2 ) ; when ( calc . getInsertionData ( vehicleRoute , service , veh2 , veh2 . getEarliestDeparture ( ) , null , 20.0 ) ) . thenReturn ( iDataVeh2 ) ; com . graphhopper . jsprit . core . problem . VehicleRoutingProblem vrp = mock ( com . graphhopper . jsprit . core . problem . VehicleRoutingProblem . class ) ; when ( vrp . getInitialVehicleRoutes ( ) ) . thenReturn ( java . util . Collections . < com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute > emptyList ( ) ) ; com . graphhopper . jsprit . core . algorithm . recreate . VehicleTypeDependentJobInsertionCalculator insertion = new com . graphhopper . jsprit . core . algorithm . recreate . VehicleTypeDependentJobInsertionCalculator ( vrp , fleetManager , calc ) ; com . graphhopper . jsprit . core . algorithm . recreate . InsertionData iData = insertion . getInsertionData ( vehicleRoute , service , null , 0.0 , null , Double . MAX_VALUE ) ; "<AssertPlaceHolder>" ; } getSelectedVehicle ( ) { return selectedVehicle ; }
org . junit . Assert . assertThat ( iData . getSelectedVehicle ( ) , org . hamcrest . CoreMatchers . is ( veh2 ) )
testForUnSignedDateArray ( ) { java . sql . Date [ ] dateArr = new java . sql . Date [ 2 ] ; dateArr [ 0 ] = new java . sql . Date ( java . lang . System . currentTimeMillis ( ) ) ; dateArr [ 1 ] = new java . sql . Date ( ( ( java . lang . System . currentTimeMillis ( ) ) + ( java . lang . System . currentTimeMillis ( ) ) ) ) ; org . apache . phoenix . schema . types . PhoenixArray arr = org . apache . phoenix . schema . types . PArrayDataType . instantiatePhoenixArray ( PUnsignedDate . INSTANCE , dateArr ) ; PUnsignedDateArray . INSTANCE . toObject ( arr , PUnsignedDateArray . INSTANCE ) ; byte [ ] bytes = PUnsignedDateArray . INSTANCE . toBytes ( arr ) ; org . apache . phoenix . schema . types . PhoenixArray resultArr = ( ( org . apache . phoenix . schema . types . PhoenixArray ) ( PUnsignedDateArray . INSTANCE . toObject ( bytes , 0 , bytes . length ) ) ) ; "<AssertPlaceHolder>" ; } toObject ( java . lang . Object , org . apache . phoenix . schema . types . PDataType , org . apache . phoenix . schema . SortOrder ) { return toObject ( object , actualType ) ; }
org . junit . Assert . assertEquals ( arr , resultArr )
testNonPersistentMultipleIDs ( ) { for ( int i = 0 ; i < 10 ; i ++ ) { javax . transaction . xa . Xid xid = new org . apache . activemq . artemis . core . transaction . impl . XidImpl ( "xa1" . getBytes ( ) , 1 , org . apache . activemq . artemis . utils . UUIDGenerator . getInstance ( ) . generateStringUUID ( ) . getBytes ( ) ) ; org . apache . activemq . artemis . api . core . client . ClientMessage m1 = createTextMessage ( "m1" , false ) ; org . apache . activemq . artemis . api . core . client . ClientMessage m2 = createTextMessage ( "m2" , false ) ; org . apache . activemq . artemis . api . core . client . ClientMessage m3 = createTextMessage ( "m3" , false ) ; org . apache . activemq . artemis . api . core . client . ClientMessage m4 = createTextMessage ( "m4" , false ) ; clientSession . start ( xid , XAResource . TMNOFLAGS ) ; clientProducer . send ( m1 ) ; clientProducer . send ( m2 ) ; clientProducer . send ( m3 ) ; clientProducer . send ( m4 ) ; clientSession . end ( xid , XAResource . TMSUCCESS ) ; clientSession . prepare ( xid ) ; if ( i == 2 ) { clientSession . commit ( xid , false ) ; } recreateClients ( ) ; } stopAndRestartServer ( ) ; javax . transaction . xa . Xid [ ] xids = clientSession . recover ( XAResource . TMSTARTRSCAN ) ; "<AssertPlaceHolder>" ; } recover ( int ) { if ( ActiveMQRALogger . LOGGER . isTraceEnabled ( ) ) { ActiveMQRALogger . LOGGER . trace ( ( ( "recover(" + flag ) + ")" ) ) ; } return xaResource . recover ( flag ) ; }
org . junit . Assert . assertEquals ( 9 , xids . length )
checkOnDelete ( ) { final org . uberfire . mvp . PlaceRequest placeRequest = mock ( org . uberfire . mvp . PlaceRequest . class ) ; presenter . editorPlaceRequest = placeRequest ; presenter . onDelete ( ) ; final org . mockito . ArgumentCaptor < com . google . gwt . core . client . Scheduler . ScheduledCommand > commandCaptor = org . mockito . ArgumentCaptor . forClass ( Scheduler . ScheduledCommand . class ) ; verify ( presenter , times ( 1 ) ) . scheduleClosure ( commandCaptor . capture ( ) ) ; final com . google . gwt . core . client . Scheduler . ScheduledCommand command = commandCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; command . execute ( ) ; verify ( placeManager , times ( 1 ) ) . forceClosePlace ( eq ( placeRequest ) ) ; } getValue ( ) { return this . value ; }
org . junit . Assert . assertNotNull ( command )
testGetSuccessorsWithLoop ( ) { java . util . List < org . s1ck . gdl . model . Edge > successors = com . google . common . collect . Lists . newArrayList ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . QUERY_HANDLER . getSuccessors ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getEdgeCache ( ) . get ( "e4" ) . getId ( ) ) ) ; java . util . List < org . s1ck . gdl . model . Edge > expected = com . google . common . collect . Lists . newArrayList ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . GDL_HANDLER . getEdgeCache ( ) . get ( "e4" ) ) ; "<AssertPlaceHolder>" ; } elementsEqual ( java . util . List , java . util . List ) { boolean equal = ( list . size ( ) ) == ( expected . size ( ) ) ; if ( equal ) { list . sort ( java . util . Comparator . comparingLong ( Element :: getId ) ) ; expected . sort ( java . util . Comparator . comparingLong ( Element :: getId ) ) ; for ( int i = 0 ; i < ( list . size ( ) ) ; i ++ ) { if ( ! ( list . get ( i ) . equals ( expected . get ( i ) ) ) ) { equal = false ; break ; } } } return equal ; }
org . junit . Assert . assertTrue ( org . gradoop . flink . model . impl . operators . matching . common . query . QueryHandlerTest . elementsEqual ( successors , expected ) )
doesNotCountConstructorInvocations ( ) { com . github . mauricioaniche . ck . CKClassResult a = com . github . mauricioaniche . ck . metric . RFCTest . report . get ( "rfc.RFC2" ) ; "<AssertPlaceHolder>" ; } getRfc ( ) { return rfc ; }
org . junit . Assert . assertEquals ( 0 , a . getRfc ( ) )
testEcho3 ( ) { final java . io . ByteArrayOutputStream bytes = new java . io . ByteArrayOutputStream ( ) ; final java . io . PrintStream echo = new java . io . PrintStream ( bytes ) ; final net . sf . expectit . InputStreamCopier copier = new net . sf . expectit . InputStreamCopier ( channel , input , net . sf . expectit . ExpectBuilder . DEFAULT_BUFFER_SIZE , echo , null , false ) ; executor . submit ( copier ) . get ( ) ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertArrayEquals ( toByteArray ( resource ) , bytes . toByteArray ( ) )
testMethodOfInnerClass ( ) { japicmp . filter . JavadocLikeBehaviorFilter filter = new japicmp . filter . JavadocLikeBehaviorFilter ( "japicmp.Test$InnerClass#method()" ) ; javassist . ClassPool classPool = new javassist . ClassPool ( ) ; classPool . appendSystemPath ( ) ; javassist . CtClass ctClass = japicmp . util . CtClassBuilder . create ( ) . name ( "japicmp.Test$InnerClass" ) . addToClassPool ( classPool ) ; javassist . CtMethod ctMethod = japicmp . util . CtMethodBuilder . create ( ) . name ( "method" ) . addToClass ( ctClass ) ; "<AssertPlaceHolder>" ; } matches ( javassist . CtField ) { javassist . CtClass declaringClass = ctField . getDeclaringClass ( ) ; java . lang . String className = declaringClass . getName ( ) ; if ( ! ( this . patternClass . matcher ( className ) . matches ( ) ) ) { return false ; } java . lang . String fieldName = ctField . getName ( ) ; return this . patternField . matcher ( fieldName ) . matches ( ) ; }
org . junit . Assert . assertThat ( filter . matches ( ctMethod ) , org . hamcrest . core . Is . is ( true ) )
testNoAuthorizeHttpOnSendToError ( ) { com . streamsets . pipeline . stage . origin . http . HttpClientSource origin = getUnauthorizedClientSource ( ) ; com . streamsets . pipeline . sdk . SourceRunner runner = new com . streamsets . pipeline . sdk . SourceRunner . Builder ( com . streamsets . pipeline . stage . origin . http . HttpClientDSource . class , origin ) . addOutputLane ( "lane" ) . setOnRecordError ( OnRecordError . TO_ERROR ) . build ( ) ; runner . runInit ( ) ; try { runner . runProduce ( null , 1000 ) ; java . util . List < java . lang . String > errors = runner . getErrors ( ) ; "<AssertPlaceHolder>" ; } finally { runner . runDestroy ( ) ; } } size ( ) { return delegate . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , errors . size ( ) )
testGetExecutionTests ( ) { il . co . topq . difido . model . execution . MachineNode machine = il . co . topq . report . business . elastic . ExecutionMetaDataGenerator . generateMachineNode ( 2 , 10 ) ; java . util . Set < il . co . topq . difido . model . execution . TestNode > tests = il . co . topq . report . business . elastic . EsControllerIT . controller . getExecutionTests ( machine ) ; "<AssertPlaceHolder>" ; } getExecutionTests ( il . co . topq . difido . model . execution . MachineNode ) { java . util . Set < il . co . topq . difido . model . execution . TestNode > executionTests = new java . util . HashSet < il . co . topq . difido . model . execution . TestNode > ( ) ; if ( null == machineNode ) { return executionTests ; } if ( null == ( machineNode . getChildren ( ) ) ) { return executionTests ; } for ( il . co . topq . difido . model . execution . Node node : machineNode . getChildren ( true ) ) { if ( node instanceof il . co . topq . difido . model . execution . TestNode ) { if ( ( ( ( il . co . topq . difido . model . execution . TestNode ) ( node ) ) . isHideInHtml ( ) ) && ( ( il . co . topq . difido . model . Enums . Status . success ) == ( ( ( il . co . topq . difido . model . execution . TestNode ) ( node ) ) . getStatus ( ) ) ) ) { continue ; } executionTests . add ( ( ( il . co . topq . difido . model . execution . TestNode ) ( node ) ) ) ; } } return executionTests ; }
org . junit . Assert . assertEquals ( tests . size ( ) , 20 )
testKeyNull ( ) { java . lang . String prefix = "someprefix" ; java . lang . String realKey = "key1" ; java . lang . String envKey = prefix + "!" ; java . lang . String value = "value1" ; java . util . Map < java . lang . String , java . lang . Object > env = com . google . common . collect . ImmutableMap . of ( envKey , value ) ; configuration . setPrefix ( prefix ) ; configuration . setEnvironment ( env ) ; configuration . buildMap ( ) ; com . google . common . collect . ImmutableMap < java . lang . String , java . lang . String > effectiveEnv = configuration . getObject ( ) ; "<AssertPlaceHolder>" ; } get ( diskCacheV111 . services . space . LinkGroupCriterion ) { diskCacheV111 . services . space . JdbcSpaceManagerDatabase . JdbcCriterion c = ( ( diskCacheV111 . services . space . JdbcSpaceManagerDatabase . JdbcCriterion ) ( criterion ) ) ; return getJdbcTemplate ( ) . query ( ( ( ( "SELECT<sp>*<sp>from<sp>" + ( diskCacheV111 . services . space . JdbcSpaceManagerDatabase . LINKGROUP_TABLE ) ) + "<sp>WHERE<sp>" ) + ( c . getPredicate ( ) ) ) , c . getArguments ( ) , this :: toLinkGroup ) ; }
org . junit . Assert . assertEquals ( null , effectiveEnv . get ( realKey ) )
testClientSendWithListenerThrowingNonRetryableException ( ) { java . lang . String name = "clientname" ; com . sun . sgs . test . impl . service . session . TestClientSessionServiceImplv4 . DummyClient client = createDummyClient ( name ) ; try { client . connect ( serverNode . getAppPort ( ) ) ; "<AssertPlaceHolder>" ; com . sun . sgs . test . impl . service . session . TestClientSessionServiceImplv4 . receivedMessageException = new com . sun . sgs . test . impl . service . session . TestClientSessionServiceImplv4 . MaybeRetryException ( "non-retryable" , false ) ; int numMessages = 5 ; for ( int i = 0 ; i < numMessages ; i ++ ) { java . nio . ByteBuffer buf = java . nio . ByteBuffer . allocate ( 4 ) ; buf . putInt ( i ) . flip ( ) ; client . sendMessage ( buf . array ( ) , true ) ; } client . waitForSessionListenerToReceiveExpectedMessages ( ( numMessages - 1 ) ) ; client . validateMessageSequence ( client . sessionListenerReceivedMessages , ( numMessages - 1 ) , 1 ) ; } finally { client . disconnect ( ) ; } } login ( ) { return login ( true ) ; }
org . junit . Assert . assertTrue ( client . login ( ) )
testFileEntryQueryReturnsLatestFileVersion ( ) { com . liferay . portal . kernel . repository . model . FileEntry fileEntry = org . mockito . Mockito . mock ( com . liferay . portal . kernel . repository . model . FileEntry . class ) ; _amImageQueryBuilderImpl . forFileEntry ( fileEntry ) ; "<AssertPlaceHolder>" ; } getFileVersion ( ) { if ( ( _fileVersion ) != null ) { return _fileVersion ; } _fileVersion = _fileEntry . getFileVersion ( ) ; return _fileVersion ; }
org . junit . Assert . assertEquals ( fileEntry . getFileVersion ( ) , _amImageQueryBuilderImpl . getFileVersion ( ) )
testTruncateStringUnder ( ) { java . lang . String input = "123456789" ; java . lang . String truncate = org . sagebionetworks . repo . manager . message . DiscussionBroadcastMessageBuilder . truncateString ( input , input . length ( ) ) ; "<AssertPlaceHolder>" ; } truncateString ( java . lang . String , int ) { if ( ( toTruncate . length ( ) ) <= maxLength ) { return toTruncate ; } else { return ( toTruncate . substring ( 0 , maxLength ) ) + "..." ; } }
org . junit . Assert . assertEquals ( input , truncate )
shouldConvertIntToDoubleCorrectly ( ) { final java . lang . Double d = io . confluent . ksql . serde . util . SerdeUtils . toDouble ( 1 ) ; "<AssertPlaceHolder>" ; } toDouble ( java . lang . Object ) { java . util . Objects . requireNonNull ( object , "Object<sp>cannot<sp>be<sp>null" ) ; if ( object instanceof java . lang . Double ) { return ( ( java . lang . Double ) ( object ) ) ; } if ( object instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( object ) ) . doubleValue ( ) ; } if ( object instanceof java . lang . String ) { try { return java . lang . Double . parseDouble ( ( ( java . lang . String ) ( object ) ) ) ; } catch ( final java . lang . NumberFormatException e ) { throw new io . confluent . ksql . util . KsqlException ( ( ( "Cannot<sp>convert<sp>" + object ) + "<sp>to<sp>DOUBLE." ) , e ) ; } } throw new java . lang . IllegalArgumentException ( "This<sp>Object<sp>doesn't<sp>represent<sp>a<sp>double" ) ; }
org . junit . Assert . assertThat ( d , org . hamcrest . CoreMatchers . equalTo ( 1.0 ) )
shouldApplyDifferentTransformersToDifferentGroups ( ) { final java . util . function . Function < java . lang . String , java . lang . Integer > function = String :: length ; final java . util . function . Function < java . lang . String , java . lang . String > function1 = String :: toUpperCase ; final java . util . Map < java . lang . String , uk . gov . gchq . gaffer . data . element . function . ElementTransformer > edges = new java . util . HashMap ( ) ; given ( store . getSchema ( ) ) . willReturn ( schema ) ; final uk . gov . gchq . gaffer . data . element . Edge edge = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE ) . property ( TestPropertyNames . PROP_1 , "testValue" ) . property ( TestPropertyNames . PROP_2 , 5 ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Edge edge1 = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE_2 ) . property ( TestPropertyNames . PROP_2 , "otherValue" ) . property ( TestPropertyNames . PROP_3 , 2L ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . function . ElementTransformer elementTransformer = new uk . gov . gchq . gaffer . data . element . function . ElementTransformer . Builder ( ) . select ( TestPropertyNames . PROP_1 ) . execute ( function ) . project ( TestPropertyNames . PROP_4 ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . function . ElementTransformer elementTransformer1 = new uk . gov . gchq . gaffer . data . element . function . ElementTransformer . Builder ( ) . select ( TestPropertyNames . PROP_2 ) . execute ( function1 ) . project ( TestPropertyNames . PROP_4 ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Edge expectedEdge = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE ) . property ( TestPropertyNames . PROP_4 , 9 ) . property ( TestPropertyNames . PROP_2 , 5 ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Edge expectedEdge1 = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE_2 ) . property ( TestPropertyNames . PROP_4 , "OTHERVALUE" ) . property ( TestPropertyNames . PROP_3 , 2L ) . build ( ) ; edges . put ( TestGroups . EDGE , elementTransformer ) ; edges . put ( TestGroups . EDGE_2 , elementTransformer1 ) ; input . add ( edge ) ; input . add ( edge1 ) ; expected . add ( expectedEdge ) ; expected . add ( expectedEdge1 ) ; final uk . gov . gchq . gaffer . operation . impl . function . Transform transform = new uk . gov . gchq . gaffer . operation . impl . function . Transform . Builder ( ) . input ( input ) . edges ( edges ) . build ( ) ; final java . lang . Iterable < ? extends uk . gov . gchq . gaffer . data . element . Element > results = handler . doOperation ( transform , context , store ) ; final java . util . List < uk . gov . gchq . gaffer . data . element . Element > resultsList = com . google . common . collect . Lists . newArrayList ( results ) ; boolean isSame = false ; for ( int i = 0 ; i < ( resultsList . size ( ) ) ; i ++ ) { isSame = expected . get ( i ) . getProperty ( TestPropertyNames . PROP_4 ) . equals ( resultsList . get ( i ) . getProperty ( TestPropertyNames . PROP_4 ) ) ; } "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return properties . get ( name ) ; }
org . junit . Assert . assertTrue ( isSame )
testNameCoverageSubSubdomainWithWildcard ( ) { final java . lang . String name = "deeper.xmpp.example.org" ; final java . lang . String pattern = "*.example.org" ; final boolean result = org . jivesoftware . openfire . net . DNSUtil . isNameCoveredByPattern ( name , pattern ) ; "<AssertPlaceHolder>" ; } isNameCoveredByPattern ( java . lang . String , java . lang . String ) { if ( ( ( ( name == null ) || ( name . isEmpty ( ) ) ) || ( pattern == null ) ) || ( pattern . isEmpty ( ) ) ) { throw new java . lang . IllegalArgumentException ( "Arguments<sp>cannot<sp>be<sp>null<sp>or<sp>empty." ) ; } final java . lang . String needle = name . toLowerCase ( ) ; final java . lang . String hayStack = pattern . toLowerCase ( ) ; if ( needle . equals ( hayStack ) ) { return true ; } if ( hayStack . startsWith ( "*." ) ) { return needle . endsWith ( hayStack . substring ( 2 ) ) ; } return false ; }
org . junit . Assert . assertTrue ( result )
testEnumUnion ( ) { org . apache . avro . generic . GenericData genericData = org . apache . avro . generic . GenericData . get ( ) ; io . confluent . connect . avro . AvroDataConfig avroDataConfig = new io . confluent . connect . avro . AvroDataConfig . Builder ( ) . with ( AvroDataConfig . ENHANCED_AVRO_SCHEMA_SUPPORT_CONFIG , true ) . build ( ) ; io . confluent . connect . avro . AvroData avroData = new io . confluent . connect . avro . AvroData ( avroDataConfig ) ; com . connect . avro . EnumUnion testModel = com . connect . avro . EnumUnion . newBuilder ( ) . setUserType ( UserType . ANONYMOUS ) . build ( ) ; org . apache . kafka . connect . data . SchemaAndValue schemaAndValue = avroData . toConnectData ( EnumUnion . SCHEMA . , testModel ) ; org . apache . kafka . connect . data . Schema schema = schemaAndValue . schema ( ) ; java . lang . Object schemaValue = schemaAndValue . value ( ) ; org . apache . avro . generic . GenericData . Record value = ( ( org . apache . avro . generic . GenericData . Record ) ( avroData . fromConnectData ( schema , schemaValue ) ) ) ; org . apache . avro . Schema userTypeSchema = EnumUnion . SCHEMA . . getField ( "userType" ) . schema ( ) ; java . lang . Object userTypeValue = value . get ( "userType" ) ; int unionIndex = genericData . resolveUnion ( userTypeSchema , userTypeValue ) ; "<AssertPlaceHolder>" ; } get ( int ) { io . confluent . kafka . schemaregistry . storage . SchemaValue schema = null ; try { io . confluent . kafka . schemaregistry . storage . SchemaKey subjectVersionKey = lookupCache . schemaKeyById ( id ) ; if ( subjectVersionKey == null ) { return null ; } schema = ( ( io . confluent . kafka . schemaregistry . storage . SchemaValue ) ( kafkaStore . get ( subjectVersionKey ) ) ) ; if ( schema == null ) { return null ; } } catch ( io . confluent . kafka . schemaregistry . storage . exceptions . StoreException e ) { throw new io . confluent . kafka . schemaregistry . exceptions . SchemaRegistryStoreException ( ( ( ( "Error<sp>while<sp>retrieving<sp>schema<sp>with<sp>id<sp>" + id ) + "<sp>from<sp>the<sp>backend<sp>Kafka" ) + "<sp>store" ) , e ) ; } io . confluent . kafka . schemaregistry . client . rest . entities . SchemaString schemaString = new io . confluent . kafka . schemaregistry . client . rest . entities . SchemaString ( ) ; schemaString . setSchemaString ( schema . getSchema ( ) ) ; return schemaString ; }
org . junit . Assert . assertEquals ( 1 , unionIndex )
testFairlyLargeGraph ( ) { org . antlr . misc . Graph < java . lang . String > g = new org . antlr . misc . Graph < java . lang . String > ( ) ; g . addEdge ( "C" , "F" ) ; g . addEdge ( "C" , "G" ) ; g . addEdge ( "C" , "A" ) ; g . addEdge ( "C" , "B" ) ; g . addEdge ( "A" , "D" ) ; g . addEdge ( "A" , "E" ) ; g . addEdge ( "B" , "E" ) ; g . addEdge ( "D" , "E" ) ; g . addEdge ( "D" , "F" ) ; g . addEdge ( "F" , "H" ) ; g . addEdge ( "E" , "F" ) ; java . lang . String expecting = "[H,<sp>F,<sp>E,<sp>D,<sp>G,<sp>A,<sp>B,<sp>C]" ; java . util . List < java . lang . String > nodes = g . sort ( ) ; java . lang . String result = nodes . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( "[" + ( grammar . name ) ) + "." ) + ( name ) ) + ",index=" ) + ( index ) ) + ",line=" ) + ( tree . getToken ( ) . getLine ( ) ) ) + "]" ; }
org . junit . Assert . assertEquals ( expecting , result )
testHandleParameterWithXmlAdapterOnInterface ( ) { java . lang . String value = "1.1" ; org . apache . cxf . jaxrs . utils . InjectionUtilsTest . Id id = org . apache . cxf . jaxrs . utils . InjectionUtils . handleParameter ( value , true , org . apache . cxf . jaxrs . utils . InjectionUtilsTest . Id . class , org . apache . cxf . jaxrs . utils . InjectionUtilsTest . Id . class , new java . lang . annotation . Annotation [ ] { } , ParameterType . PATH , org . apache . cxf . jaxrs . utils . InjectionUtilsTest . createMessage ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return getClass ( ) . getName ( ) ; }
org . junit . Assert . assertEquals ( value , id . getId ( ) )
testExecute ( ) { System . out . println ( "execute" ) ; org . apache . jmeter . samplers . SampleResult previousResult = null ; org . apache . jmeter . samplers . Sampler currentSampler = null ; kg . apc . jmeter . functions . FifoPut instance = new kg . apc . jmeter . functions . FifoPut ( ) ; java . lang . String expResult = "FifoPuttest" ; java . util . LinkedList < org . apache . jmeter . engine . util . CompoundVariable > list = new java . util . LinkedList ( ) ; list . add ( new org . apache . jmeter . engine . util . CompoundVariable ( "FifoPuttest" ) ) ; list . add ( new org . apache . jmeter . engine . util . CompoundVariable ( "FifoPuttest" ) ) ; instance . setParameters ( list ) ; java . lang . String result = instance . execute ( null , null ) ; "<AssertPlaceHolder>" ; } execute ( org . apache . jmeter . samplers . SampleResult , org . apache . jmeter . samplers . Sampler ) { java . lang . String tstName = values [ 0 ] . execute ( ) ; java . lang . String concName = tstName + "_concurrency" ; if ( justStarted ) { org . apache . jmeter . util . JMeterUtils . setProperty ( concName , java . lang . String . valueOf ( values [ 1 ] . execute ( ) ) ) ; justStarted = false ; } int limit = Integer . MAX_VALUE ; if ( ( values . length ) > 2 ) { try { limit = java . lang . Integer . parseInt ( values [ 2 ] . execute ( ) ) ; } catch ( java . lang . NumberFormatException exc ) { kg . apc . jmeter . timers . functions . TSTFeedback . log . debug ( "Failed<sp>to<sp>parse<sp>value<sp>for<sp>limit,<sp>defaulting<sp>to<sp>infinity" , exc ) ; } } double spare = 0.1 ; if ( ( values . length ) > 3 ) { try { spare = java . lang . Double . parseDouble ( values [ 3 ] . execute ( ) ) ; } catch ( java . lang . NumberFormatException exc ) { kg . apc . jmeter . timers . functions . TSTFeedback . log . debug ( "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" , exc ) ; spare = 1 ; } } int con = java . lang . Integer . parseInt ( org . apache . jmeter . util . JMeterUtils . getPropDefault ( concName , "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 2 ) ) ; int delayed = java . lang . Integer . parseInt ( org . apache . jmeter . util . JMeterUtils . getPropDefault ( ( tstName + "_cntDelayed" ) , "0" ) ) ; int sent = java . lang . Integer . parseInt ( org . apache . jmeter . util . JMeterUtils . getPropDefault ( ( tstName + "_cntSent" ) , "0" ) ) ; float rps = java . lang . Float . parseFloat ( org . apache . jmeter . util . JMeterUtils . getPropDefault ( ( tstName + "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 4 ) , "0" ) ) ; int needed = con ; if ( rps <= 0 ) { } else if ( delayed > 0 ) { needed = decreaseNeeded ( spare , con , delayed , needed ) ; } else if ( sent < rps ) { needed = ( ( int ) ( java . lang . Math . ceil ( ( con * ( 2 - ( sent / rps ) ) ) ) ) ) ; } if ( ( needed != con ) && ( kg . apc . jmeter . timers . functions . TSTFeedback . log . isDebugEnabled ( ) ) ) { kg . apc . jmeter . timers . functions . TSTFeedback . log . debug ( ( ( ( ( ( ( ( ( ( ( ( ( "Need<sp>to<sp>change<sp>" + concName ) + ":<sp>" ) + con ) + "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 5 ) + needed ) + "<sp>(" ) + sent ) + "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 3 ) + rps ) + "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 3 ) + delayed ) + "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 0 ) ) ; } if ( needed <= 0 ) { kg . apc . jmeter . timers . functions . TSTFeedback . log . warn ( ( "Got<sp>concurrency<sp>less<sp>than<sp>zero:<sp>" + needed ) ) ; needed = 1 ; } if ( needed > limit ) { kg . apc . jmeter . timers . functions . TSTFeedback . log . warn ( ( "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 1 + needed ) ) ; needed = limit ; } org . apache . jmeter . util . JMeterUtils . setProperty ( concName , java . lang . String . valueOf ( needed ) ) ; org . apache . jmeter . util . JMeterUtils . setProperty ( ( tstName + "Failed<sp>to<sp>parse<sp>value<sp>for<sp>spare<sp>ratio,<sp>defaulting<sp>to<sp>0" 4 ) , "0" ) ; return java . lang . String . valueOf ( needed ) ; }
org . junit . Assert . assertEquals ( expResult , result )
testSkipScanJoinOptimization ( ) { try ( java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) ) ) { java . lang . String tableName = generateUniqueName ( ) ; java . lang . String viewName = generateUniqueName ( ) ; java . lang . String idxName = "IDX_" + tableName ; conn . setAutoCommit ( true ) ; conn . createStatement ( ) . execute ( ( ( ( "create<sp>table<sp>" + tableName ) + "create<sp>table<sp>" 6 ) + "create<sp>table<sp>" 5 ) ) ; conn . createStatement ( ) . execute ( ( ( "create<sp>table<sp>" 7 + tableName ) + "<sp>values<sp>(1,1,1,1)" ) ) ; conn . createStatement ( ) . execute ( ( ( "create<sp>table<sp>" 7 + tableName ) + "create<sp>table<sp>" 4 ) ) ; conn . createStatement ( ) . execute ( ( ( "create<sp>table<sp>" 7 + tableName ) + "<sp>values<sp>(2,3,1,2)" ) ) ; conn . createStatement ( ) . execute ( ( ( ( ( "create<sp>table<sp>" 2 + viewName ) + "create<sp>table<sp>" 0 ) + tableName ) + "<sp>where<sp>PK1<sp>in<sp>(1,2)" ) ) ; conn . createStatement ( ) . execute ( ( ( ( ( "create<sp>index<sp>" + idxName ) + "<sp>on<sp>" ) + viewName ) + "create<sp>table<sp>" 1 ) ) ; java . sql . ResultSet rs = conn . createStatement ( ) . executeQuery ( ( ( ( ( ( ( "select<sp>/*+<sp>INDEX(" + viewName ) + "<sp>" ) + idxName ) + "create<sp>table<sp>" 3 ) + viewName ) + "<sp>where<sp>ID1<sp>=<sp>1<sp>" ) ) ; "<AssertPlaceHolder>" ; } } next ( ) { if ( ! ( org . apache . phoenix . util . CursorUtil . moreValues ( cursorName ) ) ) { return null ; } else if ( ( fetchSize ) == ( rowsRead ) ) { return null ; } org . apache . phoenix . schema . tuple . Tuple next = delegate . next ( ) ; org . apache . phoenix . util . CursorUtil . updateCursor ( cursorName , next , delegate . peek ( ) ) ; ( rowsRead ) ++ ; return next ; }
org . junit . Assert . assertTrue ( rs . next ( ) )
givenNoHeadersWhenSerializeThenProduceNothing ( ) { java . lang . StringBuilder sb = v2Serializer . serialize ( java . util . Collections . < java . lang . String , java . lang . String > emptyMap ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return com . google . firestore . admin . v1 . FieldName . PATH_TEMPLATE . instantiate ( "project" , project , "database" , database , "collection_id" , collectionId , "field_id" , fieldId ) ; }
org . junit . Assert . assertEquals ( sb . toString ( ) , "" )
testExecuteFunctionArg4SuccessCase ( ) { java . lang . Integer result = managedTransaction . executeFunction ( this :: callHelperWithReturn , testParam1 , testParam2 , testParam3 , testParam4 ) ; "<AssertPlaceHolder>" ; verifyInteractionWithTransactionManagerSuccessCase ( testParam1 , testParam2 , testParam3 , testParam4 ) ; } executeFunction ( ManagedTransactionFunction . Arg4 , T1 , T2 , T3 , T4 ) { return executeTransactionBlockInternal ( ( ) -> fn . apply ( t1 , t2 , t3 , t4 ) ) ; }
org . junit . Assert . assertEquals ( java . lang . Integer . valueOf ( 1 ) , result )
testGetAsStringEmpty ( ) { javax . faces . component . UIComponent component = org . oscm . ui . converter . ConverterTestHelper . getComponent ( false , null , null , "duration" ) ; java . lang . String result = converter . getAsString ( context , component , "" ) ; "<AssertPlaceHolder>" ; } getAsString ( javax . faces . context . FacesContext , javax . faces . component . UIComponent , java . lang . Object ) { java . lang . String retVal ; if ( ! ( object instanceof org . oscm . internal . vo . VOPaymentInfo ) ) { retVal = "" ; } else { retVal = java . lang . String . valueOf ( ( ( org . oscm . internal . vo . VOPaymentInfo ) ( object ) ) . getKey ( ) ) ; } return retVal ; }
org . junit . Assert . assertNull ( result )
testChannelIdNotPublish ( ) { com . ewcms . publication . service . ChannelPublishServiceable channelLoaderService = mock ( com . ewcms . publication . service . ChannelPublishServiceable . class ) ; com . ewcms . core . site . model . Channel channel = new com . ewcms . core . site . model . Channel ( ) ; channel . setId ( 1 ) ; channel . setPublicenable ( false ) ; when ( channelLoaderService . getChannel ( any ( com . ewcms . publication . freemarker . directive . Integer . class ) , any ( com . ewcms . publication . freemarker . directive . Integer . class ) ) ) . thenReturn ( channel ) ; com . ewcms . publication . freemarker . directive . ArticleListDirective directive = new com . ewcms . publication . freemarker . directive . ArticleListDirective ( channelLoaderService , null ) ; cfg . setSharedVariable ( "alist" , directive ) ; freemarker . template . Template template = cfg . getTemplate ( getTemplatePath ( "value.html" ) ) ; java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; com . ewcms . core . site . model . Site site = new com . ewcms . core . site . model . Site ( ) ; site . setId ( 1 ) ; params . put ( GlobalVariable . SITE . toString ( ) , site ) ; java . lang . String value = process ( template , params ) ; "<AssertPlaceHolder>" ; } process ( org . apache . http . HttpResponse , org . apache . http . protocol . HttpContext ) { org . apache . http . HttpEntity entity = response . getEntity ( ) ; org . apache . http . Header contentEncoding = entity . getContentEncoding ( ) ; if ( contentEncoding != null ) { org . apache . http . HeaderElement [ ] codecs = contentEncoding . getElements ( ) ; for ( org . apache . http . HeaderElement codec : codecs ) { if ( codec . getName ( ) . equalsIgnoreCase ( "gzip" ) ) { response . setEntity ( new com . ewcms . plugin . crawler . generate . fetcher . PageFetcher . GzipDecompressingEntity ( response . getEntity ( ) ) ) ; return ; } } } }
org . junit . Assert . assertEquals ( "" , value )
testExecuteQueryPreparedStatement ( ) { io . sniffy . Spy spy = io . sniffy . Sniffy . spy ( ) ; try ( io . sniffy . sql . Connection connection = io . sniffy . sql . DriverManager . getConnection ( "sniffy:jdbc:h2:mem:" , "sa" , "sa" ) ; io . sniffy . sql . PreparedStatement preparedStatement = connection . prepareStatement ( "SELECT<sp>1<sp>FROM<sp>DUAL" ) ) { preparedStatement . executeQuery ( ) ; } "<AssertPlaceHolder>" ; spy . verifyAtMostOnce ( ) . reset ( ) . verifyNever ( ) ; } executedStatements ( ) { return null == ( executedStatements ) ? 0 : exceptions . size ( ) ; }
org . junit . Assert . assertEquals ( 1 , spy . executedStatements ( ) )
testGetPIDorNull ( ) { java . lang . Integer pid = com . hazelcast . simulator . utils . NativeUtils . getPID ( ) ; "<AssertPlaceHolder>" ; } getPID ( ) { java . lang . Integer pid = com . hazelcast . simulator . utils . NativeUtils . getPidFromManagementBean ( ) ; if ( pid != null ) { return pid ; } pid = com . hazelcast . simulator . utils . NativeUtils . getPidViaReflection ( ) ; if ( pid != null ) { return pid ; } return - 1 ; }
org . junit . Assert . assertNotNull ( pid )
testBasicWrapping ( ) { java . util . Map < java . lang . String , java . lang . Object > properties = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "a" , 1 ) ; put ( "b" , 2 ) ; put ( ResourceResolver . PROPERTY_RESOURCE_TYPE , "a/b/c" ) ; } } ; org . apache . sling . api . resource . Resource wrappedResource = new com . adobe . cq . wcm . core . components . internal . resource . ImageResourceWrapper ( prepareResourceToBeWrapped ( properties ) , "d/e/f" ) ; java . util . ArrayList < java . util . Map . Entry > keyValuePairs = new java . util . ArrayList ( ) ; keyValuePairs . add ( new org . apache . commons . collections . keyvalue . DefaultMapEntry ( "a" , 1 ) ) ; keyValuePairs . add ( new org . apache . commons . collections . keyvalue . DefaultMapEntry ( "b" , 2 ) ) ; keyValuePairs . add ( new org . apache . commons . collections . keyvalue . DefaultMapEntry ( org . apache . sling . api . resource . ResourceResolver . PROPERTY_RESOURCE_TYPE , "d/e/f" ) ) ; testValueMap ( keyValuePairs , wrappedResource . adaptTo ( org . apache . sling . api . resource . ValueMap . class ) ) ; testValueMap ( keyValuePairs , wrappedResource . getValueMap ( ) ) ; "<AssertPlaceHolder>" ; } getResourceType ( ) { return resourceType ; }
org . junit . Assert . assertEquals ( "d/e/f" , wrappedResource . getResourceType ( ) )
does_not_support_modifying ( ) { when ( update . getAction ( ) ) . thenReturn ( Action . MODIFY ) ; when ( update . getType ( ) ) . thenReturn ( ObjectType . INETNUM ) ; "<AssertPlaceHolder>" ; } supports ( net . ripe . db . whois . update . domain . PreparedUpdate ) { return ( update . getAction ( ) . equals ( Action . CREATE ) ) && ( ( update . getType ( ) . equals ( ObjectType . ROUTE ) ) || ( update . getType ( ) . equals ( ObjectType . ROUTE6 ) ) ) ; }
org . junit . Assert . assertThat ( subject . supports ( update ) , org . hamcrest . core . Is . is ( false ) )
testHasWidth ( ) { com . eclipsesource . tabris . passepartout . Bounds bounds = new com . eclipsesource . tabris . passepartout . Bounds ( 23 , 42 , 123 , 142 ) ; int width = bounds . getWidth ( ) ; "<AssertPlaceHolder>" ; } getWidth ( ) { return width ; }
org . junit . Assert . assertEquals ( 123 , width )
subscribeToBroadcastWithEnumOutput ( ) { final java . util . concurrent . Semaphore broadcastReceived = new java . util . concurrent . Semaphore ( 0 ) ; final joynr . tests . testTypes . TestEnum expectedTestEnum = joynr . tests . testTypes . TestEnum . TWO ; io . joynr . integration . AbstractBroadcastEnd2EndTest . proxy . subscribeToBroadcastWithEnumOutputBroadcast ( new testBroadcastInterface . BroadcastWithEnumOutputBroadcastAdapter ( ) { @ io . joynr . integration . Override public void onReceive ( joynr . tests . testTypes . TestEnum testEnum ) { "<AssertPlaceHolder>" ; broadcastReceived . release ( ) ; } @ io . joynr . integration . Override public void onError ( io . joynr . exceptions . SubscriptionException error ) { org . junit . Assert . fail ( "Error<sp>subscribing<sp>to<sp>broadcast" ) ; } } , new joynr . MulticastSubscriptionQos ( ) ) ; java . lang . Thread . sleep ( 300 ) ; io . joynr . integration . AbstractBroadcastEnd2EndTest . provider . fireBroadcastWithEnumOutput ( expectedTestEnum ) ; broadcastReceived . acquire ( ) ; } onReceive ( joynr . interlanguagetest . namedTypeCollection2 . ExtendedTypeCollectionEnumerationInTypeCollection ) { io . joynr . test . interlanguage . IltConsumerMulticastSubscriptionTest . LOG . info ( ( ( name . getMethodName ( ) ) + "<sp>-<sp>callback<sp>-<sp>got<sp>broadcast" ) ) ; subscribeBroadcastWithSingleEnumerationParameterCallbackResult = true ; subscribeBroadcastWithSingleEnumerationParameterCallbackDone = true ; synchronized ( callbackCalledSemaphore ) { callbackCalledSemaphore . notify ( ) ; } }
org . junit . Assert . assertEquals ( expectedTestEnum , testEnum )
testGetValue ( ) { System . out . println ( "getValue" ) ; org . neuroph . core . Weight instance = new org . neuroph . core . Weight ( 0.7 ) ; double expResult = 0.7 ; double result = instance . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return "" ; }
org . junit . Assert . assertEquals ( expResult , result , 0.0 )
should_create_or_query ( ) { final java . lang . String name = "testCreateOrQuery" ; org . apache . deltaspike . data . test . domain . Parent parent1 = new org . apache . deltaspike . data . test . domain . Parent ( ( name + "1" ) ) ; parent1 . setValue ( 25L ) ; org . apache . deltaspike . data . test . domain . Parent parent2 = new org . apache . deltaspike . data . test . domain . Parent ( ( name + "2" ) ) ; parent2 . setValue ( 75L ) ; org . apache . deltaspike . data . test . domain . Parent parent3 = new org . apache . deltaspike . data . test . domain . Parent ( ( name + "3" ) ) ; parent3 . setValue ( 25L ) ; org . apache . deltaspike . data . test . domain . Parent parent4 = new org . apache . deltaspike . data . test . domain . Parent ( ( name + "1" ) ) ; parent4 . setValue ( 75L ) ; getEntityManager ( ) . persist ( parent1 ) ; getEntityManager ( ) . persist ( parent2 ) ; getEntityManager ( ) . persist ( parent3 ) ; getEntityManager ( ) . persist ( parent4 ) ; getEntityManager ( ) . flush ( ) ; java . util . List < org . apache . deltaspike . data . test . domain . Parent > result = parentRepo . orQuery ( ( name + "1" ) , ( name + "2" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( this . wrappedNavigationCaseMap . size ( ) ) + ( this . viewConfigBasedNavigationCaseCache . size ( ) ) ; }
org . junit . Assert . assertEquals ( 2 , result . size ( ) )
testCalc ( ) { com . graphhopper . isochrone . algorithm . DelaunayTriangulationIsolineBuilder instance = new com . graphhopper . isochrone . algorithm . DelaunayTriangulationIsolineBuilder ( ) ; java . util . List < java . util . List < org . locationtech . jts . geom . Coordinate > > listOfList = new java . util . ArrayList ( ) ; java . util . List < org . locationtech . jts . geom . Coordinate > list = new java . util . ArrayList ( ) ; listOfList . add ( list ) ; list . add ( new org . locationtech . jts . geom . Coordinate ( 0.0 , 0.0 ) ) ; list . add ( new org . locationtech . jts . geom . Coordinate ( 0.001 , 0.0 ) ) ; list . add ( new org . locationtech . jts . geom . Coordinate ( 0.001 , 0.001 ) ) ; list . add ( new org . locationtech . jts . geom . Coordinate ( 0.001 , 0.002 ) ) ; list . add ( new org . locationtech . jts . geom . Coordinate ( 0.0 , 0.002 ) ) ; java . util . List < org . locationtech . jts . geom . Coordinate [ ] > res = instance . calcList ( listOfList , listOfList . size ( ) ) ; org . locationtech . jts . geom . Coordinate [ ] geometry = res . get ( 0 ) ; "<AssertPlaceHolder>" ; } get ( long ) { int segmentNo = ( ( int ) ( index / ( entriesPerSegment ) ) ) ; int entry = ( ( int ) ( index % ( entriesPerSegment ) ) ) ; try { if ( segmentNo >= ( segments . size ( ) ) ) { return null ; } byte [ ] bytes = segments . get ( segmentNo ) ; com . graphhopper . storage . VLongStorage store = new com . graphhopper . storage . VLongStorage ( com . graphhopper . coll . CompressedArray . decompress ( bytes ) ) ; long len = store . getLength ( ) ; for ( int i = 0 ; ( store . getPosition ( ) ) < len ; i ++ ) { long latlon = store . readVLong ( ) ; if ( i == entry ) { com . graphhopper . util . shapes . GHPoint point = new com . graphhopper . util . shapes . GHPoint ( ) ; algo . decode ( latlon , point ) ; return point ; } } return null ; } catch ( java . lang . ArrayIndexOutOfBoundsException ex ) { throw new java . lang . RuntimeException ( ( ( ( ( ( ( ( "index<sp>" + index ) + "=><sp>segNo:" ) + segmentNo ) + ",<sp>entry=" ) + entry ) + ",<sp>segments:" ) + ( segments . size ( ) ) ) , ex ) ; } catch ( java . lang . Exception ex ) { throw new java . lang . RuntimeException ( ex ) ; } }
org . junit . Assert . assertEquals ( 9 , geometry . length )
testBaseEquality2 ( ) { org . wildfly . security . auth . client . AuthenticationConfiguration c1 ; org . wildfly . security . auth . client . AuthenticationConfiguration c2 ; c1 = org . wildfly . security . auth . client . AuthenticationConfiguration . empty ( ) . useName ( "name1" ) . usePort ( 1234 ) . useProtocol ( "abcd" ) . usePassword ( "abcd" ) ; c2 = org . wildfly . security . auth . client . AuthenticationConfiguration . empty ( ) . useName ( "name1" ) . usePort ( 1234 ) . useProtocol ( "abcd" ) . usePassword ( "abcd" ) ; "<AssertPlaceHolder>" ; } usePassword ( org . wildfly . security . password . Password ) { final org . wildfly . security . credential . source . CredentialSource filtered = getCredentialSource ( ) . without ( org . wildfly . security . credential . PasswordCredential . class ) ; return password == null ? useCredentials ( filtered ) : useCredentials ( filtered ) . useCredential ( new org . wildfly . security . credential . PasswordCredential ( password ) ) ; }
org . junit . Assert . assertEquals ( c1 , c2 )
testVerifyIsNotSuperAdminOnly ( ) { java . lang . reflect . Method m = org . candlepin . resteasy . filter . AuthorizationFeatureTest . FakeResource . class . getMethod ( "methodWithVerify" , java . lang . String . class ) ; boolean isSuperAdminOnly = authorizationFeature . isSuperAdminOnly ( m ) ; "<AssertPlaceHolder>" ; } isSuperAdminOnly ( java . lang . reflect . Method ) { java . lang . annotation . Annotation [ ] [ ] allAnnotations = method . getParameterAnnotations ( ) ; for ( int i = 0 ; i < ( allAnnotations . length ) ; i ++ ) { for ( java . lang . annotation . Annotation a : allAnnotations [ i ] ) { if ( a instanceof org . candlepin . auth . Verify ) { return false ; } } } return true ; }
org . junit . Assert . assertEquals ( false , isSuperAdminOnly )
testSubmitReservationNormal ( ) { org . apache . hadoop . yarn . api . protocolrecords . ReservationSubmissionRequest request = createSimpleReservationSubmissionRequest ( 1 , 1 , 1 , 5 , 3 ) ; org . apache . hadoop . yarn . server . resourcemanager . reservation . Plan plan = null ; try { plan = rrValidator . validateReservationSubmissionRequest ( rSystem , request , org . apache . hadoop . yarn . server . resourcemanager . reservation . ReservationSystemTestUtil . getNewReservationId ( ) ) ; } catch ( org . apache . hadoop . yarn . exceptions . YarnException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } "<AssertPlaceHolder>" ; } getMessage ( ) { return builder . getMessage ( ) ; }
org . junit . Assert . assertNotNull ( plan )
testControleerNederlandseNationaliteitKindBijNederlandseOuders ( ) { final nl . bzk . brp . bijhouding . bericht . model . AdministratieveHandelingElement ahElement = maakGeboorteInNederlandAH ( "0001" , "0001" , false , java . util . Collections . emptyList ( ) , 20160101 ) ; final java . util . List < nl . bzk . brp . bijhouding . bericht . model . MeldingElement > meldingen = ahElement . valideerInhoud ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) )
testFilter ( ) { int maxLength = Integer . MAX_VALUE ; java . util . function . IntPredicate filter = ( i ) -> ( i % 2 ) == 0 ; java . util . List < org . ranksys . core . util . tuples . Tuple2id > result = recommender . getRecommendation ( 0 , maxLength , filter ) . getIidxs ( ) ; java . util . List < org . ranksys . core . util . tuples . Tuple2id > expected = java . util . Arrays . asList ( tuple ( 0 , 6.0 ) , tuple ( 2 , 4.0 ) , tuple ( 4 , 2.0 ) ) ; "<AssertPlaceHolder>" ; } tuple ( T1 , double ) { return new org . ranksys . core . util . tuples . Tuple2od ( v1 , v2 ) ; }
org . junit . Assert . assertEquals ( expected , result )
testToAndFromPb ( ) { com . google . cloud . bigquery . ViewDefinition viewDefinition = com . google . cloud . bigquery . ViewDefinitionTest . VIEW_DEFINITION . toBuilder ( ) . setUseLegacySql ( false ) . build ( ) ; "<AssertPlaceHolder>" ; compareViewDefinition ( viewDefinition , com . google . cloud . bigquery . TableDefinition . < com . google . cloud . bigquery . ViewDefinition > fromPb ( viewDefinition . toPb ( ) ) ) ; } fromPb ( com . google . api . services . bigquery . model . JobConfiguration ) { return new com . google . cloud . bigquery . WriteChannelConfiguration . Builder ( configurationPb ) . build ( ) ; }
org . junit . Assert . assertTrue ( ( ( com . google . cloud . bigquery . TableDefinition . fromPb ( viewDefinition . toPb ( ) ) ) instanceof com . google . cloud . bigquery . ViewDefinition ) )
withOneValueEach ( ) { "<AssertPlaceHolder>" ; } findSmallestDiff ( int [ ] , int [ ] ) { int [ ] small = ( ( a1 . length ) < ( a2 . length ) ) ? a1 : a2 ; int [ ] big = ( small == a1 ) ? a2 : a1 ; java . util . Arrays . sort ( small ) ; int diff = Integer . MAX_VALUE ; for ( int i : big ) { int p = java . util . Arrays . binarySearch ( small , i ) ; if ( p < 0 ) { int insertion = ( - p ) - 1 ; if ( insertion > 0 ) { diff = java . lang . Math . min ( diff , ( i - ( small [ ( insertion - 1 ) ] ) ) ) ; } if ( insertion < ( small . length ) ) { diff = java . lang . Math . min ( diff , ( ( small [ insertion ] ) - i ) ) ; } } } return diff ; }
org . junit . Assert . assertEquals ( 1 , s . findSmallestDiff ( new int [ ] { 1 } , new int [ ] { 2 } ) )
shouldPreventInfiniteRecusion ( ) { final java . util . Map < java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > , uk . gov . gchq . gaffer . store . operation . resolver . ScoreResolver > resolvers = new java . util . HashMap ( ) ; resolvers . put ( uk . gov . gchq . gaffer . operation . impl . get . GetElements . class , new uk . gov . gchq . gaffer . store . operation . resolver . ScoreResolver ( ) { @ uk . gov . gchq . gaffer . store . operation . resolver . Override public uk . gov . gchq . gaffer . store . operation . resolver . Integer getScore ( final uk . gov . gchq . gaffer . operation . Operation operation ) { throw new java . lang . IllegalArgumentException ( "defaultResolver<sp>is<sp>required" ) ; } @ uk . gov . gchq . gaffer . store . operation . resolver . Override public uk . gov . gchq . gaffer . store . operation . resolver . Integer getScore ( final uk . gov . gchq . gaffer . operation . Operation operation , final uk . gov . gchq . gaffer . store . operation . resolver . ScoreResolver defaultScoreResolver ) { return defaultScoreResolver . getScore ( operation ) ; } } ) ; final uk . gov . gchq . gaffer . operation . OperationChain opChain = new uk . gov . gchq . gaffer . operation . OperationChain . Builder ( ) . first ( new uk . gov . gchq . gaffer . operation . impl . get . GetAdjacentIds ( ) ) . then ( new uk . gov . gchq . gaffer . operation . impl . get . GetElements ( ) ) . build ( ) ; final uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver scoreResolver = new uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver ( null , resolvers ) ; final java . lang . Object result = scoreResolver . getScore ( opChain ) ; "<AssertPlaceHolder>" ; } getScore ( uk . gov . gchq . gaffer . operation . Operation ) { if ( null == operation ) { return 0 ; } if ( ( operation instanceof uk . gov . gchq . gaffer . operation . Operations ) && ( ! ( operation instanceof uk . gov . gchq . gaffer . named . operation . NamedOperation ) ) ) { int score = 0 ; for ( final uk . gov . gchq . gaffer . operation . Operation op : ( ( uk . gov . gchq . gaffer . operation . Operations < ? > ) ( operation ) ) . getOperations ( ) ) { score += getScore ( op ) ; } return score ; } else { final java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > opClass = operation . getClass ( ) ; if ( ( null == ( skipResolvingOperation ) ) || ( ( skipResolvingOperation ) != operation ) ) { uk . gov . gchq . gaffer . store . operation . resolver . ScoreResolver resolver = scoreResolvers . get ( opClass ) ; if ( null != resolver ) { final uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver delegateResolver = new uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver ( opScores , scoreResolvers , operation ) ; java . lang . Integer opScore = resolver . getScore ( operation , delegateResolver ) ; if ( null != opScore ) { return opScore ; } } } final java . util . List < java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > > keys = new java . util . ArrayList ( opScores . keySet ( ) ) ; for ( int i = ( keys . size ( ) ) - 1 ; i >= 0 ; i -- ) { final java . lang . Class < ? extends uk . gov . gchq . gaffer . operation . Operation > key = keys . get ( i ) ; if ( key . isAssignableFrom ( opClass ) ) { return opScores . get ( key ) ; } } } return uk . gov . gchq . gaffer . store . operation . resolver . DefaultScoreResolver . DEFAULT_OPERATION_SCORE ; }
org . junit . Assert . assertEquals ( 2 , result )
sortedView3 ( ) { org . diirt . util . array . ArrayDouble values = new org . diirt . util . array . ArrayDouble ( ( - 1.7178013239620846 ) , 0.5200744839822301 , 0.638091980352644 , 0.093683130487196 , ( - 1.2967630810250952 ) , 0.7040257444802407 , ( - 0.4166241363846508 ) , 2.9610862677876244 , 0.03636268292097817 , ( - 0.35530274977371445 ) ) ; org . diirt . util . array . SortedListView sortedView = org . diirt . util . array . ListNumbers . ListNumbers . sortedView ( values ) ; "<AssertPlaceHolder>" ; } sortedView ( org . diirt . util . array . ListNumber ) { org . diirt . util . array . SortedListView view = new org . diirt . util . array . SortedListView ( values ) ; if ( ( values . size ( ) ) <= 1 ) { return view ; } double value = values . getDouble ( 0 ) ; for ( int i = 1 ; i < ( values . size ( ) ) ; i ++ ) { double newValue = values . getDouble ( i ) ; if ( value > newValue ) { org . diirt . util . array . SortedListView . quicksort ( view ) ; return view ; } value = newValue ; } return view ; }
org . junit . Assert . assertThat ( sortedView , equalTo ( ( ( org . diirt . util . array . ListNumber ) ( new org . diirt . util . array . ArrayDouble ( ( - 1.7178013239620846 ) , ( - 1.2967630810250952 ) , ( - 0.4166241363846508 ) , ( - 0.35530274977371445 ) , 0.03636268292097817 , 0.093683130487196 , 0.5200744839822301 , 0.638091980352644 , 0.7040257444802407 , 2.9610862677876244 ) ) ) ) )
testParser2 ( ) { java . util . Calendar ref = java . util . Calendar . getInstance ( java . util . TimeZone . getTimeZone ( "GMT-2:00" ) ) ; ref . set ( 1997 , 6 , 16 , 19 , 20 , 30 ) ; ref . set ( Calendar . MILLISECOND , 45 ) ; java . util . Calendar cal = org . nuxeo . ecm . automation . client . model . DateParser . parse ( "1997-07-16T19:20:30.045-02:00" ) ; "<AssertPlaceHolder>" ; } getTime ( ) { return timestamp ; }
org . junit . Assert . assertEquals ( ref . getTime ( ) , cal . getTime ( ) )
testGetLayoutPageTemplateCollectionsByKeywords ( ) { com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group . getGroupId ( ) , com . liferay . portal . kernel . test . util . TestPropsValues . getUserId ( ) ) ; int originalLayoutPageTemplateCollectionsCount = com . liferay . layout . page . template . service . LayoutPageTemplateCollectionServiceUtil . getLayoutPageTemplateCollectionsCount ( _group . getGroupId ( ) , "Theme" ) ; com . liferay . layout . page . template . service . LayoutPageTemplateCollectionServiceUtil . addLayoutPageTemplateCollection ( _group . getGroupId ( ) , "Fjord<sp>Theme<sp>collection" , null , serviceContext ) ; com . liferay . layout . page . template . service . LayoutPageTemplateCollectionServiceUtil . addLayoutPageTemplateCollection ( _group . getGroupId ( ) , "Theme<sp>Westeros<sp>collection" , null , serviceContext ) ; int actualLayoutPageTemplateCollectionsCount = com . liferay . layout . page . template . service . LayoutPageTemplateCollectionServiceUtil . getLayoutPageTemplateCollectionsCount ( _group . getGroupId ( ) , "Theme" ) ; "<AssertPlaceHolder>" ; } getGroupId ( ) { return _groupId ; }
org . junit . Assert . assertEquals ( ( originalLayoutPageTemplateCollectionsCount + 2 ) , actualLayoutPageTemplateCollectionsCount )
configRoundTrip ( ) { story . addStep ( new org . junit . runners . model . Statement ( ) { @ org . jenkinsci . plugins . workflow . steps . Override public void evaluate ( ) throws java . lang . Throwable { configRoundTrip ( java . util . Collections . < java . lang . String > emptyList ( ) ) ; configRoundTrip ( java . util . Collections . singletonList ( "VAR1=val1" ) ) ; configRoundTrip ( java . util . Arrays . asList ( "VAR1=val1" , "VAR2=val2" ) ) ; } private void configRoundTrip ( java . util . List < java . lang . String > overrides ) throws org . jenkinsci . plugins . workflow . steps . Exception { "<AssertPlaceHolder>" ; } } ) ; } configRoundTrip ( java . util . List ) { org . junit . Assert . assertEquals ( overrides , new org . jenkinsci . plugins . workflow . steps . StepConfigTester ( story . j ) . configRoundTrip ( new org . jenkinsci . plugins . workflow . steps . EnvStep ( overrides ) ) . getOverrides ( ) ) ; }
org . junit . Assert . assertEquals ( overrides , new org . jenkinsci . plugins . workflow . steps . StepConfigTester ( story . j ) . configRoundTrip ( new org . jenkinsci . plugins . workflow . steps . EnvStep ( overrides ) ) . getOverrides ( ) )
testAncestors ( ) { com . ebay . cloud . cms . metadata . mongo . MongoMetadataServiceImpl metaService = ( ( com . ebay . cloud . cms . metadata . mongo . MongoMetadataServiceImpl ) ( com . ebay . cloud . cms . metadata . model . MetaClassTest . repo . getMetadataService ( ) ) ) ; com . ebay . cloud . cms . metadata . model . MetaClass appMeta = com . ebay . cloud . cms . metadata . model . MetaClassTest . repo . getMetadataService ( ) . getMetaClass ( com . ebay . cloud . cms . metadata . model . MetaClassTest . APPLICATION_SERVICE ) ; com . ebay . cloud . cms . metadata . model . MetaClass newMeta = new com . ebay . cloud . cms . metadata . model . MetaClass ( ) ; newMeta . setName ( "newName" ) ; newMeta . setMetadataService ( com . ebay . cloud . cms . metadata . model . MetaClassTest . repo . getMetadataService ( ) ) ; newMeta . setupAncestors ( metaService , java . util . Collections . < java . lang . String , com . ebay . cloud . cms . metadata . model . MetaClass > emptyMap ( ) ) ; try { newMeta . setParent ( "non-parent" ) ; newMeta . setupAncestors ( metaService , java . util . Collections . < java . lang . String , com . ebay . cloud . cms . metadata . model . MetaClass > emptyMap ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( com . ebay . cloud . cms . metadata . exception . IllegalMetaClassException e ) { } newMeta . setParent ( appMeta . getName ( ) ) ; newMeta . setupAncestors ( metaService , java . util . Collections . < java . lang . String , com . ebay . cloud . cms . metadata . model . MetaClass > emptyMap ( ) ) ; appMeta . setParent ( newMeta . getName ( ) ) ; try { newMeta . setupAncestors ( metaService , java . util . Collections . < java . lang . String , com . ebay . cloud . cms . metadata . model . MetaClass > emptyMap ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( com . ebay . cloud . cms . metadata . exception . IllegalMetaClassException e ) { } "<AssertPlaceHolder>" ; } toString ( ) { return value ; }
org . junit . Assert . assertNotNull ( appMeta . toString ( ) )
testPrioHeap ( ) { int k = 10 ; java . util . PriorityQueue < java . lang . Integer > heap = new java . util . PriorityQueue < java . lang . Integer > ( k , java . util . Collections . reverseOrder ( ) ) ; int [ ] array = new int [ ] { 5 , 6 , 4 , 3 , 2 , 6 , 7 , 9 , 3 } ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { heap . add ( array [ i ] ) ; } int cnt = 0 ; int [ ] result = new int [ array . length ] ; while ( ! ( heap . isEmpty ( ) ) ) { result [ ( cnt ++ ) ] = heap . remove ( ) ; } int [ ] expected = new int [ ] { 9 , 7 , 6 , 6 , 5 , 4 , 3 , 3 , 2 } ; "<AssertPlaceHolder>" ; }
org . junit . Assert . assertArrayEquals ( expected , result )
test ( ) { try { context = new com . obomprogramador . tools . jqana . context . Context ( ) ; testClasses = com . obomprogramador . tools . jqana . model . defaultimpl . RetriveTestResults . getResults ( context ) ; com . obomprogramador . tools . jqana . model . defaultimpl . DefaultProjectProcessor dpp = new com . obomprogramador . tools . jqana . model . defaultimpl . DefaultProjectProcessor ( context ) ; java . io . File sourceDir = new java . io . File ( this . getClass ( ) . getClassLoader ( ) . getResource ( rootTestResources ) . toURI ( ) ) ; java . io . File objectDir = sourceDir . getParentFile ( ) . getParentFile ( ) ; this . project = dpp . process ( "Teste" , sourceDir , objectDir ) ; com . obomprogramador . tools . jqana . model . defaultimpl . DefaultXmlGenerator generator = new com . obomprogramador . tools . jqana . model . defaultimpl . DefaultXmlGenerator ( context ) ; org . w3c . dom . Document report = generator . serialize ( this . project ) ; "<AssertPlaceHolder>" ; logger . debug ( ( "Test<sp>OK!<sp>XML:<sp>" + ( generator . xml2String ( report , true ) ) ) ) ; } catch ( java . lang . Exception ex ) { org . junit . Assert . fail ( ( ( ( ">>>>>>>>>><sp>jQana<sp>Report<sp>Error:<sp>" + ( context . getStatusBeforeException ( ) ) ) + ".<sp>Exception:<sp>" ) + ( ex . getMessage ( ) ) ) ) ; } } verifyResult ( org . w3c . dom . Document ) { boolean result = true ; javax . xml . bind . JAXBContext jcontext = javax . xml . bind . JAXBContext . newInstance ( com . obomprogramador . tools . jqana . model . Measurement . class ) ; javax . xml . bind . Unmarshaller m = jcontext . createUnmarshaller ( ) ; com . obomprogramador . tools . jqana . model . Measurement projectMeasurement = ( ( com . obomprogramador . tools . jqana . model . Measurement ) ( m . unmarshal ( report ) ) ) ; java . util . List < com . obomprogramador . tools . jqana . model . Measurement > packages = projectMeasurement . getInnerMeasurements ( ) ; for ( int x = 0 ; x < ( testClasses . length ) ; x ++ ) { com . obomprogramador . tools . jqana . model . Measurement packageM = getMeasurement ( packages , testClasses [ x ] [ 0 ] ) ; if ( packageM == null ) { System . out . println ( ( "***<sp>ERROR<sp>Package<sp>not<sp>found:<sp>" + ( testClasses [ x ] [ 0 ] ) ) ) ; result = false ; break ; } com . obomprogramador . tools . jqana . model . Measurement classM = getMeasurement ( packageM . getInnerMeasurements ( ) , testClasses [ x ] [ 1 ] ) ; if ( classM == null ) { System . out . println ( ( "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 6 + ( testClasses [ x ] [ 1 ] ) ) ) ; result = false ; break ; } com . obomprogramador . tools . jqana . model . defaultimpl . MetricValue ccMetric = classM . getMetricValue ( context . getBundle ( ) . getString ( "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 1 ) ) ; if ( ccMetric == null ) { System . out . println ( ( "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" + ( testClasses [ x ] [ 1 ] ) ) ) ; result = false ; break ; } com . obomprogramador . tools . jqana . model . defaultimpl . MetricValue lcom4Metric = classM . getMetricValue ( context . getBundle ( ) . getString ( "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 4 ) ) ; if ( ccMetric == null ) { System . out . println ( ( "***<sp>ERROR<sp>lcom4Metric<sp>is<sp>missing.<sp>Class:<sp>" + ( testClasses [ x ] [ 1 ] ) ) ) ; result = false ; break ; } com . obomprogramador . tools . jqana . model . defaultimpl . MetricValue rfcMetric = classM . getMetricValue ( context . getBundle ( ) . getString ( "metric.rfc.name" ) ) ; if ( ccMetric == null ) { System . out . println ( ( "***<sp>ERROR<sp>rfcMetric<sp>is<sp>missing.<sp>Class:<sp>" + ( testClasses [ x ] [ 1 ] ) ) ) ; result = false ; break ; } java . lang . String value = "" ; try { value = "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 8 ; double ccValue = java . lang . Double . parseDouble ( testClasses [ x ] [ 2 ] ) ; value = "lcom4" ; double lcom4Value = java . lang . Double . parseDouble ( testClasses [ x ] [ 3 ] ) ; value = "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 7 ; double rfcValue = java . lang . Double . parseDouble ( testClasses [ x ] [ 4 ] ) ; if ( ( java . lang . Math . abs ( ( ccValue - ( ccMetric . getValue ( ) ) ) ) ) > 0.5 ) { System . out . println ( ( ( ( ( ( "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 0 + ( testClasses [ x ] [ 1 ] ) ) + "<sp>expected:<sp>" ) + ccValue ) + "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 3 ) + ( ccMetric . getValue ( ) ) ) ) ; result = false ; } if ( ( java . lang . Math . abs ( ( lcom4Value - ( lcom4Metric . getValue ( ) ) ) ) ) > 0.5 ) { System . out . println ( ( ( ( ( ( "***<sp>ERROR<sp>metric<sp>lcom4<sp>value<sp>for<sp>class:<sp>" + ( testClasses [ x ] [ 1 ] ) ) + "<sp>expected:<sp>" ) + lcom4Value ) + "***<sp>ERROR<sp>ccMetric<sp>is<sp>missing.<sp>Class:<sp>" 3 ) + ( lcom4Metric . getValue ( ) ) ) ) ; result = false ; } if ( ( java . lang . Math . abs ( ( rfcValue - ( rfcMetric . getValue ( ) ) )
org . junit . Assert . assertTrue ( verifyResult ( report ) )
testNullIsNull ( ) { java . lang . String sql = com . liferay . portal . dao . orm . test . SQLNullTest . _SQL_IS_NULL ; if ( isSybase ( ) ) { sql = transformSybaseSQL ( sql ) ; } com . liferay . portal . kernel . dao . orm . Session session = _sessionFactory . openSession ( ) ; try { com . liferay . portal . kernel . dao . orm . SQLQuery sqlQuery = session . createSynchronizedSQLQuery ( sql ) ; com . liferay . portal . kernel . dao . orm . QueryPos qPos = com . liferay . portal . kernel . dao . orm . QueryPos . getInstance ( sqlQuery ) ; qPos . add ( ( ( java . lang . Object ) ( null ) ) ) ; java . util . List < java . lang . Object > list = sqlQuery . list ( ) ; "<AssertPlaceHolder>" ; } finally { _sessionFactory . closeSession ( session ) ; } } toString ( ) { com . liferay . petra . string . StringBundler sb = new com . liferay . petra . string . StringBundler ( 25 ) ; sb . append ( ",<sp>groupId=" 2 ) ; sb . append ( uuid ) ; sb . append ( ",<sp>assetListEntrySegmentsEntryRelId=" ) ; sb . append ( assetListEntrySegmentsEntryRelId ) ; sb . append ( ",<sp>groupId=" ) ; sb . append ( groupId ) ; sb . append ( ",<sp>companyId=" ) ; sb . append ( companyId ) ; sb . append ( ",<sp>userId=" ) ; sb . append ( userId ) ; sb . append ( ",<sp>userName=" ) ; sb . append ( userName ) ; sb . append ( ",<sp>createDate=" ) ; sb . append ( createDate ) ; sb . append ( ",<sp>groupId=" 1 ) ; sb . append ( modifiedDate ) ; sb . append ( ",<sp>assetListEntryId=" ) ; sb . append ( assetListEntryId ) ; sb . append ( ",<sp>segmentsEntryId=" ) ; sb . append ( segmentsEntryId ) ; sb . append ( ",<sp>groupId=" 0 ) ; sb . append ( typeSettings ) ; sb . append ( ",<sp>lastPublishDate=" ) ; sb . append ( lastPublishDate ) ; sb . append ( "}" ) ; return sb . toString ( ) ; }
org . junit . Assert . assertFalse ( list . toString ( ) , list . isEmpty ( ) )
getReaderWithRootAndResourceHasDoubleDotRelativePath ( ) { resolver . ClasspathResolver underTest = new resolver . ClasspathResolver ( "templates" ) ; java . io . Reader reader = underTest . getReader ( "absolute/../absolute_partials_template.html" ) ; "<AssertPlaceHolder>" ; } getReader ( java . lang . String ) { java . lang . ClassLoader ccl = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; java . lang . String fullResourceName = concatResourceRootAndResourceName ( resourceName ) ; java . lang . String normalizeResourceName = java . net . URI . create ( fullResourceName ) . normalize ( ) . getPath ( ) ; java . io . InputStream is = ccl . getResourceAsStream ( normalizeResourceName ) ; if ( is == null ) { java . lang . ClassLoader classLoader = resolver . ClasspathResolver . class . getClassLoader ( ) ; is = classLoader . getResourceAsStream ( normalizeResourceName ) ; } if ( is != null ) { return new java . io . BufferedReader ( new java . io . InputStreamReader ( is , java . nio . charset . StandardCharsets . UTF_8 ) ) ; } else { return null ; } }
org . junit . Assert . assertNotNull ( reader )
testDeleteColumnsWithDiffColsAndTags1 ( ) { org . apache . hadoop . hbase . TableName tableName = createTable ( 5 ) ; try ( org . apache . hadoop . hbase . client . Table table = org . apache . hadoop . hbase . security . visibility . TEST_UTIL . getConnection ( ) . getTable ( tableName ) ) { org . apache . hadoop . hbase . client . Put put = new org . apache . hadoop . hbase . client . Put ( org . apache . hadoop . hbase . util . Bytes . toBytes ( "row1" ) ) ; put . addColumn ( fam , qual1 , 125L , value ) ; put . setCellVisibility ( new org . apache . hadoop . hbase . security . visibility . CellVisibility ( CONFIDENTIAL ) ) ; table . put ( put ) ; put = new org . apache . hadoop . hbase . client . Put ( org . apache . hadoop . hbase . util . Bytes . toBytes ( "row1" ) ) ; put . addColumn ( fam , qual1 , 126L , value ) ; put . setCellVisibility ( new org . apache . hadoop . hbase . security . visibility . CellVisibility ( SECRET ) ) ; table . put ( put ) ; org . apache . hadoop . hbase . security . visibility . TEST_UTIL . getAdmin ( ) . flush ( tableName ) ; java . security . PrivilegedExceptionAction < java . lang . Void > actiona = new java . security . PrivilegedExceptionAction < java . lang . Void > ( ) { @ org . apache . hadoop . hbase . security . visibility . Override public org . apache . hadoop . hbase . security . visibility . Void run ( ) throws org . apache . hadoop . hbase . security . visibility . Exception { org . apache . hadoop . hbase . client . Delete d1 = new org . apache . hadoop . hbase . client . Delete ( row1 ) ; d1 . setCellVisibility ( new org . apache . hadoop . hbase . security . visibility . CellVisibility ( SECRET ) ) ; d1 . addColumns ( fam , qual , 126L ) ; org . apache . hadoop . hbase . client . Delete d2 = new org . apache . hadoop . hbase . client . Delete ( row1 ) ; d2 . setCellVisibility ( new org . apache . hadoop . hbase . security . visibility . CellVisibility ( CONFIDENTIAL ) ) ; d2 . addColumns ( fam , qual1 , 126L ) ; try ( org . apache . hadoop . hbase . client . Connection connection = org . apache . hadoop . hbase . client . ConnectionFactory . createConnection ( conf ) ; org . apache . hadoop . hbase . client . Table table = connection . getTable ( tableName ) ) { table . delete ( org . apache . hadoop . hbase . security . visibility . TestVisibilityLabelsWithDeletes . createList ( d1 , d2 ) ) ; } catch ( java . lang . Throwable t ) { throw new java . io . IOException ( t ) ; } return null ; } } ; org . apache . hadoop . hbase . security . visibility . SUPERUSER . runAs ( actiona ) ; org . apache . hadoop . hbase . client . Scan s = new org . apache . hadoop . hbase . client . Scan ( ) ; s . readVersions ( 5 ) ; s . setAuthorizations ( new org . apache . hadoop . hbase . security . visibility . Authorizations ( SECRET , CONFIDENTIAL ) ) ; org . apache . hadoop . hbase . client . ResultScanner scanner = table . getScanner ( s ) ; org . apache . hadoop . hbase . client . Result [ ] next = scanner . next ( 3 ) ; "<AssertPlaceHolder>" ; } } next ( int ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( uri ) ; sb . append ( "?n=" ) ; sb . append ( nbRows ) ; for ( int i = 0 ; i < ( maxRetries ) ; i ++ ) { org . apache . hadoop . hbase . rest . client . Response response = client . get ( sb . toString ( ) , Constants . MIMETYPE_PROTOBUF ) ; int code = response . getCode ( ) ; switch ( code ) { case 200 : org . apache . hadoop . hbase . rest . model . CellSetModel model = new org . apache . hadoop . hbase . rest . model . CellSetModel ( ) ; model . getObjectFromMessage ( response . getBody ( ) ) ; return buildResultFromModel ( model ) ; case 204 : case 206 : return null ; case 509 : try { java . lang . Thread . sleep ( sleepTime ) ; } catch ( java . lang . InterruptedException e ) { throw ( ( java . io . InterruptedIOException ) ( new java . io . InterruptedIOException ( ) . initCause ( e ) ) ) ; } break ; default : throw new java . io . IOException ( ( "scanner.next<sp>request<sp>failed<sp>with<sp>" + code ) ) ; } } throw new java . io . IOException ( "scanner.next<sp>request<sp>timed<sp>out" ) ; }
org . junit . Assert . assertEquals ( 1 , next . length )
lastReviewDateNullTest ( ) { org . marc . everest . rmim . uv . cdar2 . pocd_mt000040uv . EntryRelationship entryRelationship = org . oscarehr . e2e . model . export . body . ProblemsModelTest . nullProblemsModel . getDiagnosisDate ( ) ; "<AssertPlaceHolder>" ; } getDiagnosisDate ( ) { return diagnosisDate ; }
org . junit . Assert . assertNull ( entryRelationship )
testH02 ( ) { java . lang . String [ ] input = new java . lang . String [ ] { "1" , "a" , "A" } ; java . lang . String result = org . terasoluna . gfw . web . el . Functions . h ( input ) ; "<AssertPlaceHolder>" ; } h ( java . lang . Object ) { return org . terasoluna . gfw . web . util . HtmlEscapeUtils . htmlEscape ( input ) ; }
org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( java . util . Arrays . toString ( ( ( java . lang . String [ ] ) ( input ) ) ) ) )
simplePollTimeout ( ) { final org . nohope . concurrent . BlockingMap < java . lang . Integer , java . lang . Integer > m = new org . nohope . concurrent . BlockingMap ( ) ; "<AssertPlaceHolder>" ; } poll ( K , org . nohope . concurrent . Timeout ) { final V value = poll ( key , t . time ( ) , t . timeUnit ( ) ) ; if ( value == null ) { throw new java . util . concurrent . TimeoutException ( ( ( "Timeout<sp>getting<sp>'" + key ) + "'<sp>from<sp>queue" ) ) ; } return value ; }
org . junit . Assert . assertEquals ( ( ( java . lang . Object ) ( 2 ) ) , m . poll ( 1 , new org . nohope . concurrent . Timeout ( 1 ) ) )
testParsePath_entityProperty ( ) { for ( de . fraunhofer . iosb . ilt . frostserver . path . EntityType entityType : de . fraunhofer . iosb . ilt . frostserver . path . EntityType . values ( ) ) { for ( de . fraunhofer . iosb . ilt . frostserver . path . Property property : entityType . getPropertySet ( ) ) { if ( property instanceof de . fraunhofer . iosb . ilt . frostserver . path . EntityProperty ) { de . fraunhofer . iosb . ilt . frostserver . path . EntityProperty entityProperty = ( ( de . fraunhofer . iosb . ilt . frostserver . path . EntityProperty ) ( property ) ) ; java . lang . String path = ( ( "/" + ( entityType . plural ) ) + "(1)/" ) + ( property . getName ( ) ) ; de . fraunhofer . iosb . ilt . frostserver . path . ResourcePath result = de . fraunhofer . iosb . ilt . frostserver . parser . path . PathParser . parsePath ( "" , path ) ; de . fraunhofer . iosb . ilt . frostserver . path . ResourcePath expResult = new de . fraunhofer . iosb . ilt . frostserver . path . ResourcePath ( "" , path ) ; de . fraunhofer . iosb . ilt . frostserver . path . EntitySetPathElement espe = new de . fraunhofer . iosb . ilt . frostserver . path . EntitySetPathElement ( entityType , null ) ; expResult . addPathElement ( espe , false , false ) ; de . fraunhofer . iosb . ilt . frostserver . path . EntityPathElement epe = new de . fraunhofer . iosb . ilt . frostserver . path . EntityPathElement ( new de . fraunhofer . iosb . ilt . frostserver . model . core . IdLong ( 1 ) , entityType , espe ) ; expResult . addPathElement ( epe , true , true ) ; de . fraunhofer . iosb . ilt . frostserver . path . PropertyPathElement ppe = new de . fraunhofer . iosb . ilt . frostserver . path . PropertyPathElement ( entityProperty , epe ) ; expResult . addPathElement ( ppe , false , false ) ; "<AssertPlaceHolder>" ; } } } } addPathElement ( de . fraunhofer . iosb . ilt . frostserver . path . ResourcePathElement , boolean , boolean ) { pathElements . add ( pe ) ; if ( ( isMain && ( pe instanceof de . fraunhofer . iosb . ilt . frostserver . path . EntityPathElement ) ) || ( pe instanceof de . fraunhofer . iosb . ilt . frostserver . path . EntitySetPathElement ) ) { setMainElement ( pe ) ; } if ( isIdentifier && ( pe instanceof de . fraunhofer . iosb . ilt . frostserver . path . EntityPathElement ) ) { de . fraunhofer . iosb . ilt . frostserver . path . EntityPathElement epe = ( ( de . fraunhofer . iosb . ilt . frostserver . path . EntityPathElement ) ( pe ) ) ; setIdentifiedElement ( epe ) ; } this . entityProperty = pe instanceof de . fraunhofer . iosb . ilt . frostserver . path . PropertyPathElement ; }
org . junit . Assert . assertEquals ( expResult , result )
testBeanManagerResourceLookup ( ) { "<AssertPlaceHolder>" ; } getBeanManager ( ) { if ( ( beanManager ) == null ) { beanManager = org . jboss . weld . bean . builtin . BeanManagerProxy . unwrap ( ( ( javax . enterprise . inject . spi . BeanManager ) ( org . jboss . as . weld . ejb . EjbRequestScopeActivationInterceptor . currentServiceContainer ( ) . getRequiredService ( beanManagerServiceName ) . getValue ( ) ) ) ) ; } return beanManager ; }
org . junit . Assert . assertTrue ( ( ( ejb . getBeanManager ( ) ) instanceof javax . enterprise . inject . spi . BeanManager ) )