input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testCreateStream ( ) { final fr . univartois . sonargo . coverage . CoverageSensor sensor = new fr . univartois . sonargo . coverage . CoverageSensor ( ) ; try ( java . util . stream . Stream < java . nio . file . Path > paths = sensor . createStream ( testerContext ) ) { "<AssertPlaceHolder>" ; } catch ( final java . io . IOException e ) { e . printStackTrace ( ) ; } } createStream ( org . sonar . api . batch . sensor . SensorContext ) { final java . lang . String fullPath = context . fileSystem ( ) . baseDir ( ) . getPath ( ) ; fr . univartois . sonargo . coverage . CoverageSensor . LOGGER . info ( fullPath ) ; return java . nio . file . Files . walk ( java . nio . file . Paths . get ( fullPath ) ) . filter ( ( p ) -> ( ( ( ( ! ( p . getParent ( ) . toString ( ) . equals ( ".git" ) ) ) && ( ! ( p . getParent ( ) . toString ( ) . contains ( ".sonar" ) ) ) ) && ( ! ( p . getParent ( ) . toString ( ) . contains ( ".scannerwork" ) ) ) ) && ( ! ( p . getFileName ( ) . toString ( ) . startsWith ( "." ) ) ) ) && ( ! ( isAnExcludedPath ( p , context ) ) ) ) ; } | org . junit . Assert . assertNotNull ( paths ) |
testCheckMajorVersionChange ( ) { org . apache . hadoop . hdfs . HdfsConfiguration conf = new org . apache . hadoop . hdfs . HdfsConfiguration ( ) ; org . apache . hadoop . hdfs . MiniDFSCluster cluster = new org . apache . hadoop . hdfs . MiniDFSCluster . Builder ( conf ) . numDataNodes ( 1 ) . build ( ) ; try { fsTester = new org . apache . hadoop . yarn . server . resourcemanager . recovery . TestFSRMStateStore . TestFSRMStateStoreTester ( cluster , false ) { org . apache . hadoop . yarn . server . records . Version VERSION_INFO = org . apache . hadoop . yarn . server . records . Version . newInstance ( Integer . MAX_VALUE , 0 ) ; @ org . apache . hadoop . yarn . server . resourcemanager . recovery . Override public org . apache . hadoop . yarn . server . records . Version getCurrentVersion ( ) throws org . apache . hadoop . yarn . server . resourcemanager . recovery . Exception { return VERSION_INFO ; } @ org . apache . hadoop . yarn . server . resourcemanager . recovery . Override public org . apache . hadoop . yarn . server . resourcemanager . recovery . RMStateStore getRMStateStore ( ) throws org . apache . hadoop . yarn . server . resourcemanager . recovery . Exception { org . apache . hadoop . yarn . conf . YarnConfiguration conf = new org . apache . hadoop . yarn . conf . YarnConfiguration ( ) ; conf . set ( YarnConfiguration . FS_RM_STATE_STORE_URI , workingDirPathURI . toString ( ) ) ; conf . set ( YarnConfiguration . FS_RM_STATE_STORE_RETRY_POLICY_SPEC , "100,6000" ) ; this . store = new org . apache . hadoop . yarn . server . resourcemanager . recovery . TestFSRMStateStore . TestFSRMStateStoreTester . TestFileSystemRMStore ( conf ) { org . apache . hadoop . yarn . server . records . Version storedVersion = null ; @ org . apache . hadoop . yarn . server . resourcemanager . recovery . Override public org . apache . hadoop . yarn . server . records . Version getCurrentVersion ( ) { return VERSION_INFO ; } @ org . apache . hadoop . yarn . server . resourcemanager . recovery . Override protected synchronized org . apache . hadoop . yarn . server . records . Version loadVersion ( ) throws org . apache . hadoop . yarn . server . resourcemanager . recovery . Exception { return storedVersion ; } @ org . apache . hadoop . yarn . server . resourcemanager . recovery . Override protected synchronized void storeVersion ( ) throws org . apache . hadoop . yarn . server . resourcemanager . recovery . Exception { storedVersion = VERSION_INFO ; } } ; return store ; } } ; org . apache . hadoop . yarn . server . resourcemanager . recovery . RMStateStore store = fsTester . getRMStateStore ( ) ; org . apache . hadoop . yarn . server . records . Version defaultVersion = fsTester . getCurrentVersion ( ) ; store . checkVersion ( ) ; "<AssertPlaceHolder>" ; } finally { cluster . shutdown ( ) ; } } loadVersion ( ) { byte [ ] data = db . get ( bytes ( org . apache . hadoop . mapreduce . v2 . hs . HistoryServerLeveldbStateStoreService . DB_SCHEMA_VERSION_KEY ) ) ; if ( ( data == null ) || ( ( data . length ) == 0 ) ) { return org . apache . hadoop . yarn . server . records . Version . newInstance ( 1 , 0 ) ; } org . apache . hadoop . yarn . server . records . Version version = new org . apache . hadoop . yarn . server . records . impl . pb . VersionPBImpl ( org . apache . hadoop . yarn . proto . YarnServerCommonProtos . VersionProto . parseFrom ( data ) ) ; return version ; } | org . junit . Assert . assertEquals ( defaultVersion , store . loadVersion ( ) ) |
testPureSpeakeasyInvalidDescriptor ( ) { com . atlassian . plugin . ModuleDescriptor descriptor = mock ( com . atlassian . plugin . ModuleDescriptor . class ) ; when ( descriptor . getKey ( ) ) . thenReturn ( "bar" ) ; when ( plugin . getModuleDescriptors ( ) ) . thenReturn ( com . google . common . collect . Lists . < com . atlassian . plugin . ModuleDescriptor < ? > > newArrayList ( descriptor ) ) ; "<AssertPlaceHolder>" ; } tryKey ( java . lang . String ) { when ( pluginBundle . getHeaders ( ) ) . thenReturn ( new java . util . Hashtable ( ) { { put ( OsgiPlugin . ATLASSIAN_PLUGIN_KEY , pluginKey ) ; } } ) ; when ( bundleContext . getBundles ( ) ) . thenReturn ( new org . osgi . framework . Bundle [ ] { pluginBundle } ) ; when ( plugin . getKey ( ) ) . thenReturn ( pluginKey ) ; return com . atlassian . labs . speakeasy . util . ExtensionValidate . isPureSpeakeasyExtension ( bundleContext , plugin ) ; } | org . junit . Assert . assertFalse ( tryKey ( "foo" ) ) |
toUrlShouldEncodeWithoutOptionalInstance ( ) { java . lang . String port = "port" ; java . lang . String server = "server" ; java . lang . String database = "database" ; final java . lang . String expected = ( ( ( ( "jdbc:sqlserver://" + server ) + ":" ) + port ) + ";databaseName=" ) + database ; final java . util . Map < java . lang . String , java . lang . Object > settings = new java . util . LinkedHashMap ( ) ; settings . put ( AbstractHibernateCoreDatasource . HOST_KEY , server ) ; settings . put ( AbstractHibernateCoreDatasource . PORT_KEY , port ) ; settings . put ( AbstractHibernateCoreDatasource . DATABASE_KEY , database ) ; final java . lang . String created = new org . n52 . sos . ds . datasource . AbstractSqlServerDatasourceTest . AbstractSqlServerDatasourceSeam ( ) . toURL ( settings ) ; "<AssertPlaceHolder>" ; } toURL ( java . util . Map ) { return org . n52 . sos . ds . datasource . H2InMemoryDatasource . JDBC_URL ; } | org . junit . Assert . assertThat ( created , org . hamcrest . CoreMatchers . is ( expected ) ) |
testBuildWithParameters ( ) { java . lang . String abbrName = "AN" ; java . lang . String name = "fdsfds" ; org . lnu . is . domain . employee . type . EmployeeType context = new org . lnu . is . domain . employee . type . EmployeeType ( ) ; context . setAbbrName ( abbrName ) ; context . setName ( name ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>EmployeeType<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>AND<sp>e.abbrName<sp>LIKE<sp>CONCAT('%',:abbrName,'%')<sp>)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . employee . type . EmployeeType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
testRemove ( ) { com . liferay . knowledge . base . model . KBFolder newKBFolder = addKBFolder ( ) ; _persistence . remove ( newKBFolder ) ; com . liferay . knowledge . base . model . KBFolder existingKBFolder = _persistence . fetchByPrimaryKey ( newKBFolder . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertNull ( existingKBFolder ) |
testParse_GermanLocaleNegativeAllowed ( ) { org . oscm . converter . PriceConverter converter = new org . oscm . converter . PriceConverter ( java . util . Locale . GERMAN ) ; "<AssertPlaceHolder>" ; converter . parse ( "-50,00" , true ) ; } getActiveLocale ( ) { return activeLocale ; } | org . junit . Assert . assertEquals ( Locale . GERMAN , converter . getActiveLocale ( ) ) |
testName ( ) { org . apache . olingo . odata2 . ref . model . Team team1 = new org . apache . olingo . odata2 . ref . model . Team ( 1 , org . apache . olingo . odata2 . ref . model . TeamTest . VALUE_NAME ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( team1 . getName ( ) , org . apache . olingo . odata2 . ref . model . TeamTest . VALUE_NAME ) |
should_show_new_password_form_for_reseted_password_user ( ) { tryToSendResetPasswordEmail ( validEmail ) ; tryToSetNewPassword ( "newpass" ) ; home ( ) . logOut ( ) ; boolean isLoggedIn = home ( ) . toLoginPage ( ) . login ( validEmail , "newpass" ) . isLoggedIn ( ) ; "<AssertPlaceHolder>" ; home ( ) . logOut ( ) ; } isLoggedIn ( ) { org . openqa . selenium . WebElement profileLink = profileLink ( ) ; java . lang . String linkClass = profileLink . getAttribute ( "class" ) ; return ! ( linkClass . equals ( "login" ) ) ; } | org . junit . Assert . assertTrue ( isLoggedIn ) |
shouldMapNodeWithToken ( ) { stubNodeResultSet ( ) ; given ( resultSet . wasNull ( ) ) . willReturn ( true ) ; annis . model . AnnisNode node = generator . mapNode ( resultSet , tableAccessStrategy , null ) ; "<AssertPlaceHolder>" ; } isToken ( ) { return token ; } | org . junit . Assert . assertThat ( node . isToken ( ) , org . hamcrest . Matchers . is ( false ) ) |
testIsotope_IElement ( ) { org . openscience . cdk . interfaces . IElement element = newChemObject ( ) . getBuilder ( ) . newInstance ( org . openscience . cdk . interfaces . IElement . class , "C" ) ; org . openscience . cdk . interfaces . IIsotope i = new org . openscience . cdk . silent . Isotope ( element ) ; "<AssertPlaceHolder>" ; } getSymbol ( ) { return symbol ; } | org . junit . Assert . assertEquals ( "C" , i . getSymbol ( ) ) |
testSerialization2 ( ) { org . jfree . data . xy . IntervalXYDataset data1 = createDataset1 ( ) ; org . jfree . chart . renderer . xy . XYItemRenderer renderer1 = new org . jfree . chart . renderer . xy . XYBarRenderer ( 0.2 ) ; renderer1 . setDefaultToolTipGenerator ( org . jfree . chart . labels . StandardXYToolTipGenerator . getTimeSeriesInstance ( ) ) ; org . jfree . chart . plot . XYPlot p1 = new org . jfree . chart . plot . XYPlot ( data1 , new org . jfree . chart . axis . DateAxis ( "Date" ) , null , renderer1 ) ; org . jfree . chart . plot . XYPlot p2 = ( ( org . jfree . chart . plot . XYPlot ) ( org . jfree . chart . TestUtils . serialised ( p1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( T extends java . io . Serializable ) { T 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 = ( ( T ) ( 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 ( p1 , p2 ) |
testURLEncodedKey ( ) { java . lang . String urlKey = "http://example.com/foo" ; java . lang . StringBuilder path = new java . lang . StringBuilder ( ) ; path . append ( '/' ) ; path . append ( org . apache . hadoop . hbase . rest . TestRowResource . TABLE ) ; path . append ( '/' ) ; path . append ( java . net . URLEncoder . encode ( urlKey , HConstants . UTF8_ENCODING ) ) ; path . append ( '/' ) ; path . append ( org . apache . hadoop . hbase . rest . TestRowResource . COLUMN_1 ) ; org . apache . hadoop . hbase . rest . client . Response response ; response = org . apache . hadoop . hbase . rest . TestRowResource . putValueXML ( path . toString ( ) , org . apache . hadoop . hbase . rest . TestRowResource . TABLE , urlKey , org . apache . hadoop . hbase . rest . TestRowResource . COLUMN_1 , org . apache . hadoop . hbase . rest . TestRowResource . VALUE_1 ) ; "<AssertPlaceHolder>" ; org . apache . hadoop . hbase . rest . TestRowResource . checkValueXML ( path . toString ( ) , org . apache . hadoop . hbase . rest . TestRowResource . TABLE , urlKey , org . apache . hadoop . hbase . rest . TestRowResource . COLUMN_1 , org . apache . hadoop . hbase . rest . TestRowResource . VALUE_1 ) ; } getCode ( ) { return this . code ; } | org . junit . Assert . assertEquals ( response . getCode ( ) , 200 ) |
testStreamNameAsAppName ( ) { java . lang . String streamName = "bar" ; java . lang . String stream = "bar<sp>=<sp>foo<sp>|<sp>bar" ; sn = parse ( stream ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( streamName , sn . getName ( ) ) |
testGetRecords ( ) { record = software . amazon . awssdk . services . kinesis . model . Record . builder ( ) . data ( createByteBufferWithSize ( software . amazon . kinesis . retrieval . polling . PrefetchRecordsPublisherTest . SIZE_512_KB ) ) . build ( ) ; when ( records . size ( ) ) . thenReturn ( 1000 ) ; final java . util . List < software . amazon . kinesis . retrieval . KinesisClientRecord > expectedRecords = records . stream ( ) . map ( KinesisClientRecord :: fromRecord ) . collect ( java . util . stream . Collectors . toList ( ) ) ; getRecordsCache . start ( sequenceNumber , initialPosition ) ; software . amazon . kinesis . lifecycle . events . ProcessRecordsInput result = getRecordsCache . getNextResult ( ) . processRecordsInput ( ) ; "<AssertPlaceHolder>" ; verify ( executorService ) . execute ( any ( ) ) ; verify ( getRecordsRetrievalStrategy , atLeast ( 1 ) ) . getRecords ( eq ( software . amazon . kinesis . retrieval . polling . PrefetchRecordsPublisherTest . MAX_RECORDS_PER_CALL ) ) ; } processRecordsInput ( ) { return processRecordsInput ; } | org . junit . Assert . assertEquals ( expectedRecords , result . records ( ) ) |
testGetMaxResoStruc ( ) { org . openscience . cdk . charges . GasteigerPEPEPartialCharges peoe = new org . openscience . cdk . charges . GasteigerPEPEPartialCharges ( ) ; "<AssertPlaceHolder>" ; } getMaxResoStruc ( ) { return MX_RESON ; } | org . junit . Assert . assertEquals ( 50 , peoe . getMaxResoStruc ( ) ) |
testSemanticallyEquivalent ( ) { org . biopax . paxtools . model . Model m = BioPAXLevel . L3 . getDefaultFactory ( ) . createModel ( ) ; org . biopax . paxtools . model . level3 . UnificationXref x = m . addNew ( org . biopax . paxtools . model . level3 . UnificationXref . class , "ExpType_MI_0492" ) ; x . setDb ( "MI" ) ; x . setId ( "MI:0492" ) ; org . biopax . paxtools . model . level3 . EvidenceCodeVocabulary ecv = m . addNew ( org . biopax . paxtools . model . level3 . EvidenceCodeVocabulary . class , "EvidenceCodeVocab_1" ) ; ecv . addTerm ( "in<sp>vitro" ) ; ecv . addXref ( x ) ; org . biopax . paxtools . model . level3 . Evidence inVitro = m . addNew ( org . biopax . paxtools . model . level3 . Evidence . class , "Evidence_InVitro" ) ; inVitro . addEvidenceCode ( ecv ) ; x = m . addNew ( org . biopax . paxtools . model . level3 . UnificationXref . class , "Evidence_InVivo" 0 ) ; x . setDb ( "MI" ) ; x . setId ( "MI:0493" ) ; ecv = m . addNew ( org . biopax . paxtools . model . level3 . EvidenceCodeVocabulary . class , "EvidenceCodeVocab_2" ) ; ecv . addTerm ( "in<sp>vivo" ) ; ecv . addXref ( x ) ; org . biopax . paxtools . model . level3 . Evidence inVivo = m . addNew ( org . biopax . paxtools . model . level3 . Evidence . class , "Evidence_InVivo" ) ; "<AssertPlaceHolder>" ; } isEquivalent ( org . biopax . paxtools . model . BioPAXElement ) { return ( this . equals ( element ) ) || ( this . semanticallyEquivalent ( element ) ) ; } | org . junit . Assert . assertFalse ( inVitro . isEquivalent ( inVivo ) ) |
testSetField_static ( ) { org . evosuite . runtime . PrivateAccess . setVariable ( org . evosuite . runtime . FooFields . class , null , "n" , 42 ) ; "<AssertPlaceHolder>" ; } getN ( ) { return org . evosuite . runtime . FooFields . n ; } | org . junit . Assert . assertEquals ( 42 , org . evosuite . runtime . FooFields . getN ( ) ) |
testExceptionPropagation ( ) { org . apache . calcite . avatica . jdbc . JdbcMeta meta = new org . apache . calcite . avatica . jdbc . JdbcMeta ( "url" ) ; final java . lang . Throwable e = new java . lang . Exception ( ) ; try { meta . propagate ( e ) ; org . junit . Assert . fail ( "Expected<sp>an<sp>exception<sp>to<sp>be<sp>thrown" ) ; } catch ( java . lang . Throwable caughtException ) { "<AssertPlaceHolder>" ; } } propagate ( java . lang . Throwable ) { throw ( ( E ) ( e ) ) ; } | org . junit . Assert . assertThat ( caughtException , org . hamcrest . CoreMatchers . is ( e ) ) |
testGetServlets ( ) { java . util . Enumeration < javax . servlet . Servlet > is = createMock ( java . util . Enumeration . class ) ; expect ( servletContext . getServlets ( ) ) . andReturn ( is ) ; replay ( servletContext , config , is ) ; org . apache . tiles . web . util . ServletContextAdapter adapter = new org . apache . tiles . web . util . ServletContextAdapter ( config ) ; "<AssertPlaceHolder>" ; verify ( is ) ; } getServlets ( ) { return rootContext . getServlets ( ) ; } | org . junit . Assert . assertEquals ( is , adapter . getServlets ( ) ) |
length ( ) { final nl . bzk . migratiebrp . voisc . spd . GetMessageBody record = new nl . bzk . migratiebrp . voisc . spd . GetMessageBody ( ) ; "<AssertPlaceHolder>" ; } length ( ) { return length ; } | org . junit . Assert . assertEquals ( 3 , record . length ( ) ) |
testSendKeysKeepsCapitalization ( ) { org . openqa . selenium . qtwebkit . nativetests . WebElement textarea = driver . findElement ( org . openqa . selenium . qtwebkit . nativetests . By . id ( "workingArea" ) ) ; textarea . clear ( ) ; java . lang . String cheesey = "BrIe<sp>And<sp>CheDdar" ; textarea . sendKeys ( cheesey ) ; "<AssertPlaceHolder>" ; } getText ( ) { return stb . getText ( ) ; } | org . junit . Assert . assertThat ( textarea . getText ( ) , org . hamcrest . Matchers . equalTo ( cheesey ) ) |
checkTest2 ( ) { com . navercorp . pinpoint . web . vo . Application application = new com . navercorp . pinpoint . web . vo . Application ( com . navercorp . pinpoint . web . alarm . checker . ErrorCountCheckerTest . SERVICE_NAME , com . navercorp . pinpoint . common . trace . ServiceType . STAND_ALONE ) ; com . navercorp . pinpoint . web . alarm . collector . ResponseTimeDataCollector collector = new com . navercorp . pinpoint . web . alarm . collector . ResponseTimeDataCollector ( com . navercorp . pinpoint . web . alarm . DataCollectorFactory . DataCollectorCategory . RESPONSE_TIME , application , com . navercorp . pinpoint . web . alarm . checker . ErrorCountCheckerTest . mockMapResponseDAO , java . lang . System . currentTimeMillis ( ) , 300000 ) ; com . navercorp . pinpoint . web . alarm . vo . Rule rule = new com . navercorp . pinpoint . web . alarm . vo . Rule ( com . navercorp . pinpoint . web . alarm . checker . ErrorCountCheckerTest . SERVICE_NAME , com . navercorp . pinpoint . web . alarm . checker . ErrorCountCheckerTest . SERVICE_TYPE , CheckerCategory . ERROR_COUNT . getName ( ) , 76 , "testGroup" , false , false , "" ) ; com . navercorp . pinpoint . web . alarm . checker . ErrorCountChecker filter = new com . navercorp . pinpoint . web . alarm . checker . ErrorCountChecker ( collector , rule ) ; filter . check ( ) ; "<AssertPlaceHolder>" ; } isDetected ( ) { return detected ; } | org . junit . Assert . assertFalse ( filter . isDetected ( ) ) |
cancel ( ) { popup ( "repairExample" ) ; driver . findElement ( org . apromore . portal . uitest . By . xpath ( ( ( SETUP_DIALOG_XPATH ) + "//button[text()='Cancel']" ) ) ) . click ( ) ; delay ( ) ; "<AssertPlaceHolder>" ; } isElementPresent ( org . apromore . portal . uitest . By ) { try { driver . findElement ( by ) ; return true ; } catch ( org . apromore . portal . uitest . NoSuchElementException e ) { return false ; } } | org . junit . Assert . assertFalse ( isElementPresent ( org . apromore . portal . uitest . By . xpath ( SETUP_DIALOG_XPATH ) ) ) |
axesAxesIsTrue ( ) { "<AssertPlaceHolder>" ; } axes ( ) { return ( ( this ) == ( org . jenkinsci . plugins . postbuildscript . model . ExecuteOn . AXES ) ) || ( ( this ) == ( org . jenkinsci . plugins . postbuildscript . model . ExecuteOn . BOTH ) ) ; } | org . junit . Assert . assertThat ( ExecuteOn . AXES . axes ( ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testRead ( ) { java . io . PipedReader in = new java . io . PipedReader ( ) ; java . io . PipedWriter pout = new java . io . PipedWriter ( in ) ; java . io . PrintWriter out = new java . io . PrintWriter ( pout , true ) ; out . println ( "a<sp>b<sp>c<sp>d<sp>e" ) ; out . println ( "f<sp>g<sp>h<sp>i<sp>j" ) ; out . close ( ) ; pout . close ( ) ; "<AssertPlaceHolder>" ; } read ( java . io . Reader ) { java . lang . StringBuilder retcode = new java . lang . StringBuilder ( ) ; java . io . BufferedReader din = new java . io . BufferedReader ( in , 8192 ) ; while ( true ) { java . lang . String line = din . readLine ( ) ; if ( line == null ) { break ; } retcode . append ( line ) ; retcode . append ( org . crosswire . common . util . StringUtil . NEWLINE ) ; } return retcode . toString ( ) ; } | org . junit . Assert . assertEquals ( ( ( ( "a<sp>b<sp>c<sp>d<sp>e" + ( StringUtil . NEWLINE ) ) + "f<sp>g<sp>h<sp>i<sp>j" ) + ( StringUtil . NEWLINE ) ) , org . crosswire . common . util . StringUtil . read ( in ) ) |
stringToKey ( ) { com . google . appengine . api . datastore . Key key = org . slim3 . datastore . Datastore . createKey ( "Hoge" , 1 ) ; java . lang . String encodedKey = com . google . appengine . api . datastore . KeyFactory . keyToString ( key ) ; "<AssertPlaceHolder>" ; } stringToKey ( java . lang . String ) { return org . slim3 . datastore . Datastore . delegate ( ) . stringToKey ( encodedKey ) ; } | org . junit . Assert . assertThat ( org . slim3 . datastore . Datastore . stringToKey ( encodedKey ) , org . hamcrest . CoreMatchers . is ( key ) ) |
testReadRestrictions ( ) { org . apache . jackrabbit . oak . util . NodeUtil aceNode = new org . apache . jackrabbit . oak . util . NodeUtil ( root . getTree ( "val1" 1 ) ) . addChild ( "test" , org . apache . jackrabbit . oak . security . authorization . restriction . NT_REP_GRANT_ACE ) ; aceNode . setBoolean ( "val1" 2 , true ) ; aceNode . setValues ( "longs" , new javax . jcr . Value [ ] { vf . createValue ( 10 ) , vf . createValue ( 290 ) } ) ; aceNode . setString ( org . apache . jackrabbit . oak . security . authorization . restriction . REP_GLOB , "*" ) ; aceNode . setNames ( org . apache . jackrabbit . oak . security . authorization . restriction . REP_NT_NAMES ) ; aceNode . setString ( "invalid" , "val" ) ; aceNode . setStrings ( "invalid2" , "val1" , "val2" , "val1" 0 ) ; java . util . Set < org . apache . jackrabbit . oak . spi . security . authorization . restriction . Restriction > restrictions = provider . readRestrictions ( "/test" , aceNode . getTree ( ) ) ; "<AssertPlaceHolder>" ; for ( org . apache . jackrabbit . oak . spi . security . authorization . restriction . Restriction r : restrictions ) { java . lang . String name = r . getDefinition ( ) . getName ( ) ; if ( ! ( supported . contains ( name ) ) ) { org . junit . Assert . fail ( "read<sp>unsupported<sp>restriction" ) ; } } } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 4 , restrictions . size ( ) ) |
testObjIncompleteNestedBraces ( ) { java . lang . String nestedBracesMsg = "\"request\":<sp>\"/Foo(${bar)\"" ; java . lang . String logMsg = ( "<sp>{" + nestedBracesMsg ) + "}<sp>" ; com . sap . hcp . cf . logging . common . converter . DefaultMessageConverter jmc = new com . sap . hcp . cf . logging . common . converter . DefaultMessageConverter ( ) ; jmc . setFlatten ( true ) ; "<AssertPlaceHolder>" ; } formatMsg ( com . sap . hcp . cf . logging . common . converter . DefaultMessageConverter , java . lang . String ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; mc . convert ( msg , sb ) ; return sb . toString ( ) ; } | org . junit . Assert . assertThat ( formatMsg ( jmc , logMsg ) , org . hamcrest . core . Is . is ( nestedBracesMsg ) ) |
test12 ( ) { java . lang . String [ ] vars = new java . lang . String [ ] { "t" , "x" , "y" , "z" } ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > f1 = cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "x^2*y^2*t<sp>+<sp>x*y*z<sp>-<sp>y*z^4<sp>+<sp>x" , cc . redberry . rings . Rings . Zp ( 17 ) , cc . redberry . rings . poly . multivar . MonomialOrder . GREVLEX , vars ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > f2 = cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "x^17*y^4<sp>-<sp>z^4*y^2<sp>+<sp>x*z*y^4<sp>-<sp>1" , cc . redberry . rings . Rings . Zp ( 17 ) , cc . redberry . rings . poly . multivar . MonomialOrder . GREVLEX , vars ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > f3 = cc . redberry . rings . poly . multivar . MultivariatePolynomial . parse ( "x^15*y^4*z<sp>-<sp>x*y^2<sp>+<sp>x*z<sp>+<sp>t^3" , cc . redberry . rings . Rings . Zp ( 17 ) , cc . redberry . rings . poly . multivar . MonomialOrder . GREVLEX , vars ) ; cc . redberry . rings . poly . multivar . List < cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 > ideal = cc . redberry . rings . poly . multivar . Arrays . asList ( cc . redberry . rings . poly . multivar . MultivariatePolynomial . asOverZp64 ( f1 ) , cc . redberry . rings . poly . multivar . MultivariatePolynomial . asOverZp64 ( f2 ) , cc . redberry . rings . poly . multivar . MultivariatePolynomial . asOverZp64 ( f3 ) ) ; for ( int i = 0 ; i < ( its ( 1 , 1 ) ) ; i ++ ) { long start ; cc . redberry . rings . poly . multivar . Comparator < cc . redberry . rings . poly . multivar . SyzygyPair > strategy = cc . redberry . rings . poly . multivar . GroebnerBases . normalSelectionStrategy ( cc . redberry . rings . poly . multivar . MonomialOrder . GREVLEX ) ; start = java . lang . System . nanoTime ( ) ; cc . redberry . rings . poly . multivar . List < cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 > norm = BuchbergerGB ( ideal , cc . redberry . rings . poly . multivar . MonomialOrder . GREVLEX , strategy ) ; System . out . println ( ( "Normal<sp>strategy:<sp>" + ( nanosecondsToString ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ) ) ) ; strategy = cc . redberry . rings . poly . multivar . GroebnerBases . withSugar ( strategy ) ; start = java . lang . System . nanoTime ( ) ; cc . redberry . rings . poly . multivar . List < cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 > sugar = BuchbergerGB ( ideal , cc . redberry . rings . poly . multivar . MonomialOrder . GREVLEX , strategy ) ; System . out . println ( ( "Sugar<sp>strategy:<sp>" + ( nanosecondsToString ( ( ( java . lang . System . nanoTime ( ) ) - start ) ) ) ) ) ; "<AssertPlaceHolder>" ; } } nanosecondsToString ( long ) { java . lang . String pf = "ns" ; if ( ( nano / 1000 ) > 1 ) { pf = "us" ; nano /= 1000 ; } if ( ( nano / 1000 ) > 1 ) { pf = "ms" ; nano /= 1000 ; } if ( ( nano / 1000 ) > 1 ) { pf = "s" ; nano /= 1000 ; } return nano + pf ; } | org . junit . Assert . assertEquals ( norm , sugar ) |
toFile_File_AllowOverwrite ( ) { java . io . File sourceFile = new java . io . File ( "test-resources/Thumbnailator/grid.png" ) ; java . io . File f = net . coobird . thumbnailator . TestUtils . createTempFile ( net . coobird . thumbnailator . ThumbnailsBuilderInputOutputTest . TMPDIR , "png" ) ; net . coobird . thumbnailator . TestUtils . copyFile ( sourceFile , f ) ; long fileSizeBefore = f . length ( ) ; net . coobird . thumbnailator . Thumbnails . of ( f ) . size ( 100 , 100 ) . allowOverwrite ( true ) . toFile ( f ) ; long fileSizeAfter = f . length ( ) ; f . delete ( ) ; "<AssertPlaceHolder>" ; } size ( int , int ) { if ( width < 0 ) { throw new java . lang . IllegalArgumentException ( "Width<sp>must<sp>be<sp>greater<sp>than<sp>0." ) ; } if ( height < 0 ) { throw new java . lang . IllegalArgumentException ( "Height<sp>must<sp>be<sp>greater<sp>than<sp>0." ) ; } this . width = width ; this . height = height ; return this ; } | org . junit . Assert . assertTrue ( ( fileSizeAfter < fileSizeBefore ) ) |
getSplatParameterElements_NoneOccurring ( ) { org . bigtesting . routd . Route route = new org . bigtesting . routd . Route ( "/" ) ; java . util . List < org . bigtesting . routd . SplatParameterElement > params = route . getSplatParameterElements ( ) ; "<AssertPlaceHolder>" ; } getSplatParameterElements ( ) { return new java . util . ArrayList < org . bigtesting . routd . SplatParameterElement > ( splatParamElements ) ; } | org . junit . Assert . assertEquals ( 0 , params . size ( ) ) |
testGetMTU ( ) { for ( org . dcache . util . NetworkInterfaceViewTests . InterfaceAndViewPair pair : _interfaces ) { java . net . NetworkInterface ni = pair . getNetworkInterface ( ) ; org . dcache . util . NetworkInterfaceView niv = pair . getNetworkInterfaceView ( ) ; "<AssertPlaceHolder>" ; } } getMTU ( ) { return _mtu ; } | org . junit . Assert . assertEquals ( ni . getMTU ( ) , niv . getMTU ( ) ) |
givenSystem_whenCalledGetPropertyDefaultValue_thenReturnPropertyinResult ( ) { java . lang . System . clearProperty ( "dbHost" ) ; java . lang . String myKey = java . lang . System . getProperty ( "dbHost" , "db.host.com" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( "db.host.com" , myKey ) |
testFindOne01 ( ) { org . terasoluna . tourreservation . domain . model . TourInfo info = new org . terasoluna . tourreservation . domain . model . TourInfo ( ) ; when ( tourInfoRepository . findById ( "foo" ) ) . thenReturn ( java . util . Optional . of ( info ) ) ; org . terasoluna . tourreservation . domain . model . TourInfo result = tourInfoSharedService . findOne ( "foo" ) ; "<AssertPlaceHolder>" ; } findOne ( java . lang . String ) { return customerRepository . findById ( customerCode ) . orElse ( null ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( info ) ) |
testQuerySingleSubColumn ( ) { me . prettyprint . cassandra . service . template . SuperCfTemplate < java . lang . String , java . lang . String , java . lang . String > sTemplate = new me . prettyprint . cassandra . service . template . ThriftSuperCfTemplate < java . lang . String , java . lang . String , java . lang . String > ( keyspace , "Super1" , se , se , se ) ; me . prettyprint . cassandra . service . template . SuperCfUpdater < java . lang . String , java . lang . String , java . lang . String > sUpdater = sTemplate . createUpdater ( "skey3" , "super1" ) ; sUpdater . setString ( "sub1_col_1" , "sub1_val_1" ) ; sTemplate . update ( sUpdater ) ; me . prettyprint . hector . api . beans . HColumn < java . lang . String , java . lang . String > myCol = sTemplate . querySingleSubColumn ( "skey3" , "super1" , "sub1_col_1" , se ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return counterColumn . value ; } | org . junit . Assert . assertEquals ( "sub1_val_1" , myCol . getValue ( ) ) |
overlaps12 ( ) { net . time4j . PlainDate startA = net . time4j . PlainDate . of ( 2014 , 5 , 13 ) ; net . time4j . PlainDate endA = net . time4j . PlainDate . of ( 2014 , 6 , 15 ) ; net . time4j . PlainDate startB = net . time4j . PlainDate . of ( 2014 , 5 , 10 ) ; net . time4j . PlainDate endB = net . time4j . PlainDate . of ( 2014 , 5 , 13 ) ; net . time4j . range . DateInterval a = net . time4j . range . DateInterval . between ( startA , endA ) ; net . time4j . range . DateInterval b = net . time4j . range . DateInterval . between ( startB , endB ) ; "<AssertPlaceHolder>" ; } overlaps ( I extends net . time4j . range . IsoInterval ) { if ( ( other . getStart ( ) . isInfinite ( ) ) || ( this . end . isInfinite ( ) ) ) { return false ; } T startA = this . getClosedFiniteStart ( ) ; T startB = other . getClosedFiniteStart ( ) ; if ( ( startA != null ) && ( ! ( startA . isBefore ( startB ) ) ) ) { return false ; } T endA = this . end . getTemporal ( ) ; T endB = other . getEnd ( ) . getTemporal ( ) ; if ( this . getFactory ( ) . isCalendrical ( ) ) { if ( this . end . isOpen ( ) ) { endA = this . getTimeLine ( ) . stepBackwards ( endA ) ; } if ( ( endA == null ) || ( endA . isBefore ( startB ) ) ) { return false ; } else if ( endB == null ) { return true ; } if ( other . getEnd ( ) . isOpen ( ) ) { endB = this . getTimeLine ( ) . stepBackwards ( endB ) ; } } else { if ( this . end . isClosed ( ) ) { endA = this . getTimeLine ( ) . stepForward ( endA ) ; if ( endA == null ) { return endB == null ; } } if ( ! ( endA . isAfter ( startB ) ) ) { return false ; } if ( other . getEnd ( ) . isClosed ( ) ) { endB = this . getTimeLine ( ) . stepForward ( endB ) ; } } return ( endB == null ) || ( endA . isBefore ( endB ) ) ; } | org . junit . Assert . assertThat ( a . overlaps ( b ) , org . hamcrest . CoreMatchers . is ( false ) ) |
shouldIndicateSourceOfEvent ( ) { "<AssertPlaceHolder>" ; } getSource ( ) { return source ; } | org . junit . Assert . assertEquals ( source , event . getSource ( ) ) |
shouldAcceptName ( ) { lb = new org . openstack . atlas . api . validation . validators . LoadBalancer ( ) ; lb . setName ( "Biased<sp>load<sp>BALANCER.<sp>Ha!" ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( lb , org . openstack . atlas . api . validation . validators . PUT ) ; "<AssertPlaceHolder>" ; } passedValidation ( ) { return expectationResultList . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( result . passedValidation ( ) ) |
testDroppingDefaultGraph ( ) { java . lang . String queryStr = "DROP<sp>SILENT<sp>DEFAULT" ; org . apache . clerezza . rdf . core . sparql . SparqlPreParser parser ; parser = new org . apache . clerezza . rdf . core . sparql . SparqlPreParser ( org . apache . clerezza . rdf . core . access . TcManager . getInstance ( ) ) ; java . util . Set < org . apache . clerezza . commons . rdf . IRI > referredGraphs = parser . getReferredGraphs ( queryStr , org . apache . clerezza . rdf . core . sparql . SparqlPreParserTest . DEFAULT_GRAPH ) ; "<AssertPlaceHolder>" ; } toArray ( ) { java . lang . Object [ ] result = base . toArray ( ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { org . apache . clerezza . commons . rdf . Triple triple = ( ( org . apache . clerezza . commons . rdf . Triple ) ( result [ i ] ) ) ; result [ i ] = toTargetTriple ( triple ) ; } return result ; } | org . junit . Assert . assertTrue ( referredGraphs . toArray ( ) [ 0 ] . equals ( org . apache . clerezza . rdf . core . sparql . SparqlPreParserTest . DEFAULT_GRAPH ) ) |
sizeOfBadJobsShouldBeCorrect_2 ( ) { com . graphhopper . jsprit . core . problem . job . Job badJob = mock ( com . graphhopper . jsprit . core . problem . job . Job . class ) ; java . util . List < com . graphhopper . jsprit . core . problem . job . Job > badJobs = new java . util . ArrayList < com . graphhopper . jsprit . core . problem . job . Job > ( ) ; badJobs . add ( badJob ) ; com . graphhopper . jsprit . core . problem . solution . VehicleRoutingProblemSolution sol = new com . graphhopper . jsprit . core . problem . solution . VehicleRoutingProblemSolution ( java . util . Collections . < com . graphhopper . jsprit . core . problem . solution . route . VehicleRoute > emptyList ( ) , 10.0 ) ; sol . getUnassignedJobs ( ) . addAll ( badJobs ) ; "<AssertPlaceHolder>" ; } getUnassignedJobs ( ) { return unassignedJobs ; } | org . junit . Assert . assertEquals ( 1 , sol . getUnassignedJobs ( ) . size ( ) ) |
testBadConnectFn ( ) { org . apache . edgent . topology . Topology t = newTopology ( "testBadConnectFn" ) ; populatePersonsTable ( getPersonList ( ) ) ; java . util . List < java . lang . String > expected = expectedPersons ( ( p ) -> true , getPersonList ( ) . subList ( 1 , getPersonList ( ) . size ( ) ) ) ; int expectedExcCnt = ( getPersonList ( ) . size ( ) ) - ( expected . size ( ) ) ; java . util . concurrent . atomic . AtomicInteger connFnCnt = new java . util . concurrent . atomic . AtomicInteger ( ) ; 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 ) -> { if ( ( connFnCnt . incrementAndGet ( ) ) == 1 ) throw new java . sql . SQLException ( "FAKE-CONNECT-FN-FAILURE" ) ; else return connect ( dataSource ) ; } ) ; java . util . concurrent . atomic . AtomicInteger executionExcCnt = new java . util . concurrent . atomic . AtomicInteger ( ) ; org . apache . edgent . topology . TStream < org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . PersonId > personIds = t . collection ( getPersonIdList ( ) ) ; org . apache . edgent . topology . TStream < org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . Person > rcvdPerson = db . executeStatement ( personIds , ( ) -> "SELECT<sp>id,<sp>firstname,<sp>lastname,<sp>gender,<sp>age" + "<sp>FROM<sp>persons<sp>WHERE<sp>id<sp>=<sp>?" , ( tuple , stmt ) -> stmt . setInt ( 1 , tuple . id ) , ( tuple , resultSet , exc , stream ) -> { System . out . println ( ( ( ( ( ( t . getName ( ) ) + "executionExcCnt" 2 ) + tuple ) + "<sp>exc=" ) + exc ) ) ; if ( exc != null ) { executionExcCnt . incrementAndGet ( ) ; return ; } resultSet . next ( ) ; int id = resultSet . getInt ( "executionExcCnt" 0 ) ; java . lang . String firstName = resultSet . getString ( "firstname" ) ; java . lang . String lastName = resultSet . getString ( "lastname" ) ; java . lang . String gender = resultSet . getString ( "executionExcCnt" 3 ) ; int age = resultSet . getInt ( "age" ) ; stream . accept ( new org . apache . edgent . test . connectors . jdbc . Person ( id , firstName , lastName , gender , age ) ) ; } ) ; 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 ( "executionExcCnt" 1 , t , rcvd , org . apache . edgent . test . connectors . jdbc . JdbcStreamsTest . SEC_TIMEOUT , expected . toArray ( new java . lang . String [ 0 ] ) ) ; "<AssertPlaceHolder>" ; } get ( ) { return new org . apache . edgent . analytics . math3 . stat . JsonOLS ( this ) ; } | org . junit . Assert . assertEquals ( "executionExcCnt" , expectedExcCnt , executionExcCnt . get ( ) ) |
testGetByClusterAndSinglePath ( ) { int status = Status . AGREE . getValue ( ) ; java . lang . String cluster = "local_test" ; java . lang . String path = "/test/sub1" ; int expectedSize = 1 ; java . util . List < com . xiaomi . shepher . model . PermissionTeam > permissionTeams = permissionTeamMapper . listByPath ( cluster , path , status ) ; "<AssertPlaceHolder>" ; } listByPath ( java . lang . String , java . lang . String , com . xiaomi . shepher . common . Status ) { if ( ( ( org . apache . commons . lang3 . StringUtils . isBlank ( cluster ) ) || ( path == null ) ) || ( status == null ) ) { throw com . xiaomi . shepher . exception . ShepherException . createIllegalParameterException ( ) ; } java . util . List < java . lang . String > parentPaths = com . xiaomi . shepher . util . ParentPathParser . parse ( path ) ; return this . listByPaths ( cluster , parentPaths , status ) ; } | org . junit . Assert . assertEquals ( expectedSize , permissionTeams . size ( ) ) |
testWithExclusiveStartShardId ( ) { java . lang . Object actual = adapter . withExclusiveStartShardId ( TEST_STRING ) ; "<AssertPlaceHolder>" ; } withExclusiveStartShardId ( java . lang . String ) { internalRequest . setExclusiveStartShardId ( exclusiveStartShardId ) ; return this ; } | org . junit . Assert . assertEquals ( adapter , actual ) |
testEqualsTwoTablesSameValuesDifferentOrder ( ) { java . util . List < java . lang . String > tableHeaders = java . util . Arrays . asList ( new java . lang . String [ ] { "col1" , "col2" } ) ; java . util . List < java . lang . String > otherTableHeaders = java . util . Arrays . asList ( new java . lang . String [ ] { "col1" , "col2" } ) ; com . thoughtworks . gauge . Table table = new com . thoughtworks . gauge . Table ( tableHeaders ) ; table . addRow ( java . util . Arrays . asList ( new java . lang . String [ ] { "A" , "B" } ) ) ; table . addRow ( java . util . Arrays . asList ( new java . lang . String [ ] { "C" , "D" } ) ) ; com . thoughtworks . gauge . Table otherTable = new com . thoughtworks . gauge . Table ( otherTableHeaders ) ; otherTable . addRow ( java . util . Arrays . asList ( new java . lang . String [ ] { "C" , "D" } ) ) ; otherTable . addRow ( java . util . Arrays . asList ( new java . lang . String [ ] { "A" , "B" } ) ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } com . thoughtworks . gauge . TableRow other = ( ( com . thoughtworks . gauge . TableRow ) ( obj ) ) ; return ( cells ) == null ? ( other . cells ) == null : cells . equals ( other . cells ) ; } | org . junit . Assert . assertFalse ( table . equals ( otherTable ) ) |
getArtistReturnsV1TagsArtistIfV2TagsArtistIsEmpty ( ) { com . mpatric . mp3agic . ID3v1 id3v1Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v1TagForTesting ( ) ; id3v1Tag . setArtist ( "V1<sp>Artist" ) ; com . mpatric . mp3agic . ID3v2 id3v2Tag = new com . mpatric . mp3agic . ID3WrapperTest . ID3v2TagForTesting ( ) ; id3v2Tag . setArtist ( "" ) ; com . mpatric . mp3agic . ID3Wrapper wrapper = new com . mpatric . mp3agic . ID3Wrapper ( id3v1Tag , id3v2Tag ) ; "<AssertPlaceHolder>" ; } getArtist ( ) { if ( ( ( ( id3v2Tag ) != null ) && ( ( id3v2Tag . getArtist ( ) ) != null ) ) && ( ( id3v2Tag . getArtist ( ) . length ( ) ) > 0 ) ) { return id3v2Tag . getArtist ( ) ; } else if ( ( id3v1Tag ) != null ) { return id3v1Tag . getArtist ( ) ; } else { return null ; } } | org . junit . Assert . assertEquals ( "V1<sp>Artist" , wrapper . getArtist ( ) ) |
testMalformed11 ( ) { java . util . List < org . apache . tomcat . util . http . parser . AcceptLanguage > actual = org . apache . tomcat . util . http . parser . AcceptLanguage . parse ( new java . io . StringReader ( "en-gb;q=1a0" ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return items . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , actual . size ( ) ) |
testExtractSearchParams ( ) { org . hl7 . fhir . dstu3 . model . Patient p = new org . hl7 . fhir . dstu3 . model . Patient ( ) ; p . addName ( ) . setFamily ( "FOO" ) . addGiven ( "BAR" ) . addGiven ( "BAR" ) ; p . getMaritalStatus ( ) . setText ( "DDDDD" ) ; p . addAddress ( ) . addLine ( "A" ) . addLine ( "B" ) . addLine ( "C" ) ; ca . uhn . fhir . context . FhirContext ctx = ca . uhn . fhir . context . FhirContext . forDstu3 ( ) ; org . hl7 . fhir . dstu3 . hapi . ctx . IValidationSupport mockValidationSupport = mock ( org . hl7 . fhir . dstu3 . hapi . ctx . IValidationSupport . class ) ; org . hl7 . fhir . dstu3 . hapi . ctx . IValidationSupport validationSupport = new org . hl7 . fhir . dstu3 . hapi . validation . CachingValidationSupport ( new org . hl7 . fhir . dstu3 . hapi . validation . ValidationSupportChain ( new org . hl7 . fhir . dstu3 . hapi . ctx . DefaultProfileValidationSupport ( ) , mockValidationSupport ) ) ; ca . uhn . fhir . jpa . searchparam . registry . ISearchParamRegistry searchParamRegistry = mock ( ca . uhn . fhir . jpa . searchparam . registry . ISearchParamRegistry . class ) ; ca . uhn . fhir . jpa . searchparam . extractor . SearchParamExtractorDstu3 extractor = new ca . uhn . fhir . jpa . searchparam . extractor . SearchParamExtractorDstu3 ( new ca . uhn . fhir . jpa . model . entity . ModelConfig ( ) , ctx , validationSupport , searchParamRegistry ) ; extractor . start ( ) ; java . util . Map < java . lang . String , ca . uhn . fhir . context . RuntimeSearchParam > spMap = ctx . getResourceDefinition ( "Patient" ) . getSearchParams ( ) . stream ( ) . collect ( java . util . stream . Collectors . toMap ( RuntimeSearchParam :: getName , ( t ) -> t ) ) ; when ( searchParamRegistry . getActiveSearchParams ( eq ( "Patient" ) ) ) . thenReturn ( spMap ) ; ca . uhn . fhir . jpa . model . entity . ResourceTable entity = new ca . uhn . fhir . jpa . model . entity . ResourceTable ( ) ; java . util . Set < ca . uhn . fhir . jpa . model . entity . ResourceIndexedSearchParamString > params = extractor . extractSearchParamStrings ( entity , p ) ; ca . uhn . fhir . util . StopWatch sw = new ca . uhn . fhir . util . StopWatch ( ) ; int loops = 100 ; for ( int i = 0 ; i < loops ; i ++ ) { entity = new ca . uhn . fhir . jpa . model . entity . ResourceTable ( ) ; params = extractor . extractSearchParamStrings ( entity , p ) ; } ca . uhn . fhir . jpa . searchparam . IndexStressTest . ourLog . info ( "Indexed<sp>{}<sp>times<sp>in<sp>{}ms/time" , loops , sw . getMillisPerOperation ( loops ) ) ; "<AssertPlaceHolder>" ; verify ( mockValidationSupport , times ( 1 ) ) . fetchAllStructureDefinitions ( any ( ca . uhn . fhir . context . FhirContext . class ) ) ; } size ( ) { return myTagSet . size ( ) ; } | org . junit . Assert . assertEquals ( 9 , params . size ( ) ) |
changeQuestionAnswer_shouldChangeTheSecretQuestionAndAnswerForGivenUser ( ) { org . openmrs . User u = userService . getUser ( 501 ) ; userService . changeQuestionAnswer ( u , "the<sp>question" , "the<sp>answer" ) ; org . openmrs . User o = userService . getUser ( 501 ) ; "<AssertPlaceHolder>" ; } isSecretAnswer ( org . openmrs . User , java . lang . String ) { if ( org . apache . commons . lang3 . StringUtils . isEmpty ( answer ) ) { return false ; } org . openmrs . api . db . LoginCredential credentials = getLoginCredential ( u ) ; java . lang . String answerOnRecord = credentials . getSecretAnswer ( ) ; java . lang . String hashedAnswer = org . openmrs . util . Security . encodeString ( ( ( answer . toLowerCase ( ) ) + ( credentials . getSalt ( ) ) ) ) ; return hashedAnswer . equals ( answerOnRecord ) ; } | org . junit . Assert . assertTrue ( userService . isSecretAnswer ( o , "the<sp>answer" ) ) |
testDropOnMap ( ) { map . getEditManagerInternal ( ) . setSelectedLayer ( map . getLayersInternal ( ) . get ( 3 ) ) ; action . init ( null , null , ViewerDropLocation . ON , map , sldURL ) ; action . perform ( new org . eclipse . core . runtime . NullProgressMonitor ( ) ) ; final java . lang . String expectedName = "Test<sp>Style" ; org . locationtech . udig . ui . tests . support . UDIGTestUtil . inDisplayThreadWait ( 3000 , new org . locationtech . udig . ui . WaitCondition ( ) { public boolean isTrue ( ) { return isTestStyle ( map . getEditManager ( ) . getSelectedLayer ( ) , expectedName ) ; } } , false ) ; "<AssertPlaceHolder>" ; } isTestStyle ( org . locationtech . udig . project . ILayer , java . lang . String ) { org . geotools . styling . Style style = ( ( org . geotools . styling . Style ) ( destination . getStyleBlackboard ( ) . get ( "org.locationtech.udig.style.sld" ) ) ) ; java . lang . String name = style . getName ( ) ; return name . equals ( expectedName ) ; } | org . junit . Assert . assertTrue ( isTestStyle ( map . getEditManager ( ) . getSelectedLayer ( ) , expectedName ) ) |
testTooLateUsage ( ) { final java . util . List < com . github . rinde . rinsim . core . model . rand . RandomProvider > rp = new java . util . ArrayList ( ) ; model . register ( new com . github . rinde . rinsim . core . model . rand . RandomUser ( ) { @ com . github . rinde . rinsim . core . model . rand . Override public void setRandomGenerator ( com . github . rinde . rinsim . core . model . rand . RandomProvider provider ) { rp . add ( provider ) ; } } ) ; boolean fail = false ; try { rp . get ( 0 ) . masterInstance ( ) ; } catch ( final java . lang . IllegalStateException e ) { fail = true ; } "<AssertPlaceHolder>" ; } get ( long ) { return com . github . rinde . rinsim . central . SolverValidator . wrap ( supplier . get ( seed ) ) ; } | org . junit . Assert . assertTrue ( fail ) |
isHomingEnabledShouldBeTrue ( ) { target . rawResponseListener ( "$22=1" ) ; "<AssertPlaceHolder>" ; } isHomingEnabled ( ) { boolean isHomingEnabled = false ; try { isHomingEnabled = backend . getController ( ) . getFirmwareSettings ( ) . isHomingEnabled ( ) ; } catch ( com . willwinder . universalgcodesender . firmware . FirmwareSettingsException ignored ) { } return isHomingEnabled ; } | org . junit . Assert . assertTrue ( target . isHomingEnabled ( ) ) |
testSingleton ( ) { datawave . ingest . time . Now now = datawave . ingest . time . Now . getInstance ( ) ; datawave . ingest . time . Now now2 = datawave . ingest . time . Now . getInstance ( ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { if ( ( datawave . ingest . time . Now . instance ) == null ) { synchronized ( datawave . ingest . time . Now . class ) { if ( ( datawave . ingest . time . Now . instance ) == null ) { datawave . ingest . time . Now . instance = new datawave . ingest . time . Now ( false ) ; } } } return datawave . ingest . time . Now . instance ; } | org . junit . Assert . assertSame ( now , now2 ) |
testSimpleMethods ( ) { java . util . Map < java . lang . String , java . lang . Object > method = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( org . eclipse . ceylon . compiler . js . TestModelMethodsAndAttributes . model . get ( "simple1" ) ) ) ; "<AssertPlaceHolder>" ; util . ModelUtils . checkMap ( method , MetamodelGenerator . KEY_NAME , "simple1" , MetamodelGenerator . KEY_METATYPE , MetamodelGenerator . METATYPE_METHOD ) ; util . ModelUtils . checkType ( method , "ceylon.language::Anything" ) ; method = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( org . eclipse . ceylon . compiler . js . TestModelMethodsAndAttributes . model . get ( "simple2" ) ) ) ; util . ModelUtils . checkMap ( method , MetamodelGenerator . KEY_NAME , "simple2" , MetamodelGenerator . KEY_METATYPE , MetamodelGenerator . METATYPE_METHOD ) ; util . ModelUtils . checkAnnotations ( method , "shared" ) ; util . ModelUtils . checkType ( method , "ceylon.language::Integer" ) ; method = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( org . eclipse . ceylon . compiler . js . TestModelMethodsAndAttributes . model . get ( "simple3" ) ) ) ; util . ModelUtils . checkMap ( method , MetamodelGenerator . KEY_NAME , "simple3" , MetamodelGenerator . KEY_METATYPE , MetamodelGenerator . METATYPE_METHOD ) ; util . ModelUtils . checkType ( method , "ceylon.language::Anything" ) ; util . ModelUtils . checkParam ( method , 0 , "p1" , "ceylon.language::Integer" , false , false ) ; util . ModelUtils . checkParam ( method , 1 , "p2" , "ceylon.language::String" , false , false ) ; } | org . junit . Assert . assertNotNull ( method ) |
test31 ( ) { "<AssertPlaceHolder>" ; } getByCode ( java . lang . String ) { return com . neovisionaries . i18n . ScriptCode . getByCode ( code , true ) ; } | org . junit . Assert . assertNull ( com . neovisionaries . i18n . ScriptCode . getByCode ( 0 ) ) |
testJsonDeserializationFromEmptyString ( ) { com . fasterxml . jackson . databind . ObjectMapper objectMapper = new com . fasterxml . jackson . databind . ObjectMapper ( ) ; io . github . tcdl . msb . support . SimpleBean bean = io . github . tcdl . msb . support . Utils . fromJson ( "" , io . github . tcdl . msb . support . SimpleBean . class , objectMapper ) ; "<AssertPlaceHolder>" ; } fromJson ( java . lang . String , java . lang . Class , com . fasterxml . jackson . databind . ObjectMapper ) { return io . github . tcdl . msb . support . Utils . fromJson ( json , new com . fasterxml . jackson . core . type . TypeReference < T > ( ) { @ io . github . tcdl . msb . support . Override public java . lang . reflect . Type getType ( ) { return clazz ; } } , objectMapper ) ; } | org . junit . Assert . assertNull ( bean ) |
executeBatchShouldWork ( ) { java . sql . Connection connection = java . sql . DriverManager . getConnection ( ( ( "jdbc:neo4j:" + ( org . neo4j . jdbc . bolt . BoltNeo4jPreparedStatementIT . neo4j . getBoltUrl ( ) ) ) + "?nossl" ) ) ; java . sql . PreparedStatement statement = connection . prepareStatement ( StatementData . STATEMENT_CREATE_TWO_PROPERTIES_PARAMETRIC ) ; connection . setAutoCommit ( true ) ; statement . setString ( 1 , "test1" ) ; statement . setString ( 2 , "test2" ) ; statement . addBatch ( ) ; statement . setString ( 1 , "test3" ) ; statement . setString ( 2 , "test4" ) ; statement . addBatch ( ) ; statement . setString ( 1 , "test5" ) ; statement . setString ( 2 , "test6" ) ; statement . addBatch ( ) ; int [ ] result = statement . executeBatch ( ) ; "<AssertPlaceHolder>" ; connection . close ( ) ; org . neo4j . jdbc . bolt . BoltNeo4jPreparedStatementIT . neo4j . getGraphDatabase ( ) . execute ( StatementData . STATEMENT_CLEAR_DB ) ; } executeBatch ( ) { this . checkClosed ( ) ; int [ ] result = new int [ 0 ] ; try { for ( java . lang . String query : this . batchStatements ) { org . neo4j . driver . v1 . StatementResult res ; if ( this . connection . getAutoCommit ( ) ) { res = ( ( org . neo4j . jdbc . bolt . BoltNeo4jConnection ) ( connection ) ) . getSession ( ) . run ( query ) ; } else { res = ( ( org . neo4j . jdbc . bolt . BoltNeo4jConnection ) ( connection ) ) . getTransaction ( ) . run ( query ) ; } org . neo4j . driver . v1 . summary . SummaryCounters count = res . consume ( ) . counters ( ) ; result = java . util . Arrays . copyOf ( result , ( ( result . length ) + 1 ) ) ; result [ ( ( result . length ) - 1 ) ] = ( count . nodesCreated ( ) ) + ( count . nodesDeleted ( ) ) ; } } catch ( java . lang . Exception e ) { throw new java . sql . BatchUpdateException ( result , e ) ; } return result ; } | org . junit . Assert . assertArrayEquals ( new int [ ] { 1 , 1 , 1 } , result ) |
hadoopPartitionTap ( ) { java . lang . Class < ? > tapType = com . hotels . plunger . TapTypeUtil . getTapConfigClass ( new cascading . tap . hadoop . PartitionTap ( new cascading . tap . hadoop . Hfs ( new cascading . scheme . hadoop . TextDelimited ( ) , "" ) , new cascading . tap . partition . DelimitedPartition ( new cascading . tuple . Fields ( "A" ) ) ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( org . apache . hadoop . conf . Configuration . class , tapType ) |
testJobSubmission ( ) { org . apache . hadoop . mapred . JobConf conf = new org . apache . hadoop . mapred . JobConf ( ) ; org . apache . hadoop . mapreduce . Job job = new org . apache . hadoop . mapreduce . Job ( conf ) ; job . setInputFormatClass ( org . apache . hadoop . mapreduce . TestInputFormat . class ) ; job . setMapperClass ( org . apache . hadoop . mapreduce . TestMROutputFormat . TestMapper . class ) ; job . setOutputFormatClass ( org . apache . hadoop . mapreduce . TestOutputFormat . class ) ; job . setOutputKeyClass ( org . apache . hadoop . io . IntWritable . class ) ; job . setOutputValueClass ( org . apache . hadoop . io . IntWritable . class ) ; job . waitForCompletion ( true ) ; "<AssertPlaceHolder>" ; } isSuccessful ( ) { if ( lost ) { throw new java . io . IOException ( "Test<sp>failure!" ) ; } return isSuccessful ; } | org . junit . Assert . assertTrue ( job . isSuccessful ( ) ) |
testGetSetEncryptionScheme ( ) { java . lang . String expectedEncryptionScheme = "testEncryptionScheme" ; com . microsoft . windowsazure . services . media . models . AssetFileInfo fileInfo = new com . microsoft . windowsazure . services . media . models . AssetFileInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . AssetFileType ( ) . setEncryptionScheme ( expectedEncryptionScheme ) ) ; java . lang . String actualEncryptionScheme = fileInfo . getEncryptionScheme ( ) ; "<AssertPlaceHolder>" ; } getEncryptionScheme ( ) { return encryptionScheme ; } | org . junit . Assert . assertEquals ( expectedEncryptionScheme , actualEncryptionScheme ) |
shouldReduceTooLongDescriptions ( ) { int MAX_LENGTH = 1000 ; int ACTUAL_LENGTH = 2000 ; java . util . function . Supplier < java . lang . String > desciptionSupplier = ( ) -> com . github . rollingmetrics . top . TestData . generateString ( ACTUAL_LENGTH ) ; com . github . rollingmetrics . top . Position position = new com . github . rollingmetrics . top . Position ( java . lang . System . currentTimeMillis ( ) , 22 , java . util . concurrent . TimeUnit . MILLISECONDS , desciptionSupplier , 1000 ) ; "<AssertPlaceHolder>" ; } getQueryDescription ( ) { return description ; } | org . junit . Assert . assertEquals ( MAX_LENGTH , position . getQueryDescription ( ) . length ( ) ) |
getBytes ( ) { int length = 3 ; byte [ ] bytes = new byte [ ] { 1 , 2 , 3 } ; doReturn ( RedisBytes . DOLLAR_BYTE ) . when ( streamReader ) . readByte ( ) ; doReturn ( length ) . when ( streamReader ) . readInt ( ) ; doReturn ( bytes ) . when ( streamReader ) . read ( length ) ; byte [ ] actualBytes = commandResult . getBytes ( ) ; "<AssertPlaceHolder>" ; } getBytes ( ) { com . cetsoft . imcache . redis . client . RedisStreamReader streamReader = getStreamReader ( ) ; checkMessageType ( streamReader , RedisBytes . DOLLAR_BYTE ) ; int length = streamReader . readInt ( ) ; return streamReader . read ( length ) ; } | org . junit . Assert . assertArrayEquals ( bytes , actualBytes ) |
test_composition_identity_simple_case ( ) { com . artemis . World world = new com . artemis . World ( ) ; com . artemis . Entity e = world . createEntity ( ) ; world . process ( ) ; "<AssertPlaceHolder>" ; } getCompositionId ( ) { return world . getComponentManager ( ) . getIdentity ( id ) ; } | org . junit . Assert . assertEquals ( 0 , e . getCompositionId ( ) ) |
concurrencyTest ( ) { org . apache . taverna . lang . observer . ObserverTest . MyObservable observable = new org . apache . taverna . lang . observer . ObserverTest . MyObservable ( ) ; org . apache . taverna . lang . observer . ObserverTest . MyObserver dummyObserver = new org . apache . taverna . lang . observer . ObserverTest . MyObserver ( ) ; org . apache . taverna . lang . observer . ObserverTest . SelvRemovingObserver selfRemoving = new org . apache . taverna . lang . observer . ObserverTest . SelvRemovingObserver ( ) ; observable . addObserver ( dummyObserver ) ; observable . addObserver ( selfRemoving ) ; "<AssertPlaceHolder>" ; observable . triggerEvent ( ) ; } getObservers ( ) { return processorFinishedMultiCaster . getObservers ( ) ; } | org . junit . Assert . assertEquals ( 2 , observable . getObservers ( ) . size ( ) ) |
testSaslGssApiKrbConnectionWithPrincipalViaJmsUsernameConnFactory ( ) { try ( org . apache . qpid . jms . test . testpeer . TestAmqpPeer testPeer = new org . apache . qpid . jms . test . testpeer . TestAmqpPeer ( ) ) { testPeer . expectSaslGSSAPI ( org . apache . qpid . jms . integration . SaslGssApiIntegrationTest . servicePrincipal , org . apache . qpid . jms . integration . SaslGssApiIntegrationTest . KRB5_KEYTAB , ( ( org . apache . qpid . jms . integration . SaslGssApiIntegrationTest . CLIENT_PRINCIPAL_FACTORY_USERNAME ) + "@EXAMPLE.COM" ) ) ; testPeer . expectOpen ( ) ; testPeer . expectBegin ( ) ; java . lang . String uriOptions = ( "?sasl.options.configScope=KRB5-CLIENT-FACTORY-USERNAME-CALLBACK" + "&amqp.saslMechanisms=" ) + ( org . apache . qpid . jms . integration . SaslGssApiIntegrationTest . GSSAPI ) ; javax . jms . ConnectionFactory factory = new org . apache . qpid . jms . JmsConnectionFactory ( ( ( "amqp://localhost:" + ( testPeer . getServerPort ( ) ) ) + uriOptions ) ) ; javax . jms . Connection connection = factory . createConnection ( org . apache . qpid . jms . integration . SaslGssApiIntegrationTest . CLIENT_PRINCIPAL_FACTORY_USERNAME , null ) ; connection . setClientID ( "clientName" ) ; testPeer . waitForAllHandlersToComplete ( 1000 ) ; "<AssertPlaceHolder>" ; testPeer . expectClose ( ) ; connection . close ( ) ; } } getThrowable ( ) { return _driverRunnable . getException ( ) ; } | org . junit . Assert . assertNull ( testPeer . getThrowable ( ) ) |
testBuildWithDisabledStatusConstraint ( ) { unit . setActive ( false ) ; org . lnu . is . domain . language . Language context = new org . lnu . is . domain . language . Language ( ) ; java . lang . String expectedQuery = "SELECT<sp>e<sp>FROM<sp>Language<sp>e<sp>WHERE<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . language . Language > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expectedQuery , actualQuery ) |
testToAndFromPb ( ) { "<AssertPlaceHolder>" ; compareSnapshotDiskConfiguration ( com . google . cloud . compute . deprecated . SnapshotDiskConfigurationTest . DISK_CONFIGURATION , com . google . cloud . compute . deprecated . DiskConfiguration . < com . google . cloud . compute . deprecated . SnapshotDiskConfiguration > fromPb ( com . google . cloud . compute . deprecated . SnapshotDiskConfigurationTest . DISK_CONFIGURATION . toPb ( ) ) ) ; } fromPb ( com . google . api . services . compute . model . Zone ) { com . google . cloud . compute . deprecated . Zone . Builder builder = com . google . cloud . compute . deprecated . Zone . builder ( ) ; builder . setZoneId ( com . google . cloud . compute . deprecated . ZoneId . fromUrl ( zonePb . getSelfLink ( ) ) ) ; if ( ( zonePb . getId ( ) ) != null ) { builder . setGeneratedId ( zonePb . getId ( ) . toString ( ) ) ; } if ( ( zonePb . getCreationTimestamp ( ) ) != null ) { builder . setCreationTimestamp ( com . google . cloud . compute . deprecated . Zone . TIMESTAMP_FORMATTER . parse ( zonePb . getCreationTimestamp ( ) , Instant . FROM ) . toEpochMilli ( ) ) ; } builder . setDescription ( zonePb . getDescription ( ) ) ; if ( ( zonePb . getStatus ( ) ) != null ) { builder . setStatus ( com . google . cloud . compute . deprecated . Zone . Status . valueOf ( zonePb . getStatus ( ) ) ) ; } if ( ( zonePb . getRegion ( ) ) != null ) { builder . setRegion ( com . google . cloud . compute . deprecated . RegionId . fromUrl ( zonePb . getRegion ( ) ) ) ; } if ( ( zonePb . getDeprecated ( ) ) != null ) { builder . setDeprecationStatus ( com . google . cloud . compute . deprecated . DeprecationStatus . fromPb ( zonePb . getDeprecated ( ) , ZoneId . FROM_URL_FUNCTION ) ) ; } return builder . build ( ) ; } | org . junit . Assert . assertTrue ( ( ( com . google . cloud . compute . deprecated . DiskConfiguration . fromPb ( com . google . cloud . compute . deprecated . SnapshotDiskConfigurationTest . DISK_CONFIGURATION . toPb ( ) ) ) instanceof com . google . cloud . compute . deprecated . SnapshotDiskConfiguration ) ) |
testFixtMessageCrackingWithSessionDefaultApplVerID ( ) { quickfix . fix44 . Email message = createFix44Email ( ) ; stub ( mockSession . getTargetDefaultApplicationVersionID ( ) ) . toReturn ( new quickfix . field . ApplVerID ( quickfix . field . ApplVerID . FIX44 ) ) ; quickfix . MessageCracker cracker = new quickfix . MessageCracker ( ) { @ quickfix . SuppressWarnings ( "unused" ) public void onMessage ( quickfix . fix44 . Email email , quickfix . SessionID sessionID ) { ( messageCracked ) ++ ; } } ; cracker . crack ( message , new quickfix . SessionID ( FixVersions . BEGINSTRING_FIXT11 , "SENDER" , "TARGET" ) ) ; "<AssertPlaceHolder>" ; } onMessage ( quickfix . fix42 . NewOrderSingle , quickfix . SessionID ) { java . lang . String senderCompId = message . getHeader ( ) . getString ( SenderCompID . FIELD ) ; java . lang . String targetCompId = message . getHeader ( ) . getString ( TargetCompID . FIELD ) ; java . lang . String clOrdId = message . getString ( ClOrdID . FIELD ) ; java . lang . String symbol = message . getString ( Symbol . FIELD ) ; char side = message . getChar ( Side . FIELD ) ; char ordType = message . getChar ( OrdType . FIELD ) ; double price = 0 ; if ( ordType == ( quickfix . field . OrdType . LIMIT ) ) { price = message . getDouble ( Price . FIELD ) ; } double qty = message . getDouble ( OrderQty . FIELD ) ; char timeInForce = quickfix . field . TimeInForce . DAY ; if ( message . isSetField ( TimeInForce . FIELD ) ) { timeInForce = message . getChar ( TimeInForce . FIELD ) ; } try { if ( timeInForce != ( quickfix . field . TimeInForce . DAY ) ) { throw new java . lang . RuntimeException ( "Unsupported<sp>TIF,<sp>use<sp>Day" ) ; } quickfix . examples . ordermatch . Order order = new quickfix . examples . ordermatch . Order ( clOrdId , symbol , senderCompId , targetCompId , side , ordType , price , ( ( int ) ( qty ) ) ) ; processOrder ( order ) ; } catch ( java . lang . Exception e ) { rejectOrder ( targetCompId , senderCompId , clOrdId , symbol , side , e . getMessage ( ) ) ; } } | org . junit . Assert . assertTrue ( ( ( messageCracked ) > 0 ) ) |
shouldReturnTrueFromHasValueIfAnEmptyValueIsSupplied ( ) { final com . lmax . simpledsl . DslParams params = new com . lmax . simpledsl . DslParams ( new java . lang . String [ ] { "a=" } , new com . lmax . simpledsl . OptionalParam ( "a" ) ) ; "<AssertPlaceHolder>" ; } hasValue ( java . lang . String ) { return valuesByName . containsKey ( name . toLowerCase ( ) ) ; } | org . junit . Assert . assertTrue ( params . hasValue ( "a" ) ) |
resolveVisibilityForwardsCalls ( ) { when ( this . visibilityManager . resolveVisibility ( org . phenotips . data . permissions . internal . DefaultEntityPermissionsManagerTest . PUBLIC ) ) . thenReturn ( org . phenotips . data . permissions . internal . DefaultEntityPermissionsManagerTest . PUBLIC_VISIBILITY ) ; "<AssertPlaceHolder>" ; verify ( this . visibilityManager , times ( 1 ) ) . resolveVisibility ( org . phenotips . data . permissions . internal . DefaultEntityPermissionsManagerTest . PUBLIC ) ; } resolveVisibility ( java . lang . String ) { return this . internalService . resolveVisibility ( name ) ; } | org . junit . Assert . assertSame ( org . phenotips . data . permissions . internal . DefaultEntityPermissionsManagerTest . PUBLIC_VISIBILITY , this . component . resolveVisibility ( org . phenotips . data . permissions . internal . DefaultEntityPermissionsManagerTest . PUBLIC ) ) |
testFileInFolderCommitted ( ) { org . eclipse . jgit . revwalk . RevCommit commit = writeFileInFolderAndCommit ( ) ; org . eclipse . jgit . treewalk . TreeWalk treeWalk = createTreeWalk ( commit ) ; "<AssertPlaceHolder>" ; } next ( ) { org . eclipse . jgit . treewalk . CanonicalTreeParser p = this ; for ( ; ; ) { if ( ( p . nextPtr ) == ( p . raw . length ) ) { if ( ( p . parent ) == null ) { p . currPtr = p . nextPtr ; return p ; } p = ( ( org . eclipse . jgit . treewalk . CanonicalTreeParser ) ( p . parent ) ) ; continue ; } p . prevPtr = p . currPtr ; p . currPtr = p . nextPtr ; p . parseEntry ( ) ; return p ; } } | org . junit . Assert . assertFalse ( treeWalk . next ( ) ) |
testNonNull ( ) { org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProvider provider = org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . getInstance ( ) ; "<AssertPlaceHolder>" ; } getInstance ( ) { synchronized ( org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . class ) { if ( ( org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . provider ) != null ) { return org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . provider ; } org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . provider = org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . locateProvider ( ) ; return org . eclipse . kapua . broker . core . plugin . ConnectorDescriptorProviders . provider ; } } | org . junit . Assert . assertNotNull ( provider ) |
equalsWithNullReturnsFalse ( ) { com . rackspacecloud . blueflood . types . SimpleNumber sn = new com . rackspacecloud . blueflood . types . SimpleNumber ( 123.45 ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( other instanceof com . rackspacecloud . blueflood . service . SlotState ) ) { return false ; } com . rackspacecloud . blueflood . service . SlotState that = ( ( com . rackspacecloud . blueflood . service . SlotState ) ( other ) ) ; return this . toString ( ) . equals ( that . toString ( ) ) ; } | org . junit . Assert . assertFalse ( sn . equals ( null ) ) |
testEmptyTableSpace ( ) { org . eclipse . rdf4j . model . impl . TreeModel g = new org . eclipse . rdf4j . model . impl . TreeModel ( ) ; org . eclipse . rdf4j . model . IRI node = org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) . createIRI ( "http://node" ) ; g . add ( node , HALYARD . TABLE_NAME_PROPERTY , org . eclipse . rdf4j . model . impl . SimpleValueFactory . getInstance ( ) . createLiteral ( "" ) ) ; com . msd . gin . halyard . sail . HBaseSailConfig cfg = new com . msd . gin . halyard . sail . HBaseSailConfig ( ) ; cfg . parse ( g , null ) ; "<AssertPlaceHolder>" ; } getTablespace ( ) { return tablespace ; } | org . junit . Assert . assertNull ( cfg . getTablespace ( ) ) |
testEqualsToLowerCase ( ) { org . evosuite . symbolic . expr . str . StringVariable var1 = new org . evosuite . symbolic . expr . str . StringVariable ( "var1" , "f|" ) ; org . evosuite . symbolic . expr . bv . StringBinaryComparison cmp3 = new org . evosuite . symbolic . expr . bv . StringBinaryComparison ( new org . evosuite . symbolic . expr . str . StringConstant ( "wed" ) , org . evosuite . symbolic . expr . Operator . EQUALS , new org . evosuite . symbolic . expr . str . StringUnaryExpression ( var1 , org . evosuite . symbolic . expr . Operator . TOLOWERCASE , "f|" . toLowerCase ( ) ) , 0L ) ; org . evosuite . symbolic . expr . StringConstraint constr3 = new org . evosuite . symbolic . expr . StringConstraint ( cmp3 , org . evosuite . symbolic . expr . Comparator . NE , new org . evosuite . symbolic . expr . bv . IntegerConstant ( 0 ) ) ; java . util . Collection < org . evosuite . symbolic . expr . Constraint < ? > > constraints = new java . util . ArrayList < org . evosuite . symbolic . expr . Constraint < ? > > ( ) ; constraints . add ( constr3 ) ; org . evosuite . symbolic . solver . avm . EvoSuiteSolver solver = new org . evosuite . symbolic . solver . avm . EvoSuiteSolver ( ) ; java . util . Map < java . lang . String , java . lang . Object > solution ; try { solution = org . evosuite . symbolic . solver . TestSolver . solve ( solver , constraints ) ; "<AssertPlaceHolder>" ; } catch ( org . evosuite . symbolic . solver . SolverTimeoutException e ) { org . junit . Assert . fail ( ) ; } } solve ( org . evosuite . symbolic . solver . Solver , java . util . Collection ) { if ( hasCachedResult ( constraints ) ) { org . evosuite . symbolic . solver . SolverResult cached_solution = getCachedResult ( ) ; return cached_solution ; } org . evosuite . symbolic . solver . SolverResult solverResult ; try { solverResult = solver . solve ( constraints ) ; if ( solverResult . isUNSAT ( ) ) { addUNSAT ( constraints , solverResult ) ; } else { addSAT ( constraints , solverResult ) ; } } catch ( org . evosuite . symbolic . solver . SolverTimeoutException | java . io . IOException | org . evosuite . symbolic . solver . SolverParseException | org . evosuite . symbolic . solver . SolverEmptyQueryException | org . evosuite . symbolic . solver . SolverErrorException e ) { solverResult = null ; } return solverResult ; } | org . junit . Assert . assertNotNull ( solution ) |
testEvaluationPhraseSameTermFailure ( ) { java . lang . String query = buildFunction ( ContentFunctions . CONTENT_PHRASE_FUNCTION_NAME , Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , "'cat'" , "'cat'" ) ; org . apache . commons . jexl2 . Expression expr = datawave . query . jexl . functions . ContentFunctionsTest . engine . createExpression ( query ) ; java . util . List < datawave . ingest . protobuf . TermWeightPosition > list1 ; list1 = asList ( 1 , 3 , 5 ) ; termOffSetMap . put ( "cat" , new datawave . query . jexl . functions . TermFrequencyList ( com . google . common . collect . Maps . immutableEntry ( new datawave . query . jexl . functions . TermFrequencyList . Zone ( "CONTENT" , true , eventId ) , list1 ) ) ) ; context . set ( Constants . TERM_OFFSET_MAP_JEXL_VARIABLE_NAME , termOffSetMap ) ; java . lang . Object o = expr . evaluate ( context ) ; "<AssertPlaceHolder>" ; } expect ( java . lang . Object , java . lang . Boolean ) { if ( null == result ) { return Boolean . FALSE . equals ( expected ) ; } if ( result instanceof java . lang . Boolean ) { return result . equals ( expected ) ; } return false ; } | org . junit . Assert . assertTrue ( datawave . query . jexl . functions . ContentFunctionsTest . expect ( o , false ) ) |
testProjectStageAwarePropertyValueReference_2 ( ) { final java . lang . String expected = "projectStageAware-exampleEntry-1-is-tomato-UnitTest" ; final java . lang . String projectStageAwareExampleEntry1 = org . apache . deltaspike . core . api . config . ConfigResolver . getProjectStageAwarePropertyValue ( "deltaspike.test.exampleEntry-2" , "" ) ; "<AssertPlaceHolder>" ; } getProjectStageAwarePropertyValue ( java . lang . String , java . lang . String ) { return org . apache . deltaspike . core . api . config . ConfigResolver . getConfigProvider ( ) . getConfig ( ) . resolve ( key ) . withCurrentProjectStage ( true ) . withDefault ( defaultValue ) . evaluateVariables ( true ) . getValue ( ) ; } | org . junit . Assert . assertEquals ( expected , projectStageAwareExampleEntry1 ) |
updateAlarm ( ) { com . vsct . supervision . seyren . api . Alarm alarm = com . vsct . supervision . notification . TestUtils . getDefaultAlarm ( ) ; alarm . setTarget ( "totoSayHello" ) ; com . vsct . supervision . seyren . api . Alarm updatedAlarm = alarmService . updateAlarm ( alarm ) ; "<AssertPlaceHolder>" ; verify ( seyrenRepository ) . updateAlarm ( alarm ) ; } updateAlarm ( com . vsct . supervision . seyren . api . Alarm ) { com . vsct . supervision . notification . service . AlarmService . LOGGER . debug ( ( "Update<sp>alarm<sp>to:<sp>" + alarm ) ) ; validateUpdatable ( alarm ) ; try { seyrenRepository . updateAlarm ( alarm ) ; if ( alarm . isEnabled ( ) ) { notificationHandler . sendAlarmHasBeenModified ( alarm ) ; } else { notificationHandler . sendAlarmHasBeenDeactivated ( alarm ) ; } return this . searchAlarmByName ( alarm . getName ( ) ) ; } catch ( java . lang . RuntimeException exception ) { com . vsct . supervision . notification . service . AlarmService . LOGGER . error ( "Error<sp>updating<sp>alarm" , exception ) ; throw new com . vsct . supervision . notification . exception . CerebroException ( com . vsct . supervision . notification . ErrorCode . CEREBRO_UNKNOWN_ERROR , "Error<sp>updating<sp>alarm" , exception ) ; } } | org . junit . Assert . assertNotNull ( updatedAlarm ) |
testGetOptions ( ) { java . util . List < java . lang . Object > expectedOptions = new java . util . ArrayList ( ) ; expectedOptions . add ( createOption ( "Label<sp>1" , "value<sp>1" ) ) ; expectedOptions . add ( createOption ( "Label<sp>2" , "value<sp>2" ) ) ; expectedOptions . add ( createOption ( "Label<sp>3" , "value<sp>3" ) ) ; com . liferay . dynamic . data . mapping . model . DDMFormFieldOptions ddmFormFieldOptions = createDDMFormFieldOptions ( ) ; java . util . List < java . lang . Object > actualOptions = getActualOptions ( ddmFormFieldOptions , LocaleUtil . US ) ; "<AssertPlaceHolder>" ; } getActualOptions ( com . liferay . dynamic . data . mapping . model . DDMFormFieldOptions , java . util . Locale ) { com . liferay . dynamic . data . mapping . form . field . type . radio . internal . RadioDDMFormFieldContextHelper radioDDMFormFieldContextHelper = new com . liferay . dynamic . data . mapping . form . field . type . radio . internal . RadioDDMFormFieldContextHelper ( ddmFormFieldOptions , locale ) ; com . liferay . dynamic . data . mapping . render . DDMFormFieldRenderingContext ddmFormFieldRenderingContext = new com . liferay . dynamic . data . mapping . render . DDMFormFieldRenderingContext ( ) ; return radioDDMFormFieldContextHelper . getOptions ( ddmFormFieldRenderingContext ) ; } | org . junit . Assert . assertEquals ( expectedOptions , actualOptions ) |
clearTSLCache ( ) { java . io . File fileCacheDirectory = org . digidoc4j . impl . asic . tsl . TslLoader . fileCacheDirectory ; if ( fileCacheDirectory . exists ( ) ) { org . apache . commons . io . FileUtils . cleanDirectory ( fileCacheDirectory ) ; } org . digidoc4j . TSLCertificateSource tslCertificateSource = this . configuration . getTSL ( ) ; tslCertificateSource . refresh ( ) ; org . digidoc4j . test . util . TestCommonUtil . sleepInSeconds ( 1 ) ; java . io . File oldCachedFile = fileCacheDirectory . listFiles ( ) [ 0 ] ; java . nio . file . attribute . FileTime oldCachedFileDate = ( ( java . nio . file . attribute . FileTime ) ( java . nio . file . Files . getAttribute ( oldCachedFile . toPath ( ) , "basic:creationTime" ) ) ) ; tslCertificateSource . invalidateCache ( ) ; this . configuration . setTSL ( null ) ; tslCertificateSource = this . configuration . getTSL ( ) ; tslCertificateSource . refresh ( ) ; java . io . File newCachedFile = fileCacheDirectory . listFiles ( ) [ 0 ] ; java . nio . file . attribute . FileTime newCachedFileDate = org . digidoc4j . test . util . TestFileUtil . creationTime ( newCachedFile . toPath ( ) ) ; "<AssertPlaceHolder>" ; } creationTime ( java . nio . file . Path ) { try { return ( ( java . nio . file . attribute . FileTime ) ( java . nio . file . Files . getAttribute ( filePath , "basic:creationTime" ) ) ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertTrue ( ( ( newCachedFileDate . compareTo ( oldCachedFileDate ) ) > 0 ) ) |
testWijzigingDatumVoorOpschortingDatum ( ) { nl . bzk . brp . model . groep . bericht . PersoonOpschortingGroepBericht opschorting = new nl . bzk . brp . model . groep . bericht . PersoonOpschortingGroepBericht ( ) ; opschorting . setRedenOpschorting ( RedenOpschorting . MINISTER ) ; nl . bzk . brp . model . groep . operationeel . actueel . PersoonOpschortingGroepModel opschortingModel = new nl . bzk . brp . model . groep . operationeel . actueel . PersoonOpschortingGroepModel ( opschorting ) ; org . springframework . test . util . ReflectionTestUtils . setField ( persoon1 , "opschorting" , opschortingModel ) ; nl . bzk . brp . model . objecttype . bericht . PersoonBericht nieuweSituatie = new nl . bzk . brp . model . objecttype . bericht . PersoonBericht ( ) ; nl . bzk . brp . model . validatie . Melding melding = bral9003 . executeer ( persoon1 , nieuweSituatie , new nl . bzk . brp . model . attribuuttype . Datum ( 20120504 ) ) ; org . mockito . Mockito . verify ( persoonOpschortingHistorieRepository , org . mockito . Mockito . times ( 1 ) ) . haalOpActueleDatumOpschorting ( persoon1 ) ; "<AssertPlaceHolder>" ; } setRedenOpschorting ( nl . bzk . algemeenbrp . dal . domein . brp . enums . NadereBijhoudingsaard ) { nl . bzk . algemeenbrp . dal . domein . brp . util . ValidationUtils . controleerOpNullWaarden ( "redenOpschorting<sp>mag<sp>niet<sp>null<sp>zijn" , redenOpschorting ) ; redenOpschortingId = redenOpschorting . getId ( ) ; } | org . junit . Assert . assertNull ( melding ) |
whenProGuardMaxHeapSizeOverrideUsed ( ) { java . lang . String proGuardMaxHeapSize = "1234M" ; com . facebook . buck . io . filesystem . impl . FakeProjectFilesystem filesystem = new com . facebook . buck . io . filesystem . impl . FakeProjectFilesystem ( ) ; com . facebook . buck . core . config . BuckConfig buckConfig = com . facebook . buck . core . config . FakeBuckConfig . builder ( ) . setSections ( com . google . common . collect . ImmutableMap . of ( "tools" , com . google . common . collect . ImmutableMap . of ( "proguard-max-heap-size" , proGuardMaxHeapSize ) ) ) . setFilesystem ( filesystem ) . build ( ) ; com . facebook . buck . android . ProGuardConfig proGuardConfig = new com . facebook . buck . android . ProGuardConfig ( buckConfig ) ; "<AssertPlaceHolder>" ; } getProguardMaxHeapSize ( ) { return delegate . getValue ( SECTION , "proguard-max-heap-size" ) . orElse ( "1024M" ) ; } | org . junit . Assert . assertEquals ( proGuardMaxHeapSize , proGuardConfig . getProguardMaxHeapSize ( ) ) |
testGetOrbitReference ( ) { try { jrc . it . xml . wrapper . SumoJaxbSafeReader reader = new jrc . it . xml . wrapper . SumoJaxbSafeReader ( new java . io . File ( safeFile ) ) ; jrc . it . safe . reader . jaxb . OrbitReference orbit = reader . getOrbitReference ( ) ; "<AssertPlaceHolder>" ; } catch ( org . jdom2 . JDOMException | java . io . IOException | javax . xml . bind . JAXBException e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } } getOrbitReference ( ) { return orbitReference ; } | org . junit . Assert . assertNotNull ( orbit ) |
testIsMatchSizeLess ( ) { org . sagebionetworks . repo . model . table . ColumnModel model = new org . sagebionetworks . repo . model . table . ColumnModel ( ) ; model . setId ( "123" ) ; model . setColumnType ( ColumnType . STRING ) ; model . setName ( EntityField . name . name ( ) ) ; model . setMaximumSize ( ( ( EntityField . name . getColumnModel ( ) . getMaximumSize ( ) ) - 1 ) ) ; "<AssertPlaceHolder>" ; } isMatch ( org . sagebionetworks . repo . model . table . ColumnModel ) { org . sagebionetworks . repo . model . table . ColumnModel fieldColumnModel = this . getColumnModel ( ) ; if ( ! ( fieldColumnModel . getName ( ) . equals ( cm . getName ( ) ) ) ) { return false ; } if ( ! ( fieldColumnModel . getColumnType ( ) . equals ( cm . getColumnType ( ) ) ) ) { return false ; } if ( ( fieldColumnModel . getMaximumSize ( ) ) != null ) { if ( ( cm . getMaximumSize ( ) ) == null ) { return false ; } if ( ( cm . getMaximumSize ( ) ) < ( fieldColumnModel . getMaximumSize ( ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertFalse ( EntityField . name . isMatch ( model ) ) |
registerKnownCustomer_asReseller ( ) { setupContainer ( ) ; mockTriggerQueue ( ) ; mockNoInvoiceAsDefault ( ) ; final org . oscm . domobjects . PlatformUser user = givenBroker ( ) ; container . login ( user . getKey ( ) , UserRoleType . RESELLER_MANAGER . name ( ) ) ; org . oscm . domobjects . Marketplace marketplace = givenMarketplace ( user . getOrganization ( ) , "MP" ) ; invoiceAsDefault . setValue ( "true" ) ; mockMarketplaceService ( marketplace ) ; org . oscm . internal . vo . VOOrganization org = as . registerKnownCustomer ( createVOOrganization ( "customerOfReseller" ) , createVOUserDetails ( "admin" ) , null , marketplace . getMarketplaceId ( ) ) ; "<AssertPlaceHolder>" ; invoiceAsDefault . setValue ( "false" ) ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( "customerOfReseller" , org . getName ( ) ) |
testSetDay ( ) { final int day = 10 ; instance . setDay ( day ) ; "<AssertPlaceHolder>" ; } getDay ( ) { return day ; } | org . junit . Assert . assertEquals ( day , instance . getDay ( ) ) |
testUpsertStatement ( ) { java . sql . Connection conn = java . sql . DriverManager . getConnection ( getUrl ( ) , org . apache . phoenix . util . PropertiesUtil . deepCopy ( TestUtil . TEST_PROPERTIES ) ) ; final java . lang . String tableName = "TEST_TABLE" ; try { java . lang . String ddl = ( ( "CREATE<sp>TABLE<sp>" + tableName ) + "<sp>(a_string<sp>varchar<sp>not<sp>null,<sp>a_binary<sp>varbinary<sp>not<sp>null,<sp>col1<sp>integer" ) + "<sp>CONSTRAINT<sp>pk<sp>PRIMARY<sp>KEY<sp>(a_string,<sp>a_binary))\n" ; conn . createStatement ( ) . execute ( ddl ) ; final org . apache . hadoop . conf . Configuration configuration = new org . apache . hadoop . conf . Configuration ( ) ; configuration . set ( HConstants . ZOOKEEPER_QUORUM , getUrl ( ) ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . setOutputTableName ( configuration , tableName ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . setPhysicalTableName ( configuration , tableName ) ; final java . lang . String upserStatement = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getUpsertStatement ( configuration ) ; final java . lang . String expectedUpsertStatement = ( "UPSERT<sp>INTO<sp>" + tableName ) + "<sp>VALUES<sp>(?,<sp>?,<sp>?)" ; "<AssertPlaceHolder>" ; } finally { conn . close ( ) ; } } getUpsertStatement ( org . apache . hadoop . conf . Configuration ) { com . google . common . base . Preconditions . checkNotNull ( configuration ) ; java . lang . String upsertStmt = configuration . get ( org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . UPSERT_STATEMENT ) ; if ( org . apache . commons . lang3 . StringUtils . isNotEmpty ( upsertStmt ) ) { return upsertStmt ; } final java . lang . String tableName = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getOutputTableName ( configuration ) ; com . google . common . base . Preconditions . checkNotNull ( tableName ) ; java . util . List < java . lang . String > upsertColumnNames = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getUpsertColumnNames ( configuration ) ; final java . util . List < org . apache . phoenix . util . ColumnInfo > columnMetadataList = org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . getUpsertColumnMetadataList ( configuration ) ; if ( ! ( upsertColumnNames . isEmpty ( ) ) ) { upsertStmt = org . apache . phoenix . util . QueryUtil . constructUpsertStatement ( tableName , columnMetadataList ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . LOG . info ( ( "Phoenix<sp>Custom<sp>Upsert<sp>Statement:<sp>" + upsertStmt ) ) ; } else { upsertStmt = org . apache . phoenix . util . QueryUtil . constructGenericUpsertStatement ( tableName , columnMetadataList . size ( ) ) ; org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . LOG . info ( ( "Phoenix<sp>Generic<sp>Upsert<sp>Statement:<sp>" + upsertStmt ) ) ; } configuration . set ( org . apache . phoenix . mapreduce . util . PhoenixConfigurationUtil . UPSERT_STATEMENT , upsertStmt ) ; return upsertStmt ; } | org . junit . Assert . assertEquals ( expectedUpsertStatement , upserStatement ) |
testMath340 ( ) { org . apache . commons . math . fraction . BigFraction fractionA = new org . apache . commons . math . fraction . BigFraction ( 0.00131 ) ; org . apache . commons . math . fraction . BigFraction fractionB = new org . apache . commons . math . fraction . BigFraction ( 0.37 ) . reciprocal ( ) ; org . apache . commons . math . fraction . BigFraction errorResult = fractionA . multiply ( fractionB ) ; org . apache . commons . math . fraction . BigFraction correctResult = new org . apache . commons . math . fraction . BigFraction ( fractionA . getNumerator ( ) . multiply ( fractionB . getNumerator ( ) ) , fractionA . getDenominator ( ) . multiply ( fractionB . getDenominator ( ) ) ) ; "<AssertPlaceHolder>" ; } multiply ( org . mozilla . javascript . v8dtoa . DiyFp ) { final long kM32 = 4294967295L ; long a = ( f ) > > > 32 ; long b = ( f ) & kM32 ; long c = ( other . f ) > > > 32 ; long d = ( other . f ) & kM32 ; long ac = a * c ; long bc = b * c ; long ad = a * d ; long bd = b * d ; long tmp = ( ( bd > > > 32 ) + ( ad & kM32 ) ) + ( bc & kM32 ) ; tmp += 1L << 31 ; long result_f = ( ( ac + ( ad > > > 32 ) ) + ( bc > > > 32 ) ) + ( tmp > > > 32 ) ; e += ( other . e ) + 64 ; f = result_f ; } | org . junit . Assert . assertEquals ( correctResult , errorResult ) |
deveObterAmbienteComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . NFInfoEventoRetorno eventoRetorno = new com . fincatto . documentofiscal . nfe400 . classes . evento . NFInfoEventoRetorno ( ) ; final com . fincatto . documentofiscal . DFAmbiente ambiente = com . fincatto . documentofiscal . DFAmbiente . HOMOLOGACAO ; eventoRetorno . setAmbiente ( ambiente ) ; "<AssertPlaceHolder>" ; } getAmbiente ( ) { return this . ambiente ; } | org . junit . Assert . assertEquals ( ambiente , eventoRetorno . getAmbiente ( ) ) |
testGetEntriesMultipleChunks ( ) { cPropManager . addKey ( platformType , "something" , "A<sp>thing" ) ; cPropManager . addKey ( platformType , "securityPolicy" , "A<sp>policy" ) ; flushSession ( ) ; final java . lang . StringBuffer giantString = new java . lang . StringBuffer ( ) ; for ( int i = 0 ; i < 1003 ; i ++ ) { giantString . append ( 'a' ) ; } cPropManager . setValue ( platform . getEntityId ( ) , platformType . getId ( ) , "something" , giantString . toString ( ) ) ; cPropManager . setValue ( platform . getEntityId ( ) , platformType . getId ( ) , "securityPolicy" , "none" ) ; java . util . Properties props = cPropManager . getEntries ( platform . getEntityId ( ) ) ; java . util . Properties expected = new java . util . Properties ( ) ; expected . setProperty ( "something" , giantString . toString ( ) ) ; expected . setProperty ( "securityPolicy" , "none" ) ; "<AssertPlaceHolder>" ; } setProperty ( java . lang . String , java . lang . String ) { java . lang . Object result = super . setProperty ( key , value ) ; recalculate ( ) ; return result ; } | org . junit . Assert . assertEquals ( expected , props ) |
checkTest2 ( ) { com . navercorp . pinpoint . web . alarm . vo . Rule rule = new com . navercorp . pinpoint . web . alarm . vo . Rule ( com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateCheckerTest . SERVICE_NAME , com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateCheckerTest . SERVICE_TYPE , CheckerCategory . HEAP_USAGE_RATE . getName ( ) , 71 , "testGroup" , false , false , "" ) ; com . navercorp . pinpoint . web . vo . Application application = new com . navercorp . pinpoint . web . vo . Application ( com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateCheckerTest . SERVICE_NAME , com . navercorp . pinpoint . common . trace . ServiceType . STAND_ALONE ) ; com . navercorp . pinpoint . web . alarm . collector . AgentStatDataCollector collector = new com . navercorp . pinpoint . web . alarm . collector . AgentStatDataCollector ( com . navercorp . pinpoint . web . alarm . DataCollectorFactory . DataCollectorCategory . AGENT_STAT , application , com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateCheckerTest . jvmGcDao , com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateCheckerTest . cpuLoadDao , com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateCheckerTest . applicationIndexDao , java . lang . System . currentTimeMillis ( ) , com . navercorp . pinpoint . web . alarm . DataCollectorFactory . SLOT_INTERVAL_FIVE_MIN ) ; com . navercorp . pinpoint . web . alarm . checker . AgentChecker checker = new com . navercorp . pinpoint . web . alarm . checker . HeapUsageRateChecker ( collector , rule ) ; checker . check ( ) ; "<AssertPlaceHolder>" ; } isDetected ( ) { return detected ; } | org . junit . Assert . assertFalse ( checker . isDetected ( ) ) |
testAsyncFailure ( ) { org . robolectric . Robolectric . getFakeHttpLayer ( ) . interceptHttpRequests ( false ) ; java . lang . String subpath = "/asyncfailure" ; java . lang . String body = "hello" ; stubFor ( get ( urlEqualTo ( subpath ) ) . willReturn ( aResponse ( ) . withStatus ( 403 ) . withBody ( body ) ) ) ; final java . lang . Object [ ] content = new java . lang . Object [ 1 ] ; final java . util . concurrent . locks . Lock lock = new java . util . concurrent . locks . ReentrantLock ( ) ; final java . util . concurrent . locks . Condition condition = lock . newCondition ( ) ; asyncEndpoint . asyncFailure ( new com . lonepulse . robozombie . response . AsyncHandler < java . lang . String > ( ) { @ com . lonepulse . robozombie . processor . Override public void onSuccess ( org . apache . http . HttpResponse httpResponse , java . lang . String e ) { } @ com . lonepulse . robozombie . processor . Override public void onFailure ( org . apache . http . HttpResponse httpResponse ) { lock . lock ( ) ; content [ 0 ] = httpResponse ; condition . signal ( ) ; lock . unlock ( ) ; } } ) ; lock . lock ( ) ; condition . await ( ) ; lock . unlock ( ) ; verify ( getRequestedFor ( urlEqualTo ( subpath ) ) ) ; "<AssertPlaceHolder>" ; } onSuccess ( com . lonepulse . robozombie . proxy . InvocationContext , org . apache . http . HttpResponse ) { java . lang . Object reponseEntity = null ; try { reponseEntity = Processors . RESPONSE . run ( context , response ) ; } catch ( java . lang . Exception e ) { onError ( context , com . lonepulse . robozombie . proxy . InvocationException . newInstance ( context , response , e ) ) ; return ; } com . lonepulse . robozombie . response . AsyncHandler < java . lang . Object > asyncHandler = com . lonepulse . robozombie . executor . AsyncExecutionHandler . getAsyncHandler ( context ) ; if ( asyncHandler != null ) { try { asyncHandler . onSuccess ( response , reponseEntity ) ; } catch ( java . lang . Exception e ) { android . util . Log . e ( getClass ( ) . getSimpleName ( ) , "Callback<sp>\"onSuccess\"<sp>aborted<sp>with<sp>an<sp>exception." , e ) ; } } } | org . junit . Assert . assertTrue ( ( ( content [ 0 ] ) != null ) ) |
registerBusinessUserTest ( ) { com . venefica . service . dto . BusinessCategoryDto category = client . getAllBusinessCategories ( ) . get ( 0 ) ; com . venefica . service . dto . UserDto testBusinessUserDto = com . venefica . service . UserManagementServiceTest . createBusinessUserDto ( com . venefica . service . UserManagementServiceTest . TEST_BUSINESS_NAME , category . getId ( ) ) ; client . registerBusinessUser ( testBusinessUserDto , com . venefica . service . UserManagementServiceTest . TEST_PASSWORD ) ; authenticateClientAsFirstUser ( ) ; com . venefica . service . dto . UserDto userDto = client . getUserByEmail ( testBusinessUserDto . getEmail ( ) ) ; "<AssertPlaceHolder>" ; } getEmail ( ) { return email ; } | org . junit . Assert . assertTrue ( ( userDto != null ) ) |
testTranscriptDuplicationOma1 ( ) { final java . lang . String outPath = runJannovarOnVCFLine ( "/sv_header.vcf" , "1\t58929877\t.\tN\t<DUP:TANDEM>\t.\t.\tSVTYPE=DUP;END=59028960" ) ; final java . lang . String expected = "1\t58929877\t.\tN\t<DUP:TANDEM>\t.\t.\tEND=59028960;" + ( "SVANN=transcript_amplification&direct_tandem_duplication&structural_variant&coding_transcript_variant" + "|HIGH|OMA1|115209|transcript|NM_145243.3|Coding|;SVTYPE=DUP" ) ; final java . lang . String actual = loadVcfBody ( outPath ) ; "<AssertPlaceHolder>" ; } loadVcfBody ( java . lang . String ) { return java . util . Arrays . asList ( com . google . common . io . Files . asCharSource ( new de . charite . compbio . jannovar . cmd . annotate_vcf . File ( outPath ) , Charsets . UTF_8 ) . read ( ) . split ( "\r?\n" ) ) . stream ( ) . filter ( ( line ) -> ! ( line . startsWith ( "#" ) ) ) . collect ( java . util . stream . Collectors . joining ( ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetters ( ) { org . ff4j . property . store . InMemoryPropertyStore ips = new org . ff4j . property . store . InMemoryPropertyStore ( ) ; ips . setLocation ( "test-ff4j-features.xml" ) ; ips . setFileName ( "invalid.xml" ) ; "<AssertPlaceHolder>" ; } getFileName ( ) { return fileName ; } | org . junit . Assert . assertEquals ( "invalid.xml" , ips . getFileName ( ) ) |
testCategoriesRoot ( ) { javax . jcr . Node rootCategory = org . jahia . services . categories . Category . getCategoriesRoot ( ) ; "<AssertPlaceHolder>" ; } getCategoriesRoot ( ) { return org . jahia . services . categories . Category . getCategoriesRoot ( org . jahia . services . content . JCRSessionFactory . getInstance ( ) . getCurrentUser ( ) ) ; } | org . junit . Assert . assertNotNull ( rootCategory ) |
testUnwrapForObjectTypes ( ) { for ( Map . Entry < java . lang . Class < ? > , java . lang . Class < ? > > entry : cz . zcu . kiv . jop . util . PrimitiveUtilsTest . primitivesMap . entrySet ( ) ) { "<AssertPlaceHolder>" ; } } unwrap ( java . lang . Class ) { if ( clazz == null ) { return null ; } if ( clazz . isPrimitive ( ) ) { return clazz ; } if ( ! ( cz . zcu . kiv . jop . util . PrimitiveUtils . isWrapper ( clazz ) ) ) { return clazz ; } java . lang . String name = clazz . getName ( ) ; int c10 = name . charAt ( 10 ) ; int c12 = name . charAt ( 12 ) ; int mapper = ( ( ( c10 + c10 ) + c10 ) + 5 ) & ( 118 - c12 ) ; return cz . zcu . kiv . jop . util . PrimitiveUtils . primitives . get ( mapper ) ; } | org . junit . Assert . assertEquals ( entry . getKey ( ) , cz . zcu . kiv . jop . util . PrimitiveUtils . unwrap ( entry . getValue ( ) ) ) |
testRemoveListener ( ) { com . sonymobile . tools . gerrit . gerritevents . GerritEventListener listenerMock = mock ( com . sonymobile . tools . gerrit . gerritevents . GerritEventListener . class ) ; handler . addListener ( listenerMock ) ; handler . removeListener ( listenerMock ) ; java . util . Collection < com . sonymobile . tools . gerrit . gerritevents . GerritEventListener > gerritEventListeners = org . powermock . reflect . Whitebox . getInternalState ( handler , "gerritEventListeners" ) ; "<AssertPlaceHolder>" ; } removeListener ( com . sonymobile . tools . gerrit . gerritevents . GerritEventListener ) { synchronized ( this ) { gerritEventListeners . remove ( listener ) ; } } | org . junit . Assert . assertTrue ( gerritEventListeners . isEmpty ( ) ) |
testSetObject ( ) { org . apache . qpid . jms . message . JmsObjectMessage msg = factory . createObjectMessage ( ) ; java . lang . String str = "testText" ; msg . setObject ( str ) ; "<AssertPlaceHolder>" ; } getObject ( ) { try { return this . facade . getObject ( ) ; } catch ( java . lang . Exception e ) { throw new javax . jms . MessageFormatException ( "Failed<sp>to<sp>read<sp>object" ) ; } } | org . junit . Assert . assertEquals ( str , msg . getObject ( ) ) |
testConvertAll ( ) { java . lang . Long id = 1L ; java . lang . String abbrName = "abbr<sp>Name" ; java . lang . String name = "n<sp>a<sp>m<sp>e" ; org . lnu . is . domain . gender . type . GenderType source = new org . lnu . is . domain . gender . type . GenderType ( ) ; source . setId ( id ) ; source . setAbbrName ( abbrName ) ; source . setName ( name ) ; java . util . List < org . lnu . is . domain . gender . type . GenderType > sources = java . util . Arrays . asList ( source ) ; org . lnu . is . resource . gender . type . GenderTypeResource expected = new org . lnu . is . resource . gender . type . GenderTypeResource ( ) ; expected . setId ( id ) ; expected . setAbbrName ( abbrName ) ; expected . setName ( name ) ; java . util . List < org . lnu . is . resource . gender . type . GenderTypeResource > expecteds = java . util . Arrays . asList ( expected ) ; java . util . List < org . lnu . is . resource . gender . type . GenderTypeResource > actuals = unit . convertAll ( sources ) ; "<AssertPlaceHolder>" ; } convertAll ( java . util . List ) { return convertAll ( sources , new java . util . ArrayList < TARGET > ( sources . size ( ) ) ) ; } | org . junit . Assert . assertEquals ( expecteds , actuals ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.