input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testListOrders_Cancelled ( ) { try { java . lang . String filter = getTestRunMessageValue ( "cancelledOrdersFilter" ) ; upsertOnTestRunMessage ( "filter" , filter ) ; java . util . List < org . mule . module . magento . automation . testcases . SalesOrderListEntity > orders = runFlowAndGetPayload ( "list-orders" ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( org . mule . modules . tests . ConnectorTestUtils . getStackTrace ( e ) ) ; } } | org . junit . Assert . assertTrue ( orders . isEmpty ( ) ) |
testEmptyArray ( ) { com . aliyun . odps . mapred . conf . JobConf conf = new com . aliyun . odps . mapred . conf . JobConf ( ) ; conf . setOutputKeySortColumns ( new java . lang . String [ 0 ] ) ; "<AssertPlaceHolder>" ; } getOutputKeySortColumns ( ) { java . lang . String joined = get ( CONF . OUTPUT_KEY_SORT_COLUMNS , null ) ; if ( ( joined == null ) || ( joined . isEmpty ( ) ) ) { return com . aliyun . odps . mapred . utils . SchemaUtils . getNames ( getMapOutputKeySchema ( ) ) ; } return joined . split ( "," ) ; } | org . junit . Assert . assertArrayEquals ( new java . lang . String [ 0 ] , conf . getOutputKeySortColumns ( ) ) |
get_partitions_by_expr ( ) { org . apache . hadoop . hive . metastore . api . PartitionsByExprRequest req = new org . apache . hadoop . hive . metastore . api . PartitionsByExprRequest ( ) ; req . setDbName ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P ) ; org . apache . hadoop . hive . metastore . api . PartitionsByExprRequest inbound = new org . apache . hadoop . hive . metastore . api . PartitionsByExprRequest ( ) ; org . apache . hadoop . hive . metastore . api . PartitionsByExprResult partitionResult = new org . apache . hadoop . hive . metastore . api . PartitionsByExprResult ( ) ; org . apache . hadoop . hive . metastore . api . PartitionsByExprResult outbound = new org . apache . hadoop . hive . metastore . api . PartitionsByExprResult ( ) ; when ( primaryMapping . transformInboundPartitionsByExprRequest ( req ) ) . thenReturn ( inbound ) ; when ( primaryClient . get_partitions_by_expr ( inbound ) ) . thenReturn ( partitionResult ) ; when ( primaryMapping . transformOutboundPartitionsByExprResult ( partitionResult ) ) . thenReturn ( outbound ) ; org . apache . hadoop . hive . metastore . api . PartitionsByExprResult result = handler . get_partitions_by_expr ( req ) ; "<AssertPlaceHolder>" ; verify ( primaryMapping , never ( ) ) . checkWritePermissions ( com . hotels . bdp . waggledance . server . FederatedHMSHandlerTest . DB_P ) ; } get_partitions_by_expr ( org . apache . hadoop . hive . metastore . api . PartitionsByExprRequest ) { com . hotels . bdp . waggledance . mapping . model . DatabaseMapping mapping = databaseMappingService . databaseMapping ( req . getDbName ( ) ) ; org . apache . hadoop . hive . metastore . api . PartitionsByExprResult result = mapping . getClient ( ) . get_partitions_by_expr ( mapping . transformInboundPartitionsByExprRequest ( req ) ) ; return mapping . transformOutboundPartitionsByExprResult ( result ) ; } | org . junit . Assert . assertThat ( result , org . hamcrest . CoreMatchers . is ( outbound ) ) |
testCheckListPathValid ( ) { org . provebit . merkle . FileMerkle mtree = new org . provebit . merkle . FileMerkle ( HashType . SHA256 ) ; mtree . addTracking ( org . provebit . merkle . FileMerkleTest . completeDirPath , false ) ; mtree . makeTree ( ) ; byte [ ] [ ] tree = mtree . getTree ( ) ; byte [ ] startingHash = tree [ 9 ] ; java . util . List < org . provebit . merkle . MerklePathStep > path = mtree . findPath ( startingHash ) ; "<AssertPlaceHolder>" ; } checkPath ( java . util . List ) { boolean validPath = ( this . height ) == ( path . size ( ) ) ; if ( validPath && ( ( path . size ( ) ) > 0 ) ) { byte [ ] currentHash = path . get ( 0 ) . getHash ( ) ; if ( existsAsLeaf ( currentHash ) ) { int treeIndex = findLeafIndex ( currentHash ) ; for ( int listIndex = 0 ; ( listIndex < ( path . size ( ) ) ) && validPath ; listIndex ++ ) { boolean correctSide = ( isLeftNode ( treeIndex ) ) == ( path . get ( listIndex ) . onLeft ( ) ) ; boolean correctHash = java . util . Arrays . equals ( tree [ treeIndex ] , path . get ( listIndex ) . getHash ( ) ) ; if ( ( ! correctSide ) || ( ! correctHash ) ) { validPath = false ; } treeIndex = getSibling ( getParent ( treeIndex ) ) ; } } else { validPath = false ; } } return validPath ; } | org . junit . Assert . assertTrue ( mtree . checkPath ( path ) ) |
testThatTagNodeIsNotTerseIfTempalteSettingIsNotTerse ( ) { template . setMode ( Jade4J . Mode . XHTML ) ; for ( int i = 0 ; i < ( selfClosing . length ) ; i ++ ) { tagNode . setName ( selfClosing [ i ] ) ; "<AssertPlaceHolder>" ; } } isTerse ( de . neuland . jade4j . template . JadeTemplate ) { return ( isSelfClosing ( template ) ) && ( template . isTerse ( ) ) ; } | org . junit . Assert . assertFalse ( tagNode . isTerse ( template ) ) |
testComputeJTSPeerWithGeometry ( ) { com . vividsolutions . jts . geom . GeometryFactory fac = new com . vividsolutions . jts . geom . GeometryFactory ( ) ; com . vividsolutions . jts . geom . Geometry toWrap = fac . createPoint ( new com . vividsolutions . jts . geom . Coordinate ( 0 , 0 ) ) ; toTest = new ddf . catalog . impl . filter . JTSGeometryWrapper ( toWrap ) ; "<AssertPlaceHolder>" ; } computeJTSPeer ( ) { return geo ; } | org . junit . Assert . assertEquals ( toWrap , toTest . computeJTSPeer ( ) ) |
getArrayFormulaRange_returnsNull ( ) { org . apache . poi . ss . usermodel . Cell cell = new org . apache . poi . xssf . streaming . SXSSFCell ( null , org . apache . poi . ss . usermodel . CellType . BLANK ) ; org . apache . poi . ss . util . CellRangeAddress result = cell . getArrayFormulaRange ( ) ; "<AssertPlaceHolder>" ; } getArrayFormulaRange ( ) { org . apache . poi . xssf . usermodel . XSSFCell cell = getSheet ( ) . getFirstCellInArrayFormula ( this ) ; if ( cell == null ) { throw new java . lang . IllegalStateException ( ( ( "Cell<sp>" + ( new org . apache . poi . ss . util . CellReference ( this ) . formatAsString ( ) ) ) + "<sp>is<sp>not<sp>part<sp>of<sp>an<sp>array<sp>formula." ) ) ; } java . lang . String formulaRef = cell . _cell . getF ( ) . getRef ( ) ; return org . apache . poi . ss . util . CellRangeAddress . valueOf ( formulaRef ) ; } | org . junit . Assert . assertNull ( result ) |
deveObterCodigoStatusComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . NFInfoEventoRetorno eventoRetorno = new com . fincatto . documentofiscal . nfe400 . classes . evento . NFInfoEventoRetorno ( ) ; final int codigoStatus = 100 ; eventoRetorno . setCodigoStatus ( codigoStatus ) ; "<AssertPlaceHolder>" ; } getCodigoStatus ( ) { return this . codigoStatus ; } | org . junit . Assert . assertEquals ( codigoStatus , eventoRetorno . getCodigoStatus ( ) , 0 ) |
testGetDescriptionWithZero ( ) { final java . lang . String string = org . apache . commons . imaging . formats . psd . ImageResourceType . getDescription ( 0 ) ; "<AssertPlaceHolder>" ; } getDescription ( int ) { for ( final org . apache . commons . imaging . formats . psd . ImageResourceType type : org . apache . commons . imaging . formats . psd . ImageResourceType . TYPES ) { if ( ( ( type . from ) <= id ) && ( id <= ( type . to ) ) ) { return type . description ; } } return "Unknown" ; } | org . junit . Assert . assertEquals ( "Unknown" , string ) |
addToEmptyDocumentTest ( ) { org . apache . cxf . ws . transfer . manager . ResourceManager resourceManager = new org . apache . cxf . ws . transfer . manager . MemoryResourceManager ( ) ; org . apache . cxf . ws . addressing . ReferenceParametersType refParams = resourceManager . create ( new org . apache . cxf . ws . transfer . Representation ( ) ) ; org . apache . cxf . endpoint . Server resource = createLocalResource ( resourceManager ) ; org . apache . cxf . ws . transfer . resource . Resource client = createClient ( refParams ) ; org . apache . cxf . ws . transfer . Put request = new org . apache . cxf . ws . transfer . Put ( ) ; request . setDialect ( FragmentDialectConstants . FRAGMENT_2011_03_IRI ) ; org . apache . cxf . ws . transfer . dialect . fragment . Fragment fragment = new org . apache . cxf . ws . transfer . dialect . fragment . Fragment ( ) ; org . apache . cxf . ws . transfer . dialect . fragment . ExpressionType expression = new org . apache . cxf . ws . transfer . dialect . fragment . ExpressionType ( ) ; expression . setLanguage ( FragmentDialectConstants . XPATH10_LANGUAGE_IRI ) ; expression . setMode ( FragmentDialectConstants . FRAGMENT_MODE_ADD ) ; expression . getContent ( ) . add ( "/" ) ; org . w3c . dom . Element addedElement = org . apache . cxf . helpers . DOMUtils . getEmptyDocument ( ) . createElement ( "a" ) ; org . apache . cxf . ws . transfer . dialect . fragment . ValueType value = new org . apache . cxf . ws . transfer . dialect . fragment . ValueType ( ) ; value . getContent ( ) . add ( addedElement ) ; fragment . setExpression ( expression ) ; fragment . setValue ( value ) ; request . getAny ( ) . add ( fragment ) ; org . apache . cxf . ws . transfer . PutResponse response = client . put ( request ) ; org . w3c . dom . Element rootEl = ( ( org . w3c . dom . Element ) ( response . getRepresentation ( ) . getAny ( ) ) ) ; "<AssertPlaceHolder>" ; resource . destroy ( ) ; } getNodeName ( ) { return null ; } | org . junit . Assert . assertEquals ( "a" , rootEl . getNodeName ( ) ) |
testEndedLineVar ( ) { org . pentaho . di . trans . steps . textfileoutput . TextFileOutputData data = new org . pentaho . di . trans . steps . textfileoutput . TextFileOutputData ( ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; data . writer = baos ; org . pentaho . di . trans . steps . textfileoutput . TextFileOutputMeta meta = new org . pentaho . di . trans . steps . textfileoutput . TextFileOutputMeta ( ) ; meta . setEndedLine ( "${endvar}" ) ; meta . setDefault ( ) ; meta . setEncoding ( "UTF-8" ) ; stepMockHelper . stepMeta . setStepMetaInterface ( meta ) ; org . pentaho . di . trans . steps . textfileoutput . TextFileOutput textFileOutput = new org . pentaho . di . trans . steps . textfileoutput . TextFileOutputTest . TextFileOutputTestHandler ( stepMockHelper . stepMeta , data , 0 , stepMockHelper . transMeta , stepMockHelper . trans ) ; textFileOutput . meta = meta ; textFileOutput . data = data ; textFileOutput . setVariable ( "endvar" , "this<sp>is<sp>the<sp>end" ) ; textFileOutput . writeEndedLine ( ) ; "<AssertPlaceHolder>" ; } toString ( boolean ) { java . lang . String retval ; switch ( getType ( ) ) { case org . pentaho . di . compatibility . Value . VALUE_TYPE_STRING : retval = toStringString ( pad ) ; break ; case org . pentaho . di . compatibility . Value . VALUE_TYPE_INTEGER : retval = toStringInteger ( pad ) ; break ; case org . pentaho . di . compatibility . Value . VALUE_TYPE_NUMBER : retval = toStringNumber ( pad ) ; break ; case org . pentaho . di . compatibility . Value . VALUE_TYPE_DATE : retval = toStringDate ( ) ; break ; case org . pentaho . di . compatibility . Value . VALUE_TYPE_BOOLEAN : retval = toStringBoolean ( ) ; break ; case org . pentaho . di . compatibility . Value . VALUE_TYPE_BIGNUMBER : retval = toStringBigNumber ( ) ; break ; case org . pentaho . di . compatibility . Value . VALUE_TYPE_BINARY : retval = toStringBinary ( ) ; break ; default : retval = "" ; break ; } return retval ; } | org . junit . Assert . assertEquals ( "this<sp>is<sp>the<sp>end" , baos . toString ( "UTF-8" ) ) |
testIsEmpty ( ) { "<AssertPlaceHolder>" ; } emptyBag ( ) { return ( ( org . kocakosm . pitaya . collection . Bag < E > ) ( org . kocakosm . pitaya . collection . Bags . EMPTY_BAG ) ) ; } | org . junit . Assert . assertTrue ( org . kocakosm . pitaya . collection . Bags . emptyBag ( ) . isEmpty ( ) ) |
deleteAllRatingsInComponentInstance ( ) { org . silverpeas . core . persistence . Transaction . performInOne ( ( ) -> { repository . deleteAllRatingsInComponentInstance ( "kmelia12" ) ; return null ; } ) ; java . util . List < org . silverpeas . core . contribution . rating . model . Rating > ratings = org . silverpeas . core . contribution . rating . model . RatingFinder . getSomeByQuery ( "from<sp>Rating<sp>where<sp>instanceId<sp>=<sp>'kmelia12'" ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { if ( ( ( entries ) == null ) || ( entries . isEmpty ( ) ) ) { return true ; } for ( org . silverpeas . web . pdc . vo . FacetEntryVO entry : entries ) { if ( ( entry . getNbElt ( ) ) > 0 ) { return false ; } } return true ; } | org . junit . Assert . assertThat ( ratings . isEmpty ( ) , org . hamcrest . Matchers . is ( true ) ) |
getTopicsPendingModerationForumIsNotModeratedShouldReturnEmptyList ( ) { net . jforum . entities . Forum forum = new net . jforum . entities . Forum ( ) ; forum . setModerated ( false ) ; "<AssertPlaceHolder>" ; } getTopicsPendingModeration ( ) { final net . jforum . entities . Forum forum = new net . jforum . entities . Forum ( repository ) ; forum . setModerated ( true ) ; forum . getTopicsPendingModeration ( ) ; verify ( repository ) . getTopicsPendingModeration ( forum ) ; } | org . junit . Assert . assertEquals ( 0 , forum . getTopicsPendingModeration ( ) . size ( ) ) |
testNoError ( ) { com . streamsets . pipeline . lib . remote . RemoteConnector connector = getConnector ( getBean ( ( ( ( ( getScheme ( ) ) + "://localhost:" ) + ( port ) ) + "/" ) , true , false , com . streamsets . pipeline . lib . remote . TESTUSER , com . streamsets . pipeline . lib . remote . TESTPASS , null , null , null , true , null ) ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = initWithNoIssues ( connector ) ; "<AssertPlaceHolder>" ; verifyConnection ( connector ) ; connector . close ( ) ; } size ( ) { return delegate . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , issues . size ( ) ) |
testUnwrappedWithAny ( ) { final com . fasterxml . jackson . dataformat . xml . XmlMapper mapper = new com . fasterxml . jackson . dataformat . xml . XmlMapper ( ) ; final java . lang . String xml = "<xml>\n" + ( ( ( ( ( ( "<type>type</type>\n" + "<x>10</x>\n" ) + "<y>10</y>\n" ) + "<k1>k1</k1>\n" ) + "<k2>k1</k2>\n" ) + "<k3>k1</k3>\n" ) + "</xml>" ) ; com . riversoft . weixin . pay . payment . AnySetter349Test . Bean349 value = mapper . readValue ( xml , com . riversoft . weixin . pay . payment . AnySetter349Test . Bean349 . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( value ) |
shouldRaiseConstraintViolationCausePriceLow ( ) { org . agoncal . book . javaee7 . chapter03 . ex01 . Book01 book = new org . agoncal . book . javaee7 . chapter03 . ex01 . Book01 ( "H2G2" , 0.5F , "Best<sp>IT<sp>Scifi<sp>Book" , "1234-4566-9876" , 247 , false ) ; java . util . Set < javax . validation . ConstraintViolation < org . agoncal . book . javaee7 . chapter03 . ex01 . Book01 > > violations = org . agoncal . book . javaee7 . chapter03 . ex01 . Book01Test . validator . validate ( book ) ; displayContraintViolations ( violations ) ; "<AssertPlaceHolder>" ; } displayContraintViolations ( java . util . Set ) { for ( org . agoncal . book . javaee7 . chapter03 . ex12 . ConstraintViolation constraintViolation : constraintViolations ) { System . out . println ( ( ( ( ( ( ( ( "###<sp>" + ( constraintViolation . getRootBeanClass ( ) . getSimpleName ( ) ) ) + "." ) + ( constraintViolation . getPropertyPath ( ) ) ) + "<sp>-<sp>Invalid<sp>Value<sp>=<sp>" ) + ( constraintViolation . getInvalidValue ( ) ) ) + "<sp>-<sp>Error<sp>Msg<sp>=<sp>" ) + ( constraintViolation . getMessage ( ) ) ) ) ; } } | org . junit . Assert . assertEquals ( 1 , violations . size ( ) ) |
testVDBRespositoryGetActive ( ) { org . teiid . deployers . VDBRepository repo = new org . teiid . deployers . VDBRepository ( ) ; org . teiid . deployers . CompositeVDB mock1 = org . mockito . Mockito . mock ( org . teiid . deployers . CompositeVDB . class ) ; org . teiid . adminapi . impl . VDBMetaData vdb = new org . teiid . adminapi . impl . VDBMetaData ( ) ; vdb . setName ( "name" ) ; vdb . setVersion ( 1 ) ; vdb . setConnectionType ( ConnectionType . NONE ) ; org . mockito . Mockito . stub ( mock1 . getVDB ( ) ) . toReturn ( vdb ) ; repo . getVdbRepo ( ) . put ( new org . teiid . vdb . runtime . VDBKey ( "name" , 1 ) , mock1 ) ; org . teiid . deployers . CompositeVDB mock2 = org . mockito . Mockito . mock ( org . teiid . deployers . CompositeVDB . class ) ; org . teiid . adminapi . impl . VDBMetaData vdb2 = new org . teiid . adminapi . impl . VDBMetaData ( ) ; vdb2 . setName ( "name" ) ; vdb2 . setVersion ( 2 ) ; vdb2 . setConnectionType ( ConnectionType . NONE ) ; org . mockito . Mockito . stub ( mock2 . getVDB ( ) ) . toReturn ( vdb2 ) ; repo . getVdbRepo ( ) . put ( new org . teiid . vdb . runtime . VDBKey ( "name" , 2 ) , mock2 ) ; org . teiid . adminapi . impl . VDBMetaData live = repo . getLiveVDB ( "name" ) ; "<AssertPlaceHolder>" ; } getVersion ( ) { if ( ( this . version ) != null ) { java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; java . util . List < java . lang . String > parts = org . teiid . core . util . StringUtil . split ( this . version , "." ) ; for ( int i = 0 ; i < ( parts . size ( ) ) ; i ++ ) { if ( i > 0 ) { builder . append ( '.' ) ; } java . lang . String part = parts . get ( i ) ; if ( ( ( part . length ( ) ) < 2 ) && ( java . lang . Character . isDigit ( part . charAt ( 0 ) ) ) ) { builder . append ( '0' ) ; } builder . append ( part ) ; } return builder . toString ( ) ; } return this . version ; } | org . junit . Assert . assertEquals ( "2" , live . getVersion ( ) ) |
testDefaultNullValues ( ) { java . lang . Integer value = ofInteger ( ) . get ( Config . EMPTY , null ) ; "<AssertPlaceHolder>" ; } get ( io . datakernel . config . Config , io . datakernel . config . ConfigsModuleTest$TestClass ) { io . datakernel . config . ConfigsModuleTest . TestClass testClass = new io . datakernel . config . ConfigsModuleTest . TestClass ( ) ; testClass . field1 = config . get ( ofInteger ( ) , "field1" ) ; testClass . field2 = config . get ( ofDouble ( ) , "field2" ) ; testClass . field3 = config . get ( ofBoolean ( ) , "field3" ) ; return testClass ; } | org . junit . Assert . assertNull ( value ) |
testGenericMethodFromReturnValue ( ) { java . lang . Class < ? > targetClass = com . examples . with . different . packagename . generic . GenericMethodWithBounds . class ; java . lang . reflect . Method targetMethod = targetClass . getMethod ( "is" , new java . lang . Class < ? > [ ] { org . evosuite . utils . Comparable . class } ) ; org . evosuite . utils . generic . GenericMethod genericMethod = new org . evosuite . utils . generic . GenericMethod ( targetMethod , targetClass ) ; org . evosuite . utils . generic . GenericClass generatedType = new org . evosuite . utils . generic . GenericClass ( new com . googlecode . gentyref . TypeToken < java . util . List < java . lang . Integer > > ( ) { } . getType ( ) ) ; org . evosuite . utils . generic . GenericMethod instantiatedMethod = genericMethod . getGenericInstantiationFromReturnValue ( generatedType ) ; "<AssertPlaceHolder>" ; } getGeneratedClass ( ) { return generatedType ; } | org . junit . Assert . assertEquals ( instantiatedMethod . getGeneratedClass ( ) , generatedType ) |
testGetLength ( ) { mockHelper . replayAll ( ) ; classUnderTest . setEndPosition ( 10 ) ; "<AssertPlaceHolder>" ; mockHelper . verifyAll ( ) ; } getLength ( ) { return ( ( endPosition ) - ( startPosition ) ) + 1 ; } | org . junit . Assert . assertEquals ( 12 , classUnderTest . getLength ( ) ) |
compareToLesserValue ( ) { final java . nio . file . Path path = fileSystem . getPath ( "/toplevel/b" ) ; final java . lang . String otherName = "/toplevel/a" ; final java . nio . file . Path other = fileSystem . getPath ( otherName ) ; final int compare = path . compareTo ( other ) ; "<AssertPlaceHolder>" ; } compareTo ( org . jboss . shrinkwrap . api . ArchivePath ) { if ( path == null ) { return 1 ; } final org . jboss . shrinkwrap . api . ArchivePath parentOfSpecified = org . jboss . shrinkwrap . impl . base . path . PathUtil . getParent ( path ) ; final org . jboss . shrinkwrap . api . ArchivePath parentOfThis = org . jboss . shrinkwrap . impl . base . path . PathUtil . getParent ( this ) ; if ( this . equals ( parentOfSpecified ) ) { return - 1 ; } if ( path . equals ( parentOfThis ) ) { return 1 ; } final int comparedContexts = path . get ( ) . compareTo ( this . get ( ) ) ; final int adjusted = 0 - comparedContexts ; return adjusted ; } | org . junit . Assert . assertEquals ( 1 , compare ) |
loadBlobAndSave_theResultBlobIdShouldBeTheSame ( ) { org . eclipse . jgit . lib . ObjectId loaded = writeSomethingToCache ( ) ; org . eclipse . jgit . lib . ObjectId saved = com . beijunyi . parallelgit . utils . io . BlobSnapshot . load ( loaded , repo ) . save ( repo ) ; "<AssertPlaceHolder>" ; } save ( com . beijunyi . parallelgit . utils . io . ObjectInserter ) { return inserter . insert ( com . beijunyi . parallelgit . utils . io . OBJ_BLOB , getData ( ) ) ; } | org . junit . Assert . assertEquals ( loaded , saved ) |
testSimpleWithDecimalsTrunc ( ) { org . apache . commons . math4 . geometry . euclidean . twod . Cartesian2D c = new org . apache . commons . math4 . geometry . euclidean . twod . Cartesian2D ( 1.232323232323 , 1.434343434343 ) ; java . lang . String expected = ( ( ( "{1" + ( getDecimalCharacter ( ) ) ) + "2323232323;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "4343434343}" ; java . lang . String actual = vector2DFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testOwnerQuery ( ) { org . nuxeo . ecm . automation . OperationContext ctx = new org . nuxeo . ecm . automation . OperationContext ( session ) ; java . util . Map < java . lang . String , java . lang . Object > params = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; params . put ( "query" , "FROM<sp>LogEntry<sp>log<sp>WHERE<sp>log.principalName=?" ) ; params . put ( "pageSize" , org . nuxeo . ecm . automation . core . test . TestDocumentAuditPageProviderOperation . MAX_ENTRIES ) ; params . put ( "maxResults" , org . nuxeo . ecm . automation . core . test . TestDocumentAuditPageProviderOperation . MAX_ENTRIES ) ; params . put ( "currentPageIndex" , 0 ) ; org . nuxeo . ecm . automation . core . util . StringList queryParams = new org . nuxeo . ecm . automation . core . util . StringList ( ) ; queryParams . add ( "$currentUser" ) ; params . put ( "queryParams" , queryParams ) ; java . util . List < org . nuxeo . ecm . platform . audit . api . LogEntry > entries = ( ( java . util . List < org . nuxeo . ecm . platform . audit . api . LogEntry > ) ( service . run ( ctx , AuditPageProviderOperation . ID , params ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return vars . size ( ) ; } | org . junit . Assert . assertTrue ( ( ( entries . size ( ) ) > 0 ) ) |
testLowest ( ) { org . bukkit . Note note = new org . bukkit . Note ( 0 , Note . Tone . F , true ) ; "<AssertPlaceHolder>" ; } getId ( ) { return this . id ; } | org . junit . Assert . assertEquals ( note . getId ( ) , ( ( byte ) ( 0 ) ) ) |
appliesCredentialsIfConfigured ( ) { org . appenders . log4j2 . elasticsearch . Credentials < org . elasticsearch . common . settings . Settings . Builder > credentials = org . mockito . Mockito . mock ( org . appenders . log4j2 . elasticsearch . Credentials . class ) ; org . elasticsearch . common . settings . Settings . Builder settingsBuilder = org . elasticsearch . common . settings . Settings . builder ( ) ; org . appenders . log4j2 . elasticsearch . bulkprocessor . ShieldAuth shieldAuth = org . appenders . log4j2 . elasticsearch . bulkprocessor . ShieldAuthTest . createTestBuilder ( ) . withCredentials ( credentials ) . build ( ) ; shieldAuth . configure ( settingsBuilder ) ; org . mockito . Mockito . verify ( credentials ) . applyTo ( builderArgumentCaptor . capture ( ) ) ; "<AssertPlaceHolder>" ; } applyTo ( org . elasticsearch . common . settings . Settings$Builder ) { clientConfigBuilder . put ( org . appenders . log4j2 . elasticsearch . bulkprocessor . JKSCertInfo . SHIELD_TRANSPORT_SSL_ENABLED , "true" ) ; if ( ( keystorePath ) != null ) { clientConfigBuilder . put ( org . appenders . log4j2 . elasticsearch . bulkprocessor . JKSCertInfo . SHIELD_SSL_KEYSTORE_PATH , keystorePath ) ; } if ( ( truststorePath ) != null ) { clientConfigBuilder . put ( org . appenders . log4j2 . elasticsearch . bulkprocessor . JKSCertInfo . SHIELD_SSL_TRUSTSTORE_PATH , truststorePath ) ; } clientConfigBuilder . put ( org . appenders . log4j2 . elasticsearch . bulkprocessor . JKSCertInfo . SHIELD_SSL_KEYSTORE_PASSWORD , keystorePassword ) ; clientConfigBuilder . put ( org . appenders . log4j2 . elasticsearch . bulkprocessor . JKSCertInfo . SHIELD_SSL_TRUSTSTORE_PASSWORD , truststorePassword ) ; } | org . junit . Assert . assertEquals ( settingsBuilder , builderArgumentCaptor . getValue ( ) ) |
testSendMessageOnResume ( ) { org . apache . cxf . transport . jms . continuations . Counter continuations = new org . apache . cxf . transport . jms . continuations . JMSContinuationTest . DummyCounter ( ) ; org . apache . cxf . transport . jms . continuations . JMSContinuation cw = new org . apache . cxf . transport . jms . continuations . JMSContinuation ( b , m , observer , continuations ) ; cw . suspend ( 5000 ) ; "<AssertPlaceHolder>" ; observer . onMessage ( m ) ; org . easymock . EasyMock . expectLastCall ( ) ; org . easymock . EasyMock . replay ( observer ) ; cw . resume ( ) ; org . easymock . EasyMock . verify ( observer ) ; } suspend ( javax . ws . rs . container . AsyncResponse ) { org . apache . cxf . systest . jaxrs . AsyncResource . ASYNC_RESPONSES [ 0 ] . add ( asyncResponse ) ; } | org . junit . Assert . assertFalse ( cw . suspend ( 1000 ) ) |
testRepeatedRuleLabelInLexer ( ) { java . lang . String grammar = "lexer<sp>grammar<sp>T;\n" + ( "B<sp>:<sp>x=A<sp>x=A<sp>;\n" + "fragment<sp>A<sp>:<sp>\'a\'<sp>;\n" ) ; boolean found = rawGenerateAndBuildRecognizer ( "T.g" , grammar , null , "T" , false ) ; boolean expecting = true ; "<AssertPlaceHolder>" ; } rawGenerateAndBuildRecognizer ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , boolean ) { boolean allIsWell = antlr ( grammarFileName , grammarFileName , grammarStr , debug ) ; if ( ! allIsWell ) { return false ; } if ( lexerName != null ) { boolean ok ; if ( parserName != null ) { ok = compile ( ( parserName + ".java" ) ) ; if ( ! ok ) { allIsWell = false ; } } ok = compile ( ( lexerName + ".java" ) ) ; if ( ! ok ) { allIsWell = false ; } } else { boolean ok = compile ( ( parserName + ".java" ) ) ; if ( ! ok ) { allIsWell = false ; } } return allIsWell ; } | org . junit . Assert . assertEquals ( expecting , found ) |
testBuildColumnInfoList_ContainingNulls ( ) { java . util . List < org . apache . phoenix . util . ColumnInfo > columnInfoListWithNull = com . google . common . collect . Lists . newArrayList ( new org . apache . phoenix . util . ColumnInfo ( "idCol" , PInteger . INSTANCE . getSqlType ( ) ) , null , new org . apache . phoenix . util . ColumnInfo ( "unsignedIntCol" , PUnsignedInt . INSTANCE . getSqlType ( ) ) , new org . apache . phoenix . util . ColumnInfo ( "stringArrayCol" , PIntegerArray . INSTANCE . getSqlType ( ) ) ) ; org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( ) ; org . apache . phoenix . mapreduce . CsvToKeyValueMapper . configureColumnInfoList ( conf , columnInfoListWithNull ) ; java . util . List < org . apache . phoenix . util . ColumnInfo > fromConfig = org . apache . phoenix . mapreduce . CsvToKeyValueMapper . buildColumnInfoList ( conf ) ; "<AssertPlaceHolder>" ; } buildColumnInfoList ( org . apache . hadoop . conf . Configuration ) { return com . google . common . collect . Lists . newArrayList ( com . google . common . collect . Iterables . transform ( com . google . common . base . Splitter . on ( "|" ) . split ( conf . get ( org . apache . phoenix . mapreduce . CsvToKeyValueMapper . COLUMN_INFO_CONFKEY ) ) , new com . google . common . base . Function < java . lang . String , org . apache . phoenix . util . ColumnInfo > ( ) { @ javax . annotation . Nullable @ org . apache . phoenix . mapreduce . Override public org . apache . phoenix . util . ColumnInfo apply ( @ javax . annotation . Nullable java . lang . String input ) { if ( input . isEmpty ( ) ) { return null ; } return org . apache . phoenix . util . ColumnInfo . fromString ( input ) ; } } ) ) ; } | org . junit . Assert . assertEquals ( columnInfoListWithNull , fromConfig ) |
test_convertNumberToRomanNumeral ( ) { java . lang . String five = com . levelup . java . exercises . beginner . RomanNumerals . convertNumberToRomanNumeral ( 5 ) ; "<AssertPlaceHolder>" ; } convertNumberToRomanNumeral ( java . lang . Integer ) { switch ( number ) { case 1 : return "I" ; case 2 : return "II" ; case 3 : return "X" 0 ; case 4 : return "IV" ; case 5 : return "V" ; case 6 : return "VI" ; case 7 : return "VII" ; case 8 : return "VIII" ; case 9 : return "IX" ; case 10 : return "X" ; default : return "Invalid<sp>number." ; } } | org . junit . Assert . assertEquals ( "V" , five ) |
shouldReturnNotEqualForDifferentBaseObjectId3 ( ) { org . eclipse . egit . ui . internal . synchronize . model . GitModelBlob left = createGitModelBlob ( zeroId ( ) , org . eclipse . jgit . lib . ObjectId . zeroId ( ) , getFile1Location ( ) ) ; org . eclipse . egit . ui . internal . synchronize . model . GitModelBlob right = createGitModelBlob ( fromString ( "4c879313cd1332e594b1ad20b1485bdff9533034" ) , fromString ( "4c879313cd1332e0000000000000000111122233" ) , getFile2Location ( ) ) ; boolean actual = left . equals ( right ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } org . eclipse . egit . ui . CommitMessageWithCaretPosition other = ( ( org . eclipse . egit . ui . CommitMessageWithCaretPosition ) ( obj ) ) ; return ( ( caretPosition ) == ( other . caretPosition ) ) && ( java . util . Objects . equals ( message , other . message ) ) ; } | org . junit . Assert . assertFalse ( actual ) |
generateDDL_whenTableIsNotYetPersisted_returnsDDLStringForColumnsToBeCreated ( ) { org . jkiss . dbeaver . ext . greenplum . model . PostgreTableColumn mockPostgreTableColumn = mockDbColumn ( "\'<sp>header<sp>)\n" 1 , "int4" , ( - 1 ) ) ; org . jkiss . dbeaver . ext . greenplum . model . PostgreTableColumn mockPostgreTableColumn2 = mockDbColumn ( "column2" , "int2" , ( - 1 ) ) ; java . util . List < org . jkiss . dbeaver . ext . greenplum . model . PostgreTableColumn > tableColumns = java . util . Arrays . asList ( mockPostgreTableColumn , mockPostgreTableColumn2 ) ; org . jkiss . dbeaver . ext . greenplum . model . GreenplumExternalTable table = new org . jkiss . dbeaver . ext . greenplum . model . GreenplumExternalTable ( mockSchema ) ; table . setName ( "sampleTable" ) ; table . setUriLocations ( exampleUriLocation ) ; table . setPersisted ( false ) ; addMockColumnsToTableCache ( tableColumns , table ) ; java . lang . String expectedDDL = "CREATE<sp>EXTERNAL<sp>TABLE<sp>sampleDatabase.sampleSchema.sampleTable<sp>(\n\tcolumn1<sp>int4,\n\tcolumn2<sp>int2\n)\n" + ( ( ( ( "LOCATION<sp>(\n" + "\'<sp>header<sp>)\n" 0 ) + ")<sp>ON<sp>ALL\n" ) + "FORMAT<sp>\'TEXT\'<sp>(<sp>delimiter<sp>\',\'<sp>null<sp>\'\'<sp>escape<sp>\'\"\'<sp>quote<sp>\'\"\'<sp>header<sp>)\n" ) + "ENCODING<sp>'UTF8'" ) ; "<AssertPlaceHolder>" ; } generateDDL ( org . jkiss . dbeaver . model . runtime . DBRProgressMonitor ) { java . lang . StringBuilder ddlBuilder = new java . lang . StringBuilder ( ) ; ddlBuilder . append ( "\nLOG<sp>ERRORS" 1 ) . append ( ( this . isWritable ( ) ? "WRITABLE<sp>" : "" ) ) . append ( "EXTERNAL<sp>" ) . append ( ( isWebTable ( ) ? "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 6 : "" ) ) . append ( ( this . isTemporaryTable ( ) ? "TEMPORARY<sp>" : "" ) ) . append ( "TABLE<sp>" ) . append ( addDatabaseQualifier ( ) ) . append ( this . getName ( ) ) . append ( "\nLOG<sp>ERRORS" 0 ) ; java . util . List < org . jkiss . dbeaver . ext . postgresql . model . PostgreTableColumn > tableColumns = filterOutNonMetadataColumns ( monitor ) ; if ( ( tableColumns . size ( ) ) == 0 ) { ddlBuilder . append ( "\nLOG<sp>ERRORS" 2 ) ; } else if ( ( tableColumns . size ( ) ) == 1 ) { org . jkiss . dbeaver . ext . postgresql . model . PostgreTableColumn column = tableColumns . get ( 0 ) ; ddlBuilder . append ( ( ( ( ( "\t" + ( column . getName ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 ) + ( column . getTypeName ( ) ) ) + "\nLOG<sp>ERRORS" 2 ) ) ; } else { ddlBuilder . append ( tableColumns . stream ( ) . map ( ( field ) -> ( ( "\t" + ( field . getName ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 ) + ( field . getTypeName ( ) ) ) . collect ( java . util . stream . Collectors . joining ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 4 ) ) ) ; ddlBuilder . append ( "\nLOG<sp>ERRORS" 2 ) ; } if ( org . jkiss . utils . CommonUtils . isNotEmpty ( this . getUriLocations ( ) ) ) { ddlBuilder . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 7 ) ; ddlBuilder . append ( this . uriLocationsHandler . stream ( ) . map ( ( location ) -> ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 2 + location ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 1 ) . collect ( java . util . stream . Collectors . joining ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 4 ) ) ) ; ddlBuilder . append ( ( ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 5 + ( determineExecutionLocation ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 9 ) ) ; } else if ( tableHasCommand ( ) ) { ddlBuilder . append ( ( ( ( ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 8 + ( this . getCommand ( ) ) ) + "'<sp>" ) + ( determineExecutionLocation ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 9 ) ) ; } ddlBuilder . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 3 ) . append ( this . getFormatType ( ) ) . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 1 ) ; if ( ( this . getFormatOptions ( ) ) != null ) { ddlBuilder . append ( generateFormatOptions ( this . formatType , this . getFormatOptions ( ) ) ) ; } if ( ( ( this . getEncoding ( ) ) != null ) && ( ( this . getEncoding ( ) . length ( ) ) > 0 ) ) { ddlBuilder . append ( ( ( "\nENCODING<sp>\'" + ( this . getEncoding ( ) ) ) + "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 1 ) ) ; } if ( this . isLoggingErrors ( ) ) { ddlBuilder . append ( "\nLOG<sp>ERRORS" ) ; } if ( ( ( this . getRejectLimit ( ) ) > 0 ) && ( ( this . getRejectLimitType ( ) ) != null ) ) { ddlBuilder . append ( ( this . isLoggingErrors ( ) ? "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 : "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 9 ) ) . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" ) . append ( this . getRejectLimit ( ) ) . append ( "SEGMENT<sp>REJECT<sp>LIMIT<sp>" 0 ) . append ( this . getRejectLimitType ( ) . getValue ( ) ) ; } return ddlBuilder . toString ( ) ; } | org . junit . Assert . assertEquals ( expectedDDL , table . generateDDL ( monitor ) ) |
testFalse ( ) { java . util . Set < net . sourceforge . pmd . lang . java . ast . ASTBooleanLiteral > ops = net . sourceforge . pmd . lang . java . ParserTstUtil . getNodes ( net . sourceforge . pmd . lang . java . ast . ASTBooleanLiteral . class , net . sourceforge . pmd . lang . java . ast . ASTBooleanLiteralTest . TEST2 ) ; net . sourceforge . pmd . lang . java . ast . ASTBooleanLiteral b = ops . iterator ( ) . next ( ) ; "<AssertPlaceHolder>" ; } isTrue ( ) { return this . isTrue ; } | org . junit . Assert . assertFalse ( b . isTrue ( ) ) |
testBlockBlobCompactionSmallWrite ( ) { org . apache . hadoop . fs . Path path = getBlobPathWithTestName ( org . apache . hadoop . fs . azure . ITestOutputStreamSemantics . BLOCK_BLOB_COMPACTION_DIR ) ; try ( org . apache . hadoop . fs . FSDataOutputStream stream = fs . create ( path ) ) { "<AssertPlaceHolder>" ; byte [ ] buffer = getRandomBytes ( ) ; stream . write ( buffer ) ; validate ( path , buffer , false ) ; } } isBlockBlobAppendStreamWrapper ( org . apache . hadoop . fs . FSDataOutputStream ) { return ( ( ( org . apache . hadoop . fs . azure . SyncableDataOutputStream ) ( ( ( org . apache . hadoop . fs . azure . NativeAzureFileSystem . NativeAzureFsOutputStream ) ( stream . getWrappedStream ( ) ) ) . getOutStream ( ) ) ) . getOutStream ( ) ) instanceof org . apache . hadoop . fs . azure . BlockBlobAppendStream ; } | org . junit . Assert . assertTrue ( isBlockBlobAppendStreamWrapper ( stream ) ) |
testGetFactoryInboundMessage ( ) { org . apache . cxf . jaxrs . provider . ProviderFactory factory = org . apache . cxf . jaxrs . provider . ServerProviderFactory . getInstance ( ) ; org . apache . cxf . message . Message m = new org . apache . cxf . message . MessageImpl ( ) ; org . apache . cxf . message . Exchange e = new org . apache . cxf . message . ExchangeImpl ( ) ; m . setExchange ( e ) ; org . apache . cxf . endpoint . Endpoint endpoint = org . easymock . EasyMock . createMock ( org . apache . cxf . endpoint . Endpoint . class ) ; org . easymock . EasyMock . expect ( endpoint . get ( org . apache . cxf . jaxrs . provider . ServerProviderFactory . class . getName ( ) ) ) . andReturn ( factory ) ; org . easymock . EasyMock . replay ( endpoint ) ; e . put ( org . apache . cxf . endpoint . Endpoint . class , endpoint ) ; "<AssertPlaceHolder>" ; } getInstance ( org . apache . cxf . message . Message ) { org . apache . cxf . endpoint . Endpoint e = m . getExchange ( ) . getEndpoint ( ) ; return ( ( org . apache . cxf . jaxrs . provider . ServerProviderFactory ) ( e . get ( org . apache . cxf . jaxrs . provider . SERVER_FACTORY_NAME ) ) ) ; } | org . junit . Assert . assertSame ( org . apache . cxf . jaxrs . provider . ProviderFactory . getInstance ( m ) , factory ) |
testGetIdentifiable ( ) { service . put ( "key" , "value" ) ; com . google . appengine . api . memcache . MemcacheService . IdentifiableValue identifiable = service . getIdentifiable ( "key" ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( "value" , identifiable . getValue ( ) ) |
shouldRespondWith200AndEmptyListOfRelationshipRepresentationsWhenGettingRelationshipsForANodeWithoutRelationships ( ) { long nodeId = org . neo4j . server . rest . web . RestfulGraphDatabaseTest . helper . createNode ( ) ; javax . ws . rs . core . Response response = org . neo4j . server . rest . web . RestfulGraphDatabaseTest . service . getNodeRelationships ( nodeId , RelationshipDirection . all , new org . neo4j . server . rest . web . RestfulGraphDatabase . AmpersandSeparatedCollection ( "" ) ) ; "<AssertPlaceHolder>" ; verifyRelReps ( 0 , org . neo4j . server . rest . web . RestfulGraphDatabaseTest . entityAsString ( response ) ) ; checkContentTypeCharsetUtf8 ( response ) ; } getStatus ( ) { return status ; } | org . junit . Assert . assertEquals ( 200 , response . getStatus ( ) ) |
testOnNodeDeletePreSizeErr ( ) { org . o3project . odenos . core . component . ConversionTable conversionTable = org . powermock . api . mockito . PowerMockito . spy ( new org . o3project . odenos . core . component . ConversionTable ( ) ) ; org . powermock . api . mockito . PowerMockito . doReturn ( "original" ) . when ( conversionTable , "getConnectionType" , org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID ) ; org . powermock . api . mockito . PowerMockito . doReturn ( "original" ) . when ( conversionTable , "getConnectionType" , org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID ) ; org . powermock . api . mockito . PowerMockito . doReturn ( conversionTable ) . when ( target , "conversionTable" ) ; org . powermock . api . mockito . PowerMockito . doReturn ( org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID ) . when ( target , "getNetworkIdByType" , "original" ) ; org . powermock . api . mockito . PowerMockito . doReturn ( org . o3project . odenos . component . aggregator . AggregatorTest . AGGREGATED_NW_ID ) . when ( target , "getNetworkIdByType" , "aggregated" ) ; java . util . Map < java . lang . String , org . o3project . odenos . core . component . network . topology . Port > ports1 = new java . util . HashMap < java . lang . String , org . o3project . odenos . core . component . network . topology . Port > ( ) ; org . o3project . odenos . core . component . network . topology . Node node1 = new org . o3project . odenos . core . component . network . topology . Node ( "0" , "node1" , ports1 , new java . util . HashMap < java . lang . String , java . lang . String > ( ) ) ; "<AssertPlaceHolder>" ; } onNodeDeletePre ( java . lang . String , org . o3project . odenos . core . component . network . topology . Node ) { org . o3project . odenos . component . aggregator . Aggregator . log . debug ( "" ) ; java . lang . String connType = conversionTable ( ) . getConnectionType ( networkId ) ; if ( ( connType != null ) && ( connType . equals ( org . o3project . odenos . component . aggregator . Aggregator . AGGREGATED ) ) ) { return false ; } java . lang . String aggNetworkId = getNetworkIdByType ( org . o3project . odenos . component . aggregator . Aggregator . AGGREGATED ) ; if ( aggNetworkId == null ) { return false ; } org . o3project . odenos . core . component . NetworkInterface aggNetworkIf = networkInterfaces ( ) . get ( aggNetworkId ) ; if ( ( ( node . getPortMap ( ) ) != null ) && ( ( node . getPortMap ( ) . size ( ) ) != 0 ) ) { for ( java . lang . String pid : node . getPortMap ( ) . keySet ( ) ) { org . o3project . odenos . core . component . network . topology . Port orgPort = node . getPort ( pid ) ; java . lang . String aggPortId = getConvPortId ( networkId , orgPort . getNode ( ) , orgPort . getId ( ) ) ; if ( aggPortId == null ) { continue ; } java . lang . String [ ] aggPortList = aggPortId . split ( "::" ) ; aggNetworkIf . delPort ( aggPortList [ 1 ] , aggPortList [ 2 ] ) ; } } java . util . List < java . lang . String > aggNodes = conversionTable ( ) . getNode ( aggNetworkId , this . getObjectId ( ) ) ; if ( ( aggNodes . size ( ) ) == 1 ) { return true ; } conversionTable ( ) . delEntryNode ( networkId , node . getId ( ) ) ; return false ; } | org . junit . Assert . assertThat ( target . onNodeDeletePre ( org . o3project . odenos . component . aggregator . AggregatorTest . ORIGINAL_NW_ID , node1 ) , org . hamcrest . CoreMatchers . is ( false ) ) |
testWriteAndReadFields ( ) { org . gradoop . common . model . impl . properties . PropertyValueList p1 = org . gradoop . common . model . impl . properties . PropertyValueList . fromPropertyValues ( com . google . common . collect . Lists . newArrayList ( org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . NULL_VAL_0 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . BOOL_VAL_1 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . INT_VAL_2 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . LONG_VAL_3 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . FLOAT_VAL_4 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . DOUBLE_VAL_5 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . STRING_VAL_6 ) , org . gradoop . common . model . impl . properties . PropertyValue . create ( GradoopTestUtils . BIG_DECIMAL_VAL_7 ) ) ) ; org . gradoop . common . model . impl . properties . PropertyValueList p2 = org . gradoop . common . GradoopTestUtils . writeAndReadFields ( org . gradoop . common . model . impl . properties . PropertyValueList . class , p1 ) ; "<AssertPlaceHolder>" ; } writeAndReadFields ( java . lang . Class , T extends org . apache . flink . types . Value ) { org . apache . commons . io . output . ByteArrayOutputStream outputStream = new org . apache . commons . io . output . ByteArrayOutputStream ( ) ; org . apache . flink . core . memory . DataOutputView outputView = new org . apache . flink . core . memory . DataOutputViewStreamWrapper ( outputStream ) ; in . write ( outputView ) ; outputStream . flush ( ) ; T out ; try { out = clazz . newInstance ( ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; throw new java . io . IOException ( ( "Cannot<sp>initialize<sp>the<sp>class:<sp>" + clazz ) ) ; } java . io . ByteArrayInputStream inputStream = new java . io . ByteArrayInputStream ( outputStream . toByteArray ( ) ) ; org . apache . flink . core . memory . DataInputView inputView = new org . apache . flink . core . memory . DataInputViewStreamWrapper ( inputStream ) ; out . read ( inputView ) ; return out ; } | org . junit . Assert . assertEquals ( p1 , p2 ) |
testClearArguments ( ) { final org . apache . oozie . fluentjob . api . action . ShellActionBuilder builder = getBuilderInstance ( ) ; for ( final java . lang . String file : org . apache . oozie . fluentjob . api . action . TestShellActionBuilder . ARGS ) { builder . withArgument ( file ) ; } builder . clearArguments ( ) ; final org . apache . oozie . fluentjob . api . action . ShellAction action = builder . build ( ) ; final java . util . List < java . lang . String > argList = action . getArguments ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return org . apache . oozie . event . MemoryEventQueue . currentSize . intValue ( ) ; } | org . junit . Assert . assertEquals ( 0 , argList . size ( ) ) |
testGetDataRecordBySiteMember ( ) { com . liferay . data . engine . model . DEDataDefinition deDataDefinition = com . liferay . data . engine . service . test . DEDataEngineTestUtil . insertDEDataDefinition ( _adminUser , _group , _deDataDefinitionService ) ; com . liferay . data . engine . model . DEDataRecordCollection deDataRecordCollection ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( _group , _adminUser . getUserId ( ) ) ; com . liferay . portal . kernel . service . permission . ModelPermissions modelPermissions = new com . liferay . portal . kernel . service . permission . ModelPermissions ( ) ; modelPermissions . addRolePermissions ( RoleConstants . SITE_MEMBER , DEActionKeys . VIEW_DATA_RECORD ) ; serviceContext . setModelPermissions ( modelPermissions ) ; com . liferay . portal . kernel . service . ServiceContextThreadLocal . pushServiceContext ( serviceContext ) ; com . liferay . portal . kernel . security . permission . PermissionThreadLocal . setPermissionChecker ( com . liferay . portal . kernel . security . permission . PermissionCheckerFactoryUtil . create ( _adminUser ) ) ; try { deDataRecordCollection = new com . liferay . data . engine . model . DEDataRecordCollection ( ) ; deDataRecordCollection . addName ( LocaleUtil . US , "Data<sp>record<sp>list" ) ; deDataRecordCollection . addDescription ( LocaleUtil . BRAZIL , "Lista<sp>de<sp>registro<sp>de<sp>dados" ) ; deDataRecordCollection . addDescription ( LocaleUtil . US , "Data<sp>record<sp>list<sp>description" ) ; deDataRecordCollection . addDescription ( LocaleUtil . BRAZIL , "Descrio<sp>da<sp>lista<sp>de<sp>registro<sp>de<sp>dados" ) ; deDataRecordCollection . setDEDataDefinition ( deDataDefinition ) ; com . liferay . data . engine . service . DEDataRecordCollectionSaveRequest deDataRecordCollectionSaveRequest = com . liferay . data . engine . service . DEDataRecordCollectionRequestBuilder . saveBuilder ( deDataRecordCollection ) . onBehalfOf ( _adminUser . getUserId ( ) ) . inGroup ( _group . getGroupId ( ) ) . build ( ) ; com . liferay . data . engine . service . DEDataRecordCollectionSaveResponse deDataRecordCollectionSaveResponse = _deDataRecordCollectionService . execute ( deDataRecordCollectionSaveRequest ) ; deDataRecordCollection = deDataRecordCollectionSaveResponse . getDEDataRecordCollection ( ) ; } finally { com . liferay . portal . kernel . service . ServiceContextThreadLocal . popServiceContext ( ) ; } com . liferay . data . engine . model . DEDataRecord expectedDEDataRecord = com . liferay . data . engine . service . test . DEDataEngineTestUtil . insertDEDataRecord ( _adminUser , _group , deDataRecordCollection , _deDataRecordCollectionService ) ; com . liferay . portal . kernel . model . User user = com . liferay . portal . kernel . test . util . UserTestUtil . addGroupUser ( _group , RoleConstants . SITE_MEMBER ) ; com . liferay . data . engine . model . DEDataRecord deDataRecord = com . liferay . data . engine . service . test . DEDataEngineTestUtil . getDEDataRecord ( user , _group , expectedDEDataRecord . getDEDataRecordId ( ) , _deDataRecordCollectionService ) ; "<AssertPlaceHolder>" ; } addGroupUser ( com . liferay . portal . kernel . model . Group , java . lang . String ) { com . liferay . portal . kernel . model . User groupUser = com . liferay . portal . kernel . test . util . UserTestUtil . addUser ( group . getGroupId ( ) ) ; com . liferay . portal . kernel . model . Role role = com . liferay . portal . kernel . service . RoleLocalServiceUtil . getRole ( group . getCompanyId ( ) , roleName ) ; long [ ] userIds = new long [ ] { groupUser . getUserId ( ) } ; com . liferay . portal . kernel . service . UserGroupRoleLocalServiceUtil . addUserGroupRoles ( userIds , group . getGroupId ( ) , role . getRoleId ( ) ) ; return groupUser ; } | org . junit . Assert . assertEquals ( expectedDEDataRecord , deDataRecord ) |
testFlowOnFailureSkipped ( ) { java . net . URI resource = getClass ( ) . getResource ( "/corrupted/flow_on_failure_skipped.sl" ) . toURI ( ) ; io . cloudslang . lang . compiler . modeller . result . ExecutableModellingResult result = compiler . preCompileSource ( io . cloudslang . lang . compiler . SlangSource . fromFile ( resource ) ) ; "<AssertPlaceHolder>" ; exception . expect ( io . cloudslang . lang . compiler . RuntimeException . class ) ; exception . expectMessage ( ( "Error<sp>compiling<sp>source<sp>\'flow_on_failure_skipped.sl\'.\n" + ( "Flow:<sp>'flow_on_failure_skipped'<sp>has<sp>steps<sp>with<sp>keyword<sp>on<sp>the<sp>same<sp>indentation<sp>as<sp>the<sp>step<sp>name<sp>or<sp>" + "there<sp>is<sp>no<sp>space<sp>between<sp>step<sp>name<sp>and<sp>hyphen." ) ) ) ; throw result . getErrors ( ) . get ( 0 ) ; } getErrors ( ) { return errors ; } | org . junit . Assert . assertTrue ( ( ( result . getErrors ( ) . size ( ) ) > 0 ) ) |
testStarGraph ( ) { edu . ucla . sspace . graph . isomorphism . Graph < edu . ucla . sspace . graph . isomorphism . Edge > g1 = new edu . ucla . sspace . graph . isomorphism . SparseUndirectedGraph ( ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 0 , 1 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 0 , 2 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 0 , 3 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 0 , 4 ) ) ; g1 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 0 , 5 ) ) ; edu . ucla . sspace . graph . isomorphism . Graph < edu . ucla . sspace . graph . isomorphism . Edge > g2 = new edu . ucla . sspace . graph . isomorphism . SparseUndirectedGraph ( ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 0 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 2 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 3 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 4 ) ) ; g2 . add ( new edu . ucla . sspace . graph . isomorphism . SimpleEdge ( 1 , 5 ) ) ; edu . ucla . sspace . graph . isomorphism . IsomorphismTester isoTest = new edu . ucla . sspace . graph . isomorphism . VF2IsomorphismTester ( ) ; "<AssertPlaceHolder>" ; } areIsomorphic ( edu . ucla . sspace . graph . isomorphism . Graph , edu . ucla . sspace . graph . isomorphism . Graph ) { edu . ucla . sspace . graph . isomorphism . Graph < ? extends edu . ucla . sspace . graph . isomorphism . Edge > g1mapped = remap ( g1 , null ) ; edu . ucla . sspace . graph . isomorphism . Graph < ? extends edu . ucla . sspace . graph . isomorphism . Edge > g2mapped = remap ( g2 , null ) ; edu . ucla . sspace . graph . isomorphism . State state = makeInitialState ( g1mapped , g2mapped ) ; return match ( state ) ; } | org . junit . Assert . assertTrue ( isoTest . areIsomorphic ( g1 , g2 ) ) |
getTagsAsList_shouldReturnEmptyString_null ( ) { java . lang . String result = p . getTagsAsList ( null ) ; "<AssertPlaceHolder>" ; } getTagsAsList ( java . util . List ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( globalPropertyTags != null ) { int count = 0 ; for ( ch . puzzle . itc . mobiliar . business . property . entity . PropertyTagEntity tag : globalPropertyTags ) { if ( ( ( tag . getName ( ) ) != null ) && ( ! ( tag . getName ( ) . isEmpty ( ) ) ) ) { if ( count > 0 ) { sb . append ( ",<sp>" ) ; } sb . append ( "'" ) ; sb . append ( tag . getName ( ) ) ; sb . append ( "'" ) ; count ++ ; } } } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( "" , result ) |
testInstanceInitializer ( ) { com . thoughtworks . qdox . model . JavaInitializer init = mock ( com . thoughtworks . qdox . model . JavaInitializer . class ) ; when ( init . isStatic ( ) ) . thenReturn ( false ) ; when ( init . getBlockContent ( ) ) . thenReturn ( "//test" ) ; modelWriter . writeInitializer ( init ) ; java . lang . String expected = "{\n" + ( "\t//test\n" + "}\n" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "++" + ( getValue ( ) . toString ( ) ) ; } | org . junit . Assert . assertEquals ( expected , modelWriter . toString ( ) ) |
testGetFactHandleEqualityBehavior ( ) { final org . kie . api . KieBaseConfiguration kbc = org . drools . core . impl . KnowledgeBaseFactory . newKnowledgeBaseConfiguration ( ) ; kbc . setOption ( EqualityBehaviorOption . EQUALITY ) ; final org . kie . api . KieBase kbase = org . drools . compiler . integrationtests . SerializationHelper . serializeObject ( loadKnowledgeBase ( kbc ) ) ; final org . kie . api . runtime . KieSession ksession = createKnowledgeSession ( kbase ) ; final org . drools . compiler . CheeseEqual cheese = new org . drools . compiler . CheeseEqual ( "stilton" , 10 ) ; ksession . insert ( cheese ) ; final org . kie . api . runtime . rule . FactHandle fh = ksession . getFactHandle ( new org . drools . compiler . CheeseEqual ( "stilton" , 10 ) ) ; "<AssertPlaceHolder>" ; } getFactHandle ( org . drools . core . rule . Declaration , org . drools . core . common . InternalFactHandle [ ] ) { return ( handles != null ) && ( ( handles . length ) > ( declaration . getPattern ( ) . getOffset ( ) ) ) ? handles [ declaration . getPattern ( ) . getOffset ( ) ] : null ; } | org . junit . Assert . assertNotNull ( fh ) |
datumIngangDeelsOnbekend ( ) { final nl . bzk . algemeenbrp . dal . domein . brp . entity . BijhouderFiatteringsuitzondering bijhouderFiatteringsuitzondering = new nl . bzk . algemeenbrp . dal . domein . brp . entity . BijhouderFiatteringsuitzondering ( new nl . bzk . algemeenbrp . dal . domein . brp . entity . PartijRol ( new nl . bzk . algemeenbrp . dal . domein . brp . entity . Partij ( "partij1" , "000001" ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Rol . AFNEMER ) ) ; bijhouderFiatteringsuitzondering . setDatumIngang ( 20160005 ) ; "<AssertPlaceHolder>" ; } errorCount ( nl . bzk . algemeenbrp . dal . domein . brp . entity . ToegangLeveringsAutorisatie ) { final java . util . Map < ? , ? > result = new java . util . HashMap ( ) ; final org . springframework . validation . Errors errors = new org . springframework . validation . MapBindingResult ( result , "toegang" ) ; subject . validate ( toegang , errors ) ; return errors . getErrorCount ( ) ; } | org . junit . Assert . assertEquals ( 1 , errorCount ( bijhouderFiatteringsuitzondering ) ) |
testGetByModule ( ) { org . apache . usergrid . chop . webapp . dao . CommitDaoTest . LOG . info ( "\n===CommitDaoTest.testGetByModule===\n" ) ; java . util . List < org . apache . usergrid . chop . api . Commit > list = ESSuiteTest . commitDao . getByModule ( ESSuiteTest . MODULE_ID_2 ) ; for ( org . apache . usergrid . chop . api . Commit commit : list ) { org . apache . usergrid . chop . webapp . dao . CommitDaoTest . LOG . info ( commit . toString ( ) ) ; } "<AssertPlaceHolder>" ; } size ( ) { return getDynamicProperties ( ) . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , list . size ( ) ) |
getSelectedServiceKey ( ) { org . oscm . ui . dialog . classic . partnerservice . PartnerServiceViewModel m = new org . oscm . ui . dialog . classic . partnerservice . PartnerServiceViewModel ( ) ; long l = m . getSelectedServiceKey ( ) ; "<AssertPlaceHolder>" ; } getSelectedServiceKey ( ) { long l = m . getSelectedServiceKey ( ) ; org . junit . Assert . assertEquals ( 0 , l ) ; } | org . junit . Assert . assertEquals ( l , 0 ) |
testRemoveNormal ( ) { java . util . Map < java . lang . String , java . lang . Object > values = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; values . put ( "id" , 1 ) ; values . put ( "description" , "item:" ) ; values . put ( "price" , ( ( double ) ( SupportConst . I_TWENTY ) ) ) ; com . huawei . streaming . event . TupleEvent event = new com . huawei . streaming . event . TupleEvent ( "item" , item , values ) ; events [ 0 ] = event ; collection . add ( events ) ; collection . remove ( events ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return keyBasedEvent . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( collection . isEmpty ( ) ) |
testSetInboundPassthruMode ( ) { gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry registry = gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . getInstance ( ) ; gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum serviceName = gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum . QueryForDocuments ; gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum direction = gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum . Inbound ; boolean status = true ; gov . hhs . fha . nhinc . docquery . configuration . jmx . DocumentQuery30WebServices docquery30 = mock ( gov . hhs . fha . nhinc . docquery . configuration . jmx . DocumentQuery30WebServices . class ) ; when ( docquery30 . getServiceName ( ) ) . thenReturn ( serviceEnum . QueryForDocuments ) ; when ( docquery30 . isInboundPassthru ( ) ) . thenReturn ( status ) ; registry . registerWebServiceMXBean ( docquery30 ) ; boolean passthru = registry . isPassthru ( serviceName , direction ) ; "<AssertPlaceHolder>" ; } isPassthru ( gov . hhs . fha . nhinc . configuration . IConfiguration . serviceEnum , gov . hhs . fha . nhinc . configuration . IConfiguration . directionEnum ) { boolean passthruMode = false ; for ( gov . hhs . fha . nhinc . configuration . jmx . WebServicesMXBean b : registeredBeans ) { if ( ( ( gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . isInbound ( direction ) ) && ( b . getServiceName ( ) . equals ( serviceName ) ) ) && ( b . isInboundPassthru ( ) ) ) { passthruMode = true ; } if ( ( ( gov . hhs . fha . nhinc . configuration . jmx . PassthruMXBeanRegistry . isOutbound ( direction ) ) && ( b . getServiceName ( ) . equals ( serviceName ) ) ) && ( b . isOutboundPassthru ( ) ) ) { passthruMode = true ; } } return passthruMode ; } | org . junit . Assert . assertEquals ( true , passthru ) |
testSwapEmptyLongArray ( ) { final long [ ] array = new long [ 0 ] ; org . fintx . util . Arrays . swap ( array , 0 , 2 ) ; "<AssertPlaceHolder>" ; } swap ( T , int , int ) { org . fintx . util . Arrays . swap ( array , offset1 , offset2 , 1 ) ; } | org . junit . Assert . assertEquals ( 0 , array . length ) |
getIndexOfFirstNonDiscreteCellTest ( ) { int [ ] [ ] cellData = new int [ ] [ ] { new int [ ] { 0 } , new int [ ] { 1 } , new int [ ] { 2 , 3 , 4 } , new int [ ] { 5 , 6 } } ; org . openscience . cdk . group . Partition p = new org . openscience . cdk . group . Partition ( cellData ) ; "<AssertPlaceHolder>" ; } getIndexOfFirstNonDiscreteCell ( ) { for ( int i = 0 ; i < ( this . cells . size ( ) ) ; i ++ ) { if ( ! ( isDiscreteCell ( i ) ) ) return i ; } return - 1 ; } | org . junit . Assert . assertEquals ( 2 , p . getIndexOfFirstNonDiscreteCell ( ) ) |
testGenerateDSNFailureMessage_nullMessageToTrack ( ) { org . apache . camel . Exchange exchange = new org . apache . camel . impl . DefaultExchange ( mock ( org . apache . camel . CamelContext . class ) ) ; java . util . Collection < org . nhindirect . common . tx . model . Tx > txs = new java . util . ArrayList < org . nhindirect . common . tx . model . Tx > ( ) ; org . nhindirect . monitor . processor . DSNMessageGenerator generator = createGenerator ( ) ; generator . generateDSNFailureMessage ( txs , exchange ) ; javax . mail . internet . MimeMessage dsnMessage = ( ( javax . mail . internet . MimeMessage ) ( exchange . getIn ( ) . getBody ( ) ) ) ; "<AssertPlaceHolder>" ; } getBody ( ) { return body ; } | org . junit . Assert . assertNull ( dsnMessage ) |
toPrimitiveLongForEmptyString ( ) { "<AssertPlaceHolder>" ; } toPrimitiveLong ( java . lang . Object ) { java . lang . Long l = org . slim3 . util . LongUtil . toLong ( o ) ; if ( l == null ) { return 0 ; } return l . longValue ( ) ; } | org . junit . Assert . assertThat ( org . slim3 . util . LongUtil . toPrimitiveLong ( "" ) , org . hamcrest . CoreMatchers . is ( 0L ) ) |
testEncodeWellKnown ( ) { byte [ ] data = new byte [ ] { 12 , 10 , 15 , 14 , 11 , 10 , 11 , 14 } ; byte [ ] expected = new byte [ ] { 0 , 0 , 0 , 8 , 12 , 10 , 15 , 14 , 11 , 10 , 11 , 14 } ; try ( org . dcache . oncrpc4j . xdr . Xdr xdr = new org . dcache . oncrpc4j . xdr . Xdr ( 16 ) ) { xdr . beginEncoding ( ) ; org . dcache . oncrpc4j . xdr . XdrOpaque opaque = new org . dcache . oncrpc4j . xdr . XdrOpaque ( data ) ; opaque . xdrEncode ( xdr ) ; xdr . endEncoding ( ) ; "<AssertPlaceHolder>" ; } } getBytes ( ) { checkState ( ( ! ( _inUse ) ) , "getBytes<sp>called<sp>while<sp>buffer<sp>in<sp>use" ) ; int size = _buffer . remaining ( ) ; byte [ ] bytes = new byte [ size ] ; org . glassfish . grizzly . Buffer dup = _buffer . duplicate ( ) ; dup . get ( bytes ) ; return bytes ; } | org . junit . Assert . assertArrayEquals ( expected , xdr . getBytes ( ) ) |
testFileSuppression ( ) { java . io . File file = new java . io . File ( "/test/testfile" ) ; profile . addFileSuppression ( file ) ; "<AssertPlaceHolder>" ; } isFileSuppressed ( java . io . File ) { java . io . File absoluteFile = makeAbsoluteFile ( file ) ; for ( com . googlecode . cppcheclipse . core . Suppression suppression : suppressionList ) { if ( suppression . isSuppression ( absoluteFile , project ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( profile . isFileSuppressed ( file ) ) |
testCastIntToShort ( ) { short expected = org . stjs . generator . exec . ints . IntToShort . method ( IntToShort . MAX_INT ) ; double expectedDouble = ( ( double ) ( expected ) ) ; "<AssertPlaceHolder>" ; } executeAndReturnNumber ( java . lang . Class ) { return executeAndReturnNumber ( clazz , null ) ; } | org . junit . Assert . assertEquals ( expectedDouble , executeAndReturnNumber ( org . stjs . generator . exec . ints . IntToShort . class ) , 0 ) |
testDefineClass ( ) { byte [ ] b = org . objenesis . instantiator . util . ClassDefinitionUtils . readClass ( className ) ; java . lang . Class < ? > c = org . objenesis . instantiator . util . ClassDefinitionUtils . defineClass ( className , b , org . objenesis . Objenesis . class , getClass ( ) . getClassLoader ( ) ) ; "<AssertPlaceHolder>" ; } defineClass ( java . lang . String , byte [ ] , java . lang . Class , java . lang . ClassLoader ) { java . lang . Class < T > c = ( ( java . lang . Class < T > ) ( org . objenesis . instantiator . util . DefineClassHelper . defineClass ( className , b , 0 , b . length , neighbor , loader , org . objenesis . instantiator . util . ClassDefinitionUtils . PROTECTION_DOMAIN ) ) ) ; java . lang . Class . forName ( className , true , loader ) ; return c ; } | org . junit . Assert . assertEquals ( c . getName ( ) , className ) |
testBuildWithDisabledDefaultConstraint ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; org . lnu . is . domain . mark . scale . MarkScale context = new org . lnu . is . domain . mark . scale . MarkScale ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>MarkScale<sp>e<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . mark . scale . MarkScale > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; } | org . junit . Assert . assertEquals ( expected , actualQuery ) |
union_empty_result ( ) { com . querydsl . core . types . SubQueryExpression < java . lang . Integer > sq1 = query ( ) . from ( com . querydsl . sql . Constants . employee ) . where ( employee . firstname . eq ( "XXX" ) ) . select ( employee . id ) ; com . querydsl . core . types . SubQueryExpression < java . lang . Integer > sq2 = query ( ) . from ( com . querydsl . sql . Constants . employee ) . where ( employee . firstname . eq ( "YYY" ) ) . select ( employee . id ) ; java . util . List < java . lang . Integer > list = query ( ) . union ( sq1 , sq2 ) . fetch ( ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( values . isEmpty ( ) ) && ( batches . isEmpty ( ) ) ; } | org . junit . Assert . assertTrue ( list . isEmpty ( ) ) |
setQualityWithValidArgument ( ) { instance . setQuality ( 50 ) ; "<AssertPlaceHolder>" ; } getQuality ( ) { return quality ; } | org . junit . Assert . assertEquals ( 50 , instance . getQuality ( ) ) |
shouldGetGraphIds ( ) { uk . gov . gchq . gaffer . federatedstore . operation . handler . impl . FederatedGetAllGraphIDHandler federatedGetAllGraphIDHandler = new uk . gov . gchq . gaffer . federatedstore . operation . handler . impl . FederatedGetAllGraphIDHandler ( ) ; uk . gov . gchq . gaffer . federatedstore . operation . GetAllGraphIds op = org . mockito . Mockito . mock ( uk . gov . gchq . gaffer . federatedstore . operation . GetAllGraphIds . class ) ; uk . gov . gchq . gaffer . store . Context context = org . mockito . Mockito . mock ( uk . gov . gchq . gaffer . store . Context . class ) ; org . mockito . BDDMockito . given ( context . getUser ( ) ) . willReturn ( testUser ) ; uk . gov . gchq . gaffer . federatedstore . FederatedStore store = org . mockito . Mockito . mock ( uk . gov . gchq . gaffer . federatedstore . FederatedStore . class ) ; java . util . Set < java . lang . String > expected = com . google . common . collect . Sets . newHashSet ( ) ; expected . add ( "value1" ) ; org . mockito . BDDMockito . given ( store . getAllGraphIds ( testUser ) ) . willReturn ( expected ) ; java . lang . Iterable < ? extends java . lang . String > actual = federatedGetAllGraphIDHandler . doOperation ( op , context , store ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( store ) . getAllGraphIds ( testUser ) ; } doOperation ( uk . gov . gchq . gaffer . operation . impl . function . Filter , uk . gov . gchq . gaffer . store . Context , uk . gov . gchq . gaffer . store . Store ) { return handler . doOperation ( operation , ( ( uk . gov . gchq . gaffer . federatedstore . FederatedStore ) ( store ) ) . getSchema ( operation , context ) ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testLsr ( ) { final org . apache . hadoop . conf . Configuration conf = org . apache . hadoop . hdfs . TestDFSShell . dfs . getConf ( ) ; final java . lang . String root = org . apache . hadoop . hdfs . TestDFSShell . createTree ( org . apache . hadoop . hdfs . TestDFSShell . dfs , "lsr" ) ; org . apache . hadoop . hdfs . TestDFSShell . dfs . mkdirs ( new org . apache . hadoop . hdfs . Path ( root , "zzz" ) ) ; org . apache . hadoop . hdfs . TestDFSShell . runLsr ( new org . apache . hadoop . hdfs . FsShell ( conf ) , root , 0 ) ; final org . apache . hadoop . hdfs . Path sub = new org . apache . hadoop . hdfs . Path ( root , "sub" ) ; org . apache . hadoop . hdfs . TestDFSShell . dfs . setPermission ( sub , new org . apache . hadoop . fs . permission . FsPermission ( ( ( short ) ( 0 ) ) ) ) ; final org . apache . hadoop . security . UserGroupInformation ugi = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) ; final java . lang . String tmpusername = ( ugi . getShortUserName ( ) ) + "1" ; org . apache . hadoop . security . UserGroupInformation tmpUGI = org . apache . hadoop . security . UserGroupInformation . createUserForTesting ( tmpusername , new java . lang . String [ ] { tmpusername } ) ; java . lang . String results = tmpUGI . doAs ( new java . security . PrivilegedExceptionAction < java . lang . String > ( ) { @ org . apache . hadoop . hdfs . Override public java . lang . String run ( ) throws org . apache . hadoop . hdfs . Exception { return org . apache . hadoop . hdfs . TestDFSShell . runLsr ( new org . apache . hadoop . hdfs . FsShell ( conf ) , root , 1 ) ; } } ) ; "<AssertPlaceHolder>" ; } contains ( E ) { return blockq . contains ( e ) ; } | org . junit . Assert . assertTrue ( results . contains ( "zzz" ) ) |
getCollectionSize_Property_NonCollection ( ) { org . pentaho . di . core . injection . bean . BeanInjector bi = new org . pentaho . di . core . injection . bean . BeanInjector ( null ) ; org . pentaho . di . core . injection . bean . BeanInjectionInfo bii = new org . pentaho . di . core . injection . bean . BeanInjectionInfo ( org . pentaho . di . core . injection . MetaBeanLevel1 . class ) ; org . pentaho . di . core . injection . MetaBeanLevel1 mbl1 = new org . pentaho . di . core . injection . MetaBeanLevel1 ( ) ; mbl1 . setSub ( new org . pentaho . di . core . injection . MetaBeanLevel2 ( ) ) ; mbl1 . getSub ( ) . setAscending ( java . util . Arrays . asList ( new java . lang . Boolean [ ] { true , false , false , true } ) ) ; org . pentaho . di . core . injection . bean . BeanInjectionInfo . Property property = bii . getProperties ( ) . values ( ) . stream ( ) . filter ( ( p ) -> p . getName ( ) . equals ( "SEPARATOR" ) ) . findFirst ( ) . orElse ( null ) ; "<AssertPlaceHolder>" ; } getCollectionSize ( org . pentaho . di . core . injection . bean . BeanLevelInfo , java . lang . Object ) { int size = - 1 ; try { if ( isArray ( beanLevelInfo ) ) { java . lang . Object existArray = beanLevelInfo . getField ( ) . get ( obj ) ; size = java . lang . reflect . Array . getLength ( existArray ) ; } else { java . util . List < java . lang . Object > existList = ( ( java . util . List < java . lang . Object > ) ( beanLevelInfo . getField ( ) . get ( obj ) ) ) ; size = existList . size ( ) ; } } catch ( java . lang . Exception e ) { } return size ; } | org . junit . Assert . assertEquals ( ( - 1 ) , bi . getCollectionSize ( property , mbl1 . getSub ( ) ) ) |
testPutMetrics ( ) { org . apache . hadoop . metrics2 . MetricsRecord record = mock ( org . apache . hadoop . metrics2 . MetricsRecord . class ) ; when ( record . tags ( ) ) . thenReturn ( com . google . common . collect . Lists . newArrayList ( new org . apache . hadoop . metrics2 . MetricsTag ( org . apache . hadoop . metrics2 . impl . TestKafkaMetrics . KafkaMetricsInfo . KafkaTag , "test_tag" ) ) ) ; when ( record . timestamp ( ) ) . thenReturn ( java . lang . System . currentTimeMillis ( ) ) ; org . apache . hadoop . metrics2 . AbstractMetric metric = new org . apache . hadoop . metrics2 . AbstractMetric ( org . apache . hadoop . metrics2 . impl . TestKafkaMetrics . KafkaMetricsInfo . KafkaCounter ) { @ org . apache . hadoop . metrics2 . impl . Override public org . apache . hadoop . metrics2 . impl . Number value ( ) { return new java . lang . Integer ( 123 ) ; } @ org . apache . hadoop . metrics2 . impl . Override public org . apache . hadoop . metrics2 . MetricType type ( ) { return null ; } @ org . apache . hadoop . metrics2 . impl . Override public void visit ( org . apache . hadoop . metrics2 . MetricsVisitor visitor ) { } } ; java . lang . Iterable < org . apache . hadoop . metrics2 . AbstractMetric > metrics = com . google . common . collect . Lists . newArrayList ( metric ) ; when ( record . name ( ) ) . thenReturn ( "Kafka<sp>record<sp>name" ) ; when ( record . metrics ( ) ) . thenReturn ( metrics ) ; org . apache . commons . configuration2 . SubsetConfiguration conf = mock ( org . apache . commons . configuration2 . SubsetConfiguration . class ) ; when ( conf . getString ( KafkaSink . BROKER_LIST ) ) . thenReturn ( "localhost:9092" ) ; java . lang . String topic = "myTestKafkaTopic" ; when ( conf . getString ( KafkaSink . TOPIC ) ) . thenReturn ( topic ) ; kafkaSink = new org . apache . hadoop . metrics2 . sink . KafkaSink ( ) ; kafkaSink . init ( conf ) ; org . apache . kafka . clients . producer . Producer < java . lang . Integer , byte [ ] > mockProducer = mock ( org . apache . kafka . clients . producer . KafkaProducer . class ) ; kafkaSink . setProducer ( mockProducer ) ; java . lang . StringBuilder jsonLines = recordToJson ( record ) ; if ( org . apache . hadoop . metrics2 . impl . TestKafkaMetrics . LOG . isDebugEnabled ( ) ) { org . apache . hadoop . metrics2 . impl . TestKafkaMetrics . LOG . debug ( ( "kafka<sp>message:<sp>" + ( jsonLines . toString ( ) ) ) ) ; } java . util . concurrent . Future < org . apache . kafka . clients . producer . RecordMetadata > f = mock ( java . util . concurrent . Future . class ) ; when ( mockProducer . send ( any ( ) ) ) . thenReturn ( f ) ; kafkaSink . putMetrics ( record ) ; org . mockito . ArgumentCaptor < org . apache . kafka . clients . producer . ProducerRecord > argument = org . mockito . ArgumentCaptor . forClass ( org . apache . kafka . clients . producer . ProducerRecord . class ) ; verify ( mockProducer ) . send ( argument . capture ( ) ) ; org . apache . kafka . clients . producer . ProducerRecord < java . lang . Integer , byte [ ] > data = argument . getValue ( ) ; java . lang . String jsonResult = new java . lang . String ( data . value ( ) ) ; if ( org . apache . hadoop . metrics2 . impl . TestKafkaMetrics . LOG . isDebugEnabled ( ) ) { org . apache . hadoop . metrics2 . impl . TestKafkaMetrics . LOG . debug ( ( "kafka<sp>result:<sp>" + jsonResult ) ) ; } "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( ( ( ( ( "OzoneFileSystem{URI=" + ( uri ) ) + ",<sp>" ) + "workingDir=" ) + ( workingDir ) ) + ",<sp>" ) + "userName=" ) + ( userName ) ) + ",<sp>" ) + "statistics=" ) + ( statistics ) ) + "}" ; } | org . junit . Assert . assertEquals ( jsonLines . toString ( ) , jsonResult ) |
getSelectedTemplateKey ( ) { model . setSelectedTemplateKey ( 101L ) ; "<AssertPlaceHolder>" ; } getSelectedTemplateKey ( ) { return selectedTemplateKey ; } | org . junit . Assert . assertEquals ( 101L , model . getSelectedTemplateKey ( ) ) |
test3 ( ) { final org . eclipse . kapua . client . gateway . Topic topic = org . eclipse . kapua . client . gateway . Topic . of ( new java . util . LinkedList ( java . util . Arrays . asList ( "foo" , "bar" ) ) ) ; "<AssertPlaceHolder>" ; } getSegments ( ) { return segments ; } | org . junit . Assert . assertEquals ( java . util . Arrays . asList ( "foo" , "bar" ) , topic . getSegments ( ) ) |
shouldFireEventsToPublishConsoleOutput ( ) { org . infinitest . testrunner . RunnerEventSupport eventSupport = new org . infinitest . testrunner . RunnerEventSupport ( this ) ; final java . lang . StringBuffer updatedText = new java . lang . StringBuffer ( ) ; eventSupport . addConsoleOutputListener ( new org . infinitest . testrunner . ConsoleOutputListener ( ) { @ org . infinitest . testrunner . Override public void consoleOutputUpdate ( java . lang . String newText , org . infinitest . testrunner . OutputType outputType ) { updatedText . append ( newText ) ; } } ) ; new org . infinitest . testrunner . ConsoleOutputProcessor ( toInputStream ( "hello" ) , STDERR , eventSupport ) . run ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( name ) + "." ) + ( method ) ; } | org . junit . Assert . assertEquals ( "hello" , updatedText . toString ( ) ) |
testSlowConnection ( ) { org . opennms . netmgt . jasper . measurement . remote . Result result = new org . opennms . netmgt . jasper . measurement . remote . MeasurementApiClient ( ) . execute ( false , "http://localhost:9999/opennms/rest/measurements/slow-response" , null , null , "<dummy<sp>request>" ) ; "<AssertPlaceHolder>" ; } wasSuccessful ( ) { return ( ( responseCode ) >= 200 ) && ( ( responseCode ) <= 299 ) ; } | org . junit . Assert . assertTrue ( result . wasSuccessful ( ) ) |
testMultipleParameterStoreInvocationsReturnSameParam ( ) { org . ocpsoft . rewrite . servlet . config . Path path = org . ocpsoft . rewrite . servlet . config . Path . matches ( "/something/#{param}" ) ; org . ocpsoft . rewrite . param . ParameterStore store = new org . ocpsoft . rewrite . param . DefaultParameterStore ( ) ; org . ocpsoft . rewrite . util . ParameterUtils . initialize ( store , path ) ; org . ocpsoft . rewrite . param . Parameter < ? > p1 = store . get ( "param" ) ; org . ocpsoft . rewrite . param . Parameter < ? > p2 = store . get ( "param" ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { org . apache . http . impl . client . DefaultHttpClient client = new org . apache . http . impl . client . DefaultHttpClient ( ) ; return get ( client , path ) ; } | org . junit . Assert . assertTrue ( ( p1 == p2 ) ) |
testGetParametersWithDefaultEntityAndDisabledSecurity ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . specoffer . SpecOfferSubject entity = new org . lnu . is . domain . specoffer . SpecOfferSubject ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; } | org . junit . Assert . assertEquals ( expected , actual ) |
featureTagTest ( ) { java . util . List < java . lang . String > existingTags = new java . util . ArrayList ( ) ; for ( com . github . bogdanlivadariu . reporting . cucumber . json . models . Feature f : reports . getFeatures ( ) ) { for ( com . github . bogdanlivadariu . reporting . cucumber . json . models . Tag t : f . getTags ( ) ) { existingTags . add ( ( ( t . getName ( ) ) + ( t . getLine ( ) ) ) ) ; } } java . util . List < java . lang . String > expectedTags = new java . util . ArrayList < java . lang . String > ( java . util . Arrays . asList ( "@super1" , "@editor1" , "@formatting1" , "@formattingBlocks1" , "@formattingSpacer1" , "@all3" , "@ControleDeBens3" , "@Patrimonio3" ) ) ; "<AssertPlaceHolder>" ; } getLine ( ) { return line ; } | org . junit . Assert . assertEquals ( expectedTags , existingTags ) |
test_partition_frozen_assign ( ) { com . noctarius . snowcast . impl . SequencerDefinition definition = new com . noctarius . snowcast . impl . SequencerDefinition ( "empty" , com . noctarius . snowcast . SnowcastEpoch . byTimestamp ( 1 ) , 128 , ( ( short ) ( 1 ) ) ) ; com . hazelcast . nio . Address address = new com . hazelcast . nio . Address ( "localhost" , 1000 ) ; com . noctarius . snowcast . impl . SequencerPartition partition = new com . noctarius . snowcast . impl . SequencerPartition ( 1 ) ; java . lang . Integer logicalNodeId = partition . attachLogicalNode ( definition , address ) ; "<AssertPlaceHolder>" ; partition . freeze ( ) ; partition . assignLogicalNode ( definition , logicalNodeId , address ) ; } attachLogicalNode ( java . lang . String , com . noctarius . snowcast . impl . SequencerDefinition ) { long epochOffset = sequencerDefinition . getEpoch ( ) . getEpochOffset ( ) ; int maxLogicalNodeCount = sequencerDefinition . getMaxLogicalNodeCount ( ) ; short backupCount = sequencerDefinition . getBackupCount ( ) ; com . hazelcast . client . impl . protocol . ClientMessage request = com . hazelcast . client . impl . protocol . codec . SnowcastAttachLogicalNodeCodec . encodeRequest ( sequencerName , epochOffset , maxLogicalNodeCount , backupCount ) ; com . hazelcast . client . impl . protocol . ClientMessage response = invoke ( sequencerName , request ) ; return com . hazelcast . client . impl . protocol . codec . SnowcastAttachLogicalNodeCodec . decodeResponse ( response ) . response ; } | org . junit . Assert . assertNotNull ( logicalNodeId ) |
testWaitOnEnlistedReceivesFailures ( ) { bitronix . tm . journal . nio . List < bitronix . tm . journal . nio . Future < java . lang . Boolean > > futures = doTestWaitOnEnlistedWithFailure ( ) ; for ( bitronix . tm . journal . nio . Future < java . lang . Boolean > future : futures ) "<AssertPlaceHolder>" ; } get ( ) { return super . get ( ) ; } | org . junit . Assert . assertFalse ( future . get ( ) ) |
testCuboidCounts2 ( ) { org . apache . kylin . cube . model . CubeDesc cube = getTestKylinCubeWithoutSellerLeftJoin ( ) ; org . apache . kylin . cube . cuboid . CuboidScheduler cuboidScheduler = cube . getInitialCuboidScheduler ( ) ; int [ ] counts = org . apache . kylin . cube . cuboid . CuboidCLI . calculateAllLevelCount ( cube ) ; printCount ( counts ) ; int sum = 0 ; for ( java . lang . Integer x : counts ) { sum += x ; } "<AssertPlaceHolder>" ; } getCuboidCount ( ) { return allCuboidIds . size ( ) ; } | org . junit . Assert . assertEquals ( cuboidScheduler . getCuboidCount ( ) , sum ) |
testCreateRowFieldWithNonText ( ) { try { executeString ( ( "CREATE<sp>TABLE<sp>hbase_mapped_table2<sp>(rk1<sp>int4,<sp>rk2<sp>text,<sp>col3<sp>text,<sp>col4<sp>text)<sp>" + ( "TABLESPACE<sp>cluster1<sp>USING<sp>hbase<sp>WITH<sp>('table'='hbase_table',<sp>'columns'='0:key#b,1:key,col3:,col2:b',<sp>" + "'hbase.rowkey.delimiter'='_')" ) ) ) . close ( ) ; org . junit . Assert . fail ( "Key<sp>field<sp>type<sp>should<sp>be<sp>TEXT<sp>type" ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { java . lang . StringBuffer sb = new java . lang . StringBuffer ( ) ; int messageLimit = java . lang . Math . min ( errors . size ( ) , 10 ) ; for ( int i = 0 ; i < messageLimit ; i ++ ) { sb . append ( errors . get ( i ) . getMessage ( ) ) . append ( "\n" ) ; } if ( messageLimit < ( errors . size ( ) ) ) sb . append ( "skipped<sp>....." ) . append ( "\n" ) ; return sb . toString ( ) ; } | org . junit . Assert . assertTrue ( ( ( e . getMessage ( ) . indexOf ( "Key<sp>field<sp>type<sp>should<sp>be<sp>TEXT<sp>type" ) ) >= 0 ) ) |
testWasIOSuccessfulWithRunnableWhenNoErrorsAreRecorded ( ) { final org . codice . ddf . util . function . ThrowingRunnable < java . io . IOException > code = ( ) -> { } ; "<AssertPlaceHolder>" ; } wasIOSuccessful ( org . codice . ddf . util . function . ThrowingRunnable ) { final int nerrs = this . numErrors ; if ( code != null ) { code . run ( ) ; } return ( this . numErrors ) == nerrs ; } | org . junit . Assert . assertThat ( report . wasIOSuccessful ( code ) , org . hamcrest . Matchers . equalTo ( true ) ) |
return_empty_list_iterator_guava ( ) { java . util . Iterator < java . lang . String > strings = com . google . common . collect . Iterators . emptyIterator ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( strings . hasNext ( ) ) |
shouldRejectId ( ) { cluster . setId ( 2 ) ; org . openstack . atlas . api . validation . results . ValidatorResult result = cTest . validate ( cluster , org . openstack . atlas . api . mgmt . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertFalse ( resultMessage ( result , org . openstack . atlas . api . mgmt . validation . validators . POST ) , result . passedValidation ( ) ) |
testCreateEndpointWithArgs2 ( ) { java . lang . String args = "arg1<sp>\"arg2<sp>\"<sp>arg3" ; org . apache . camel . component . exec . ExecEndpoint e = createExecEndpoint ( ( "exec:test?args=" + ( org . apache . camel . util . UnsafeUriCharactersEncoder . encode ( args ) ) ) ) ; "<AssertPlaceHolder>" ; } getArgs ( ) { return args ; } | org . junit . Assert . assertEquals ( args , e . getArgs ( ) ) |
prefersGenreDescriptionOverGenreID ( ) { com . github . marabou . audio . ID3v24Tag id3v24Tag = new com . github . marabou . audio . ID3v24Tag ( ) ; id3v24Tag . setGenre ( 1 ) ; id3v24Tag . setGenreDescription ( "Death<sp>Metal" ) ; final com . github . marabou . audio . Mp3File mp3FileMock = mock ( com . github . marabou . audio . Mp3File . class ) ; when ( mp3FileMock . hasId3v1Tag ( ) ) . thenReturn ( true ) ; when ( mp3FileMock . getId3v1Tag ( ) ) . thenReturn ( id3v24Tag ) ; com . github . marabou . audio . AudioFileFactory audioFileStore = audioFileFactoryWithMp3FileMock ( mp3FileMock ) ; com . github . marabou . audio . AudioFile audioFile = audioFileStore . createAudioFile ( mp3FileMock ) ; "<AssertPlaceHolder>" ; } getGenre ( ) { return genre ; } | org . junit . Assert . assertEquals ( "Death<sp>Metal" , audioFile . getGenre ( ) ) |
testHashCode ( ) { org . jfree . chart . axis . NumberTickUnit t1 = new org . jfree . chart . axis . NumberTickUnit ( 1.23 , new java . text . DecimalFormat ( "0.00" ) ) ; org . jfree . chart . axis . NumberTickUnit t2 = new org . jfree . chart . axis . NumberTickUnit ( 1.23 , new java . text . DecimalFormat ( "0.00" ) ) ; int h1 = t1 . hashCode ( ) ; int h2 = t2 . hashCode ( ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { int result ; result = ( ( this . data ) != null ) ? this . data . hashCode ( ) : 0 ; result = ( 29 * result ) + ( ( this . xPoints ) != null ? this . xPoints . hashCode ( ) : 0 ) ; result = ( 29 * result ) + ( this . propagateEvents ? 1 : 0 ) ; result = ( 29 * result ) + ( this . autoPrune ? 1 : 0 ) ; return result ; } | org . junit . Assert . assertEquals ( h1 , h2 ) |
treatsEmptyPathAsRoot_recognizedCommand ( ) { codec . defineCommand ( "num" , org . openqa . selenium . remote . http . HttpMethod . POST , "/" ) ; byte [ ] data = "{\"char\":\"水\"}" . getBytes ( org . openqa . selenium . remote . http . UTF_8 ) ; org . openqa . selenium . remote . http . HttpRequest request = new org . openqa . selenium . remote . http . HttpRequest ( org . openqa . selenium . remote . http . HttpMethod . POST , "" ) ; request . setHeader ( org . openqa . selenium . remote . http . CONTENT_TYPE , org . openqa . selenium . remote . http . JSON_UTF_8 . withoutParameters ( ) . toString ( ) ) ; request . setHeader ( org . openqa . selenium . remote . http . CONTENT_LENGTH , java . lang . String . valueOf ( data . length ) ) ; request . setContent ( data ) ; org . openqa . selenium . remote . Command command = codec . decode ( request ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertThat ( command . getName ( ) , org . hamcrest . Matchers . is ( "num" ) ) |
testUpdateByteArayField_Null ( ) { byte [ ] salt = new byte [ 64 ] ; com . jmethods . catatumbo . EntityManagerTest . random . nextBytes ( salt ) ; com . jmethods . catatumbo . entities . ByteArrayField entity = new com . jmethods . catatumbo . entities . ByteArrayField ( ) ; entity . setSalt ( salt ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; salt = null ; entity . setSalt ( salt ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . update ( entity ) ; entity = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . ByteArrayField . class , entity . getId ( ) ) ; "<AssertPlaceHolder>" ; } getSalt ( ) { return salt ; } | org . junit . Assert . assertTrue ( ( ( entity . getSalt ( ) ) == null ) ) |
apiAuthenticationExceptionHandler_shouldReturnUnauthorizedIfNotLoggedIn ( ) { org . openmrs . api . context . Context . logout ( ) ; controller . apiAuthenticationExceptionHandler ( new org . openmrs . api . APIAuthenticationException ( ) , request , response ) ; "<AssertPlaceHolder>" ; } apiAuthenticationExceptionHandler ( java . lang . Exception , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse ) { int errorCode ; java . lang . String errorDetail ; if ( org . openmrs . api . context . Context . isAuthenticated ( ) ) { errorCode = javax . servlet . http . HttpServletResponse . SC_FORBIDDEN ; errorDetail = "User<sp>is<sp>logged<sp>in<sp>but<sp>doesn't<sp>have<sp>the<sp>relevant<sp>privilege" ; } else { errorCode = javax . servlet . http . HttpServletResponse . SC_UNAUTHORIZED ; errorDetail = "User<sp>is<sp>not<sp>logged<sp>in" ; if ( shouldAddWWWAuthHeader ( request ) ) { response . addHeader ( "WWW-Authenticate" , ( ( "Basic<sp>realm=\"OpenMRS<sp>at<sp>" + ( org . openmrs . module . webservices . rest . web . RestConstants . URI_PREFIX ) ) + "\"" ) ) ; } } response . setStatus ( errorCode ) ; return org . openmrs . module . webservices . rest . web . RestUtil . wrapErrorResponse ( ex , errorDetail ) ; } | org . junit . Assert . assertThat ( response . getStatus ( ) , org . hamcrest . Matchers . is ( HttpServletResponse . SC_UNAUTHORIZED ) ) |
testRemoveServerProfileSchemaByAppId ( ) { org . kaaproject . kaa . common . dto . ApplicationDto app = generateApplicationDto ( ) ; generateServerProfileSchema ( null , null ) ; generateServerProfileSchema ( null , null ) ; generateServerProfileSchema ( null , null ) ; generateServerProfileSchema ( null , null ) ; generateServerProfileSchema ( app . getId ( ) , app . getTenantId ( ) ) ; generateServerProfileSchema ( app . getId ( ) , app . getTenantId ( ) ) ; generateServerProfileSchema ( app . getId ( ) , app . getTenantId ( ) ) ; generateServerProfileSchema ( app . getId ( ) , app . getTenantId ( ) ) ; serverProfileService . removeServerProfileSchemaByAppId ( app . getId ( ) ) ; java . util . List < org . kaaproject . kaa . common . dto . ServerProfileSchemaDto > found = serverProfileService . findServerProfileSchemasByAppId ( app . getId ( ) ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return rawSchema . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( found . isEmpty ( ) ) |
testReconnectAfterCloseThroughSessionId ( ) { org . nuxeo . ecm . core . api . DocumentModel file = session . createDocumentModel ( "/" , "file" , "File" ) ; file = session . createDocument ( file ) ; session . save ( ) ; session = coreFeature . reopenCoreSession ( ) ; "<AssertPlaceHolder>" ; } getCoreSession ( ) { org . nuxeo . ecm . core . api . CoreSession coreSession ; java . util . Map < java . lang . String , java . io . Serializable > props = getProperties ( ) ; coreSession = ( ( org . nuxeo . ecm . core . api . CoreSession ) ( props . get ( org . nuxeo . ecm . platform . query . nxql . CoreQueryAndFetchPageProvider . CORE_SESSION_PROPERTY ) ) ) ; return coreSession ; } | org . junit . Assert . assertNull ( file . getCoreSession ( ) ) |
testGetBusinessObjectDataAttributeSubPartitionValuesCount4 ( ) { org . finra . herd . model . api . xml . BusinessObjectDataAttributeKey businessObjectDataAttributeKey = new org . finra . herd . model . api . xml . BusinessObjectDataAttributeKey ( BDEF_NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , FORMAT_FILE_TYPE_CODE , FORMAT_VERSION , PARTITION_VALUE , java . util . Arrays . asList ( org . finra . herd . rest . SUBPARTITION_VALUES . get ( 0 ) , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 1 ) , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 2 ) , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 3 ) ) , DATA_VERSION , ATTRIBUTE_NAME_1_MIXED_CASE ) ; org . finra . herd . model . api . xml . BusinessObjectDataAttribute businessObjectDataAttribute = new org . finra . herd . model . api . xml . BusinessObjectDataAttribute ( ID , businessObjectDataAttributeKey , ATTRIBUTE_VALUE_1 ) ; when ( businessObjectDataAttributeService . getBusinessObjectDataAttribute ( businessObjectDataAttributeKey ) ) . thenReturn ( businessObjectDataAttribute ) ; org . finra . herd . model . api . xml . BusinessObjectDataAttribute result = businessObjectDataAttributeRestController . getBusinessObjectDataAttribute ( org . finra . herd . rest . BDEF_NAMESPACE , org . finra . herd . rest . BDEF_NAME , org . finra . herd . rest . FORMAT_USAGE_CODE , org . finra . herd . rest . FORMAT_FILE_TYPE_CODE , org . finra . herd . rest . FORMAT_VERSION , org . finra . herd . rest . PARTITION_VALUE , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 0 ) , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 1 ) , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 2 ) , org . finra . herd . rest . SUBPARTITION_VALUES . get ( 3 ) , org . finra . herd . rest . DATA_VERSION , org . finra . herd . rest . ATTRIBUTE_NAME_1_MIXED_CASE ) ; verify ( businessObjectDataAttributeService ) . getBusinessObjectDataAttribute ( businessObjectDataAttributeKey ) ; verifyNoMoreInteractionsHelper ( ) ; "<AssertPlaceHolder>" ; } verifyNoMoreInteractionsHelper ( ) { verifyNoMoreInteractions ( awsHelper , javaPropertiesHelper , retryPolicyFactory , s3Operations ) ; } | org . junit . Assert . assertEquals ( businessObjectDataAttribute , result ) |
testWrapSingle ( ) { org . onebusaway . nyc . queue . Publisher p = new org . onebusaway . nyc . queue . Publisher ( "topic" ) { java . lang . String generateUUID ( ) { return "foo" ; } long getTimeReceived ( ) { return 1234567 ; } } ; byte [ ] buff = "<sp>" . getBytes ( ) ; java . lang . String envelope = p . wrap ( buff ) ; "<AssertPlaceHolder>" ; } wrap ( java . lang . String ) { return wrap ( realtime , generateUUID ( ) ) ; } | org . junit . Assert . assertEquals ( null , envelope ) |
saveUserVerifierNullVerifierDtoTest ( ) { org . kaaproject . kaa . common . dto . user . UserVerifierDto found = verifierService . saveUserVerifier ( null ) ; "<AssertPlaceHolder>" ; } saveUserVerifier ( org . kaaproject . kaa . common . dto . user . UserVerifierDto ) { org . kaaproject . kaa . server . common . dao . service . UserVerifierServiceImpl . LOG . debug ( "Save<sp>user<sp>verifier<sp>[{}]" , userVerifierDto ) ; org . kaaproject . kaa . common . dto . user . UserVerifierDto saved = null ; if ( userVerifierDto != null ) { if ( isBlank ( userVerifierDto . getId ( ) ) ) { userVerifierDto . setCreatedTime ( java . lang . System . currentTimeMillis ( ) ) ; java . lang . String verifierToken = org . apache . commons . lang . RandomStringUtils . randomNumeric ( Constants . USER_VERIFIER_TOKEN_SIZE ) ; userVerifierDto . setVerifierToken ( verifierToken ) ; } saved = getDto ( userVerifierDao . save ( new org . kaaproject . kaa . server . common . dao . model . sql . UserVerifier ( userVerifierDto ) ) ) ; } return saved ; } | org . junit . Assert . assertNull ( found ) |
testPeriodicalFlush ( ) { org . apache . distributedlog . service . DistributedLogClient client = mock ( org . apache . distributedlog . service . DistributedLogClient . class ) ; org . apache . distributedlog . client . DistributedLogMultiStreamWriter writer = org . apache . distributedlog . client . DistributedLogMultiStreamWriter . newBuilder ( ) . streams ( com . google . common . collect . Lists . newArrayList ( "stream1" , "stream2" ) ) . client ( client ) . compressionCodec ( CompressionCodec . Type . LZ4 ) . firstSpeculativeTimeoutMs ( 10 ) . maxSpeculativeTimeoutMs ( 20 ) . speculativeBackoffMultiplier ( 2 ) . requestTimeoutMs ( 5000000 ) . flushIntervalMs ( 10 ) . bufferSize ( Integer . MAX_VALUE ) . build ( ) ; final org . apache . distributedlog . DLSN dlsn = new org . apache . distributedlog . DLSN ( 99L , 88L , 0L ) ; org . mockito . Mockito . doAnswer ( new org . mockito . stubbing . Answer ( ) { @ org . apache . distributedlog . client . Override public java . lang . Object answer ( org . mockito . invocation . InvocationOnMock invocation ) throws java . lang . Throwable { return com . twitter . util . Future . value ( dlsn ) ; } } ) . when ( client ) . writeRecordSet ( ( ( java . lang . String ) ( any ( ) ) ) , ( ( org . apache . distributedlog . LogRecordSetBuffer ) ( any ( ) ) ) ) ; byte [ ] data = "test-test" . getBytes ( org . apache . distributedlog . client . UTF_8 ) ; java . nio . ByteBuffer buffer = java . nio . ByteBuffer . wrap ( data ) ; com . twitter . util . Future < org . apache . distributedlog . DLSN > writeFuture = writer . write ( buffer ) ; org . apache . distributedlog . DLSN writeDLSN = com . twitter . util . Await . result ( writeFuture ) ; "<AssertPlaceHolder>" ; writer . close ( ) ; } result ( com . twitter . util . Future ) { return org . apache . distributedlog . util . FutureUtils . result ( result , com . twitter . util . Duration . Top ( ) ) ; } | org . junit . Assert . assertEquals ( dlsn , writeDLSN ) |
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . kernel . model . UserNotificationDelivery . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "userNotificationDeliveryId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "userNotificationDeliveryId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
givenHasTransactionId_thenIgnored ( ) { final java . lang . reflect . Method actionMethod = findMethod ( org . apache . isis . core . metamodel . facets . actions . action . ActionAnnotationFacetFactoryTest . SomeTransactionalId . class , "someAction" ) ; facetFactory . processCommand ( new org . apache . isis . core . metamodel . facets . FacetFactory . ProcessMethodContext ( org . apache . isis . core . metamodel . facets . actions . action . ActionAnnotationFacetFactoryTest . SomeTransactionalId . class , null , null , actionMethod , mockMethodRemover , facetedMethod ) ) ; final org . apache . isis . core . metamodel . facetapi . Facet facet = facetedMethod . getFacet ( org . apache . isis . core . metamodel . facets . actions . command . CommandFacet . class ) ; "<AssertPlaceHolder>" ; } getFacet ( java . lang . Class ) { final org . apache . isis . core . metamodel . facetapi . FacetHolder facetHolder = getAction ( ) ; return facetHolder . getFacet ( facetType ) ; } | org . junit . Assert . assertNull ( facet ) |
testCreateManualSampler ( ) { System . out . println ( "createManualSampler" ) ; java . lang . String name = "gentest" ; org . netbeans . modules . sampler . Sampler result = org . netbeans . modules . sampler . Sampler . createManualSampler ( name ) ; "<AssertPlaceHolder>" ; } createManualSampler ( java . lang . String ) { if ( org . netbeans . modules . sampler . SamplesOutputStream . isSupported ( ) ) { return new org . netbeans . modules . sampler . InternalSampler ( name ) ; } return null ; } | org . junit . Assert . assertNotNull ( result ) |
testCookieMatch3 ( ) { org . apache . ogt . http . cookie . CookieSpec cookiespec = new org . apache . ogt . http . impl . cookie . BrowserCompatSpec ( ) ; org . apache . ogt . http . impl . cookie . BasicClientCookie cookie = new org . apache . ogt . http . impl . cookie . BasicClientCookie ( "name" , "value" ) ; cookie . setDomain ( ".whatever.com" ) ; cookie . setPath ( "/" ) ; org . apache . ogt . http . cookie . CookieOrigin origin = new org . apache . ogt . http . cookie . CookieOrigin ( ".really.whatever.com" , 80 , "/" , false ) ; "<AssertPlaceHolder>" ; } match ( java . security . cert . X509Certificate , java . lang . String ) { if ( ( ( certificate == null ) || ( thisDomain == null ) ) || ( ( thisDomain . length ( ) ) == 0 ) ) { return false ; } thisDomain = thisDomain . toLowerCase ( Locale . US ) ; if ( ! ( com . fsck . k9 . helper . DomainNameChecker . isIpAddress ( thisDomain ) ) ) { return com . fsck . k9 . helper . DomainNameChecker . matchDns ( certificate , thisDomain ) ; } else { return com . fsck . k9 . helper . DomainNameChecker . matchIpAddress ( certificate , thisDomain ) ; } } | org . junit . Assert . assertTrue ( cookiespec . match ( cookie , origin ) ) |
testGetErrorType ( ) { org . jinstagram . entity . common . Meta fixture = new org . jinstagram . entity . common . Meta ( ) ; fixture . setErrorType ( "" ) ; fixture . setCode ( 1 ) ; fixture . setErrorMessage ( "" ) ; java . lang . String result = fixture . getErrorType ( ) ; "<AssertPlaceHolder>" ; } getErrorType ( ) { return errorType ; } | org . junit . Assert . assertEquals ( "" , result ) |
testExecuteFailByValidate ( ) { com . ctrip . platform . dal . dao . task . DalRequestExecutor test = new com . ctrip . platform . dal . dao . task . DalRequestExecutor ( ) ; java . sql . SQLException ex = new java . sql . SQLException ( "Test" ) ; com . ctrip . platform . dal . dao . task . DalRequestExecutorTest . TestDalRequest request = new com . ctrip . platform . dal . dao . task . DalRequestExecutorTest . TestDalRequest ( ex , null ) ; com . ctrip . platform . dal . dao . DalHints hints = new com . ctrip . platform . dal . dao . DalHints ( ) ; try { test . execute ( hints , request ) ; org . junit . Assert . fail ( ) ; } catch ( java . sql . SQLException e ) { "<AssertPlaceHolder>" ; } } execute ( java . util . concurrent . Callable , com . ctrip . platform . dal . dao . client . LogEntry ) { java . lang . Throwable error = null ; logger . startStatement ( entry ) ; try { return statementTask . call ( ) ; } catch ( java . lang . Throwable e ) { error = e ; throw e ; } finally { logger . endStatement ( entry , error ) ; } } | org . junit . Assert . assertEquals ( ex , e ) |
testMatchesWithParameters ( ) { org . ocpsoft . rewrite . servlet . config . Path path = org . ocpsoft . rewrite . servlet . config . Path . matches ( "/application/{seg}" ) ; org . ocpsoft . rewrite . mock . MockEvaluationContext context = new org . ocpsoft . rewrite . mock . MockEvaluationContext ( ) ; org . ocpsoft . rewrite . util . ParameterUtils . initialize ( context , path ) ; "<AssertPlaceHolder>" ; } evaluate ( org . ocpsoft . rewrite . event . Rewrite , org . ocpsoft . rewrite . context . EvaluationContext ) { if ( ( zone ) != null ) return condition . matches ( new org . joda . time . DateTime ( zone ) ) ; else return condition . matches ( new org . joda . time . DateTime ( ) ) ; } | org . junit . Assert . assertTrue ( path . evaluate ( rewrite , context ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.